. Specifically IBIZA.DSK demo which streams data from the disk throughout (ie. so runs at full-speed all the time)
. Update the screen every frame, but only if video memory has changed (check AZTEC.DSK loading time)
. NB. When running at full-speed, then 6502 emulation doesn't do cycle-accurate video updates
Fixed crash that could occur when switch video mode (F9) when running at full-speed
. Occured when g_nVideoClockVert was >= 192
. means that disk accesses (eg. loading) is much quicker
Correct naming of video modes (in UI and code)
Pixel adjust for NTSC B&W and Color video modes to align with other video modes
Fixed JoyUpdateButtonLatch() to debounce in 5mecs instead of 5secs!
SpkrToggle() was using redundant global ('cyclenum') when using the PC speaker.
. I reworked the code (as it looked out-of-date),
but probably better to just remove all the PC speaker support.
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().
- allowed some simplification to VideoSetMode()
Tidy up ContinueExecution(), removing unused 'BOOL pageflipping'.
Refactor VideoCheckPage() to make it more readable.