mirror of
https://github.com/SourMesen/Mesen.git
synced 2025-04-02 10:52:48 -04:00
Added VBlank suppression flag
This commit is contained in:
parent
16b6ebeb84
commit
739d1d8f7a
2 changed files with 10 additions and 8 deletions
16
Core/PPU.cpp
16
Core/PPU.cpp
|
@ -196,6 +196,10 @@ void PPU::UpdateStatusFlag()
|
|||
((uint8_t)_statusFlags.Sprite0Hit << 6) |
|
||||
((uint8_t)_statusFlags.VerticalBlank << 7);
|
||||
_statusFlags.VerticalBlank = false;
|
||||
|
||||
if(_scanline == 241 && _cycle == 0) {
|
||||
_doNotSetVBFlag = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Taken from http://wiki.nesdev.com/w/index.php/The_skinny_on_NES_scrolling#Wrapping_around
|
||||
|
@ -490,16 +494,13 @@ void PPU::CopyOAMData()
|
|||
void PPU::BeginVBlank()
|
||||
{
|
||||
if(_cycle == 1) {
|
||||
_statusFlags.VerticalBlank = true;
|
||||
/*if(!_suppressVBlank) {
|
||||
// We're in VBlank
|
||||
Ppu_setStatus(p, STATUS_VBLANK_STARTED);
|
||||
p->cycleCount = 0;
|
||||
}*/
|
||||
if(!_doNotSetVBFlag) {
|
||||
_statusFlags.VerticalBlank = true;
|
||||
}
|
||||
if(_flags.VBlank) {
|
||||
CPU::SetNMIFlag();
|
||||
}
|
||||
//Ppu_raster(p);
|
||||
_doNotSetVBFlag = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -507,7 +508,6 @@ void PPU::EndVBlank()
|
|||
{
|
||||
if(_cycle == 340) {
|
||||
_frameCount++;
|
||||
//std::cout << _frameCount << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -90,6 +90,8 @@ class PPU : public IMemoryHandler
|
|||
PPUControlFlags _flags;
|
||||
PPUStatusFlags _statusFlags;
|
||||
|
||||
bool _doNotSetVBFlag = false;
|
||||
|
||||
TileInfo _currentTile;
|
||||
TileInfo _nextTile;
|
||||
TileInfo _previousTile;
|
||||
|
|
Loading…
Add table
Reference in a new issue