summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2019-04-04 22:44:30 -0400
committer AJR <ajrhacker@users.noreply.github.com>2019-04-04 22:45:04 -0400
commit6b09b02f7e503a11699fda2de5a7d3d356e3d36f (patch)
tree4c091568028716dea7e5c1b5480b90868db7770e
parentbda6a83a492f5d3112f55e8d6d9f2f0d1a14576d (diff)
aztarac: Tie spaces together for interrupt vectoring; derive clocks from XTAL; use X2212 for NVRAM (nw)
-rw-r--r--src/mame/drivers/aztarac.cpp39
-rw-r--r--src/mame/includes/aztarac.h9
2 files changed, 25 insertions, 23 deletions
diff --git a/src/mame/drivers/aztarac.cpp b/src/mame/drivers/aztarac.cpp
index 65b66adb159..7298469af14 100644
--- a/src/mame/drivers/aztarac.cpp
+++ b/src/mame/drivers/aztarac.cpp
@@ -20,7 +20,6 @@
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
-#include "machine/nvram.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "speaker.h"
@@ -32,15 +31,15 @@
*
*************************************/
-IRQ_CALLBACK_MEMBER(aztarac_state::irq_callback)
+void aztarac_state::machine_start()
{
- return 0xc;
+ save_item(NAME(m_sound_status));
}
-
-void aztarac_state::machine_start()
+void aztarac_state::machine_reset()
{
- save_item(NAME(m_sound_status));
+ m_nvram->recall(1);
+ m_nvram->recall(0);
}
@@ -51,9 +50,10 @@ void aztarac_state::machine_start()
*
*************************************/
-READ16_MEMBER(aztarac_state::nvram_r)
+void aztarac_state::nvram_store_w(uint16_t data)
{
- return m_nvram[offset] | 0xfff0;
+ m_nvram->store(1);
+ m_nvram->store(0);
}
@@ -81,7 +81,8 @@ READ16_MEMBER(aztarac_state::joystick_r)
void aztarac_state::main_map(address_map &map)
{
map(0x000000, 0x00bfff).rom();
- map(0x022000, 0x0220ff).r(FUNC(aztarac_state::nvram_r)).writeonly().share("nvram");
+ map(0x021000, 0x021001).w(FUNC(aztarac_state::nvram_store_w));
+ map(0x022000, 0x0221ff).rw(m_nvram, FUNC(x2212_device::read), FUNC(x2212_device::write)).umask16(0x00ff);
map(0x027000, 0x027001).r(FUNC(aztarac_state::joystick_r));
map(0x027004, 0x027005).portr("INPUTS");
map(0x027008, 0x027009).rw(FUNC(aztarac_state::sound_r), FUNC(aztarac_state::sound_w));
@@ -152,16 +153,16 @@ INPUT_PORTS_END
void aztarac_state::aztarac(machine_config &config)
{
/* basic machine hardware */
- M68000(config, m_maincpu, 8000000);
- m_maincpu->set_addrmap(AS_PROGRAM, &aztarac_state::main_map);
- m_maincpu->set_vblank_int("screen", FUNC(aztarac_state::irq4_line_hold));
- m_maincpu->set_irq_acknowledge_callback(FUNC(aztarac_state::irq_callback));
+ m68000_device &maincpu(M68000(config, m_maincpu, 16_MHz_XTAL / 2));
+ maincpu.set_addrmap(AS_PROGRAM, &aztarac_state::main_map);
+ maincpu.set_vblank_int("screen", FUNC(aztarac_state::irq4_line_hold));
+ maincpu.set_cpu_space(AS_PROGRAM);
- Z80(config, m_audiocpu, 2000000);
+ Z80(config, m_audiocpu, 16_MHz_XTAL / 8);
m_audiocpu->set_addrmap(AS_PROGRAM, &aztarac_state::sound_map);
m_audiocpu->set_periodic_int(FUNC(aztarac_state::snd_timed_irq), attotime::from_hz(100));
- NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
+ X2212(config, m_nvram);
WATCHDOG_TIMER(config, "watchdog");
@@ -179,13 +180,13 @@ void aztarac_state::aztarac(machine_config &config)
GENERIC_LATCH_8(config, m_soundlatch);
- AY8910(config, "ay1", 2000000).add_route(ALL_OUTPUTS, "mono", 0.15);
+ AY8910(config, "ay1", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15);
- AY8910(config, "ay2", 2000000).add_route(ALL_OUTPUTS, "mono", 0.15);
+ AY8910(config, "ay2", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15);
- AY8910(config, "ay3", 2000000).add_route(ALL_OUTPUTS, "mono", 0.15);
+ AY8910(config, "ay3", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15);
- AY8910(config, "ay4", 2000000).add_route(ALL_OUTPUTS, "mono", 0.15);
+ AY8910(config, "ay4", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15);
}
diff --git a/src/mame/includes/aztarac.h b/src/mame/includes/aztarac.h
index 107c8a071dd..61110cbf21b 100644
--- a/src/mame/includes/aztarac.h
+++ b/src/mame/includes/aztarac.h
@@ -7,6 +7,7 @@
*************************************************************************/
#include "machine/gen_latch.h"
+#include "machine/x2212.h"
#include "video/vector.h"
#include "screen.h"
@@ -17,26 +18,26 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
+ m_nvram(*this, "nvram"),
m_vector(*this, "vector"),
m_screen(*this, "screen"),
m_soundlatch(*this, "soundlatch"),
- m_nvram(*this, "nvram") ,
m_vectorram(*this, "vectorram") { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<x2212_device> m_nvram;
required_device<vector_device> m_vector;
required_device<screen_device> m_screen;
required_device<generic_latch_8_device> m_soundlatch;
- required_shared_ptr<uint16_t> m_nvram;
required_shared_ptr<uint16_t> m_vectorram;
int m_sound_status;
int m_xcenter;
int m_ycenter;
- DECLARE_READ16_MEMBER(nvram_r);
+ void nvram_store_w(uint16_t data);
DECLARE_READ16_MEMBER(joystick_r);
DECLARE_WRITE16_MEMBER(ubr_w);
DECLARE_READ16_MEMBER(sound_r);
@@ -46,10 +47,10 @@ public:
DECLARE_WRITE8_MEMBER(snd_status_w);
virtual void machine_start() override;
+ virtual void machine_reset() override;
virtual void video_start() override;
INTERRUPT_GEN_MEMBER(snd_timed_irq);
- IRQ_CALLBACK_MEMBER(irq_callback);
inline void read_vectorram(uint16_t *vectorram, int addr, int *x, int *y, int *c);
void aztarac(machine_config &config);