diff options
author | Sergey Svishchev <shattered@users.sourceforge.net> | 2015-08-30 11:55:48 +0300 |
---|---|---|
committer | Sergey Svishchev <shattered@users.sourceforge.net> | 2015-08-30 12:32:23 +0300 |
commit | 47c125bfa845954fcf779ab8445f82c3428186c3 (patch) | |
tree | f5e273c50db740d71624e6b32cf538248aa72663 /src/emu/machine | |
parent | ce285e1d62ad450bdcaf8cf3f9264efbcfb87a0f (diff) |
at, at_keybc: hook up Display Switch
Diffstat (limited to 'src/emu/machine')
-rw-r--r-- | src/emu/machine/at_keybc.c | 20 | ||||
-rw-r--r-- | src/emu/machine/at_keybc.h | 1 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/emu/machine/at_keybc.c b/src/emu/machine/at_keybc.c index bc77324cf96..7ed8df3f5dc 100644 --- a/src/emu/machine/at_keybc.c +++ b/src/emu/machine/at_keybc.c @@ -24,6 +24,15 @@ static ADDRESS_MAP_START( at_keybc_io, AS_IO, 8, at_keyboard_controller_device) AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ( p1_r) AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(p2_r, p2_w) ADDRESS_MAP_END + +static INPUT_PORTS_START( at_keybc ) + PORT_START("DSW") + PORT_BIT( 0xbf, 0xbf, IPT_UNUSED ) + PORT_DIPNAME( 0x40, 0x40, "Display switch") + PORT_DIPSETTING( 0x40, "Monochrome adapter" ) + PORT_DIPSETTING( 0x00, "Color/Graphics adapter" ) +INPUT_PORTS_END + // machine fragment static MACHINE_CONFIG_FRAGMENT( at_keybc ) MCFG_CPU_ADD("at_keybc", I8042, DERIVED_CLOCK(1,1)) @@ -72,6 +81,15 @@ const rom_entry *at_keyboard_controller_device::device_rom_region() const } //------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor at_keyboard_controller_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( at_keybc ); +} + +//------------------------------------------------- // machine_config_additions - return a pointer to // the device's machine fragment //------------------------------------------------- @@ -139,7 +157,7 @@ READ8_MEMBER( at_keyboard_controller_device::t1_r ) */ READ8_MEMBER( at_keyboard_controller_device::p1_r ) { - return 0xbf; + return ioport("DSW")->read(); } READ8_MEMBER( at_keyboard_controller_device::p2_r ) diff --git a/src/emu/machine/at_keybc.h b/src/emu/machine/at_keybc.h index f21c6d25035..2051071da5f 100644 --- a/src/emu/machine/at_keybc.h +++ b/src/emu/machine/at_keybc.h @@ -79,6 +79,7 @@ protected: virtual void device_reset(); virtual const rom_entry *device_rom_region() const; + virtual ioport_constructor device_input_ports() const; virtual machine_config_constructor device_mconfig_additions() const; private: |