Commodore64: Fix VIC addressing for Ultimax format cartridges. PLA implementation should be 100% complete now
This commit is contained in:
parent
e9bacfd683
commit
d6056bb402
|
@ -133,18 +133,9 @@ namespace BizHawk.Emulation.Computers.Commodore64
|
|||
|
||||
byte Vic_ReadMemory(int addr)
|
||||
{
|
||||
//p6 = a14 && !a13 && a12 && aec && game;
|
||||
//p7 = a14 && !a13 && a12 && aec && !exrom && !game;
|
||||
//(char rom from pla)
|
||||
|
||||
|
||||
// the system sees (cia1.PortAData & 0x3) but we use a shortcut
|
||||
addr |= (0x3 - (((cia1.PortALatch & cia1.PortADirection) | (~cia1.PortADirection)) & 0x3)) << 14;
|
||||
if ((addr & 0x7000) == 0x1000)
|
||||
bus = charRom.Read(addr);
|
||||
else
|
||||
bus = ram.Read(addr);
|
||||
return bus;
|
||||
return pla.VicRead(addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -387,7 +387,26 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS
|
|||
return 0xFF;
|
||||
}
|
||||
|
||||
public void Write(int addr, byte val)
|
||||
public byte VicRead(int addr)
|
||||
{
|
||||
game = ReadGame();
|
||||
exrom = ReadExRom();
|
||||
a14 = (addr & 0x04000) == 0;
|
||||
a13 = (addr & 0x02000) != 0;
|
||||
a12 = (addr & 0x01000) != 0;
|
||||
|
||||
// read char rom at 1000-1FFF and 9000-9FFF
|
||||
if (a14 && !a13 && a12 && (game || !exrom))
|
||||
return ReadCharRom(addr);
|
||||
|
||||
// read cartridge rom in ultimax mode
|
||||
if (a13 && a12 && exrom && !game)
|
||||
return ReadCartridgeHi(addr);
|
||||
|
||||
return ReadMemory(addr);
|
||||
}
|
||||
|
||||
public void Write(int addr, byte val)
|
||||
{
|
||||
switch (Bank(addr, false))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue