GBHawk: Clean up frame display routines

This commit is contained in:
alyosha-tas 2019-09-29 20:15:49 -04:00
parent 96fa7feb09
commit 9b161ced56
3 changed files with 18 additions and 11 deletions

View File

@ -126,7 +126,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
// send the image on VBlank
SendVideoBuffer();
for (int j = 0; j < frame_buffer.Length; j++) { frame_buffer[j] = _vidbuffer[j]; }
}
REG_FF0F_OLD = REG_FF0F;
@ -287,18 +286,31 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
return frame_buffer;
}
public int[] SendVideoBuffer()
public void SendVideoBuffer()
{
if (ppu.blank_frame)
if (GBC_compat)
{
for (int i = 0; i < _vidbuffer.Length; i++)
if (!ppu.blank_frame)
{
_vidbuffer[i] = (int)color_palette[0];
for (int j = 0; j < frame_buffer.Length; j++) { frame_buffer[j] = _vidbuffer[j]; }
}
ppu.blank_frame = false;
}
else
{
if (ppu.blank_frame)
{
for (int i = 0; i < _vidbuffer.Length; i++)
{
_vidbuffer[i] = (int)color_palette[0];
}
}
return _vidbuffer;
for (int j = 0; j < frame_buffer.Length; j++) { frame_buffer[j] = _vidbuffer[j]; }
ppu.blank_frame = false;
}
}
public int VirtualWidth => 160;

View File

@ -154,7 +154,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
// send the image on VBlank
L.SendVideoBuffer();
for (int j = 0; j < L._vidbuffer.Length; j++) { L.frame_buffer[j] = L._vidbuffer[j]; }
L.vblank_rise = false;
do_frame_fill = true;
@ -170,7 +169,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
// send the image on VBlank
R.SendVideoBuffer();
for (int j = 0; j < R._vidbuffer.Length; j++) { R.frame_buffer[j] = R._vidbuffer[j]; }
R.vblank_rise = false;
do_frame_fill = true;

View File

@ -274,7 +274,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x
// send the image on VBlank
L.SendVideoBuffer();
for (int j = 0; j < L._vidbuffer.Length; j++) { L.frame_buffer[j] = L._vidbuffer[j]; }
L.vblank_rise = false;
do_frame_fill = true;
@ -289,7 +288,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x
// send the image on VBlank
C.SendVideoBuffer();
for (int j = 0; j < C._vidbuffer.Length; j++) { C.frame_buffer[j] = C._vidbuffer[j]; }
C.vblank_rise = false;
do_frame_fill = true;
@ -304,7 +302,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x
// send the image on VBlank
R.SendVideoBuffer();
for (int j = 0; j < R._vidbuffer.Length; j++) { R.frame_buffer[j] = R._vidbuffer[j]; }
R.vblank_rise = false;
do_frame_fill = true;