GBHawk: minor bug fixes

This commit is contained in:
alyosha-tas 2019-10-10 20:12:44 -04:00
parent 931a4dcde9
commit 5916b9af17
5 changed files with 17 additions and 1 deletions

View File

@ -117,6 +117,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
VRAM_access_write = true;
OAM_access_read = true;
OAM_access_write = true;
clear_screen = true;
}
if (!LCDC.Bit(7) && value.Bit(7))

View File

@ -132,6 +132,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
in_vblank_old = in_vblank;
}
// turn off the screen so the image doesnt persist
// but dont turn off blank_frame yet, it still needs to be true until the next VBL
// this doesn't run for GBC, some games, ex MIB the series 2, rely on the screens persistence while off to make video look smooth.
// But some GB gams, ex Battletoads, turn off the screen for a long time from the middle of the frame, so need to be cleared.
if (ppu.clear_screen)
{
for (int j = 0; j < frame_buffer.Length; j++) { frame_buffer[j] = (int)color_palette[0]; }
ppu.clear_screen = false;
}
}
public void do_single_step()

View File

@ -39,6 +39,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
VRAM_access_write = true;
OAM_access_read = true;
OAM_access_write = true;
clear_screen = true;
}
if (!LCDC.Bit(7) && value.Bit(7))

View File

@ -114,7 +114,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
case 0xFF4F: // VBK
if (GBC_compat)
{
ret = VRAM_Bank;
ret = (byte)(0xFE | VRAM_Bank);
}
else
{

View File

@ -11,6 +11,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
public uint[] OBJ_palette = new uint[32];
public bool HDMA_active;
public bool clear_screen;
// register variables
public byte LCDC;
@ -172,6 +173,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
ser.Sync(nameof(BG_palette), ref BG_palette, false);
ser.Sync(nameof(OBJ_palette), ref OBJ_palette, false);
ser.Sync(nameof(HDMA_active), ref HDMA_active);
ser.Sync(nameof(clear_screen), ref clear_screen);
ser.Sync(nameof(LCDC), ref LCDC);
ser.Sync(nameof(STAT), ref STAT);