PPU: Fixed a couple of rendering-related scanline conditions for scanline 239/240

This commit is contained in:
Souryo 2016-07-10 09:08:31 -04:00
parent 313340198e
commit f3bf2a631c

View file

@ -97,7 +97,7 @@ PPUDebugState PPU::GetState()
void PPU::UpdateVideoRamAddr()
{
if(_scanline >= 239 || !IsRenderingEnabled()) {
if(_scanline >= 240 || !IsRenderingEnabled()) {
_state.VideoRamAddr += _flags.VerticalWrite ? 32 : 1;
//Trigger memory read when setting the vram address - needed by MMC3 IRQ counter
@ -170,7 +170,7 @@ uint8_t PPU::ReadRAM(uint16_t addr)
break;
case PPURegisters::SpriteData:
if(_scanline <= 240 && IsRenderingEnabled() && (_cycle >= 257 || _cycle <= 64)) {
if(_scanline <= 239 && IsRenderingEnabled() && (_cycle >= 257 || _cycle <= 64)) {
if(_cycle >= 257 && _cycle <= 320) {
//Set OAM copy buffer to its proper value. This is done here for performance.
//It's faster to only do this here when it's needed, rather than splitting LoadSpriteTileInfo() into an 8-step process