Added new function NTSC_VideoRedrawWholeScreen() to fix #352

This commit is contained in:
tomcw
2016-09-25 10:42:14 +01:00
parent 30160583cb
commit 5f0ccfc75c
6 changed files with 40 additions and 35 deletions
+27
View File
@@ -1729,6 +1729,8 @@ bool NTSC_VideoIsVbl ()
//===========================================================================
void NTSC_VideoUpdateCycles( long cycles6502 )
{
_ASSERT(cycles6502 < VIDEO_SCANNER_6502_CYCLES); // Use NTSC_VideoRedrawWholeScreen() instead
bool bRedraw = cycles6502 >= VIDEO_SCANNER_6502_CYCLES;
// if( !g_bFullSpeed )
@@ -1774,3 +1776,28 @@ if(true)
}
}
}
//===========================================================================
void NTSC_VideoRedrawWholeScreen( void )
{
// Save/restore current V/H positions - maybe not strictly necessary, but should be harmless
uint16_t currVideoClockVert = g_nVideoClockVert;
uint16_t currVideoClockHorz = g_nVideoClockHorz;
// Need to reset V/H positions so that redraw occurs from the start of the frame & mixed-mode is rendered correctly
g_nVideoClockVert = 0;
g_nVideoClockHorz = 0;
if (g_nVideoMixed)
{
g_pFuncUpdateGraphicsScreen(VIDEO_SCANNER_MAX_HORZ * VIDEO_SCANNER_Y_MIXED); // lines [0..159]
g_pFuncUpdateGraphicsScreen(VIDEO_SCANNER_6502_CYCLES - (VIDEO_SCANNER_MAX_HORZ * VIDEO_SCANNER_Y_MIXED)); // lines [160..191..261]
}
else
{
g_pFuncUpdateGraphicsScreen(VIDEO_SCANNER_6502_CYCLES); // lines [0..261]
}
g_nVideoClockVert = currVideoClockVert;
g_nVideoClockHorz = currVideoClockHorz;
}