bus/c64: fixed MT07867

This commit is contained in:
Ivan Vangelista 2021-02-13 20:12:23 +01:00
parent 6aa8804ac4
commit 7e5a013c09
5 changed files with 17 additions and 8 deletions

View File

@ -29,6 +29,8 @@ DEFINE_DEVICE_TYPE(C64_EXPANSION_SLOT, c64_expansion_slot_device, "c64_expansion
device_c64_expansion_card_interface::device_c64_expansion_card_interface(const machine_config &mconfig, device_t &device) :
device_interface(device, "c64exp"),
m_roml_size(0),
m_romh_size(0),
m_game(1),
m_exrom(1)
{
@ -166,6 +168,8 @@ image_init_result c64_expansion_slot_device::call_load()
// Ultimax (VIC-10) cartridge
load_software_region("lorom", m_card->m_roml);
load_software_region("uprom", m_card->m_romh);
m_card->m_roml_size = get_software_region_length("roml");
m_card->m_romh_size = get_software_region_length("romh");
m_card->m_exrom = 1;
m_card->m_game = 0;
@ -177,6 +181,8 @@ image_init_result c64_expansion_slot_device::call_load()
load_software_region("romh", m_card->m_romh);
load_software_region("romx", m_card->m_romx);
load_software_region("nvram", m_card->m_nvram);
m_card->m_roml_size = get_software_region_length("roml");
m_card->m_romh_size = get_software_region_length("romh");
if (get_feature("exrom") != nullptr) m_card->m_exrom = atol(get_feature("exrom"));
if (get_feature("game") != nullptr) m_card->m_game = atol(get_feature("game"));

View File

@ -153,6 +153,9 @@ protected:
std::unique_ptr<uint8_t[]> m_romx;
std::unique_ptr<uint8_t[]> m_nvram;
uint32_t m_roml_size;
uint32_t m_romh_size;
int m_game;
int m_exrom;

View File

@ -87,12 +87,12 @@ uint8_t c64_ocean_cartridge_device::c64_cd_r(offs_t offset, uint8_t data, int sp
if (!roml && m_roml)
{
offs_t addr = (m_bank << 13) | (offset & 0x1fff);
data = m_roml[addr];
data = m_roml[addr & (m_roml_size - 1)];
}
else if (!romh && m_romh)
{
offs_t addr = (m_bank << 13) | (offset & 0x1fff);
data = m_romh[addr];
data = m_romh[addr & (m_romh_size - 1)];
}
else if (!io1)
{

View File

@ -51,17 +51,17 @@ uint8_t c64_standard_cartridge_device::c64_cd_r(offs_t offset, uint8_t data, int
{
if (!roml && m_roml)
{
data = m_roml[offset];
data = m_roml[offset & (m_roml_size - 1)];
}
else if (!romh)
{
if (m_romh)
{
data = m_romh[offset];
data = m_romh[offset & (m_romh_size - 1)];
}
else if (m_roml)
{
data = m_roml[offset];
data = m_roml[offset & (m_roml_size - 1)];
}
}

View File

@ -61,17 +61,17 @@ uint8_t c64_westermann_cartridge_device::c64_cd_r(offs_t offset, uint8_t data, i
{
if (!roml)
{
data = m_roml[offset];
data = m_roml[offset & (m_roml_size - 1)];
}
else if (!romh)
{
if (m_romh)
{
data = m_romh[offset];
data = m_romh[offset & (m_romh_size - 1)];
}
else
{
data = m_roml[offset];
data = m_roml[offset & (m_roml_size - 1)];
}
}
else if (!io2)