added ppu read latch
This commit is contained in:
parent
2fdae00ff8
commit
9ab5ac3c13
2 changed files with 5 additions and 2 deletions
|
@ -131,7 +131,8 @@ Byte ppuRead(struct PPU* ppu, Word addr)
|
||||||
{
|
{
|
||||||
if (ppu->ppuAddress.raw < 0x2000)
|
if (ppu->ppuAddress.raw < 0x2000)
|
||||||
{
|
{
|
||||||
val = readCartridgePPU(ppu->bus->cartridge, ppu->ppuAddress.raw);
|
val = ppu->ppuReadLatch;
|
||||||
|
ppu->ppuReadLatch = readCartridgePPU(ppu->bus->cartridge, ppu->ppuAddress.raw);
|
||||||
}
|
}
|
||||||
else if (0x2000 <= ppu->ppuAddress.raw && ppu->ppuAddress.raw < 0x3F00)
|
else if (0x2000 <= ppu->ppuAddress.raw && ppu->ppuAddress.raw < 0x3F00)
|
||||||
{
|
{
|
||||||
|
@ -140,7 +141,8 @@ Byte ppuRead(struct PPU* ppu, Word addr)
|
||||||
if (effectiveAddress >= 0x2800)
|
if (effectiveAddress >= 0x2800)
|
||||||
effectiveAddress -= 0x0400;
|
effectiveAddress -= 0x0400;
|
||||||
|
|
||||||
val = ppu->nameTables[0][(effectiveAddress - 0x2000) & 0x0FFF];
|
val = ppu->ppuReadLatch;
|
||||||
|
ppu->ppuReadLatch = ppu->nameTables[0][(effectiveAddress - 0x2000) & 0x0FFF];
|
||||||
}
|
}
|
||||||
else if (0x3F00 <= ppu->ppuAddress.raw && ppu->ppuAddress.raw < 0x4000)
|
else if (0x3F00 <= ppu->ppuAddress.raw && ppu->ppuAddress.raw < 0x4000)
|
||||||
{
|
{
|
||||||
|
|
|
@ -113,6 +113,7 @@ struct PPU
|
||||||
Word raw;
|
Word raw;
|
||||||
} ppuAddress;
|
} ppuAddress;
|
||||||
Byte ppuAddressWriteTarget;
|
Byte ppuAddressWriteTarget;
|
||||||
|
Byte ppuReadLatch;
|
||||||
|
|
||||||
Byte oamdma;
|
Byte oamdma;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue