mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-24 00:34:43 +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();
|
const UINT dwClksPerFrame = NTSC_GetCyclesPerFrame();
|
||||||
if (g_dwCyclesThisFrame >= dwClksPerFrame && !VideoGetVblBar())
|
if (g_dwCyclesThisFrame >= dwClksPerFrame && !VideoGetVblBar(g_dwCyclesThisFrame))
|
||||||
{
|
{
|
||||||
g_dwCyclesThisFrame -= dwClksPerFrame;
|
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)
|
bool VideoGetVblBar(const DWORD uExecutedCycles)
|
||||||
{
|
{
|
||||||
// get video scanner position
|
if (g_bFullSpeed)
|
||||||
int nCycles = CpuGetCyclesThisVideoFrame(uExecutedCycles);
|
{
|
||||||
|
// 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;
|
return g_nVideoClockVert < kVDisplayableScanLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,8 +188,7 @@ void VideoReinitialize (bool bInitVideoScannerAddress = true);
|
|||||||
void VideoResetState ();
|
void VideoResetState ();
|
||||||
enum VideoScanner_e {VS_FullAddr, VS_PartialAddrV, VS_PartialAddrH};
|
enum VideoScanner_e {VS_FullAddr, VS_PartialAddrV, VS_PartialAddrH};
|
||||||
WORD VideoGetScannerAddress(DWORD nCycles, VideoScanner_e videoScannerAddr = VS_FullAddr);
|
WORD VideoGetScannerAddress(DWORD nCycles, VideoScanner_e videoScannerAddr = VS_FullAddr);
|
||||||
bool VideoGetVblBar(DWORD uExecutedCycles);
|
bool VideoGetVblBar(const DWORD uExecutedCycles);
|
||||||
bool VideoGetVblBar(void);
|
|
||||||
|
|
||||||
bool VideoGetSW80COL(void);
|
bool VideoGetSW80COL(void);
|
||||||
bool VideoGetSWDHIRES(void);
|
bool VideoGetSWDHIRES(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user