summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar cracyc <cracyc@users.noreply.github.com>2020-02-25 17:47:18 -0600
committerGravatarGravatar cracyc <cracyc@users.noreply.github.com>2020-02-25 17:48:22 -0600
commit9ba04478badc47e01f9d363a77e5b16ee129a782 (patch) (github)
tree56c3140e6b966b9b9388682aa9e32adfe09c93c4
parentfee7d8df4534b9739fe7238a94a8765ae6668bc9 (diff)
downloadmame-9ba04478badc47e01f9d363a77e5b16ee129a782.tar.bz2
mame-9ba04478badc47e01f9d363a77e5b16ee129a782.zip
alphatpc16: more keys (nw)
-rw-r--r--src/mame/drivers/alphatpc16.cpp53
1 files changed, 44 insertions, 9 deletions
diff --git a/src/mame/drivers/alphatpc16.cpp b/src/mame/drivers/alphatpc16.cpp
index d7dc9d1b14b..c4e093f59a9 100644
--- a/src/mame/drivers/alphatpc16.cpp
+++ b/src/mame/drivers/alphatpc16.cpp
@@ -75,6 +75,7 @@ public:
m_ram(*this, RAM_TAG),
m_z80(*this, "z80"),
m_flop0(*this, "wdfdc:0"),
+ m_flop1(*this, "wdfdc:1"),
m_keys(*this, "KEYS.%u", 0)
{ }
@@ -109,7 +110,8 @@ private:
required_device<ram_device> m_ram;
required_device<cpu_device> m_z80;
required_device<floppy_connector> m_flop0;
- required_ioport_array<7> m_keys;
+ required_device<floppy_connector> m_flop1;
+ required_ioport_array<8> m_keys;
u8 m_p1, m_p2, m_data, m_p40;
bool m_bsy, m_req, m_ack, m_cd, m_io, m_sel;
@@ -143,7 +145,7 @@ WRITE8_MEMBER(alphatpc16_state::p2_w)
READ8_MEMBER(alphatpc16_state::p2_r)
{
bool key = false;
- if(m_p1 <= 0x62)
+ if(m_p1 < 0x80)
key = BIT(m_keys[m_p1 >> 4]->read(), m_p1 & 0xf);
return (m_p2 | 0x40) & ~(key ? (m_p1 < 0x40 ? 2 : 1) : 0);
}
@@ -378,12 +380,12 @@ static INPUT_PORTS_START( alphatpc16 )
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR('+')
PORT_START("KEYS.5")
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Numpad =") PORT_CHAR('=')
- PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1)
- PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2)
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3)
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4)
- PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5)
- PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6)
+ PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1))
+ PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2))
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3))
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4))
+ PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5))
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6))
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7')
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR('4')
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1')
@@ -394,7 +396,39 @@ static INPUT_PORTS_START( alphatpc16 )
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR('\r')
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("CLEAR")
PORT_START("KEYS.6")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME)
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME))
+ PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Unknown 0x61")
+ PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
+ PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Unknown 0x6b")
+ PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_START("KEYS.7")
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Unknown 0x78")
+ PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
+ PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
static void atpc16_floppies(device_slot_interface &device)
@@ -422,6 +456,7 @@ void alphatpc16_state::alphatpc16(machine_config &config)
WD1770(config, m_wdfdc, 8_MHz_XTAL);
FLOPPY_CONNECTOR(config, m_flop0, atpc16_floppies, "525dd", floppy_image_device::default_floppy_formats);
dynamic_cast<device_slot_interface *>(m_flop0.target())->set_fixed(true);
+ FLOPPY_CONNECTOR(config, m_flop1, atpc16_floppies, "525dd", floppy_image_device::default_floppy_formats);
i8741a_device& i8741(I8741A(config, "i8741", 4.608_MHz_XTAL));
i8741.p1_in_cb().set(FUNC(alphatpc16_state::p1_r));