From 5d183b86fe6d63ab86e7fbd5677cd4b01b3da782 Mon Sep 17 00:00:00 2001 From: AJR Date: Mon, 11 Jun 2018 19:46:46 -0400 Subject: balsente.cpp: Split NVRAM between two X2212 devices --- src/mame/drivers/balsente.cpp | 7 ++++--- src/mame/includes/balsente.h | 3 +++ src/mame/machine/balsente.cpp | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mame/drivers/balsente.cpp b/src/mame/drivers/balsente.cpp index e81882b5159..bb2a511ce09 100644 --- a/src/mame/drivers/balsente.cpp +++ b/src/mame/drivers/balsente.cpp @@ -231,7 +231,6 @@ DIP locations verified for: #include "cpu/z80/z80.h" #include "cpu/m6809/m6809.h" #include "cpu/m68000/m68000.h" -#include "machine/nvram.h" #include "machine/watchdog.h" #include "sound/cem3394.h" #include "speaker.h" @@ -267,7 +266,8 @@ void balsente_state::cpu1_map(address_map &map) map(0x9903, 0x9903).portr("IN1").nopw(); map(0x9a00, 0x9a03).r(FUNC(balsente_state::random_num_r)); map(0x9a04, 0x9a05).rw(FUNC(balsente_state::m6850_r), FUNC(balsente_state::m6850_w)); - map(0x9b00, 0x9cff).ram().share("nvram"); /* system+cart NOVRAM */ + map(0x9b00, 0x9bff).rw("nov0", FUNC(x2212_device::read), FUNC(x2212_device::write)); + map(0x9c00, 0x9cff).rw("nov1", FUNC(x2212_device::read), FUNC(x2212_device::write)); map(0xa000, 0xbfff).bankr("bank1"); map(0xc000, 0xffff).bankr("bank2"); } @@ -1305,7 +1305,8 @@ MACHINE_CONFIG_START(balsente_state::balsente) MCFG_QUANTUM_TIME(attotime::from_hz(600)) - MCFG_NVRAM_ADD_0FILL("nvram") + MCFG_X2212_ADD_AUTOSAVE("nov0") // system NOVRAM + MCFG_X2212_ADD_AUTOSAVE("nov1") // cart NOVRAM MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/includes/balsente.h b/src/mame/includes/balsente.h index b5fa0467412..14f8385e972 100644 --- a/src/mame/includes/balsente.h +++ b/src/mame/includes/balsente.h @@ -10,6 +10,7 @@ #include "machine/pit8253.h" #include "machine/timer.h" +#include "machine/x2212.h" #include "machine/74259.h" #include "sound/cem3394.h" #include "screen.h" @@ -51,6 +52,7 @@ public: , m_screen(*this, "screen") , m_palette(*this, "palette") , m_outlatch(*this, "outlatch") + , m_novram(*this, "nov%u", 0U) , m_generic_paletteram_8(*this, "paletteram") { } @@ -227,6 +229,7 @@ private: required_device m_screen; required_device m_palette; required_device m_outlatch; + required_device_array m_novram; required_shared_ptr m_generic_paletteram_8; }; diff --git a/src/mame/machine/balsente.cpp b/src/mame/machine/balsente.cpp index ff2f54b27d0..d1d2740071f 100644 --- a/src/mame/machine/balsente.cpp +++ b/src/mame/machine/balsente.cpp @@ -312,7 +312,8 @@ WRITE_LINE_MEMBER(balsente_state::out6_w) WRITE_LINE_MEMBER(balsente_state::nvrecall_w) { - logerror("nvrecall_w=%d\n", state); + m_novram[0]->recall(!state); + m_novram[1]->recall(!state); } -- cgit v1.2.3