diff options
author | Aaron Giles <aaron@aarongiles.com> | 2010-09-04 17:01:46 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2010-09-04 17:01:46 +0000 |
commit | 5b6c078aebe05f8415acc9a7e3d423f89342b628 (patch) | |
tree | 3492d73afc9907d181f2d025f3382cf728d9fc3a /src/mame/drivers/namcos23.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/namcos23.c')
-rw-r--r-- | src/mame/drivers/namcos23.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c index ec011cee143..bd40fd3c9d2 100644 --- a/src/mame/drivers/namcos23.c +++ b/src/mame/drivers/namcos23.c @@ -1159,6 +1159,7 @@ Notes: #include "cpu/h83002/h8.h" #include "cpu/sh2/sh2.h" #include "sound/c352.h" +#include "machine/nvram.h" #define S23_BUSCLOCK (66664460/2) // 33 MHz CPU bus clock / input, somehow derived from 14.31721 MHz crystal #define S23_VSYNC1 (59.8824) @@ -2241,7 +2242,7 @@ static ADDRESS_MAP_START( gorgon_map, ADDRESS_SPACE_PROGRAM, 32 ) AM_RANGE(0x08000000, 0x087fffff) AM_ROM AM_REGION("data", 0) // data ROMs - AM_RANGE(0x0c000000, 0x0c00ffff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) // BACKUP + AM_RANGE(0x0c000000, 0x0c00ffff) AM_RAM AM_SHARE("nvram") // BACKUP AM_RANGE(0x0d000000, 0x0d00000f) AM_READWRITE16( s23_ctl_r, s23_ctl_w, 0xffffffff ) // write for LEDs at d000000, watchdog at d000004 @@ -2260,7 +2261,7 @@ static ADDRESS_MAP_START( ss23_map, ADDRESS_SPACE_PROGRAM, 32 ) AM_RANGE(0x04400000, 0x0440ffff) AM_RAM AM_BASE(&namcos23_shared_ram) AM_RANGE(0x04c3ff08, 0x04c3ff0b) AM_WRITE( s23_mcuen_w ) AM_RANGE(0x04c3ff0c, 0x04c3ff0f) AM_RAM - AM_RANGE(0x06000000, 0x0600ffff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) // Backup + AM_RANGE(0x06000000, 0x0600ffff) AM_RAM AM_SHARE("nvram") // Backup AM_RANGE(0x06200000, 0x06203fff) AM_RAM // C422 AM_RANGE(0x06400000, 0x0640000f) AM_READWRITE16( s23_c422_r, s23_c422_w, 0xffffffff ) // C422 registers AM_RANGE(0x06800000, 0x06807fff) AM_RAM_WRITE( s23_txtchar_w ) AM_BASE(&namcos23_charram) // text layer characters (shown as CGRAM in POST) @@ -2899,7 +2900,7 @@ static MACHINE_CONFIG_START( gorgon, driver_device ) MDRV_PALETTE_LENGTH(0x8000) - MDRV_NVRAM_HANDLER(generic_0fill) + MDRV_NVRAM_ADD_0FILL("nvram") MDRV_GFXDECODE(namcos23) @@ -2947,7 +2948,7 @@ static MACHINE_CONFIG_START( s23, driver_device ) MDRV_GFXDECODE(namcos23) - MDRV_NVRAM_HANDLER(generic_0fill) + MDRV_NVRAM_ADD_0FILL("nvram") MDRV_VIDEO_START(ss23) MDRV_VIDEO_UPDATE(ss23) @@ -2989,7 +2990,7 @@ static MACHINE_CONFIG_START( ss23, driver_device ) MDRV_GFXDECODE(namcos23) - MDRV_NVRAM_HANDLER(generic_0fill) + MDRV_NVRAM_ADD_0FILL("nvram") MDRV_VIDEO_START(ss23) MDRV_VIDEO_UPDATE(ss23) |