Added new keyboardtype preference (stolen from the Windows port)

This commit is contained in:
nigel 2003-08-16 03:28:58 +00:00
parent ddb433382d
commit 35fcf4d98c
3 changed files with 18 additions and 2 deletions

View File

@ -524,6 +524,14 @@ nogui <"true" or "false">
error alerts. All errors will then be reported to stdout. The default
is "false".
keyboardtype <keyboard-id>
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.

View File

@ -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;
}

View File

@ -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);
}