summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/champbwl.c
diff options
context:
space:
mode:
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
commit5b6c078aebe05f8415acc9a7e3d423f89342b628 (patch)
tree3492d73afc9907d181f2d025f3382cf728d9fc3a /src/mame/drivers/champbwl.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/champbwl.c')
-rw-r--r--src/mame/drivers/champbwl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mame/drivers/champbwl.c b/src/mame/drivers/champbwl.c
index fea72bfff40..cf33063bc61 100644
--- a/src/mame/drivers/champbwl.c
+++ b/src/mame/drivers/champbwl.c
@@ -153,6 +153,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "sound/x1_010.h"
+#include "machine/nvram.h"
#include "includes/tnzs.h"
@@ -194,7 +195,7 @@ static WRITE8_HANDLER( champbwl_objctrl_w )
static ADDRESS_MAP_START( champbwl_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x3fff) AM_ROM AM_REGION("maincpu", 0x10000)
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
- AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE_SIZE_GENERIC(nvram)
+ AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE_MEMBER(tnzs_state, objram)
AM_RANGE(0xc000, 0xdfff) AM_DEVREADWRITE("x1snd", seta_sound_r, seta_sound_w)
AM_RANGE(0xe000, 0xe1ff) AM_RAM AM_BASE_MEMBER(tnzs_state, vdcram)
@@ -361,7 +362,7 @@ static MACHINE_CONFIG_START( champbwl, tnzs_state )
MDRV_CPU_PROGRAM_MAP(champbwl_map)
MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
- MDRV_NVRAM_HANDLER(generic_0fill)
+ MDRV_NVRAM_ADD_0FILL("nvram")
MDRV_MACHINE_START(champbwl)
MDRV_MACHINE_RESET(champbwl)