summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/omegrace.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/omegrace.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/omegrace.c')
-rw-r--r--src/mame/drivers/omegrace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mame/drivers/omegrace.c b/src/mame/drivers/omegrace.c
index bd8029642e3..04adc10e9a3 100644
--- a/src/mame/drivers/omegrace.c
+++ b/src/mame/drivers/omegrace.c
@@ -218,6 +218,7 @@
#include "video/vector.h"
#include "video/avgdvg.h"
#include "sound/ay8910.h"
+#include "machine/nvram.h"
#include "rendlay.h"
@@ -328,7 +329,7 @@ static WRITE8_HANDLER( omegrace_soundlatch_w )
static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x4bff) AM_RAM
- AM_RANGE(0x5c00, 0x5cff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) /* NVRAM */
+ AM_RANGE(0x5c00, 0x5cff) AM_RAM AM_SHARE("nvram") /* NVRAM */
AM_RANGE(0x8000, 0x8fff) AM_RAM AM_BASE(&avgdvg_vectorram) AM_SIZE(&avgdvg_vectorram_size) AM_REGION("maincpu", 0x8000) /* vector ram */
AM_RANGE(0x9000, 0x9fff) AM_ROM /* vector rom */
ADDRESS_MAP_END
@@ -488,7 +489,7 @@ static MACHINE_CONFIG_START( omegrace, driver_device )
MDRV_CPU_PERIODIC_INT(nmi_line_pulse,250)
MDRV_MACHINE_RESET(omegrace)
- MDRV_NVRAM_HANDLER(generic_0fill)
+ MDRV_NVRAM_ADD_0FILL("nvram")
/* video hardware */
MDRV_SCREEN_ADD("screen", VECTOR)