summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/abcbus/ssa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/abcbus/ssa.cpp')
-rw-r--r--src/devices/bus/abcbus/ssa.cpp48
1 files changed, 31 insertions, 17 deletions
diff --git a/src/devices/bus/abcbus/ssa.cpp b/src/devices/bus/abcbus/ssa.cpp
index 27bbdc3927f..5a190fc0fbb 100644
--- a/src/devices/bus/abcbus/ssa.cpp
+++ b/src/devices/bus/abcbus/ssa.cpp
@@ -65,16 +65,16 @@ Notes:
// DEVICE DEFINITIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(SUPER_SMARTAID, super_smartaid_t, "ssa", "Super Smartaid")
+DEFINE_DEVICE_TYPE(ABC_SUPER_SMARTAID, abc_super_smartaid_device, "abc_ssa", "Super Smartaid")
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
-void super_smartaid_t::device_add_mconfig(machine_config &config)
+void abc_super_smartaid_device::device_add_mconfig(machine_config &config)
{
- ABCBUS_SLOT(config, ABCBUS_TAG, DERIVED_CLOCK(1, 1), abc80_cards, nullptr);
+ ABCBUS_SLOT(config, m_bus, DERIVED_CLOCK(1, 1), abc80_cards, nullptr);
}
@@ -98,7 +98,7 @@ ROM_END
// rom_region - device-specific ROM region
//-------------------------------------------------
-const tiny_rom_entry *super_smartaid_t::device_rom_region() const
+const tiny_rom_entry *abc_super_smartaid_device::device_rom_region() const
{
return ROM_NAME( super_smartaid );
}
@@ -110,18 +110,18 @@ const tiny_rom_entry *super_smartaid_t::device_rom_region() const
//**************************************************************************
//-------------------------------------------------
-// super_smartaid_t - constructor
+// abc_super_smartaid_device - constructor
//-------------------------------------------------
-super_smartaid_t::super_smartaid_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, SUPER_SMARTAID, tag, owner, clock),
+abc_super_smartaid_device::abc_super_smartaid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, ABC_SUPER_SMARTAID, tag, owner, clock),
device_abcbus_card_interface(mconfig, *this),
device_nvram_interface(mconfig, *this),
- m_bus(*this, ABCBUS_TAG),
+ m_bus(*this, "bus"),
m_rom_1(*this, "ssa1"),
m_rom_2(*this, "ssa2"),
m_prom(*this, "ssa3"),
- m_nvram(*this, "nvram"),
+ m_nvram(*this, "nvram", 0x800, ENDIANNESS_LITTLE),
m_rom_bank(0),
m_prom_bank(0)
{
@@ -132,7 +132,7 @@ super_smartaid_t::super_smartaid_t(const machine_config &mconfig, const char *ta
// device_start - device-specific startup
//-------------------------------------------------
-void super_smartaid_t::device_start()
+void abc_super_smartaid_device::device_start()
{
// descramble ROMs
for (offs_t i = 0; i < 0x800; i++)
@@ -144,9 +144,6 @@ void super_smartaid_t::device_start()
m_rom_2->base()[i] = bitswap<8>(m_rom_2->base()[i], 2, 6, 1, 4, 3, 5, 7, 0);
}
- // allocate memory
- m_nvram.allocate(0x800);
-
// state saving
save_item(NAME(m_rom_bank));
save_item(NAME(m_prom_bank));
@@ -157,13 +154,30 @@ void super_smartaid_t::device_start()
// device_reset - device-specific reset
//-------------------------------------------------
-void super_smartaid_t::device_reset()
+void abc_super_smartaid_device::device_reset()
{
m_rom_bank = 0;
m_prom_bank = 0;
}
+void abc_super_smartaid_device::nvram_default()
+{
+}
+
+bool abc_super_smartaid_device::nvram_read(util::read_stream &file)
+{
+ auto const [err, actual] = read(file, m_nvram, m_nvram.bytes());
+ return !err && (actual == m_nvram.bytes());
+}
+
+bool abc_super_smartaid_device::nvram_write(util::write_stream &file)
+{
+ auto const [err, actual] = write(file, m_nvram, m_nvram.bytes());
+ return !err;
+}
+
+
//**************************************************************************
// ABC BUS INTERFACE
@@ -173,7 +187,7 @@ void super_smartaid_t::device_reset()
// abcbus_xmemfl -
//-------------------------------------------------
-uint8_t super_smartaid_t::abcbus_xmemfl(offs_t offset)
+uint8_t abc_super_smartaid_device::abcbus_xmemfl(offs_t offset)
{
uint8_t data = 0xff;
@@ -181,7 +195,7 @@ uint8_t super_smartaid_t::abcbus_xmemfl(offs_t offset)
{
case 0x08:
m_prom_bank = 1;
- // fallthru
+ [[fallthrough]];
case 0x0c: case 0x0f:
data = m_rom_2->base()[(m_rom_bank << 12) | (offset & 0xfff)];
break;
@@ -204,7 +218,7 @@ uint8_t super_smartaid_t::abcbus_xmemfl(offs_t offset)
// abcbus_xmemw -
//-------------------------------------------------
-void super_smartaid_t::abcbus_xmemw(offs_t offset, uint8_t data)
+void abc_super_smartaid_device::abcbus_xmemw(offs_t offset, uint8_t data)
{
if ((offset == 0x4040) || (offset == 0x4041))
{