Commit Graph

57 Commits

Author SHA1 Message Date
Andrea 4ab60cebf8
Serial comms: compilation in Linux (PR #1249)
* SerialComms: compilation in linux.
1) static variables must be defined (otherwise it becomes optimisation-dependent)
2) ensure the socket is closed if an error is detected

* SerialComms: avoid issues with order of global variables.
GetFrame() and the GetCardMgr() use global variables and the order of their destructor is not well defined.
CSuperSerialCard::CommTcpSerialCleanup() is called as part of the CardManager's destructor.
2024-01-06 14:50:10 +00:00
Andrea 12d1a0e1fe
Card: cleanup interface. (PR #1059)
1) Remove Init()
2) Call Reset() via CardManager
3) Call Destroy() via CardManager (only used by Disks/Harddisk) on WM_DESTROY

The only "real" changes are in CSuperSerialCard: ensure destructor cleans up and remove Destroy().
2022-03-11 22:17:03 +00:00
Kelvin Lee 80f3eaeb91
Various *Name() functions can simply return const std::string& (PR #1049) 2022-02-28 20:52:18 +00:00
Kelvin Lee 253a59fde6
Replace sprintf_s() and wsprintf() with StrFormat(). (PR #1041)
And these Debugger related:
. Improve FormatAddress() and GetSymbol().
. GetSymbol(), FindSymbolFromAddress(), FormatAddress() are changed to use std::string instead.
. Remove static variable (not nice) in FormatAddress().
. GetSymbol() returns std::string reference instead of pointer.
2022-02-26 17:54:06 +00:00
tomcw 43b9df253a Fix build errors from PR #1039 2022-02-16 20:14:40 +00:00
Kelvin Lee 9a3832084a
Simplify the common combination of sprintf() and OutputDebugString() (PR #1031)
- Update LogOutput() and LogFileOutput().
- Add StrFormat() to produce std::string out of snprintf() & add StrFormat.cpp to projects.
- Add PTRDIFF_T_FMT in parallel to SIZE_T_FMT to StdAfx.h, for completeness.
- In Log.cpp, changed to get timestamp using posix functions.
- Removed TCHAR usage throughout - simply use char.
2022-02-13 21:37:05 +00:00
Andrea 7ab65492c6
Load save-state for Cards: improve error messages. (#1025)
. better error message for (unlikely) slot mismatch.
. better error message if load state version is invalid.
2022-01-30 21:25:40 +00:00
Andrea 47f721882e
throw std::runtime_error instead of std::string (PR #1011)
+ add more information about location of yaml parser error.
2021-12-18 16:37:28 +00:00
Andrea 0b2104cc89
Card::Save/LoadSnapshot (PR #1003)
Add 2 virtual methods to Card to load and save snapshots.
2021-11-25 20:23:21 +00:00
tomcw d96ed5b8c5 Refactor: move m_slot into Card class 2021-11-01 21:01:28 +00:00
tomcw 67b3c28833 Refactor: remove slot from InitializeIO() calls for card objects 2021-11-01 20:39:26 +00:00
TomCh ed298b4fd9
Improve save-state card management (PR #983)
Initially all cards are removed before loading save-state.

Use new Registry "Configuration/Slot 2" location to save SSC's port name.
Use new Registry "Configuration/Slot 7" location to save HDV's image names.
Use new Registry "Configuration/Slot n" (and "Configuration/Slot Auxiliary") locations to save all other card types.

Command line: -s<slot> (eg. -s7 empty) now get persisted to the Registry.

Only update 'HDV Starting Directory' for slot7 & drive1.
2021-09-17 20:43:10 +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 e27879ac99
Move interface into a class FrameBase. (PR #893)
. Move the Win32  implementation into Win32Frame.
2020-12-24 15:08:50 +00:00
Andrea 2d2ba86f4f
IPropertySheet: make it a standard C++ class with pure virtual functions (PR #892)
* Interface.h: ensure that functions in the interface are not exported by other header files.

This is generally harmless, except for the presence of default arguments, in which case the version with default arguments must come first.
To avoid the issue, these functions are only ever exported in the Interface.h header file.
2020-12-20 15:32:51 +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 c455488b50
Split Frame.cpp to WinFrame.cpp (PR #874) 2020-11-23 19:21:20 +00:00
tomcw bd1d65ce4f Renamed Applewin.h to AppleWin.h across entire project 2020-11-11 22:12:39 +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 eed3182bef Fixed cmd line regressions: (#790)
. -s7-empty-on-exit wasn't being recognised
. -d1, -d2 weren't saving the 'Last Disk Image 1/2' & 'Starting Directory'
2020-05-25 21:59:26 +01:00
TomCh 769d4c6927
Support 2nd Disk][ card and improved card management (#726) (PR #741)
Support 2nd Disk][ in slot-5, via command line:
- -s5 diskii
- -s5d1 \<imagefile\>
- -s5d2 \<imagefile\>

NB. there's currently no Configuration UI support, except the Drive icons' tooltips show what's in slot-5 & slot-6 (for drive-n). So there's no way to eject the disks or insert new disks. The use-case I'm supporting it Wasteland which just has the 4 disks in the 4 drives.

Improved card management:
- Added `class Card` (in Card.h) which all other cards (that exist as classes) derive from (eg. LC,SSC,Mouse,Disk2).
- Added `class CardManager` (in CardManager.cpp\h) which now manages the 8 slots (and aux slot).
- Added `class Disk2CardManager` (in Disk2CardManager.cpp\h) which provides methods for operations that act on all Disk2 instances at the same time.
- Currently limited to just 1x SSC and 1x Mouse card (why would you need more?). This simplifies things, meaning there's no need to have dedicated SSCManager / MouseCardManager objects.
- Currently the 2nd Disk2 card can only be put into slot-5. This limitation is just due to the complexity of the Configuration UI. Having a more general drop-down per slot UI would remove this limitation.
2019-12-19 19:42:30 +00:00
TomCh 3d4691e9bd
ADTPro not working (#707) (PR #714)
. Wrap m_vbTxEmpty in a mutex
. Check WriteFile() result & log error
2019-11-02 19:53:00 +00:00
tomcw 5edd8ac32b SSC: Get initial modem status when COM port is first opened 2019-10-27 16:53:24 +00:00
tomcw d23d091caa SSC: Support COM ports greater than 9 (#707) 2019-10-24 21:43:00 +01:00
Andrea Odetti bd201202cd Some more std::string changes.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2019-09-07 19:37:19 +01:00
tomcw d9a15c30da Save-state: fix for loading state not re-asserting pending IRQs for Mouse & SSC. (#677)
NB. Small opt to CheckInterruptSources() to explicitly test sg_Mouse.IsActive() first.
2019-08-26 20:13:52 +01:00
tomcw eea8cb3cdf Deprecated and removed support for v1 save-state. (Fixes #603) 2019-01-05 22:20:51 +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 7beaf610d2 SSC:
. Save-state: SSC unit v2 - support DCD flag, removed redundant vars
2018-05-10 13:47:26 +01:00
tomcw 2fdc270837 SSC: Make default baud-rate consistent (9600) 2018-05-05 16:56:15 +01:00
tomcw ba090ebcef SSC: Change DIPSW1's baud rate to 9600 (was 19200) & reflect this change in the help doc for SSC 2018-04-23 21:34:09 +01:00
tomcw 52e7d61c7e SSC:
. DCD state is now a mirror of DSR unless -dcd switch is used. (Fixes #553)
. Removed -dsr,-dtr switches, so -modem is now an alias for -dcd.  (Also for #553)
. Wait for events (RLSD,DSR,CTS) in CommThread and call GetCommModemStatus() in CommThread.
2018-04-22 14:37:59 +01:00
tomcw 4ab5aa1e7c SSC work:
. SSC: For TCP mode, support DSR, DCD & CTS status bits (#308).
. SSC: Now DTR must also be set to enable interrupts (in addition to the respective Tx/Rx interrupt bit).
. SSC: When reading the Status register, throttle calls to GetCommModemStatus() to a maximum of once every 8ms.
2018-04-14 21:15:41 +01:00
TomCh a78f1e04da
SSC: Support for TX IRQ and other SSC updates (#552)
. Support TX IRQ for both TCP and COM modes (fixes #522)
. Support CTS/RTS (fixes #311)
. Fixed reading DIPSW registers
. Fixed TCP mode which was only generating an IRQ for first byte received
. Added UpdateCommandReg() to consolidate all updates to SSC command reg
. Updated reference URLs
2018-04-08 17:37:26 +01:00
tomcw d9accc82c5 Refactor codebase by renaming nCyclesLeft to uExecutedCycles (#540) 2018-03-03 21:27:50 +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 f37b82a8e7 Serial: after loading save-state, set m_uDTR variable correctly 2017-12-19 22:00:08 +00:00
tomcw 7e38429766 Serial-over-TCP: Receive wasn't setting the ASIC's Status register's interrupt bit. (Fix #308) 2017-12-19 21:35:04 +00:00
tomcw 1bd85e123e SSC: Added -modem switch (for dcd,dsr,dtr) and removed invert switches (#386) 2017-03-23 21:36:26 +00:00
tomcw abd99d109e SSC: Experimental support for 6551's status bits: DCD and DSR via -dcd[-invert] and -dsr[-invert] args (#386) 2017-03-19 21:44:20 +00:00
tomcw b377dc8afb Savestate: SSC - DTR : added a todo comment 2017-03-19 17:27:07 +00:00
tomcw 6063d8e96f SSC: Experimental support for 6551's DTR via -dtr or -dtr-invert args (#386) 2017-03-18 13:56:18 +00:00
tomcw d0243c71d7 Save-state: rename SaveHex{4|8|12|16...64} to SaveHexUint{4|8|12|16...64} 2016-03-04 21:26:14 +00:00
tomcw 11789c9023 Save-state: Renamed YamlLoadHelper load-type functions to be more consistent with YamlSaveHelper functions 2016-02-24 22:38:59 +00:00
tomcw 6b07fd665f Save-state: Added save-type functions to YamlSaveHelper & use wherever saving state. Also added new cmd-line option: -load-state. 2016-02-24 21:51:20 +00:00
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 2f6e86c0fa Added libyaml 0.1.5
Added yaml save-state support for:
. Main AppleII unit
. Aux memory & RawWorksIII
. Printer
. SSC
. Z80
. Mouse
. Mockingboard
. Phasor
. Disk][
. HDD
2016-02-07 15:47:15 +00:00
tomcw 5c16c3642a Merged master to savestate branch 2015-09-13 11:39:58 +01:00