diff --git a/BasiliskII/README b/BasiliskII/README index 890ba53b..e72b5c6f 100644 --- a/BasiliskII/README +++ b/BasiliskII/README @@ -524,6 +524,14 @@ nogui <"true" or "false"> error alerts. All errors will then be reported to stdout. The default is "false". +keyboardtype + + Specifies the keyboard type that BasiliskII should report to the MacOS. + The default is "5" which is a "Apple Extended Keyboard II (ISO)", + but many other numbers are understood by most versions of the MacOS + (e.g. 11 is a "Macintosh Plus Keyboard with keypad", + 13 is a "Apple PowerBook Keyboard (ISO)" ) + For additional information, consult the source. diff --git a/BasiliskII/src/adb.cpp b/BasiliskII/src/adb.cpp index 788d78f9..fbd4921b 100644 --- a/BasiliskII/src/adb.cpp +++ b/BasiliskII/src/adb.cpp @@ -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, 0x01}; // Mouse ADB register 3 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; } diff --git a/BasiliskII/src/prefs_items.cpp b/BasiliskII/src/prefs_items.cpp index ece973ec..00eafb0b 100644 --- a/BasiliskII/src/prefs_items.cpp +++ b/BasiliskII/src/prefs_items.cpp @@ -62,6 +62,7 @@ prefs_desc common_prefs_items[] = { {"jitdebug", TYPE_BOOLEAN, false, "enable JIT debugger (requires mon builtin)"}, {"jitcachesize", TYPE_INT32, false, "translation cache size in KB"}, {"jitlazyflush", TYPE_BOOLEAN, false, "enable lazy invalidation of translation cache"}, + {"keyboardtype", TYPE_INT32, false, "hardware keyboard type"}, {NULL, TYPE_END, false, NULL} // End of list }; @@ -97,4 +98,6 @@ void AddPrefsDefaults(void) #else PrefsAddBool("jit", false); #endif + + PrefsAddInt32("keyboardtype", 5); }