summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/acefruit.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/acefruit.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/acefruit.c')
-rw-r--r--src/mame/drivers/acefruit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mame/drivers/acefruit.c b/src/mame/drivers/acefruit.c
index d5c48f702e4..ec4b8f52687 100644
--- a/src/mame/drivers/acefruit.c
+++ b/src/mame/drivers/acefruit.c
@@ -10,6 +10,7 @@ Inputs and Dip Switches by Stephh
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/nvram.h"
#include "sidewndr.lh"
@@ -258,7 +259,7 @@ static PALETTE_INIT( acefruit )
static ADDRESS_MAP_START( acefruit_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_ROM
- AM_RANGE(0x2000, 0x20ff) AM_RAM AM_BASE_SIZE_GENERIC(nvram)
+ AM_RANGE(0x2000, 0x20ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&videoram)
AM_RANGE(0x4400, 0x47ff) AM_RAM_WRITE(acefruit_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0")
@@ -565,7 +566,7 @@ static MACHINE_CONFIG_START( acefruit, driver_device )
MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 255)
MDRV_PALETTE_LENGTH(16)
- MDRV_NVRAM_HANDLER(generic_0fill)
+ MDRV_NVRAM_ADD_0FILL("nvram")
MDRV_PALETTE_INIT(acefruit)
MDRV_VIDEO_START(acefruit)