summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2021-01-19 19:30:39 +0100
committer Ivan Vangelista <mesgnet@yahoo.it>2021-01-19 19:30:39 +0100
commit3583cce9af36c0739be83955a2456b17687c7fd5 (patch)
tree185dd20bbe96f3a14dc30b0073aecf5a8b102c47 /src/mame
parent5c17e6c1d699197d97f5d1a27d9f1c003a4c13c6 (diff)
xybots.cpp: fixed MT05379
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/audio/atarijsa.cpp13
-rw-r--r--src/mame/audio/atarijsa.h6
-rw-r--r--src/mame/drivers/xybots.cpp7
3 files changed, 18 insertions, 8 deletions
diff --git a/src/mame/audio/atarijsa.cpp b/src/mame/audio/atarijsa.cpp
index df19e59a73f..27112bec3b4 100644
--- a/src/mame/audio/atarijsa.cpp
+++ b/src/mame/audio/atarijsa.cpp
@@ -178,6 +178,14 @@ INPUT_PORTS_START( jsa_i_ioports )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER(DEVICE_SELF, atari_jsa_base_device, main_test_read_line) // self test
INPUT_PORTS_END
+INPUT_PORTS_START( jsa_i_ioports_inverted_coins )
+ PORT_INCLUDE( jsa_i_ioports )
+
+ PORT_MODIFY("JSAI")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
+INPUT_PORTS_END
+
INPUT_PORTS_START( jsa_ii_ioports )
PORT_START("JSAII")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
@@ -630,7 +638,8 @@ atari_jsa_i_device::atari_jsa_i_device(const machine_config &mconfig, const char
m_tms5220(*this, "tms"),
m_jsai(*this, "JSAI"),
m_pokey_volume(1.0),
- m_tms5220_volume(1.0)
+ m_tms5220_volume(1.0),
+ m_inverted_coins(false)
{
}
@@ -800,7 +809,7 @@ void atari_jsa_i_device::device_add_mconfig(machine_config &config)
ioport_constructor atari_jsa_i_device::device_input_ports() const
{
- return INPUT_PORTS_NAME( jsa_i_ioports );
+ return m_inverted_coins ? INPUT_PORTS_NAME( jsa_i_ioports_inverted_coins ) : INPUT_PORTS_NAME( jsa_i_ioports );
}
diff --git a/src/mame/audio/atarijsa.h b/src/mame/audio/atarijsa.h
index 4fcaf5e7bd6..ec495fbcef5 100644
--- a/src/mame/audio/atarijsa.h
+++ b/src/mame/audio/atarijsa.h
@@ -169,6 +169,9 @@ public:
// construction/destruction
atari_jsa_i_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ // configuration
+ void set_inverted_coins() { m_inverted_coins = true; } // for Xybots
+
// read/write handlers
uint8_t rdio_r();
void wrio_w(uint8_t data);
@@ -196,6 +199,9 @@ protected:
// internal state
double m_pokey_volume;
double m_tms5220_volume;
+
+private:
+ bool m_inverted_coins;
};
diff --git a/src/mame/drivers/xybots.cpp b/src/mame/drivers/xybots.cpp
index 0abfe46ede8..93c902479e8 100644
--- a/src/mame/drivers/xybots.cpp
+++ b/src/mame/drivers/xybots.cpp
@@ -121,12 +121,6 @@ static INPUT_PORTS_START( xybots )
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* 256H */
PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* VBLANK */
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
-
- /* Xybots uses a swapped version */
-// todo:
-// PORT_MODIFY("jsa:JSAI")
-// PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
-// PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
INPUT_PORTS_END
@@ -214,6 +208,7 @@ void xybots_state::xybots(machine_config &config)
ATARI_JSA_I(config, m_jsa, 0);
m_jsa->main_int_cb().set_inputline(m_maincpu, M68K_IRQ_2);
m_jsa->test_read_cb().set_ioport("FFE200").bit(8);
+ m_jsa->set_inverted_coins();
m_jsa->add_route(0, "rspeaker", 1.0);
m_jsa->add_route(1, "lspeaker", 1.0);
config.device_remove("jsa:pokey");