From 60da7d3bafbea7b5ee479bddd0a397fce214ffa7 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 13 Aug 2021 03:09:35 +1000 Subject: bus/a2bus/q68.cpp: Fixed various issues. * Fixed friended derived classes. * Added "a2" prefix to device short names uesd for crude namespacing. * Added the prefix header explicitly so it will build without PCH. * Fixed bizarre mixed space and tab indenting. --- src/devices/bus/a2bus/q68.cpp | 87 ++++++++++++++++++++++--------------------- src/devices/bus/a2bus/q68.h | 13 +++---- 2 files changed, 51 insertions(+), 49 deletions(-) diff --git a/src/devices/bus/a2bus/q68.cpp b/src/devices/bus/a2bus/q68.cpp index 68edb0a3a7f..102f35ef03f 100644 --- a/src/devices/bus/a2bus/q68.cpp +++ b/src/devices/bus/a2bus/q68.cpp @@ -38,9 +38,12 @@ *********************************************************************/ +#include "emu.h" #include "q68.h" + #include "cpu/m68000/m68000.h" + /*************************************************************************** PARAMETERS ***************************************************************************/ @@ -49,21 +52,21 @@ // GLOBAL VARIABLES //************************************************************************** -DEFINE_DEVICE_TYPE(A2BUS_Q68, a2bus_q68_device, "q68", "Stellation Two Q-68") -DEFINE_DEVICE_TYPE(A2BUS_Q68PLUS, a2bus_q68plus_device, "q68plus", "Stellation Two Q-68 Plus") +DEFINE_DEVICE_TYPE(A2BUS_Q68, a2bus_q68_device, "a2q68", "Stellation Two Q-68") +DEFINE_DEVICE_TYPE(A2BUS_Q68PLUS, a2bus_q68plus_device, "a2q68plus", "Stellation Two Q-68 Plus") void a2bus_q68_device::m68008_mem(address_map &map) { - map(0x00000, 0x0ffff).rw(FUNC(a2bus_68k_device::dma_r), FUNC(a2bus_68k_device::dma_w)); - map(0x10000, 0x11fff).mirror(0x6000).rom(); //8k debug rom - map(0x18000, 0x19fff).mirror(0x6000).ram(); //8k ram + map(0x00000, 0x0ffff).rw(FUNC(a2bus_q68_device::dma_r), FUNC(a2bus_q68_device::dma_w)); + map(0x10000, 0x11fff).mirror(0x6000).rom(); // 8k debug rom + map(0x18000, 0x19fff).mirror(0x6000).ram(); // 8k of ram } void a2bus_q68plus_device::m68008_mem(address_map &map) { - map(0x00000, 0x0ffff).rw(FUNC(a2bus_68k_device::dma_r), FUNC(a2bus_68k_device::dma_w)); - map(0x10000, 0x11fff).rom(); // 8k debug rom - map(0x12000, 0xfffff).ram(); // 1 MB of RAM + map(0x00000, 0x0ffff).rw(FUNC(a2bus_q68plus_device::dma_r), FUNC(a2bus_q68plus_device::dma_w)); + map(0x10000, 0x11fff).rom(); // 8k debug rom + map(0x12000, 0xfffff).ram(); // 1 MB of RAM } ROM_START( q68 ) @@ -193,25 +196,25 @@ void a2bus_68k_device::write_c0nx(uint8_t offset, uint8_t data) uint8_t a2bus_68k_device::dma_r(offs_t offset) { - if(m_bEnabled) - { - if (offset <= 0x03ff) //0x0000-0x03ff - { - return slot_dma_read(offset+0x800); - } - else if (offset <= 0x07ff) //0x0400-0x07ff - { - return slot_dma_read(offset); - } - else if (offset <= 0x0bff) //0x0800-0x0bff - { - return slot_dma_read(offset-0x800); - } - else if (offset <= 0xffff) //0x0c00-0xffff + if (m_bEnabled) { - return slot_dma_read(offset); + if (offset <= 0x03ff) //0x0000-0x03ff + { + return slot_dma_read(offset+0x800); + } + else if (offset <= 0x07ff) //0x0400-0x07ff + { + return slot_dma_read(offset); + } + else if (offset <= 0x0bff) //0x0800-0x0bff + { + return slot_dma_read(offset-0x800); + } + else if (offset <= 0xffff) //0x0c00-0xffff + { + return slot_dma_read(offset); + } } - } return 0xff; } @@ -222,23 +225,23 @@ uint8_t a2bus_68k_device::dma_r(offs_t offset) void a2bus_68k_device::dma_w(offs_t offset, uint8_t data) { - if(m_bEnabled) - { - if (offset <= 0x03ff) //0x0000-0x03ff - { - return slot_dma_write(offset+0x800, data); - } - else if (offset <= 0x07ff) //0x0400-0x07ff - { - return slot_dma_write(offset, data); - } - else if (offset <= 0x0bff) //0x0800-0x0bff - { - return slot_dma_write(offset-0x800, data); - } - else if (offset <= 0xffff) //0x0c00-0xffff + if (m_bEnabled) { - return slot_dma_write(offset, data); + if (offset <= 0x03ff) //0x0000-0x03ff + { + return slot_dma_write(offset+0x800, data); + } + else if (offset <= 0x07ff) //0x0400-0x07ff + { + return slot_dma_write(offset, data); + } + else if (offset <= 0x0bff) //0x0800-0x0bff + { + return slot_dma_write(offset-0x800, data); + } + else if (offset <= 0xffff) //0x0c00-0xffff + { + return slot_dma_write(offset, data); + } } - } } diff --git a/src/devices/bus/a2bus/q68.h b/src/devices/bus/a2bus/q68.h index b31a9d8a516..c52c9567bc9 100644 --- a/src/devices/bus/a2bus/q68.h +++ b/src/devices/bus/a2bus/q68.h @@ -23,9 +23,6 @@ class a2bus_68k_device: public device_t, public device_a2bus_card_interface { - friend class a2bus_q68_device; - friend class a2bus_q68plus_device; - protected: a2bus_68k_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -38,11 +35,11 @@ protected: virtual void write_c0nx(uint8_t offset, uint8_t data) override; virtual bool take_c800() override { return false; } - required_device m_m68008; - uint8_t dma_r(offs_t offset); void dma_w(offs_t offset, uint8_t data); + required_device m_m68008; + private: bool m_bEnabled; }; @@ -52,9 +49,10 @@ class a2bus_q68_device : public a2bus_68k_device public: a2bus_q68_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: virtual void device_add_mconfig(machine_config &config) override; - //virtual const tiny_rom_entry *device_rom_region() const override; +private: void m68008_mem(address_map &map); }; @@ -63,9 +61,10 @@ class a2bus_q68plus_device : public a2bus_68k_device public: a2bus_q68plus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: virtual void device_add_mconfig(machine_config &config) override; - //virtual const tiny_rom_entry *device_rom_region() const override; +private: void m68008_mem(address_map &map); }; -- cgit v1.2.3