Skip to content

Commit

Permalink
GB: Fixed missing HUD in 007 The World Is Not Enough
Browse files Browse the repository at this point in the history
  • Loading branch information
SourMesen committed May 12, 2024
1 parent 5484e41 commit c61297c
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Core/Gameboy/GbPpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void GbPpu::ProcessVblankScanline()
_state.Scanline = 0;
_state.Ly = 0;
_state.LyForCompare = 0;
_wyEnableFlag = false;
_wyEnableFlag = _state.Scanline == _state.WindowY && _state.WindowEnabled;

if(!_gameboy->IsCgb()) {
//On scanline 0, hblank gets set here (not on CGB)
Expand Down Expand Up @@ -275,22 +275,19 @@ void GbPpu::ProcessFirstScanlineAfterPowerOn()
case 91:
if(_gameboy->IsCgb()) {
_rendererIdle = false;
//"at some point in this frame the value of WY was equal to LY"
_wyEnableFlag |= _state.Scanline == _state.WindowY && _state.WindowEnabled;
}
break;

case 92:
if(!_gameboy->IsCgb()) {
_rendererIdle = false;
//"at some point in this frame the value of WY was equal to LY"
_wyEnableFlag |= _state.Scanline == _state.WindowY && _state.WindowEnabled;
}
break;

case 456:
_state.Cycle = 0;
_state.Scanline++;
_wyEnableFlag |= _state.Scanline == _state.WindowY && _state.WindowEnabled;
_drawnPixels = 0;
_state.Ly = _state.Scanline;
_drawnPixels = 0;
Expand Down Expand Up @@ -346,23 +343,20 @@ void GbPpu::ProcessVisibleScanline()
case 88:
if(_gameboy->IsCgb()) {
_rendererIdle = false;
//"at some point in this frame the value of WY was equal to LY"
_wyEnableFlag |= _state.Scanline == _state.WindowY && _state.WindowEnabled;
}
break;

case 89:
if(!_gameboy->IsCgb()) {
_rendererIdle = false;
//"at some point in this frame the value of WY was equal to LY"
_wyEnableFlag |= _state.Scanline == _state.WindowY && _state.WindowEnabled;
}
break;

case 456:
_state.Cycle = 0;
_state.Scanline++;
_state.Ly = _state.Scanline;
_wyEnableFlag |= _state.Scanline == _state.WindowY && _state.WindowEnabled;
_drawnPixels = 0;
if(_state.Scanline == 144) {
_state.LyForCompare = -1;
Expand Down Expand Up @@ -952,6 +946,8 @@ void GbPpu::Write(uint16_t addr, uint8_t value)
_state.LargeSprites = (value & 0x04) != 0;
_state.SpritesEnabled = (value & 0x02) != 0;
_state.BgEnabled = (value & 0x01) != 0;

_wyEnableFlag |= _state.Scanline == _state.WindowY && _state.WindowEnabled;
break;

case 0xFF41:
Expand Down

0 comments on commit c61297c

Please sign in to comment.