Commit Graph

31 Commits

Author SHA1 Message Date
tomcw
37ad1ebd63 Removed redundant binary v2 save-state code
Also:
. support new CpuType independently of Apple2Type
. save-state: don't save disk track image if no disk
. save-state: re-init AppleWin internals & UI to reflect changed Apple2Type
2016-02-14 16:01:30 +00:00
tomcw
5c16c3642a Merged master to savestate branch 2015-09-13 11:39:58 +01:00
tomcw
2f4ee9466f Save-state:
. add ConfirmReboot
. Restore saved configuration
. Moved some config to Joystick & SerialCard
. save config
2015-08-21 21:45:21 +01:00
michaelangel007
2f645d68f4 [PVS-Studio] Fix assignment in DenibblizeTrack() and potential buffer overflow in SetCurrentImageDir() 2015-07-30 07:28:20 -07:00
tomcw
559a236b14 Save-state:
. On save: append .aws if missing
. Added Pravets.cpp/h (for this clone's specific stuff)
2015-05-31 22:53:53 +01:00
tomcw
4d61eb6a75 Fixed crash on shutdown with -d1 arg and GPL declined (#286) 2015-05-03 16:35:49 +01:00
tomcw
f114a9b8fe Save-state: alloc extra 64K banks for RamWorks card if needed 2015-04-12 17:30:16 +01:00
tomcw
498f01edde New save-state (.aws) v2:
Added card save/load for:
. Phasor (#260)
. CP/M (#260)
. 80 column card:
  . aux memory now saved separately from main memory
  . extended memory (RAMworks) (#260)

Mockingboard & Phasor:
. Full AY8910 internal state now preserved.
  . needed for eg. envelope, ay_change[], etc
  . also Phasor player only updates AY regs that have changed

Other:
. On restore error, then PostMessage(WM_USER_RESTART), so that emulator not left in intermediate state
. Fix: Start Dir wasn't set when drag & dropping an image onto a drive icon or double-clicking an image file
2015-04-11 22:24:54 +01:00
tomcw
717c5cba84 New save-state (.aws) v2:
. Format now extensible for supporting new hardware types in the future
. Include missing items like Apple2Type, CyclesThisVideoFrame (#255)
Continue to support loading of old v1 format.

Added card save/load for:
. Mouse (#260)
. HDD (#260)
. Printer

Extended card support for:
. SSC

Other:
. Added save-state v1 struct size checks
. Create SaveState_Structs_v2.h and split out common into SaveState_Structs_common.h
. Refactor HardDisk.cpp to use imagehandle; and consolidate with Disk.cpp
. Fix Disk/HD_GetFullPathName() which wasn't always returning full pathname
. Consolidate common GetImageTitle() and move into DiskImage.cpp
2015-02-13 22:40:53 +00:00
tomcw
8c019bcd35 More main-loop reduction & removal of redundant globals.
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.
2014-09-14 21:23:54 +01:00
tomcw
1f892a27d4 Simplified main-loop a bit more, and removed more globals from AppleWin.cpp 2014-09-14 16:12:55 +01:00
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
tomcw
d1dddbe813 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
michaelangel007
ce2f0b75cb Fix: SetCurrentImageDir() to always make sure g_sCurrentDir has trailing backslash 2014-09-03 17:14:06 -07:00
michaelangel007
807fcce1ef 1.25.0.2 Fixed: F12 Snapshot_LoadState() -> Snapshot_SetFilename() not keeping trailing backslash on path 2014-09-02 08:48:46 -07:00
michaelangel007
ae762762e7 #206 Based on FaceBook poll, changed memory initialization pattern to: MIP_FF_00_FULL_PAGE 2014-08-28 10:43:32 -07:00
michaelangel007
9b8151b12e #206 Based on FaceBook poll, changed memory initialization pattern to: MIP_FF_00_FULL_PAGE 2014-08-28 10:39:29 -07:00
michaelangel007
24e581ba2c Added: Ctrl-PrintScreen will copy the text screen (auto detect 40/80 columns) to the clipboard. 2014-08-25 08:35:43 -07:00
tomcw
cbdad2a02f Qualified all STL refs with std:: to get rid of the 'using namespace std' mismatch between the main code & debugger code 2014-08-14 20:29:01 +01:00
tomcw
6a26a95487 PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
michaelangel007
50ed260710 #199 #215 Cleanup: "Confirm Reset" to "Confirm reboot" 2014-07-27 14:31:00 -07:00
michaelangel007
825b7cddcb #199 Added option to skip reset 2014-07-26 14:51:23 -07:00
tomcw
5d64ea5673 Merge branch 'master' of github.com:AppleWin/AppleWin 2014-07-20 10:30:21 +01:00
tomcw
a75555d21c Simplified ContinueExecution(): video refresh part. 2014-07-20 10:24:50 +01:00
michaelangel007
f4b09e1f8f Feature Request #206 Command line switch: -memclear # 2014-07-17 20:18:59 -07:00
michaelangel007
9ded7f0926 Cleanup: Removed unused variable: g_bResetTiming 2014-07-17 19:52:56 -07:00
michaelangel007
8090dd3933 Cleanup: Removed unused variable: needsprecision 2014-07-17 19:50:39 -07:00
tomcw
8637dfa7af Removed the _DEBUG-only experimental video modes (eg. Emboss, Psychedelic, etc) 2014-07-10 22:52:26 +01:00
tomcw
ae233fe1fc Remove redundant 'BOOL behind' which was always zero.
- allowed some simplification to VideoSetMode()
Tidy up ContinueExecution(), removing unused 'BOOL pageflipping'.
Refactor VideoCheckPage() to make it more readable.
2014-07-08 20:58:48 +01:00
tomcw
c509349469 Fullscreen defaults to 32-bit. Use -fs8bit for 8-bit mode 2014-06-26 22:44:02 +01:00
tomcw
d591dd006b Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00