ti99: Block invalid accesses to VDP (like writing on read address); fixes Ambulance game.

This commit is contained in:
Michael Zapf 2020-01-06 13:54:56 +01:00
parent 974b9339cb
commit 5ef3d3a3b5

View File

@ -123,31 +123,25 @@ datamux_device::datamux_device(const machine_config &mconfig, const char *tag, d
void datamux_device::read_all(uint16_t addr, uint8_t *value)
{
// Valid access
bool validaccess = ((addr & 0x0400)==0);
if (validaccess)
// GROM access
if ((addr & 0xfc01)==0x9800)
{
// GROM access
if ((addr & 0xf801)==0x9800)
if (m_console_groms_present)
{
if (m_console_groms_present)
{
m_grom0->readz(value);
m_grom1->readz(value);
m_grom2->readz(value);
}
// GROMport (GROMs)
m_gromport->readz(addr, value);
m_grom_idle = false;
m_grom0->readz(value);
m_grom1->readz(value);
m_grom2->readz(value);
}
// GROMport (GROMs)
m_gromport->readz(addr, value);
m_grom_idle = false;
}
// Video
if ((addr & 0xf801)==0x8800)
{
// Forward to VDP unless we have an EVPC
if (m_video != nullptr) *value = m_video->read(addr>>1); // A14 determines data or register read
}
// Video
if ((addr & 0xfc01)==0x8800)
{
// Forward to VDP unless we have an EVPC
if (m_video != nullptr) *value = m_video->read((addr>>1)&1); // A14 determines data or register read
}
// GROMport (ROMs)
@ -185,10 +179,10 @@ void datamux_device::write_all(uint16_t addr, uint8_t value)
}
// Video
if ((addr & 0xf801)==0x8800)
if ((addr & 0xfc01)==0x8c00)
{
// Forward to VDP unless we have an EVPC
if (m_video != nullptr) m_video->write(addr>>1, value); // A14 determines data or register write
if (m_video != nullptr) m_video->write((addr>>1)&1, value); // A14 determines data or register write
}
// I/O port gets all accesses