summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2022-02-01 13:07:36 +0100
committer Dirk Best <mail@dirk-best.de>2022-02-01 13:08:35 +0100
commita773080932ed4efbfbc8dba82c41c8fbce0e021f (patch)
tree59cfcad00b718fda4ea4eea0f597632659fe5c2d
parent3624935bedfb6fc162b8d43b82a63a0371021972 (diff)
digilog: Replace HLE keyboard with LLE
-rw-r--r--scripts/target/mame/mess.lua4
-rw-r--r--src/mame/drivers/digilog320.cpp5
-rw-r--r--src/mame/machine/digilog320_kbd.cpp309
-rw-r--r--src/mame/machine/digilog320_kbd.h64
-rw-r--r--src/mame/machine/digilog_kbd.cpp283
-rw-r--r--src/mame/machine/digilog_kbd.h59
6 files changed, 346 insertions, 378 deletions
diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua
index c7af6eb0e3e..9c6c72e1005 100644
--- a/scripts/target/mame/mess.lua
+++ b/scripts/target/mame/mess.lua
@@ -4597,8 +4597,8 @@ files {
MAME_DIR .. "src/mame/drivers/didact.cpp",
MAME_DIR .. "src/mame/drivers/digel804.cpp",
MAME_DIR .. "src/mame/drivers/digilog320.cpp",
- MAME_DIR .. "src/mame/machine/digilog320_kbd.cpp",
- MAME_DIR .. "src/mame/machine/digilog320_kbd.h",
+ MAME_DIR .. "src/mame/machine/digilog_kbd.cpp",
+ MAME_DIR .. "src/mame/machine/digilog_kbd.h",
MAME_DIR .. "src/mame/drivers/digijet.cpp",
MAME_DIR .. "src/mame/drivers/dim68k.cpp",
MAME_DIR .. "src/mame/drivers/dm7000.cpp",
diff --git a/src/mame/drivers/digilog320.cpp b/src/mame/drivers/digilog320.cpp
index b005d903921..b69dcaa1cab 100644
--- a/src/mame/drivers/digilog320.cpp
+++ b/src/mame/drivers/digilog320.cpp
@@ -57,7 +57,7 @@
#include "cpu/i86/i186.h"
#include "cpu/z80/z80.h"
#include "machine/am9519.h"
-#include "machine/digilog320_kbd.h"
+#include "machine/digilog_kbd.h"
#include "machine/i8251.h"
#include "machine/mc68681.h"
#include "machine/nvram.h"
@@ -382,7 +382,6 @@ void digilog320_state::digilog320(machine_config &config)
SCN2681(config, m_duart, 3.6864_MHz_XTAL);
m_duart->irq_cb().set(m_maincpu, FUNC(i80186_cpu_device::int0_w));
- m_duart->a_tx_cb().set("kbd", FUNC(digilog320_kbd_hle_device::rx_w));
m_duart->outport_cb().set("usart", FUNC(i8251_device::write_txc)).bit(3);
m_duart->outport_cb().append("usart", FUNC(i8251_device::write_rxc)).bit(3);
@@ -399,7 +398,7 @@ void digilog320_state::digilog320(machine_config &config)
SOFTWARE_LIST(config, "floppy_list").set_original("digilog320");
- digilog320_kbd_hle_device &kbd(DIGILOG320_KBD_HLE(config, "kbd"));
+ digilog_kbd_device &kbd(DIGILOG_KBD(config, "kbd"));
kbd.tx_handler().set(m_duart, FUNC(scn2681_device::rx_a_w));
}
diff --git a/src/mame/machine/digilog320_kbd.cpp b/src/mame/machine/digilog320_kbd.cpp
deleted file mode 100644
index bcf36f315d2..00000000000
--- a/src/mame/machine/digilog320_kbd.cpp
+++ /dev/null
@@ -1,309 +0,0 @@
-// license: BSD-3-Clause
-// copyright-holders: Dirk Best
-/***************************************************************************
-
- Digilog 320 Keyboard (HLE)
-
- TODO:
- - Map and verify missing keys
-
-***************************************************************************/
-
-#include "emu.h"
-#include "digilog320_kbd.h"
-#include "machine/keyboard.ipp"
-
-
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-DEFINE_DEVICE_TYPE(DIGILOG320_KBD_HLE, digilog320_kbd_hle_device, "digilog320_kbd_hle", "Digilog 320 Keyboard (HLE)")
-
-namespace {
-
-uint8_t const TRANSLATION_TABLE[4][5][18] =
-{
- // unshift
- {
- { 0x00, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 0x00, 0x8f, 0x96, 0x95, 0x80 }, // 0
- { 0x8a, 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', 0x8d, 0x8e, 0x89, 0x97, 0x88 }, // 1
- { 0x00, 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', 0x00, 0x00, 0x84, 0x85, 0x81, 0x90, 0x00 }, // 2
- { 0x00, '\\', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 0x00, 0x98, 0x99, 0x91, 0x92, 0x93 }, // 3
- { 0x00, 0x00, ' ', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, '`', '\'', 0x87, 0x8b, 0x8c, 0x83, 0x94, 0x82 }, // 4
- },
- // shift
- {
- { 0x00, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', 0x00, 0x00, 0x00, 0x00, 0x00 }, // 0
- { 0x00, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', 0x00, 0x00, 0x00, 0x00, 0x00 }, // 1
- { 0x00, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 2
- { 0x00, '|', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 3
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, '~', '"', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 4
- },
- // unshift-control
- {
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 0
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 1
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 2
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 3
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 4
- },
- // shift-control
- {
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 0
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 1
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 2
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 3
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // 4
- }
-};
-
-} // anonymous namespace
-
-//-------------------------------------------------
-// input_ports - device-specific input ports
-//-------------------------------------------------
-
-// unknown codes: Nul, Return, Halt, Mask / Crc, Don't Care (0x83?), Not (0x82?)
-
-static INPUT_PORTS_START( keyboard )
- PORT_START("mod")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_TOGGLE
-
- PORT_START("row_0")
- PORT_BIT(0x000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F1) PORT_NAME("Nul")
- PORT_BIT(0x000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
- PORT_BIT(0x000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@')
- PORT_BIT(0x000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
- PORT_BIT(0x000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
- PORT_BIT(0x000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
- PORT_BIT(0x000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^')
- PORT_BIT(0x000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&')
- PORT_BIT(0x000100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*')
- PORT_BIT(0x000200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(')
- PORT_BIT(0x000400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
- PORT_BIT(0x000800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_')
- PORT_BIT(0x001000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+')
- PORT_BIT(0x002000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F2) PORT_NAME("Halt")
- PORT_BIT(0x004000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F3) PORT_NAME("Run Mon")
- PORT_BIT(0x008000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F4) PORT_NAME("Run Trap")
- PORT_BIT(0x010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F5) PORT_NAME("Run Prog")
- PORT_BIT(0x020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F6) PORT_NAME("Auto Set-up")
-
- PORT_START("row_1")
- PORT_BIT(0x000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL))
- PORT_BIT(0x000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
- PORT_BIT(0x000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')
- PORT_BIT(0x000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')
- PORT_BIT(0x000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')
- PORT_BIT(0x000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')
- PORT_BIT(0x000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')
- PORT_BIT(0x000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')
- PORT_BIT(0x000100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')
- PORT_BIT(0x000200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
- PORT_BIT(0x000400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
- PORT_BIT(0x000800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
- PORT_BIT(0x001000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
- PORT_BIT(0x002000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Page Fwd")
- PORT_BIT(0x004000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_PGUP) PORT_NAME("Page Rev")
- PORT_BIT(0x008000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_NAME("Main Menu")
- PORT_BIT(0x010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F7) PORT_NAME("Exec Menu Cmd")
- PORT_BIT(0x020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F8) PORT_NAME("Hex")
-
- PORT_START("row_2")
- PORT_BIT(0x000001, IP_ACTIVE_HIGH, IPT_UNUSED) // "Ctrl" handled elsewhere
- PORT_BIT(0x000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A')
- PORT_BIT(0x000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')
- PORT_BIT(0x000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')
- PORT_BIT(0x000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')
- PORT_BIT(0x000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')
- PORT_BIT(0x000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')
- PORT_BIT(0x000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')
- PORT_BIT(0x000100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')
- PORT_BIT(0x000200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
- PORT_BIT(0x000400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
- PORT_BIT(0x000800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
- PORT_BIT(0x001000, IP_ACTIVE_HIGH, IPT_UNUSED)
- PORT_BIT(0x002000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F9) PORT_NAME("Field Sel Fwd")
- PORT_BIT(0x004000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F10) PORT_NAME("Field Sel Rev")
- PORT_BIT(0x008000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Clear")
- PORT_BIT(0x010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
- PORT_BIT(0x020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F11) PORT_NAME("Mask Crc")
-
- PORT_START("row_3")
- PORT_BIT(0x000001, IP_ACTIVE_HIGH, IPT_UNUSED) // "Left Shift" handled elsewhere
- PORT_BIT(0x000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('\\') PORT_CHAR('|')
- PORT_BIT(0x000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z')
- PORT_BIT(0x000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')
- PORT_BIT(0x000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')
- PORT_BIT(0x000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')
- PORT_BIT(0x000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')
- PORT_BIT(0x000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')
- PORT_BIT(0x000100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')
- PORT_BIT(0x000200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
- PORT_BIT(0x000400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
- PORT_BIT(0x000800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
- PORT_BIT(0x001000, IP_ACTIVE_HIGH, IPT_UNUSED) // "Right Shift" handled elsewhere
- PORT_BIT(0x002000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_NAME("Tab Fwd")
- PORT_BIT(0x004000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F12) PORT_NAME("Tab Rev")
- PORT_BIT(0x008000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
- PORT_BIT(0x010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_NAME("Freeze Home")
- PORT_BIT(0x020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
-
- PORT_START("row_4")
- PORT_BIT(0x000001, IP_ACTIVE_HIGH, IPT_UNUSED) // "Shift Lock"
- PORT_BIT(0x000002, IP_ACTIVE_HIGH, IPT_UNUSED) // "Caps Lock" handled elsewhere
- PORT_BIT(0x000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
- PORT_BIT(0x000008, IP_ACTIVE_HIGH, IPT_UNUSED)
- PORT_BIT(0x000010, IP_ACTIVE_HIGH, IPT_UNUSED)
- PORT_BIT(0x000020, IP_ACTIVE_HIGH, IPT_UNUSED)
- PORT_BIT(0x000040, IP_ACTIVE_HIGH, IPT_UNUSED)
- PORT_BIT(0x000080, IP_ACTIVE_HIGH, IPT_UNUSED)
- PORT_BIT(0x000100, IP_ACTIVE_HIGH, IPT_UNUSED)
- PORT_BIT(0x000200, IP_ACTIVE_HIGH, IPT_UNUSED)
- PORT_BIT(0x000400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~')
- PORT_BIT(0x000800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"')
- PORT_BIT(0x001000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_END) PORT_NAME("Help")
- PORT_BIT(0x002000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_INSERT) PORT_NAME("Insert Line Del")
- PORT_BIT(0x004000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("Insert Char Del")
- PORT_BIT(0x008000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Don\'t Care")
- PORT_BIT(0x010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
- PORT_BIT(0x020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Not")
-INPUT_PORTS_END
-
-ioport_constructor digilog320_kbd_hle_device::device_input_ports() const
-{
- return INPUT_PORTS_NAME( keyboard );
-}
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// digilog320_kbd_hle_device - constructor
-//-------------------------------------------------
-
-digilog320_kbd_hle_device::digilog320_kbd_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, DIGILOG320_KBD_HLE, tag, owner, clock),
- device_buffered_serial_interface(mconfig, *this),
- device_matrix_keyboard_interface(mconfig, *this, "row_0", "row_1", "row_2", "row_3", "row_4"),
- m_modifiers(*this, "mod"),
- m_tx_handler(*this)
-{
-}
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void digilog320_kbd_hle_device::device_start()
-{
- // resolve callbacks
- m_tx_handler.resolve_safe();
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void digilog320_kbd_hle_device::device_reset()
-{
- clear_fifo();
-
- receive_register_reset();
- transmit_register_reset();
-
- set_data_frame(1, 8, PARITY_EVEN, STOP_BITS_1);
- set_rcv_rate(1200);
- set_tra_rate(1200);
-
- reset_key_state();
- start_processing(attotime::from_hz(1200));
- typematic_stop();
-}
-
-//-------------------------------------------------
-// tra_callback - send bit to host
-//-------------------------------------------------
-
-void digilog320_kbd_hle_device::tra_callback()
-{
- m_tx_handler(transmit_register_get_data_bit());
-}
-
-//-------------------------------------------------
-// received_byte - handle received byte
-//-------------------------------------------------
-
-void digilog320_kbd_hle_device::received_byte(uint8_t byte)
-{
- // might be send only
- logerror("Received from host: %02x\n", byte);
-}
-
-//-------------------------------------------------
-// key_make - handle a key being pressed
-//-------------------------------------------------
-
-void digilog320_kbd_hle_device::key_make(uint8_t row, uint8_t column)
-{
- uint8_t code = translate(row, column);
-
- if (code != 0x00)
- {
- transmit_byte(code);
- typematic_start(row, column, attotime::from_msec(750), attotime::from_msec(50));
- }
-}
-
-//-------------------------------------------------
-// key_break - handle a key being released
-//-------------------------------------------------
-
-void digilog320_kbd_hle_device::key_break(uint8_t row, uint8_t column)
-{
- if (typematic_is(row, column))
- typematic_stop();
-}
-
-//-------------------------------------------------
-// key_repeat - handle a key being repeated
-//-------------------------------------------------
-
-void digilog320_kbd_hle_device::key_repeat(u8 row, u8 column)
-{
- uint8_t code = translate(row, column);
-
- if (code != 0x00)
- transmit_byte(code);
-}
-
-//-------------------------------------------------
-// rx_w - receive bit from host
-//-------------------------------------------------
-
-void digilog320_kbd_hle_device::rx_w(int state)
-{
- device_buffered_serial_interface::rx_w(state);
-}
-
-//-------------------------------------------------
-// translate - row and column to key code
-//-------------------------------------------------
-
-uint8_t digilog320_kbd_hle_device::translate(uint8_t row, uint8_t column)
-{
- uint8_t const modifiers(m_modifiers->read());
-
- bool const ctrl(modifiers & 0x01);
- bool const shift(bool(modifiers & 0x02) || (bool(modifiers & 0x04)));
- bool const ctrl_shift(ctrl && shift);
-
- unsigned const map(ctrl_shift? 3 : ctrl ? 2 : shift ? 1 : 0);
-
- return TRANSLATION_TABLE[map][row][column];
-}
diff --git a/src/mame/machine/digilog320_kbd.h b/src/mame/machine/digilog320_kbd.h
deleted file mode 100644
index d65ddf15df5..00000000000
--- a/src/mame/machine/digilog320_kbd.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// license: BSD-3-Clause
-// copyright-holders: Dirk Best
-/***************************************************************************
-
- Digilog 320 Keyboard (HLE)
-
-***************************************************************************/
-
-#ifndef MAME_MACHINE_DIGILOG320_KBD_H
-#define MAME_MACHINE_DIGILOG320_KBD_H
-
-#pragma once
-
-#include "machine/keyboard.h"
-#include "diserial.h"
-
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-// ======================> digilog320_kbd_hle_device
-
-class digilog320_kbd_hle_device : public device_t,
- public device_buffered_serial_interface<16>,
- protected device_matrix_keyboard_interface<5>
-{
-public:
- // construction/destruction
- digilog320_kbd_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
-
- // callbacks
- auto tx_handler() { return m_tx_handler.bind(); }
-
- // from host
- void rx_w(int state);
-
-protected:
- // device_t overrides
- virtual ioport_constructor device_input_ports() const override;
- virtual void device_start() override;
- virtual void device_reset() override;
-
- // device_buffered_serial_interface overrides
- virtual void tra_callback() override;
- virtual void received_byte(uint8_t byte) override;
-
- // device_matrix_keyboard_interface overrides
- virtual void key_make(uint8_t row, uint8_t column) override;
- virtual void key_break(uint8_t row, uint8_t column) override;
- virtual void key_repeat(uint8_t row, uint8_t column) override;
-
-private:
- required_ioport m_modifiers;
-
- uint8_t translate(uint8_t row, uint8_t column);
-
- devcb_write_line m_tx_handler;
-};
-
-// device type definition
-DECLARE_DEVICE_TYPE(DIGILOG320_KBD_HLE, digilog320_kbd_hle_device)
-
-#endif // MAME_MACHINE_DIGILOG320_KBD_H
diff --git a/src/mame/machine/digilog_kbd.cpp b/src/mame/machine/digilog_kbd.cpp
new file mode 100644
index 00000000000..c324a6f03eb
--- /dev/null
+++ b/src/mame/machine/digilog_kbd.cpp
@@ -0,0 +1,283 @@
+// license: BSD-3-Clause
+// copyright-holders: Dirk Best
+/***************************************************************************
+
+ Digilog protocol anaylzer keyboard
+
+ PN: 2185033 78-0048-02 A
+ PCBD-870056-04
+
+ Manufactured 1983 by Maxi-Switch Co. / Maxikey
+
+ TOOD:
+ - Shift Lock and Caps Lock
+ - Unknown keys
+ - LED artwork
+
+ Notes:
+ - Setting MCU t1=0 causes it to send a (buggy) checksum over the
+ serial port.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "digilog_kbd.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(DIGILOG_KBD, digilog_kbd_device, "digilog_kbd", "Digilog protocol analyzer keyboard")
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+ROM_START( firmware )
+ ROM_REGION(0x400, "mcu", 0)
+ ROM_LOAD("d8748hc.u1", 0x000, 0x400, CRC(9d8c0440) SHA1(c80a7f9dff6942c8f54ba8a03bc72a87d075e00d))
+ROM_END
+
+const tiny_rom_entry *digilog_kbd_device::device_rom_region() const
+{
+ return ROM_NAME(firmware);
+}
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void digilog_kbd_device::device_add_mconfig(machine_config &config)
+{
+ I8748(config, m_mcu, 6_MHz_XTAL);
+ m_mcu->bus_in_cb().set(FUNC(digilog_kbd_device::bus_r));
+ m_mcu->bus_out_cb().set(FUNC(digilog_kbd_device::bus_w));
+ m_mcu->t0_in_cb().set(FUNC(digilog_kbd_device::t0_r));
+ m_mcu->t1_in_cb().set_constant(1); // see note
+ m_mcu->p1_out_cb().set(FUNC(digilog_kbd_device::p1_w));
+ m_mcu->p2_in_cb().set(FUNC(digilog_kbd_device::p2_r));
+}
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+static INPUT_PORTS_START( keyboard )
+ PORT_START("row_0")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("a8")
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F9) PORT_NAME("Field Sel Fwd")
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(')
+
+ PORT_START("row_1")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("a9")
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
+
+ PORT_START("row_2")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("a7")
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F2) PORT_NAME("Halt")
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_NAME("Tab Fwd")
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Page Fwd")
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*')
+
+ PORT_START("row_3")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("a6")
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F3) PORT_NAME("Run Mon")
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_INSERT) PORT_NAME("Insert Line Del")
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_PGUP) PORT_NAME("Page Rev")
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&')
+
+ PORT_START("row_4")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("a5")
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F12) PORT_NAME("Tab Rev")
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F11) PORT_NAME("Mask Crc?")
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F10) PORT_NAME("Field Sel Rev")
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^')
+
+ PORT_START("row_5")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F4) PORT_NAME("Run Trap")
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_END) PORT_NAME("Help")
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_NAME("Main Menu")
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
+
+ PORT_START("row_6")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"')
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Clear")
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
+
+ PORT_START("row_7")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("a4")
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F5) PORT_NAME("Run Prog")
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Don\'t Care?")
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F7) PORT_NAME("Exec Menu Cmd")
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
+
+ PORT_START("row_8")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("a3")
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_NAME("Freeze Home")
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~')
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@')
+
+ PORT_START("row_9")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("a2")
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F6) PORT_NAME("Auto Set-up")
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F8) PORT_NAME("Hex")
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
+
+ PORT_START("row_a")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("a1")
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("Insert Char Del?")
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Not?")
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('\\') PORT_CHAR('|')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL))
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Nul")
+
+ PORT_START("row_b")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2)
+ PORT_BIT(0xfe, IP_ACTIVE_LOW, IPT_UNUSED)
+
+ PORT_START("row_c")
+ PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED)
+
+ PORT_START("row_d")
+ PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED)
+
+ PORT_START("row_e")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
+ PORT_BIT(0xfe, IP_ACTIVE_LOW, IPT_UNUSED)
+
+ PORT_START("row_f")
+ PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED)
+INPUT_PORTS_END
+
+ioport_constructor digilog_kbd_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( keyboard );
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// digilog_kbd_device - constructor
+//-------------------------------------------------
+
+digilog_kbd_device::digilog_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, DIGILOG_KBD, tag, owner, clock),
+ m_mcu(*this, "mcu"),
+ m_keys(*this, "row_%x", 0U),
+ m_tx_handler(*this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void digilog_kbd_device::device_start()
+{
+ // resolve callbacks
+ m_tx_handler.resolve_safe();
+
+ // register for save states
+ save_item(NAME(m_bus));
+ save_item(NAME(m_key_row));
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void digilog_kbd_device::device_reset()
+{
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t digilog_kbd_device::bus_r()
+{
+ return m_bus;
+}
+
+void digilog_kbd_device::bus_w(uint8_t data)
+{
+ logerror("bus_w: %02x\n", data);
+
+ // 7------- unknown
+ // -6------ hex key led
+ // --543210 unknown
+
+ m_bus = data;
+}
+
+int digilog_kbd_device::t0_r()
+{
+ // modifier keys
+ if (m_key_row > 0x0a)
+ return m_keys[m_key_row]->read() & 0x01;
+ else
+ return 1;
+}
+
+void digilog_kbd_device::p1_w(uint8_t data)
+{
+ // 7654---- key row to scan
+ // ----321- unknown (not used?)
+ // -------0 serial data out
+
+ m_key_row = data >> 4;
+ m_tx_handler(BIT(data, 0) ? 0 : 1);
+}
+
+uint8_t digilog_kbd_device::p2_r()
+{
+ // normal keys read
+ return m_keys[m_key_row]->read();
+}
diff --git a/src/mame/machine/digilog_kbd.h b/src/mame/machine/digilog_kbd.h
new file mode 100644
index 00000000000..143925c2fbc
--- /dev/null
+++ b/src/mame/machine/digilog_kbd.h
@@ -0,0 +1,59 @@
+// license: BSD-3-Clause
+// copyright-holders: Dirk Best
+/***************************************************************************
+
+ Digilog protocol anaylzer keyboard
+
+***************************************************************************/
+
+#ifndef MAME_MACHINE_DIGILOG_KBD_H
+#define MAME_MACHINE_DIGILOG_KBD_H
+
+#pragma once
+
+#include "cpu/mcs48/mcs48.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> digilog_kbd_device
+
+class digilog_kbd_device : public device_t
+{
+public:
+ // construction/destruction
+ digilog_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+
+ // callbacks
+ auto tx_handler() { return m_tx_handler.bind(); }
+
+protected:
+ // device_t overrides
+ virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual ioport_constructor device_input_ports() const override;
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+private:
+ required_device<i8748_device> m_mcu;
+ required_ioport_array<16> m_keys;
+
+ uint8_t bus_r();
+ void bus_w(uint8_t data);
+ int t0_r();
+ void p1_w(uint8_t data);
+ uint8_t p2_r();
+
+ devcb_write_line m_tx_handler;
+
+ uint8_t m_bus;
+ uint8_t m_key_row;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(DIGILOG_KBD, digilog_kbd_device)
+
+#endif // MAME_MACHINE_DIGILOG_KBD_H