Commit Graph

42 Commits

Author SHA1 Message Date
tomcw 0f7bec509a Zip file support: avoid double-free if there's a problem with the zip file (eg. no valid image type) 2024-02-18 21:03:32 +00:00
tomcw faff74a98d WOZ: Support very large 5.25 WOZ images (#1240) 2023-06-29 21:52:59 +01:00
Kelvin Lee 1a4e933778
Replace StringCbPrintf() with StrFormat() (PR #1032) 2022-02-15 18:48:20 +00:00
Andrea de7f35e6bd
Make path separator OS-dependent (PR #954) 2021-05-19 21:10:22 +01:00
Andrea cdf1cb9106
Remove usages of g_hFrameWindow and g_hInstance from core emulator files. And Resource related Win32 functions. (PR #915)
. Win32Frame: remove WM_USER_RESTART.
2021-01-19 20:37:43 +00:00
Andrea 30d3269fbf
Remove a few more Win32 memory functions. (PR #888)
CopyMemory, MoveMemory, FillMemory.
2020-12-12 11:09:14 +00:00
tomcw 50a0e81941 Rename ms_pWorkBuffer to m_pWorkBuffer (as it's no longer static) 2020-12-10 21:28:12 +00:00
Andrea d2a34e1f91
Remove VirtualAlloc, VirtualFree & ZeroMemory. (PR #884)
. Allocation in Memory.cpp: keep VirtualAlloc of size=64KiB (alignment=64KiB) to ease debugging.
2020-12-10 21:08:15 +00:00
Andrea bbe88da787
AppleWin.cpp split (PR #875)
. Split AppleWin -> Core with the functionality really needed by the emulator.
. Split AppleWin -> Utilities for generic code not called by other emulator components.
. Split AppleWin -> CmdLine for the command line option parsing.
2020-11-26 21:50:06 +00:00
Andrea 01ad5d1882
Ensure all header files can be included (in any order) after stdafx.h. (PR #866) 2020-11-11 21:15:27 +00:00
tomcw 9cc49af0dc VS2008 vcproj: added DirectInput.cpp/h 2020-11-10 20:47:25 +00:00
Andrea 8cc04e2b86
Cumulative changes required to enable / ease compilation in Linux with gcc. (PR #861)
Split MouseInterface to isolate DirectInput code.
Avoid overflow in platforms where RAND_MAX is a big integer constant.
Fix include files for gcc (where enums cannot be forward declared).
2020-11-10 20:33:55 +00:00
tomcw bcd8fcc726 Fixed multi-zip regression (numTracks was getting zeroed). (Fixes #824) 2020-08-17 20:24:53 +01:00
tomcw 3651ca0cb8 NIB disk image: added warning if any track's first D5-nibble isn't an addr prologue (#139) 2020-08-05 13:58:17 +01:00
TomCh 21d16d3a0c
Auto-switch DiskII firmware to 13 or 16 sector depending on disk in drive-1 (#734) (PR #761)
. The auto-switch is done on each reset, or on inserting a disk at the start-up screen (MODE_LOGO).
. The Window's title include '(S6-13)' if DiskII card has 13-sector f/w.
. The debugger's 'disk info' cmd will show FW13 or FW16 depending on f/w.
2020-02-22 11:38:25 +00:00
tomcw ad599680d2 Small refactor for WOZ2 write track 2020-02-11 21:29:27 +00:00
TomCh 4956957ca1
Write support for WOZ1/WOZ2 images (#756)
Also:
- Allow creation of a blank (WOZ2) image
- multi-zip support extended to scan for the first valid image (useful for most woz-a-day zips which have at least 2 entries and were previously failing)
2020-02-09 21:23:15 +00:00
tomcw 78337c06bb WOZ: Removed version check on INFO section 2020-01-14 20:32:46 +00:00
tomcw 087616db29 Fixed Coverity 'High Impact Outstanding' issues:
1489113
1489111
1489105
1489096
1489093
1489092
1486059
1486055 (false positive)
1486054
1486051 (false positive)
1486050
1486047 (false positive)
1486043
1446684
2020-01-04 17:43:20 +00:00
tomcw c280d43e75 DiskImageHelper: small refactor 2020-01-02 21:01:10 +00:00
tomcw a28803cbf9 WOZ: Support large tracks (fixes #745) 2019-12-31 12:07:45 +00:00
Andrea d6d76ae6bc Memory fix for struct ImageInfo (PR #715)
ImageInfo is not a POD and cannot simply be initialised with ZeroMemory()
. the std::string constructor must be called.
. ImageInfo: simplify code using new / delete vs VirtualAlloc
Also fixed mismatching new / delete [] reported by valgrind
2019-11-11 14:09:29 +00:00
Andrea Odetti dced4793b7 Next iteration of the string project.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2019-09-07 10:16:51 +01:00
Andrea Odetti f5f60310c1 More std::strings.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2019-09-07 09:02:39 +01:00
TomCh 4bc75093b8
Support (read-only) WOZ1/WOZ2 images (#544) (PR #653)
Supports:
- all "woz test images" v1.3 (WOZ1, WOZ2) are working, except 3.5"
- additionally: Frogger (spiradisc), Choplifter (not Enhanced //e!), Lode Runner, Marble Madness, Skyfox.
- woz images can be .gz or .zip compressed (ie. same as other supported images)
- save-state

Limitations:
- read-only, so WOZ images are forced to be write-protected
  . as a result, games that need r/w images won't work (Stickybear Town Builder, Wizardry)
- 5.25" only (not 3.5")
2019-07-05 23:01:19 +01:00
tomcw 971eff7875 Added info about enhanceDisk 2019-04-11 22:34:40 +01:00
tomcw e7d6eac04d Class-ify disk.cpp into DiskIIInterfaceCard 2019-04-07 14:22:05 +01:00
tomcw dff37871fc Changed to a case-insensitive compare for .gz and .zip suffixes. (Fixes #628) 2019-03-16 14:40:05 +00:00
tomcw f9b7d9326e Fixed Coverity 'High Impact Outstanding' issues:
CIDs in main code:
1446691
1446688 (false positive)
1446672 (false positive)
1446643
1446642
1446641
1446635 (false positive)

CIDs in debugger:
1472410
1446728 (false positive)
1446684
1446673
1472409
1446693
1446692
1446726
1446687
1446685
1446683
2018-11-06 19:13:28 +00:00
tomcw 396c55d8a3 Coverity: tackled a few CIDs (#470) 2018-08-12 12:48:08 +01:00
tomcw 6c031e7930 Disk II: changing 'enhancedisk' doesn't cause a restart + added accessors (fixes #546) 2018-02-25 15:09:25 +00:00
Andrea 70540bd6dc Fix the following errors reported by VS2017 Code Analysis. (#414)
* Fix the following errors reported by VS2017 Code Analysis.

applewin\source\applewin.cpp(761): warning C6385: Reading invalid data from '"Disk Image"':  the readable size is '11' bytes, but '21' bytes may be read.
applewin\source\debugger\debug.cpp(6624): warning C6386: Buffer overrun while writing to 'sName':  the writable size is '31' bytes, but '32' bytes might be written.
applewin\source\debugger\debugger_display.cpp(3715): warning C6053: The prior call to 'strncpy' might not zero-terminate string 'sText'.
applewin\source\log.cpp(42): warning C6053: The prior call to '_vsnprintf' might not zero-terminate string 'output'.
applewin\source\debugger\debug.cpp(2759): warning C6011: Dereferencing NULL pointer 'pFont'.
applewin\source\debugger\debugger_symbols.cpp(243): warning C6053: The prior call to '_tcsncpy' might not zero-terminate string 'pText'.
applewin\source\diskimagehelper.cpp(1132): warning C6053: The prior call to '_tcsncpy' might not zero-terminate string 'pszExt'.
applewin\source\diskimagehelper.cpp(1141): warning C6053: The prior call to '_tcsncpy' might not zero-terminate string 'szFilename'.
applewin\source\parallelprinter.cpp(242): warning C6053: The prior call to '_tcsncpy' might not zero-terminate string 'g_szPrintFilename'.

The one about RegSetValue(), according to Microsoft

https://msdn.microsoft.com/en-us/library/windows/desktop/ms724922(v=vs.85).aspx

the last argument cbData is ignored, so I set it to 0, as in some cases was anyway wrong (see "DiskImage").


Signed-off-by: Andrea Odetti <mariofutire@gmail.com>

* Use sizeof() rather than hardcoded value.
Fix one more case on non terminated string.


Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2018-02-24 15:24:37 +00:00
Andrea 6051bc55d0 Changes to ease code compilation in gcc. (#541)
Changes to ease code compilation in GCC.

Disk_t and HDD contain a std::string and for this reason they need a proper constructor, ZeroMemory is not guaranteed to work.
2018-02-24 15:12:40 +00:00
tomcw 02a6df73c5 DiskFormat: tweaks and fixed some TODOs in comments 2018-01-20 17:18:24 +00:00
tomcw 4a69ba8a97 git merge --squash GH125-ProDOS-Format. Fix for disk formatting #125, #196, #338:
. .dsk / .nib images
. ProDOS format / DOS 3.3 init
. authentic / enhanced disk access speed

For zero-length files, resize to the complete file size when first opened (#506)
. Support both .dsk and .nib

Created a new class FormatTrack to encapsulate the new track formatting logic

Improved precision of 'authentic' drive mode's spin emulation (#125)

Save-state: (save-state DiskII unit v2)
. support Format Track state
. save DiskLastCycle

DenibblizeTrack(): added some debug asserts and comments

Updated for VS2008/VS2013/2015/2017 projs & remove dependency on ddraw.lib for VS2013/2015

Updated disk logging:
. Moved all LOG_DISK_xx macros to new DiskLog.h (since shared by Disk.cpp and DiskFormatTrack.cpp)
. For write nibble: option to log cycle count & sync byte count
. For written track: option to log gap1/2/3 and track size
. For disk latch r/w: option to log when D5AA96 detected

Other:
. Debugger: Fix CD cmd to support absolute paths (#505)
2018-01-14 18:01:22 +00:00
tomcw 34094f7299 Fix static analysis issues raised in PR #517 2017-12-17 19:35:54 +00:00
tomcw 82302c19ce Fixed #387: Added support for up to 40-track .nib images 2017-03-21 22:06:56 +00:00
Michaelangel007 8a1d39104b Fix #317 -- some .img using version 0 instead of version 1 2016-04-28 16:08:08 -07:00
tomcw e98de27039 Manual merge from master @ c798157 2016-03-21 23:48:02 +00:00
tomcw 4d40590fbf Renamed DiskConsts.h to DiskDefs.h + other header refactoring 2014-08-14 17:48:38 +01:00
tomcw 6a26a95487 PCH refactor: remove non-system headers from stdafx.h 2014-08-13 21:30:35 +01:00
tomcw d591dd006b Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00