Compare commits

...

86 Commits

Author SHA1 Message Date
TomCh
d052327fb4
Update README.md
Update stable release version from 1.30.17 to 1.30.20.
2025-04-09 10:43:56 +01:00
tomcw
a4fa3b5cb5 Debugger: fix Ramworks3's bank display number (fixes #1393) 2025-04-05 09:27:50 +01:00
tomcw
c3fb55d376 Add debug cmd line: '-alt-cpu-emu' 2025-04-04 22:16:18 +01:00
TomCh
839c493b67
Support IIe aux slot: 80-col(1KiB) card via generic read ptrs (#1341, PR #1391)
Better support the IIe's aux slot when it's empty or has the 80-col(1KiB) card.
- any h/w using this alternate CPU emulation, (ie. aux=empty or 80-col(1KiB)), then the 'mem' cache is completely bypassed.
Debugger: change all the direct 'mem' accesses to go via ReadByteFromMemory().
TestCPU6502: test the alt CPU emulation code too.
2025-04-03 21:10:02 +01:00
Andrea
629e1344a2
tfe_store: explicit cases to avoid warning. (PR #1389) 2025-03-09 18:12:22 +00:00
Michael "Code Poet" Pohoreski
9d312230e5
Debugger view output QoL (#1384, PR #1387)
. Add HGR Pages 6, 7, 8 Visualizer viewing for Language Card.
. Update help for HGR Visualizer hotkeys 6, 7, 8 and debugger commands HGR6, HGR7, HGR8.
2025-03-02 15:57:27 +00:00
michaelangel007
9006430f0c #1384 Update main table of contents for Debugger View Ouptut 2025-02-22 10:21:09 -08:00
tomcw
e262595e30 AppleWin help: fix some typos & html debugger TOC issues 2025-02-22 17:33:09 +00:00
Michael "Code Poet" Pohoreski
c1592b90f4
Debugger view output QoL (#1384, PR #1385)
. Add (missing) help for Debugger's View Output
2025-02-22 16:57:10 +00:00
tomcw
07914230a7 Update comment 2025-02-22 14:47:07 +00:00
Andrea
fa6d2f7c12
Fix initial volume of SSI263 and after a Load State. (PR #1383)
It was set at the maximum level rather than the Mockingboard volume.
2025-02-22 14:38:04 +00:00
tomcw
245773795f RamWorks III: default to 1MiB (16x 64K banks). (#478) 2025-02-13 20:56:59 +00:00
Andrea
acbef19489
Remove TEXT() and _T(). (PR #1379) 2025-02-13 20:48:37 +00:00
TomCh
b35a4d17d2
Restore SC01 continuous phoneme playback from save-state (#1372, PR #1380)
. Save-state: Mockingboard v13: deprecate SS_YAML_KEY_VOTRAX_PHONEME (from Mockingboard card).
. Consolidate the save/loading of the SSI263 & SC01 state into single function (in class SSI263).
2025-02-11 21:54:48 +00:00
tomcw
fa181922f0 Commit 287a0f8 fixed #1318 2025-02-09 21:56:05 +00:00
tomcw
287a0f892e SSI263: Fix phoneme leadout ASSERT when single-stepping.
(And add some logging for SSI263::Update() for early returns)
2025-02-09 21:43:21 +00:00
tomcw
693812319a Use dtor for setting m_hasVidHD=false when VidHD card is removed. 2025-02-08 16:42:01 +00:00
tomcw
0ef6ead4a6 Fix setting m_hasVidHD=false when '-s3 empty' is specified on cmd line 2025-02-08 16:32:48 +00:00
Michael "Code Poet" Pohoreski
67896db65e
Document the disk image size magic numbers. (PR #1375)
* Document the disk image size magic numbers (in source & help doc).
* Mention 40+ tracks after oddball disk sizes.
* Debugger 2.9.2.2: Fixed: DB HGR = 2000:3FFF was displaying help instead of being parsed.
* Debugger 2.9.2.3: Fixed: DB HGR = 2000:3FFF and DB FOO = 300 wasn't parsing correctly from 2.9.1.3. Fix for commit 48e0fe3a.
* Debugger: 2.9.2.4 Fixed: DA RESET = 3F2 was displaying help instead of being parsed.
* Debugger: 2.9.2.5 Added: Symbol table for DOS 3.3 using file A2_DOS33.SYM2
* Debugger: 2.9.2.6 Added: QoL: Turning a symbol table on/off now shows the current status.
2025-02-08 16:11:08 +00:00
tomcw
bd87cae92c Improve logging: for -fs-width/height=x: for each display resolution, after the WxH also output the aspect ratio. 2025-02-08 16:03:41 +00:00
TomCh
5bc7e495bf
Restore SSI263 continuous phoneme playback from save-state (#1372, PR #1376)
. Defer each SSI263's DSInit() until SSI263::Play() & Update() are called.
. Refactor DSInit(): rename to Init() for consistency with MockingboardCardManager class.
. m_currentActivePhoneme: never return to -1 value, instead OR with kPhonemeLeadoutFlag.
. Save-state: Mockingboard v13: deprecate SS_YAML_KEY_SSI263_ACTIVE_PHONEME.
2025-02-08 13:37:50 +00:00
tomcw
648e5cca25 Replace a missed _tcslen() with strlen() 2025-02-08 11:11:31 +00:00
Andrea
168e868677
Remove TCHAR and <tchar.h> (PR #1373)
. Replace TCHAR -> char.
. Remove <tchar.h> and related functions.
2025-02-08 11:09:09 +00:00
tomcw
1f3e253c4b Help doc: -f-height, best: include info when vidhd is enabled 2025-02-06 21:35:50 +00:00
michaelangel007
f44d058a09 Debugger: 2.9.2.6 Added: QoL: Turning a symbol table on/off now shows the current status. 2025-02-06 11:48:28 -08:00
michaelangel007
977cc01d85 Debugger: 2.9.2.5 Added: Symbol table for DOS 3.3 using file A2_DOS33.SYM2 2025-02-06 11:47:33 -08:00
michaelangel007
fa608c1f89 Debugger: 2.9.2.4 Fixed: DA RESET = 3F2 was displaying help instead of being parsed. 2025-02-06 10:38:15 -08:00
michaelangel007
3659beb776 Debugger 2.9.2.3: Fixed: DB HGR = 2000:3FFF and DB FOO = 300 wasn't parsing correctly from 2.9.1.3. Fix for commit 48e0fe3a. 2025-02-06 10:37:10 -08:00
michaelangel007
cb0da8538d Debugger 2.9.2.2: Fixed: DB HGR = 2000:3FFF was displaying help instead of being parsed. 2025-02-06 09:59:00 -08:00
tomcw
9bd5f838b3 RepeatInitialization(): fix function's code indentation. NB. no code changes! 2025-01-26 19:40:24 +00:00
tomcw
7cde8d40c9 RepeatInitialization(): call KeybReset(). Fixes #1367 2025-01-26 19:32:32 +00:00
tomcw
7aa6fb5757 Help doc: bump (c) to 2025 2025-01-19 20:52:15 +00:00
tomcw
ef088e49ae RamWorks III: default to 2MiB (32x 64K banks). (#478) 2025-01-19 20:47:48 +00:00
TomCh
02b6bbdbb5
RamWorks III - 16MB support (#478, PR #1369)
. Allow up to 256 x 64KiB banks
. Persist aux slot's mem card's "Number of Banks" to Registry
. LoadConfiguration() now restores aux card from Registry - don't need to pass cmd line each time
. Update help docs
2025-01-19 18:16:53 +00:00
TomCh
d6c1654e97
Fix SmartPort Status cmd when reading status to aux mem (#1319, PR #1366)
. Use CpuWrite() instead of directly writing to 'mem'
. Check writes don't hit I/O space or ROM
2025-01-15 21:24:17 +00:00
tomcw
143f6679b6 Fix NMOS 6502 illegal opcode 0C (fixes #1360) 2025-01-07 21:51:34 +00:00
michaelangel007
6c6d821051 Debugger 2.9.2.1 Added: Error message when trying to add a symbol > 51 characters. See Issue #1342 2025-01-06 15:45:47 -08:00
tomcw
c336a0ce40 Fix 2 minor bugs:
1) Debugger: wasn't accounting for 80STORE when checking PAGE2 switch (eg. CTRL+PRNTSCRN)
2) 80-col 1KiB card (std80): wasn't checking SW_WRITERAM
2025-01-05 17:25:32 +00:00
Andrea
c4e81fc71d
DebugFont: use an ID which is a valid macro. (PR #1359)
Simplifies linux resource embedding.
2025-01-05 17:13:06 +00:00
tomcw
b1a03a1a81 Logging: add log msg when AY reg writes are discarded (likely due to ScrollLock / full-speed mode). (#1358) 2025-01-04 13:30:36 +00:00
Andrea
3a3663d9d6
More cleanup (PR #1357)
SoundBuffer: move Windows only flags to DXSoundBuffer.
Remove out of date _MSC_VER checks (pre-VS2019).
2025-01-04 12:35:31 +00:00
Andrea
d7918d9ac9
A few miscellaneous cleanups. (PR #1355)
Move DSXXX function to a more specific location.
. DSAvailable() is not implemented in SoundCore.
. DSInit() & DSUninit(); are only meaningful in Windows.
SoundBuffer: use plain C++ to clean it up as opposed to COM interfaces.
. which are only relevant to the Win32 implementation.
Remove 2 obsolete FMT macros.
NTSC: load bitmaps by resource id.
SoundBuffer: make creation of a SoundBuffer an atomic operation.
Fix 2019 solution.
2025-01-02 21:08:55 +00:00
tomcw
80af06db77 Debug: fix MB IRQ logging 2025-01-02 21:04:15 +00:00
TomCh
16b2cf329e
Support IIe aux slot: empty or with 80-col(1KiB) card (#1341, PR #1351)
Add new command line switch: -aux <empty|std80|ext80|rw3>
Add 6502/65C02 x normal/debugger alt read support for CPU emulation (#1353).
Fix bug in MemReadFloatingBus() reading from mem[] - no good, if MF_AUXREAD is set.
Support odd 80-col text video mode when aux slot is empty:
. add a new videoMode flag for VF_80COL_AUX_EMPTY.
Correctly support 80COL & DHIRES soft-switches when aux slot is empty or with std80 card.
Support VidHD's SHR with -aux <empty|std80>.
Save-state: support aux slot empty or with std80 card.
2024-12-30 21:39:16 +00:00
Jamiras
a2b03483ee
Add SoundBuffer interface (PR #1352)
This replaces the LPDIRECTSOUNDBUFFER pointer with a pure virtual class and an implementation that wraps the LPDIRECTSOUNDBUFFER, allowing other sound implementations without having to simulate the exact alignment of a DIRECTSOUNDBUFFER object.

Additionally, moves the DSInit and DSUninit calls out of the SoundCore.cpp file (into a new DXSoundBuffer.cpp (for Windows)), allowing them to be appropriately reimplemented in a non-DirectSound environment.
2024-12-30 12:42:26 +00:00
Jamiras
cb1366f485
Check _WIN32 instead of _MSC_VER (PR #1346) 2024-12-24 12:06:37 +00:00
Andrea
35f176e4d8
Replace DWORD -> uint32_t. (PR #1350)
Some have been left where tightly coupled with the Win32 API.
2024-12-21 12:32:00 +00:00
tomcw
44babe9814 Add comment for RamWorks III on a reset 2024-12-16 15:25:18 +00:00
Andrea
9b15559949
Minizip: include minizip as "minizip/unzip.h" and "minizip/zip.h". (#1345)
This aligns AW to the new way minizip is meant to be included:

7e6f0784cc

Which avoids ambiguous includes if zip is installed in a non standard path.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2024-12-06 17:31:34 +00:00
tomcw
3fb6839458 Debugger: Increase symbol length from 31 to 51 chars 2024-11-24 18:12:48 +00:00
tomcw
000b546613 MB: Refactor: rename m_phasorEnable to m_isPhasorCard 2024-11-23 15:05:02 +00:00
tomcw
d1d026f7ab MB: Refactor: add SetPhasorMode() 2024-11-23 14:57:16 +00:00
tomcw
a6416acb87 MB: SSI263: Don't try to create DS soundbuffer if DS is unavailable 2024-11-23 14:25:09 +00:00
tomcw
b5544142e0 MB: Refactor IsActive() to IsActiveToPreventFullSpeed() (#1340) 2024-11-20 21:00:38 +00:00
tomcw
d896e1cec2 MB: Fix for SSI263 phoneme blocking enhanced disk II full-speed mode. (Fixes #1340) 2024-11-18 21:27:56 +00:00
tomcw
7f9563b8ea 1.30.20: Update History.txt 2024-11-16 12:21:51 +00:00
tomcw
a0e79d449e Help: Keyboard: add some 'quick-start' info to the top of this page. (PR #1335) 2024-11-16 11:29:13 +00:00
tomcw
ae4b34decf Fix VS2019 proj 2024-11-15 22:51:51 +00:00
tomcw
7c6ec3dbf0 Add cmd line option (for testing): -load-state-ignore-hdc-fw 2024-11-03 19:02:01 +00:00
TomCh
964a5d5198
Oz-DOS and Format command support (#88, PR #1337)
Support FORMAT cmd:
. HDC firmware: byte $FE, b3=1 (format supported)
. HDC firmware: allow both SmartPort and BLK FORMAT cmd (and check that SP FORMAT only has 1 parameter)

SmartPort Controller:
. Format will just zero all blocks (if not write-protected)
. Write cmd: if write-protected return NOWRITE
. SP Status cmd: 'General Status': set format-allowed & write-protected flags

If HDD image is read-only then support as write-protected.
. On Insert() setup m_bWriteProtected flag correctly
2024-11-02 11:39:49 +00:00
tomcw
5ddb2357aa History.txt: Revert the claim for the Oz DOS fix 2024-10-16 21:43:21 +01:00
tomcw
f6d0c0088c HDC: Improve logging 2024-10-16 21:41:37 +01:00
TomCh
910313f176
Fix edge-case for 6522 Timer write (#1333, PR #1334)
Refactor GetOpcodeCyclesForRead()/Write() to make then consistent & consolidate common code.
2024-10-15 21:26:38 +01:00
tomcw
9f508d1b7e MB: Fix ASSERT for 6522 write (#1333) 2024-10-13 18:09:21 +01:00
tomcw
617e2b5d16 Help: Troubleshooting: add item about overriding high DPI scaling behaviour (#1295) 2024-10-12 20:03:15 +01:00
tomcw
cf42f77b70 Update History.txt with a few issues fixed by previous AppleWin versions 2024-10-12 18:47:02 +01:00
Andrea
3033f3445b
SaveState: add absolute path for disk & hdd images. (#1290, PR #1294) 2024-10-06 20:44:24 +01:00
tomcw
e8641555e8 Debugger: visually show that a 6522 is configured as bad in mini-mem window's title 2024-09-28 16:46:28 +01:00
tomcw
5f40ac8e70 Fix 6522 ctor 2024-09-25 21:48:41 +01:00
tomcw
b764c00d50 Cmd line: -sN 6522a|b-bad (for mb-audit) 2024-09-25 20:58:59 +01:00
tomcw
8739b6ba08 DiskII: C0E8 (DRIVES OFF): Improve logging & comments (#926) 2024-09-20 21:57:51 +01:00
tomcw
ec90ebf156 Help: Update harddisk page for Block mode/SmartPort etc 2024-09-17 21:05:09 +01:00
tomcw
8a3de5592a Help doc: add Hayden dongle 2024-08-25 14:31:44 +01:00
TomCh
29c02d6bf2
Gh1267 update paging (#1326)
MemGetBankPtr(): simplify with a default arg. (#1262, PR #1326)
. UpdatePaging(): improve comment for page0 & page1 and memdirty
2024-08-24 20:18:28 +01:00
tomcw
f035a53374 For II/II+/Unenhanced //e use the new SmartPort firmware, but with $Cs07 = 0x3C. (#1319) 2024-08-21 23:01:29 +01:00
tomcw
b3aef776c2 Help: tweak info on -s<n> hdc-[bm2|bm4] 2024-08-21 22:35:02 +01:00
TomCh
57ba330072
Support Hayden dongle (#1312, PR #1325) 2024-08-21 22:15:34 +01:00
tomcw
91743eeebc Help: add cmd-line info about '-s<n> hdc-[sp|bm2|bm4]' 2024-08-17 22:03:15 +01:00
tomcw
ad6482a89c Help: add cmd-line info about '-s5h* <pathname>' and '-s7h* <pathname>' 2024-08-17 21:43:13 +01:00
tomcw
25820cc145 History.txt: update to match GH release details 2024-08-17 21:26:10 +01:00
TomCh
fd93396162
Uthernet I/II: Activate DEV SELECT I/O even if NIC interface is not valid (PR #1324) 2024-08-17 21:20:00 +01:00
tomcw
4786de0cc7 Floppy/Harddisk images: on failure, close handle for all return paths. (Fixes #1227) 2024-08-17 16:14:09 +01:00
tomcw
1127447a10 U1, U2: small refactor 2024-08-15 20:08:38 +01:00
tomcw
2e65426a11 Get U2 to emit similar warning to U1 when interface isn't valid. (#1321) 2024-08-15 18:11:56 +01:00
tomcw
6e8d79ddde Fix for both Uthernet cards not reading I/O $Csxx space as floating-bus. (#1321) 2024-08-15 17:36:32 +01:00
TomCh
f516423772
Update History.txt - fixed releaes year for 1.30.18 & .19 2024-08-15 16:16:30 +01:00
174 changed files with 5231 additions and 3072 deletions

View File

@ -11,7 +11,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppleWin", "AppleWin-VS2022
{9B32A6E7-1237-4F36-8903-A3FD51DF9C4E} = {9B32A6E7-1237-4F36-8903-A3FD51DF9C4E}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zip_lib", "zip_lib\zip_VS2022.vcxproj", "{509739E7-0AF3-4C09-A1A9-F0B1BC31B39D}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip\zip_VS2022.vcxproj", "{509739E7-0AF3-4C09-A1A9-F0B1BC31B39D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib-VS2022.vcxproj", "{9B32A6E7-1237-4F36-8903-A3FD51DF9C4E}"
EndProject

View File

@ -59,7 +59,6 @@
<ClInclude Include="source\CPU\cpu6502.h" />
<ClInclude Include="source\CPU\cpu65C02.h" />
<ClInclude Include="source\Debugger\Debug.h" />
<ClInclude Include="source\Debugger\DebugDefs.h" />
<ClInclude Include="source\Debugger\Debugger_Assembler.h" />
<ClInclude Include="source\Debugger\Debugger_Color.h" />
<ClInclude Include="source\Debugger\Debugger_Console.h" />
@ -107,6 +106,7 @@
<ClInclude Include="source\SaveState.h" />
<ClInclude Include="source\SerialComms.h" />
<ClInclude Include="source\SNESMAX.h" />
<ClInclude Include="source\SoundBuffer.h" />
<ClInclude Include="source\SoundCore.h" />
<ClInclude Include="source\Speaker.h" />
<ClInclude Include="source\Speech.h" />
@ -134,6 +134,7 @@
<ClInclude Include="source\W5100.h" />
<ClInclude Include="source\Windows\AppleWin.h" />
<ClInclude Include="source\Windows\DirectInput.h" />
<ClInclude Include="source\Windows\DXSoundBuffer.h" />
<ClInclude Include="source\Windows\HookFilter.h" />
<ClInclude Include="source\Windows\Win32Frame.h" />
<ClInclude Include="source\YamlHelper.h" />
@ -264,6 +265,7 @@
<ClCompile Include="Source\VidHD.cpp" />
<ClCompile Include="source\Windows\AppleWin.cpp" />
<ClCompile Include="source\Windows\DirectInput.cpp" />
<ClCompile Include="source\Windows\DXSoundBuffer.cpp" />
<ClCompile Include="source\Windows\HookFilter.cpp" />
<ClCompile Include="source\Windows\Win32Frame.cpp" />
<ClCompile Include="source\Windows\WinFrame.cpp" />
@ -321,7 +323,7 @@
<None Include="source\CPU\cpu_instructions.inl" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="zip_lib\zip_VS2022.vcxproj">
<ProjectReference Include="minizip\zip_VS2022.vcxproj">
<Project>{509739e7-0af3-4c09-a1a9-f0b1bc31b39d}</Project>
</ProjectReference>
<ProjectReference Include="zlib\zlib-VS2022.vcxproj">
@ -467,7 +469,7 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
@ -494,7 +496,7 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
@ -523,7 +525,7 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;NO_DIRECT_X;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<ConformanceMode>true</ConformanceMode>
@ -551,7 +553,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
@ -583,7 +585,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
@ -617,7 +619,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;NO_DIRECT_X;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>

View File

@ -274,6 +274,9 @@
<ClCompile Include="source\MockingboardCardManager.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
<ClCompile Include="source\Windows\DXSoundBuffer.cpp">
<Filter>Source Files\Windows</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="source\CommonVICE\6510core.h">
@ -495,9 +498,6 @@
<ClInclude Include="source\z80emu.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\Debugger\DebugDefs.h">
<Filter>Source Files\Debugger</Filter>
</ClInclude>
<ClInclude Include="source\Debugger\Util_MemoryTextFile.h">
<Filter>Source Files\Debugger</Filter>
</ClInclude>
@ -621,6 +621,12 @@
<ClInclude Include="source\MemoryDefs.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\SoundBuffer.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\Windows\DXSoundBuffer.h">
<Filter>Source Files\Windows</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="resource\Applewin.bmp">

View File

@ -11,7 +11,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppleWin", "AppleWinExpress
{9B32A6E7-1237-4F36-8903-A3FD51DF9C4E} = {9B32A6E7-1237-4F36-8903-A3FD51DF9C4E}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zip_lib", "zip_lib\zip_lib2019.vcxproj", "{509739E7-0AF3-4C09-A1A9-F0B1BC31B39D}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip\zip_lib2019.vcxproj", "{509739E7-0AF3-4C09-A1A9-F0B1BC31B39D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib-Express2019.vcxproj", "{9B32A6E7-1237-4F36-8903-A3FD51DF9C4E}"
EndProject

View File

@ -90,6 +90,7 @@
<ClInclude Include="source\LanguageCard.h" />
<ClInclude Include="source\Log.h" />
<ClInclude Include="source\Memory.h" />
<ClInclude Include="source\MemoryDefs.h" />
<ClInclude Include="source\Mockingboard.h" />
<ClInclude Include="source\MockingboardCardManager.h" />
<ClInclude Include="source\MockingboardDefs.h" />
@ -106,6 +107,7 @@
<ClInclude Include="source\SaveState.h" />
<ClInclude Include="source\SerialComms.h" />
<ClInclude Include="source\SNESMAX.h" />
<ClInclude Include="source\SoundBuffer.h" />
<ClInclude Include="source\SoundCore.h" />
<ClInclude Include="source\Speaker.h" />
<ClInclude Include="source\Speech.h" />
@ -133,6 +135,7 @@
<ClInclude Include="source\W5100.h" />
<ClInclude Include="source\Windows\AppleWin.h" />
<ClInclude Include="source\Windows\DirectInput.h" />
<ClInclude Include="source\Windows\DXSoundBuffer.h" />
<ClInclude Include="source\Windows\HookFilter.h" />
<ClInclude Include="source\Windows\Win32Frame.h" />
<ClInclude Include="source\YamlHelper.h" />
@ -263,6 +266,7 @@
<ClCompile Include="Source\VidHD.cpp" />
<ClCompile Include="source\Windows\AppleWin.cpp" />
<ClCompile Include="source\Windows\DirectInput.cpp" />
<ClCompile Include="source\Windows\DXSoundBuffer.cpp" />
<ClCompile Include="source\Windows\HookFilter.cpp" />
<ClCompile Include="source\Windows\Win32Frame.cpp" />
<ClCompile Include="source\Windows\WinFrame.cpp" />
@ -297,14 +301,18 @@
<None Include="resource\Apple2.rom" />
<None Include="resource\Apple2e.rom" />
<None Include="resource\Apple2e_Enhanced.rom" />
<None Include="resource\Apple2e_Enhanced_Video.rom" />
<None Include="resource\Apple2_JPlus.rom" />
<None Include="resource\Apple2_JPlus_Video.rom" />
<None Include="resource\Apple2_Plus.rom" />
<None Include="resource\Apple2_Video.rom" />
<None Include="resource\Base64A.rom" />
<None Include="resource\Base64A_German_Video.rom" />
<None Include="resource\Disk2-13sector.rom" />
<None Include="resource\DISK2.rom" />
<None Include="resource\Freezes_Non-autostart_F8_Rom.rom" />
<None Include="resource\HDC-SmartPort.bin" />
<None Include="resource\Hddrvr-v2.bin" />
<None Include="resource\Hddrvr.bin" />
<None Include="resource\Mockingboard-D.rom" />
<None Include="resource\MouseInterface.rom" />
@ -320,7 +328,7 @@
<None Include="source\CPU\cpu_instructions.inl" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="zip_lib\zip_lib2019.vcxproj">
<ProjectReference Include="minizip\zip_lib2019.vcxproj">
<Project>{509739e7-0af3-4c09-a1a9-f0b1bc31b39d}</Project>
</ProjectReference>
<ProjectReference Include="zlib\zlib-Express2019.vcxproj">
@ -466,7 +474,7 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
@ -493,7 +501,7 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
@ -509,7 +517,7 @@
</Link>
<PreBuildEvent>
<Command>echo Performing unit-test: TestCPU6502
.\Debug\TestCPU6502.exe</Command>
".\Debug v141_xp\TestCPU6502.exe"</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Performing unit-test: TestCPU6502</Message>
@ -522,7 +530,7 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;NO_DIRECT_X;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<ConformanceMode>true</ConformanceMode>
@ -550,7 +558,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
@ -582,7 +590,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
@ -601,7 +609,7 @@
</Link>
<PreBuildEvent>
<Command>echo Performing unit-test: TestCPU6502
.\Release\TestCPU6502.exe</Command>
".\Release v141_xp\TestCPU6502.exe"</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Performing unit-test: TestCPU6502</Message>
@ -616,7 +624,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;NO_DSHOW_STRSAFE;NO_DIRECT_X;YAML_DECLARE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;$(SolutionDir);libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>

View File

@ -274,6 +274,9 @@
<ClCompile Include="source\MockingboardCardManager.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
<ClCompile Include="source\Windows\DXSoundBuffer.cpp">
<Filter>Source Files\Windows</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="source\CommonVICE\6510core.h">
@ -618,6 +621,15 @@
<ClInclude Include="source\MockingboardDefs.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\MemoryDefs.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\SoundBuffer.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\Windows\DXSoundBuffer.h">
<Filter>Source Files\Windows</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="resource\Applewin.bmp">
@ -805,6 +817,18 @@
<None Include="resource\Disk2-13sector.rom">
<Filter>Resource Files</Filter>
</None>
<None Include="resource\Apple2_Video.rom">
<Filter>Resource Files</Filter>
</None>
<None Include="resource\Apple2e_Enhanced_Video.rom">
<Filter>Resource Files</Filter>
</None>
<None Include="resource\HDC-SmartPort.bin">
<Filter>Resource Files</Filter>
</None>
<None Include="resource\Hddrvr-v2.bin">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Text Include="docs\CodingConventions.txt">

View File

@ -23,9 +23,9 @@ Peripheral cards and add-on hardware supported:
- Game I/O Connector copy protection dongles
Download latest (stable) release: [AppleWin v1.30.17.0](https://github.com/AppleWin/AppleWin/releases/download/v1.30.17.0/AppleWin1.30.17.0.zip)
Download latest (stable) release: [AppleWin v1.30.20.0](https://github.com/AppleWin/AppleWin/releases/download/v1.30.20.0/AppleWin1.30.20.0.zip)
Release Notes: [v1.30.17.0](https://github.com/AppleWin/AppleWin/releases/tag/v1.30.17.0)
Release Notes: [v1.30.20.0](https://github.com/AppleWin/AppleWin/releases/tag/v1.30.20.0)
Building

93
bin/A2_DOS33.SYM2 Normal file
View File

@ -0,0 +1,93 @@
// DOS 3.3 Symbols for AppleWin
// Min debugger version 2.9.2.4
// = Functions =
symdos33 DOS.COS0 = 9EEB
symdos33 DOS.COS1 = 9F12
symdos33 DOS.SCANCMD = 9FCD
symdos33 DOS.ORTN = 9FB3
symdos33 DOS.MVCSW = A851
symdos33 DOS.EBLD = A35D
symdos33 DOS.EBLD1 = A382
symdos33 DOS.EBLD2 = A360
symdos33 DOS.EBLD3 = A36C
symdos33 DOS.EBSV = A331
symdos33 DOS.EBRUN = A38E
symdos33 DOS.LD3 = A471
symdos33 DOS.GNBC = A1A4
// = Data =
dw DOS.CFTABA = AA4F
db DOS.ISTATE = AA51
db DOS.OSTATE = AA52
dw DOS.SVOUTS = AA53
dw DOS.SVINS = AA55
db DOS.CNFTBS = AA57
db DOS.DFNFB = AA58
db DOS.SVSTK = AA59
db DOS.SVX = AA5A
db DOS.SVY = AA5B
db DOS.SVA = AA5C
db DOS.LBUFD = AA5D
db DOS.MONMOD = AA5E
db DOS.CMDNO = AA5F
dw DOS.SVBL = AA60
db DOS.SVCMD = AA62
db DOS.TEMP1A = AA63
db DOS.TEMP2A = AA64
db DOS.INOPTS = AA65
dw DOS.CV = AA66
dw DOS.CD = AA68
dw DOS.CS = AA6A
dw DOS.CL = AA6C
dw DOS.CR = AA6E
dw DOS.CB = AA70
dw DOS.CA = AA72
db DOS.PAD_B7DF = B7DF
db DOS.NDPGS = B7E0
db DOS.BRWCNT = B7E1
db DOS.PAD_B7E2 = B7E2
db DOS.PAD_B7E3 = B7E3
da DOS.BAOB = B7E4
da DOS.ADOSLD = B7E6
db DOS.IBTYPE = B7E8
db DOS.IBSLOT = B7E9
db DOS.IBDRVN = B7EA
db DOS.IBVOL = B7EB
db DOS.IBTRK = B7EC
db DOS.IBSECT = B7ED
da DOS.IBDCTP = B7EE
da DOS.IBBUFP = B7F0
dw DOS.IBDLEN = B7F2
db DOS.IBCMD = B7F4
// = Strings =
asc T_INIT A884:A887
asc T_LOAD A888:A88B
asc T_SAVE A88C:A88F
asc T_RUN A890:A892
asc T_CHAIN A893:A897
asc T_DELETE A898:A89D
asc T_LOCK A89E:A8A1
asc T_UNLOCK A8A2:A8A7
asc T_CLOSE A8A8:A8AC
asc T_READ A8AD:A8B0
asc T_EXEC A8B1:A8B4
asc T_WRITE A8B5:A8B9
asc T_POSITION A8BA:A8C1
asc T_OPEN A8C2:A8C5
asc T_APPEND A8C6:A8CB
asc T_RENAME A8CC:A8D1
asc T_CATALOG A8D2:A8D8
asc T_MON A8D9:A8DB
asc T_NOMON A8DC:A8E0
asc T_PR_NUM A8E1:A8E3
asc T_IN_NUM A8E4:A8E6
asc T_MAXFILES A8E7:A8EE
asc T_FP A8EF:A8F0
asc T_INT A8F1:A8F3
asc T_BSAVE A8F4:A8F8
asc T_BLOAD A8F9:A8FD
asc T_BRUN A8FE:A901
asc T_VERIFY A902:A907

View File

@ -9,15 +9,40 @@ https://github.com/AppleWin/AppleWin/issues/new
Tom Charlesworth
1.30.19.0 - 28 Jul 2023
1.30.20.0 - 16 Nov 2024
-----------------------
- [Change #1207] Support for SmartPort hard disk controller for Enhanced //e. [@burniouf, @alupin65, @inexorabletash, @univta0001]
- [Change #1312] Support Hayden's Applesoft compiler protection key.
- For use with Hayden's 1981 AppleSoft compiler (DOS 3.2 and DOS 3.3 pre-release versions).
- [Change #1337] HDC controller: support Format command (both SmartPort and ProDOS block device):
- [Bug #88] Fix for Oz-DOS (uses ProDOS block device command).
- SP Status command: 'General Status': set format-allowed & write-protected flags
- For read-only HDD images: support them as write-protected.
- [Change #1319] For II/II+/Unenhanced //e use the new SmartPort firmware, but with $Cs07 = 0x3C:
- This now defaults to supporting 4 block mode devices (instead of the previous 2).
- [Change #1295] Help doc: add troubleshooting note about "High DPI scaling override", eg. for 2K or 4K monitors.
- [Change #1290] Save-state: add absolute path to disk & hard disk image. [@audetto]
- [Bug #1333] Mockingboard: fix edge-case for 6522 Timer1/2 read/write (cycle accuracy). Test added to (future) mb-audit v1.56.
- [Bug #1321] Uthernet/Uthernet II cards: fix $Csxx space not reading as floating-bus.
- [Bug #1227] Fix issue with not being able to insert a 3.5" 800K image (after failing to insert it into a 5.25" drive).
- [PR #1335] Help doc: add some 'quick-start' info to the Keyboard page.
1.30.19.0 - 28 Jul 2024
-----------------------
- [Change #1207] Support for SmartPort hard disk controller for Enhanced //e. [Thanks to @burniouf, with additional testing and input from: @alupin65, @inexorabletash, @univta0001]
- New HDC SmartPort firmware written by @burniouf.
- Enhanced //e defaults to using SmartPort firmware, and older Apple II's still use the older v2 firmware.
- Supports up to 8 SmartPort units per HDC (currently limited to 4GiB capacity for each unit).
- Supports up to 4 ProDOS block devices per HDC (previously was 2).
- Command line support only for slot 5 HDC (-s5 hdc) and hard disks after unit-2 (eg. -s5h3 <pathname>, -s7h3 <pathname>, etc).
- [Bug #563] Fixes "UniDOS 3.3 v2.0.1".
- [Change #175] Improvements to the SSI263 emulation (mostly edge cases). Use in conjunction with mb-audit v1.53.
- [Bug #926, #1315] DiskII Interface: 'DRIVES OFF' forces the control flipflops to clear. Fixes Infocom's Shogun & Zork0. [@sicklittlemonkey]
- [Bug #1308] Fix for corrupt 't' glyph. [@xotmatrix]
- [Bug #1308] Fix for corrupt 't' glyph. [@xotmatrix] and use actual II+ and Enhanced //e video character ROMs.
- [Bug #1285] Fix crash in 6502 emulation at 0xFFFF boundary.
1.30.18.0 - 23 Mar 2023
1.30.18.0 - 23 Mar 2024
-----------------------
- [Change #1272] New HDC firmware v2 to support returning HDD size in Y:X for status call. [@peteri]
- [Change #1277] Add (debug) cmd line switch to revert to HDC firmware v1: -hdc-firmware-v1.

View File

@ -1,4 +1,26 @@
/*
2.9.2.7 Added: QoL for Debugger's view output screen.
When using the debugger to view the ouput screen such as `HGR`, `HGR2`, etc. allow the
keys 0-5 to display the specificed video # page, or 9 to see the current video mode.
0 Pseudo Page 0 ($0000 for graphics, else text page 1)
1 Hardware Page 1 ($2000 for graphics, else text $0400)
2 Hardware Page 2 ($4000 for graphics, else text $0800)
3 Pseudo Page 3 ($6000 for graphics, else text page 1)
4 Pseudo Page 4 ($8000 for graphics, else text page 1)
5 Pseudo Page 5 ($A000 for graphics, else text page 1)
9 Current mode and page
2.9.2.6 Added: QoL: Turning a symbol table on/off now shows the current status.
2.9.2.5 Added: Symbol table for DOS 3.3 using file A2_DOS33.SYM2
Add symbols via: SYMDOS33 <symbol> = <addr>
To disable: SYMDOS33 OFF
To renable: SYMDOS33 ON
2.9.2.4 Fixed: DA RESET = 3F2 was displaying help instead of being parsed.
2.9.2.3 Fixed: DB HGR = 2000:3FFF and DB FOO = 300 wasn't parsing correctly from 2.9.1.3. Fix for commit 48e0fe3a.
2.9.2.2 Fixed: DB HGR = 2000:3FFF was displaying help instead of being parsed.
2.9.2.1 Added: Error message when trying to add a symbol > 51 characters.
2.9.2.0 Released with AppleWin 1.30.20.0
2.9.2.0 Fixed: Debugger: Step-over WAIT can fail #1194
2.9.1.26 Fixed: When adding symbols list the address first then the name for readability
2.9.1.25 Fixed: R P ## wasn't setting P flag status register.

View File

@ -243,7 +243,7 @@ Cn_BLK php
ldy #0
- lda BLK_Cmd,y
sta IO_BlkCmdFifo,x ; BLK_Cmd's are $0x
sta IO_BlkCmdFifo,x ; BLK_Cmd's are $0x (NB. not range-checked unlike SP cmds)
iny ; BLK_UnitNum's are DSSS0000 : if SSS does NOT match physical slot...
; ...hardware should handle the remap by adding +2 to the REAL dev_ID
cpy #6 ; that way, a BLK controller can support 4 devices (see $CnFE byte below)
@ -276,7 +276,9 @@ Cn_BLK_Done lsr ; Post: C=0 or 1
Cn_SP lda (Ptr1),y ; CMD byte
cmp #SP_Cmd_format
bcs Cn_SP_E_BADCALL ; only STATUS, READBLOCK & WRITEBLOCK supported
beq +
bcs Cn_SP_E_BADCALL ; only STATUS, READBLOCK, WRITEBLOCK & FORMAT supported
+ ; C=1 if FORMAT cmd [*1]
ldx Slot_n0
@ -290,18 +292,28 @@ Cn_SP lda (Ptr1),y ; CMD byte
lda (Ptr1),y
sta Ptr1+1
pla
pla
sta Ptr1 ; Now Ptr1 = Param list
ldy #0 ; Param Cnt
ldy #0 ; Param Idx (in bytes)
lda (Ptr1),y
cmp #3 ; STATUS, READBLOCK & WRITEBLOCK = all 3 parameters
sec
!if 1 { ; (This parameter-checking code could be removed to free up some space)
bcs @format ; NB. C-flag untouched from above [*1]
cmp #3 ; STATUS, READBLOCK & WRITEBLOCK: all have 3 parameters
beq +
bne Cn_SP_E_BADCNT
@format cmp #1 ; FORMAT: has 1 parameter
bne Cn_SP_E_BADCNT
+
}
- iny ; UnitNum (B), MemPtr (L/H), DiskBlock (L/M/H) -> IO (R,W)
lda (Ptr1),y ; UnitNum (B), MemPtr (L/H), StatusCode (B) -> IO (S)
; Parameter-1: Parameter-2: Parameter-3:
; UnitNum (B), MemPtr (L/H), StatusCode (B) -> IO (STATUS)
; UnitNum (B), MemPtr (L/H), DiskBlock (L/M/H) -> IO (READ,WRITE)
; UnitNum (B) -> IO (FORMAT)
- iny ; Always copy 6 more bytes to the FIFO regardless of the command
lda (Ptr1),y
sta IO_SPCmdFifo,x ; UnitNum Range is 0 (smartport controller itself), 1,2,3.....
cpy #6 ; blockNums are 24-bit for SP calls
bcc -
@ -364,7 +376,8 @@ Cn_SP_E_BADCNT ldx #E_BADCNT
; $C7 = Removable, Interruptable, #Volumes=1, Supports write/read/status
; $D7 = Removable, Interruptable, #Volumes=2, Supports write/read/status
; $F7 = Removable, Interruptable, #Volumes=4, Supports write/read/status
; $BF = Removable, Interruptable, #Volumes=4, Supports format/write/read/status (KEGS / IIGS)
; $FF = Removable, Interruptable, #Volumes=4, Supports format/write/read/status
; $BF = Removable, , #Volumes=4, Supports format/write/read/status (KEGS / IIGS)
;
; $CnFF = offset to BLK entry point
;--------------------------------------
@ -372,8 +385,8 @@ Cn_SP_E_BADCNT ldx #E_BADCNT
*= $00FB ; org $00FB
!warn "CsFB padding = ", * - @checkCsFB
;--------------------------------------
!byte $00 ; Smart port ID Type byte
!byte $00 ; SmartPort ID Type byte
!word $0000 ; how many blocks are on the device. Zero means use status call
!byte $F7 ; specifics about the device (number of drives, read/write/format capability, etc)
!byte $FF ; specifics about the device (number of drives, read/write/format capability, etc)
!byte <Cn_Entry_BLK ; entry point offset for ProDOS (must be $0a)
;--------------------------------------

View File

@ -28,14 +28,24 @@
-s5d2 &lt;pathname&gt;<br>
Start with a floppy disk in slot 5 drive-2 (must be used with '-s5 diskii' or '-s5 diskii13').<br><br>
-h1 &lt;pathname&gt;<br>
Start with hard disk 1 plugged-in (and auto power-on the Apple II). NB. Hard disk controller card gets enabled.<br><br>
Start with hard disk 1 plugged in (and auto power-on the Apple II). NB. Hard disk controller card in slot 7 gets enabled.<br><br>
-h2 &lt;pathname&gt;<br>
Start with hard disk 2 plugged-in. NB. Hard disk controller card gets enabled.<br><br>
Start with hard disk 2 plugged in. NB. Hard disk controller card in slot 7 gets enabled.<br><br>
-s5h1 &lt;pathname&gt;<br>
Start with hard disk 1 plugged-in slot 5 (must be used with '-s5 hdc').<br><br>
Start with hard disk 1 plugged into HDC in slot 5 (must be used with '-s5 hdc').<br><br>
-s5h2 &lt;pathname&gt;<br>
Start with hard disk 2 plugged-in slot 5 (must be used with '-s5 hdc').<br><br>
NB. For -d1,-d2,-s5d1,-s5d2,-h1,-h2,-s5h1,-s5h2, if pathname is "", then the disk is ejected or the hard disk is unplugged.<br><br>
Start with hard disk 2 plugged into HDC in slot 5 (must be used with '-s5 hdc').<br><br>
-s5h&lt;1|2|3|4|5|6|7|8&gt; &lt;pathname&gt;<br>
Start with hard disk n plugged into HDC in slot 5 (must be used with '-s5 hdc').<br>
NB. Only SmartPort firmware for enhanced //e supports hard disks 5-8.<br><br>
-s7h1 &lt;pathname&gt;<br>
Start with hard disk 1 plugged into HDC in slot 7 (must be used with '-s7 hdc').<br><br>
-s7h2 &lt;pathname&gt;<br>
Start with hard disk 2 plugged into HDC in slot 7 (must be used with '-s7 hdc').<br><br>
-s7h&lt;1|2|3|4|5|6|7|8&gt; &lt;pathname&gt;<br>
Start with hard disk n plugged into HDC in slot 7 (must be used with '-s7 hdc').<br>
NB. Only SmartPort firmware for enhanced //e supports hard disks 5-8.<br><br>
NB. For -d1,-d2,-s5d1,-s5d2,-h1,-h2,-s5h*,-s7h*, if pathname is "", then the disk is ejected or the hard disk is unplugged.<br><br>
-model &lt;apple2|apple2p|apple2jp|apple2e|apple2ee&gt;<br>
Select the machine model: Apple II, Apple II+, Apple II J-Plus, Apple //e, Enhanced Apple //e.<br><br>
-clock-multiplier &lt;value&gt;<br>
@ -69,18 +79,23 @@
Remove the hard disk controller card from slot 7 on AppleWin exit.<br><br>
-s5 hdc<br>
-s7 hdc<br>
Insert a hard disk controller card into slot 5 or 7.<br><br>
Insert a hard disk controller card into slot 5 or 7.<br>
NB. For enhanced //e, the firmware will support SmartPort commands (and up to 8 hard disk devices).<br><br>
-d1-disconnected, -d2-disconnected<br>
Disconnect drive-1 and/or drive-2 from the Disk II controller card in slot 6.<br><br>
-harddisknumblocks &lt;number of ProDOS blocks&gt;<br>
Set the number of blocks returned by a ProDOS status call. Use -harddisknumblocks 32767 to have the same autoexpanding behavior as older AppleWin versions.<br><br>
-no-nsc<br>
Remove the No-Slot clock (NSC).<br><br>
-r &lt;number of pages&gt;<br>
Emulate a RamWorks III card with 1 to 127 pages (each page is 64K, giving a max of 8MB) in the auxiliary slot in an Apple //e machine.<br><br>
-aux &lt;empty|std80|ext80|rw3&gt;<br>
Remove ('empty') or insert 80-Column('std80'), Extended 80-Column('ext80') or RamWorks III('rw3') card into auxiliary slot in Apple //e.<br>
NB. 'rw3' will default to 1MiB (16 banks of 64K) unless overriden by -r switch.<br><br>
-r &lt;number of banks&gt;<br>
Emulate a RamWorks III card with 1 to 256 banks (each bank is 64K, giving a max of 16MiB) in the auxiliary slot in an Apple //e machine.<br>
(Implicitly inserts a RamWorks III card into the aux slot.)<br><br>
-load-state &lt;savestate&gt;<br>
Load a save-state file (and auto power-on the Apple II).<br>
NB. This takes precedent over the -d1, -d2, -s#d#, -h1, -h2, s0-7, -model and -r switches.<br><br>
NB. This takes precedent over the -d1, -d2, -s#d#, -h1, -h2, -s#h#, -s0-7, -model and -r switches.<br><br>
-f or -full-screen<br>
Start in full-screen mode.<br><br>
-no-full-screen<br>
@ -88,7 +103,7 @@
-fs-height=&lt;best|nnnn&gt;<br>
Use to select a better resolution for full-screen mode.<br>
<ul>
<li>best: picks the highest resolution where the height is an integer multiple of (192*2)</li>
<li>best: picks the highest resolution where the height is an integer multiple of (192*2); or (200*2) when using '-s3 vidhd'</li>
<li>nnnn: select a specific resolution with height=nnnn pixels</li>
</ul>
-fs-width=&lt;nnnn&gt;<br>
@ -229,11 +244,19 @@
<br><br>
-screenshot-and-exit<br>
For testing. Use in combination with -load-state.<br><br>
-load-state-ignore-hdc-fw<br>
For testing. Use in combination with -load-state.<br><br>
-hdc-firmware-v1<br>
Force all attached hard disk controllers to use the old v1 firmware (as per pre-AppleWin 1.30.17).
<ul>
<li>NB. Switch likely to be removed after a few releases.</li>
</ul>
-s&lt;n&gt; hdc-[sp|bm2|bm4]
<ul>
<li>hdc-sp: Force HDC SmartPort firmware for II/II+/Unenhanced //e machines (now won't autoboot from HDD-1).</li>
<li>hdc-bm2: Modify HDC firmware: $Cn07=$3C (block mode, not SmartPort), and $CnFE to report supporting 2 block mode devices.</li>
<li>hdc-bm4: Modify HDC firmware: $Cn07=$3C (block mode, not SmartPort), and $CnFE to report supporting 4 block mode devices.</li>
</ul>
<br><br>
</body>
</html>

View File

@ -179,6 +179,10 @@
<param name="Name" value="Memory">
<param name="Local" value="dbg-memory.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="View Output">
<param name="Local" value="dbg-view-output.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Symbols">
<param name="Local" value="dbg-symbols.html">

View File

@ -87,7 +87,7 @@
<br>
Can't set bookmark 0 in the debugger / CTRL+SHIFT+0 not working:
<img style="FLOAT: right;" src="img/Change Key Sequence.png" alt="Configuration settings" hspace="5" vspace="5">
<img style="FLOAT: right;" src="img/Change Key Sequence.png" alt="Change Key Sequence" hspace="5" vspace="5">
<ul>
<li>Windows 7: From "Control Panel...":</li>
<ul>
@ -124,5 +124,16 @@
<li>These non-booting .po images are with DOS-order sectors.</li>
</ul>
</ul>
<br>
AppleWin's window is blurry when running on a 2K, 4K (or higher) monitor when display scaling (eg. 150%) is enabled.
<img style="FLOAT: right;" src="img/Override high DPI scaling behaviour.png" alt="Override high DPI scaling behaviour" hspace="5" vspace="5">
<ul>
<li>From AppleWin.exe's Properties (from Explorer, press right-mouse button on the AppleWin.exe file) and select:</li>
<ul>
<li>Compatibility -> Change high DPI settings: Check the "Override high DPI scaling behaviour".</li>
<li>Set the drop-down menu to "Application".</li>
</ul>
</ul>
</body>
</html>

View File

@ -88,10 +88,11 @@ Supported devices are:
<li> Southwestern Data Systems' datakey - SpeedStar (copy protection dongle)
<li> Dynatech Microsoftware / Cortechs Corp's protection key - CodeWriter (copy protection dongle)
<li> Robocom Ltd's interface module - Robo 500/1000/1500 & RoboCAD 1/2 (copy protection dongle)
<li> Hayden Book Company, Inc's protection key - Applesoft Compiler (copy protection dongle)
</ul>
NB. Copy protection dongles can interfere with joysticks (eg. buttons may be hardwired to a fixed state), so only use dongles with the intended software.<br>
NB. Copy protection dongles can interfere with RGB cards (eg. unexpected video modes may get selected).<br>
NB. For Apple II/II+ models, when a joystick is selected (from the <a href="cfg-input.html">Input</a> tab), then there is also an implicit joystick connected at the same time as the device selected here.
NB. For Apple II/II+ models, when a joystick is selected (from the <a href="cfg-input.html">Input</a> tab), then there is also an implicit joystick connected at the same time as the device selected here (and some dongles even allowed 16-pin game connectors to be plugged in on top, eg. SDS and Robocom devices).
</p>
</body></html>

View File

@ -6,9 +6,6 @@
</head>
<body style="DIRECTION: ltr" lang="en-US">
<h2><a name="Configuration"></a>Configuration</h2>
<p><br>
<br>
</p>
<h3><a name="Colors"></a>Colors</h3>
<p>The commands to change color schemes, and colors are:</p>
<p><br>

View File

@ -496,14 +496,10 @@ FF0A</span></b></font></font></p>
<p><font color="#00b8ff"><font face="Courier"><b>300:60</b></font></font></p>
</td>
<td width="75%">
<p><i><span style="COLOR: white">Same
as Applesoft Poke 768,96</span></i></p>
<p><i><span style="COLOR: white">Same as Applesoft Poke 768,96</span></i></p>
</td>
</tr>
</tbody>
</table>
<h2>
<br>
&nbsp;</h2>
</body>
</html>

View File

@ -7,7 +7,7 @@
<body style="DIRECTION: ltr" lang="en-US">
<H1>AppleWin Debugger Tutorial</H1>
<P><FONT size="4"><i>By Michael Pohoreski.</i></FONT></P>
<P><FONT size="3">Revision 3.&nbsp; Mar 12, 2006.</FONT></P>
<P><FONT size="3">Revision 4.&nbsp; Feb. 21, 2025.</FONT></P>
<H2>Table of Contents</H2>
<UL>
<LI><A href="#Introduction">Introduction</A>
@ -23,6 +23,11 @@
<LI><A href="dbg-memory.html#Memory_Search">Searching Memory</A>
<LI><A href="dbg-memory.html#Memory_Change">Changing Memory</A>
</UL>
<LI><A href="dbg-view-output.html">View Output</a>
<UL>
<LI><A href="dbg-view-output.html#View_Video_Modes">Video Modes</A>
<LI><A href="dbg-view-output.html#View_Output_Keys">Output Keys</A>
</UL>
<LI><A href="dbg-symbols.html">Symbols</A>
<LI><A href="dbg-calculator.html">Calculator</A>
<LI><A href="dbg-windows.html">Windows</A>

198
help/dbg-view-output.html Normal file
View File

@ -0,0 +1,198 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>AppleWin Debugger Tutorial</title>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=windows-1252">
</head>
<body style="DIRECTION: ltr" lang="en-US">
<h1><a name="View_Output">View Output</a></h1>
<h3><a name="View_Video_Modes">Video Modes</a></h3>
<p>You can view the output of the Apple by using the following commands.</p>
<table border="0" cellpadding="2" cellspacing="0" width="80%">
<COLGROUP>
<col width="64">
<col width="192">
<tbody>
<tr bgcolor="#000000">
<td bgcolor="#000000" width="25%"><p><font color="#ffffff"><b>Command</b></font></p></td>
<td bgcolor="#000000" width="75%"><p style="FONT-STYLE: normal"><font color="#ffffff"><b>Effect</b></font></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">\</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Display Apple output until a key pressed.</span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">DGR</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Double lo-res (current page).</span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">DGR1</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Double lo-res Page 1.</span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">DGR2</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Double lo-res Page 2.<br></span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">DHGR</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Double Hi-res (current page).</span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">DHGR1</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Double Hi-res Page 1.<br></span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">DHGR2</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Double Hi-res Page 2.</span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">GR</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Lo-Res screen (current page).<br></span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">GR1</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Lo-Res screen Page 1.</span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">GR2</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Lo-Res screen Page 2.<br></span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">HGR</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Hi-res (current page).</span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">HGR0</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View pseudo Hi-res Page 0 ($0000).<br></span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">HGR1</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Hi-res Page 1 ($2000).</span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">HGR2</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Hi-res Page 2 ($4000).<br></span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">HGR3</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View pseudo Hi-res Page 3 ($6000).</span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">HGR4</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View pseudo Hi-res Page 4 ($8000).<br></span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">HGR5</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View pseudo Hi-res Page 5 ($A000).</span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">HGR6</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View pseudo Hi-res Page 6 LC Banks 1/2 ($C000-$DFFF).</span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">HGR7</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View pseudo Hi-res Page 7 LC Banks 2/RAM ($D000-$EFFF).</span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">HGR8</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View pseudo Hi-res Page 8 LC Banks RAM ($D000-$EFFF).</span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">SHR</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Super Hi-res.<br></span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">TEXT</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Text screen (current page).</span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">TEXT1</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Text screen Page 1 ($0400).<br></span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">TEXT2</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View Text screen Page 2 ($0800).</span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">TEXT80</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View 80-column Text screen (current page).<br></span></i></p></td>
</tr>
<tr bgcolor="#999999">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">TEXT81</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View 80-column Text screen Page 1.</span></i></p></td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%"><p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">TEXT82</span></b></font></font></p></td>
<td width="75%"><p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">View 80-column Text screen Page 2.<br></span></i></p></td>
</tr>
</tbody>
</table>
<h2><font size="4">Notes:</font></h2>
<ul>
<li><p>If you change to a specific video mode/page <i>different</i> from the current video settings and then exit the debugger (<font face="Courier, monospace">F7</font>) the screen will NOT change to the current video settings.
This lets you inspect other video modes/pages until code (re)sets the video mode or page -- handy if reverse engineering games.</p></li>
<li>If the Apple's output is in a mixed mode then viewing a specific mode MAY view them in full screen mode.</li>
</ul>
<p><br></p>
<h3><a name="View_Output_Keys">Output Keys</a></h3>
<p>While viewing the Apple's output you can use the following keys to switch video pages. Pressing any other key will return to the debugger's output.</p>
<table border="1" cellpadding="2" cellspacing="0" width="75%">
<COLGROUP>
<col width="26">
<col width="64">
<col width="166">
<tbody>
<tr bgcolor="#000000">
<td width="10%">
<p><font color="#ffffff"><b>Key</b></font></p>
</td>
<td width="25%">
<p><font color="#ffffff"><b>Name</b></font></p>
</td>
<td width="65%">
<p><font color="#ffffff"><b>Effect</b></font></p>
</td>
</tr>
<tr>
<td width="10%"><p><b><font face="Courier">0</font></b></p></td>
<td width="25%"><p>Zero</p></td><td width="65%"><p><i>View pseudo page 0<br> ($0000-$1FFF) if graphics,<br> page 1 if text.</i></p></td>
</tr>
<tr>
<td width="10%"><p><b><font face="Courier">1</font></b></p></td>
<td width="25%"><p>One</p></td><td width="65%"><p><i>View page 1<br> ($2000-$3FFF) if graphics,<br>($0400-$07FF) if text.</i></p></td>
</tr>
<tr>
<td width="10%"><p><b><font face="Courier">2</font></b></p></td>
<td width="25%"><p>Two</p></td><td width="65%"><p><i>View page 2<br> ($4000-$5FFF) if graphics,<br>($0800-$0BFF) if text.</i></p></td>
</tr>
<tr>
<td width="10%"><p><b><font face="Courier">3</font></b></p></td>
<td width="25%"><p>Three</p></td><td width="65%"><p><i>View pseudo page 3<br> ($6000-$7FFF) if graphics,<br>page 1 if text.</i></p></td>
</tr>
<tr>
<td width="10%"><p><b><font face="Courier">4</font></b></p></td>
<td width="25%"><p>Four</p></td><td width="65%"><p><i>View pseudo page 4<br> ($8000-$9FFF) if graphics,<br>page 1 if text.</i></p></td>
</tr>
<tr>
<td width="10%"><p><b><font face="Courier">5</font></b></p></td>
<td width="25%"><p>Five</p></td><td width="65%"><p><i>View pseudo page 5<br> ($A000-$BFFF) if graphics,<br>page 1 if text.</i></p></td>
</tr>
<tr>
<td width="10%"><p><b><font face="Courier">6</font></b></p></td>
<td width="25%"><p>Six</p></td><td width="65%"><p><i>View pseudo page 6<br> LC Banks 1/2 ($C000-$DFFF) if graphics,<br>page 1 if text.</i></p></td>
</tr>
<tr>
<td width="10%"><p><b><font face="Courier">7</font></b></p></td>
<td width="25%"><p>Seven</p></td><td width="65%"><p><i>View pseudo page 7<br> LC Banks 2/RAM ($D000-$EFFF) if graphics,<br>page 1 if text.</i></p></td>
</tr>
<tr>
<td width="10%"><p><b><font face="Courier">8</font></b></p></td>
<td width="25%"><p>Eight</p></td><td width="65%"><p><i>View pseudo page 8<br> LC Bank RAM ($E000-$FFFF) if graphics,<br>page 1 if text.</i></p></td>
</tr>
<tr>
<td width="10%"><p><b><font face="Courier">9</font></b></p></td>
<td width="25%"><p>Nine</p></td><td width="65%"><p><i>View current video mode and page.</i></p></td>
</tr>
</table>
</body>
</html>

View File

@ -27,16 +27,24 @@ sectors. If you run a DOS program on the Apple which reads in
sectors one by one and then transfers them over a serial line to
the PC, you will get a DOS order disk image. </p>
<p>Apple floppy disks contained 35 tracks with
<p>Apple floppy disks (normally) contain 35 tracks with
16 sectors per track, for a total of 560 sectors. Each of these
sectors contained 256 bytes of information, for a total of
143,360 bytes per disk. Therefore, DOS order disk images are
always at least 143,360 bytes long. Sometimes on the Internet you
will see a disk image that is 143,488 or 143,616 bytes long; this
will see a disk image that is not 143,360 bytes long; this
is probably a DOS order image with extra header information
before or after the image. In most cases, AppleWin can
automatically detect this and handle it. </p>
<p>Due to some games being incorrectly converted to a disk image AppleWin also accepts disk images of sizes:
<ul>
<li>143,403 bytes (<i>Castle Wolfenstein</i>)</li>
<li>143,488 bytes (<i>Rescue Raiders</i>)</li>
</ul>
<p>Some disk drives were able to handle 40+ tracks. AppleWin accept disk images up to 40 tracks -- 163,840 bytes -- as long as the disk image is a multiple of 4,096 bytes / track.</p>
<p style="font-weight: bold;">ProDOS Order
Images: </p>

View File

@ -5,7 +5,6 @@
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Hard Disk Images</title>
</head>
@ -16,39 +15,38 @@
<hr size="4">
<p style="font-weight: bold;">Overview:</p>
<p>A hard disk controller (or interface) card can be plugged in to slot 7 via the AppleWin Configuration tab labelled Disk.
Just check <span style="font-style: italic;">Enable hard disk controller in slot 7</span>.</p>
<p>A hard disk controller (or interface) card can be plugged in to slot 7 via the
AppleWin Configuration tab labelled Disk. Just check <span style="font-style: italic;">
Enable hard disk controller in slot 7</span>.</p>
<p>There is provision to connect two hard disks to this card from the UI (more can be added via the command line).
This is done by using .hdv or 800KB .2mg files on your PC. Each hard disk can have a maximum capacity of 32MB.</p>
<p>There is provision to connect two hard disks to this card.
This is done by using .hdv or 800KB .2mg files on your PC.
Each hard disk can have a maximum capacity of 32MB.</p>
NB. The hard disk controller supports both fixed-disk types (up to 32MB) and 3.5" floppy types (800KB).
<p>On booting, the Apple will <span style="text-decoration: underline;">always</span>
attempt to
autoboot from slot 7 first. If the hard disk card is unplugged (not
enabled) then
the Apple will then attempt to boot from slot 6 (with the Disk][
attempt to autoboot from slot 7 first. If the hard disk card is unplugged (not
enabled) then the Apple will then attempt to boot from slot 6 (with the Disk][
interface card in it).</p>
<p>To boot a floppy disk with the hard disk card enabled, either hold down the Open-Apple key during an Apple II restart or
issue PR#6 from an AppleSoft prompt.</p>
<p>To boot a floppy disk with the hard disk card enabled, either hold down the
Open-Apple key during an Apple II restart or issue PR#6 from an AppleSoft prompt.</p>
<p>Use command line options to insert a hard disk controller card into slot 5, and attach HDDs.</p>
<p>The firmware in the hard disk controller card defaults to:
<li>II/II+/Unenhanced //e: ProDOS block mode, supporting up to 4 HDDs.</li>
<li>Enhanced //e: SmartPort, supporting up to 8 HDDs.</li>
</p>
<p style="font-weight: bold;">Warnings:</p>
<ul>
<li>Unchecking <span style="font-style: italic;">Enable hard disk controller in slot 7</span> whilst the Apple is running will
physically unplugging the hard disk card. This can lead to a corrupt
.hdv image if the Apple is writing to the hard disk when it is unplugged!</li>
<li>Equally, exiting AppleWin
can have the same affect.</li>
<li>Copy][+ v7.1 locks up when
trying to calculate how many free blocks are available when running a
catalog. This is a bug in Copy][+ which is fixed in later versions.</li>
<li>Unchecking <span style="font-style: italic;">Enable hard disk controller in slot 7</span>
whilst the Apple is running will physically unplugging the hard disk card. This
can lead to a corrupt .hdv image if the Apple is writing to the hard disk when it is unplugged!</li>
<li>Equally, exiting AppleWin can have the same affect.</li>
<li>Copy][+ v7.1 locks up when trying to calculate how many free blocks are
available when running a catalog. This is a bug in Copy][+ which is fixed in later versions.</li>
</ul>
</body>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -5,11 +5,22 @@
<body style="font-family: verdana; background-color: rgb(255, 255, 255);" alink="#008000" link="#008000" vlink="#008000">
<h2 style="color: rgb(0, 128, 0);">Using the Keyboard</h2>
<hr size="4">
<p>Normally to start an Apple II computer you would insert a floppy into
the floppy disk drive and power it on. If you don't have a disk inserted
the drive motor will stay on indefinitely. To enter Applesoft BASIC instead (and stop the disk
drive from spinning) you should press Ctrl+Reset. In AppleWin this sequence is
<span style="font-style: italic;">analogous</span> to pressing the following keys:</p>
<ul>
<li><span style="font-weight: bold;">F2</span> (Power On), and
<li><span style="font-weight: bold;">Ctrl+F2</span> or <span style="font-weight: bold;">Ctrl+Break</span> (Ctrl+Reset)
</ul>
<p>The Apple //e keyboard was very similar to the PC keyboard, and most keys
correspond directly between the two keyboards. However, there were a few keys
on the Apple //e that are not on the PC; these are described below:</p>
<p><span style="font-weight: bold;">Reset</span>:<br>
On the Apple //e, you could usually press Control+Reset to interrupt a running
On the Apple //e, you could usually press Ctrl+Reset to interrupt a running
program. With the Apple //e Emulator, you may emulate this key sequence with
<span style="font-style: italic;">Ctrl+F2</span> or
<span style="font-style: italic;">Ctrl+Break</span>.

View File

@ -45,10 +45,12 @@
<li>Alternate ROM</li>
<li>Alternate video ROM</li>
</ul>
<p>Note: Only the file names of the disk images are stored in the .yaml file (not the
full path). This allows you to move your disk image around or distribute them.
If AppleWin can't locate the disk image(s), then it will prompt for the new
location.</p>
<p>
Note: Both the file name and absolute path are stored in the .yaml file.
This allows you to move your disk image around or distribute them.
If AppleWin still can't locate the disk image(s), then it will prompt for the new
location.
</p>
<p>NB. Loading of the old v1 file format (.aws file) is no longer supported. Use AppleWin 1.27.13 to load it at the AppleWin start-up/logo screen,
then immediately save it (and it'll be saved in the v2 format).</p>
</body>

View File

@ -12,7 +12,7 @@
Copyright © 1994-1996, Michael O'Brien<br>
Copyright © 2001, Oliver Schmidt<br>
Copyright © 2002-2005, Tom Charlesworth<br>
Copyright © 2006-2024, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis<br>
Copyright © 2006-2025, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis<br>
<br>
<a href="applewin-team.html">AppleWin team</a>
<br>

View File

@ -36,8 +36,8 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{509739E7-0AF3-4C09-A1A9-F0B1BC31B39D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>zip_lib</RootNamespace>
<ProjectName>zip_lib</ProjectName>
<RootNamespace>minizip</RootNamespace>
<ProjectName>minizip</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

View File

@ -36,8 +36,8 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{509739E7-0AF3-4C09-A1A9-F0B1BC31B39D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>zip_lib</RootNamespace>
<ProjectName>zip_lib</ProjectName>
<RootNamespace>minizip</RootNamespace>
<ProjectName>minizip</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

View File

@ -70,13 +70,13 @@ LED_CAPSOFF_P8_BITMAP BITMAP "LED_CAPS_OFF_P8.BMP"
LED_CAPSON_P8_BITMAP BITMAP "LED_CAPS_ON_P8.BMP"
LED_LATOFF_BITMAP BITMAP "LED_CAPS_OFF_LAT.BMP"
LED_LATON_BITMAP BITMAP "LED_CAPS_ON_LAT.BMP"
CHARSET82 BITMAP "CHARSET82.BMP"
CHARSET8M BITMAP "CHARSET8M.BMP"
CHARSET8C BITMAP "CHARSET8C.BMP"
IDB_CHARSET82 BITMAP "CHARSET82.bmp"
IDB_CHARSET8M BITMAP "CHARSET8M.bmp"
IDB_CHARSET8C BITMAP "CHARSET8C.bmp"
HELP_BUTTON BITMAP "HELP.BMP"
DRIVESWAP_BUTTON BITMAP "DRIVESWAP.BMP"
IDB_APPLEWIN BITMAP "ApplewinLogo.bmp"
IDB_DEBUG_FONT_7X8 BITMAP "Debug_Font.bmp"
IDB_DEBUG_FONT_7_by_8 BITMAP "Debug_Font.bmp"
/////////////////////////////////////////////////////////////////////////////
//
@ -327,8 +327,8 @@ END
// FIRMWARE
//
IDR_DISK2_13SECTOR_FW FIRMWARE "Disk2-13sector.rom"
IDR_DISK2_16SECTOR_FW FIRMWARE "Disk2.rom"
IDR_DISK2_13SECTOR_FW FIRMWARE "DISK2-13sector.rom"
IDR_DISK2_16SECTOR_FW FIRMWARE "DISK2.rom"
IDR_SSC_FW FIRMWARE "SSC.rom"
IDR_HDDRVR_FW FIRMWARE "Hddrvr.bin"
IDR_HDDRVR_V2_FW FIRMWARE "Hddrvr-v2.bin"
@ -349,12 +349,12 @@ IDR_APPLE2_PLUS_ROM ROM "Apple2_Plus.rom"
IDR_APPLE2_JPLUS_ROM ROM "Apple2_JPlus.rom"
IDR_APPLE2E_ROM ROM "Apple2e.rom"
IDR_APPLE2E_ENHANCED_ROM ROM "Apple2e_Enhanced.rom"
IDR_PRAVETS_82_ROM ROM "Pravets82.rom"
IDR_PRAVETS_8M_ROM ROM "Pravets8M.rom"
IDR_PRAVETS_8C_ROM ROM "Pravets8C.rom"
IDR_PRAVETS_82_ROM ROM "PRAVETS82.ROM"
IDR_PRAVETS_8M_ROM ROM "PRAVETS8M.ROM"
IDR_PRAVETS_8C_ROM ROM "PRAVETS8C.ROM"
IDR_TK3000_2E_ROM ROM "TK3000e.rom"
IDR_BASE_64A_ROM ROM "Base64A.rom"
IDR_FREEZES_F8_ROM ROM "FREEZES_NON-AUTOSTART_F8_ROM.rom"
IDR_FREEZES_F8_ROM ROM "Freezes_Non-Autostart_F8_Rom.rom"
/////////////////////////////////////////////////////////////////////////////
//

Binary file not shown.

View File

@ -56,6 +56,10 @@
#define IDR_BASE64A_VIDEO_ROM 154
#define IDR_HDDRVR_V2_FW 155
#define IDR_HDC_SMARTPORT_FW 156
#define IDB_CHARSET8M 157
#define IDB_CHARSET82 158
#define IDB_CHARSET8C 159
#define IDB_DEBUG_FONT_7_by_8 160
#define IDC_KEYB_BUFFER_ENABLE 1005
#define IDC_SAVESTATE 1006
#define IDC_SAVESTATE_ON_EXIT 1007
@ -138,7 +142,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 149
#define _APS_NEXT_RESOURCE_VALUE 161
#define _APS_NEXT_COMMAND_VALUE 40012
#define _APS_NEXT_CONTROL_VALUE 1083
#define _APS_NEXT_SYMED_VALUE 101

View File

@ -1,4 +1,4 @@
#define APPLEWIN_VERSION 1,30,19,0
#define APPLEWIN_VERSION 1,30,20,0
#define xstr(a) str(a)
#define str(a) #a

View File

@ -87,7 +87,6 @@ void SY6522::StopTimer1(void)
void SY6522::StartTimer2(void)
{
m_timer2Active = true;
}
void SY6522::StopTimer2(void)
@ -353,6 +352,8 @@ BYTE SY6522::Read(BYTE nReg)
break;
case 0x02: // DDRB
nValue = m_regs.DDRB;
if (m_bad6522)
nValue &= ~1; // DDRB.b0 = 0 (for testing mb-audit)
break;
case 0x03: // DDRA
nValue = m_regs.DDRA;
@ -410,188 +411,200 @@ BYTE SY6522::Read(BYTE nReg)
// TODO: RMW opcodes: dec,inc,asl,lsr,rol,ror (abs16 & abs16,x) + 65C02 trb,tsb (abs16)
UINT SY6522::GetOpcodeCyclesForRead(BYTE reg)
{
UINT opcodeCycles = 0;
BYTE opcode = 0;
bool abs16 = false;
UINT zpOpcodeCycles = 0, opcodeCycles = 0;
BYTE zpOpcode = 0, opcode = 0; // these double-up as flags to indicate validity
bool abs16x = false;
bool abs16y = false;
bool indx = false;
bool indy = false;
const BYTE opcodeMinus3 = mem[(::regs.pc - 3) & 0xffff];
const BYTE opcodeMinus2 = mem[(::regs.pc - 2) & 0xffff];
const BYTE opcodeMinus3 = ReadByteFromMemory(::regs.pc - 3);
const BYTE opcodeMinus2 = ReadByteFromMemory(::regs.pc - 2);
// Check 2-byte opcodes
if (((opcodeMinus2 & 0x0f) == 0x01) && ((opcodeMinus2 & 0x10) == 0x00)) // ora (zp,x), and (zp,x), ..., sbc (zp,x)
{
// NB. this is for read, so don't need to exclude 0x81 / sta (zp,x)
opcodeCycles = 6;
opcode = opcodeMinus2;
zpOpcodeCycles = 6;
zpOpcode = opcodeMinus2;
indx = true;
}
else if (((opcodeMinus2 & 0x0f) == 0x01) && ((opcodeMinus2 & 0x10) == 0x10)) // ora (zp),y, and (zp),y, ..., sbc (zp),y
{
// NB. this is for read, so don't need to exclude 0x91 / sta (zp),y
opcodeCycles = 5;
opcode = opcodeMinus2;
zpOpcodeCycles = 5;
zpOpcode = opcodeMinus2;
indy = true;
}
else if (((opcodeMinus2 & 0x0f) == 0x02) && ((opcodeMinus2 & 0x10) == 0x10) && GetMainCpu() == CPU_65C02) // ora (zp), and (zp), ..., sbc (zp) : 65C02-only
{
// NB. this is for read, so don't need to exclude 0x92 / sta (zp)
opcodeCycles = 5;
opcode = opcodeMinus2;
zpOpcodeCycles = 5;
zpOpcode = opcodeMinus2;
}
else
{
if ((((opcodeMinus3 & 0x0f) == 0x0D) && ((opcodeMinus3 & 0x10) == 0x00)) || // ora abs16, and abs16, ..., sbc abs16
(opcodeMinus3 == 0x2C) || // bit abs16
(opcodeMinus3 == 0xAC) || // ldy abs16
(opcodeMinus3 == 0xAE) || // ldx abs16
(opcodeMinus3 == 0xCC) || // cpy abs16
(opcodeMinus3 == 0xEC)) // cpx abs16
{
}
else if ((opcodeMinus3 == 0xBC) || // ldy abs16,x
((opcodeMinus3 == 0x3C) && GetMainCpu() == CPU_65C02)) // bit abs16,x : 65C02-only
{
abs16x = true;
}
else if ((opcodeMinus3 == 0xBE)) // ldx abs16,y
{
abs16y = true;
}
else if ((opcodeMinus3 & 0x10) == 0x10)
{
if ((opcodeMinus3 & 0x0f) == 0x0D) // ora abs16,x, and abs16,x, ..., sbc abs16,x
abs16x = true;
else if ((opcodeMinus3 & 0x0f) == 0x09) // ora abs16,y, and abs16,y, ..., sbc abs16,y
abs16y = true;
}
else
{
_ASSERT(0);
opcodeCycles = 0;
return 0;
}
// Check 3-byte opcodes
if ((((opcodeMinus3 & 0x0f) == 0x0D) && ((opcodeMinus3 & 0x10) == 0x00)) || // ora abs16, and abs16, ..., sbc abs16
(opcodeMinus3 == 0x2C) || // bit abs16
(opcodeMinus3 == 0xAC) || // ldy abs16
(opcodeMinus3 == 0xAE) || // ldx abs16
(opcodeMinus3 == 0xCC) || // cpy abs16
(opcodeMinus3 == 0xEC)) // cpx abs16
{
opcodeCycles = 4;
opcode = opcodeMinus3;
abs16 = true;
}
else if ((opcodeMinus3 == 0xBC) || // ldy abs16,x
((opcodeMinus3 == 0x3C) && GetMainCpu() == CPU_65C02)) // bit abs16,x : 65C02-only
{
opcodeCycles = 4;
opcode = opcodeMinus3;
abs16x = true;
}
else if ((opcodeMinus3 == 0xBE)) // ldx abs16,y
{
opcodeCycles = 4;
opcode = opcodeMinus3;
abs16y = true;
}
else if ((opcodeMinus3 & 0x10) == 0x10)
{
if ((opcodeMinus3 & 0x0f) == 0x0D) // ora abs16,x, and abs16,x, ..., sbc abs16,x
{
opcodeCycles = 4;
opcode = opcodeMinus3;
abs16x = true;
}
else if ((opcodeMinus3 & 0x0f) == 0x09) // ora abs16,y, and abs16,y, ..., sbc abs16,y
{
opcodeCycles = 4;
opcode = opcodeMinus3;
abs16y = true;
}
}
//
WORD addr16 = 0;
if (!abs16)
{
BYTE zp = mem[(::regs.pc - 1) & 0xffff];
if (indx) zp += ::regs.x;
addr16 = (mem[zp] | (mem[(zp + 1) & 0xff] << 8));
if (indy) addr16 += ::regs.y;
}
else
{
addr16 = mem[(::regs.pc - 2) & 0xffff] | (mem[(::regs.pc - 1) & 0xffff] << 8);
if (abs16y) addr16 += ::regs.y;
if (abs16x) addr16 += ::regs.x;
}
// Check we've reverse looked-up the 6502 opcode correctly
if ((addr16 & 0xF80F) != (0xC000 + reg))
if (!opcode && !zpOpcode) // Unsupported opcode
{
_ASSERT(0);
return 0;
}
return opcodeCycles;
return GetOpcodeCycles(reg, zpOpcodeCycles, opcodeCycles, zpOpcode, opcode, abs16x, abs16y, indx, indy);
}
// TODO: RMW opcodes: dec,inc,asl,lsr,rol,ror (abs16 & abs16,x) + 65C02 trb,tsb (abs16)
UINT SY6522::GetOpcodeCyclesForWrite(BYTE reg)
{
UINT opcodeCycles = 0;
BYTE opcode = 0;
bool abs16 = false;
UINT zpOpcodeCycles = 0, opcodeCycles = 0;
BYTE zpOpcode = 0, opcode = 0; // these double-up as flags to indicate validity
bool abs16x = false;
bool abs16y = false;
bool indx = false;
bool indy = false;
const BYTE opcodeMinus3 = mem[(::regs.pc - 3) & 0xffff];
const BYTE opcodeMinus2 = mem[(::regs.pc - 2) & 0xffff];
const BYTE opcodeMinus3 = ReadByteFromMemory(::regs.pc - 3);
const BYTE opcodeMinus2 = ReadByteFromMemory(::regs.pc - 2);
if ((opcodeMinus3 == 0x8C) || // sty abs16
(opcodeMinus3 == 0x8D) || // sta abs16
(opcodeMinus3 == 0x8E)) // stx abs16
{ // Eg. FT demos: CHIP, MADEF, MAD2
opcodeCycles = 4;
opcode = opcodeMinus3;
abs16 = true;
}
else if ((opcodeMinus3 == 0x99) || // sta abs16,y
(opcodeMinus3 == 0x9D)) // sta abs16,x
{ // Eg. Paleotronic microTracker demo
opcodeCycles = 5;
opcode = opcodeMinus3;
abs16 = true;
}
else if (opcodeMinus2 == 0x81) // sta (zp,x)
// Check 2-byte opcodes
if (opcodeMinus2 == 0x81) // sta (zp,x)
{
opcodeCycles = 6;
opcode = opcodeMinus2;
zpOpcodeCycles = 6;
zpOpcode = opcodeMinus2;
indx = true;
}
else if (opcodeMinus2 == 0x91) // sta (zp),y
{ // Eg. FT demos: OMT, PLS
opcodeCycles = 6;
opcode = opcodeMinus2;
zpOpcodeCycles = 6;
zpOpcode = opcodeMinus2;
indy = true;
}
else if (opcodeMinus2 == 0x92 && GetMainCpu() == CPU_65C02) // sta (zp) : 65C02-only
{
zpOpcodeCycles = 5;
zpOpcode = opcodeMinus2;
}
// Check 3-byte opcodes
if ((opcodeMinus3 == 0x8C) || // sty abs16
(opcodeMinus3 == 0x8D) || // sta abs16
(opcodeMinus3 == 0x8E)) // stx abs16
{ // Eg. FT demos: CHIP, MADEF, MAD2
opcodeCycles = 4;
opcode = opcodeMinus3;
}
else if (opcodeMinus3 == 0x99) // sta abs16,y
{
opcodeCycles = 5;
opcode = opcodeMinus2;
opcode = opcodeMinus3;
abs16y = true;
}
else if (opcodeMinus3 == 0x9D) // sta abs16,x
{ // Eg. Paleotronic microTracker demo
opcodeCycles = 5;
opcode = opcodeMinus3;
abs16x = true;
}
else if (opcodeMinus3 == 0x9C && GetMainCpu() == CPU_65C02) // stz abs16 : 65C02-only
{
opcodeCycles = 4;
opcode = opcodeMinus3;
abs16 = true;
}
else if (opcodeMinus3 == 0x9E && GetMainCpu() == CPU_65C02) // stz abs16,x : 65C02-only
{
opcodeCycles = 5;
opcode = opcodeMinus3;
abs16 = true;
}
else
{
_ASSERT(0);
opcodeCycles = 0;
return 0;
abs16x = true;
}
//
WORD addr16 = 0;
if (!abs16)
{
BYTE zp = mem[(::regs.pc - 1) & 0xffff];
if (opcode == 0x81) zp += ::regs.x;
addr16 = (mem[zp] | (mem[(zp + 1) & 0xff] << 8));
if (opcode == 0x91) addr16 += ::regs.y;
}
else
{
addr16 = mem[(::regs.pc - 2) & 0xffff] | (mem[(::regs.pc - 1) & 0xffff] << 8);
if (opcode == 0x99) addr16 += ::regs.y;
if (opcode == 0x9D || opcode == 0x9E) addr16 += ::regs.x;
}
// Check we've reverse looked-up the 6502 opcode correctly
if ((addr16 & 0xF80F) != (0xC000 + reg))
if (!opcode && !zpOpcode) // Unsupported opcode
{
_ASSERT(0);
return 0;
}
return opcodeCycles;
return GetOpcodeCycles(reg, zpOpcodeCycles, opcodeCycles, zpOpcode, opcode, abs16x, abs16y, indx, indy);
}
UINT SY6522::GetOpcodeCycles(BYTE reg, UINT zpOpcodeCycles, UINT opcodeCycles,
BYTE zpOpcode, BYTE opcode,
bool abs16x, bool abs16y, bool indx, bool indy)
{
WORD zpAddr16 = 0, addr16 = 0;
if (zpOpcode)
{
if (IsZeroPageFloatingBus())
return 0;
BYTE zp = ReadByteFromMemory(::regs.pc - 1);
if (indx) zp += ::regs.x;
zpAddr16 = (ReadByteFromMemory(zp) | (ReadByteFromMemory((zp + 1) & 0xff) << 8));
if (indy) zpAddr16 += ::regs.y;
}
if (opcode)
{
addr16 = ReadByteFromMemory(::regs.pc - 2) | (ReadByteFromMemory(::regs.pc - 1) << 8);
if (abs16y) addr16 += ::regs.y;
if (abs16x) addr16 += ::regs.x;
}
// Check we've reverse looked-up the 6502 opcode correctly
const bool isZpAddrValid = (zpAddr16 & 0xF80F) == (0xC000 + reg);
const bool isAbs16AddrValid = (addr16 & 0xF80F) == (0xC000 + reg);
if ( (isZpAddrValid && isAbs16AddrValid)
|| (!isZpAddrValid && !isAbs16AddrValid) )
{
_ASSERT(0);
return 0;
}
return isZpAddrValid ? zpOpcodeCycles : opcodeCycles;
}
//=============================================================================

View File

@ -3,7 +3,7 @@
class SY6522
{
public:
SY6522(UINT slot, bool isMegaAudio) : m_slot(slot), m_isMegaAudio(isMegaAudio), m_isBusDriven(false)
SY6522(UINT slot, bool isMegaAudio) : m_slot(slot), m_isMegaAudio(isMegaAudio), m_isBusDriven(false), m_bad6522(false)
{
for (UINT i = 0; i < kNumTimersPer6522; i++)
m_syncEvent[i] = NULL;
@ -20,6 +20,11 @@ public:
m_syncEvent[1] = event1;
}
void InitBadState(bool bad6522)
{
m_bad6522 = bad6522;
}
void Reset(const bool powerCycle);
void StartTimer1(void);
@ -55,6 +60,7 @@ public:
void SetRegIRA(BYTE reg) { m_regs.ORA = reg; }
bool IsTimer1IrqDelay(void) { return m_timer1IrqDelay ? true : false; }
void SetBusBeingDriven(bool state) { m_isBusDriven = state; }
bool IsBad(void) { return m_bad6522; }
BYTE Read(BYTE nReg);
void Write(BYTE nReg, BYTE nValue);
@ -91,6 +97,7 @@ private:
UINT GetOpcodeCyclesForRead(BYTE reg);
UINT GetOpcodeCyclesForWrite(BYTE reg);
UINT GetOpcodeCycles(BYTE reg, UINT zpOpcodeCycles, UINT opcodeCycles, BYTE zpOpcode, BYTE opcode, bool abs16x, bool abs16y, bool indx, bool indy);
void StartTimer2(void);
void StartTimer1_LoadStateV1(void);
@ -148,4 +155,7 @@ private:
bool m_isBusDriven;
static const UINT kExtraMegaAudioTimerCycles = kExtraTimerCycles + 1;
// For mb-audit
bool m_bad6522;
};

View File

@ -782,6 +782,10 @@ void AY8913::sound_ay_write( int reg, int val, libspectrum_dword now )
ay_change[ ay_change_count ].val = val;
ay_change_count++;
}
else
{
LogOutput("AY reg write discarded: %02X = %02X\n", reg, val);
}
}

View File

@ -235,7 +235,7 @@ static UINT g_nMin = 0xFFFFFFFF;
static UINT g_nMax = 0;
#endif
static __forceinline void DoIrqProfiling(DWORD uCycles)
static __forceinline void DoIrqProfiling(uint32_t uCycles)
{
#ifdef _DEBUG
if(regs.ps & AF_INTERRUPT)
@ -379,6 +379,24 @@ static __forceinline void Fetch(BYTE& iOpcode, ULONG uExecutedCycles)
regs.pc++;
}
static __forceinline void Fetch_alt(BYTE& iOpcode, ULONG uExecutedCycles)
{
const USHORT PC = regs.pc;
#if defined(_DEBUG) && defined(DBG_HDD_ENTRYPOINT)
DebugHddEntrypoint(PC);
#endif
iOpcode = _READ_ALT(regs.pc);
#ifdef USE_SPEECH_API
if ((PC == COUT1 || PC == BASICOUT) && g_Speech.IsEnabled() && !g_bFullSpeed)
CaptureCOUT();
#endif
regs.pc++;
}
//#define ENABLE_NMI_SUPPORT // Not used - so don't enable
static __forceinline bool NMI(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
{
@ -391,14 +409,28 @@ static __forceinline bool NMI(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
#ifdef _DEBUG
g_nCycleIrqStart = g_nCumulativeCycles + uExecutedCycles;
#endif
PUSH(regs.pc >> 8)
PUSH(regs.pc & 0xFF)
EF_TO_AF
PUSH(regs.ps & ~AF_BREAK)
regs.ps |= AF_INTERRUPT;
if (GetMainCpu() == CPU_65C02) // GH#1099
regs.ps &= ~AF_DECIMAL;
regs.pc = * (WORD*) (mem+0xFFFA);
if (GetIsMemCacheValid())
{
_PUSH(regs.pc >> 8)
_PUSH(regs.pc & 0xFF)
EF_TO_AF
_PUSH(regs.ps & ~AF_BREAK)
regs.ps |= AF_INTERRUPT;
if (GetMainCpu() == CPU_65C02) // GH#1099
regs.ps &= ~AF_DECIMAL;
regs.pc = *(WORD*)(mem + _6502_NMI_VECTOR);
}
else
{
_PUSH_ALT(regs.pc >> 8)
_PUSH_ALT(regs.pc & 0xFF)
EF_TO_AF
_PUSH_ALT(regs.ps & ~AF_BREAK)
regs.ps |= AF_INTERRUPT;
if (GetMainCpu() == CPU_65C02) // GH#1099
regs.ps &= ~AF_DECIMAL;
regs.pc = READ_WORD_ALT(_6502_NMI_VECTOR);
}
UINT uExtraCycles = 0; // Needed for CYC(a) macro
CYC(7);
g_interruptInLastExecutionBatch = true;
@ -433,14 +465,28 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
#ifdef _DEBUG
g_nCycleIrqStart = g_nCumulativeCycles + uExecutedCycles;
#endif
PUSH(regs.pc >> 8)
PUSH(regs.pc & 0xFF)
EF_TO_AF
PUSH(regs.ps & ~AF_BREAK)
regs.ps |= AF_INTERRUPT;
if (GetMainCpu() == CPU_65C02) // GH#1099
regs.ps &= ~AF_DECIMAL;
regs.pc = * (WORD*) (mem+0xFFFE);
if (GetIsMemCacheValid())
{
_PUSH(regs.pc >> 8)
_PUSH(regs.pc & 0xFF)
EF_TO_AF;
_PUSH(regs.ps & ~AF_BREAK)
regs.ps |= AF_INTERRUPT;
if (GetMainCpu() == CPU_65C02) // GH#1099
regs.ps &= ~AF_DECIMAL;
regs.pc = *(WORD*)(mem + _6502_INTERRUPT_VECTOR);
}
else
{
_PUSH_ALT(regs.pc >> 8)
_PUSH_ALT(regs.pc & 0xFF)
EF_TO_AF;
_PUSH_ALT(regs.ps & ~AF_BREAK)
regs.ps |= AF_INTERRUPT;
if (GetMainCpu() == CPU_65C02) // GH#1099
regs.ps &= ~AF_DECIMAL;
regs.pc = READ_WORD_ALT(_6502_INTERRUPT_VECTOR);
}
UINT uExtraCycles = 0; // Needed for CYC(a) macro
CYC(7);
#if defined(_DEBUG) && LOG_IRQ_TAKEN_AND_RTI
@ -462,61 +508,116 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
//===========================================================================
#define READ _READ_WITH_IO_F8xx
#define WRITE(value) _WRITE_WITH_IO_F8xx(value)
#define HEATMAP_X(address)
// 6502 & no debugger
#define READ(addr) _READ_WITH_IO_F8xx(addr)
#define WRITE(value) _WRITE_WITH_IO_F8xx(value)
#include "CPU/cpu6502.h" // MOS 6502
#undef READ
#undef WRITE
//-------
// 6502 & no debugger & alt read/write support
#define CPU_ALT
#define READ(addr) _READ_ALT(addr)
#define WRITE(value) _WRITE_ALT(value)
#define Cpu6502 Cpu6502_altRW
#define Fetch Fetch_alt
#include "CPU/cpu6502.h" // MOS 6502
#undef Cpu6502
#undef Fetch
//-------
#define READ _READ
// 65C02 & no debugger
#define READ(addr) _READ(addr)
#define WRITE(value) _WRITE(value)
#include "CPU/cpu65C02.h" // WDC 65C02
#undef READ
#undef WRITE
//-------
// 65C02 & no debugger & alt read/write support
#define CPU_ALT
#define READ(addr) _READ_ALT(addr)
#define WRITE(value) _WRITE_ALT(value)
#define Cpu65C02 Cpu65C02_altRW
#define Fetch Fetch_alt
#include "CPU/cpu65C02.h" // WDC 65C02
#undef Cpu65C02
#undef Fetch
#undef HEATMAP_X
//-----------------
#define READ Heatmap_ReadByte_With_IO_F8xx(addr, uExecutedCycles)
#define WRITE(value) Heatmap_WriteByte_With_IO_F8xx(addr, value, uExecutedCycles);
#define HEATMAP_X(address) Heatmap_X(address)
#include "CPU/cpu_heatmap.inl"
// 6502 & debugger
#define READ(addr) Heatmap_ReadByte_With_IO_F8xx(addr, uExecutedCycles)
#define WRITE(value) Heatmap_WriteByte_With_IO_F8xx(addr, value, uExecutedCycles);
#define Cpu6502 Cpu6502_debug
#include "CPU/cpu6502.h" // MOS 6502
#undef Cpu6502
#undef READ
#undef WRITE
//-------
// 6502 & debugger & alt read/write support
#define CPU_ALT
#define READ(addr) _READ_ALT(addr)
#define WRITE(value) _WRITE_ALT(value)
#define Cpu6502 Cpu6502_debug_altRW
#define Fetch Fetch_alt
#include "CPU/cpu6502.h" // MOS 6502
#undef Cpu6502
#undef Fetch
//-------
#define READ Heatmap_ReadByte(addr, uExecutedCycles)
// 65C02 & debugger
#define READ(addr) Heatmap_ReadByte(addr, uExecutedCycles)
#define WRITE(value) Heatmap_WriteByte(addr, value, uExecutedCycles);
#define Cpu65C02 Cpu65C02_debug
#include "CPU/cpu65C02.h" // WDC 65C02
#undef Cpu65C02
#undef READ
#undef WRITE
//-------
// 65C02 & debugger & alt read/write support
#define CPU_ALT
#define READ(addr) _READ_ALT(addr)
#define WRITE(value) _WRITE_ALT(value)
#define Cpu65C02 Cpu65C02_debug_altRW
#define Fetch Fetch_alt
#include "CPU/cpu65C02.h" // WDC 65C02
#undef Cpu65C02
#undef Fetch
#undef HEATMAP_X
//===========================================================================
static DWORD InternalCpuExecute(const DWORD uTotalCycles, const bool bVideoUpdate)
static uint32_t InternalCpuExecute(const uint32_t uTotalCycles, const bool bVideoUpdate)
{
if (g_nAppMode == MODE_RUNNING || g_nAppMode == MODE_BENCHMARK)
{
if (!GetIsMemCacheValid())
{
_ASSERT(memshadow[0]);
if (GetMainCpu() == CPU_6502)
return Cpu6502_altRW(uTotalCycles, bVideoUpdate); // Apple //e
else
return Cpu65C02_altRW(uTotalCycles, bVideoUpdate); // Enhanced Apple //e
}
if (GetMainCpu() == CPU_6502)
return Cpu6502(uTotalCycles, bVideoUpdate); // Apple ][, ][+, //e, Clones
else
@ -525,6 +626,16 @@ static DWORD InternalCpuExecute(const DWORD uTotalCycles, const bool bVideoUpdat
else
{
_ASSERT(g_nAppMode == MODE_STEPPING || g_nAppMode == MODE_DEBUG);
if (!GetIsMemCacheValid())
{
_ASSERT(memshadow[0]);
if (GetMainCpu() == CPU_6502)
return Cpu6502_debug_altRW(uTotalCycles, bVideoUpdate); // Apple //e
else
return Cpu65C02_debug_altRW(uTotalCycles, bVideoUpdate); // Enhanced Apple //e
}
if (GetMainCpu() == CPU_6502)
return Cpu6502_debug(uTotalCycles, bVideoUpdate); // Apple ][, ][+, //e, Clones
else
@ -543,7 +654,7 @@ BYTE CpuRead(USHORT addr, ULONG uExecutedCycles)
{
if (g_nAppMode == MODE_RUNNING)
{
return _READ_WITH_IO_F8xx; // Superset of _READ
return _READ_WITH_IO_F8xx(addr); // Superset of _READ
}
return Heatmap_ReadByte_With_IO_F8xx(addr, uExecutedCycles);
@ -607,7 +718,7 @@ ULONG CpuGetCyclesThisVideoFrame(const ULONG nExecutedCycles)
//===========================================================================
DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate)
uint32_t CpuExecute(const uint32_t uCycles, const bool bVideoUpdate)
{
#ifdef LOG_PERF_TIMINGS
extern UINT64 g_timeCpu;
@ -624,7 +735,7 @@ DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate)
// uCycles:
// =0 : Do single step
// >0 : Do multi-opcode emulation
const DWORD uExecutedCycles = InternalCpuExecute(uCycles, bVideoUpdate);
const uint32_t uExecutedCycles = InternalCpuExecute(uCycles, bVideoUpdate);
// Update 6522s (NB. Do this before updating g_nCumulativeCycles below)
// . Ensures that 6522 regs are up-to-date for any potential save-state
@ -692,7 +803,10 @@ void CpuReset()
regs.ps |= AF_INTERRUPT;
if (GetMainCpu() == CPU_65C02) // GH#1099
regs.ps &= ~AF_DECIMAL;
regs.pc = *(WORD*)(mem + 0xFFFC);
_ASSERT(memshadow[_6502_RESET_VECTOR >> 8] != NULL);
regs.pc = ReadWordFromMemory(_6502_RESET_VECTOR);
regs.sp = 0x0100 | ((regs.sp - 3) & 0xFF);
regs.bJammed = 0;
@ -705,7 +819,7 @@ void CpuReset()
//===========================================================================
void CpuSetupBenchmark ()
void CpuSetupBenchmark()
{
regs.a = 0;
regs.x = 0;
@ -719,19 +833,19 @@ void CpuSetupBenchmark ()
int opcode = 0;
do
{
*(mem+addr++) = benchopcode[opcode];
*(mem+addr++) = benchopcode[opcode];
WriteByteToMemory(addr++, benchopcode[opcode]);
WriteByteToMemory(addr++, benchopcode[opcode]);
if (opcode >= SHORTOPCODES)
*(mem+addr++) = 0;
WriteByteToMemory(addr++, 0);
if ((++opcode >= BENCHOPCODES) || ((addr & 0x0F) >= 0x0B))
{
*(mem+addr++) = 0x4C;
WriteByteToMemory(addr++, 0x4C);
// split into 2 lines to avoid -Wunsequenced and undefined behaviour
const BYTE value = (opcode >= BENCHOPCODES) ? 0x00 : ((addr >> 4)+1) << 4;
*(mem+addr++) = value;
*(mem+addr++) = 0x03;
WriteByteToMemory(addr++, value);
WriteByteToMemory(addr++, 0x03);
while (addr & 0x0F)
++addr;
}

View File

@ -30,7 +30,7 @@ extern unsigned __int64 g_nCumulativeCycles;
void CpuDestroy ();
void CpuCalcCycles(ULONG nExecutedCycles);
DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate);
uint32_t CpuExecute(const uint32_t uCycles, const bool bVideoUpdate);
ULONG CpuGetCyclesThisVideoFrame(ULONG nExecutedCycles);
void CpuCreateCriticalSection(void);
void CpuInitialize(void);

View File

@ -21,9 +21,64 @@ along with AppleWin; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// For regular or alternate (slow-path) CPU emulation
#ifndef CPU_ALT
// NB READ(x) and WRITE(x) are defined in the parent CPU.cpp.
// . but keep here to retain symmetry with the undef's at the end of this file.
//#define READ(addr) _READ(addr)
//#define WRITE(value) _WRITE(value)
#define BRK_NMOS _BRK_NMOS
#define BRK_CMOS _BRK_CMOS
#define JSR _JSR
#define POP _POP
#define PUSH(value) _PUSH(value)
#define ABS _ABS
#define IABSX _IABSX
#define ABSX_CONST _ABSX_CONST
#define ABSX_OPT _ABSX_OPT
#define ABSY_CONST _ABSY_CONST
#define ABSY_OPT _ABSY_OPT
#define IABS_CMOS _IABS_CMOS
#define IABS_NMOS _IABS_NMOS
#define INDX _INDX
#define INDX _INDX
#define INDY_CONST _INDY_CONST
#define INDY_OPT _INDY_OPT
#define IZPG _IZPG
#define REL _REL
#define ZPG _ZPG
#define ZPGX _ZPGX
#define ZPGY _ZPGY
#else
//#define READ(addr) _READ_ALT(addr)
//#define WRITE(value) _WRITE_ALT(value)
#define BRK_NMOS _BRK_NMOS_ALT
#define BRK_CMOS _BRK_CMOS_ALT
#define JSR _JSR_ALT
#define POP _POP_ALT
#define PUSH(value) _PUSH_ALT(value)
#define ABS _ABS_ALT
#define IABSX _IABSX_ALT
#define ABSX_CONST _ABSX_CONST_ALT
#define ABSX_OPT _ABSX_OPT_ALT
#define ABSY_CONST _ABSY_CONST_ALT
#define ABSY_OPT _ABSY_OPT_ALT
#define IABS_CMOS _IABS_CMOS_ALT
#define IABS_NMOS _IABS_NMOS_ALT
#define INDX _INDX_ALT
#define INDX _INDX_ALT
#define INDY_CONST _INDY_CONST_ALT
#define INDY_OPT _INDY_OPT_ALT
#define IZPG _IZPG_ALT
#define REL _REL_ALT
#define ZPG _ZPG_ALT
#define ZPGX _ZPGX_ALT
#define ZPGY _ZPGY_ALT
#endif
//===========================================================================
static DWORD Cpu6502(DWORD uTotalCycles, const bool bVideoUpdate)
static uint32_t Cpu6502(uint32_t uTotalCycles, const bool bVideoUpdate)
{
WORD addr;
BOOL flagc; // must always be 0 or 1, no other values allowed
@ -74,7 +129,7 @@ static DWORD Cpu6502(DWORD uTotalCycles, const bool bVideoUpdate)
case 0x09: IMM ORA CYC(2) break;
case 0x0A: asl CYC(2) break;
case 0x0B: IMM ANC CYC(2) break; // invalid
case 0x0C: ABSX_OPT NOP CYC(4) break; // invalid
case 0x0C: ABS NOP CYC(4) break; // invalid (GH#1360: ABS, not ABS,X)
case 0x0D: ABS ORA CYC(4) break;
case 0x0E: ABS ASLn CYC(6) break;
case 0x0F: ABS ASO CYC(6) break; // invalid
@ -339,3 +394,30 @@ static DWORD Cpu6502(DWORD uTotalCycles, const bool bVideoUpdate)
}
//===========================================================================
#undef CPU_ALT
#undef READ
#undef WRITE
#undef BRK_NMOS
#undef BRK_CMOS
#undef JSR
#undef POP
#undef PUSH
#undef ABS
#undef IABSX
#undef ABSX_CONST
#undef ABSX_OPT
#undef ABSY_CONST
#undef ABSY_OPT
#undef IABS_CMOS
#undef IABS_NMOS
#undef INDX
#undef INDX
#undef INDY_CONST
#undef INDY_OPT
#undef IZPG
#undef REL
#undef ZPG
#undef ZPGX
#undef ZPGY

View File

@ -21,9 +21,64 @@ along with AppleWin; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// For regular or alternate (slow-path) CPU emulation
#ifndef CPU_ALT
// NB READ(x) and WRITE(x) are defined in the parent CPU.cpp.
// . but keep here to retain symmetry with the undef's at the end of this file.
//#define READ(addr) _READ(addr)
//#define WRITE(value) _WRITE(value)
#define BRK_NMOS _BRK_NMOS
#define BRK_CMOS _BRK_CMOS
#define JSR _JSR
#define POP _POP
#define PUSH(value) _PUSH(value)
#define ABS _ABS
#define IABSX _IABSX
#define ABSX_CONST _ABSX_CONST
#define ABSX_OPT _ABSX_OPT
#define ABSY_CONST _ABSY_CONST
#define ABSY_OPT _ABSY_OPT
#define IABS_CMOS _IABS_CMOS
#define IABS_NMOS _IABS_NMOS
#define INDX _INDX
#define INDX _INDX
#define INDY_CONST _INDY_CONST
#define INDY_OPT _INDY_OPT
#define IZPG _IZPG
#define REL _REL
#define ZPG _ZPG
#define ZPGX _ZPGX
#define ZPGY _ZPGY
#else
//#define READ(addr) _READ_ALT(addr)
//#define WRITE(value) _WRITE_ALT(value)
#define BRK_NMOS _BRK_NMOS_ALT
#define BRK_CMOS _BRK_CMOS_ALT
#define JSR _JSR_ALT
#define POP _POP_ALT
#define PUSH(value) _PUSH_ALT(value)
#define ABS _ABS_ALT
#define IABSX _IABSX_ALT
#define ABSX_CONST _ABSX_CONST_ALT
#define ABSX_OPT _ABSX_OPT_ALT
#define ABSY_CONST _ABSY_CONST_ALT
#define ABSY_OPT _ABSY_OPT_ALT
#define IABS_CMOS _IABS_CMOS_ALT
#define IABS_NMOS _IABS_NMOS_ALT
#define INDX _INDX_ALT
#define INDX _INDX_ALT
#define INDY_CONST _INDY_CONST_ALT
#define INDY_OPT _INDY_OPT_ALT
#define IZPG _IZPG_ALT
#define REL _REL_ALT
#define ZPG _ZPG_ALT
#define ZPGX _ZPGX_ALT
#define ZPGY _ZPGY_ALT
#endif
//===========================================================================
static DWORD Cpu65C02(DWORD uTotalCycles, const bool bVideoUpdate)
static uint32_t Cpu65C02(uint32_t uTotalCycles, const bool bVideoUpdate)
{
WORD addr;
BOOL flagc; // must always be 0 or 1, no other values allowed
@ -339,3 +394,30 @@ static DWORD Cpu65C02(DWORD uTotalCycles, const bool bVideoUpdate)
}
//===========================================================================
#undef CPU_ALT
#undef READ
#undef WRITE
#undef BRK_NMOS
#undef BRK_CMOS
#undef JSR
#undef POP
#undef PUSH
#undef ABS
#undef IABSX
#undef ABSX_CONST
#undef ABSX_OPT
#undef ABSY_CONST
#undef ABSY_OPT
#undef IABS_CMOS
#undef IABS_NMOS
#undef INDX
#undef INDX
#undef INDY_CONST
#undef INDY_OPT
#undef IZPG
#undef REL
#undef ZPG
#undef ZPGX
#undef ZPGY

View File

@ -35,8 +35,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#undef AF_TO_EF
#undef EF_TO_AF
#define AF_TO_EF flagc = (regs.ps & AF_CARRY); \
flagn = (regs.ps & AF_SIGN); \
flagv = (regs.ps & AF_OVERFLOW); \
@ -50,34 +48,71 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
| AF_RESERVED | AF_BREAK;
// CYC(a): This can be optimised, as only certain opcodes will affect uExtraCycles
#define CYC(a) uExecutedCycles += (a)+uExtraCycles;
#define POP (*(mem+((regs.sp >= 0x1FF) ? (regs.sp = 0x100) : ++regs.sp)))
#define PUSH(a) *(mem+regs.sp--) = (a); \
if (regs.sp < 0x100) \
regs.sp = 0x1FF;
#define _READ ( \
((addr & 0xF000) == 0xC000) \
#define _POP (*(mem+((regs.sp >= _6502_STACK_END) ? (regs.sp = _6502_STACK_BEGIN) : ++regs.sp)))
#define _POP_ALT ( /*TODO: Support reads from IO & Floating bus*/\
*(memshadow[_6502_STACK_PAGE]-_6502_STACK_BEGIN+((regs.sp >= _6502_STACK_END) ? (regs.sp = _6502_STACK_BEGIN) : ++regs.sp)) \
)
#define _PUSH(a) *(mem+regs.sp--) = (a); \
if (regs.sp < _6502_STACK_BEGIN) \
regs.sp = _6502_STACK_END;
#define _PUSH_ALT(a) { \
LPBYTE page = memwrite[_6502_STACK_PAGE]; \
if (page) { \
*(page+(regs.sp & 0xFF)) = (BYTE)(a); \
} \
regs.sp--; \
if (regs.sp < _6502_STACK_BEGIN) \
regs.sp = _6502_STACK_END; \
}
#define _READ(addr) ( \
((addr & 0xF000) == APPLE_IO_BEGIN) \
? IORead[(addr>>4) & 0xFF](regs.pc,addr,0,0,uExecutedCycles) \
: *(mem+addr) \
)
#define _READ_WITH_IO_F8xx ( /* GH#827 */\
((addr & 0xF000) == 0xC000) \
#define _READ_ALT(addr) ( \
(memreadPageType[addr >> 8] == MEM_Normal) \
? *(memshadow[addr >> 8]+(addr&0xff)) \
: (memreadPageType[addr >> 8] == MEM_IORead) \
? IORead[(addr >> 4) & 0xFF](regs.pc, addr, 0, 0, uExecutedCycles) \
: MemReadFloatingBus(uExecutedCycles) \
)
#define _READ_WITH_IO_F8xx(addr) ( /* GH#827 */\
((addr & 0xF000) == APPLE_IO_BEGIN) \
? IORead[(addr>>4) & 0xFF](regs.pc,addr,0,0,uExecutedCycles) \
: (addr >= 0xF800) \
? IO_F8xx(regs.pc,addr,0,0,uExecutedCycles) \
: *(mem+addr) \
)
#define SETNZ(a) { \
flagn = ((a) & 0x80); \
flagz = !((a) & 0xFF); \
}
#define SETZ(a) flagz = !((a) & 0xFF);
#define _WRITE(a) { \
{ \
memdirty[addr >> 8] = 0xFF; \
LPBYTE page = memwrite[addr >> 8]; \
if (page) \
*(page+(addr & 0xFF)) = (BYTE)(a); \
else if ((addr & 0xF000) == 0xC000) \
else if ((addr & 0xF000) == APPLE_IO_BEGIN) \
IOWrite[(addr>>4) & 0xFF](regs.pc,addr,1,(BYTE)(a),uExecutedCycles);\
} \
}
#define _WRITE_ALT(a) { \
{ \
memdirty[addr >> 8] = 0xFF; \
LPBYTE page = memwrite[addr >> 8]; \
if (page) { \
*(page+(addr & 0xFF)) = (BYTE)(a); \
if (memVidHD) /* GH#997 */\
*(memVidHD + addr) = (BYTE)(a); \
} \
else if ((addr & 0xF000) == APPLE_IO_BEGIN) \
IOWrite[(addr>>4) & 0xFF](regs.pc,addr,1,(BYTE)(a),uExecutedCycles);\
} \
}
@ -92,7 +127,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
if (memVidHD) /* GH#997 */\
*(memVidHD + addr) = (BYTE)(a); \
} \
else if ((addr & 0xF000) == 0xC000) \
else if ((addr & 0xF000) == APPLE_IO_BEGIN) \
IOWrite[(addr>>4) & 0xFF](regs.pc,addr,1,(BYTE)(a),uExecutedCycles);\
} \
}
@ -119,95 +154,154 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define CHECK_PAGE_CHANGE if ((base ^ addr) & 0xFF00) \
uExtraCycles=1;
#define READ_BYTE_ALT(pc) _READ_ALT(pc)
#define READ_WORD_ALT(pc) (_READ_ALT(pc) | (_READ_ALT((pc+1))<<8))
/****************************************************************************
*
* ADDRESSING MODE MACROS
*
***/
#define ABS addr = *(LPWORD)(mem+regs.pc); regs.pc += 2;
#define IABSX addr = *(LPWORD)(mem+(*(LPWORD)(mem+regs.pc))+(WORD)regs.x); regs.pc += 2;
#define _ABS addr = *(LPWORD)(mem+regs.pc); regs.pc += 2;
#define _ABS_ALT \
addr = READ_WORD_ALT(regs.pc); \
regs.pc += 2;
#define _IABSX addr = *(LPWORD)(mem+(*(LPWORD)(mem+regs.pc))+(WORD)regs.x); regs.pc += 2;
#define _IABSX_ALT \
base = READ_WORD_ALT(regs.pc) + (WORD)regs.x; \
addr = READ_WORD_ALT(base); \
regs.pc += 2;
// Not optimised for page-cross
#define _ABSX_CONST base = *(LPWORD)(mem+regs.pc); addr = base+(WORD)regs.x; regs.pc += 2;
#define _ABSX_CONST_ALT \
base = READ_WORD_ALT(regs.pc); \
addr = base + (WORD)regs.x; \
regs.pc += 2;
// Optimised for page-cross
#define ABSX_OPT base = *(LPWORD)(mem+regs.pc); addr = base+(WORD)regs.x; regs.pc += 2; CHECK_PAGE_CHANGE;
#define _ABSX_OPT _ABSX_CONST; CHECK_PAGE_CHANGE;
#define _ABSX_OPT_ALT _ABSX_CONST_ALT; CHECK_PAGE_CHANGE;
// Not optimised for page-cross
#define ABSX_CONST base = *(LPWORD)(mem+regs.pc); addr = base+(WORD)regs.x; regs.pc += 2;
#define _ABSY_CONST base = *(LPWORD)(mem+regs.pc); addr = base+(WORD)regs.y; regs.pc += 2;
#define _ABSY_CONST_ALT \
base = READ_WORD_ALT(regs.pc); \
addr = base + (WORD)regs.y; \
regs.pc += 2;
// Optimised for page-cross
#define ABSY_OPT base = *(LPWORD)(mem+regs.pc); addr = base+(WORD)regs.y; regs.pc += 2; CHECK_PAGE_CHANGE;
// Not optimised for page-cross
#define ABSY_CONST base = *(LPWORD)(mem+regs.pc); addr = base+(WORD)regs.y; regs.pc += 2;
#define _ABSY_OPT _ABSY_CONST; CHECK_PAGE_CHANGE;
#define _ABSY_OPT_ALT _ABSY_CONST_ALT; CHECK_PAGE_CHANGE;
// TODO Optimization Note (just for IABSCMOS): uExtraCycles = ((base & 0xFF) + 1) >> 8;
#define IABS_CMOS base = *(LPWORD)(mem+regs.pc); \
addr = *(LPWORD)(mem+base); \
if ((base & 0xFF) == 0xFF) uExtraCycles=1; \
#define _IABS_CMOS base = *(LPWORD)(mem+regs.pc); \
addr = *(LPWORD)(mem+base); \
if ((base & 0xFF) == 0xFF) uExtraCycles=1; \
regs.pc += 2;
#define IABS_NMOS base = *(LPWORD)(mem+regs.pc); \
if ((base & 0xFF) == 0xFF) \
addr = *(mem+base)+((WORD)*(mem+(base&0xFF00))<<8);\
#define _IABS_CMOS_ALT \
base = READ_WORD_ALT(regs.pc); \
addr = READ_WORD_ALT(base); \
if ((base & 0xFF) == 0xFF) uExtraCycles=1; \
regs.pc += 2;
#define _IABS_NMOS base = *(LPWORD)(mem+regs.pc); \
if ((base & 0xFF) == 0xFF) \
addr = *(mem+base)+((WORD)*(mem+(base&0xFF00))<<8); \
else \
addr = *(LPWORD)(mem+base); \
addr = *(LPWORD)(mem+base); \
regs.pc += 2;
#define _IABS_NMOS_ALT \
base = READ_WORD_ALT(regs.pc); \
if ((base & 0xFF) == 0xFF) \
addr = READ_BYTE_ALT(base) | (READ_BYTE_ALT((base&0xFF00))<<8); /* NB. Requires double-parenthesis for 2nd macro */\
else \
addr = READ_WORD_ALT(base); \
regs.pc += 2;
#define IMM addr = regs.pc++;
#define INDX base = ((*(mem+regs.pc++))+regs.x) & 0xFF; \
if (base == 0xFF) \
addr = *(mem+0xFF)+(((WORD)*mem)<<8); \
else \
#define _INDX base = ((*(mem+regs.pc++))+regs.x) & 0xFF; \
if (base == 0xFF) \
addr = *(mem+0xFF)+(((WORD)*mem)<<8); \
else \
addr = *(LPWORD)(mem+base);
#define _INDX_ALT \
base = (READ_BYTE_ALT(regs.pc)+regs.x) & 0xFF; regs.pc++; \
if (base == 0xFF) \
addr = READ_BYTE_ALT(0xFF) | (READ_BYTE_ALT(0x00)<<8); \
else \
addr = READ_WORD_ALT(base);
// Not optimised for page-cross
#define _INDY_CONST if (*(mem+regs.pc) == 0xFF) /*no extra cycle for page-crossing*/ \
base = *(mem+0xFF)+(((WORD)*mem)<<8); \
else \
base = *(LPWORD)(mem+*(mem+regs.pc)); \
regs.pc++; \
addr = base+(WORD)regs.y;
#define _INDY_CONST_ALT \
base = READ_BYTE_ALT(regs.pc); \
if (base == 0xFF) \
base = READ_BYTE_ALT(0xFF) | (READ_BYTE_ALT(0x00)<<8); \
else \
base = READ_WORD_ALT(base); \
regs.pc++; \
addr = base+(WORD)regs.y;
// Optimised for page-cross
#define INDY_OPT if (*(mem+regs.pc) == 0xFF) /*incurs an extra cycle for page-crossing*/ \
base = *(mem+0xFF)+(((WORD)*mem)<<8); \
else \
base = *(LPWORD)(mem+*(mem+regs.pc)); \
regs.pc++; \
addr = base+(WORD)regs.y; \
CHECK_PAGE_CHANGE;
// Not optimised for page-cross
#define INDY_CONST if (*(mem+regs.pc) == 0xFF) /*no extra cycle for page-crossing*/ \
base = *(mem+0xFF)+(((WORD)*mem)<<8); \
else \
base = *(LPWORD)(mem+*(mem+regs.pc)); \
regs.pc++; \
addr = base+(WORD)regs.y;
#define _INDY_OPT _INDY_CONST; CHECK_PAGE_CHANGE;
#define _INDY_OPT_ALT _INDY_CONST_ALT; CHECK_PAGE_CHANGE;
#define IZPG base = *(mem+regs.pc++); \
if (base == 0xFF) \
addr = *(mem+0xFF)+(((WORD)*mem)<<8); \
else \
#define _IZPG base = *(mem+regs.pc++); \
if (base == 0xFF) \
addr = *(mem+0xFF)+(((WORD)*mem)<<8); \
else \
addr = *(LPWORD)(mem+base);
#define _IZPG_ALT \
base = READ_BYTE_ALT(regs.pc); regs.pc++; \
if (base == 0xFF) \
addr = READ_BYTE_ALT(0xFF) | (READ_BYTE_ALT(0x00)<<8); \
else \
addr = READ_WORD_ALT(base);
#define REL addr = (signed char)*(mem+regs.pc++);
#define _REL addr = (signed char)*(mem+regs.pc++);
#define _REL_ALT addr = (signed char)READ_BYTE_ALT(regs.pc); regs.pc++;
// TODO Optimization Note:
// . Opcodes that generate zero-page addresses can't be accessing $C000..$CFFF
// so they could be paired with special READZP/WRITEZP macros (instead of READ/WRITE)
#define ZPG addr = *(mem+regs.pc++);
#define ZPGX addr = ((*(mem+regs.pc++))+regs.x) & 0xFF;
#define ZPGY addr = ((*(mem+regs.pc++))+regs.y) & 0xFF;
#define _ZPG addr = *(mem+regs.pc++);
#define _ZPGX addr = ((*(mem+regs.pc++))+regs.x) & 0xFF;
#define _ZPGY addr = ((*(mem+regs.pc++))+regs.y) & 0xFF;
// Tidy 3 char addressing modes to keep the opcode table visually aligned, clean, and readable.
#define _ZPG_ALT addr = READ_BYTE_ALT(regs.pc); regs.pc++;
#define _ZPGX_ALT addr = (READ_BYTE_ALT(regs.pc) + regs.x) & 0xFF; regs.pc++;
#define _ZPGY_ALT addr = (READ_BYTE_ALT(regs.pc) + regs.y) & 0xFF; regs.pc++;
// Tidy 3 char opcodes & addressing modes to keep the opcode table visually aligned, clean, and readable.
#undef asl
#undef lsr
#undef rol
#undef ror
#define asl ASLA
#define lsr LSRA
#define rol ROLA
#define ror RORA
#undef idx
#undef imm
#undef izp
#undef lsr
#undef rel
#undef rol
#undef ror
#undef zpx
#undef zpy
#define asl ASLA // Arithmetic Shift Left
#define idx INDX
#define imm IMM
#define izp IZPG
#define lsr LSRA // Logical Shift Right
#define rel REL
#define rol ROLA // Rotate Left
#define ror RORA // Rotate Right
#define zpx ZPGX
#define zpy ZPGY

View File

@ -50,13 +50,13 @@ inline void Heatmap_X(uint16_t address)
inline uint8_t Heatmap_ReadByte(uint16_t addr, int uExecutedCycles)
{
Heatmap_R(addr);
return _READ;
return _READ(addr);
}
inline uint8_t Heatmap_ReadByte_With_IO_F8xx(uint16_t addr, int uExecutedCycles)
{
Heatmap_R(addr);
return _READ_WITH_IO_F8xx;
return _READ_WITH_IO_F8xx(addr);
}
inline void Heatmap_WriteByte(uint16_t addr, uint16_t value, int uExecutedCycles)

View File

@ -173,7 +173,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// ==========
#define ADC_NMOS /*bSlowerOnPagecross = 1;*/ \
temp = READ; \
temp = READ(addr); \
if (regs.ps & AF_DECIMAL) { \
val = (regs.a & 0x0F) + (temp & 0x0F) + flagc; \
if (val > 0x09) \
@ -199,7 +199,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SETNZ(regs.a); \
}
#define ADC_CMOS /*bSlowerOnPagecross = 1*/; \
temp = READ; \
temp = READ(addr); \
flagv = !((regs.a ^ temp) & 0x80); \
if (regs.ps & AF_DECIMAL) { \
uExtraCycles++; \
@ -232,18 +232,18 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
} \
regs.a = val & 0xFF; \
SETNZ(regs.a)
#define ALR regs.a &= READ; \
#define ALR regs.a &= READ(addr); \
flagc = (regs.a & 1); \
flagn = 0; \
regs.a >>= 1; \
SETZ(regs.a)
#define AND /*bSlowerOnPagecross = 1;*/ \
regs.a &= READ; \
regs.a &= READ(addr); \
SETNZ(regs.a)
#define ANC regs.a &= READ; \
#define ANC regs.a &= READ(addr); \
SETNZ(regs.a) \
flagc = !!flagn;
#define ARR temp = regs.a & READ; /* Yes, this is sick */ \
#define ARR temp = regs.a & READ(addr); /* Yes, this is sick */ \
if (regs.ps & AF_DECIMAL) { \
val = temp; \
val |= (flagc ? 0x100 : 0); \
@ -270,12 +270,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
regs.a = (val & 0xFF); \
}
#define ASL_NMOS /*bSlowerOnPagecross = 0;*/ \
val = READ << 1; \
val = READ(addr) << 1; \
flagc = (val > 0xFF); \
SETNZ(val) \
WRITE(val)
#define ASL_CMOS /*bSlowerOnPagecross = 1*/; \
val = READ << 1; \
val = READ(addr) << 1; \
flagc = (val > 0xFF); \
SETNZ(val) \
WRITE(val)
@ -284,7 +284,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SETNZ(val) \
regs.a = (BYTE)val;
#define ASO /*bSlowerOnPagecross = 0;*/ \
val = READ << 1; \
val = READ(addr) << 1; \
flagc = (val > 0xFF); \
WRITE(val) \
regs.a |= val; \
@ -299,30 +299,45 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define BCS if ( flagc) BRANCH_TAKEN;
#define BEQ if ( flagz) BRANCH_TAKEN;
#define BIT /*bSlowerOnPagecross = 1;*/ \
val = READ; \
val = READ(addr); \
flagz = !(regs.a & val); \
flagn = val & 0x80; \
flagv = val & 0x40;
#define BITI flagz = !(regs.a & READ);
#define BITI flagz = !(regs.a & READ(addr));
#define BMI if ( flagn) BRANCH_TAKEN;
#define BNE if (!flagz) BRANCH_TAKEN;
#define BPL if (!flagn) BRANCH_TAKEN;
#define BRA BRANCH_TAKEN;
#define BRK_NMOS regs.pc++; \
#define _BRK_NMOS regs.pc++; \
PUSH(regs.pc >> 8) \
PUSH(regs.pc & 0xFF) \
EF_TO_AF \
PUSH(regs.ps); \
regs.ps |= AF_INTERRUPT; \
regs.pc = *(LPWORD)(mem+0xFFFE);
#define BRK_CMOS regs.pc++; \
regs.pc = *(LPWORD)(mem+_6502_INTERRUPT_VECTOR);
#define _BRK_NMOS_ALT regs.pc++; \
PUSH(regs.pc >> 8) \
PUSH(regs.pc & 0xFF) \
EF_TO_AF \
PUSH(regs.ps); \
regs.ps |= AF_INTERRUPT; \
regs.pc = READ_WORD_ALT(_6502_INTERRUPT_VECTOR);
#define _BRK_CMOS regs.pc++; \
PUSH(regs.pc >> 8) \
PUSH(regs.pc & 0xFF) \
EF_TO_AF \
PUSH(regs.ps); \
regs.ps |= AF_INTERRUPT; \
regs.ps &= ~AF_DECIMAL; /*CMOS clears D flag*/ \
regs.pc = *(LPWORD)(mem+0xFFFE);
regs.pc = *(LPWORD)(mem+_6502_INTERRUPT_VECTOR);
#define _BRK_CMOS_ALT regs.pc++; \
PUSH(regs.pc >> 8) \
PUSH(regs.pc & 0xFF) \
EF_TO_AF \
PUSH(regs.ps); \
regs.ps |= AF_INTERRUPT; \
regs.ps &= ~AF_DECIMAL; /*CMOS clears D flag*/ \
regs.pc = READ_WORD_ALT(_6502_INTERRUPT_VECTOR);
#define BVC if (!flagv) BRANCH_TAKEN;
#define BVS if ( flagv) BRANCH_TAKEN;
#define CLC flagc = 0;
@ -330,20 +345,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define CLI regs.ps &= ~AF_INTERRUPT;
#define CLV flagv = 0;
#define CMP /*bSlowerOnPagecross = 1;*/ \
val = READ; \
val = READ(addr); \
flagc = (regs.a >= val); \
val = regs.a-val; \
SETNZ(val)
#define CPX val = READ; \
#define CPX val = READ(addr); \
flagc = (regs.x >= val); \
val = regs.x-val; \
SETNZ(val)
#define CPY val = READ; \
#define CPY val = READ(addr); \
flagc = (regs.y >= val); \
val = regs.y-val; \
SETNZ(val)
#define DCM /*bSlowerOnPagecross = 0;*/ \
val = READ-1; \
val = READ(addr)-1; \
WRITE(val) \
flagc = (regs.a >= val); \
val = regs.a-val; \
@ -351,7 +366,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define DEA --regs.a; \
SETNZ(regs.a)
#define DEC /*bSlowerOnPagecross = 0;*/ \
val = READ-1; \
val = READ(addr)-1; \
SETNZ(val) \
WRITE(val)
#define DEX --regs.x; \
@ -359,18 +374,18 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define DEY --regs.y; \
SETNZ(regs.y)
#define EOR /*bSlowerOnPagecross = 1;*/ \
regs.a ^= READ; \
regs.a ^= READ(addr); \
SETNZ(regs.a)
#define HLT regs.bJammed = 1; \
--regs.pc;
#define INA ++regs.a; \
SETNZ(regs.a)
#define INC /*bSlowerOnPagecross = 0;*/ \
val = READ+1; \
val = READ(addr)+1; \
SETNZ(val) \
WRITE(val)
#define INS /*bSlowerOnPagecross = 0;*/ \
val = READ+1; \
val = READ(addr)+1; \
WRITE(val) \
temp = val; \
temp2 = regs.a - temp - !flagc; \
@ -400,45 +415,51 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define INY ++regs.y; \
SETNZ(regs.y)
#define JMP regs.pc = addr;
#define JSR addr = *(LPBYTE)(mem+regs.pc); regs.pc++; \
#define _JSR addr = *(LPBYTE)(mem+regs.pc); regs.pc++; \
PUSH(regs.pc >> 8) \
PUSH(regs.pc & 0xFF) \
regs.pc = addr | (*(LPBYTE)(mem+regs.pc)) << 8; /* GH#1257 */
#define _JSR_ALT \
addr = READ_BYTE_ALT(regs.pc); \
regs.pc++; \
PUSH(regs.pc >> 8) \
PUSH(regs.pc & 0xFF) \
regs.pc = addr | READ_BYTE_ALT(regs.pc) << 8; /* GH#1257 */
#define LAS /*bSlowerOnPagecross = 1*/; \
val = (BYTE)(READ & regs.sp); \
val = (BYTE)(READ(addr) & regs.sp); \
regs.a = regs.x = (BYTE) val; \
regs.sp = val | 0x100; \
SETNZ(val)
#define LAX /*bSlowerOnPagecross = 1;*/ \
regs.a = regs.x = READ; \
regs.a = regs.x = READ(addr); \
SETNZ(regs.a)
#define LDA /*bSlowerOnPagecross = 1;*/ \
regs.a = READ; \
regs.a = READ(addr); \
SETNZ(regs.a)
#define LDD /*Undocumented 65C02: LoaD and Discard*/ \
READ;
READ(addr);
#define LDX /*bSlowerOnPagecross = 1;*/ \
regs.x = READ; \
regs.x = READ(addr); \
SETNZ(regs.x)
#define LDY /*bSlowerOnPagecross = 1;*/ \
regs.y = READ; \
regs.y = READ(addr); \
SETNZ(regs.y)
#define LSE /*bSlowerOnPagecross = 0;*/ \
val = READ; \
val = READ(addr); \
flagc = (val & 1); \
val >>= 1; \
WRITE(val) \
regs.a ^= val; \
SETNZ(regs.a)
#define LSR_NMOS /*bSlowerOnPagecross = 0;*/ \
val = READ; \
val = READ(addr); \
flagc = (val & 1); \
flagn = 0; \
val >>= 1; \
SETZ(val) \
WRITE(val)
#define LSR_CMOS /*bSlowerOnPagecross = 1;*/ \
val = READ; \
val = READ(addr); \
flagc = (val & 1); \
flagn = 0; \
val >>= 1; \
@ -450,11 +471,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SETZ(regs.a)
#define NOP /*bSlowerOnPagecross = 1;*/
#define OAL regs.a |= 0xEE; \
regs.a &= READ; \
regs.a &= READ(addr); \
regs.x = regs.a; \
SETNZ(regs.a)
#define ORA /*bSlowerOnPagecross = 1;*/ \
regs.a |= READ; \
regs.a |= READ(addr); \
SETNZ(regs.a)
#define PHA PUSH(regs.a)
#define PHP EF_TO_AF \
@ -470,18 +491,18 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define PLY regs.y = POP; \
SETNZ(regs.y)
#define RLA /*bSlowerOnPagecross = 0;*/ \
val = (READ << 1) | flagc; \
val = (READ(addr) << 1) | flagc; \
flagc = (val > 0xFF); \
WRITE(val) \
regs.a &= val; \
SETNZ(regs.a)
#define ROL_NMOS /*bSlowerOnPagecross = 0;*/ \
val = (READ << 1) | flagc; \
val = (READ(addr) << 1) | flagc; \
flagc = (val > 0xFF); \
SETNZ(val) \
WRITE(val)
#define ROL_CMOS /*bSlowerOnPagecross = 1;*/ \
val = (READ << 1) | flagc; \
val = (READ(addr) << 1) | flagc; \
flagc = (val > 0xFF); \
SETNZ(val) \
WRITE(val)
@ -490,13 +511,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
regs.a = val & 0xFF; \
SETNZ(regs.a);
#define ROR_NMOS /*bSlowerOnPagecross = 0;*/ \
temp = READ; \
temp = READ(addr); \
val = (temp >> 1) | (flagc ? 0x80 : 0); \
flagc = (temp & 1); \
SETNZ(val) \
WRITE(val)
#define ROR_CMOS /*bSlowerOnPagecross = 1;*/ \
temp = READ; \
temp = READ(addr); \
val = (temp >> 1) | (flagc ? 0x80 : 0); \
flagc = (temp & 1); \
SETNZ(val) \
@ -506,7 +527,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
regs.a = val & 0xFF; \
SETNZ(regs.a)
#define RRA /*bSlowerOnPagecross = 0;*/ \
temp = READ; \
temp = READ(addr); \
val = (temp >> 1) | (flagc ? 0x80 : 0); \
flagc = (temp & 1); \
WRITE(val) \
@ -543,7 +564,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
regs.pc |= (((WORD)POP) << 8); \
++regs.pc;
#define SAX temp = regs.a & regs.x; \
val = READ; \
val = READ(addr); \
flagc = (temp >= val); \
regs.x = temp-val; \
SETNZ(regs.x)
@ -552,7 +573,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
ON_PAGECROSS_REPLACE_HI_ADDR \
WRITE(val)
#define SBC_NMOS /*bSlowerOnPagecross = 1;*/ \
temp = READ; \
temp = READ(addr); \
temp2 = regs.a - temp - !flagc; \
if (regs.ps & AF_DECIMAL) { \
val = (regs.a & 0x0F) - (temp & 0x0F) - !flagc; \
@ -576,7 +597,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SETNZ(regs.a); \
}
#define SBC_CMOS /*bSlowerOnPagecross = 1;*/ \
temp = READ; \
temp = READ(addr); \
flagv = ((regs.a ^ temp) & 0x80); \
if (regs.ps & AF_DECIMAL) { \
uExtraCycles++; \
@ -640,12 +661,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define TAY regs.y = regs.a; \
SETNZ(regs.y)
#define TRB /*bSlowerOnPagecross = 0;*/ \
val = READ; \
val = READ(addr); \
flagz = !(regs.a & val); \
val &= ~regs.a; \
WRITE(val)
#define TSB /*bSlowerOnPagecross = 0;*/ \
val = READ; \
val = READ(addr); \
flagz = !(regs.a & val); \
val |= regs.a; \
WRITE(val)
@ -657,7 +678,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define TYA regs.a = regs.y; \
SETNZ(regs.a)
#define XAA regs.a = regs.x; \
regs.a &= READ; \
regs.a &= READ(addr); \
SETNZ(regs.a)
#define XAS /*bSlowerOnPagecross = 0;*/ \
val = regs.x & (((base >> 8) + 1) & 0xFF); \

View File

@ -219,10 +219,17 @@ void CardManager::InsertAuxInternal(SS_CARDTYPE type)
RemoveAux(); // creates a new EmptyCard
}
void CardManager::InsertAux(SS_CARDTYPE type)
void CardManager::InsertAux(SS_CARDTYPE type, bool updateRegistry/*=true*/)
{
InsertAuxInternal(type);
RegSetConfigSlotNewCardType(SLOT_AUX, type);
if (updateRegistry)
{
if (type != CT_RamWorksIII)
SetRamWorksMemorySize(1, false); // 1x 64K bank for Empty/80Col/Extended80Col cards
RegSetConfigSlotNewCardType(SLOT_AUX, type);
SetRegistryAuxNumberOfBanks();
}
}
void CardManager::RemoveAuxInternal()

View File

@ -45,7 +45,7 @@ public:
return m_slot[slot];
}
void InsertAux(SS_CARDTYPE type);
void InsertAux(SS_CARDTYPE type, bool updateRegistry = true);
void RemoveAux(void);
SS_CARDTYPE QueryAux(void) { return m_aux->QueryType(); }
Card* GetObjAux(void) { _ASSERT(0); return m_aux; } // ASSERT because this is a DummyCard

View File

@ -178,64 +178,84 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
lpCmdLine = GetCurrArg(lpNextArg);
lpNextArg = GetNextArg(lpNextArg);
if (strcmp(lpCmdLine, "empty") == 0)
{
g_cmdLine.bSlotEmpty[slot] = true;
if (strcmp(lpCmdLine, "diskii") == 0)
}
else if (strcmp(lpCmdLine, "diskii") == 0)
{
g_cmdLine.slotInsert[slot] = CT_Disk2;
if (strcmp(lpCmdLine, "diskii13") == 0)
}
else if (strcmp(lpCmdLine, "diskii13") == 0)
{
g_cmdLine.slotInsert[slot] = CT_Disk2;
g_cmdLine.slotInfo[slot].isDiskII13 = true;
}
if (strcmp(lpCmdLine, "hdc") == 0)
else if (strcmp(lpCmdLine, "hdc") == 0)
{
g_cmdLine.slotInsert[slot] = CT_GenericHDD;
if (strcmp(lpCmdLine, "hdc-sp") == 0)
}
else if (strcmp(lpCmdLine, "hdc-sp") == 0)
{
g_cmdLine.slotInsert[slot] = CT_GenericHDD;
g_cmdLine.slotInfo[slot].useHdcFirmwareMode = HdcSmartPort;
}
if (strcmp(lpCmdLine, "hdc-bm2") == 0)
else if (strcmp(lpCmdLine, "hdc-bm2") == 0)
{
g_cmdLine.slotInsert[slot] = CT_GenericHDD;
g_cmdLine.slotInfo[slot].useHdcFirmwareMode = HdcBlockMode2Devices;
}
if (strcmp(lpCmdLine, "hdc-bm4") == 0)
else if (strcmp(lpCmdLine, "hdc-bm4") == 0)
{
g_cmdLine.slotInsert[slot] = CT_GenericHDD;
g_cmdLine.slotInfo[slot].useHdcFirmwareMode = HdcBlockMode4Devices;
}
if (strcmp(lpCmdLine, "saturn") == 0 || strcmp(lpCmdLine, "saturn128") == 0) // Support Saturn128 card in slot 1-7 too (GH#1279)
else if (strcmp(lpCmdLine, "saturn") == 0 || strcmp(lpCmdLine, "saturn128") == 0) // Support Saturn128 card in slot 1-7 too (GH#1279)
{
g_cmdLine.slotInsert[slot] = CT_Saturn128K;
if (strcmp(lpCmdLine, "megaaudio") == 0)
}
else if (strcmp(lpCmdLine, "megaaudio") == 0)
{
g_cmdLine.slotInsert[slot] = CT_MegaAudio;
g_cmdLine.supportExtraMBCardTypes = true;
}
if (strcmp(lpCmdLine, "sdmusic") == 0)
else if (strcmp(lpCmdLine, "sdmusic") == 0)
{
g_cmdLine.slotInsert[slot] = CT_SDMusic;
g_cmdLine.supportExtraMBCardTypes = true;
}
if (strcmp(lpCmdLine, "parallel") == 0)
else if (strcmp(lpCmdLine, "6522a-bad") == 0)
{
g_cmdLine.slotInfo[slot].useBad6522A = true;
}
else if (strcmp(lpCmdLine, "6522b-bad") == 0)
{
g_cmdLine.slotInfo[slot].useBad6522B = true;
}
else if (strcmp(lpCmdLine, "parallel") == 0)
{
if (slot == SLOT1)
g_cmdLine.slotInsert[slot] = CT_GenericPrinter;
else
LogFileOutput("Parallel Printer card currently only supported in slot 1\n");
}
if (strcmp(lpCmdLine, "ssc") == 0)
else if (strcmp(lpCmdLine, "ssc") == 0)
{
if (slot == SLOT2)
g_cmdLine.slotInsert[slot] = CT_SSC;
else
LogFileOutput("SSC currently only supported in slot 2\n");
}
if (strcmp(lpCmdLine, "vidhd") == 0)
else if (strcmp(lpCmdLine, "vidhd") == 0)
{
if (slot == SLOT3)
g_cmdLine.slotInsert[slot] = CT_VidHD;
else
LogFileOutput("VidHD currently only supported in slot 3\n");
}
else
{
LogFileOutput("Unsupported slot-%d card: %s\n", slot, lpCmdLine);
}
}
else if (lpCmdLine[3] == 'd' && (lpCmdLine[4] == '1' || lpCmdLine[4] == '2')) // -s[1..7]d[1|2] <dsk-image>
{
@ -277,6 +297,33 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
LogFileOutput("Unsupported arg: %s\n", lpCmdLine);
}
}
else if (strcmp(lpCmdLine, "-aux") == 0)
{
lpCmdLine = GetCurrArg(lpNextArg);
lpNextArg = GetNextArg(lpNextArg);
if (strcmp(lpCmdLine, "empty") == 0)
{
g_cmdLine.auxSlotEmpty = true;
}
else if (strcmp(lpCmdLine, "std80") == 0)
{
g_cmdLine.auxSlotInsert = CT_80Col;
}
else if (strcmp(lpCmdLine, "ext80") == 0)
{
g_cmdLine.auxSlotInsert = CT_Extended80Col;
}
else if (strcmp(lpCmdLine, "rw3") == 0)
{
g_cmdLine.auxSlotInsert = CT_RamWorksIII;
if (!g_cmdLine.uRamWorksExPages)
g_cmdLine.uRamWorksExPages = kDefaultExMemoryBanksRealRW3;
}
else
{
LogFileOutput("Unsupported aux slot card: %s\n", lpCmdLine);
}
}
else if (strcmp(lpCmdLine, "-harddisknumblocks") == 0) // number of blocks to report for ProDOS
{
lpCmdLine = GetCurrArg(lpNextArg);
@ -298,6 +345,10 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
lpNextArg = GetNextArg(lpNextArg);
g_cmdLine.szSnapshotName = lpCmdLine;
}
else if (strcmp(lpCmdLine, "-load-state-ignore-hdc-fw") == 0) // For testing - Use in combination with -load-state
{
g_cmdLine.snapshotIgnoreHdcFirmware = true;
}
else if (strcmp(lpCmdLine, "-f") == 0 || strcmp(lpCmdLine, "-full-screen") == 0)
{
g_cmdLine.setFullScreen = 1;
@ -361,16 +412,16 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
g_nMemoryClearType = NUM_MIP - 1;
}
#ifdef RAMWORKS
else if (strcmp(lpCmdLine, "-r") == 0) // RamWorks size [1..127]
else if (strcmp(lpCmdLine, "-r") == 0) // RamWorks size [1..256]
{
lpCmdLine = GetCurrArg(lpNextArg);
lpNextArg = GetNextArg(lpNextArg);
g_cmdLine.uRamWorksExPages = atoi(lpCmdLine);
if (g_cmdLine.uRamWorksExPages > kMaxExMemoryBanks)
g_cmdLine.uRamWorksExPages = kMaxExMemoryBanks;
else
if (g_cmdLine.uRamWorksExPages < 1)
g_cmdLine.uRamWorksExPages = 1;
else if (g_cmdLine.uRamWorksExPages < 1)
g_cmdLine.uRamWorksExPages = 1; // 1x64KB (aux mem)
g_cmdLine.auxSlotInsert = CT_RamWorksIII; // Insert RW3 into aux slot
}
#endif
else if (strcmp(lpCmdLine, "-f8rom") == 0) // Use custom 2K ROM at [$F800..$FFFF]
@ -406,7 +457,7 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
{
std::string msg = "Failed to load video rom (not found or not exactly 2/4/8/16KiB)\n";
LogFileOutput("%s", msg.c_str());
GetFrame().FrameMessageBox(msg.c_str(), TEXT("AppleWin Error"), MB_OK);
GetFrame().FrameMessageBox(msg.c_str(), "AppleWin Error", MB_OK);
}
else
{
@ -630,7 +681,7 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
if (!SNESMAXCard::ParseControllerMappingFile(joyNum, lpCmdLine, errorMsg))
{
LogFileOutput("%s", errorMsg.c_str());
GetFrame().FrameMessageBox(errorMsg.c_str(), TEXT("AppleWin Error"), MB_OK);
GetFrame().FrameMessageBox(errorMsg.c_str(), "AppleWin Error", MB_OK);
}
}
else if (strcmp(lpCmdLine, "-wav-speaker") == 0)
@ -661,6 +712,10 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
{
g_cmdLine.useHdcFirmwareV2 = true;
}
else if (strcmp(lpCmdLine, "-alt-cpu-emu") == 0) // debug
{
g_cmdLine.useAltCpuEmulation = true;
}
else // unsupported
{
LogFileOutput("Unsupported arg: %s\n", lpCmdLine);

View File

@ -15,10 +15,14 @@ struct CmdLine
{
isDiskII13 = false;
useHdcFirmwareMode = HdcDefault;
useBad6522A = false;
useBad6522B = false;
}
bool isDiskII13;
HdcMode useHdcFirmwareMode;
bool useBad6522A;
bool useBad6522B;
};
CmdLine()
@ -39,6 +43,7 @@ struct CmdLine
useHdcFirmwareV1 = false;
useHdcFirmwareV2 = false;
szSnapshotName = NULL;
snapshotIgnoreHdcFirmware = false;
szScreenshotFilename = NULL;
uHarddiskNumBlocks = 0;
uRamWorksExPages = 0;
@ -55,6 +60,8 @@ struct CmdLine
bestFullScreenResolution = false;
userSpecifiedWidth = 0;
userSpecifiedHeight = 0;
auxSlotEmpty = false;
auxSlotInsert = CT_Empty;
for (UINT i = 0; i < NUM_SLOTS; i++)
{
@ -84,6 +91,7 @@ struct CmdLine
bool noDisk2StepperDefer; // debug
bool useHdcFirmwareV1; // debug
bool useHdcFirmwareV2;
bool useAltCpuEmulation; // debug
SS_CARDTYPE slotInsert[NUM_SLOTS];
SlotInfo slotInfo[NUM_SLOTS];
LPCSTR szImageName_drive[NUM_SLOTS][NUM_DRIVES];
@ -91,6 +99,7 @@ struct CmdLine
LPCSTR szImageName_harddisk[NUM_SLOTS][NUM_HARDDISKS];
UINT uHarddiskNumBlocks;
LPSTR szSnapshotName;
bool snapshotIgnoreHdcFirmware;
LPSTR szScreenshotFilename;
UINT uRamWorksExPages;
UINT uSaturnBanks;
@ -109,6 +118,8 @@ struct CmdLine
UINT userSpecifiedHeight;
std::string wavFileSpeaker;
std::string wavFileMockingboard;
bool auxSlotEmpty;
SS_CARDTYPE auxSlotInsert;
};
bool ProcessCmdLine(LPSTR lpCmdLine);

View File

@ -13,7 +13,7 @@ const double CLK_6502_PAL = (_14M_PAL * 65.0) / (65.0*14.0+2.0);
// Use a base freq so that DirectX (or sound h/w) doesn't have to up/down-sample
// Assume base freqs are 44.1KHz & 48KHz
const DWORD SPKR_SAMPLE_RATE = 44100;
const uint32_t SPKR_SAMPLE_RATE = 44100;
enum AppMode_e
{
@ -46,20 +46,20 @@ enum AppMode_e
#define BTN_SETUP 7
// TODO: Move to StringTable.h
#define TITLE_APPLE_2 TEXT("Apple ][ Emulator")
#define TITLE_APPLE_2_PLUS TEXT("Apple ][+ Emulator")
#define TITLE_APPLE_2_JPLUS TEXT("Apple ][ J-Plus Emulator")
#define TITLE_APPLE_2E TEXT("Apple //e Emulator")
#define TITLE_APPLE_2E_ENHANCED TEXT("Enhanced Apple //e Emulator")
#define TITLE_APPLE_2C TEXT("Apple //e Emulator")
#define TITLE_PRAVETS_82 TEXT("Pravets 82 Emulator")
#define TITLE_PRAVETS_8M TEXT("Pravets 8M Emulator")
#define TITLE_PRAVETS_8A TEXT("Pravets 8A Emulator")
#define TITLE_TK3000_2E TEXT("TK3000 //e Emulator")
#define TITLE_BASE64A TEXT("Base64A Emulator")
#define TITLE_APPLE_2 "Apple ][ Emulator"
#define TITLE_APPLE_2_PLUS "Apple ][+ Emulator"
#define TITLE_APPLE_2_JPLUS "Apple ][ J-Plus Emulator"
#define TITLE_APPLE_2E "Apple //e Emulator"
#define TITLE_APPLE_2E_ENHANCED "Enhanced Apple //e Emulator"
#define TITLE_APPLE_2C "Apple //e Emulator"
#define TITLE_PRAVETS_82 "Pravets 82 Emulator"
#define TITLE_PRAVETS_8M "Pravets 8M Emulator"
#define TITLE_PRAVETS_8A "Pravets 8A Emulator"
#define TITLE_TK3000_2E "TK3000 //e Emulator"
#define TITLE_BASE64A "Base64A Emulator"
#define TITLE_PAUSED TEXT("* PAUSED *")
#define TITLE_STEPPING TEXT("Stepping")
#define TITLE_PAUSED "* PAUSED *"
#define TITLE_STEPPING "Stepping"
// Configuration
#define REG_CONFIG "Configuration"
@ -114,6 +114,7 @@ enum AppMode_e
#define REGVALUE_SLOT4 "Slot 4" // GH#977: Deprecated from 1.30.4
#define REGVALUE_SLOT5 "Slot 5" // GH#977: Deprecated from 1.30.4
#define REGVALUE_VERSION "Version"
#define REGVALUE_AUX_NUM_BANKS "Number of Banks"
#define REG_CONFIG_SLOT_AUX "Slot Auxiliary"
#define REG_CONFIG_SLOT "Slot "
#define REGVALUE_CARD_TYPE "Card type"
@ -140,7 +141,7 @@ enum AppMode_e
#define WM_USER_FULLSCREEN WM_USER+8
#define VK_SNAPSHOT_TEXT WM_USER+9 // PrintScreen+Ctrl
#ifdef _MSC_VER
#ifdef _WIN32
#define PATH_SEPARATOR '\\'
#else
#define PATH_SEPARATOR '/'
@ -219,6 +220,11 @@ inline bool IsApple2PlusOrClone(eApple2Type type) // Apple ][,][+,][J-Plus or cl
return (type & (APPLE2E_MASK|APPLE2C_MASK)) == 0;
}
inline bool IsAppleIIe(eApple2Type type) // Apple //e,Enhanced//e or clone //e,Enhanced//e
{
return type & APPLE2E_MASK;
}
inline bool IsAppleIIeOrAbove(eApple2Type type) // Apple //e,Enhanced//e,//c or clone //e,Enhanced//e
{
return !IsApple2PlusOrClone(type);

View File

@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../Windows/AppleWin.h"
#include "../resource/resource.h"
static const TCHAR g_szGPL[] =
static const char g_szGPL[] =
"This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\
\r\n\
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\
@ -64,7 +64,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hWnd, UINT message, WPARAM wparam, LPA
case WM_INITDIALOG:
{
HICON hIcon = LoadIcon(GetFrame().g_hInstance, TEXT("APPLEWIN_ICON"));
HICON hIcon = LoadIcon(GetFrame().g_hInstance, "APPLEWIN_ICON");
SendDlgItemMessage(hWnd, IDC_APPLEWIN_ICON, STM_SETIMAGE, IMAGE_ICON, reinterpret_cast<LPARAM>(hIcon));
std::string strAppleWinVersion = "AppleWin v" + g_VERSIONSTRING;

View File

@ -8,7 +8,7 @@ class IPropertySheet
{
public:
virtual void Init(void) = 0;
virtual DWORD GetVolumeMax(void) = 0; // TODO:TC: Move out of here
virtual uint32_t GetVolumeMax(void) = 0; // TODO:TC: Move out of here
virtual bool SaveStateSelectImage(HWND hWindow, bool bSave) = 0; // TODO:TC: Move out of here
virtual void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld) = 0;
virtual void ApplyNewConfigFromSnapshot(const CConfigNeedingRestart& ConfigNew) = 0;

View File

@ -37,20 +37,21 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
CPageAdvanced* CPageAdvanced::ms_this = 0; // reinit'd in ctor
enum CLONECHOICE {MENUITEM_CLONEMIN, MENUITEM_PRAVETS82=MENUITEM_CLONEMIN, MENUITEM_PRAVETS8M, MENUITEM_PRAVETS8A, MENUITEM_TK30002E, MENUITEM_BASE64A, MENUITEM_CLONEMAX};
const TCHAR CPageAdvanced::m_CloneChoices[] =
TEXT("Pravets 82\0") // Bulgarian
TEXT("Pravets 8M\0") // Bulgarian
TEXT("Pravets 8A\0") // Bulgarian
TEXT("TK3000 //e\0") // Brazilian
TEXT("Base 64A\0"); // Taiwanese
const char CPageAdvanced::m_CloneChoices[] =
"Pravets 82\0" // Bulgarian
"Pravets 8M\0" // Bulgarian
"Pravets 8A\0" // Bulgarian
"TK3000 //e\0" // Brazilian
"Base 64A\0"; // Taiwanese
const TCHAR CPageAdvanced::m_gameIOConnectorChoices[] =
const char CPageAdvanced::m_gameIOConnectorChoices[] =
"Empty\0"
"SDS DataKey - SpeedStar\0" /* Protection dongle for Southwestern Data Systems "SpeedStar" Applesoft Compiler */
"Cortechs Corp - CodeWriter\0" /* Protection key for Dynatech Microsoftware / Cortechs Corp "CodeWriter" */
"Robocom Ltd - Robo 500\0" /* Interface Module for Robocom Ltd's Robo 500 */
"Robocom Ltd - Robo 1000\0" /* Interface Module for Robocom Ltd's Robo 1000 */
"Robocom Ltd - Robo 1500, CAD-2P\0"; /* Interface Module for Robocom Ltd's Robo 1500, Robo Systems CAD-2P */
"Robocom Ltd - Robo 1500, CAD-2P\0" /* Interface Module for Robocom Ltd's Robo 1500, Robo Systems CAD-2P */
"Hayden - Applesoft Compiler\0"; /* Protection key for Hayden Book Company, Inc's Applesoft Compiler (1981) */
INT_PTR CALLBACK CPageAdvanced::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
@ -97,12 +98,12 @@ INT_PTR CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, L
case IDC_SAVESTATE_FILENAME:
break;
case IDC_SAVESTATE_BROWSE:
if(m_PropertySheetHelper.SaveStateSelectImage(hWnd, TEXT("Select Save State file"), true))
if(m_PropertySheetHelper.SaveStateSelectImage(hWnd, "Select Save State file", true))
SendDlgItemMessage(hWnd, IDC_SAVESTATE_FILENAME, WM_SETTEXT, 0, (LPARAM)m_PropertySheetHelper.GetSSNewFilename().c_str());
break;
case IDC_PRINTER_DUMP_FILENAME_BROWSE:
{
std::string strPrinterDumpLoc = m_PropertySheetHelper.BrowseToFile(hWnd, TEXT("Select printer dump file"), REGVALUE_PRINTER_FILENAME, TEXT("Text files (*.txt)\0*.txt\0") TEXT("All Files\0*.*\0"));
std::string strPrinterDumpLoc = m_PropertySheetHelper.BrowseToFile(hWnd, "Select printer dump file", REGVALUE_PRINTER_FILENAME, "Text files (*.txt)\0*.txt\0" "All Files\0*.*\0");
SendDlgItemMessage(hWnd, IDC_PRINTER_DUMP_FILENAME, WM_SETTEXT, 0, (LPARAM)strPrinterDumpLoc.c_str());
}
break;
@ -127,7 +128,7 @@ INT_PTR CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, L
case IDC_CLONETYPE:
if(HIWORD(wparam) == CBN_SELCHANGE)
{
const DWORD NewCloneMenuItem = (DWORD) SendDlgItemMessage(hWnd, IDC_CLONETYPE, CB_GETCURSEL, 0, 0);
const uint32_t NewCloneMenuItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_CLONETYPE, CB_GETCURSEL, 0, 0);
const eApple2Type NewCloneType = GetCloneType(NewCloneMenuItem);
m_PropertySheetHelper.GetConfigNew().m_Apple2Type = NewCloneType;
m_PropertySheetHelper.GetConfigNew().m_CpuType = ProbeMainCpuDefault(NewCloneType);
@ -194,7 +195,7 @@ void CPageAdvanced::DlgOK(HWND hWnd)
}
g_bSaveStateOnExit = IsDlgButtonChecked(hWnd, IDC_SAVESTATE_ON_EXIT) ? true : false;
REGSAVE(TEXT(REGVALUE_SAVE_STATE_ON_EXIT), g_bSaveStateOnExit ? 1 : 0);
REGSAVE(REGVALUE_SAVE_STATE_ON_EXIT, g_bSaveStateOnExit ? 1 : 0);
// Save the copy protection dongle type
RegSetConfigGameIOConnectorNewDongleType(GAME_IO_CONNECTOR, GetCopyProtectionDongleType());
@ -241,7 +242,7 @@ void CPageAdvanced::InitOptions(HWND hWnd)
}
// Advanced->Clone: Menu item to eApple2Type
eApple2Type CPageAdvanced::GetCloneType(DWORD NewMenuItem)
eApple2Type CPageAdvanced::GetCloneType(uint32_t NewMenuItem)
{
switch (NewMenuItem)
{

View File

@ -31,15 +31,15 @@ protected:
private:
void InitOptions(HWND hWnd);
eApple2Type GetCloneType(DWORD NewMenuItem);
eApple2Type GetCloneType(uint32_t NewMenuItem);
int GetCloneMenuItem(void);
void InitFreezeDlgButton(HWND hWnd);
void InitCloneDropdownMenu(HWND hWnd);
void InitGameIOConnectorDropdownMenu(HWND hWnd);
static CPageAdvanced* ms_this;
static const TCHAR m_CloneChoices[];
static const TCHAR m_gameIOConnectorChoices[];
static const char m_CloneChoices[];
static const char m_gameIOConnectorChoices[];
const PAGETYPE m_Page;
CPropertySheetHelper& m_PropertySheetHelper;

View File

@ -39,13 +39,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
CPageConfig* CPageConfig::ms_this = 0; // reinit'd in ctor
enum APPLEIICHOICE {MENUITEM_IIORIGINAL, MENUITEM_IIPLUS, MENUITEM_IIJPLUS, MENUITEM_IIE, MENUITEM_ENHANCEDIIE, MENUITEM_CLONE};
const TCHAR CPageConfig::m_ComputerChoices[] =
TEXT("Apple ][ (Original)\0")
TEXT("Apple ][+\0")
TEXT("Apple ][ J-Plus\0")
TEXT("Apple //e\0")
TEXT("Enhanced Apple //e\0")
TEXT("Clone\0");
const char CPageConfig::m_ComputerChoices[] =
"Apple ][ (Original)\0"
"Apple ][+\0"
"Apple ][ J-Plus\0"
"Apple //e\0"
"Enhanced Apple //e\0"
"Clone\0";
INT_PTR CALLBACK CPageConfig::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
@ -71,7 +71,7 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
case PSN_KILLACTIVE:
// About to stop being active page
{
DWORD NewComputerMenuItem = (DWORD) SendDlgItemMessage(hWnd, IDC_COMPUTER, CB_GETCURSEL, 0, 0);
uint32_t NewComputerMenuItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_COMPUTER, CB_GETCURSEL, 0, 0);
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid
}
break;
@ -145,7 +145,7 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
case IDC_COMPUTER:
if(HIWORD(wparam) == CBN_SELCHANGE)
{
const DWORD NewComputerMenuItem = (DWORD) SendDlgItemMessage(hWnd, IDC_COMPUTER, CB_GETCURSEL, 0, 0);
const uint32_t NewComputerMenuItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_COMPUTER, CB_GETCURSEL, 0, 0);
const eApple2Type NewApple2Type = GetApple2Type(NewComputerMenuItem);
m_PropertySheetHelper.GetConfigNew().m_Apple2Type = NewApple2Type;
if (NewApple2Type != A2TYPE_CLONE)
@ -171,12 +171,12 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
#if 0
case IDC_RECALIBRATE:
RegSaveValue(TEXT(""),TEXT("RunningOnOS"),0,0);
RegSaveValue("","RunningOnOS",0,0);
if (MessageBox(hWnd,
TEXT("The emulator has been set to recalibrate ")
TEXT("itself the next time it is started.\n\n")
TEXT("Would you like to restart the emulator now?"),
TEXT(REG_CONFIG),
"The emulator has been set to recalibrate "
"itself the next time it is started.\n\n"
"Would you like to restart the emulator now?",
REG_CONFIG,
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDOK)
{
PropSheet_PressButton(GetParent(hWnd), PSBTN_OK);
@ -245,8 +245,8 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
BOOL bCustom = TRUE;
if (g_dwSpeed == SPEED_NORMAL)
{
DWORD dwCustomSpeed;
REGLOAD_DEFAULT(TEXT(REGVALUE_CUSTOM_SPEED), &dwCustomSpeed, 0);
uint32_t dwCustomSpeed;
REGLOAD_DEFAULT(REGVALUE_CUSTOM_SPEED, &dwCustomSpeed, 0);
bCustom = dwCustomSpeed ? TRUE : FALSE;
}
CheckRadioButton(hWnd, IDC_AUTHENTIC_SPEED, IDC_CUSTOM_SPEED, bCustom ? IDC_CUSTOM_SPEED : IDC_AUTHENTIC_SPEED);
@ -354,7 +354,7 @@ void CPageConfig::DlgOK(HWND hWnd)
if (win32Frame.GetFullScreenShowSubunitStatus() != bNewFSSubunitStatus)
{
REGSAVE(TEXT(REGVALUE_FS_SHOW_SUBUNIT_STATUS), bNewFSSubunitStatus ? 1 : 0);
REGSAVE(REGVALUE_FS_SHOW_SUBUNIT_STATUS, bNewFSSubunitStatus ? 1 : 0);
win32Frame.SetFullScreenShowSubunitStatus(bNewFSSubunitStatus);
if (win32Frame.IsFullScreen())
@ -366,7 +366,7 @@ void CPageConfig::DlgOK(HWND hWnd)
const BOOL bNewConfirmReboot = IsDlgButtonChecked(hWnd, IDC_CHECK_CONFIRM_REBOOT) ? 1 : 0;
if (win32Frame.g_bConfirmReboot != bNewConfirmReboot)
{
REGSAVE(TEXT(REGVALUE_CONFIRM_REBOOT), bNewConfirmReboot);
REGSAVE(REGVALUE_CONFIRM_REBOOT, bNewConfirmReboot);
win32Frame.g_bConfirmReboot = bNewConfirmReboot;
}
@ -374,7 +374,7 @@ void CPageConfig::DlgOK(HWND hWnd)
if (GetCardMgr().IsSSCInstalled())
{
const DWORD uNewSerialPort = (DWORD) SendDlgItemMessage(hWnd, IDC_SERIALPORT, CB_GETCURSEL, 0, 0);
const uint32_t uNewSerialPort = (uint32_t) SendDlgItemMessage(hWnd, IDC_SERIALPORT, CB_GETCURSEL, 0, 0);
GetCardMgr().GetSSC()->CommSetSerialPort(uNewSerialPort);
}
@ -387,8 +387,8 @@ void CPageConfig::DlgOK(HWND hWnd)
SetCurrentCLK6502();
REGSAVE(TEXT(REGVALUE_CUSTOM_SPEED), IsDlgButtonChecked(hWnd, IDC_CUSTOM_SPEED));
REGSAVE(TEXT(REGVALUE_EMULATION_SPEED), g_dwSpeed);
REGSAVE(REGVALUE_CUSTOM_SPEED, IsDlgButtonChecked(hWnd, IDC_CUSTOM_SPEED));
REGSAVE(REGVALUE_EMULATION_SPEED, g_dwSpeed);
m_PropertySheetHelper.PostMsgAfterClose(hWnd, m_Page);
}
@ -406,7 +406,7 @@ void CPageConfig::InitOptions(HWND hWnd)
}
// Config->Computer: Menu item to eApple2Type
eApple2Type CPageConfig::GetApple2Type(DWORD NewMenuItem)
eApple2Type CPageConfig::GetApple2Type(uint32_t NewMenuItem)
{
switch (NewMenuItem)
{
@ -440,9 +440,9 @@ bool CPageConfig::IsOkToBenchmark(HWND hWnd, const bool bConfigChanged)
if (bConfigChanged)
{
if (MessageBox(hWnd,
TEXT("The hardware configuration has changed. Benchmarking will lose these changes.\n\n")
TEXT("Are you sure you want to do this?"),
TEXT("Benchmarks"),
"The hardware configuration has changed. Benchmarking will lose these changes.\n\n"
"Are you sure you want to do this?",
"Benchmarks",
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDCANCEL)
return false;
}
@ -451,11 +451,11 @@ bool CPageConfig::IsOkToBenchmark(HWND hWnd, const bool bConfigChanged)
return true;
if (MessageBox(hWnd,
TEXT("Running the benchmarks will reset the state of ")
TEXT("the emulated machine, causing you to lose any ")
TEXT("unsaved work.\n\n")
TEXT("Are you sure you want to do this?"),
TEXT("Benchmarks"),
"Running the benchmarks will reset the state of "
"the emulated machine, causing you to lose any "
"unsaved work.\n\n"
"Are you sure you want to do this?",
"Benchmarks",
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDCANCEL)
return false;

View File

@ -28,13 +28,13 @@ protected:
private:
void InitOptions(HWND hWnd);
eApple2Type GetApple2Type(DWORD NewMenuItem);
eApple2Type GetApple2Type(uint32_t NewMenuItem);
void EnableTrackbar(HWND hWnd, BOOL enable);
void ui_tfe_settings_dialog(HWND hwnd);
bool IsOkToBenchmark(HWND hWnd, const bool bConfigChanged);
static CPageConfig* ms_this;
static const TCHAR m_ComputerChoices[];
static const char m_ComputerChoices[];
const PAGETYPE m_Page;
CPropertySheetHelper& m_PropertySheetHelper;

View File

@ -37,13 +37,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
CPageDisk* CPageDisk::ms_this = 0; // reinit'd in ctor
const TCHAR CPageDisk::m_defaultDiskOptions[] =
TEXT("Select Disk...\0")
TEXT("Eject Disk\0");
const char CPageDisk::m_defaultDiskOptions[] =
"Select Disk...\0"
"Eject Disk\0";
const TCHAR CPageDisk::m_defaultHDDOptions[] =
TEXT("Select Hard Disk Image...\0")
TEXT("Unplug Hard Disk Image\0");
const char CPageDisk::m_defaultHDDOptions[] =
"Select Hard Disk Image...\0"
"Unplug Hard Disk Image\0";
INT_PTR CALLBACK CPageDisk::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
@ -173,7 +173,7 @@ INT_PTR CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARA
break;
case IDC_CIDERPRESS_BROWSE:
{
std::string CiderPressLoc = m_PropertySheetHelper.BrowseToFile(hWnd, TEXT("Select path to CiderPress"), REGVALUE_CIDERPRESSLOC, TEXT("Applications (*.exe)\0*.exe\0") TEXT("All Files\0*.*\0") );
std::string CiderPressLoc = m_PropertySheetHelper.BrowseToFile(hWnd, "Select path to CiderPress", REGVALUE_CIDERPRESSLOC, "Applications (*.exe)\0*.exe\0" "All Files\0*.*\0" );
SendDlgItemMessage(hWnd, IDC_CIDERPRESS_FILENAME, WM_SETTEXT, 0, (LPARAM) CiderPressLoc.c_str());
}
break;
@ -193,8 +193,8 @@ INT_PTR CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARA
InitComboHDD(hWnd, SLOT7);
TCHAR PathToCiderPress[MAX_PATH];
RegLoadString(TEXT(REG_CONFIG), REGVALUE_CIDERPRESSLOC, 1, PathToCiderPress, MAX_PATH, TEXT(""));
char PathToCiderPress[MAX_PATH];
RegLoadString(REG_CONFIG, REGVALUE_CIDERPRESSLOC, 1, PathToCiderPress, MAX_PATH, "");
SendDlgItemMessage(hWnd, IDC_CIDERPRESS_FILENAME ,WM_SETTEXT, 0, (LPARAM)PathToCiderPress);
CheckDlgButton(hWnd, IDC_HDD_ENABLE, (GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD) ? BST_CHECKED : BST_UNCHECKED);
@ -271,14 +271,14 @@ void CPageDisk::DlgOK(HWND hWnd)
nLineLength = nLineLength > sizeof(szFilename)-1 ? sizeof(szFilename)-1 : nLineLength;
szFilename[nLineLength] = 0x00;
RegSaveString(TEXT(REG_CONFIG), REGVALUE_CIDERPRESSLOC, 1, szFilename);
RegSaveString(REG_CONFIG, REGVALUE_CIDERPRESSLOC, 1, szFilename);
}
const bool bNewEnhanceDisk = IsDlgButtonChecked(hWnd, IDC_ENHANCE_DISK_ENABLE) ? true : false;
if (bNewEnhanceDisk != GetCardMgr().GetDisk2CardMgr().GetEnhanceDisk())
{
GetCardMgr().GetDisk2CardMgr().SetEnhanceDisk(bNewEnhanceDisk);
REGSAVE(TEXT(REGVALUE_ENHANCE_DISK_SPEED), (DWORD)bNewEnhanceDisk);
REGSAVE(REGVALUE_ENHANCE_DISK_SPEED, (uint32_t)bNewEnhanceDisk);
}
Win32Frame& win32Frame = Win32Frame::GetWin32Frame();
@ -350,8 +350,8 @@ void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected
HarddiskInterfaceCard& card = dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(SLOT7));
// Search from "select hard drive"
DWORD dwOpenDialogIndex = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_FINDSTRINGEXACT, -1, (LPARAM)&m_defaultHDDOptions[0]);
DWORD dwComboSelection = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_GETCURSEL, 0, 0);
uint32_t dwOpenDialogIndex = (uint32_t)SendDlgItemMessage(hWnd, comboSelected, CB_FINDSTRINGEXACT, -1, (LPARAM)&m_defaultHDDOptions[0]);
uint32_t dwComboSelection = (uint32_t)SendDlgItemMessage(hWnd, comboSelected, CB_GETCURSEL, 0, 0);
SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, -1, 0); // Set to "empty" item
@ -379,9 +379,9 @@ void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected
SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, 0, 0);
// If the HD was in the other combo, remove now
DWORD comboOther = (comboSelected == IDC_COMBO_HDD1) ? IDC_COMBO_HDD2 : IDC_COMBO_HDD1;
uint32_t comboOther = (comboSelected == IDC_COMBO_HDD1) ? IDC_COMBO_HDD2 : IDC_COMBO_HDD1;
DWORD duplicated = (DWORD)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)card.GetFullName(driveSelected).c_str());
uint32_t duplicated = (uint32_t)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)card.GetFullName(driveSelected).c_str());
if (duplicated != CB_ERR)
{
SendDlgItemMessage(hWnd, comboOther, CB_DELETESTRING, duplicated, 0);
@ -420,8 +420,8 @@ void CPageDisk::HandleFloppyDriveCombo(HWND hWnd, UINT driveSelected, UINT combo
Disk2InterfaceCard& disk2Card = dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(slot));
// Search from "select floppy drive"
DWORD dwOpenDialogIndex = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_FINDSTRINGEXACT, -1, (LPARAM)&m_defaultDiskOptions[0]);
DWORD dwComboSelection = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_GETCURSEL, 0, 0);
uint32_t dwOpenDialogIndex = (uint32_t)SendDlgItemMessage(hWnd, comboSelected, CB_FINDSTRINGEXACT, -1, (LPARAM)&m_defaultDiskOptions[0]);
uint32_t dwComboSelection = (uint32_t)SendDlgItemMessage(hWnd, comboSelected, CB_GETCURSEL, 0, 0);
SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, -1, 0); // Set to "empty" item
@ -450,7 +450,7 @@ void CPageDisk::HandleFloppyDriveCombo(HWND hWnd, UINT driveSelected, UINT combo
SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, 0, 0);
// If the FD was in the other combo, remove now
DWORD duplicated = (DWORD)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)fullname.c_str());
uint32_t duplicated = (uint32_t)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)fullname.c_str());
if (duplicated != CB_ERR)
{
SendDlgItemMessage(hWnd, comboOther, CB_DELETESTRING, duplicated, 0);

View File

@ -35,8 +35,8 @@ private:
UINT RemovalConfirmation(UINT uCommand);
static CPageDisk* ms_this;
static const TCHAR m_defaultDiskOptions[];
static const TCHAR m_defaultHDDOptions[];
static const char m_defaultDiskOptions[];
static const char m_defaultHDDOptions[];
const PAGETYPE m_Page;
CPropertySheetHelper& m_PropertySheetHelper;

View File

@ -34,22 +34,22 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
CPageInput* CPageInput::ms_this = 0; // reinit'd in ctor
// Joystick option choices - NOTE maximum text length is MaxMenuChoiceLen = 40
const TCHAR CPageInput::m_szJoyChoice0[] = TEXT("Disabled\0");
const TCHAR CPageInput::m_szJoyChoice1[] = TEXT("PC Joystick #1\0");
const TCHAR CPageInput::m_szJoyChoice2[] = TEXT("PC Joystick #2\0");
const TCHAR CPageInput::m_szJoyChoice3[] = TEXT("Keyboard (cursors)\0");
const TCHAR CPageInput::m_szJoyChoice4[] = TEXT("Keyboard (numpad)\0");
const TCHAR CPageInput::m_szJoyChoice5[] = TEXT("Mouse\0");
const TCHAR CPageInput::m_szJoyChoice6[] = TEXT("PC Joystick #1 Thumbstick 2\0");
const char CPageInput::m_szJoyChoice0[] = "Disabled\0";
const char CPageInput::m_szJoyChoice1[] = "PC Joystick #1\0";
const char CPageInput::m_szJoyChoice2[] = "PC Joystick #2\0";
const char CPageInput::m_szJoyChoice3[] = "Keyboard (cursors)\0";
const char CPageInput::m_szJoyChoice4[] = "Keyboard (numpad)\0";
const char CPageInput::m_szJoyChoice5[] = "Mouse\0";
const char CPageInput::m_szJoyChoice6[] = "PC Joystick #1 Thumbstick 2\0";
const TCHAR* const CPageInput::m_pszJoy0Choices[J0C_MAX] = {
const char* const CPageInput::m_pszJoy0Choices[J0C_MAX] = {
CPageInput::m_szJoyChoice0,
CPageInput::m_szJoyChoice1, // PC Joystick #1
CPageInput::m_szJoyChoice3,
CPageInput::m_szJoyChoice4,
CPageInput::m_szJoyChoice5 };
const TCHAR* const CPageInput::m_pszJoy1Choices[J1C_MAX] = {
const char* const CPageInput::m_pszJoy1Choices[J1C_MAX] = {
CPageInput::m_szJoyChoice0,
CPageInput::m_szJoyChoice2, // PC Joystick #2
CPageInput::m_szJoyChoice3,
@ -57,22 +57,22 @@ const TCHAR* const CPageInput::m_pszJoy1Choices[J1C_MAX] = {
CPageInput::m_szJoyChoice5,
CPageInput::m_szJoyChoice6 };
const TCHAR CPageInput::m_szCPMSlotChoice_Slot4[] = TEXT("Slot 4\0");
const TCHAR CPageInput::m_szCPMSlotChoice_Slot5[] = TEXT("Slot 5\0");
const TCHAR CPageInput::m_szCPMSlotChoice_Unplugged[] = TEXT("Unplugged\0");
const TCHAR CPageInput::m_szCPMSlotChoice_Unavailable[] = TEXT("Unavailable\0");
const char CPageInput::m_szCPMSlotChoice_Slot4[] = "Slot 4\0";
const char CPageInput::m_szCPMSlotChoice_Slot5[] = "Slot 5\0";
const char CPageInput::m_szCPMSlotChoice_Unplugged[] = "Unplugged\0";
const char CPageInput::m_szCPMSlotChoice_Unavailable[] = "Unavailable\0";
const TCHAR CPageInput::m_szFourPlaySlotChoice_Slot3[] = TEXT("Slot 3\0");
const TCHAR CPageInput::m_szFourPlaySlotChoice_Slot4[] = TEXT("Slot 4\0");
const TCHAR CPageInput::m_szFourPlaySlotChoice_Slot5[] = TEXT("Slot 5\0");
const TCHAR CPageInput::m_szFourPlaySlotChoice_Unplugged[] = TEXT("Unplugged\0");
const TCHAR CPageInput::m_szFourPlaySlotChoice_Unavailable[] = TEXT("Unavailable\0");
const char CPageInput::m_szFourPlaySlotChoice_Slot3[] = "Slot 3\0";
const char CPageInput::m_szFourPlaySlotChoice_Slot4[] = "Slot 4\0";
const char CPageInput::m_szFourPlaySlotChoice_Slot5[] = "Slot 5\0";
const char CPageInput::m_szFourPlaySlotChoice_Unplugged[] = "Unplugged\0";
const char CPageInput::m_szFourPlaySlotChoice_Unavailable[] = "Unavailable\0";
const TCHAR CPageInput::m_szSNESMAXSlotChoice_Slot3[] = TEXT("Slot 3\0");
const TCHAR CPageInput::m_szSNESMAXSlotChoice_Slot4[] = TEXT("Slot 4\0");
const TCHAR CPageInput::m_szSNESMAXSlotChoice_Slot5[] = TEXT("Slot 5\0");
const TCHAR CPageInput::m_szSNESMAXSlotChoice_Unplugged[] = TEXT("Unplugged\0");
const TCHAR CPageInput::m_szSNESMAXSlotChoice_Unavailable[] = TEXT("Unavailable\0");
const char CPageInput::m_szSNESMAXSlotChoice_Slot3[] = "Slot 3\0";
const char CPageInput::m_szSNESMAXSlotChoice_Slot4[] = "Slot 4\0";
const char CPageInput::m_szSNESMAXSlotChoice_Slot5[] = "Slot 5\0";
const char CPageInput::m_szSNESMAXSlotChoice_Unplugged[] = "Unplugged\0";
const char CPageInput::m_szSNESMAXSlotChoice_Unavailable[] = "Unavailable\0";
INT_PTR CALLBACK CPageInput::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
@ -136,7 +136,7 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
case IDC_JOYSTICK0:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
DWORD dwNewJoyType = (DWORD)SendDlgItemMessage(hWnd, IDC_JOYSTICK0, CB_GETCURSEL, 0, 0);
uint32_t dwNewJoyType = (uint32_t)SendDlgItemMessage(hWnd, IDC_JOYSTICK0, CB_GETCURSEL, 0, 0);
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface;
JoySetEmulationType(hWnd, m_nJoy0ChoiceTranlationTbl[dwNewJoyType], JN_JOYSTICK0, bIsSlot4Mouse);
InitOptions(hWnd);
@ -146,7 +146,7 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
case IDC_JOYSTICK1:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
DWORD dwNewJoyType = (DWORD)SendDlgItemMessage(hWnd, IDC_JOYSTICK1, CB_GETCURSEL, 0, 0);
uint32_t dwNewJoyType = (uint32_t)SendDlgItemMessage(hWnd, IDC_JOYSTICK1, CB_GETCURSEL, 0, 0);
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface;
JoySetEmulationType(hWnd, m_nJoy1ChoiceTranlationTbl[dwNewJoyType], JN_JOYSTICK1, bIsSlot4Mouse);
InitOptions(hWnd);
@ -169,7 +169,7 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
case IDC_CPM_CONFIG:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
const DWORD NewCPMChoiceItem = (DWORD) SendDlgItemMessage(hWnd, IDC_CPM_CONFIG, CB_GETCURSEL, 0, 0);
const uint32_t NewCPMChoiceItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_CPM_CONFIG, CB_GETCURSEL, 0, 0);
const CPMCHOICE NewCPMChoice = m_CPMComboItemToChoice[NewCPMChoiceItem];
if (NewCPMChoice == m_CPMChoice)
break;
@ -195,7 +195,7 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
case IDC_FOURPLAY_CONFIG:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
const DWORD NewFourPlayChoiceItem = (DWORD) SendDlgItemMessage(hWnd, IDC_FOURPLAY_CONFIG, CB_GETCURSEL, 0, 0);
const uint32_t NewFourPlayChoiceItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_FOURPLAY_CONFIG, CB_GETCURSEL, 0, 0);
const FOURPLAYCHOICE NewFourPlayChoice = m_FourPlayComboItemToChoice[NewFourPlayChoiceItem];
if (NewFourPlayChoice == m_FourPlayChoice)
break;
@ -226,7 +226,7 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
case IDC_SNESMAX_CONFIG:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
const DWORD NewSNESMAXChoiceItem = (DWORD) SendDlgItemMessage(hWnd, IDC_SNESMAX_CONFIG, CB_GETCURSEL, 0, 0);
const uint32_t NewSNESMAXChoiceItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_SNESMAX_CONFIG, CB_GETCURSEL, 0, 0);
const SNESMAXCHOICE NewSNESMAXChoice = m_SNESMAXComboItemToChoice[NewSNESMAXChoiceItem];
if (NewSNESMAXChoice == m_SNESMAXChoice)
break;
@ -295,12 +295,12 @@ void CPageInput::DlgOK(HWND hWnd)
if (JoySetEmulationType(hWnd, m_nJoy0ChoiceTranlationTbl[uNewJoyType0], JN_JOYSTICK0, bIsSlot4Mouse))
{
REGSAVE(TEXT(REGVALUE_JOYSTICK0_EMU_TYPE), JoyGetJoyType(0));
REGSAVE(REGVALUE_JOYSTICK0_EMU_TYPE, JoyGetJoyType(0));
}
if (JoySetEmulationType(hWnd, m_nJoy1ChoiceTranlationTbl[uNewJoyType1], JN_JOYSTICK1, bIsSlot4Mouse))
{
REGSAVE(TEXT(REGVALUE_JOYSTICK1_EMU_TYPE), JoyGetJoyType(1));
REGSAVE(REGVALUE_JOYSTICK1_EMU_TYPE, JoyGetJoyType(1));
}
JoySetTrim((short)SendDlgItemMessage(hWnd, IDC_SPIN_XTRIM, UDM_GETPOS, 0, 0), true);
@ -313,15 +313,15 @@ void CPageInput::DlgOK(HWND hWnd)
m_uMouseShowCrosshair = IsDlgButtonChecked(hWnd, IDC_MOUSE_CROSSHAIR) ? 1 : 0;
m_uMouseRestrictToWindow = IsDlgButtonChecked(hWnd, IDC_MOUSE_RESTRICT_TO_WINDOW) ? 1 : 0;
REGSAVE(TEXT(REGVALUE_PDL_XTRIM), JoyGetTrim(true));
REGSAVE(TEXT(REGVALUE_PDL_YTRIM), JoyGetTrim(false));
REGSAVE(TEXT(REGVALUE_SCROLLLOCK_TOGGLE), m_uScrollLockToggle);
REGSAVE(TEXT(REGVALUE_CURSOR_CONTROL), m_uCursorControl);
REGSAVE(TEXT(REGVALUE_AUTOFIRE), m_bmAutofire);
REGSAVE(TEXT(REGVALUE_SWAP_BUTTONS_0_AND_1), m_bSwapButtons0and1);
REGSAVE(TEXT(REGVALUE_CENTERING_CONTROL), m_uCenteringControl);
REGSAVE(TEXT(REGVALUE_MOUSE_CROSSHAIR), m_uMouseShowCrosshair);
REGSAVE(TEXT(REGVALUE_MOUSE_RESTRICT_TO_WINDOW), m_uMouseRestrictToWindow);
REGSAVE(REGVALUE_PDL_XTRIM, JoyGetTrim(true));
REGSAVE(REGVALUE_PDL_YTRIM, JoyGetTrim(false));
REGSAVE(REGVALUE_SCROLLLOCK_TOGGLE, m_uScrollLockToggle);
REGSAVE(REGVALUE_CURSOR_CONTROL, m_uCursorControl);
REGSAVE(REGVALUE_AUTOFIRE, m_bmAutofire);
REGSAVE(REGVALUE_SWAP_BUTTONS_0_AND_1, m_bSwapButtons0and1);
REGSAVE(REGVALUE_CENTERING_CONTROL, m_uCenteringControl);
REGSAVE(REGVALUE_MOUSE_CROSSHAIR, m_uMouseShowCrosshair);
REGSAVE(REGVALUE_MOUSE_RESTRICT_TO_WINDOW, m_uMouseRestrictToWindow);
m_PropertySheetHelper.PostMsgAfterClose(hWnd, m_Page);
}
@ -333,11 +333,11 @@ void CPageInput::InitOptions(HWND hWnd)
void CPageInput::InitJoystickChoices(HWND hWnd, int nJoyNum, int nIdcValue)
{
TCHAR* pnzJoystickChoices;
char* pnzJoystickChoices;
int *pnJoyTranslationTbl;
int nJoyTranslationTblSize;
unsigned short nJC_DISABLED, nJC_JOYSTICK, nJC_KEYBD_CURSORS, nJC_KEYBD_NUMPAD, nJC_MOUSE, nJC_MAX;
TCHAR** ppszJoyChoices;
char** ppszJoyChoices;
int nOtherJoyNum = nJoyNum == JN_JOYSTICK0 ? JN_JOYSTICK1 : JN_JOYSTICK0;
if (nJoyNum == JN_JOYSTICK0)
@ -351,7 +351,7 @@ void CPageInput::InitJoystickChoices(HWND hWnd, int nJoyNum, int nIdcValue)
nJC_KEYBD_NUMPAD = J0C_KEYBD_NUMPAD;
nJC_MOUSE = J0C_MOUSE;
nJC_MAX = J0C_MAX;
ppszJoyChoices = (TCHAR**) m_pszJoy0Choices;
ppszJoyChoices = (char**) m_pszJoy0Choices;
}
else
{
@ -364,10 +364,10 @@ void CPageInput::InitJoystickChoices(HWND hWnd, int nJoyNum, int nIdcValue)
nJC_KEYBD_NUMPAD = J1C_KEYBD_NUMPAD;
nJC_MOUSE = J1C_MOUSE;
nJC_MAX = J1C_MAX;
ppszJoyChoices = (TCHAR**) m_pszJoy1Choices;
ppszJoyChoices = (char**) m_pszJoy1Choices;
}
TCHAR* pszMem = pnzJoystickChoices;
char* pszMem = pnzJoystickChoices;
int nIdx = 0;
memset(pnJoyTranslationTbl, -1, nJoyTranslationTblSize);

View File

@ -61,37 +61,37 @@ private:
static CPageInput* ms_this;
static const UINT MaxMenuChoiceLen = 40;
static const TCHAR m_szJoyChoice0[];
static const TCHAR m_szJoyChoice1[];
static const TCHAR m_szJoyChoice2[];
static const TCHAR m_szJoyChoice3[];
static const TCHAR m_szJoyChoice4[];
static const TCHAR m_szJoyChoice5[];
static const TCHAR m_szJoyChoice6[];
static const TCHAR* const m_pszJoy0Choices[J0C_MAX];
static const TCHAR* const m_pszJoy1Choices[J1C_MAX];
static const char m_szJoyChoice0[];
static const char m_szJoyChoice1[];
static const char m_szJoyChoice2[];
static const char m_szJoyChoice3[];
static const char m_szJoyChoice4[];
static const char m_szJoyChoice5[];
static const char m_szJoyChoice6[];
static const char* const m_pszJoy0Choices[J0C_MAX];
static const char* const m_pszJoy1Choices[J1C_MAX];
static const TCHAR m_szCPMSlotChoice_Slot4[];
static const TCHAR m_szCPMSlotChoice_Slot5[];
static const TCHAR m_szCPMSlotChoice_Unplugged[];
static const TCHAR m_szCPMSlotChoice_Unavailable[];
static const char m_szCPMSlotChoice_Slot4[];
static const char m_szCPMSlotChoice_Slot5[];
static const char m_szCPMSlotChoice_Unplugged[];
static const char m_szCPMSlotChoice_Unavailable[];
static const TCHAR m_szFourPlaySlotChoice_Slot3[];
static const TCHAR m_szFourPlaySlotChoice_Slot4[];
static const TCHAR m_szFourPlaySlotChoice_Slot5[];
static const TCHAR m_szFourPlaySlotChoice_Unplugged[];
static const TCHAR m_szFourPlaySlotChoice_Unavailable[];
static const char m_szFourPlaySlotChoice_Slot3[];
static const char m_szFourPlaySlotChoice_Slot4[];
static const char m_szFourPlaySlotChoice_Slot5[];
static const char m_szFourPlaySlotChoice_Unplugged[];
static const char m_szFourPlaySlotChoice_Unavailable[];
static const TCHAR m_szSNESMAXSlotChoice_Slot3[];
static const TCHAR m_szSNESMAXSlotChoice_Slot4[];
static const TCHAR m_szSNESMAXSlotChoice_Slot5[];
static const TCHAR m_szSNESMAXSlotChoice_Unplugged[];
static const TCHAR m_szSNESMAXSlotChoice_Unavailable[];
static const char m_szSNESMAXSlotChoice_Slot3[];
static const char m_szSNESMAXSlotChoice_Slot4[];
static const char m_szSNESMAXSlotChoice_Slot5[];
static const char m_szSNESMAXSlotChoice_Unplugged[];
static const char m_szSNESMAXSlotChoice_Unavailable[];
int m_nJoy0ChoiceTranlationTbl[J0C_MAX];
TCHAR m_joystick0choices[J0C_MAX * MaxMenuChoiceLen];
char m_joystick0choices[J0C_MAX * MaxMenuChoiceLen];
int m_nJoy1ChoiceTranlationTbl[J1C_MAX];
TCHAR m_joystick1choices[J1C_MAX * MaxMenuChoiceLen];
char m_joystick1choices[J1C_MAX * MaxMenuChoiceLen];
const PAGETYPE m_Page;
CPropertySheetHelper& m_PropertySheetHelper;
@ -105,17 +105,17 @@ private:
UINT m_uMouseRestrictToWindow;
enum CPMCHOICE {CPM_SLOT4=0, CPM_SLOT5, CPM_UNPLUGGED, CPM_UNAVAILABLE, _CPM_MAX_CHOICES};
TCHAR m_szCPMSlotChoices[_CPM_MAX_CHOICES * MaxMenuChoiceLen];
char m_szCPMSlotChoices[_CPM_MAX_CHOICES * MaxMenuChoiceLen];
CPMCHOICE m_CPMChoice;
CPMCHOICE m_CPMComboItemToChoice[_CPM_MAX_CHOICES];
enum FOURPLAYCHOICE {FOURPLAY_SLOT3=0, FOURPLAY_SLOT4, FOURPLAY_SLOT5, FOURPLAY_UNPLUGGED, FOURPLAY_UNAVAILABLE, _FOURPLAY_MAX_CHOICES};
TCHAR m_szFourPlaySlotChoices[_FOURPLAY_MAX_CHOICES * MaxMenuChoiceLen];
char m_szFourPlaySlotChoices[_FOURPLAY_MAX_CHOICES * MaxMenuChoiceLen];
FOURPLAYCHOICE m_FourPlayChoice;
FOURPLAYCHOICE m_FourPlayComboItemToChoice[_FOURPLAY_MAX_CHOICES];
enum SNESMAXCHOICE {SNESMAX_SLOT3=0, SNESMAX_SLOT4, SNESMAX_SLOT5, SNESMAX_UNPLUGGED, SNESMAX_UNAVAILABLE, _SNESMAX_MAX_CHOICES};
TCHAR m_szSNESMAXSlotChoices[_SNESMAX_MAX_CHOICES * MaxMenuChoiceLen];
char m_szSNESMAXSlotChoices[_SNESMAX_MAX_CHOICES * MaxMenuChoiceLen];
SNESMAXCHOICE m_SNESMAXChoice;
SNESMAXCHOICE m_SNESMAXComboItemToChoice[_SNESMAX_MAX_CHOICES];
};

View File

@ -35,8 +35,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
CPageSound* CPageSound::ms_this = 0; // reinit'd in ctor
const TCHAR CPageSound::m_soundchoices[] = TEXT("Disabled\0")
TEXT("Sound Card\0");
const char CPageSound::m_soundchoices[] = "Disabled\0"
"Sound Card\0";
const char CPageSound::m_soundCardChoices[] = "Mockingboard\0"
@ -107,7 +107,7 @@ INT_PTR CPageSound::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
if (HIWORD(wparam) == CBN_SELCHANGE)
{
UINT slot = (LOWORD(wparam) == IDC_SOUNDCARD_SLOT4) ? SLOT4 : SLOT5;
DWORD newChoiceItem = (DWORD)SendDlgItemMessage(hWnd, LOWORD(wparam), CB_GETCURSEL, 0, 0);
uint32_t newChoiceItem = (uint32_t)SendDlgItemMessage(hWnd, LOWORD(wparam), CB_GETCURSEL, 0, 0);
SS_CARDTYPE newCard = CT_Empty;
switch (newChoiceItem)
@ -154,19 +154,19 @@ void CPageSound::DlgOK(HWND hWnd)
{
const SoundType_e newSoundType = (SoundType_e) SendDlgItemMessage(hWnd, IDC_SOUNDTYPE, CB_GETCURSEL, 0, 0);
const DWORD dwSpkrVolume = SendDlgItemMessage(hWnd, IDC_SPKR_VOLUME, TBM_GETPOS, 0, 0);
const DWORD dwMBVolume = SendDlgItemMessage(hWnd, IDC_MB_VOLUME, TBM_GETPOS, 0, 0);
const uint32_t dwSpkrVolume = SendDlgItemMessage(hWnd, IDC_SPKR_VOLUME, TBM_GETPOS, 0, 0);
const uint32_t dwMBVolume = SendDlgItemMessage(hWnd, IDC_MB_VOLUME, TBM_GETPOS, 0, 0);
SpkrSetEmulationType(newSoundType);
DWORD dwSoundType = (soundtype == SOUND_NONE) ? REG_SOUNDTYPE_NONE : REG_SOUNDTYPE_WAVE;
REGSAVE(TEXT(REGVALUE_SOUND_EMULATION), dwSoundType);
uint32_t dwSoundType = (soundtype == SOUND_NONE) ? REG_SOUNDTYPE_NONE : REG_SOUNDTYPE_WAVE;
REGSAVE(REGVALUE_SOUND_EMULATION, dwSoundType);
// NB. Volume: 0=Loudest, VOLUME_MAX=Silence
SpkrSetVolume(dwSpkrVolume, VOLUME_MAX);
GetCardMgr().GetMockingboardCardMgr().SetVolume(dwMBVolume, VOLUME_MAX);
REGSAVE(TEXT(REGVALUE_SPKR_VOLUME), SpkrGetVolume());
REGSAVE(TEXT(REGVALUE_MB_VOLUME), GetCardMgr().GetMockingboardCardMgr().GetVolume());
REGSAVE(REGVALUE_SPKR_VOLUME, SpkrGetVolume());
REGSAVE(REGVALUE_MB_VOLUME, GetCardMgr().GetMockingboardCardMgr().GetVolume());
m_PropertySheetHelper.PostMsgAfterClose(hWnd, m_Page);
}

View File

@ -19,7 +19,7 @@ public:
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
DWORD GetVolumeMax(void){ return VOLUME_MAX; }
uint32_t GetVolumeMax(void){ return VOLUME_MAX; }
protected:
// IPropertySheetPage
@ -40,7 +40,7 @@ private:
static const UINT VOLUME_MIN = 0;
static const UINT VOLUME_MAX = 59;
static const TCHAR m_soundchoices[];
static const char m_soundchoices[];
static const char m_soundCardChoices[];
static const char m_soundCardChoicesEx[];
static const char m_soundCardChoice_Unavailable[];

View File

@ -85,7 +85,7 @@ void CPropertySheet::Init(void)
INT_PTR nRes = PropertySheet(&PropSheetHeader); // Result: 0=Cancel, 1=OK
}
DWORD CPropertySheet::GetVolumeMax()
uint32_t CPropertySheet::GetVolumeMax()
{
return m_PageSound.GetVolumeMax();
}
@ -93,8 +93,8 @@ DWORD CPropertySheet::GetVolumeMax()
// Called when F11/F12 is pressed
bool CPropertySheet::SaveStateSelectImage(HWND hWindow, bool bSave)
{
if(m_PropertySheetHelper.SaveStateSelectImage(hWindow, bSave ? TEXT("Select Save State file")
: TEXT("Select Load State file"), bSave))
if(m_PropertySheetHelper.SaveStateSelectImage(hWindow, bSave ? "Select Save State file"
: "Select Load State file", bSave))
{
m_PropertySheetHelper.SaveStateUpdate();
return true;

View File

@ -22,7 +22,7 @@ public:
virtual ~CPropertySheet(){}
virtual void Init(void);
virtual DWORD GetVolumeMax(void); // TODO:TC: Move out of here
virtual uint32_t GetVolumeMax(void); // TODO:TC: Move out of here
virtual bool SaveStateSelectImage(HWND hWindow, bool bSave); // TODO:TC: Move out of here
void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld)
{

View File

@ -94,7 +94,7 @@ void CPropertySheetHelper::FillComboBox(HWND window, int controlid, LPCTSTR choi
while (choices && *choices)
{
SendMessage(combowindow, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)choices);
choices += _tcslen(choices)+1;
choices += strlen(choices)+1;
}
if (SendMessage(combowindow, CB_SETCURSEL, currentchoice, 0) == CB_ERR && currentchoice != -1)
@ -114,13 +114,13 @@ void CPropertySheetHelper::SaveComputerType(eApple2Type NewApple2Type)
void CPropertySheetHelper::ConfigSaveApple2Type(eApple2Type apple2Type)
{
REGSAVE(TEXT(REGVALUE_APPLE2_TYPE), apple2Type);
REGSAVE(REGVALUE_APPLE2_TYPE, apple2Type);
LogFileOutput("Config: Apple2 Type changed to %d\n", apple2Type);
}
void CPropertySheetHelper::SaveCpuType(eCpuType NewCpuType)
{
REGSAVE(TEXT(REGVALUE_CPU_TYPE), NewCpuType);
REGSAVE(REGVALUE_CPU_TYPE, NewCpuType);
}
void CPropertySheetHelper::SetSlot(UINT slot, SS_CARDTYPE newCardType)
@ -139,10 +139,10 @@ void CPropertySheetHelper::SetSlot(UINT slot, SS_CARDTYPE newCardType)
// Used by:
// . CPageDisk: IDC_CIDERPRESS_BROWSE
// . CPageAdvanced: IDC_PRINTER_DUMP_FILENAME_BROWSE
std::string CPropertySheetHelper::BrowseToFile(HWND hWindow, const TCHAR* pszTitle, const TCHAR* REGVALUE, const TCHAR* FILEMASKS)
std::string CPropertySheetHelper::BrowseToFile(HWND hWindow, const char* pszTitle, const char* REGVALUE, const char* FILEMASKS)
{
TCHAR szFilename[MAX_PATH];
RegLoadString(REG_CONFIG, REGVALUE, 1, szFilename, MAX_PATH, TEXT(""));
char szFilename[MAX_PATH];
RegLoadString(REG_CONFIG, REGVALUE, 1, szFilename, MAX_PATH, "");
std::string pathname = szFilename;
OPENFILENAME ofn;
@ -152,9 +152,9 @@ std::string CPropertySheetHelper::BrowseToFile(HWND hWindow, const TCHAR* pszTit
ofn.hwndOwner = hWindow;
ofn.hInstance = GetFrame().g_hInstance;
ofn.lpstrFilter = FILEMASKS;
/*ofn.lpstrFilter = TEXT("Applications (*.exe)\0*.exe\0")
TEXT("Text files (*.txt)\0*.txt\0")
TEXT("All Files\0*.*\0");*/
/*ofn.lpstrFilter = "Applications (*.exe)\0*.exe\0"
"Text files (*.txt)\0*.txt\0"
"All Files\0*.*\0";*/
ofn.lpstrFile = szFilename;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrInitialDir = "";
@ -173,12 +173,12 @@ void CPropertySheetHelper::SaveStateUpdate()
if (m_bSSNewFilename)
{
Snapshot_SetFilename(m_szSSNewFilename, m_szSSNewDirectory);
RegSaveString(TEXT(REG_CONFIG), TEXT(REGVALUE_SAVESTATE_FILENAME), 1, Snapshot_GetPathname());
RegSaveString(REG_CONFIG, REGVALUE_SAVESTATE_FILENAME, 1, Snapshot_GetPathname());
}
}
// NB. OK'ing this property sheet will call SaveStateUpdate()->Snapshot_SetFilename() with this new path & filename
int CPropertySheetHelper::SaveStateSelectImage(HWND hWindow, const TCHAR* pszTitle, bool bSave)
int CPropertySheetHelper::SaveStateSelectImage(HWND hWindow, const char* pszTitle, bool bSave)
{
// Whenever harddisks/disks are inserted (or removed) and *if path has changed* then:
// . Snapshot's path & Snapshot's filename will be updated to reflect the new defaults.
@ -198,8 +198,8 @@ int CPropertySheetHelper::SaveStateSelectImage(HWND hWindow, const TCHAR* pszTit
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hWindow;
ofn.hInstance = GetFrame().g_hInstance;
ofn.lpstrFilter = TEXT("Save State files (*.aws.yaml)\0*.aws.yaml\0")
TEXT("All Files\0*.*\0");
ofn.lpstrFilter = "Save State files (*.aws.yaml)\0*.aws.yaml\0"
"All Files\0*.*\0";
ofn.lpstrFile = szFilename; // Dialog strips the last .EXT from this string (eg. file.aws.yaml is displayed as: file.aws
ofn.nMaxFile = sizeof(szFilename);
ofn.lpstrInitialDir = szDirectory.c_str();
@ -355,12 +355,12 @@ void CPropertySheetHelper::ApplyNewConfig(const CConfigNeedingRestart& ConfigNew
if (CONFIG_CHANGED_LOCAL(m_bEnableTheFreezesF8Rom))
{
REGSAVE(TEXT(REGVALUE_THE_FREEZES_F8_ROM), ConfigNew.m_bEnableTheFreezesF8Rom);
REGSAVE(REGVALUE_THE_FREEZES_F8_ROM, ConfigNew.m_bEnableTheFreezesF8Rom);
}
if (CONFIG_CHANGED_LOCAL(m_videoRefreshRate))
{
REGSAVE(TEXT(REGVALUE_VIDEO_REFRESH_RATE), ConfigNew.m_videoRefreshRate);
REGSAVE(REGVALUE_VIDEO_REFRESH_RATE, ConfigNew.m_videoRefreshRate);
}
}
@ -368,8 +368,8 @@ void CPropertySheetHelper::ApplyNewConfigFromSnapshot(const CConfigNeedingRestar
{
SaveComputerType(ConfigNew.m_Apple2Type);
SaveCpuType(ConfigNew.m_CpuType);
REGSAVE(TEXT(REGVALUE_THE_FREEZES_F8_ROM), ConfigNew.m_bEnableTheFreezesF8Rom);
REGSAVE(TEXT(REGVALUE_VIDEO_REFRESH_RATE), ConfigNew.m_videoRefreshRate);
REGSAVE(REGVALUE_THE_FREEZES_F8_ROM, ConfigNew.m_bEnableTheFreezesF8Rom);
REGSAVE(REGVALUE_VIDEO_REFRESH_RATE, ConfigNew.m_videoRefreshRate);
}
void CPropertySheetHelper::ApplyNewConfig(void)
@ -406,9 +406,9 @@ bool CPropertySheetHelper::IsOkToSaveLoadState(HWND hWnd, const bool bConfigChan
if (bConfigChanged)
{
if (MessageBox(hWnd,
TEXT("The hardware configuration has changed. Save/Load state will lose these changes.\n\n")
TEXT("Are you sure you want to do this?"),
TEXT(REG_CONFIG),
"The hardware configuration has changed. Save/Load state will lose these changes.\n\n"
"Are you sure you want to do this?",
REG_CONFIG,
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDCANCEL)
return false;
}
@ -422,11 +422,11 @@ bool CPropertySheetHelper::IsOkToRestart(HWND hWnd)
return true;
if (MessageBox(hWnd,
TEXT("Restarting the emulator will reset the state ")
TEXT("of the emulated machine, causing you to lose any ")
TEXT("unsaved work.\n\n")
TEXT("Are you sure you want to do this?"),
TEXT(REG_CONFIG),
"Restarting the emulator will reset the state "
"of the emulated machine, causing you to lose any "
"unsaved work.\n\n"
"Are you sure you want to do this?",
REG_CONFIG,
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDCANCEL)
return false;
@ -483,7 +483,7 @@ bool CPropertySheetHelper::HardwareConfigChanged(HWND hWnd)
if (MessageBox(hWnd,
strMsg.c_str(),
TEXT(REG_CONFIG),
REG_CONFIG,
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDCANCEL)
return false;

View File

@ -14,9 +14,9 @@ public:
virtual ~CPropertySheetHelper(){}
void FillComboBox(HWND window, int controlid, LPCTSTR choices, int currentchoice);
std::string BrowseToFile(HWND hWindow, const TCHAR* pszTitle, const TCHAR* REGVALUE, const TCHAR* FILEMASKS);
std::string BrowseToFile(HWND hWindow, const char* pszTitle, const char* REGVALUE, const char* FILEMASKS);
void SaveStateUpdate();
int SaveStateSelectImage(HWND hWindow, const TCHAR* pszTitle, bool bSave);
int SaveStateSelectImage(HWND hWindow, const char* pszTitle, bool bSave);
void PostMsgAfterClose(HWND hWnd, PAGETYPE page);
void ResetPageMask(void) { m_bmPages = 0; } // Req'd because cancelling doesn't clear the page-mask

View File

@ -29,6 +29,7 @@
- Southwestern Data Systems' datakey for SpeedStar Applesoft Compiler (Matthew D'Asaro Dec 2022)
- Dynatech Microsoftware / Cortechs Corp's protection key for "CodeWriter"
- Robocom Ltd's Interface Module for Robo Graphics 500/1000/1500 & RoboCAD 1/2 (BitStik joystick plugs in on top)
- Hayden Book Company, Inc's protection key for "Applesoft Compiler"
*/
#include "StdAfx.h"
#include <sstream>
@ -96,6 +97,9 @@ int CopyProtectionDonglePB0(void)
// Returns the copy protection dongle state of PB1. A return value of -1 means not used by copy protection dongle
int CopyProtectionDonglePB1(void)
{
if (copyProtectionDongleType == DT_HAYDENCOMPILER)
return 0; // connected to GND
return -1;
}
@ -118,6 +122,15 @@ int CopyProtectionDonglePB2(void)
// Returns the copy protection dongle state of PDL(n). A return value of -1 means not used by copy protection dongle
int CopyProtectionDonglePDL(UINT pdl)
{
if (copyProtectionDongleType == DT_HAYDENCOMPILER && pdl == 3)
{
static BYTE haydenValue[4] = {0xFF, 0x96, 0x96, 0x50}; // Derived from reverse-engineered Hayden code - although other than 0xFF, actual values are unknown.
UINT haydenDongleMode = ((UINT)MemGetAnnunciator(2) << 1) | (UINT)MemGetAnnunciator(0);
return haydenValue[haydenDongleMode];
}
//
if (copyProtectionDongleType != DT_ROBOCOM500 && copyProtectionDongleType != DT_ROBOCOM1000 && copyProtectionDongleType != DT_ROBOCOM1500)
return -1;
@ -162,7 +175,7 @@ int CopyProtectionDonglePDL(UINT pdl)
// 1: Add SDS SpeedStar dongle
// 2: Add Cortechs Corp CodeWriter protection key
// Add Robocom Ltd - Robo 500/1000/1500 Interface Modules
static const UINT kUNIT_VERSION = 2;
// 3: Add Hayden Compiler protection key
static const std::string& GetSnapshotStructName_SDSSpeedStar(void)
{
@ -194,6 +207,12 @@ static const std::string& GetSnapshotStructName_Robocom1500(void)
return name;
}
static const std::string& GetSnapshotStructName_HaydenCompiler(void)
{
static const std::string name("Hayden - Applesoft Compiler protection key");
return name;
}
void CopyProtectionDongleSaveSnapshot(YamlSaveHelper& yamlSaveHelper)
{
if (copyProtectionDongleType == DT_SDSSPEEDSTAR)
@ -221,13 +240,18 @@ void CopyProtectionDongleSaveSnapshot(YamlSaveHelper& yamlSaveHelper)
yamlSaveHelper.SaveString(SS_YAML_KEY_DEVICE, GetSnapshotStructName_Robocom1500());
// NB. No state for this dongle
}
else if (copyProtectionDongleType == DT_HAYDENCOMPILER)
{
yamlSaveHelper.SaveString(SS_YAML_KEY_DEVICE, GetSnapshotStructName_HaydenCompiler());
// NB. No state for this dongle
}
else
{
_ASSERT(0);
}
}
void CopyProtectionDongleLoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version)
void CopyProtectionDongleLoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version, UINT kUNIT_VERSION)
{
if (version < 1 || version > kUNIT_VERSION)
{
@ -261,6 +285,10 @@ void CopyProtectionDongleLoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT versi
{
copyProtectionDongleType = DT_ROBOCOM1500;
}
else if (device == GetSnapshotStructName_HaydenCompiler())
{
copyProtectionDongleType = DT_HAYDENCOMPILER;
}
else
{
_ASSERT(0);

View File

@ -3,7 +3,7 @@
#include "Common.h"
// Must be in the same order as in PageAdvanced.cpp
enum DONGLETYPE { DT_EMPTY, DT_SDSSPEEDSTAR, DT_CODEWRITER, DT_ROBOCOM500, DT_ROBOCOM1000, DT_ROBOCOM1500 };
enum DONGLETYPE { DT_EMPTY, DT_SDSSPEEDSTAR, DT_CODEWRITER, DT_ROBOCOM500, DT_ROBOCOM1000, DT_ROBOCOM1500, DT_HAYDENCOMPILER };
void SetCopyProtectionDongleType(DONGLETYPE type);
DONGLETYPE GetCopyProtectionDongleType(void);
@ -14,4 +14,4 @@ int CopyProtectionDonglePB2(void);
int CopyProtectionDonglePDL(UINT pdl);
void CopyProtectionDongleSaveSnapshot(class YamlSaveHelper& yamlSaveHelper);
void CopyProtectionDongleLoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT version);
void CopyProtectionDongleLoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT version, UINT kUNIT_VERSION);

View File

@ -69,12 +69,12 @@ bool g_bDisableDirectInput = false;
bool g_bDisableDirectSound = false;
bool g_bDisableDirectSoundMockingboard = false;
DWORD g_dwSpeed = SPEED_NORMAL; // Affected by Config dialog's speed slider bar
uint32_t g_dwSpeed = SPEED_NORMAL; // Affected by Config dialog's speed slider bar
double g_fCurrentCLK6502 = CLK_6502_NTSC; // Affected by Config dialog's speed slider bar
static double g_fMHz = 1.0; // Affected by Config dialog's speed slider bar
int g_nCpuCyclesFeedback = 0;
DWORD g_dwCyclesThisFrame = 0;
uint32_t g_dwCyclesThisFrame = 0;
int g_nMemoryClearType = MIP_FF_FF_00_00; // Note: -1 = random MIP in Memory.cpp MemReset()
@ -128,7 +128,7 @@ void LogPerfTimings(void)
//===========================================================================
static DWORD dwLogKeyReadTickStart;
static uint32_t dwLogKeyReadTickStart;
static bool bLogKeyReadDone = false;
void LogFileTimeUntilFirstKeyReadReset(void)
@ -154,13 +154,13 @@ void LogFileTimeUntilFirstKeyRead(void)
if (!g_fh || bLogKeyReadDone)
return;
if ( (mem[regs.pc-3] != 0x2C) // AZTEC: bit $c000
&& !((regs.pc-2) == 0xE797 && mem[regs.pc-2] == 0xB1 && mem[regs.pc-1] == 0x50) // Phasor1: lda ($50),y
&& !((regs.pc-3) == 0x0895 && mem[regs.pc-3] == 0xAD) // Rescue Raiders v1.3,v1.5: lda $c000
if ( (ReadByteFromMemory(regs.pc-3) != 0x2C) // AZTEC: bit $c000
&& !((regs.pc-2) == 0xE797 && ReadByteFromMemory(regs.pc-2) == 0xB1 && ReadByteFromMemory(regs.pc-1) == 0x50) // Phasor1: lda ($50),y
&& !((regs.pc-3) == 0x0895 && ReadByteFromMemory(regs.pc-3) == 0xAD) // Rescue Raiders v1.3,v1.5: lda $c000
)
return;
DWORD dwTime = GetTickCount() - dwLogKeyReadTickStart;
uint32_t dwTime = GetTickCount() - dwLogKeyReadTickStart;
LogFileOutput("Time from emulation reboot until first $C000 access: %d msec\n", dwTime);
@ -200,7 +200,7 @@ double Get6502BaseClock(void)
void SetCurrentCLK6502(void)
{
static DWORD dwPrevSpeed = (DWORD) -1;
static uint32_t dwPrevSpeed = (uint32_t) -1;
static VideoRefreshRate_e prevVideoRefreshRate = VR_NONE;
if (dwPrevSpeed == g_dwSpeed && GetVideo().GetVideoRefreshRate() == prevVideoRefreshRate)

View File

@ -45,11 +45,11 @@ bool SetCurrentImageDir(const std::string& pszImageDir);
extern bool g_bRestart;
extern DWORD g_dwSpeed;
extern uint32_t g_dwSpeed;
extern double g_fCurrentCLK6502;
extern int g_nCpuCyclesFeedback;
extern DWORD g_dwCyclesThisFrame;
extern uint32_t g_dwCyclesThisFrame;
extern int g_nMemoryClearType; // Cmd line switch: use specific MIP (Memory Initialization Pattern)

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
#pragma once
#include "../Common.h"
#include "../MemoryDefs.h"
#include "Debugger_Types.h"
#include "Debugger_DisassemblerData.h"
@ -20,7 +21,7 @@
extern bool g_bDebuggerEatKey;
// Benchmarking
extern DWORD extbench;
extern uint32_t extbench;
// Bookmarks
extern int g_nBookmarks;
@ -51,7 +52,7 @@
extern Breakpoint_t g_aBreakpoints[ MAX_BREAKPOINTS ];
extern const char *g_aBreakpointSource [ NUM_BREAKPOINT_SOURCES ];
extern const TCHAR *g_aBreakpointSymbols[ NUM_BREAKPOINT_OPERATORS ];
extern const char *g_aBreakpointSymbols[ NUM_BREAKPOINT_OPERATORS ];
extern int g_nDebugBreakOnInvalid ;
extern int g_iDebugBreakOnOpcode ;
@ -71,7 +72,7 @@
bool operator() ( const Command_t & rLHS, const Command_t & rRHS ) const
{
// return true if lhs<rhs
return (_tcscmp( rLHS.m_sName, rRHS.m_sName ) <= 0) ? true : false;
return (strcmp( rLHS.m_sName, rRHS.m_sName ) <= 0) ? true : false;
}
};
@ -178,7 +179,7 @@
void DebugInitialize ();
void DebugReset(void);
void DebuggerInputConsoleChar( TCHAR ch );
void DebuggerInputConsoleChar( char ch );
void DebuggerProcessKey( int keycode );
void DebuggerUpdate();

View File

@ -1,13 +0,0 @@
#pragma once
const int _6502_BRANCH_POS = +127;
const int _6502_BRANCH_NEG = -128;
const unsigned int _6502_ZEROPAGE_END = 0x00FF;
const unsigned int _6502_STACK_BEGIN = 0x0100;
const unsigned int _6502_STACK_END = 0x01FF;
const unsigned int _6502_IO_BEGIN = 0xC000;
const unsigned int _6502_IO_END = 0xC0FF;
const unsigned int _6502_BRK_VECTOR = 0xFFFE;
const unsigned int _6502_MEM_BEGIN = 0x0000;
const unsigned int _6502_MEM_END = 0xFFFF;
const unsigned int _6502_MEM_LEN = _6502_MEM_END + 1;

View File

@ -43,23 +43,23 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
AddressingMode_t g_aOpmodes[ NUM_ADDRESSING_MODES ] =
{ // Output, but eventually used for Input when Assembler is working.
{TEXT("") , 1 , "(implied)" }, // (implied)
{TEXT("") , 1 , "n/a 1" }, // INVALID1
{TEXT("") , 2 , "n/a 2" }, // INVALID2
{TEXT("") , 3 , "n/a 3" }, // INVALID3
{TEXT("%02X") , 2 , "Immediate" }, // AM_M // #$%02X -> %02X
{TEXT("%04X") , 3 , "Absolute" }, // AM_A
{TEXT("%02X") , 2 , "Zero Page" }, // AM_Z
{TEXT("%04X,X") , 3 , "Absolute,X" }, // AM_AX // %s,X
{TEXT("%04X,Y") , 3 , "Absolute,Y" }, // AM_AY // %s,Y
{TEXT("%02X,X") , 2 , "Zero Page,X" }, // AM_ZX // %s,X
{TEXT("%02X,Y") , 2 , "Zero Page,Y" }, // AM_ZY // %s,Y
{TEXT("%s") , 2 , "Relative" }, // AM_R
{TEXT("(%02X,X)"), 2 , "(Zero Page),X" }, // AM_IZX // ($%02X,X) -> %s,X
{TEXT("(%04X,X)"), 3 , "(Absolute),X" }, // AM_IAX // ($%04X,X) -> %s,X
{TEXT("(%02X),Y"), 2 , "(Zero Page),Y" }, // AM_NZY // ($%02X),Y
{TEXT("(%02X)") , 2 , "(Zero Page)" }, // AM_NZ // ($%02X) -> $%02X
{TEXT("(%04X)") , 3 , "(Absolute)" } // AM_NA // (%04X) -> %s
{"" , 1 , "(implied)" }, // (implied)
{"" , 1 , "n/a 1" }, // INVALID1
{"" , 2 , "n/a 2" }, // INVALID2
{"" , 3 , "n/a 3" }, // INVALID3
{"%02X" , 2 , "Immediate" }, // AM_M // #$%02X -> %02X
{"%04X" , 3 , "Absolute" }, // AM_A
{"%02X" , 2 , "Zero Page" }, // AM_Z
{"%04X,X" , 3 , "Absolute,X" }, // AM_AX // %s,X
{"%04X,Y" , 3 , "Absolute,Y" }, // AM_AY // %s,Y
{"%02X,X" , 2 , "Zero Page,X" }, // AM_ZX // %s,X
{"%02X,Y" , 2 , "Zero Page,Y" }, // AM_ZY // %s,Y
{"%s" , 2 , "Relative" }, // AM_R
{"(%02X,X)", 2 , "(Zero Page),X" }, // AM_IZX // ($%02X,X) -> %s,X
{"(%04X,X)", 3 , "(Absolute),X" }, // AM_IAX // ($%04X,X) -> %s,X
{"(%02X),Y", 2 , "(Zero Page),Y" }, // AM_NZY // ($%02X),Y
{"(%02X)" , 2 , "(Zero Page)" }, // AM_NZ // ($%02X) -> $%02X
{"(%04X)" , 3 , "(Absolute)" } // AM_NA // (%04X) -> %s
};
@ -168,7 +168,7 @@ const Opcodes_t g_aOpcodes65C02[ NUM_OPCODES ] =
};
const Opcodes_t g_aOpcodes6502[ NUM_OPCODES ] =
{ // Should match Cpu.cpp InternalCpuExecute() switch (*(mem+regs.pc++)) !!
{
/*
Based on: http://axis.llx.com/~nparker/a2/opcodes.html
@ -477,8 +477,8 @@ WORD _6502_GetStackReturnAddress ()
WORD _6502_PeekStackReturnAddress (WORD & nStack)
{
WORD nAddress;
nAddress = ((unsigned) *(LPBYTE)(mem + 0x100 + (nStack & 0xFF)) ); nStack++;
nAddress += ((unsigned) *(LPBYTE)(mem + 0x100 + (nStack & 0xFF)) << 8);
nAddress = ReadByteFromMemory(_6502_STACK_BEGIN + (nStack & 0xFF)); nStack++;
nAddress += (ReadByteFromMemory(_6502_STACK_BEGIN + (nStack & 0xFF)) << 8);
nAddress++;
return nAddress;
}
@ -534,7 +534,7 @@ int _6502_GetOpmodeOpbyte ( const int nBaseAddress, int & iOpmode_, int & nOpby
}
#endif
int iOpcode_ = *(mem + nBaseAddress);
int iOpcode_ = ReadByteFromMemory(nBaseAddress);
iOpmode_ = g_aOpcodes[ iOpcode_ ].nAddressMode;
nOpbyte_ = g_aOpmodes[ iOpmode_ ].m_nBytes;
@ -553,7 +553,7 @@ int _6502_GetOpmodeOpbyte ( const int nBaseAddress, int & iOpmode_, int & nOpby
if ( pData_ )
*pData_ = pData;
const DWORD nEndAddress = pData->nEndAddress;
const uint32_t nEndAddress = pData->nEndAddress;
const int nDisplayLen = nEndAddress - nBaseAddress + 1; // *inclusive* KEEP IN SYNC: _CmdDefineByteRange() CmdDisasmDataList() _6502_GetOpmodeOpbyte() FormatNopcodeBytes()
nSlack = nDisplayLen;
@ -571,7 +571,7 @@ int _6502_GetOpmodeOpbyte ( const int nBaseAddress, int & iOpmode_, int & nOpby
case NOP_WORD_2: nOpbyte_ = 4; iOpmode_ = AM_M; break;
case NOP_WORD_4: nOpbyte_ = 8; iOpmode_ = AM_M; break;
case NOP_ADDRESS:nOpbyte_ = 2; iOpmode_ = AM_A; // BUGFIX: 2.6.2.33 Define Address should be shown as Absolute mode, not Indirect Absolute mode. DA BASIC.FPTR D000:D080 // was showing as "da (END-1)" now shows as "da END-1"
pData->nTargetAddress = *(LPWORD)(mem+nBaseAddress);
pData->nTargetAddress = ReadWordFromMemory(nBaseAddress);
break;
case NOP_STRING_APPLE:
iOpmode_ = AM_DATA;
@ -644,9 +644,9 @@ bool _6502_GetTargets (WORD nAddress, int *pTargetPartial_, int *pTargetPartial2
if (pTargetBytes_)
*pTargetBytes_ = 0;
BYTE nOpcode = mem[nAddress];
BYTE nTarget8 = mem[(nAddress+1)&0xFFFF];
WORD nTarget16 = (mem[(nAddress+2)&0xFFFF]<<8) | nTarget8;
BYTE nOpcode = ReadByteFromMemory(nAddress);
BYTE nTarget8 = ReadByteFromMemory(nAddress + 1);
WORD nTarget16 = (ReadByteFromMemory(nAddress + 2) << 8) | nTarget8;
int eMode = g_aOpcodes[ nOpcode ].nAddressMode;
@ -670,7 +670,7 @@ bool _6502_GetTargets (WORD nAddress, int *pTargetPartial_, int *pTargetPartial2
*pTargetPartial_ = _6502_STACK_BEGIN + ((sp+1) & 0xFF);
*pTargetPartial2_ = _6502_STACK_BEGIN + ((sp+2) & 0xFF);
nTarget16 = mem[*pTargetPartial_] + (mem[*pTargetPartial2_]<<8);
nTarget16 = ReadByteFromMemory(*pTargetPartial_) + (ReadByteFromMemory(*pTargetPartial2_) << 8);
if (nOpcode == OPCODE_RTS)
++nTarget16;
@ -682,7 +682,7 @@ bool _6502_GetTargets (WORD nAddress, int *pTargetPartial_, int *pTargetPartial2
//*pTargetPartial3_ = _6502_STACK_BEGIN + ((regs.sp-2) & 0xFF); // TODO: PHP
//*pTargetPartial4_ = _6502_BRK_VECTOR + 0; // TODO
//*pTargetPartial5_ = _6502_BRK_VECTOR + 1; // TODO
nTarget16 = *(LPWORD)(mem + _6502_BRK_VECTOR);
nTarget16 = ReadWordFromMemory(_6502_INTERRUPT_VECTOR);
}
else // PHn/PLn
{
@ -720,7 +720,7 @@ bool _6502_GetTargets (WORD nAddress, int *pTargetPartial_, int *pTargetPartial2
*pTargetPartial_ = nTarget16;
*pTargetPartial2_ = nTarget16+1;
if (bIncludeNextOpcodeAddress)
*pTargetPointer_ = *(LPWORD)(mem + nTarget16);
*pTargetPointer_ = ReadWordFromMemory(nTarget16);
if (pTargetBytes_)
*pTargetBytes_ = 2;
break;
@ -746,7 +746,7 @@ bool _6502_GetTargets (WORD nAddress, int *pTargetPartial_, int *pTargetPartial2
if (GetMainCpu() == CPU_6502 && (nTarget16 & 0xff) == 0xff)
*pTargetPartial2_ = nTarget16 & 0xff00;
if (bIncludeNextOpcodeAddress)
*pTargetPointer_ = mem[*pTargetPartial_] | (mem[*pTargetPartial2_] << 8);
*pTargetPointer_ = ReadByteFromMemory(*pTargetPartial_) | (ReadByteFromMemory(*pTargetPartial2_) << 8);
if (pTargetBytes_)
*pTargetBytes_ = 2;
break;
@ -754,21 +754,21 @@ bool _6502_GetTargets (WORD nAddress, int *pTargetPartial_, int *pTargetPartial2
case AM_IZX: // Indexed (Zeropage Indirect, X)
nTarget8 = (nTarget8 + regs.x) & 0xFF;
*pTargetPartial_ = nTarget8;
*pTargetPointer_ = *(LPWORD)(mem + nTarget8);
*pTargetPointer_ = ReadWordFromMemory(nTarget8);
if (pTargetBytes_)
*pTargetBytes_ = 2;
break;
case AM_NZY: // Indirect (Zeropage) Indexed, Y
*pTargetPartial_ = nTarget8;
*pTargetPointer_ = ((*(LPWORD)(mem + nTarget8)) + regs.y) & _6502_MEM_END; // Bugfix:
*pTargetPointer_ = ((ReadWordFromMemory(nTarget8)) + regs.y) & _6502_MEM_END;
if (pTargetBytes_)
*pTargetBytes_ = 1;
break;
case AM_NZ: // Indirect (Zeropage)
*pTargetPartial_ = nTarget8;
*pTargetPointer_ = *(LPWORD)(mem + nTarget8);
*pTargetPointer_ = ReadWordFromMemory(nTarget8);
if (pTargetBytes_)
*pTargetBytes_ = 2;
break;
@ -899,9 +899,9 @@ bool _6502_IsOpcodeValid ( int iOpcode )
//===========================================================================
Hash_t AssemblerHashMnemonic ( const TCHAR * pMnemonic )
Hash_t AssemblerHashMnemonic ( const char * pMnemonic )
{
const TCHAR *pText = pMnemonic;
const char *pText = pMnemonic;
Hash_t nMnemonicHash = 0;
int iHighBits;
@ -944,7 +944,7 @@ void AssemblerHashOpcodes ()
for ( iOpcode = 0; iOpcode < NUM_OPCODES; iOpcode++ )
{
const TCHAR *pMnemonic = g_aOpcodes65C02[ iOpcode ].sMnemonic;
const char *pMnemonic = g_aOpcodes65C02[ iOpcode ].sMnemonic;
nMnemonicHash = AssemblerHashMnemonic( pMnemonic );
g_aOpcodesHash[ iOpcode ] = nMnemonicHash;
#if DEBUG_ASSEMBLER
@ -965,8 +965,8 @@ void AssemblerHashDirectives ()
for ( iOpcode = 0; iOpcode < NUM_ASM_M_DIRECTIVES; iOpcode++ )
{
int iNopcode = FIRST_M_DIRECTIVE + iOpcode;
//. const TCHAR *pMnemonic = g_aAssemblerDirectivesMerlin[ iOpcode ].m_pMnemonic;
const TCHAR *pMnemonic = g_aAssemblerDirectives[ iNopcode ].m_pMnemonic;
//. const char *pMnemonic = g_aAssemblerDirectivesMerlin[ iOpcode ].m_pMnemonic;
const char *pMnemonic = g_aAssemblerDirectives[ iNopcode ].m_pMnemonic;
nMnemonicHash = AssemblerHashMnemonic( pMnemonic );
g_aAssemblerDirectives[ iNopcode ].m_nHash = nMnemonicHash;
}
@ -1037,14 +1037,11 @@ int AssemblerPokeAddress( const int Opcode, const int nOpmode, const WORD nBaseA
// if (nOpbytes != nBytes)
// ConsoleDisplayError( " ERROR: Input Opcode bytes differs from actual!" );
*(memdirty + (nBaseAddress >> 8)) |= 1;
// *(mem + nBaseAddress) = (BYTE) nOpcode;
if (nOpbytes > 1)
*(mem + nBaseAddress + 1) = (BYTE)(nTargetOffset >> 0);
WriteByteToMemory(nBaseAddress + 1, (BYTE)(nTargetOffset >> 0));
if (nOpbytes > 2)
*(mem + nBaseAddress + 2) = (BYTE)(nTargetOffset >> 8);
WriteByteToMemory(nBaseAddress + 2, (BYTE)(nTargetOffset >> 8));
return nOpbytes;
}
@ -1065,7 +1062,7 @@ bool AssemblerPokeOpcodeAddress( const WORD nBaseAddress )
if (nOpmode == iAddressMode)
{
*(mem + nBaseAddress) = (BYTE) nOpcode;
WriteByteToMemory(nBaseAddress, (BYTE)nOpcode);
int nOpbytes = AssemblerPokeAddress( nOpcode, nOpmode, nBaseAddress, nTargetValue );
if (m_bDelayedTargetsDirty)
@ -1138,12 +1135,12 @@ bool AssemblerGetArgs( int iArg, int nArgs, WORD nBaseAddress )
{
if (eNextState != AS_GET_MNEMONIC_PARM)
{
ConsoleBufferPush( TEXT( " Syntax Error: '#'" ) );
ConsoleBufferPush( " Syntax Error: '#'" );
return false;
}
if (TestFlag( AF_HaveHash ))
{
ConsoleBufferPush( TEXT( " Syntax Error: Extra '#'" ) ); // No thanks, we already have one
ConsoleBufferPush( " Syntax Error: Extra '#'" ); // No thanks, we already have one
return false;
}
SetFlag( AF_HaveHash );
@ -1157,7 +1154,7 @@ bool AssemblerGetArgs( int iArg, int nArgs, WORD nBaseAddress )
{
if (TestFlag( AF_HaveDollar ))
{
ConsoleBufferPush( TEXT( " Syntax Error: Extra '$'" ) ); // No thanks, we already have one
ConsoleBufferPush( " Syntax Error: Extra '$'" ); // No thanks, we already have one
return false;
}
@ -1176,7 +1173,7 @@ bool AssemblerGetArgs( int iArg, int nArgs, WORD nBaseAddress )
{
if (TestFlag( AF_HaveLeftParen ))
{
ConsoleBufferPush( TEXT( " Syntax Error: Extra '('" ) ); // No thanks, we already have one
ConsoleBufferPush( " Syntax Error: Extra '('" ); // No thanks, we already have one
return false;
}
SetFlag( AF_HaveLeftParen );
@ -1189,7 +1186,7 @@ bool AssemblerGetArgs( int iArg, int nArgs, WORD nBaseAddress )
{
if (TestFlag( AF_HaveRightParen ))
{
ConsoleBufferPush( TEXT( " Syntax Error: Extra ')'" ) ); // No thanks, we already have one
ConsoleBufferPush( " Syntax Error: Extra ')'" ); // No thanks, we already have one
return false;
}
SetFlag( AF_HaveRightParen );
@ -1202,7 +1199,7 @@ bool AssemblerGetArgs( int iArg, int nArgs, WORD nBaseAddress )
{
if (TestFlag( AF_HaveComma ))
{
ConsoleBufferPush( TEXT( " Syntax Error: Extra ','" ) ); // No thanks, we already have one
ConsoleBufferPush( " Syntax Error: Extra ','" ); // No thanks, we already have one
return false;
}
SetFlag( AF_HaveComma );
@ -1294,7 +1291,7 @@ bool AssemblerGetArgs( int iArg, int nArgs, WORD nBaseAddress )
{
if (! TestFlag( AF_HaveComma ))
{
ConsoleBufferPush( TEXT( " Syntax Error: Missing ','" ) );
ConsoleBufferPush( " Syntax Error: Missing ','" );
return false;
}
SetFlag( AF_HaveRegisterX );
@ -1303,7 +1300,7 @@ bool AssemblerGetArgs( int iArg, int nArgs, WORD nBaseAddress )
{
if (! (TestFlag( AF_HaveComma )))
{
ConsoleBufferPush( TEXT( " Syntax Error: Missing ','" ) );
ConsoleBufferPush( " Syntax Error: Missing ','" );
return false;
}
SetFlag( AF_HaveRegisterY );
@ -1328,13 +1325,13 @@ bool AssemblerUpdateAddressingMode()
if ((TestFlag( AF_HaveLeftParen )) && (! TestFlag( AF_HaveRightParen )))
{
ConsoleBufferPush( TEXT( " Syntax Error: Missing ')'" ) );
ConsoleBufferPush( " Syntax Error: Missing ')'" );
return false;
}
if ((! TestFlag( AF_HaveLeftParen )) && ( TestFlag( AF_HaveRightParen )))
{
ConsoleBufferPush( TEXT( " Syntax Error: Missing '('" ) );
ConsoleBufferPush( " Syntax Error: Missing '('" );
return false;
}
@ -1342,7 +1339,7 @@ bool AssemblerUpdateAddressingMode()
{
if ((! TestFlag( AF_HaveRegisterX )) && (! TestFlag( AF_HaveRegisterY )))
{
ConsoleBufferPush( TEXT( " Syntax Error: Index 'X' or 'Y'" ) );
ConsoleBufferPush( " Syntax Error: Index 'X' or 'Y'" );
return false;
}
}
@ -1507,7 +1504,7 @@ bool Assemble( int iArg, int nArgs, WORD nAddress )
m_nAsmBaseAddress = nAddress;
TCHAR *pMnemonic = g_aArgs[ iArg ].sArg;
char *pMnemonic = g_aArgs[ iArg ].sArg;
Hash_t nMnemonicHash = AssemblerHashMnemonic( pMnemonic );
#if DEBUG_ASSEMBLER
@ -1536,7 +1533,7 @@ bool Assemble( int iArg, int nArgs, WORD nAddress )
{
// Check for assembler directive
ConsoleBufferPush( TEXT(" Syntax Error: Invalid mnemonic") );
ConsoleBufferPush( " Syntax Error: Invalid mnemonic" );
return false;
}
else

View File

@ -206,7 +206,7 @@ extern int g_aAssemblerFirstDirective[ NUM_ASSEMBLERS ];
bool _6502_IsOpcodeValid( int nOpcode );
// Assembler
Hash_t AssemblerHashMnemonic ( const TCHAR * pMnemonic );
Hash_t AssemblerHashMnemonic ( const char * pMnemonic );
// bool AssemblerGetAddressingMode ( int iArg, int nArgs, WORD nAddress, std::vector<int> & vOpcodes );
void _CmdAssembleHashDump ();

View File

@ -144,6 +144,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
COLOR_CUSTOM_01, // FG_AY8913_EVEN
Y8, // FG_AY8913_ODD
R8, // FG_AY8913_FUNCTION
R8, // FG_INFO_ADDRESS_SY6522_AY8913_BAD
};
@ -202,7 +203,7 @@ static void _SetupColorRamp(const int iPrimary, int & iColor_)
int nR = bR ? nC : 0;
int nG = bG ? nC : 0;
int nB = bB ? nC : 0;
DWORD nColor = RGB(nR, nG, nB);
uint32_t nColor = RGB(nR, nG, nB);
g_aColorPalette[iColor_] = nColor;
#if DEBUG_COLOR_RAMP
strRamp += StrFormat("RGB(%3d,%3d,%3d), ", nR, nG, nB);

View File

@ -29,7 +29,7 @@
COLOR_CUSTOM_01, COLOR_CUSTOM_02, COLOR_CUSTOM_03, COLOR_CUSTOM_04,
COLOR_CUSTOM_05, COLOR_CUSTOM_06, COLOR_CUSTOM_07, COLOR_CUSTOM_08,
COLOR_CUSTOM_09, COLOR_CUSTOM_11, CUSTOM_COLOR_11, COLOR_CUSTOM_12,
COLOR_CUSTOM_09, COLOR_CUSTOM_10, COLOR_CUSTOM_11, COLOR_CUSTOM_12,
COLOR_CUSTOM_13, COLOR_CUSTOM_14, COLOR_CUSTOM_15, COLOR_CUSTOM_16,
NUM_PALETTE,
@ -138,6 +138,7 @@
, FG_AY8913_EVEN
, FG_AY8913_ODD
, FG_AY8913_FUNCTION
, FG_INFO_ADDRESS_SY6522_AY8913_BAD
, NUM_DEBUG_COLORS
};

View File

@ -40,191 +40,191 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Command_t g_aCommands[] =
{
// Assembler
// {TEXT("!") , CmdAssemberMini , CMD_ASSEMBLER_MINI , "Mini assembler" },
{TEXT("A") , CmdAssemble , CMD_ASSEMBLE , "Assemble instructions" },
// {"!" , CmdAssemberMini , CMD_ASSEMBLER_MINI , "Mini assembler" },
{"A" , CmdAssemble , CMD_ASSEMBLE , "Assemble instructions" },
// CPU (Main)
{TEXT(".") , CmdCursorJumpPC , CMD_CURSOR_JUMP_PC , "Locate the cursor in the disasm window" }, // centered
{TEXT("=") , CmdCursorSetPC , CMD_CURSOR_SET_PC , "Sets the PC to the current instruction" },
{TEXT("G") , CmdGoNormalSpeed , CMD_GO_NORMAL_SPEED , "Run at normal speed [until PC == address]" },
{TEXT("GG") , CmdGoFullSpeed , CMD_GO_FULL_SPEED , "Run at full speed [until PC == address]" },
{TEXT("IN") , CmdIn , CMD_IN , "Input byte from IO $C0xx" },
{TEXT("KEY") , CmdKey , CMD_INPUT_KEY , "Feed key into emulator" },
{TEXT("JSR") , CmdJSR , CMD_JSR , "Call sub-routine" },
{TEXT("NOP") , CmdNOP , CMD_NOP , "Zap the current instruction with a NOP" },
{TEXT("OUT") , CmdOut , CMD_OUT , "Output byte to IO $C0xx" },
{TEXT("LBR") , CmdLBR , CMD_LBR , "Show Last Branch Record" },
{"." , CmdCursorJumpPC , CMD_CURSOR_JUMP_PC , "Locate the cursor in the disasm window" }, // centered
{"=" , CmdCursorSetPC , CMD_CURSOR_SET_PC , "Sets the PC to the current instruction" },
{"G" , CmdGoNormalSpeed , CMD_GO_NORMAL_SPEED , "Run at normal speed [until PC == address]" },
{"GG" , CmdGoFullSpeed , CMD_GO_FULL_SPEED , "Run at full speed [until PC == address]" },
{"IN" , CmdIn , CMD_IN , "Input byte from IO $C0xx" },
{"KEY" , CmdKey , CMD_INPUT_KEY , "Feed key into emulator" },
{"JSR" , CmdJSR , CMD_JSR , "Call sub-routine" },
{"NOP" , CmdNOP , CMD_NOP , "Zap the current instruction with a NOP" },
{"OUT" , CmdOut , CMD_OUT , "Output byte to IO $C0xx" },
{"LBR" , CmdLBR , CMD_LBR , "Show Last Branch Record" },
// CPU - Meta Info
{TEXT("PROFILE") , CmdProfile , CMD_PROFILE , "List/Save 6502 profiling" },
{TEXT("R") , CmdRegisterSet , CMD_REGISTER_SET , "Set register" },
{"PROFILE" , CmdProfile , CMD_PROFILE , "List/Save 6502 profiling" },
{"R" , CmdRegisterSet , CMD_REGISTER_SET , "Set register" },
// CPU - Stack
{TEXT("POP") , CmdStackPop , CMD_STACK_POP },
{TEXT("PPOP") , CmdStackPopPseudo , CMD_STACK_POP_PSEUDO },
{TEXT("PUSH") , CmdStackPop , CMD_STACK_PUSH },
// {TEXT("RTS") , CmdStackReturn , CMD_STACK_RETURN },
{TEXT("P") , CmdStepOver , CMD_STEP_OVER , "Step current instruction" },
{TEXT("RTS") , CmdStepOut , CMD_STEP_OUT , "Step out of subroutine" },
{"POP" , CmdStackPop , CMD_STACK_POP },
{"PPOP" , CmdStackPopPseudo , CMD_STACK_POP_PSEUDO },
{"PUSH" , CmdStackPop , CMD_STACK_PUSH },
// {"RTS" , CmdStackReturn , CMD_STACK_RETURN },
{"P" , CmdStepOver , CMD_STEP_OVER , "Step current instruction" },
{"RTS" , CmdStepOut , CMD_STEP_OUT , "Step out of subroutine" },
// CPU - Meta Info
{TEXT("T") , CmdTrace , CMD_TRACE , "Trace current instruction" },
{TEXT("TF") , CmdTraceFile , CMD_TRACE_FILE , "Save trace to filename [with video scanner info]" },
{TEXT("TL") , CmdTraceLine , CMD_TRACE_LINE , "Trace (with cycle counting)" },
{TEXT("U") , CmdUnassemble , CMD_UNASSEMBLE , "Disassemble instructions" },
// {TEXT("WAIT") , CmdWait , CMD_WAIT , "Run until
{"T" , CmdTrace , CMD_TRACE , "Trace current instruction" },
{"TF" , CmdTraceFile , CMD_TRACE_FILE , "Save trace to filename [with video scanner info]" },
{"TL" , CmdTraceLine , CMD_TRACE_LINE , "Trace (with cycle counting)" },
{"U" , CmdUnassemble , CMD_UNASSEMBLE , "Disassemble instructions" },
// {"WAIT" , CmdWait , CMD_WAIT , "Run until
// Bookmarks
{TEXT("BM") , CmdBookmark , CMD_BOOKMARK , "Alias for BMA (Bookmark Add)" },
{TEXT("BMA") , CmdBookmarkAdd , CMD_BOOKMARK_ADD , "Add/Update addess to bookmark" },
{TEXT("BMC") , CmdBookmarkClear , CMD_BOOKMARK_CLEAR , "Clear (remove) bookmark" },
{TEXT("BML") , CmdBookmarkList , CMD_BOOKMARK_LIST , "List all bookmarks" },
{TEXT("BMG") , CmdBookmarkGoto , CMD_BOOKMARK_GOTO , "Move cursor to bookmark" },
// {TEXT("BMLOAD") , CmdBookmarkLoad , CMD_BOOKMARK_LOAD , "Load bookmarks" },
{TEXT("BMSAVE") , CmdBookmarkSave , CMD_BOOKMARK_SAVE , "Save bookmarks" },
{"BM" , CmdBookmark , CMD_BOOKMARK , "Alias for BMA (Bookmark Add)" },
{"BMA" , CmdBookmarkAdd , CMD_BOOKMARK_ADD , "Add/Update addess to bookmark" },
{"BMC" , CmdBookmarkClear , CMD_BOOKMARK_CLEAR , "Clear (remove) bookmark" },
{"BML" , CmdBookmarkList , CMD_BOOKMARK_LIST , "List all bookmarks" },
{"BMG" , CmdBookmarkGoto , CMD_BOOKMARK_GOTO , "Move cursor to bookmark" },
// {"BMLOAD" , CmdBookmarkLoad , CMD_BOOKMARK_LOAD , "Load bookmarks" },
{"BMSAVE" , CmdBookmarkSave , CMD_BOOKMARK_SAVE , "Save bookmarks" },
// Breakpoints
{TEXT("BRK") , CmdBreakInvalid , CMD_BREAK_INVALID , "Enter debugger on BRK or INVALID" },
{TEXT("BRKOP") , CmdBreakOpcode , CMD_BREAK_OPCODE , "Enter debugger on opcode" },
{TEXT("BRKINT") , CmdBreakOnInterrupt , CMD_BREAK_ON_INTERRUPT , "Enter debugger on interrupt" },
{TEXT("BP") , CmdBreakpoint , CMD_BREAKPOINT , "Alias for BPR (Breakpoint Register Add)" },
{TEXT("BPA") , CmdBreakpointAddSmart, CMD_BREAKPOINT_ADD_SMART , "Add (smart) breakpoint" },
// {TEXT("BPP") , CmdBreakpointAddFlag , CMD_BREAKPOINT_ADD_FLAG , "Add breakpoint on flags" },
{TEXT("BPR") , CmdBreakpointAddReg , CMD_BREAKPOINT_ADD_REG , "Add breakpoint on register value" }, // NOTE! Different from SoftICE !!!!
{TEXT("BPX") , CmdBreakpointAddPC , CMD_BREAKPOINT_ADD_PC , "Add breakpoint at current instruction" },
{TEXT("BPIO") , CmdBreakpointAddIO , CMD_BREAKPOINT_ADD_IO , "Add breakpoint for IO address $C0xx" },
{TEXT("BPM") , CmdBreakpointAddMemA , CMD_BREAKPOINT_ADD_MEM , "Add breakpoint on memory access" }, // SoftICE
{TEXT("BPMR") , CmdBreakpointAddMemR , CMD_BREAKPOINT_ADD_MEMR , "Add breakpoint on memory read access" },
{TEXT("BPMW") , CmdBreakpointAddMemW , CMD_BREAKPOINT_ADD_MEMW , "Add breakpoint on memory write access" },
{TEXT("BPV") , CmdBreakpointAddVideo, CMD_BREAKPOINT_ADD_VIDEO , "Add breakpoint on video scanner position" },
{"BRK" , CmdBreakInvalid , CMD_BREAK_INVALID , "Enter debugger on BRK or INVALID" },
{"BRKOP" , CmdBreakOpcode , CMD_BREAK_OPCODE , "Enter debugger on opcode" },
{"BRKINT" , CmdBreakOnInterrupt , CMD_BREAK_ON_INTERRUPT , "Enter debugger on interrupt" },
{"BP" , CmdBreakpoint , CMD_BREAKPOINT , "Alias for BPR (Breakpoint Register Add)" },
{"BPA" , CmdBreakpointAddSmart, CMD_BREAKPOINT_ADD_SMART , "Add (smart) breakpoint" },
// {"BPP" , CmdBreakpointAddFlag , CMD_BREAKPOINT_ADD_FLAG , "Add breakpoint on flags" },
{"BPR" , CmdBreakpointAddReg , CMD_BREAKPOINT_ADD_REG , "Add breakpoint on register value" }, // NOTE! Different from SoftICE !!!!
{"BPX" , CmdBreakpointAddPC , CMD_BREAKPOINT_ADD_PC , "Add breakpoint at current instruction" },
{"BPIO" , CmdBreakpointAddIO , CMD_BREAKPOINT_ADD_IO , "Add breakpoint for IO address $C0xx" },
{"BPM" , CmdBreakpointAddMemA , CMD_BREAKPOINT_ADD_MEM , "Add breakpoint on memory access" }, // SoftICE
{"BPMR" , CmdBreakpointAddMemR , CMD_BREAKPOINT_ADD_MEMR , "Add breakpoint on memory read access" },
{"BPMW" , CmdBreakpointAddMemW , CMD_BREAKPOINT_ADD_MEMW , "Add breakpoint on memory write access" },
{"BPV" , CmdBreakpointAddVideo, CMD_BREAKPOINT_ADD_VIDEO , "Add breakpoint on video scanner position" },
{TEXT("BPC") , CmdBreakpointClear , CMD_BREAKPOINT_CLEAR , "Clear (remove) breakpoint" }, // SoftICE
{TEXT("BPD") , CmdBreakpointDisable , CMD_BREAKPOINT_DISABLE , "Disable breakpoint- it is still in the list, just not active" }, // SoftICE
{TEXT("BPEDIT") , CmdBreakpointEdit , CMD_BREAKPOINT_EDIT , "Edit breakpoint" }, // SoftICE
{TEXT("BPE") , CmdBreakpointEnable , CMD_BREAKPOINT_ENABLE , "(Re)Enable disabled breakpoint" }, // SoftICE
{TEXT("BPL") , CmdBreakpointList , CMD_BREAKPOINT_LIST , "List all breakpoints" }, // SoftICE
// {TEXT("BPLOAD") , CmdBreakpointLoad , CMD_BREAKPOINT_LOAD , "Loads breakpoints" },
{TEXT("BPSAVE") , CmdBreakpointSave , CMD_BREAKPOINT_SAVE , "Saves breakpoints" },
{TEXT("BPCHANGE") , CmdBreakpointChange , CMD_BREAKPOINT_CHANGE , "Change breakpoint" },
{"BPC" , CmdBreakpointClear , CMD_BREAKPOINT_CLEAR , "Clear (remove) breakpoint" }, // SoftICE
{"BPD" , CmdBreakpointDisable , CMD_BREAKPOINT_DISABLE , "Disable breakpoint- it is still in the list, just not active" }, // SoftICE
{"BPEDIT" , CmdBreakpointEdit , CMD_BREAKPOINT_EDIT , "Edit breakpoint" }, // SoftICE
{"BPE" , CmdBreakpointEnable , CMD_BREAKPOINT_ENABLE , "(Re)Enable disabled breakpoint" }, // SoftICE
{"BPL" , CmdBreakpointList , CMD_BREAKPOINT_LIST , "List all breakpoints" }, // SoftICE
// {"BPLOAD" , CmdBreakpointLoad , CMD_BREAKPOINT_LOAD , "Loads breakpoints" },
{"BPSAVE" , CmdBreakpointSave , CMD_BREAKPOINT_SAVE , "Saves breakpoints" },
{"BPCHANGE" , CmdBreakpointChange , CMD_BREAKPOINT_CHANGE , "Change breakpoint" },
// Config
{TEXT("BENCHMARK") , CmdBenchmark , CMD_BENCHMARK , "Benchmark the emulator" },
{TEXT("BW") , CmdConfigColorMono , CMD_CONFIG_BW , "Sets/Shows RGB for Black & White scheme" },
{TEXT("COLOR") , CmdConfigColorMono , CMD_CONFIG_COLOR , "Sets/Shows RGB for color scheme" },
// {TEXT("OPTION") , CmdConfigMenu , CMD_CONFIG_MENU , "Access config options" },
{TEXT("DISASM") , CmdConfigDisasm , CMD_CONFIG_DISASM , "Sets/Shows disassembly view options." },
{TEXT("FONT") , CmdConfigFont , CMD_CONFIG_FONT , "Shows current font or sets new one" },
{TEXT("HCOLOR") , CmdConfigHColor , CMD_CONFIG_HCOLOR , "Sets/Shows colors mapped to Apple HGR" },
{TEXT("LOAD") , CmdConfigLoad , CMD_CONFIG_LOAD , "Load debugger configuration" },
{TEXT("MONO") , CmdConfigColorMono , CMD_CONFIG_MONOCHROME , "Sets/Shows RGB for monochrome scheme" },
{TEXT("SAVE") , CmdConfigSave , CMD_CONFIG_SAVE , "Save debugger configuration" },
{TEXT("PWD") , CmdConfigGetDebugDir , CMD_CONFIG_GET_DEBUG_DIR , "Displays the current debugger directory. Used for scripts & mem load/save." },
{TEXT("CD") , CmdConfigSetDebugDir , CMD_CONFIG_SET_DEBUG_DIR , "Updates the current debugger directory." },
{"BENCHMARK" , CmdBenchmark , CMD_BENCHMARK , "Benchmark the emulator" },
{"BW" , CmdConfigColorMono , CMD_CONFIG_BW , "Sets/Shows RGB for Black & White scheme" },
{"COLOR" , CmdConfigColorMono , CMD_CONFIG_COLOR , "Sets/Shows RGB for color scheme" },
// {"OPTION" , CmdConfigMenu , CMD_CONFIG_MENU , "Access config options" },
{"DISASM" , CmdConfigDisasm , CMD_CONFIG_DISASM , "Sets/Shows disassembly view options." },
{"FONT" , CmdConfigFont , CMD_CONFIG_FONT , "Shows current font or sets new one" },
{"HCOLOR" , CmdConfigHColor , CMD_CONFIG_HCOLOR , "Sets/Shows colors mapped to Apple HGR" },
{"LOAD" , CmdConfigLoad , CMD_CONFIG_LOAD , "Load debugger configuration" },
{"MONO" , CmdConfigColorMono , CMD_CONFIG_MONOCHROME , "Sets/Shows RGB for monochrome scheme" },
{"SAVE" , CmdConfigSave , CMD_CONFIG_SAVE , "Save debugger configuration" },
{"PWD" , CmdConfigGetDebugDir , CMD_CONFIG_GET_DEBUG_DIR , "Displays the current debugger directory. Used for scripts & mem load/save." },
{"CD" , CmdConfigSetDebugDir , CMD_CONFIG_SET_DEBUG_DIR , "Updates the current debugger directory." },
// Cursor
{TEXT("RET") , CmdCursorJumpRetAddr , CMD_CURSOR_JUMP_RET_ADDR , "Sets the cursor to the sub-routine caller" },
{TEXT( "^") , NULL , CMD_CURSOR_LINE_UP }, // \x2191 = Up Arrow (Unicode)
{TEXT("Shift ^") , NULL , CMD_CURSOR_LINE_UP_1 },
{TEXT( "v") , NULL , CMD_CURSOR_LINE_DOWN }, // \x2193 = Dn Arrow (Unicode)
{TEXT("Shift v") , NULL , CMD_CURSOR_LINE_DOWN_1 },
{TEXT("PAGEUP" ) , CmdCursorPageUp , CMD_CURSOR_PAGE_UP , "Scroll up one screen" },
{TEXT("PAGEUP256") , CmdCursorPageUp256 , CMD_CURSOR_PAGE_UP_256 , "Scroll up 256 bytes" }, // Shift
{TEXT("PAGEUP4K" ) , CmdCursorPageUp4K , CMD_CURSOR_PAGE_UP_4K , "Scroll up 4096 bytes" }, // Ctrl
{TEXT("PAGEDN" ) , CmdCursorPageDown , CMD_CURSOR_PAGE_DOWN , "Scroll down one scren" },
{TEXT("PAGEDOWN256") , CmdCursorPageDown256 , CMD_CURSOR_PAGE_DOWN_256 , "Scroll down 256 bytes" }, // Shift
{TEXT("PAGEDOWN4K" ) , CmdCursorPageDown4K , CMD_CURSOR_PAGE_DOWN_4K , "Scroll down 4096 bytes" }, // Ctrl
{"RET" , CmdCursorJumpRetAddr , CMD_CURSOR_JUMP_RET_ADDR , "Sets the cursor to the sub-routine caller" },
{"^" , NULL , CMD_CURSOR_LINE_UP }, // \x2191 = Up Arrow (Unicode)
{"Shift ^" , NULL , CMD_CURSOR_LINE_UP_1 },
{"v" , NULL , CMD_CURSOR_LINE_DOWN }, // \x2193 = Dn Arrow (Unicode)
{"Shift v" , NULL , CMD_CURSOR_LINE_DOWN_1 },
{"PAGEUP" , CmdCursorPageUp , CMD_CURSOR_PAGE_UP , "Scroll up one screen" },
{"PAGEUP256" , CmdCursorPageUp256 , CMD_CURSOR_PAGE_UP_256 , "Scroll up 256 bytes" }, // Shift
{"PAGEUP4K" , CmdCursorPageUp4K , CMD_CURSOR_PAGE_UP_4K , "Scroll up 4096 bytes" }, // Ctrl
{"PAGEDN" , CmdCursorPageDown , CMD_CURSOR_PAGE_DOWN , "Scroll down one scren" },
{"PAGEDOWN256" , CmdCursorPageDown256 , CMD_CURSOR_PAGE_DOWN_256 , "Scroll down 256 bytes" }, // Shift
{"PAGEDOWN4K" , CmdCursorPageDown4K , CMD_CURSOR_PAGE_DOWN_4K , "Scroll down 4096 bytes" }, // Ctrl
// Cycles info
{TEXT("CYCLES") , CmdCyclesInfo , CMD_CYCLES_INFO, "Cycles display configuration" },
{TEXT("RCC") , CmdCyclesReset , CMD_CYCLES_RESET, "Reset cycles counter" },
{"CYCLES" , CmdCyclesInfo , CMD_CYCLES_INFO, "Cycles display configuration" },
{"RCC" , CmdCyclesReset , CMD_CYCLES_RESET, "Reset cycles counter" },
// Disassembler Data
{TEXT("Z") , CmdDisasmDataDefByte1 , CMD_DISASM_DATA , "Treat byte [range] as data" },
{TEXT("X") , CmdDisasmDataDefCode , CMD_DISASM_CODE , "Treat byte [range] as code" },
{"Z" , CmdDisasmDataDefByte1 , CMD_DISASM_DATA , "Treat byte [range] as data" },
{"X" , CmdDisasmDataDefCode , CMD_DISASM_CODE , "Treat byte [range] as code" },
// TODO: Conflicts with monitor command #L -> 000DL
{TEXT("B") , CmdDisasmDataList , CMD_DISASM_LIST , "List all byte ranges treated as data" },
{"B" , CmdDisasmDataList , CMD_DISASM_LIST , "List all byte ranges treated as data" },
// without symbol lookup
{TEXT("DB") , CmdDisasmDataDefByte1 , CMD_DEFINE_DATA_BYTE1, "Define byte(s)" },
{TEXT("DB2") , CmdDisasmDataDefByte2 , CMD_DEFINE_DATA_BYTE2, "Define byte array, display 2 bytes/line" },
{TEXT("DB4") , CmdDisasmDataDefByte4 , CMD_DEFINE_DATA_BYTE4, "Define byte array, display 4 bytes/line" },
{TEXT("DB8") , CmdDisasmDataDefByte8 , CMD_DEFINE_DATA_BYTE8, "Define byte array, display 8 bytes/line" },
{TEXT("DW") , CmdDisasmDataDefWord1 , CMD_DEFINE_DATA_WORD1, "Define address array" },
{TEXT("DW2") , CmdDisasmDataDefWord2 , CMD_DEFINE_DATA_WORD2, "Define address array, display 2 words/line" },
{TEXT("DW4") , CmdDisasmDataDefWord4 , CMD_DEFINE_DATA_WORD4, "Define address array, display 4 words/line" },
{TEXT("ASC") , CmdDisasmDataDefString , CMD_DEFINE_DATA_STR , "Define text string" }, // 2.7.0.26 Changed: DS to ASC because DS is used as "Define Space" assembler directive
{TEXT("DF") , CmdDisasmDataDefFloat , CMD_DEFINE_DATA_FLOAT, "Define AppleSoft (packed) Float" },
// {TEXT("DFX") , CmdDisasmDataDefFloatUnpack , CMD_DEFINE_DATA_FLOAT2,"Define AppleSoft (unpacked) Float" },
{"DB" , CmdDisasmDataDefByte1 , CMD_DEFINE_DATA_BYTE1, "Define byte(s)" },
{"DB2" , CmdDisasmDataDefByte2 , CMD_DEFINE_DATA_BYTE2, "Define byte array, display 2 bytes/line" },
{"DB4" , CmdDisasmDataDefByte4 , CMD_DEFINE_DATA_BYTE4, "Define byte array, display 4 bytes/line" },
{"DB8" , CmdDisasmDataDefByte8 , CMD_DEFINE_DATA_BYTE8, "Define byte array, display 8 bytes/line" },
{"DW" , CmdDisasmDataDefWord1 , CMD_DEFINE_DATA_WORD1, "Define address array" },
{"DW2" , CmdDisasmDataDefWord2 , CMD_DEFINE_DATA_WORD2, "Define address array, display 2 words/line" },
{"DW4" , CmdDisasmDataDefWord4 , CMD_DEFINE_DATA_WORD4, "Define address array, display 4 words/line" },
{"ASC" , CmdDisasmDataDefString , CMD_DEFINE_DATA_STR , "Define text string" }, // 2.7.0.26 Changed: DS to ASC because DS is used as "Define Space" assembler directive
{"DF" , CmdDisasmDataDefFloat , CMD_DEFINE_DATA_FLOAT, "Define AppleSoft (packed) Float" },
// {"DFX" , CmdDisasmDataDefFloatUnpack , CMD_DEFINE_DATA_FLOAT2,"Define AppleSoft (unpacked) Float" },
// with symbol lookup
// {TEXT("DA<>") , CmdDisasmDataDefAddress8HL , CMD_DEFINE_ADDR_8_HL , "Define split array of addresses, high byte section followed by low byte section" },
// {TEXT("DA><") , CmdDisasmDataDefAddress8LH , CMD_DEFINE_ADDR_8_LH , "Define split array of addresses, low byte section followed by high byte section" },
// {TEXT("DA<") , CmdDisasmDataDefAddress8H , CMD_DEFINE_ADDR_BYTE_H , "Define array of high byte addresses" },
// {TEXT("DB>") , CmdDisasmDataDefAddress8L , CMD_DEFINE_ADDR_BYTE_L , "Define array of low byte addresses" }
{TEXT("DA") , CmdDisasmDataDefAddress16 , CMD_DEFINE_ADDR_WORD , "Define array of word addresses" },
// {"DA<>" , CmdDisasmDataDefAddress8HL , CMD_DEFINE_ADDR_8_HL , "Define split array of addresses, high byte section followed by low byte section" },
// {"DA><" , CmdDisasmDataDefAddress8LH , CMD_DEFINE_ADDR_8_LH , "Define split array of addresses, low byte section followed by high byte section" },
// {"DA<" , CmdDisasmDataDefAddress8H , CMD_DEFINE_ADDR_BYTE_H , "Define array of high byte addresses" },
// {"DB>" , CmdDisasmDataDefAddress8L , CMD_DEFINE_ADDR_BYTE_L , "Define array of low byte addresses" }
{"DA" , CmdDisasmDataDefAddress16 , CMD_DEFINE_ADDR_WORD , "Define array of word addresses" },
// TODO: Rename config cmd: DISASM or ID (Interactive Disassembly)
// {TEXT("UA") , CmdDisasmDataSmart , CMD_SMART_DISASSEMBLE, "Analyze opcodes to determine if code or data" },
// {"UA" , CmdDisasmDataSmart , CMD_SMART_DISASSEMBLE, "Analyze opcodes to determine if code or data" },
// Disk
{TEXT("DISK") , CmdDisk , CMD_DISK , "Access Disk Drive Functions" },
{"DISK" , CmdDisk , CMD_DISK , "Access Disk Drive Functions" },
// Flags
// {TEXT("FC") , CmdFlag , CMD_FLAG_CLEAR , "Clear specified Flag" }, // NVRBDIZC see AW_CPU.cpp AF_*
// {"FC" , CmdFlag , CMD_FLAG_CLEAR , "Clear specified Flag" }, // NVRBDIZC see AW_CPU.cpp AF_*
// TODO: Conflicts with monitor command #L -> 000CL
{TEXT("CL") , CmdFlag , CMD_FLAG_CLEAR , "Clear specified Flag" }, // NVRBDIZC see AW_CPU.cpp AF_*
{"CL" , CmdFlag , CMD_FLAG_CLEAR , "Clear specified Flag" }, // NVRBDIZC see AW_CPU.cpp AF_*
{TEXT("CLC") , CmdFlagClear , CMD_FLAG_CLR_C , "Clear Flag Carry" }, // 0 // Legacy
{TEXT("CLZ") , CmdFlagClear , CMD_FLAG_CLR_Z , "Clear Flag Zero" }, // 1
{TEXT("CLI") , CmdFlagClear , CMD_FLAG_CLR_I , "Clear Flag Interrupts Disabled" }, // 2
{TEXT("CLD") , CmdFlagClear , CMD_FLAG_CLR_D , "Clear Flag Decimal (BCD)" }, // 3
{TEXT("CLB") , CmdFlagClear , CMD_FLAG_CLR_B , "CLear Flag Break" }, // 4 // Legacy
{TEXT("CLR") , CmdFlagClear , CMD_FLAG_CLR_R , "Clear Flag Reserved" }, // 5
{TEXT("CLV") , CmdFlagClear , CMD_FLAG_CLR_V , "Clear Flag Overflow" }, // 6
{TEXT("CLN") , CmdFlagClear , CMD_FLAG_CLR_N , "Clear Flag Negative (Sign)" }, // 7
{"CLC" , CmdFlagClear , CMD_FLAG_CLR_C , "Clear Flag Carry" }, // 0 // Legacy
{"CLZ" , CmdFlagClear , CMD_FLAG_CLR_Z , "Clear Flag Zero" }, // 1
{"CLI" , CmdFlagClear , CMD_FLAG_CLR_I , "Clear Flag Interrupts Disabled" }, // 2
{"CLD" , CmdFlagClear , CMD_FLAG_CLR_D , "Clear Flag Decimal (BCD)" }, // 3
{"CLB" , CmdFlagClear , CMD_FLAG_CLR_B , "CLear Flag Break" }, // 4 // Legacy
{"CLR" , CmdFlagClear , CMD_FLAG_CLR_R , "Clear Flag Reserved" }, // 5
{"CLV" , CmdFlagClear , CMD_FLAG_CLR_V , "Clear Flag Overflow" }, // 6
{"CLN" , CmdFlagClear , CMD_FLAG_CLR_N , "Clear Flag Negative (Sign)" }, // 7
// {TEXT("FS") , CmdFlag , CMD_FLAG_SET , "Set specified Flag" },
{TEXT("SE") , CmdFlag , CMD_FLAG_SET , "Set specified Flag" },
// {"FS" , CmdFlag , CMD_FLAG_SET , "Set specified Flag" },
{"SE" , CmdFlag , CMD_FLAG_SET , "Set specified Flag" },
{TEXT("SEC") , CmdFlagSet , CMD_FLAG_SET_C , "Set Flag Carry" }, // 0
{TEXT("SEZ") , CmdFlagSet , CMD_FLAG_SET_Z , "Set Flag Zero" }, // 1
{TEXT("SEI") , CmdFlagSet , CMD_FLAG_SET_I , "Set Flag Interrupts Disabled" }, // 2
{TEXT("SED") , CmdFlagSet , CMD_FLAG_SET_D , "Set Flag Decimal (BCD)" }, // 3
{TEXT("SEB") , CmdFlagSet , CMD_FLAG_SET_B , "Set Flag Break" }, // 4 // Legacy
{TEXT("SER") , CmdFlagSet , CMD_FLAG_SET_R , "Set Flag Reserved" }, // 5
{TEXT("SEV") , CmdFlagSet , CMD_FLAG_SET_V , "Set Flag Overflow" }, // 6
{TEXT("SEN") , CmdFlagSet , CMD_FLAG_SET_N , "Set Flag Negative" }, // 7
{"SEC" , CmdFlagSet , CMD_FLAG_SET_C , "Set Flag Carry" }, // 0
{"SEZ" , CmdFlagSet , CMD_FLAG_SET_Z , "Set Flag Zero" }, // 1
{"SEI" , CmdFlagSet , CMD_FLAG_SET_I , "Set Flag Interrupts Disabled" }, // 2
{"SED" , CmdFlagSet , CMD_FLAG_SET_D , "Set Flag Decimal (BCD)" }, // 3
{"SEB" , CmdFlagSet , CMD_FLAG_SET_B , "Set Flag Break" }, // 4 // Legacy
{"SER" , CmdFlagSet , CMD_FLAG_SET_R , "Set Flag Reserved" }, // 5
{"SEV" , CmdFlagSet , CMD_FLAG_SET_V , "Set Flag Overflow" }, // 6
{"SEN" , CmdFlagSet , CMD_FLAG_SET_N , "Set Flag Negative" }, // 7
// Help
{TEXT("?") , CmdHelpList , CMD_HELP_LIST , "List all available commands" },
{TEXT("HELP") , CmdHelpSpecific , CMD_HELP_SPECIFIC , "Help on specific command" },
{TEXT("VERSION") , CmdVersion , CMD_VERSION , "Displays version of emulator/debugger" },
{TEXT("MOTD") , CmdMOTD , CMD_MOTD }, // MOTD: Message Of The Day
{"?" , CmdHelpList , CMD_HELP_LIST , "List all available commands" },
{"HELP" , CmdHelpSpecific , CMD_HELP_SPECIFIC , "Help on specific command" },
{"VERSION" , CmdVersion , CMD_VERSION , "Displays version of emulator/debugger" },
{"MOTD" , CmdMOTD , CMD_MOTD }, // MOTD: Message Of The Day
// Memory
{TEXT("MC") , CmdMemoryCompare , CMD_MEMORY_COMPARE },
{"MC" , CmdMemoryCompare , CMD_MEMORY_COMPARE },
{TEXT("MD1") , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_1 , "Hex dump in the mini memory area 1" },
{TEXT("MD2") , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_2 , "Hex dump in the mini memory area 2" },
{"MD1" , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_1 , "Hex dump in the mini memory area 1" },
{"MD2" , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_2 , "Hex dump in the mini memory area 2" },
{TEXT("MA1") , CmdMemoryMiniDumpAscii,CMD_MEM_MINI_DUMP_ASCII_1, "ASCII text in mini memory area 1" },
{TEXT("MA2") , CmdMemoryMiniDumpAscii,CMD_MEM_MINI_DUMP_ASCII_2, "ASCII text in mini memory area 2" },
{TEXT("MT1") , CmdMemoryMiniDumpApple,CMD_MEM_MINI_DUMP_APPLE_1, "Apple Text in mini memory area 1" },
{TEXT("MT2") , CmdMemoryMiniDumpApple,CMD_MEM_MINI_DUMP_APPLE_2, "Apple Text in mini memory area 2" },
// {TEXT("ML1") , CmdMemoryMiniDumpLow , CMD_MEM_MINI_DUMP_TXT_LO_1, "Text (Ctrl) in mini memory dump area 1" },
// {TEXT("ML2") , CmdMemoryMiniDumpLow , CMD_MEM_MINI_DUMP_TXT_LO_2, "Text (Ctrl) in mini memory dump area 2" },
// {TEXT("MH1") , CmdMemoryMiniDumpHigh, CMD_MEM_MINI_DUMP_TXT_HI_1, "Text (High) in mini memory dump area 1" },
// {TEXT("MH2") , CmdMemoryMiniDumpHigh, CMD_MEM_MINI_DUMP_TXT_HI_2, "Text (High) in mini memory dump area 2" },
{"MA1" , CmdMemoryMiniDumpAscii,CMD_MEM_MINI_DUMP_ASCII_1, "ASCII text in mini memory area 1" },
{"MA2" , CmdMemoryMiniDumpAscii,CMD_MEM_MINI_DUMP_ASCII_2, "ASCII text in mini memory area 2" },
{"MT1" , CmdMemoryMiniDumpApple,CMD_MEM_MINI_DUMP_APPLE_1, "Apple Text in mini memory area 1" },
{"MT2" , CmdMemoryMiniDumpApple,CMD_MEM_MINI_DUMP_APPLE_2, "Apple Text in mini memory area 2" },
// {"ML1" , CmdMemoryMiniDumpLow , CMD_MEM_MINI_DUMP_TXT_LO_1, "Text (Ctrl) in mini memory dump area 1" },
// {"ML2" , CmdMemoryMiniDumpLow , CMD_MEM_MINI_DUMP_TXT_LO_2, "Text (Ctrl) in mini memory dump area 2" },
// {"MH1" , CmdMemoryMiniDumpHigh, CMD_MEM_MINI_DUMP_TXT_HI_1, "Text (High) in mini memory dump area 1" },
// {"MH2" , CmdMemoryMiniDumpHigh, CMD_MEM_MINI_DUMP_TXT_HI_2, "Text (High) in mini memory dump area 2" },
{TEXT("ME") , CmdMemoryEdit , CMD_MEMORY_EDIT , "Memory Editor - Not Implemented!" }, // TODO: like Copy ][+ Sector Edit
{TEXT("MEB") , CmdMemoryEnterByte , CMD_MEMORY_ENTER_BYTE , "Enter byte" },
{TEXT("MEW") , CmdMemoryEnterWord , CMD_MEMORY_ENTER_WORD , "Enter word" },
{TEXT("BLOAD") , CmdMemoryLoad , CMD_MEMORY_LOAD , "Load a region of memory" },
{TEXT("M") , CmdMemoryMove , CMD_MEMORY_MOVE , "Memory move" },
{TEXT("BSAVE") , CmdMemorySave , CMD_MEMORY_SAVE , "Save a region of memory" },
{TEXT("S") , CmdMemorySearch , CMD_MEMORY_SEARCH , "Search memory for text / hex values" },
{TEXT("@") ,_SearchMemoryDisplay , CMD_MEMORY_FIND_RESULTS , "Display search memory results" },
// {TEXT("SA") , CmdMemorySearchAscii, CMD_MEMORY_SEARCH_ASCII , "Search ASCII text" },
// {TEXT("ST") , CmdMemorySearchApple , CMD_MEMORY_SEARCH_APPLE , "Search Apple text (hi-bit)" },
{TEXT("SH") , CmdMemorySearchHex , CMD_MEMORY_SEARCH_HEX , "Search memory for hex values" },
{TEXT("F") , CmdMemoryFill , CMD_MEMORY_FILL , "Memory fill" },
{"ME" , CmdMemoryEdit , CMD_MEMORY_EDIT , "Memory Editor - Not Implemented!" }, // TODO: like Copy ][+ Sector Edit
{"MEB" , CmdMemoryEnterByte , CMD_MEMORY_ENTER_BYTE , "Enter byte" },
{"MEW" , CmdMemoryEnterWord , CMD_MEMORY_ENTER_WORD , "Enter word" },
{"BLOAD" , CmdMemoryLoad , CMD_MEMORY_LOAD , "Load a region of memory" },
{"M" , CmdMemoryMove , CMD_MEMORY_MOVE , "Memory move" },
{"BSAVE" , CmdMemorySave , CMD_MEMORY_SAVE , "Save a region of memory" },
{"S" , CmdMemorySearch , CMD_MEMORY_SEARCH , "Search memory for text / hex values" },
{"@" ,_SearchMemoryDisplay , CMD_MEMORY_FIND_RESULTS , "Display search memory results" },
// {"SA" , CmdMemorySearchAscii, CMD_MEMORY_SEARCH_ASCII , "Search ASCII text" },
// {"ST" , CmdMemorySearchApple , CMD_MEMORY_SEARCH_APPLE , "Search Apple text (hi-bit)" },
{"SH" , CmdMemorySearchHex , CMD_MEMORY_SEARCH_HEX , "Search memory for hex values" },
{"F" , CmdMemoryFill , CMD_MEMORY_FILL , "Memory fill" },
{TEXT("NTSC") , CmdNTSC , CMD_NTSC , "Save/Load the NTSC palette" },
{TEXT("TSAVE") , CmdTextSave , CMD_TEXT_SAVE , "Save text screen" },
{"NTSC" , CmdNTSC , CMD_NTSC , "Save/Load the NTSC palette" },
{"TSAVE" , CmdTextSave , CMD_TEXT_SAVE , "Save text screen" },
// Output / Scripts
{TEXT("CALC") , CmdOutputCalc , CMD_OUTPUT_CALC , "Display mini calc result" },
{TEXT("ECHO") , CmdOutputEcho , CMD_OUTPUT_ECHO , "Echo string to console" }, // or toggle command echoing"
{TEXT("PRINT") , CmdOutputPrint , CMD_OUTPUT_PRINT , "Display string and/or hex values" },
{TEXT("PRINTF") , CmdOutputPrintf , CMD_OUTPUT_PRINTF , "Display formatted string" },
{TEXT("RUN") , CmdOutputRun , CMD_OUTPUT_RUN , "Run script file of debugger commands" },
{"CALC" , CmdOutputCalc , CMD_OUTPUT_CALC , "Display mini calc result" },
{"ECHO" , CmdOutputEcho , CMD_OUTPUT_ECHO , "Echo string to console" }, // or toggle command echoing"
{"PRINT" , CmdOutputPrint , CMD_OUTPUT_PRINT , "Display string and/or hex values" },
{"PRINTF" , CmdOutputPrintf , CMD_OUTPUT_PRINTF , "Display formatted string" },
{"RUN" , CmdOutputRun , CMD_OUTPUT_RUN , "Run script file of debugger commands" },
// Source Level Debugging
{TEXT("SOURCE") , CmdSource , CMD_SOURCE , "Starts/Stops source level debugging" },
{TEXT("SYNC") , CmdSync , CMD_SYNC , "Syncs the cursor to the source file" },
{"SOURCE" , CmdSource , CMD_SOURCE , "Starts/Stops source level debugging" },
{"SYNC" , CmdSync , CMD_SYNC , "Syncs the cursor to the source file" },
// Symbols
{TEXT("SYM") , CmdSymbols , CMD_SYMBOLS_LOOKUP , "Lookup symbol or address, or define symbol" },
{"SYM" , CmdSymbols , CMD_SYMBOLS_LOOKUP , "Lookup symbol or address, or define symbol" },
{"SYMMAIN" , CmdSymbolsCommand , CMD_SYMBOLS_ROM , "Main/ROM symbol table lookup/menu" }, // CLEAR,LOAD,SAVE
{"SYMBASIC" , CmdSymbolsCommand , CMD_SYMBOLS_APPLESOFT , "Applesoft symbol table lookup/menu" }, // CLEAR,LOAD,SAVE
@ -236,140 +236,143 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{"SYMDOS33" , CmdSymbolsCommand , CMD_SYMBOLS_DOS33 , "DOS 3.3 symbol table lookup/menu" }, // CLEAR,LOAD,SAVE
{"SYMPRODOS" , CmdSymbolsCommand , CMD_SYMBOLS_PRODOS , "ProDOS symbol table lookup/menu" }, // CLEAR,LOAD,SAVE
// {TEXT("SYMCLEAR") , CmdSymbolsClear , CMD_SYMBOLS_CLEAR }, // can't use SC = SetCarry
{TEXT("SYMINFO") , CmdSymbolsInfo , CMD_SYMBOLS_INFO , "Display summary of symbols" },
{TEXT("SYMLIST") , CmdSymbolsList , CMD_SYMBOLS_LIST , "Lookup symbol in main/user/src tables" }, // 'symbolname', can't use param '*'
// {"SYMCLEAR" , CmdSymbolsClear , CMD_SYMBOLS_CLEAR }, // can't use SC = SetCarry
{"SYMINFO" , CmdSymbolsInfo , CMD_SYMBOLS_INFO , "Display summary of symbols" },
{"SYMLIST" , CmdSymbolsList , CMD_SYMBOLS_LIST , "Lookup symbol in main/user/src tables" }, // 'symbolname', can't use param '*'
// Variables
// {TEXT("CLEAR") , CmdVarsClear , CMD_VARIABLES_CLEAR },
// {TEXT("VAR") , CmdVarsDefine , CMD_VARIABLES_DEFINE },
// {TEXT("INT8") , CmdVarsDefineInt8 , CMD_VARIABLES_DEFINE_INT8},
// {TEXT("INT16") , CmdVarsDefineInt16 , CMD_VARIABLES_DEFINE_INT16},
// {TEXT("VARS") , CmdVarsList , CMD_VARIABLES_LIST },
// {TEXT("VARSLOAD") , CmdVarsLoad , CMD_VARIABLES_LOAD },
// {TEXT("VARSSAVE") , CmdVarsSave , CMD_VARIABLES_SAVE },
// {TEXT("SET") , CmdVarsSet , CMD_VARIABLES_SET },
// {"CLEAR" , CmdVarsClear , CMD_VARIABLES_CLEAR },
// {"VAR" , CmdVarsDefine , CMD_VARIABLES_DEFINE },
// {"INT8" , CmdVarsDefineInt8 , CMD_VARIABLES_DEFINE_INT8},
// {"INT16" , CmdVarsDefineInt16 , CMD_VARIABLES_DEFINE_INT16},
// {"VARS" , CmdVarsList , CMD_VARIABLES_LIST },
// {"VARSLOAD" , CmdVarsLoad , CMD_VARIABLES_LOAD },
// {"VARSSAVE" , CmdVarsSave , CMD_VARIABLES_SAVE },
// {"SET" , CmdVarsSet , CMD_VARIABLES_SET },
// Video-scanner info
{TEXT("VIDEOINFO") , CmdVideoScannerInfo , CMD_VIDEO_SCANNER_INFO, "Video-scanner display configuration" },
{"VIDEOINFO" , CmdVideoScannerInfo , CMD_VIDEO_SCANNER_INFO, "Video-scanner display configuration" },
// View
{TEXT("TEXT") , CmdViewOutput_Text4X , CMD_VIEW_TEXT4X, "View Text screen (current page)" },
{TEXT("TEXT1") , CmdViewOutput_Text41 , CMD_VIEW_TEXT41, "View Text screen Page 1" },
{TEXT("TEXT2") , CmdViewOutput_Text42 , CMD_VIEW_TEXT42, "View Text screen Page 2" },
{TEXT("TEXT80") , CmdViewOutput_Text8X , CMD_VIEW_TEXT8X, "View 80-col Text screen (current page)" },
{TEXT("TEXT81") , CmdViewOutput_Text81 , CMD_VIEW_TEXT81, "View 80-col Text screen Page 1" },
{TEXT("TEXT82") , CmdViewOutput_Text82 , CMD_VIEW_TEXT82, "View 80-col Text screen Page 2" },
{TEXT("GR") , CmdViewOutput_GRX , CMD_VIEW_GRX , "View Lo-Res screen (current page)" },
{TEXT("GR1") , CmdViewOutput_GR1 , CMD_VIEW_GR1 , "View Lo-Res screen Page 1" },
{TEXT("GR2") , CmdViewOutput_GR2 , CMD_VIEW_GR2 , "View Lo-Res screen Page 2" },
{TEXT("DGR") , CmdViewOutput_DGRX , CMD_VIEW_DGRX , "View Double lo-res (current page)" },
{TEXT("DGR1") , CmdViewOutput_DGR1 , CMD_VIEW_DGR1 , "View Double lo-res Page 1" },
{TEXT("DGR2") , CmdViewOutput_DGR2 , CMD_VIEW_DGR2 , "View Double lo-res Page 2" },
{TEXT("HGR") , CmdViewOutput_HGRX , CMD_VIEW_HGRX , "View Hi-res (current page)" },
{TEXT("HGR0") , CmdViewOutput_HGR0 , CMD_VIEW_HGR0 , "View pseudo Hi-res Page 0 ($0000)" },
{TEXT("HGR1") , CmdViewOutput_HGR1 , CMD_VIEW_HGR1 , "View Hi-res Page 1 ($2000)" },
{TEXT("HGR2") , CmdViewOutput_HGR2 , CMD_VIEW_HGR2 , "View Hi-res Page 2 ($4000)" },
{TEXT("HGR3") , CmdViewOutput_HGR3 , CMD_VIEW_HGR3 , "View pseudo Hi-res Page 3 ($6000)" },
{TEXT("HGR4") , CmdViewOutput_HGR4 , CMD_VIEW_HGR4 , "View pseudo Hi-res Page 4 ($8000)" },
{TEXT("HGR5") , CmdViewOutput_HGR5 , CMD_VIEW_HGR5 , "View pseudo Hi-res Page 5 ($A000)" },
{TEXT("DHGR") , CmdViewOutput_DHGRX , CMD_VIEW_DHGRX , "View Double Hi-res (current page)" },
{TEXT("DHGR1") , CmdViewOutput_DHGR1 , CMD_VIEW_DHGR1 , "View Double Hi-res Page 1" },
{TEXT("DHGR2") , CmdViewOutput_DHGR2 , CMD_VIEW_DHGR2 , "View Double Hi-res Page 2" },
{TEXT("SHR") , CmdViewOutput_SHR , CMD_VIEW_SHR , "View Super Hi-res" },
{"TEXT" , CmdViewOutput_Text4X , CMD_VIEW_TEXT4X, "View Text screen (current page)" },
{"TEXT1" , CmdViewOutput_Text41 , CMD_VIEW_TEXT41, "View Text screen Page 1" },
{"TEXT2" , CmdViewOutput_Text42 , CMD_VIEW_TEXT42, "View Text screen Page 2" },
{"TEXT80" , CmdViewOutput_Text8X , CMD_VIEW_TEXT8X, "View 80-col Text screen (current page)" },
{"TEXT81" , CmdViewOutput_Text81 , CMD_VIEW_TEXT81, "View 80-col Text screen Page 1" },
{"TEXT82" , CmdViewOutput_Text82 , CMD_VIEW_TEXT82, "View 80-col Text screen Page 2" },
{"GR" , CmdViewOutput_GRX , CMD_VIEW_GRX , "View Lo-Res screen (current page)" },
{"GR1" , CmdViewOutput_GR1 , CMD_VIEW_GR1 , "View Lo-Res screen Page 1" },
{"GR2" , CmdViewOutput_GR2 , CMD_VIEW_GR2 , "View Lo-Res screen Page 2" },
{"DGR" , CmdViewOutput_DGRX , CMD_VIEW_DGRX , "View Double lo-res (current page)" },
{"DGR1" , CmdViewOutput_DGR1 , CMD_VIEW_DGR1 , "View Double lo-res Page 1" },
{"DGR2" , CmdViewOutput_DGR2 , CMD_VIEW_DGR2 , "View Double lo-res Page 2" },
{"HGR" , CmdViewOutput_HGRX , CMD_VIEW_HGRX , "View Hi-res (current page)" },
{"HGR0" , CmdViewOutput_HGR0 , CMD_VIEW_HGR0 , "View pseudo Hi-res Page 0 ($0000)" },
{"HGR1" , CmdViewOutput_HGR1 , CMD_VIEW_HGR1 , "View Hi-res Page 1 ($2000)" },
{"HGR2" , CmdViewOutput_HGR2 , CMD_VIEW_HGR2 , "View Hi-res Page 2 ($4000)" },
{"HGR3" , CmdViewOutput_HGR3 , CMD_VIEW_HGR3 , "View pseudo Hi-res Page 3 ($6000)" },
{"HGR4" , CmdViewOutput_HGR4 , CMD_VIEW_HGR4 , "View pseudo Hi-res Page 4 ($8000)" },
{"HGR5" , CmdViewOutput_HGR5 , CMD_VIEW_HGR5 , "View pseudo Hi-res Page 5 ($A000)" },
{"HGR6" , CmdViewOutput_HGR6 , CMD_VIEW_HGR6 , "View pseudo Hi-res Page 6 (LC 1/2 $C000,$D000)" },
{"HGR7" , CmdViewOutput_HGR7 , CMD_VIEW_HGR7 , "View pseudo Hi-res Page 7 (LC 2/- $D000,$E000)" },
{"HGR8" , CmdViewOutput_HGR8 , CMD_VIEW_HGR8 , "View pseudo Hi-res Page 8 (LC RAM $E000,$F000)" },
{"DHGR" , CmdViewOutput_DHGRX , CMD_VIEW_DHGRX , "View Double Hi-res (current page)" },
{"DHGR1" , CmdViewOutput_DHGR1 , CMD_VIEW_DHGR1 , "View Double Hi-res Page 1" },
{"DHGR2" , CmdViewOutput_DHGR2 , CMD_VIEW_DHGR2 , "View Double Hi-res Page 2" },
{"SHR" , CmdViewOutput_SHR , CMD_VIEW_SHR , "View Super Hi-res" },
// Watch
{TEXT("W") , CmdWatchAdd , CMD_WATCH , "Alias for WA (Watch Add)" },
{TEXT("WA") , CmdWatchAdd , CMD_WATCH_ADD , "Add/Update address or symbol to watch" },
{TEXT("WC") , CmdWatchClear , CMD_WATCH_CLEAR , "Clear (remove) watch" },
{TEXT("WD") , CmdWatchDisable , CMD_WATCH_DISABLE , "Disable specific watch - it is still in the list, just not active" },
{TEXT("WE") , CmdWatchEnable , CMD_WATCH_ENABLE , "(Re)Enable disabled watch" },
{TEXT("WL") , CmdWatchList , CMD_WATCH_LIST , "List all watches" },
// {TEXT("WLOAD") , CmdWatchLoad , CMD_WATCH_LOAD , "Load Watches" }, // Cant use as param to W
{TEXT("WSAVE") , CmdWatchSave , CMD_WATCH_SAVE , "Save Watches" }, // due to symbol look-up
{"W" , CmdWatchAdd , CMD_WATCH , "Alias for WA (Watch Add)" },
{"WA" , CmdWatchAdd , CMD_WATCH_ADD , "Add/Update address or symbol to watch" },
{"WC" , CmdWatchClear , CMD_WATCH_CLEAR , "Clear (remove) watch" },
{"WD" , CmdWatchDisable , CMD_WATCH_DISABLE , "Disable specific watch - it is still in the list, just not active" },
{"WE" , CmdWatchEnable , CMD_WATCH_ENABLE , "(Re)Enable disabled watch" },
{"WL" , CmdWatchList , CMD_WATCH_LIST , "List all watches" },
// {"WLOAD" , CmdWatchLoad , CMD_WATCH_LOAD , "Load Watches" }, // Cant use as param to W
{"WSAVE" , CmdWatchSave , CMD_WATCH_SAVE , "Save Watches" }, // due to symbol look-up
// Window
{TEXT("WIN") , CmdWindow , CMD_WINDOW , "Show specified debugger window" },
{"WIN" , CmdWindow , CMD_WINDOW , "Show specified debugger window" },
// CODE 0, CODE 1, CODE 2 ... ???
{TEXT("CODE") , CmdWindowViewCode , CMD_WINDOW_CODE , "Switch to full code window" }, // Can't use WC = WatchClear
{TEXT("CODE1") , CmdWindowShowCode1 , CMD_WINDOW_CODE_1 , "Show code on top split window" },
{TEXT("CODE2") , CmdWindowShowCode2 , CMD_WINDOW_CODE_2 , "Show code on bottom split window" },
{TEXT("CONSOLE") , CmdWindowViewConsole , CMD_WINDOW_CONSOLE , "Switch to full console window" },
{TEXT("DATA") , CmdWindowViewData , CMD_WINDOW_DATA , "Switch to full data window" },
{TEXT("DATA1") , CmdWindowShowData1 , CMD_WINDOW_DATA_1 , "Show data on top split window" },
{TEXT("DATA2") , CmdWindowShowData2 , CMD_WINDOW_DATA_2 , "Show data on bottom split window" },
{TEXT("SOURCE1") , CmdWindowShowSource1 , CMD_WINDOW_SOURCE_1, "Show source on top split screen" },
{TEXT("SOURCE2") , CmdWindowShowSource2 , CMD_WINDOW_SOURCE_2, "Show source on bottom split screen" },
{"CODE" , CmdWindowViewCode , CMD_WINDOW_CODE , "Switch to full code window" }, // Can't use WC = WatchClear
{"CODE1" , CmdWindowShowCode1 , CMD_WINDOW_CODE_1 , "Show code on top split window" },
{"CODE2" , CmdWindowShowCode2 , CMD_WINDOW_CODE_2 , "Show code on bottom split window" },
{"CONSOLE" , CmdWindowViewConsole , CMD_WINDOW_CONSOLE , "Switch to full console window" },
{"DATA" , CmdWindowViewData , CMD_WINDOW_DATA , "Switch to full data window" },
{"DATA1" , CmdWindowShowData1 , CMD_WINDOW_DATA_1 , "Show data on top split window" },
{"DATA2" , CmdWindowShowData2 , CMD_WINDOW_DATA_2 , "Show data on bottom split window" },
{"SOURCE1" , CmdWindowShowSource1 , CMD_WINDOW_SOURCE_1, "Show source on top split screen" },
{"SOURCE2" , CmdWindowShowSource2 , CMD_WINDOW_SOURCE_2, "Show source on bottom split screen" },
{TEXT("\\") , CmdWindowViewOutput , CMD_WINDOW_OUTPUT , "Display Apple output until key pressed" },
// {TEXT("INFO") , CmdToggleInfoPanel , CMD_WINDOW_TOGGLE },
// {TEXT("WINSOURCE") , CmdWindowShowSource , CMD_WINDOW_SOURCE },
// {TEXT("ZEROPAGE") , CmdWindowShowZeropage, CMD_WINDOW_ZEROPAGE },
{"\\" , CmdWindowViewOutput , CMD_WINDOW_OUTPUT , "Display Apple output until key pressed" },
// {"INFO" , CmdToggleInfoPanel , CMD_WINDOW_TOGGLE },
// {"WINSOURCE" , CmdWindowShowSource , CMD_WINDOW_SOURCE },
// {"ZEROPAGE" , CmdWindowShowZeropage, CMD_WINDOW_ZEROPAGE },
// Zero Page
{TEXT("ZP") , CmdZeroPageAdd , CMD_ZEROPAGE_POINTER , "Alias for ZPA (Zero Page Add)" },
{TEXT("ZP0") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_0 , "Set/Update/Remove ZP watch 0 " },
{TEXT("ZP1") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_1 , "Set/Update/Remove ZP watch 1" },
{TEXT("ZP2") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_2 , "Set/Update/Remove ZP watch 2" },
{TEXT("ZP3") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_3 , "Set/Update/Remove ZP watch 3" },
{TEXT("ZP4") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_4 , "Set/Update/Remove ZP watch 4" },
{TEXT("ZP5") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_5 , "Set/Update/Remove ZP watch 5 " },
{TEXT("ZP6") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_6 , "Set/Update/Remove ZP watch 6" },
{TEXT("ZP7") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_7 , "Set/Update/Remove ZP watch 7" },
{TEXT("ZPA") , CmdZeroPageAdd , CMD_ZEROPAGE_POINTER_ADD , "Add/Update address to zero page pointer"},
{TEXT("ZPC") , CmdZeroPageClear , CMD_ZEROPAGE_POINTER_CLEAR , "Clear (remove) zero page pointer" },
{TEXT("ZPD") , CmdZeroPageDisable , CMD_ZEROPAGE_POINTER_DISABLE,"Disable zero page pointer - it is still in the list, just not active" },
{TEXT("ZPE") , CmdZeroPageEnable , CMD_ZEROPAGE_POINTER_ENABLE, "(Re)Enable disabled zero page pointer" },
{TEXT("ZPL") , CmdZeroPageList , CMD_ZEROPAGE_POINTER_LIST , "List all zero page pointers" },
// {TEXT("ZPLOAD") , CmdZeroPageLoad , CMD_ZEROPAGE_POINTER_LOAD , "Load zero page pointers" }, // Cant use as param to ZP
{TEXT("ZPSAVE") , CmdZeroPageSave , CMD_ZEROPAGE_POINTER_SAVE , "Save zero page pointers" }, // due to symbol look-up
{"ZP" , CmdZeroPageAdd , CMD_ZEROPAGE_POINTER , "Alias for ZPA (Zero Page Add)" },
{"ZP0" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_0 , "Set/Update/Remove ZP watch 0 " },
{"ZP1" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_1 , "Set/Update/Remove ZP watch 1" },
{"ZP2" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_2 , "Set/Update/Remove ZP watch 2" },
{"ZP3" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_3 , "Set/Update/Remove ZP watch 3" },
{"ZP4" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_4 , "Set/Update/Remove ZP watch 4" },
{"ZP5" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_5 , "Set/Update/Remove ZP watch 5 " },
{"ZP6" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_6 , "Set/Update/Remove ZP watch 6" },
{"ZP7" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_7 , "Set/Update/Remove ZP watch 7" },
{"ZPA" , CmdZeroPageAdd , CMD_ZEROPAGE_POINTER_ADD , "Add/Update address to zero page pointer"},
{"ZPC" , CmdZeroPageClear , CMD_ZEROPAGE_POINTER_CLEAR , "Clear (remove) zero page pointer" },
{"ZPD" , CmdZeroPageDisable , CMD_ZEROPAGE_POINTER_DISABLE,"Disable zero page pointer - it is still in the list, just not active" },
{"ZPE" , CmdZeroPageEnable , CMD_ZEROPAGE_POINTER_ENABLE, "(Re)Enable disabled zero page pointer" },
{"ZPL" , CmdZeroPageList , CMD_ZEROPAGE_POINTER_LIST , "List all zero page pointers" },
// {"ZPLOAD" , CmdZeroPageLoad , CMD_ZEROPAGE_POINTER_LOAD , "Load zero page pointers" }, // Cant use as param to ZP
{"ZPSAVE" , CmdZeroPageSave , CMD_ZEROPAGE_POINTER_SAVE , "Save zero page pointers" }, // due to symbol look-up
// {TEXT("TIMEDEMO"),CmdTimeDemo, CMD_TIMEDEMO }, // CmdBenchmarkStart(), CmdBenchmarkStop()
// {TEXT("WC"),CmdShowCodeWindow}, // Can't use since WatchClear
// {TEXT("WD"),CmdShowDataWindow}, //
// {"TIMEDEMO",CmdTimeDemo, CMD_TIMEDEMO }, // CmdBenchmarkStart(), CmdBenchmarkStop()
// {"WC",CmdShowCodeWindow}, // Can't use since WatchClear
// {"WD",CmdShowDataWindow}, //
// Internal Consistency Check
{ DEBUGGER__COMMANDS_VERIFY_TXT__, NULL, NUM_COMMANDS },
// Aliasies - Can be in any order
{TEXT("->") , NULL , CMD_CURSOR_JUMP_PC },
{TEXT("Ctrl ->" ) , NULL , CMD_CURSOR_SET_PC },
{TEXT("Shift ->") , NULL , CMD_CURSOR_JUMP_PC }, // at top
{TEXT("INPUT") , CmdIn , CMD_IN },
{"->" , NULL , CMD_CURSOR_JUMP_PC },
{"Ctrl ->" , NULL , CMD_CURSOR_SET_PC },
{"Shift ->" , NULL , CMD_CURSOR_JUMP_PC }, // at top
{"INPUT" , CmdIn , CMD_IN },
// Data
// Flags - Clear
{TEXT("RC") , CmdFlagClear , CMD_FLAG_CLR_C , "Clear Flag Carry" }, // 0 // Legacy
{TEXT("RZ") , CmdFlagClear , CMD_FLAG_CLR_Z , "Clear Flag Zero" }, // 1
{TEXT("RI") , CmdFlagClear , CMD_FLAG_CLR_I , "Clear Flag Interrupts Disabled" }, // 2
{TEXT("RD") , CmdFlagClear , CMD_FLAG_CLR_D , "Clear Flag Decimal (BCD)" }, // 3
{TEXT("RB") , CmdFlagClear , CMD_FLAG_CLR_B , "CLear Flag Break" }, // 4 // Legacy
{TEXT("RR") , CmdFlagClear , CMD_FLAG_CLR_R , "Clear Flag Reserved" }, // 5
{TEXT("RV") , CmdFlagClear , CMD_FLAG_CLR_V , "Clear Flag Overflow" }, // 6
{TEXT("RN") , CmdFlagClear , CMD_FLAG_CLR_N , "Clear Flag Negative (Sign)" }, // 7
{"RC" , CmdFlagClear , CMD_FLAG_CLR_C , "Clear Flag Carry" }, // 0 // Legacy
{"RZ" , CmdFlagClear , CMD_FLAG_CLR_Z , "Clear Flag Zero" }, // 1
{"RI" , CmdFlagClear , CMD_FLAG_CLR_I , "Clear Flag Interrupts Disabled" }, // 2
{"RD" , CmdFlagClear , CMD_FLAG_CLR_D , "Clear Flag Decimal (BCD)" }, // 3
{"RB" , CmdFlagClear , CMD_FLAG_CLR_B , "CLear Flag Break" }, // 4 // Legacy
{"RR" , CmdFlagClear , CMD_FLAG_CLR_R , "Clear Flag Reserved" }, // 5
{"RV" , CmdFlagClear , CMD_FLAG_CLR_V , "Clear Flag Overflow" }, // 6
{"RN" , CmdFlagClear , CMD_FLAG_CLR_N , "Clear Flag Negative (Sign)" }, // 7
// Flags - Set
{TEXT("SC") , CmdFlagSet , CMD_FLAG_SET_C , "Set Flag Carry" }, // 0
{TEXT("SZ") , CmdFlagSet , CMD_FLAG_SET_Z , "Set Flag Zero" }, // 1
{TEXT("SI") , CmdFlagSet , CMD_FLAG_SET_I , "Set Flag Interrupts Disabled" }, // 2
{TEXT("SD") , CmdFlagSet , CMD_FLAG_SET_D , "Set Flag Decimal (BCD)" }, // 3
{TEXT("SB") , CmdFlagSet , CMD_FLAG_SET_B , "CLear Flag Break" }, // 4 // Legacy
{TEXT("SR") , CmdFlagSet , CMD_FLAG_SET_R , "Clear Flag Reserved" }, // 5
{TEXT("SV") , CmdFlagSet , CMD_FLAG_SET_V , "Clear Flag Overflow" }, // 6
{TEXT("SN") , CmdFlagSet , CMD_FLAG_SET_N , "Clear Flag Negative" }, // 7
{"SC" , CmdFlagSet , CMD_FLAG_SET_C , "Set Flag Carry" }, // 0
{"SZ" , CmdFlagSet , CMD_FLAG_SET_Z , "Set Flag Zero" }, // 1
{"SI" , CmdFlagSet , CMD_FLAG_SET_I , "Set Flag Interrupts Disabled" }, // 2
{"SD" , CmdFlagSet , CMD_FLAG_SET_D , "Set Flag Decimal (BCD)" }, // 3
{"SB" , CmdFlagSet , CMD_FLAG_SET_B , "CLear Flag Break" }, // 4 // Legacy
{"SR" , CmdFlagSet , CMD_FLAG_SET_R , "Clear Flag Reserved" }, // 5
{"SV" , CmdFlagSet , CMD_FLAG_SET_V , "Clear Flag Overflow" }, // 6
{"SN" , CmdFlagSet , CMD_FLAG_SET_N , "Clear Flag Negative" }, // 7
// Memory
{TEXT("D") , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_1 , "Hex dump in the mini memory area 1" }, // FIXME: Must also work in DATA screen
{TEXT("M1") , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_1 }, // alias
{TEXT("M2") , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_2 }, // alias
{"D" , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_1 , "Hex dump in the mini memory area 1" }, // FIXME: Must also work in DATA screen
{"M1" , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_1 }, // alias
{"M2" , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_2 }, // alias
{TEXT("ME8") , CmdMemoryEnterByte , CMD_MEMORY_ENTER_BYTE }, // changed from EB -- bugfix: EB:## ##
{TEXT("ME16") , CmdMemoryEnterWord , CMD_MEMORY_ENTER_WORD },
{TEXT("MM") , CmdMemoryMove , CMD_MEMORY_MOVE },
{TEXT("MS") , CmdMemorySearch , CMD_MEMORY_SEARCH }, // CmdMemorySearch
{TEXT("P0") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_0 },
{TEXT("P1") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_1 },
{TEXT("P2") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_2 },
{TEXT("P3") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_3 },
{TEXT("P4") , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_4 },
{TEXT("REGISTER") , CmdRegisterSet , CMD_REGISTER_SET },
// {TEXT("RET") , CmdStackReturn , CMD_STACK_RETURN },
{TEXT("TRACE") , CmdTrace , CMD_TRACE },
{"ME8" , CmdMemoryEnterByte , CMD_MEMORY_ENTER_BYTE }, // changed from EB -- bugfix: EB:## ##
{"ME16" , CmdMemoryEnterWord , CMD_MEMORY_ENTER_WORD },
{"MM" , CmdMemoryMove , CMD_MEMORY_MOVE },
{"MS" , CmdMemorySearch , CMD_MEMORY_SEARCH }, // CmdMemorySearch
{"P0" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_0 },
{"P1" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_1 },
{"P2" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_2 },
{"P3" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_3 },
{"P4" , CmdZeroPagePointer , CMD_ZEROPAGE_POINTER_4 },
{"REGISTER" , CmdRegisterSet , CMD_REGISTER_SET },
// {"RET" , CmdStackReturn , CMD_STACK_RETURN },
{"TRACE" , CmdTrace , CMD_TRACE },
// {TEXT("SYMBOLS") , CmdSymbols , CMD_SYMBOLS_LOOKUP , "Return " },
// {TEXT("SYMBOLS1") , CmdSymbolsInfo , CMD_SYMBOLS_1 },
// {TEXT("SYMBOLS2") , CmdSymbolsInfo , CMD_SYMBOLS_2 },
// {"SYMBOLS" , CmdSymbols , CMD_SYMBOLS_LOOKUP , "Return " },
// {"SYMBOLS1" , CmdSymbolsInfo , CMD_SYMBOLS_1 },
// {"SYMBOLS2" , CmdSymbolsInfo , CMD_SYMBOLS_2 },
// {"SYM0" , CmdSymbolsInfo , CMD_SYMBOLS_ROM },
// {"SYM1" , CmdSymbolsInfo , CMD_SYMBOLS_APPLESOFT },
// {"SYM2" , CmdSymbolsInfo , CMD_SYMBOLS_ASSEMBLY },
@ -380,20 +383,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{"SYMDOS" , CmdSymbolsCommand , CMD_SYMBOLS_DOS33 },
{"SYMPRO" , CmdSymbolsCommand , CMD_SYMBOLS_PRODOS },
{TEXT("TEXT40") , CmdViewOutput_Text4X , CMD_VIEW_TEXT4X },
{TEXT("TEXT41") , CmdViewOutput_Text41 , CMD_VIEW_TEXT41 },
{TEXT("TEXT42") , CmdViewOutput_Text42 , CMD_VIEW_TEXT42 },
{"TEXT40" , CmdViewOutput_Text4X , CMD_VIEW_TEXT4X },
{"TEXT41" , CmdViewOutput_Text41 , CMD_VIEW_TEXT41 },
{"TEXT42" , CmdViewOutput_Text42 , CMD_VIEW_TEXT42 },
// {TEXT("WATCH") , CmdWatchAdd , CMD_WATCH_ADD },
{TEXT("WINDOW") , CmdWindow , CMD_WINDOW },
// {TEXT("W?") , CmdWatchAdd , CMD_WATCH_ADD },
{TEXT("ZAP") , CmdNOP , CMD_NOP },
// {"WATCH" , CmdWatchAdd , CMD_WATCH_ADD },
{"WINDOW" , CmdWindow , CMD_WINDOW },
// {"W?" , CmdWatchAdd , CMD_WATCH_ADD },
{"ZAP" , CmdNOP , CMD_NOP },
// DEPRECATED -- Probably should be removed in a future version
{TEXT("BENCH") , CmdBenchmarkStart , CMD_BENCHMARK },
{TEXT("EXITBENCH") , NULL , CMD_BENCHMARK }, // 2.8.03 was incorrectly alias with 'E' Bug #246. // CmdBenchmarkStop
{TEXT("MDB") , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_1 }, // MemoryDumpByte // Did anyone actually use this??
// {TEXT("MEMORY") , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_1 }, // MemoryDumpByte // Did anyone actually use this??
{"BENCH" , CmdBenchmarkStart , CMD_BENCHMARK },
{"EXITBENCH" , NULL , CMD_BENCHMARK }, // 2.8.03 was incorrectly alias with 'E' Bug #246. // CmdBenchmarkStop
{"MDB" , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_1 }, // MemoryDumpByte // Did anyone actually use this??
// {"MEMORY" , CmdMemoryMiniDumpHex , CMD_MEM_MINI_DUMP_HEX_1 }, // MemoryDumpByte // Did anyone actually use this??
};
const int NUM_COMMANDS_WITH_ALIASES = sizeof(g_aCommands) / sizeof (Command_t); // Determined at compile-time ;-)
@ -406,78 +409,78 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Command_t g_aParameters[] =
{
// Breakpoint
{TEXT("<=") , NULL, PARAM_BP_LESS_EQUAL },
{TEXT("<" ) , NULL, PARAM_BP_LESS_THAN },
{TEXT("=" ) , NULL, PARAM_BP_EQUAL },
{TEXT("!=") , NULL, PARAM_BP_NOT_EQUAL },
{TEXT("!" ) , NULL, PARAM_BP_NOT_EQUAL_1 },
{TEXT(">" ) , NULL, PARAM_BP_GREATER_THAN },
{TEXT(">=") , NULL, PARAM_BP_GREATER_EQUAL },
{TEXT("R") , NULL, PARAM_BP_READ },
{TEXT("?") , NULL, PARAM_BP_READ },
{TEXT("W") , NULL, PARAM_BP_WRITE },
{TEXT("@") , NULL, PARAM_BP_WRITE },
{TEXT("*") , NULL, PARAM_BP_READ_WRITE },
{"<=" , NULL, PARAM_BP_LESS_EQUAL },
{"<" , NULL, PARAM_BP_LESS_THAN },
{"=" , NULL, PARAM_BP_EQUAL },
{"!=" , NULL, PARAM_BP_NOT_EQUAL },
{"!" , NULL, PARAM_BP_NOT_EQUAL_1 },
{">" , NULL, PARAM_BP_GREATER_THAN },
{">=" , NULL, PARAM_BP_GREATER_EQUAL },
{"R" , NULL, PARAM_BP_READ },
{"?" , NULL, PARAM_BP_READ },
{"W" , NULL, PARAM_BP_WRITE },
{"@" , NULL, PARAM_BP_WRITE },
{"*" , NULL, PARAM_BP_READ_WRITE },
// Breakpoint Change, See: CmdBreakpointChange ()
{TEXT("E") , NULL, PARAM_BP_CHANGE_ENABLE },
{TEXT("e") , NULL, PARAM_BP_CHANGE_DISABLE },
{TEXT("T") , NULL, PARAM_BP_CHANGE_TEMP_ON },
{TEXT("t") , NULL, PARAM_BP_CHANGE_TEMP_OFF },
{TEXT("S") , NULL, PARAM_BP_CHANGE_STOP_ON },
{TEXT("s") , NULL, PARAM_BP_CHANGE_STOP_OFF },
{"E" , NULL, PARAM_BP_CHANGE_ENABLE },
{"e" , NULL, PARAM_BP_CHANGE_DISABLE },
{"T" , NULL, PARAM_BP_CHANGE_TEMP_ON },
{"t" , NULL, PARAM_BP_CHANGE_TEMP_OFF },
{"S" , NULL, PARAM_BP_CHANGE_STOP_ON },
{"s" , NULL, PARAM_BP_CHANGE_STOP_OFF },
// Regs (for PUSH / POP)
{TEXT("A") , NULL, PARAM_REG_A },
{TEXT("X") , NULL, PARAM_REG_X },
{TEXT("Y") , NULL, PARAM_REG_Y },
{TEXT("PC") , NULL, PARAM_REG_PC },
{TEXT("S") , NULL, PARAM_REG_SP },
{"A" , NULL, PARAM_REG_A },
{"X" , NULL, PARAM_REG_X },
{"Y" , NULL, PARAM_REG_Y },
{"PC" , NULL, PARAM_REG_PC },
{"S" , NULL, PARAM_REG_SP },
// Flags
{TEXT("P") , NULL, PARAM_FLAGS },
{TEXT("C") , NULL, PARAM_FLAG_C }, // ---- ---1 Carry
{TEXT("Z") , NULL, PARAM_FLAG_Z }, // ---- --1- Zero
{TEXT("I") , NULL, PARAM_FLAG_I }, // ---- -1-- Interrupt
{TEXT("D") , NULL, PARAM_FLAG_D }, // ---- 1--- Decimal
{TEXT("B") , NULL, PARAM_FLAG_B }, // ---1 ---- Break
{TEXT("R") , NULL, PARAM_FLAG_R }, // --1- ---- Reserved
{TEXT("V") , NULL, PARAM_FLAG_V }, // -1-- ---- Overflow
{TEXT("N") , NULL, PARAM_FLAG_N }, // 1--- ---- Sign
{"P" , NULL, PARAM_FLAGS },
{"C" , NULL, PARAM_FLAG_C }, // ---- ---1 Carry
{"Z" , NULL, PARAM_FLAG_Z }, // ---- --1- Zero
{"I" , NULL, PARAM_FLAG_I }, // ---- -1-- Interrupt
{"D" , NULL, PARAM_FLAG_D }, // ---- 1--- Decimal
{"B" , NULL, PARAM_FLAG_B }, // ---1 ---- Break
{"R" , NULL, PARAM_FLAG_R }, // --1- ---- Reserved
{"V" , NULL, PARAM_FLAG_V }, // -1-- ---- Overflow
{"N" , NULL, PARAM_FLAG_N }, // 1--- ---- Sign
// Disasm
{TEXT("BRANCH") , NULL, PARAM_CONFIG_BRANCH },
{TEXT("CLICK") , NULL, PARAM_CONFIG_CLICK }, // GH#462
{TEXT("COLON") , NULL, PARAM_CONFIG_COLON },
{TEXT("OPCODE") , NULL, PARAM_CONFIG_OPCODE },
{TEXT("POINTER") , NULL, PARAM_CONFIG_POINTER },
{TEXT("SPACES") , NULL, PARAM_CONFIG_SPACES },
{TEXT("TARGET") , NULL, PARAM_CONFIG_TARGET },
{"BRANCH" , NULL, PARAM_CONFIG_BRANCH },
{"CLICK" , NULL, PARAM_CONFIG_CLICK }, // GH#462
{"COLON" , NULL, PARAM_CONFIG_COLON },
{"OPCODE" , NULL, PARAM_CONFIG_OPCODE },
{"POINTER" , NULL, PARAM_CONFIG_POINTER },
{"SPACES" , NULL, PARAM_CONFIG_SPACES },
{"TARGET" , NULL, PARAM_CONFIG_TARGET },
// Disk
{TEXT("INFO") , NULL, PARAM_DISK_INFO },
{TEXT("SLOT") , NULL, PARAM_DISK_SET_SLOT },
{TEXT("EJECT") , NULL, PARAM_DISK_EJECT },
{TEXT("PROTECT") , NULL, PARAM_DISK_PROTECT },
{TEXT("READ") , NULL, PARAM_DISK_READ },
{"INFO" , NULL, PARAM_DISK_INFO },
{"SLOT" , NULL, PARAM_DISK_SET_SLOT },
{"EJECT" , NULL, PARAM_DISK_EJECT },
{"PROTECT" , NULL, PARAM_DISK_PROTECT },
{"READ" , NULL, PARAM_DISK_READ },
// Font (Config)
{TEXT("MODE") , NULL, PARAM_FONT_MODE }, // also INFO, CONSOLE, DISASM (from Window)
{"MODE" , NULL, PARAM_FONT_MODE }, // also INFO, CONSOLE, DISASM (from Window)
// General
{TEXT("FIND") , NULL, PARAM_FIND },
{TEXT("BRANCH") , NULL, PARAM_BRANCH },
{"FIND" , NULL, PARAM_FIND },
{"BRANCH" , NULL, PARAM_BRANCH },
{"CATEGORY" , NULL, PARAM_CATEGORY },
{TEXT("CLEAR") , NULL, PARAM_CLEAR },
{TEXT("LOAD") , NULL, PARAM_LOAD },
{TEXT("LIST") , NULL, PARAM_LIST },
{TEXT("OFF") , NULL, PARAM_OFF },
{TEXT("ON") , NULL, PARAM_ON },
{TEXT("RESET") , NULL, PARAM_RESET },
{TEXT("SAVE") , NULL, PARAM_SAVE },
{TEXT("START") , NULL, PARAM_START }, // benchmark
{TEXT("STOP") , NULL, PARAM_STOP }, // benchmark
{TEXT("ALL") , NULL, PARAM_ALL },
{"CLEAR" , NULL, PARAM_CLEAR },
{"LOAD" , NULL, PARAM_LOAD },
{"LIST" , NULL, PARAM_LIST },
{"OFF" , NULL, PARAM_OFF },
{"ON" , NULL, PARAM_ON },
{"RESET" , NULL, PARAM_RESET },
{"SAVE" , NULL, PARAM_SAVE },
{"START" , NULL, PARAM_START }, // benchmark
{"STOP" , NULL, PARAM_STOP }, // benchmark
{"ALL" , NULL, PARAM_ALL },
// Help Categories
{"*" , NULL, PARAM_WILDSTAR },
{"BOOKMARKS" , NULL, PARAM_CAT_BOOKMARKS },
{"BREAKPOINTS" , NULL, PARAM_CAT_BREAKPOINTS },
{"CONFIG" , NULL, PARAM_CAT_CONFIG },
{"CPU" , NULL, PARAM_CAT_CPU },
// {TEXT("EXPRESSION") ,
// {"EXPRESSION" ,
{"FLAGS" , NULL, PARAM_CAT_FLAGS },
{"HELP" , NULL, PARAM_CAT_HELP },
{"KEYBOARD" , NULL, PARAM_CAT_KEYBOARD },
@ -485,42 +488,42 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{"OUTPUT" , NULL, PARAM_CAT_OUTPUT },
{"OPERATORS" , NULL, PARAM_CAT_OPERATORS },
{"RANGE" , NULL, PARAM_CAT_RANGE },
// {TEXT("REGISTERS") , NULL, PARAM_CAT_REGISTERS },
// {"REGISTERS" , NULL, PARAM_CAT_REGISTERS },
{"SYMBOLS" , NULL, PARAM_CAT_SYMBOLS },
{"VIEW" , NULL, PARAM_CAT_VIEW },
{"WATCHES" , NULL, PARAM_CAT_WATCHES },
{"WINDOW" , NULL, PARAM_CAT_WINDOW },
{"ZEROPAGE" , NULL, PARAM_CAT_ZEROPAGE },
// Memory
{TEXT("?") , NULL, PARAM_MEM_SEARCH_WILD },
// {TEXT("*") , NULL, PARAM_MEM_SEARCH_BYTE },
{"?" , NULL, PARAM_MEM_SEARCH_WILD },
// {"*" , NULL, PARAM_MEM_SEARCH_BYTE },
// Source level debugging
{TEXT("MEM") , NULL, PARAM_SRC_MEMORY },
{TEXT("MEMORY") , NULL, PARAM_SRC_MEMORY },
{TEXT("SYM") , NULL, PARAM_SRC_SYMBOLS },
{TEXT("SYMBOLS") , NULL, PARAM_SRC_SYMBOLS },
{TEXT("MERLIN") , NULL, PARAM_SRC_MERLIN },
{TEXT("ORCA") , NULL, PARAM_SRC_ORCA },
{"MEM" , NULL, PARAM_SRC_MEMORY },
{"MEMORY" , NULL, PARAM_SRC_MEMORY },
{"SYM" , NULL, PARAM_SRC_SYMBOLS },
{"SYMBOLS" , NULL, PARAM_SRC_SYMBOLS },
{"MERLIN" , NULL, PARAM_SRC_MERLIN },
{"ORCA" , NULL, PARAM_SRC_ORCA },
// View
// {TEXT("VIEW") , NULL, PARAM_SRC_??? },
// {"VIEW" , NULL, PARAM_SRC_??? },
// Window Win Cmd WinEffects CmdEffects
{TEXT("CODE") , NULL, PARAM_CODE }, // x x code win only switch to code window
// {TEXT("CODE1") , NULL, PARAM_CODE_1 }, // - x code/data win
{TEXT("CODE2") , NULL, PARAM_CODE_2 }, // - x code/data win
{TEXT("CONSOLE") , NULL, PARAM_CONSOLE }, // x - switch to console window
{TEXT("DATA") , NULL, PARAM_DATA }, // x x data win only switch to data window
// {TEXT("DATA1") , NULL, PARAM_DATA_1 }, // - x code/data win
{TEXT("DATA2") , NULL, PARAM_DATA_2 }, // - x code/data win
{TEXT("DISASM") , NULL, PARAM_DISASM }, //
{TEXT("INFO") , NULL, PARAM_INFO }, // - x code/data Toggles showing/hiding Regs/Stack/BP/Watches/ZP
{TEXT("SOURCE") , NULL, PARAM_SOURCE }, // x x switch to source window
{TEXT("SRC") , NULL, PARAM_SOURCE }, // alias
// {TEXT("SOURCE_1") , NULL, PARAM_SOURCE_1 }, // - x code/data
{TEXT("SOURCE2 ") , NULL, PARAM_SOURCE_2 }, // - x
{TEXT("SYMBOLS") , NULL, PARAM_SYMBOLS }, // x x code/data win switch to symbols window
{TEXT("SYM") , NULL, PARAM_SYMBOLS }, // alias x SOURCE [SYM] [MEM] filename
// {TEXT("SYMBOL1") , NULL, PARAM_SYMBOL_1 }, // - x code/data win
{TEXT("SYMBOL2") , NULL, PARAM_SYMBOL_2 }, // - x code/data win
{"CODE" , NULL, PARAM_CODE }, // x x code win only switch to code window
// {"CODE1" , NULL, PARAM_CODE_1 }, // - x code/data win
{"CODE2" , NULL, PARAM_CODE_2 }, // - x code/data win
{"CONSOLE" , NULL, PARAM_CONSOLE }, // x - switch to console window
{"DATA" , NULL, PARAM_DATA }, // x x data win only switch to data window
// {"DATA1" , NULL, PARAM_DATA_1 }, // - x code/data win
{"DATA2" , NULL, PARAM_DATA_2 }, // - x code/data win
{"DISASM" , NULL, PARAM_DISASM }, //
{"INFO" , NULL, PARAM_INFO }, // - x code/data Toggles showing/hiding Regs/Stack/BP/Watches/ZP
{"SOURCE" , NULL, PARAM_SOURCE }, // x x switch to source window
{"SRC" , NULL, PARAM_SOURCE }, // alias
// {"SOURCE_1" , NULL, PARAM_SOURCE_1 }, // - x code/data
{"SOURCE2 " , NULL, PARAM_SOURCE_2 }, // - x
{"SYMBOLS" , NULL, PARAM_SYMBOLS }, // x x code/data win switch to symbols window
{"SYM" , NULL, PARAM_SYMBOLS }, // alias x SOURCE [SYM] [MEM] filename
// {"SYMBOL1" , NULL, PARAM_SYMBOL_1 }, // - x code/data win
{"SYMBOL2" , NULL, PARAM_SYMBOL_2 }, // - x code/data win
// Internal Consistency Check
{ DEBUGGER__PARAMS_VERIFY_TXT__, NULL, NUM_PARAMS },
};

View File

@ -516,7 +516,7 @@ void ConsoleInputReset ()
ConsoleInputClear();
// _tcscpy( g_aConsoleInput, g_sConsolePrompt ); // Assembler can change prompt
// strcpy( g_aConsoleInput, g_sConsolePrompt ); // Assembler can change prompt
g_aConsoleInput[0] = g_sConsolePrompt[0];
g_nConsolePromptLen = 1;

View File

@ -223,8 +223,8 @@
extern char g_sConsoleCursor[];
// Display
extern char g_aConsolePrompt[];// = TEXT(">!"); // input, assembler // NUM_PROMPTS
extern char g_sConsolePrompt[];// = TEXT(">"); // No, NOT Integer Basic! The nostalgic '*' "Monitor" doesn't look as good, IMHO. :-(
extern char g_aConsolePrompt[];// = ">!"; // input, assembler // NUM_PROMPTS
extern char g_sConsolePrompt[];// = ">"; // No, NOT Integer Basic! The nostalgic '*' "Monitor" doesn't look as good, IMHO. :-(
extern int g_nConsolePromptLen;
extern bool g_bConsoleFullWidth;// = false;
@ -238,7 +238,7 @@
// Input History
extern int g_nHistoryLinesStart;// = 0;
extern int g_nHistoryLinesTotal;// = 0; // number of commands entered
extern char g_aHistoryLines[ HISTORY_HEIGHT ][ HISTORY_WIDTH ];// = {TEXT("")};
extern char g_aHistoryLines[ HISTORY_HEIGHT ][ HISTORY_WIDTH ];// = {""};
// Input Line
// Raw input Line (has prompt)

View File

@ -48,15 +48,15 @@ std::string FormatAddress(WORD nAddress, int nBytes)
}
//===========================================================================
char* FormatCharCopy(char* pDst, const char* pEnd, const char* pSrc, const int nLen)
static char* FormatCharCopy(char* pDst, const char* pEnd, uint16_t srcAddr, const int nLen)
{
for (int i = 0; i < nLen && pDst < pEnd; i++)
*pDst++ = FormatCharTxtCtrl(*pSrc++);
*pDst++ = FormatCharTxtCtrl(ReadByteFromMemory(srcAddr++));
return pDst;
}
//===========================================================================
char FormatCharTxtAsci(const BYTE b, bool* pWasAsci_)
static char FormatCharTxtAsci(const BYTE b, bool* pWasAsci_)
{
if (pWasAsci_)
*pWasAsci_ = false;
@ -74,7 +74,7 @@ char FormatCharTxtAsci(const BYTE b, bool* pWasAsci_)
// Note: FormatCharTxtCtrl() and RemapChar()
//===========================================================================
char FormatCharTxtCtrl(const BYTE b, bool* pWasCtrl_)
char FormatCharTxtCtrl(const BYTE b, bool* pWasCtrl_)
{
if (pWasCtrl_)
*pWasCtrl_ = false;
@ -92,7 +92,7 @@ char FormatCharTxtCtrl(const BYTE b, bool* pWasCtrl_)
}
//===========================================================================
char FormatCharTxtHigh(const BYTE b, bool* pWasHi_)
char FormatCharTxtHigh(const BYTE b, bool* pWasHi_)
{
if (pWasHi_)
*pWasHi_ = false;
@ -229,8 +229,9 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
{
nTarget = pData->nTargetAddress;
}
else {
nTarget = mem[(nBaseAddress + 1) & 0xFFFF] | (mem[(nBaseAddress + 2) & 0xFFFF] << 8);
else
{
nTarget = ReadWordFromMemory(nBaseAddress + 1);
if (nOpbyte == 2)
nTarget &= 0xFF;
}
@ -352,7 +353,7 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
{
bDisasmFormatFlags |= DISASM_FORMAT_TARGET_POINTER;
nTargetValue = *(mem + nTargetPointer) | (*(mem + ((nTargetPointer + 1) & 0xffff)) << 8);
nTargetValue = ReadWordFromMemory(nTargetPointer);
//if (((iOpmode >= AM_A) && (iOpmode <= AM_NZ)) && (iOpmode != AM_R))
// sTargetValue_ = WordToHexStr( nTargetValue ); // & 0xFFFF
@ -457,7 +458,7 @@ void FormatOpcodeBytes(WORD nBaseAddress, DisasmLine_t& line_)
const char* const ep = cp + sizeof(line_.sOpCodes);
for (int iByte = 0; iByte < nMaxOpBytes; iByte++)
{
const BYTE nMem = mem[(nBaseAddress + iByte) & 0xFFFF];
const BYTE nMem = ReadByteFromMemory(nBaseAddress + iByte);
if ((cp+2) < ep)
cp = StrBufferAppendByteAsHex(cp, nMem);
@ -482,11 +483,11 @@ struct FAC_t
void FAC_Unpack(WORD nAddress, FAC_t& fac_)
{
BYTE e0 = *(LPBYTE)(mem + nAddress + 0);
BYTE m1 = *(LPBYTE)(mem + nAddress + 1);
BYTE m2 = *(LPBYTE)(mem + nAddress + 2);
BYTE m3 = *(LPBYTE)(mem + nAddress + 3);
BYTE m4 = *(LPBYTE)(mem + nAddress + 4);
BYTE e0 = ReadByteFromMemory(nAddress + 0);
BYTE m1 = ReadByteFromMemory(nAddress + 1);
BYTE m2 = ReadByteFromMemory(nAddress + 2);
BYTE m3 = ReadByteFromMemory(nAddress + 3);
BYTE m4 = ReadByteFromMemory(nAddress + 4);
// sign
// EB82:A5 9D SIGN LDA FAC
@ -517,14 +518,14 @@ void FormatNopcodeBytes(WORD nBaseAddress, DisasmLine_t& line_)
// TODO: One day, line_.sTarget should become a std::string and things would be much simpler.
char* pDst = line_.sTarget;
const char* const pEnd = pDst + sizeof(line_.sTarget);
const DWORD nStartAddress = line_.pDisasmData->nStartAddress;
const DWORD nEndAddress = line_.pDisasmData->nEndAddress;
const uint32_t nStartAddress = line_.pDisasmData->nStartAddress;
const uint32_t nEndAddress = line_.pDisasmData->nEndAddress;
const int nDisplayLen = nEndAddress - nBaseAddress + 1; // *inclusive* KEEP IN SYNC: _CmdDefineByteRange() CmdDisasmDataList() _6502_GetOpmodeOpbyte() FormatNopcodeBytes()
for (int iByte = 0; iByte < line_.nOpbyte; )
{
BYTE nTarget8 = *(LPBYTE)(mem + nBaseAddress + iByte);
WORD nTarget16 = *(LPWORD)(mem + nBaseAddress + iByte);
BYTE nTarget8 = ReadByteFromMemory(nBaseAddress + iByte);
WORD nTarget16 = ReadWordFromMemory(nBaseAddress + iByte);
switch (line_.iNoptype)
{
@ -603,8 +604,8 @@ void FormatNopcodeBytes(WORD nBaseAddress, DisasmLine_t& line_)
iByte = line_.nOpbyte;
if ((pDst + iByte) < pEnd)
{
memcpy(pDst, mem + nBaseAddress, iByte);
pDst += iByte;
for (int i = 0; i < iByte; i++)
*pDst++ = ReadByteFromMemory(nBaseAddress + i);
}
*pDst = 0;
break;
@ -612,7 +613,6 @@ void FormatNopcodeBytes(WORD nBaseAddress, DisasmLine_t& line_)
case NOP_STRING_APPLE:
{
iByte = line_.nOpbyte; // handle all bytes of text
const char* pSrc = (const char*)mem + nStartAddress;
if (nDisplayLen > (DISASM_DISPLAY_MAX_IMMEDIATE_LEN - 2)) // does "text" fit?
{
@ -622,7 +622,7 @@ void FormatNopcodeBytes(WORD nBaseAddress, DisasmLine_t& line_)
;
// DISPLAY: text_longer_18...
pDst = FormatCharCopy(pDst, pEnd, pSrc, len); // BUG: #251 v2.8.0.7: ASC #:# with null byte doesn't mark up properly
pDst = FormatCharCopy(pDst, pEnd, nStartAddress, len); // BUG: #251 v2.8.0.7: ASC #:# with null byte doesn't mark up properly
if (ellipsis && (pDst + 3) < pEnd)
{
@ -635,7 +635,7 @@ void FormatNopcodeBytes(WORD nBaseAddress, DisasmLine_t& line_)
{ // DISPLAY: "max_18_char"
if ((pDst + 1) < pEnd)
*pDst++ = '"';
pDst = FormatCharCopy(pDst, pEnd, pSrc, nDisplayLen); // BUG: #251 v2.8.0.7: ASC #:# with null byte doesn't mark up properly
pDst = FormatCharCopy(pDst, pEnd, nStartAddress, nDisplayLen); // BUG: #251 v2.8.0.7: ASC #:# with null byte doesn't mark up properly
if ((pDst + 1) < pEnd)
*pDst++ = '"';
}

View File

@ -82,6 +82,9 @@ WORD _GetDataRange (int nArgs, int iArg, DisasmData_t& tData_)
else
{
// DB foo = 300 // nArgs == 3
// 2.9.2.3: Fixed: DB HGR = 2000:3FFF and DB FOO = 300 wasn't parsing correctly from 2.9.1.3. Fix for commit 48e0fe3a.
if (g_aArgs[iArg].eToken == TOKEN_EQUAL)
iArg++;
RangeType_t eRange = Range_Get( nAddress, nAddress2, iArg);
if ((eRange == RANGE_HAS_END) ||
@ -97,10 +100,7 @@ WORD _GetDataRange (int nArgs, int iArg, DisasmData_t& tData_)
// 2.9.1.1 Add: Support for equal sign, also make it optional for command DB
// DB FOO 300
// DB FOO = 300
if (g_aArgs[2].bType == TOKEN_EQUAL)
nAddress = g_aArgs[ 3 ].nValue;
else
nAddress = g_aArgs[ 2 ].nValue;
nAddress = g_aArgs[ iArg ].nValue;
}
else
nAddress = g_aArgs[ 1 ].nValue;
@ -373,7 +373,8 @@ Update_t _CmdDisasmDataDefByteX (int nArgs)
// To "return to code" use ."X"
int iCmd = g_aArgs[0].nValue - NOP_BYTE_1;
if (nArgs > 4) // 2.7.0.31 Bug fix: DB range, i.e. DB 174E:174F
// 2.9.2.2: Bug fix: DB HGR = 2000:3FFF was displaying help instead of being parsed.
if (nArgs > 5) // 2.7.0.31 Bug fix: DB range, i.e. DB 174E:174F
{
return Help_Arg_1( CMD_DEFINE_DATA_BYTE1 + iCmd );
}
@ -489,7 +490,8 @@ Update_t CmdDisasmDataDefAddress16 (int nArgs)
{
int iCmd = NOP_WORD_1 - g_aArgs[0].nValue;
if (! ((nArgs <= 2) || (nArgs == 4)))
// 2.9.2.4 Fixed: DA RESET = 3F2 was displaying help instead of being parsed.
if (nArgs > 4)
{
return Help_Arg_1( CMD_DEFINE_DATA_WORD1 + iCmd );
}

View File

@ -42,6 +42,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../Memory.h"
#include "../Mockingboard.h"
#include "../NTSC.h"
#include "../resource/resource.h"
// NEW UI debugging - force display ALL meta-info (regs, stack, bp, watches, zp) for debugging purposes
#define DEBUG_FORCE_DISPLAY 0
@ -231,7 +232,7 @@ enum WinROP4_e
*/
#if DEBUG_FONT_ROP
const DWORD aROP4[ 256 ] =
const uint32_t aROP4[ 256 ] =
{
0x00000042, // BLACKNESS
0x00010289, // DPSoon
@ -593,7 +594,7 @@ HDC GetConsoleFontDC(void)
// DRAW THE SOURCE IMAGE INTO THE SOURCE BIT BUFFER
HDC tmpDC = CreateCompatibleDC(hFrameDC);
// Pre-scaled bitmap
HBITMAP tmpFont = LoadBitmap(win32Frame.g_hInstance, TEXT("IDB_DEBUG_FONT_7x8")); // Bitmap must be 112x128 as defined above
HBITMAP tmpFont = LoadBitmap(win32Frame.g_hInstance, MAKEINTRESOURCE(IDB_DEBUG_FONT_7_by_8)); // Bitmap must be 112x128 as defined above
SelectObject(tmpDC, tmpFont);
BitBlt(g_hConsoleFontDC, 0, 0, CONSOLE_FONT_BITMAP_WIDTH, CONSOLE_FONT_BITMAP_HEIGHT,
tmpDC, 0, 0,
@ -647,7 +648,7 @@ void StretchBltMemToFrameDC(void)
GetDebuggerMemDC(), // HDC hdcSrc,
0, 0, // int nXOriginSrc, int nYOriginSrc,
GetVideo().GetFrameBufferBorderlessWidth(), GetVideo().GetFrameBufferBorderlessHeight(), // int nWidthSrc, int nHeightSrc,
SRCCOPY // DWORD dwRop
SRCCOPY // uint32_t dwRop
);
}
@ -2130,7 +2131,7 @@ void DrawMemory ( int line, int iMemDump )
#if DISPLAY_MEMORY_TITLE
if (eDevice == DEV_MB_SUBUNIT)
{
sAddress = StrFormat("%c: SY & AY", 'A' + subUnit);
sAddress = StrFormat("%c:%cSY & AY", 'A' + subUnit, !MB.subUnit[subUnit].is6522Bad ? ' ' : '!');
}
else if (eDevice == DEV_AY8913_PAIR)
{
@ -2160,6 +2161,8 @@ void DrawMemory ( int line, int iMemDump )
PrintTextCursorX(" at ", rect2);
DebuggerSetColorFG(DebuggerGetColor(FG_INFO_ADDRESS));
if (MB.subUnit[subUnit].is6522Bad && eDevice == DEV_MB_SUBUNIT)
DebuggerSetColorFG(DebuggerGetColor(FG_INFO_ADDRESS_SY6522_AY8913_BAD));
PrintTextCursorY(sAddress.c_str(), rect2);
#endif
@ -2263,17 +2266,17 @@ void DrawMemory ( int line, int iMemDump )
std::string sText;
// .12 Bugfix: DrawMemory() should draw memory byte for IO address: ML1 C000
// if ((iAddress >= _6502_IO_BEGIN) && (iAddress <= _6502_IO_END))
// if ((iAddress >= APPLE_IO_BEGIN) && (iAddress <= APPLE_IO_END))
// {
// sText = "IO ";
// }
// else
{
BYTE nData = (unsigned)*(LPBYTE)(mem + iAddress);
const BYTE nData = ReadByteFromMemory(iAddress);
if (iView == MEM_VIEW_HEX)
{
if ((iAddress >= _6502_IO_BEGIN) && (iAddress <= _6502_IO_END))
if ((iAddress >= APPLE_IO_BEGIN) && (iAddress <= APPLE_IO_END))
{
DebuggerSetColorFG(DebuggerGetColor(FG_INFO_IO_BYTE));
}
@ -2283,7 +2286,7 @@ void DrawMemory ( int line, int iMemDump )
else
{
// .12 Bugfix: DrawMemory() should draw memory byte for IO address: ML1 C000
if ((iAddress >= _6502_IO_BEGIN) && (iAddress <= _6502_IO_END))
if ((iAddress >= APPLE_IO_BEGIN) && (iAddress <= APPLE_IO_END))
iBackground = BG_INFO_IO_BYTE;
sText = ColorizeSpecialChar(nData, iView, iBackground);
@ -2603,7 +2606,7 @@ void _DrawSoftSwitchLanguageCardBank( RECT & rect, const int iBankDisplay, int b
PrintTextCursorX( sMemType, rect );
DebuggerSetColorFG( DebuggerGetColor( FG_INFO_ADDRESS )); // orange
PrintTextCursorX( ByteToHexStr( iActiveBank & 0x7F ).c_str(), rect );
PrintTextCursorX( ByteToHexStr( iActiveBank & 0xFF ).c_str(), rect );
}
else
{
@ -2853,7 +2856,7 @@ void DrawStack ( int line)
if (nAddress <= _6502_STACK_END)
{
DebuggerSetColorFG( DebuggerGetColor( FG_INFO_OPCODE )); // COLOR_FG_DATA_TEXT
PrintTextCursorX( StrFormat( " %02X", (unsigned)*(LPBYTE)(mem+nAddress) ).c_str(), rect );
PrintTextCursorX(StrFormat(" %02X", ReadByteFromMemory(nAddress)).c_str(), rect);
}
iStack++;
}
@ -2868,7 +2871,7 @@ void DrawTargets ( int line)
int aTarget[3];
_6502_GetTargets( regs.pc, &aTarget[0],&aTarget[1],&aTarget[2], NULL );
GetTargets_IgnoreDirectJSRJMP(mem[regs.pc], aTarget[2]);
GetTargets_IgnoreDirectJSRJMP(ReadByteFromMemory(regs.pc), aTarget[2]);
aTarget[1] = aTarget[2]; // Move down as we only have 2 lines
@ -2879,7 +2882,7 @@ void DrawTargets ( int line)
while (iAddress--)
{
// .6 Bugfix: DrawTargets() should draw target byte for IO address: R PC FB33
// if ((aTarget[iAddress] >= _6502_IO_BEGIN) && (aTarget[iAddress] <= _6502_IO_END))
// if ((aTarget[iAddress] >= APPLE_IO_BEGIN) && (aTarget[iAddress] <= APPLE_IO_END))
// aTarget[iAddress] = NO_6502_TARGET;
std::string sAddress = "-none-";
@ -2893,9 +2896,9 @@ void DrawTargets ( int line)
{
sAddress = WordToHexStr(aTarget[iAddress]);
if (iAddress)
sData = ByteToHexStr(*(LPBYTE)(mem+aTarget[iAddress]));
sData = ByteToHexStr(ReadByteFromMemory(aTarget[iAddress]));
else
sData = WordToHexStr(*(LPWORD)(mem+aTarget[iAddress]));
sData = WordToHexStr(ReadWordFromMemory(aTarget[iAddress]));
}
rect.left = DISPLAY_TARGETS_COLUMN;
@ -2969,11 +2972,11 @@ void DrawWatches (int line)
//
BYTE nTargetL = *(LPBYTE)(mem + g_aWatches[iWatch].nAddress);
BYTE nTargetL = ReadByteFromMemory(g_aWatches[iWatch].nAddress);
DebuggerSetColorFG( DebuggerGetColor( FG_INFO_OPCODE ));
PrintTextCursorX( ByteToHexStr( nTargetL ).c_str(), rect2 );
BYTE nTargetH = *(LPBYTE)(mem + ((g_aWatches[iWatch].nAddress + 1) & 0xffff));
BYTE nTargetH = ReadByteFromMemory(g_aWatches[iWatch].nAddress + 1);
DebuggerSetColorFG( DebuggerGetColor( FG_INFO_OPCODE ));
PrintTextCursorX( ByteToHexStr( nTargetH ).c_str(), rect2 );
@ -3006,7 +3009,7 @@ void DrawWatches (int line)
else
DebuggerSetColorBG( DebuggerGetColor( BG_DATA_2 ));
BYTE nValue8 = mem[ (nTarget16 + iByte) & 0xffff ];
BYTE nValue8 = ReadByteFromMemory(nTarget16 + iByte);
PrintTextCursorX( ByteToHexStr( nValue8 ).c_str(), rect2 );
}
}
@ -3152,14 +3155,14 @@ void DrawZeroPagePointers ( int line )
DebuggerSetColorFG( DebuggerGetColor( FG_INFO_OPERATOR ));
PrintTextCursorX( ":", rect2 );
WORD nTarget16 = (WORD)mem[ nZPAddr1 ] | ((WORD)mem[ nZPAddr2 ]<< 8);
WORD nTarget16 = (WORD)ReadByteFromMemory(nZPAddr1) | (((WORD)ReadByteFromMemory(nZPAddr2)) << 8);
DebuggerSetColorFG( DebuggerGetColor( FG_INFO_ADDRESS ));
PrintTextCursorX( WordToHexStr( nTarget16 ).c_str(), rect2 );
DebuggerSetColorFG( DebuggerGetColor( FG_INFO_OPERATOR ));
PrintTextCursorX( ":", rect2 );
BYTE nValue8 = (unsigned)*(LPBYTE)(mem + nTarget16);
BYTE nValue8 = ReadByteFromMemory(nTarget16);
DebuggerSetColorFG( DebuggerGetColor( FG_INFO_OPCODE ));
PrintTextCursorX( ByteToHexStr( nValue8 ).c_str(), rect2 );
}
@ -3253,10 +3256,10 @@ void DrawSubWindow_Data (Update_t bUpdate)
std::string sAddress = WordToHexStr( iAddress );
std::string sOpcodes;
const BYTE* mp = mem + iAddress;
for ( int iByte = 0; iByte < nMaxOpcodes; ++iByte, ++mp )
WORD srcAddr = iAddress;
for (int iByte = 0; iByte < nMaxOpcodes; ++iByte, ++srcAddr)
{
StrAppendByteAsHex(sOpcodes, *mp);
StrAppendByteAsHex(sOpcodes, ReadByteFromMemory(srcAddr));
sOpcodes += ' ';
}
@ -3300,9 +3303,9 @@ void DrawSubWindow_Data (Update_t bUpdate)
iAddress = nAddress;
for ( int iByte = 0; iByte < nMaxOpcodes; iByte++ )
{
BYTE nImmediate = (unsigned)*(LPBYTE)(mem + iAddress);
BYTE nImmediate = ReadByteFromMemory(iAddress);
/*int iTextBackground = iBackground;
if ((iAddress >= _6502_IO_BEGIN) && (iAddress <= _6502_IO_END))
if ((iAddress >= APPLE_IO_BEGIN) && (iAddress <= APPLE_IO_END))
{
iTextBackground = BG_INFO_IO_BYTE;
}
@ -3320,7 +3323,7 @@ void DrawSubWindow_Data (Update_t bUpdate)
BYTE nImmediate = (unsigned)*(LPBYTE)(membank + iAddress);
int iTextBackground = iBackground; // BG_INFO_CHAR;
//pMD->eView == MEM_VIEW_HEX
if ((iAddress >= _6502_IO_BEGIN) && (iAddress <= _6502_IO_END))
if ((iAddress >= APPLE_IO_BEGIN) && (iAddress <= APPLE_IO_END))
iTextBackground = BG_INFO_IO_BYTE;
std::string sImmediate = ColorizeSpecialChar( nImmediate, MEM_VIEW_APPLE, iBackground );

View File

@ -45,7 +45,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
http://www.codeproject.com/cpp/unicode.asp
TEXT() _tcsrev
_tcsrev
_UNICODE Unicode _wcsrev
_MBCS Multi-byte _mbsrev
n/a ASCII strrev
@ -468,8 +468,8 @@ Update_t CmdHelpSpecific (int nArgs)
bool bCategory = false;
bool bDisplayCategory = true;
if ((! _tcscmp( g_aArgs[1].sArg, g_aParameters[ PARAM_WILDSTAR ].m_sName)) ||
(! _tcscmp( g_aArgs[1].sArg, g_aParameters[ PARAM_MEM_SEARCH_WILD ].m_sName)) )
if ((! strcmp( g_aArgs[1].sArg, g_aParameters[ PARAM_WILDSTAR ].m_sName)) ||
(! strcmp( g_aArgs[1].sArg, g_aParameters[ PARAM_MEM_SEARCH_WILD ].m_sName)) )
{
bAllCommands = true;
nArgs = NUM_COMMANDS;
@ -1216,11 +1216,11 @@ Update_t CmdHelpSpecific (int nArgs)
break;
case CMD_OUTPUT_ECHO:
ConsoleColorizePrint( " Usage: string" );
// ConsoleBufferPush( TEXT(" Examples:" ) );
// ConsoleBufferPush( " Examples:" );
Help_Examples();
ConsolePrintFormat( "%s %s Checkpoint", CHC_EXAMPLE, pCommand->m_sName );
ConsolePrintFormat( "%s %s PC" , CHC_EXAMPLE, pCommand->m_sName );
// ConsoleBufferPush( TEXT(" Echo the string to the console" ) );
// ConsoleBufferPush( " Echo the string to the console" );
break;
case CMD_OUTPUT_PRINT:
ConsoleColorizePrint( " Usage: <string | expression> [, string | expression]*" );
@ -1473,8 +1473,8 @@ Update_t CmdVersion (int nArgs)
for (int iArg = 1; iArg <= g_nArgRaw; iArg++ )
{
// * PARAM_WILDSTAR -> ? PARAM_MEM_SEARCH_WILD
if ((! _tcscmp( g_aArgs[ iArg ].sArg, g_aParameters[ PARAM_WILDSTAR ].m_sName )) ||
(! _tcscmp( g_aArgs[ iArg ].sArg, g_aParameters[ PARAM_MEM_SEARCH_WILD ].m_sName )) )
if ((! strcmp( g_aArgs[ iArg ].sArg, g_aParameters[ PARAM_WILDSTAR ].m_sName )) ||
(! strcmp( g_aArgs[ iArg ].sArg, g_aParameters[ PARAM_MEM_SEARCH_WILD ].m_sName )) )
{
ConsoleBufferPushFormat( " Arg: %" SIZE_T_FMT " bytes * %d = %" SIZE_T_FMT " bytes",
sizeof(Arg_t), MAX_ARGS, sizeof(g_aArgs) );
@ -1487,7 +1487,7 @@ Update_t CmdVersion (int nArgs)
ConsoleBufferPushFormat( " Cursor(%d) T: %04X C: %04X B: %04X %c D: %02X", // Top, Cur, Bot, Delta
g_nDisasmCurLine, g_nDisasmTopAddress, g_nDisasmCurAddress, g_nDisasmBotAddress,
g_bDisasmCurBad ? TEXT('*') : TEXT(' ')
g_bDisasmCurBad ? '*' : ' '
, g_nDisasmBotAddress - g_nDisasmTopAddress
);

View File

@ -39,14 +39,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Arg_t g_aArgRaw[ MAX_ARGS ]; // pre-processing
Arg_t g_aArgs [ MAX_ARGS ]; // post-processing (cooked)
const TCHAR TCHAR_LF = TEXT('\x0D');
const TCHAR TCHAR_CR = TEXT('\x0A');
const TCHAR TCHAR_SPACE = TEXT(' ');
const TCHAR TCHAR_TAB = TEXT('\t');
// const TCHAR TCHAR_QUOTED = TEXT('"');
const TCHAR TCHAR_QUOTE_DOUBLE = TEXT('"');
const TCHAR TCHAR_QUOTE_SINGLE = TEXT('\'');
const TCHAR TCHAR_ESCAPE = TEXT('\x1B');
const char TCHAR_LF = '\x0D';
const char TCHAR_CR = '\x0A';
const char TCHAR_SPACE = ' ';
const char TCHAR_TAB = '\t';
// const char TCHAR_QUOTED = '"';
const char TCHAR_QUOTE_DOUBLE = '"';
const char TCHAR_QUOTE_SINGLE = '\'';
const char TCHAR_ESCAPE = '\x1B';
// NOTE: ArgToken_e and g_aTokens must match!
@ -76,13 +76,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{ TOKEN_PERCENT , TYPE_OPERATOR, "%" }, // mod
{ TOKEN_PIPE , TYPE_OPERATOR, "|" }, // bit-or
{ TOKEN_PLUS , TYPE_OPERATOR, "+" }, // add
// { TOKEN_QUESTION , TYPE_OPERATOR, TEXT('?') }, // Not a token 1) wildcard needs to stay together with other chars
// { TOKEN_QUESTION , TYPE_OPERATOR, '?' }, // Not a token 1) wildcard needs to stay together with other chars
{ TOKEN_QUOTE_SINGLE, TYPE_QUOTED_1, "\'" },
{ TOKEN_QUOTE_DOUBLE, TYPE_QUOTED_2, "\"" }, // for strings
{ TOKEN_SEMI , TYPE_STRING , ";" },
{ TOKEN_SPACE , TYPE_STRING , " " }, // space is also a delimiter between tokens/args
{ TOKEN_STAR , TYPE_OPERATOR, "*" }, // Not a token 1) wildcard needs to stay together with other chars
// { TOKEN_TAB , TYPE_STRING , TEXT('\t') }
// { TOKEN_TAB , TYPE_STRING , '\t' }
{ TOKEN_TILDE , TYPE_OPERATOR, "~" }, // C/C++: Not. Used for console.
{ TOKEN_COMMENT_EOL , TYPE_STRING , "//" },
@ -104,14 +104,14 @@ int _Arg_1( int nValue )
//===========================================================================
int _Arg_1( LPTSTR pName )
{
int nLen = _tcslen( g_aArgs[1].sArg );
int nLen = strlen( g_aArgs[1].sArg );
if (nLen < MAX_ARG_LEN)
{
_tcscpy( g_aArgs[1].sArg, pName );
strcpy( g_aArgs[1].sArg, pName );
}
else
{
_tcsncpy( g_aArgs[1].sArg, pName, MAX_ARG_LEN );
strncpy( g_aArgs[1].sArg, pName, MAX_ARG_LEN );
}
return 1;
}
@ -205,12 +205,12 @@ bool ArgsGetValue ( Arg_t *pArg, WORD * pAddressValue_, const int nBase )
if (pArg == NULL)
return false;
TCHAR *pSrc = & (pArg->sArg[ 0 ]);
TCHAR *pEnd = NULL;
char *pSrc = & (pArg->sArg[ 0 ]);
char *pEnd = NULL;
if (pAddressValue_)
{
*pAddressValue_ = (WORD)(_tcstoul( pSrc, &pEnd, nBase) & _6502_MEM_END);
*pAddressValue_ = (WORD)(strtoul( pSrc, &pEnd, nBase) & _6502_MEM_END);
return true;
}
@ -234,7 +234,7 @@ bool ArgsGetImmediateValue ( Arg_t *pArg, WORD * pAddressValue_ )
// Read console input, process the raw args, turning them into tokens and types.
//===========================================================================
int ArgsGet ( TCHAR * pInput )
int ArgsGet ( char * pInput )
{
LPCTSTR pSrc = pInput;
LPCTSTR pEnd = NULL;
@ -313,7 +313,7 @@ int ArgsGet ( TCHAR * pInput )
//if (iTokenSrc == TOKEN_QUOTE_DOUBLE)
// nLen = nBuf;
nLen = MIN( nBuf, MAX_ARG_LEN ); // NOTE: see Arg_t.sArg[] // GH#481
_tcsncpy( pArg->sArg, pSrc, nLen );
strncpy( pArg->sArg, pSrc, nLen );
pArg->sArg[ nLen ] = 0;
pArg->nArgLen = nLen;
pArg->eToken = iTokenSrc;
@ -393,7 +393,7 @@ bool ArgsGetRegisterValue ( Arg_t *pArg, WORD * pAddressValue_ )
else
if (iReg == BP_SRC_REG_PC)
{
if ((pArg->nArgLen == 2) && (_tcscmp( pArg->sArg, g_aBreakpointSource[ iReg ] ) == 0))
if ((pArg->nArgLen == 2) && (strcmp( pArg->sArg, g_aBreakpointSource[ iReg ] ) == 0))
{
*pAddressValue_ = regs.pc ; bStatus = true; break;
}
@ -408,8 +408,8 @@ bool ArgsGetRegisterValue ( Arg_t *pArg, WORD * pAddressValue_ )
void ArgsRawParse ( void )
{
const int BASE = 16; // hex
TCHAR *pSrc = NULL;
TCHAR *pEnd = NULL;
char *pSrc = NULL;
char *pEnd = NULL;
int iArg = 1;
Arg_t *pArg = & g_aArgRaw[ iArg ];
@ -423,7 +423,7 @@ void ArgsRawParse ( void )
{
pSrc = & (pArg->sArg[ 0 ]);
nAddressArg = (WORD)(_tcstoul( pSrc, &pEnd, BASE) & _6502_MEM_END);
nAddressArg = (WORD)(strtoul( pSrc, &pEnd, BASE) & _6502_MEM_END);
nAddressValue = nAddressArg;
bool bFound = false;
@ -461,8 +461,8 @@ void ArgsRawParse ( void )
int ArgsCook ( const int nArgs )
{
const int BASE = 16; // hex
TCHAR *pSrc = NULL;
TCHAR *pEnd2 = NULL;
char *pSrc = NULL;
char *pEnd2 = NULL;
int nArg = nArgs;
int iArg = 1;
@ -503,7 +503,9 @@ int ArgsCook ( const int nArgs )
pArg->bType |= TYPE_NO_REG;
}
else
{
return ARG_SYNTAX_ERROR;
}
}
if (pArg->bType & TYPE_OPERATOR) // prev op type == address?
@ -726,15 +728,17 @@ int ArgsCook ( const int nArgs )
// pArg->bType |= TYPE_INDIRECT;
// pArg->nValue = nAddressVal;
//nAddressVal = pNext->nValue;
pArg->nValue = * (WORD*) (mem + nAddressVal);
pArg->bType = TYPE_VALUE | TYPE_ADDRESS | TYPE_NO_REG;
pArg->nValue = ReadWordFromMemory(nAddressVal);
pArg->bType = TYPE_VALUE | TYPE_ADDRESS | TYPE_NO_REG;
iArg++; // eat ')'
nArg -= 2;
nParamLen = 0;
}
else
{
return ARG_SYNTAX_ERROR; // ERROR: unbalanced/unmatched ( )
}
}
}
@ -746,7 +750,9 @@ int ArgsCook ( const int nArgs )
nParamLen = 1;
}
else
{
return ARG_SYNTAX_ERROR;
}
}
if (nParamLen)
@ -757,11 +763,13 @@ int ArgsCook ( const int nArgs )
}
}
else
{
return ARG_SYNTAX_ERROR;
}
}
else // not an operator, try (1) address, (2) symbol lookup
{
nAddressArg = (WORD)(_tcstoul( pSrc, &pEnd2, BASE) & _6502_MEM_END);
nAddressArg = (WORD)(strtoul( pSrc, &pEnd2, BASE) & _6502_MEM_END);
if (! (pArg->bType & TYPE_NO_REG))
{
@ -804,7 +812,7 @@ const char * ParserFindToken( const char *pSrc, const TokenTable_t *aTokens, con
if (! pSrc)
return NULL;
const TCHAR *pName = NULL;
const char *pName = NULL;
int iToken;
// Look-ahead for <=
@ -840,12 +848,12 @@ const char * ParserFindToken( const char *pSrc, const TokenTable_t *aTokens, con
//===========================================================================
const TCHAR * FindTokenOrAlphaNumeric ( const TCHAR *pSrc, const TokenTable_t *aTokens, const int nTokens, ArgToken_e * pToken_ )
const char * FindTokenOrAlphaNumeric ( const char *pSrc, const TokenTable_t *aTokens, const int nTokens, ArgToken_e * pToken_ )
{
if ( pToken_ )
*pToken_ = NO_TOKEN;
const TCHAR *pEnd = pSrc;
const char *pEnd = pSrc;
if (pSrc && (*pSrc))
{
@ -866,7 +874,7 @@ const TCHAR * FindTokenOrAlphaNumeric ( const TCHAR *pSrc, const TokenTable_t *a
//===========================================================================
void TextConvertTabsToSpaces( TCHAR *pDeTabified_, LPCTSTR pText, const int nDstSize, int nTabStop )
void TextConvertTabsToSpaces( char *pDeTabified_, LPCTSTR pText, const int nDstSize, int nTabStop )
{
int TAB_SPACING = 8;
int TAB_SPACING_1 = 16;
@ -937,9 +945,9 @@ void TextConvertTabsToSpaces( TCHAR *pDeTabified_, LPCTSTR pText, const int nDst
// @return Length of new string
//===========================================================================
int RemoveWhiteSpaceReverse ( TCHAR *pSrc )
int RemoveWhiteSpaceReverse ( char *pSrc )
{
int nLen = _tcslen( pSrc );
int nLen = strlen( pSrc );
char *pDst = pSrc + nLen;
while (nLen--)
{

View File

@ -4,9 +4,9 @@
#include "Util_Text.h"
const char * ParserFindToken( const char *pSrc, const TokenTable_t *aTokens, const int nTokens, ArgToken_e * pToken_ );
const TCHAR * FindTokenOrAlphaNumeric ( const TCHAR *pSrc, const TokenTable_t *aTokens, const int nTokens, ArgToken_e * pToken_ );
const char * FindTokenOrAlphaNumeric ( const char *pSrc, const TokenTable_t *aTokens, const int nTokens, ArgToken_e * pToken_ );
int RemoveWhiteSpaceReverse( char *pSrc );
void TextConvertTabsToSpaces( TCHAR *pDeTabified_, LPCTSTR pText, const int nDstSize, int nTabStop = 0 );
void TextConvertTabsToSpaces( char *pDeTabified_, LPCTSTR pText, const int nDstSize, int nTabStop = 0 );
inline const char* SkipUntilToken( const char *pSrc, const TokenTable_t *aTokens, const int nTokens, ArgToken_e *pToken_ )
{
@ -29,16 +29,16 @@ inline const char* SkipUntilToken( const char *pSrc, const TokenTable_t *aTokens
extern Arg_t g_aArgRaw[ MAX_ARGS ]; // pre-processing
extern Arg_t g_aArgs [ MAX_ARGS ]; // post-processing
extern const TCHAR * g_pConsoleFirstArg; // = 0; // points to first arg
extern const char * g_pConsoleFirstArg; // = 0; // points to first arg
extern const TokenTable_t g_aTokens[ NUM_TOKENS ];
extern const TCHAR TCHAR_LF ;//= 0x0D;
extern const TCHAR TCHAR_CR ;//= 0x0A;
extern const TCHAR TCHAR_SPACE ;//= TEXT(' ');
extern const TCHAR TCHAR_TAB ;//= TEXT('\t');
extern const TCHAR TCHAR_QUOTE_DOUBLE;
extern const TCHAR TCHAR_QUOTE_SINGLE;
extern const char TCHAR_LF ;//= 0x0D;
extern const char TCHAR_CR ;//= 0x0A;
extern const char TCHAR_SPACE ;//= ' ';
extern const char TCHAR_TAB ;//= '\t';
extern const char TCHAR_QUOTE_DOUBLE;
extern const char TCHAR_QUOTE_SINGLE;
// Prototypes _______________________________________________________________
@ -52,7 +52,7 @@ inline const char* SkipUntilToken( const char *pSrc, const TokenTable_t *aTokens
bool ArgsGetValue ( Arg_t *pArg, WORD * pAddressValue_, const int nBase = 16 );
bool ArgsGetImmediateValue ( Arg_t *pArg, WORD * pAddressValue_ );
int ArgsGet ( TCHAR * pInput );
int ArgsGet ( char * pInput );
bool ArgsGetRegisterValue ( Arg_t *pArg, WORD * pAddressValue_ );
void ArgsRawParse ( void );
int ArgsCook ( const int nArgs ); // const int bProcessMask );

View File

@ -50,7 +50,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
,"A2_USER2.SYM"
,"A2_SRC1.SYM" // "A2_SRC.SYM",
,"A2_SRC2.SYM"
,"A2_DOS33.SYM"
,"A2_DOS33.SYM2"
,"A2_PRODOS.SYM"
};
std::string g_sFileNameSymbolsUser;
@ -182,7 +182,7 @@ bool FindAddressFromSymbol ( const char* pSymbol, WORD * pAddress_, int * iTable
SymbolTable_t :: iterator iSymbol = g_aSymbols[iTable].begin();
while (iSymbol != g_aSymbols[iTable].end())
{
if (!_tcsicmp( iSymbol->second.c_str(), pSymbol))
if (!_stricmp( iSymbol->second.c_str(), pSymbol))
{
if (pAddress_)
{
@ -221,34 +221,34 @@ WORD GetAddressFromSymbol (const char* pSymbol)
//===========================================================================
bool String2Address( LPCTSTR pText, WORD & nAddress_ )
{
TCHAR sHexApple[ CONSOLE_WIDTH ];
char sHexApple[ CONSOLE_WIDTH ];
if (pText[0] == '$')
{
if (!TextIsHexString( pText+1))
return false;
_tcscpy( sHexApple, "0x" );
_tcsncpy( sHexApple+2, pText+1, MAX_SYMBOLS_LEN - 3 );
strcpy( sHexApple, "0x" );
strncpy( sHexApple+2, pText+1, MAX_SYMBOLS_LEN - 3 );
sHexApple[2 + (MAX_SYMBOLS_LEN - 3) - 1] = 0;
pText = sHexApple;
}
if (pText[0] == TEXT('0'))
if (pText[0] == '0')
{
if ((pText[1] == TEXT('X')) || pText[1] == TEXT('x'))
if ((pText[1] == 'X') || pText[1] == 'x')
{
if (!TextIsHexString( pText+2))
return false;
TCHAR *pEnd;
nAddress_ = (WORD) _tcstol( pText, &pEnd, 16 );
char *pEnd;
nAddress_ = (WORD) strtol( pText, &pEnd, 16 );
return true;
}
if (TextIsHexString( pText ))
{
TCHAR *pEnd;
nAddress_ = (WORD) _tcstol( pText, &pEnd, 16 );
char *pEnd;
nAddress_ = (WORD) strtol( pText, &pEnd, 16 );
return true;
}
}
@ -281,7 +281,7 @@ Update_t CmdSymbolsClear (int nArgs)
// Format the summary of the specified symbol table
//===========================================================================
std::string _CmdSymbolsInfoHeader( int iTable, int nDisplaySize /* = 0 */ )
std::string _CmdSymbolsInfoHeader ( int iTable, int nDisplaySize /* = 0 */ )
{
// Common case is to use/calc the table size
bool bActive = (g_bDisplaySymbolTables & (1 << iTable)) ? true : false;
@ -296,6 +296,20 @@ std::string _CmdSymbolsInfoHeader( int iTable, int nDisplaySize /* = 0 */ )
);
}
//===========================================================================
std::string _CmdSymbolsSummaryStatus ( int iTable )
{
bool bActive = (g_bDisplaySymbolTables & (1 << iTable)) ? true : false;
int iParam = bActive
? PARAM_ON
: PARAM_OFF
;
std::string sSymbolSummary = _CmdSymbolsInfoHeader( iTable );
sSymbolSummary += StrFormat( "%s(%s%s%s)", CHC_ARG_SEP, CHC_COMMAND, g_aParameters[ iParam ].m_sName, CHC_ARG_SEP );
return sSymbolSummary;
}
//===========================================================================
Update_t CmdSymbolsInfo (int nArgs)
{
@ -549,8 +563,8 @@ int ParseSymbolTable(const std::string & pPathFileName, SymbolTable_Index_e eSym
if (pPathFileName.empty())
return nSymbolsLoaded;
std::string sFormat1 = StrFormat( "%%x %%%ds", MAX_SYMBOLS_LEN ); // i.e. "%x %13s"
std::string sFormat2 = StrFormat( "%%%ds %%x", MAX_SYMBOLS_LEN ); // i.e. "%13s %x"
std::string sFormat1 = StrFormat( "%%x %%%ds", MAX_SYMBOLS_LEN ); // i.e. "%x %51s"
std::string sFormat2 = StrFormat( "%%%ds %%x", MAX_SYMBOLS_LEN ); // i.e. "%51s %x"
FILE *hFile = fopen( pPathFileName.c_str(), "rt" );
@ -575,7 +589,7 @@ int ParseSymbolTable(const std::string & pPathFileName, SymbolTable_Index_e eSym
// . SYMBOL =$0000; Comment
// . SYMBOL =$FFFF; Comment
//
DWORD nAddress = _6502_MEM_END + 1; // default to invalid address
uint32_t nAddress = _6502_MEM_END + 1; // default to invalid address
char sName[ MAX_SYMBOLS_LEN+1 ] = "";
const int MAX_LINE = 256;
@ -749,7 +763,43 @@ Update_t CmdSymbolsLoad (int nArgs)
if (! nArgs)
{
sFileName = g_sProgramDir + g_sFileNameSymbols[ iSymbolTable ];
nSymbols = ParseSymbolTable( sFileName, (SymbolTable_Index_e) iSymbolTable );
// if ".sym2" extension then RUN since we need support for DB, DA, etc.
// TODO: Use Util_GetFileNameExtension()
const size_t nLength = sFileName.length();
const size_t iExtension = sFileName.rfind( '.', nLength );
const std::string sExt = (iExtension != std::string::npos)
? sFileName.substr( iExtension, nLength )
: std::string("")
;
bool bSymbolFormat2 = (sExt == std::string( ".SYM2"));
if (bSymbolFormat2)
{
// We could hijack:
// CmdOutputRun( -1 );
// But we would need to futz around with arguments
// strncpy(g_aArgs[0].sArg, sFileName.c_str(), sizeof(g_aArgs[0].sArg));
MemoryTextFile_t script;
if (script.Read( sFileName ))
{
int nLine = script.GetNumLines();
Update_t bUpdateDisplay = UPDATE_NOTHING; // not used
for ( int iLine = 0; iLine < nLine; iLine++ )
{
script.GetLine( iLine, g_pConsoleInput, CONSOLE_WIDTH-2 );
g_nConsoleInputChars = strlen( g_pConsoleInput );
bUpdateDisplay |= DebuggerProcessCommand( false );
}
}
}
else
{
nSymbols = ParseSymbolTable( sFileName, (SymbolTable_Index_e) iSymbolTable );
}
// Try optional alternate location
if ((nSymbols == 0) && !g_sBuiltinSymbolsDir.empty())
@ -827,7 +877,8 @@ void SymbolUpdate ( SymbolTable_Index_e eSymbolTable, const char *pSymbolName, W
if (bRemoveSymbol)
pSymbolName = g_aArgs[2].sArg;
if (_tcslen( pSymbolName ) < MAX_SYMBOLS_LEN)
size_t nSymLen = strlen( pSymbolName );
if (nSymLen < MAX_SYMBOLS_LEN)
{
WORD nAddressPrev;
int iTable;
@ -839,7 +890,7 @@ void SymbolUpdate ( SymbolTable_Index_e eSymbolTable, const char *pSymbolName, W
{
if (bRemoveSymbol)
{
ConsoleBufferPush( TEXT(" Removing symbol." ) );
ConsoleBufferPush( " Removing symbol." );
}
g_aSymbols[ eSymbolTable ].erase( nAddressPrev );
@ -860,7 +911,7 @@ void SymbolUpdate ( SymbolTable_Index_e eSymbolTable, const char *pSymbolName, W
{
if (bRemoveSymbol)
{
ConsoleBufferPush( TEXT(" Symbol not in table." ) );
ConsoleBufferPush( " Symbol not in table." );
}
}
@ -888,6 +939,16 @@ void SymbolUpdate ( SymbolTable_Index_e eSymbolTable, const char *pSymbolName, W
);
}
}
else
ConsolePrintFormat(
CHC_ERROR "Error: "
CHC_DEFAULT "Symbol length "
CHC_NUM_DEC "%d "
CHC_ARG_SEP "> "
CHC_NUM_DEC "%d "
, (int) nSymLen
, MAX_SYMBOLS_LEN
);
}
// Syntax:
@ -903,7 +964,7 @@ Update_t _CmdSymbolsUpdate( int nArgs, int bSymbolTables )
bool bRemoveSymbol = false;
bool bUpdateSymbol = false;
TCHAR *pSymbolName = g_aArgs[1].sArg;
char *pSymbolName = g_aArgs[1].sArg;
WORD nAddress = g_aArgs[3].nValue;
if ((nArgs == 2)
@ -973,7 +1034,7 @@ Update_t _CmdSymbolsCommon ( int nArgs, int bSymbolTables )
{
// Shouldn't have multiple symbol tables selected
// nArgs = _Arg_1( eSymbolsTable );
ConsoleBufferPush( TEXT(" Error: Unknown Symbol Table Type") );
ConsoleBufferPush( " Error: Unknown Symbol Table Type" );
return ConsoleUpdate();
}
}
@ -993,7 +1054,7 @@ Update_t _CmdSymbolsCommon ( int nArgs, int bSymbolTables )
}
else
{
ConsoleBufferPush( TEXT(" Error: Unknown Symbol Table Type") );
ConsoleBufferPush( " Error: Unknown Symbol Table Type" );
}
return ConsoleUpdate();
}
@ -1010,7 +1071,7 @@ Update_t _CmdSymbolsCommon ( int nArgs, int bSymbolTables )
int iTable = _GetSymbolTableFromFlag( bSymbolTables );
if (iTable != NUM_SYMBOL_TABLES)
{
ConsolePrint( _CmdSymbolsInfoHeader( iTable ).c_str() );
ConsolePrint( _CmdSymbolsSummaryStatus( iTable ).c_str() );
}
return ConsoleUpdate() | UPDATE_DISASM;
}
@ -1021,7 +1082,7 @@ Update_t _CmdSymbolsCommon ( int nArgs, int bSymbolTables )
int iTable = _GetSymbolTableFromFlag( bSymbolTables );
if (iTable != NUM_SYMBOL_TABLES)
{
ConsolePrint( _CmdSymbolsInfoHeader( iTable ).c_str() );
ConsolePrint( _CmdSymbolsSummaryStatus( iTable ).c_str() );
}
return ConsoleUpdate() | UPDATE_DISASM;
}

Some files were not shown because too many files have changed in this diff Show More