diff options
author | 2020-07-13 13:10:09 +0100 | |
---|---|---|
committer | 2020-07-13 14:34:32 +0100 | |
commit | 52c23aba52a93094d90049269e8c428c1a979a4d (patch) | |
tree | c0f6d08f0f1497007045dc20dbc4edc3b6701a92 | |
parent | d6cbfb3814dedd6d1ccbd4980786e2f4dd30d19b (diff) |
bus/bbc/tube: Added Acorn Z80 2nd Processor (Winchester) device.
-rw-r--r-- | src/devices/bus/bbc/tube/tube.cpp | 2 | ||||
-rw-r--r-- | src/devices/bus/bbc/tube/tube_z80.cpp | 61 | ||||
-rw-r--r-- | src/devices/bus/bbc/tube/tube_z80.h | 19 |
3 files changed, 56 insertions, 26 deletions
diff --git a/src/devices/bus/bbc/tube/tube.cpp b/src/devices/bus/bbc/tube/tube.cpp index adee8e33373..12e1c3294d0 100644 --- a/src/devices/bus/bbc/tube/tube.cpp +++ b/src/devices/bus/bbc/tube/tube.cpp @@ -111,6 +111,7 @@ void bbc_tube_devices(device_slot_interface &device) { device.option_add("6502", BBC_TUBE_6502); /* Acorn ANC01 6502 2nd processor */ device.option_add("z80", BBC_TUBE_Z80); /* Acorn ANC04 Z80 2nd processor */ + device.option_add("z80w", BBC_TUBE_Z80W); /* Acorn ANC04 Z80 2nd processor (Winchester) */ device.option_add("32016", BBC_TUBE_32016); /* Acorn ANC05 32016 2nd processor */ device.option_add("arm", BBC_TUBE_ARM); /* Acorn ANC13 ARM Evaluation System */ device.option_add("80286", BBC_TUBE_80286); /* Acorn 80286 2nd Processor */ @@ -139,6 +140,7 @@ void bbc_extube_devices(device_slot_interface &device) { device.option_add("6502", BBC_TUBE_6502); /* Acorn ANC01 6502 2nd processor */ device.option_add("z80", BBC_TUBE_Z80); /* Acorn ANC04 Z80 2nd processor */ + device.option_add("z80w", BBC_TUBE_Z80W); /* Acorn ANC04 Z80 2nd processor (Winchester) */ device.option_add("32016", BBC_TUBE_32016); /* Acorn ANC05 32016 2nd processor */ device.option_add("arm", BBC_TUBE_ARM); /* Acorn ANC13 ARM Evaluation System */ device.option_add("80286", BBC_TUBE_80286); /* Acorn 80286 2nd Processor */ diff --git a/src/devices/bus/bbc/tube/tube_z80.cpp b/src/devices/bus/bbc/tube/tube_z80.cpp index 8704a1ee771..d6c65c64812 100644 --- a/src/devices/bus/bbc/tube/tube_z80.cpp +++ b/src/devices/bus/bbc/tube/tube_z80.cpp @@ -19,6 +19,7 @@ //************************************************************************** DEFINE_DEVICE_TYPE(BBC_TUBE_Z80, bbc_tube_z80_device, "bbc_tube_z80", "Acorn Z80 2nd Processor") +DEFINE_DEVICE_TYPE(BBC_TUBE_Z80W, bbc_tube_z80w_device, "bbc_tube_z80w", "Acorn Z80 2nd Processor (Winchester)") //------------------------------------------------- @@ -54,7 +55,14 @@ void bbc_tube_z80_device::tube_z80_io(address_map &map) ROM_START( tube_z80 ) ROM_REGION(0x1000, "rom", 0) - ROM_LOAD("z80_120.rom", 0x0000, 0x1000, CRC(315bfc20) SHA1(069077df498599a9c880d4ec9f4bc53fcc602d82)) + ROM_SYSTEM_BIOS(0, "120", "Z80 v1.20") + ROMX_LOAD("z80_120.rom", 0x0000, 0x1000, CRC(315bfc20) SHA1(069077df498599a9c880d4ec9f4bc53fcc602d82), ROM_BIOS(0)) +ROM_END + +ROM_START( tube_z80w ) + ROM_REGION(0x1000, "rom", 0) + ROM_SYSTEM_BIOS(0, "200", "Z80 v2.00") /* supplied with Acorn Business Computer */ + ROMX_LOAD("z80_200.rom", 0x0000, 0x1000, CRC(84672c3d) SHA1(47211cead3a1b0f9830dcdef8e54e29522c69bf8), ROM_BIOS(0)) ROM_END //------------------------------------------------- @@ -71,12 +79,9 @@ void bbc_tube_z80_device::device_add_mconfig(machine_config &config) TUBE(config, m_ula); m_ula->hirq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_tube_slot_device::irq_w)); - m_ula->pnmi_handler().set(FUNC(bbc_tube_z80_device::nmi_w)); + m_ula->pnmi_handler().set_inputline(m_z80, INPUT_LINE_NMI); m_ula->pirq_handler().set_inputline(m_z80, INPUT_LINE_IRQ0); - /* internal ram */ - RAM(config, m_ram).set_default_size("64K").set_default_value(0); - /* software lists */ SOFTWARE_LIST(config, "flop_ls_z80").set_original("bbc_flop_z80"); } @@ -90,6 +95,11 @@ const tiny_rom_entry *bbc_tube_z80_device::device_rom_region() const return ROM_NAME( tube_z80 ); } +const tiny_rom_entry* bbc_tube_z80w_device::device_rom_region() const +{ + return ROM_NAME( tube_z80w ); +} + //************************************************************************** // LIVE DEVICE //************************************************************************** @@ -98,14 +108,23 @@ const tiny_rom_entry *bbc_tube_z80_device::device_rom_region() const // bbc_tube_z80_device - constructor //------------------------------------------------- -bbc_tube_z80_device::bbc_tube_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, BBC_TUBE_Z80, tag, owner, clock), - device_bbc_tube_interface(mconfig, *this), - m_z80(*this, "z80"), - m_ula(*this, "ula"), - m_ram(*this, "ram"), - m_rom(*this, "rom"), - m_rom_enabled(true) +bbc_tube_z80_device::bbc_tube_z80_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock) + , device_bbc_tube_interface(mconfig, *this) + , m_z80(*this, "z80") + , m_ula(*this, "ula") + , m_rom(*this, "rom") + , m_rom_enabled(true) +{ +} + +bbc_tube_z80_device::bbc_tube_z80_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) + : bbc_tube_z80_device(mconfig, BBC_TUBE_Z80, tag, owner, clock) +{ +} + +bbc_tube_z80w_device::bbc_tube_z80w_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) + : bbc_tube_z80_device(mconfig, BBC_TUBE_Z80W, tag, owner, clock) { } @@ -115,7 +134,10 @@ bbc_tube_z80_device::bbc_tube_z80_device(const machine_config &mconfig, const ch void bbc_tube_z80_device::device_start() { - m_slot = dynamic_cast<bbc_tube_slot_device *>(owner()); + m_ram = std::make_unique<uint8_t[]>(0x10000); + + /* register for save states */ + save_pointer(NAME(m_ram), 0x100000); } //------------------------------------------------- @@ -124,8 +146,6 @@ void bbc_tube_z80_device::device_start() void bbc_tube_z80_device::device_reset() { - m_ula->reset(); - m_rom_enabled = true; } @@ -165,19 +185,14 @@ uint8_t bbc_tube_z80_device::mem_r(offs_t offset) if (m_rom_enabled && (offset < 0x1000)) data = m_rom->base()[offset & 0xfff]; else - data = m_ram->pointer()[offset]; + data = m_ram[offset]; return data; } void bbc_tube_z80_device::mem_w(offs_t offset, uint8_t data) { - m_ram->pointer()[offset] = data; -} - -WRITE_LINE_MEMBER(bbc_tube_z80_device::nmi_w) -{ - m_z80->set_input_line(INPUT_LINE_NMI, state); + m_ram[offset] = data; } diff --git a/src/devices/bus/bbc/tube/tube_z80.h b/src/devices/bus/bbc/tube/tube_z80.h index 536e506d43d..a3ef1c2303f 100644 --- a/src/devices/bus/bbc/tube/tube_z80.h +++ b/src/devices/bus/bbc/tube/tube_z80.h @@ -14,7 +14,6 @@ #include "tube.h" #include "cpu/z80/z80.h" -#include "machine/ram.h" #include "machine/tube.h" //************************************************************************** @@ -32,6 +31,8 @@ public: bbc_tube_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: + bbc_tube_z80_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock); + // device-level overrides virtual void device_start() override; virtual void device_reset() override; @@ -45,13 +46,13 @@ protected: private: IRQ_CALLBACK_MEMBER( irq_callback ); - DECLARE_WRITE_LINE_MEMBER( nmi_w ); required_device<cpu_device> m_z80; required_device<tube_device> m_ula; - required_device<ram_device> m_ram; required_memory_region m_rom; + std::unique_ptr<uint8_t[]> m_ram; + bool m_rom_enabled; uint8_t mem_r(offs_t offset); @@ -64,8 +65,20 @@ private: }; +class bbc_tube_z80w_device : public bbc_tube_z80_device +{ +public: + bbc_tube_z80w_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock); + +protected: + // optional information overrides + virtual const tiny_rom_entry* device_rom_region() const override; +}; + + // device type definition DECLARE_DEVICE_TYPE(BBC_TUBE_Z80, bbc_tube_z80_device) +DECLARE_DEVICE_TYPE(BBC_TUBE_Z80W, bbc_tube_z80w_device) #endif /* MAME_BUS_BBC_TUBE_Z80_H */ |