57 |
|
static uint8 key_reg_2[2] = {0xff, 0xff}; // Keyboard ADB register 2 |
58 |
|
static uint8 key_reg_3[2] = {0x62, 0x05}; // Keyboard ADB register 3 |
59 |
|
|
60 |
< |
// ADB mouse input state lock (for platforms that use separate input thread) |
60 |
> |
// ADB mouse motion lock (for platforms that use separate input thread) |
61 |
|
static B2_mutex *mouse_lock; |
62 |
|
|
63 |
|
|
231 |
|
mouse_x = x; mouse_y = y; |
232 |
|
} |
233 |
|
B2_unlock_mutex(mouse_lock); |
234 |
+ |
SetInterruptFlag(INTFLAG_ADB); |
235 |
+ |
TriggerInterrupt(); |
236 |
|
} |
237 |
|
|
238 |
|
|
242 |
|
|
243 |
|
void ADBMouseDown(int button) |
244 |
|
{ |
243 |
– |
B2_lock_mutex(mouse_lock); |
245 |
|
mouse_button[button] = true; |
246 |
< |
B2_unlock_mutex(mouse_lock); |
246 |
> |
SetInterruptFlag(INTFLAG_ADB); |
247 |
> |
TriggerInterrupt(); |
248 |
|
} |
249 |
|
|
250 |
|
|
251 |
|
/* |
252 |
< |
* First mouse button released |
252 |
> |
* Mouse button released |
253 |
|
*/ |
254 |
|
|
255 |
|
void ADBMouseUp(int button) |
256 |
|
{ |
255 |
– |
B2_lock_mutex(mouse_lock); |
257 |
|
mouse_button[button] = false; |
258 |
< |
B2_unlock_mutex(mouse_lock); |
258 |
> |
SetInterruptFlag(INTFLAG_ADB); |
259 |
> |
TriggerInterrupt(); |
260 |
|
} |
261 |
|
|
262 |
|
|
266 |
|
|
267 |
|
void ADBSetRelMouseMode(bool relative) |
268 |
|
{ |
269 |
< |
relative_mouse = relative; |
269 |
> |
if (relative_mouse != relative) { |
270 |
> |
relative_mouse = relative; |
271 |
> |
mouse_x = mouse_y = 0; |
272 |
> |
} |
273 |
|
} |
274 |
|
|
275 |
|
|
285 |
|
|
286 |
|
// Set key in matrix |
287 |
|
key_states[code >> 3] |= (1 << (~code & 7)); |
288 |
+ |
|
289 |
+ |
// Trigger interrupt |
290 |
+ |
SetInterruptFlag(INTFLAG_ADB); |
291 |
+ |
TriggerInterrupt(); |
292 |
|
} |
293 |
|
|
294 |
|
|
304 |
|
|
305 |
|
// Clear key in matrix |
306 |
|
key_states[code >> 3] &= ~(1 << (~code & 7)); |
307 |
+ |
|
308 |
+ |
// Trigger interrupt |
309 |
+ |
SetInterruptFlag(INTFLAG_ADB); |
310 |
+ |
TriggerInterrupt(); |
311 |
|
} |
312 |
|
|
313 |
|
|