summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2009-11-25 16:33:02 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2009-11-25 16:33:02 +0000
commit0b7a91267ef81f6d65298005b1d9b5064e338b48 (patch)
tree2945274fb1f997afe64a7b4d37b5ad4dd62a17d9 /src/mame
parent409223e919e09dc748667dc6d710a29c082cf854 (diff)
converted the following drivers to use EEPROM device: deco156.c, eolith.c, eolith16.c, limenko.c, taito_f3.c, taito_z.c, taito_b.c, taitojc.c, toaplan2.c and kaneko16.c
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/deco156.c40
-rw-r--r--src/mame/drivers/eolith.c34
-rw-r--r--src/mame/drivers/eolith16.c25
-rw-r--r--src/mame/drivers/kaneko16.c102
-rw-r--r--src/mame/drivers/limenko.c43
-rw-r--r--src/mame/drivers/taito_b.c58
-rw-r--r--src/mame/drivers/taito_f3.c85
-rw-r--r--src/mame/drivers/taito_z.c40
-rw-r--r--src/mame/drivers/taitojc.c44
-rw-r--r--src/mame/drivers/toaplan2.c60
10 files changed, 246 insertions, 285 deletions
diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c
index 087e3eec2c6..fbe9b1f7ad4 100644
--- a/src/mame/drivers/deco156.c
+++ b/src/mame/drivers/deco156.c
@@ -16,7 +16,7 @@
#include "driver.h"
#include "decocrpt.h"
#include "deco32.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "sound/okim6295.h"
#include "sound/ymz280b.h"
#include "cpu/arm/arm.h"
@@ -147,13 +147,10 @@ static VIDEO_UPDATE( wcvol95 )
static WRITE32_HANDLER(hvysmsh_eeprom_w)
{
- if (ACCESSING_BITS_0_7) {
-
+ if (ACCESSING_BITS_0_7)
+ {
okim6295_set_bank_base(devtag_get_device(space->machine, "oki2"), 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);
+ input_port_write(space->machine, "EEPROMOUT", data, 0xff);
}
}
@@ -162,15 +159,6 @@ static WRITE32_DEVICE_HANDLER( hvysmsh_oki_0_bank_w )
okim6295_set_bank_base(device, (data & 1) * 0x40000);
}
-static WRITE32_HANDLER(wcvol95_eeprom_w)
-{
- if (ACCESSING_BITS_0_7) {
- eeprom_set_clock_line((data & 0x2) ? ASSERT_LINE : CLEAR_LINE);
- eeprom_write_bit(data & 0x1);
- eeprom_set_cs_line((data & 0x4) ? CLEAR_LINE : ASSERT_LINE);
- }
-}
-
static WRITE32_HANDLER(wcvol95_nonbuffered_palette_w)
{
COMBINE_DATA(&paletteram32[offset]);
@@ -219,7 +207,7 @@ static ADDRESS_MAP_START( wcvol95_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x124000, 0x124fff) AM_READWRITE( wcvol95_pf2_rowscroll_r, wcvol95_pf2_rowscroll_w )
AM_RANGE(0x130000, 0x137fff) AM_RAM
AM_RANGE(0x140000, 0x140003) AM_READ_PORT("INPUTS")
- AM_RANGE(0x150000, 0x150003) AM_WRITE(wcvol95_eeprom_w)
+ AM_RANGE(0x150000, 0x150003) AM_WRITE_PORT("EEPROMOUT")
AM_RANGE(0x160000, 0x161fff) AM_RAM AM_BASE(&spriteram32) AM_SIZE(&spriteram_size)
AM_RANGE(0x170000, 0x170003) AM_NOP // Irq ack?
AM_RANGE(0x180000, 0x180fff) AM_READ(SMH_RAM) AM_WRITE(wcvol95_nonbuffered_palette_w) AM_BASE(&paletteram32)
@@ -256,7 +244,7 @@ static INPUT_PORTS_START( hvysmsh )
PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -264,6 +252,11 @@ static INPUT_PORTS_START( hvysmsh )
PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x00000010, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+ PORT_BIT( 0x00000020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
INPUT_PORTS_END
static INPUT_PORTS_START( wcvol95 )
@@ -293,7 +286,7 @@ static INPUT_PORTS_START( wcvol95 )
PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -301,6 +294,11 @@ static INPUT_PORTS_START( wcvol95 )
PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+ PORT_BIT( 0x00000002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
INPUT_PORTS_END
@@ -374,7 +372,7 @@ static MACHINE_DRIVER_START( hvysmsh )
MDRV_CPU_PROGRAM_MAP(hvysmsh_map)
MDRV_CPU_VBLANK_INT("screen", deco32_vbl_interrupt)
- MDRV_NVRAM_HANDLER(93C46)
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM )
@@ -413,7 +411,7 @@ static MACHINE_DRIVER_START( wcvol95 )
MDRV_CPU_PROGRAM_MAP(wcvol95_map)
MDRV_CPU_VBLANK_INT("screen", deco32_vbl_interrupt)
- MDRV_NVRAM_HANDLER(93C46)
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM )
diff --git a/src/mame/drivers/eolith.c b/src/mame/drivers/eolith.c
index 06178650833..3385283a4ed 100644
--- a/src/mame/drivers/eolith.c
+++ b/src/mame/drivers/eolith.c
@@ -54,7 +54,7 @@
#include "driver.h"
#include "cpu/e132xs/e132xs.h"
#include "deprecat.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
READ32_HANDLER(eolith_vram_r);
WRITE32_HANDLER(eolith_vram_w);
@@ -81,18 +81,6 @@ static const eeprom_interface eeprom_interface_93C66 =
-static NVRAM_HANDLER( eolith )
-{
- if (read_or_write)
- eeprom_save(file);
- else
- {
- eeprom_init(machine, &eeprom_interface_93C66);
- if (file) eeprom_load(file);
- }
-}
-
-
static READ32_HANDLER( eolith_custom_r )
{
/*
@@ -114,9 +102,7 @@ static WRITE32_HANDLER( systemcontrol_w )
coin_counter_w(0, data & coin_counter_bit);
set_led_status(0, data & 1);
- eeprom_write_bit(data & 0x08);
- eeprom_set_cs_line((data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
- eeprom_set_clock_line((data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
+ input_port_write(space->machine, "EEPROMOUT", data, 0xff);
// bit 0x100 and 0x040 ?
}
@@ -159,7 +145,7 @@ static INPUT_PORTS_START( common )
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL) // eeprom bit
+ PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(eolith_speedup_getvblank, NULL)
@@ -185,6 +171,11 @@ static INPUT_PORTS_START( common )
PORT_START("DSW1")
PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+ PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
INPUT_PORTS_END
static INPUT_PORTS_START( ironfort )
@@ -192,7 +183,7 @@ static INPUT_PORTS_START( ironfort )
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL) // eeprom bit
+ PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(eolith_speedup_getvblank, NULL)
@@ -239,6 +230,11 @@ static INPUT_PORTS_START( ironfort )
PORT_DIPSETTING( 0x000000c0, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x00000080, DEF_STR( Easy ) )
PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+ PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
INPUT_PORTS_END
static INPUT_PORTS_START( hidnctch )
@@ -334,7 +330,7 @@ static MACHINE_DRIVER_START( eolith45 )
/* sound cpu */
- MDRV_NVRAM_HANDLER(eolith)
+ MDRV_EEPROM_NODEFAULT_ADD("eeprom", eeprom_interface_93C66)
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/eolith16.c b/src/mame/drivers/eolith16.c
index fa26c539c90..f83c3f07b5d 100644
--- a/src/mame/drivers/eolith16.c
+++ b/src/mame/drivers/eolith16.c
@@ -12,7 +12,7 @@
#include "driver.h"
#include "cpu/e132xs/e132xs.h"
#include "deprecat.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "sound/okim6295.h"
#include "eolithsp.h"
@@ -36,9 +36,7 @@ static WRITE16_HANDLER( eeprom_w )
vbuffer = (data & 0x80) >> 7;
coin_counter_w(0, data & 1);
- eeprom_write_bit(data & 0x40);
- eeprom_set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
- eeprom_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
+ input_port_write(space->machine, "EEPROMOUT", data, 0xff);
//data & 0x100 and data & 0x004 always set
}
@@ -77,7 +75,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( eolith16 )
PORT_START("SPECIAL")
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL) // eeprom bit
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(eolith_speedup_getvblank, NULL)
PORT_BIT( 0xff6f, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -98,6 +96,11 @@ static INPUT_PORTS_START( eolith16 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+ PORT_BIT( 0x00000020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
INPUT_PORTS_END
static VIDEO_START( eolith16 )
@@ -127,16 +130,6 @@ static VIDEO_UPDATE( eolith16 )
return 0;
}
-static NVRAM_HANDLER( eolith16_eeprom )
-{
- if (read_or_write)
- eeprom_save(file);
- else
- {
- eeprom_init(machine, &eeprom_interface_93C66);
- if (file) eeprom_load(file);
- }
-}
// setup a custom palette because pixels use 8 bits per color
static PALETTE_INIT( eolith16 )
@@ -169,7 +162,7 @@ static MACHINE_DRIVER_START( eolith16 )
MDRV_CPU_PROGRAM_MAP(eolith16_map)
MDRV_CPU_VBLANK_INT_HACK(eolith_speedup,262)
- MDRV_NVRAM_HANDLER(eolith16_eeprom)
+ MDRV_EEPROM_NODEFAULT_ADD("eeprom", eeprom_interface_93C66)
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c
index 96303a6a3e2..6cf8bb07228 100644
--- a/src/mame/drivers/kaneko16.c
+++ b/src/mame/drivers/kaneko16.c
@@ -87,7 +87,7 @@ Dip locations verified from manual for:
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "deprecat.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "includes/kaneko16.h"
#include "sound/2203intf.h"
#include "sound/2151intf.h"
@@ -331,29 +331,11 @@ static WRITE16_DEVICE_HANDLER( kaneko16_YM2149_w )
***************************************************************************/
-static READ8_DEVICE_HANDLER( kaneko16_eeprom_r )
-{
- return eeprom_read_bit() & 1;
-}
-
-static WRITE8_DEVICE_HANDLER( kaneko16_eeprom_reset_w )
-{
- // reset line asserted: reset.
- eeprom_set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE );
-}
-
static WRITE16_HANDLER( kaneko16_eeprom_w )
{
if (ACCESSING_BITS_0_7)
{
- // latch the bit
- eeprom_write_bit(data & 0x02);
-
- // reset line asserted: reset.
-// eeprom_set_cs_line((data & 0x00) ? CLEAR_LINE : ASSERT_LINE );
-
- // clock line asserted: write latch or select next bit to read
- eeprom_set_clock_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE );
+ input_port_write(space->machine, "EEPROMOUT", data, 0xff);
}
if (ACCESSING_BITS_8_15)
@@ -958,6 +940,10 @@ static INPUT_PORTS_START( bakubrkr )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
INPUT_PORTS_END
@@ -1529,6 +1515,10 @@ static INPUT_PORTS_START( mgcrystl )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
INPUT_PORTS_END
@@ -1601,6 +1591,10 @@ static INPUT_PORTS_START( shogwarr )
PORT_DIPNAME( 0x80, 0x80, "Continue Coin" ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
INPUT_PORTS_END
@@ -1674,6 +1668,9 @@ Difficulty Lives Bonus Players Play Level
Very Hard 1 --- NONE --- Level 6
******************************************************/
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
INPUT_PORTS_END
@@ -1762,11 +1759,20 @@ static const ay8910_interface ay8910_intf_dsw =
DEVCB_NULL,
};
+static WRITE8_DEVICE_HANDLER( kaneko16_eeprom_reset_w )
+{
+ // FIXME: the device line cannot be directly put in the interface due to inverse value!
+ // we might want to define a "reversed" set_cs_line handler
+ const device_config *eeprom = devtag_get_device(device->machine, "eeprom");
+ // reset line asserted: reset.
+ eepromdev_set_cs_line(eeprom, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE );
+}
+
static const ay8910_interface ay8910_intf_eeprom =
{
AY8910_LEGACY_OUTPUT,
AY8910_DEFAULT_LOADS,
- DEVCB_HANDLER(kaneko16_eeprom_r), /* inputs A: 0,EEPROM bit read */
+ DEVCB_DEVICE_LINE("eeprom", eepromdev_read_bit), /* inputs A: 0,EEPROM bit read */
DEVCB_NULL, /* inputs B */
DEVCB_NULL, /* outputs A */
DEVCB_HANDLER(kaneko16_eeprom_reset_w) /* outputs B: 0,EEPROM reset */
@@ -1841,7 +1847,7 @@ static MACHINE_DRIVER_START( bakubrkr )
MDRV_CPU_VBLANK_INT_HACK(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM)
MDRV_MACHINE_RESET(bakubrkr)
- MDRV_NVRAM_HANDLER(93C46)
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) // mangled sprites otherwise
@@ -2042,7 +2048,7 @@ static MACHINE_DRIVER_START( mgcrystl )
MDRV_CPU_VBLANK_INT_HACK(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM)
MDRV_MACHINE_RESET(mgcrystl)
- MDRV_NVRAM_HANDLER(93C46)
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
@@ -2144,38 +2150,6 @@ static const UINT8 shogwarr_default_eeprom[128] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF
};
-static const UINT8 brapboys_default_eeprom[128] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x20, 0x30, 0x00, 0x03, 0x68, 0x18, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x4B, 0x41, 0x4E, 0x45, 0x4B, 0x4F, 0x20, 0x20,
- 0x42, 0x65, 0x20, 0x52, 0x61, 0x70, 0x20, 0x42, 0x6F, 0x79, 0x73, 0x00, 0x30, 0x30, 0x30, 0x2E,
- 0x30, 0x38, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 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, 0x35, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-static NVRAM_HANDLER( shogwarr )
-{
- int isbrap = ( !strcmp(machine->gamedrv->name,"brapboysj") || !strcmp(machine->gamedrv->name,"brapboys"));
-
- if (read_or_write)
- eeprom_save(file);
- else
- {
- eeprom_init(machine, &eeprom_interface_93C46);
-
- if (file) eeprom_load(file);
- else
- {
- if (isbrap)
- eeprom_set_data(brapboys_default_eeprom,128);
- else
- eeprom_set_data(shogwarr_default_eeprom,128);
- }
- }
-}
-
static ADDRESS_MAP_START( shogwarr_oki1_map, 0, 8 )
AM_RANGE(0x00000, 0x2ffff) AM_ROM
AM_RANGE(0x30000, 0x3ffff) AM_ROMBANK(10)
@@ -2193,6 +2167,7 @@ static MACHINE_DRIVER_START( shogwarr )
MDRV_CPU_VBLANK_INT_HACK(shogwarr_interrupt,SHOGWARR_INTERRUPTS_NUM)
MDRV_MACHINE_RESET(shogwarr)
+ MDRV_EEPROM_93C46_ADD("eeprom", 128, shogwarr_default_eeprom)
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
@@ -2208,8 +2183,6 @@ static MACHINE_DRIVER_START( shogwarr )
MDRV_VIDEO_START(kaneko16_1xVIEW2)
MDRV_VIDEO_UPDATE(kaneko16)
- MDRV_NVRAM_HANDLER(shogwarr)
-
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")
@@ -2224,6 +2197,18 @@ static MACHINE_DRIVER_START( shogwarr )
MDRV_DEVICE_ADDRESS_MAP(0, shogwarr_oki2_map)
MACHINE_DRIVER_END
+
+static const UINT8 brapboys_default_eeprom[128] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x20, 0x30, 0x00, 0x03, 0x68, 0x18, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x4B, 0x41, 0x4E, 0x45, 0x4B, 0x4F, 0x20, 0x20,
+ 0x42, 0x65, 0x20, 0x52, 0x61, 0x70, 0x20, 0x42, 0x6F, 0x79, 0x73, 0x00, 0x30, 0x30, 0x30, 0x2E,
+ 0x30, 0x38, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 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, 0x35, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
+};
+
static ADDRESS_MAP_START( brapboys_oki2_map, 0, 8 )
AM_RANGE(0x00000, 0x1ffff) AM_ROM
AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK(11)
@@ -2233,6 +2218,9 @@ static MACHINE_DRIVER_START( brapboys )
MDRV_IMPORT_FROM(shogwarr)
MDRV_SOUND_MODIFY("oki2")
MDRV_DEVICE_ADDRESS_MAP(0, brapboys_oki2_map)
+
+ MDRV_DEVICE_REMOVE("eeprom")
+ MDRV_EEPROM_93C46_ADD("eeprom", 128, brapboys_default_eeprom)
MACHINE_DRIVER_END
/***************************************************************************
diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c
index 0f58c1b45ff..6c5d5bbf0ad 100644
--- a/src/mame/drivers/limenko.c
+++ b/src/mame/drivers/limenko.c
@@ -25,7 +25,7 @@
#include "driver.h"
#include "cpu/e132xs/e132xs.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "sound/okim6295.h"
#include "cpu/mcs51/mcs51.h"
@@ -46,15 +46,6 @@ static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectan
MISC FUNCTIONS
*****************************************************************************************************/
-static WRITE32_HANDLER( eeprom_w )
-{
- // data & 0x80000 -> video disabled?
-
- eeprom_write_bit(data & 0x40000);
- eeprom_set_cs_line((data & 0x10000) ? CLEAR_LINE : ASSERT_LINE );
- eeprom_set_clock_line((data & 0x20000) ? ASSERT_LINE : CLEAR_LINE );
-}
-
static WRITE32_HANDLER( limenko_coincounter_w )
{
coin_counter_w(0,data & 0x10000);
@@ -159,7 +150,7 @@ static ADDRESS_MAP_START( limenko_io_map, ADDRESS_SPACE_IO, 32 )
AM_RANGE(0x0800, 0x0803) AM_READ_PORT("IN1")
AM_RANGE(0x1000, 0x1003) AM_READ_PORT("IN2")
AM_RANGE(0x4000, 0x4003) AM_WRITE(limenko_coincounter_w)
- AM_RANGE(0x4800, 0x4803) AM_WRITE(eeprom_w)
+ AM_RANGE(0x4800, 0x4803) AM_WRITE_PORT("EEPROMOUT")
AM_RANGE(0x5000, 0x5003) AM_WRITENOP // sound latch
ADDRESS_MAP_END
@@ -186,7 +177,7 @@ static ADDRESS_MAP_START( spotty_io_map, ADDRESS_SPACE_IO, 32 )
AM_RANGE(0x0800, 0x0803) AM_READ_PORT("IN1")
AM_RANGE(0x0800, 0x0803) AM_WRITENOP // hopper related
AM_RANGE(0x1000, 0x1003) AM_READ_PORT("IN2")
- AM_RANGE(0x4800, 0x4803) AM_WRITE(eeprom_w)
+ AM_RANGE(0x4800, 0x4803) AM_WRITE_PORT("EEPROMOUT")
AM_RANGE(0x5000, 0x5003) AM_WRITE(spotty_soundlatch_w)
ADDRESS_MAP_END
@@ -515,7 +506,7 @@ static INPUT_PORTS_START( legendoh )
PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW )
PORT_BIT( 0x00400000, IP_ACTIVE_HIGH, IPT_SPECIAL ) //security bit
- PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL) //eeprom
+ PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START3 )
PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_START4 )
PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_COIN3 )
@@ -526,6 +517,12 @@ static INPUT_PORTS_START( legendoh )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(spriteram_bit_r, NULL) //changes spriteram location
PORT_BIT( 0x4000ffff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+ PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+// PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // 0x80000 -> video disabled?
INPUT_PORTS_END
static INPUT_PORTS_START( sb2003 )
@@ -558,13 +555,19 @@ static INPUT_PORTS_START( sb2003 )
PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW )
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_SPECIAL ) //security bit
- PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL) //eeprom
+ PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_DIPNAME( 0x20000000, 0x00000000, "Sound Enable" )
PORT_DIPSETTING( 0x20000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(spriteram_bit_r, NULL) //changes spriteram location
PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE1 ) // checked in dynabomb I/O test, but doesn't work in game
PORT_BIT( 0x5f00ffff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+ PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+// PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // 0x80000 -> video disabled?
INPUT_PORTS_END
static INPUT_PORTS_START( spotty )
@@ -597,12 +600,18 @@ static INPUT_PORTS_START( spotty )
PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(spriteram_bit_r, NULL) //changes spriteram location
PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW )
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_SPECIAL ) //security bit
- PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL) //eeprom
+ PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_DIPNAME( 0x20000000, 0x20000000, DEF_STR( Demo_Sounds ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x20000000, DEF_STR( On ) )
PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x5f10ffff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+ PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+// PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // 0x80000 -> video disabled?
INPUT_PORTS_END
/*****************************************************************************************************
@@ -637,7 +646,7 @@ static MACHINE_DRIVER_START( limenko )
MDRV_CPU_IO_MAP(limenko_io_map)
MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
- MDRV_NVRAM_HANDLER(93C46)
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
@@ -665,7 +674,7 @@ static MACHINE_DRIVER_START( spotty )
MDRV_CPU_ADD("audiocpu", AT89C4051, 4000000) /* 4 MHz */
MDRV_CPU_IO_MAP(spotty_sound_io_map)
- MDRV_NVRAM_HANDLER(93C46)
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/taito_b.c b/src/mame/drivers/taito_b.c
index f5266e927ed..99ec4075dea 100644
--- a/src/mame/drivers/taito_b.c
+++ b/src/mame/drivers/taito_b.c
@@ -172,7 +172,7 @@ Notes:
#include "taitoipt.h"
#include "cpu/m68000/m68000.h"
#include "video/taitoic.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "machine/mb87078.h"
#include "audio/taitosnd.h"
#include "sound/2203intf.h"
@@ -358,7 +358,7 @@ static WRITE16_HANDLER( gain_control_w )
***************************************************************************/
-static const eeprom_interface eeprom_intf =
+static const eeprom_interface taitob_eeprom_intf =
{
6, /* address bits */
16, /* data bits */
@@ -369,30 +369,6 @@ static const eeprom_interface eeprom_intf =
"0100110000" /* unlock command*/
};
-static NVRAM_HANDLER( taito_b )
-{
- if (read_or_write)
- eeprom_save(file);
- else
- {
- eeprom_init(machine, &eeprom_intf);
- if (file)
- {
- eeprom_load(file);
- }
- }
-}
-
-static READ16_HANDLER( eeprom_r )
-{
- int res;
-
- res = (eeprom_read_bit() & 0x01);
- res |= input_port_read(space->machine, "DSWB") & 0xfe; /* coin inputs */
-
- return res;
-}
-
static UINT16 eep_latch = 0;
static READ16_HANDLER( eep_latch_r )
@@ -404,8 +380,8 @@ static WRITE16_HANDLER( eeprom_w )
{
COMBINE_DATA(&eep_latch);
- if (ACCESSING_BITS_8_15)
- {
+ if (ACCESSING_BITS_8_15)
+ {
data >>= 8; /*M68k byte write*/
/* bit 0 - Unused */
@@ -418,9 +394,7 @@ static WRITE16_HANDLER( eeprom_w )
/* bit 7 - set all the time (Chip Select?) */
/* EEPROM */
- eeprom_write_bit(data & 0x04);
- eeprom_set_clock_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
- eeprom_set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ input_port_write(space->machine, "EEPROMOUT", data, 0xff);
}
}
@@ -457,7 +431,7 @@ static READ16_HANDLER( pbobble_input_bypass_r )
switch (offset)
{
case 0x01:
- return eeprom_r(space, 0, mem_mask) << 8;
+ return input_port_read(space->machine, "DSWB") << 8;
default:
return TC0640FIO_r(space, offset) << 8;
@@ -1364,7 +1338,7 @@ static INPUT_PORTS_START( pbobble ) /* Missing P3&4 controls ! */
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) /*ok*/
PORT_START("DSWB")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1422,6 +1396,11 @@ static INPUT_PORTS_START( pbobble ) /* Missing P3&4 controls ! */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
INPUT_PORTS_END
static INPUT_PORTS_START( spacedxo )
@@ -1522,7 +1501,7 @@ static INPUT_PORTS_START( qzshowby )
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) /*ok*/
PORT_START("DSWB")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1580,6 +1559,11 @@ static INPUT_PORTS_START( qzshowby )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
INPUT_PORTS_END
static INPUT_PORTS_START( viofight )
@@ -2460,7 +2444,7 @@ static MACHINE_DRIVER_START( pbobble )
MDRV_QUANTUM_TIME(HZ(600))
MDRV_MACHINE_RESET(mb87078)
- MDRV_NVRAM_HANDLER(taito_b)
+ MDRV_EEPROM_NODEFAULT_ADD("eeprom", taitob_eeprom_intf)
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
@@ -2501,7 +2485,7 @@ static MACHINE_DRIVER_START( spacedx )
MDRV_QUANTUM_TIME(HZ(600))
MDRV_MACHINE_RESET(mb87078)
- MDRV_NVRAM_HANDLER(taito_b)
+ MDRV_EEPROM_NODEFAULT_ADD("eeprom", taitob_eeprom_intf)
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
@@ -2580,7 +2564,7 @@ static MACHINE_DRIVER_START( qzshowby )
MDRV_QUANTUM_TIME(HZ(600))
MDRV_MACHINE_RESET(mb87078)
- MDRV_NVRAM_HANDLER(taito_b)
+ MDRV_EEPROM_NODEFAULT_ADD("eeprom", taitob_eeprom_intf)
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c
index b273fb1e79e..2ef1d6aa71b 100644
--- a/src/mame/drivers/taito_f3.c
+++ b/src/mame/drivers/taito_f3.c
@@ -37,7 +37,7 @@
#include "driver.h"
#include "cpu/m68000/m68000.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "taito_f3.h"
#include "sound/es5506.h"
#include "audio/taito_en.h"
@@ -99,9 +99,7 @@ static WRITE32_HANDLER( f3_control_w )
case 0x04: /* Eeprom */
if (ACCESSING_BITS_0_7)
{
- eeprom_set_clock_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
- eeprom_write_bit(data & 0x04);
- eeprom_set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ input_port_write(space->machine, "EEPROMOUT", data, 0xff);
}
return;
@@ -195,8 +193,8 @@ static INPUT_PORTS_START( f3 )
PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_START3 )
PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_START4 )
- PORT_BIT( 0x00ff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "EEPROM")
- PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "EEPROM")
+ PORT_BIT( 0x00ff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "EEPROMIN")
+ PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "EEPROMIN")
/* MSW: Coin counters/lockouts are readable, LSW: Joysticks (Player 1 & 2) */
PORT_START("IN1")
@@ -248,8 +246,8 @@ static INPUT_PORTS_START( f3 )
PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* These are not read directly, but through PORT_CUSTOMs above */
- PORT_START("EEPROM")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL) /* Eprom data bit */
+ PORT_START("EEPROMIN")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) /* Another service mode */
@@ -263,6 +261,11 @@ static INPUT_PORTS_START( f3 )
PORT_START("DIAL2")
PORT_BIT( 0xfff, 0x000, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2)
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
INPUT_PORTS_END
static INPUT_PORTS_START( kn )
@@ -373,34 +376,16 @@ static MACHINE_RESET( f3 )
}
-static NVRAM_HANDLER( taito_f3 )
-{
- if (read_or_write)
- eeprom_save(file);
- else
- {
- static const UINT8 recalh_eeprom[128] = {
- 0x85,0x54,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf3,0x35,
- 0x00,0x01,0x86,0xa0,0x00,0x13,0x04,0x13,0x00,0x00,0xc3,0x50,0x00,0x19,0x00,0x0a,
- 0x00,0x00,0x4e,0x20,0x00,0x03,0x18,0x0d,0x00,0x00,0x27,0x10,0x00,0x05,0x14,0x18,
- 0x00,0x00,0x13,0x88,0x00,0x00,0x12,0x27,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
- };
-
- // RecalH does not initialise it's eeprom on first boot, so we provide one.
- // Same applies to gseeker.
- eeprom_init(machine, &eeprom_interface_93C46);
- if (file)
- eeprom_load(file);
- else if (f3_game==RECALH)
- eeprom_set_data(recalh_eeprom,128);
- else if (f3_game==GSEEKER)
- eeprom_set_data(recalh_eeprom,128);
- }
-}
+static const UINT8 recalh_eeprom[128] = {
+ 0x85,0x54,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf3,0x35,
+ 0x00,0x01,0x86,0xa0,0x00,0x13,0x04,0x13,0x00,0x00,0xc3,0x50,0x00,0x19,0x00,0x0a,
+ 0x00,0x00,0x4e,0x20,0x00,0x03,0x18,0x0d,0x00,0x00,0x27,0x10,0x00,0x05,0x14,0x18,
+ 0x00,0x00,0x13,0x88,0x00,0x00,0x12,0x27,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,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 MACHINE_START(f3)
{
@@ -418,7 +403,8 @@ static MACHINE_DRIVER_START( f3 )
MDRV_MACHINE_START(f3)
MDRV_MACHINE_RESET(f3)
- MDRV_NVRAM_HANDLER(taito_f3)
+
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
@@ -462,6 +448,20 @@ static MACHINE_DRIVER_START( f3_224c )
MDRV_SCREEN_VISIBLE_AREA(46, 40*8-1 + 46, 24, 24+224-1)
MACHINE_DRIVER_END
+/* recalh and gseeker need a default EEPROM to work */
+static MACHINE_DRIVER_START( f3_eeprom )
+ MDRV_IMPORT_FROM(f3)
+
+ MDRV_DEVICE_REMOVE("eeprom")
+ MDRV_EEPROM_93C46_ADD("eeprom", 128, recalh_eeprom)
+MACHINE_DRIVER_END
+
+static MACHINE_DRIVER_START( f3_224b_eeprom )
+ MDRV_IMPORT_FROM(f3)
+
+ MDRV_DEVICE_REMOVE("eeprom")
+ MDRV_EEPROM_93C46_ADD("eeprom", 128, recalh_eeprom)
+MACHINE_DRIVER_END
static const gfx_layout bubsympb_sprite_layout =
{
@@ -501,7 +501,8 @@ static MACHINE_DRIVER_START( bubsympb )
MDRV_MACHINE_START(f3)
//MDRV_MACHINE_RESET(f3)
- MDRV_NVRAM_HANDLER(taito_f3)
+
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
@@ -3845,9 +3846,9 @@ GAME( 1992, arabianmu,arabianm, f3_224a, f3, arabianm, ROT0, "Taito America Co
GAME( 1992, ridingf, 0, f3_224b, f3, ridingf, ROT0, "Taito Corporation Japan", "Riding Fight (Ver 1.0O)", GAME_NO_SOUND )
GAME( 1992, ridingfj, ridingf, f3_224b, f3, ridingf, ROT0, "Taito Corporation", "Riding Fight (Ver 1.0J)", GAME_NO_SOUND )
GAME( 1992, ridingfu, ridingf, f3_224b, f3, ridingf, ROT0, "Taito America Corporation", "Riding Fight (Ver 1.0A)", GAME_NO_SOUND )
-GAME( 1992, gseeker, 0, f3_224b, f3, gseeker, ROT90, "Taito Corporation Japan", "Grid Seeker: Project Storm Hammer (Ver 1.3O)", 0 )
-GAME( 1992, gseekerj, gseeker, f3_224b, f3, gseeker, ROT90, "Taito Corporation", "Grid Seeker: Project Storm Hammer (Ver 1.3J)", 0 )
-GAME( 1992, gseekeru, gseeker, f3_224b, f3, gseeker, ROT90, "Taito America Corporation", "Grid Seeker: Project Storm Hammer (Ver 1.3A)", 0 )
+GAME( 1992, gseeker, 0, f3_224b_eeprom, f3, gseeker, ROT90, "Taito Corporation Japan", "Grid Seeker: Project Storm Hammer (Ver 1.3O)", 0 )
+GAME( 1992, gseekerj, gseeker, f3_224b_eeprom, f3, gseeker, ROT90, "Taito Corporation", "Grid Seeker: Project Storm Hammer (Ver 1.3J)", 0 )
+GAME( 1992, gseekeru, gseeker, f3_224b_eeprom, f3, gseeker, ROT90, "Taito America Corporation", "Grid Seeker: Project Storm Hammer (Ver 1.3A)", 0 )
GAME( 1992, commandw, 0, f3_224b, f3, commandw, ROT0, "Taito Corporation", "Command War - Super Special Battle & War Game (Ver 0.0J) (Prototype)", GAME_IMPERFECT_GRAPHICS )
/* Most of the football games share some GFX roms but shouldn't be considered clones unless they have the same Taito game code for the program roms */
GAME( 1993, cupfinal, 0, f3_224a, f3, cupfinal, ROT0, "Taito Corporation Japan", "Taito Cup Finals (Ver 1.0O 1993/02/28)", 0 )
@@ -3890,7 +3891,7 @@ GAME( 1994, elvactr, 0, f3, f3, elvactr, ROT0, "Taito Corporatio
GAME( 1994, elvactrj, elvactr, f3, f3, elvactr, ROT0, "Taito Corporation", "Elevator Action Returns (Ver 2.2J 1995/02/20)", 0 )
GAME( 1994, elvact2u, elvactr, f3, f3, elvactr, ROT0, "Taito America Corporation", "Elevator Action II (Ver 2.2A 1995/02/20)", 0 )
/* There is also a prototype Elevator Action II (US) pcb with the graphics in a different rom format (same program code) */
-GAME( 1994, recalh, 0, f3, f3, recalh, ROT0, "Taito Corporation", "Recalhorn (Ver 1.42J 1994/5/11) (Prototype)", 0 )
+GAME( 1994, recalh, 0, f3_eeprom,f3, recalh, ROT0, "Taito Corporation", "Recalhorn (Ver 1.42J 1994/5/11) (Prototype)", 0 )
GAME( 1995, spcinv95, 0, f3_224a, f3, spcinv95, ROT270, "Taito Corporation Japan", "Space Invaders '95: The Attack Of Lunar Loonies (Ver 2.5O 1995/06/14)", 0 )
GAME( 1995, spcinv95u,spcinv95, f3_224a, f3, spcinv95, ROT270, "Taito America Corporation", "Space Invaders '95: The Attack Of Lunar Loonies (Ver 2.5A 1995/06/14)", 0 )
GAME( 1995, akkanvdr, spcinv95, f3_224a, f3, spcinv95, ROT270, "Taito Corporation", "Akkanbeder (Ver 2.5J 1995/06/14)", 0 )
diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c
index 2dbd5cb9e36..a80c380d08d 100644
--- a/src/mame/drivers/taito_z.c
+++ b/src/mame/drivers/taito_z.c
@@ -879,7 +879,7 @@ J1100256A VIDEO PCB
#include "cpu/z80/z80.h"
#include "taitoipt.h"
#include "cpu/m68000/m68000.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "video/taitoic.h"
#include "audio/taitosnd.h"
#include "sound/2610intf.h"
@@ -1014,7 +1014,7 @@ static INTERRUPT_GEN( dblaxle_cpub_interrupt )
EEPROM
******************************************************************/
-static const UINT8 default_eeprom[128]=
+static const UINT8 spacegun_default_eeprom[128]=
{
0x00,0x00,0x00,0xff,0x00,0x01,0x41,0x41,0x00,0x00,0x00,0xff,0x00,0x00,0xf0,0xf0,
0x00,0x00,0x00,0xff,0x00,0x01,0x41,0x41,0x00,0x00,0x00,0xff,0x00,0x00,0xf0,0xf0,
@@ -1026,7 +1026,7 @@ static const UINT8 default_eeprom[128]=
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
};
-static const eeprom_interface eeprom_intf =
+static const eeprom_interface spacegun_eeprom_intf =
{
6, /* address bits */
16, /* data bits */
@@ -1039,25 +1039,6 @@ static const eeprom_interface eeprom_intf =
1 /* reset delay */
};
-static NVRAM_HANDLER( spacegun )
-{
- if (read_or_write)
- eeprom_save(file);
- else
- {
- eeprom_init(machine, &eeprom_intf);
-
- if (file)
- eeprom_load(file);
- else
- eeprom_set_data(default_eeprom,128); /* Default the gun setup values */
- }
-}
-
-static int eeprom_r(void)
-{
- return (eeprom_read_bit() & 0x01)<<7;
-}
#if 0
static READ16_HANDLER( eep_latch_r )
@@ -1079,9 +1060,7 @@ static WRITE16_HANDLER( spacegun_output_bypass_w )
x0000000 (unused) */
COMBINE_DATA(&eep_latch);
- eeprom_write_bit(data & 0x40);
- eeprom_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
- eeprom_set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ input_port_write(space->machine, "EEPROMOUT", data, 0xff);
break;
default:
@@ -1281,10 +1260,12 @@ static READ16_HANDLER( sci_steer_input_r )
static READ16_HANDLER( spacegun_input_bypass_r )
{
+ const device_config *eeprom = devtag_get_device(space->machine, "eeprom");
+
switch (offset)
{
case 0x03:
- return eeprom_r();
+ return eepromdev_read_bit(eeprom) << 7;
default:
return TC0220IOC_r(space, offset); /* might be a 510NIO ! */
@@ -2635,6 +2616,11 @@ static INPUT_PORTS_START( spacegun )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+
PORT_START("STICKX1")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(13) PORT_CENTERDELTA(0) PORT_REVERSE PORT_PLAYER(1)
@@ -3282,7 +3268,7 @@ static MACHINE_DRIVER_START( spacegun )
MDRV_MACHINE_START(taitoz)
- MDRV_NVRAM_HANDLER(spacegun)
+ MDRV_EEPROM_ADD("eeprom", spacegun_eeprom_intf, 128, spacegun_default_eeprom)
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c
index adcbde28a26..8d61fce2133 100644
--- a/src/mame/drivers/taitojc.c
+++ b/src/mame/drivers/taitojc.c
@@ -355,7 +355,7 @@ Notes:
#include "taito_f3.h"
#include "cpu/mc68hc11/mc68hc11.h"
#include "sound/es5506.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "audio/taito_en.h"
extern UINT32 *f3_shared_ram;
@@ -484,9 +484,7 @@ static WRITE32_HANDLER ( jc_control_w )
{
if (ACCESSING_BITS_24_31)
{
- eeprom_set_clock_line(((data >> 24) & 0x08) ? ASSERT_LINE : CLEAR_LINE);
- eeprom_write_bit(((data >> 24) & 0x04) ? 1 : 0);
- eeprom_set_cs_line(((data >> 24) & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ input_port_write(space->machine, "EEPROMOUT", data >> 24, 0xff);
}
return;
}
@@ -1092,7 +1090,7 @@ static INPUT_PORTS_START( taitojc )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
//PORT_SERVICE(0x02, 0x00)
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_START("START")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
@@ -1116,6 +1114,11 @@ static INPUT_PORTS_START( taitojc )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON7 )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
INPUT_PORTS_END
#endif
@@ -1124,7 +1127,7 @@ static INPUT_PORTS_START( dendeg )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_START("START")
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1132,6 +1135,11 @@ static INPUT_PORTS_START( dendeg )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+
PORT_START("UNUSED")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) // Horn
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1155,7 +1163,7 @@ static INPUT_PORTS_START( landgear )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_START("START")
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1163,6 +1171,11 @@ static INPUT_PORTS_START( landgear )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+
PORT_START("UNUSED")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // View button
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1185,7 +1198,7 @@ static INPUT_PORTS_START( sidebs )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_START("START")
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1195,6 +1208,11 @@ static INPUT_PORTS_START( sidebs )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+
PORT_START("UNUSED")
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // View button
@@ -1220,7 +1238,7 @@ static INPUT_PORTS_START( dangcurv )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
PORT_START("START")
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1230,6 +1248,11 @@ static INPUT_PORTS_START( dangcurv )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+
PORT_START("UNUSED")
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // View button
@@ -1320,8 +1343,7 @@ static MACHINE_DRIVER_START( taitojc )
MDRV_QUANTUM_TIME(HZ(6000))
MDRV_MACHINE_RESET(taitojc)
- MDRV_NVRAM_HANDLER(93C46)
-
+ MDRV_EEPROM_93C46_NODEFAULT_ADD("eeprom")
MDRV_SCREEN_ADD("screen", RASTER)
MDRV_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c
index bb670375ba2..b54324aa1c3 100644
--- a/src/mame/drivers/toaplan2.c
+++ b/src/mame/drivers/toaplan2.c
@@ -255,7 +255,7 @@ To Do / Unknowns:
#include "cpu/nec/nec.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
-#include "machine/eeprom.h"
+#include "machine/eepromdev.h"
#include "machine/nmk112.h"
#include "sound/2151intf.h"
#include "sound/3812intf.h"
@@ -1213,7 +1213,7 @@ static WRITE8_HANDLER( raizing_clear_nmi_w )
/*###################### Battle Bakraid ##############################*/
/* EEPROM contents with Battle Bakraid Unlimited version features unlocked */
-static const UINT8 bbakraid_unlimited_nvram[512] = {
+static const UINT8 bbakraid_unlim_default[512] = {
0xc2,0x49,0x00,0x07,0xa1,0x20,0x2a,0x2a,0x2a,0x90,0x90,0x90,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x06,0x1a,0x80,0x2a,0x2a,0x2a,0x94,
0x94,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x04,
@@ -1250,7 +1250,7 @@ static const UINT8 bbakraid_unlimited_nvram[512] = {
-static const eeprom_interface eeprom_interface_93C66 =
+static const eeprom_interface bbakraid_93C66_intf =
{
/* Pin 6 of the 93C66 is connected to Gnd!
So it's configured for 512 bytes */
@@ -1266,29 +1266,10 @@ static const eeprom_interface eeprom_interface_93C66 =
// "*10010xxxx" // erase all 1 00 10xxxx
};
-
-static NVRAM_HANDLER( bbakraid )
-{
- /* Pin 6 of 93C66 is connected to Gnd! */
-
- if (read_or_write)
- eeprom_save(file);
- else
- {
- eeprom_init(machine, &eeprom_interface_93C66);
-
- if (file) eeprom_load(file);
- else
- {
- if (bbakraid_unlimited_ver == 1)
- eeprom_set_data(bbakraid_unlimited_nvram, sizeof(bbakraid_unlimited_nvram));
- }
- }
-}
-
-
static READ16_HANDLER( bbakraid_nvram_r )
{
+ const device_config *eeprom = devtag_get_device(space->machine, "eeprom");
+
/* Bit 1 returns the status of BUSAK from the Z80.
BUSRQ is activated via bit 0x10 on the NVRAM write port.
These accesses are made when the 68K wants to read the Z80
@@ -1296,7 +1277,7 @@ static READ16_HANDLER( bbakraid_nvram_r )
*/
int data;
- data = ((eeprom_read_bit() & 0x01) << 4);
+ data = ((eepromdev_read_bit(eeprom) & 0x01) << 4);
data |= ((raizing_Z80_busreq >> 4) & 0x01); /* Loop BUSRQ to BUSAK */
return data;
@@ -1309,16 +1290,8 @@ static WRITE16_HANDLER( bbakraid_nvram_w )
logerror("CPU #0 PC:%06X - Unknown EEPROM data being written %04X\n",cpu_get_pc(space->cpu),data);
if ( ACCESSING_BITS_0_7 )
- {
- // chip select
- eeprom_set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE );
+ input_port_write(space->machine, "EEPROMOUT", data, 0xff);
- // latch the bit
- eeprom_write_bit( (data & 0x04) >> 2 );
-
- // clock line asserted: write latch or select next bit to read
- eeprom_set_clock_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE );
- }
raizing_Z80_busreq = data & 0x10; /* see bbakraid_nvram_r above */
}
@@ -3297,6 +3270,11 @@ static INPUT_PORTS_START( bbakraid )
PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW3:8")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
+
+ PORT_START( "EEPROMOUT" )
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line)
+ PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit)
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line)
INPUT_PORTS_END
@@ -4334,7 +4312,7 @@ static MACHINE_DRIVER_START( bbakraid )
MDRV_QUANTUM_TIME(HZ(600))
MDRV_MACHINE_RESET(toaplan2)
- MDRV_NVRAM_HANDLER(bbakraid)
+ MDRV_EEPROM_NODEFAULT_ADD("eeprom", bbakraid_93C66_intf)
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
@@ -4360,6 +4338,12 @@ static MACHINE_DRIVER_START( bbakraid )
MDRV_SOUND_ROUTE(1, "mono", 1.0)
MACHINE_DRIVER_END
+static MACHINE_DRIVER_START( bbakradu )
+ MDRV_IMPORT_FROM(bbakraid)
+
+ MDRV_DEVICE_REMOVE("eeprom")
+ MDRV_EEPROM_ADD("eeprom", bbakraid_93C66_intf, 512, bbakraid_unlim_default)
+MACHINE_DRIVER_END
/***************************************************************************
@@ -5455,7 +5439,7 @@ GAME( 1998, batridja, batrid, batrider, batridrj, batrider, ROT270, "Raizing /
// Battle Bakraid
// the 'unlimited' version is a newer revision of the code.
-GAME( 1999, bkraidu, 0, bbakraid, bbakraid, bbakradu, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (U.S.A.) (Tue Jun 8 1999)", GAME_SUPPORTS_SAVE )
-GAME( 1999, bkraiduj, bkraidu, bbakraid, bbakraid, bbakradu, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (Japan) (Tue Jun 8 1999)", GAME_SUPPORTS_SAVE )
+GAME( 1999, bkraidu, 0, bbakradu, bbakraid, bbakradu, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (U.S.A.) (Tue Jun 8 1999)", GAME_SUPPORTS_SAVE )
+GAME( 1999, bkraiduj, bkraidu, bbakradu, bbakraid, bbakradu, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (Japan) (Tue Jun 8 1999)", GAME_SUPPORTS_SAVE )
// older revision of the code
-GAME( 1999, bkraidj, bkraidu, bbakraid, bbakraid, bbakraid, ROT270, "Eighting", "Battle Bakraid (Japan) (Wed Apr 7 1999)", GAME_SUPPORTS_SAVE )
+GAME( 1999, bkraidj, bkraidu, bbakraid, bbakraid, bbakraid, ROT270, "Eighting", "Battle Bakraid (Japan) (Wed Apr 7 1999)", GAME_SUPPORTS_SAVE )