diff --git a/src/gcc_check.sh b/src/gcc_check.sh
deleted file mode 100644
index cd6e1b509..000000000
--- a/src/gcc_check.sh
+++ /dev/null
@@ -1 +0,0 @@
-gcc $1 -Wall -Wclobbered -Wbad-function-cast -Wempty-body -Wignored-qualifiers -Wmissing-field-initializers -Wmissing-parameter-type -Wold-style-declaration -Woverride-init -Wsign-compare -Wtype-limits -Wuninitialized -Wunknown-pragmas -pedantic -Werror -Wshadow
diff --git a/src/gcc_check_ioctl.sh b/src/gcc_check_ioctl.sh
deleted file mode 100644
index 934f0873f..000000000
--- a/src/gcc_check_ioctl.sh
+++ /dev/null
@@ -1 +0,0 @@
-gcc $1 -Wall -Wclobbered -Wbad-function-cast -Wempty-body -Wignored-qualifiers -Wmissing-field-initializers -Wmissing-parameter-type -Wold-style-declaration -Woverride-init -Wsign-compare -Wtype-limits -Wuninitialized -Wunknown-pragmas -pedantic -Werror -Wshadow -DUSE_IOCTL
diff --git a/src/keyboard_at.c.bak b/src/keyboard_at.c.bak
deleted file mode 100644
index 391f725be..000000000
--- a/src/keyboard_at.c.bak
+++ /dev/null
@@ -1,2144 +0,0 @@
-/*
- * 86Box A hypervisor and IBM PC system emulator that specializes in
- * running old operating systems and software designed for IBM
- * PC systems and compatibles from 1981 through fairly recent
- * system designs based on the PCI bus.
- *
- * This file is part of the 86Box distribution.
- *
- * Intel 8042 (AT keyboard controller) emulation.
- *
- * Version: @(#)keyboard_at.c 1.0.37 2018/05/25
- *
- * Authors: Sarah Walker,
- * Miran Grca,
- * Fred N. van Kempen,
- *
- * Copyright 2008-2018 Sarah Walker.
- * Copyright 2016-2018 Miran Grca.
- * Copyright 2017,2018 Fred N. van Kempen.
- */
-#include
-#include
-#include
-#include
-#include
-#define HAVE_STDARG_H
-#include
-#include "86box.h"
-#include "cpu/cpu.h"
-#include "io.h"
-#include "pic.h"
-#include "pit.h"
-#include "ppi.h"
-#include "mem.h"
-#include "rom.h"
-#include "device.h"
-#include "timer.h"
-#include "machine/machine.h"
-#include "machine/m_xt_xi8088.h"
-#include "machine/m_at_t3100e.h"
-#include "floppy/fdd.h"
-#include "floppy/fdc.h"
-#include "sound/sound.h"
-#include "sound/snd_speaker.h"
-#include "video/video.h"
-#include "keyboard.h"
-#include "mouse.h"
-
-
-#define STAT_PARITY 0x80
-#define STAT_RTIMEOUT 0x40
-#define STAT_TTIMEOUT 0x20
-#define STAT_MFULL 0x20
-#define STAT_LOCK 0x10
-#define STAT_CD 0x08
-#define STAT_SYSFLAG 0x04
-#define STAT_IFULL 0x02
-#define STAT_OFULL 0x01
-
-#define PS2_REFRESH_TIME (16LL * TIMER_USEC)
-
-#define CCB_UNUSED 0x80
-#define CCB_TRANSLATE 0x40
-#define CCB_PCMODE 0x20
-#define CCB_ENABLEKBD 0x10
-#define CCB_IGNORELOCK 0x08
-#define CCB_SYSTEM 0x04
-#define CCB_ENABLEMINT 0x02
-#define CCB_ENABLEKINT 0x01
-
-#define CCB_MASK 0x68
-#define MODE_MASK 0x6C
-
-#define KBC_TYPE_ISA 0x00
-#define KBC_TYPE_PS2_1 0x01
-#define KBC_TYPE_PS2_2 0x02
-#define KBC_TYPE_MASK 0x03
-
-#define KBC_VEN_GENERIC 0x00
-#define KBC_VEN_AMI 0x04
-#define KBC_VEN_IBM_MCA 0x08
-#define KBC_VEN_QUADTEL 0x0C
-#define KBC_VEN_TOSHIBA 0x10
-#define KBC_VEN_MASK 0x1C
-
-typedef struct {
- int initialized;
- int want60,
- wantirq,
- wantirq12;
- uint8_t command;
- uint8_t status;
- uint8_t mem[0x100];
- uint8_t out;
- int out_new, out_delayed;
- uint8_t secr_phase;
- uint8_t mem_addr;
-
- uint8_t input_port,
- output_port;
-
- uint8_t old_output_port;
-
- uint8_t key_command;
- int key_wantdata;
-
- int last_irq;
-
- uint8_t last_scan_code;
-
- int dtrans;
- int first_write;
-
- int64_t refresh_time;
- int refresh;
-
- uint32_t flags;
- uint8_t output_locked;
-
- int64_t pulse_cb;
- uint8_t ami_stat;
-
- uint8_t (*write60_ven)(void *p, uint8_t val);
- uint8_t (*write64_ven)(void *p, uint8_t val);
-
- int64_t timeout;
-} atkbd_t;
-
-
-/* bit 0 = repeat, bit 1 = makes break code? */
-uint8_t keyboard_set3_flags[512];
-uint8_t keyboard_set3_all_repeat;
-uint8_t keyboard_set3_all_break;
-
-/* Bits 0 - 1 = scan code set, bit 6 = translate or not. */
-uint8_t keyboard_mode = 0x42;
-
-#ifdef ENABLE_KEYBOARD_AT_LOG
-int keyboard_at_do_log = ENABLE_KEYBOARD_AT_LOG;
-#endif
-
-int mouse_queue_start = 0,
- mouse_queue_end = 0;
-
-
-static uint8_t key_ctrl_queue[16];
-static int key_ctrl_queue_start = 0,
- key_ctrl_queue_end = 0;
-static uint8_t key_queue[16];
-static int key_queue_start = 0,
- key_queue_end = 0;
-static uint8_t mouse_queue[16];
-static void (*mouse_write)(uint8_t val, void *priv) = NULL;
-static void *mouse_p = NULL;
-static uint8_t sc_or = 0;
-static atkbd_t *CurrentKbd = NULL; // FIXME: remove!!! --FvK
-
-
-/* Non-translated to translated scan codes. */
-static const uint8_t nont_to_t[256] = {
- 0xFF, 0x43, 0x41, 0x3F, 0x3D, 0x3B, 0x3C, 0x58,
- 0x64, 0x44, 0x42, 0x40, 0x3E, 0x0F, 0x29, 0x59,
- 0x65, 0x38, 0x2A, 0x70, 0x1D, 0x10, 0x02, 0x5A,
- 0x66, 0x71, 0x2C, 0x1F, 0x1E, 0x11, 0x03, 0x5B,
- 0x67, 0x2E, 0x2D, 0x20, 0x12, 0x05, 0x04, 0x5C,
- 0x68, 0x39, 0x2F, 0x21, 0x14, 0x13, 0x06, 0x5D,
- 0x69, 0x31, 0x30, 0x23, 0x22, 0x15, 0x07, 0x5E,
- 0x6A, 0x72, 0x32, 0x24, 0x16, 0x08, 0x09, 0x5F,
- 0x6B, 0x33, 0x25, 0x17, 0x18, 0x0B, 0x0A, 0x60,
- 0x6C, 0x34, 0x35, 0x26, 0x27, 0x19, 0x0C, 0x61,
- 0x6D, 0x73, 0x28, 0x74, 0x1A, 0x0D, 0x62, 0x6E,
- 0x3A, 0x36, 0x1C, 0x1B, 0x75, 0x2B, 0x63, 0x76,
- 0x55, 0x56, 0x77, 0x78, 0x79, 0x7A, 0x0E, 0x7B,
- 0x7C, 0x4F, 0x7D, 0x4B, 0x47, 0x7E, 0x7F, 0x6F,
- 0x52, 0x53, 0x50, 0x4C, 0x4D, 0x48, 0x01, 0x45,
- 0x57, 0x4E, 0x51, 0x4A, 0x37, 0x49, 0x46, 0x54,
- 0x80, 0x81, 0x82, 0x41, 0x54, 0x85, 0x86, 0x87,
- 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
- 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,
- 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
- 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
- 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7,
- 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
- 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
- 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
- 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
- 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
- 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
- 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
- 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
- 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF
-};
-
-static const scancode scancode_set1[512] = {
- { { -1},{ -1} }, { { 0x01,-1},{ 0x81,-1} }, { { 0x02,-1},{ 0x82,-1} }, { { 0x03,-1},{ 0x83,-1} }, /*000*/
- { { 0x04,-1},{ 0x84,-1} }, { { 0x05,-1},{ 0x85,-1} }, { { 0x06,-1},{ 0x86,-1} }, { { 0x07,-1},{ 0x87,-1} }, /*004*/
- { { 0x08,-1},{ 0x88,-1} }, { { 0x09,-1},{ 0x89,-1} }, { { 0x0a,-1},{ 0x8a,-1} }, { { 0x0b,-1},{ 0x8b,-1} }, /*008*/
- { { 0x0c,-1},{ 0x8c,-1} }, { { 0x0d,-1},{ 0x8d,-1} }, { { 0x0e,-1},{ 0x8e,-1} }, { { 0x0f,-1},{ 0x8f,-1} }, /*00c*/
- { { 0x10,-1},{ 0x90,-1} }, { { 0x11,-1},{ 0x91,-1} }, { { 0x12,-1},{ 0x92,-1} }, { { 0x13,-1},{ 0x93,-1} }, /*010*/
- { { 0x14,-1},{ 0x94,-1} }, { { 0x15,-1},{ 0x95,-1} }, { { 0x16,-1},{ 0x96,-1} }, { { 0x17,-1},{ 0x97,-1} }, /*014*/
- { { 0x18,-1},{ 0x98,-1} }, { { 0x19,-1},{ 0x99,-1} }, { { 0x1a,-1},{ 0x9a,-1} }, { { 0x1b,-1},{ 0x9b,-1} }, /*018*/
- { { 0x1c,-1},{ 0x9c,-1} }, { { 0x1d,-1},{ 0x9d,-1} }, { { 0x1e,-1},{ 0x9e,-1} }, { { 0x1f,-1},{ 0x9f,-1} }, /*01c*/
- { { 0x20,-1},{ 0xa0,-1} }, { { 0x21,-1},{ 0xa1,-1} }, { { 0x22,-1},{ 0xa2,-1} }, { { 0x23,-1},{ 0xa3,-1} }, /*020*/
- { { 0x24,-1},{ 0xa4,-1} }, { { 0x25,-1},{ 0xa5,-1} }, { { 0x26,-1},{ 0xa6,-1} }, { { 0x27,-1},{ 0xa7,-1} }, /*024*/
- { { 0x28,-1},{ 0xa8,-1} }, { { 0x29,-1},{ 0xa9,-1} }, { { 0x2a,-1},{ 0xaa,-1} }, { { 0x2b,-1},{ 0xab,-1} }, /*028*/
- { { 0x2c,-1},{ 0xac,-1} }, { { 0x2d,-1},{ 0xad,-1} }, { { 0x2e,-1},{ 0xae,-1} }, { { 0x2f,-1},{ 0xaf,-1} }, /*02c*/
- { { 0x30,-1},{ 0xb0,-1} }, { { 0x31,-1},{ 0xb1,-1} }, { { 0x32,-1},{ 0xb2,-1} }, { { 0x33,-1},{ 0xb3,-1} }, /*030*/
- { { 0x34,-1},{ 0xb4,-1} }, { { 0x35,-1},{ 0xb5,-1} }, { { 0x36,-1},{ 0xb6,-1} }, { { 0x37,-1},{ 0xb7,-1} }, /*034*/
- { { 0x38,-1},{ 0xb8,-1} }, { { 0x39,-1},{ 0xb9,-1} }, { { 0x3a,-1},{ 0xba,-1} }, { { 0x3b,-1},{ 0xbb,-1} }, /*038*/
- { { 0x3c,-1},{ 0xbc,-1} }, { { 0x3d,-1},{ 0xbd,-1} }, { { 0x3e,-1},{ 0xbe,-1} }, { { 0x3f,-1},{ 0xbf,-1} }, /*03c*/
- { { 0x40,-1},{ 0xc0,-1} }, { { 0x41,-1},{ 0xc1,-1} }, { { 0x42,-1},{ 0xc2,-1} }, { { 0x43,-1},{ 0xc3,-1} }, /*040*/
- { { 0x44,-1},{ 0xc4,-1} }, { { 0x45,-1},{ 0xc5,-1} }, { { 0x46,-1},{ 0xc6,-1} }, { { 0x47,-1},{ 0xc7,-1} }, /*044*/
- { { 0x48,-1},{ 0xc8,-1} }, { { 0x49,-1},{ 0xc9,-1} }, { { 0x4a,-1},{ 0xca,-1} }, { { 0x4b,-1},{ 0xcb,-1} }, /*048*/
- { { 0x4c,-1},{ 0xcc,-1} }, { { 0x4d,-1},{ 0xcd,-1} }, { { 0x4e,-1},{ 0xce,-1} }, { { 0x4f,-1},{ 0xcf,-1} }, /*04c*/
- { { 0x50,-1},{ 0xd0,-1} }, { { 0x51,-1},{ 0xd1,-1} }, { { 0x52,-1},{ 0xd2,-1} }, { { 0x53,-1},{ 0xd3,-1} }, /*050*/
- { { 0x54,-1},{ 0xd4,-1} }, { { 0x55,-1},{ 0xd5,-1} }, { { 0x56,-1},{ 0xd6,-1} }, { { 0x57,-1},{ 0xd7,-1} }, /*054*/
- { { 0x58,-1},{ 0xd8,-1} }, { { 0x59,-1},{ 0xd9,-1} }, { { 0x5a,-1},{ 0xda,-1} }, { { 0x5b,-1},{ 0xdb,-1} }, /*058*/
- { { 0x5c,-1},{ 0xdc,-1} }, { { 0x5d,-1},{ 0xdd,-1} }, { { 0x5e,-1},{ 0xde,-1} }, { { 0x5f,-1},{ 0xdf,-1} }, /*05c*/
- { { 0x60,-1},{ 0xe0,-1} }, { { 0x61,-1},{ 0xe1,-1} }, { { 0x62,-1},{ 0xe2,-1} }, { { 0x63,-1},{ 0xe3,-1} }, /*060*/
- { { 0x64,-1},{ 0xe4,-1} }, { { 0x65,-1},{ 0xe5,-1} }, { { 0x66,-1},{ 0xe6,-1} }, { { 0x67,-1},{ 0xe7,-1} }, /*064*/
- { { 0x68,-1},{ 0xe8,-1} }, { { 0x69,-1},{ 0xe9,-1} }, { { 0x6a,-1},{ 0xea,-1} }, { { 0x6b,-1},{ 0xeb,-1} }, /*068*/
- { { 0x6c,-1},{ 0xec,-1} }, { { 0x6d,-1},{ 0xed,-1} }, { { 0x6e,-1},{ 0xee,-1} }, { { 0x6f,-1},{ 0xef,-1} }, /*06c*/
- { { 0x70,-1},{ 0xf0,-1} }, { { 0x71,-1},{ 0xf1,-1} }, { { 0x72,-1},{ 0xf2,-1} }, { { 0x73,-1},{ 0xf3,-1} }, /*070*/
- { { 0x74,-1},{ 0xf4,-1} }, { { 0x75,-1},{ 0xf5,-1} }, { { 0x76,-1},{ 0xf6,-1} }, { { 0x77,-1},{ 0xf7,-1} }, /*074*/
- { { 0x78,-1},{ 0xf8,-1} }, { { 0x79,-1},{ 0xf9,-1} }, { { 0x7a,-1},{ 0xfa,-1} }, { { 0x7b,-1},{ 0xfb,-1} }, /*078*/
- { { 0x7c,-1},{ 0xfc,-1} }, { { 0x7d,-1},{ 0xfd,-1} }, { { 0x7e,-1},{ 0xfe,-1} }, { { 0x7f,-1},{ 0xff,-1} }, /*07c*/
-
- { { 0x80,-1},{ -1} }, { { 0x81,-1},{ -1} }, { { 0x82,-1},{ -1} }, { { -1},{ -1} }, /*080*/
- { { -1},{ -1} }, { { 0x85,-1},{ -1} }, { { 0x86,-1},{ -1} }, { { 0x87,-1},{ -1} }, /*084*/
- { { 0x88,-1},{ -1} }, { { 0x89,-1},{ -1} }, { { 0x8a,-1},{ -1} }, { { 0x8b,-1},{ -1} }, /*088*/
- { { 0x8c,-1},{ -1} }, { { 0x8d,-1},{ -1} }, { { 0x8e,-1},{ -1} }, { { 0x8f,-1},{ -1} }, /*08c*/
- { { 0x90,-1},{ -1} }, { { 0x91,-1},{ -1} }, { { 0x92,-1},{ -1} }, { { 0x93,-1},{ -1} }, /*090*/
- { { 0x94,-1},{ -1} }, { { 0x95,-1},{ -1} }, { { 0x96,-1},{ -1} }, { { 0x97,-1},{ -1} }, /*094*/
- { { 0x98,-1},{ -1} }, { { 0x99,-1},{ -1} }, { { 0x9a,-1},{ -1} }, { { 0x9b,-1},{ -1} }, /*098*/
- { { 0x9c,-1},{ -1} }, { { 0x9d,-1},{ -1} }, { { 0x9e,-1},{ -1} }, { { 0x9f,-1},{ -1} }, /*09c*/
- { { 0xa0,-1},{ -1} }, { { 0xa1,-1},{ -1} }, { { 0xa2,-1},{ -1} }, { { 0xa3,-1},{ -1} }, /*0a0*/
- { { 0xa4,-1},{ -1} }, { { 0xa5,-1},{ -1} }, { { 0xa6,-1},{ -1} }, { { 0xa7,-1},{ -1} }, /*0a4*/
- { { 0xa8,-1},{ -1} }, { { 0xa9,-1},{ -1} }, { { 0xaa,-1},{ -1} }, { { 0xab,-1},{ -1} }, /*0a8*/
- { { 0xac,-1},{ -1} }, { { 0xad,-1},{ -1} }, { { 0xae,-1},{ -1} }, { { 0xaf,-1},{ -1} }, /*0ac*/
- { { 0xb0,-1},{ -1} }, { { 0xb1,-1},{ -1} }, { { 0xb2,-1},{ -1} }, { { 0xb3,-1},{ -1} }, /*0b0*/
- { { 0xb4,-1},{ -1} }, { { 0xb5,-1},{ -1} }, { { 0xb6,-1},{ -1} }, { { 0xb7,-1},{ -1} }, /*0b4*/
- { { 0xb8,-1},{ -1} }, { { 0xb9,-1},{ -1} }, { { 0xba,-1},{ -1} }, { { 0xbb,-1},{ -1} }, /*0b8*/
- { { 0xbc,-1},{ -1} }, { { 0xbd,-1},{ -1} }, { { 0xbe,-1},{ -1} }, { { 0xbf,-1},{ -1} }, /*0bc*/
- { { 0xc0,-1},{ -1} }, { { 0xc1,-1},{ -1} }, { { 0xc2,-1},{ -1} }, { { 0xc3,-1},{ -1} }, /*0c0*/
- { { 0xc4,-1},{ -1} }, { { 0xc5,-1},{ -1} }, { { 0xc6,-1},{ -1} }, { { 0xc7,-1},{ -1} }, /*0c4*/
- { { 0xc8,-1},{ -1} }, { { 0xc9,-1},{ -1} }, { { 0xca,-1},{ -1} }, { { 0xcb,-1},{ -1} }, /*0c8*/
- { { 0xcc,-1},{ -1} }, { { 0xcd,-1},{ -1} }, { { 0xce,-1},{ -1} }, { { 0xcf,-1},{ -1} }, /*0cc*/
- { { 0xd0,-1},{ -1} }, { { 0xd1,-1},{ -1} }, { { 0xd2,-1},{ -1} }, { { 0xd3,-1},{ -1} }, /*0d0*/
- { { 0xd4,-1},{ -1} }, { { 0xd5,-1},{ -1} }, { { 0xd6,-1},{ -1} }, { { 0xd7,-1},{ -1} }, /*0d4*/
- { { 0xd8,-1},{ -1} }, { { 0xd9,-1},{ -1} }, { { 0xda,-1},{ -1} }, { { 0xdb,-1},{ -1} }, /*0d8*/
- { { 0xdc,-1},{ -1} }, { { 0xdd,-1},{ -1} }, { { 0xde,-1},{ -1} }, { { 0xdf,-1},{ -1} }, /*0dc*/
- { { 0xe0,-1},{ -1} }, { { 0xe1,-1},{ -1} }, { { 0xe2,-1},{ -1} }, { { 0xe3,-1},{ -1} }, /*0e0*/
- { { 0xe4,-1},{ -1} }, { { 0xe5,-1},{ -1} }, { { 0xe6,-1},{ -1} }, { { 0xe7,-1},{ -1} }, /*0e4*/
- { { 0xe8,-1},{ -1} }, { { 0xe9,-1},{ -1} }, { { 0xea,-1},{ -1} }, { { 0xeb,-1},{ -1} }, /*0e8*/
- { { 0xec,-1},{ -1} }, { { 0xed,-1},{ -1} }, { { 0xee,-1},{ -1} }, { { 0xef,-1},{ -1} }, /*0ec*/
- { { -1},{ -1} }, { { 0xf1,-1},{ -1} }, { { 0xf2,-1},{ -1} }, { { 0xf3,-1},{ -1} }, /*0f0*/
- { { 0xf4,-1},{ -1} }, { { 0xf5,-1},{ -1} }, { { 0xf6,-1},{ -1} }, { { 0xf7,-1},{ -1} }, /*0f4*/
- { { 0xf8,-1},{ -1} }, { { 0xf9,-1},{ -1} }, { { 0xfa,-1},{ -1} }, { { 0xfb,-1},{ -1} }, /*0f8*/
- { { 0xfc,-1},{ -1} }, { { 0xfd,-1},{ -1} }, { { 0xfe,-1},{ -1} }, { { 0xff,-1},{ -1} }, /*0fc*/
-
- { {0xe1,0x1d,-1},{0xe1, 0x9d,-1} }, { {0xe0,0x01,-1},{0xe0, 0x81,-1} }, { {0xe0,0x02,-1},{0xe0, 0x82,-1} }, { {0xe0,0x03,-1},{0xe0, 0x83,-1} }, /*100*/
- { {0xe0,0x04,-1},{0xe0, 0x84,-1} }, { {0xe0,0x05,-1},{0xe0, 0x85,-1} }, { {0xe0,0x06,-1},{0xe0, 0x86,-1} }, { {0xe0,0x07,-1},{0xe0, 0x87,-1} }, /*104*/
- { {0xe0,0x08,-1},{0xe0, 0x88,-1} }, { {0xe0,0x09,-1},{0xe0, 0x89,-1} }, { {0xe0,0x0a,-1},{0xe0, 0x8a,-1} }, { {0xe0,0x0b,-1},{0xe0, 0x8b,-1} }, /*108*/
- { {0xe0,0x0c,-1},{0xe0, 0x8c,-1} }, { { -1},{ -1} }, { {0xe0,0x0e,-1},{0xe0, 0x8e,-1} }, { {0xe0,0x0f,-1},{0xe0, 0x8f,-1} }, /*10c*/
- { {0xe0,0x10,-1},{0xe0, 0x90,-1} }, { {0xe0,0x11,-1},{0xe0, 0x91,-1} }, { {0xe0,0x12,-1},{0xe0, 0x92,-1} }, { {0xe0,0x13,-1},{0xe0, 0x93,-1} }, /*110*/
- { {0xe0,0x14,-1},{0xe0, 0x94,-1} }, { {0xe0,0x15,-1},{0xe0, 0x95,-1} }, { {0xe0,0x16,-1},{0xe0, 0x96,-1} }, { {0xe0,0x17,-1},{0xe0, 0x97,-1} }, /*114*/
- { {0xe0,0x18,-1},{0xe0, 0x98,-1} }, { {0xe0,0x19,-1},{0xe0, 0x99,-1} }, { {0xe0,0x1a,-1},{0xe0, 0x9a,-1} }, { {0xe0,0x1b,-1},{0xe0, 0x9b,-1} }, /*118*/
- { {0xe0,0x1c,-1},{0xe0, 0x9c,-1} }, { {0xe0,0x1d,-1},{0xe0, 0x9d,-1} }, { {0xe0,0x1e,-1},{0xe0, 0x9e,-1} }, { {0xe0,0x1f,-1},{0xe0, 0x9f,-1} }, /*11c*/
- { {0xe0,0x20,-1},{0xe0, 0xa0,-1} }, { {0xe0,0x21,-1},{0xe0, 0xa1,-1} }, { {0xe0,0x22,-1},{0xe0, 0xa2,-1} }, { {0xe0,0x23,-1},{0xe0, 0xa3,-1} }, /*120*/
- { {0xe0,0x24,-1},{0xe0, 0xa4,-1} }, { {0xe0,0x25,-1},{0xe0, 0xa5,-1} }, { {0xe0,0x26,-1},{0xe0, 0xa6,-1} }, { { -1},{ -1} }, /*124*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*128*/
- { {0xe0,0x2c,-1},{0xe0, 0xac,-1} }, { {0xe0,0x2d,-1},{0xe0, 0xad,-1} }, { {0xe0,0x2e,-1},{0xe0, 0xae,-1} }, { {0xe0,0x2f,-1},{0xe0, 0xaf,-1} }, /*12c*/
- { {0xe0,0x30,-1},{0xe0, 0xb0,-1} }, { {0xe0,0x31,-1},{0xe0, 0xb1,-1} }, { {0xe0,0x32,-1},{0xe0, 0xb2,-1} }, { { -1},{ -1} }, /*130*/
- { {0xe0,0x34,-1},{0xe0, 0xb4,-1} }, { {0xe0,0x35,-1},{0xe0, 0xb5,-1} }, { { -1},{ -1} }, { {0xe0,0x37,-1},{0xe0, 0xb7,-1} }, /*134*/
- { {0xe0,0x38,-1},{0xe0, 0xb8,-1} }, { { -1},{ -1} }, { {0xe0,0x3a,-1},{0xe0, 0xba,-1} }, { {0xe0,0x3b,-1},{0xe0, 0xbb,-1} }, /*138*/
- { {0xe0,0x3c,-1},{0xe0, 0xbc,-1} }, { {0xe0,0x3d,-1},{0xe0, 0xbd,-1} }, { {0xe0,0x3e,-1},{0xe0, 0xbe,-1} }, { {0xe0,0x3f,-1},{0xe0, 0xbf,-1} }, /*13c*/
- { {0xe0,0x40,-1},{0xe0, 0xc0,-1} }, { {0xe0,0x41,-1},{0xe0, 0xc1,-1} }, { {0xe0,0x42,-1},{0xe0, 0xc2,-1} }, { {0xe0,0x43,-1},{0xe0, 0xc3,-1} }, /*140*/
- { {0xe0,0x44,-1},{0xe0, 0xc4,-1} }, { { -1},{ -1} }, { {0xe0,0x46,-1},{0xe0, 0xc6,-1} }, { {0xe0,0x47,-1},{0xe0, 0xc7,-1} }, /*144*/
- { {0xe0,0x48,-1},{0xe0, 0xc8,-1} }, { {0xe0,0x49,-1},{0xe0, 0xc9,-1} }, { { -1},{ -1} }, { {0xe0,0x4b,-1},{0xe0, 0xcb,-1} }, /*148*/
- { {0xe0,0x4c,-1},{0xe0, 0xcc,-1} }, { {0xe0,0x4d,-1},{0xe0, 0xcd,-1} }, { {0xe0,0x4e,-1},{0xe0, 0xce,-1} }, { {0xe0,0x4f,-1},{0xe0, 0xcf,-1} }, /*14c*/
- { {0xe0,0x50,-1},{0xe0, 0xd0,-1} }, { {0xe0,0x51,-1},{0xe0, 0xd1,-1} }, { {0xe0,0x52,-1},{0xe0, 0xd2,-1} }, { {0xe0,0x53,-1},{0xe0, 0xd3,-1} }, /*150*/
- { { -1},{ -1} }, { {0xe0,0x55,-1},{0xe0, 0xd5,-1} }, { { -1},{ -1} }, { {0xe0,0x57,-1},{0xe0, 0xd7,-1} }, /*154*/
- { {0xe0,0x58,-1},{0xe0, 0xd8,-1} }, { {0xe0,0x59,-1},{0xe0, 0xd9,-1} }, { {0xe0,0x5a,-1},{0xe0, 0xaa,-1} }, { {0xe0,0x5b,-1},{0xe0, 0xdb,-1} }, /*158*/
- { {0xe0,0x5c,-1},{0xe0, 0xdc,-1} }, { {0xe0,0x5d,-1},{0xe0, 0xdd,-1} }, { {0xe0,0x5e,-1},{0xe0, 0xee,-1} }, { {0xe0,0x5f,-1},{0xe0, 0xdf,-1} }, /*15c*/
- { { -1},{ -1} }, { {0xe0,0x61,-1},{0xe0, 0xe1,-1} }, { {0xe0,0x62,-1},{0xe0, 0xe2,-1} }, { {0xe0,0x63,-1},{0xe0, 0xe3,-1} }, /*160*/
- { {0xe0,0x64,-1},{0xe0, 0xe4,-1} }, { {0xe0,0x65,-1},{0xe0, 0xe5,-1} }, { {0xe0,0x66,-1},{0xe0, 0xe6,-1} }, { {0xe0,0x67,-1},{0xe0, 0xe7,-1} }, /*164*/
- { {0xe0,0x68,-1},{0xe0, 0xe8,-1} }, { {0xe0,0x69,-1},{0xe0, 0xe9,-1} }, { {0xe0,0x6a,-1},{0xe0, 0xea,-1} }, { {0xe0,0x6b,-1},{0xe0, 0xeb,-1} }, /*168*/
- { {0xe0,0x6c,-1},{0xe0, 0xec,-1} }, { {0xe0,0x6d,-1},{0xe0, 0xed,-1} }, { {0xe0,0x6e,-1},{0xe0, 0xee,-1} }, { { -1},{ -1} }, /*16c*/
- { {0xe0,0x70,-1},{0xe0, 0xf0,-1} }, { {0xe0,0x71,-1},{0xe0, 0xf1,-1} }, { {0xe0,0x72,-1},{0xe0, 0xf2,-1} }, { {0xe0,0x73,-1},{0xe0, 0xf3,-1} }, /*170*/
- { {0xe0,0x74,-1},{0xe0, 0xf4,-1} }, { {0xe0,0x75,-1},{0xe0, 0xf5,-1} }, { { -1},{ -1} }, { {0xe0,0x77,-1},{0xe0, 0xf7,-1} }, /*174*/
- { {0xe0,0x78,-1},{0xe0, 0xf8,-1} }, { {0xe0,0x79,-1},{0xe0, 0xf9,-1} }, { {0xe0,0x7a,-1},{0xe0, 0xfa,-1} }, { {0xe0,0x7b,-1},{0xe0, 0xfb,-1} }, /*178*/
- { {0xe0,0x7c,-1},{0xe0, 0xfc,-1} }, { {0xe0,0x7d,-1},{0xe0, 0xfd,-1} }, { {0xe0,0x7e,-1},{0xe0, 0xfe,-1} }, { {0xe0,0x7f,-1},{0xe0, 0xff,-1} }, /*17c*/
-
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*180*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*184*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*188*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*18c*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*190*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*194*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*198*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*19c*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1a0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1a4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1a8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1ac*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1c0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1c4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1c8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1cc*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1d0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1d4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1d8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1dc*/
- { { -1},{ -1} }, { {0xe0,0xe1,-1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1e0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1e4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1e8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { {0xe0,0xee,-1},{ -1} }, { { -1},{ -1} }, /*1ec*/
- { { -1},{ -1} }, { {0xe0,0xf1,-1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1f0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1f4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1f8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { {0xe0,0xfe,-1},{ -1} }, { {0xe0,0xff,-1},{ -1} } /*1fc*/
-};
-
-static const scancode scancode_set2[512] = {
- { { -1},{ -1} }, { { 0x76,-1},{ 0xF0,0x76,-1} }, { { 0x16,-1},{ 0xF0,0x16,-1} }, { { 0x1E,-1},{ 0xF0,0x1E,-1} }, /*000*/
- { { 0x26,-1},{ 0xF0,0x26,-1} }, { { 0x25,-1},{ 0xF0,0x25,-1} }, { { 0x2E,-1},{ 0xF0,0x2E,-1} }, { { 0x36,-1},{ 0xF0,0x36,-1} }, /*004*/
- { { 0x3D,-1},{ 0xF0,0x3D,-1} }, { { 0x3E,-1},{ 0xF0,0x3E,-1} }, { { 0x46,-1},{ 0xF0,0x46,-1} }, { { 0x45,-1},{ 0xF0,0x45,-1} }, /*008*/
- { { 0x4E,-1},{ 0xF0,0x4E,-1} }, { { 0x55,-1},{ 0xF0,0x55,-1} }, { { 0x66,-1},{ 0xF0,0x66,-1} }, { { 0x0D,-1},{ 0xF0,0x0D,-1} }, /*00c*/
- { { 0x15,-1},{ 0xF0,0x15,-1} }, { { 0x1D,-1},{ 0xF0,0x1D,-1} }, { { 0x24,-1},{ 0xF0,0x24,-1} }, { { 0x2D,-1},{ 0xF0,0x2D,-1} }, /*010*/
- { { 0x2C,-1},{ 0xF0,0x2C,-1} }, { { 0x35,-1},{ 0xF0,0x35,-1} }, { { 0x3C,-1},{ 0xF0,0x3C,-1} }, { { 0x43,-1},{ 0xF0,0x43,-1} }, /*014*/
- { { 0x44,-1},{ 0xF0,0x44,-1} }, { { 0x4D,-1},{ 0xF0,0x4D,-1} }, { { 0x54,-1},{ 0xF0,0x54,-1} }, { { 0x5B,-1},{ 0xF0,0x5B,-1} }, /*018*/
- { { 0x5A,-1},{ 0xF0,0x5A,-1} }, { { 0x14,-1},{ 0xF0,0x14,-1} }, { { 0x1C,-1},{ 0xF0,0x1C,-1} }, { { 0x1B,-1},{ 0xF0,0x1B,-1} }, /*01c*/
- { { 0x23,-1},{ 0xF0,0x23,-1} }, { { 0x2B,-1},{ 0xF0,0x2B,-1} }, { { 0x34,-1},{ 0xF0,0x34,-1} }, { { 0x33,-1},{ 0xF0,0x33,-1} }, /*020*/
- { { 0x3B,-1},{ 0xF0,0x3B,-1} }, { { 0x42,-1},{ 0xF0,0x42,-1} }, { { 0x4B,-1},{ 0xF0,0x4B,-1} }, { { 0x4C,-1},{ 0xF0,0x4C,-1} }, /*024*/
- { { 0x52,-1},{ 0xF0,0x52,-1} }, { { 0x0E,-1},{ 0xF0,0x0E,-1} }, { { 0x12,-1},{ 0xF0,0x12,-1} }, { { 0x5D,-1},{ 0xF0,0x5D,-1} }, /*028*/
- { { 0x1A,-1},{ 0xF0,0x1A,-1} }, { { 0x22,-1},{ 0xF0,0x22,-1} }, { { 0x21,-1},{ 0xF0,0x21,-1} }, { { 0x2A,-1},{ 0xF0,0x2A,-1} }, /*02c*/
- { { 0x32,-1},{ 0xF0,0x32,-1} }, { { 0x31,-1},{ 0xF0,0x31,-1} }, { { 0x3A,-1},{ 0xF0,0x3A,-1} }, { { 0x41,-1},{ 0xF0,0x41,-1} }, /*030*/
- { { 0x49,-1},{ 0xF0,0x49,-1} }, { { 0x4A,-1},{ 0xF0,0x4A,-1} }, { { 0x59,-1},{ 0xF0,0x59,-1} }, { { 0x7C,-1},{ 0xF0,0x7C,-1} }, /*034*/
- { { 0x11,-1},{ 0xF0,0x11,-1} }, { { 0x29,-1},{ 0xF0,0x29,-1} }, { { 0x58,-1},{ 0xF0,0x58,-1} }, { { 0x05,-1},{ 0xF0,0x05,-1} }, /*038*/
- { { 0x06,-1},{ 0xF0,0x06,-1} }, { { 0x04,-1},{ 0xF0,0x04,-1} }, { { 0x0C,-1},{ 0xF0,0x0C,-1} }, { { 0x03,-1},{ 0xF0,0x03,-1} }, /*03c*/
- { { 0x0B,-1},{ 0xF0,0x0B,-1} }, { { 0x83,-1},{ 0xF0,0x83,-1} }, { { 0x0A,-1},{ 0xF0,0x0A,-1} }, { { 0x01,-1},{ 0xF0,0x01,-1} }, /*040*/
- { { 0x09,-1},{ 0xF0,0x09,-1} }, { { 0x77,-1},{ 0xF0,0x77,-1} }, { { 0x7E,-1},{ 0xF0,0x7E,-1} }, { { 0x6C,-1},{ 0xF0,0x6C,-1} }, /*044*/
- { { 0x75,-1},{ 0xF0,0x75,-1} }, { { 0x7D,-1},{ 0xF0,0x7D,-1} }, { { 0x7B,-1},{ 0xF0,0x7B,-1} }, { { 0x6B,-1},{ 0xF0,0x6B,-1} }, /*048*/
- { { 0x73,-1},{ 0xF0,0x73,-1} }, { { 0x74,-1},{ 0xF0,0x74,-1} }, { { 0x79,-1},{ 0xF0,0x79,-1} }, { { 0x69,-1},{ 0xF0,0x69,-1} }, /*04c*/
- { { 0x72,-1},{ 0xF0,0x72,-1} }, { { 0x7A,-1},{ 0xF0,0x7A,-1} }, { { 0x70,-1},{ 0xF0,0x70,-1} }, { { 0x71,-1},{ 0xF0,0x71,-1} }, /*050*/
- { { 0x84,-1},{ 0xF0,0x84,-1} }, { { 0x60,-1},{ 0xF0,0x60,-1} }, { { 0x61,-1},{ 0xF0,0x61,-1} }, { { 0x78,-1},{ 0xF0,0x78,-1} }, /*054*/
- { { 0x07,-1},{ 0xF0,0x07,-1} }, { { 0x0F,-1},{ 0xF0,0x0F,-1} }, { { 0x17,-1},{ 0xF0,0x17,-1} }, { { 0x1F,-1},{ 0xF0,0x1F,-1} }, /*058*/
- { { 0x27,-1},{ 0xF0,0x27,-1} }, { { 0x2F,-1},{ 0xF0,0x2F,-1} }, { { 0x37,-1},{ 0xF0,0x37,-1} }, { { 0x3F,-1},{ 0xF0,0x3F,-1} }, /*05c*/
- { { 0x47,-1},{ 0xF0,0x47,-1} }, { { 0x4F,-1},{ 0xF0,0x4F,-1} }, { { 0x56,-1},{ 0xF0,0x56,-1} }, { { 0x5E,-1},{ 0xF0,0x5E,-1} }, /*060*/
- { { 0x08,-1},{ 0xF0,0x08,-1} }, { { 0x10,-1},{ 0xF0,0x10,-1} }, { { 0x18,-1},{ 0xF0,0x18,-1} }, { { 0x20,-1},{ 0xF0,0x20,-1} }, /*064*/
- { { 0x28,-1},{ 0xF0,0x28,-1} }, { { 0x30,-1},{ 0xF0,0x30,-1} }, { { 0x38,-1},{ 0xF0,0x38,-1} }, { { 0x40,-1},{ 0xF0,0x40,-1} }, /*068*/
- { { 0x48,-1},{ 0xF0,0x48,-1} }, { { 0x50,-1},{ 0xF0,0x50,-1} }, { { 0x57,-1},{ 0xF0,0x57,-1} }, { { 0x6F,-1},{ 0xF0,0x6F,-1} }, /*06c*/
- { { 0x13,-1},{ 0xF0,0x13,-1} }, { { 0x19,-1},{ 0xF0,0x19,-1} }, { { 0x39,-1},{ 0xF0,0x39,-1} }, { { 0x51,-1},{ 0xF0,0x51,-1} }, /*070*/
- { { 0x53,-1},{ 0xF0,0x53,-1} }, { { 0x5C,-1},{ 0xF0,0x5C,-1} }, { { 0x5F,-1},{ 0xF0,0x5F,-1} }, { { 0x62,-1},{ 0xF0,0x62,-1} }, /*074*/
- { { 0x63,-1},{ 0xF0,0x63,-1} }, { { 0x64,-1},{ 0xF0,0x64,-1} }, { { 0x65,-1},{ 0xF0,0x65,-1} }, { { 0x67,-1},{ 0xF0,0x67,-1} }, /*078*/
- { { 0x68,-1},{ 0xF0,0x68,-1} }, { { 0x6A,-1},{ 0xF0,0x6A,-1} }, { { 0x6D,-1},{ 0xF0,0x6D,-1} }, { { 0x6E,-1},{ 0xF0,0x6E,-1} }, /*07c*/
-
- { { 0x80,-1},{ 0xf0,0x80,-1} }, { { 0x81,-1},{ 0xf0,0x81,-1} }, { { 0x82,-1},{ 0xf0,0x82,-1} }, { { -1},{ -1} }, /*080*/
- { { -1},{ -1} }, { { 0x85,-1},{ 0xf0,0x54,-1} }, { { 0x86,-1},{ 0xf0,0x86,-1} }, { { 0x87,-1},{ 0xf0,0x87,-1} }, /*084*/
- { { 0x88,-1},{ 0xf0,0x88,-1} }, { { 0x89,-1},{ 0xf0,0x89,-1} }, { { 0x8a,-1},{ 0xf0,0x8a,-1} }, { { 0x8b,-1},{ 0xf0,0x8b,-1} }, /*088*/
- { { 0x8c,-1},{ 0xf0,0x8c,-1} }, { { 0x8d,-1},{ 0xf0,0x8d,-1} }, { { 0x8e,-1},{ 0xf0,0x8e,-1} }, { { 0x8f,-1},{ 0xf0,0x8f,-1} }, /*08c*/
- { { 0x90,-1},{ 0xf0,0x90,-1} }, { { 0x91,-1},{ 0xf0,0x91,-1} }, { { 0x92,-1},{ 0xf0,0x92,-1} }, { { 0x93,-1},{ 0xf0,0x93,-1} }, /*090*/
- { { 0x94,-1},{ 0xf0,0x94,-1} }, { { 0x95,-1},{ 0xf0,0x95,-1} }, { { 0x96,-1},{ 0xf0,0x96,-1} }, { { 0x97,-1},{ 0xf0,0x97,-1} }, /*094*/
- { { 0x98,-1},{ 0xf0,0x98,-1} }, { { 0x99,-1},{ 0xf0,0x99,-1} }, { { 0x9a,-1},{ 0xf0,0x9a,-1} }, { { 0x9b,-1},{ 0xf0,0x9b,-1} }, /*098*/
- { { 0x9c,-1},{ 0xf0,0x9c,-1} }, { { 0x9d,-1},{ 0xf0,0x9d,-1} }, { { 0x9e,-1},{ 0xf0,0x9e,-1} }, { { 0x9f,-1},{ 0xf0,0x9f,-1} }, /*09c*/
- { { 0xa0,-1},{ 0xf0,0xa0,-1} }, { { 0xa1,-1},{ 0xf0,0xa1,-1} }, { { 0xa2,-1},{ 0xf0,0xa2,-1} }, { { 0xa3,-1},{ 0xf0,0xa3,-1} }, /*0a0*/
- { { 0xa4,-1},{ 0xf0,0xa4,-1} }, { { 0xa5,-1},{ 0xf0,0xa5,-1} }, { { 0xa6,-1},{ 0xf0,0xa6,-1} }, { { 0xa7,-1},{ 0xf0,0xa7,-1} }, /*0a4*/
- { { 0xa8,-1},{ 0xf0,0xa8,-1} }, { { 0xa9,-1},{ 0xf0,0xa9,-1} }, { { 0xaa,-1},{ 0xf0,0xaa,-1} }, { { 0xab,-1},{ 0xf0,0xab,-1} }, /*0a8*/
- { { 0xac,-1},{ 0xf0,0xac,-1} }, { { 0xad,-1},{ 0xf0,0xad,-1} }, { { 0xae,-1},{ 0xf0,0xae,-1} }, { { 0xaf,-1},{ 0xf0,0xaf,-1} }, /*0ac*/
- { { 0xb0,-1},{ 0xf0,0xb0,-1} }, { { 0xb1,-1},{ 0xf0,0xb1,-1} }, { { 0xb2,-1},{ 0xf0,0xb2,-1} }, { { 0xb3,-1},{ 0xf0,0xb3,-1} }, /*0b0*/
- { { 0xb4,-1},{ 0xf0,0xb4,-1} }, { { 0xb5,-1},{ 0xf0,0xb5,-1} }, { { 0xb6,-1},{ 0xf0,0xb6,-1} }, { { 0xb7,-1},{ 0xf0,0xb7,-1} }, /*0b4*/
- { { 0xb8,-1},{ 0xf0,0xb8,-1} }, { { 0xb9,-1},{ 0xf0,0xb9,-1} }, { { 0xba,-1},{ 0xf0,0xba,-1} }, { { 0xbb,-1},{ 0xf0,0xbb,-1} }, /*0b8*/
- { { 0xbc,-1},{ 0xf0,0xbc,-1} }, { { 0xbd,-1},{ 0xf0,0xbd,-1} }, { { 0xbe,-1},{ 0xf0,0xbe,-1} }, { { 0xbf,-1},{ 0xf0,0xbf,-1} }, /*0bc*/
- { { 0xc0,-1},{ 0xf0,0xc0,-1} }, { { 0xc1,-1},{ 0xf0,0xc1,-1} }, { { 0xc2,-1},{ 0xf0,0xc2,-1} }, { { 0xc3,-1},{ 0xf0,0xc3,-1} }, /*0c0*/
- { { 0xc4,-1},{ 0xf0,0xc4,-1} }, { { 0xc5,-1},{ 0xf0,0xc5,-1} }, { { 0xc6,-1},{ 0xf0,0xc6,-1} }, { { 0xc7,-1},{ 0xf0,0xc7,-1} }, /*0c4*/
- { { 0xc8,-1},{ 0xf0,0xc8,-1} }, { { 0xc9,-1},{ 0xf0,0xc9,-1} }, { { 0xca,-1},{ 0xf0,0xca,-1} }, { { 0xcb,-1},{ 0xf0,0xcb,-1} }, /*0c8*/
- { { 0xcc,-1},{ 0xf0,0xcc,-1} }, { { 0xcd,-1},{ 0xf0,0xcd,-1} }, { { 0xce,-1},{ 0xf0,0xce,-1} }, { { 0xcf,-1},{ 0xf0,0xcf,-1} }, /*0cc*/
- { { 0xd0,-1},{ 0xf0,0xd0,-1} }, { { 0xd1,-1},{ 0xf0,0xd0,-1} }, { { 0xd2,-1},{ 0xf0,0xd2,-1} }, { { 0xd3,-1},{ 0xf0,0xd3,-1} }, /*0d0*/
- { { 0xd4,-1},{ 0xf0,0xd4,-1} }, { { 0xd5,-1},{ 0xf0,0xd5,-1} }, { { 0xd6,-1},{ 0xf0,0xd6,-1} }, { { 0xd7,-1},{ 0xf0,0xd7,-1} }, /*0d4*/
- { { 0xd8,-1},{ 0xf0,0xd8,-1} }, { { 0xd9,-1},{ 0xf0,0xd9,-1} }, { { 0xda,-1},{ 0xf0,0xda,-1} }, { { 0xdb,-1},{ 0xf0,0xdb,-1} }, /*0d8*/
- { { 0xdc,-1},{ 0xf0,0xdc,-1} }, { { 0xdd,-1},{ 0xf0,0xdd,-1} }, { { 0xde,-1},{ 0xf0,0xde,-1} }, { { 0xdf,-1},{ 0xf0,0xdf,-1} }, /*0dc*/
- { { 0xe0,-1},{ 0xf0,0xe0,-1} }, { { 0xe1,-1},{ 0xf0,0xe1,-1} }, { { 0xe2,-1},{ 0xf0,0xe2,-1} }, { { 0xe3,-1},{ 0xf0,0xe3,-1} }, /*0e0*/
- { { 0xe4,-1},{ 0xf0,0xe4,-1} }, { { 0xe5,-1},{ 0xf0,0xe5,-1} }, { { 0xe6,-1},{ 0xf0,0xe6,-1} }, { { 0xe7,-1},{ 0xf0,0xe7,-1} }, /*0e4*/
- { { 0xe8,-1},{ 0xf0,0xe8,-1} }, { { 0xe9,-1},{ 0xf0,0xe9,-1} }, { { 0xea,-1},{ 0xf0,0xea,-1} }, { { 0xeb,-1},{ 0xf0,0xeb,-1} }, /*0e8*/
- { { 0xec,-1},{ 0xf0,0xec,-1} }, { { 0xed,-1},{ 0xf0,0xed,-1} }, { { 0xee,-1},{ 0xf0,0xee,-1} }, { { 0xef,-1},{ 0xf0,0xef,-1} }, /*0ec*/
- { { -1},{ -1} }, { { 0xf1,-1},{ 0xf0,0xf1,-1} }, { { 0xf2,-1},{ 0xf0,0xf2,-1} }, { { 0xf3,-1},{ 0xf0,0xf3,-1} }, /*0f0*/
- { { 0xf4,-1},{ 0xf0,0xf4,-1} }, { { 0xf5,-1},{ 0xf0,0xf5,-1} }, { { 0xf6,-1},{ 0xf0,0xf6,-1} }, { { 0xf7,-1},{ 0xf0,0xf7,-1} }, /*0f4*/
- { { 0xf8,-1},{ 0xf0,0xf8,-1} }, { { 0xf9,-1},{ 0xf0,0xf9,-1} }, { { 0xfa,-1},{ 0xf0,0xfa,-1} }, { { 0xfb,-1},{ 0xf0,0xfb,-1} }, /*0f8*/
- { { 0xfc,-1},{ 0xf0,0xfc,-1} }, { { 0xfd,-1},{ 0xf0,0xfd,-1} }, { { 0xfe,-1},{ 0xf0,0xfe,-1} }, { { 0xff,-1},{ 0xf0,0xff,-1} }, /*0fc*/
-
- { {0xe1,0x14,-1},{0xe1,0xf0,0x14,-1} }, { {0xe0,0x76,-1},{0xe0,0xF0,0x76,-1} }, { {0xe0,0x16,-1},{0xe0,0xF0,0x16,-1} }, { {0xe0,0x1E,-1},{0xe0,0xF0,0x1E,-1} }, /*100*/
- { {0xe0,0x26,-1},{0xe0,0xF0,0x26,-1} }, { {0xe0,0x25,-1},{0xe0,0xF0,0x25,-1} }, { {0xe0,0x2E,-1},{0xe0,0xF0,0x2E,-1} }, { {0xe0,0x36,-1},{0xe0,0xF0,0x36,-1} }, /*104*/
- { {0xe0,0x3D,-1},{0xe0,0xF0,0x3D,-1} }, { {0xe0,0x3E,-1},{0xe0,0xF0,0x3E,-1} }, { {0xe0,0x46,-1},{0xe0,0xF0,0x46,-1} }, { {0xe0,0x45,-1},{0xe0,0xF0,0x45,-1} }, /*108*/
- { {0xe0,0x4E,-1},{0xe0,0xF0,0x4E,-1} }, { { -1},{ -1} }, { {0xe0,0x66,-1},{0xe0,0xF0,0x66,-1} }, { {0xe0,0x0D,-1},{0xe0,0xF0,0x0D,-1} }, /*10c*/
- { {0xe0,0x15,-1},{0xe0,0xF0,0x15,-1} }, { {0xe0,0x1D,-1},{0xe0,0xF0,0x1D,-1} }, { {0xe0,0x24,-1},{0xe0,0xF0,0x24,-1} }, { {0xe0,0x2D,-1},{0xe0,0xF0,0x2D,-1} }, /*110*/
- { {0xe0,0x2C,-1},{0xe0,0xF0,0x2C,-1} }, { {0xe0,0x35,-1},{0xe0,0xF0,0x35,-1} }, { {0xe0,0x3C,-1},{0xe0,0xF0,0x3C,-1} }, { {0xe0,0x43,-1},{0xe0,0xF0,0x43,-1} }, /*114*/
- { {0xe0,0x44,-1},{0xe0,0xF0,0x44,-1} }, { {0xe0,0x4D,-1},{0xe0,0xF0,0x4D,-1} }, { {0xe0,0x54,-1},{0xe0,0xF0,0x54,-1} }, { {0xe0,0x5B,-1},{0xe0,0xF0,0x5B,-1} }, /*118*/
- { {0xe0,0x5A,-1},{0xe0,0xF0,0x5A,-1} }, { {0xe0,0x14,-1},{0xe0,0xF0,0x14,-1} }, { {0xe0,0x1C,-1},{0xe0,0xF0,0x1C,-1} }, { {0xe0,0x1B,-1},{0xe0,0xF0,0x1B,-1} }, /*11c*/
- { {0xe0,0x23,-1},{0xe0,0xF0,0x23,-1} }, { {0xe0,0x2B,-1},{0xe0,0xF0,0x2B,-1} }, { {0xe0,0x34,-1},{0xe0,0xF0,0x34,-1} }, { {0xe0,0x33,-1},{0xe0,0xF0,0x33,-1} }, /*120*/
- { {0xe0,0x3B,-1},{0xe0,0xF0,0x3B,-1} }, { {0xe0,0x42,-1},{0xe0,0xF0,0x42,-1} }, { {0xe0,0x4B,-1},{0xe0,0xF0,0x4B,-1} }, { { -1},{ -1} }, /*124*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*128*/
- { {0xe0,0x1A,-1},{0xe0,0xF0,0x1A,-1} }, { {0xe0,0x22,-1},{0xe0,0xF0,0x22,-1} }, { {0xe0,0x21,-1},{0xe0,0xF0,0x21,-1} }, { {0xe0,0x2A,-1},{0xe0,0xF0,0x2A,-1} }, /*12c*/
- { {0xe0,0x32,-1},{0xe0,0xF0,0x32,-1} }, { {0xe0,0x31,-1},{0xe0,0xF0,0x31,-1} }, { {0xe0,0x3A,-1},{0xe0,0xF0,0x3A,-1} }, { { -1},{ -1} }, /*130*/
- { {0xe0,0x49,-1},{0xe0,0xF0,0x49,-1} }, { {0xe0,0x4A,-1},{0xe0,0xF0,0x4A,-1} }, { { -1},{ -1} }, { {0xe0,0x7C,-1},{0xe0,0xF0,0x7C,-1} }, /*134*/
- { {0xe0,0x11,-1},{0xe0,0xF0,0x11,-1} }, { { -1},{ -1} }, { {0xe0,0x58,-1},{0xe0,0xF0,0x58,-1} }, { {0xe0,0x05,-1},{0xe0,0xF0,0x05,-1} }, /*138*/
- { {0xe0,0x06,-1},{0xe0,0xF0,0x06,-1} }, { {0xe0,0x04,-1},{0xe0,0xF0,0x04,-1} }, { {0xe0,0x0C,-1},{0xe0,0xF0,0x0C,-1} }, { {0xe0,0x03,-1},{0xe0,0xF0,0x03,-1} }, /*13c*/
- { {0xe0,0x0B,-1},{0xe0,0xF0,0x0B,-1} }, { {0xe0,0x02,-1},{0xe0,0xF0,0x02,-1} }, { {0xe0,0x0A,-1},{0xe0,0xF0,0x0A,-1} }, { {0xe0,0x01,-1},{0xe0,0xF0,0x01,-1} }, /*140*/
- { {0xe0,0x09,-1},{0xe0,0xF0,0x09,-1} }, { { -1},{ -1} }, { {0xe0,0x7E,-1},{0xe0,0xF0,0x7E,-1} }, { {0xe0,0x6C,-1},{0xe0,0xF0,0x6C,-1} }, /*144*/
- { {0xe0,0x75,-1},{0xe0,0xF0,0x75,-1} }, { {0xe0,0x7D,-1},{0xe0,0xF0,0x7D,-1} }, { { -1},{ -1} }, { {0xe0,0x6B,-1},{0xe0,0xF0,0x6B,-1} }, /*148*/
- { {0xe0,0x73,-1},{0xe0,0xF0,0x73,-1} }, { {0xe0,0x74,-1},{0xe0,0xF0,0x74,-1} }, { {0xe0,0x79,-1},{0xe0,0xF0,0x79,-1} }, { {0xe0,0x69,-1},{0xe0,0xF0,0x69,-1} }, /*14c*/
- { {0xe0,0x72,-1},{0xe0,0xF0,0x72,-1} }, { {0xe0,0x7A,-1},{0xe0,0xF0,0x7A,-1} }, { {0xe0,0x70,-1},{0xe0,0xF0,0x70,-1} }, { {0xe0,0x71,-1},{0xe0,0xF0,0x71,-1} }, /*150*/
- { { -1},{ -1} }, { {0xe0,0x60,-1},{0xe0,0xF0,0x60,-1} }, { { -1},{ -1} }, { {0xe0,0x78,-1},{0xe0,0xF0,0x78,-1} }, /*154*/
- { {0xe0,0x07,-1},{0xe0,0xF0,0x07,-1} }, { {0xe0,0x0F,-1},{0xe0,0xF0,0x0F,-1} }, { {0xe0,0x17,-1},{0xe0,0xF0,0x17,-1} }, { {0xe0,0x1F,-1},{0xe0,0xF0,0x1F,-1} }, /*158*/
- { {0xe0,0x27,-1},{0xe0,0xF0,0x27,-1} }, { {0xe0,0x2F,-1},{0xe0,0xF0,0x2F,-1} }, { {0xe0,0x37,-1},{0xe0,0xF0,0x37,-1} }, { {0xe0,0x3F,-1},{0xe0,0xF0,0x3F,-1} }, /*15c*/
- { { -1},{ -1} }, { {0xe0,0x4F,-1},{0xe0,0xF0,0x4F,-1} }, { {0xe0,0x56,-1},{0xe0,0xF0,0x56,-1} }, { {0xe0,0x5E,-1},{0xe0,0xF0,0x5E,-1} }, /*160*/
- { {0xe0,0x08,-1},{0xe0,0xF0,0x08,-1} }, { {0xe0,0x10,-1},{0xe0,0xF0,0x10,-1} }, { {0xe0,0x18,-1},{0xe0,0xF0,0x18,-1} }, { {0xe0,0x20,-1},{0xe0,0xF0,0x20,-1} }, /*164*/
- { {0xe0,0x28,-1},{0xe0,0xF0,0x28,-1} }, { {0xe0,0x30,-1},{0xe0,0xF0,0x30,-1} }, { {0xe0,0x38,-1},{0xe0,0xF0,0x38,-1} }, { {0xe0,0x40,-1},{0xe0,0xF0,0x40,-1} }, /*168*/
- { {0xe0,0x48,-1},{0xe0,0xF0,0x48,-1} }, { {0xe0,0x50,-1},{0xe0,0xF0,0x50,-1} }, { {0xe0,0x57,-1},{0xe0,0xF0,0x57,-1} }, { { -1},{ -1} }, /*16c*/
- { {0xe0,0x13,-1},{0xe0,0xF0,0x13,-1} }, { {0xe0,0x19,-1},{0xe0,0xF0,0x19,-1} }, { {0xe0,0x39,-1},{0xe0,0xF0,0x39,-1} }, { {0xe0,0x51,-1},{0xe0,0xF0,0x51,-1} }, /*170*/
- { {0xe0,0x53,-1},{0xe0,0xF0,0x53,-1} }, { {0xe0,0x5C,-1},{0xe0,0xF0,0x5C,-1} }, { { -1},{ -1} }, { {0xe0,0x62,-1},{0xe0,0xF0,0x62,-1} }, /*174*/
- { {0xe0,0x63,-1},{0xe0,0xF0,0x63,-1} }, { {0xe0,0x64,-1},{0xe0,0xF0,0x64,-1} }, { {0xe0,0x65,-1},{0xe0,0xF0,0x65,-1} }, { {0xe0,0x67,-1},{0xe0,0xF0,0x67,-1} }, /*178*/
- { {0xe0,0x68,-1},{0xe0,0xF0,0x68,-1} }, { {0xe0,0x6A,-1},{0xe0,0xF0,0x6A,-1} }, { {0xe0,0x6D,-1},{0xe0,0xF0,0x6D,-1} }, { {0xe0,0x6E,-1},{0xe0,0xF0,0x6E,-1} }, /*17c*/
-
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*180*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*184*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*188*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*18c*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*190*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*194*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*198*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*19c*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1a0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1a4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1a8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1ac*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1c0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1c4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1c8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1cc*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1d0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1d4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1d8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1dc*/
- { { -1},{ -1} }, { {0xe0,0xe1,-1},{0xe0,0xF0,0xE1,-1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1e0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1e4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1e8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { {0xe0,0xee,-1},{0xe0,0xF0,0xEE,-1} }, { { -1},{ -1} }, /*1ec*/
- { { -1},{ -1} }, { {0xe0,0xf1,-1},{0xe0,0xF0,0xF1,-1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1f0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1f4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1f8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { {0xe0,0xfe,-1},{0xe0,0xF0,0xFE,-1} }, { {0xe0,0xff,-1},{0xe0,0xF0,0xFF,-1} } /*1fc*/
-};
-
-static const scancode scancode_set3[512] = {
- { { -1},{ -1} }, { { 0x08,-1},{ 0xf0,0x08,-1} }, { { 0x16,-1},{ 0xf0,0x16,-1} }, { { 0x1E,-1},{ 0xf0,0x1E,-1} }, /*000*/
- { { 0x26,-1},{ 0xf0,0x26,-1} }, { { 0x25,-1},{ 0xf0,0x25,-1} }, { { 0x2E,-1},{ 0xf0,0x2E,-1} }, { { 0x36,-1},{ 0xf0,0x36,-1} }, /*004*/
- { { 0x3D,-1},{ 0xf0,0x3D,-1} }, { { 0x3E,-1},{ 0xf0,0x3E,-1} }, { { 0x46,-1},{ 0xf0,0x46,-1} }, { { 0x45,-1},{ 0xf0,0x45,-1} }, /*008*/
- { { 0x4E,-1},{ 0xf0,0x4E,-1} }, { { 0x55,-1},{ 0xf0,0x55,-1} }, { { 0x66,-1},{ 0xf0,0x66,-1} }, { { 0x0D,-1},{ 0xf0,0x0D,-1} }, /*00c*/
- { { 0x15,-1},{ 0xf0,0x15,-1} }, { { 0x1D,-1},{ 0xf0,0x1D,-1} }, { { 0x24,-1},{ 0xf0,0x24,-1} }, { { 0x2D,-1},{ 0xf0,0x2D,-1} }, /*010*/
- { { 0x2C,-1},{ 0xf0,0x2C,-1} }, { { 0x35,-1},{ 0xf0,0x35,-1} }, { { 0x3C,-1},{ 0xf0,0x3C,-1} }, { { 0x43,-1},{ 0xf0,0x43,-1} }, /*014*/
- { { 0x44,-1},{ 0xf0,0x44,-1} }, { { 0x4D,-1},{ 0xf0,0x4D,-1} }, { { 0x54,-1},{ 0xf0,0x54,-1} }, { { 0x5B,-1},{ 0xf0,0x5B,-1} }, /*018*/
- { { 0x5A,-1},{ 0xf0,0x5A,-1} }, { { 0x11,-1},{ 0xf0,0x11,-1} }, { { 0x1C,-1},{ 0xf0,0x1C,-1} }, { { 0x1B,-1},{ 0xf0,0x1B,-1} }, /*01c*/
- { { 0x23,-1},{ 0xf0,0x23,-1} }, { { 0x2B,-1},{ 0xf0,0x2B,-1} }, { { 0x34,-1},{ 0xf0,0x34,-1} }, { { 0x33,-1},{ 0xf0,0x33,-1} }, /*020*/
- { { 0x3B,-1},{ 0xf0,0x3B,-1} }, { { 0x42,-1},{ 0xf0,0x42,-1} }, { { 0x4B,-1},{ 0xf0,0x4B,-1} }, { { 0x4C,-1},{ 0xf0,0x4C,-1} }, /*024*/
- { { 0x52,-1},{ 0xf0,0x52,-1} }, { { 0x0E,-1},{ 0xf0,0x0E,-1} }, { { 0x12,-1},{ 0xf0,0x12,-1} }, { { 0x5C,-1},{ 0xf0,0x5C,-1} }, /*028*/
- { { 0x1A,-1},{ 0xf0,0x1A,-1} }, { { 0x22,-1},{ 0xf0,0x22,-1} }, { { 0x21,-1},{ 0xf0,0x21,-1} }, { { 0x2A,-1},{ 0xf0,0x2A,-1} }, /*02c*/
- { { 0x32,-1},{ 0xf0,0x32,-1} }, { { 0x31,-1},{ 0xf0,0x31,-1} }, { { 0x3A,-1},{ 0xf0,0x3A,-1} }, { { 0x41,-1},{ 0xf0,0x41,-1} }, /*030*/
- { { 0x49,-1},{ 0xf0,0x49,-1} }, { { 0x4A,-1},{ 0xf0,0x4A,-1} }, { { 0x59,-1},{ 0xf0,0x59,-1} }, { { 0x7E,-1},{ 0xf0,0x7E,-1} }, /*034*/
- { { 0x19,-1},{ 0xf0,0x19,-1} }, { { 0x29,-1},{ 0xf0,0x29,-1} }, { { 0x14,-1},{ 0xf0,0x14,-1} }, { { 0x07,-1},{ 0xf0,0x07,-1} }, /*038*/
- { { 0x0F,-1},{ 0xf0,0x0F,-1} }, { { 0x17,-1},{ 0xf0,0x17,-1} }, { { 0x1F,-1},{ 0xf0,0x1F,-1} }, { { 0x27,-1},{ 0xf0,0x27,-1} }, /*03c*/
- { { 0x2F,-1},{ 0xf0,0x2F,-1} }, { { 0x37,-1},{ 0xf0,0x37,-1} }, { { 0x3F,-1},{ 0xf0,0x3F,-1} }, { { 0x47,-1},{ 0xf0,0x47,-1} }, /*040*/
- { { 0x4F,-1},{ 0xf0,0x4F,-1} }, { { 0x76,-1},{ 0xf0,0x76,-1} }, { { 0x5F,-1},{ 0xf0,0x5F,-1} }, { { 0x6C,-1},{ 0xf0,0x6C,-1} }, /*044*/
- { { 0x75,-1},{ 0xf0,0x75,-1} }, { { 0x7D,-1},{ 0xf0,0x7D,-1} }, { { 0x84,-1},{ 0xf0,0x84,-1} }, { { 0x6B,-1},{ 0xf0,0x6B,-1} }, /*048*/
- { { 0x73,-1},{ 0xf0,0x73,-1} }, { { 0x74,-1},{ 0xf0,0x74,-1} }, { { 0x7C,-1},{ 0xf0,0x7C,-1} }, { { 0x69,-1},{ 0xf0,0x69,-1} }, /*04c*/
- { { 0x72,-1},{ 0xf0,0x72,-1} }, { { 0x7A,-1},{ 0xf0,0x7A,-1} }, { { 0x70,-1},{ 0xf0,0x70,-1} }, { { 0x71,-1},{ 0xf0,0x71,-1} }, /*050*/
- { { 0x57,-1},{ 0xf0,0x57,-1} }, { { 0x60,-1},{ 0xf0,0x60,-1} }, { { -1},{ -1} }, { { 0x56,-1},{ 0xf0,0x56,-1} }, /*054*/
- { { 0x5E,-1},{ 0xf0,0x5E,-1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*058*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*05c*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*060*/
- { { -1},{ -1} }, { { 0x10,-1},{ 0xf0,0x10,-1} }, { { 0x18,-1},{ 0xf0,0x18,-1} }, { { 0x20,-1},{ 0xf0,0x20,-1} }, /*064*/
- { { 0x28,-1},{ 0xf0,0x28,-1} }, { { 0x30,-1},{ 0xf0,0x30,-1} }, { { 0x38,-1},{ 0xf0,0x38,-1} }, { { 0x40,-1},{ 0xf0,0x40,-1} }, /*068*/
- { { 0x48,-1},{ 0xf0,0x48,-1} }, { { 0x50,-1},{ 0xf0,0x50,-1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*06c*/
- { { 0x87,-1},{ 0xf0,0x87,-1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { 0x51,-1},{ 0xf0,0x51,-1} }, /*070*/
- { { 0x53,-1},{ 0xf0,0x53,-1} }, { { 0x5C,-1},{ 0xf0,0x5C,-1} }, { { -1},{ -1} }, { { 0x62,-1},{ 0xf0,0x62,-1} }, /*074*/
- { { 0x63,-1},{ 0xf0,0x63,-1} }, { { 0x86,-1},{ 0xf0,0x86,-1} }, { { -1},{ -1} }, { { 0x85,-1},{ 0xf0,0x85,-1} }, /*078*/
- { { 0x68,-1},{ 0xf0,0x68,-1} }, { { 0x13,-1},{ 0xf0,0x13,-1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*07c*/
-
- { { 0x80,-1},{ 0xf0,0x80,-1} }, { { 0x81,-1},{ 0xf0,0x81,-1} }, { { 0x82,-1},{ 0xf0,0x82,-1} }, { { -1},{ -1} }, /*080*/
- { { -1},{ -1} }, { { 0x85,-1},{ 0xf0,0x54,-1} }, { { 0x86,-1},{ 0xf0,0x86,-1} }, { { 0x87,-1},{ 0xf0,0x87,-1} }, /*084*/
- { { 0x88,-1},{ 0xf0,0x88,-1} }, { { 0x89,-1},{ 0xf0,0x89,-1} }, { { 0x8a,-1},{ 0xf0,0x8a,-1} }, { { 0x8b,-1},{ 0xf0,0x8b,-1} }, /*088*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { 0x8e,-1},{ 0xf0,0x8e,-1} }, { { 0x8f,-1},{ 0xf0,0x8f,-1} }, /*08c*/
- { { 0x90,-1},{ 0xf0,0x90,-1} }, { { 0x91,-1},{ 0xf0,0x91,-1} }, { { 0x92,-1},{ 0xf0,0x92,-1} }, { { 0x93,-1},{ 0xf0,0x93,-1} }, /*090*/
- { { 0x94,-1},{ 0xf0,0x94,-1} }, { { 0x95,-1},{ 0xf0,0x95,-1} }, { { 0x96,-1},{ 0xf0,0x96,-1} }, { { 0x97,-1},{ 0xf0,0x97,-1} }, /*094*/
- { { 0x98,-1},{ 0xf0,0x98,-1} }, { { 0x99,-1},{ 0xf0,0x99,-1} }, { { 0x9a,-1},{ 0xf0,0x9a,-1} }, { { 0x9b,-1},{ 0xf0,0x9b,-1} }, /*098*/
- { { 0x9c,-1},{ 0xf0,0x9c,-1} }, { { 0x9d,-1},{ 0xf0,0x9d,-1} }, { { 0x9e,-1},{ 0xf0,0x9e,-1} }, { { 0x9f,-1},{ 0xf0,0x9f,-1} }, /*09c*/
- { { 0xa0,-1},{ 0xf0,0xa0,-1} }, { { 0xa1,-1},{ 0xf0,0xa1,-1} }, { { 0xa2,-1},{ 0xf0,0xa2,-1} }, { { 0xa3,-1},{ 0xf0,0xa3,-1} }, /*0a0*/
- { { 0xa4,-1},{ 0xf0,0xa4,-1} }, { { 0xa5,-1},{ 0xf0,0xa5,-1} }, { { 0xa6,-1},{ 0xf0,0xa6,-1} }, { { 0xa7,-1},{ 0xf0,0xa7,-1} }, /*0a4*/
- { { 0xa8,-1},{ 0xf0,0xa8,-1} }, { { 0xa9,-1},{ 0xf0,0xa9,-1} }, { { 0xaa,-1},{ 0xf0,0xaa,-1} }, { { 0xab,-1},{ 0xf0,0xab,-1} }, /*0a8*/
- { { 0xac,-1},{ 0xf0,0xac,-1} }, { { 0xad,-1},{ 0xf0,0xad,-1} }, { { 0xae,-1},{ 0xf0,0xae,-1} }, { { 0xaf,-1},{ 0xf0,0xaf,-1} }, /*0ac*/
- { { 0xb0,-1},{ 0xf0,0xb0,-1} }, { { 0xb1,-1},{ 0xf0,0xb1,-1} }, { { 0xb2,-1},{ 0xf0,0xb2,-1} }, { { 0xb3,-1},{ 0xf0,0xb3,-1} }, /*0b0*/
- { { 0xb4,-1},{ 0xf0,0xb4,-1} }, { { 0xb5,-1},{ 0xf0,0xb5,-1} }, { { 0xb6,-1},{ 0xf0,0xb6,-1} }, { { 0xb7,-1},{ 0xf0,0xb7,-1} }, /*0b4*/
- { { 0xb8,-1},{ 0xf0,0xb8,-1} }, { { 0xb9,-1},{ 0xf0,0xb9,-1} }, { { 0xba,-1},{ 0xf0,0xba,-1} }, { { 0xbb,-1},{ 0xf0,0xbb,-1} }, /*0b8*/
- { { 0xbc,-1},{ 0xf0,0xbc,-1} }, { { 0xbd,-1},{ 0xf0,0xbd,-1} }, { { 0xbe,-1},{ 0xf0,0xbe,-1} }, { { 0xbf,-1},{ 0xf0,0xbf,-1} }, /*0bc*/
- { { 0xc0,-1},{ 0xf0,0xc0,-1} }, { { 0xc1,-1},{ 0xf0,0xc1,-1} }, { { 0xc2,-1},{ 0xf0,0xc2,-1} }, { { 0xc3,-1},{ 0xf0,0xc3,-1} }, /*0c0*/
- { { 0xc4,-1},{ 0xf0,0xc4,-1} }, { { 0xc5,-1},{ 0xf0,0xc5,-1} }, { { 0xc6,-1},{ 0xf0,0xc6,-1} }, { { 0xc7,-1},{ 0xf0,0xc7,-1} }, /*0c4*/
- { { 0xc8,-1},{ 0xf0,0xc8,-1} }, { { 0xc9,-1},{ 0xf0,0xc9,-1} }, { { 0xca,-1},{ 0xf0,0xca,-1} }, { { 0xcb,-1},{ 0xf0,0xcb,-1} }, /*0c8*/
- { { 0xcc,-1},{ 0xf0,0xcc,-1} }, { { 0xcd,-1},{ 0xf0,0xcd,-1} }, { { 0xce,-1},{ 0xf0,0xce,-1} }, { { 0xcf,-1},{ 0xf0,0xcf,-1} }, /*0cc*/
- { { 0xd0,-1},{ 0xf0,0xd0,-1} }, { { 0xd1,-1},{ 0xf0,0xd0,-1} }, { { 0xd2,-1},{ 0xf0,0xd2,-1} }, { { 0xd3,-1},{ 0xf0,0xd3,-1} }, /*0d0*/
- { { 0xd4,-1},{ 0xf0,0xd4,-1} }, { { 0xd5,-1},{ 0xf0,0xd5,-1} }, { { 0xd6,-1},{ 0xf0,0xd6,-1} }, { { 0xd7,-1},{ 0xf0,0xd7,-1} }, /*0d4*/
- { { 0xd8,-1},{ 0xf0,0xd8,-1} }, { { 0xd9,-1},{ 0xf0,0xd9,-1} }, { { 0xda,-1},{ 0xf0,0xda,-1} }, { { 0xdb,-1},{ 0xf0,0xdb,-1} }, /*0d8*/
- { { 0xdc,-1},{ 0xf0,0xdc,-1} }, { { 0xdd,-1},{ 0xf0,0xdd,-1} }, { { 0xde,-1},{ 0xf0,0xde,-1} }, { { 0xdf,-1},{ 0xf0,0xdf,-1} }, /*0dc*/
- { { 0xe0,-1},{ 0xf0,0xe0,-1} }, { { 0xe1,-1},{ 0xf0,0xe1,-1} }, { { 0xe2,-1},{ 0xf0,0xe2,-1} }, { { 0xe3,-1},{ 0xf0,0xe3,-1} }, /*0e0*/
- { { 0xe4,-1},{ 0xf0,0xe4,-1} }, { { 0xe5,-1},{ 0xf0,0xe5,-1} }, { { 0xe6,-1},{ 0xf0,0xe6,-1} }, { { 0xe7,-1},{ 0xf0,0xe7,-1} }, /*0e4*/
- { { 0xe8,-1},{ 0xf0,0xe8,-1} }, { { 0xe9,-1},{ 0xf0,0xe9,-1} }, { { 0xea,-1},{ 0xf0,0xea,-1} }, { { 0xeb,-1},{ 0xf0,0xeb,-1} }, /*0e8*/
- { { 0xec,-1},{ 0xf0,0xec,-1} }, { { 0xed,-1},{ 0xf0,0xed,-1} }, { { 0xee,-1},{ 0xf0,0xee,-1} }, { { 0xef,-1},{ 0xf0,0xef,-1} }, /*0ec*/
- { { -1},{ -1} }, { { 0xf1,-1},{ 0xf0,0xf1,-1} }, { { 0xf2,-1},{ 0xf0,0xf2,-1} }, { { 0xf3,-1},{ 0xf0,0xf3,-1} }, /*0f0*/
- { { 0xf4,-1},{ 0xf0,0xf4,-1} }, { { 0xf5,-1},{ 0xf0,0xf5,-1} }, { { 0xf6,-1},{ 0xf0,0xf6,-1} }, { { 0xf7,-1},{ 0xf0,0xf7,-1} }, /*0f4*/
- { { 0xf8,-1},{ 0xf0,0xf8,-1} }, { { 0xf9,-1},{ 0xf0,0xf9,-1} }, { { 0xfa,-1},{ 0xf0,0xfa,-1} }, { { 0xfb,-1},{ 0xf0,0xfb,-1} }, /*0f8*/
- { { 0xfc,-1},{ 0xf0,0xfc,-1} }, { { 0xfd,-1},{ 0xf0,0xfd,-1} }, { { 0xfe,-1},{ 0xf0,0xfe,-1} }, { { 0xff,-1},{ 0xf0,0xff,-1} }, /*0fc*/
-
- { { 0x62,-1},{ 0xF0,0x62,-1} }, { {0xe0,0x76,-1},{0xe0,0xF0,0x76,-1} }, { {0xe0,0x16,-1},{0xe0,0xF0,0x16,-1} }, { {0xe0,0x1E,-1},{0xe0,0xF0,0x1E,-1} }, /*100*/
- { {0xe0,0x26,-1},{0xe0,0xF0,0x26,-1} }, { {0xe0,0x25,-1},{0xe0,0xF0,0x25,-1} }, { {0xe0,0x2E,-1},{0xe0,0xF0,0x2E,-1} }, { {0xe0,0x36,-1},{0xe0,0xF0,0x36,-1} }, /*104*/
- { {0xe0,0x3D,-1},{0xe0,0xF0,0x3D,-1} }, { {0xe0,0x3E,-1},{0xe0,0xF0,0x3E,-1} }, { {0xe0,0x46,-1},{0xe0,0xF0,0x46,-1} }, { {0xe0,0x45,-1},{0xe0,0xF0,0x45,-1} }, /*108*/
- { {0xe0,0x4E,-1},{0xe0,0xF0,0x4E,-1} }, { { -1},{ -1} }, { {0xe0,0x66,-1},{0xe0,0xF0,0x66,-1} }, { {0xe0,0x0D,-1},{0xe0,0xF0,0x0D,-1} }, /*10c*/
- { {0xe0,0x15,-1},{0xe0,0xF0,0x15,-1} }, { {0xe0,0x1D,-1},{0xe0,0xF0,0x1D,-1} }, { {0xe0,0x24,-1},{0xe0,0xF0,0x24,-1} }, { {0xe0,0x2D,-1},{0xe0,0xF0,0x2D,-1} }, /*110*/
- { {0xe0,0x2C,-1},{0xe0,0xF0,0x2C,-1} }, { {0xe0,0x35,-1},{0xe0,0xF0,0x35,-1} }, { {0xe0,0x3C,-1},{0xe0,0xF0,0x3C,-1} }, { {0xe0,0x43,-1},{0xe0,0xF0,0x43,-1} }, /*114*/
- { {0xe0,0x44,-1},{0xe0,0xF0,0x44,-1} }, { {0xe0,0x4D,-1},{0xe0,0xF0,0x4D,-1} }, { {0xe0,0x54,-1},{0xe0,0xF0,0x54,-1} }, { {0xe0,0x5B,-1},{0xe0,0xF0,0x5B,-1} }, /*118*/
- { { 0x79,-1},{ 0xf0,0x79,-1} }, { { 0x58,-1},{ 0xf0,0x58,-1} }, { {0xe0,0x1C,-1},{0xe0,0xF0,0x1C,-1} }, { {0xe0,0x1B,-1},{0xe0,0xF0,0x1B,-1} }, /*11c*/
- { {0xe0,0x23,-1},{0xe0,0xF0,0x23,-1} }, { {0xe0,0x2B,-1},{0xe0,0xF0,0x2B,-1} }, { {0xe0,0x34,-1},{0xe0,0xF0,0x34,-1} }, { {0xe0,0x33,-1},{0xe0,0xF0,0x33,-1} }, /*120*/
- { {0xe0,0x3B,-1},{0xe0,0xF0,0x3B,-1} }, { {0xe0,0x42,-1},{0xe0,0xF0,0x42,-1} }, { {0xe0,0x4B,-1},{0xe0,0xF0,0x4B,-1} }, { { -1},{ -1} }, /*124*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*128*/
- { {0xe0,0x1A,-1},{0xe0,0xF0,0x1A,-1} }, { {0xe0,0x22,-1},{0xe0,0xF0,0x22,-1} }, { {0xe0,0x21,-1},{0xe0,0xF0,0x21,-1} }, { {0xe0,0x2A,-1},{0xe0,0xF0,0x2A,-1} }, /*12c*/
- { {0xe0,0x32,-1},{0xe0,0xF0,0x32,-1} }, { {0xe0,0x31,-1},{0xe0,0xF0,0x31,-1} }, { {0xe0,0x3A,-1},{0xe0,0xF0,0x3A,-1} }, { { -1},{ -1} }, /*130*/
- { {0xe0,0x49,-1},{0xe0,0xF0,0x49,-1} }, { { 0x77,-1},{ 0xf0,0x77,-1} }, { { -1},{ -1} }, { { 0x57,-1},{ 0xf0,0x57,-1} }, /*134*/
- { { 0x39,-1},{ 0xf0,0x39,-1} }, { { -1},{ -1} }, { {0xe0,0x58,-1},{0xe0,0xF0,0x58,-1} }, { {0xe0,0x05,-1},{0xe0,0xF0,0x05,-1} }, /*138*/
- { {0xe0,0x06,-1},{0xe0,0xF0,0x06,-1} }, { {0xe0,0x04,-1},{0xe0,0xF0,0x04,-1} }, { {0xe0,0x0C,-1},{0xe0,0xF0,0x0C,-1} }, { {0xe0,0x03,-1},{0xe0,0xF0,0x03,-1} }, /*13c*/
- { {0xe0,0x0B,-1},{0xe0,0xF0,0x0B,-1} }, { {0xe0,0x02,-1},{0xe0,0xF0,0x02,-1} }, { {0xe0,0x0A,-1},{0xe0,0xF0,0x0A,-1} }, { {0xe0,0x01,-1},{0xe0,0xF0,0x01,-1} }, /*140*/
- { {0xe0,0x09,-1},{0xe0,0xF0,0x09,-1} }, { { -1},{ -1} }, { {0xe0,0x7E,-1},{0xe0,0xF0,0x7E,-1} }, { { 0x6E,-1},{ 0xf0,0x6E,-1} }, /*144*/
- { { 0x63,-1},{ 0xf0,0x63,-1} }, { { 0x6F,-1},{ 0xf0,0x6F,-1} }, { { -1},{ -1} }, { { 0x61,-1},{ 0xf0,0x61,-1} }, /*148*/
- { {0xe0,0x73,-1},{0xe0,0xF0,0x73,-1} }, { { 0x6A,-1},{ 0xf0,0x6A,-1} }, { {0xe0,0x79,-1},{0xe0,0xF0,0x79,-1} }, { { 0x65,-1},{ 0xf0,0x65,-1} }, /*14c*/
- { { 0x60,-1},{ 0xf0,0x60,-1} }, { { 0x6D,-1},{ 0xf0,0x6D,-1} }, { { 0x67,-1},{ 0xf0,0x67,-1} }, { { 0x64,-1},{ 0xf0,0x64,-1} }, /*150*/
- { { 0xd4,-1},{ 0xf0,0xD4,-1} }, { {0xe0,0x60,-1},{0xe0,0xF0,0x60,-1} }, { { -1},{ -1} }, { {0xe0,0x78,-1},{0xe0,0xF0,0x78,-1} }, /*154*/
- { {0xe0,0x07,-1},{0xe0,0xF0,0x07,-1} }, { {0xe0,0x0F,-1},{0xe0,0xF0,0x0F,-1} }, { {0xe0,0x17,-1},{0xe0,0xF0,0x17,-1} }, { { 0x8B,-1},{ 0xf0,0x8B,-1} }, /*158*/
- { { 0x8C,-1},{ 0xf0,0x8C,-1} }, { { 0x8D,-1},{ 0xf0,0x8D,-1} }, { { -1},{ -1} }, { { 0x7F,-1},{ 0xf0,0x7F,-1} }, /*15c*/
- { { -1},{ -1} }, { {0xe0,0x4F,-1},{0xe0,0xF0,0x4F,-1} }, { {0xe0,0x56,-1},{0xe0,0xF0,0x56,-1} }, { { -1},{ -1} }, /*160*/
- { {0xe0,0x08,-1},{0xe0,0xF0,0x08,-1} }, { {0xe0,0x10,-1},{0xe0,0xF0,0x10,-1} }, { {0xe0,0x18,-1},{0xe0,0xF0,0x18,-1} }, { {0xe0,0x20,-1},{0xe0,0xF0,0x20,-1} }, /*164*/
- { {0xe0,0x28,-1},{0xe0,0xF0,0x28,-1} }, { {0xe0,0x30,-1},{0xe0,0xF0,0x30,-1} }, { {0xe0,0x38,-1},{0xe0,0xF0,0x38,-1} }, { {0xe0,0x40,-1},{0xe0,0xF0,0x40,-1} }, /*168*/
- { {0xe0,0x48,-1},{0xe0,0xF0,0x48,-1} }, { {0xe0,0x50,-1},{0xe0,0xF0,0x50,-1} }, { {0xe0,0x57,-1},{0xe0,0xF0,0x57,-1} }, { { -1},{ -1} }, /*16c*/
- { {0xe0,0x13,-1},{0xe0,0xF0,0x13,-1} }, { {0xe0,0x19,-1},{0xe0,0xF0,0x19,-1} }, { {0xe0,0x39,-1},{0xe0,0xF0,0x39,-1} }, { {0xe0,0x51,-1},{0xe0,0xF0,0x51,-1} }, /*170*/
- { {0xe0,0x53,-1},{0xe0,0xF0,0x53,-1} }, { {0xe0,0x5C,-1},{0xe0,0xF0,0x5C,-1} }, { { -1},{ -1} }, { {0xe0,0x62,-1},{0xe0,0xF0,0x62,-1} }, /*174*/
- { {0xe0,0x63,-1},{0xe0,0xF0,0x63,-1} }, { {0xe0,0x64,-1},{0xe0,0xF0,0x64,-1} }, { {0xe0,0x65,-1},{0xe0,0xF0,0x65,-1} }, { {0xe0,0x67,-1},{0xe0,0xF0,0x67,-1} }, /*178*/
- { {0xe0,0x68,-1},{0xe0,0xF0,0x68,-1} }, { {0xe0,0x6A,-1},{0xe0,0xF0,0x6A,-1} }, { {0xe0,0x6D,-1},{0xe0,0xF0,0x6D,-1} }, { {0xe0,0x6E,-1},{0xe0,0xF0,0x6E,-1} }, /*17c*/
-
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*180*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*184*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*188*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*18c*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*190*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*194*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*198*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*19c*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1a0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1a4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1a8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1ac*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1c0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1c4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1c8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1cc*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1d0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1d4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1d8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1dc*/
- { { -1},{ -1} }, { {0xe0,0xe1,-1},{0xe0,0xF0,0xE1,-1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1e0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1e4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1e8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { {0xe0,0xee,-1},{0xe0,0xF0,0xEE,-1} }, { { -1},{ -1} }, /*1ec*/
- { { -1},{ -1} }, { {0xe0,0xf1,-1},{0xe0,0xF0,0xF1,-1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1f0*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1f4*/
- { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, { { -1},{ -1} }, /*1f8*/
- { { -1},{ -1} }, { { -1},{ -1} }, { {0xe0,0xfe,-1},{0xe0,0xF0,0xFE,-1} }, { {0xe0,0xff,-1},{0xe0,0xF0,0xFF,-1} } /*1fc*/
-};
-
-
-static void
-kbdlog(const char *fmt, ...)
-{
-#ifdef ENABLE_KEYBOARD_AT_LOG
- va_list ap;
-
- if (keyboard_at_do_log) {
- va_start(ap, fmt);
- pclog_ex(fmt, ap);
- va_end(ap);
- }
-#endif
-}
-
-
-static void
-kbd_setmap(atkbd_t *kbd)
-{
- switch (keyboard_mode & 3) {
- case 1:
- default:
- keyboard_set_table(scancode_set1);
- break;
-
- case 2:
- keyboard_set_table(scancode_set2);
- break;
-
- case 3:
- keyboard_set_table(scancode_set3);
- break;
- }
-
- if (keyboard_mode & 0x20)
- keyboard_set_table(scancode_set1);
-}
-
-
-static void
-kbd_poll(void *priv)
-{
- atkbd_t *kbd = (atkbd_t *)priv;
-
- keyboard_delay += (1000LL * TIMER_USEC);
-
- if ((kbd->out_new != -1) && !kbd->last_irq) {
- kbd->wantirq = 0;
- if (kbd->out_new & 0x100) {
- kbdlog("ATkbd: want mouse data\n");
- if (kbd->mem[0] & 0x02)
- picint(0x1000);
- kbd->out = kbd->out_new & 0xff;
- kbd->out_new = -1;
- kbd->status |= STAT_OFULL;
- kbd->status &= ~STAT_IFULL;
- kbd->status |= STAT_MFULL;
- kbd->last_irq = 0x1000;
- } else {
- kbdlog("ATkbd: want keyboard data\n");
- if (kbd->mem[0] & 0x01)
- picint(2);
- kbd->out = kbd->out_new & 0xff;
- kbd->out_new = -1;
- kbd->status |= STAT_OFULL;
- kbd->status &= ~STAT_IFULL;
- kbd->status &= ~STAT_MFULL;
- kbd->last_irq = 2;
- }
- }
-
- if (kbd->out_new == -1 && !(kbd->status & STAT_OFULL) &&
- key_ctrl_queue_start != key_ctrl_queue_end) {
- kbd->out_new = key_ctrl_queue[key_ctrl_queue_start] | 0x200;
- key_ctrl_queue_start = (key_ctrl_queue_start + 1) & 0xf;
- } else if (!(kbd->status & STAT_OFULL) && kbd->out_new == -1 &&
- kbd->out_delayed != -1) {
- kbd->out_new = kbd->out_delayed;
- kbd->out_delayed = -1;
- } else if (!(kbd->status & STAT_OFULL) && kbd->out_new == -1 &&
- !(kbd->mem[0] & 0x10) && kbd->out_delayed != -1) {
- kbd->out_new = kbd->out_delayed;
- kbd->out_delayed = -1;
- } else if (!(kbd->status & STAT_OFULL) && kbd->out_new == -1/* && !(kbd->mem[0] & 0x20)*/ &&
- (mouse_queue_start != mouse_queue_end)) {
- kbd->out_new = mouse_queue[mouse_queue_start] | 0x100;
- mouse_queue_start = (mouse_queue_start + 1) & 0xf;
- } else if (!(kbd->status&STAT_OFULL) && kbd->out_new == -1 &&
- !(kbd->mem[0]&0x10) && (key_queue_start != key_queue_end)) {
- kbd->out_new = key_queue[key_queue_start];
- key_queue_start = (key_queue_start + 1) & 0xf;
- }
-}
-
-
-static void
-kbd_adddata(uint8_t val)
-{
- key_ctrl_queue[key_ctrl_queue_end] = val;
- key_ctrl_queue_end = (key_ctrl_queue_end + 1) & 0xf;
-
- if (!(CurrentKbd->out_new & 0x300)) {
- CurrentKbd->out_delayed = CurrentKbd->out_new;
- CurrentKbd->out_new = -1;
- }
-}
-
-
-static void
-kbd_adddata_vals(uint8_t *val, uint8_t len)
-{
- int translate = (keyboard_mode & 0x40) && !(keyboard_mode & 0x20);
- int i;
- uint8_t or = 0;
- uint8_t send;
-
- for (i = 0; i < len; i++) {
- if (translate) {
- if (val[i] == 0xf0) {
- or = 0x80;
- continue;
- }
- send = nont_to_t[val[i]] | or;
- if (or == 0x80)
- or = 0;
- } else
- send = val[i];
- kbdlog("%02X", send);
- kbd_adddata(send);
- if (i < (len - 1)) kbdlog(" ");
- }
-
- if (translate) {
- kbdlog(" original: (");
- for (i = 0; i < len; i++) {
- kbdlog("%02X", val[i]);
- if (i < (len - 1)) kbdlog(" ");
- }
- kbdlog(")");
- }
-
- kbdlog("\n");
-}
-
-
-static void
-kbd_adddata_keyboard(uint16_t val)
-{
- int translate = (keyboard_mode & 0x40) && !(keyboard_mode & 0x20);
-
- uint8_t fake_shift[4];
- uint8_t num_lock = 0, shift_states = 0;
-
- keyboard_get_states(NULL, &num_lock, NULL);
- shift_states = keyboard_get_shift() & STATE_SHIFT_MASK;
-
- /* Allow for scan code translation. */
- if (translate && (val == 0xf0)) {
- kbdlog("Translate is on, F0 prefix detected\n");
- sc_or = 0x80;
- return;
- }
-
- /* Skip break code if translated make code has bit 7 set. */
- if (translate && (sc_or == 0x80) && (val & 0x80)) {
- kbdlog("Translate is on, skipping scan code: %02X (original: F0 %02X)\n", nont_to_t[val], val);
- sc_or = 0;
- return;
- }
-
- /* Test for T3100E 'Fn' key (Right Alt / Right Ctrl) */
- if (romset == ROM_T3100E && (keyboard_recv(0xb8) || keyboard_recv(0x9d)))
- {
- switch (val)
- {
- case 0x4f: t3100e_notify_set(0x01); break; /* End */
- case 0x50: t3100e_notify_set(0x02); break; /* Down */
- case 0x51: t3100e_notify_set(0x03); break; /* PgDn */
- case 0x52: t3100e_notify_set(0x04); break; /* Ins */
- case 0x53: t3100e_notify_set(0x05); break; /* Del */
- case 0x54: t3100e_notify_set(0x06); break; /* SysRQ */
- case 0x45: t3100e_notify_set(0x07); break; /* NumLock */
- case 0x46: t3100e_notify_set(0x08); break; /* ScrLock */
- case 0x47: t3100e_notify_set(0x09); break; /* Home */
- case 0x48: t3100e_notify_set(0x0A); break; /* Up */
- case 0x49: t3100e_notify_set(0x0B); break; /* PgUp */
- case 0x4A: t3100e_notify_set(0x0C); break; /* Keypad -*/
- case 0x4B: t3100e_notify_set(0x0D); break; /* Left */
- case 0x4C: t3100e_notify_set(0x0E); break; /* KP 5 */
- case 0x4D: t3100e_notify_set(0x0F); break; /* Right */
- }
- }
-
- kbdlog("Translate is %s, ", translate ? "on" : "off");
- switch(val) {
- case FAKE_LSHIFT_ON:
- kbdlog("fake left shift on, scan code: ");
- if (num_lock) {
- if (shift_states) {
- kbdlog("N/A (one or both shifts on)\n");
- break;
- } else {
- /* Num lock on and no shifts are pressed, send non-inverted fake shift. */
- switch(keyboard_mode & 0x02) {
- case 1:
- fake_shift[0] = 0xe0; fake_shift[1] = 0x2a;
- kbd_adddata_vals(fake_shift, 2);
- break;
- case 2:
- fake_shift[0] = 0xe0; fake_shift[1] = 0x12;
- kbd_adddata_vals(fake_shift, 2);
- break;
- default:
- kbdlog("N/A (scan code set %i)\n", keyboard_mode & 0x02);
- break;
- }
- }
- } else {
- if (shift_states & STATE_LSHIFT) {
- /* Num lock off and left shift pressed. */
- switch(keyboard_mode & 0x02) {
- case 1:
- fake_shift[0] = 0xe0; fake_shift[1] = 0xaa;
- kbd_adddata_vals(fake_shift, 2);
- break;
- case 2:
- fake_shift[0] = 0xe0; fake_shift[1] = 0xf0; fake_shift[2] = 0x12;
- kbd_adddata_vals(fake_shift, 3);
- break;
- default:
- kbdlog("N/A (scan code set %i)\n", keyboard_mode & 0x02);
- break;
- }
- }
- if (shift_states & STATE_RSHIFT) {
- /* Num lock off and right shift pressed. */
- switch(keyboard_mode & 0x02) {
- case 1:
- fake_shift[0] = 0xe0; fake_shift[1] = 0xb6;
- kbd_adddata_vals(fake_shift, 2);
- break;
- case 2:
- fake_shift[0] = 0xe0; fake_shift[1] = 0xf0; fake_shift[2] = 0x59;
- kbd_adddata_vals(fake_shift, 3);
- break;
- default:
- kbdlog("N/A (scan code set %i)\n", keyboard_mode & 0x02);
- break;
- }
- }
- if (!shift_states)
- kbdlog("N/A (both shifts off)\n");
- }
- break;
- case FAKE_LSHIFT_OFF:
- kbdlog("fake left shift on, scan code: ");
- if (num_lock) {
- if (shift_states) {
- kbdlog("N/A (one or both shifts on)\n");
- break;
- } else {
- /* Num lock on and no shifts are pressed, send non-inverted fake shift. */
- switch(keyboard_mode & 0x02) {
- case 1:
- fake_shift[0] = 0xe0; fake_shift[1] = 0xaa;
- kbd_adddata_vals(fake_shift, 2);
- break;
- case 2:
- fake_shift[0] = 0xe0; fake_shift[1] = 0xf0; fake_shift[2] = 0x12;
- kbd_adddata_vals(fake_shift, 3);
- break;
- default:
- kbdlog("N/A (scan code set %i)\n", keyboard_mode & 0x02);
- break;
- }
- }
- } else {
- if (shift_states & STATE_LSHIFT) {
- /* Num lock off and left shift pressed. */
- switch(keyboard_mode & 0x02) {
- case 1:
- fake_shift[0] = 0xe0; fake_shift[1] = 0x2a;
- kbd_adddata_vals(fake_shift, 2);
- break;
- case 2:
- fake_shift[0] = 0xe0; fake_shift[1] = 0x12;
- kbd_adddata_vals(fake_shift, 2);
- break;
- default:
- kbdlog("N/A (scan code set %i)\n", keyboard_mode & 0x02);
- break;
- }
- }
- if (shift_states & STATE_RSHIFT) {
- /* Num lock off and right shift pressed. */
- switch(keyboard_mode & 0x02) {
- case 1:
- fake_shift[0] = 0xe0; fake_shift[1] = 0x36;
- kbd_adddata_vals(fake_shift, 2);
- break;
- case 2:
- fake_shift[0] = 0xe0; fake_shift[1] = 0x59;
- kbd_adddata_vals(fake_shift, 2);
- break;
- default:
- kbdlog("N/A (scan code set %i)\n", keyboard_mode & 0x02);
- break;
- }
- }
- if (!shift_states)
- kbdlog("N/A (both shifts off)\n");
- }
- break;
- default:
- kbdlog("scan code: ");
- if (translate) {
- kbdlog("%02X (original: ", (nont_to_t[val] | sc_or));
- if (sc_or == 0x80)
- kbdlog("F0 ");
- kbdlog("%02X)\n", val);
- } else
- kbdlog("%02X\n", val);
-
- key_queue[key_queue_end] = (translate ? (nont_to_t[val] | sc_or) : val);
- key_queue_end = (key_queue_end + 1) & 0xf;
- break;
- }
-
- if (sc_or == 0x80) sc_or = 0;
-}
-
-
-static void
-kbd_output_write(atkbd_t *kbd, uint8_t val)
-{
- kbdlog("Write output port: %02X (old: %02X)\n", val, kbd->output_port);
- if ((kbd->output_port ^ val) & 0x20) { /*IRQ 12*/
- if (val & 0x20)
- picint(1 << 12);
- else
- picintc(1 << 12);
- }
- if ((kbd->output_port ^ val) & 0x10) { /*IRQ 1*/
- if (val & 0x10)
- picint(1 << 1);
- else
- picintc(1 << 1);
- }
- if ((kbd->output_port ^ val) & 0x02) { /*A20 enable change*/
- mem_a20_key = val & 0x02;
- mem_a20_recalc();
- flushmmucache();
- }
- if ((kbd->output_port ^ val) & 0x01) { /*Reset*/
- if (! (val & 0x01)) {
- /* Pin 0 selected. */
- softresetx86(); /*Pulse reset!*/
- cpu_set_edx();
- }
- }
- kbd->output_port = val;
-}
-
-
-static void
-kbd_cmd_write(atkbd_t *kbd, uint8_t val)
-{
- kbdlog("Write command byte: %02X (old: %02X)\n", val, kbd->mem[0]);
-
- if ((val & 1) && (kbd->status & STAT_OFULL))
- kbd->wantirq = 1;
- if (!(val & 1) && kbd->wantirq)
- kbd->wantirq = 0;
-
- /* PS/2 type 2 keyboard controllers always force the XLAT bit to 0. */
- if ((kbd->flags & KBC_TYPE_MASK) == KBC_TYPE_PS2_2) {
- val &= ~CCB_TRANSLATE;
- kbd->mem[0] &= ~CCB_TRANSLATE;
- }
-
- /* Scan code translate ON/OFF. */
- keyboard_mode &= 0x93;
- keyboard_mode |= (val & MODE_MASK);
-
- keyboard_scan = !(val & 0x10);
- kbdlog("ATkbd: keyboard is now %s\n", mouse_scan ? "enabled" : "disabled");
- kbdlog("ATkbd: keyboard interrupt is now %s\n", (val & 0x01) ? "enabled" : "disabled");
-
- /* ISA AT keyboard controllers use bit 5 for keyboard mode (1 = PC/XT, 2 = AT);
- PS/2 (and EISA/PCI) keyboard controllers use it as the PS/2 mouse enable switch. */
- if (((kbd->flags & KBC_VEN_MASK) == KBC_VEN_AMI) || ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1)) {
- keyboard_mode &= ~CCB_PCMODE;
-
- mouse_scan = !(val & 0x20);
- kbdlog("ATkbd: mouse is now %s\n", mouse_scan ? "enabled" : "disabled");
-
- kbdlog("ATkbd: mouse interrupt is now %s\n", (val & 0x02) ? "enabled" : "disabled");
- }
-}
-
-
-static void
-kbd_output_pulse(atkbd_t *kbd, uint8_t mask)
-{
- if (mask != 0xF) {
- kbd->old_output_port = kbd->output_port & ~(0xF0 | mask);
- kbd_output_write(kbd, kbd->output_port & (0xF0 | mask));
- kbd->pulse_cb = 6LL * TIMER_USEC;
- }
-}
-
-
-static void
-kbd_pulse_poll(void *p)
-{
- atkbd_t *kbd = (atkbd_t *) p;
-
- kbd_output_write(kbd, kbd->output_port | kbd->old_output_port);
- kbd->pulse_cb = 0LL;
-}
-
-
-static void
-kbd_timeout_poll(void *p)
-{
- atkbd_t *kbd = (atkbd_t *) p;
-
- kbd->key_wantdata = 0;
- kbd->want60 = 0;
- if (mouse_p)
- mouse_clear_data(mouse_p);
-
- kbd->timeout = 0LL;
-}
-
-
-static void
-kbd_keyboard_set(atkbd_t *kbd, uint8_t enable)
-{
- kbd->mem[0] &= 0xef;
- kbd->mem[0] |= (enable ? 0x00 : 0x10);
- keyboard_scan = enable;
-}
-
-
-static void
-kbd_mouse_set(atkbd_t *kbd, uint8_t enable)
-{
- kbd->mem[0] &= 0xdf;
- kbd->mem[0] |= (enable ? 0x00 : 0x20);
- mouse_scan = enable;
-}
-
-
-static uint8_t
-kbd_write64_generic(void *p, uint8_t val)
-{
- atkbd_t *kbd = (atkbd_t *) p;
-
- switch (val) {
- case 0xa4: /*Check if password installed*/
- if ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1) {
- kbdlog("ATkbd: check if password installed\n");
- kbd_adddata(0xf1);
- return 0;
- } else
- kbdlog("ATkbd: bad command A4\n");
- break;
- case 0xa7: /*Disable mouse port*/
- if ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1) {
- kbdlog("ATkbd: disable mouse port\n");
- kbd_mouse_set(kbd, 0);
- return 0;
- } else
- kbdlog("ATkbd: bad command A7\n");
- break;
- case 0xa8: /*Enable mouse port*/
- if ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1) {
- kbdlog("ATkbd: enable mouse port\n");
- kbd_mouse_set(kbd, 1);
- return 0;
- } else
- kbdlog("ATkbd: bad command A8\n");
- break;
- case 0xa9: /*Test mouse port*/
- kbdlog("ATkbd: test mouse port\n");
- if ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1) {
- if (mouse_write)
- kbd_adddata(0x00); /*no error*/
- else
- kbd_adddata(0xff); /*no mouse*/
- return 0;
- } else
- kbdlog("ATkbd: bad command A9\n");
- break;
- case 0xaf: /*Read keyboard version*/
- kbdlog("ATkbd: read keyboard version\n");
- kbd_adddata(0x00);
- return 0;
- case 0xc0: /*Read input port*/
- kbdlog("ATkbd: read input port\n");
-
- kbd_adddata(kbd->input_port | 4 | fdc_ps1_525());
- kbd->input_port = ((kbd->input_port + 1) & 3) | (kbd->input_port & 0xfc) | fdc_ps1_525();
- return 0;
- case 0xd3: /*Write mouse output buffer*/
- if ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1) {
- kbdlog("ATkbd: write mouse output buffer\n");
- kbd->want60 = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- return 0;
- }
- break;
- case 0xd4: /*Write to mouse*/
- if ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1) {
- kbdlog("ATkbd: write to mouse\n");
- kbd->want60 = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- return 0;
- }
- break;
- case 0xf0: case 0xf1: case 0xf2: case 0xf3:
- case 0xf4: case 0xf5: case 0xf6: case 0xf7:
- case 0xf8: case 0xf9: case 0xfa: case 0xfb:
- case 0xfc: case 0xfd: case 0xfe: case 0xff:
- // kbdlog("ATkbd: pulse %01X\n", val & 0x0f);
- kbd_output_pulse(kbd, val & 0x0f);
- return 0;
- }
-
- return 1;
-}
-
-
-static uint8_t
-kbd_write60_ami(void *p, uint8_t val)
-{
- atkbd_t *kbd = (atkbd_t *) p;
-
- switch(kbd->command) {
- /* 0x40 - 0x5F are aliases for 0x60-0x7F */
- case 0x40: case 0x41: case 0x42: case 0x43:
- case 0x44: case 0x45: case 0x46: case 0x47:
- case 0x48: case 0x49: case 0x4a: case 0x4b:
- case 0x4c: case 0x4d: case 0x4e: case 0x4f:
- case 0x50: case 0x51: case 0x52: case 0x53:
- case 0x54: case 0x55: case 0x56: case 0x57:
- case 0x58: case 0x59: case 0x5a: case 0x5b:
- case 0x5c: case 0x5d: case 0x5e: case 0x5f:
- kbdlog("AMI - alias write to register %08X\n", kbd->command);
- kbd->mem[kbd->command & 0x1f] = val;
- if (kbd->command == 0x60)
- kbd_cmd_write(kbd, val);
- return 0;
- case 0xaf: /*AMI - set extended controller RAM*/
- kbdlog("AMI - set extended controller RAM\n");
- if (kbd->secr_phase == 1) {
- kbd->mem_addr = val;
- kbd->want60 = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- kbd->secr_phase = 2;
- } else if (kbd->secr_phase == 2) {
- kbd->mem[kbd->mem_addr] = val;
- kbd->secr_phase = 0;
- }
- return 0;
- case 0xcb: /*AMI - set keyboard mode*/
- kbdlog("AMI - set keyboard mode\n");
- return 0;
- }
-
- return 1;
-}
-
-
-static uint8_t
-kbd_write64_ami(void *p, uint8_t val)
-{
- atkbd_t *kbd = (atkbd_t *) p;
-
- switch (val) {
- case 0x00: case 0x01: case 0x02: case 0x03:
- case 0x04: case 0x05: case 0x06: case 0x07:
- case 0x08: case 0x09: case 0x0a: case 0x0b:
- case 0x0c: case 0x0d: case 0x0e: case 0x0f:
- case 0x10: case 0x11: case 0x12: case 0x13:
- case 0x14: case 0x15: case 0x16: case 0x17:
- case 0x18: case 0x19: case 0x1a: case 0x1b:
- case 0x1c: case 0x1d: case 0x1e: case 0x1f:
- kbdlog("AMI - alias read from register %08X\n", val);
- kbd_adddata(kbd->mem[val]);
- return 0;
- case 0x40: case 0x41: case 0x42: case 0x43:
- case 0x44: case 0x45: case 0x46: case 0x47:
- case 0x48: case 0x49: case 0x4a: case 0x4b:
- case 0x4c: case 0x4d: case 0x4e: case 0x4f:
- case 0x50: case 0x51: case 0x52: case 0x53:
- case 0x54: case 0x55: case 0x56: case 0x57:
- case 0x58: case 0x59: case 0x5a: case 0x5b:
- case 0x5c: case 0x5d: case 0x5e: case 0x5f:
- kbdlog("AMI - alias write to register %08X\n", kbd->command);
- kbd->want60 = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- return 0;
- case 0xa1: /*AMI - get controller version*/
- kbdlog("AMI - get controller version\n");
- return 0;
- case 0xa2: /*AMI - reset keyboard controller lines P22 and P23 low*/
- if ((kbd->flags & KBC_TYPE_MASK) < KBC_TYPE_PS2_1) {
- kbdlog("AMI - reset keyboard controller lines P22 and P23 low\n");
- kbd_output_write(kbd, kbd->output_port & 0xf3);
- kbd_adddata(0x00);
- return 0;
- }
- break;
- case 0xa3: /*AMI - set keyboard controller lines P22 and P23 high*/
- if ((kbd->flags & KBC_TYPE_MASK) < KBC_TYPE_PS2_1) {
- kbdlog("AMI - set keyboard controller lines P22 and P23 high\n");
- kbd_output_write(kbd, kbd->output_port | 0x0c);
- kbd_adddata(0x00);
- return 0;
- }
- break;
- case 0xa4: /* AMI - write clock = low */
- if ((kbd->flags & KBC_TYPE_MASK) < KBC_TYPE_PS2_1) {
- kbdlog("AMI - write clock = low\n");
- kbd->ami_stat &= 0xfe;
- return 0;
- }
- break;
- case 0xa5: /* AMI - write clock = high */
- if ((kbd->flags & KBC_TYPE_MASK) < KBC_TYPE_PS2_1) {
- kbdlog("AMI - write clock = high\n");
- kbd->ami_stat |= 0x01;
- return 0;
- }
- break;
- case 0xa6: /* AMI - read clock */
- if ((kbd->flags & KBC_TYPE_MASK) < KBC_TYPE_PS2_1) {
- kbdlog("AMI - read clock\n");
- kbd_adddata(!!(kbd->ami_stat & 1));
- return 0;
- }
- break;
- case 0xa7: /* AMI - write cache bad */
- if ((kbd->flags & KBC_TYPE_MASK) < KBC_TYPE_PS2_1) {
- kbdlog("AMI - write cache bad\n");
- kbd->ami_stat &= 0xfd;
- return 0;
- }
- break;
- case 0xa8: /* AMI - write cache good */
- if ((kbd->flags & KBC_TYPE_MASK) < KBC_TYPE_PS2_1) {
- kbdlog("AMI - write cache good\n");
- kbd->ami_stat |= 0x02;
- return 0;
- }
- break;
- case 0xa9: /* AMI - read cache */
- if ((kbd->flags & KBC_TYPE_MASK) < KBC_TYPE_PS2_1) {
- kbdlog("AMI - read cache\n");
- kbd_adddata(!!(kbd->ami_stat & 2));
- return 0;
- }
- break;
- case 0xaf: /*Set extended controller RAM*/
- kbdlog("ATkbd: set extended controller RAM\n");
- kbd->want60 = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- kbd->secr_phase = 1;
- return 0;
- case 0xb0: case 0xb1: case 0xb2: case 0xb3:
- /*Set keyboard controller line P10-P13 (input port bits 0-3) low*/
- if (!PCI || (val > 0xb1))
- kbd->input_port &= ~(1 << (val & 0x03));
- kbd_adddata(0x00);
- return 0;
- case 0xb4: case 0xb5:
- /*Set keyboard controller line P22-P23 (output port bits 2-3) low*/
- if (!PCI)
- kbd_output_write(kbd, kbd->output_port & ~(4 << (val & 0x01)));
- kbd_adddata(0x00);
- return 0;
- case 0xb8: case 0xb9: case 0xba: case 0xbb:
- /*Set keyboard controller line P10-P13 (input port bits 0-3) high*/
- if (!PCI || (val > 0xb9)) {
- kbd->input_port |= (1 << (val & 0x03));
- kbd_adddata(0x00);
- }
- return 0;
- case 0xbc: case 0xbd:
- /*Set keyboard controller line P22-P23 (output port bits 2-3) high*/
- if (!PCI)
- kbd_output_write(kbd, kbd->output_port | (4 << (val & 0x01)));
- kbd_adddata(0x00);
- return 0;
- case 0xc8: /*AMI - unblock keyboard controller lines P22 and P23
- (allow command D1 to change bits 2 and 3 of the output
- port)*/
- kbdlog("AMI - unblock keyboard controller lines P22 and P23\n");
- kbd->output_locked = 1;
- return 0;
- case 0xc9: /*AMI - block keyboard controller lines P22 and P23
- (prevent command D1 from changing bits 2 and 3 of the
- output port)*/
- kbdlog("AMI - block keyboard controller lines P22 and P23\n");
- kbd->output_locked = 1;
- return 0;
- case 0xca: /*AMI - read keyboard mode*/
- kbdlog("AMI - read keyboard mode\n");
- kbd_adddata(0x00); /*ISA mode*/
- return 0;
- case 0xcb: /*AMI - set keyboard mode*/
- kbdlog("AMI - set keyboard mode\n");
- kbd->want60 = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- return 0;
- case 0xef: /*??? - sent by AMI486*/
- kbdlog("??? - sent by AMI486\n");
- return 0;
- }
-
- return kbd_write64_generic(kbd, val);
-}
-
-
-static uint8_t
-kbd_write64_ibm_mca(void *p, uint8_t val)
-{
- atkbd_t *kbd = (atkbd_t *) p;
-
- switch (val) {
- case 0xc1: /*Copy bits 0 to 3 of input port to status bits 4 to 7*/
- kbdlog("ATkbd: copy bits 0 to 3 of input port to status bits 4 to 7\n");
- kbd->status &= 0xf;
- kbd->status |= ((((kbd->input_port & 0xfc) | 0x84 | fdc_ps1_525()) & 0xf) << 4);
- return 0;
- case 0xc2: /*Copy bits 4 to 7 of input port to status bits 4 to 7*/
- kbdlog("ATkbd: copy bits 4 to 7 of input port to status bits 4 to 7\n");
- kbd->status &= 0xf;
- kbd->status |= (((kbd->input_port & 0xfc) | 0x84 | fdc_ps1_525()) & 0xf0);
- return 0;
- case 0xaf:
- kbdlog("ATkbd: bad kbc command AF\n");
- return 1;
- case 0xf0: case 0xf1: case 0xf2: case 0xf3:
- case 0xf4: case 0xf5: case 0xf6: case 0xf7:
- case 0xf8: case 0xf9: case 0xfa: case 0xfb:
- case 0xfc: case 0xfd: case 0xfe: case 0xff:
- kbdlog("ATkbd: pulse: %01X\n", (val & 0x03) | 0x0c);
- kbd_output_pulse(kbd, (val & 0x03) | 0x0c);
- return 0;
- }
-
- return kbd_write64_generic(kbd, val);
-}
-
-
-static uint8_t
-kbd_write60_quadtel(void *p, uint8_t val)
-{
- atkbd_t *kbd = (atkbd_t *) p;
-
- switch(kbd->command) {
- case 0xcf: /*??? - sent by MegaPC BIOS*/
- kbdlog("??? - sent by MegaPC BIOS\n");
- return 0;
- }
-
- return 1;
-}
-
-
-static uint8_t
-kbd_write64_quadtel(void *p, uint8_t val)
-{
- atkbd_t *kbd = (atkbd_t *) p;
-
- switch (val) {
- case 0xaf:
- kbdlog("ATkbd: bad kbc command AF\n");
- return 1;
- case 0xcf: /*??? - sent by MegaPC BIOS*/
- kbdlog("??? - sent by MegaPC BIOS\n");
- kbd->want60 = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- return 0;
- }
-
- return kbd_write64_generic(kbd, val);
-}
-
-
-static uint8_t
-kbd_write60_toshiba(void *p, uint8_t val)
-{
- atkbd_t *kbd = (atkbd_t *) p;
-
- switch(kbd->command) {
- case 0xb6: /* T3100e - set colour/mono switch */
- t3100e_mono_set(val);
- return 0;
- }
-
- return 1;
-}
-
-
-static uint8_t
-kbd_write64_toshiba(void *p, uint8_t val)
-{
- atkbd_t *kbd = (atkbd_t *) p;
-
- switch (val) {
- case 0xaf:
- kbdlog("ATkbd: bad kbc command AF\n");
- return 1;
- case 0xb0: /* T3100e: Turbo on */
- t3100e_turbo_set(1);
- return 0;
- case 0xb1: /* T3100e: Turbo off */
- t3100e_turbo_set(0);
- return 0;
- case 0xb2: /* T3100e: Select external display */
- t3100e_display_set(0x00);
- return 0;
- case 0xb3: /* T3100e: Select internal display */
- t3100e_display_set(0x01);
- return 0;
- case 0xb4: /* T3100e: Get configuration / status */
- kbd_adddata(t3100e_config_get());
- return 0;
- case 0xb5: /* T3100e: Get colour / mono byte */
- kbd_adddata(t3100e_mono_get());
- return 0;
- case 0xb6: /* T3100e: Set colour / mono byte */
- kbd->want60 = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- return 0;
- case 0xb7: /* T3100e: Emulate PS/2 keyboard - not implemented */
- case 0xb8: /* T3100e: Emulate AT keyboard - not implemented */
- return 0;
- case 0xbb: /* T3100e: Read 'Fn' key.
- Return it for right Ctrl and right Alt; on the real
- T3100e, these keystrokes could only be generated
- using 'Fn'. */
- if (keyboard_recv(0xb8) || /* Right Alt */
- keyboard_recv(0x9d)) /* Right Ctrl */
- kbd_adddata(0x04);
- else kbd_adddata(0x00);
- return 0;
- case 0xbc: /* T3100e: Reset Fn+Key notification */
- t3100e_notify_set(0x00);
- return 0;
- case 0xc0: /*Read input port*/
- kbdlog("ATkbd: read input port\n");
-
- /* The T3100e returns all bits set except bit 6 which
- * is set by t3100e_mono_set() */
- kbd->input_port = (t3100e_mono_get() & 1) ? 0xFF : 0xBF;
- kbd_adddata(kbd->input_port);
- return 0;
-
- }
-
- return kbd_write64_generic(kbd, val);
-}
-
-
-static void
-kbd_write(uint16_t port, uint8_t val, void *priv)
-{
- atkbd_t *kbd = (atkbd_t *)priv;
- int i = 0;
- int bad = 1;
- uint8_t mask;
-
- if (romset == ROM_XI8088 && port == 0x63)
- port = 0x61;
-
- switch (port) {
- case 0x60:
- if (kbd->want60) {
- /*Write to controller*/
- kbd->want60 = 0;
- switch (kbd->command) {
- case 0x60: case 0x61: case 0x62: case 0x63:
- case 0x64: case 0x65: case 0x66: case 0x67:
- case 0x68: case 0x69: case 0x6a: case 0x6b:
- case 0x6c: case 0x6d: case 0x6e: case 0x6f:
- case 0x70: case 0x71: case 0x72: case 0x73:
- case 0x74: case 0x75: case 0x76: case 0x77:
- case 0x78: case 0x79: case 0x7a: case 0x7b:
- case 0x7c: case 0x7d: case 0x7e: case 0x7f:
- kbd->mem[kbd->command & 0x1f] = val;
- if (kbd->command == 0x60)
- kbd_cmd_write(kbd, val);
- break;
-
- case 0xd1: /*Write output port*/
- // kbdlog("Write output port\n");
- if (kbd->output_locked) {
- /*If keyboard controller lines P22-P23 are blocked,
- we force them to remain unchanged.*/
- val &= ~0x0c;
- val |= (kbd->output_port & 0x0c);
- }
- kbd_output_write(kbd, val);
- break;
-
- case 0xd2: /*Write to keyboard output buffer*/
- kbdlog("ATkbd: write to keyboard output buffer\n");
- kbd_adddata_keyboard(val);
- break;
-
- case 0xd3: /*Write to mouse output buffer*/
- kbdlog("ATkbd: write to mouse output buffer\n");
- if (mouse_write && ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1))
- keyboard_at_adddata_mouse(val);
- break;
-
- case 0xd4: /*Write to mouse*/
- kbdlog("ATkbd: write to mouse (%02X)\n", val);
- kbd_mouse_set(kbd, 1);
- if (mouse_write && ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1))
- mouse_write(val, mouse_p);
- else if (!mouse_write && ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1))
- keyboard_at_adddata_mouse(0xff);
- break;
-
- default:
- /* Run the vendor-specific command handler, if present,
- otherwise (or if the former returns 1), assume bad command. */
- if (kbd->write60_ven)
- bad = kbd->write60_ven(kbd, val);
-
- if (bad)
- kbdlog("ATkbd: bad keyboard controller 0060 write %02X command %02X\n", val, kbd->command);
- }
- } else {
- /*Write to keyboard*/
- kbd->mem[0] &= ~0x10;
- if (kbd->key_wantdata) {
- kbd->key_wantdata = 0;
- switch (kbd->key_command) {
- case 0xed: /*Set/reset LEDs*/
- kbd_adddata_keyboard(0xfa);
- break;
-
- case 0xf0: /*Get/set scancode set*/
- if (val == 0) {
- kbd_adddata_keyboard(keyboard_mode & 3);
- } else {
- if (val <= 3) {
- keyboard_mode &= 0xFC;
- keyboard_mode |= (val & 3);
- }
- kbd_adddata_keyboard(0xfa);
- kbd_setmap(kbd);
- }
- break;
-
- case 0xf3: /*Set typematic rate/delay*/
- kbd_adddata_keyboard(0xfa);
- break;
-
- default:
- kbdlog("ATkbd: bad keyboard 0060 write %02X command %02X\n", val, kbd->key_command);
- }
- } else {
- kbd->key_command = val;
- kbd_keyboard_set(kbd, 1);
- switch (val) {
- case 0x00:
- kbdlog("ATkbd: command 00\n");
- kbd_adddata_keyboard(0xfa);
- break;
-
- case 0x05: /*??? - sent by NT 4.0*/
- kbdlog("ATkbd: nt 4.0 command fe\n");
- kbd_adddata_keyboard(0xfe);
- break;
-
- case 0x71: /*These two commands are sent by Pentium-era AMI BIOS'es.*/
- case 0x82:
- kbdlog("ATkbd: pentium-era ami bios command %02x\n", val);
- break;
-
- case 0xed: /*Set/reset LEDs*/
- kbdlog("ATkbd: set/reset leds\n");
- kbd->key_wantdata = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- kbd_adddata_keyboard(0xfa);
- break;
-
- case 0xee: /*Diagnostic echo*/
- kbdlog("ATkbd: diagnostic echo\n");
- kbd_adddata_keyboard(0xee);
- break;
-
- case 0xef: /*NOP (No OPeration). Reserved for future use.*/
- kbdlog("ATkbd: kbd nop\n");
- break;
-
- case 0xf0: /*Get/set scan code set*/
- kbdlog("ATkbd: scan code set\n");
- kbd->key_wantdata = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- kbd_adddata_keyboard(0xfa);
- break;
-
- case 0xf2: /*Read ID*/
- /* Fixed as translation will be done in kbd_adddata_keyboard(). */
- kbdlog("ATkbd: read keyboard id\n");
- kbd_adddata_keyboard(0xfa);
- kbd_adddata_keyboard(0xab);
- kbd_adddata_keyboard(0x83);
- break;
-
- case 0xf3: /*Set typematic rate/delay*/
- kbdlog("ATkbd: set typematic rate/delay\n");
- kbd->key_wantdata = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- kbd_adddata_keyboard(0xfa);
- break;
-
- case 0xf4: /*Enable keyboard*/
- kbdlog("ATkbd: enable keyboard via keyboard\n");
- keyboard_scan = 1;
- kbd_adddata_keyboard(0xfa);
- break;
-
- case 0xf5: /*Disable keyboard*/
- kbdlog("ATkbd: disable keyboard via keyboard\n");
- keyboard_scan = 0;
- kbd_adddata_keyboard(0xfa);
- break;
-
- case 0xf6: /*Set defaults*/
- kbdlog("ATkbd: set defaults\n");
- keyboard_set3_all_break = 0;
- keyboard_set3_all_repeat = 0;
- memset(keyboard_set3_flags, 0, 512);
- keyboard_mode = (keyboard_mode & 0xFC) | 0x02;
- kbd_adddata_keyboard(0xfa);
- kbd_setmap(kbd);
- break;
-
- case 0xf7: /*Set all keys to repeat*/
- kbdlog("ATkbd: set all keys to repeat\n");
- keyboard_set3_all_break = 1;
- kbd_adddata_keyboard(0xfa);
- break;
-
- case 0xf8: /*Set all keys to give make/break codes*/
- kbdlog("ATkbd: set all keys to give make/break codes\n");
- keyboard_set3_all_break = 1;
- kbd_adddata_keyboard(0xfa);
- break;
-
- case 0xf9: /*Set all keys to give make codes only*/
- kbdlog("ATkbd: set all keys to give make codes only\n");
- keyboard_set3_all_break = 0;
- kbd_adddata_keyboard(0xfa);
- break;
-
- case 0xfa: /*Set all keys to repeat and give make/break codes*/
- kbdlog("ATkbd: set all keys to repeat and give make/break codes\n");
- keyboard_set3_all_repeat = 1;
- keyboard_set3_all_break = 1;
- kbd_adddata_keyboard(0xfa);
- break;
-
- case 0xfe: /*Resend last scan code*/
- kbdlog("ATkbd: reset last scan code\n");
- kbd_adddata_keyboard(kbd->last_scan_code);
- break;
-
- case 0xff: /*Reset*/
- kbdlog("ATkbd: kbd reset\n");
- key_queue_start = key_queue_end = 0; /*Clear key queue*/
- kbd_adddata_keyboard(0xfa);
- kbd_adddata_keyboard(0xaa);
- /* Set system flag to 1 and scan code set to 2. */
- keyboard_mode &= 0xFC;
- keyboard_mode |= 2;
- kbd_setmap(kbd);
- break;
-
- default:
- kbdlog("ATkbd: bad keyboard command %02X\n", val);
- kbd_adddata_keyboard(0xfe);
- }
- }
- }
- break;
-
- case 0x61:
- ppi.pb = val;
-
- timer_process();
- timer_update_outstanding();
-
- speaker_update();
- speaker_gated = val & 1;
- speaker_enable = val & 2;
- if (speaker_enable)
- was_speaker_enable = 1;
- pit_set_gate(&pit, 2, val & 1);
-
- if (romset == ROM_XI8088) {
- if (val & 0x04)
- xi8088_turbo_set(1);
- else
- xi8088_turbo_set(0);
- }
- break;
-
- case 0x64:
- kbd->want60 = 0;
- kbd->command = val;
- /*New controller command*/
- switch (val) {
- case 0x20: case 0x21: case 0x22: case 0x23:
- case 0x24: case 0x25: case 0x26: case 0x27:
- case 0x28: case 0x29: case 0x2a: case 0x2b:
- case 0x2c: case 0x2d: case 0x2e: case 0x2f:
- case 0x30: case 0x31: case 0x32: case 0x33:
- case 0x34: case 0x35: case 0x36: case 0x37:
- case 0x38: case 0x39: case 0x3a: case 0x3b:
- case 0x3c: case 0x3d: case 0x3e: case 0x3f:
- kbd_adddata(kbd->mem[val & 0x1f]);
- break;
-
- case 0x60: case 0x61: case 0x62: case 0x63:
- case 0x64: case 0x65: case 0x66: case 0x67:
- case 0x68: case 0x69: case 0x6a: case 0x6b:
- case 0x6c: case 0x6d: case 0x6e: case 0x6f:
- case 0x70: case 0x71: case 0x72: case 0x73:
- case 0x74: case 0x75: case 0x76: case 0x77:
- case 0x78: case 0x79: case 0x7a: case 0x7b:
- case 0x7c: case 0x7d: case 0x7e: case 0x7f:
- kbd->want60 = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- break;
-
- case 0xaa: /*Self-test*/
- kbdlog("Self-test\n");
- if ((kbd->flags & KBC_VEN_MASK) == KBC_VEN_TOSHIBA)
- kbd->status |= STAT_IFULL;
- if (! kbd->initialized) {
- kbd->initialized = 1;
- key_ctrl_queue_start = key_ctrl_queue_end = 0;
- kbd->status &= ~STAT_OFULL;
- }
- kbd->status |= STAT_SYSFLAG;
- kbd->mem[0] |= 0x04;
- kbd_keyboard_set(kbd, 1);
- if ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1)
- kbd_mouse_set(kbd, 1);
- kbd_output_write(kbd, 0xcf);
- kbd_adddata(0x55);
- break;
-
- case 0xab: /*Interface test*/
- kbdlog("ATkbd: interface test\n");
- kbd_adddata(0x00); /*no error*/
- break;
-
- case 0xac: /*Diagnostic dump*/
- kbdlog("ATkbd: diagnostic dump\n");
- for (i=0; i<16; i++)
- kbd_adddata(kbd->mem[i]);
- kbd_adddata((kbd->input_port & 0xf0) | 0x80);
- kbd_adddata(kbd->output_port);
- kbd_adddata(kbd->status);
- break;
-
- case 0xad: /*Disable keyboard*/
- kbdlog("ATkbd: disable keyboard\n");
- kbd_keyboard_set(kbd, 0);
- break;
-
- case 0xae: /*Enable keyboard*/
- kbdlog("ATkbd: enable keyboard\n");
- kbd_keyboard_set(kbd, 1);
- break;
-
- case 0xd0: /*Read output port*/
- kbdlog("ATkbd: read output port\n");
- mask = 0xff;
- if(!keyboard_scan)
- mask &= 0xbf;
- if(!mouse_scan && ((kbd->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1))
- mask &= 0xf7;
- kbd_adddata(kbd->output_port & mask);
- break;
-
- case 0xd1: /*Write output port*/
- // kbdlog("ATkbd: write output port\n");
- kbd->want60 = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- break;
-
- case 0xd2: /*Write keyboard output buffer*/
- kbdlog("ATkbd: write keyboard output buffer\n");
- kbd->want60 = 1;
- kbd->timeout = 25000LL * TIMER_USEC;
- break;
-
- case 0xdd: /* Disable A20 Address Line */
- kbdlog("ATkbd: disable A20 Address Line\n");
- kbd_output_write(kbd, kbd->output_port & 0xfd);
- break;
-
- case 0xdf: /* Enable A20 Address Line */
- kbdlog("ATkbd: enable A20 address line\n");
- kbd_output_write(kbd, kbd->output_port | 0x02);
- break;
-
- case 0xe0: /*Read test inputs*/
- kbdlog("ATkbd: read test inputs\n");
- kbd_adddata(0x00);
- break;
-
- default:
- /* Run the vendor-specific command handler, if present,
- otherwise (or if the former returns 1), assume bad command. */
- if (kbd->write64_ven)
- bad = kbd->write64_ven(kbd, val);
-
- if (bad)
- kbdlog("ATkbd: bad controller command %02X\n", val);
- }
- break;
- }
-}
-
-
-static uint8_t
-kbd_read(uint16_t port, void *priv)
-{
- atkbd_t *kbd = (atkbd_t *)priv;
- uint8_t ret = 0xff;
-
- if (romset == ROM_XI8088 && port == 0x63)
- port = 0x61;
-
- switch (port) {
- case 0x60:
- ret = kbd->out;
- kbd->status &= ~(STAT_OFULL);
- picintc(kbd->last_irq);
- kbd->last_irq = 0;
- break;
-
- case 0x61:
- ret = ppi.pb & ~0xe0;
- if (ppispeakon)
- ret |= 0x20;
- if ((kbd->flags & KBC_TYPE_MASK) != KBC_TYPE_ISA) {
- if (kbd->refresh)
- ret |= 0x10;
- else
- ret &= ~0x10;
- }
- if (romset == ROM_XI8088){
- if (xi8088_turbo_get())
- ret |= 0x04;
- else
- ret &= ~0x04;
- }
- break;
-
- case 0x64:
- ret = (kbd->status & 0xFB) | (keyboard_mode & CCB_SYSTEM);
- ret |= STAT_LOCK;
- /* The transmit timeout (TTIMEOUT) flag should *NOT* be cleared, otherwise
- the IBM PS/2 Model 80's BIOS gives error 8601 (mouse error). */
- kbd->status &= ~(STAT_RTIMEOUT/* | STAT_TTIMEOUT*/);
- break;
- }
-
- return(ret);
-}
-
-
-static void
-kbd_refresh(void *priv)
-{
- atkbd_t *kbd = (atkbd_t *)priv;
-
- kbd->refresh = !kbd->refresh;
- kbd->refresh_time += PS2_REFRESH_TIME;
-}
-
-
-static void
-kbd_reset(void *priv)
-{
- atkbd_t *kbd = (atkbd_t *)priv;
-
- kbd->initialized = 0;
- kbd->dtrans = 0;
- kbd->first_write = 1;
- kbd->status = STAT_LOCK | STAT_CD;
- kbd->mem[0] = 0x01;
- kbd->wantirq = 0;
- kbd_output_write(kbd, 0xcf);
- kbd->input_port = (video_is_mda()) ? 0xf0 : 0xb0;
- kbd->out_new = -1;
- kbd->last_irq = 0;
- kbd->secr_phase = 0;
- kbd->key_wantdata = 0;
- kbd->timeout = 0LL;
-
- keyboard_mode = 0x02 | kbd->dtrans;
-
- kbd_keyboard_set(kbd, 1);
- kbd_mouse_set(kbd, 0);
-
- sc_or = 0;
- keyboard_update_states(0, 0, 0);
-
- memset(keyboard_set3_flags, 0, 512);
-
- kbd_setmap(kbd);
-}
-
-
-static void *
-kbd_init(const device_t *info)
-{
- atkbd_t *kbd;
-
- kbd = (atkbd_t *)malloc(sizeof(atkbd_t));
- memset(kbd, 0x00, sizeof(atkbd_t));
-
- kbd->flags = info->local;
-
- kbd_reset(kbd);
-
- io_sethandler(0x0060, 5,
- kbd_read, NULL, NULL, kbd_write, NULL, NULL, kbd);
- keyboard_send = kbd_adddata_keyboard;
-
- timer_add(kbd_poll, &keyboard_delay, TIMER_ALWAYS_ENABLED, kbd);
-
- if ((kbd->flags & KBC_TYPE_MASK) != KBC_TYPE_ISA) {
- if ((kbd->flags & KBC_TYPE_MASK) == KBC_TYPE_PS2_2)
- keyboard_mode &= ~0x03; /* These machines force translation off, so the keyboard
- must start in scan code set 0. */
-
- timer_add(kbd_refresh,
- &kbd->refresh_time, TIMER_ALWAYS_ENABLED, kbd);
- }
-
- timer_add(kbd_pulse_poll,
- &kbd->pulse_cb, &kbd->pulse_cb, kbd);
-
- timer_add(kbd_timeout_poll,
- &kbd->timeout, &kbd->timeout, kbd);
-
- kbd->write60_ven = NULL;
- kbd->write64_ven = NULL;
-
- switch(kbd->flags & KBC_VEN_MASK) {
- case KBC_VEN_GENERIC:
- kbd->write64_ven = &kbd_write64_generic;
- break;
- case KBC_VEN_AMI:
- kbd->write60_ven = &kbd_write60_ami;
- kbd->write64_ven = &kbd_write64_ami;
- break;
- case KBC_VEN_IBM_MCA:
- kbd->write64_ven = &kbd_write64_ibm_mca;
- break;
- case KBC_VEN_QUADTEL:
- kbd->write60_ven = &kbd_write60_quadtel;
- kbd->write64_ven = &kbd_write64_quadtel;
- break;
- case KBC_VEN_TOSHIBA:
- kbd->write60_ven = &kbd_write60_toshiba;
- kbd->write64_ven = &kbd_write64_toshiba;
- break;
- }
-
- /* We need this, sadly. */
- CurrentKbd = kbd;
-
- return(kbd);
-}
-
-
-static void
-kbd_close(void *priv)
-{
- atkbd_t *kbd = (atkbd_t *)priv;
-
- kbd_reset(kbd);
-
- /* Stop timers. */
- keyboard_delay = 0;
- kbd->refresh_time = 0;
-
- keyboard_scan = 0;
- keyboard_send = NULL;
-
- /* Disable the scancode maps. */
- keyboard_set_table(NULL);
-
- CurrentKbd = NULL;
- free(kbd);
-}
-
-
-const device_t keyboard_at_device = {
- "PC/AT Keyboard",
- 0,
- KBC_TYPE_ISA | KBC_VEN_GENERIC,
- kbd_init,
- kbd_close,
- kbd_reset,
- NULL, NULL, NULL
-};
-
-const device_t keyboard_at_ami_device = {
- "PC/AT Keyboard (AMI)",
- 0,
- KBC_TYPE_ISA | KBC_VEN_AMI,
- kbd_init,
- kbd_close,
- kbd_reset,
- NULL, NULL, NULL
-};
-
-const device_t keyboard_at_toshiba_device = {
- "PC/AT Keyboard (Toshiba)",
- 0,
- KBC_TYPE_ISA | KBC_VEN_TOSHIBA,
- kbd_init,
- kbd_close,
- kbd_reset,
- NULL, NULL, NULL
-};
-
-const device_t keyboard_ps2_device = {
- "PS/2 Keyboard",
- 0,
- KBC_TYPE_PS2_1 | KBC_VEN_GENERIC,
- kbd_init,
- kbd_close,
- kbd_reset,
- NULL, NULL, NULL
-};
-
-const device_t keyboard_ps2_ami_device = {
- "PS/2 Keyboard (AMI)",
- 0,
- KBC_TYPE_PS2_1 | KBC_VEN_AMI,
- kbd_init,
- kbd_close,
- kbd_reset,
- NULL, NULL, NULL
-};
-
-const device_t keyboard_ps2_mca_device = {
- "PS/2 Keyboard",
- 0,
- KBC_TYPE_PS2_1 | KBC_VEN_IBM_MCA,
- kbd_init,
- kbd_close,
- kbd_reset,
- NULL, NULL, NULL
-};
-
-const device_t keyboard_ps2_mca_2_device = {
- "PS/2 Keyboard",
- 0,
- KBC_TYPE_PS2_2 | KBC_VEN_IBM_MCA,
- kbd_init,
- kbd_close,
- kbd_reset,
- NULL, NULL, NULL
-};
-
-const device_t keyboard_ps2_quadtel_device = {
- "PS/2 Keyboard (Quadtel/MegaPC)",
- 0,
- KBC_TYPE_PS2_1 | KBC_VEN_QUADTEL,
- kbd_init,
- kbd_close,
- kbd_reset,
- NULL, NULL, NULL
-};
-
-const device_t keyboard_ps2_pci_device = {
- "PS/2 Keyboard",
- DEVICE_PCI,
- KBC_TYPE_PS2_1 | KBC_VEN_GENERIC,
- kbd_init,
- kbd_close,
- kbd_reset,
- NULL, NULL, NULL
-};
-
-const device_t keyboard_ps2_ami_pci_device = {
- "PS/2 Keyboard (AMI)",
- DEVICE_PCI,
- KBC_TYPE_PS2_1 | KBC_VEN_AMI,
- kbd_init,
- kbd_close,
- kbd_reset,
- NULL, NULL, NULL
-};
-
-
-void
-keyboard_at_set_mouse(void (*func)(uint8_t val, void *priv), void *priv)
-{
- mouse_write = func;
- mouse_p = priv;
-}
-
-
-void
-keyboard_at_adddata_keyboard_raw(uint8_t val)
-{
- key_queue[key_queue_end] = val;
- key_queue_end = (key_queue_end + 1) & 0xf;
-}
-
-
-void
-keyboard_at_adddata_mouse(uint8_t val)
-{
- mouse_queue[mouse_queue_end] = val;
- mouse_queue_end = (mouse_queue_end + 1) & 0xf;
-}
-
-
-void
-keyboard_at_set_mouse_scan(uint8_t val)
-{
- atkbd_t *kbd = CurrentKbd;
- uint8_t temp_mouse_scan = val ? 1 : 0;
-
- if (temp_mouse_scan == mouse_scan) return;
-
- kbd_mouse_set(kbd, val ? 1 : 0);
-
- kbdlog("ATkbd: mouse scan %sabled via PCI\n", mouse_scan ? "en" : "dis");
-}
-
-
-uint8_t
-keyboard_at_get_mouse_scan(void)
-{
- return(mouse_scan ? 0x10 : 0x00);
-}