summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-06-08 19:55:54 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-06-08 20:01:14 -0400
commit59f1767fa64853ab77c3e3041379bb36e8ab7a02 (patch)
treec132d00fdded5fc8df5289ffa089f29a38b1b0d3
parent19105986a85c905b193f12774373cd83bc34a300 (diff)
groundfx: Use TC0510NIO device for inputs
groundfx, cbombers & clones: Add MACHINE_NODEVICE_LAN flag (nw)
-rw-r--r--src/mame/drivers/groundfx.cpp103
-rw-r--r--src/mame/drivers/undrfire.cpp6
-rw-r--r--src/mame/includes/groundfx.h9
-rw-r--r--src/mame/includes/undrfire.h1
4 files changed, 39 insertions, 80 deletions
diff --git a/src/mame/drivers/groundfx.cpp b/src/mame/drivers/groundfx.cpp
index 7f131bc59bc..e7d589c8878 100644
--- a/src/mame/drivers/groundfx.cpp
+++ b/src/mame/drivers/groundfx.cpp
@@ -67,6 +67,7 @@
#include "emu.h"
#include "includes/groundfx.h"
#include "audio/taito_en.h"
+#include "machine/taitoio.h"
#include "cpu/m68000/m68000.h"
#include "machine/eepromser.h"
@@ -95,44 +96,17 @@ void groundfx_state::device_timer(emu_timer &timer, device_timer_id id, int para
GAME INPUTS
**********************************************************/
-CUSTOM_INPUT_MEMBER(groundfx_state::frame_counter_r)
+READ_LINE_MEMBER(groundfx_state::frame_counter_r)
{
return m_frame_counter;
}
-CUSTOM_INPUT_MEMBER(groundfx_state::coin_word_r)
+WRITE8_MEMBER(groundfx_state::coin_word_w)
{
- return m_coin_word;
-}
-
-WRITE32_MEMBER(groundfx_state::input_w)
-{
- switch (offset)
- {
- case 0x00:
- if (ACCESSING_BITS_24_31) /* $500000 is watchdog */
- {
- m_watchdog->watchdog_reset();
- }
-
- if (ACCESSING_BITS_0_7)
- {
- ioport("EEPROMOUT")->write(data, 0xff);
- }
-
- break;
-
- case 0x01:
- if (ACCESSING_BITS_24_31)
- {
- machine().bookkeeping().coin_lockout_w(0,~data & 0x01000000);
- machine().bookkeeping().coin_lockout_w(1,~data & 0x02000000);
- machine().bookkeeping().coin_counter_w(0, data & 0x04000000);
- machine().bookkeeping().coin_counter_w(1, data & 0x08000000);
- m_coin_word = (data >> 16) &0xffff;
- }
- break;
- }
+ machine().bookkeeping().coin_lockout_w(0,~data & 0x01);
+ machine().bookkeeping().coin_lockout_w(1,~data & 0x02);
+ machine().bookkeeping().coin_counter_w(0, data & 0x04);
+ machine().bookkeeping().coin_counter_w(1, data & 0x08);
}
READ32_MEMBER(groundfx_state::adc_r)
@@ -187,9 +161,7 @@ static ADDRESS_MAP_START( groundfx_map, AS_PROGRAM, 32, groundfx_state )
AM_RANGE(0x200000, 0x21ffff) AM_RAM AM_SHARE("ram") /* main CPUA ram */
AM_RANGE(0x300000, 0x303fff) AM_RAM AM_SHARE("spriteram") /* sprite ram */
AM_RANGE(0x400000, 0x400003) AM_WRITE(motor_control_w) /* gun vibration */
- AM_RANGE(0x500000, 0x500003) AM_READ_PORT("BUTTONS")
- AM_RANGE(0x500004, 0x500007) AM_READ_PORT("SYSTEM")
- AM_RANGE(0x500000, 0x500007) AM_WRITE(input_w) /* eeprom etc. */
+ AM_RANGE(0x500000, 0x500007) AM_DEVREADWRITE8("tc0510nio", tc0510nio_device, read, write, 0xffffffff)
AM_RANGE(0x600000, 0x600003) AM_READWRITE(adc_r, adc_w)
AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("snd_shared")
AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, long_r, long_w) /* tilemaps */
@@ -209,39 +181,24 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( groundfx )
PORT_START("BUTTONS")
- PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, groundfx_state,frame_counter_r, nullptr)
- PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
- PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* shift hi */
- PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* brake */
- PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* shift low */
- PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED )
-
- PORT_START( "EEPROMOUT" )
- PORT_BIT( 0x00000010, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, cs_write)
- PORT_BIT( 0x00000020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, clk_write)
- PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, di_write)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* shift hi */
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* brake */
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* shift low */
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SYSTEM")
- PORT_SERVICE_NO_TOGGLE( 0x00000001, IP_ACTIVE_LOW )
- PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_COIN1 )
- PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, groundfx_state, coin_word_r, nullptr)
+ PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("AN0") /* IN 2, steering wheel */
PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(1)
@@ -320,7 +277,15 @@ static MACHINE_CONFIG_START( groundfx )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
- MCFG_WATCHDOG_ADD("watchdog")
+ MCFG_DEVICE_ADD("tc0510nio", TC0510NIO, 0)
+ MCFG_TC0510NIO_READ_2_CB(IOPORT("BUTTONS"))
+ MCFG_TC0510NIO_READ_3_CB(DEVREADLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(7)
+ MCFG_DEVCB_CHAIN_INPUT(READLINE(groundfx_state, frame_counter_r)) MCFG_DEVCB_BIT(0)
+ MCFG_TC0510NIO_WRITE_3_CB(DEVWRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) MCFG_DEVCB_BIT(5)
+ MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) MCFG_DEVCB_BIT(6)
+ MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) MCFG_DEVCB_BIT(4)
+ MCFG_TC0510NIO_WRITE_4_CB(WRITE8(groundfx_state, coin_word_w))
+ MCFG_TC0510NIO_READ_7_CB(IOPORT("SYSTEM"))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -442,4 +407,4 @@ DRIVER_INIT_MEMBER(groundfx_state,groundfx)
}
-GAME( 1992, groundfx, 0, groundfx, groundfx, groundfx_state, groundfx, ROT0, "Taito Corporation", "Ground Effects / Super Ground Effects (Japan)", 0 )
+GAME( 1992, groundfx, 0, groundfx, groundfx, groundfx_state, groundfx, ROT0, "Taito Corporation", "Ground Effects / Super Ground Effects (Japan)", MACHINE_NODEVICE_LAN )
diff --git a/src/mame/drivers/undrfire.cpp b/src/mame/drivers/undrfire.cpp
index df698159cf9..fe69201c5b7 100644
--- a/src/mame/drivers/undrfire.cpp
+++ b/src/mame/drivers/undrfire.cpp
@@ -1126,6 +1126,6 @@ DRIVER_INIT_MEMBER(undrfire_state,cbombers)
GAME( 1993, undrfire, 0, undrfire, undrfire, undrfire_state, undrfire, ROT0, "Taito Corporation Japan", "Under Fire (World)", 0 )
GAME( 1993, undrfireu, undrfire, undrfire, undrfire, undrfire_state, undrfire, ROT0, "Taito America Corporation", "Under Fire (US)", 0 )
GAME( 1993, undrfirej, undrfire, undrfire, undrfire, undrfire_state, undrfire, ROT0, "Taito Corporation", "Under Fire (Japan)", 0 )
-GAMEL(1994, cbombers, 0, cbombers, cbombers, undrfire_state, cbombers, ROT0, "Taito Corporation Japan", "Chase Bombers (World)", MACHINE_IMPERFECT_GRAPHICS, layout_cbombers )
-GAMEL(1994, cbombersj, cbombers, cbombers, cbombers, undrfire_state, cbombers, ROT0, "Taito Corporation", "Chase Bombers (Japan)", MACHINE_IMPERFECT_GRAPHICS, layout_cbombers )
-GAMEL(1994, cbombersp, cbombers, cbombers, cbombers, undrfire_state, cbombers, ROT0, "Taito Corporation", "Chase Bombers (Japan Prototype)", MACHINE_IMPERFECT_GRAPHICS, layout_cbombers )
+GAMEL(1994, cbombers, 0, cbombers, cbombers, undrfire_state, cbombers, ROT0, "Taito Corporation Japan", "Chase Bombers (World)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN, layout_cbombers )
+GAMEL(1994, cbombersj, cbombers, cbombers, cbombers, undrfire_state, cbombers, ROT0, "Taito Corporation", "Chase Bombers (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN, layout_cbombers )
+GAMEL(1994, cbombersp, cbombers, cbombers, cbombers, undrfire_state, cbombers, ROT0, "Taito Corporation", "Chase Bombers (Japan Prototype)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN, layout_cbombers )
diff --git a/src/mame/includes/groundfx.h b/src/mame/includes/groundfx.h
index 9a2225aab29..9568b075d71 100644
--- a/src/mame/includes/groundfx.h
+++ b/src/mame/includes/groundfx.h
@@ -1,7 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
-#include "machine/watchdog.h"
#include "video/tc0100scn.h"
#include "video/tc0480scp.h"
@@ -28,7 +27,6 @@ public:
m_ram(*this,"ram"),
m_spriteram(*this,"spriteram") ,
m_maincpu(*this, "maincpu"),
- m_watchdog(*this, "watchdog"),
m_tc0100scn(*this, "tc0100scn"),
m_tc0480scp(*this, "tc0480scp"),
m_gfxdecode(*this, "gfxdecode"),
@@ -38,13 +36,11 @@ public:
required_shared_ptr<uint32_t> m_spriteram;
required_device<cpu_device> m_maincpu;
- required_device<watchdog_timer_device> m_watchdog;
required_device<tc0100scn_device> m_tc0100scn;
required_device<tc0480scp_device> m_tc0480scp;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- uint16_t m_coin_word;
uint16_t m_frame_counter;
uint16_t m_port_sel;
std::unique_ptr<gfx_tempsprite[]> m_spritelist;
@@ -52,14 +48,13 @@ public:
rectangle m_hack_cliprect;
emu_timer *m_interrupt5_timer;
- DECLARE_WRITE32_MEMBER(input_w);
DECLARE_READ32_MEMBER(adc_r);
DECLARE_WRITE32_MEMBER(adc_w);
DECLARE_WRITE32_MEMBER(rotate_control_w);
DECLARE_WRITE32_MEMBER(motor_control_w);
DECLARE_READ32_MEMBER(irq_speedup_r);
- DECLARE_CUSTOM_INPUT_MEMBER(frame_counter_r);
- DECLARE_CUSTOM_INPUT_MEMBER(coin_word_r);
+ DECLARE_READ_LINE_MEMBER(frame_counter_r);
+ DECLARE_WRITE8_MEMBER(coin_word_w);
DECLARE_DRIVER_INIT(groundfx);
virtual void video_start() override;
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
diff --git a/src/mame/includes/undrfire.h b/src/mame/includes/undrfire.h
index 7cd215d28e0..89f738c9c1f 100644
--- a/src/mame/includes/undrfire.h
+++ b/src/mame/includes/undrfire.h
@@ -43,7 +43,6 @@ public:
required_device<eeprom_serial_93cxx_device> m_eeprom;
optional_shared_ptr<uint32_t> m_ram;
optional_shared_ptr<uint32_t> m_shared_ram;
- uint16_t m_coin_word;
uint16_t m_port_sel;
int m_frame_counter;
std::unique_ptr<uf_tempsprite[]> m_spritelist;