summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/bbc/tube/tube_6502.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/bbc/tube/tube_6502.cpp')
-rw-r--r--src/devices/bus/bbc/tube/tube_6502.cpp125
1 files changed, 81 insertions, 44 deletions
diff --git a/src/devices/bus/bbc/tube/tube_6502.cpp b/src/devices/bus/bbc/tube/tube_6502.cpp
index 3aa3c6a1175..8120ab16812 100644
--- a/src/devices/bus/bbc/tube/tube_6502.cpp
+++ b/src/devices/bus/bbc/tube/tube_6502.cpp
@@ -6,6 +6,10 @@
http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Acorn_ANC01_65022ndproc.html
+ Acorn ADC06 65C102 Co-processor
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Acorn_ADC06_65C102CoPro.html
+
**********************************************************************/
@@ -18,7 +22,8 @@
// DEVICE DEFINITIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(BBC_TUBE_6502, bbc_tube_6502_device, "bbc_tube_6502", "Acorn 6502 2nd Processor")
+DEFINE_DEVICE_TYPE(BBC_TUBE_6502, bbc_tube_6502_device, "bbc_tube_6502", "Acorn 6502 2nd Processor")
+DEFINE_DEVICE_TYPE(BBC_TUBE_65C102, bbc_tube_65c102_device, "bbc_tube_65c102", "Acorn 65C102 Co-Processor")
//-------------------------------------------------
@@ -27,7 +32,17 @@ DEFINE_DEVICE_TYPE(BBC_TUBE_6502, bbc_tube_6502_device, "bbc_tube_6502", "Acorn
void bbc_tube_6502_device::tube_6502_mem(address_map &map)
{
- map(0x0000, 0xffff).rw(FUNC(bbc_tube_6502_device::read), FUNC(bbc_tube_6502_device::write));
+ map(0x0000, 0xffff).m(m_bankdev, FUNC(address_map_bank_device::amap8));
+ map(0xfef0, 0xfeff).rw(FUNC(bbc_tube_6502_device::tube_r), FUNC(bbc_tube_6502_device::tube_w));
+}
+
+void bbc_tube_6502_device::tube_6502_bank(address_map &map)
+{
+ // ROM enabled
+ map(0x00000, 0x0ffff).ram().share("ram");
+ map(0x0f000, 0x0ffff).rom().region("rom", 0);
+ // ROM disabled
+ map(0x10000, 0x1ffff).ram().share("ram");
}
//-------------------------------------------------
@@ -36,21 +51,33 @@ void bbc_tube_6502_device::tube_6502_mem(address_map &map)
ROM_START( tube_6502 )
ROM_REGION(0x1000, "rom", 0)
- ROM_LOAD("6502tube.rom", 0x0000, 0x1000, CRC(98b5fe42) SHA1(338269d03cf6bfa28e09d1651c273ea53394323b))
+ ROM_DEFAULT_BIOS("110")
+ ROM_SYSTEM_BIOS(0, "110", "Tube 1.10")
+ ROMX_LOAD("6502tube.rom", 0x0000, 0x1000, CRC(98b5fe42) SHA1(338269d03cf6bfa28e09d1651c273ea53394323b), ROM_BIOS(0))
+ ROM_SYSTEM_BIOS(1, "121", "Tube 1.21 (ReCo6502)")
+ ROMX_LOAD("reco6502tube.rom", 0x0000, 0x1000, CRC(75b2a466) SHA1(9ecef24de58a48c3fbe01b12888c3f6a5d24f57f), ROM_BIOS(1))
+ROM_END
+
+ROM_START( tube_65c102 )
+ ROM_REGION(0x1000, "rom", 0)
+ ROM_DEFAULT_BIOS("110")
+ ROM_SYSTEM_BIOS(0, "110", "Tube 1.10")
+ ROMX_LOAD("65c102_boot_110.rom", 0x0000, 0x1000, CRC(ad5b70cc) SHA1(0ac9a1c70e55a79e2c81e102afae1d016af229fa), ROM_BIOS(0)) // 2201,243-02
+ ROM_SYSTEM_BIOS(1, "121", "Tube 1.21 (ReCo6502)")
+ ROMX_LOAD("reco6502tube.rom", 0x0000, 0x1000, CRC(75b2a466) SHA1(9ecef24de58a48c3fbe01b12888c3f6a5d24f57f), ROM_BIOS(1))
ROM_END
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
-void bbc_tube_6502_device::device_add_mconfig(machine_config &config)
+void bbc_tube_6502_device::add_common_devices(machine_config &config)
{
- M65C02(config, m_m6502, 12_MHz_XTAL / 4);
- m_m6502->set_addrmap(AS_PROGRAM, &bbc_tube_6502_device::tube_6502_mem);
+ ADDRESS_MAP_BANK(config, m_bankdev).set_map(&bbc_tube_6502_device::tube_6502_bank).set_options(ENDIANNESS_LITTLE, 8, 17, 0x10000);
TUBE(config, m_ula);
- m_ula->pnmi_handler().set_inputline(m_m6502, M65C02_NMI_LINE);
- m_ula->pirq_handler().set_inputline(m_m6502, M65C02_IRQ_LINE);
+ m_ula->pnmi_handler().set_inputline(m_maincpu, M65C02_NMI_LINE);
+ m_ula->pirq_handler().set_inputline(m_maincpu, M65C02_IRQ_LINE);
/* internal ram */
RAM(config, m_ram).set_default_size("64K").set_default_value(0);
@@ -60,6 +87,22 @@ void bbc_tube_6502_device::device_add_mconfig(machine_config &config)
SOFTWARE_LIST(config, "flop_ls_65c102").set_original("bbc_flop_65c102");
}
+void bbc_tube_6502_device::device_add_mconfig(machine_config &config)
+{
+ M65C02(config, m_maincpu, 12_MHz_XTAL / 4);
+ m_maincpu->set_addrmap(AS_PROGRAM, &bbc_tube_6502_device::tube_6502_mem);
+
+ add_common_devices(config);
+}
+
+void bbc_tube_65c102_device::device_add_mconfig(machine_config &config)
+{
+ M65C02(config, m_maincpu, 16_MHz_XTAL / 4);
+ m_maincpu->set_addrmap(AS_PROGRAM, &bbc_tube_65c102_device::tube_6502_mem);
+
+ add_common_devices(config);
+}
+
//-------------------------------------------------
// rom_region - device-specific ROM region
//-------------------------------------------------
@@ -69,6 +112,11 @@ const tiny_rom_entry *bbc_tube_6502_device::device_rom_region() const
return ROM_NAME( tube_6502 );
}
+const tiny_rom_entry *bbc_tube_65c102_device::device_rom_region() const
+{
+ return ROM_NAME( tube_65c102 );
+}
+
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -77,14 +125,24 @@ const tiny_rom_entry *bbc_tube_6502_device::device_rom_region() const
// bbc_tube_6502_device - constructor
//-------------------------------------------------
+bbc_tube_6502_device::bbc_tube_6502_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_maincpu(*this, "maincpu")
+ , m_bankdev(*this, "bankdev")
+ , m_ula(*this, "ula")
+ , m_ram(*this, "ram")
+ , m_rom(*this, "rom")
+{
+}
+
bbc_tube_6502_device::bbc_tube_6502_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, BBC_TUBE_6502, tag, owner, clock),
- device_bbc_tube_interface(mconfig, *this),
- m_m6502(*this, "m6502"),
- m_ula(*this, "ula"),
- m_ram(*this, "ram"),
- m_rom(*this, "rom"),
- m_rom_enabled(true)
+ : bbc_tube_6502_device(mconfig, BBC_TUBE_6502, tag, owner, clock)
+{
+}
+
+bbc_tube_65c102_device::bbc_tube_65c102_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_tube_6502_device(mconfig, BBC_TUBE_65C102, tag, owner, clock)
{
}
@@ -94,7 +152,6 @@ bbc_tube_6502_device::bbc_tube_6502_device(const machine_config &mconfig, const
void bbc_tube_6502_device::device_start()
{
- m_slot = dynamic_cast<bbc_tube_slot_device *>(owner());
}
//-------------------------------------------------
@@ -103,9 +160,7 @@ void bbc_tube_6502_device::device_start()
void bbc_tube_6502_device::device_reset()
{
- m_ula->reset();
-
- m_rom_enabled = true;
+ m_bankdev->set_bank(0);
}
@@ -124,34 +179,16 @@ WRITE8_MEMBER(bbc_tube_6502_device::host_w)
}
-READ8_MEMBER(bbc_tube_6502_device::read)
+READ8_MEMBER(bbc_tube_6502_device::tube_r)
{
- uint8_t data;
+ // Disable ROM on first access
+ if (!machine().side_effects_disabled())
+ m_bankdev->set_bank(1);
- if (offset >= 0xfef0 && offset <= 0xfeff)
- {
- if (!machine().side_effects_disabled()) m_rom_enabled = false;
- data = m_ula->parasite_r(space, offset);
- }
- else if (m_rom_enabled && (offset >= 0xf000))
- {
- data = m_rom->base()[offset & 0xfff];
- }
- else
- {
- data = m_ram->pointer()[offset];
- }
- return data;
+ return m_ula->parasite_r(space, offset);
}
-WRITE8_MEMBER(bbc_tube_6502_device::write)
+WRITE8_MEMBER(bbc_tube_6502_device::tube_w)
{
- if (offset >= 0xfef0 && offset <= 0xfeff)
- {
- m_ula->parasite_w(space, offset, data);
- }
- else
- {
- m_ram->pointer()[offset] = data;
- }
+ m_ula->parasite_w(space, offset, data);
}