summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/centiped.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/centiped.cpp')
-rw-r--r--src/mame/drivers/centiped.cpp64
1 files changed, 47 insertions, 17 deletions
diff --git a/src/mame/drivers/centiped.cpp b/src/mame/drivers/centiped.cpp
index dff31e015e6..404e900c10c 100644
--- a/src/mame/drivers/centiped.cpp
+++ b/src/mame/drivers/centiped.cpp
@@ -421,7 +421,6 @@ each direction to assign the boundries.
#include "cpu/s2650/s2650.h"
#include "machine/74259.h"
#include "machine/watchdog.h"
-#include "machine/atari_vg.h"
#include "sound/sn76496.h"
#include "sound/pokey.h"
#include "speaker.h"
@@ -457,6 +456,9 @@ MACHINE_RESET_MEMBER(centiped_state,centiped)
{
m_maincpu->set_input_line(0, CLEAR_LINE);
m_prg_bank = 0;
+
+ if (m_earom.found())
+ earom_control_w(machine().dummy_space(), 0, 0);
}
@@ -647,6 +649,32 @@ WRITE_LINE_MEMBER(centiped_state::bullsdrt_coin_count_w)
/*************************************
*
+ * High score EAROM
+ *
+ *************************************/
+
+READ8_MEMBER(centiped_state::earom_read)
+{
+ return m_earom->data();
+}
+
+WRITE8_MEMBER(centiped_state::earom_write)
+{
+ m_earom->set_address(offset & 0x3f);
+ m_earom->set_data(data);
+}
+
+WRITE8_MEMBER(centiped_state::earom_control_w)
+{
+ // CK = DB0, C1 = /DB1, C2 = DB2, CS1 = DB3, /CS2 = GND
+ m_earom->set_control(BIT(data, 3), 1, !BIT(data, 1), BIT(data, 2));
+ m_earom->set_clk(BIT(data, 0));
+}
+
+
+
+/*************************************
+ *
* Centipede CPU memory handlers
*
*************************************/
@@ -664,9 +692,9 @@ void centiped_state::centiped_base_map(address_map &map)
map(0x0c02, 0x0c02).r(FUNC(centiped_state::centiped_IN2_r));
map(0x0c03, 0x0c03).portr("IN3");
map(0x1400, 0x140f).w(FUNC(centiped_state::centiped_paletteram_w)).share("paletteram");
- map(0x1600, 0x163f).nopr().w("earom", FUNC(atari_vg_earom_device::write));
- map(0x1680, 0x1680).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
- map(0x1700, 0x173f).r("earom", FUNC(atari_vg_earom_device::read));
+ map(0x1600, 0x163f).nopr().w(FUNC(centiped_state::earom_write));
+ map(0x1680, 0x1680).w(FUNC(centiped_state::earom_control_w));
+ map(0x1700, 0x173f).r(FUNC(centiped_state::earom_read));
map(0x1800, 0x1800).w(FUNC(centiped_state::irq_ack_w));
map(0x1c00, 0x1c07).nopr().w("outlatch", FUNC(ls259_device::write_d7));
map(0x2000, 0x2000).w("watchdog", FUNC(watchdog_timer_device::reset_w));
@@ -706,9 +734,9 @@ void centiped_state::centipdb_map(address_map &map)
map(0x1000, 0x1001).mirror(0x4000).w(m_aysnd, FUNC(ay8910_device::data_address_w));
map(0x1001, 0x1001).mirror(0x4000).r(m_aysnd, FUNC(ay8910_device::data_r));
map(0x1400, 0x140f).mirror(0x4000).w(FUNC(centiped_state::centiped_paletteram_w)).share("paletteram");
- map(0x1600, 0x163f).mirror(0x4000).w("earom", FUNC(atari_vg_earom_device::write));
- map(0x1680, 0x1680).mirror(0x4000).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
- map(0x1700, 0x173f).mirror(0x4000).r("earom", FUNC(atari_vg_earom_device::read));
+ map(0x1600, 0x163f).mirror(0x4000).w(FUNC(centiped_state::earom_write));
+ map(0x1680, 0x1680).mirror(0x4000).w(FUNC(centiped_state::earom_control_w));
+ map(0x1700, 0x173f).mirror(0x4000).r(FUNC(centiped_state::earom_read));
map(0x1800, 0x1800).mirror(0x4000).w(FUNC(centiped_state::irq_ack_w));
map(0x1c00, 0x1c07).mirror(0x4000).w("outlatch", FUNC(ls259_device::write_d7));
map(0x2000, 0x27ff).rom();
@@ -764,13 +792,13 @@ void centiped_state::milliped_map(address_map &map)
map(0x2001, 0x2001).r(FUNC(centiped_state::milliped_IN1_r));
map(0x2010, 0x2010).r(FUNC(centiped_state::milliped_IN2_r));
map(0x2011, 0x2011).portr("IN3");
- map(0x2030, 0x2030).r("earom", FUNC(atari_vg_earom_device::read));
+ map(0x2030, 0x2030).r(FUNC(centiped_state::earom_read));
map(0x2480, 0x249f).w(FUNC(centiped_state::milliped_paletteram_w)).share("paletteram");
map(0x2500, 0x2507).w("outlatch", FUNC(ls259_device::write_d7));
map(0x2600, 0x2600).w(FUNC(centiped_state::irq_ack_w));
map(0x2680, 0x2680).w("watchdog", FUNC(watchdog_timer_device::reset_w));
- map(0x2700, 0x2700).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
- map(0x2780, 0x27bf).w("earom", FUNC(atari_vg_earom_device::write));
+ map(0x2700, 0x2700).w(FUNC(centiped_state::earom_control_w));
+ map(0x2780, 0x27bf).w(FUNC(centiped_state::earom_write));
map(0x4000, 0x7fff).rom();
}
@@ -909,14 +937,14 @@ void centiped_state::mazeinv_map(address_map &map)
map(0x2010, 0x2010).portr("IN2");
map(0x2011, 0x2011).portr("IN3");
map(0x2020, 0x2020).r(FUNC(centiped_state::mazeinv_input_r));
- map(0x2030, 0x2030).r("earom", FUNC(atari_vg_earom_device::read));
+ map(0x2030, 0x2030).r(FUNC(centiped_state::earom_read));
map(0x2480, 0x249f).w(FUNC(centiped_state::mazeinv_paletteram_w)).share("paletteram");
map(0x2500, 0x2507).w("outlatch", FUNC(ls259_device::write_d7));
map(0x2580, 0x2583).w(FUNC(centiped_state::mazeinv_input_select_w));
map(0x2600, 0x2600).w(FUNC(centiped_state::irq_ack_w));
map(0x2680, 0x2680).w("watchdog", FUNC(watchdog_timer_device::reset_w));
- map(0x2700, 0x2700).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
- map(0x2780, 0x27bf).w("earom", FUNC(atari_vg_earom_device::write));
+ map(0x2700, 0x2700).w(FUNC(centiped_state::earom_control_w));
+ map(0x2780, 0x27bf).w(FUNC(centiped_state::earom_write));
map(0x3000, 0x7fff).rom();
}
@@ -935,8 +963,8 @@ void centiped_state::bullsdrt_map(address_map &map)
map(0x1080, 0x1080).mirror(0x6000).r(FUNC(centiped_state::centiped_IN0_r));
map(0x1081, 0x1081).mirror(0x6000).portr("IN1");
map(0x1082, 0x1082).mirror(0x6000).r(FUNC(centiped_state::centiped_IN2_r));
- map(0x1200, 0x123f).mirror(0x6000).rw("earom", FUNC(atari_vg_earom_device::read), FUNC(atari_vg_earom_device::write));
- map(0x1280, 0x1280).mirror(0x6000).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
+ map(0x1200, 0x123f).mirror(0x6000).rw(FUNC(centiped_state::earom_read), FUNC(centiped_state::earom_write));
+ map(0x1280, 0x1280).mirror(0x6000).w(FUNC(centiped_state::earom_control_w));
map(0x1300, 0x1300).mirror(0x6000).portr("DSW2");
map(0x1400, 0x140f).mirror(0x6000).w(FUNC(centiped_state::centiped_paletteram_w)).share("paletteram");
map(0x1480, 0x1487).mirror(0x6000).w("outlatch", FUNC(ls259_device::write_d7));
@@ -1719,7 +1747,7 @@ MACHINE_CONFIG_START(centiped_state::centiped_base)
MCFG_MACHINE_START_OVERRIDE(centiped_state,centiped)
MCFG_MACHINE_RESET_OVERRIDE(centiped_state,centiped)
- MCFG_ATARIVGEAROM_ADD("earom")
+ MCFG_DEVICE_ADD("earom", ER2055)
MCFG_DEVICE_ADD("outlatch", LS259, 0)
MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, centiped_state, coin_counter_left_w))
@@ -1884,6 +1912,8 @@ MACHINE_CONFIG_START(centiped_state::warlords)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(warlords_map)
+ MCFG_DEVICE_REMOVE("earom")
+
// these extra LEDs also appear on Centipede schematics
MCFG_DEVICE_MODIFY("outlatch") // P9
MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led2")) MCFG_DEVCB_INVERT // LED 3
@@ -1934,7 +1964,7 @@ MACHINE_CONFIG_START(centiped_state::bullsdrt)
MCFG_DEVICE_IO_MAP(bullsdrt_port_map)
MCFG_DEVICE_DATA_MAP(bullsdrt_data_map)
- MCFG_ATARIVGEAROM_ADD("earom")
+ MCFG_DEVICE_ADD("earom", ER2055)
MCFG_DEVICE_ADD("outlatch", LS259, 0)
MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, centiped_state, bullsdrt_coin_count_w))