Skip to content

Commit

Permalink
Eliminate "Atari VG EAROM" in favor of newer ER2055 device
Browse files Browse the repository at this point in the history
digdug: Use MCFG_DEVCB_RSHIFT for MCU DSW inputs (nw)

runaway, qwak: Add addressable latch (nw)
  • Loading branch information
ajrhacker committed Jun 27, 2018
1 parent 897192e commit 2d897be
Show file tree
Hide file tree
Showing 21 changed files with 333 additions and 330 deletions.
2 changes: 0 additions & 2 deletions scripts/target/mame/arcade.lua
Expand Up @@ -1257,8 +1257,6 @@ files {
MAME_DIR .. "src/mame/video/xybots.cpp",
MAME_DIR .. "src/mame/machine/asic65.cpp",
MAME_DIR .. "src/mame/machine/asic65.h",
MAME_DIR .. "src/mame/machine/atari_vg.cpp",
MAME_DIR .. "src/mame/machine/atari_vg.h",
MAME_DIR .. "src/mame/machine/atarigen.cpp",
MAME_DIR .. "src/mame/machine/atarigen.h",
MAME_DIR .. "src/mame/machine/mathbox.cpp",
Expand Down
5 changes: 4 additions & 1 deletion src/devices/machine/er2055.cpp
Expand Up @@ -4,7 +4,10 @@
er2055.c
GI 512 bit electrically alterable read-only memory.
GI 64 word x 8 bit electrically alterable read-only memory.
Atari often called this part "137161-001" on their technical manuals,
but their schematics usually called it by its proper ER-2055 name.
***************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion src/devices/machine/er2055.h
Expand Up @@ -28,7 +28,7 @@ class er2055_device : public device_t,
{
public:
// construction/destruction
er2055_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
er2055_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);

// I/O operations
uint8_t data() const { return m_data; }
Expand Down
35 changes: 30 additions & 5 deletions src/mame/drivers/asteroid.cpp
Expand Up @@ -249,7 +249,6 @@ NOTE: Previous program versions, for the second line would only show 4 digits.
#include "includes/asteroid.h"
#include "cpu/m6502/m6502.h"
#include "machine/74259.h"
#include "machine/atari_vg.h"
#include "machine/output_latch.h"
#include "machine/watchdog.h"
#include "sound/pokey.h"
Expand Down Expand Up @@ -285,6 +284,32 @@ WRITE_LINE_MEMBER(asteroid_state::coin_counter_right_w)



/*************************************
*
* High score EAROM
*
*************************************/

READ8_MEMBER(asteroid_state::earom_read)
{
return m_earom->data();
}

WRITE8_MEMBER(asteroid_state::earom_write)
{
m_earom->set_address(offset & 0x3f);
m_earom->set_data(data);
}

WRITE8_MEMBER(asteroid_state::earom_control_w)
{
// CK = DB0, C1 = /DB2, C2 = DB1, CS1 = DB3, /CS2 = GND
m_earom->set_control(BIT(data, 3), 1, !BIT(data, 2), BIT(data, 1));
m_earom->set_clk(BIT(data, 0));
}



/*************************************
*
* Main CPU memory handlers
Expand Down Expand Up @@ -323,12 +348,12 @@ void asteroid_state::astdelux_map(address_map &map)
map(0x2400, 0x2407).r(FUNC(asteroid_state::asteroid_IN1_r)).nopw(); /* IN1 */
map(0x2800, 0x2803).r(FUNC(asteroid_state::asteroid_DSW1_r)); /* DSW1 */
map(0x2c00, 0x2c0f).rw("pokey", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x2c40, 0x2c7f).r("earom", FUNC(atari_vg_earom_device::read));
map(0x2c40, 0x2c7f).r(FUNC(asteroid_state::earom_read));
map(0x3000, 0x3000).w(m_dvg, FUNC(dvg_device::go_w));
map(0x3200, 0x323f).w("earom", FUNC(atari_vg_earom_device::write)).nopr();
map(0x3200, 0x323f).w(FUNC(asteroid_state::earom_write)).nopr();
map(0x3400, 0x3400).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0x3600, 0x3600).w(FUNC(asteroid_state::asteroid_explode_w));
map(0x3a00, 0x3a00).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
map(0x3a00, 0x3a00).w(FUNC(asteroid_state::earom_control_w));
map(0x3c00, 0x3c07).w("audiolatch", FUNC(ls259_device::write_d7));
map(0x3e00, 0x3e00).w(FUNC(asteroid_state::asteroid_noise_reset_w));
map(0x4000, 0x47ff).ram().share("vectorram").region("maincpu", 0x4000);
Expand Down Expand Up @@ -762,7 +787,7 @@ MACHINE_CONFIG_START(asteroid_state::astdelux)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(astdelux_map)

MCFG_ATARIVGEAROM_ADD("earom")
MCFG_DEVICE_ADD("earom", ER2055)

/* sound hardware */
astdelux_sound(config);
Expand Down
51 changes: 40 additions & 11 deletions src/mame/drivers/bwidow.cpp
Expand Up @@ -225,7 +225,6 @@
#include "machine/watchdog.h"
#include "video/vector.h"
#include "video/avgdvg.h"
#include "machine/atari_vg.h"
#include "sound/pokey.h"
#include "sound/discrete.h"

Expand Down Expand Up @@ -357,6 +356,36 @@ WRITE8_MEMBER(bwidow_state::spacduel_coin_counter_w)
m_lastdata = data;
}

/*************************************
*
* High score EAROM
*
*************************************/

READ8_MEMBER(bwidow_state::earom_read)
{
return m_earom->data();
}

WRITE8_MEMBER(bwidow_state::earom_write)
{
m_earom->set_address(offset & 0x3f);
m_earom->set_data(data);
}

WRITE8_MEMBER(bwidow_state::earom_control_w)
{
// CK = DB0, C1 = /DB2, C2 = DB1, CS1 = DB3, /CS2 = GND
m_earom->set_control(BIT(data, 3), 1, !BIT(data, 2), BIT(data, 1));
m_earom->set_clk(BIT(data, 0));
}

void bwidow_state::machine_reset()
{
earom_control_w(machine().dummy_space(), 0, 0);
}


/*************************************
*
* Interrupt ack
Expand All @@ -382,16 +411,16 @@ void bwidow_state::bwidow_map(address_map &map)
map(0x2800, 0x5fff).rom();
map(0x6000, 0x67ff).rw("pokey1", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x6800, 0x6fff).rw("pokey2", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x7000, 0x7000).r("earom", FUNC(atari_vg_earom_device::read));
map(0x7000, 0x7000).r(FUNC(bwidow_state::earom_read));
map(0x7800, 0x7800).portr("IN0");
map(0x8000, 0x8000).portr("IN3");
map(0x8800, 0x8800).portr("IN4");
map(0x8800, 0x8800).w(FUNC(bwidow_state::bwidow_misc_w)); /* coin counters, leds */
map(0x8840, 0x8840).w("avg", FUNC(avg_device::go_w));
map(0x8880, 0x8880).w("avg", FUNC(avg_device::reset_w));
map(0x88c0, 0x88c0).w(FUNC(bwidow_state::irq_ack_w)); /* interrupt acknowledge */
map(0x8900, 0x8900).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
map(0x8940, 0x897f).w("earom", FUNC(atari_vg_earom_device::write));
map(0x8900, 0x8900).w(FUNC(bwidow_state::earom_control_w));
map(0x8940, 0x897f).w(FUNC(bwidow_state::earom_write));
map(0x8980, 0x89ed).nopw(); /* watchdog clear */
map(0x9000, 0xffff).rom();
}
Expand All @@ -410,9 +439,9 @@ void bwidow_state::bwidowp_map(address_map &map)
map(0x4000, 0x47ff).ram().share("vectorram").region("maincpu", 0x4000);
map(0x4800, 0x6fff).rom();
map(0x6000, 0x6000).w(FUNC(bwidow_state::irq_ack_w)); /* interrupt acknowledge */
map(0x8000, 0x803f).w("earom", FUNC(atari_vg_earom_device::write));
map(0x8800, 0x8800).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
map(0x9000, 0x9000).r("earom", FUNC(atari_vg_earom_device::read));
map(0x8000, 0x803f).w(FUNC(bwidow_state::earom_write));
map(0x8800, 0x8800).w(FUNC(bwidow_state::earom_control_w));
map(0x9000, 0x9000).r(FUNC(bwidow_state::earom_read));
map(0x9800, 0x9800).nopw(); /* ? written once at startup */
map(0xa000, 0xffff).rom();
}
Expand All @@ -423,14 +452,14 @@ void bwidow_state::spacduel_map(address_map &map)
map(0x0800, 0x0800).portr("IN0");
map(0x0900, 0x0907).r(FUNC(bwidow_state::spacduel_IN3_r)); /* IN1 */
map(0x0905, 0x0906).nopw(); /* ignore? */
map(0x0a00, 0x0a00).r("earom", FUNC(atari_vg_earom_device::read));
map(0x0a00, 0x0a00).r(FUNC(bwidow_state::earom_read));
map(0x0c00, 0x0c00).w(FUNC(bwidow_state::spacduel_coin_counter_w)); /* coin out */
map(0x0c80, 0x0c80).w("avg", FUNC(avg_device::go_w));
map(0x0d00, 0x0d00).nopw(); /* watchdog clear */
map(0x0d80, 0x0d80).w("avg", FUNC(avg_device::reset_w));
map(0x0e00, 0x0e00).w(FUNC(bwidow_state::irq_ack_w)); /* interrupt acknowledge */
map(0x0e80, 0x0e80).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
map(0x0f00, 0x0f3f).w("earom", FUNC(atari_vg_earom_device::write));
map(0x0e80, 0x0e80).w(FUNC(bwidow_state::earom_control_w));
map(0x0f00, 0x0f3f).w(FUNC(bwidow_state::earom_write));
map(0x1000, 0x10ff).rw("pokey1", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x1400, 0x14ff).rw("pokey2", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x2000, 0x27ff).ram().share("vectorram").region("maincpu", 0x2000);
Expand Down Expand Up @@ -741,7 +770,7 @@ MACHINE_CONFIG_START(bwidow_state::bwidow)
MCFG_DEVICE_PROGRAM_MAP(bwidow_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(bwidow_state, irq0_line_assert, CLOCK_3KHZ / 12)

MCFG_ATARIVGEAROM_ADD("earom")
MCFG_DEVICE_ADD("earom", ER2055)

/* video hardware */
MCFG_VECTOR_ADD("vector")
Expand Down
39 changes: 35 additions & 4 deletions src/mame/drivers/bzone.cpp
Expand Up @@ -213,7 +213,6 @@
#include "machine/watchdog.h"
#include "video/vector.h"
#include "video/avgdvg.h"
#include "machine/atari_vg.h"
#include "sound/pokey.h"
#include "screen.h"
#include "speaker.h"
Expand Down Expand Up @@ -242,6 +241,12 @@ void redbaron_state::machine_start()
}


void redbaron_state::machine_reset()
{
earom_control_w(machine().dummy_space(), 0, 0);
}



/*************************************
*
Expand Down Expand Up @@ -295,6 +300,32 @@ WRITE8_MEMBER(redbaron_state::redbaron_joysound_w)



/*************************************
*
* Red Baron EAROM
*
*************************************/

READ8_MEMBER(redbaron_state::earom_read)
{
return m_earom->data();
}

WRITE8_MEMBER(redbaron_state::earom_write)
{
m_earom->set_address((offset ^ 0x20) & 0x3f);
m_earom->set_data(data);
}

WRITE8_MEMBER(redbaron_state::earom_control_w)
{
// CK = EDB0, C1 = /EDB2, C2 = EDB1, CS1 = EDB3, /CS2 = GND
m_earom->set_control(BIT(data, 3), 1, !BIT(data, 2), BIT(data, 1));
m_earom->set_clk(BIT(data, 0));
}



/*************************************
*
* Main CPU memory handlers
Expand Down Expand Up @@ -339,9 +370,9 @@ void redbaron_state::redbaron_map(address_map &map)
map(0x1806, 0x1806).r("mathbox", FUNC(mathbox_device::hi_r));
map(0x1808, 0x1808).w(FUNC(redbaron_state::redbaron_joysound_w)); /* and select joystick pot also */
map(0x180a, 0x180a).nopw(); /* sound reset, yet todo */
map(0x180c, 0x180c).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
map(0x180c, 0x180c).w(FUNC(redbaron_state::earom_control_w));
map(0x1810, 0x181f).rw("pokey", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x1820, 0x185f).rw("earom", FUNC(atari_vg_earom_device::read), FUNC(atari_vg_earom_device::write));
map(0x1820, 0x185f).rw(FUNC(redbaron_state::earom_read), FUNC(redbaron_state::earom_write));
map(0x1860, 0x187f).w("mathbox", FUNC(mathbox_device::go_w));
map(0x2000, 0x2fff).ram().share("vectorram").region("maincpu", 0x2000);
map(0x3000, 0x7fff).rom();
Expand Down Expand Up @@ -580,7 +611,7 @@ MACHINE_CONFIG_START(redbaron_state::redbaron)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(redbaron_map)

MCFG_ATARIVGEAROM_ADD("earom")
MCFG_DEVICE_ADD("earom", ER2055)

/* video hardware */
MCFG_SCREEN_MODIFY("screen")
Expand Down

0 comments on commit 2d897be

Please sign in to comment.