Skip to content

Commit

Permalink
NES: Fix MMC5 sprite display when using 8x16 mode with 8kb window and…
Browse files Browse the repository at this point in the history
… reduce sprite flicker enabled (#60)
  • Loading branch information
jroweboy committed May 9, 2024
1 parent 5b69530 commit 78130ed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Core/NES/NesPpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,13 +913,18 @@ template<class T> void NesPpu<T>::ProcessScanlineImpl()
//copy vertical scrolling value from t
_videoRamAddr = (_videoRamAddr & ~0x7BE0) | (_tmpVideoRamAddr & 0x7BE0);
}
// Load the extra sprites before tile loading starts (which matters for MMC5)
// The CHR banks are switched back to the bg tileset in LoadTileInfo on cycle 321
// and the extra sprites will potentially read from the wrong banks
if(_cycle == 320) {
LoadExtraSprites();
}
}
} else if(_cycle >= 321 && _cycle <= 336) {
LoadTileInfo();

if(_cycle == 321) {
if(IsRenderingEnabled()) {
LoadExtraSprites();
_oamCopybuffer = _secondarySpriteRam[0];
}
} else if(_prevRenderingEnabled && (_cycle == 328 || _cycle == 336)) {
Expand Down

0 comments on commit 78130ed

Please sign in to comment.