PPU: Need to perform both sprite & bg fetches when either sprite or background is enabled. Otherwise things that rely on these fetches break - such as the MMC3 IRQ timer. Fixes Burai Fighter freezing at the start of level 1

This commit is contained in:
Souryo 2014-07-26 20:21:36 -04:00
parent 3823407b58
commit 35d2e9cc00

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "PPU.h"
#include "CPU.h"
#include "../Utilities/PNGWriter.h"
PPU* PPU::Instance = nullptr;
IVideoDevice *PPU::VideoDevice = nullptr;
@ -306,7 +307,7 @@ uint16_t PPU::GetAttributeAddr()
void PPU::LoadTileInfo()
{
if(_flags.BackgroundEnabled) {
if(IsRenderingEnabled()) {
_previousTile = _currentTile;
_currentTile = _nextTile;
@ -322,7 +323,7 @@ void PPU::LoadTileInfo()
void PPU::LoadSpriteTileInfo(uint8_t spriteIndex)
{
if(_flags.SpritesEnabled) {
if(IsRenderingEnabled()) {
uint32_t spriteAddr = spriteIndex * 4;
uint8_t spriteY = _secondarySpriteRAM[spriteAddr];
uint8_t tileIndex = _secondarySpriteRAM[spriteAddr + 1];