summaryrefslogtreecommitdiffstats
path: root/src/devices/bus/ti99/gromport/cartridges.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/ti99/gromport/cartridges.cpp')
-rw-r--r--src/devices/bus/ti99/gromport/cartridges.cpp56
1 files changed, 30 insertions, 26 deletions
diff --git a/src/devices/bus/ti99/gromport/cartridges.cpp b/src/devices/bus/ti99/gromport/cartridges.cpp
index d3f3f75a10a..7e93029f97f 100644
--- a/src/devices/bus/ti99/gromport/cartridges.cpp
+++ b/src/devices/bus/ti99/gromport/cartridges.cpp
@@ -341,23 +341,23 @@ void ti99_cartridge_device::set_slot(int i)
READ8Z_MEMBER(ti99_cartridge_device::readz)
{
if (m_pcb != nullptr)
- m_pcb->readz(offset, value);
+ m_pcb->readz(space, offset, value);
}
-void ti99_cartridge_device::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_cartridge_device::write)
{
if (m_pcb != nullptr)
- m_pcb->write(offset, data);
+ m_pcb->write(space, offset, data);
}
READ8Z_MEMBER(ti99_cartridge_device::crureadz)
{
- if (m_pcb != nullptr) m_pcb->crureadz(offset, value);
+ if (m_pcb != nullptr) m_pcb->crureadz(space, offset, value);
}
-void ti99_cartridge_device::cruwrite(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_cartridge_device::cruwrite)
{
- if (m_pcb != nullptr) m_pcb->cruwrite(offset, data);
+ if (m_pcb != nullptr) m_pcb->cruwrite(space, offset, data);
}
WRITE_LINE_MEMBER( ti99_cartridge_device::ready_line )
@@ -509,7 +509,7 @@ READ8Z_MEMBER(ti99_cartridge_pcb::readz)
}
}
-void ti99_cartridge_pcb::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_cartridge_pcb::write)
{
if (m_romspace_selected)
{
@@ -526,7 +526,7 @@ READ8Z_MEMBER(ti99_cartridge_pcb::crureadz)
{
}
-void ti99_cartridge_pcb::cruwrite(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_cartridge_pcb::cruwrite)
{
}
@@ -614,7 +614,7 @@ READ8Z_MEMBER(ti99_paged12k_cartridge::readz)
}
}
-void ti99_paged12k_cartridge::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_paged12k_cartridge::write)
{
if (m_romspace_selected)
{
@@ -663,7 +663,7 @@ READ8Z_MEMBER(ti99_paged16k_cartridge::readz)
}
}
-void ti99_paged16k_cartridge::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_paged16k_cartridge::write)
{
if (m_romspace_selected)
{
@@ -720,7 +720,7 @@ READ8Z_MEMBER(ti99_minimem_cartridge::readz)
}
/* Write function for the minimem cartridge. */
-void ti99_minimem_cartridge::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_minimem_cartridge::write)
{
if (m_romspace_selected)
{
@@ -788,7 +788,7 @@ READ8Z_MEMBER(ti99_super_cartridge::readz)
}
/* Write function for the super cartridge. */
-void ti99_super_cartridge::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_super_cartridge::write)
{
if (m_romspace_selected)
{
@@ -826,15 +826,19 @@ READ8Z_MEMBER(ti99_super_cartridge::crureadz)
// SRL R0,1 Restore Bank Number (optional)
// RT
+ // Our implementation in MESS always gets 8 bits in one go. Also, the address
+ // is twice the bit number. That is, the offset value is always a multiple
+ // of 0x10.
+
if ((offset & 0xfff0) == 0x0800)
{
LOGMASKED(LOG_CRU, "CRU accessed at %04x\n", offset);
uint8_t val = 0x02 << (m_ram_page << 1);
- *value = BIT(val, (offset & 0x000e) >> 1);
+ *value = (val >> ((offset - 0x0800)>>1)) & 0xff;
}
}
-void ti99_super_cartridge::cruwrite(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_super_cartridge::cruwrite)
{
if ((offset & 0xfff0) == 0x0800)
{
@@ -919,7 +923,7 @@ READ8Z_MEMBER(ti99_mbx_cartridge::readz)
}
/* Write function for the mbx cartridge. */
-void ti99_mbx_cartridge::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_mbx_cartridge::write)
{
if (m_romspace_selected)
{
@@ -995,7 +999,7 @@ READ8Z_MEMBER(ti99_paged7_cartridge::readz)
}
/* Write function for the paged7 cartridge. */
-void ti99_paged7_cartridge::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_paged7_cartridge::write)
{
if (m_romspace_selected)
{
@@ -1067,7 +1071,7 @@ READ8Z_MEMBER(ti99_paged379i_cartridge::readz)
}
/* Write function for the paged379i cartridge. Only used to set the bank. */
-void ti99_paged379i_cartridge::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_paged379i_cartridge::write)
{
// Bits: 011x xxxx xxxb bbbx
// x = don't care, bbbb = bank
@@ -1118,7 +1122,7 @@ READ8Z_MEMBER(ti99_paged378_cartridge::readz)
}
/* Write function for the paged378 cartridge. Only used to set the bank. */
-void ti99_paged378_cartridge::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_paged378_cartridge::write)
{
// Bits: 011x xxxx xbbb bbbx
// x = don't care, bbbb = bank
@@ -1158,7 +1162,7 @@ READ8Z_MEMBER(ti99_paged377_cartridge::readz)
}
/* Write function for the paged377 cartridge. Only used to set the bank. */
-void ti99_paged377_cartridge::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_paged377_cartridge::write)
{
// Bits: 011x xxxb bbbb bbbx
// x = don't care, bbbb = bank
@@ -1212,7 +1216,7 @@ READ8Z_MEMBER(ti99_pagedcru_cartridge::readz)
}
/* Write function for the pagedcru cartridge. No effect. */
-void ti99_pagedcru_cartridge::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_pagedcru_cartridge::write)
{
return;
}
@@ -1227,11 +1231,11 @@ READ8Z_MEMBER(ti99_pagedcru_cartridge::crureadz)
{
page = page-(bit/2); // 4 page flags per 8 bits
}
- *value = (offset & 0x000e) == (page * 4 + 2) ? 1 : 0;
+ *value = 1 << (page*2+1);
}
}
-void ti99_pagedcru_cartridge::cruwrite(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_pagedcru_cartridge::cruwrite)
{
if ((offset & 0xf800)==0x0800)
{
@@ -1303,7 +1307,7 @@ READ8Z_MEMBER(ti99_gromemu_cartridge::readz)
{
if (m_grom_selected)
{
- if (m_grom_read_mode) gromemureadz(offset, value);
+ if (m_grom_read_mode) gromemureadz(space, offset, value, mem_mask);
}
else
{
@@ -1323,7 +1327,7 @@ READ8Z_MEMBER(ti99_gromemu_cartridge::readz)
}
}
-void ti99_gromemu_cartridge::write(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_gromemu_cartridge::write)
{
if (m_romspace_selected)
{
@@ -1344,7 +1348,7 @@ void ti99_gromemu_cartridge::write(offs_t offset, uint8_t data)
// Will not change anything when not selected (preceding gsq=ASSERT)
if (m_grom_selected)
{
- if (!m_grom_read_mode) gromemuwrite(offset, data);
+ if (!m_grom_read_mode) gromemuwrite(space, offset, data, mem_mask);
}
}
}
@@ -1369,7 +1373,7 @@ READ8Z_MEMBER(ti99_gromemu_cartridge::gromemureadz)
m_waddr_LSB = false;
}
-void ti99_gromemu_cartridge::gromemuwrite(offs_t offset, uint8_t data)
+WRITE8_MEMBER(ti99_gromemu_cartridge::gromemuwrite)
{
// Set GROM address
if (m_grom_address_mode)