From 548bf7a247526a0fdfb119521056d7bf4863687d Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 6 Apr 2023 18:00:03 -0400 Subject: cdd2000: Add ROM banking to prevent code from running off rails --- src/devices/bus/nscsi/cdd2000.cpp | 10 +++++++++- src/devices/bus/nscsi/cdd2000.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/devices/bus/nscsi/cdd2000.cpp b/src/devices/bus/nscsi/cdd2000.cpp index 60c5c72b97e..1a1229a21b8 100644 --- a/src/devices/bus/nscsi/cdd2000.cpp +++ b/src/devices/bus/nscsi/cdd2000.cpp @@ -17,18 +17,25 @@ cdd2000_device::cdd2000_device(const machine_config &mconfig, const char *tag, d : device_t(mconfig, CDD2000, tag, owner, clock) , nscsi_slot_card_interface(mconfig, *this, "scsic") , m_cdcpu(*this, "cdcpu") + , m_rombank(*this, "bank") { } void cdd2000_device::device_start() { + m_rombank->configure_entries(0, 4, memregion("flash")->base() + 0x1000, 0x10000); +} + +void cdd2000_device::device_reset() +{ + m_rombank->set_entry(3); // FIXME: MC68HC11 core should take care of this } void cdd2000_device::mem_map(address_map &map) { map(0x0400, 0x040f).m("scsic", FUNC(ncr53cf94_device::map)); // 0x0800, 0x080f is another device - map(0x1000, 0xffff).rom().region("flash", 0x31000); // TODO: banking + map(0x1000, 0xffff).bankr(m_rombank); map(0x2000, 0x3fff).ram(); } @@ -37,6 +44,7 @@ void cdd2000_device::device_add_mconfig(machine_config &config) mc68hc11f1_device &cdcpu(MC68HC11F1(config, m_cdcpu, 8'000'000)); // type and clock guessed cdcpu.set_addrmap(AS_PROGRAM, &cdd2000_device::mem_map); cdcpu.set_default_config(0x0b); + cdcpu.out_pa_callback().set_membank(m_rombank).mask(0x60).rshift(5); NCR53CF94(config, "scsic", 25'000'000); // type and clock guessed } diff --git a/src/devices/bus/nscsi/cdd2000.h b/src/devices/bus/nscsi/cdd2000.h index 8f2b6eb6a20..546e4dfa96f 100644 --- a/src/devices/bus/nscsi/cdd2000.h +++ b/src/devices/bus/nscsi/cdd2000.h @@ -17,6 +17,7 @@ public: protected: virtual void device_start() override; + virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override; virtual const tiny_rom_entry *device_rom_region() const override; @@ -24,6 +25,7 @@ private: void mem_map(address_map &map); required_device m_cdcpu; + required_memory_bank m_rombank; }; DECLARE_DEVICE_TYPE(CDD2000, cdd2000_device) -- cgit v1.2.3