summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
authorGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-12-01 12:02:53 -0500
committerGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-12-01 12:05:02 -0500
commit550b5bb87feca909ce411d67b6f632c0762c94b2 (patch)
tree47cd899f6bff75330f387c6c8282335085624337 /src/devices
parent679858e85dd5ac15da3cb795937111bce8873d69 (diff)
m6802, nsc8105: Internalize internal RAM (nw)
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/cpu/m6800/m6800.cpp16
-rw-r--r--src/devices/cpu/m6800/m6800.h8
-rw-r--r--src/devices/machine/swtpc8212.cpp1
3 files changed, 23 insertions, 2 deletions
diff --git a/src/devices/cpu/m6800/m6800.cpp b/src/devices/cpu/m6800/m6800.cpp
index 86b14810771..eaf193b4c77 100644
--- a/src/devices/cpu/m6800/m6800.cpp
+++ b/src/devices/cpu/m6800/m6800.cpp
@@ -348,13 +348,27 @@ m6802_cpu_device::m6802_cpu_device(const machine_config &mconfig, const char *ta
}
m6802_cpu_device::m6802_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const op_func *insn, const uint8_t *cycles)
- : m6800_cpu_device(mconfig, type, tag, owner, clock, insn, cycles, address_map_constructor())
+ : m6800_cpu_device(mconfig, type, tag, owner, clock, insn, cycles, address_map_constructor(FUNC(m6802_cpu_device::ram_map), this))
+ , m_ram_enable(true)
{
}
+void m6802_cpu_device::ram_map(address_map &map)
+{
+ if (m_ram_enable)
+ map(0x0000, 0x007f).ram();
+}
+
m6808_cpu_device::m6808_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: m6802_cpu_device(mconfig, M6808, tag, owner, clock, m6800_insn, cycles_6800)
{
+ set_ram_enable(false);
+}
+
+void m6808_cpu_device::device_validity_check(validity_checker &valid) const
+{
+ if (m_ram_enable)
+ osd_printf_error("MC6808 should not have internal RAM enabled\n");
}
nsc8105_cpu_device::nsc8105_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
diff --git a/src/devices/cpu/m6800/m6800.h b/src/devices/cpu/m6800/m6800.h
index 0e8ef732058..82131562637 100644
--- a/src/devices/cpu/m6800/m6800.h
+++ b/src/devices/cpu/m6800/m6800.h
@@ -368,12 +368,19 @@ class m6802_cpu_device : public m6800_cpu_device
public:
m6802_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ void set_ram_enable(bool re) { assert(!configured()); m_ram_enable = re; }
+
protected:
m6802_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const m6800_cpu_device::op_func *insn, const uint8_t *cycles);
virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 4 - 1) / 4; }
virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 4); }
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
+
+ bool m_ram_enable;
+
+private:
+ void ram_map(address_map &map);
};
@@ -384,6 +391,7 @@ public:
protected:
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
+ virtual void device_validity_check(validity_checker &valid) const override;
};
diff --git a/src/devices/machine/swtpc8212.cpp b/src/devices/machine/swtpc8212.cpp
index 3625e7a6225..bd7b33e23e9 100644
--- a/src/devices/machine/swtpc8212.cpp
+++ b/src/devices/machine/swtpc8212.cpp
@@ -421,7 +421,6 @@ void swtpc8212_device::device_reset()
void swtpc8212_device::mem_map(address_map &map)
{
- map(0x0000, 0x007f).ram();
map(0x0080, 0x0083).rw("pia0", FUNC(pia6821_device::read), FUNC(pia6821_device::write));
map(0x0088, 0x0088).w("crtc", FUNC(mc6845_device::address_w));
map(0x0089, 0x0089).rw("crtc", FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w));