AppleWin/source
tomcw bc45812f4e Simplified and moved main-loop video update logic into Video.cpp.
Removed complex case below for:
. VideoHasRefreshed(), 'anyupdates'
. VideoCheckPage()

Detailed notes below.

---

Video updates in ContinueExecution() loop:

'anyupdates' gets set if there were any page-flip(s) in last ~17030 cycles:
	anyupdates |= VideoHasRefreshed();
ie. VideoRefreshScreen() was called outside of this loop.

If there's been a call to VideoRefreshScreen() outside of this loop,
  and then the video framebuffer gets written to, ie. VideoApparentlyDirty() returns TRUE,
then don't call VideoRefreshScreen() from this loop for 3 frames.
(If a VideoRefreshScreen() is called outside of this loop then restart the 3 frame count.)

So..
 if the game is flipping, the VideoApparentlyDirty() will return FALSE (since game writes to other framebuffer).
 if the game is not flipping, then VideoHasRefreshed() will return FALSE (since no flips occur).

Therefore this complex case above probably only arises at a boundary eg. when the game is transitioning between these 2 modes,
and so if the emulator does the very occasional screen update in this main loop, it is of no consequence.

(I guess this extra logic was to throttle video updates on very old slow machines)

---

VideoCheckPage(BOOL bForce) was called twice in main-loop:

UnexpectedPage if g_bVideoDisplayPage2 != SW_PAGE2

Once each time through the loop (ie. every 1ms), with bForce=0
	if UnexpectedPage && >500ms since last flip then VideoRefreshScreen()

Once each video frame (ie. ~17030 cycles) when not flipping, with bForce=1
	if UnexpectedPage then VideoRefreshScreen()

Basically this was all about supporting FullSpeed mode, and limiting the calls to VideoRefreshScreen().
2014-09-13 22:22:27 +01:00
..
CommonVICE Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Configuration Renamed DiskConsts.h to DiskDefs.h + other header refactoring 2014-08-14 17:48:38 +01:00
CPU Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Debugger Simplified and moved main-loop video update logic into Video.cpp. 2014-09-13 22:22:27 +01:00
Tfe Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Z80VICE PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
6821.cpp More header refactoring 2014-08-14 18:03:12 +01:00
6821.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Applewin.cpp Simplified and moved main-loop video update logic into Video.cpp. 2014-09-13 22:22:27 +01:00
Applewin.h Renamed DiskConsts.h to DiskDefs.h + other header refactoring 2014-08-14 17:48:38 +01:00
AY8910.cpp More header refactoring 2014-08-14 18:03:12 +01:00
AY8910.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Common.h Added: Ctrl-PrintScreen will copy the text screen (auto detect 40/80 columns) to the clipboard. 2014-08-25 08:35:43 -07:00
CPU.cpp PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
CPU.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Disk.cpp PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
Disk.h PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
DiskDefs.h Renamed DiskConsts.h to DiskDefs.h + other header refactoring 2014-08-14 17:48:38 +01:00
DiskImage.cpp Renamed DiskConsts.h to DiskDefs.h + other header refactoring 2014-08-14 17:48:38 +01:00
DiskImage.h Renamed DiskConsts.h to DiskDefs.h + other header refactoring 2014-08-14 17:48:38 +01:00
DiskImageHelper.cpp Renamed DiskConsts.h to DiskDefs.h + other header refactoring 2014-08-14 17:48:38 +01:00
DiskImageHelper.h PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
Frame.cpp Moved a potentially confusing global to be function-local & fixed a few comments 2014-08-25 21:49:58 +01:00
Frame.h PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
Harddisk.cpp PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
Harddisk.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Joystick.cpp More header refactoring 2014-08-14 18:03:12 +01:00
Joystick.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Keyboard.cpp PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
Keyboard.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Log.cpp Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Log.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Memory.cpp 1.25.0.3: Restore MIP_FF_FF_00_00 as memory init default (see GH Bug#225) 2014-09-08 22:25:29 +01:00
Memory.h 1.25.0.3: Restore MIP_FF_FF_00_00 as memory init default (see GH Bug#225) 2014-09-08 22:25:29 +01:00
Mockingboard.cpp Remove wchar.h & Update VS2012 proj with new headers 2014-08-14 22:27:41 +01:00
Mockingboard.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
MouseInterface.cpp Renamed DiskConsts.h to DiskDefs.h + other header refactoring 2014-08-14 17:48:38 +01:00
MouseInterface.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
NoSlotClock.cpp Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
NoSlotClock.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
ParallelPrinter.cpp PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
ParallelPrinter.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Peripheral_Clock_Generic.cpp Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Peripheral_Clock_Generic.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Peripheral_Clock_ThunderClockPlus.cpp Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Registry.cpp Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Registry.h Renamed DiskConsts.h to DiskDefs.h + other header refactoring 2014-08-14 17:48:38 +01:00
Riff.cpp More header refactoring 2014-08-14 18:03:12 +01:00
Riff.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
SaveState.cpp 1.25.0.2 Fixed: F12 Snapshot_LoadState() -> Snapshot_SetFilename() not keeping trailing backslash on path 2014-09-02 08:48:46 -07:00
SaveState.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
SerialComms.cpp More header refactoring 2014-08-14 18:03:12 +01:00
SerialComms.h PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
SoundCore.cpp PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
SoundCore.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Speaker.cpp Remove wchar.h & Update VS2012 proj with new headers 2014-08-14 22:27:41 +01:00
Speaker.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Speech.cpp Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Speech.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
SSI263Phonemes.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
StdAfx.cpp Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
StdAfx.h Fix for window border when building with VS2012 & VS2013, using GetSystemMetrics(SM_CXPADDINGBORDER) 2014-08-20 22:40:48 +01:00
Structs.h Renamed DiskConsts.h to DiskDefs.h + other header refactoring 2014-08-14 17:48:38 +01:00
Tape.cpp PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
Tape.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00
Video.cpp Simplified and moved main-loop video update logic into Video.cpp. 2014-09-13 22:22:27 +01:00
Video.h Simplified and moved main-loop video update logic into Video.cpp. 2014-09-13 22:22:27 +01:00
z80emu.cpp PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
z80emu.h Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00