diff options
author | 2010-09-04 17:01:46 +0000 | |
---|---|---|
committer | 2010-09-04 17:01:46 +0000 | |
commit | 5b6c078aebe05f8415acc9a7e3d423f89342b628 (patch) | |
tree | 3492d73afc9907d181f2d025f3382cf728d9fc3a /src/mame/drivers/witch.c | |
parent | 8969b0b7ee3a47b281d767dfea9f31b14a09b692 (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/witch.c')
-rw-r--r-- | src/mame/drivers/witch.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mame/drivers/witch.c b/src/mame/drivers/witch.c index a685552fefb..f0e05e781a0 100644 --- a/src/mame/drivers/witch.c +++ b/src/mame/drivers/witch.c @@ -193,6 +193,7 @@ TODO : #include "cpu/z80/z80.h" #include "sound/es8712.h" #include "sound/2203intf.h" +#include "machine/nvram.h" #define UNBANKED_SIZE 0x800 @@ -451,7 +452,7 @@ static ADDRESS_MAP_START( map_main, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_BASE_GENERIC(paletteram) AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_BASE_GENERIC(paletteram2) AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_SHARE("share1") - AM_RANGE(0xf100, 0xf17f) AM_RAM AM_BASE_SIZE_GENERIC(nvram) + AM_RANGE(0xf100, 0xf17f) AM_RAM AM_SHARE("nvram") AM_RANGE(0xf180, 0xffff) AM_RAM AM_SHARE("share2") ADDRESS_MAP_END @@ -767,7 +768,7 @@ static MACHINE_CONFIG_START( witch, driver_device ) MDRV_CPU_PROGRAM_MAP(map_sub) MDRV_CPU_VBLANK_INT("screen", witch_sub_interrupt) - MDRV_NVRAM_HANDLER(generic_0fill) + MDRV_NVRAM_ADD_0FILL("nvram") /* video hardware */ MDRV_SCREEN_ADD("screen", RASTER) |