summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/quantum.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/quantum.cpp')
-rw-r--r--src/mame/drivers/quantum.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mame/drivers/quantum.cpp b/src/mame/drivers/quantum.cpp
index 6954e966ff8..40ebdbb09e8 100644
--- a/src/mame/drivers/quantum.cpp
+++ b/src/mame/drivers/quantum.cpp
@@ -54,8 +54,8 @@ NOTE: The Atari 136002-125 PROM in the sets below wasn't dumped from an actual
#include "video/avgdvg.h"
#include "sound/pokey.h"
#include "sound/discrete.h"
-#include "machine/nvram.h"
#include "machine/watchdog.h"
+#include "machine/x2212.h"
#include "screen.h"
#include "speaker.h"
@@ -67,6 +67,7 @@ public:
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_avg(*this, "avg"),
+ m_nvram(*this, "nvram"),
m_leds(*this, "led%u", 0U)
{ }
@@ -76,6 +77,7 @@ protected:
virtual void machine_start() override { m_leds.resolve(); }
DECLARE_READ16_MEMBER(trackball_r);
DECLARE_WRITE16_MEMBER(led_w);
+ DECLARE_WRITE16_MEMBER(nvram_recall_w);
DECLARE_READ8_MEMBER(input_1_r);
DECLARE_READ8_MEMBER(input_2_r);
void main_map(address_map &map);
@@ -83,6 +85,7 @@ protected:
private:
required_device<cpu_device> m_maincpu;
required_device<avg_quantum_device> m_avg;
+ required_device<x2212_device> m_nvram;
output_finder<2> m_leds;
};
@@ -130,6 +133,8 @@ WRITE16_MEMBER(quantum_state::led_w)
machine().bookkeeping().coin_counter_w(0, data & 2);
machine().bookkeeping().coin_counter_w(1, data & 1);
+ m_nvram->store(BIT(data, 2));
+
/* bit 3 = select second trackball for cocktail mode? */
/* bits 4 and 5 are LED controls */
@@ -142,6 +147,12 @@ WRITE16_MEMBER(quantum_state::led_w)
}
}
+WRITE16_MEMBER(quantum_state::nvram_recall_w)
+{
+ m_nvram->recall(1);
+ m_nvram->recall(0);
+}
+
/*************************************
@@ -157,12 +168,12 @@ void quantum_state::main_map(address_map &map)
map(0x800000, 0x801fff).ram().share("vectorram");
map(0x840000, 0x84001f).rw("pokey1", FUNC(pokey_device::read), FUNC(pokey_device::write)).umask16(0x00ff);
map(0x840020, 0x84003f).rw("pokey2", FUNC(pokey_device::read), FUNC(pokey_device::write)).umask16(0x00ff);
- map(0x900000, 0x9001ff).ram().share("nvram");
+ map(0x900000, 0x9001ff).rw("nvram", FUNC(x2212_device::read), FUNC(x2212_device::write)).umask16(0x00ff);
map(0x940000, 0x940001).r(this, FUNC(quantum_state::trackball_r)); /* trackball */
map(0x948000, 0x948001).portr("SYSTEM");
map(0x950000, 0x95001f).writeonly().share("colorram");
map(0x958000, 0x958001).w(this, FUNC(quantum_state::led_w));
- map(0x960000, 0x960001).nopw();
+ map(0x960000, 0x960001).w(this, FUNC(quantum_state::nvram_recall_w));
map(0x968000, 0x968001).w(m_avg, FUNC(avg_quantum_device::reset_word_w));
map(0x970000, 0x970001).w(m_avg, FUNC(avg_quantum_device::go_word_w));
map(0x978000, 0x978001).nopr().w("watchdog", FUNC(watchdog_timer_device::reset16_w));
@@ -282,7 +293,7 @@ MACHINE_CONFIG_START(quantum_state::quantum)
MCFG_DEVICE_PROGRAM_MAP(main_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(quantum_state, irq1_line_hold, CLOCK_3KHZ / 12)
- MCFG_NVRAM_ADD_1FILL("nvram")
+ MCFG_X2212_ADD("nvram") // "137288-001" in parts list and schematic diagram
MCFG_WATCHDOG_ADD("watchdog")