c64: Route LORAM to expansion port interface for BusCard. [Curt Coder]

This commit is contained in:
Curt Coder 2019-05-11 20:16:37 +03:00
parent b329fa3125
commit 7255f87b9e
11 changed files with 43 additions and 39 deletions

View File

@ -160,7 +160,7 @@ void buscard_t::c64_cd_w(offs_t offset, uint8_t data, int sphi2, int ba, int rom
int buscard_t::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
{
return m_exp->game_r(offset, sphi2, ba, rw, m_slot->hiram());
return m_exp->game_r(offset, sphi2, ba, rw, m_slot->loram(), m_slot->hiram());
}
@ -170,5 +170,5 @@ int buscard_t::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
int buscard_t::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
{
return m_exp->exrom_r(offset, sphi2, ba, rw, m_slot->hiram());
return m_exp->exrom_r(offset, sphi2, ba, rw, m_slot->loram(), m_slot->hiram());
}

View File

@ -27,13 +27,13 @@ DEFINE_DEVICE_TYPE(C64_EXPANSION_SLOT, c64_expansion_slot_device, "c64_expansion
// device_c64_expansion_card_interface - constructor
//-------------------------------------------------
device_c64_expansion_card_interface::device_c64_expansion_card_interface(const machine_config &mconfig, device_t &device)
: device_slot_card_interface(mconfig, device),
m_roml(*this, "roml"),
m_romh(*this, "romh"),
m_nvram(*this, "nvram"),
m_game(1),
m_exrom(1)
device_c64_expansion_card_interface::device_c64_expansion_card_interface(const machine_config &mconfig, device_t &device) :
device_slot_card_interface(mconfig, device),
m_roml(*this, "roml"),
m_romh(*this, "romh"),
m_nvram(*this, "nvram"),
m_game(1),
m_exrom(1)
{
m_slot = dynamic_cast<c64_expansion_slot_device *>(device.owner());
}
@ -58,15 +58,15 @@ device_c64_expansion_card_interface::~device_c64_expansion_card_interface()
//-------------------------------------------------
c64_expansion_slot_device::c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, C64_EXPANSION_SLOT, tag, owner, clock),
device_slot_interface(mconfig, *this),
device_image_interface(mconfig, *this),
m_read_dma_cd(*this),
m_write_dma_cd(*this),
m_write_irq(*this),
m_write_nmi(*this),
m_write_dma(*this),
m_write_reset(*this), m_card(nullptr), m_hiram(0)
device_t(mconfig, C64_EXPANSION_SLOT, tag, owner, clock),
device_slot_interface(mconfig, *this),
device_image_interface(mconfig, *this),
m_read_dma_cd(*this),
m_write_dma_cd(*this),
m_write_irq(*this),
m_write_nmi(*this),
m_write_dma(*this),
m_write_reset(*this), m_card(nullptr), m_hiram(0)
{
}
@ -253,11 +253,12 @@ void c64_expansion_slot_device::cd_w(offs_t offset, uint8_t data, int sphi2, int
// game_r - GAME read
//-------------------------------------------------
int c64_expansion_slot_device::game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
int c64_expansion_slot_device::game_r(offs_t offset, int sphi2, int ba, int rw, int loram, int hiram)
{
int state = 1;
m_hiram = hiram;
m_loram = loram;
if (m_card != nullptr)
{
@ -272,11 +273,12 @@ int c64_expansion_slot_device::game_r(offs_t offset, int sphi2, int ba, int rw,
// exrom_r - EXROM read
//-------------------------------------------------
int c64_expansion_slot_device::exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
int c64_expansion_slot_device::exrom_r(offs_t offset, int sphi2, int ba, int rw, int loram, int hiram)
{
int state = 1;
m_hiram = hiram;
m_loram = loram;
if (m_card != nullptr)
{

View File

@ -83,8 +83,8 @@ public:
// computer interface
uint8_t cd_r(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2);
void cd_w(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2);
int game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
int exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
int game_r(offs_t offset, int sphi2, int ba, int rw, int loram, int hiram);
int exrom_r(offs_t offset, int sphi2, int ba, int rw, int loram, int hiram);
// cartridge interface
uint8_t dma_cd_r(offs_t offset) { return m_read_dma_cd(offset); }
@ -96,7 +96,8 @@ public:
int phi2() { return clock(); }
int dotclock() { return phi2() * 8; }
int hiram() { return m_hiram; }
int loram() { return m_loram; }
void set_passthrough();
protected:
@ -132,6 +133,7 @@ protected:
device_c64_expansion_card_interface *m_card;
int m_hiram;
int m_loram;
};

View File

@ -106,7 +106,7 @@ READ8_MEMBER( c64_ieee488_device::tpi_pc_r )
data |= m_bus->ifc_r();
data |= m_bus->srq_r() << 1;
data |= m_exp->exrom_r(offset, 1, 1, 1, 0) << 7;
data |= m_exp->exrom_r(offset, 1, 1, 1, 0, 0) << 7;
return data;
}
@ -240,5 +240,5 @@ void c64_ieee488_device::c64_cd_w(offs_t offset, uint8_t data, int sphi2, int ba
int c64_ieee488_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
{
return m_exp->game_r(offset, sphi2, ba, rw, m_slot->hiram());
return m_exp->game_r(offset, sphi2, ba, rw, m_slot->loram(), m_slot->hiram());
}

View File

@ -97,7 +97,7 @@ READ8_MEMBER( c64_magic_voice_cartridge_device::tpi_pa_r )
uint8_t data = 0;
data |= m_exp->game_r(get_offset(m_ca), 1, 1, 1, 0) << 5;
data |= m_exp->game_r(get_offset(m_ca), 1, 1, 1, 0, 0) << 5;
data |= m_vslsi->eos_r() << 6;
data |= m_fifo->dir_r() << 7;
@ -144,7 +144,7 @@ READ8_MEMBER( c64_magic_voice_cartridge_device::tpi_pb_r )
uint8_t data = 0;
data |= m_exp->exrom_r(get_offset(m_ca), 1, 1, 1, 0) << 7;
data |= m_exp->exrom_r(get_offset(m_ca), 1, 1, 1, 0, 0) << 7;
return data;
}

View File

@ -206,7 +206,7 @@ void c64_music64_cartridge_device::c64_cd_w(offs_t offset, uint8_t data, int sph
int c64_music64_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
{
return m_exp->game_r(offset, sphi2, ba, rw, m_slot->hiram());
return m_exp->game_r(offset, sphi2, ba, rw, m_slot->loram(), m_slot->hiram());
}
@ -216,5 +216,5 @@ int c64_music64_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, i
int c64_music64_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
{
return m_exp->exrom_r(offset, sphi2, ba, rw, m_slot->hiram());
return m_exp->exrom_r(offset, sphi2, ba, rw, m_slot->loram(), m_slot->hiram());
}

View File

@ -248,7 +248,7 @@ void c64_sfx_sound_expander_cartridge_device::c64_cd_w(offs_t offset, uint8_t da
int c64_sfx_sound_expander_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
{
return m_exp->game_r(get_offset(offset, rw), sphi2, ba, rw, m_slot->hiram());
return m_exp->game_r(get_offset(offset, rw), sphi2, ba, rw, m_slot->loram(), m_slot->hiram());
}
@ -258,5 +258,5 @@ int c64_sfx_sound_expander_cartridge_device::c64_game_r(offs_t offset, int sphi2
int c64_sfx_sound_expander_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
{
return m_exp->exrom_r(get_offset(offset, rw), sphi2, ba, rw, m_slot->hiram());
return m_exp->exrom_r(get_offset(offset, rw), sphi2, ba, rw, m_slot->loram(), m_slot->hiram());
}

View File

@ -285,7 +285,7 @@ void c64_supercpu_device::c64_cd_w(offs_t offset, uint8_t data, int sphi2, int b
int c64_supercpu_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
{
return m_exp->game_r(offset, sphi2, ba, rw, m_slot->hiram());
return m_exp->game_r(offset, sphi2, ba, rw, m_slot->loram(), m_slot->hiram());
}
@ -295,5 +295,5 @@ int c64_supercpu_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
int c64_supercpu_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
{
return m_exp->exrom_r(offset, sphi2, ba, rw, m_slot->hiram());
return m_exp->exrom_r(offset, sphi2, ba, rw, m_slot->loram(), m_slot->hiram());
}

View File

@ -319,7 +319,7 @@ void c64_tdos_cartridge_device::c64_cd_w(offs_t offset, uint8_t data, int sphi2,
int c64_tdos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
{
return m_enabled ? 1 : m_exp->game_r(offset, sphi2, ba, rw, m_slot->hiram());
return m_enabled ? 1 : m_exp->game_r(offset, sphi2, ba, rw, m_slot->loram(), m_slot->hiram());
}
@ -329,5 +329,5 @@ int c64_tdos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int
int c64_tdos_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
{
return m_enabled ? 0 : m_exp->exrom_r(offset, sphi2, ba, rw, m_slot->hiram());
return m_enabled ? 0 : m_exp->exrom_r(offset, sphi2, ba, rw, m_slot->loram(), m_slot->hiram());
}

View File

@ -319,8 +319,8 @@ int c128_state::read_pla(offs_t offset, offs_t ca, offs_t vma, int ba, int rw, i
int vicfix = 1;
int sphi2 = m_vic->phi0_r();
m_game = m_exp->game_r(ca, sphi2, ba, rw, m_hiram);
m_exrom = m_exp->exrom_r(ca, sphi2, ba, rw, m_hiram);
m_game = m_exp->game_r(ca, sphi2, ba, rw, m_loram, m_hiram);
m_exrom = m_exp->exrom_r(ca, sphi2, ba, rw, m_loram, m_hiram);
uint32_t input = sphi2 << 26 | m_va14 << 25 | m_charen << 24 |
m_hiram << 23 | m_loram << 22 | ba << 21 | VMA5 << 20 | VMA4 << 19 | ms0 << 18 | ms1 << 17 | ms2 << 16 |

View File

@ -445,8 +445,8 @@ int c64_state::read_pla(offs_t offset, offs_t va, int rw, int aec, int ba)
//int ba = m_vic->ba_r();
//int aec = !m_vic->aec_r();
int sphi2 = m_vic->phi0_r();
int game = m_exp->game_r(offset, sphi2, ba, rw, m_hiram);
int exrom = m_exp->exrom_r(offset, sphi2, ba, rw, m_hiram);
int game = m_exp->game_r(offset, sphi2, ba, rw, m_loram, m_hiram);
int exrom = m_exp->exrom_r(offset, sphi2, ba, rw, m_loram, m_hiram);
int cas = 0;
uint32_t input = VA12 << 15 | VA13 << 14 | game << 13 | exrom << 12 | rw << 11 | aec << 10 | ba << 9 | A12 << 8 |