Commit Graph

57 Commits

Author SHA1 Message Date
tomcw f03f5e0904 Fix for 6522 counter underflows falsely delaying when IRQ occurs. (Fixes #1176) 2023-02-05 11:02:56 +00:00
TomCh 71c67cf132
Refactor Mockingboard into a class (#1171)
Mockingboard or Phasor cards can be inserted into any slot.
Change Config->Sound to that slots 4+5 to be individually selected for the 3 soundcard types.
Add MockingboardCardManager class to manage multiple cards and mix the sound buffers.
2023-01-28 18:15:28 +00:00
tomcw 4377441c26 Fix 6502/65C02's D flag for BRK, IRQ, NMI and RESET. (Fixes #1099) 2023-01-02 21:41:31 +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 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
tomcw 83e56924f7 WM_CREATE: remove CpuCreateCriticalSection(), since done in SY6522.Reset() 2022-02-13 12:37:33 +00:00
tomcw b519031de4 WM_CREATE: call CpuCreateCriticalSection() instead of CpuInitialize() 2022-02-12 19:11:34 +00:00
tomcw 3fe06faf65 MB/6522: remove the legacy g_nMBTimerDevice variable.
Fix ASSERT from previous commit as SY6522.Reset() needs CriticalSection.
2022-02-12 18:42:58 +00:00
TomCh f7c6ef397c
Split 6522 out of MB code and into own class (PR #1028)
NB. Update CpuInitialize() & CriticalSection creation:
. call CpuInitialize() on WM_CREATE to create CriticalSection
. needed as MB_Initialize() needs CriticalSection
2022-02-05 18:48:36 +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
tomcw fa18382757 Core emulation: simplify NMI & IRQ handling 2021-10-18 21:45:45 +01:00
TomCh 9553106f4e
Debugger: Add IRQ support to LBR and new command to Break on Interrupt (#987, PR #990)
Extend LBR so that it includes the control-flow on a taken interrupt
Add a new command 'brkint <0|1>' to support Break on Interrupt

Internal: in core emulation loop, moved IRQ/NMI check to start of loop so that just the "interrupt vectoring" case can be single-stepped (instead of previously opcode + interrupt vector).

Debugger help chm: update Breakpoints section to include BRK, BRKOP and BRKINT
2021-10-16 16:57:00 +01:00
tomcw 4f8b30506d Debugger: Fix LBR so it's updated only if branch is taken (#987) 2021-10-16 11:58:09 +01:00
tomcw 91f2c43992 Disable SC01 logging 2021-03-28 22:18:00 +01:00
tomcw 2258d01184 MB: SC01 is only mapped to the 6522 at Cn00 2021-03-28 22:16:34 +01:00
TomCh 96bbc0c435
Improve SSI263 (PR #939)
New class for SSI263 (2 instances per MB/Phasor card)
- support 2nd SSI263 at $Cn20 connected to 6522-A (at $Cn00)

Switch from one-shot phoneme playback to ring-buffer
Use a new dedicated ring-buffer (distinct from the AY8910 ring buffer)
Gets rid of: SSI263Thread, the 2 events, and the 64 voices

Support the 2-bit Duration b7:6 of phoneme register for both SC01 & SSI263 (to fix #929)
Updated save-state
Updated IRQ logging (output cycle & 6522 source)
2021-03-23 22:01:41 +00:00
tomcw 3f75012c0e Windows speech: trap calls to COUT1 and BASICOUT (instead of COUT) (#934) 2021-03-09 21:06:37 +00:00
tomcw 4e88163430 MB/6522: better reset support - only ACR,IFR,IER affected 2021-02-13 16:56:29 +00:00
tomcw fcafa18340 Debugger: add red 'IRQ' after the v/h-pos when IRQ is being asserted to the 6502 2021-01-31 19:38:06 +00:00
TomCh 3aa5750dcf
Make Video.cpp and WinVideo.cpp into a dependent class hierarchy (PR #898)
. class hierarchy: WinVideo IS_A Video (ie. WinVideo is a subclass of Video)
. GetVideo() singleton instance of WinVideo in AppleWin.cpp, exposed via Interface.h
2020-12-28 16:25:29 +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
TomCh 6e166dfff6
Support NSC for Apple II/II+ via F8-ROM (#827 PR #873) 2020-11-25 21:57:34 +00:00
Andrea 2a7191f5ce
Split Video.cpp to WinVideo.cpp to remove most of the Win32 specific functions (PR #872)
. Moved DirectInput.cpp/h and WinVideo.cpp/h to a new "Windows" folder.
2020-11-21 20:57:56 +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
ThorstenB b0b033da49
Source clean-up, portability and debugger fixes. (PR #842)
And fix two general issues:
- confusing behavior when entering the builtin (mini) assembler mode,
- and also fixes the "cl" (clear flag) command - which was documented, but did not work at all (due to an "interesting" command/syntax conflict...).
2020-10-11 17:14:03 +01:00
TomCh 6125c2b12d
Support for synchronous events (PR #841)
Switched Mockingboard/6522 Timer interrupts & Mousecard's VBlank interrupt to use synchronous events.
This is a linked-list of ordered timer-based event, where only the head of the list needs updating after every opcode.
2020-10-11 16:08:05 +01:00
TomCh ef913fe827
Removed 65d02 and used the regular 65c02/6502 headers instead (PR #825)
Removed 65d02.h and reconstructed this code using a combination of existing 6502.h/65c02.h and extra C Pre-Processor macros to include (or omit) the extra heatmap functionality.

We still end up with a normal 65c02 instance and also a debug 65c02 instance, but both will derive from the same 65c02.h file (+ same for the 6502 normal/debug instances).

Also:
. Added cpu_heatmap.inl for the built-in debugger's read/write operations.
. Support CpuRead/Write() from Z80 to hook the heatmap r/w.
2020-08-31 10:03:29 +01:00
tomcw 13a4043118 Added a new PerfMarker class: used to instrument emulation sub-systems and log timings (#788)
To enable this uncomment the #define LOG_PERF_TIMINGS in AppleWin.h.
2020-05-23 16:41:19 +01:00
tomcw 9f49820a8d Phasor: support SSI263 speech for Mockingboard mode (#777)
. Improved DEVICE_SELECT' I/O support (including Echo+).
. SSI263_Read() only for Phasor in Phasor mode.
. save-state: v6 (Phasor unit): phasor mode extended.
SSI263 (MB/Phasor) bug fix for when RESET/Power-cycle during phoneme playback.
Logging:
. improved for SSI263
. in CPU.cpp, added 'IRQ' / 'ISR-end'
2020-04-19 21:00:37 +01:00
tomcw 960af9bda0 MB: Moved MB_StartOfCpuExecute() to Snapshot_LoadState_v2(), since it's only needed there 2019-12-24 13:58:20 +00: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
tomcw 7d38b1ba38 CPU save-state: added 'Defer IRQ By 1 Opcode' (v5) and comments for why the other state doesn't need saving 2019-11-18 15:08:59 +00:00
TomCh d1b595f7bd
Fix for "Mad Effect 1&2" demos (PR #725)
. 6502 interrupt delays 1 opcode when interrupt occurs on last cycle of opcode (#724).
. Only 1-cycle delay for VF_TEXT & VF_MIXED mode changes (#656).
NB. Mad Effect 1 still has a bit of flicker on Space Invader (left edge)
2019-11-16 23:49:21 +00:00
tomcw 9ee9414bb6 Debugger: show video-scanner's h,v position (at the expense of losing 2 watches). (#666) 2019-09-21 16:37:45 +01:00
tomcw 300494c470 Mockingboard: only do multi-TIMER1 support update when 6502 interrupts are enabled. (#685) 2019-09-06 19:59:28 +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 1f2dc6ee8a Full-speed: only do interrupt checking every 40 opcodes & simplify CYC macro (#651) 2019-06-02 14:30:54 +01:00
tomcw 98a733ba73 Removed comment about benchmark: as benchmark is now run in both normal and full-speed modes 2019-06-01 17:01:15 +01:00
tomcw 3a41061f83 Check interrupt sources after every opcode when in normal speed. (#651) 2019-06-01 16:54:58 +01:00
tomcw 8ee651a6f8 Fixed comment typo 2019-01-06 17:02:24 +00:00
tomcw ceb0416bf3 Fixed 6522 & interrupt:
. Broadside needs to see IRQ within 17 cycles (6 opcodes) of 6522 counter underflowing to detect Mockingboard. (Fixes #605)
2019-01-06 16:54:54 +00:00
tomcw eea8cb3cdf Deprecated and removed support for v1 save-state. (Fixes #603) 2019-01-05 22:20:51 +00:00
tomcw 552d8fcc7b Remove old debug timing code (#540) 2018-02-26 21:34:01 +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 297cea7d2a Support polling of Mockingboard's & Phasor's 6522 IFR.Timer1 (#496)
. Extended save-state (Mockingboard & Phasor: version 2) to support 6522 timer being active
2017-10-21 18:47:22 +01:00
tomcw 3d6c10bad9 Debugger:
. Move the BRK and invalid opcodes checks out of main emulation's Fetch() and into DebugContinueStepping()
. Added a new break condition: when PC reads floating bus or I/O memory
. On a break condition, output a 'Stop Reason' message to the console
2017-03-07 21:35:38 +00:00
tomcw 0b6c5bbb91 Support for #384:
. Debug 'G(o)' cmd now defaults to normal speed (and precise video updates)
. New debug 'GG' cmd enables full speed (and periodic video updates)
. Single-stepping (normal or full speed) now routed through ContinueExecution()
. Removed Cpu6502()/Cpu65C02() check for debug breakpoints
. Removed the (undocumented) SHIFT+F7 feature to exit debugger for 'normal speed breakpoints'
. Removed the g_bDebugNormalSpeedBreakpoints variable
2017-02-25 22:32:46 +00:00
tomcw 8447a22942 VBlank tweaks:
. Removed NTSC_VideoVbl(), since it's not accurate during full-speed. (Nothing was using it)
. Renamed VideoGetVbl() to VideoGetVblBar()
. Correctly pass Vbl (not VblBar) to Mouse's SetVBlank()
2016-11-16 11:18:41 +00:00
tomcw 86ba0b0407 Apply fixes and enhancements to PR #285 (Support for TK3000 //e) 2016-10-22 23:20:23 +01:00