Commit Graph

144 Commits

Author SHA1 Message Date
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
0858cc3a23 Debugger: improve mem views for 6522 & AY8913 chips 2021-03-07 13:11:22 +00:00
tomcw
2d086e87ec Support 2nd SSI263 at $Cn20
Phasor doesn't support reading AY8913 regs
2021-02-21 19:12:36 +00:00
tomcw
a709e9dbdf MB/SSI263: improve logging to include phoneme duration 2021-02-17 21:53:15 +00:00
tomcw
4e88163430 MB/6522: better reset support - only ACR,IFR,IER affected 2021-02-13 16:56:29 +00:00
tomcw
84a705d20d MB/6522: improve T1 underflow with latch 2021-02-12 19:16:14 +00:00
tomcw
ff29b055ce MB/6522: fix timer1 underflow for very small values 2021-02-11 22:44:40 +00:00
tomcw
776a48fc01 MB/6522: support for T1 latch in one-shot mode 2021-02-10 20:51:11 +00:00
tomcw
c492004e8d 6522 read: support non 4-cycle read opcodes (#833)
. ie. addr modes: (zp,x), (zp),y and (zp)
2021-02-06 18:02:35 +00:00
tomcw
f302e88f55 Add 6522 support for stz abs16 and stz abs16,x 2021-02-05 22:30:05 +00:00
tomcw
5d46298dcc Mockingboard: support AY-3-8913 read 2021-01-17 19:51:25 +00:00
tomcw
0ddb1917aa SyncEvents: ensure MB & Mouse have removed their events for a restart 2020-12-12 17:46:36 +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
tomcw
d6a2339ff0 Coverity SA: Fixed the 2 new Impact=High issues:
. CID 1499553: UNINIT
. CID 1499560: OVERRUN (out of bounds access in CmdBookmarkAdd)
Fixed bug in CmdBookmarkClear() too.
2020-11-17 21:31:57 +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
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
ThorstenB
4543117f81
More clean-up, portability and another debugger fix (PR #847)
Fixed debugger main "data" window behaviour:
. When activating the main data display ("data" command) the cursor keys wouldn't work until the minidump ("md1") was also enabled. NB. The cursor keys should work in the main data window, independently of whether the minidump is active.
2020-10-25 17:27:59 +00:00
tomcw
aa322dbd53 Fixed loading a save-state where both Phasor 6522's Timer1s are active (eg. DIGIDREAM demo) 2020-10-18 19:32:18 +01:00
tomcw
1a11c65d37 Replaced global g_CardMgr with a singleton object & GetCardMgr() call. (Fixes #843) 2020-10-11 17:34:44 +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
tomcw
06f8ccb384 MB false read of 6522: limit to only the no-PX variants 2020-08-22 16:06:26 +01:00
tomcw
b93de29ff1 Fixed the 6502/65C02 false-read of 6522 issue for Willy Byte! (fixes #52) 2020-07-24 19:39:31 +01:00
tomcw
52ff9d5b99 Fixed MB looping sound after 'OK' in Configuration (#813) 2020-07-17 22:53:17 +01:00
Andrea
82c09abd54
Minor fixes (#805)
* Add missing Riff.h include and fix const correctness of arguments.
* Cosmetic improvements to Perf breakdown in LogPerfTimings().
* Logging - removed unnecessary cast.
2020-07-01 21:08:18 +01:00
tomcw
60d54d6f3b Fix for 'IRQ occurring on last cycle of opcode' not always true. (Fixes #796)
. FT demo MAD2.DSK - original version now correctly crashes at start of full-screen scroller
. FT demo MADEF.DSK - graphics glitch on vertical edge where it transitions from GR to HGR mode
2020-06-27 19:29:29 +01:00
Andrea
fe62271ef9
Some minor c++ correctness changes. (#803)
Added const, static forward declaration.
Removed some unneeded header files.
2020-06-27 14:32:09 +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
58df8ea1e6 MB/SSI263 - alt logging via LOG_SSI263B 2020-05-10 18:21:34 +01:00
tomcw
61a3f06172 MB/Phasor: SSI263 - improved save-state for different speech cards' IRQs 2020-04-26 18:07:38 +01:00
tomcw
f201294451 MB/Phasor: SSI263
. extend for 6522 PCR CA1 input control=0, which sets IFR.b1 on phoneme complete
2020-04-26 10:10:39 +01:00
tomcw
389b6e6d23 Mockingboard: replicate 6522 I/O across entire $Cnxx I/O space
. SSI263.b7 not readable
. SSI263 writes also written to 6522 in low addr
2020-04-25 16:42:50 +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
22806c6c59 Phasor: support both kinds of speech interrupts (#777) 2020-04-07 22:11:31 +01:00
tomcw
c204783816 MB/6522: IER doesn't start/stop timers 2020-03-07 18:08:50 +00:00
tomcw
ef4ee4ed16 Fixed 6522.T2 interrupt for Lancaster (#765) 2020-02-29 18:48:46 +00: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
tomcw
e03b68b7f0 MB: removed redundant g_n6522TimerPeriod variable 2019-12-24 13:19:35 +00:00
tomcw
8567f0a651 MB: include 1-cycle 65C02 opcodes 2019-12-24 12:51:43 +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
tomcw
b82de931a1 Fixed 6522 timer interrupt which was occurring 1 cycle late (#711) 2019-11-17 12:26:14 +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
3c6d5d1e76 Phasor: fixed noisy playback for AE's player. (Fixes #659) 2019-11-11 17:35:10 +00:00
tomcw
d4e01643fa Mockingboard: improved sound-buffer updating
. Changed to 6522.TIMER underflowing at 0x0000 -> 0xFFFF (#652)
. Changed MB_Update() to be based on cycle delta (was TIMER1 interval)
  . this improves support for small 6522.T1C interval
  . removed MB_GetFramePeriod()
  . removed overly-complex dual-timer support
. Replaced MB_EndOfVideoFrame() with MB_PeriodicUpdate()
2019-11-10 15:52:07 +00:00
tomcw
eb59c52dc4 Mockingboard: Fix initial fast (weird) music playback issue (#711) 2019-11-03 21:37:55 +00:00
tomcw
d92eca5068 Cmd line: -m and -no-mb: fix crash 2019-11-03 14:23:47 +00:00
tomcw
506a52f359 Refactor slots & allow empty slots for s1(printer), s6(disk2)
. NB. can't empty s3(uthernet) yet
2019-09-15 20:37:20 +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
ed9ae72778 Mockingboard: moved multi-TIMER1 support before the AY access. (#685) 2019-09-05 22:03:56 +01:00
tomcw
11323e2aba Mockingboard: support multiple TIMER1 interrupts, with one for MB reg updates (#685) 2019-09-05 20:42:34 +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
94bbc5ec3d Save-state: fix for loading state not re-asserting any pending MB/SY6522 interrupts 2019-08-26 16:52:11 +01:00
TomCh
bd86088c59
Support 50Hz(PAL) (#648) (PR #658)
- Added Configuration GUI to include checkbox for "50Hz"
- Implicitly use PAL or NTSC base 6502 clocks depending on video refresh rate
- Added new -50hz and -60hz command line switches
- Updated save-state for video refresh rate

1.28.8.0: Updated version & history.txt
2019-06-28 21:34:34 +01:00
tomcw
3fbe416424 6522: Underflow on 0x0001 -> 0x0000; and FRT's period is N+2 cycles (#652) 2019-06-15 17:41:53 +01:00
tomcw
941ef46e9a 6522: account for underflowed cycles to ensure consistent interrupt period (#651) 2019-06-01 12:21:00 +01:00
tomcw
6929ad98e3 Fix for 6522.TIMER2 not setting CpuAdjustIrqCheck() correctly 2019-04-18 20:47:29 +01:00
tomcw
be81458284 Save-state: correctly stop & play Mockingboard sound buffer across save-state loading transition (#609) 2019-02-24 15:37:15 +00:00
tomcw
de3f0d877e Save-state: Better MB init for loading save-state 2019-02-24 10:49:09 +00:00
tomcw
f998c7ddb2 Save-state: Explicitly init MB SoundcardType when loading state. (Fixes #609) 2019-02-23 10:22:52 +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
9bc7feb37e Mockingboard: Better support for stop/starting 6522's IER.TIMERx (#567) 2018-06-20 22:13:18 +01:00
tomcw
7f478fa36c Mockingboard: Reading 6522's IER now returns 0x80|IER. (Fixes #567) 2018-06-17 18:47:57 +01:00
tomcw
598b20fb52 Refactor: Use INTCXROM instead of SLOTCXROM to be consistent with UTAIIe (fixes #419) 2018-04-06 22:36:54 +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
e2b515de33 MB/Phasor: Wrap 6522.IFR changes inside a critical section to avoid a potential 2 thread data-race 2017-10-28 18:39:45 +01:00
tomcw
74ac2a4f22 Mockingboard/Phasor unit functions only work from an inactive state
(#320)
- Extended save-state (MB/Phasor v3) to support 'Unit state'
2017-10-27 11:10:15 +01:00
TomCh
66321febba Support Mockingboard/Phasor when polling IFR.Timer1 (#496)
* Support precise AY8910 sound-buffer filling when polling 6522 IFR.Timer1 (ACR=Free Running mode)
  - same as if using 6522 IER.Timer1 interrupt
* Support 6522's Timer2 and some code refactoring
* Bump version: 1.26.3.4
2017-10-24 22:28:22 +01: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
64dd4c22c2 Refactor: Rename IORead_Cxxx() to IO_Cxxx(), and use for writes too. Re-enable support for writes to NSC (which was accidently removed at 5470feb). 2017-05-21 22:06:37 +01:00
Kelvin Lee
20a1a9a884 Fixed compiler warnings about adding integer to char. 2016-12-29 11:35:09 -05:00
tomcw
cf0cd37d9e . Fixed #309: Support 6522 TIMER1 at $Cs80 as in interrupt source
. Fixed save-state v2 bug where Mockingboard's card ROM was erroneously mapped in (instead of internal $C100-CFFF ROM)
. Added Cybernoid-TimerAtC480.aws.yaml to test both
2016-09-08 22:36:16 +01:00
tomcw
5fdc879a05 Merge from branch 'NTSC_PreMerge':
1.26.0.1
. NTSC video modes (TV Color, TV B&W, Monitor Color, Monitor B&W)
. Full Screen using native resolution (not 640x480)

NB. 6502 emulation is slower now, which means disk loading (ie. full-speed) is slower.
. EG. Aztec.dsk: from F2 boot to "Press any key". (Release build, 50% "TV Color", not run in VS, VAIO laptop)
  ~4 secs: AppleWin 1.25.0.3 (built with VS2005)
  ~7 secs: AppleWin 1.26.0.1 (built with VS2008 or VS015)
2016-09-04 21:14:26 +01:00
tomcw
66e468db65 Merged in Nick's new native resolution full-screen
- old 640x480 full-screen deprecated

Fixes for:
. Logo & Debug window scaled/positioned correctly
. Buttons & disk activity (on RHS) drawn in correct position
. Crosshairs for mouse (and when using mouse as joystick)drawn in correct position
2016-07-12 22:43:31 +01:00
tomcw
e98de27039 Manual merge from master @ c798157 2016-03-21 23:48:02 +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
33ee34b96c Save-state: SaveBool() / LoadBool() persists true,false values 2016-03-01 22:31:17 +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
michaelangel007
81c649d621 [PVS-Studio] Fix sprintf() security warnings Bug #301 2015-07-30 09:17:34 -07:00
tomcw
9ceb95372f SSI263 speech: fix for data-race (todo: raise GH issue, since it resulted in a Win32 crash) 2015-04-12 18:17:08 +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
73f0e405e5 Remove wchar.h & Update VS2012 proj with new headers 2014-08-14 22:27:41 +01: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
tomcw
d591dd006b Remove the top-level AppleWin folder 2014-05-23 22:59:02 +01:00