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.9 by gbeauche, 2003-05-13T12:34:09Z vs.
Revision 1.13 by gbeauche, 2004-11-13T14:28:49Z

# Line 1 | Line 1
1   /*
2   *  adb.cpp - ADB emulation (mouse/keyboard)
3   *
4 < *  Basilisk II (C) 1997-2002 Christian Bauer
4 > *  Basilisk II (C) 1997-2004 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 28 | Line 28
28  
29   #include "sysdeps.h"
30   #include "cpu_emulation.h"
31 #include "main.h"
31   #include "emul_op.h"
32 + #include "main.h"
33 + #include "prefs.h"
34   #include "video.h"
35   #include "adb.h"
36  
# Line 57 | Line 58 | static uint8 mouse_reg_3[2] = {0x63, 0x0
58   static uint8 key_reg_2[2] = {0xff, 0xff};       // Keyboard ADB register 2
59   static uint8 key_reg_3[2] = {0x62, 0x05};       // Keyboard ADB register 3
60  
61 + static uint8 m_keyboard_type = 0x05;
62 +
63   // ADB mouse motion lock (for platforms that use separate input thread)
64   static B2_mutex *mouse_lock;
65  
# Line 68 | Line 71 | static B2_mutex *mouse_lock;
71   void ADBInit(void)
72   {
73          mouse_lock = B2_create_mutex();
74 +        m_keyboard_type = (uint8)PrefsFindInt32("keyboardtype");
75 +        key_reg_3[1] = m_keyboard_type;
76   }
77  
78  
# Line 99 | Line 104 | void ADBOp(uint8 op, uint8 *data)
104                  key_reg_2[0] = 0xff;
105                  key_reg_2[1] = 0xff;
106                  key_reg_3[0] = 0x62;
107 <                key_reg_3[1] = 0x05;
107 >                key_reg_3[1] = m_keyboard_type;
108                  return;
109          }
110  
# Line 372 | Line 377 | void ADBInterrupt(void)
377                  // Update mouse position (absolute)
378                  if (mx != old_mouse_x || my != old_mouse_y) {
379   #ifdef POWERPC_ROM
380 <                        static const uint8 proc[] = {
381 <                                0x2f, 0x08,             // move.l a0,-(sp)
382 <                                0x2f, 0x00,             // move.l d0,-(sp)
383 <                                0x2f, 0x01,             // move.l d1,-(sp)
384 <                                0x70, 0x01,             // moveq #1,d0 (MoveTo)
385 <                                0xaa, 0xdb,             // CursorDeviceDispatch
386 <                                M68K_RTS >> 8, M68K_RTS & 0xff
380 >                        static const uint16 proc[] = {
381 >                                PW(0x2f08),             // move.l a0,-(sp)
382 >                                PW(0x2f00),             // move.l d0,-(sp)
383 >                                PW(0x2f01),             // move.l d1,-(sp)
384 >                                PW(0x7001),             // moveq #1,d0 (MoveTo)
385 >                                PW(0xaadb),             // CursorDeviceDispatch
386 >                                PW(M68K_RTS)
387                          };
388                          r.a[0] = ReadMacInt32(mouse_base + 4);
389                          r.d[0] = mx;
390                          r.d[1] = my;
391 <                        Execute68k((uint32)proc, &r);
391 >                        Execute68k(Host2MacAddr((uint8 *)proc), &r);
392   #else
393                          WriteMacInt16(0x82a, mx);
394                          WriteMacInt16(0x828, my);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines