summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Robbbert <robbbert@users.noreply.github.com>2013-02-10 10:51:08 +0000
committer Robbbert <robbbert@users.noreply.github.com>2013-02-10 10:51:08 +0000
commit32b2f50c4476e6fd1b98d6c9fca6a37d306b9352 (patch)
treee6f219f0dab7331d57fde20a2f68b7fd7b80d30d
parent28055f6806dd4e80b205e65050247970f14e4bd3 (diff)
(MESS) fixed multisession crash with any system using generic keyboard.
-rw-r--r--src/mess/machine/keyboard.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/mess/machine/keyboard.c b/src/mess/machine/keyboard.c
index 73338c6a5b3..bb16440c5c3 100644
--- a/src/mess/machine/keyboard.c
+++ b/src/mess/machine/keyboard.c
@@ -78,9 +78,8 @@ UINT8 generic_keyboard_device::row_number(UINT8 code)
UINT8 generic_keyboard_device::keyboard_handler(UINT8 last_code, UINT8 *scan_line)
{
- static ioport_port *const keynames[] = { m_io_kbd0, m_io_kbd1, m_io_kbd2, m_io_kbd3, m_io_kbd4, m_io_kbd5, m_io_kbd6, m_io_kbd7 };
int i;
- UINT8 code;
+ UINT8 code = 0;
UINT8 key_code = 0;
UINT8 retVal = 0;
UINT8 shift = BIT(m_io_kbdc->read(), 1);
@@ -88,7 +87,22 @@ UINT8 generic_keyboard_device::keyboard_handler(UINT8 last_code, UINT8 *scan_lin
UINT8 ctrl = BIT(m_io_kbdc->read(), 0);
i = *scan_line;
{
- code = keynames[i]->read();
+ if (i == 0) code = m_io_kbd0->read();
+ else
+ if (i == 1) code = m_io_kbd1->read();
+ else
+ if (i == 2) code = m_io_kbd2->read();
+ else
+ if (i == 3) code = m_io_kbd3->read();
+ else
+ if (i == 4) code = m_io_kbd4->read();
+ else
+ if (i == 5) code = m_io_kbd5->read();
+ else
+ if (i == 6) code = m_io_kbd6->read();
+ else
+ if (i == 7) code = m_io_kbd7->read();
+
if (code != 0)
{
if (i==0 && shift==0) {