ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/adb.cpp
(Generate patch)

Comparing BasiliskII/src/adb.cpp (file contents):
Revision 1.6 by cebix, 2001-07-03T15:59:45Z vs.
Revision 1.7 by cebix, 2001-07-09T11:21:59Z

# Line 57 | Line 57 | static uint8 mouse_reg_3[2] = {0x63, 0x0
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  
# Line 231 | Line 231 | void ADBMouseMoved(int x, int y)
231                  mouse_x = x; mouse_y = y;
232          }
233          B2_unlock_mutex(mouse_lock);
234 +        SetInterruptFlag(INTFLAG_ADB);
235 +        TriggerInterrupt();
236   }
237  
238  
# Line 240 | Line 242 | void ADBMouseMoved(int x, int y)
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  
# Line 264 | Line 266 | void ADBMouseUp(int button)
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  
# Line 280 | Line 285 | void ADBKeyDown(int code)
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  
# Line 295 | Line 304 | void ADBKeyUp(int code)
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines