mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-08 13:31:00 +00:00
Full-speed: Only redraw video screen during VBl (support VBl in full-speed)
This commit is contained in:
parent
dd3ecf738f
commit
20b8515b7b
@ -357,7 +357,7 @@ static void ContinueExecution(void)
|
||||
//
|
||||
|
||||
const UINT dwClksPerFrame = NTSC_GetCyclesPerFrame();
|
||||
if (g_dwCyclesThisFrame >= dwClksPerFrame && !VideoGetVblBar())
|
||||
if (g_dwCyclesThisFrame >= dwClksPerFrame && !VideoGetVblBar(g_dwCyclesThisFrame))
|
||||
{
|
||||
g_dwCyclesThisFrame -= dwClksPerFrame;
|
||||
|
||||
|
@ -873,24 +873,15 @@ WORD VideoGetScannerAddress(DWORD nCycles, VideoScanner_e videoScannerAddr /*= V
|
||||
|
||||
//===========================================================================
|
||||
|
||||
// TODO: Consider replacing simply with: return g_nVideoClockVert < kVDisplayableScanLines
|
||||
// - will this work in full-speed mode?
|
||||
bool VideoGetVblBar(const DWORD uExecutedCycles)
|
||||
{
|
||||
// get video scanner position
|
||||
int nCycles = CpuGetCyclesThisVideoFrame(uExecutedCycles);
|
||||
if (g_bFullSpeed)
|
||||
{
|
||||
// Ensure that NTSC video-scanner gets updated during full-speed:
|
||||
// so that video-dependent Apple II code doesn't hang & video screen can be redraw during VBL
|
||||
NTSC_VideoClockResync(CpuGetCyclesThisVideoFrame(uExecutedCycles));
|
||||
}
|
||||
|
||||
// calculate video parameters according to display standard
|
||||
const int kScanLines = g_bVideoScannerNTSC ? kNTSCScanLines : kPALScanLines;
|
||||
const int kScanCycles = kScanLines * kHClocks;
|
||||
nCycles %= kScanCycles;
|
||||
|
||||
// VBL'
|
||||
return nCycles < kVDisplayableScanLines * kHClocks;
|
||||
}
|
||||
|
||||
bool VideoGetVblBar(void)
|
||||
{
|
||||
return g_nVideoClockVert < kVDisplayableScanLines;
|
||||
}
|
||||
|
||||
|
@ -188,8 +188,7 @@ void VideoReinitialize (bool bInitVideoScannerAddress = true);
|
||||
void VideoResetState ();
|
||||
enum VideoScanner_e {VS_FullAddr, VS_PartialAddrV, VS_PartialAddrH};
|
||||
WORD VideoGetScannerAddress(DWORD nCycles, VideoScanner_e videoScannerAddr = VS_FullAddr);
|
||||
bool VideoGetVblBar(DWORD uExecutedCycles);
|
||||
bool VideoGetVblBar(void);
|
||||
bool VideoGetVblBar(const DWORD uExecutedCycles);
|
||||
|
||||
bool VideoGetSW80COL(void);
|
||||
bool VideoGetSWDHIRES(void);
|
||||
|
Loading…
Reference in New Issue
Block a user