diff options
| author | 2016-04-14 07:55:32 +0200 | |
|---|---|---|
| committer | 2016-04-14 07:55:32 +0200 | |
| commit | 013440849c1973d0a4d662afdddc0ff601d2acd6 (patch) | |
| tree | 4c07384a88df1ceede2865dfbf611977fe1c5dab /src/devices | |
| parent | bf9ef09474ecf4a13758b77b846dc841cd04b893 (diff) | |
8bit handlers are more appropriate here. nw.
Diffstat (limited to 'src/devices')
| -rw-r--r-- | src/devices/bus/neogeo_ctrl/ctrl.cpp | 4 | ||||
| -rw-r--r-- | src/devices/bus/neogeo_ctrl/ctrl.h | 6 | ||||
| -rw-r--r-- | src/devices/bus/neogeo_ctrl/joystick.cpp | 19 | ||||
| -rw-r--r-- | src/devices/bus/neogeo_ctrl/joystick.h | 4 | ||||
| -rw-r--r-- | src/devices/bus/neogeo_ctrl/mahjong.cpp | 74 | ||||
| -rw-r--r-- | src/devices/bus/neogeo_ctrl/mahjong.h | 2 |
6 files changed, 52 insertions, 57 deletions
diff --git a/src/devices/bus/neogeo_ctrl/ctrl.cpp b/src/devices/bus/neogeo_ctrl/ctrl.cpp index 94d85f99b99..6f96fdd3762 100644 --- a/src/devices/bus/neogeo_ctrl/ctrl.cpp +++ b/src/devices/bus/neogeo_ctrl/ctrl.cpp @@ -77,9 +77,9 @@ void neogeo_control_port_device::device_start() } -UINT16 neogeo_control_port_device::read_ctrl() +UINT8 neogeo_control_port_device::read_ctrl() { - UINT16 data = 0; + UINT8 data = 0; if (m_device) data |= m_device->read_ctrl(); return data; diff --git a/src/devices/bus/neogeo_ctrl/ctrl.h b/src/devices/bus/neogeo_ctrl/ctrl.h index 82777f6fe60..841516e3a27 100644 --- a/src/devices/bus/neogeo_ctrl/ctrl.h +++ b/src/devices/bus/neogeo_ctrl/ctrl.h @@ -29,7 +29,7 @@ public: device_neogeo_control_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_neogeo_control_port_interface(); - virtual UINT16 read_ctrl() { return 0xffff; }; + virtual UINT8 read_ctrl() { return 0xff; }; virtual UINT8 read_start_sel() { return 0xff; }; virtual void write_ctrlsel(UINT8 data) { }; @@ -47,10 +47,10 @@ public: neogeo_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); virtual ~neogeo_control_port_device(); - UINT16 read_ctrl(); + UINT8 read_ctrl(); UINT8 read_start_sel(); void write_ctrlsel(UINT8 data); - DECLARE_READ16_MEMBER( ctrl_r ) { return read_ctrl(); } + DECLARE_READ8_MEMBER( ctrl_r ) { return read_ctrl(); } protected: // device-level overrides diff --git a/src/devices/bus/neogeo_ctrl/joystick.cpp b/src/devices/bus/neogeo_ctrl/joystick.cpp index dc884138413..bdeda3aeb8a 100644 --- a/src/devices/bus/neogeo_ctrl/joystick.cpp +++ b/src/devices/bus/neogeo_ctrl/joystick.cpp @@ -17,15 +17,14 @@ const device_type NEOGEO_JOYSTICK = &device_creator<neogeo_joystick_device>; static INPUT_PORTS_START( neogeo_joy ) PORT_START("JOY") - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_START("START_SELECT") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START ) @@ -83,7 +82,7 @@ void neogeo_joystick_device::device_reset() // read_ctrl //------------------------------------------------- -UINT16 neogeo_joystick_device::read_ctrl() +UINT8 neogeo_joystick_device::read_ctrl() { return m_joy->read(); } diff --git a/src/devices/bus/neogeo_ctrl/joystick.h b/src/devices/bus/neogeo_ctrl/joystick.h index 742964a518c..312a1f92a76 100644 --- a/src/devices/bus/neogeo_ctrl/joystick.h +++ b/src/devices/bus/neogeo_ctrl/joystick.h @@ -37,7 +37,7 @@ protected: virtual void device_reset() override; // device_intv_control_port_interface overrides - virtual UINT16 read_ctrl() override; + virtual UINT8 read_ctrl() override; virtual UINT8 read_start_sel() override; private: @@ -64,7 +64,7 @@ protected: virtual void device_reset() override; // device_intv_control_port_interface overrides - virtual UINT16 read_ctrl() override; + virtual UINT8 read_ctrl() override; private: required_ioport m_joy; diff --git a/src/devices/bus/neogeo_ctrl/mahjong.cpp b/src/devices/bus/neogeo_ctrl/mahjong.cpp index 5f9768531b2..f0af20fb71f 100644 --- a/src/devices/bus/neogeo_ctrl/mahjong.cpp +++ b/src/devices/bus/neogeo_ctrl/mahjong.cpp @@ -17,49 +17,45 @@ const device_type NEOGEO_MJCTRL = &device_creator<neogeo_mjctrl_device>; static INPUT_PORTS_START( neogeo_joy ) PORT_START("MJ.0") - PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_A ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_B ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_C ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_D ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_E ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_F ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_G ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_B ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_C ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_D ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_F ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_G ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("MJ.1") - PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_H ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_I ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_J ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_K ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_L ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_M ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_N ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_H ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_I ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_K ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_L ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_M ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_N ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) // is this actually connected? PORT_START("MJ.2") - PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_START("MJ.3") - PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("START_SELECT") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) @@ -119,13 +115,13 @@ void neogeo_mjctrl_device::device_reset() // read_ctrl //------------------------------------------------- -UINT16 neogeo_mjctrl_device::read_ctrl() +UINT8 neogeo_mjctrl_device::read_ctrl() { - UINT16 res = 0; + UINT8 res = 0; switch (m_ctrl_sel) { default: - case 0x00: res = 0xffff; break; + case 0x00: res = 0xff; break; case 0x09: res = m_mjpanel[0]->read(); break; case 0x12: res = m_mjpanel[1]->read(); break; case 0x1b: res = m_mjpanel[2]->read(); break; diff --git a/src/devices/bus/neogeo_ctrl/mahjong.h b/src/devices/bus/neogeo_ctrl/mahjong.h index 68ceeb91268..6c92851dee9 100644 --- a/src/devices/bus/neogeo_ctrl/mahjong.h +++ b/src/devices/bus/neogeo_ctrl/mahjong.h @@ -37,7 +37,7 @@ protected: virtual void device_reset() override; // device_intv_control_port_interface overrides - virtual UINT16 read_ctrl() override; + virtual UINT8 read_ctrl() override; virtual UINT8 read_start_sel() override; virtual void write_ctrlsel(UINT8 data) override; |
