summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/bbc
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/bbc')
-rw-r--r--src/devices/bus/bbc/1mhzbus/1mhzbus.cpp19
-rw-r--r--src/devices/bus/bbc/1mhzbus/1mhzbus.h16
-rw-r--r--src/devices/bus/bbc/1mhzbus/beebsid.cpp20
-rw-r--r--src/devices/bus/bbc/1mhzbus/beebsid.h8
-rw-r--r--src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp2
-rw-r--r--src/devices/bus/bbc/1mhzbus/cfa3000opt.h2
-rw-r--r--src/devices/bus/bbc/1mhzbus/emrmidi.cpp8
-rw-r--r--src/devices/bus/bbc/1mhzbus/emrmidi.h4
-rw-r--r--src/devices/bus/bbc/1mhzbus/ieee488.cpp113
-rw-r--r--src/devices/bus/bbc/1mhzbus/ieee488.h16
-rw-r--r--src/devices/bus/bbc/1mhzbus/m2000.cpp28
-rw-r--r--src/devices/bus/bbc/1mhzbus/m2000.h8
-rw-r--r--src/devices/bus/bbc/1mhzbus/opus3.cpp8
-rw-r--r--src/devices/bus/bbc/1mhzbus/opus3.h8
-rw-r--r--src/devices/bus/bbc/1mhzbus/sprite.cpp99
-rw-r--r--src/devices/bus/bbc/1mhzbus/sprite.h49
-rw-r--r--src/devices/bus/bbc/exp/exp.cpp32
-rw-r--r--src/devices/bus/bbc/exp/exp.h34
-rw-r--r--src/devices/bus/bbc/exp/mertec.cpp34
-rw-r--r--src/devices/bus/bbc/exp/mertec.h18
-rw-r--r--src/devices/bus/bbc/fdc/acorn.cpp16
-rw-r--r--src/devices/bus/bbc/fdc/acorn.h8
-rw-r--r--src/devices/bus/bbc/fdc/ams.cpp12
-rw-r--r--src/devices/bus/bbc/fdc/ams.h4
-rw-r--r--src/devices/bus/bbc/fdc/cumana.cpp4
-rw-r--r--src/devices/bus/bbc/fdc/cumana.h4
-rw-r--r--src/devices/bus/bbc/fdc/cv1797.cpp4
-rw-r--r--src/devices/bus/bbc/fdc/cv1797.h4
-rw-r--r--src/devices/bus/bbc/fdc/fdc.cpp8
-rw-r--r--src/devices/bus/bbc/fdc/fdc.h8
-rw-r--r--src/devices/bus/bbc/fdc/microware.cpp4
-rw-r--r--src/devices/bus/bbc/fdc/microware.h4
-rw-r--r--src/devices/bus/bbc/fdc/opus.cpp14
-rw-r--r--src/devices/bus/bbc/fdc/opus.h8
-rw-r--r--src/devices/bus/bbc/fdc/watford.cpp8
-rw-r--r--src/devices/bus/bbc/fdc/watford.h8
-rw-r--r--src/devices/bus/bbc/joyport/joyport.cpp8
-rw-r--r--src/devices/bus/bbc/joyport/joyport.h8
-rw-r--r--src/devices/bus/bbc/joyport/joystick.cpp2
-rw-r--r--src/devices/bus/bbc/joyport/joystick.h2
-rw-r--r--src/devices/bus/bbc/rom/dfs.cpp63
-rw-r--r--src/devices/bus/bbc/rom/dfs.h42
-rw-r--r--src/devices/bus/bbc/rom/pal.cpp312
-rw-r--r--src/devices/bus/bbc/rom/pal.h167
-rw-r--r--src/devices/bus/bbc/rom/ram.cpp57
-rw-r--r--src/devices/bus/bbc/rom/ram.h42
-rw-r--r--src/devices/bus/bbc/rom/rom.cpp50
-rw-r--r--src/devices/bus/bbc/rom/rom.h41
-rw-r--r--src/devices/bus/bbc/rom/rtc.cpp124
-rw-r--r--src/devices/bus/bbc/rom/rtc.h72
-rw-r--r--src/devices/bus/bbc/rom/slot.cpp234
-rw-r--r--src/devices/bus/bbc/rom/slot.h155
-rw-r--r--src/devices/bus/bbc/tube/tube.cpp20
-rw-r--r--src/devices/bus/bbc/tube/tube.h8
-rw-r--r--src/devices/bus/bbc/tube/tube_32016.cpp210
-rw-r--r--src/devices/bus/bbc/tube/tube_32016.h71
-rw-r--r--src/devices/bus/bbc/tube/tube_6502.cpp16
-rw-r--r--src/devices/bus/bbc/tube/tube_6502.h8
-rw-r--r--src/devices/bus/bbc/tube/tube_80186.cpp8
-rw-r--r--src/devices/bus/bbc/tube/tube_80186.h4
-rw-r--r--src/devices/bus/bbc/tube/tube_80286.cpp15
-rw-r--r--src/devices/bus/bbc/tube/tube_80286.h8
-rw-r--r--src/devices/bus/bbc/tube/tube_arm.cpp12
-rw-r--r--src/devices/bus/bbc/tube/tube_arm.h8
-rw-r--r--src/devices/bus/bbc/tube/tube_casper.cpp4
-rw-r--r--src/devices/bus/bbc/tube/tube_casper.h4
-rw-r--r--src/devices/bus/bbc/tube/tube_rc6502.cpp12
-rw-r--r--src/devices/bus/bbc/tube/tube_rc6502.h8
-rw-r--r--src/devices/bus/bbc/tube/tube_z80.cpp14
-rw-r--r--src/devices/bus/bbc/tube/tube_z80.h10
-rw-r--r--src/devices/bus/bbc/tube/tube_zep100.cpp18
-rw-r--r--src/devices/bus/bbc/tube/tube_zep100.h18
-rw-r--r--src/devices/bus/bbc/userport/beebspch.cpp2
-rw-r--r--src/devices/bus/bbc/userport/beebspch.h2
-rw-r--r--src/devices/bus/bbc/userport/cfa3000kbd.cpp2
-rw-r--r--src/devices/bus/bbc/userport/cfa3000kbd.h2
-rw-r--r--src/devices/bus/bbc/userport/pointer.cpp6
-rw-r--r--src/devices/bus/bbc/userport/pointer.h6
-rw-r--r--src/devices/bus/bbc/userport/userport.cpp8
-rw-r--r--src/devices/bus/bbc/userport/userport.h8
80 files changed, 2167 insertions, 368 deletions
diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
index 43cabfdfec3..41e9bc0e8cb 100644
--- a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
+++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
@@ -92,18 +92,18 @@ void bbc_1mhzbus_slot_device::device_reset()
// read
//-------------------------------------------------
-READ8_MEMBER(bbc_1mhzbus_slot_device::fred_r)
+uint8_t bbc_1mhzbus_slot_device::fred_r(offs_t offset)
{
if (m_card)
- return m_card->fred_r(space, offset);
+ return m_card->fred_r(offset);
else
return 0xff;
}
-READ8_MEMBER(bbc_1mhzbus_slot_device::jim_r)
+uint8_t bbc_1mhzbus_slot_device::jim_r(offs_t offset)
{
if (m_card)
- return m_card->jim_r(space, offset);
+ return m_card->jim_r(offset);
else
return 0xff;
}
@@ -112,16 +112,16 @@ READ8_MEMBER(bbc_1mhzbus_slot_device::jim_r)
// write
//-------------------------------------------------
-WRITE8_MEMBER(bbc_1mhzbus_slot_device::fred_w)
+void bbc_1mhzbus_slot_device::fred_w(offs_t offset, uint8_t data)
{
if (m_card)
- m_card->fred_w(space, offset, data);
+ m_card->fred_w(offset, data);
}
-WRITE8_MEMBER(bbc_1mhzbus_slot_device::jim_w)
+void bbc_1mhzbus_slot_device::jim_w(offs_t offset, uint8_t data)
{
if (m_card)
- m_card->jim_w(space, offset, data);
+ m_card->jim_w(offset, data);
}
//-------------------------------------------------
@@ -142,6 +142,7 @@ WRITE8_MEMBER(bbc_1mhzbus_slot_device::jim_w)
//#include "graduate.h"
#include "beebsid.h"
//#include "prisma3.h"
+#include "sprite.h"
#include "cfa3000opt.h"
@@ -161,6 +162,7 @@ void bbc_1mhzbus_devices(device_slot_interface &device)
//device.option_add("graduate", BBC_GRADUATE); /* The Torch Graduate G400/G800 */
device.option_add("beebsid", BBC_BEEBSID); /* BeebSID */
//device.option_add("prisma3", BBC_PRISMA3); /* PRISMA-3 - Millipede 1989 */
+ device.option_add("sprite", BBC_SPRITE); /* Logotron Sprite Board */
}
void bbcm_1mhzbus_devices(device_slot_interface &device)
@@ -183,5 +185,6 @@ void bbcm_1mhzbus_devices(device_slot_interface &device)
//device.option_add("graduate", BBC_GRADUATE); /* The Torch Graduate G400/G800 */
device.option_add("beebsid", BBC_BEEBSID); /* BeebSID */
//device.option_add("prisma3", BBC_PRISMA3); /* PRISMA-3 - Millipede 1989 */
+ device.option_add("sprite", BBC_SPRITE); /* Logotron Sprite Board */
device.option_add("cfa3000opt", CFA3000_OPT); /* Henson CFA 3000 Option Board */
}
diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.h b/src/devices/bus/bbc/1mhzbus/1mhzbus.h
index ad435876bf0..80e48425973 100644
--- a/src/devices/bus/bbc/1mhzbus/1mhzbus.h
+++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.h
@@ -107,10 +107,10 @@ public:
auto irq_handler() { return m_irq_handler.bind(); }
auto nmi_handler() { return m_nmi_handler.bind(); }
- virtual DECLARE_READ8_MEMBER(fred_r);
- virtual DECLARE_WRITE8_MEMBER(fred_w);
- virtual DECLARE_READ8_MEMBER(jim_r);
- virtual DECLARE_WRITE8_MEMBER(jim_w);
+ virtual uint8_t fred_r(offs_t offset);
+ virtual void fred_w(offs_t offset, uint8_t data);
+ virtual uint8_t jim_r(offs_t offset);
+ virtual void jim_w(offs_t offset, uint8_t data);
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_handler(state); }
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_handler(state); }
@@ -134,10 +134,10 @@ private:
class device_bbc_1mhzbus_interface : public device_slot_card_interface
{
public:
- virtual DECLARE_READ8_MEMBER(fred_r) { return 0xff; }
- virtual DECLARE_WRITE8_MEMBER(fred_w) { }
- virtual DECLARE_READ8_MEMBER(jim_r) { return 0xff; }
- virtual DECLARE_WRITE8_MEMBER(jim_w) { }
+ virtual uint8_t fred_r(offs_t offset) { return 0xff; }
+ virtual void fred_w(offs_t offset, uint8_t data) { }
+ virtual uint8_t jim_r(offs_t offset) { return 0xff; }
+ virtual void jim_w(offs_t offset, uint8_t data) { }
protected:
device_bbc_1mhzbus_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/bbc/1mhzbus/beebsid.cpp b/src/devices/bus/bbc/1mhzbus/beebsid.cpp
index c0e6ea62c46..d50449ede99 100644
--- a/src/devices/bus/bbc/1mhzbus/beebsid.cpp
+++ b/src/devices/bus/bbc/1mhzbus/beebsid.cpp
@@ -65,40 +65,40 @@ void bbc_beebsid_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_beebsid_device::fred_r)
+uint8_t bbc_beebsid_device::fred_r(offs_t offset)
{
uint8_t data = 0xff;
if (offset >= 0x20 && offset < 0x40)
{
- data = m_sid->read(space, offset);
+ data = m_sid->read(offset);
}
- data &= m_1mhzbus->fred_r(space, offset);
+ data &= m_1mhzbus->fred_r(offset);
return data;
}
-WRITE8_MEMBER(bbc_beebsid_device::fred_w)
+void bbc_beebsid_device::fred_w(offs_t offset, uint8_t data)
{
if (offset >= 0x20 && offset < 0x40)
{
- m_sid->write(space, offset, data);
+ m_sid->write(offset, data);
}
- m_1mhzbus->fred_w(space, offset, data);
+ m_1mhzbus->fred_w(offset, data);
}
-READ8_MEMBER(bbc_beebsid_device::jim_r)
+uint8_t bbc_beebsid_device::jim_r(offs_t offset)
{
uint8_t data = 0xff;
- data &= m_1mhzbus->jim_r(space, offset);
+ data &= m_1mhzbus->jim_r(offset);
return data;
}
-WRITE8_MEMBER(bbc_beebsid_device::jim_w)
+void bbc_beebsid_device::jim_w(offs_t offset, uint8_t data)
{
- m_1mhzbus->jim_w(space, offset, data);
+ m_1mhzbus->jim_w(offset, data);
}
diff --git a/src/devices/bus/bbc/1mhzbus/beebsid.h b/src/devices/bus/bbc/1mhzbus/beebsid.h
index d78d5486c10..107e875abde 100644
--- a/src/devices/bus/bbc/1mhzbus/beebsid.h
+++ b/src/devices/bus/bbc/1mhzbus/beebsid.h
@@ -34,10 +34,10 @@ protected:
// optional information overrides
virtual void device_add_mconfig(machine_config &config) override;
- virtual DECLARE_READ8_MEMBER(fred_r) override;
- virtual DECLARE_WRITE8_MEMBER(fred_w) override;
- virtual DECLARE_READ8_MEMBER(jim_r) override;
- virtual DECLARE_WRITE8_MEMBER(jim_w) override;
+ virtual uint8_t fred_r(offs_t offset) override;
+ virtual void fred_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t jim_r(offs_t offset) override;
+ virtual void jim_w(offs_t offset, uint8_t data) override;
private:
required_device<bbc_1mhzbus_slot_device> m_1mhzbus;
diff --git a/src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp b/src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp
index 0946d9cdf82..e5ac755e006 100644
--- a/src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp
+++ b/src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp
@@ -98,7 +98,7 @@ void cfa3000_opt_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(cfa3000_opt_device::fred_r)
+uint8_t cfa3000_opt_device::fred_r(offs_t offset)
{
uint8_t data = 0xff;
diff --git a/src/devices/bus/bbc/1mhzbus/cfa3000opt.h b/src/devices/bus/bbc/1mhzbus/cfa3000opt.h
index 5a4e413754b..64913e95604 100644
--- a/src/devices/bus/bbc/1mhzbus/cfa3000opt.h
+++ b/src/devices/bus/bbc/1mhzbus/cfa3000opt.h
@@ -35,7 +35,7 @@ protected:
// optional information overrides
virtual ioport_constructor device_input_ports() const override;
- virtual DECLARE_READ8_MEMBER(fred_r) override;
+ virtual uint8_t fred_r(offs_t offset) override;
private:
required_ioport m_opt;
diff --git a/src/devices/bus/bbc/1mhzbus/emrmidi.cpp b/src/devices/bus/bbc/1mhzbus/emrmidi.cpp
index 9c7c036f44c..6cfbacf23da 100644
--- a/src/devices/bus/bbc/1mhzbus/emrmidi.cpp
+++ b/src/devices/bus/bbc/1mhzbus/emrmidi.cpp
@@ -81,23 +81,23 @@ void bbc_emrmidi_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_emrmidi_device::fred_r)
+uint8_t bbc_emrmidi_device::fred_r(offs_t offset)
{
uint8_t data = 0xff;
if (offset >= 0xf0 && offset < 0xf2)
{
- data = m_acia->read(space, offset & 1);
+ data = m_acia->read(offset & 1);
}
return data;
}
-WRITE8_MEMBER(bbc_emrmidi_device::fred_w)
+void bbc_emrmidi_device::fred_w(offs_t offset, uint8_t data)
{
if (offset >= 0xf0 && offset < 0xf2)
{
- m_acia->write(space, offset & 1, data);
+ m_acia->write(offset & 1, data);
}
}
diff --git a/src/devices/bus/bbc/1mhzbus/emrmidi.h b/src/devices/bus/bbc/1mhzbus/emrmidi.h
index bbc41992948..341e487ce24 100644
--- a/src/devices/bus/bbc/1mhzbus/emrmidi.h
+++ b/src/devices/bus/bbc/1mhzbus/emrmidi.h
@@ -36,8 +36,8 @@ protected:
// optional information overrides
virtual void device_add_mconfig(machine_config &config) override;
- virtual DECLARE_READ8_MEMBER(fred_r) override;
- virtual DECLARE_WRITE8_MEMBER(fred_w) override;
+ virtual uint8_t fred_r(offs_t offset) override;
+ virtual void fred_w(offs_t offset, uint8_t data) override;
private:
DECLARE_WRITE_LINE_MEMBER(write_acia_clock);
diff --git a/src/devices/bus/bbc/1mhzbus/ieee488.cpp b/src/devices/bus/bbc/1mhzbus/ieee488.cpp
index 383ceef537b..3aae6fe2f54 100644
--- a/src/devices/bus/bbc/1mhzbus/ieee488.cpp
+++ b/src/devices/bus/bbc/1mhzbus/ieee488.cpp
@@ -54,7 +54,8 @@ ROM_END
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(bbc_ieee488_device::device_add_mconfig)
+void bbc_ieee488_device::device_add_mconfig(machine_config &config)
+{
TMS9914(config, m_tms9914, 5_MHz_XTAL);
m_tms9914->int_write_cb().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
m_tms9914->dio_read_cb().set(IEEE488_TAG, FUNC(ieee488_device::dio_r));
@@ -67,23 +68,25 @@ MACHINE_CONFIG_START(bbc_ieee488_device::device_add_mconfig)
m_tms9914->srq_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_srq_w));
m_tms9914->atn_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_atn_w));
m_tms9914->ren_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_ren_w));
- MCFG_IEEE488_BUS_ADD()
- MCFG_IEEE488_EOI_CALLBACK(WRITELINE(m_tms9914, tms9914_device, eoi_w))
- MCFG_IEEE488_DAV_CALLBACK(WRITELINE(m_tms9914, tms9914_device, dav_w))
- MCFG_IEEE488_NRFD_CALLBACK(WRITELINE(m_tms9914, tms9914_device, nrfd_w))
- MCFG_IEEE488_NDAC_CALLBACK(WRITELINE(m_tms9914, tms9914_device, ndac_w))
- MCFG_IEEE488_IFC_CALLBACK(WRITELINE(m_tms9914, tms9914_device, ifc_w))
- MCFG_IEEE488_SRQ_CALLBACK(WRITELINE(m_tms9914, tms9914_device, srq_w))
- MCFG_IEEE488_ATN_CALLBACK(WRITELINE(m_tms9914, tms9914_device, atn_w))
- MCFG_IEEE488_REN_CALLBACK(WRITELINE(m_tms9914, tms9914_device, ren_w))
- MCFG_IEEE488_SLOT_ADD("ieee_dev", 0, cbm_ieee488_devices, nullptr)
+
+ IEEE488(config, m_ieee);
+ m_ieee->eoi_callback().set(m_tms9914, FUNC(tms9914_device::eoi_w));
+ m_ieee->dav_callback().set(m_tms9914, FUNC(tms9914_device::dav_w));
+ m_ieee->nrfd_callback().set(m_tms9914, FUNC(tms9914_device::nrfd_w));
+ m_ieee->ndac_callback().set(m_tms9914, FUNC(tms9914_device::ndac_w));
+ m_ieee->ifc_callback().set(m_tms9914, FUNC(tms9914_device::ifc_w));
+ m_ieee->srq_callback().set(m_tms9914, FUNC(tms9914_device::srq_w));
+ m_ieee->atn_callback().set(m_tms9914, FUNC(tms9914_device::atn_w));
+ m_ieee->ren_callback().set(m_tms9914, FUNC(tms9914_device::ren_w));
+ IEEE488_SLOT(config, "ieee_dev", 0, cbm_ieee488_devices, nullptr);
BBC_1MHZBUS_SLOT(config, m_1mhzbus, DERIVED_CLOCK(1, 1), bbc_1mhzbus_devices, nullptr);
m_1mhzbus->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
m_1mhzbus->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::nmi_w));
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(bbc_b488_device::device_add_mconfig)
+void bbc_b488_device::device_add_mconfig(machine_config &config)
+{
TMS9914(config, m_tms9914, 5_MHz_XTAL); // TODO: verify clock
m_tms9914->int_write_cb().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
m_tms9914->dio_read_cb().set(IEEE488_TAG, FUNC(ieee488_device::dio_r));
@@ -96,35 +99,37 @@ MACHINE_CONFIG_START(bbc_b488_device::device_add_mconfig)
m_tms9914->srq_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_srq_w));
m_tms9914->atn_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_atn_w));
m_tms9914->ren_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_ren_w));
- MCFG_IEEE488_BUS_ADD()
- MCFG_IEEE488_EOI_CALLBACK(WRITELINE(m_tms9914, tms9914_device, eoi_w))
- MCFG_IEEE488_DAV_CALLBACK(WRITELINE(m_tms9914, tms9914_device, dav_w))
- MCFG_IEEE488_NRFD_CALLBACK(WRITELINE(m_tms9914, tms9914_device, nrfd_w))
- MCFG_IEEE488_NDAC_CALLBACK(WRITELINE(m_tms9914, tms9914_device, ndac_w))
- MCFG_IEEE488_IFC_CALLBACK(WRITELINE(m_tms9914, tms9914_device, ifc_w))
- MCFG_IEEE488_SRQ_CALLBACK(WRITELINE(m_tms9914, tms9914_device, srq_w))
- MCFG_IEEE488_ATN_CALLBACK(WRITELINE(m_tms9914, tms9914_device, atn_w))
- MCFG_IEEE488_REN_CALLBACK(WRITELINE(m_tms9914, tms9914_device, ren_w))
- MCFG_IEEE488_SLOT_ADD("ieee_dev", 0, cbm_ieee488_devices, nullptr)
+
+ IEEE488(config, m_ieee);
+ m_ieee->eoi_callback().set(m_tms9914, FUNC(tms9914_device::eoi_w));
+ m_ieee->dav_callback().set(m_tms9914, FUNC(tms9914_device::dav_w));
+ m_ieee->nrfd_callback().set(m_tms9914, FUNC(tms9914_device::nrfd_w));
+ m_ieee->ndac_callback().set(m_tms9914, FUNC(tms9914_device::ndac_w));
+ m_ieee->ifc_callback().set(m_tms9914, FUNC(tms9914_device::ifc_w));
+ m_ieee->srq_callback().set(m_tms9914, FUNC(tms9914_device::srq_w));
+ m_ieee->atn_callback().set(m_tms9914, FUNC(tms9914_device::atn_w));
+ m_ieee->ren_callback().set(m_tms9914, FUNC(tms9914_device::ren_w));
+ IEEE488_SLOT(config, "ieee_dev", 0, cbm_ieee488_devices, nullptr);
// TODO: LED's for ATN, TALK, and DATA
-MACHINE_CONFIG_END
+}
-//MACHINE_CONFIG_START(bbc_procyon_device::device_add_mconfig)
+//void bbc_procyon_device::device_add_mconfig(machine_config &config)
+//{
// TODO: Implement MC68488
- //MCFG_IEEE488_BUS_ADD()
- //MCFG_IEEE488_EOI_CALLBACK(WRITELINE(m_mc68488, mc68488_device, eoi_w))
- //MCFG_IEEE488_DAV_CALLBACK(WRITELINE(m_mc68488, mc68488_device, dav_w))
- //MCFG_IEEE488_NRFD_CALLBACK(WRITELINE(m_mc68488, mc68488_device, nrfd_w))
- //MCFG_IEEE488_NDAC_CALLBACK(WRITELINE(m_mc68488, mc68488_device, ndac_w))
- //MCFG_IEEE488_IFC_CALLBACK(WRITELINE(m_mc68488, mc68488_device, ifc_w))
- //MCFG_IEEE488_SRQ_CALLBACK(WRITELINE(m_mc68488, mc68488_device, srq_w))
- //MCFG_IEEE488_ATN_CALLBACK(WRITELINE(m_mc68488, mc68488_device, atn_w))
- //MCFG_IEEE488_REN_CALLBACK(WRITELINE(m_mc68488, mc68488_device, ren_w))
- //MCFG_IEEE488_SLOT_ADD("ieee_dev", 0, cbm_ieee488_devices, nullptr)
+ //IEEE488(config, m_ieee);
+ //m_ieee->eoi_callback(m_mc68488, FUNC(mc68488_device::eoi_w));
+ //m_ieee->dav_callback(m_mc68488, FUNC(mc68488_device::dav_w));
+ //m_ieee->nrfd_callback(m_mc68488, FUNC(mc68488_device::nrfd_w));
+ //m_ieee->ndac_callback(m_mc68488, FUNC(mc68488_device::ndac_w));
+ //m_ieee->ifc_callback(m_mc68488, FUNC(mc68488_device::ifc_w));
+ //m_ieee->srq_callback(m_mc68488, FUNC(mc68488_device::srq_w));
+ //m_ieee->atn_callback(m_mc68488, FUNC(mc68488_device::atn_w));
+ //m_ieee->ren_callback(m_mc68488, FUNC(mc68488_device::ren_w));
+ //IEEE488_SLOT(config, "ieee_dev", 0, cbm_ieee488_devices, nullptr);
// TODO: LED's for Bus Active, Byte Out, and Byte In
-//MACHINE_CONFIG_END
+//}
//-------------------------------------------------
// rom_region - device-specific ROM region
@@ -192,82 +197,82 @@ void bbc_b488_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_ieee488_device::fred_r)
+uint8_t bbc_ieee488_device::fred_r(offs_t offset)
{
uint8_t data = 0xff;
if (offset >= 0x20 && offset < 0x28)
{
- data = m_tms9914->reg8_r(space, offset & 0x07);
+ data = m_tms9914->read(offset & 0x07);
}
- data &= m_1mhzbus->fred_r(space, offset);
+ data &= m_1mhzbus->fred_r(offset);
return data;
}
-WRITE8_MEMBER(bbc_ieee488_device::fred_w)
+void bbc_ieee488_device::fred_w(offs_t offset, uint8_t data)
{
if (offset >= 0x20 && offset < 0x28)
{
- m_tms9914->reg8_w(space, offset & 0x07, data);
+ m_tms9914->write(offset & 0x07, data);
}
- m_1mhzbus->fred_w(space, offset, data);
+ m_1mhzbus->fred_w(offset, data);
}
-READ8_MEMBER(bbc_ieee488_device::jim_r)
+uint8_t bbc_ieee488_device::jim_r(offs_t offset)
{
uint8_t data = 0xff;
- data &= m_1mhzbus->jim_r(space, offset);
+ data &= m_1mhzbus->jim_r(offset);
return data;
}
-WRITE8_MEMBER(bbc_ieee488_device::jim_w)
+void bbc_ieee488_device::jim_w(offs_t offset, uint8_t data)
{
- m_1mhzbus->jim_w(space, offset, data);
+ m_1mhzbus->jim_w(offset, data);
}
-READ8_MEMBER(bbc_b488_device::fred_r)
+uint8_t bbc_b488_device::fred_r(offs_t offset)
{
uint8_t data = 0xff;
if (offset >= 0x20 && offset < 0x28)
{
- data = m_tms9914->reg8_r(space, offset & 0x07);
+ data = m_tms9914->read(offset & 0x07);
}
return data;
}
-WRITE8_MEMBER(bbc_b488_device::fred_w)
+void bbc_b488_device::fred_w(offs_t offset, uint8_t data)
{
if (offset >= 0x20 && offset < 0x28)
{
- m_tms9914->reg8_w(space, offset & 0x07, data);
+ m_tms9914->write(offset & 0x07, data);
}
}
-//READ8_MEMBER(bbc_procyon_device::fred_r)
+//uint8_t bbc_procyon_device::fred_r(offs_t offset)
//{
//uint8_t data = 0xff;
//if (offset >= 0x20 && offset < 0x28)
//{
- // data = mc68488_device->reg8_r(space, offset & 0x07);
+ // data = mc68488_device->read(offset & 0x07);
//}
//return data;
//}
-//WRITE8_MEMBER(bbc_procyon_device::fred_w)
+//void bbc_procyon_device::fred_w(offs_t offset, uint8_t data)
//{
//if (offset >= 0x20 && offset < 0x28)
//{
- // mc68488_device->reg8_w(space, offset & 0x07, data);
+ // mc68488_device->write(offset & 0x07, data);
//}
//}
diff --git a/src/devices/bus/bbc/1mhzbus/ieee488.h b/src/devices/bus/bbc/1mhzbus/ieee488.h
index 05a9e60c928..9b810b4bf8d 100644
--- a/src/devices/bus/bbc/1mhzbus/ieee488.h
+++ b/src/devices/bus/bbc/1mhzbus/ieee488.h
@@ -42,10 +42,10 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER(fred_r) override;
- virtual DECLARE_WRITE8_MEMBER(fred_w) override;
- virtual DECLARE_READ8_MEMBER(jim_r) override;
- virtual DECLARE_WRITE8_MEMBER(jim_w) override;
+ virtual uint8_t fred_r(offs_t offset) override;
+ virtual void fred_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t jim_r(offs_t offset) override;
+ virtual void jim_w(offs_t offset, uint8_t data) override;
private:
required_device<ieee488_device> m_ieee;
@@ -69,8 +69,8 @@ protected:
// optional information overrides
virtual void device_add_mconfig(machine_config &config) override;
- virtual DECLARE_READ8_MEMBER(fred_r) override;
- virtual DECLARE_WRITE8_MEMBER(fred_w) override;
+ virtual uint8_t fred_r(offs_t offset) override;
+ virtual void fred_w(offs_t offset, uint8_t data) override;
private:
required_device<ieee488_device> m_ieee;
@@ -94,8 +94,8 @@ private:
// virtual void device_add_mconfig(machine_config &config) override;
// virtual const tiny_rom_entry *device_rom_region() const override;
//
-// virtual DECLARE_READ8_MEMBER(fred_r) override;
-// virtual DECLARE_WRITE8_MEMBER(fred_w) override;
+// virtual uint8_t fred_r(offs_t offset) override;
+// virtual void fred_w(offs_t offset, uint8_t data) override;
//
//private:
// required_device<ieee488_device> m_ieee;
diff --git a/src/devices/bus/bbc/1mhzbus/m2000.cpp b/src/devices/bus/bbc/1mhzbus/m2000.cpp
index 88a713d1ff8..8203cada22e 100644
--- a/src/devices/bus/bbc/1mhzbus/m2000.cpp
+++ b/src/devices/bus/bbc/1mhzbus/m2000.cpp
@@ -91,7 +91,7 @@ void bbc_m2000_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_m2000_device::fred_r)
+uint8_t bbc_m2000_device::fred_r(offs_t offset)
{
uint8_t data = 0xff;
@@ -100,59 +100,59 @@ READ8_MEMBER(bbc_m2000_device::fred_r)
switch (offset & 0x06)
{
case 0x00:
- data = m_acia1->read(space, offset & 1);
+ data = m_acia1->read(offset & 1);
break;
case 0x02:
- data = m_acia2->read(space, offset & 1);
+ data = m_acia2->read(offset & 1);
break;
case 0x04:
- data = m_acia3->read(space, offset & 1);
+ data = m_acia3->read(offset & 1);
break;
case 0x06:
break;
}
}
- data &= m_1mhzbus->fred_r(space, offset);
+ data &= m_1mhzbus->fred_r(offset);
return data;
}
-WRITE8_MEMBER(bbc_m2000_device::fred_w)
+void bbc_m2000_device::fred_w(offs_t offset, uint8_t data)
{
if (offset >= 0x08 && offset < 0x10)
{
switch (offset & 0x06)
{
case 0x00:
- m_acia1->write(space, offset & 1, data);
+ m_acia1->write(offset & 1, data);
break;
case 0x02:
- m_acia2->write(space, offset & 1, data);
+ m_acia2->write(offset & 1, data);
break;
case 0x04:
- m_acia3->write(space, offset & 1, data);
+ m_acia3->write(offset & 1, data);
break;
case 0x06:
break;
}
}
- m_1mhzbus->fred_w(space, offset, data);
+ m_1mhzbus->fred_w(offset, data);
}
-READ8_MEMBER(bbc_m2000_device::jim_r)
+uint8_t bbc_m2000_device::jim_r(offs_t offset)
{
uint8_t data = 0xff;
- data &= m_1mhzbus->jim_r(space, offset);
+ data &= m_1mhzbus->jim_r(offset);
return data;
}
-WRITE8_MEMBER(bbc_m2000_device::jim_w)
+void bbc_m2000_device::jim_w(offs_t offset, uint8_t data)
{
- m_1mhzbus->jim_w(space, offset, data);
+ m_1mhzbus->jim_w(offset, data);
}
WRITE_LINE_MEMBER(bbc_m2000_device::write_acia_clock)
diff --git a/src/devices/bus/bbc/1mhzbus/m2000.h b/src/devices/bus/bbc/1mhzbus/m2000.h
index f476c92dac5..eeee1034a4e 100644
--- a/src/devices/bus/bbc/1mhzbus/m2000.h
+++ b/src/devices/bus/bbc/1mhzbus/m2000.h
@@ -38,10 +38,10 @@ protected:
// optional information overrides
virtual void device_add_mconfig(machine_config &config) override;
- virtual DECLARE_READ8_MEMBER(fred_r) override;
- virtual DECLARE_WRITE8_MEMBER(fred_w) override;
- virtual DECLARE_READ8_MEMBER(jim_r) override;
- virtual DECLARE_WRITE8_MEMBER(jim_w) override;
+ virtual uint8_t fred_r(offs_t offset) override;
+ virtual void fred_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t jim_r(offs_t offset) override;
+ virtual void jim_w(offs_t offset, uint8_t data) override;
private:
DECLARE_WRITE_LINE_MEMBER(write_acia_clock);
diff --git a/src/devices/bus/bbc/1mhzbus/opus3.cpp b/src/devices/bus/bbc/1mhzbus/opus3.cpp
index 65a8a3134ec..77f21ac199a 100644
--- a/src/devices/bus/bbc/1mhzbus/opus3.cpp
+++ b/src/devices/bus/bbc/1mhzbus/opus3.cpp
@@ -159,7 +159,7 @@ void bbc_opusa_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_opus3_device::fred_r)
+uint8_t bbc_opus3_device::fred_r(offs_t offset)
{
uint8_t data = 0xff;
@@ -175,7 +175,7 @@ READ8_MEMBER(bbc_opus3_device::fred_r)
return data;
}
-WRITE8_MEMBER(bbc_opus3_device::fred_w)
+void bbc_opus3_device::fred_w(offs_t offset, uint8_t data)
{
floppy_image_device *floppy = nullptr;
@@ -219,7 +219,7 @@ WRITE_LINE_MEMBER(bbc_opus3_device::fdc_drq_w)
m_slot->nmi_w((m_fdc_drq && m_fdc_ie) ? ASSERT_LINE : CLEAR_LINE);
}
-READ8_MEMBER(bbc_opus3_device::jim_r)
+uint8_t bbc_opus3_device::jim_r(offs_t offset)
{
if ((m_ramdisk_page << 8) < m_ramdisk->size())
return m_ramdisk->read((m_ramdisk_page << 8) + offset);
@@ -227,7 +227,7 @@ READ8_MEMBER(bbc_opus3_device::jim_r)
return 0xff;
}
-WRITE8_MEMBER(bbc_opus3_device::jim_w)
+void bbc_opus3_device::jim_w(offs_t offset, uint8_t data)
{
if ((m_ramdisk_page << 8) < m_ramdisk->size())
m_ramdisk->write((m_ramdisk_page << 8) + offset, data);
diff --git a/src/devices/bus/bbc/1mhzbus/opus3.h b/src/devices/bus/bbc/1mhzbus/opus3.h
index ef7a2174f5c..7d287f1622c 100644
--- a/src/devices/bus/bbc/1mhzbus/opus3.h
+++ b/src/devices/bus/bbc/1mhzbus/opus3.h
@@ -39,10 +39,10 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER(fred_r) override;
- virtual DECLARE_WRITE8_MEMBER(fred_w) override;
- virtual DECLARE_READ8_MEMBER(jim_r) override;
- virtual DECLARE_WRITE8_MEMBER(jim_w) override;
+ virtual uint8_t fred_r(offs_t offset) override;
+ virtual void fred_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t jim_r(offs_t offset) override;
+ virtual void jim_w(offs_t offset, uint8_t data) override;
private:
DECLARE_FLOPPY_FORMATS(floppy_formats);
diff --git a/src/devices/bus/bbc/1mhzbus/sprite.cpp b/src/devices/bus/bbc/1mhzbus/sprite.cpp
new file mode 100644
index 00000000000..ee7f5f292e7
--- /dev/null
+++ b/src/devices/bus/bbc/1mhzbus/sprite.cpp
@@ -0,0 +1,99 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Logotron Sprite Board
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "sprite.h"
+#include "screen.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_SPRITE, bbc_sprite_device, "bbc_sprite", "Logotron Sprite Board");
+
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_sprite_device::device_add_mconfig(machine_config &config)
+{
+ TMS9129(config, m_vdp, 10.738635_MHz_XTAL);
+ m_vdp->int_callback().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
+ m_vdp->set_screen("screen");
+ m_vdp->set_vram_size(0x4000);
+
+ SCREEN(config, "screen", SCREEN_TYPE_RASTER);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_sprite_device - constructor
+//-------------------------------------------------
+
+bbc_sprite_device::bbc_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_SPRITE, tag, owner, clock)
+ , device_bbc_1mhzbus_interface(mconfig, *this)
+ , m_vdp(*this, "vdp")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_sprite_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void bbc_sprite_device::device_reset()
+{
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_sprite_device::fred_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (offset)
+ {
+ case 0xa0:
+ data = m_vdp->vram_read();
+ break;
+ case 0xa2:
+ data = m_vdp->register_read();
+ break;
+ }
+ return data;
+}
+
+void bbc_sprite_device::fred_w(offs_t offset, uint8_t data)
+{
+ switch (offset)
+ {
+ case 0xa1:
+ m_vdp->vram_write(data);
+ break;
+ case 0xa3:
+ m_vdp->register_write(data);
+ break;
+ }
+}
diff --git a/src/devices/bus/bbc/1mhzbus/sprite.h b/src/devices/bus/bbc/1mhzbus/sprite.h
new file mode 100644
index 00000000000..02b0cff5dc2
--- /dev/null
+++ b/src/devices/bus/bbc/1mhzbus/sprite.h
@@ -0,0 +1,49 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Logotron Sprite Board
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_1MHZBUS_SPRITE_H
+#define MAME_BUS_BBC_1MHZBUS_SPRITE_H
+
+#include "1mhzbus.h"
+#include "video/tms9928a.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_sprite_device:
+ public device_t,
+ public device_bbc_1mhzbus_interface
+{
+public:
+ // construction/destruction
+ bbc_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual uint8_t fred_r(offs_t offset) override;
+ virtual void fred_w(offs_t offset, uint8_t data) override;
+
+private:
+ required_device<tms9129_device> m_vdp;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_SPRITE, bbc_sprite_device);
+
+
+#endif /* MAME_BUS_BBC_1MHZBUS_SPRITE_H */
diff --git a/src/devices/bus/bbc/exp/exp.cpp b/src/devices/bus/bbc/exp/exp.cpp
index d2a5cca3611..25f19746b72 100644
--- a/src/devices/bus/bbc/exp/exp.cpp
+++ b/src/devices/bus/bbc/exp/exp.cpp
@@ -97,26 +97,26 @@ void bbc_exp_slot_device::device_reset()
// read
//-------------------------------------------------
-READ8_MEMBER(bbc_exp_slot_device::fred_r)
+uint8_t bbc_exp_slot_device::fred_r(offs_t offset)
{
if (m_card)
- return m_card->fred_r(space, offset);
+ return m_card->fred_r(offset);
else
return 0xff;
}
-READ8_MEMBER(bbc_exp_slot_device::jim_r)
+uint8_t bbc_exp_slot_device::jim_r(offs_t offset)
{
if (m_card)
- return m_card->jim_r(space, offset);
+ return m_card->jim_r(offset);
else
return 0xff;
}
-READ8_MEMBER(bbc_exp_slot_device::sheila_r)
+uint8_t bbc_exp_slot_device::sheila_r(offs_t offset)
{
if (m_card)
- return m_card->sheila_r(space, offset);
+ return m_card->sheila_r(offset);
else
return 0xfe;
}
@@ -125,32 +125,32 @@ READ8_MEMBER(bbc_exp_slot_device::sheila_r)
// write
//-------------------------------------------------
-WRITE8_MEMBER(bbc_exp_slot_device::fred_w)
+void bbc_exp_slot_device::fred_w(offs_t offset, uint8_t data)
{
if (m_card)
- m_card->fred_w(space, offset, data);
+ m_card->fred_w(offset, data);
}
-WRITE8_MEMBER(bbc_exp_slot_device::jim_w)
+void bbc_exp_slot_device::jim_w(offs_t offset, uint8_t data)
{
if (m_card)
- m_card->jim_w(space, offset, data);
+ m_card->jim_w(offset, data);
}
-WRITE8_MEMBER(bbc_exp_slot_device::sheila_w)
+void bbc_exp_slot_device::sheila_w(offs_t offset, uint8_t data)
{
if (m_card)
- m_card->sheila_w(space, offset, data);
+ m_card->sheila_w(offset, data);
}
//-------------------------------------------------
// pb_r
//-------------------------------------------------
-READ8_MEMBER(bbc_exp_slot_device::pb_r)
+uint8_t bbc_exp_slot_device::pb_r()
{
if (m_card)
- return 0x1f | m_card->pb_r(space, 0);
+ return 0x1f | m_card->pb_r();
else
return 0xff;
}
@@ -160,10 +160,10 @@ READ8_MEMBER(bbc_exp_slot_device::pb_r)
// pb_w
//-------------------------------------------------
-WRITE8_MEMBER(bbc_exp_slot_device::pb_w)
+void bbc_exp_slot_device::pb_w(uint8_t data)
{
if (m_card)
- m_card->pb_w(space, 0, data);
+ m_card->pb_w(data);
}
//-------------------------------------------------
diff --git a/src/devices/bus/bbc/exp/exp.h b/src/devices/bus/bbc/exp/exp.h
index 5269deb3900..ef1a0174b1a 100644
--- a/src/devices/bus/bbc/exp/exp.h
+++ b/src/devices/bus/bbc/exp/exp.h
@@ -75,12 +75,12 @@ public:
auto cb1_handler() { return m_cb1_handler.bind(); }
auto cb2_handler() { return m_cb2_handler.bind(); }
- virtual DECLARE_READ8_MEMBER(fred_r);
- virtual DECLARE_WRITE8_MEMBER(fred_w);
- virtual DECLARE_READ8_MEMBER(jim_r);
- virtual DECLARE_WRITE8_MEMBER(jim_w);
- virtual DECLARE_READ8_MEMBER(sheila_r);
- virtual DECLARE_WRITE8_MEMBER(sheila_w);
+ uint8_t fred_r(offs_t offset);
+ void fred_w(offs_t offset, uint8_t data);
+ uint8_t jim_r(offs_t offset);
+ void jim_w(offs_t offset, uint8_t data);
+ uint8_t sheila_r(offs_t offset);
+ void sheila_w(offs_t offset, uint8_t data);
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_handler(state); }
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_handler(state); }
@@ -89,8 +89,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(cb1_w) { m_cb1_handler(state); }
DECLARE_WRITE_LINE_MEMBER(cb2_w) { m_cb2_handler(state); }
- DECLARE_READ8_MEMBER(pb_r);
- DECLARE_WRITE8_MEMBER(pb_w);
+ uint8_t pb_r();
+ void pb_w(uint8_t data);
protected:
// device-level overrides
@@ -114,15 +114,15 @@ private:
class device_bbc_exp_interface : public device_slot_card_interface
{
public:
- virtual DECLARE_READ8_MEMBER(fred_r) { return 0xff; }
- virtual DECLARE_WRITE8_MEMBER(fred_w) { }
- virtual DECLARE_READ8_MEMBER(jim_r) { return 0xff; }
- virtual DECLARE_WRITE8_MEMBER(jim_w) { }
- virtual DECLARE_READ8_MEMBER(sheila_r) { return 0xfe; }
- virtual DECLARE_WRITE8_MEMBER(sheila_w) { }
-
- virtual DECLARE_READ8_MEMBER(pb_r) { return 0xff; }
- virtual DECLARE_WRITE8_MEMBER(pb_w) { }
+ virtual uint8_t fred_r(offs_t offset) { return 0xff; }
+ virtual void fred_w(offs_t offset, uint8_t data) { }
+ virtual uint8_t jim_r(offs_t offset) { return 0xff; }
+ virtual void jim_w(offs_t offset, uint8_t data) { }
+ virtual uint8_t sheila_r(offs_t offset) { return 0xfe; }
+ virtual void sheila_w(offs_t offset, uint8_t data) { }
+
+ virtual uint8_t pb_r() { return 0xff; }
+ virtual void pb_w(uint8_t data) { }
protected:
device_bbc_exp_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/bbc/exp/mertec.cpp b/src/devices/bus/bbc/exp/mertec.cpp
index 8f896da0359..ab9dc3c2f6e 100644
--- a/src/devices/bus/bbc/exp/mertec.cpp
+++ b/src/devices/bus/bbc/exp/mertec.cpp
@@ -52,7 +52,7 @@ void bbc_mertec_device::device_add_mconfig(machine_config &config)
//m_pia->irq_handler().set("irqs", FUNC(input_merger_device::in_w<0>));
/* adc */
- UPD7002(config, m_upd7002, 0);
+ UPD7002(config, m_upd7002, DERIVED_CLOCK(1, 8));
m_upd7002->set_get_analogue_callback(FUNC(bbc_mertec_device::get_analogue_input), this);
m_upd7002->set_eoc_callback(FUNC(bbc_mertec_device::upd7002_eoc), this);
@@ -114,52 +114,52 @@ void bbc_mertec_device::upd7002_eoc(int data)
//m_via6522_0->write_cb1(data);
}
-READ8_MEMBER(bbc_mertec_device::fred_r)
+uint8_t bbc_mertec_device::fred_r(offs_t offset)
{
- return m_2mhzbus->fred_r(space, offset);
+ return m_2mhzbus->fred_r(offset);
}
-WRITE8_MEMBER(bbc_mertec_device::fred_w)
+void bbc_mertec_device::fred_w(offs_t offset, uint8_t data)
{
- m_2mhzbus->fred_w(space, offset, data);
+ m_2mhzbus->fred_w(offset, data);
}
-READ8_MEMBER(bbc_mertec_device::jim_r)
+uint8_t bbc_mertec_device::jim_r(offs_t offset)
{
- return m_2mhzbus->jim_r(space, offset);
+ return m_2mhzbus->jim_r(offset);
}
-WRITE8_MEMBER(bbc_mertec_device::jim_w)
+void bbc_mertec_device::jim_w(offs_t offset, uint8_t data)
{
- m_2mhzbus->jim_w(space, offset, data);
+ m_2mhzbus->jim_w(offset, data);
}
-READ8_MEMBER(bbc_mertec_device::sheila_r)
+uint8_t bbc_mertec_device::sheila_r(offs_t offset)
{
uint8_t data = 0xfe;
if (offset >= 0x18 && offset < 0x20)
{
- data = m_upd7002->read(space, offset & 0x03);
+ data = m_upd7002->read(offset & 0x03);
}
return data;
}
-WRITE8_MEMBER(bbc_mertec_device::sheila_w)
+void bbc_mertec_device::sheila_w(offs_t offset, uint8_t data)
{
if (offset >= 0x18 && offset < 0x20)
{
- m_upd7002->write(space, offset & 0x03, data);
+ m_upd7002->write(offset & 0x03, data);
}
}
-READ8_MEMBER(bbc_mertec_device::pb_r)
+uint8_t bbc_mertec_device::pb_r()
{
- return m_userport->pb_r(space, 0);
+ return m_userport->pb_r();
}
-WRITE8_MEMBER(bbc_mertec_device::pb_w)
+void bbc_mertec_device::pb_w(uint8_t data)
{
- m_userport->pb_w(space, 0, data);
+ m_userport->pb_w(data);
}
diff --git a/src/devices/bus/bbc/exp/mertec.h b/src/devices/bus/bbc/exp/mertec.h
index bd87c0d5398..33d71ab2ce9 100644
--- a/src/devices/bus/bbc/exp/mertec.h
+++ b/src/devices/bus/bbc/exp/mertec.h
@@ -40,15 +40,15 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER(fred_r) override;
- virtual DECLARE_WRITE8_MEMBER(fred_w) override;
- virtual DECLARE_READ8_MEMBER(jim_r) override;
- virtual DECLARE_WRITE8_MEMBER(jim_w) override;
- virtual DECLARE_READ8_MEMBER(sheila_r) override;
- virtual DECLARE_WRITE8_MEMBER(sheila_w) override;
-
- virtual DECLARE_READ8_MEMBER(pb_r) override;
- virtual DECLARE_WRITE8_MEMBER(pb_w) override;
+ virtual uint8_t fred_r(offs_t offset) override;
+ virtual void fred_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t jim_r(offs_t offset) override;
+ virtual void jim_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t sheila_r(offs_t offset) override;
+ virtual void sheila_w(offs_t offset, uint8_t data) override;
+
+ virtual uint8_t pb_r() override;
+ virtual void pb_w(uint8_t data) override;
private:
int get_analogue_input(int channel_number);
diff --git a/src/devices/bus/bbc/fdc/acorn.cpp b/src/devices/bus/bbc/fdc/acorn.cpp
index dd5d8f28559..0df7b38b076 100644
--- a/src/devices/bus/bbc/fdc/acorn.cpp
+++ b/src/devices/bus/bbc/fdc/acorn.cpp
@@ -166,30 +166,30 @@ void bbc_acorn1770_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_acorn8271_device::read)
+uint8_t bbc_acorn8271_device::read(offs_t offset)
{
uint8_t data;
if (offset & 0x04)
{
- data = m_fdc->data_r(space , 0);
+ data = m_fdc->data_r();
}
else
{
- data = m_fdc->read(space, offset & 0x03);
+ data = m_fdc->read(offset & 0x03);
}
return data;
}
-WRITE8_MEMBER(bbc_acorn8271_device::write)
+void bbc_acorn8271_device::write(offs_t offset, uint8_t data)
{
if (offset & 0x04)
{
- m_fdc->data_w(space, 0, data);
+ m_fdc->data_w(data);
}
else
{
- m_fdc->write(space, offset & 0x03, data);
+ m_fdc->write(offset & 0x03, data);
}
}
@@ -207,7 +207,7 @@ WRITE_LINE_MEMBER(bbc_acorn8271_device::side_w)
}
-READ8_MEMBER(bbc_acorn1770_device::read)
+uint8_t bbc_acorn1770_device::read(offs_t offset)
{
uint8_t data = 0xff;
@@ -222,7 +222,7 @@ READ8_MEMBER(bbc_acorn1770_device::read)
return data;
}
-WRITE8_MEMBER(bbc_acorn1770_device::write)
+void bbc_acorn1770_device::write(offs_t offset, uint8_t data)
{
if (offset & 0x04)
{
diff --git a/src/devices/bus/bbc/fdc/acorn.h b/src/devices/bus/bbc/fdc/acorn.h
index 951b7e33e1d..13b434b156b 100644
--- a/src/devices/bus/bbc/fdc/acorn.h
+++ b/src/devices/bus/bbc/fdc/acorn.h
@@ -42,8 +42,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER(read) override;
- virtual DECLARE_WRITE8_MEMBER(write) override;
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
private:
DECLARE_WRITE_LINE_MEMBER(motor_w);
@@ -70,8 +70,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER(read) override;
- virtual DECLARE_WRITE8_MEMBER(write) override;
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
private:
DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w);
diff --git a/src/devices/bus/bbc/fdc/ams.cpp b/src/devices/bus/bbc/fdc/ams.cpp
index 02af01be5c5..db9eb7e3012 100644
--- a/src/devices/bus/bbc/fdc/ams.cpp
+++ b/src/devices/bus/bbc/fdc/ams.cpp
@@ -89,30 +89,30 @@ void bbc_ams3_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_ams3_device::read)
+uint8_t bbc_ams3_device::read(offs_t offset)
{
uint8_t data;
if (offset & 0x04)
{
- data = m_fdc->data_r(space , 0);
+ data = m_fdc->data_r();
}
else
{
- data = m_fdc->read(space, offset & 0x03);
+ data = m_fdc->read(offset & 0x03);
}
return data;
}
-WRITE8_MEMBER(bbc_ams3_device::write)
+void bbc_ams3_device::write(offs_t offset, uint8_t data)
{
if (offset & 0x04)
{
- m_fdc->data_w(space, 0, data);
+ m_fdc->data_w(data);
}
else
{
- m_fdc->write(space, offset & 0x03, data);
+ m_fdc->write(offset & 0x03, data);
}
}
diff --git a/src/devices/bus/bbc/fdc/ams.h b/src/devices/bus/bbc/fdc/ams.h
index a97a6b762c5..304666b5392 100644
--- a/src/devices/bus/bbc/fdc/ams.h
+++ b/src/devices/bus/bbc/fdc/ams.h
@@ -39,8 +39,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER(read) override;
- virtual DECLARE_WRITE8_MEMBER(write) override;
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
private:
DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w);
diff --git a/src/devices/bus/bbc/fdc/cumana.cpp b/src/devices/bus/bbc/fdc/cumana.cpp
index 23cecd3ebcf..f4490b1922d 100644
--- a/src/devices/bus/bbc/fdc/cumana.cpp
+++ b/src/devices/bus/bbc/fdc/cumana.cpp
@@ -137,7 +137,7 @@ void bbc_cumanafdc_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_cumanafdc_device::read)
+uint8_t bbc_cumanafdc_device::read(offs_t offset)
{
uint8_t data;
@@ -152,7 +152,7 @@ READ8_MEMBER(bbc_cumanafdc_device::read)
return data;
}
-WRITE8_MEMBER(bbc_cumanafdc_device::write)
+void bbc_cumanafdc_device::write(offs_t offset, uint8_t data)
{
if (offset & 0x04)
{
diff --git a/src/devices/bus/bbc/fdc/cumana.h b/src/devices/bus/bbc/fdc/cumana.h
index 5b2439000ec..6e1a4f25011 100644
--- a/src/devices/bus/bbc/fdc/cumana.h
+++ b/src/devices/bus/bbc/fdc/cumana.h
@@ -39,8 +39,8 @@ protected:
// device-level overrides
virtual void device_start() override;
- virtual DECLARE_READ8_MEMBER(read) override;
- virtual DECLARE_WRITE8_MEMBER(write) override;
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
required_device<mb8877_device> m_fdc;
required_device<floppy_connector> m_floppy0;
diff --git a/src/devices/bus/bbc/fdc/cv1797.cpp b/src/devices/bus/bbc/fdc/cv1797.cpp
index 98f54718c42..d14098a3fa3 100644
--- a/src/devices/bus/bbc/fdc/cv1797.cpp
+++ b/src/devices/bus/bbc/fdc/cv1797.cpp
@@ -100,7 +100,7 @@ void bbc_cv1797_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_cv1797_device::read)
+uint8_t bbc_cv1797_device::read(offs_t offset)
{
uint8_t data;
@@ -115,7 +115,7 @@ READ8_MEMBER(bbc_cv1797_device::read)
return data;
}
-WRITE8_MEMBER(bbc_cv1797_device::write)
+void bbc_cv1797_device::write(offs_t offset, uint8_t data)
{
if (offset & 0x04)
{
diff --git a/src/devices/bus/bbc/fdc/cv1797.h b/src/devices/bus/bbc/fdc/cv1797.h
index a887a1b18a4..86207c8fcd0 100644
--- a/src/devices/bus/bbc/fdc/cv1797.h
+++ b/src/devices/bus/bbc/fdc/cv1797.h
@@ -40,8 +40,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER(read) override;
- virtual DECLARE_WRITE8_MEMBER(write) override;
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
private:
DECLARE_FLOPPY_FORMATS(floppy_formats);
diff --git a/src/devices/bus/bbc/fdc/fdc.cpp b/src/devices/bus/bbc/fdc/fdc.cpp
index 10f9131351f..2269bb3370a 100644
--- a/src/devices/bus/bbc/fdc/fdc.cpp
+++ b/src/devices/bus/bbc/fdc/fdc.cpp
@@ -89,10 +89,10 @@ void bbc_fdc_slot_device::device_reset()
// read
//-------------------------------------------------
-READ8_MEMBER(bbc_fdc_slot_device::read)
+uint8_t bbc_fdc_slot_device::read(offs_t offset)
{
if (m_card)
- return m_card->read(space, offset);
+ return m_card->read(offset);
else
return 0xff;
}
@@ -101,10 +101,10 @@ READ8_MEMBER(bbc_fdc_slot_device::read)
// write
//-------------------------------------------------
-WRITE8_MEMBER(bbc_fdc_slot_device::write)
+void bbc_fdc_slot_device::write(offs_t offset, uint8_t data)
{
if (m_card)
- m_card->write(space, offset, data);
+ m_card->write(offset, data);
}
//-------------------------------------------------
diff --git a/src/devices/bus/bbc/fdc/fdc.h b/src/devices/bus/bbc/fdc/fdc.h
index 0cc256961ee..3264172a25d 100644
--- a/src/devices/bus/bbc/fdc/fdc.h
+++ b/src/devices/bus/bbc/fdc/fdc.h
@@ -41,8 +41,8 @@ public:
auto intrq_wr_callback() { return m_intrq_cb.bind(); }
auto drq_wr_callback() { return m_drq_cb.bind(); }
- virtual DECLARE_READ8_MEMBER(read);
- virtual DECLARE_WRITE8_MEMBER(write);
+ uint8_t read(offs_t offset);
+ void write(offs_t offset, uint8_t data);
DECLARE_WRITE_LINE_MEMBER( intrq_w ) { m_intrq_cb(state); }
DECLARE_WRITE_LINE_MEMBER( drq_w) { m_drq_cb(state); }
@@ -66,8 +66,8 @@ private:
class device_bbc_fdc_interface : public device_slot_card_interface
{
public:
- virtual DECLARE_READ8_MEMBER(read) { return 0xff; }
- virtual DECLARE_WRITE8_MEMBER(write) { }
+ virtual uint8_t read(offs_t offset) { return 0xff; }
+ virtual void write(offs_t offset, uint8_t data) { }
protected:
device_bbc_fdc_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/bbc/fdc/microware.cpp b/src/devices/bus/bbc/fdc/microware.cpp
index 29489af382c..477ac0f3f9e 100644
--- a/src/devices/bus/bbc/fdc/microware.cpp
+++ b/src/devices/bus/bbc/fdc/microware.cpp
@@ -101,7 +101,7 @@ void bbc_microware_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_microware_device::read)
+uint8_t bbc_microware_device::read(offs_t offset)
{
uint8_t data;
@@ -116,7 +116,7 @@ READ8_MEMBER(bbc_microware_device::read)
return data;
}
-WRITE8_MEMBER(bbc_microware_device::write)
+void bbc_microware_device::write(offs_t offset, uint8_t data)
{
if (offset & 0x04)
{
diff --git a/src/devices/bus/bbc/fdc/microware.h b/src/devices/bus/bbc/fdc/microware.h
index 117159b407d..61c0cb358cf 100644
--- a/src/devices/bus/bbc/fdc/microware.h
+++ b/src/devices/bus/bbc/fdc/microware.h
@@ -42,8 +42,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER(read) override;
- virtual DECLARE_WRITE8_MEMBER(write) override;
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
private:
DECLARE_FLOPPY_FORMATS(floppy_formats);
diff --git a/src/devices/bus/bbc/fdc/opus.cpp b/src/devices/bus/bbc/fdc/opus.cpp
index f25de315c58..f6b07df6bcb 100644
--- a/src/devices/bus/bbc/fdc/opus.cpp
+++ b/src/devices/bus/bbc/fdc/opus.cpp
@@ -212,7 +212,7 @@ void bbc_opusfdc_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_opus8272_device::read)
+uint8_t bbc_opus8272_device::read(offs_t offset)
{
uint8_t data = 0xff;
@@ -227,20 +227,20 @@ READ8_MEMBER(bbc_opus8272_device::read)
if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(1);
if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(1);
case 0x04:
- data = m_fdc->msr_r(space, 0);
+ data = m_fdc->msr_r();
break;
case 0x05:
if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(0);
if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(0);
case 0x07:
- data = m_fdc->fifo_r(space, 0);
+ data = m_fdc->fifo_r();
break;
}
return data;
}
-WRITE8_MEMBER(bbc_opus8272_device::write)
+void bbc_opus8272_device::write(offs_t offset, uint8_t data)
{
floppy_image_device *floppy = nullptr;
@@ -259,13 +259,13 @@ WRITE8_MEMBER(bbc_opus8272_device::write)
if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(0);
if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(0);
case 0x07:
- m_fdc->fifo_w(space, 0, data);
+ m_fdc->fifo_w(data);
break;
}
}
-READ8_MEMBER(bbc_opusfdc_device::read)
+uint8_t bbc_opusfdc_device::read(offs_t offset)
{
uint8_t data;
@@ -280,7 +280,7 @@ READ8_MEMBER(bbc_opusfdc_device::read)
return data;
}
-WRITE8_MEMBER(bbc_opusfdc_device::write)
+void bbc_opusfdc_device::write(offs_t offset, uint8_t data)
{
if (offset & 0x04)
{
diff --git a/src/devices/bus/bbc/fdc/opus.h b/src/devices/bus/bbc/fdc/opus.h
index 721f3ebab5c..033fccc02c4 100644
--- a/src/devices/bus/bbc/fdc/opus.h
+++ b/src/devices/bus/bbc/fdc/opus.h
@@ -36,8 +36,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER(read) override;
- virtual DECLARE_WRITE8_MEMBER(write) override;
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
private:
required_device<i8272a_device> m_fdc;
@@ -62,8 +62,8 @@ protected:
// device-level overrides
virtual void device_start() override;
- virtual DECLARE_READ8_MEMBER(read) override;
- virtual DECLARE_WRITE8_MEMBER(write) override;
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
required_device<wd_fdc_device_base> m_fdc;
required_device<floppy_connector> m_floppy0;
diff --git a/src/devices/bus/bbc/fdc/watford.cpp b/src/devices/bus/bbc/fdc/watford.cpp
index b888840314f..4c3f31344ee 100644
--- a/src/devices/bus/bbc/fdc/watford.cpp
+++ b/src/devices/bus/bbc/fdc/watford.cpp
@@ -147,7 +147,7 @@ void bbc_weddb3_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_weddb2_device::read)
+uint8_t bbc_weddb2_device::read(offs_t offset)
{
uint8_t data;
@@ -162,7 +162,7 @@ READ8_MEMBER(bbc_weddb2_device::read)
return data;
}
-WRITE8_MEMBER(bbc_weddb2_device::write)
+void bbc_weddb2_device::write(offs_t offset, uint8_t data)
{
if (offset & 0x04)
{
@@ -192,7 +192,7 @@ WRITE8_MEMBER(bbc_weddb2_device::write)
}
}
-READ8_MEMBER(bbc_weddb3_device::read)
+uint8_t bbc_weddb3_device::read(offs_t offset)
{
uint8_t data;
@@ -207,7 +207,7 @@ READ8_MEMBER(bbc_weddb3_device::read)
return data;
}
-WRITE8_MEMBER(bbc_weddb3_device::write)
+void bbc_weddb3_device::write(offs_t offset, uint8_t data)
{
if (offset & 0x04)
{
diff --git a/src/devices/bus/bbc/fdc/watford.h b/src/devices/bus/bbc/fdc/watford.h
index 02bbf59f523..2f1cfa65c64 100644
--- a/src/devices/bus/bbc/fdc/watford.h
+++ b/src/devices/bus/bbc/fdc/watford.h
@@ -45,8 +45,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER(read) override;
- virtual DECLARE_WRITE8_MEMBER(write) override;
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
private:
required_device<wd_fdc_device_base> m_fdc;
@@ -68,8 +68,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER(read) override;
- virtual DECLARE_WRITE8_MEMBER(write) override;
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
private:
required_device<wd_fdc_device_base> m_fdc;
diff --git a/src/devices/bus/bbc/joyport/joyport.cpp b/src/devices/bus/bbc/joyport/joyport.cpp
index 5ed3f8d2fff..0c1bae50ee2 100644
--- a/src/devices/bus/bbc/joyport/joyport.cpp
+++ b/src/devices/bus/bbc/joyport/joyport.cpp
@@ -91,11 +91,11 @@ void bbc_joyport_slot_device::device_reset()
// pb_r
//-------------------------------------------------
-READ8_MEMBER(bbc_joyport_slot_device::pb_r)
+uint8_t bbc_joyport_slot_device::pb_r()
{
// TODO: Joyport connected to PB0-PB4 only. PB5-PB7 are expansion port.
if (m_device)
- return 0xe0 | m_device->pb_r(space, 0);
+ return 0xe0 | m_device->pb_r();
else
return 0xff;
}
@@ -105,10 +105,10 @@ READ8_MEMBER(bbc_joyport_slot_device::pb_r)
// pb_w
//-------------------------------------------------
-WRITE8_MEMBER(bbc_joyport_slot_device::pb_w)
+void bbc_joyport_slot_device::pb_w(uint8_t data)
{
if (m_device)
- m_device->pb_w(space, 0, data);
+ m_device->pb_w(data);
}
diff --git a/src/devices/bus/bbc/joyport/joyport.h b/src/devices/bus/bbc/joyport/joyport.h
index 572e41f7612..6abda62633d 100644
--- a/src/devices/bus/bbc/joyport/joyport.h
+++ b/src/devices/bus/bbc/joyport/joyport.h
@@ -64,8 +64,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(cb1_w) { m_cb1_handler(state); }
DECLARE_WRITE_LINE_MEMBER(cb2_w) { m_cb2_handler(state); }
- DECLARE_READ8_MEMBER(pb_r);
- DECLARE_WRITE8_MEMBER(pb_w);
+ uint8_t pb_r();
+ void pb_w(uint8_t data);
protected:
// device-level overrides
@@ -86,8 +86,8 @@ private:
class device_bbc_joyport_interface : public device_slot_card_interface
{
public:
- virtual DECLARE_READ8_MEMBER(pb_r) { return 0xff; }
- virtual DECLARE_WRITE8_MEMBER(pb_w) { }
+ virtual uint8_t pb_r() { return 0xff; }
+ virtual void pb_w(uint8_t data) { }
protected:
device_bbc_joyport_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/bbc/joyport/joystick.cpp b/src/devices/bus/bbc/joyport/joystick.cpp
index 5f4047c13a3..d53186f118d 100644
--- a/src/devices/bus/bbc/joyport/joystick.cpp
+++ b/src/devices/bus/bbc/joyport/joystick.cpp
@@ -78,7 +78,7 @@ void bbcmc_joystick_device::device_reset()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbcmc_joystick_device::pb_r)
+uint8_t bbcmc_joystick_device::pb_r()
{
return m_joy->read();
}
diff --git a/src/devices/bus/bbc/joyport/joystick.h b/src/devices/bus/bbc/joyport/joystick.h
index 0e9cea22716..8d0cc5a0458 100644
--- a/src/devices/bus/bbc/joyport/joystick.h
+++ b/src/devices/bus/bbc/joyport/joystick.h
@@ -36,7 +36,7 @@ protected:
virtual void device_start() override;
virtual void device_reset() override;
- virtual DECLARE_READ8_MEMBER(pb_r) override;
+ virtual uint8_t pb_r() override;
private:
required_ioport m_joy;
diff --git a/src/devices/bus/bbc/rom/dfs.cpp b/src/devices/bus/bbc/rom/dfs.cpp
new file mode 100644
index 00000000000..8a3aac6d588
--- /dev/null
+++ b/src/devices/bus/bbc/rom/dfs.cpp
@@ -0,0 +1,63 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro MRM E00 DFS emulation
+
+ Comprises of 8K ROM and 2K/4K? RAM on a carrier board, with flying lead
+ to RW line to enable writing to RAM.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "dfs.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_MRME00, bbc_mrme00_device, "bbc_mrme00", "BBC Micro MRM E00 DFS")
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_rom_device - constructor
+//-------------------------------------------------
+
+bbc_mrme00_device::bbc_mrme00_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_MRME00, tag, owner, clock)
+ , device_bbc_rom_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_mrme00_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// read
+//-------------------------------------------------
+
+uint8_t bbc_mrme00_device::read(offs_t offset)
+{
+ if (offset < get_rom_size())
+ return get_rom_base()[offset & (get_rom_size() - 1)];
+ else
+ return get_ram_base()[offset & (get_ram_size() - 1)];
+}
+
+//-------------------------------------------------
+// write
+//-------------------------------------------------
+
+void bbc_mrme00_device::write(offs_t offset, uint8_t data)
+{
+ get_ram_base()[offset & (get_ram_size() - 1)] = data;
+}
diff --git a/src/devices/bus/bbc/rom/dfs.h b/src/devices/bus/bbc/rom/dfs.h
new file mode 100644
index 00000000000..b76a7ab26ed
--- /dev/null
+++ b/src/devices/bus/bbc/rom/dfs.h
@@ -0,0 +1,42 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro MRM E00 DFS emulation
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_ROM_DFS_H
+#define MAME_BUS_BBC_ROM_DFS_H
+
+#pragma once
+
+#include "slot.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_mrme00_device
+
+class bbc_mrme00_device : public device_t,
+ public device_bbc_rom_interface
+{
+public:
+ // construction/destruction
+ bbc_mrme00_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_MRME00, bbc_mrme00_device)
+
+
+#endif // MAME_BUS_BBC_ROM_DFS_H
diff --git a/src/devices/bus/bbc/rom/pal.cpp b/src/devices/bus/bbc/rom/pal.cpp
new file mode 100644
index 00000000000..51667f70955
--- /dev/null
+++ b/src/devices/bus/bbc/rom/pal.cpp
@@ -0,0 +1,312 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro PALPROM carrier boards
+
+ Computer Concepts PALPROM carrier boards (PAL16R4):
+ These were the first to provide a 32K ROM banked into a 16K slot using
+ a PAL to perform the switching upon reads from pre-programmed zones. In
+ addition to being able to provide larger ROM based applications such
+ as Inter-Word and Inter-Base, it also served as copy protection since
+ the carrier board and PAL would have to be reproduced to support the
+ ROM.
+ Other publishers such as Beebug and PMS also used the carrier boards
+ and PAL provided by Computer Concepts.
+
+ Watford Electronics PALPROM carrier boards (PAL16L8):
+ The PALPROM device provides a means of running 32K software within the
+ space allocated to a 16K sideways ROM whilst providing a good degree of
+ software protection.
+ Within a PALPROM, a 32K EPROM is divided into 4 banks of 8K. These are
+ arranged in a 3 plus 1 arrangement. Bank 0, which occupies &8000 to
+ &9FFF is permanently enabled, whilst banks 1 to 3, which occupy the
+ region &A000 to &BFFF, are swapped in one at a time. This swapping is
+ made by performing an access to a special switching zone, of which there
+ are 8 in total. Accessing a switching zone, which is 32 bytes in length
+ and aligned to start on a 32 byte boundary, selects a pre-specified bank
+ (1 to 3)
+
+ P.R.E.S. PALPROM carrier boards:
+ This was based on the Computer Concepts carrier board.
+
+ Instant Mini Office 2:
+ Not a PALPROM carrier board but a larger ROM carrier containing 4x32K
+ and TTL circuits to enable and page each ROM into 16K banks.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "pal.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_CCIWORD, bbc_cciword_device, "bbc_cciword", "Computer Concepts 32K ROM Carrier (Inter-Word)")
+DEFINE_DEVICE_TYPE(BBC_CCIBASE, bbc_ccibase_device, "bbc_ccibase", "Computer Concepts 64K ROM Carrier (Inter-Base)")
+DEFINE_DEVICE_TYPE(BBC_CCISPELL, bbc_ccispell_device, "bbc_ccispell", "Computer Concepts 128K ROM Carrier (SpellMaster)")
+DEFINE_DEVICE_TYPE(BBC_PALQST, bbc_palqst_device, "bbc_palqst", "Watford Electronics ROM Carrier (Quest Paint)")
+DEFINE_DEVICE_TYPE(BBC_PALWAP, bbc_palwap_device, "bbc_palwap", "Watford Electronics ROM Carrier (Wapping Editor)")
+DEFINE_DEVICE_TYPE(BBC_PALTED, bbc_palted_device, "bbc_palted", "Watford Electronics ROM Carrier (TED)")
+DEFINE_DEVICE_TYPE(BBC_PALABEP, bbc_palabep_device, "bbc_palabep", "P.R.E.S. 32K ROM Carrier (ABE+)")
+DEFINE_DEVICE_TYPE(BBC_PALABE, bbc_palabe_device, "bbc_palabe", "P.R.E.S. 32K ROM Carrier (ABE)")
+DEFINE_DEVICE_TYPE(BBC_PALMO2, bbc_palmo2_device, "bbc_palmo2", "Instant Mini Office 2 ROM Carrier")
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_palprom_device - constructor
+//-------------------------------------------------
+
+bbc_pal_device::bbc_pal_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_rom_interface(mconfig, *this)
+ , m_bank(0)
+{
+}
+
+bbc_cciword_device::bbc_cciword_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_pal_device(mconfig, BBC_CCIWORD, tag, owner, clock)
+{
+}
+
+bbc_ccibase_device::bbc_ccibase_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_pal_device(mconfig, BBC_CCIBASE, tag, owner, clock)
+{
+}
+
+bbc_ccispell_device::bbc_ccispell_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_pal_device(mconfig, BBC_CCISPELL, tag, owner, clock)
+{
+}
+
+bbc_palqst_device::bbc_palqst_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_pal_device(mconfig, BBC_PALQST, tag, owner, clock)
+{
+}
+
+bbc_palwap_device::bbc_palwap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_pal_device(mconfig, BBC_PALWAP, tag, owner, clock)
+{
+}
+
+bbc_palted_device::bbc_palted_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_pal_device(mconfig, BBC_PALTED, tag, owner, clock)
+{
+}
+
+bbc_palabep_device::bbc_palabep_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_pal_device(mconfig, BBC_PALABEP, tag, owner, clock)
+{
+}
+
+bbc_palabe_device::bbc_palabe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_pal_device(mconfig, BBC_PALABE, tag, owner, clock)
+{
+}
+
+bbc_palmo2_device::bbc_palmo2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_pal_device(mconfig, BBC_PALMO2, tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_pal_device::device_start()
+{
+ save_item(NAME(m_bank));
+}
+
+//-------------------------------------------------
+// read
+//-------------------------------------------------
+
+uint8_t bbc_cciword_device::read(offs_t offset)
+{
+ if (!machine().side_effects_disabled())
+ {
+ /* switching zones for Inter-Word */
+ switch (offset & 0x3fe0)
+ {
+ case 0x0060:
+ case 0x3fc0: m_bank = 0; break;
+ case 0x0040:
+ case 0x3fa0:
+ case 0x3fe0: m_bank = 1; break;
+ }
+ }
+
+ return get_rom_base()[(offset & 0x3fff) | (m_bank << 14)];
+}
+
+uint8_t bbc_ccibase_device::read(offs_t offset)
+{
+ if (!machine().side_effects_disabled())
+ {
+ /* switching zones for Inter-Base */
+ switch (offset & 0x3fe0)
+ {
+ case 0x3f80: m_bank = 0; break;
+ case 0x3fa0: m_bank = 1; break;
+ case 0x3fc0: m_bank = 2; break;
+ case 0x3fe0: m_bank = 3; break;
+ }
+ }
+
+ return get_rom_base()[(offset & 0x3fff) | (m_bank << 14)];
+}
+
+uint8_t bbc_ccispell_device::read(offs_t offset)
+{
+ if (!machine().side_effects_disabled())
+ {
+ /* switching zones for SpellMaster */
+ if (offset == 0x3fe0)
+ {
+ m_bank = 0;
+ }
+ else if (m_bank == 0)
+ {
+ switch (offset & 0x3fe0)
+ {
+ case 0x3fc0: m_bank = 1; break;
+ case 0x3fa0: m_bank = 2; break;
+ case 0x3f80: m_bank = 3; break;
+ case 0x3f60: m_bank = 4; break;
+ case 0x3f40: m_bank = 5; break;
+ case 0x3f20: m_bank = 6; break;
+ case 0x3f00: m_bank = 7; break;
+ }
+ }
+ }
+
+ return get_rom_base()[(offset & 0x3fff) | (m_bank << 14)];
+}
+
+uint8_t bbc_palqst_device::read(offs_t offset)
+{
+ if (!machine().side_effects_disabled())
+ {
+ /* switching zones for Quest Paint and ConQuest */
+ switch (offset & 0x3fe0)
+ {
+ case 0x0820: m_bank = 2; break;
+ case 0x11e0: m_bank = 1; break;
+ case 0x12c0: m_bank = 3; break;
+ case 0x1340: m_bank = 0; break;
+ }
+ }
+
+ if (offset & 0x2000)
+ {
+ return get_rom_base()[(offset & 0x1fff) | (m_bank << 13)];
+ }
+ else
+ {
+ return get_rom_base()[offset & 0x1fff];
+ }
+}
+
+uint8_t bbc_palwap_device::read(offs_t offset)
+{
+ if (!machine().side_effects_disabled())
+ {
+ /* switching zones for Wapping Editor */
+ switch (offset & 0x3fe0)
+ {
+ case 0x1f00: m_bank = 0; break;
+ case 0x1f20: m_bank = 1; break;
+ case 0x1f40: m_bank = 2; break;
+ case 0x1f60: m_bank = 3; break;
+ case 0x1f80: m_bank = 4; break;
+ case 0x1fa0: m_bank = 5; break;
+ case 0x1fc0: m_bank = 6; break;
+ case 0x1fe0: m_bank = 7; break;
+ }
+ }
+
+ if (offset & 0x2000)
+ {
+ return get_rom_base()[(offset & 0x1fff) | (m_bank << 13)];
+ }
+ else
+ {
+ return get_rom_base()[offset & 0x1fff];
+ }
+}
+
+uint8_t bbc_palted_device::read(offs_t offset)
+{
+ if (!machine().side_effects_disabled())
+ {
+ /* switching zones for TED */
+ switch (offset & 0x3fe0)
+ {
+ case 0x1f80: m_bank = 0; break;
+ case 0x1fa0: m_bank = 1; break;
+ case 0x1fc0: m_bank = 2; break;
+ case 0x1fe0: m_bank = 3; break;
+ }
+ }
+
+ if (offset & 0x2000)
+ {
+ return get_rom_base()[(offset & 0x1fff) | (m_bank << 13)];
+ }
+ else
+ {
+ return get_rom_base()[offset & 0x1fff];
+ }
+}
+
+uint8_t bbc_palabep_device::read(offs_t offset)
+{
+ if (!machine().side_effects_disabled())
+ {
+ /* switching zones for Advanced BASIC Editor Plus */
+ switch (offset & 0x3ffc)
+ {
+ case 0x3ff8: m_bank = 0; break;
+ case 0x3ffc: m_bank = 1; break;
+ }
+ }
+
+ return get_rom_base()[(offset & 0x3fff) | (m_bank << 14)];
+}
+
+uint8_t bbc_palabe_device::read(offs_t offset)
+{
+ if (!machine().side_effects_disabled())
+ {
+ /* switching zones for Advanced BASIC Editor */
+ switch (offset & 0x3ffc)
+ {
+ case 0x3ff8: m_bank = 1; break;
+ case 0x3ffc: m_bank = 0; break;
+ }
+ }
+
+ return get_rom_base()[(offset & 0x3fff) | (m_bank << 14)];
+}
+
+uint8_t bbc_palmo2_device::read(offs_t offset)
+{
+ if (!machine().side_effects_disabled())
+ {
+ /* switching zones for Instant Mini Office 2 */
+ switch (offset & 0x3ff0)
+ {
+ case 0x2000: m_bank = offset & 0x0f; break;
+ }
+ }
+
+ return get_rom_base()[(offset & 0x3fff) | (m_bank << 13)];
+}
diff --git a/src/devices/bus/bbc/rom/pal.h b/src/devices/bus/bbc/rom/pal.h
new file mode 100644
index 00000000000..31c8dcd0d78
--- /dev/null
+++ b/src/devices/bus/bbc/rom/pal.h
@@ -0,0 +1,167 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro PALPROM carrier boards
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_ROM_PAL_H
+#define MAME_BUS_BBC_ROM_PAL_H
+
+#pragma once
+
+#include "slot.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_pal_device
+
+class bbc_pal_device : public device_t,
+ public device_bbc_rom_interface
+{
+protected:
+ // construction/destruction
+ bbc_pal_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;
+
+ // device_bbc_rom_interface overrides
+ virtual uint32_t get_rom_size() override { return 0x4000; }
+
+ uint8_t m_bank;
+};
+
+// ======================> bbc_cciword_device
+
+class bbc_cciword_device : public bbc_pal_device
+{
+public:
+ // construction/destruction
+ bbc_cciword_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+};
+
+// ======================> bbc_ccibase_device
+
+class bbc_ccibase_device : public bbc_pal_device
+{
+public:
+ // construction/destruction
+ bbc_ccibase_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+};
+
+// ======================> bbc_ccispell_device
+
+class bbc_ccispell_device : public bbc_pal_device
+{
+public:
+ // construction/destruction
+ bbc_ccispell_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+};
+
+// ======================> bbc_palqst_device
+
+class bbc_palqst_device : public bbc_pal_device
+{
+public:
+ bbc_palqst_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+};
+
+// ======================> bbc_palwap_device
+
+class bbc_palwap_device : public bbc_pal_device
+{
+public:
+ bbc_palwap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+};
+
+// ======================> bbc_palted_device
+
+class bbc_palted_device : public bbc_pal_device
+{
+public:
+ // construction/destruction
+ bbc_palted_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+};
+
+// ======================> bbc_palabep_device
+
+class bbc_palabep_device : public bbc_pal_device
+{
+public:
+ // construction/destruction
+ bbc_palabep_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+};
+
+// ======================> bbc_palabe_device
+
+class bbc_palabe_device : public bbc_pal_device
+{
+public:
+ // construction/destruction
+ bbc_palabe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+};
+
+// ======================> bbc_palmo2_device
+
+class bbc_palmo2_device : public bbc_pal_device
+{
+public:
+ // construction/destruction
+ bbc_palmo2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_CCIWORD, bbc_cciword_device)
+DECLARE_DEVICE_TYPE(BBC_CCIBASE, bbc_ccibase_device)
+DECLARE_DEVICE_TYPE(BBC_CCISPELL, bbc_ccispell_device)
+DECLARE_DEVICE_TYPE(BBC_PALQST, bbc_palqst_device)
+DECLARE_DEVICE_TYPE(BBC_PALWAP, bbc_palwap_device)
+DECLARE_DEVICE_TYPE(BBC_PALTED, bbc_palted_device)
+DECLARE_DEVICE_TYPE(BBC_PALABEP, bbc_palabep_device)
+DECLARE_DEVICE_TYPE(BBC_PALABE, bbc_palabe_device)
+DECLARE_DEVICE_TYPE(BBC_PALMO2, bbc_palmo2_device)
+
+
+#endif // MAME_BUS_BBC_ROM_PAL_H
diff --git a/src/devices/bus/bbc/rom/ram.cpp b/src/devices/bus/bbc/rom/ram.cpp
new file mode 100644
index 00000000000..0d626955812
--- /dev/null
+++ b/src/devices/bus/bbc/rom/ram.cpp
@@ -0,0 +1,57 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro Sideways RAM emulation
+
+***************************************************************************/
+
+#include "emu.h"
+#include "ram.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_RAM, bbc_ram_device, "bbc_ram", "BBC Micro Sideways RAM")
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_ram_device - constructor
+//-------------------------------------------------
+
+bbc_ram_device::bbc_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_RAM, tag, owner, clock)
+ , device_bbc_rom_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_ram_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// read
+//-------------------------------------------------
+
+uint8_t bbc_ram_device::read(offs_t offset)
+{
+ return get_ram_base()[offset & (get_ram_size() - 1)];
+}
+
+//-------------------------------------------------
+// write
+//-------------------------------------------------
+
+void bbc_ram_device::write(offs_t offset, uint8_t data)
+{
+ get_ram_base()[offset & (get_ram_size() - 1)] = data;
+}
diff --git a/src/devices/bus/bbc/rom/ram.h b/src/devices/bus/bbc/rom/ram.h
new file mode 100644
index 00000000000..85267147a35
--- /dev/null
+++ b/src/devices/bus/bbc/rom/ram.h
@@ -0,0 +1,42 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro Sideways RAM emulation
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_ROM_RAM_H
+#define MAME_BUS_BBC_ROM_RAM_H
+
+#pragma once
+
+#include "slot.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_ram_device
+
+class bbc_ram_device : public device_t,
+ public device_bbc_rom_interface
+{
+public:
+ // construction/destruction
+ bbc_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_RAM, bbc_ram_device)
+
+#endif // MAME_BUS_BBC_ROM_RAM_H
diff --git a/src/devices/bus/bbc/rom/rom.cpp b/src/devices/bus/bbc/rom/rom.cpp
new file mode 100644
index 00000000000..f798de11c6a
--- /dev/null
+++ b/src/devices/bus/bbc/rom/rom.cpp
@@ -0,0 +1,50 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro Sideways ROM emulation
+
+***************************************************************************/
+
+#include "emu.h"
+#include "rom.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_ROM, bbc_rom_device, "bbc_rom", "BBC Micro Sideways ROM")
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_rom_device - constructor
+//-------------------------------------------------
+
+bbc_rom_device::bbc_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_ROM, tag, owner, clock)
+ , device_bbc_rom_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_rom_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// read
+//-------------------------------------------------
+
+uint8_t bbc_rom_device::read(offs_t offset)
+{
+ uint32_t size = std::min((int32_t)get_rom_size(), 0x4000);
+
+ return get_rom_base()[offset & (size - 1)];
+}
diff --git a/src/devices/bus/bbc/rom/rom.h b/src/devices/bus/bbc/rom/rom.h
new file mode 100644
index 00000000000..282e5471781
--- /dev/null
+++ b/src/devices/bus/bbc/rom/rom.h
@@ -0,0 +1,41 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro Sideways ROM emulation
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_ROM_ROM_H
+#define MAME_BUS_BBC_ROM_ROM_H
+
+#pragma once
+
+#include "slot.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_rom_device
+
+class bbc_rom_device : public device_t,
+ public device_bbc_rom_interface
+{
+public:
+ // construction/destruction
+ bbc_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_ROM, bbc_rom_device)
+
+
+#endif // MAME_BUS_BBC_ROM_ROM_H
diff --git a/src/devices/bus/bbc/rom/rtc.cpp b/src/devices/bus/bbc/rom/rtc.cpp
new file mode 100644
index 00000000000..7d73c24b53e
--- /dev/null
+++ b/src/devices/bus/bbc/rom/rtc.cpp
@@ -0,0 +1,124 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Solidisk Real Time Clock
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Solidisk_RTC.html
+
+ PMS Genie Watch (RTC for the BBC)
+
+***************************************************************************/
+
+#include "emu.h"
+#include "rtc.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_STLRTC, bbc_stlrtc_device, "bbc_stlrtc", "Solidisk Real Time Clock")
+DEFINE_DEVICE_TYPE(BBC_PMSRTC, bbc_pmsrtc_device, "bbc_pmsrtc", "PMS Genie Real Time Clock")
+
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_stlrtc_device::device_add_mconfig(machine_config &config)
+{
+ MC146818(config, m_rtc, 32.768_kHz_XTAL); // TODO: verify clock
+}
+
+void bbc_pmsrtc_device::device_add_mconfig(machine_config &config)
+{
+ /* Dallas DS1216 SmartWatch RAM */
+ DS1315(config, m_rtc, 0);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_stlrtc_device - constructor
+//-------------------------------------------------
+
+bbc_stlrtc_device::bbc_stlrtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_STLRTC, tag, owner, clock)
+ , device_bbc_rom_interface(mconfig, *this)
+ , m_rtc(*this, "rtc")
+{
+}
+
+bbc_pmsrtc_device::bbc_pmsrtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_PMSRTC, tag, owner, clock)
+ , device_bbc_rom_interface(mconfig, *this)
+ , m_rtc(*this, "rtc")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_stlrtc_device::device_start()
+{
+}
+
+void bbc_pmsrtc_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// read
+//-------------------------------------------------
+
+uint8_t bbc_stlrtc_device::read(offs_t offset)
+{
+ uint8_t data = get_rom_base()[offset & 0x3fff];
+
+ switch (offset & 0x3fc0)
+ {
+ case 0x3e00:
+ data = m_rtc->read(1);
+ break;
+ case 0x3e40:
+ if (!machine().side_effects_disabled())
+ m_rtc->write(0, data);
+ break;
+ case 0x3e80:
+ case 0x3ec0:
+ data = m_rtc->read(0);
+ break;
+ case 0x3f00:
+ case 0x3f40:
+ case 0x3f80:
+ case 0x3fc0:
+ if (!machine().side_effects_disabled())
+ m_rtc->write(1, data);
+ break;
+ }
+ return data;
+}
+
+uint8_t bbc_pmsrtc_device::read(offs_t offset)
+{
+ uint8_t data = get_rom_base()[offset & 0x1fff];
+
+ switch (offset)
+ {
+ case 0x00:
+ data |= m_rtc->read_0();
+ break;
+ case 0x01:
+ data |= m_rtc->read_1();
+ break;
+ case 0x04:
+ if (m_rtc->chip_enable())
+ data = m_rtc->read_data() & 0x01;
+ break;
+ }
+ return data;
+}
diff --git a/src/devices/bus/bbc/rom/rtc.h b/src/devices/bus/bbc/rom/rtc.h
new file mode 100644
index 00000000000..d37b2174b9b
--- /dev/null
+++ b/src/devices/bus/bbc/rom/rtc.h
@@ -0,0 +1,72 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Solidisk Real Time Clock emulation
+
+ PMS Genie Watch (RTC for the BBC)
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_ROM_RTC_H
+#define MAME_BUS_BBC_ROM_RTC_H
+
+#pragma once
+
+#include "slot.h"
+#include "machine/mc146818.h"
+#include "machine/ds1315.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_stlrtc_device
+
+class bbc_stlrtc_device : public device_t,
+ public device_bbc_rom_interface
+{
+public:
+ // construction/destruction
+ bbc_stlrtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual void device_start() override;
+
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+
+private:
+ required_device<mc146818_device> m_rtc;
+};
+
+// ======================> bbc_pmsrtc_device
+
+class bbc_pmsrtc_device : public device_t,
+ public device_bbc_rom_interface
+{
+public:
+ // construction/destruction
+ bbc_pmsrtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual void device_start() override;
+
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+
+private:
+ required_device<ds1315_device> m_rtc;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_STLRTC, bbc_stlrtc_device)
+DECLARE_DEVICE_TYPE(BBC_PMSRTC, bbc_pmsrtc_device)
+
+#endif // MAME_BUS_BBC_ROM_RTC_H
diff --git a/src/devices/bus/bbc/rom/slot.cpp b/src/devices/bus/bbc/rom/slot.cpp
new file mode 100644
index 00000000000..af8ae212d6d
--- /dev/null
+++ b/src/devices/bus/bbc/rom/slot.cpp
@@ -0,0 +1,234 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/*********************************************************************
+
+ BBC Micro ROM slot emulation
+
+*********************************************************************/
+
+#include "emu.h"
+#include "slot.h"
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_ROMSLOT16, bbc_romslot16_device, "bbc_romslot16", "BBC Micro 16K ROM Slot")
+DEFINE_DEVICE_TYPE(BBC_ROMSLOT32, bbc_romslot32_device, "bbc_romslot32", "BBC Micro 32K ROM Slot")
+
+
+//**************************************************************************
+// DEVICE BBC_ROMSLOT CARD INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// device_bbc_rom_interface - constructor
+//-------------------------------------------------
+
+device_bbc_rom_interface::device_bbc_rom_interface(const machine_config &mconfig, device_t &device)
+ : device_slot_card_interface(mconfig, device)
+ , m_rom(nullptr)
+ , m_rom_size(0)
+{
+}
+
+
+//-------------------------------------------------
+// ~device_bbc_rom_interface - destructor
+//-------------------------------------------------
+
+device_bbc_rom_interface::~device_bbc_rom_interface()
+{
+}
+
+//-------------------------------------------------
+// rom_alloc - alloc the space for the ROM
+//-------------------------------------------------
+
+void device_bbc_rom_interface::rom_alloc(uint32_t size, const char *tag)
+{
+ if (m_rom == nullptr)
+ {
+ m_rom = device().machine().memory().region_alloc(std::string(tag).append(BBC_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
+ m_rom_size = size;
+ }
+}
+
+//-------------------------------------------------
+// ram_alloc - alloc the space for the RAM
+//-------------------------------------------------
+
+void device_bbc_rom_interface::ram_alloc(uint32_t size)
+{
+ m_ram.resize(size);
+ device().save_item(NAME(m_ram));
+}
+
+//-------------------------------------------------
+// nvram_alloc - alloc the space for the NVRAM
+//-------------------------------------------------
+
+void device_bbc_rom_interface::nvram_alloc(uint32_t size)
+{
+ m_nvram.resize(size);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_romslot_device - constructor
+//-------------------------------------------------
+bbc_romslot_device::bbc_romslot_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_image_interface(mconfig, *this)
+ , device_slot_interface(mconfig, *this)
+ , m_cart(nullptr)
+{
+}
+
+bbc_romslot16_device::bbc_romslot16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_romslot_device(mconfig, BBC_ROMSLOT16, tag, owner, clock)
+{
+}
+
+bbc_romslot32_device::bbc_romslot32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_romslot_device(mconfig, BBC_ROMSLOT32, tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_romslot_device::device_start()
+{
+ m_cart = dynamic_cast<device_bbc_rom_interface *>(get_card_device());
+}
+
+
+//-------------------------------------------------
+// call load
+//-------------------------------------------------
+
+image_init_result bbc_romslot_device::call_load()
+{
+ if (m_cart)
+ {
+ uint32_t size = !loaded_through_softlist() ? length() : get_software_region_length("rom");
+
+ if (size % 0x2000)
+ {
+ seterror(IMAGE_ERROR_INVALIDIMAGE, "Invalid ROM size");
+ return image_init_result::FAIL;
+ }
+
+ m_cart->rom_alloc(size, tag());
+
+ if (!loaded_through_softlist())
+ fread(m_cart->get_rom_base(), size);
+ else
+ memcpy(m_cart->get_rom_base(), get_software_region("rom"), size);
+
+ if (get_software_region("ram"))
+ m_cart->ram_alloc(get_software_region_length("ram"));
+
+ if (get_software_region("nvram"))
+ m_cart->nvram_alloc(get_software_region_length("nvram"));
+ }
+
+ return image_init_result::PASS;
+}
+
+//-------------------------------------------------
+// call_unload
+//-------------------------------------------------
+
+void bbc_romslot_device::call_unload()
+{
+ if (m_cart && m_cart->get_nvram_base() && m_cart->get_nvram_size())
+ battery_save(m_cart->get_nvram_base(), m_cart->get_nvram_size());
+}
+
+
+//-------------------------------------------------
+// get default card software
+//-------------------------------------------------
+
+std::string bbc_romslot_device::get_default_card_software(get_default_card_software_hook &hook) const
+{
+ return software_get_default_slot("rom");
+}
+
+
+//-------------------------------------------------
+// rom size
+//-------------------------------------------------
+
+uint32_t bbc_romslot_device::get_rom_size()
+{
+ if (m_cart)
+ return m_cart->get_rom_size();
+ else
+ return 0;
+}
+
+
+//-------------------------------------------------
+// read - rom read
+//-------------------------------------------------
+
+uint8_t bbc_romslot_device::read(offs_t offset)
+{
+ if (m_cart)
+ return m_cart->read(offset);
+ else
+ return 0xff;
+}
+
+
+//-------------------------------------------------
+// write - rom write
+//-------------------------------------------------
+
+void bbc_romslot_device::write(offs_t offset, uint8_t data)
+{
+ if (m_cart)
+ m_cart->write(offset, data);
+}
+
+
+//-------------------------------------------------
+// SLOT_INTERFACE( bbc_rom )
+//-------------------------------------------------
+
+#include "rom.h"
+#include "ram.h"
+#include "dfs.h"
+//#include "genie.h"
+#include "pal.h"
+//#include "replay.h"
+#include "rtc.h"
+
+
+void bbc_rom_devices(device_slot_interface &device)
+{
+ device.option_add_internal("rom", BBC_ROM);
+ device.option_add_internal("ram", BBC_RAM);
+ device.option_add_internal("cciword", BBC_CCIWORD);
+ device.option_add_internal("ccibase", BBC_CCIBASE);
+ device.option_add_internal("ccispell", BBC_CCISPELL);
+ device.option_add_internal("palqst", BBC_PALQST);
+ device.option_add_internal("palwap", BBC_PALWAP);
+ device.option_add_internal("palted", BBC_PALTED);
+ device.option_add_internal("palabep", BBC_PALABEP);
+ device.option_add_internal("palabe", BBC_PALABE);
+ device.option_add_internal("palmo2", BBC_PALMO2);
+ //device.option_add_internal("genie", BBC_PMSGENIE);
+ device.option_add_internal("mrme00", BBC_MRME00);
+ //device.option_add_internal("replay", BBC_REPLAY);
+ device.option_add_internal("stlrtc", BBC_STLRTC);
+ device.option_add_internal("pmsrtc", BBC_PMSRTC);
+}
diff --git a/src/devices/bus/bbc/rom/slot.h b/src/devices/bus/bbc/rom/slot.h
new file mode 100644
index 00000000000..40818d9e619
--- /dev/null
+++ b/src/devices/bus/bbc/rom/slot.h
@@ -0,0 +1,155 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/*********************************************************************
+
+ BBC Micro ROM slot emulation
+
+*********************************************************************/
+
+#ifndef MAME_BUS_BBC_ROM_SLOT_H
+#define MAME_BUS_BBC_ROM_SLOT_H
+
+#pragma once
+
+#include "softlist_dev.h"
+
+
+#define BBC_ROM_REGION_TAG ":cart:rom"
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+// ======================> bbc_romslot_device
+
+class device_bbc_rom_interface;
+
+class bbc_romslot_device : public device_t,
+ public device_image_interface,
+ public device_slot_interface
+{
+public:
+ // image-level overrides
+ virtual image_init_result call_load() override;
+ virtual void call_unload() override;
+ virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
+
+ virtual iodevice_t image_type() const override { return IO_ROM; }
+ virtual bool is_readable() const override { return 1; }
+ virtual bool is_writeable() const override { return 0; }
+ virtual bool is_creatable() const override { return 0; }
+ virtual bool must_be_loaded() const override { return 0; }
+ virtual bool is_reset_on_load() const override { return 1; }
+ virtual const char *image_interface() const override { return "bbc_rom"; }
+ virtual const char *file_extensions() const override { return "rom,bin"; }
+
+ // slot interface overrides
+ virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override;
+
+ // reading and writing
+ uint8_t read(offs_t offset);
+ void write(offs_t offset, uint8_t data);
+
+ uint32_t get_rom_size();
+ uint32_t get_slot_size() const { return m_slot_size; }
+
+protected:
+ // construction/destruction
+ bbc_romslot_device(const machine_config &mconfig, device_type type, char const *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
+ uint32_t m_slot_size;
+
+private:
+ device_bbc_rom_interface* m_cart;
+};
+
+// ======================> bbc_romslot16_device
+
+class bbc_romslot16_device : public bbc_romslot_device
+{
+public:
+ // construction/destruction
+ template <typename T>
+ bbc_romslot16_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&slot_options, char const *default_option)
+ : bbc_romslot16_device(mconfig, tag, owner)
+ {
+ option_reset();
+ slot_options(*this);
+ set_default_option(default_option);
+ set_fixed(false);
+ m_slot_size = 0x4000;
+ }
+
+ bbc_romslot16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+};
+
+// ======================> bbc_romslot32_device
+
+class bbc_romslot32_device : public bbc_romslot_device
+{
+public:
+ // construction/destruction
+ template <typename T>
+ bbc_romslot32_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&slot_options, char const *default_option)
+ : bbc_romslot32_device(mconfig, tag, owner)
+ {
+ option_reset();
+ slot_options(*this);
+ set_default_option(default_option);
+ set_fixed(false);
+ m_slot_size = 0x8000;
+ }
+
+ bbc_romslot32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+};
+
+
+// ======================> device_bbc_rom_interface
+
+class device_bbc_rom_interface : public device_slot_card_interface
+{
+public:
+ // construction/destruction
+ virtual ~device_bbc_rom_interface();
+
+ // reading and writing
+ virtual uint8_t read(offs_t offset) { return 0xff; }
+ virtual void write(offs_t offset, uint8_t data) { m_device.logerror("unhandled ROM write to %04X = %02X\n", offset | 0x8000, data); }
+
+ void rom_alloc(uint32_t size, const char *tag);
+ void ram_alloc(uint32_t size);
+ void nvram_alloc(uint32_t size);
+
+ uint8_t* get_rom_base() { return m_rom; }
+ virtual uint32_t get_rom_size() { return m_rom_size; }
+
+ uint8_t* get_ram_base() { return &m_ram[0]; }
+ uint32_t get_ram_size() { return m_ram.size(); }
+
+ uint8_t* get_nvram_base() { return &m_nvram[0]; }
+ uint32_t get_nvram_size() { return m_nvram.size(); }
+
+protected:
+ device_bbc_rom_interface(const machine_config &mconfig, device_t &device);
+
+ bbc_romslot_device *m_slot;
+
+private:
+ // internal state
+ uint8_t *m_rom;
+ uint32_t m_rom_size;
+ std::vector<uint8_t> m_ram;
+ std::vector<uint8_t> m_nvram;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_ROMSLOT16, bbc_romslot16_device)
+DECLARE_DEVICE_TYPE(BBC_ROMSLOT32, bbc_romslot32_device)
+
+void bbc_rom_devices(device_slot_interface &device);
+
+#endif // MAME_BUS_BBC_ROM_SLOT_H
diff --git a/src/devices/bus/bbc/tube/tube.cpp b/src/devices/bus/bbc/tube/tube.cpp
index 2ac1bf5fb15..602ea3c845a 100644
--- a/src/devices/bus/bbc/tube/tube.cpp
+++ b/src/devices/bus/bbc/tube/tube.cpp
@@ -92,10 +92,10 @@ void bbc_tube_slot_device::device_reset()
// host_r
//-------------------------------------------------
-READ8_MEMBER(bbc_tube_slot_device::host_r)
+uint8_t bbc_tube_slot_device::host_r(offs_t offset)
{
if (m_card)
- return m_card->host_r(space, offset);
+ return m_card->host_r(offset);
else
return 0xfe;
}
@@ -104,14 +104,15 @@ READ8_MEMBER(bbc_tube_slot_device::host_r)
// host_w
//-------------------------------------------------
-WRITE8_MEMBER(bbc_tube_slot_device::host_w)
+void bbc_tube_slot_device::host_w(offs_t offset, uint8_t data)
{
if (m_card)
- m_card->host_w(space, offset, data);
+ m_card->host_w(offset, data);
}
// slot devices
+#include "tube_32016.h"
#include "tube_6502.h"
#include "tube_80186.h"
#include "tube_80286.h"
@@ -133,7 +134,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("32016", BBC_TUBE_32016); /* Acorn ANC05 32016 2nd processor */
+ 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 */
//device.option_add("a500", BBC_TUBE_A500); /* Acorn A500 2nd Processor */
@@ -142,8 +143,8 @@ void bbc_tube_devices(device_slot_interface &device)
//device.option_add("hdp68k", BBC_TUBE_HDP68K); /* Torch Unicorn (HDP68K) */
//device.option_add("x25", BBC_TUBE_X25); /* Econet X25 Gateway */
device.option_add("zep100", BBC_TUBE_ZEP100); /* Torch Z80 Communicator (ZEP100) (Torch) */
- //device.option_add("zep100l", BBC_TUBE_ZEP100L); /* Torch Z80 Communicator (ZEP100) (Acorn 8271) */
- //device.option_add("zep100w", BBC_TUBE_ZEP100W); /* Torch Z80 Communicator (ZEP100) (Acorn 1770) */
+ //device.option_add("zep100l", BBC_TUBE_ZEP100L); /* Torch Z80 Communicator (ZEP100) (Model B) */
+ //device.option_add("zep100w", BBC_TUBE_ZEP100W); /* Torch Z80 Communicator (ZEP100) (Model B+) */
/* Acorn ANC21 Universal 2nd Processor Unit */
device.option_add("65c102", BBC_TUBE_65C102); /* Acorn ADC06 65C102 co-processor */
device.option_add("80186", BBC_TUBE_80186); /* Acorn ADC08 80186 co-processor */
@@ -160,11 +161,12 @@ 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("32016", BBC_TUBE_32016); /* Acorn ANC05 32016 2nd processor */
+ 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 */
//device.option_add("a500", BBC_TUBE_A500); /* Acorn A500 2nd Processor */
//device.option_add("pmsb2p", BBC_TUBE_PMSB2P); /* PMS B2P-6502 */
+ //device.option_add("zep100m", BBC_TUBE_ZEP100M); /* Torch Z80 Communicator (ZEP100) (Master) */
/* Acorn ANC21 Universal 2nd Processor Unit */
device.option_add("65c102", BBC_TUBE_65C102); /* Acorn ADC06 65C102 co-processor */
device.option_add("80186", BBC_TUBE_80186); /* Acorn ADC08 80186 co-processor */
@@ -181,7 +183,6 @@ void bbc_intube_devices(device_slot_interface &device)
{
device.option_add("65c102", BBC_TUBE_65C102); /* Acorn ADC06 65C102 co-processor */
device.option_add("80186", BBC_TUBE_80186); /* Acorn ADC08 80186 co-processor */
- //device.option_add("zep100m", BBC_TUBE_ZEP100M); /* Torch Z80 Communicator (ZEP100) (Master) */
//device.option_add("arm7", BBC_TUBE_ARM7); /* Sprow ARM7 co-processor */
device.option_add("rc6502", BBC_TUBE_RC6502); /* ReCo6502 (6502) */
device.option_add("rc65816", BBC_TUBE_RC65816); /* ReCo6502 (65816) */
@@ -196,6 +197,7 @@ void electron_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("32016", BBC_TUBE_32016); /* Acorn ANC05 32016 2nd processor */
device.option_add("arm", BBC_TUBE_ARM); /* Acorn ANC13 ARM Evaluation System */
device.option_add("65c102", BBC_TUBE_65C102); /* Acorn ADC06 65C102 co-processor */
device.option_add("80186", BBC_TUBE_80186); /* Acorn ADC08 80186 co-processor */
diff --git a/src/devices/bus/bbc/tube/tube.h b/src/devices/bus/bbc/tube/tube.h
index 954867f0b7f..e0d66907cb6 100644
--- a/src/devices/bus/bbc/tube/tube.h
+++ b/src/devices/bus/bbc/tube/tube.h
@@ -66,8 +66,8 @@ public:
// callbacks
auto irq_handler() { return m_irq_handler.bind(); }
- DECLARE_READ8_MEMBER( host_r );
- DECLARE_WRITE8_MEMBER( host_w );
+ uint8_t host_r(offs_t offset);
+ void host_w(offs_t offset, uint8_t data);
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_handler(state); }
@@ -90,8 +90,8 @@ class device_bbc_tube_interface : public device_slot_card_interface
{
public:
// reading and writing
- virtual DECLARE_READ8_MEMBER(host_r) { return 0xfe; }
- virtual DECLARE_WRITE8_MEMBER(host_w) { }
+ virtual uint8_t host_r(offs_t offset) { return 0xfe; }
+ virtual void host_w(offs_t offset, uint8_t data) { }
protected:
device_bbc_tube_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/bbc/tube/tube_32016.cpp b/src/devices/bus/bbc/tube/tube_32016.cpp
new file mode 100644
index 00000000000..7b6ac355e42
--- /dev/null
+++ b/src/devices/bus/bbc/tube/tube_32016.cpp
@@ -0,0 +1,210 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Acorn ANC05 32016 2nd processor
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Acorn_ANC05_320162ndproc.html
+
+ Acorn ANC06 Cambridge Co-Processor
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Acorn_ANC06_CamCoPro.html
+
+ IC1 (ULA) TUBE
+ IC2 (MMU) NS32082 Not fitted
+ IC3 (CPU) NS32016
+ IC4 (TCU) NS32201
+ IC20 (FPU) NS32081
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "tube_32016.h"
+#include "softlist_dev.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_TUBE_32016, bbc_tube_32016_device, "bbc_tube_32016", "Acorn 32016 2nd processor")
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( tube_32016_mem )
+//-------------------------------------------------
+
+void bbc_tube_32016_device::tube_32016_mem(address_map &map)
+{
+ map(0x000000, 0xffffff).rw(FUNC(bbc_tube_32016_device::read), FUNC(bbc_tube_32016_device::write));
+ map(0xf90000, 0xf90001).portr("CONFIG");
+ map(0xfffff0, 0xffffff).rw("ula", FUNC(tube_device::parasite_r), FUNC(tube_device::parasite_w)).umask32(0x00ff);
+}
+
+//-------------------------------------------------
+// ROM( tube_32016 )
+//-------------------------------------------------
+
+ROM_START(tube_32016)
+ ROM_REGION(0x8000, "rom", 0)
+ ROM_DEFAULT_BIOS("200")
+ ROM_SYSTEM_BIOS(0, "200", "Pandora v2.00")
+ ROMX_LOAD("pan200lo.rom", 0x0000, 0x4000, CRC(b1980fd0) SHA1(8084f8896cd22953abefbd43c51e1a422b30e28d), ROM_SKIP(1) | ROM_BIOS(0)) // 0201-764-02 Pandora Lo
+ ROMX_LOAD("pan200hi.rom", 0x0001, 0x4000, CRC(cab98d6b) SHA1(dfad1f4180c50757a74fcfe3a0ee7d7b48eb1bee), ROM_SKIP(1) | ROM_BIOS(0)) // 0201-763-02 Pandora Hi
+ ROM_SYSTEM_BIOS(1, "100", "Pandora v1.00")
+ ROMX_LOAD("pan100.rom", 0x0000, 0x8000, BAD_DUMP CRC(75333006) SHA1(996cd120103039390c9b979b16c327bb95da72e4), ROM_BIOS(1)) // 0201-763-01, 0201-764-01 Pandora
+ ROM_SYSTEM_BIOS(2, "061", "Pandora v0.61")
+ ROMX_LOAD("pan061lo.rom", 0x0000, 0x4000, CRC(6f801b35) SHA1(ce31f7c10603f3d15a06a8e32bde40df0639e446), ROM_SKIP(1) | ROM_BIOS(2))
+ ROMX_LOAD("pan061hi.rom", 0x0001, 0x4000, CRC(c00b1ab0) SHA1(e6a705232278c518340ddc69ea51af91965fa332), ROM_SKIP(1) | ROM_BIOS(2))
+ROM_END
+
+//-------------------------------------------------
+// INPUT_PORTS( tube_32016 )
+//-------------------------------------------------
+
+static INPUT_PORTS_START(tube_32016)
+ PORT_START("CONFIG")
+ PORT_DIPNAME(0x80, 0x80, "H") PORT_DIPLOCATION("LKS:1")
+ PORT_DIPSETTING(0x80, "FPU")
+ PORT_DIPSETTING(0x00, "No FPU")
+
+ PORT_DIPNAME(0x40, 0x00, "G") PORT_DIPLOCATION("LKS:2")
+ PORT_DIPSETTING(0x40, "MMU")
+ PORT_DIPSETTING(0x00, "No MMU")
+
+ PORT_DIPNAME(0x20, 0x00, "F") PORT_DIPLOCATION("LKS:3")
+ PORT_DIPSETTING(0x20, "Reserved")
+ PORT_DIPSETTING(0x00, "Reserved")
+
+ PORT_DIPNAME(0x10, 0x00, "E") PORT_DIPLOCATION("LKS:4")
+ PORT_DIPSETTING(0x10, "Reserved")
+ PORT_DIPSETTING(0x00, "Reserved")
+
+ PORT_DIPNAME(0x08, 0x00, "D") PORT_DIPLOCATION("LKS:5")
+ PORT_DIPSETTING(0x08, "Reserved")
+ PORT_DIPSETTING(0x00, "Reserved")
+
+ PORT_DIPNAME(0x04, 0x00, "C") PORT_DIPLOCATION("LKS:6")
+ PORT_DIPSETTING(0x04, "Reserved")
+ PORT_DIPSETTING(0x00, "Reserved")
+
+ PORT_DIPNAME(0x02, 0x00, "B") PORT_DIPLOCATION("LKS:7")
+ PORT_DIPSETTING(0x02, "Reserved")
+ PORT_DIPSETTING(0x00, "Reserved")
+
+ PORT_DIPNAME(0x01, 0x00, "A") PORT_DIPLOCATION("LKS:8")
+ PORT_DIPSETTING(0x01, "Reserved")
+ PORT_DIPSETTING(0x00, "Reserved")
+INPUT_PORTS_END
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_tube_32016_device::device_add_mconfig(machine_config &config)
+{
+ NS32016(config, m_maincpu, 12_MHz_XTAL / 2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &bbc_tube_32016_device::tube_32016_mem);
+
+ TUBE(config, m_ula);
+ m_ula->pnmi_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ m_ula->pirq_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+
+ /* internal ram */
+ RAM(config, m_ram).set_default_size("1M").set_default_value(0);
+
+ /* software lists */
+ SOFTWARE_LIST(config, "flop_ls_32016").set_original("bbc_flop_32016");
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry *bbc_tube_32016_device::device_rom_region() const
+{
+ return ROM_NAME( tube_32016 );
+}
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_tube_32016_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( tube_32016 );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_tube_32016_device - constructor
+//-------------------------------------------------
+
+bbc_tube_32016_device::bbc_tube_32016_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_TUBE_32016, tag, owner, clock)
+ , device_bbc_tube_interface(mconfig, *this)
+ , m_maincpu(*this, "maincpu")
+ , m_ula(*this, "ula")
+ , m_ram(*this, "ram")
+ , m_rom(*this, "rom")
+ , m_rom_enabled(true)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_tube_32016_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void bbc_tube_32016_device::device_reset()
+{
+ m_rom_enabled = true;
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_tube_32016_device::host_r(offs_t offset)
+{
+ return m_ula->host_r(offset);
+}
+
+void bbc_tube_32016_device::host_w(offs_t offset, uint8_t data)
+{
+ m_ula->host_w(offset, data);
+}
+
+
+READ8_MEMBER(bbc_tube_32016_device::read)
+{
+ uint16_t data = 0xffff;
+
+ if (m_rom_enabled)
+ data = m_rom->base()[offset & 0x3fff];
+ else if (offset < m_ram->size())
+ data = m_ram->pointer()[offset];
+
+ return data;
+}
+
+WRITE8_MEMBER(bbc_tube_32016_device::write)
+{
+ /* clear ROM select on first write */
+ if (!machine().side_effects_disabled()) m_rom_enabled = false;
+
+ if (offset < m_ram->size())
+ m_ram->pointer()[offset] = data;
+}
diff --git a/src/devices/bus/bbc/tube/tube_32016.h b/src/devices/bus/bbc/tube/tube_32016.h
new file mode 100644
index 00000000000..864b8173703
--- /dev/null
+++ b/src/devices/bus/bbc/tube/tube_32016.h
@@ -0,0 +1,71 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Acorn ANC05 32016 2nd processor
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Acorn_ANC05_320162ndproc.html
+
+ Acorn ANC06 Cambridge Co-Processor
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Acorn_ANC06_CamCoPro.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_TUBE_32016_H
+#define MAME_BUS_BBC_TUBE_32016_H
+
+#include "tube.h"
+#include "cpu/ns32000/ns32000.h"
+#include "machine/ram.h"
+#include "machine/tube.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_tube_32016_device
+
+class bbc_tube_32016_device :
+ public device_t,
+ public device_bbc_tube_interface
+{
+public:
+ // construction/destruction
+ bbc_tube_32016_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual uint8_t host_r(offs_t offset) override;
+ virtual void host_w(offs_t offset, uint8_t data) override;
+
+private:
+ required_device<ns32016_cpu_device> m_maincpu;
+ required_device<tube_device> m_ula;
+ required_device<ram_device> m_ram;
+ required_memory_region m_rom;
+
+ DECLARE_READ8_MEMBER(read);
+ DECLARE_WRITE8_MEMBER(write);
+
+ void tube_32016_mem(address_map &map);
+
+ bool m_rom_enabled;
+};
+
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_TUBE_32016, bbc_tube_32016_device)
+
+
+#endif /* MAME_BUS_BBC_TUBE_32016_H */
diff --git a/src/devices/bus/bbc/tube/tube_6502.cpp b/src/devices/bus/bbc/tube/tube_6502.cpp
index 8120ab16812..99852ca8d90 100644
--- a/src/devices/bus/bbc/tube/tube_6502.cpp
+++ b/src/devices/bus/bbc/tube/tube_6502.cpp
@@ -168,27 +168,27 @@ void bbc_tube_6502_device::device_reset()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_tube_6502_device::host_r)
+uint8_t bbc_tube_6502_device::host_r(offs_t offset)
{
- return m_ula->host_r(space, offset);
+ return m_ula->host_r(offset);
}
-WRITE8_MEMBER(bbc_tube_6502_device::host_w)
+void bbc_tube_6502_device::host_w(offs_t offset, uint8_t data)
{
- m_ula->host_w(space, offset, data);
+ m_ula->host_w(offset, data);
}
-READ8_MEMBER(bbc_tube_6502_device::tube_r)
+uint8_t bbc_tube_6502_device::tube_r(offs_t offset)
{
// Disable ROM on first access
if (!machine().side_effects_disabled())
m_bankdev->set_bank(1);
- return m_ula->parasite_r(space, offset);
+ return m_ula->parasite_r(offset);
}
-WRITE8_MEMBER(bbc_tube_6502_device::tube_w)
+void bbc_tube_6502_device::tube_w(offs_t offset, uint8_t data)
{
- m_ula->parasite_w(space, offset, data);
+ m_ula->parasite_w(offset, data);
}
diff --git a/src/devices/bus/bbc/tube/tube_6502.h b/src/devices/bus/bbc/tube/tube_6502.h
index 244eb9f2105..abb907ef3bd 100644
--- a/src/devices/bus/bbc/tube/tube_6502.h
+++ b/src/devices/bus/bbc/tube/tube_6502.h
@@ -52,11 +52,11 @@ protected:
void add_common_devices(machine_config &config);
- virtual DECLARE_READ8_MEMBER( host_r ) override;
- virtual DECLARE_WRITE8_MEMBER( host_w ) override;
+ virtual uint8_t host_r(offs_t offset) override;
+ virtual void host_w(offs_t offset, uint8_t data) override;
- virtual DECLARE_READ8_MEMBER( tube_r );
- virtual DECLARE_WRITE8_MEMBER( tube_w );
+ virtual uint8_t tube_r(offs_t offset);
+ virtual void tube_w(offs_t offset, uint8_t data);
required_device<cpu_device> m_maincpu;
required_device<address_map_bank_device> m_bankdev;
diff --git a/src/devices/bus/bbc/tube/tube_80186.cpp b/src/devices/bus/bbc/tube/tube_80186.cpp
index 4721d48e534..85331ab1b2a 100644
--- a/src/devices/bus/bbc/tube/tube_80186.cpp
+++ b/src/devices/bus/bbc/tube/tube_80186.cpp
@@ -126,12 +126,12 @@ void bbc_tube_80186_device::device_reset()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_tube_80186_device::host_r)
+uint8_t bbc_tube_80186_device::host_r(offs_t offset)
{
- return m_ula->host_r(space, offset);
+ return m_ula->host_r(offset);
}
-WRITE8_MEMBER(bbc_tube_80186_device::host_w)
+void bbc_tube_80186_device::host_w(offs_t offset, uint8_t data)
{
- m_ula->host_w(space, offset, data);
+ m_ula->host_w(offset, data);
}
diff --git a/src/devices/bus/bbc/tube/tube_80186.h b/src/devices/bus/bbc/tube/tube_80186.h
index 3081acbddac..42f757e75e4 100644
--- a/src/devices/bus/bbc/tube/tube_80186.h
+++ b/src/devices/bus/bbc/tube/tube_80186.h
@@ -40,8 +40,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER( host_r ) override;
- virtual DECLARE_WRITE8_MEMBER( host_w ) override;
+ virtual uint8_t host_r(offs_t offset) override;
+ virtual void host_w(offs_t offset, uint8_t data) override;
private:
required_device<i80186_cpu_device> m_i80186;
diff --git a/src/devices/bus/bbc/tube/tube_80286.cpp b/src/devices/bus/bbc/tube/tube_80286.cpp
index f38761341f5..e8ff167d0fb 100644
--- a/src/devices/bus/bbc/tube/tube_80286.cpp
+++ b/src/devices/bus/bbc/tube/tube_80286.cpp
@@ -129,24 +129,25 @@ void bbc_tube_80286_device::device_reset()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_tube_80286_device::host_r)
+uint8_t bbc_tube_80286_device::host_r(offs_t offset)
{
- return m_ula->host_r(space, offset);
+ return m_ula->host_r(offset);
}
-WRITE8_MEMBER(bbc_tube_80286_device::host_w)
+void bbc_tube_80286_device::host_w(offs_t offset, uint8_t data)
{
- m_ula->host_w(space, offset, data);
+ m_ula->host_w(offset, data);
}
-READ8_MEMBER(bbc_tube_80286_device::disable_boot_rom)
+uint8_t bbc_tube_80286_device::disable_boot_rom()
{
- m_i80286->space(AS_PROGRAM).install_ram(0xc0000, 0xfffff, m_ram->pointer() + 0xc0000);
+ if (!machine().side_effects_disabled())
+ m_i80286->space(AS_PROGRAM).install_ram(0xc0000, 0xfffff, m_ram->pointer() + 0xc0000);
return 0xff;
}
-WRITE8_MEMBER(bbc_tube_80286_device::irq_latch_w)
+void bbc_tube_80286_device::irq_latch_w(uint8_t data)
{
m_irq_latch = data;
}
diff --git a/src/devices/bus/bbc/tube/tube_80286.h b/src/devices/bus/bbc/tube/tube_80286.h
index da2d807477b..a6e952d6bf2 100644
--- a/src/devices/bus/bbc/tube/tube_80286.h
+++ b/src/devices/bus/bbc/tube/tube_80286.h
@@ -38,8 +38,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER( host_r ) override;
- virtual DECLARE_WRITE8_MEMBER( host_w ) override;
+ virtual uint8_t host_r(offs_t offset) override;
+ virtual void host_w(offs_t offset, uint8_t data) override;
private:
uint8_t m_irq_latch;
@@ -51,8 +51,8 @@ private:
required_device<ram_device> m_ram;
required_memory_region m_bootstrap;
- DECLARE_READ8_MEMBER( disable_boot_rom );
- DECLARE_WRITE8_MEMBER( irq_latch_w );
+ uint8_t disable_boot_rom();
+ void irq_latch_w(uint8_t data);
void tube_80286_io(address_map &map);
void tube_80286_mem(address_map &map);
diff --git a/src/devices/bus/bbc/tube/tube_arm.cpp b/src/devices/bus/bbc/tube/tube_arm.cpp
index 444e188a657..463a82713be 100644
--- a/src/devices/bus/bbc/tube/tube_arm.cpp
+++ b/src/devices/bus/bbc/tube/tube_arm.cpp
@@ -120,18 +120,18 @@ void bbc_tube_arm_device::device_reset()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_tube_arm_device::host_r)
+uint8_t bbc_tube_arm_device::host_r(offs_t offset)
{
- return m_ula->host_r(space, offset);
+ return m_ula->host_r(offset);
}
-WRITE8_MEMBER(bbc_tube_arm_device::host_w)
+void bbc_tube_arm_device::host_w(offs_t offset, uint8_t data)
{
- m_ula->host_w(space, offset, data);
+ m_ula->host_w(offset, data);
}
-READ8_MEMBER(bbc_tube_arm_device::ram_r)
+uint8_t bbc_tube_arm_device::ram_r(offs_t offset)
{
uint8_t data;
@@ -143,7 +143,7 @@ READ8_MEMBER(bbc_tube_arm_device::ram_r)
return data;
}
-WRITE8_MEMBER(bbc_tube_arm_device::ram_w)
+void bbc_tube_arm_device::ram_w(offs_t offset, uint8_t data)
{
/* clear ROM select on first write */
if (!machine().side_effects_disabled()) m_rom_select = false;
diff --git a/src/devices/bus/bbc/tube/tube_arm.h b/src/devices/bus/bbc/tube/tube_arm.h
index 7b58d2b40bd..8470fec84ef 100644
--- a/src/devices/bus/bbc/tube/tube_arm.h
+++ b/src/devices/bus/bbc/tube/tube_arm.h
@@ -38,8 +38,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER( host_r ) override;
- virtual DECLARE_WRITE8_MEMBER( host_w ) override;
+ virtual uint8_t host_r(offs_t offset) override;
+ virtual void host_w(offs_t offset, uint8_t data) override;
private:
required_device<arm_cpu_device> m_arm;
@@ -49,8 +49,8 @@ private:
bool m_rom_select;
- DECLARE_READ8_MEMBER( ram_r );
- DECLARE_WRITE8_MEMBER( ram_w );
+ uint8_t ram_r(offs_t offset);
+ void ram_w(offs_t offset, uint8_t data);
void tube_arm_mem(address_map &map);
};
diff --git a/src/devices/bus/bbc/tube/tube_casper.cpp b/src/devices/bus/bbc/tube/tube_casper.cpp
index db84143f553..f6bb4bdce84 100644
--- a/src/devices/bus/bbc/tube/tube_casper.cpp
+++ b/src/devices/bus/bbc/tube/tube_casper.cpp
@@ -109,12 +109,12 @@ void bbc_tube_casper_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_tube_casper_device::host_r)
+uint8_t bbc_tube_casper_device::host_r(offs_t offset)
{
return m_via6522_0->read(offset & 0xf);
}
-WRITE8_MEMBER(bbc_tube_casper_device::host_w)
+void bbc_tube_casper_device::host_w(offs_t offset, uint8_t data)
{
m_via6522_0->write(offset & 0xf, data);
}
diff --git a/src/devices/bus/bbc/tube/tube_casper.h b/src/devices/bus/bbc/tube/tube_casper.h
index e464f4a8c68..965ac703355 100644
--- a/src/devices/bus/bbc/tube/tube_casper.h
+++ b/src/devices/bus/bbc/tube/tube_casper.h
@@ -36,8 +36,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER( host_r ) override;
- virtual DECLARE_WRITE8_MEMBER( host_w ) override;
+ virtual uint8_t host_r(offs_t offset) override;
+ virtual void host_w(offs_t offset, uint8_t data) override;
private:
required_device<cpu_device> m_m68000;
diff --git a/src/devices/bus/bbc/tube/tube_rc6502.cpp b/src/devices/bus/bbc/tube/tube_rc6502.cpp
index 80061f8a5ca..c567be6f98a 100644
--- a/src/devices/bus/bbc/tube/tube_rc6502.cpp
+++ b/src/devices/bus/bbc/tube/tube_rc6502.cpp
@@ -233,23 +233,23 @@ void bbc_tube_rc6502_device::device_reset()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_tube_rc6502_device::host_r)
+uint8_t bbc_tube_rc6502_device::host_r(offs_t offset)
{
- return m_ula->host_r(space, offset);
+ return m_ula->host_r(offset);
}
-WRITE8_MEMBER(bbc_tube_rc6502_device::host_w)
+void bbc_tube_rc6502_device::host_w(offs_t offset, uint8_t data)
{
- m_ula->host_w(space, offset, data);
+ m_ula->host_w(offset, data);
}
-READ8_MEMBER(bbc_tube_rc6502_device::config_r)
+uint8_t bbc_tube_rc6502_device::config_r()
{
return m_banknum;
}
-WRITE8_MEMBER(bbc_tube_rc6502_device::register_w)
+void bbc_tube_rc6502_device::register_w(uint8_t data)
{
switch (data & 0x06)
{
diff --git a/src/devices/bus/bbc/tube/tube_rc6502.h b/src/devices/bus/bbc/tube/tube_rc6502.h
index 77542cf4a45..eadb460cc96 100644
--- a/src/devices/bus/bbc/tube/tube_rc6502.h
+++ b/src/devices/bus/bbc/tube/tube_rc6502.h
@@ -47,11 +47,11 @@ protected:
void add_common_devices(machine_config &config);
- virtual DECLARE_READ8_MEMBER( host_r ) override;
- virtual DECLARE_WRITE8_MEMBER( host_w ) override;
+ virtual uint8_t host_r(offs_t offset) override;
+ virtual void host_w(offs_t offset, uint8_t data) override;
- DECLARE_READ8_MEMBER(config_r);
- DECLARE_WRITE8_MEMBER(register_w);
+ uint8_t config_r();
+ void register_w(uint8_t data);
void tube_rc6502_bank(address_map &map);
diff --git a/src/devices/bus/bbc/tube/tube_z80.cpp b/src/devices/bus/bbc/tube/tube_z80.cpp
index cc6f87527bf..06e6931c7a3 100644
--- a/src/devices/bus/bbc/tube/tube_z80.cpp
+++ b/src/devices/bus/bbc/tube/tube_z80.cpp
@@ -134,18 +134,18 @@ void bbc_tube_z80_device::device_reset()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_tube_z80_device::host_r)
+uint8_t bbc_tube_z80_device::host_r(offs_t offset)
{
- return m_ula->host_r(space, offset);
+ return m_ula->host_r(offset);
}
-WRITE8_MEMBER(bbc_tube_z80_device::host_w)
+void bbc_tube_z80_device::host_w(offs_t offset, uint8_t data)
{
- m_ula->host_w(space, offset, data);
+ m_ula->host_w(offset, data);
}
-READ8_MEMBER(bbc_tube_z80_device::opcode_r)
+uint8_t bbc_tube_z80_device::opcode_r(offs_t offset)
{
if (!machine().side_effects_disabled())
{
@@ -158,7 +158,7 @@ READ8_MEMBER(bbc_tube_z80_device::opcode_r)
}
-READ8_MEMBER(bbc_tube_z80_device::mem_r)
+uint8_t bbc_tube_z80_device::mem_r(offs_t offset)
{
uint8_t data;
@@ -170,7 +170,7 @@ READ8_MEMBER(bbc_tube_z80_device::mem_r)
return data;
}
-WRITE8_MEMBER(bbc_tube_z80_device::mem_w)
+void bbc_tube_z80_device::mem_w(offs_t offset, uint8_t data)
{
m_ram->pointer()[offset] = data;
}
diff --git a/src/devices/bus/bbc/tube/tube_z80.h b/src/devices/bus/bbc/tube/tube_z80.h
index e35dfa02ef4..536e506d43d 100644
--- a/src/devices/bus/bbc/tube/tube_z80.h
+++ b/src/devices/bus/bbc/tube/tube_z80.h
@@ -40,8 +40,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER( host_r ) override;
- virtual DECLARE_WRITE8_MEMBER( host_w ) override;
+ virtual uint8_t host_r(offs_t offset) override;
+ virtual void host_w(offs_t offset, uint8_t data) override;
private:
IRQ_CALLBACK_MEMBER( irq_callback );
@@ -54,9 +54,9 @@ private:
bool m_rom_enabled;
- DECLARE_READ8_MEMBER( mem_r );
- DECLARE_WRITE8_MEMBER( mem_w );
- DECLARE_READ8_MEMBER( opcode_r );
+ uint8_t mem_r(offs_t offset);
+ void mem_w(offs_t offset, uint8_t data);
+ uint8_t opcode_r(offs_t offset);
void tube_z80_fetch(address_map &map);
void tube_z80_io(address_map &map);
diff --git a/src/devices/bus/bbc/tube/tube_zep100.cpp b/src/devices/bus/bbc/tube/tube_zep100.cpp
index 6ec898bb705..f11f0af6415 100644
--- a/src/devices/bus/bbc/tube/tube_zep100.cpp
+++ b/src/devices/bus/bbc/tube/tube_zep100.cpp
@@ -146,12 +146,12 @@ void bbc_tube_zep100_device::device_reset()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(bbc_tube_zep100_device::host_r)
+uint8_t bbc_tube_zep100_device::host_r(offs_t offset)
{
return m_via->read(offset & 0x0f);
}
-WRITE8_MEMBER(bbc_tube_zep100_device::host_w)
+void bbc_tube_zep100_device::host_w(offs_t offset, uint8_t data)
{
if (offset & 0x10)
m_z80->reset();
@@ -160,7 +160,7 @@ WRITE8_MEMBER(bbc_tube_zep100_device::host_w)
}
-READ8_MEMBER(bbc_tube_zep100_device::mem_r)
+uint8_t bbc_tube_zep100_device::mem_r(offs_t offset)
{
uint8_t data;
@@ -172,13 +172,13 @@ READ8_MEMBER(bbc_tube_zep100_device::mem_r)
return data;
}
-WRITE8_MEMBER(bbc_tube_zep100_device::mem_w)
+void bbc_tube_zep100_device::mem_w(offs_t offset, uint8_t data)
{
m_ram->pointer()[offset] = data;
}
-READ8_MEMBER(bbc_tube_zep100_device::io_r)
+uint8_t bbc_tube_zep100_device::io_r(offs_t offset)
{
uint8_t data = 0xff;
@@ -190,23 +190,23 @@ READ8_MEMBER(bbc_tube_zep100_device::io_r)
return data;
}
-WRITE8_MEMBER(bbc_tube_zep100_device::io_w)
+void bbc_tube_zep100_device::io_w(offs_t offset, uint8_t data)
{
m_ppi->write(offset & 0x03, data);
}
-WRITE8_MEMBER(bbc_tube_zep100_device::via_pb_w)
+void bbc_tube_zep100_device::via_pb_w(uint8_t data)
{
m_port_b = data;
}
-READ8_MEMBER(bbc_tube_zep100_device::ppi_pb_r)
+uint8_t bbc_tube_zep100_device::ppi_pb_r()
{
return m_port_b;
}
-WRITE8_MEMBER(bbc_tube_zep100_device::ppi_pc_w)
+void bbc_tube_zep100_device::ppi_pc_w(uint8_t data)
{
m_via->write_ca1(BIT(data, 7));
m_via->write_cb1(BIT(data, 1));
diff --git a/src/devices/bus/bbc/tube/tube_zep100.h b/src/devices/bus/bbc/tube/tube_zep100.h
index 24b07ea4269..b7f881fcfac 100644
--- a/src/devices/bus/bbc/tube/tube_zep100.h
+++ b/src/devices/bus/bbc/tube/tube_zep100.h
@@ -43,8 +43,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_READ8_MEMBER( host_r ) override;
- virtual DECLARE_WRITE8_MEMBER( host_w ) override;
+ virtual uint8_t host_r(offs_t offset) override;
+ virtual void host_w(offs_t offset, uint8_t data) override;
bool m_rom_enabled;
@@ -57,14 +57,14 @@ private:
uint8_t m_port_b;
- DECLARE_READ8_MEMBER( mem_r );
- DECLARE_WRITE8_MEMBER( mem_w );
- DECLARE_READ8_MEMBER( io_r );
- DECLARE_WRITE8_MEMBER( io_w );
+ uint8_t mem_r(offs_t offset);
+ void mem_w(offs_t offset, uint8_t data);
+ uint8_t io_r(offs_t offset);
+ void io_w(offs_t offset, uint8_t data);
- DECLARE_WRITE8_MEMBER( via_pb_w );
- DECLARE_READ8_MEMBER( ppi_pb_r );
- DECLARE_WRITE8_MEMBER( ppi_pc_w );
+ void via_pb_w(uint8_t data);
+ uint8_t ppi_pb_r();
+ void ppi_pc_w(uint8_t data);
void tube_zep100_io(address_map &map);
void tube_zep100_mem(address_map &map);
diff --git a/src/devices/bus/bbc/userport/beebspch.cpp b/src/devices/bus/bbc/userport/beebspch.cpp
index 291179b54c6..728d8ae6658 100644
--- a/src/devices/bus/bbc/userport/beebspch.cpp
+++ b/src/devices/bus/bbc/userport/beebspch.cpp
@@ -82,7 +82,7 @@ void bbc_beebspch_device::device_start()
// IMPLEMENTATION
//**************************************************************************
-WRITE8_MEMBER(bbc_beebspch_device::pb_w)
+void bbc_beebspch_device::pb_w(uint8_t data)
{
switch (data & 0xc0)
{
diff --git a/src/devices/bus/bbc/userport/beebspch.h b/src/devices/bus/bbc/userport/beebspch.h
index 94c36b0cc84..79e6abf64ab 100644
--- a/src/devices/bus/bbc/userport/beebspch.h
+++ b/src/devices/bus/bbc/userport/beebspch.h
@@ -38,7 +38,7 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual DECLARE_WRITE8_MEMBER(pb_w) override;
+ virtual void pb_w(uint8_t data) override;
private:
required_device<sp0256_device> m_nsp;
diff --git a/src/devices/bus/bbc/userport/cfa3000kbd.cpp b/src/devices/bus/bbc/userport/cfa3000kbd.cpp
index d07d7b6dd2f..5b2d5586f56 100644
--- a/src/devices/bus/bbc/userport/cfa3000kbd.cpp
+++ b/src/devices/bus/bbc/userport/cfa3000kbd.cpp
@@ -113,7 +113,7 @@ void cfa3000_kbd_device::device_reset()
// IMPLEMENTATION
//**************************************************************************
-READ8_MEMBER(cfa3000_kbd_device::pb_r)
+uint8_t cfa3000_kbd_device::pb_r()
{
uint8_t data = 0x00;
diff --git a/src/devices/bus/bbc/userport/cfa3000kbd.h b/src/devices/bus/bbc/userport/cfa3000kbd.h
index 2ece3cbf380..ff9951399c8 100644
--- a/src/devices/bus/bbc/userport/cfa3000kbd.h
+++ b/src/devices/bus/bbc/userport/cfa3000kbd.h
@@ -36,7 +36,7 @@ protected:
// optional information overrides
virtual ioport_constructor device_input_ports() const override;
- virtual DECLARE_READ8_MEMBER(pb_r) override;
+ virtual uint8_t pb_r() override;
private:
required_ioport_array<4> m_kbd;
diff --git a/src/devices/bus/bbc/userport/pointer.cpp b/src/devices/bus/bbc/userport/pointer.cpp
index 9a222388989..d8272766d98 100644
--- a/src/devices/bus/bbc/userport/pointer.cpp
+++ b/src/devices/bus/bbc/userport/pointer.cpp
@@ -261,17 +261,17 @@ TIMER_CALLBACK_MEMBER(bbc_pointer_device::pointer_poll)
}
}
-READ8_MEMBER(bbc_amxmouse_device::pb_r)
+uint8_t bbc_amxmouse_device::pb_r()
{
return (m_buttons->read() & 0xe0) | (m_xdir << 0) | (m_ydir << 2) | 0x1a;
}
-READ8_MEMBER(bbc_m512mouse_device::pb_r)
+uint8_t bbc_m512mouse_device::pb_r()
{
return (m_buttons->read() & 0x07) | (m_xdir << 3) | (m_ydir << 4) | 0xe0;
}
-READ8_MEMBER(bbc_tracker_device::pb_r)
+uint8_t bbc_tracker_device::pb_r()
{
return (m_buttons->read() & 0x07) | (m_xdir << 3) | (m_ydir << 4) | 0xe0;
}
diff --git a/src/devices/bus/bbc/userport/pointer.h b/src/devices/bus/bbc/userport/pointer.h
index 5551a2c82dd..a6e1bd0a629 100644
--- a/src/devices/bus/bbc/userport/pointer.h
+++ b/src/devices/bus/bbc/userport/pointer.h
@@ -58,7 +58,7 @@ public:
// construction/destruction
bbc_amxmouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_READ8_MEMBER(pb_r) override;
+ uint8_t pb_r() override;
// optional information overrides
virtual ioport_constructor device_input_ports() const override;
@@ -73,7 +73,7 @@ public:
// construction/destruction
bbc_m512mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_READ8_MEMBER(pb_r) override;
+ uint8_t pb_r() override;
// optional information overrides
virtual ioport_constructor device_input_ports() const override;
@@ -88,7 +88,7 @@ public:
// construction/destruction
bbc_tracker_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_READ8_MEMBER(pb_r) override;
+ uint8_t pb_r() override;
// optional information overrides
virtual ioport_constructor device_input_ports() const override;
diff --git a/src/devices/bus/bbc/userport/userport.cpp b/src/devices/bus/bbc/userport/userport.cpp
index a4610217651..601a6845801 100644
--- a/src/devices/bus/bbc/userport/userport.cpp
+++ b/src/devices/bus/bbc/userport/userport.cpp
@@ -89,10 +89,10 @@ void bbc_userport_slot_device::device_reset()
// pb_r
//-------------------------------------------------
-READ8_MEMBER(bbc_userport_slot_device::pb_r)
+uint8_t bbc_userport_slot_device::pb_r()
{
if (m_device)
- return m_device->pb_r(space, 0);
+ return m_device->pb_r();
else
return 0xff;
}
@@ -102,10 +102,10 @@ READ8_MEMBER(bbc_userport_slot_device::pb_r)
// pb_w
//-------------------------------------------------
-WRITE8_MEMBER(bbc_userport_slot_device::pb_w)
+void bbc_userport_slot_device::pb_w(uint8_t data)
{
if (m_device)
- m_device->pb_w(space, 0, data);
+ m_device->pb_w(data);
}
diff --git a/src/devices/bus/bbc/userport/userport.h b/src/devices/bus/bbc/userport/userport.h
index e2807146efe..e3040283a5a 100644
--- a/src/devices/bus/bbc/userport/userport.h
+++ b/src/devices/bus/bbc/userport/userport.h
@@ -64,8 +64,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(cb1_w) { m_cb1_handler(state); }
DECLARE_WRITE_LINE_MEMBER(cb2_w) { m_cb2_handler(state); }
- DECLARE_READ8_MEMBER(pb_r);
- DECLARE_WRITE8_MEMBER(pb_w);
+ uint8_t pb_r();
+ void pb_w(uint8_t data);
protected:
// device-level overrides
@@ -88,8 +88,8 @@ public:
// construction/destruction
virtual ~device_bbc_userport_interface();
- virtual DECLARE_READ8_MEMBER(pb_r) { return 0xff; }
- virtual DECLARE_WRITE8_MEMBER(pb_w) { }
+ virtual uint8_t pb_r() { return 0xff; }
+ virtual void pb_w(uint8_t data) { }
protected:
device_bbc_userport_interface(const machine_config &mconfig, device_t &device);