mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-02-03 19:32:45 +00:00
Merge branch 'master' of https://github.com/AppleWin/AppleWin
This commit is contained in:
commit
2d839b3207
@ -44,7 +44,6 @@ TCHAR *g_pAppTitle = TITLE_APPLE_2E_ENHANCED;
|
|||||||
|
|
||||||
eApple2Type g_Apple2Type = A2TYPE_APPLE2EENHANCED;
|
eApple2Type g_Apple2Type = A2TYPE_APPLE2EENHANCED;
|
||||||
|
|
||||||
BOOL behind = 0; // Redundant
|
|
||||||
DWORD cumulativecycles = 0; // Wraps after ~1hr 9mins
|
DWORD cumulativecycles = 0; // Wraps after ~1hr 9mins
|
||||||
DWORD cyclenum = 0; // Used by SpkrToggle() for non-wave sound
|
DWORD cyclenum = 0; // Used by SpkrToggle() for non-wave sound
|
||||||
DWORD emulmsec = 0;
|
DWORD emulmsec = 0;
|
||||||
@ -163,8 +162,6 @@ void SetPriorityNormal(void)
|
|||||||
|
|
||||||
void ContinueExecution(void)
|
void ContinueExecution(void)
|
||||||
{
|
{
|
||||||
static BOOL pageflipping = 0; //?
|
|
||||||
|
|
||||||
const double fUsecPerSec = 1.e6;
|
const double fUsecPerSec = 1.e6;
|
||||||
#if 1
|
#if 1
|
||||||
const UINT nExecutionPeriodUsec = 1000; // 1.0ms
|
const UINT nExecutionPeriodUsec = 1000; // 1.0ms
|
||||||
@ -241,22 +238,16 @@ void ContinueExecution(void)
|
|||||||
emulmsec_frac %= CLKS_PER_MS;
|
emulmsec_frac %= CLKS_PER_MS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// DETERMINE WHETHER THE SCREEN WAS UPDATED, THE DISK WAS SPINNING,
|
|
||||||
// OR THE KEYBOARD I/O PORTS WERE BEING EXCESSIVELY QUERIED THIS CLOCKTICK
|
|
||||||
VideoCheckPage(0);
|
|
||||||
BOOL screenupdated = VideoHasRefreshed();
|
|
||||||
BOOL systemidle = 0; //(KeybGetNumQueries() > (clockgran << 2)); // && (!ranfinegrain); // TO DO
|
|
||||||
|
|
||||||
if (screenupdated)
|
|
||||||
pageflipping = 3;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
if (g_dwCyclesThisFrame >= dwClksPerFrame)
|
if (g_dwCyclesThisFrame >= dwClksPerFrame)
|
||||||
{
|
{
|
||||||
g_dwCyclesThisFrame -= dwClksPerFrame;
|
g_dwCyclesThisFrame -= dwClksPerFrame;
|
||||||
|
|
||||||
|
// DETERMINE WHETHER THE SCREEN WAS UPDATED THIS CLOCKTICK
|
||||||
|
VideoCheckPage(0); // force=0
|
||||||
|
const BOOL screenupdated = VideoHasRefreshed(); // Only called from here. Clears & returns 'hasrefreshed' flag.
|
||||||
|
|
||||||
if (g_nAppMode != MODE_LOGO)
|
if (g_nAppMode != MODE_LOGO)
|
||||||
{
|
{
|
||||||
VideoUpdateFlash();
|
VideoUpdateFlash();
|
||||||
@ -276,20 +267,16 @@ void ContinueExecution(void)
|
|||||||
static DWORD lasttime = 0;
|
static DWORD lasttime = 0;
|
||||||
DWORD currtime = GetTickCount();
|
DWORD currtime = GetTickCount();
|
||||||
if ((!g_bFullSpeed) ||
|
if ((!g_bFullSpeed) ||
|
||||||
(currtime-lasttime >= (DWORD)((g_bGraphicsMode || !systemidle) ? 100 : 25)))
|
(currtime-lasttime >= (DWORD)(g_bGraphicsMode ? 100 : 25)))
|
||||||
{
|
{
|
||||||
VideoRefreshScreen();
|
VideoRefreshScreen();
|
||||||
lasttime = currtime;
|
lasttime = currtime;
|
||||||
}
|
}
|
||||||
screenupdated = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lastupdates[1] = lastupdates[0];
|
lastupdates[1] = lastupdates[0];
|
||||||
lastupdates[0] = anyupdates;
|
lastupdates[0] = anyupdates;
|
||||||
anyupdates = 0;
|
anyupdates = 0;
|
||||||
|
|
||||||
if (pageflipping)
|
|
||||||
pageflipping--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MB_EndOfVideoFrame();
|
MB_EndOfVideoFrame();
|
||||||
|
@ -10,7 +10,6 @@ extern TCHAR *g_pAppTitle;
|
|||||||
|
|
||||||
extern eApple2Type g_Apple2Type;
|
extern eApple2Type g_Apple2Type;
|
||||||
|
|
||||||
extern BOOL behind;
|
|
||||||
extern DWORD cumulativecycles;
|
extern DWORD cumulativecycles;
|
||||||
extern DWORD cyclenum;
|
extern DWORD cyclenum;
|
||||||
extern DWORD emulmsec;
|
extern DWORD emulmsec;
|
||||||
|
@ -3117,9 +3117,17 @@ BYTE VideoCheckMode (WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
void VideoCheckPage (BOOL force) {
|
|
||||||
if ((g_bVideoDisplayPage2 != (SW_PAGE2 != 0)) &&
|
// Check if we should call VideoRefreshScreen() based on unexpected page
|
||||||
(force || (emulmsec-lastpageflip > 500))) {
|
// - Only called from a single place in main ContinueExecution() loop
|
||||||
|
void VideoCheckPage(BOOL force)
|
||||||
|
{
|
||||||
|
const bool bUnexpectedPage = (g_bVideoDisplayPage2 != (SW_PAGE2 != 0));
|
||||||
|
//_ASSERT(!bUnexpectedPage); // [TC] Q: When does this happen? A: EG. When page-flipping && Scroll-Lock is pressed
|
||||||
|
|
||||||
|
if (bUnexpectedPage && // Unexpected page &&
|
||||||
|
(force || (emulmsec-lastpageflip > 500))) // force || >500ms since last flip
|
||||||
|
{
|
||||||
g_bVideoDisplayPage2 = (SW_PAGE2 != 0);
|
g_bVideoDisplayPage2 = (SW_PAGE2 != 0);
|
||||||
VideoRefreshScreen();
|
VideoRefreshScreen();
|
||||||
hasrefreshed = 1;
|
hasrefreshed = 1;
|
||||||
@ -3701,24 +3709,22 @@ BYTE VideoSetMode (WORD, WORD address, BYTE write, BYTE, ULONG uExecutedCycles)
|
|||||||
else
|
else
|
||||||
oldpage2 = SW_PAGE2;
|
oldpage2 = SW_PAGE2;
|
||||||
}
|
}
|
||||||
if (oldpage2 != SW_PAGE2) {
|
|
||||||
static DWORD lastrefresh = 0;
|
if (oldpage2 != SW_PAGE2)
|
||||||
if ((g_bVideoDisplayPage2 && !SW_PAGE2) || (!behind)) {
|
{
|
||||||
g_bVideoDisplayPage2 = (SW_PAGE2 != 0);
|
g_bVideoDisplayPage2 = (SW_PAGE2 != 0);
|
||||||
if (!g_VideoForceFullRedraw) {
|
if (!g_VideoForceFullRedraw)
|
||||||
|
{
|
||||||
|
#if 1
|
||||||
VideoRefreshScreen();
|
VideoRefreshScreen();
|
||||||
hasrefreshed = 1;
|
hasrefreshed = 1;
|
||||||
lastrefresh = emulmsec;
|
#else
|
||||||
}
|
g_VideoForceFullRedraw = 1; // GH#129,GH204: Defer the redraw until the main ContinueExecution() loop (TODO: What effect does this have on other games?)
|
||||||
}
|
#endif
|
||||||
else if ((!SW_PAGE2) && (!g_VideoForceFullRedraw) && (emulmsec-lastrefresh >= 20)) {
|
|
||||||
g_bVideoDisplayPage2 = 0;
|
|
||||||
VideoRefreshScreen();
|
|
||||||
hasrefreshed = 1;
|
|
||||||
lastrefresh = emulmsec;
|
|
||||||
}
|
}
|
||||||
lastpageflip = emulmsec;
|
lastpageflip = emulmsec;
|
||||||
}
|
}
|
||||||
|
|
||||||
return MemReadFloatingBus(uExecutedCycles);
|
return MemReadFloatingBus(uExecutedCycles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user