--- BasiliskII/src/adb.cpp 2001/07/09 11:21:59 1.7 +++ BasiliskII/src/adb.cpp 2004/01/10 08:54:14 1.11 @@ -1,7 +1,7 @@ /* * adb.cpp - ADB emulation (mouse/keyboard) * - * Basilisk II (C) 1997-2001 Christian Bauer + * Basilisk II (C) 1997-2002 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,8 +28,9 @@ #include "sysdeps.h" #include "cpu_emulation.h" -#include "main.h" #include "emul_op.h" +#include "main.h" +#include "prefs.h" #include "video.h" #include "adb.h" @@ -57,6 +58,8 @@ static uint8 mouse_reg_3[2] = {0x63, 0x0 static uint8 key_reg_2[2] = {0xff, 0xff}; // Keyboard ADB register 2 static uint8 key_reg_3[2] = {0x62, 0x05}; // Keyboard ADB register 3 +static uint8 m_keyboard_type = 0x05; + // ADB mouse motion lock (for platforms that use separate input thread) static B2_mutex *mouse_lock; @@ -68,6 +71,8 @@ static B2_mutex *mouse_lock; void ADBInit(void) { mouse_lock = B2_create_mutex(); + m_keyboard_type = (uint8)PrefsFindInt32("keyboardtype"); + key_reg_3[1] = m_keyboard_type; } @@ -99,7 +104,7 @@ void ADBOp(uint8 op, uint8 *data) key_reg_2[0] = 0xff; key_reg_2[1] = 0xff; key_reg_3[0] = 0x62; - key_reg_3[1] = 0x05; + key_reg_3[1] = m_keyboard_type; return; } @@ -373,12 +378,12 @@ void ADBInterrupt(void) if (mx != old_mouse_x || my != old_mouse_y) { #ifdef POWERPC_ROM static const uint16 proc[] = { - 0x2f08, // move.l a0,-(sp) - 0x2f00, // move.l d0,-(sp) - 0x2f01, // move.l d1,-(sp) - 0x7001, // moveq #1,d0 (MoveTo) - 0xaadb, // CursorDeviceDispatch - M68K_RTS + PW(0x2f08), // move.l a0,-(sp) + PW(0x2f00), // move.l d0,-(sp) + PW(0x2f01), // move.l d1,-(sp) + PW(0x7001), // moveq #1,d0 (MoveTo) + PW(0xaadb), // CursorDeviceDispatch + PW(M68K_RTS) }; r.a[0] = ReadMacInt32(mouse_base + 4); r.d[0] = mx;