ppu background rendering is working as intended
This commit is contained in:
parent
ca3eac8393
commit
6fe829d66c
14
src/PPU.cpp
14
src/PPU.cpp
|
@ -404,6 +404,13 @@ void PPU::PerformRenderAction()
|
||||||
loTile.Lo = patternTableLo;
|
loTile.Lo = patternTableLo;
|
||||||
hiTile.Lo = patternTableHi;
|
hiTile.Lo = patternTableHi;
|
||||||
|
|
||||||
|
Byte attributeHalfNybble = attributeTableByte;
|
||||||
|
attributeHalfNybble >>= (((current.CoarseX >> 1) % 2) ? 2 : 0);
|
||||||
|
attributeHalfNybble >>= (((current.CoarseY >> 1) % 2) ? 4 : 0);
|
||||||
|
|
||||||
|
loAttribute.Lo = ((attributeHalfNybble & 1) ? 0xFF : 0x00);
|
||||||
|
hiAttribute.Lo = ((attributeHalfNybble & 2) ? 0xFF : 0x00);
|
||||||
|
|
||||||
current.CoarseX++;
|
current.CoarseX++;
|
||||||
if (x == 256)
|
if (x == 256)
|
||||||
{
|
{
|
||||||
|
@ -426,13 +433,6 @@ void PPU::PerformRenderAction()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Byte attributeHalfNybble = attributeTableByte;
|
|
||||||
attributeHalfNybble >>= ((current.CoarseX % 2) ? 2 : 0);
|
|
||||||
attributeHalfNybble >>= ((current.CoarseY % 2) ? 0 : 4);
|
|
||||||
|
|
||||||
loAttribute.Lo = ((attributeHalfNybble & 1) ? 0xFF : 0x00);
|
|
||||||
hiAttribute.Lo = ((attributeHalfNybble & 2) ? 0xFF : 0x00);
|
|
||||||
|
|
||||||
fetchPhase = FetchingPhase::NametableByte;
|
fetchPhase = FetchingPhase::NametableByte;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue