diff --git a/src/system/boot/platform/atari_m68k/keyboard.cpp b/src/system/boot/platform/atari_m68k/keyboard.cpp index cf28868683..02db76ee21 100644 --- a/src/system/boot/platform/atari_m68k/keyboard.cpp +++ b/src/system/boot/platform/atari_m68k/keyboard.cpp @@ -10,26 +10,15 @@ #include -static uint16 +static uint32 check_for_key(void) { -//XXX: non blocking in ? -#if 0 - bios_regs regs; - regs.eax = 0x0100; - call_bios(0x16, ®s); - - // the zero flag is set when there is no key stroke waiting for us - if (regs.flags & ZERO_FLAG) + union key k; + if (Bconstat(DEV_CON) == 0) return 0; - // remove the key from the buffer - regs.eax = 0; - call_bios(0x16, ®s); - - return regs.eax & 0xffff; -#endif - return 0; + k.d0 = Bconin(DEV_CON); + return k.d0; } @@ -45,7 +34,7 @@ extern "C" union key wait_for_key(void) { union key key; - key.d0 = Bconin(2); + key.d0 = Bconin(DEV_CON); return key; } @@ -57,7 +46,7 @@ check_for_boot_keys(void) union key key; uint32 options = 0; - while ((key.ax = check_for_key()) != 0) { + while ((key.d0 = check_for_key()) != 0) { switch (key.code.ascii) { case ' ': options |= BOOT_OPTION_MENU; diff --git a/src/system/boot/platform/atari_m68k/keyboard.h b/src/system/boot/platform/atari_m68k/keyboard.h index dec5f19e05..306a80c04c 100644 --- a/src/system/boot/platform/atari_m68k/keyboard.h +++ b/src/system/boot/platform/atari_m68k/keyboard.h @@ -8,8 +8,10 @@ union key { uint32 d0; struct { - uint16 bios; // scan code - uint16 ascii; + uint8 modifiers; // not always present! + uint8 bios; // scan code + uint8 dummy; + uint8 ascii; } code; }; diff --git a/src/system/boot/platform/atari_m68k/toscalls.h b/src/system/boot/platform/atari_m68k/toscalls.h index e5b1062b90..776ffbc6c1 100644 --- a/src/system/boot/platform/atari_m68k/toscalls.h +++ b/src/system/boot/platform/atari_m68k/toscalls.h @@ -16,6 +16,7 @@ extern "C" { #define DEV_PRINTER 0 #define DEV_AUX 1 #define DEV_CON 2 +#define DEV_CONSOLE 2 #define DEV_MIDI 3 #define DEV_IKBD 4 #define DEV_RAW 5