machine/pckeybrd.cpp: Internalize input ports

This commit is contained in:
AJR 2020-10-15 09:58:19 -04:00
parent 91c315a38d
commit 6ef3f9dc5b
28 changed files with 121 additions and 354 deletions

View File

@ -286,7 +286,7 @@ pc_keyboard_device::pc_keyboard_device(const machine_config &mconfig, const char
pc_keyboard_device::pc_keyboard_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
m_ioport(*this, ":pc_keyboard_%u", 0),
m_ioport(*this, "pc_keyboard_%u", 0),
m_out_keypress_func(*this)
{
}
@ -1117,7 +1117,7 @@ INPUT_PORTS_START( pc_keyboard )
PORT_BIT ( 0xff80, 0x0000, IPT_UNUSED )
INPUT_PORTS_END
INPUT_PORTS_START( at_keyboard )
static INPUT_PORTS_START( at_keyboard )
PORT_START("pc_keyboard_0")
PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED ) /* unused scancode 0 */
PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) /* Esc 01 81 */
@ -1242,6 +1242,18 @@ INPUT_PORTS_START( at_keyboard )
PORT_BIT ( 0xfffe, 0x0000, IPT_UNUSED )
INPUT_PORTS_END
ioport_constructor pc_keyboard_device::device_input_ports() const
{
return INPUT_PORTS_NAME(pc_keyboard);
}
ioport_constructor at_keyboard_device::device_input_ports() const
{
return INPUT_PORTS_NAME(at_keyboard);
}
/***************************************************************************
Inputx stuff
***************************************************************************/

View File

@ -37,6 +37,7 @@ public:
protected:
pc_keyboard_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual ioport_constructor device_input_ports() const override;
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
@ -89,6 +90,7 @@ public:
void set_type(KEYBOARD_TYPE type, int default_set) { m_scan_code_set = default_set; m_type = type; }
protected:
virtual ioport_constructor device_input_ports() const override;
virtual void device_reset() override;
virtual void device_start() override;
@ -114,7 +116,6 @@ private:
};
INPUT_PORTS_EXTERN( pc_keyboard );
INPUT_PORTS_EXTERN( at_keyboard );
DECLARE_DEVICE_TYPE(PC_KEYB, pc_keyboard_device)
DECLARE_DEVICE_TYPE(AT_KEYB, at_keyboard_device)

View File

@ -465,8 +465,6 @@ Since pc200 is anyway NOT_WORKING, I comment out this one */
PORT_DIPSETTING( 0x04, DEF_STR( Yes ) )
PORT_BIT( 0x02, 0x02, IPT_UNUSED ) /* no turbo switch */
PORT_BIT( 0x01, 0x01, IPT_UNUSED )
PORT_INCLUDE( at_keyboard ) /* IN4 - IN11 */
INPUT_PORTS_END
// static const gfx_layout pc200_charlayout =

View File

@ -155,7 +155,6 @@ void at586_state::at586x3(machine_config &config)
}
static INPUT_PORTS_START(at586m55)
PORT_INCLUDE(at_keyboard)
INPUT_PORTS_END
void at586_state::at586m55(machine_config &config)

View File

@ -275,7 +275,6 @@ void bebox_state::bebox2(machine_config &config)
}
static INPUT_PORTS_START( bebox )
PORT_INCLUDE( at_keyboard )
INPUT_PORTS_END
ROM_START(bebox)

View File

@ -472,75 +472,9 @@ void calchase_state::calchase_io(address_map &map)
map(0x92e8, 0x92ef).noprw(); //To debug
}
#define AT_KEYB_HELPER(bit, text, key1) \
PORT_BIT( bit, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME(text) PORT_CODE(key1)
#if 1
static INPUT_PORTS_START( calchase )
PORT_START("pc_keyboard_0")
PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED ) /* unused scancode 0 */
// AT_KEYB_HELPER( 0x0002, "Esc", KEYCODE_Q ) /* Esc 01 81 */
// 0x0004, KEYCODE_0
// 0x0008, KEYCODE_1
// 0x0010, KEYCODE_2
// 0x0020, KEYCODE_3
// 0x0040, KEYCODE_4
// 0x0080, KEYCODE_5
// 0x0100, KEYCODE_6
// 0x0200, KEYCODE_7
// 0x0400, KEYCODE_8
// 0x0800, KEYCODE_9
// 0x1000, KEYCODE_MINUS
// 0x2000, KEYCODE_EQUAL
// 0x4000, KEYCODE_BACKSPACE
// 0x8000, KEYCODE_TAB
PORT_START("pc_keyboard_1")
// 0x0001, KEYCODE_Q
// 0x0002, KEYCODE_W
AT_KEYB_HELPER( 0x0004, "E", KEYCODE_E )
AT_KEYB_HELPER( 0x0008, "R", KEYCODE_R )
AT_KEYB_HELPER( 0x0010, "T", KEYCODE_T ) /* T 14 94 */
AT_KEYB_HELPER( 0x0020, "Y", KEYCODE_Y ) /* Y 15 95 */
// 0x0040, KEYCODE_U
AT_KEYB_HELPER( 0x0080, "I", KEYCODE_I )
AT_KEYB_HELPER( 0x0100, "O", KEYCODE_O ) /* O 18 98 */
// 0x0200, KEYCODE_P
AT_KEYB_HELPER( 0x1000, "Enter", KEYCODE_ENTER ) /* Enter 1C 9C */
AT_KEYB_HELPER( 0x4000, "A", KEYCODE_A )
AT_KEYB_HELPER( 0x8000, "S", KEYCODE_S )
PORT_START("pc_keyboard_2")
AT_KEYB_HELPER( 0x0001, "D", KEYCODE_D )
AT_KEYB_HELPER( 0x0002, "F", KEYCODE_F )
PORT_START("pc_keyboard_3")
AT_KEYB_HELPER( 0x0001, "B", KEYCODE_B ) /* B 30 B0 */
AT_KEYB_HELPER( 0x0002, "N", KEYCODE_N ) /* N 31 B1 */
AT_KEYB_HELPER( 0x0200, "SPACE", KEYCODE_SPACE ) /* N 31 B1 */
AT_KEYB_HELPER( 0x0800, "F1", KEYCODE_F1 ) /* F1 3B BB */
// AT_KEYB_HELPER( 0x8000, "F5", KEYCODE_F5 )
PORT_START("pc_keyboard_4")
// AT_KEYB_HELPER( 0x0004, "F8", KEYCODE_F8 )
PORT_START("pc_keyboard_5")
PORT_START("pc_keyboard_6")
AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up", KEYCODE_UP ) /* Up 67 e7 */
AT_KEYB_HELPER( 0x0080, "(MF2)Page Up", KEYCODE_PGUP ) /* Page Up 68 e8 */
AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left", KEYCODE_LEFT ) /* Left 69 e9 */
AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right", KEYCODE_RIGHT ) /* Right 6a ea */
AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down", KEYCODE_DOWN ) /* Down 6c ec */
AT_KEYB_HELPER( 0x1000, "(MF2)Page Down", KEYCODE_PGDN ) /* Page Down 6d ed */
AT_KEYB_HELPER( 0x4000, "Del", KEYCODE_DEL ) /* Delete 6f ef */
PORT_START("pc_keyboard_7")
PORT_START("IOCARD1")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
@ -678,7 +612,6 @@ static INPUT_PORTS_START( calchase )
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
INPUT_PORTS_END
#endif
void calchase_state::machine_start()
{

View File

@ -170,8 +170,6 @@ static INPUT_PORTS_START(compciii)
PORT_DIPSETTING( 0x10, "Color 40x25" )
PORT_DIPSETTING( 0x20, "Color 80x25" )
PORT_DIPSETTING( 0x30, "Monochrome" )
PORT_INCLUDE(pc_keyboard)
INPUT_PORTS_END
static INPUT_PORTS_START(compc)
@ -197,8 +195,6 @@ static INPUT_PORTS_START(compc)
PORT_DIPNAME( 0x01, 0x01, "Boot from floppy")
PORT_DIPSETTING( 0x01, DEF_STR(Yes) )
PORT_DIPSETTING( 0x00, DEF_STR(No) )
PORT_INCLUDE(pc_keyboard)
INPUT_PORTS_END
void compc_state::compc_map(address_map &map)

View File

@ -366,7 +366,9 @@ static INPUT_PORTS_START( europc )
PORT_DIPSETTING( 0x04, DEF_STR( Yes ) )
PORT_BIT( 0x02, 0x02, IPT_UNUSED ) /* no turbo switch */
PORT_BIT( 0x01, 0x01, IPT_UNUSED )
INPUT_PORTS_END
static INPUT_PORTS_START( europc_keyboard )
PORT_INCLUDE(pc_keyboard)
PORT_MODIFY("pc_keyboard_2") /* IN6 */
PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("` ~") PORT_CODE(KEYCODE_BACKSLASH) /* ` 29 A9 */
@ -383,6 +385,28 @@ static INPUT_PORTS_START( europc )
PORT_BIT(0xfffe, IP_ACTIVE_HIGH, IPT_UNUSED)
INPUT_PORTS_END
class europc_keyboard_device : public pc_keyboard_device
{
public:
europc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
protected:
virtual ioport_constructor device_input_ports() const override;
};
DEFINE_DEVICE_TYPE(EUROPC_KEYB, europc_keyboard_device, "europc_keyb", "EURO PC Keyboard")
europc_keyboard_device::europc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
pc_keyboard_device(mconfig, EUROPC_KEYB, tag, owner, clock)
{
m_type = KEYBOARD_TYPE::PC;
}
ioport_constructor europc_keyboard_device::device_input_ports() const
{
return INPUT_PORTS_NAME(europc_keyboard);
}
void europc_pc_state::europc_map(address_map &map)
{
map.unmap_value_high();
@ -471,7 +495,7 @@ void europc_pc_state::europc(machine_config &config)
ISA8_SLOT(config, "isa2", 0, "mb:isa", pc_isa8_cards, "lpt", true);
ISA8_SLOT(config, "isa3", 0, "mb:isa", pc_isa8_cards, "com", true);
ISA8_SLOT(config, "isa4", 0, "mb:isa", europc_fdc, "fdc", true);
PC_KEYB(config, m_keyboard);
EUROPC_KEYB(config, m_keyboard);
m_keyboard->keypress().set("mb:pic8259", FUNC(pic8259_device::ir1_w));
M3002(config, m_rtc, 32.768_kHz_XTAL);
@ -499,6 +523,9 @@ void europc_pc_state::euroxt(machine_config &config)
config.device_remove("kbdctrl");
PC_KEYB(config.replace(), m_keyboard);
m_keyboard->keypress().set("mb:pic8259", FUNC(pic8259_device::ir1_w));
m_ram->set_default_size("768K");
subdevice<isa8_slot_device>("isa2")->set_default_option(nullptr);

View File

@ -398,38 +398,7 @@ static GFXDECODE_START( gfx_cga )
GFXDECODE_ENTRY( "gfx1", 0x1800, CGA_charlayout, 0, 256 ) /* Font 3*/
GFXDECODE_END
#define AT_KEYB_HELPER(bit, text, key1) \
PORT_BIT( bit, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME(text) PORT_CODE(key1)
static INPUT_PORTS_START(gamecstl)
PORT_START("pc_keyboard_0")
PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED ) /* unused scancode 0 */
AT_KEYB_HELPER( 0x0002, "Esc", KEYCODE_Q ) /* Esc 01 81 */
PORT_START("pc_keyboard_1")
AT_KEYB_HELPER( 0x0020, "Y", KEYCODE_Y ) /* Y 15 95 */
AT_KEYB_HELPER( 0x1000, "Enter", KEYCODE_ENTER ) /* Enter 1C 9C */
PORT_START("pc_keyboard_2")
PORT_START("pc_keyboard_3")
AT_KEYB_HELPER( 0x0002, "N", KEYCODE_N ) /* N 31 B1 */
AT_KEYB_HELPER( 0x0800, "F1", KEYCODE_S ) /* F1 3B BB */
PORT_START("pc_keyboard_4")
PORT_START("pc_keyboard_5")
PORT_START("pc_keyboard_6")
AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up", KEYCODE_UP ) /* Up 67 e7 */
AT_KEYB_HELPER( 0x0080, "(MF2)Page Up", KEYCODE_PGUP ) /* Page Up 68 e8 */
AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left", KEYCODE_LEFT ) /* Left 69 e9 */
AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right", KEYCODE_RIGHT ) /* Right 6a ea */
AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down", KEYCODE_DOWN ) /* Down 6c ec */
AT_KEYB_HELPER( 0x1000, "(MF2)Page Down", KEYCODE_PGDN ) /* Page Down 6d ed */
AT_KEYB_HELPER( 0x4000, "Del", KEYCODE_A ) /* Delete 6f ef */
PORT_START("pc_keyboard_7")
INPUT_PORTS_END
void gamecstl_state::machine_start()

View File

@ -77,54 +77,8 @@ void gammagic_state::gammagic_io(address_map &map)
map(0x0400, 0xffff).noprw();
}
#define AT_KEYB_HELPER(bit, text, key1) \
PORT_BIT( bit, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME(text) PORT_CODE(key1)
#if 1
static INPUT_PORTS_START( gammagic )
PORT_START("pc_keyboard_0")
PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED ) /* unused scancode 0 */
AT_KEYB_HELPER( 0x0002, "Esc", KEYCODE_Q ) /* Esc 01 81 */
PORT_START("pc_keyboard_1")
AT_KEYB_HELPER( 0x0010, "T", KEYCODE_T ) /* T 14 94 */
AT_KEYB_HELPER( 0x0020, "Y", KEYCODE_Y ) /* Y 15 95 */
AT_KEYB_HELPER( 0x0100, "O", KEYCODE_O ) /* O 18 98 */
AT_KEYB_HELPER( 0x1000, "Enter", KEYCODE_ENTER ) /* Enter 1C 9C */
PORT_START("pc_keyboard_2")
PORT_START("pc_keyboard_3")
AT_KEYB_HELPER( 0x0001, "B", KEYCODE_B ) /* B 30 B0 */
AT_KEYB_HELPER( 0x0002, "N", KEYCODE_N ) /* N 31 B1 */
AT_KEYB_HELPER( 0x0800, "F1", KEYCODE_S ) /* F1 3B BB */
AT_KEYB_HELPER( 0x1000, "F2", KEYCODE_D ) /* F2 3C BC */
AT_KEYB_HELPER( 0x4000, "F4", KEYCODE_F ) /* F4 3E BE */
PORT_START("pc_keyboard_4")
AT_KEYB_HELPER( 0x0004, "F8", KEYCODE_F8 ) // f8=42 /f10=44 /minus 4a /plus=4e
AT_KEYB_HELPER( 0x0010, "F10", KEYCODE_F10 ) // f8=42 /f10=44 /minus 4a /plus=4e
AT_KEYB_HELPER( 0x0100, "KP 8(UP)", KEYCODE_8_PAD ) /* Keypad 8 (Up arrow) 48 C8 */
AT_KEYB_HELPER( 0x0400, "KP -", KEYCODE_MINUS_PAD ) // f8=42 /f10=44 /minus 4a /plus=4e
AT_KEYB_HELPER( 0x4000, "KP +", KEYCODE_PLUS_PAD ) // f8=42 /f10=44 /minus 4a /plus=4e
PORT_START("pc_keyboard_5")
AT_KEYB_HELPER( 0x0001, "KP 2(DN)", KEYCODE_2_PAD ) /* Keypad 2 (Down arrow) 50 D0 */
PORT_START("pc_keyboard_6")
AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up", KEYCODE_UP ) /* Up 67 e7 */
AT_KEYB_HELPER( 0x0080, "(MF2)Page Up", KEYCODE_PGUP ) /* Page Up 68 e8 */
AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left", KEYCODE_LEFT ) /* Left 69 e9 */
AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right", KEYCODE_RIGHT ) /* Right 6a ea */
AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down", KEYCODE_DOWN ) /* Down 6c ec */
AT_KEYB_HELPER( 0x1000, "(MF2)Page Down", KEYCODE_PGDN ) /* Page Down 6d ed */
AT_KEYB_HELPER( 0x4000, "Del", KEYCODE_A ) /* Delete 6f ef */
PORT_START("pc_keyboard_7")
INPUT_PORTS_END
#endif
void gammagic_state::machine_start()
{

View File

@ -119,8 +119,6 @@ private:
};
static INPUT_PORTS_START( ibmpcjr )
PORT_INCLUDE(pc_keyboard)
PORT_START("IN0") /* IN0 */
PORT_BIT ( 0xf0, 0xf0, IPT_UNUSED )
PORT_BIT ( 0x08, 0x08, IPT_CUSTOM ) PORT_VBLANK("pcvideo_pcjr:screen")

View File

@ -310,7 +310,6 @@ void ip24_state::machine_reset()
}
static INPUT_PORTS_START( ip24 )
PORT_INCLUDE( at_keyboard )
INPUT_PORTS_END
void ip24_state::wd33c93(device_t *device)

View File

@ -218,7 +218,6 @@ void kron180_state::kron180_iomap(address_map &map)
/* Input ports */
static INPUT_PORTS_START (kron180)
PORT_INCLUDE(pc_keyboard)
INPUT_PORTS_END
/* Video TODO: find and understand the char table within main rom */

View File

@ -747,11 +747,11 @@ ROM_START( ultarctcup )
ROM_END
// there are almost certainly multiple versions of these; updates were offered on floppy disk. The version numbers for the existing CHDs are unknown.
GAME(1999, hydrthnd, 0, midqslvr, at_keyboard, midqslvr_state, empty_init, ROT0, "Midway Games", "Hydro Thunder", MACHINE_IS_SKELETON)
GAME(1999, hydrthnd, 0, midqslvr, 0, midqslvr_state, empty_init, ROT0, "Midway Games", "Hydro Thunder", MACHINE_IS_SKELETON)
GAME(2000, offrthnd, 0, midqslvr, at_keyboard, midqslvr_state, empty_init, ROT0, "Midway Games", "Offroad Thunder", MACHINE_IS_SKELETON)
GAME(2000, offrthnd, 0, midqslvr, 0, midqslvr_state, empty_init, ROT0, "Midway Games", "Offroad Thunder", MACHINE_IS_SKELETON)
GAME(2001, arctthnd, 0, graphite, at_keyboard, midqslvr_state, empty_init, ROT0, "Midway Games", "Arctic Thunder (v1.002)", MACHINE_IS_SKELETON)
GAME(2001, arctthnd, 0, graphite, 0, midqslvr_state, empty_init, ROT0, "Midway Games", "Arctic Thunder (v1.002)", MACHINE_IS_SKELETON)
GAME(2001, ultarctc, 0, graphite, at_keyboard, midqslvr_state, empty_init, ROT0, "Midway Games", "Ultimate Arctic Thunder", MACHINE_IS_SKELETON)
GAME(2004, ultarctcup, ultarctc, graphite, at_keyboard, midqslvr_state, empty_init, ROT0, "Midway Games", "Ultimate Arctic Thunder Update CD ver 1.950 (5/3/04)", MACHINE_IS_SKELETON)
GAME(2001, ultarctc, 0, graphite, 0, midqslvr_state, empty_init, ROT0, "Midway Games", "Ultimate Arctic Thunder", MACHINE_IS_SKELETON)
GAME(2004, ultarctcup, ultarctc, graphite, 0, midqslvr_state, empty_init, ROT0, "Midway Games", "Ultimate Arctic Thunder Update CD ver 1.950 (5/3/04)", MACHINE_IS_SKELETON)

View File

@ -1241,7 +1241,6 @@ ROM_START(nforcepc)
ROM_END
static INPUT_PORTS_START(nforcepc)
PORT_INCLUDE(at_keyboard)
INPUT_PORTS_END
COMP(2002, nforcepc, 0, 0, nforcepc, nforcepc, nforcepc_state, empty_init, "Nvidia", "Nvidia nForce PC (CRUSH11/12)", MACHINE_IS_SKELETON)

View File

@ -106,7 +106,6 @@ void olivpc1_state::pc8_io(address_map &map)
}
static INPUT_PORTS_START(olivpc1)
PORT_INCLUDE(pc_keyboard)
INPUT_PORTS_END
// TODO: replace with 8042 dump

View File

@ -141,38 +141,7 @@ void pangofun_state::pcat_io(address_map &map)
map(0x03d0, 0x03df).rw("vga", FUNC(vga_device::port_03d0_r), FUNC(vga_device::port_03d0_w));
}
#define AT_KEYB_HELPER(bit, text, key1) \
PORT_BIT( bit, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(text) PORT_CODE(key1)
static INPUT_PORTS_START( pangofun )
PORT_START("pc_keyboard_0")
PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED ) /* unused scancode 0 */
AT_KEYB_HELPER( 0x0002, "Esc", KEYCODE_Q ) /* Esc 01 81 */
PORT_START("pc_keyboard_1")
AT_KEYB_HELPER( 0x0020, "Y", KEYCODE_Y ) /* Y 15 95 */
AT_KEYB_HELPER( 0x1000, "Enter", KEYCODE_ENTER ) /* Enter 1C 9C */
PORT_START("pc_keyboard_2")
PORT_START("pc_keyboard_3")
AT_KEYB_HELPER( 0x0002, "N", KEYCODE_N ) /* N 31 B1 */
AT_KEYB_HELPER( 0x0800, "F1", KEYCODE_S ) /* F1 3B BB */
PORT_START("pc_keyboard_4")
PORT_START("pc_keyboard_5")
PORT_START("pc_keyboard_6")
AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up", KEYCODE_UP ) /* Up 67 e7 */
AT_KEYB_HELPER( 0x0080, "(MF2)Page Up", KEYCODE_PGUP ) /* Page Up 68 e8 */
AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left", KEYCODE_LEFT ) /* Left 69 e9 */
AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right", KEYCODE_RIGHT ) /* Right 6a ea */
AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down", KEYCODE_DOWN ) /* Down 6c ec */
AT_KEYB_HELPER( 0x1000, "(MF2)Page Down", KEYCODE_PGDN ) /* Page Down 6d ed */
AT_KEYB_HELPER( 0x4000, "Del", KEYCODE_A ) /* Delete 6f ef */
PORT_START("pc_keyboard_7")
INPUT_PORTS_END
void pangofun_state::machine_start()

View File

@ -600,7 +600,6 @@ ROM_START(pcipctx)
ROM_END
static INPUT_PORTS_START(pcipc)
PORT_INCLUDE(at_keyboard)
INPUT_PORTS_END
COMP(1998, pcipc, 0, 0, pcipc, pcipc, pcipc_state, empty_init, "Hack Inc.", "Sandbox PCI PC (440HX)", MACHINE_NO_SOUND)

View File

@ -1001,8 +1001,6 @@ static INPUT_PORTS_START(pcw16)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
/* power switch - default is on */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Power Switch/Suspend") PORT_WRITE_LINE_DEVICE_MEMBER("ns16550_2", ins8250_uart_device, ri_w) PORT_TOGGLE
PORT_INCLUDE( at_keyboard ) /* IN4 - IN11 */
INPUT_PORTS_END
static void pcw16_com(device_slot_interface &device)

View File

@ -225,50 +225,7 @@ void photoply_state::photoply_io(address_map &map)
}
#define AT_KEYB_HELPER(bit, text, key1) \
PORT_BIT( bit, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME(text) PORT_CODE(key1)
static INPUT_PORTS_START( photoply )
PORT_START("pc_keyboard_0")
PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED ) // Unused scancode 0
AT_KEYB_HELPER( 0x0002, "Esc", KEYCODE_Q ) // Esc 01 81
AT_KEYB_HELPER( 0x0004, "1", KEYCODE_1 )
AT_KEYB_HELPER( 0x0008, "2", KEYCODE_2 )
AT_KEYB_HELPER( 0x0010, "3", KEYCODE_3 )
AT_KEYB_HELPER( 0x0020, "4", KEYCODE_4 )
AT_KEYB_HELPER( 0x0040, "5", KEYCODE_5 )
AT_KEYB_HELPER( 0x0080, "6", KEYCODE_6 )
AT_KEYB_HELPER( 0x0100, "7", KEYCODE_7 )
AT_KEYB_HELPER( 0x0200, "8", KEYCODE_8 )
AT_KEYB_HELPER( 0x0400, "9", KEYCODE_9 )
AT_KEYB_HELPER( 0x0800, "0", KEYCODE_0 )
PORT_START("pc_keyboard_1")
AT_KEYB_HELPER( 0x0020, "Y", KEYCODE_Y ) // Y 15 95
AT_KEYB_HELPER( 0x1000, "Enter", KEYCODE_ENTER ) // Enter 1C 9C
PORT_START("pc_keyboard_2")
PORT_START("pc_keyboard_3")
AT_KEYB_HELPER( 0x0002, "N", KEYCODE_N ) // N 31 B1
AT_KEYB_HELPER( 0x0800, "F1", KEYCODE_F1 ) // F1 3B BB
AT_KEYB_HELPER( 0x1000, "F2", KEYCODE_F2 )
AT_KEYB_HELPER( 0x4000, "F4", KEYCODE_F4 )
PORT_START("pc_keyboard_4")
PORT_START("pc_keyboard_5")
PORT_START("pc_keyboard_6")
AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up", KEYCODE_UP ) // Up 67 e7
AT_KEYB_HELPER( 0x0080, "(MF2)Page Up", KEYCODE_PGUP ) // Page Up 68 e8
AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left", KEYCODE_LEFT ) // Left 69 e9
AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right", KEYCODE_RIGHT ) // Right 6a ea
AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down", KEYCODE_DOWN ) // Down 6c ec
AT_KEYB_HELPER( 0x1000, "(MF2)Page Down", KEYCODE_PGDN ) // Page Down 6d ed
AT_KEYB_HELPER( 0x4000, "Del", KEYCODE_A ) // Delete 6f ef
PORT_START("pc_keyboard_7")
INPUT_PORTS_END
void photoply_state::machine_start()

View File

@ -317,4 +317,4 @@ ROM_START( queen )
ROM_END
GAME( 2002?, queen, 0, queen, at_keyboard, queen_state, empty_init, ROT0, "STG", "Queen?", MACHINE_IS_SKELETON )
GAME( 2002?, queen, 0, queen, 0, queen_state, empty_init, ROT0, "STG", "Queen?", MACHINE_IS_SKELETON )

View File

@ -273,4 +273,4 @@ ROM_START( su2000 )
*
*************************************/
GAME( 1993, su2000, 0, su2000, pc_keyboard, su2000_state, empty_init, ROT0, "Virtuality", "SU2000", MACHINE_IS_BIOS_ROOT | MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
GAME( 1993, su2000, 0, su2000, 0, su2000_state, empty_init, ROT0, "Virtuality", "SU2000", MACHINE_IS_BIOS_ROOT | MACHINE_NOT_WORKING | MACHINE_NO_SOUND )

View File

@ -326,42 +326,6 @@ void taitowlf_state::taitowlf_io(address_map &map)
/*****************************************************************************/
#if 0
#define AT_KEYB_HELPER(bit, text, key1) \
PORT_BIT( bit, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME(text) PORT_CODE(key1)
static INPUT_PORTS_START(taitowlf)
PORT_START("pc_keyboard_0")
PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED ) /* unused scancode 0 */
AT_KEYB_HELPER( 0x0002, "Esc", KEYCODE_Q ) /* Esc 01 81 */
PORT_START("pc_keyboard_1")
AT_KEYB_HELPER( 0x0020, "Y", KEYCODE_Y ) /* Y 15 95 */
AT_KEYB_HELPER( 0x1000, "Enter", KEYCODE_ENTER ) /* Enter 1C 9C */
PORT_START("pc_keyboard_2")
PORT_START("pc_keyboard_3")
AT_KEYB_HELPER( 0x0002, "N", KEYCODE_N ) /* N 31 B1 */
AT_KEYB_HELPER( 0x0800, "F1", KEYCODE_S ) /* F1 3B BB */
PORT_START("pc_keyboard_4")
PORT_START("pc_keyboard_5")
PORT_START("pc_keyboard_6")
AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up", KEYCODE_UP ) /* Up 67 e7 */
AT_KEYB_HELPER( 0x0080, "(MF2)Page Up", KEYCODE_PGUP ) /* Page Up 68 e8 */
AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left", KEYCODE_LEFT ) /* Left 69 e9 */
AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right", KEYCODE_RIGHT ) /* Right 6a ea */
AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down", KEYCODE_DOWN ) /* Down 6c ec */
AT_KEYB_HELPER( 0x1000, "(MF2)Page Down", KEYCODE_PGDN ) /* Page Down 6d ed */
AT_KEYB_HELPER( 0x4000, "Del", KEYCODE_A ) /* Delete 6f ef */
PORT_START("pc_keyboard_7")
INPUT_PORTS_END
#endif
void taitowlf_state::machine_start()
{
}
@ -466,4 +430,4 @@ ROM_END
/*****************************************************************************/
GAME(1997, pf2012, 0, taitowlf, pc_keyboard, taitowlf_state, init_taitowlf, ROT0, "Taito", "Psychic Force 2012", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
GAME(1997, pf2012, 0, taitowlf, 0, taitowlf_state, init_taitowlf, ROT0, "Taito", "Psychic Force 2012", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)

View File

@ -479,7 +479,7 @@ void tandy1000_state::tandy1000_bank_w(offs_t offset, uint8_t data)
}
}
static INPUT_PORTS_START( t1000_common )
static INPUT_PORTS_START( t1000 )
PORT_START("IN0") /* IN0 */
PORT_BIT ( 0xf0, 0xf0, IPT_UNUSED )
PORT_BIT ( 0x08, 0x08, IPT_CUSTOM ) PORT_VBLANK("pcvideo_t1000:screen")
@ -554,15 +554,29 @@ static INPUT_PORTS_START( t1000_keyboard )
PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F12") PORT_CODE(KEYCODE_F12) /* F12 5a Da */
INPUT_PORTS_END
static INPUT_PORTS_START( t1000_90key )
PORT_INCLUDE(t1000_common)
PORT_INCLUDE(t1000_keyboard)
INPUT_PORTS_END
class t1000_keyboard_device : public pc_keyboard_device
{
public:
t1000_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
protected:
virtual ioport_constructor device_input_ports() const override;
};
DEFINE_DEVICE_TYPE(T1000_KEYB, t1000_keyboard_device, "t1000_keyb", "Tandy 1000 Keyboard")
t1000_keyboard_device::t1000_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
pc_keyboard_device(mconfig, T1000_KEYB, tag, owner, clock)
{
m_type = KEYBOARD_TYPE::PC;
}
ioport_constructor t1000_keyboard_device::device_input_ports() const
{
return INPUT_PORTS_NAME(t1000_keyboard);
}
static INPUT_PORTS_START( t1000_101key )
PORT_INCLUDE(t1000_common)
PORT_INCLUDE(at_keyboard)
INPUT_PORTS_END
void tandy1000_state::tandy1000_map(address_map &map)
{
@ -696,7 +710,7 @@ void tandy1000_state::tandy1000_common(machine_config &config)
void tandy1000_state::tandy1000_90key(machine_config &config)
{
PC_KEYB(config, m_keyboard);
T1000_KEYB(config, m_keyboard);
m_keyboard->keypress().set("mb:pic8259", FUNC(pic8259_device::ir1_w));
}
@ -957,10 +971,10 @@ ROM_END
// tandy 1000
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
COMP( 1987, t1000hx, ibm5150, 0, t1000hx, t1000_90key, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 HX", 0 )
COMP( 1987, t1000sx, ibm5150, 0, t1000sx, t1000_90key, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 SX", 0 )
COMP( 1987, t1000tx, ibm5150, 0, t1000tx, t1000_90key, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 TX", 0 )
COMP( 1989, t1000rl, ibm5150, 0, t1000rl, t1000_101key, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 RL", 0 )
COMP( 1989, t1000tl2, ibm5150, 0, t1000tl, t1000_101key, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 TL/2", 0 )
COMP( 1988, t1000sl2, ibm5150, 0, t1000sl2, t1000_101key, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 SL/2", 0 )
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
COMP( 1987, t1000hx, ibm5150, 0, t1000hx, t1000, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 HX", 0 )
COMP( 1987, t1000sx, ibm5150, 0, t1000sx, t1000, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 SX", 0 )
COMP( 1987, t1000tx, ibm5150, 0, t1000tx, t1000, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 TX", 0 )
COMP( 1989, t1000rl, ibm5150, 0, t1000rl, t1000, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 RL", 0 )
COMP( 1989, t1000tl2, ibm5150, 0, t1000tl, t1000, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 TL/2", 0 )
COMP( 1988, t1000sl2, ibm5150, 0, t1000sl2, t1000, tandy1000_state, empty_init, "Tandy Radio Shack", "Tandy 1000 SL/2", 0 )

View File

@ -403,6 +403,20 @@ void tandy2k_state::vpac_mem(address_map &map)
static INPUT_PORTS_START( tandy2k )
// defined in machine/tandy2kb.c
PORT_START("MOUSEBTN")
PORT_BIT( 0xff8f, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(MOUSECODE_BUTTON1) PORT_CHANGED_MEMBER(DEVICE_SELF, tandy2k_state, input_changed, 0)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(MOUSECODE_BUTTON2) PORT_CHANGED_MEMBER(DEVICE_SELF, tandy2k_state, input_changed, 0)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) /* this would be button three but AFAIK no tandy mouse ever had one */
PORT_START("MOUSEX")
PORT_BIT( 0xffff, 0x00, IPT_MOUSE_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(0) PORT_CHANGED_MEMBER(DEVICE_SELF, tandy2k_state, input_changed, 0)
PORT_START("MOUSEY")
PORT_BIT( 0xffff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(0) PORT_CHANGED_MEMBER(DEVICE_SELF, tandy2k_state, input_changed, 0)
INPUT_PORTS_END
static INPUT_PORTS_START( tandy2kb_hle )
PORT_INCLUDE(pc_keyboard)
PORT_MODIFY("pc_keyboard_2")
@ -437,20 +451,30 @@ static INPUT_PORTS_START( tandy2k )
PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Home") PORT_CODE(KEYCODE_HOME) /* HOME 58 D8 */
PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F11") PORT_CODE(KEYCODE_F11) /* F11 59 D9 */
PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F12") PORT_CODE(KEYCODE_F12) /* F12 5a Da */
PORT_START("MOUSEBTN")
PORT_BIT( 0xff8f, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(MOUSECODE_BUTTON1) PORT_CHANGED_MEMBER(DEVICE_SELF, tandy2k_state, input_changed, 0)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(MOUSECODE_BUTTON2) PORT_CHANGED_MEMBER(DEVICE_SELF, tandy2k_state, input_changed, 0)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) /* this would be button three but AFAIK no tandy mouse ever had one */
PORT_START("MOUSEX")
PORT_BIT( 0xffff, 0x00, IPT_MOUSE_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(0) PORT_CHANGED_MEMBER(DEVICE_SELF, tandy2k_state, input_changed, 0)
PORT_START("MOUSEY")
PORT_BIT( 0xffff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(0) PORT_CHANGED_MEMBER(DEVICE_SELF, tandy2k_state, input_changed, 0)
INPUT_PORTS_END
class tandy2kb_hle_device : public pc_keyboard_device
{
public:
tandy2kb_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
protected:
virtual ioport_constructor device_input_ports() const override;
};
DEFINE_DEVICE_TYPE(TANDY2K_HLE_KEYB, tandy2kb_hle_device, "tandy2kb_hle", "Tandy 2000 Keyboard HLE")
tandy2kb_hle_device::tandy2kb_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
pc_keyboard_device(mconfig, TANDY2K_HLE_KEYB, tag, owner, clock)
{
m_type = KEYBOARD_TYPE::PC;
}
ioport_constructor tandy2kb_hle_device::device_input_ports() const
{
return INPUT_PORTS_NAME(tandy2kb_hle);
}
INPUT_CHANGED_MEMBER(tandy2k_state::input_changed)
{
if (m_clkmouse_cnt || !m_clkmouse_irq)
@ -1076,7 +1100,7 @@ void tandy2k_state::tandy2k(machine_config &config)
m_kb->data_wr_callback().set(FUNC(tandy2k_state::kbddat_w));
// temporary until the tandy keyboard has a rom dump
PC_KEYB(config, m_pc_keyboard, 0).keypress().set(I8259A_1_TAG, FUNC(pic8259_device::ir0_w));
TANDY2K_HLE_KEYB(config, m_pc_keyboard, 0).keypress().set(I8259A_1_TAG, FUNC(pic8259_device::ir0_w));
// software lists
SOFTWARE_LIST(config, "flop_list").set_original("tandy2k");

View File

@ -324,7 +324,6 @@ void tv990_state::tv990_mem(address_map &map)
/* Input ports */
static INPUT_PORTS_START( tv990 )
PORT_INCLUDE( at_keyboard )
PORT_START("Screen")
PORT_CONFNAME( 0x30, 0x00, "Color") PORT_CHANGED_MEMBER(DEVICE_SELF, tv990_state, color, 0)
PORT_CONFSETTING( 0x00, "Green")

View File

@ -323,47 +323,9 @@ void voyager_state::voyager_io(address_map &map)
}
#define AT_KEYB_HELPER(bit, text, key1) \
PORT_BIT( bit, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME(text) PORT_CODE(key1)
#if 1
static INPUT_PORTS_START( voyager )
PORT_START("pc_keyboard_0")
PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED ) /* unused scancode 0 */
AT_KEYB_HELPER( 0x0002, "Esc", KEYCODE_Q ) /* Esc 01 81 */
PORT_START("pc_keyboard_1")
AT_KEYB_HELPER( 0x0010, "T", KEYCODE_T ) /* T 14 94 */
AT_KEYB_HELPER( 0x0020, "Y", KEYCODE_Y ) /* Y 15 95 */
AT_KEYB_HELPER( 0x0100, "O", KEYCODE_O ) /* O 18 98 */
AT_KEYB_HELPER( 0x1000, "Enter", KEYCODE_ENTER ) /* Enter 1C 9C */
PORT_START("pc_keyboard_2")
PORT_START("pc_keyboard_3")
AT_KEYB_HELPER( 0x0001, "B", KEYCODE_B ) /* B 30 B0 */
AT_KEYB_HELPER( 0x0002, "N", KEYCODE_N ) /* N 31 B1 */
AT_KEYB_HELPER( 0x0800, "F1", KEYCODE_S ) /* F1 3B BB */
// AT_KEYB_HELPER( 0x8000, "F5", KEYCODE_F5 )
PORT_START("pc_keyboard_4")
// AT_KEYB_HELPER( 0x0004, "F8", KEYCODE_F8 )
PORT_START("pc_keyboard_5")
PORT_START("pc_keyboard_6")
AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up", KEYCODE_UP ) /* Up 67 e7 */
AT_KEYB_HELPER( 0x0080, "(MF2)Page Up", KEYCODE_PGUP ) /* Page Up 68 e8 */
AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left", KEYCODE_LEFT ) /* Left 69 e9 */
AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right", KEYCODE_RIGHT ) /* Right 6a ea */
AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down", KEYCODE_DOWN ) /* Down 6c ec */
AT_KEYB_HELPER( 0x1000, "(MF2)Page Down", KEYCODE_PGDN ) /* Page Down 6d ed */
AT_KEYB_HELPER( 0x4000, "Del", KEYCODE_A ) /* Delete 6f ef */
PORT_START("pc_keyboard_7")
PORT_START("IOCARD1")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
@ -503,7 +465,6 @@ static INPUT_PORTS_START( voyager )
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
INPUT_PORTS_END
#endif
void voyager_state::machine_start()
{

View File

@ -449,4 +449,4 @@ ROM_START( xtom3d )
ROM_END
GAME(1999, xtom3d, 0, xtom3d, at_keyboard, xtom3d_state, empty_init, ROT0, "Jamie System Development", "X Tom 3D", MACHINE_IS_SKELETON)
GAME(1999, xtom3d, 0, xtom3d, 0, xtom3d_state, empty_init, ROT0, "Jamie System Development", "X Tom 3D", MACHINE_IS_SKELETON)