summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-12-24 08:54:09 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-12-24 08:54:09 +0000
commit87d9c3e12cf7ae19fd7b26b5eeab88459baf3663 (patch)
tree56ab085eff362697814127926f7b348b3e88fbb4
parentafac4a56bab0134d08e326a05bad564d4ea7f41a (diff)
Updated segas32, simpl156, seibuspi, ssv, and stlforce to use eeprom device.
-rw-r--r--src/mame/drivers/segas32.c156
-rw-r--r--src/mame/drivers/seibuspi.c58
-rw-r--r--src/mame/drivers/simpl156.c131
-rw-r--r--src/mame/drivers/ssv.c38
-rw-r--r--src/mame/drivers/stlforce.c68
5 files changed, 139 insertions, 312 deletions
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index a9c99fec17f..1ffd5dc127e 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -320,7 +320,7 @@ MIB.42
#include "cpu/nec/nec.h"
#include "rendlay.h"
#include "includes/segas32.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "sound/2612intf.h"
#include "sound/rf5c68.h"
#include "sound/multipcm.h"
@@ -371,7 +371,6 @@ UINT16 *system32_protram;
*
*************************************/
-static const UINT8 *system32_default_eeprom;
static UINT8 *z80_shared_ram;
/* V60 interrupt controller */
@@ -690,9 +689,10 @@ static void common_io_chip_w(const address_space *space, int which, offs_t offse
case 0x06/2:
if (which == 0)
{
- eeprom_write_bit(data & 0x80);
- eeprom_set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
- eeprom_set_clock_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
+ const device_config *device = devtag_get_device(space->machine, "eeprom");
+ eepromdev_write_bit(device, data & 0x80);
+ eepromdev_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
+ eepromdev_set_clock_line(device, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
}
/* coin_lockout_w(space->machine, 1 + 2*which, data & 0x08);
coin_lockout_w(space->machine, 0 + 2*which, data & 0x04);*/
@@ -707,9 +707,10 @@ static void common_io_chip_w(const address_space *space, int which, offs_t offse
else
{
/* multi-32 EEPROM access */
- eeprom_write_bit(data & 0x80);
- eeprom_set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
- eeprom_set_clock_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
+ const device_config *device = devtag_get_device(space->machine, "eeprom");
+ eepromdev_write_bit(device, data & 0x80);
+ eepromdev_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
+ eepromdev_set_clock_line(device, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
}
break;
@@ -1180,29 +1181,6 @@ static WRITE8_HANDLER( sound_dummy_w )
/*************************************
*
- * NVRAM handler
- *
- *************************************/
-
-static NVRAM_HANDLER( system32 )
-{
- if (read_or_write)
- eeprom_save(file);
- else
- {
- eeprom_init(machine, &eeprom_interface_93C46);
-
- if (file)
- eeprom_load(file);
- else if (system32_default_eeprom != NULL)
- eeprom_set_data(system32_default_eeprom, 0x80);
- }
-}
-
-
-
-/*************************************
- *
* Main CPU memory handlers
*
*************************************/
@@ -1357,7 +1335,7 @@ static INPUT_PORTS_START( system32_generic )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 ) /* sometimes mirrors SERVICE1 */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE4 ) /* tends to also work as a test switch */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_START("PORTG_A")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1392,7 +1370,7 @@ static INPUT_PORTS_START( multi32_generic )
PORT_START("SERVICE34_B")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_START("PORTG_B")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2187,7 +2165,8 @@ static MACHINE_DRIVER_START( system32 )
MDRV_CPU_IO_MAP(system32_sound_portmap)
MDRV_MACHINE_RESET(system32)
- MDRV_NVRAM_HANDLER(system32)
+
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
MDRV_TIMER_ADD("v60_irq0", signal_v60_irq_callback)
MDRV_TIMER_ADD("v60_irq1", signal_v60_irq_callback)
@@ -2244,7 +2223,8 @@ static MACHINE_DRIVER_START( multi32 )
MDRV_CPU_IO_MAP(multi32_sound_portmap)
MDRV_MACHINE_RESET(system32)
- MDRV_NVRAM_HANDLER(system32)
+
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
MDRV_TIMER_ADD("v60_irq0", signal_v60_irq_callback)
MDRV_TIMER_ADD("v60_irq1", signal_v60_irq_callback)
@@ -2425,6 +2405,9 @@ ROM_START( alien3 )
ROMX_LOAD( "15867.bin", 0x800002, 0x200000, CRC(8cf9cb11) SHA1(a77399fccee3f258a5716721edd69a33f94f8daf) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "15869.bin", 0x800004, 0x200000, CRC(dd4b137f) SHA1(7316dce32d35bf468defae5e6ed86910a37a2457) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "15871.bin", 0x800006, 0x200000, CRC(58eb10ae) SHA1(23f2a72dc7b2d7b5c8a979952f81608296805745) , ROM_SKIP(6)|ROM_GROUPWORD )
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD16_WORD( "eeprom-alien3.bin", 0x0000, 0x0080, CRC(6e1d9df3) SHA1(2fd818bc393fb96e945fa37a63c8a3c4aff2f79f) )
ROM_END
ROM_START( alien3u )
@@ -2453,6 +2436,9 @@ ROM_START( alien3u )
ROMX_LOAD( "15867.bin", 0x800002, 0x200000, CRC(8cf9cb11) SHA1(a77399fccee3f258a5716721edd69a33f94f8daf) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "15869.bin", 0x800004, 0x200000, CRC(dd4b137f) SHA1(7316dce32d35bf468defae5e6ed86910a37a2457) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "15871.bin", 0x800006, 0x200000, CRC(58eb10ae) SHA1(23f2a72dc7b2d7b5c8a979952f81608296805745) , ROM_SKIP(6)|ROM_GROUPWORD )
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD16_WORD( "eeprom-alien3.bin", 0x0000, 0x0080, CRC(6e1d9df3) SHA1(2fd818bc393fb96e945fa37a63c8a3c4aff2f79f) )
ROM_END
@@ -3191,6 +3177,9 @@ ROM_START( radm )
ROM_REGION( 0x8000, "user2", 0 ) /* unused (cabinet motor?) */
ROM_LOAD( "epr-13686.bin", 0x00000, 0x8000, CRC(317a2857) SHA1(e0788dc7a7d214d9c4d26b24e44c1a0dc9ae477c) ) /* cabinet movement */
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD16_WORD( "eeprom-radm.bin", 0x0000, 0x0080, CRC(b1737c06) SHA1(29448a6effeb53322a93158feb9a62bc6ad31f21) )
ROM_END
/**************************************************************************************************************************
@@ -3232,6 +3221,9 @@ ROM_START( radmu )
ROM_REGION( 0x8000, "user2", 0 ) /* unused (cabinet motor?) */
ROM_LOAD( "epr-13686.bin", 0x00000, 0x8000, CRC(317a2857) SHA1(e0788dc7a7d214d9c4d26b24e44c1a0dc9ae477c) ) /* cabinet movement */
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD16_WORD( "eeprom-radm.bin", 0x0000, 0x0080, CRC(b1737c06) SHA1(29448a6effeb53322a93158feb9a62bc6ad31f21) )
ROM_END
@@ -3271,6 +3263,9 @@ ROM_START( radr )
ROM_REGION( 0x8000, "user2", 0 ) /* unused */
ROM_LOAD( "epr14084.17", 0x00000, 0x8000, CRC(f14ed074) SHA1(e1bb23eac85e3236046527c5c7688f6f23d43aef) ) /* cabinet link */
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD16_WORD( "eeprom-radr.bin", 0x0000, 0x0080, CRC(602032c6) SHA1(fecf14017e537fe870457d2a8d4f86ec6d442b90) )
ROM_END
/**************************************************************************************************************************
@@ -3307,6 +3302,9 @@ ROM_START( radru )
ROM_REGION( 0x8000, "user2", 0 ) /* unused */
ROM_LOAD( "epr14084.17", 0x00000, 0x8000, CRC(f14ed074) SHA1(e1bb23eac85e3236046527c5c7688f6f23d43aef) ) /* cabinet link */
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD16_WORD( "eeprom-radr.bin", 0x0000, 0x0080, CRC(602032c6) SHA1(fecf14017e537fe870457d2a8d4f86ec6d442b90) )
ROM_END
@@ -3767,12 +3765,11 @@ ROM_END
*
*************************************/
-static void segas32_common_init(read16_space_func custom_r, write16_space_func custom_w, const UINT8 *default_eeprom)
+static void segas32_common_init(read16_space_func custom_r, write16_space_func custom_w)
{
/* reset the custom handlers and other pointers */
custom_io_r[0] = custom_r;
custom_io_w[0] = custom_w;
- system32_default_eeprom = default_eeprom;
system32_prot_vblank = NULL;
}
@@ -3786,20 +3783,7 @@ static void segas32_common_init(read16_space_func custom_r, write16_space_func c
static DRIVER_INIT( alien3 )
{
- /* alien 3 with the gun calibrated, it doesn't prompt you if its not */
- static const UINT8 alien3_default_eeprom[128] =
- {
- 0x33, 0x53, 0x41, 0x32, 0x00, 0x35, 0x00, 0x00, 0x8B, 0xE8, 0x00, 0x02, 0x00, 0x00, 0x01, 0x00,
- 0x01, 0x01, 0x03, 0x00, 0x01, 0x08, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x8B, 0xE8, 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x03, 0x00,
- 0x01, 0x08, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- segas32_common_init(analog_custom_io_r, analog_custom_io_w, alien3_default_eeprom);
+ segas32_common_init(analog_custom_io_r, analog_custom_io_w);
}
static READ16_HANDLER( arescue_handshake_r )
@@ -3814,7 +3798,7 @@ static READ16_HANDLER( arescue_slavebusy_r )
static DRIVER_INIT( arescue )
{
- segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL);
+ segas32_common_init(analog_custom_io_r, analog_custom_io_w);
memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa00000, 0xa00007, 0, 0, arescue_dsp_r, arescue_dsp_w);
dual_pcb_comms = auto_alloc_array(machine, UINT16, 0x1000/2);
@@ -3828,7 +3812,7 @@ static DRIVER_INIT( arescue )
static DRIVER_INIT( arabfgt )
{
- segas32_common_init(extra_custom_io_r, NULL, NULL);
+ segas32_common_init(extra_custom_io_r, NULL);
/* install protection handlers */
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa00100, 0xa0011f, 0, 0, arf_wakeup_protection_r);
@@ -3838,7 +3822,7 @@ static DRIVER_INIT( arabfgt )
static DRIVER_INIT( brival )
{
- segas32_common_init(extra_custom_io_r, NULL, NULL);
+ segas32_common_init(extra_custom_io_r, NULL);
/* install protection handlers */
system32_protram = auto_alloc_array(machine, UINT16, 0x1000/2);
@@ -3849,7 +3833,7 @@ static DRIVER_INIT( brival )
static DRIVER_INIT( darkedge )
{
- segas32_common_init(extra_custom_io_r, NULL, NULL);
+ segas32_common_init(extra_custom_io_r, NULL);
/* install protection handlers */
memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa00000, 0xa7ffff, 0, 0, darkedge_protection_r, darkedge_protection_w);
@@ -3858,7 +3842,7 @@ static DRIVER_INIT( darkedge )
static DRIVER_INIT( dbzvrvs )
{
- segas32_common_init(NULL, NULL, NULL);
+ segas32_common_init(NULL, NULL);
/* install protection handlers */
memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa00000, 0xa7ffff, 0, 0, dbzvrvs_protection_r, dbzvrvs_protection_w);
@@ -3873,7 +3857,7 @@ static WRITE16_HANDLER( f1en_comms_echo_w )
static DRIVER_INIT( f1en )
{
- segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL);
+ segas32_common_init(analog_custom_io_r, analog_custom_io_w);
dual_pcb_comms = auto_alloc_array(machine, UINT16, 0x1000/2);
memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x810000, 0x810fff, 0, 0, dual_pcb_comms_r, dual_pcb_comms_w);
@@ -3885,13 +3869,13 @@ static DRIVER_INIT( f1en )
static DRIVER_INIT( f1lap )
{
- segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL);
+ segas32_common_init(analog_custom_io_r, analog_custom_io_w);
}
static DRIVER_INIT( ga2 )
{
- segas32_common_init(extra_custom_io_r, NULL, NULL);
+ segas32_common_init(extra_custom_io_r, NULL);
decrypt_ga2_protrom(machine);
memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa00000, 0xa00fff, 0, 0, ga2_dpram_r, ga2_dpram_w);
@@ -3900,13 +3884,13 @@ static DRIVER_INIT( ga2 )
static DRIVER_INIT( harddunk )
{
- segas32_common_init(extra_custom_io_r, NULL, NULL);
+ segas32_common_init(extra_custom_io_r, NULL);
}
static DRIVER_INIT( holo )
{
- segas32_common_init(NULL, NULL, NULL);
+ segas32_common_init(NULL, NULL);
}
@@ -3915,7 +3899,7 @@ static DRIVER_INIT( jpark )
/* Temp. Patch until we emulate the 'Drive Board', thanks to Malice */
UINT16 *pROM = (UINT16 *)memory_region(machine, "maincpu");
- segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL);
+ segas32_common_init(analog_custom_io_r, analog_custom_io_w);
pROM[0xC15A8/2] = 0xCD70;
pROM[0xC15AA/2] = 0xD8CD;
@@ -3924,65 +3908,39 @@ static DRIVER_INIT( jpark )
static DRIVER_INIT( orunners )
{
- segas32_common_init(analog_custom_io_r, orunners_custom_io_w, NULL);
+ segas32_common_init(analog_custom_io_r, orunners_custom_io_w);
}
static DRIVER_INIT( radm )
{
- /* put radmobile in 'upright' mode since we don't emulate the motor */
- static const UINT8 radm_default_eeprom[128] =
- {
- 0x45, 0x53, 0x41, 0x47, 0x83, 0x01, 0x00, 0x01, 0x03, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0xFF, 0x01, 0x01, 0x01, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x60, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
- 0x45, 0x53, 0x41, 0x47, 0x83, 0x01, 0x00, 0x01, 0x03, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0xFF, 0x01, 0x01, 0x01, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x60, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00
- };
-
- segas32_common_init(analog_custom_io_r, analog_custom_io_w, radm_default_eeprom);
+ segas32_common_init(analog_custom_io_r, analog_custom_io_w);
}
static DRIVER_INIT( radr )
{
- /* set rad rally to 1 coin 1 credit otherwise it'll boot into freeplay by default which isn't ideal ;-) */
- static const UINT8 radr_default_eeprom[128] =
- {
- 0x45, 0x53, 0x41, 0x47, 0x00, 0x03, 0x00, 0x01, 0x04, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0xFF, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x75, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
- 0x45, 0x53, 0x41, 0x47, 0x00, 0x03, 0x00, 0x01, 0x04, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0xFF, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x75, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00
- };
-
- segas32_common_init(analog_custom_io_r, analog_custom_io_w, radr_default_eeprom);
+ segas32_common_init(analog_custom_io_r, analog_custom_io_w);
}
static DRIVER_INIT( scross )
{
const device_config *multipcm = devtag_get_device(machine, "sega");
- segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL);
+ segas32_common_init(analog_custom_io_r, analog_custom_io_w);
memory_install_write8_device_handler(cputag_get_address_space(machine, "soundcpu", ADDRESS_SPACE_PROGRAM), multipcm, 0xb0, 0xbf, 0, 0, scross_bank_w);
}
static DRIVER_INIT( slipstrm )
{
- segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL);
+ segas32_common_init(analog_custom_io_r, analog_custom_io_w);
}
static DRIVER_INIT( sonic )
{
- segas32_common_init(sonic_custom_io_r, sonic_custom_io_w, NULL);
+ segas32_common_init(sonic_custom_io_r, sonic_custom_io_w);
/* install protection handlers */
memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x20E5C4, 0x20E5C5, 0, 0, sonic_level_load_protection);
@@ -3991,32 +3949,32 @@ static DRIVER_INIT( sonic )
static DRIVER_INIT( sonicp )
{
- segas32_common_init(sonic_custom_io_r, sonic_custom_io_w, NULL);
+ segas32_common_init(sonic_custom_io_r, sonic_custom_io_w);
}
static DRIVER_INIT( spidman )
{
- segas32_common_init(extra_custom_io_r, NULL, NULL);
+ segas32_common_init(extra_custom_io_r, NULL);
}
static DRIVER_INIT( svf )
{
- segas32_common_init(NULL, NULL, NULL);
+ segas32_common_init(NULL, NULL);
}
static DRIVER_INIT( jleague )
{
- segas32_common_init(NULL, NULL, NULL);
+ segas32_common_init(NULL, NULL);
memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x20F700, 0x20F705, 0, 0, jleague_protection_w);
}
static DRIVER_INIT( titlef )
{
- segas32_common_init(NULL, NULL, NULL);
+ segas32_common_init(NULL, NULL);
}
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index 918d3aea8f5..41fba2c689f 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -737,7 +737,7 @@ Notes:
#include "cpu/z80/z80.h"
#include "cpu/i386/i386.h"
#include "machine/ds2404.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "machine/intelfsh.h"
#include "sound/okim6295.h"
#include "sound/ymf271.h"
@@ -888,16 +888,16 @@ static READ32_HANDLER( spi_unknown_r )
return 0xffffffff;
}
-static WRITE32_HANDLER( eeprom_w )
+static WRITE32_DEVICE_HANDLER( eeprom_w )
{
- const device_config *oki2 = devtag_get_device(space->machine, "oki2");
+ const device_config *oki2 = devtag_get_device(device->machine, "oki2");
// tile banks
if( ACCESSING_BITS_16_23 ) {
rf2_set_layer_banks(data >> 16);
- eeprom_write_bit((data & 0x800000) ? 1 : 0);
- eeprom_set_clock_line((data & 0x400000) ? ASSERT_LINE : CLEAR_LINE);
- eeprom_set_cs_line((data & 0x200000) ? CLEAR_LINE : ASSERT_LINE);
+ eepromdev_write_bit(device, (data & 0x800000) ? 1 : 0);
+ eepromdev_set_clock_line(device, (data & 0x400000) ? ASSERT_LINE : CLEAR_LINE);
+ eepromdev_set_cs_line(device, (data & 0x200000) ? CLEAR_LINE : ASSERT_LINE);
}
// oki banking
@@ -1121,11 +1121,11 @@ static void irqhandler(const device_config *device, int state)
cputag_set_input_line(device->machine, "soundcpu", 0, CLEAR_LINE);
}
-static WRITE32_HANDLER(sys386f2_eeprom_w)
+static WRITE32_DEVICE_HANDLER(sys386f2_eeprom_w)
{
- eeprom_write_bit((data & 0x80) ? 1 : 0);
- eeprom_set_clock_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
- eeprom_set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
+ eepromdev_write_bit(device, (data & 0x80) ? 1 : 0);
+ eepromdev_set_clock_line(device, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
+ eepromdev_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
}
static const ymf271_interface ymf271_config =
@@ -1152,7 +1152,7 @@ static ADDRESS_MAP_START( seibu386_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x00000604, 0x00000607) AM_READ(spi_controls1_r) /* Player controls */
AM_RANGE(0x00000608, 0x0000060b) AM_READ(spi_unknown_r)
AM_RANGE(0x0000060c, 0x0000060f) AM_READ(spi_controls2_r) /* Player controls (start) */
- AM_RANGE(0x0000068c, 0x0000068f) AM_WRITE(eeprom_w)
+ AM_RANGE(0x0000068c, 0x0000068f) AM_DEVWRITE("eeprom", eeprom_w)
AM_RANGE(0x00000800, 0x0003ffff) AM_RAM AM_BASE(&spimainram)
AM_RANGE(0x00200000, 0x003fffff) AM_ROM AM_SHARE("share2")
AM_RANGE(0x01200000, 0x01200003) AM_DEVREADWRITE8("oki1", okim6295_r, okim6295_w, 0x000000ff)
@@ -1170,7 +1170,7 @@ static ADDRESS_MAP_START( sys386f2_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x00000010, 0x00000013) AM_READ(spi_int_r) /* Unknown */
AM_RANGE(0x00000090, 0x00000097) AM_RAM /* Unknown */
AM_RANGE(0x00000400, 0x00000403) AM_READNOP AM_WRITE(input_select_w)
- AM_RANGE(0x00000404, 0x00000407) AM_WRITE(sys386f2_eeprom_w)
+ AM_RANGE(0x00000404, 0x00000407) AM_DEVWRITE("eeprom", sys386f2_eeprom_w)
AM_RANGE(0x00000408, 0x0000040f) AM_DEVWRITE8("ymz", ymz280b_w, 0x000000ff)
AM_RANGE(0x00000484, 0x00000487) AM_WRITE(palette_dma_start_w)
AM_RANGE(0x00000490, 0x00000493) AM_WRITE(video_dma_length_w)
@@ -1213,7 +1213,7 @@ static INPUT_PORTS_START( spi_2button )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_START2 )
PORT_SERVICE_NO_TOGGLE( 0x00000004, IP_ACTIVE_LOW) /* Test Button */
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
- PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_BIT( 0x000000b0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1265,7 +1265,7 @@ static INPUT_PORTS_START( seibu386_2button )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1414,7 +1414,7 @@ static INPUT_PORTS_START( spi_ejsakura )
PORT_START("SYSTEM")
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x00004000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x00004000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_BIT( 0xffffbf3f, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -1811,18 +1811,6 @@ static const eeprom_interface eeprom_intf =
1 /* reset_delay */
};
-static NVRAM_HANDLER( sxx2f )
-{
- if( read_or_write ) {
- eeprom_save(file);
- } else {
- eeprom_init(machine, &eeprom_intf);
-
- if(file)
- eeprom_load(file);
- }
-}
-
static INTERRUPT_GEN( spi_interrupt )
{
cpu_set_input_line(device, 0, ASSERT_LINE );
@@ -1930,7 +1918,7 @@ static MACHINE_RESET( sxx2f )
memcpy(z80_rom, rom, 0x40000);
- memory_install_write32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000068c, 0x0000068f, 0, 0, eeprom_w);
+ memory_install_write32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), devtag_get_device(machine, "eeprom"), 0x0000068c, 0x0000068f, 0, 0, eeprom_w);
memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00000680, 0x00000683, 0, 0, sb_coin_r);
cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), spi_irq_callback);
@@ -1944,7 +1932,9 @@ static MACHINE_DRIVER_START( sxx2f ) /* Intel i386DX @ 25MHz, YMF271 @ 16.9344MH
MDRV_MACHINE_START(sxx2f)
MDRV_MACHINE_RESET(sxx2f)
- MDRV_NVRAM_HANDLER(sxx2f)
+
+ MDRV_NVRAM_HANDLER(0)
+ MDRV_EEPROM_NODEFAULT_ADD("eeprom", eeprom_intf)
MACHINE_DRIVER_END
@@ -1964,7 +1954,9 @@ static MACHINE_DRIVER_START( sxx2g ) /* single board version using measured cloc
MDRV_MACHINE_START(sxx2f)
MDRV_MACHINE_RESET(sxx2f)
- MDRV_NVRAM_HANDLER(sxx2f)
+
+ MDRV_NVRAM_HANDLER(0)
+ MDRV_EEPROM_NODEFAULT_ADD("eeprom", eeprom_intf)
MACHINE_DRIVER_END
@@ -2211,9 +2203,10 @@ static MACHINE_DRIVER_START( seibu386 )
MDRV_CPU_PROGRAM_MAP(seibu386_map)
MDRV_CPU_VBLANK_INT("screen", spi_interrupt)
- MDRV_NVRAM_HANDLER(sxx2f)
MDRV_MACHINE_RESET(seibu386)
+ MDRV_EEPROM_NODEFAULT_ADD("eeprom", eeprom_intf)
+
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
MDRV_SCREEN_REFRESH_RATE(54)
@@ -2268,9 +2261,10 @@ static MACHINE_DRIVER_START( sys386f2 )
/* no z80? */
- MDRV_NVRAM_HANDLER(sxx2f)
MDRV_MACHINE_RESET(seibu386)
+ MDRV_EEPROM_NODEFAULT_ADD("eeprom", eeprom_intf)
+
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
MDRV_SCREEN_REFRESH_RATE(54)
diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c
index 97a33fa4047..a8f380fafb2 100644
--- a/src/mame/drivers/simpl156.c
+++ b/src/mame/drivers/simpl156.c
@@ -92,12 +92,11 @@ Are the OKI M6295 clocks from Heavy Smash are correct at least for the Mitchell
#include "includes/decocrpt.h"
#include "includes/deco32.h"
#include "cpu/arm/arm.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "sound/okim6295.h"
#include "includes/deco16ic.h"
static UINT32 *simpl156_systemram;
-static const UINT8 *simpl156_default_eeprom;
extern VIDEO_START( simpl156 );
extern VIDEO_UPDATE( simpl156 );
@@ -135,7 +134,7 @@ INPUT_PORTS_END
static READ32_HANDLER( simpl156_inputs_read )
{
- int eep = eeprom_read_bit();
+ int eep = eepromdev_read_bit(devtag_get_device(space->machine, "eeprom"));
UINT32 returndata;
returndata = input_port_read(space->machine, "IN0") ^ 0xffff0000;
@@ -176,15 +175,16 @@ static READ32_HANDLER( simpl156_system_r )
static WRITE32_HANDLER( simpl156_eeprom_w )
{
+ const device_config *device = devtag_get_device(space->machine, "eeprom");
//int okibank;
//okibank = data & 0x07;
okim6295_set_bank_base(devtag_get_device(space->machine, "okimusic"), 0x40000 * (data & 0x7) );
- eeprom_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
- eeprom_write_bit(data & 0x10);
- eeprom_set_cs_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
+ eepromdev_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
+ eepromdev_write_bit(device, data & 0x10);
+ eepromdev_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -433,23 +433,6 @@ static GFXDECODE_START( simpl156 )
GFXDECODE_END
-static NVRAM_HANDLER( simpl156 )
-{
- if (read_or_write)
- eeprom_save(file);
- else
- {
- eeprom_init(machine, &eeprom_interface_93C46);// 93c45
-
- if (file) eeprom_load(file);
- else
- {
- if (simpl156_default_eeprom) /* Set the EEPROM to Factory Defaults */
- eeprom_set_data(simpl156_default_eeprom,0x100);
- }
- }
-}
-
static INTERRUPT_GEN( simpl156_vbl_interrupt )
{
cpu_set_input_line(device, ARM_IRQ_LINE, HOLD_LINE);
@@ -463,7 +446,7 @@ static MACHINE_DRIVER_START( chainrec )
MDRV_CPU_PROGRAM_MAP(chainrec_map)
MDRV_CPU_VBLANK_INT("screen", simpl156_vbl_interrupt)
- MDRV_NVRAM_HANDLER(simpl156) // 93C45
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom") // 93C45
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
@@ -555,8 +538,6 @@ static DRIVER_INIT(simpl156)
deco56_decrypt_gfx(machine, "gfx1");
deco156_decrypt(machine);
-
- simpl156_default_eeprom = NULL;
}
/*
@@ -690,6 +671,9 @@ ROM_START( chainrec )
ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
ROM_LOAD( "mcc-03", 0x00000, 0x100000, CRC(da2ebba0) SHA1(96d31dea4c7226ee1d386b286919fa334388c7a1) )
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 ) /* eeprom */
+ ROM_LOAD16_WORD( "eeprom-chainrec.bin", 0x00, 0x80, CRC(b6da3fbf) SHA1(bdc2bdeabf8686c1454737faf785b0d7501f9bde) )
ROM_END
/*
@@ -733,8 +717,8 @@ ROM_START( magdrop )
ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
ROM_LOAD( "mcc-03", 0x00000, 0x100000, CRC(da2ebba0) SHA1(96d31dea4c7226ee1d386b286919fa334388c7a1) )
- ROM_REGION( 0x80, "user1", 0 ) /* eeprom */
- ROM_LOAD( "93c45.2h", 0x00, 0x80, CRC(16ce8d2d) SHA1(1a6883c75d34febbd92a16cfe204ff12550c85fd) )
+ ROM_REGION16_BE( 0x80, "eeprom", 0 ) /* eeprom */
+ ROM_LOAD16_WORD_SWAP( "93c45.2h", 0x00, 0x80, CRC(16ce8d2d) SHA1(1a6883c75d34febbd92a16cfe204ff12550c85fd) )
ROM_END
ROM_START( magdropp )
@@ -754,8 +738,8 @@ ROM_START( magdropp )
ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
ROM_LOAD( "mcc-03", 0x00000, 0x100000, CRC(da2ebba0) SHA1(96d31dea4c7226ee1d386b286919fa334388c7a1) )
- ROM_REGION( 0x80, "user1", 0 ) /* eeprom */
- ROM_LOAD( "eeprom.2h", 0x00, 0x80, CRC(d13d9edd) SHA1(e98ee2b696f0a7a8752dc30ef8b41bfe6598cbe4) )
+ ROM_REGION16_BE( 0x80, "eeprom", 0 ) /* eeprom */
+ ROM_LOAD16_WORD_SWAP( "eeprom.2h", 0x00, 0x80, CRC(d13d9edd) SHA1(e98ee2b696f0a7a8752dc30ef8b41bfe6598cbe4) )
ROM_END
/*
@@ -902,6 +886,9 @@ ROM_START( prtytime )
ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
ROM_LOAD( "mcb-04.12f", 0x00000, 0x200000, CRC(e23d3590) SHA1(dc8418edc525f56e84f26e9334d5576000b14e5f) )
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 ) /* eeprom */
+ ROM_LOAD16_WORD( "eeprom-prtytime.bin", 0x00, 0x80, CRC(105700da) SHA1(650d11236c5692c1454d7b823d5be4d3278d6576) )
ROM_END
ROM_START( gangonta )
@@ -925,6 +912,9 @@ ROM_START( gangonta )
ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
ROM_LOAD( "mcb-04.12f", 0x00000, 0x200000, CRC(e23d3590) SHA1(dc8418edc525f56e84f26e9334d5576000b14e5f) )
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 ) /* eeprom */
+ ROM_LOAD16_WORD( "eeprom-gangonta.bin", 0x00, 0x80, CRC(27ba60a5) SHA1(1f65be84cfecda5545e7083bcea9db1681425279) )
ROM_END
/*
@@ -987,6 +977,9 @@ ROM_START( osman )
ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
ROM_LOAD( "mcf-05.12f", 0x00000, 0x200000, CRC(f007d376) SHA1(4ba20e5dabeacc3278b7f30c4462864cbe8f6984) )
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 ) /* eeprom */
+ ROM_LOAD16_WORD( "eeprom-osman.bin", 0x00, 0x80, CRC(509552b2) SHA1(b506692180ccd67f6ad48503a36ebfc4819817b1) )
ROM_END
/* NOTE: Cannon Dancer uses IDENTICAL roms to Osman. Region is contained in the eeprom settings which we set in the INIT function */
@@ -1012,21 +1005,11 @@ ROM_START( candance )
ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
ROM_LOAD( "mcf-05.12f", 0x00000, 0x200000, CRC(f007d376) SHA1(4ba20e5dabeacc3278b7f30c4462864cbe8f6984) )
-ROM_END
-
-/* some default eeproms */
+ ROM_REGION16_BE( 0x80, "eeprom", 0 ) /* eeprom */
+ ROM_LOAD16_WORD( "eeprom-candance.bin", 0x00, 0x80, CRC(0a0a8f6b) SHA1(4e07138ba7d615291c67162958c889540615e06f) )
+ROM_END
-static const UINT8 chainrec_eeprom[128] = {
- 0x52, 0x54, 0x00, 0x50, 0x00, 0x00, 0x39, 0x11, 0x41, 0x54, 0x00, 0x43, 0x00, 0x50, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
/*
Cannon Dancer / Osman are odd, they don't init their own Eeprom...
@@ -1086,47 +1069,6 @@ static const UINT8 chainrec_eeprom[128] = {
*/
-static const UINT8 osman_eeprom[128] = {
- 0xFF, 0xBE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x00, 0x88, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-static const UINT8 candance_eeprom[128] = {
- 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x00, 0x88, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-static const UINT8 prtytime_eeprom[128] = {
- 0xAF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xDE, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xED, 0xED, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0x7F, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF
-};
-
-static const UINT8 gangonta_eeprom[128] = {
- 0x2F, 0xFF, 0x2F, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xED, 0xCB, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
/* Everything seems more stable if we run the CPU speed x4 and use Idle skips.. maybe it has an internal multipler? */
static READ32_HANDLER( joemacr_speedup_r )
@@ -1152,7 +1094,6 @@ static DRIVER_INIT (chainrec)
{
memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0201018, 0x020101b, 0, 0, chainrec_speedup_r );
DRIVER_INIT_CALL(simpl156);
- simpl156_default_eeprom = chainrec_eeprom;
}
static READ32_HANDLER( prtytime_speedup_r )
@@ -1165,14 +1106,6 @@ static DRIVER_INIT (prtytime)
{
memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r );
DRIVER_INIT_CALL(simpl156);
- simpl156_default_eeprom = prtytime_eeprom;
-}
-
-static DRIVER_INIT (gangonta)
-{
- memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r );
- DRIVER_INIT_CALL(simpl156);
- simpl156_default_eeprom = gangonta_eeprom;
}
@@ -1198,15 +1131,7 @@ static DRIVER_INIT (osman)
{
memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0201010, 0x0201013, 0, 0, osman_speedup_r );
DRIVER_INIT_CALL(simpl156);
- simpl156_default_eeprom = osman_eeprom;
-
-}
-static DRIVER_INIT (candance)
-{
- memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0201010, 0x0201013, 0, 0, osman_speedup_r );
- DRIVER_INIT_CALL(simpl156);
- simpl156_default_eeprom = candance_eeprom;
}
/* Data East games running on the DE-0409-1 or DE-0491-1 PCB */
@@ -1219,6 +1144,6 @@ GAME( 1995, magdropp, chainrec, magdropp, simpl156, chainrec, ROT0, "Data Eas
/* Mitchell games running on the DEC-22VO / MT5601-0 PCB */
GAME( 1995, charlien, 0, mitchell156, simpl156, charlien, ROT0, "Mitchell", "Charlie Ninja" , 0) /* language in service mode */
GAME( 1995, prtytime, 0, mitchell156, simpl156, prtytime, ROT90, "Mitchell", "Party Time: Gonta the Diver II / Ganbare! Gonta!! 2 (World Release)", 0) /* language in service mode */
-GAME( 1995, gangonta, prtytime, mitchell156, simpl156, gangonta, ROT90, "Mitchell", "Ganbare! Gonta!! 2 / Party Time: Gonta the Diver II (Japan Release)", 0) /* language in service mode */
+GAME( 1995, gangonta, prtytime, mitchell156, simpl156, prtytime, ROT90, "Mitchell", "Ganbare! Gonta!! 2 / Party Time: Gonta the Diver II (Japan Release)", 0) /* language in service mode */
GAME( 1996, osman, 0, mitchell156, simpl156, osman, ROT0, "Mitchell", "Osman (World)", 0 )
-GAME( 1996, candance, osman, mitchell156, simpl156, candance, ROT0, "Mitchell (Atlus License)", "Cannon Dancer (Japan)", 0 )
+GAME( 1996, candance, osman, mitchell156, simpl156, osman, ROT0, "Mitchell (Atlus License)", "Cannon Dancer (Japan)", 0 )
diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c
index 71216f3bfbc..8898b7262ce 100644
--- a/src/mame/drivers/ssv.c
+++ b/src/mame/drivers/ssv.c
@@ -183,7 +183,7 @@ Notes:
#include "cpu/v810/v810.h"
#include "cpu/v60/v60.h"
#include "deprecat.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "sound/es5506.h"
#include "includes/seta.h"
@@ -364,22 +364,6 @@ static NVRAM_HANDLER( ssv )
mame_fread(file, ssv_nvram, ssv_nvram_size);
}
-static NVRAM_HANDLER( gdfs )
-{
- if (read_or_write)
- eeprom_save(file);
- else
- {
- eeprom_init(machine, &eeprom_interface_93C46);
-
- if (file) eeprom_load(file);
- else
- {
- /* Set the EEPROM to Factory Defaults */
- }
- }
-}
-
/***************************************************************************
@@ -477,19 +461,19 @@ ADDRESS_MAP_END
static int gdfs_gfxram_bank, gdfs_lightgun_select;
static UINT16 *gdfs_blitram;
-static READ16_HANDLER( gdfs_eeprom_r )
+static READ16_DEVICE_HANDLER( gdfs_eeprom_r )
{
static const char *const gunnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" };
- return (((gdfs_lightgun_select & 1) ? 0 : 0xff) ^ input_port_read(space->machine, gunnames[gdfs_lightgun_select])) | (eeprom_read_bit() << 8);
+ return (((gdfs_lightgun_select & 1) ? 0 : 0xff) ^ input_port_read(device->machine, gunnames[gdfs_lightgun_select])) | (eepromdev_read_bit(device) << 8);
}
-static WRITE16_HANDLER( gdfs_eeprom_w )
+static WRITE16_DEVICE_HANDLER( gdfs_eeprom_w )
{
static UINT16 data_old;
if (data & ~0x7b00)
- logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",cpu_get_pc(space->cpu),data);
+ logerror("%s - Unknown EEPROM bit written %04X\n",cpuexec_describe_context(device->machine),data);
if ( ACCESSING_BITS_8_15 )
{
@@ -497,13 +481,13 @@ static WRITE16_HANDLER( gdfs_eeprom_w )
// data & 0x0001 ?
// latch the bit
- eeprom_write_bit(data & 0x4000);
+ eepromdev_write_bit(device, data & 0x4000);
// reset line asserted: reset.
- eeprom_set_cs_line((data & 0x1000) ? CLEAR_LINE : ASSERT_LINE );
+ eepromdev_set_cs_line(device, (data & 0x1000) ? CLEAR_LINE : ASSERT_LINE );
// clock line asserted: write latch or select next bit to read
- eeprom_set_clock_line((data & 0x2000) ? ASSERT_LINE : CLEAR_LINE );
+ eepromdev_set_clock_line(device, (data & 0x2000) ? ASSERT_LINE : CLEAR_LINE );
if (!(data_old & 0x0800) && (data & 0x0800)) // rising clock
gdfs_lightgun_select = (data & 0x0300) >> 8;
@@ -600,8 +584,8 @@ static ADDRESS_MAP_START( gdfs_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x400000, 0x41ffff) AM_RAM_WRITE(gdfs_tmapram_w) AM_BASE(&gdfs_tmapram)
AM_RANGE(0x420000, 0x43ffff) AM_RAM
AM_RANGE(0x440000, 0x44003f) AM_RAM AM_BASE(&gdfs_tmapscroll)
- AM_RANGE(0x500000, 0x500001) AM_WRITE(gdfs_eeprom_w)
- AM_RANGE(0x540000, 0x540001) AM_READ(gdfs_eeprom_r)
+ AM_RANGE(0x500000, 0x500001) AM_DEVWRITE("eeprom", gdfs_eeprom_w)
+ AM_RANGE(0x540000, 0x540001) AM_DEVREAD("eeprom", gdfs_eeprom_r)
AM_RANGE(0x600000, 0x600fff) AM_RAM
AM_RANGE(0x800000, 0x87ffff) AM_RAM AM_BASE_GENERIC(spriteram2)
AM_RANGE(0x8c0000, 0x8c00ff) AM_READWRITE(gdfs_blitram_r, gdfs_blitram_w) AM_BASE(&gdfs_blitram)
@@ -2761,7 +2745,7 @@ static MACHINE_DRIVER_START( gdfs )
MDRV_CPU_PROGRAM_MAP(gdfs_map)
MDRV_CPU_VBLANK_INT_HACK(gdfs_interrupt,1+4)
- MDRV_NVRAM_HANDLER(gdfs)
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
/* video hardware */
MDRV_SCREEN_MODIFY("screen")
diff --git a/src/mame/drivers/stlforce.c b/src/mame/drivers/stlforce.c
index 3154c5e7fae..5455c34dfb9 100644
--- a/src/mame/drivers/stlforce.c
+++ b/src/mame/drivers/stlforce.c
@@ -69,13 +69,12 @@ TO DO :
#include "driver.h"
#include "cpu/m68000/m68000.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "sound/okim6295.h"
UINT16 *stlforce_bg_videoram, *stlforce_mlow_videoram, *stlforce_mhigh_videoram, *stlforce_tx_videoram;
UINT16 *stlforce_bg_scrollram, *stlforce_mlow_scrollram, *stlforce_mhigh_scrollram, *stlforce_vidattrram;
UINT16 *stlforce_spriteram;
-static const UINT8 *default_eeprom;
extern int stlforce_sprxoffs;
VIDEO_START( stlforce );
@@ -85,13 +84,13 @@ WRITE16_HANDLER( stlforce_mhigh_videoram_w );
WRITE16_HANDLER( stlforce_mlow_videoram_w );
WRITE16_HANDLER( stlforce_bg_videoram_w );
-static WRITE16_HANDLER( eeprom_w )
+static WRITE16_DEVICE_HANDLER( eeprom_w )
{
if( ACCESSING_BITS_0_7 )
{
- eeprom_write_bit(data & 0x01);
- eeprom_set_cs_line((data & 0x02) ? CLEAR_LINE : ASSERT_LINE );
- eeprom_set_clock_line((data & 0x04) ? ASSERT_LINE : CLEAR_LINE );
+ eepromdev_write_bit(device, data & 0x01);
+ eepromdev_set_cs_line(device, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE );
+ eepromdev_set_clock_line(device, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE );
}
}
@@ -117,7 +116,7 @@ static ADDRESS_MAP_START( stlforce_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x109000, 0x11ffff) AM_RAM
AM_RANGE(0x400000, 0x400001) AM_READ_PORT("INPUT")
AM_RANGE(0x400002, 0x400003) AM_READ_PORT("SYSTEM")
- AM_RANGE(0x400010, 0x400011) AM_WRITE(eeprom_w)
+ AM_RANGE(0x400010, 0x400011) AM_DEVWRITE("eeprom", eeprom_w)
AM_RANGE(0x400012, 0x400013) AM_DEVWRITE("oki", oki_bank_w)
AM_RANGE(0x40001e, 0x40001f) AM_WRITENOP // sprites buffer commands
AM_RANGE(0x410000, 0x410001) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff)
@@ -149,7 +148,7 @@ static INPUT_PORTS_START( stlforce )
PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL) /* eeprom */
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit) /* eeprom */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -193,46 +192,6 @@ static GFXDECODE_START( stlforce )
GFXDECODE_ENTRY( "gfx2", 0, stlforce_splayout, 0, 256 )
GFXDECODE_END
-static const UINT8 stlforce_default_eeprom[128] = {
- 0x7e, 0x01, 0x00, 0x00, 0x01, 0x03, 0x05, 0x01, 0x01, 0x00, 0x4e, 0x20, 0x00, 0x00, 0x4a, 0x4d,
- 0x42, 0x00, 0x02, 0x01, 0x4e, 0x20, 0x00, 0x00, 0x4d, 0x41, 0x43, 0x00, 0x02, 0x01, 0x00, 0x64,
- 0x00, 0x00, 0x41, 0x41, 0x41, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x41, 0x41, 0x41, 0x00,
- 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x41, 0x41, 0x41, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
-};
-
-static const UINT8 twinbrat_default_eeprom[128] = {
- 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03,
- 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f
-};
-
-
-static NVRAM_HANDLER( stlforce )
-{
- if (read_or_write)
- eeprom_save(file);
- else
- {
- eeprom_init(machine, &eeprom_interface_93C46);
- if (file)
- {
- eeprom_load(file);
- }
- else
- {
- eeprom_set_data(default_eeprom,128);
- }
- }
-}
static MACHINE_DRIVER_START( stlforce )
/* basic machine hardware */
@@ -240,7 +199,7 @@ static MACHINE_DRIVER_START( stlforce )
MDRV_CPU_PROGRAM_MAP(stlforce_map)
MDRV_CPU_VBLANK_INT("screen", irq4_line_hold)
- MDRV_NVRAM_HANDLER(stlforce)
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
@@ -293,6 +252,9 @@ ROM_START( stlforce )
/* only one bank */
ROM_REGION( 0x80000, "oki", 0 ) /* samples */
ROM_LOAD( "stlforce.u1", 0x00000, 0x80000, CRC(0a55edf1) SHA1(091f12e8110c62df22b370a2e710c930ba06e8ca) )
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD( "eeprom-stlforce.bin", 0x0000, 0x0080, CRC(3fb83951) SHA1(0cbf09751e46f100db847cf0594a4440126a7b6e) )
ROM_END
@@ -366,6 +328,9 @@ ROM_START( twinbrat )
ROM_COPY( "user1", 0x040000, 0x0a0000, 0x020000)
ROM_COPY( "user1", 0x000000, 0x0c0000, 0x020000)
ROM_COPY( "user1", 0x060000, 0x0e0000, 0x020000)
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD( "eeprom-twinbrat.bin", 0x0000, 0x0080, CRC(9366263d) SHA1(ff5155498ed0b349ecc1ce98a39566b642201cf2) )
ROM_END
ROM_START( twinbrata )
@@ -399,18 +364,19 @@ ROM_START( twinbrata )
ROM_COPY( "user1", 0x040000, 0x0a0000, 0x020000)
ROM_COPY( "user1", 0x000000, 0x0c0000, 0x020000)
ROM_COPY( "user1", 0x060000, 0x0e0000, 0x020000)
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD( "eeprom-twinbrat.bin", 0x0000, 0x0080, CRC(9366263d) SHA1(ff5155498ed0b349ecc1ce98a39566b642201cf2) )
ROM_END
static DRIVER_INIT(stlforce)
{
stlforce_sprxoffs = 0;
- default_eeprom = stlforce_default_eeprom;
}
static DRIVER_INIT(twinbrat)
{
stlforce_sprxoffs = 9;
- default_eeprom = twinbrat_default_eeprom;
}