diff options
author | 2009-12-24 08:54:09 +0000 | |
---|---|---|
committer | 2009-12-24 08:54:09 +0000 | |
commit | 87d9c3e12cf7ae19fd7b26b5eeab88459baf3663 (patch) | |
tree | 56ab085eff362697814127926f7b348b3e88fbb4 /src/mame/drivers/stlforce.c | |
parent | afac4a56bab0134d08e326a05bad564d4ea7f41a (diff) |
Updated segas32, simpl156, seibuspi, ssv, and stlforce to use eeprom device.
Diffstat (limited to 'src/mame/drivers/stlforce.c')
-rw-r--r-- | src/mame/drivers/stlforce.c | 68 |
1 files changed, 17 insertions, 51 deletions
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; } |