SMS: make undrawn area black, overscan itelf still needs reworking, fixes #2892

This commit is contained in:
alyosha-tas 2021-08-02 11:44:11 -04:00
parent 38442bd5fe
commit b6e91aef32
2 changed files with 8 additions and 5 deletions

View File

@ -304,25 +304,28 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
OverscanFrameBuffer = new int[OverscanFrameHeight * OverscanFrameWidth];
}
// TODO: overscan color can change, this should be calculated per scanline, not done in bulk at the end
int overscan_color = Palette[BackdropColor];
// Top overscan
for (int y=0; y<overscanTop; y++)
for (int x = 0; x < OverscanFrameWidth; x++)
OverscanFrameBuffer[(y * OverscanFrameWidth) + x] = BackgroundColor;
OverscanFrameBuffer[(y * OverscanFrameWidth) + x] = overscan_color;
// Bottom overscan
for (int y = overscanTop + 192; y < OverscanFrameHeight; y++)
for (int x = 0; x < OverscanFrameWidth; x++)
OverscanFrameBuffer[(y * OverscanFrameWidth) + x] = BackgroundColor;
OverscanFrameBuffer[(y * OverscanFrameWidth) + x] = overscan_color;
// Left overscan
for (int y = overscanTop; y < overscanTop + 192; y++)
for (int x = 0; x < overscanLeft; x++)
OverscanFrameBuffer[(y * OverscanFrameWidth) + x] = BackgroundColor;
OverscanFrameBuffer[(y * OverscanFrameWidth) + x] = overscan_color;
// Right overscan
for (int y = overscanTop; y < overscanTop + 192; y++)
for (int x = overscanLeft + 256; x < OverscanFrameWidth; x++)
OverscanFrameBuffer[(y * OverscanFrameWidth) + x] = BackgroundColor;
OverscanFrameBuffer[(y * OverscanFrameWidth) + x] = overscan_color;
// Active display area
for (int y = 0; y < 192; y++)

View File

@ -473,7 +473,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
}
}
public int BackgroundColor => Palette[BackdropColor];
public int BackgroundColor => unchecked((int)0xFF000000);
public int VsyncNumerator => DisplayType == DisplayType.NTSC ? 60 : 50;