summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/esh.c
diff options
context:
space:
mode:
authorGravatarGravatar Aaron Giles <aaron@aarongiles.com>2010-09-04 17:01:46 +0000
committerGravatarGravatar Aaron Giles <aaron@aarongiles.com>2010-09-04 17:01:46 +0000
commit5b6c078aebe05f8415acc9a7e3d423f89342b628 (patch)
tree3492d73afc9907d181f2d025f3382cf728d9fc3a /src/mame/drivers/esh.c
parent8969b0b7ee3a47b281d767dfea9f31b14a09b692 (diff)
Added templates required_shared_ptr<> and optional_shared_ptr<> which
work just like required_device<> and optional_device<> for retrieving a pointer by tag from an address space that specifies AM_SHARE("tag"). Also added templates required_shared_size<> and optional_shared_size<> for retrieving the size of the AM_SHARE region. Created a new generic NVRAM device. It can be configured to default to 0-fill, 1-fill, random-fill, or custom fill. In all cases, a same-named memory region overrides the default fill. The address range where the NVRAM can be found is now identified by an AM_SHARE() region of the same tag as the NVRAM device. Drivers can also explicitly configure a separately-allocated NVRAM region via nvram_device::set_base(). Replaced all instances of MDRV_NVRAM_HANDLER(generic_*) with MDRV_NVRAM_ADD_*("nvram"). Replaced all AM_BASE_GENERIC/AM_SIZE_GENERIC(nvram) with AM_SHARE("nvram"). For all remaining drivers that referenced the generic.nvram directly, changed them to hold a required_shared_ptr<UINTx> to the NVRAM in their driver state, and use that instead. Removed nvram and nvram_size from the generic_ptrs.
Diffstat (limited to 'src/mame/drivers/esh.c')
-rw-r--r--src/mame/drivers/esh.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mame/drivers/esh.c b/src/mame/drivers/esh.c
index cfe98521846..bc7185e6dee 100644
--- a/src/mame/drivers/esh.c
+++ b/src/mame/drivers/esh.c
@@ -25,6 +25,7 @@ Todo:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/laserdsc.h"
+#include "machine/nvram.h"
/* From daphne */
#define PCB_CLOCK (18432000)
@@ -142,7 +143,7 @@ static WRITE8_HANDLER(nmi_line_w)
/* PROGRAM MAPS */
static ADDRESS_MAP_START( z80_0_mem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000,0x3fff) AM_ROM
- AM_RANGE(0xe000,0xe7ff) AM_RAM AM_BASE_SIZE_GENERIC(nvram)
+ AM_RANGE(0xe000,0xe7ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0xf000,0xf3ff) AM_RAM AM_BASE(&tile_ram)
AM_RANGE(0xf400,0xf7ff) AM_RAM AM_BASE(&tile_control_ram)
ADDRESS_MAP_END
@@ -285,7 +286,7 @@ static MACHINE_CONFIG_START( esh, driver_device )
MDRV_CPU_IO_MAP(z80_0_io)
MDRV_CPU_VBLANK_INT("screen", vblank_callback_esh)
- MDRV_NVRAM_HANDLER(generic_0fill)
+ MDRV_NVRAM_ADD_0FILL("nvram")
MDRV_MACHINE_START(esh)