1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-08 10:52:58 +00:00

Compare commits

...

1366 Commits

Author SHA1 Message Date
Thomas Harte
b3012bd89e Update version number. 2024-06-02 22:29:25 -04:00
Thomas Harte
f521c12d85
Merge pull request #1385 from TomHarte/VicBorders
CRT: accept data during retrace.
2024-06-02 22:18:25 -04:00
Thomas Harte
58f04848a9 Fix: allow allocations on invisible areas. 2024-06-02 21:59:27 -04:00
Thomas Harte
6488f46850 Normalise variable names. 2024-06-02 21:58:49 -04:00
Thomas Harte
5f4b798cff Clarify scope of this_state. 2024-06-01 20:05:51 -04:00
Thomas Harte
ffa8f1db04
Merge pull request #1384 from TomHarte/QtArchimedes
Add Archimedes Qt UI options.
2024-05-31 21:25:49 -04:00
Thomas Harte
cf2711f6dd Add Archimedes Qt UI options. 2024-05-31 21:17:56 -04:00
Thomas Harte
25eded1895
Merge pull request #1382 from TomHarte/QtRepair
Qt: Correct Electron target name.
2024-05-29 22:24:52 -04:00
Thomas Harte
a8ac8f4a23 Correct Electron target name. 2024-05-29 22:24:15 -04:00
Thomas Harte
c67a53e95b
Merge pull request #1381 from TomHarte/MemoryOrder
Avoid `std::memory_order::memory_order_X` in favour of `std::memory_order_X`.
2024-05-29 22:01:20 -04:00
Thomas Harte
edf4ba2533
Merge pull request #1380 from TomHarte/NoPairs
Eliminate various unnecessary uses of `std::make_pair`.
2024-05-29 21:59:59 -04:00
Thomas Harte
71d337c10e Avoid std::memory_order::. 2024-05-29 21:51:07 -04:00
Thomas Harte
eb9e5fb727 Eliminate various unnecessary uses of std::make_pair. 2024-05-29 21:46:33 -04:00
Thomas Harte
f133000656 Update version number. 2024-05-27 15:05:47 -04:00
Thomas Harte
71361638bb
Merge pull request #1379 from TomHarte/UnambiguousRejection
Don't move cursor near disk to folder if not about to load something.
2024-05-27 15:05:04 -04:00
Thomas Harte
edc7fe9c72 Simplify actions. 2024-05-27 14:54:09 -04:00
Thomas Harte
3110041a06 Don't seem to move near disk folder if not loading. 2024-05-27 14:45:37 -04:00
Thomas Harte
ff78e4172d
Merge pull request #1378 from TomHarte/FastArchimedesDisks
Support FDC overclocking as 'fast loading'.
2024-05-26 22:19:40 -04:00
Thomas Harte
a1c23be73d Remove development dead ends. 2024-05-26 22:03:48 -04:00
Thomas Harte
eb2b1cb093 Support FDC overclocking as 'fast loading'. 2024-05-26 22:02:40 -04:00
Thomas Harte
f2245b8066
Merge pull request #1377 from TomHarte/TidySWIs
Clean up, slightly.
2024-05-26 14:43:40 -04:00
Thomas Harte
793b6d1deb Clean up, slightly. 2024-05-26 14:42:54 -04:00
Thomas Harte
537b91fa3f
Merge pull request #1374 from TomHarte/SWIAnalyser
Add Archimedes autostart behaviour.
2024-05-24 16:32:45 -04:00
Thomas Harte
b7777c9ca3 Avoid linkage warning. 2024-05-24 15:39:38 -04:00
Thomas Harte
5235262855 Add default value. 2024-05-24 15:29:11 -04:00
Thomas Harte
7b90c36463 Shorten clicks, ensure no lost actions. 2024-05-24 15:23:45 -04:00
Thomas Harte
6407ab0673 Clean up, improve application-menu response. 2024-05-24 14:32:55 -04:00
Thomas Harte
78ec9e5a60 Limit character range. 2024-05-23 22:31:43 -04:00
Thomas Harte
778ac6e6d1 Complete autoload loop. 2024-05-23 22:16:40 -04:00
Thomas Harte
5280f5aba2 Attempt to spot screen takeovers. 2024-05-23 22:03:40 -04:00
Thomas Harte
67add0da93 Use both sources. 2024-05-21 22:23:53 -04:00
Thomas Harte
a32da9a6e1 Restore preference against !Boot. 2024-05-21 22:12:55 -04:00
Thomas Harte
b6b70bb7ff Add title fallbacks, ensure 'read' costs even 0.0-weight options. 2024-05-21 22:06:09 -04:00
Thomas Harte
6d769c9e89 Use string similarity as a program differentiator. 2024-05-21 21:49:30 -04:00
Thomas Harte
0c683c2c81 Merge branch 'master' into SWIAnalyser 2024-05-21 07:38:23 -04:00
Thomas Harte
8e51bd7578 Merge branch 'master' of github.com:TomHarte/CLK 2024-05-21 07:38:10 -04:00
Thomas Harte
6d6dfa4f44 Introduce Archimedes analyser tests. 2024-05-20 22:48:20 -04:00
Thomas Harte
7d044ad0ab
Merge pull request #1376 from TomHarte/Remove-macos-11
Eliminate macos11 runner.
2024-05-20 16:29:02 -04:00
Thomas Harte
826f4c1d48
Eliminate macos-11.
As per GitHub's announcement that "The macOS 11 runner image will be removed by 6/28/24"
2024-05-20 14:21:42 -04:00
Thomas Harte
3be5d60b1e Eliminate comparison costs. 2024-05-18 22:16:58 -04:00
Thomas Harte
26375dc023 Introduce named constants. 2024-05-16 22:19:26 -04:00
Thomas Harte
8d0d7abd5a Keep track of state separately from scanning. 2024-05-16 22:18:51 -04:00
Thomas Harte
ef03ddf2ae Extend to launching the target program. 2024-05-14 22:23:35 -04:00
Thomas Harte
1d8b33d7ae Attempt to improve trajectory. 2024-05-13 22:26:36 -04:00
Thomas Harte
308b3ca448 Gamely attempt to pick an Arc program to start. 2024-05-13 22:25:02 -04:00
Thomas Harte
ca67afea4c Correct some unique-ptr oddities. 2024-05-13 21:46:03 -04:00
Thomas Harte
0b11fc259b Add Archimedes-specific target class. 2024-05-13 21:42:38 -04:00
Thomas Harte
18ffb9294f Add full cursor automation. 2024-05-12 22:16:29 -04:00
Thomas Harte
c82517c9fd Add mouse position getter. 2024-05-11 13:07:12 -04:00
Thomas Harte
6d42c9aaf9 Start making leeway on interesting SWIs. 2024-05-06 22:40:00 -04:00
Thomas Harte
02ee3a7804 Turf out old debugging cruft. 2024-05-06 20:36:00 -04:00
Thomas Harte
bdf1dff976 Update version number. 2024-05-04 21:16:43 -04:00
Thomas Harte
e6724a701a
Merge pull request #1373 from TomHarte/DiskReady
Further adjust RDY.
2024-04-30 22:50:17 -04:00
Thomas Harte
d90eedfc8c Adjust bit polarity, meaning. 2024-04-30 22:49:26 -04:00
Thomas Harte
63009d00b4
Merge pull request #1372 from TomHarte/DiskReady
Add Archimedes disk drive RDY signal.
2024-04-30 22:38:20 -04:00
Thomas Harte
6a2261d217 Merge branch 'master' into DiskReady 2024-04-30 22:38:07 -04:00
Thomas Harte
c3ad2154b5
Merge pull request #1371 from TomHarte/Interlacing
Support Archimedes interlaced video.
2024-04-30 22:37:48 -04:00
Thomas Harte
3d61861737 Ensure switch is complete. 2024-04-30 22:26:19 -04:00
Thomas Harte
7545786436 Ensure extra line types are used. 2024-04-30 22:22:18 -04:00
Thomas Harte
a997b6c677 Wire drives for IBM-style RDY. 2024-04-30 22:18:17 -04:00
Thomas Harte
72d4f638aa Merge branch 'master' into Interlacing 2024-04-30 22:08:57 -04:00
Thomas Harte
b15ff6d442 Support interlaced video timing. 2024-04-30 22:06:08 -04:00
Thomas Harte
cb70967971
Merge pull request #1370 from TomHarte/Zarch
Add automatic runtime frame-rate limiter.
2024-04-30 22:02:06 -04:00
Thomas Harte
42aea2663c Add automatic runtime frame-rate limiter. 2024-04-30 21:38:37 -04:00
Thomas Harte
a882faa7f6
Merge pull request #1369 from TomHarte/UnmaskedSubAddresses
Mildly reduce ARM/Archimedes hot-path costs.
2024-04-29 22:58:22 -04:00
Thomas Harte
5da01e4fd8 Add potential short-circuit. 2024-04-29 22:45:30 -04:00
Thomas Harte
71c5a1d419 Avoid repeated trans comparison. 2024-04-29 22:35:01 -04:00
Thomas Harte
03c3da7338 Bifurcate Zone enum, possibly to help compiler. 2024-04-29 22:34:46 -04:00
Thomas Harte
47b276ca0b
Merge pull request #1368 from TomHarte/MinorTweaks
Fix trans for instruction fetches.
2024-04-29 22:29:25 -04:00
Thomas Harte
c7747ec5a0 Remove a conditional from the hot path. 2024-04-29 22:16:06 -04:00
Thomas Harte
5a84e98256 Fix trans for instruction fetches. 2024-04-29 21:54:59 -04:00
Thomas Harte
b66d69b60c
Merge pull request #1367 from TomHarte/FloppyHeft
Slightly reduce processing heft of floppy accesses.
2024-04-28 22:49:31 -04:00
Thomas Harte
dfaea5a922 Reduce floppy access cost. 2024-04-28 22:40:54 -04:00
Thomas Harte
f4da417c3a
Merge pull request #1366 from TomHarte/VIDCDelays
Add various VIDC output latencies.
2024-04-28 22:39:29 -04:00
Thomas Harte
fa7fff86eb Eject invalid specialisation. 2024-04-28 22:20:26 -04:00
Thomas Harte
d480f9eae2 Reinstate all missing video modes. 2024-04-28 21:49:04 -04:00
Thomas Harte
4f1aef90b8 Relocate pixel collection and cursor shifting. 2024-04-26 21:29:30 -04:00
Thomas Harte
24f4538eb7 Do faulty restoration of 4bpp mode. 2024-04-25 22:50:24 -04:00
Thomas Harte
38d096cad6 Begin new state machine, losing all non-cursor pixels. 2024-04-25 22:01:38 -04:00
Thomas Harte
b82af9c471 Fix vertical timing; don't miss border colour changes. 2024-04-24 20:47:11 -04:00
Thomas Harte
0bff2089c4
Merge pull request #1364 from TomHarte/SomeWarnings
Resolve various warnings.
2024-04-23 19:40:43 -07:00
Thomas Harte
36d9c40d7b Yuckily avoid warning. 2024-04-23 22:23:56 -04:00
Thomas Harte
becb6ce2e0 Fix two more not-really-an-issue warnings. 2024-04-23 22:20:13 -04:00
Thomas Harte
56b65780d2 Avoid loading nonsense value upon data abort. 2024-04-22 22:09:57 -04:00
Thomas Harte
265d151879 Fix data aborts. 2024-04-22 22:08:09 -04:00
Thomas Harte
c485097eed Fix bool combination. 2024-04-22 22:06:09 -04:00
Thomas Harte
f86e9fe086 Eliminate impossible conditional. 2024-04-22 21:58:49 -04:00
Thomas Harte
c91ce4cfea Ensure all routes return. 2024-04-22 21:57:20 -04:00
Thomas Harte
8e64a854fc Ensure all routes return; mildly decrease conditionals. 2024-04-22 21:56:53 -04:00
Thomas Harte
7c9383cd6b Update version number. 2024-04-20 14:45:21 -04:00
Thomas Harte
82d03e3980
Merge pull request #1362 from TomHarte/ThreeStepPipeline
Introduce some degree of an ARM pipeline.
2024-04-19 19:41:46 -07:00
Thomas Harte
0775e3ad58 This is an 8-bit value. 2024-04-19 22:35:43 -04:00
Thomas Harte
ea3eef3817 Put interrupts into pipeline, without delay. 2024-04-19 22:21:23 -04:00
Thomas Harte
83eac172c9 Revoke in-pipeline interrupts.
I'm unclear on what timing should apply here really.
2024-04-19 21:46:09 -04:00
Thomas Harte
5b13d3e893 Attempt the prefetch portion of a pipeline. 2024-04-19 21:30:15 -04:00
Thomas Harte
807835b9fe
Merge pull request #1361 from TomHarte/Pipeline
Provide hooks for implementing pipeline prefetch.
2024-04-19 06:58:45 -07:00
Thomas Harte
4bf02122ee Fix disassembler. 2024-04-18 23:17:44 -04:00
Thomas Harte
e6c4454059 Provide a means for SWI interception. 2024-04-18 22:13:58 -04:00
Thomas Harte
d464ce831a Add did_set_pc. 2024-04-18 19:30:07 -04:00
Thomas Harte
018f0e097f
Merge pull request #1358 from TomHarte/ADFS-D
Ensure ADFS-D discs are recognised.
2024-04-17 23:06:49 -04:00
Thomas Harte
2acb853021
Merge pull request #1357 from TomHarte/EasyWins
Improve MEMC speed.
2024-04-17 22:47:04 -04:00
Thomas Harte
acd477df39 Ensure ADFS-D discs are recognised. 2024-04-17 22:44:55 -04:00
Thomas Harte
da520de9ef Further appease GCC. 2024-04-17 22:38:32 -04:00
Thomas Harte
e680a973b0 Appease GCC with a 'default'. 2024-04-17 22:17:24 -04:00
Thomas Harte
07984a2f8b Resolve various warnings. 2024-04-17 22:15:05 -04:00
Thomas Harte
16532136e9 Merge branch 'master' into EasyWins 2024-04-17 21:40:01 -04:00
Thomas Harte
30c2c65b77 Eliminate hot-path switch. 2024-04-17 21:36:39 -04:00
Thomas Harte
b63178132d Move trans tests inside switch. 2024-04-17 21:29:42 -04:00
Thomas Harte
6d66c90aad
Merge pull request #1356 from TomHarte/ArchimedesGUI
Add macOS route to starting empty Archimedes.
2024-04-17 21:26:03 -04:00
Thomas Harte
c807c75412 Revert version change. 2024-04-17 21:25:12 -04:00
Thomas Harte
f6feaddfe6 Add macOS route to starting empty Archimedes. 2024-04-17 20:44:45 -04:00
Thomas Harte
87d1a476a4
Merge pull request #1355 from TomHarte/Archimedes
Add an inaccurate, basic Archimedes.
2024-04-16 22:45:42 -04:00
Thomas Harte
f7337f2400
Adopt 50%:50% tables throughout. 2024-04-16 22:45:01 -04:00
Thomas Harte
fac94a5d36 Reduce MIPS. Until other performance issues can be resolved. 2024-04-16 22:32:00 -04:00
Thomas Harte
140228a936 Mildly reduce heft of scale read. 2024-04-16 22:31:40 -04:00
Thomas Harte
06fd91f002 Fix period, table lookup. 2024-04-16 22:12:10 -04:00
Thomas Harte
c3d4d0ee38 Introduce panning, threading. 2024-04-16 21:56:34 -04:00
Thomas Harte
30cca54e6c Diagnostically try for a square wave. 2024-04-13 22:10:34 -04:00
Thomas Harte
6ac6e48b95 Attempt audio output. 2024-04-13 21:54:50 -04:00
Thomas Harte
779794632e Generate volume ramp. 2024-04-13 20:23:47 -04:00
Thomas Harte
88bb16f261 Install proper filter frequency. 2024-04-13 15:34:39 -04:00
Thomas Harte
c134c7bdc2 Fix: signal is 'flyback', not sync. 2024-04-10 21:53:38 -04:00
Thomas Harte
6c6cda3db5 Use clocking hints. 2024-04-09 22:22:03 -04:00
Thomas Harte
a29f246536 Move to more natural position of ownership. 2024-04-09 22:10:07 -04:00
Thomas Harte
d9d675a74f Fix scan status scale. 2024-04-09 21:56:42 -04:00
Thomas Harte
d62ea95889 Make some intimation towards audio. 2024-04-09 21:53:40 -04:00
Thomas Harte
e2e951ad0b Fix layout. 2024-04-09 21:49:35 -04:00
Thomas Harte
a5a653d684 Factor vsync state into IO reads. 2024-04-09 21:49:00 -04:00
Thomas Harte
6123350895 Improve state guesswork. 2024-04-09 21:24:08 -04:00
Thomas Harte
ec73c00c3b Silence the routine stuff of interrupt masks. 2024-04-09 20:57:57 -04:00
Thomas Harte
dd24f5f4f3 Don't latch video addresses until almost the last minute. 2024-04-09 20:56:10 -04:00
Thomas Harte
82a2e802ea
Life's too short; just do it in HTML. 2024-04-08 23:11:22 -04:00
Thomas Harte
3b75eeb70a Try two divs. 2024-04-08 22:46:45 -04:00
Thomas Harte
ee4575b70f Attempt a div. 2024-04-08 22:45:41 -04:00
Thomas Harte
46a4ec1cb1 Reshuffle images. 2024-04-08 22:42:49 -04:00
Thomas Harte
8ab77a3260 Attempt to even out columns. 2024-04-08 22:39:14 -04:00
Thomas Harte
b875e349c1 Mention the Archimedes. 2024-04-08 22:34:08 -04:00
Thomas Harte
169298af42 Plumb through disk insertion.
Surprisingly: some things now load.
2024-04-08 21:15:40 -04:00
Thomas Harte
5e502df48b Forward motor and drive selection. 2024-04-07 22:29:00 -04:00
Thomas Harte
4f58664f97 Catch interrupt enables. 2024-04-07 22:08:12 -04:00
Thomas Harte
ffd298218c Tie off initial values; fix FIQ usage. 2024-04-07 21:58:16 -04:00
Thomas Harte
d2b077c573 Start wiring in a floppy controller. 2024-04-07 21:22:35 -04:00
Thomas Harte
547dc29a60 Remove done TODOs. 2024-04-07 15:53:42 -04:00
Thomas Harte
69aeca5c0e Aggregate mouse deltas where possible. 2024-04-06 21:24:21 -04:00
Thomas Harte
ed7cd4b277 Fix 8bpp output, all-modes cursor. 2024-04-06 20:58:44 -04:00
Thomas Harte
7bf831e1a6 Add missing 'override'. 2024-04-06 13:51:33 -04:00
Thomas Harte
0092cb8c36 Route enough to be able to mess around. 2024-04-06 13:44:05 -04:00
Thomas Harte
543b1c644a Wire mouse events to the relevant class. 2024-04-06 13:32:59 -04:00
Thomas Harte
cfaea7a90c Add cursor within 4bpp pixel area. 2024-04-05 22:43:10 -04:00
Thomas Harte
b821645644 Capture cursor palette, switch horizontal field. 2024-04-05 22:01:01 -04:00
Thomas Harte
2865190499 Resolve video addressing issues. 2024-04-05 21:56:31 -04:00
Thomas Harte
3f40e409c5 Reduce debugging heft. 2024-04-04 22:16:11 -04:00
Thomas Harte
002e235d90 Force RGB mode. 2024-04-04 22:02:47 -04:00
Thomas Harte
7d8a364658 Reimplement LDM and STM. 2024-04-04 21:59:18 -04:00
Thomas Harte
41c471ca52 Add a force-user-aware accessor. 2024-04-04 20:17:44 -04:00
Thomas Harte
dd127f64fe Simplify range. 2024-04-03 07:23:14 -04:00
Thomas Harte
b19dcfd6dc Take another run at shifts. 2024-04-02 21:57:46 -04:00
Thomas Harte
55369464ad Add a by-eye crop. A better answer will come. 2024-04-01 22:10:05 -04:00
Thomas Harte
609c117267 Switch to English RISC OS. 2024-04-01 21:44:42 -04:00
Thomas Harte
3b62a2fe7a Restrict video buffer to first 512kb. 2024-04-01 21:39:10 -04:00
Thomas Harte
7c9715f00c Change mind about carry behaviour. 2024-04-01 21:38:44 -04:00
Thomas Harte
7de92a9457 Slightly clean up shift code. 2024-04-01 21:24:49 -04:00
Thomas Harte
0866caf934 Flaws remain, but acknowledge that pixel rate is double. 2024-04-01 10:48:20 -04:00
Thomas Harte
914b88d115 Fix non-debug build. 2024-03-31 19:17:55 -04:00
Thomas Harte
cc122a7a68 Add an SWI count, to aid in logging. 2024-03-31 18:18:26 -04:00
Thomas Harte
31979649c6 As it continues to swell, factor out the junk. 2024-03-31 18:15:48 -04:00
Thomas Harte
335d13d06d Mildly improve logging, define a few more ROMs. 2024-03-30 21:49:21 -04:00
Thomas Harte
ec785f3a8a Add URL as comment. 2024-03-30 20:54:17 -04:00
Thomas Harte
1f83a5425e Complete list of all currently-failing SWIs.
... a lot of which are probably failing correctly, i.e. they're appropriately signalling.
2024-03-30 20:48:47 -04:00
Thomas Harte
4882d6d0f2 Start adding SWI detail. 2024-03-30 15:16:48 -04:00
Thomas Harte
722743659b Add missing space. 2024-03-29 21:52:57 -04:00
Thomas Harte
6e64a79b52 Log failed SWIs. 2024-03-29 21:31:33 -04:00
Thomas Harte
8a6bf84cff Keyboard: log more, ignore unrecognised commands. 2024-03-29 20:54:07 -04:00
Thomas Harte
a0fdd8f4eb Resolve magic constant. 2024-03-28 22:15:27 -04:00
Thomas Harte
bda1783624 Make new guess at non-byte IOC reads. 2024-03-28 22:10:49 -04:00
Thomas Harte
2a14557478 Be more disciplined about errant accesses. 2024-03-28 21:31:07 -04:00
Thomas Harte
0ddbc67b1f Switch to default CMOS RAM obtained from RISC OS itself. 2024-03-28 21:23:49 -04:00
Thomas Harte
ffb5149890 Reinstate real CMOS RAM results. 2024-03-28 14:27:07 -04:00
Thomas Harte
bb339d619f Eliminate trace test; I don't think I'm going to work it through. 2024-03-28 14:23:00 -04:00
Thomas Harte
2ed11877e8 Determine a couple of further exclusions. 2024-03-28 14:11:41 -04:00
Thomas Harte
ea6b83815b Add a further category of exclusions. 2024-03-28 14:01:37 -04:00
Thomas Harte
740b0e35d5 Completely bypass ignored tests. 2024-03-28 11:28:37 -04:00
Thomas Harte
2e7c1acb88 Add note on confusion. 2024-03-28 10:34:46 -04:00
Thomas Harte
4fcb85d132 Cleave off most remaining reasons for failure. 2024-03-28 10:32:27 -04:00
Thomas Harte
f175dcea58 Hack in some more potential debugging help. 2024-03-27 22:37:37 -04:00
Thomas Harte
c04c708a9d Trade some depth for breadth. 2024-03-27 22:37:10 -04:00
Thomas Harte
f4cf1e5313 Attempt to cleave by broad reason. 2024-03-27 22:36:37 -04:00
Thomas Harte
0e17f382a1 Capture further detail. 2024-03-27 22:36:03 -04:00
Thomas Harte
f38bca37a2 Take another run at MEMC.
I hadn't spotted that it is valid to map different logical pages to the same physical page with different protection levels.
2024-03-27 10:44:40 -04:00
Thomas Harte
166793ebe6 Reduce I2C chatter. 2024-03-26 21:54:42 -04:00
Thomas Harte
8b04d0e3ef Enhance and better-document I2C states. 2024-03-26 21:52:29 -04:00
Thomas Harte
a3931674dc Seemingly navigate I2C correctly. 2024-03-26 21:33:46 -04:00
Thomas Harte
bd4ef5ec57 Switch to acknowledgement-after. 2024-03-26 14:06:11 -04:00
Thomas Harte
3ba12630ab Quieten. 2024-03-26 12:27:37 -04:00
Thomas Harte
342d90c929 Advance CMOS/I2C to a seemingly-valid read. 2024-03-26 12:24:24 -04:00
Thomas Harte
9078fc994b Try to formalise I2C events. 2024-03-25 22:10:52 -04:00
Thomas Harte
f46af4b702 OS 3.11 seems to be able to get into BASIC. 2024-03-25 22:10:35 -04:00
Thomas Harte
b112987556 Do well enough at other colour depths. 2024-03-25 22:09:55 -04:00
Thomas Harte
fc880ac130 Double down on trans mode. 2024-03-25 21:32:56 -04:00
Thomas Harte
a2d95cb982 Shuffle notes. 2024-03-25 21:31:59 -04:00
Thomas Harte
d2776071e4 Speed up debug mode. 2024-03-25 21:31:33 -04:00
Thomas Harte
72a645ec1e Fix trans; take further crack at MEMC permissions. 2024-03-25 15:50:59 -04:00
Thomas Harte
1154ffd072 Add a 'drive in use' indicator LED. 2024-03-25 15:03:54 -04:00
Thomas Harte
8ba9708942 Hopefully resolve the mystery of the latch writes. 2024-03-25 14:54:30 -04:00
Thomas Harte
521fca6089 Expose full bus to IOC dependents; add notes. 2024-03-25 11:07:44 -04:00
Thomas Harte
ae684edbe1 Formally decode bank/offset/type. 2024-03-25 10:16:36 -04:00
Thomas Harte
fa0a9aa611 Eliminate 'has_moved_rom_'. 2024-03-24 22:36:11 -04:00
Thomas Harte
5da9e0486a Simplify control flow. 2024-03-24 22:30:26 -04:00
Thomas Harte
6980fd760c Add further heavily-manual debugging aids. 2024-03-24 22:18:30 -04:00
Thomas Harte
3549488b7a Add round-trip test for status flags. 2024-03-24 22:18:16 -04:00
Thomas Harte
c1602cc8fe The keyboard and interrupts are currently trusted. 2024-03-23 21:49:52 -04:00
Thomas Harte
189dd176de Reguess state machine, fixing startup display. 2024-03-23 21:38:35 -04:00
Thomas Harte
3cf262d1f7 Improve terminology, add more documentation. 2024-03-23 21:12:01 -04:00
Thomas Harte
ccfc389274 Quieten where now confident. 2024-03-23 21:03:06 -04:00
Thomas Harte
0e07f802ac Use BACK state; accept other ACKs at any time. 2024-03-23 21:02:35 -04:00
Thomas Harte
55f92e2411 Adjust data abort address. 2024-03-23 20:31:47 -04:00
Thomas Harte
c720f3910a Avoid implicit sign cast. 2024-03-23 20:13:25 -04:00
Thomas Harte
4215edd11b Reduce noise. 2024-03-23 20:12:56 -04:00
Thomas Harte
09a61cf1a7 Don't expect an ACK after identifying. 2024-03-23 20:12:38 -04:00
Thomas Harte
5967ad0865 Sketch out whole protocol, albeit faulty. 2024-03-23 17:08:03 -04:00
Thomas Harte
eb34c38332 Add very faulty key input. 2024-03-23 15:58:48 -04:00
Thomas Harte
5ccb18225a Provide key states to the keyboard. 2024-03-23 15:43:04 -04:00
Thomas Harte
58bbce1a15 Avoid display errors upon back-pressure. 2024-03-22 22:01:12 -04:00
Thomas Harte
9ea3e547ee Fix IRQ/FIQ return addresses. 2024-03-22 21:42:34 -04:00
Thomas Harte
fb5fdc9f10 Actually apply video divider. 2024-03-22 10:24:24 -04:00
Thomas Harte
de7b7818f4 Add 4bpp output. 2024-03-22 10:18:25 -04:00
Thomas Harte
c4e6b18294 Manage pixel buffers. 2024-03-22 10:10:13 -04:00
Thomas Harte
ae6cf69449 Move responsibility for clock division; reinstate vsync interrupt. 2024-03-22 10:01:34 -04:00
Thomas Harte
4a2dcff028 Endeavour to map colours properly. 2024-03-21 21:53:50 -04:00
Thomas Harte
aa6acec8fa Don't hoard cycles per line value. 2024-03-21 21:47:27 -04:00
Thomas Harte
4ac4da908c Reduce TODOs, do _something_ with border colour. 2024-03-21 21:40:11 -04:00
Thomas Harte
66e62857c4 Give ostensibly clean timing to the CRT. 2024-03-21 21:29:53 -04:00
Thomas Harte
bbc0d8b050 Count time in phase correctly. 2024-03-21 21:15:25 -04:00
Thomas Harte
0f8bc416d1 Make first, faulty step into displaying a field. 2024-03-21 21:10:55 -04:00
Thomas Harte
2ec235170e Finish the thought on magic constants. 2024-03-21 20:45:17 -04:00
Thomas Harte
2de1a2dd0d Install and properly clock a CRT. 2024-03-21 20:41:24 -04:00
Thomas Harte
1f49c3b113 Give sound and video somewhere to read from. 2024-03-21 20:22:20 -04:00
Thomas Harte
5c645fb3c2 Switch to a fixed output clock; retain addresses. 2024-03-21 11:51:29 -04:00
Thomas Harte
40b5227f0b Deliver all addresses to the video outputter. 2024-03-21 11:24:47 -04:00
Thomas Harte
847dba8f07 Divide input pixel rate. 2024-03-21 11:03:28 -04:00
Thomas Harte
417c6c4629 Announce changes. 2024-03-21 10:51:52 -04:00
Thomas Harte
2d6a4d490e Add dummy retrace interrupt. 2024-03-21 10:02:56 -04:00
Thomas Harte
a6ec870872 Capture more audio detail. 2024-03-21 09:47:53 -04:00
Thomas Harte
389541be6d Pipe further sound parameters; obey divider. 2024-03-20 14:43:47 -04:00
Thomas Harte
208f3e24de Audio ticks are now included. 2024-03-20 14:30:21 -04:00
Thomas Harte
f7e36a1e03 Merge branch 'Archimedes' of github.com:TomHarte/CLK into Archimedes 2024-03-20 14:27:32 -04:00
Thomas Harte
1341816791 Break apart, switching to delegates for interrupts. 2024-03-20 14:26:56 -04:00
Thomas Harte
b986add74a Break apart, switching to delegates for interrupts. 2024-03-20 14:25:20 -04:00
Thomas Harte
08673ff021 Switch to macro blocks of execution; flail around audio. 2024-03-20 11:42:37 -04:00
Thomas Harte
3a2d9c6082 Give user access to ROM; clean up a touch. 2024-03-19 20:26:17 -04:00
Thomas Harte
43a3959b8f Don't data abort on missing low ROM. 2024-03-19 15:06:01 -04:00
Thomas Harte
85a738acff Get rigorous on exception addresses. 2024-03-19 15:03:31 -04:00
Thomas Harte
17dbdce230 Eliminate SDL/scons targets for which brew is broken. 2024-03-19 14:27:46 -04:00
Thomas Harte
9d084782ae Document. 2024-03-19 12:22:19 -04:00
Thomas Harte
106937b679 Run into the shifts wall with LDR/STR. 2024-03-19 12:19:49 -04:00
Thomas Harte
623eda7162 Output branches and nops correctly. 2024-03-19 11:42:41 -04:00
Thomas Harte
2ad6bb099b Begin foray into disassembly. 2024-03-19 11:34:10 -04:00
Thomas Harte
9d858bc61b IRQ and FIQ should also store PC+4. 2024-03-18 14:08:08 -04:00
Thomas Harte
612c9ce49a Transfer logging responsibility. 2024-03-18 11:09:29 -04:00
Thomas Harte
64e025484a Adjust means of waiting out address. 2024-03-17 22:14:07 -04:00
Thomas Harte
7b1f800387 Extend I2C state machine. 2024-03-17 21:55:19 -04:00
Thomas Harte
2712d50e05 Attempt some inspection. 2024-03-16 22:02:16 -04:00
Thomas Harte
47e9279bd4 Add a target for I2C activity. 2024-03-16 15:00:23 -04:00
Thomas Harte
635efd0212 Clear keyboard interrupts. 2024-03-15 23:19:26 -04:00
Thomas Harte
1c1d2891c7 Adjust IRQ/FIQ return addresses. 2024-03-15 21:59:38 -04:00
Thomas Harte
1979d2e5ba Don't set interrupt flags before capture. 2024-03-15 21:34:39 -04:00
Thomas Harte
c25d0e8843 Correctly capture mode upon exception. 2024-03-15 18:39:56 -04:00
Thomas Harte
3a899ea4be Add test coverage for STM descending, proving nothing. 2024-03-15 14:55:17 -04:00
Thomas Harte
9d08282e28 Add enough of a keyboard to respond to reset. 2024-03-15 10:57:18 -04:00
Thomas Harte
18154278d1 Add minor note on where next. 2024-03-14 21:54:20 -04:00
Thomas Harte
9063852857 Undo spurious text change. 2024-03-14 21:16:38 -04:00
Thomas Harte
bc27e3998d Fix downward block data transfers. 2024-03-14 21:09:51 -04:00
Thomas Harte
19fa0b8945 Shush logging, momentarily. 2024-03-14 10:53:38 -04:00
Thomas Harte
4987bdfec9 Throw less. 2024-03-14 10:43:51 -04:00
Thomas Harte
0e4615564d Make bit masks easily testable; expand logging. 2024-03-13 14:31:26 -04:00
Thomas Harte
7aeea535a1 Reduce branchiness. 2024-03-13 11:02:52 -04:00
Thomas Harte
6b18d775ab Eliminate unused variables. 2024-03-12 21:53:26 -04:00
Thomas Harte
2ed031e440 Prepare for additional devices. 2024-03-12 21:23:22 -04:00
Thomas Harte
5d6bb11eb7 Add return. 2024-03-12 11:37:15 -04:00
Thomas Harte
c6b91559e1 Attempt to wire up timer interrupts. 2024-03-12 11:34:31 -04:00
Thomas Harte
6efc41ded7 Come to conclusion on R15; fix link values. 2024-03-12 10:42:09 -04:00
Thomas Harte
e9c5582fe1 Add note on ambiguity to be resolved. 2024-03-12 10:04:02 -04:00
Thomas Harte
8b3c0abe93 Take another swing at R15 as a destination. 2024-03-12 09:13:05 -04:00
Thomas Harte
a5ebac1b29 Add RISC OS 3.11 to catalogue, while bug hunting. 2024-03-11 22:19:14 -04:00
Thomas Harte
1ccfae885c Remove extra slashes. 2024-03-11 15:06:17 -04:00
Thomas Harte
971bfb2ecb Unify subtractions. 2024-03-11 14:52:48 -04:00
Thomas Harte
e7457461ba Reduce magic constants. 2024-03-11 14:49:03 -04:00
Thomas Harte
e8c1e8fd3f Fix RSB carry; unify set_pc. 2024-03-11 14:48:43 -04:00
Thomas Harte
ca779bc841 Expand test set. 2024-03-11 14:48:18 -04:00
Thomas Harte
a28c97c0de Simplify privilege test. 2024-03-11 12:14:00 -04:00
Thomas Harte
db49146efe Figure out what's going on with TEQ. 2024-03-11 09:51:09 -04:00
Thomas Harte
830d70d3aa Trust tests on immediate-opcode ROR 0; limit shift by register. 2024-03-10 23:38:31 -04:00
Thomas Harte
336292bc49 Further correct R15 as a destination. 2024-03-10 22:56:02 -04:00
Thomas Harte
bd62228cc6 The test set doesn't seem to do word rotation. 2024-03-10 22:40:37 -04:00
Thomas Harte
ccdd340c9a Reads also may or may not be aligned. *sigh* 2024-03-10 22:34:56 -04:00
Thomas Harte
0b42f5fb30 Make further test-set allowances. 2024-03-10 22:29:40 -04:00
Thomas Harte
e9e1db7a05 Change LDR writeback to destination. 2024-03-10 22:29:19 -04:00
Thomas Harte
21278d028c Correct unaligned accesses. 2024-03-10 21:56:19 -04:00
Thomas Harte
fbc273f114 Add invented model for tests. 2024-03-10 21:45:56 -04:00
Thomas Harte
06a5df029d Summarise failures. 2024-03-10 16:56:39 -04:00
Thomas Harte
e17700b495 Permit digression for 03110002, temporarily. 2024-03-10 14:47:02 -04:00
Thomas Harte
655b1e516c Test PSR and PC. 2024-03-10 14:14:18 -04:00
Thomas Harte
4e7a63f792 Do a de minimis checking of memory accesses. 2024-03-09 15:18:35 -05:00
Thomas Harte
a2896b9bd0 Test register values. 2024-03-09 15:11:12 -05:00
Thomas Harte
a4cf86268e Provide full access to stored registers. 2024-03-09 15:11:04 -05:00
Thomas Harte
d059e7c5d8 Disallow copying. 2024-03-09 15:10:55 -05:00
Thomas Harte
d6f882a8bb Integrate PC and PSR, guarantee invisible register values. 2024-03-09 14:59:44 -05:00
Thomas Harte
08f50f3eff Box in flags. 2024-03-08 23:01:29 -05:00
Thomas Harte
47f7340dfc Start hacking in some ARM tests. 2024-03-08 22:54:42 -05:00
Thomas Harte
fdef8901ab Double down on uint32_t. 2024-03-08 14:13:34 -05:00
Thomas Harte
ca1c3dc005 Add extra comments.
To persuade myself in the future.
2024-03-08 11:36:17 -05:00
Thomas Harte
9406a97141 Add some register switch tests. 2024-03-08 11:34:10 -05:00
Thomas Harte
a46ec4cffb Up clock rate to 24Mhz. 2024-03-07 22:16:58 -05:00
Thomas Harte
9bb5dc3c2b Fix inclusive range. 2024-03-07 19:40:34 -05:00
Thomas Harte
f6ea442606 Include various debugging detritus. 2024-03-07 14:28:39 -05:00
Thomas Harte
fa8fcd2218 Take another swing at popcount. 2024-03-07 14:28:31 -05:00
Thomas Harte
2a36d0fcbc Adjust user-mode test. 2024-03-07 14:00:38 -05:00
Thomas Harte
0e92885ed5 Fix ad hoc popcount; ARM does carry 'backwards'. 2024-03-07 13:27:41 -05:00
Thomas Harte
f5225b69e5 Add note to self. 2024-03-07 11:48:44 -05:00
Thomas Harte
15ee84b2eb Fix MUL ambiguity. 2024-03-07 11:45:39 -05:00
Thomas Harte
d380cecdb7 Add timers that count. 2024-03-07 11:39:26 -05:00
Thomas Harte
ae3cd924e8 Add a 2Mhz tick for timers. 2024-03-07 11:12:40 -05:00
Thomas Harte
a0f0f73bde Fix MOV as unconditional branch. 2024-03-07 10:31:26 -05:00
Thomas Harte
7cdceb7b4f Add a specific shout-out on prefetch abort, for debugging. 2024-03-07 10:23:46 -05:00
Thomas Harte
38b5624639 Add a little more VIDC detail. 2024-03-07 10:05:22 -05:00
Thomas Harte
3405b3b287 Add power-on bit, moving problems forward. 2024-03-06 22:14:56 -05:00
Thomas Harte
173fc9329a Add a little protection logic. 2024-03-06 22:00:34 -05:00
Thomas Harte
691a42d81e Attempt some logical mapping. 2024-03-06 21:51:19 -05:00
Thomas Harte
4059905f85 Slightly reorder messaging. 2024-03-06 16:45:17 -05:00
Thomas Harte
bbb520fd12 Transcribe some notes. 2024-03-06 15:31:07 -05:00
Thomas Harte
108a056f1c Execution now runs into a prefetch abort loop. 2024-03-06 15:05:24 -05:00
Thomas Harte
ed92e98ca2 Start looking at address translation. 2024-03-06 14:56:06 -05:00
Thomas Harte
0d666f9935 Get a bit more rigorous about reporting. 2024-03-06 09:54:39 -05:00
Thomas Harte
fe467be124 Further stick to existing type. 2024-03-05 10:56:09 -05:00
Thomas Harte
ba5f142515 Take further stab at TEQ PC, etc. 2024-03-05 10:55:44 -05:00
Thomas Harte
ed586e80bc Don't write to the PC with logical operations. 2024-03-05 09:32:35 -05:00
Thomas Harte
871c5467d7 Avoid sign change. 2024-03-05 09:31:42 -05:00
Thomas Harte
387791635e Start to establish a memory map. 2024-03-04 21:43:06 -05:00
Thomas Harte
b7a1363add Add an incorrect execution loop. 2024-03-04 21:09:24 -05:00
Thomas Harte
341b705bef Remove pointless check. 2024-03-04 14:11:44 -05:00
Thomas Harte
0b65aa39cd Add explicit assignment operator. 2024-03-04 14:09:53 -05:00
Thomas Harte
1b7c3644f4 Eliinate meaningless 'const'. 2024-03-04 14:09:27 -05:00
Thomas Harte
0cdca12e06 Resolve type mismatches. 2024-03-04 13:53:46 -05:00
Thomas Harte
61d4c69e45 Fix template parameter reference. 2024-03-04 13:25:40 -05:00
Thomas Harte
79865e295b Avoid ambiguous template parameter; use standard type. 2024-03-04 12:20:40 -05:00
Thomas Harte
1f43047de8 Loop the ARM executor into the build. 2024-03-04 12:08:46 -05:00
Thomas Harte
6f0ad0ab71 Add an empty Archimedes shell. 2024-03-04 12:06:43 -05:00
Thomas Harte
447734b1e9
Merge pull request #1354 from TomHarte/Acorn
Reorganise 'Electron' under 'Acorn'.
2024-03-04 11:55:56 -05:00
Thomas Harte
3e80651a0e Collect 'Electron' under 'Acorn'. 2024-03-04 11:31:25 -05:00
Thomas Harte
692a9da2e4
Merge pull request #1353 from TomHarte/ArchmidesAnalysis
Add a through path for Archimedes disk images.
2024-03-04 10:57:19 -05:00
Thomas Harte
e27312c980 Add to machine lists. 2024-03-04 10:19:06 -05:00
Thomas Harte
eae92a0cdb Add a through path for Archimedes disk images. 2024-03-04 10:13:57 -05:00
Thomas Harte
95cc34ba23
Merge pull request #1352 from TomHarte/ByeByeActive
Obscure storage for active registers.
2024-03-03 22:09:34 -05:00
Thomas Harte
7532b461cd
Merge pull request #1351 from TomHarte/PositiveExpression
Express offset test as positive logic.
2024-03-03 22:03:37 -05:00
Thomas Harte
230e9c6327 Obscure active. 2024-03-03 21:43:30 -05:00
Thomas Harte
11c4d2f09e Add further exposition. 2024-03-03 21:38:27 -05:00
Thomas Harte
f2db1b4aae Merge branch 'TiedDown' into PositiveExpression 2024-03-03 21:31:26 -05:00
Thomas Harte
b42a6e447d Tie down more corners. 2024-03-03 21:29:53 -05:00
Thomas Harte
8a83d71560 Fix condition. 2024-03-03 14:40:05 -05:00
Thomas Harte
9fd7d5c10f Switch test and meaning. 2024-03-03 14:34:21 -05:00
Thomas Harte
7a5ed6c427
Merge pull request #1350 from TomHarte/ArchimedesROM
Add RISC OS catalogue entry; do some basic ARM debugging.
2024-03-03 14:32:25 -05:00
Thomas Harte
4e7963ee81 Clarify PC semantics; remove faulty underscore. 2024-03-03 14:11:02 -05:00
Thomas Harte
945b7e90da Add just enough to persuade self that execution is broadly sane. 2024-03-03 14:03:08 -05:00
Thomas Harte
99f0233b76 Fix immediate offset and data processing operation. 2024-03-02 23:27:37 -05:00
Thomas Harte
62da0dee7f Unify reads. 2024-03-02 23:15:17 -05:00
Thomas Harte
1663d3d9d1 Introduce disaster of an attempted test run. 2024-03-02 22:40:12 -05:00
Thomas Harte
37499d493a Fix model name. 2024-03-02 21:47:09 -05:00
Thomas Harte
c0dd96eb7c Add a catalogue entry for RISC OS. 2024-03-02 21:44:27 -05:00
Thomas Harte
2abae4c8bf
Merge pull request #1349 from TomHarte/BarrelShifterTests
Introduce barrel-shifter tests.
2024-03-02 15:24:06 -05:00
Thomas Harte
c865da67e0 Introduce further barrel-shifter tests. 2024-03-02 15:12:03 -05:00
Thomas Harte
e6f77a9b80 Add logical right-shift tests. 2024-03-01 18:06:54 -05:00
Thomas Harte
7b28b3d634
Merge pull request #1343 from TomHarte/ARM2Ops
Attempt an implementation of the ARM2 instruction set.
2024-03-01 15:20:28 -05:00
Thomas Harte
42ba6d1281 Relocate execution code appropriately. 2024-03-01 15:02:47 -05:00
Thomas Harte
85b7afd530 Attempt a complete block data transfer. 2024-03-01 14:48:36 -05:00
Thomas Harte
f2f59a4de5 Attempt to deal with data aborts. 2024-03-01 10:38:08 -05:00
Thomas Harte
5759798ad7 Deal with downward write order. 2024-02-29 14:34:20 -05:00
Thomas Harte
ab1dd7f57e Implement a little of block data transfer. 2024-02-29 11:33:40 -05:00
Thomas Harte
53a2ea3a57 Add address exception. 2024-02-29 10:49:11 -05:00
Thomas Harte
1f1e7236be Add rotation. 2024-02-29 10:47:41 -05:00
Thomas Harte
fd2c5b6679 Make a quick first attempt at memory accesses. 2024-02-29 10:18:09 -05:00
Thomas Harte
0b287c55d5 Edge towards single data transfer. 2024-02-29 10:02:57 -05:00
Thomas Harte
0de8240238 Merge branch 'master' into ARM2Ops 2024-02-28 22:21:31 -05:00
Thomas Harte
1449b2a2a6
Merge pull request #1347 from TomHarte/AppleIIFlashRate
Double Apple II flash rate.
2024-02-28 22:21:05 -05:00
Thomas Harte
0f691766ee Double flash rate. 2024-02-28 22:13:22 -05:00
Thomas Harte
3ce05e9de1
Merge pull request #1346 from TomHarte/AppleIIReset
Propagate reset to the auxiliary switches.
2024-02-28 22:02:08 -05:00
Thomas Harte
98f5d0cdb7 Propagate reset to the auxiliary switches. 2024-02-28 21:36:55 -05:00
Thomas Harte
93b4008f81 Localise flags, detect improper carry write. 2024-02-28 21:28:19 -05:00
Thomas Harte
904462b881 Regularise data transfers. 2024-02-28 21:23:57 -05:00
Thomas Harte
3b320bcdef Update coprocessor interface. 2024-02-28 14:43:31 -05:00
Thomas Harte
3368bdb99f Document exceptions, partly for my future self. 2024-02-28 14:34:31 -05:00
Thomas Harte
4d400c3cb7 Add easy exceptions. 2024-02-28 14:25:12 -05:00
Thomas Harte
474f9da3c2 Add banked registers. 2024-02-28 14:09:05 -05:00
Thomas Harte
c49b26701f Relocate and clarify barrel shifts.
With a view to independent testing.
2024-02-28 13:53:13 -05:00
Thomas Harte
9b42d35d56 Update interface. 2024-02-28 11:42:33 -05:00
Thomas Harte
645152a1fd Implement branch. 2024-02-28 11:33:28 -05:00
Thomas Harte
487ade56ed Add basic multiply. 2024-02-28 11:27:27 -05:00
Thomas Harte
60d1b36e9a Implement registers side. 2024-02-28 10:25:14 -05:00
Thomas Harte
5a48c15e46 Add scheduler side of PC writeback. 2024-02-28 10:15:23 -05:00
Thomas Harte
d6bf1808f9 Take a swing at PC-as-input. 2024-02-28 09:33:05 -05:00
Thomas Harte
b676153d21 State intention to merge status with other registers. 2024-02-27 15:36:34 -05:00
Thomas Harte
a3339cf882 Fix indentation. 2024-02-27 15:30:51 -05:00
Thomas Harte
b4e0b46bac Add notes on R15. 2024-02-27 10:04:30 -05:00
Thomas Harte
09c1b2d7db Add missing shifts. 2024-02-27 09:55:24 -05:00
Thomas Harte
4255283e33 Deal with conditionality up front. 2024-02-26 21:36:23 -05:00
Thomas Harte
16e827bb2c Add basic arithmetics. 2024-02-26 21:27:58 -05:00
Thomas Harte
def69ce6d5 Add notes on R15. 2024-02-26 15:12:39 -05:00
Thomas Harte
054a799699 Fill in the easy 50% of operations. 2024-02-26 15:10:00 -05:00
Thomas Harte
580f402bb6 Muddle further towards data processing. 2024-02-26 14:50:45 -05:00
Thomas Harte
030dda34f0 Start poking at implementation. 2024-02-26 14:30:26 -05:00
Thomas Harte
cd21b39f44
Merge pull request #1342 from TomHarte/ARM2Status
Add some degree of ARM 2 status flags.
2024-02-26 10:48:24 -05:00
Thomas Harte
481b6d0e69 Sketch out some status flags. 2024-02-25 22:01:51 -05:00
Thomas Harte
a88d41bf00 List the flags. 2024-02-25 15:21:54 -05:00
Thomas Harte
0ee3b628e8
Merge pull request #1341 from TomHarte/AYEnvelopePeriod
Correct envelope period for internal double-resolution.
2024-02-24 15:38:17 -05:00
Thomas Harte
45628ba9df
Merge pull request #1337 from TomHarte/ArchimedesADFs
Add some support for Archimedes ADF files.
2024-02-24 15:32:08 -05:00
Thomas Harte
c843c395ea Correct envelope period for internal double-resolution. 2024-02-24 15:16:33 -05:00
Thomas Harte
9bdaf31d04 Add missing #include. 2024-02-24 15:09:40 -05:00
Thomas Harte
4ac2baeb9d
Merge pull request #1340 from ryandesign/patch-1
Mention Macintosh 128K and 512K in README.
2024-02-24 15:08:16 -05:00
Thomas Harte
c56e82207a Extend .ADF support as far as my knowledge currently goes. 2024-02-24 15:07:45 -05:00
Thomas Harte
82abebec6e Add missing #include. 2024-02-23 16:13:26 -05:00
Ryan Carsten Schmidt
60286c3a15
Mention Macintosh 128K and 512K in README. 2024-02-23 06:32:15 -06:00
Thomas Harte
8460fe2118 Flounder around file contents. 2024-02-22 22:19:19 -05:00
Thomas Harte
4b5456c9ba Add Hugo/Nick checks. 2024-02-22 22:19:10 -05:00
Thomas Harte
ddf136556d Add an Archimedes enum, start looking at analysis. 2024-02-22 13:51:44 -05:00
Thomas Harte
4c45f4468e
Merge pull request #1335 from TomHarte/ARMDecoding
Add ARM2 operation mapper.
2024-02-22 11:44:03 -05:00
Thomas Harte
73d2acca12 Moderately improve comments. 2024-02-22 11:20:22 -05:00
Thomas Harte
56a5df3783 Do the least possible manual test. 2024-02-22 10:48:19 -05:00
Thomas Harte
d205e538e1 Accept the C++ I'm in; clarify and simplify interface. 2024-02-22 10:16:54 -05:00
Thomas Harte
f9cbec668b Add empty shell for tests. 2024-02-21 15:43:24 -05:00
Thomas Harte
6577f68efc Complete instruction set; consolidate mapper. 2024-02-21 15:32:27 -05:00
Thomas Harte
e986ae2878 Add coprocessor data operations and register transfers. 2024-02-21 15:25:57 -05:00
Thomas Harte
b2696450d5 Bring forwards single data transfers. 2024-02-21 14:51:51 -05:00
Thomas Harte
2bbaf73aa2 Delete was is now duplicated. 2024-02-21 14:18:41 -05:00
Thomas Harte
0fe2c1406b Start mutating towards a form that owns the switch. 2024-02-21 14:17:01 -05:00
Thomas Harte
954d920b9e Extend what's held in the operation enum. 2024-02-20 14:14:18 -05:00
Thomas Harte
57b45076c5 Start dealing with per-instruction fields. 2024-02-17 22:13:51 -05:00
Thomas Harte
d639dc8bcb Hit up some more = default opportunities. 2024-02-17 15:42:31 -05:00
Thomas Harte
9a74ab6a8e Switch to actual mnenomics, temporarily(?) shrink table. 2024-02-17 15:41:57 -05:00
Thomas Harte
4c53414cc3 Merge branch 'master' into ARMDecoding 2024-02-17 08:14:18 -05:00
Thomas Harte
c36288dd6b
Merge pull request #1334 from TomHarte/EqualsDefault
Switch to `= default`.
2024-02-17 08:13:53 -05:00
Thomas Harte
bc5727af14 Switch to = default. 2024-02-16 21:50:15 -05:00
Thomas Harte
bd0a15c054 Start working on ARM2 decoding. 2024-02-16 21:36:07 -05:00
Thomas Harte
a758112084
Merge pull request #1333 from TomHarte/DeferredSwitches
Apple II: Apply deferred video actions before getting vapour value.
2024-02-16 10:08:23 -05:00
Thomas Harte
3981f3a874 Merge branch 'master' into DeferredSwitches 2024-02-16 09:19:54 -05:00
Thomas Harte
e8036127fe Add some commentary. 2024-02-16 09:19:22 -05:00
Thomas Harte
17abd87791 Remove further !!s. 2024-02-16 08:57:43 -05:00
Thomas Harte
35545451fe Apply applicable deferred actions before lookahead. 2024-02-16 08:56:01 -05:00
Thomas Harte
64bec0cc3d
Merge pull request #1332 from TomHarte/NoPrintf
Trim some printfs.
2024-02-15 21:18:43 -05:00
Thomas Harte
fadd3bc6fc Eliminate 'unused' error. 2024-02-15 13:57:11 -05:00
Thomas Harte
d9ec11c62e Use logger instead of printf. 2024-02-15 13:55:46 -05:00
Thomas Harte
093a029b8c Further reduce printf footprint. 2024-02-15 13:41:35 -05:00
Thomas Harte
b4a3b23571 Eliminate use of printf. 2024-02-15 13:32:49 -05:00
Thomas Harte
be99183f1d Remove outdated TODO. 2024-02-15 13:26:03 -05:00
Thomas Harte
dda5f41487
Merge pull request #1331 from TomHarte/IODeviceSel 2024-02-15 11:16:15 -05:00
Thomas Harte
a09457dab5 Fix IOSEL and DEVSEL assignments. 2024-02-15 10:29:30 -05:00
Thomas Harte
ac171d166e
Merge pull request #1321 from TomHarte/Mockingboard
Add Mockingboard support to the Apple II.
2024-02-15 10:24:39 -05:00
Thomas Harte
51de1892c0 With minor infrastructure fixes, switch Mockingboard to stereo. 2024-02-15 09:42:33 -05:00
Thomas Harte
e1fdda928a Add Mockingboard to Qt UI. 2024-02-15 09:13:17 -05:00
Thomas Harte
1c8261dc09 Add Mockingboard to macOS UI. 2024-02-15 09:10:19 -05:00
Thomas Harte
cb22278c7f Switch meaning of bit 2. 2024-02-15 08:54:52 -05:00
Thomas Harte
809bc9d6a8 Add TODO. 2024-02-14 22:46:57 -05:00
Thomas Harte
be11f31d5d Support reset. 2024-02-14 22:22:42 -05:00
Thomas Harte
0103761b7b Corrects AY audio tone. 2024-02-14 22:16:37 -05:00
Thomas Harte
3ac5fdafab Enables AY audio, albeit underclocked. 2024-02-14 22:15:21 -05:00
Thomas Harte
1e877c7563 Add a clock to the 6522s, enable interrupts. 2024-02-14 22:01:03 -05:00
Thomas Harte
07c11e8268 Begin 6522 wiring. 2024-02-14 15:18:19 -05:00
Thomas Harte
0dcceff410 There's actually two AYs. 2024-02-14 14:31:38 -05:00
Thomas Harte
2a684ab302 Include a single AY in the mix if appropriate. 2024-02-14 10:55:53 -05:00
Thomas Harte
27059233b3 Use sample source to simplify stretching AY. 2024-02-13 22:38:18 -05:00
Thomas Harte
7f84d5ac6f Merge branch 'master' into Mockingboard 2024-02-13 14:46:59 -05:00
Thomas Harte
d43f050922
Merge pull request #1330 from TomHarte/SampleProducingAY
Convert AY to a SampleSource.
2024-02-13 14:45:31 -05:00
Thomas Harte
3ba2618547 Fix formatting, add comment. 2024-02-13 13:48:31 -05:00
Thomas Harte
a3e104f8e2 Clean up commentary. 2024-02-13 13:46:27 -05:00
Thomas Harte
1bb82189e9 Add better exposition. 2024-02-13 10:57:22 -05:00
Thomas Harte
e06a66644c Eliminate a macro. 2024-02-13 10:54:53 -05:00
Thomas Harte
6dcc13921f Make first sweep at converting AY to a SampleSource. 2024-02-13 10:51:33 -05:00
Thomas Harte
fd45745600
Merge pull request #1328 from TomHarte/PerSampleAudio
Improve SampleSource infrastructure.
2024-02-12 16:38:01 -05:00
Thomas Harte
507c3da927 Sometimes avoid unnecessary zero-fills. 2024-02-12 14:33:55 -05:00
Thomas Harte
f14e45f93e Remove various instances of ';;'. 2024-02-12 14:23:54 -05:00
Thomas Harte
3d2d9ac45e Remove default set_sample_volume_range implementation too. 2024-02-12 14:00:08 -05:00
Thomas Harte
1895b4ee5d Remove empty implementation, the better for debugging. 2024-02-12 13:59:03 -05:00
Thomas Harte
d49c07687c Unify [get_/skip_]samples, adding a third option for in-place mixing. 2024-02-12 10:55:52 -05:00
Thomas Harte
3a208460e2 Reintroduce mono to stereo conversion. 2024-02-10 21:53:12 -05:00
Thomas Harte
472297e411
Merge pull request #1324 from ryandesign/cmake
Add CMake build system
2024-02-09 14:36:00 -05:00
Thomas Harte
25085cb5af Require good ordering. 2024-02-09 14:34:59 -05:00
Thomas Harte
9909146c59 Fix typo. 2024-02-09 14:26:02 -05:00
Thomas Harte
609d81d75d Distinguish sources of samples and of whole buffers. 2024-02-09 14:25:40 -05:00
Thomas Harte
c105acf1c7 Adopt a full type for stereo samples, gaining + and +=. 2024-02-09 10:48:42 -05:00
Thomas Harte
f3d0827d14 Introduce [Mono/Stereo]Sample types. 2024-02-09 09:15:48 -05:00
Thomas Harte
a4a983eb81 Promote stereo status to template parameter. 2024-02-08 15:21:47 -05:00
Thomas Harte
48be7c677e Avoid inheritance. 2024-02-08 12:07:12 -05:00
Thomas Harte
147d817977 Use fold expression for final-answer is_stereo. 2024-02-08 11:10:08 -05:00
Thomas Harte
d481f335b8 Switch to another std::fill. 2024-02-08 10:47:05 -05:00
Thomas Harte
228012cd0c Make a further deployment of std::fill. 2024-02-01 22:03:13 -05:00
Thomas Harte
f4d8c04f3c Without yet much exposition, draft sample-by-sample interface. 2024-02-01 21:56:33 -05:00
Thomas Harte
c6c9be0b08 Adopt CRTP for SampleSource. 2024-02-01 21:47:44 -05:00
Thomas Harte
3827929a15 Merge branch 'master' into PerSampleAudio 2024-02-01 21:33:25 -05:00
Thomas Harte
ca7e4b3a0e
Merge pull request #1327 from ryandesign/macos-ci
Update CI to build on macOS 11, 12, 13, and 14.
2024-02-01 21:33:11 -05:00
Thomas Harte
fd73c24fc3 Use std::fill; update volume with slider. 2024-02-01 21:32:16 -05:00
Thomas Harte
ce0d53b277 Clean up SampleSource's getters. 2024-02-01 21:29:00 -05:00
Ryan Carsten Schmidt
7dc3b5ba06 Update CI to build on macOS 11, 12, 13, and 14. 2024-01-31 06:27:11 -06:00
Thomas Harte
17cad73177 Attempt an implementation of StretchedAudioSource. 2024-01-29 16:45:20 -05:00
Thomas Harte
b28e3eb419
Merge pull request #1326 from ryandesign/MacDown
Compatibility fixes in Markdown files.
2024-01-28 17:35:41 -05:00
Ryan Carsten Schmidt
d811501421 Compatibility fixes in Markdown files.
Improve compatibility with some Markdown readers like MacDown by adding
blank lines before lists. Blank lines around headers were added for
consistency. One header level was fixed. One code block was fixed.
2024-01-27 13:24:35 -06:00
Thomas Harte
c68dd50fde
Merge pull request #1323 from ryandesign/BUILD.md
Rename BUILD.txt to BUILD.md and rewrite
2024-01-25 20:38:12 -05:00
Ryan Carsten Schmidt
ad8abf2e05 Add CMake SDL builds to CI workflow. 2024-01-25 10:15:11 -06:00
Ryan Carsten Schmidt
01d9455897 Exclude *AllRAM*.cpp from CMake program sources.
These files serve as documentation and are used in tests.
2024-01-25 10:15:11 -06:00
Ryan Carsten Schmidt
cbf8849004 Add CMake build system, initially for SDL version.
See #1275
2024-01-25 10:15:05 -06:00
Ryan Carsten Schmidt
f3a7d82dc1 Update build instructions with more specifics.
Mention macOS version requirement; see #1179.
2024-01-25 09:10:36 -06:00
Ryan Carsten Schmidt
017674de35 Rename BUILD.txt to BUILD.md. 2024-01-25 08:52:06 -06:00
Thomas Harte
4f211334b5
Merge pull request #1322 from ryandesign/cstring
Add missing include of cstring for memcpy.
2024-01-24 20:53:57 -05:00
Ryan Carsten Schmidt
31e261f7e5 Add missing include of cstring for memcpy. 2024-01-24 09:00:10 -06:00
Thomas Harte
15b5a62e01 Mockingboard: start sketching out intermediate clocking. 2024-01-23 22:05:30 -05:00
Thomas Harte
f5800aa004
Merge pull request #1320 from TomHarte/MoreTemplateElimination
Apply more macro elimination.
2024-01-22 21:46:19 -05:00
Thomas Harte
584aa78695 Avoid macro. 2024-01-22 21:37:04 -05:00
Thomas Harte
030f49db83 Eliminate macro. 2024-01-22 21:33:39 -05:00
Thomas Harte
cc165b65be Switch to lambda. 2024-01-22 21:22:56 -05:00
Thomas Harte
cb125e6336 Use constexpr functions rather than macros. 2024-01-22 21:17:00 -05:00
Thomas Harte
a3337ea90f Remove macro. 2024-01-22 21:15:44 -05:00
Thomas Harte
ae31f85f0c Eliminate macro. 2024-01-22 21:11:15 -05:00
Thomas Harte
5e9f484662 Avoid macro. 2024-01-22 21:09:13 -05:00
Thomas Harte
f2e29357bf
Merge pull request #1318 from TomHarte/MorePragmas
Switch trailing files to #pragma once.
2024-01-22 14:00:51 -05:00
Thomas Harte
8a1a14ba4c Switch trailing files to #pragma once. 2024-01-21 21:49:59 -05:00
Thomas Harte
31cbcb206f Commit new version number. 2024-01-21 21:25:27 -05:00
Thomas Harte
bf9e913a7b
Merge pull request #1317 from TomHarte/IIgsIncludes
Add missing include of cstdint.
2024-01-21 21:24:43 -05:00
Thomas Harte
d3cea4a10f Note that arguments may be unused. 2024-01-21 21:19:51 -05:00
Thomas Harte
a6df20ff84 Eliminate printf. 2024-01-21 21:19:38 -05:00
Thomas Harte
7122a9ee16 Add missing include of cstdint. 2024-01-21 21:08:04 -05:00
Thomas Harte
9361f29479
Merge pull request #1314 from ryandesign/nullptr_t 2024-01-21 19:02:42 -05:00
Thomas Harte
981f8a9aac
Merge pull request #1316 from TomHarte/SMSScrolling 2024-01-21 19:01:32 -05:00
Thomas Harte
295d5ae0c3 Ensure Master System horizontal scroll is latched every line. 2024-01-21 17:09:51 -05:00
Ryan Carsten Schmidt
070efd99e0 Include <cstddef> and use std::nullptr_t not nullptr_t
Fixes "error: use of undeclared identifier 'nullptr_t'; did you mean
'nullptr'?" when compiling with Xcode 12.4.
2024-01-20 19:17:18 -06:00
Thomas Harte
789c4a080f
Merge pull request #1312 from TomHarte/BetterLogging
Switch to a better logging interface.
2024-01-20 15:40:49 -05:00
Thomas Harte
8eb38ac437 Make use of bound_shader. 2024-01-19 22:34:42 -05:00
Thomas Harte
b08c7f8b68 Remove dangling LOG_PREFIXs. 2024-01-19 22:19:35 -05:00
Thomas Harte
0c2a4f442e Resolve all commented-out old logging references. 2024-01-19 22:17:35 -05:00
Thomas Harte
18814f7b2c Update use of logging. 2024-01-19 22:14:24 -05:00
Thomas Harte
b61317ba7e Continue conversion of logging. 2024-01-19 22:02:26 -05:00
Thomas Harte
b5e3858c46 Update logging. 2024-01-19 15:38:40 -05:00
Thomas Harte
a1df2ef401 Use updated logger. 2024-01-19 14:24:40 -05:00
Thomas Harte
2200940efe Update logging. 2024-01-19 14:22:23 -05:00
Thomas Harte
7e47329e2a Update use of logger. 2024-01-19 14:16:13 -05:00
Thomas Harte
54aae60c92 Update logging. 2024-01-19 14:01:10 -05:00
Thomas Harte
6497cae39d Attempt a full listing. 2024-01-19 14:00:53 -05:00
Thomas Harte
55d7a7e5f6 Flood the zone with sources; work incomplete. 2024-01-19 11:45:29 -05:00
Thomas Harte
040f276bf1 Update logging interface. 2024-01-19 10:57:30 -05:00
Thomas Harte
119b45001c Add SCC source. 2024-01-19 10:47:21 -05:00
Thomas Harte
70a753d8a8 Update to latest logging. 2024-01-19 10:41:59 -05:00
Thomas Harte
bdfbf779fa Promote source to a template paramter, to unify cases. 2024-01-19 10:41:47 -05:00
Thomas Harte
1d6537c3a9 Switch to newer logging interface. 2024-01-19 10:36:09 -05:00
Thomas Harte
e6ee8acfd6 Use an enum for source, for compile-time disabling. 2024-01-19 10:35:34 -05:00
Thomas Harte
07fe219148 Sketch out saner logging interface. 2024-01-18 16:37:07 -05:00
Thomas Harte
e8917cd294
Merge pull request #1310 from TomHarte/MoreUniquePtr
Remove macros and raw pointers from static analyser.
2024-01-18 13:32:30 -05:00
Thomas Harte
16add86372 Eliminate final macro. 2024-01-18 12:02:38 -05:00
Thomas Harte
9cc572ee7f Unstage temporary Qt build files. 2024-01-18 11:56:42 -05:00
Thomas Harte
c619e353bd Remove one further macro. 2024-01-18 11:36:30 -05:00
Thomas Harte
ab4ecccf57 Avoid raw pointers. 2024-01-17 14:59:36 -05:00
Thomas Harte
3ee81efe40
Merge pull request #1309 from TomHarte/TypeWarnings
Resolve minor dangling type conversion warnings.
2024-01-17 10:22:13 -05:00
Thomas Harte
a402e30edf Combine all per-bank information into a single struct.
(while fixing the indexing type)
2024-01-17 09:44:07 -05:00
Thomas Harte
16baa05aec Correct type. 2024-01-17 09:43:44 -05:00
Thomas Harte
1ccb2e72fc Eliminate a few further macros. 2024-01-17 09:43:33 -05:00
Thomas Harte
20c1f4f0e5
Merge pull request #1308 from ryandesign/no-preferredDevice
Fix color video performance on macOS 10.15+
2024-01-17 09:23:49 -05:00
Thomas Harte
e8d43a28f1
Merge pull request #1306 from TomHarte/FewerMacros
Reduce use of macros.
2024-01-17 09:22:34 -05:00
Ryan Carsten Schmidt
c74305be56 Fix color video performance on macOS 10.15+
Closes #1178
2024-01-17 01:33:00 -06:00
Thomas Harte
fafe43f013 Give value a type. 2024-01-16 23:42:04 -05:00
Thomas Harte
108c584ddb Comment out unused macros. 2024-01-16 23:40:52 -05:00
Thomas Harte
53d6d311a7 Use constexpr functions in preference to macros. 2024-01-16 23:40:40 -05:00
Thomas Harte
a3d37640aa Switch include guards to #pragma once. 2024-01-16 23:34:46 -05:00
Thomas Harte
a1f6f2c7f7 Eliminate remaining macros. 2024-01-16 22:42:20 -05:00
Thomas Harte
d85afc0caf Convert bus access macros. 2024-01-16 22:36:52 -05:00
Thomas Harte
112f3d1e73 Convert 6502 Personality-related macros. 2024-01-16 22:30:35 -05:00
Thomas Harte
dc53d6e6fa Convert check_schedule and bus_access macros. 2024-01-16 22:28:15 -05:00
Thomas Harte
30bf187119 Transcribe GetMediaAndPlatforms away from macros. 2024-01-16 22:17:19 -05:00
Thomas Harte
baac0768b8 Creep towards eliminating all macros. 2024-01-16 16:46:31 -05:00
Thomas Harte
a315deb60c Eliminate palette macro. 2024-01-16 14:32:04 -05:00
Thomas Harte
9ea71c97db Consolidate on std::array. 2024-01-16 14:28:15 -05:00
Thomas Harte
a047c6493a Eliminate joystick macros. 2024-01-16 14:26:55 -05:00
Thomas Harte
8c436c2df8 Eliminate BLOCK macro. 2024-01-16 14:22:15 -05:00
Thomas Harte
ca30cf6376 Eliminate surviving uses of old naming convention. 2024-01-16 14:18:29 -05:00
Thomas Harte
980ccbd45b Eliminate repetition macros. 2024-01-16 14:17:31 -05:00
Thomas Harte
cc635fd3ea Eliminate set_decimal_rotate_flags entirely. 2024-01-16 13:59:03 -05:00
Thomas Harte
fe34083ab8 Demacroise set_shift_flags, reduce casting. 2024-01-16 13:51:16 -05:00
Thomas Harte
ea4cc4c9b3 Convert set_rotate_flags and decline_conditional macros. 2024-01-16 13:40:44 -05:00
Thomas Harte
5b5ae69a18 Convert set_logical_flags and set_arithmetic_flags to lambdas. 2024-01-16 10:13:30 -05:00
Thomas Harte
de038fe28f Eliminate easy macros from Z80 implementation. 2024-01-16 09:43:41 -05:00
Thomas Harte
9990725cfb
Merge pull request #1305 from TomHarte/LessRaw
Avoid use of raw pointers in machine creation.
2024-01-12 22:35:35 -05:00
Thomas Harte
3ab6953246 Avoid use of raw pointers in machine creation. 2024-01-12 22:03:19 -05:00
Thomas Harte
ad3632cbe4
Merge pull request #1304 from TomHarte/CRTCEGA
Use named fields during CRTC execution.
2024-01-11 22:14:17 -05:00
Thomas Harte
42731be11f Remove non-functional EGA switches. 2024-01-11 22:00:48 -05:00
Thomas Harte
e919386c79 Grab cursor type. 2024-01-11 15:10:43 -05:00
Thomas Harte
22b4b4d4e3 Switch to named values for everything except blink mode. 2024-01-09 22:03:24 -05:00
Thomas Harte
177e741bca Fix test. 2024-01-09 21:19:44 -05:00
Thomas Harte
5f00d29297 Subsume vertical sync position. 2024-01-08 22:28:46 -05:00
Thomas Harte
f1453d9363 Introduce some vertical metrics. 2024-01-08 21:49:24 -05:00
Thomas Harte
8290220657 Begin process of meaningful naming.
This is in part for readability, but primarily because the differences in VGA/EGA register definitions are better handled at set rather than during execution.
2024-01-08 15:35:44 -05:00
Thomas Harte
0cfd29fafc
Merge pull request #1303 from TomHarte/IIgsCleanliness
Clean up what there currently is of a IIgs.
2024-01-04 12:36:40 -05:00
Thomas Harte
ed91956c30 Add missing #include. 2024-01-04 11:21:32 -05:00
Thomas Harte
24d64bf788 ROM is never shadowed; also add assert. 2024-01-04 11:17:20 -05:00
Thomas Harte
386f572e9a Add assert. 2024-01-04 11:11:26 -05:00
Thomas Harte
dae80217bc Adjust names of the newly-private. 2024-01-04 10:36:33 -05:00
Thomas Harte
bfbaebb661 Improve const correctness. 2024-01-04 10:29:38 -05:00
Thomas Harte
4affbe7556 Relocate using. 2024-01-04 10:28:41 -05:00
Thomas Harte
c151a73059 Remove dead srand. 2024-01-04 10:25:39 -05:00
Thomas Harte
ae48f05c80 Shuffle most of the MemoryMap ugliness into a source file. 2024-01-04 10:25:27 -05:00
Thomas Harte
cd7a152bed Remove a lot of dead logging detritus. 2024-01-04 09:59:46 -05:00
Thomas Harte
9cc37945b7 Avoid over-logging. 2024-01-04 09:57:01 -05:00
Thomas Harte
9bceb59f6c
Merge pull request #1302 from TomHarte/IIgsShadowingAgain
Be consistent in shadowing IIgs *physical* addresses.
2024-01-03 15:23:40 -05:00
Thomas Harte
cf00a709ec Be consistent in shadowing physical addresses. 2024-01-03 15:02:54 -05:00
Thomas Harte
ad31c50dfd
Merge pull request #1301 from TomHarte/MoreIIgsPaging
Normalise IIgs memory map interface.
2024-01-03 14:04:14 -05:00
Thomas Harte
bbaaa520c8 Eliminate MemoryMap access macros, fix tests target. 2024-01-03 13:21:39 -05:00
Thomas Harte
d01c306187 Pull PagingType::Main to top, eliminate macros. 2024-01-03 11:40:04 -05:00
Thomas Harte
439535e44b
Merge pull request #1300 from TomHarte/ElectronPaging
Don't page if acknowleding interrupts.
2024-01-02 22:34:11 -05:00
Thomas Harte
2447029631 Don't page if acknowleding interrupts. 2024-01-02 22:23:40 -05:00
Thomas Harte
ce2337f91e
Merge pull request #1299 from TomHarte/SpectreNIB
Mildly clean up around NIBs.
2024-01-02 09:52:55 -05:00
Thomas Harte
db4c802003 Make references to constant non-specific. 2024-01-02 09:26:47 -05:00
Thomas Harte
e69c777373 Merge branch 'master' into SpectreNIB 2024-01-02 09:17:37 -05:00
Thomas Harte
2db83acb98
Merge pull request #1298 from TomHarte/CRTC16bit
Make CRTC model part of type.
2024-01-01 22:57:29 -05:00
Thomas Harte
8c0ac6158c Adjust indentation. 2024-01-01 22:45:11 -05:00
Thomas Harte
34b98be6d4 Merge branch 'master' into CRTC16bit 2024-01-01 22:34:48 -05:00
Thomas Harte
8a85ef8426
Merge pull request #1297 from TomHarte/InverseText
Fix Apple II inverse text errors.
2024-01-01 22:18:11 -05:00
Thomas Harte
344fec0683 Fix Apple II inverse text errors. 2024-01-01 22:08:06 -05:00
Thomas Harte
afa2dad2e2
Merge pull request #1292 from TomHarte/KeyRepeat
Indicate whether a keypress is a repeat. Treat appropriately in the Apple II.
2024-01-01 15:27:25 -05:00
Thomas Harte
26123bf399 Mostly hide state. 2024-01-01 15:15:40 -05:00
Thomas Harte
2698ac2d0f Comment and clarify. 2024-01-01 09:33:20 -05:00
Thomas Harte
b7e1ac840f Add necessary Qt change. 2023-12-31 16:43:32 -05:00
Thomas Harte
a58f643b4d Improve repeat behaviour. 2023-12-31 15:21:20 -05:00
Thomas Harte
4f846ef8d0 Remove absolute path. 2023-12-31 15:11:45 -05:00
Thomas Harte
7f26cb0ecf Merge branch 'KeyRepeat' of github.com:TomHarte/CLK into KeyRepeat 2023-12-31 15:03:52 -05:00
Thomas Harte
a1da6db0ee
Merge pull request #1296 from TomHarte/Qt5Too
Reintroduce Qt5 support.
2023-12-30 23:08:07 -05:00
Thomas Harte
a7fda83ea5 Reintroduce shortcuts; eliminate bad auto-UI additions. 2023-12-30 23:05:49 -05:00
Thomas Harte
c1778a8fee Reintroduce Qt5 support. 2023-12-30 23:03:15 -05:00
Thomas Harte
7cb40f5d45
Merge pull request #1293 from TomHarte/Qt6
Update to Qt 6.
2023-12-29 23:05:43 -05:00
Thomas Harte
0c770c474b Add PC startup options. 2023-12-29 22:55:34 -05:00
Thomas Harte
134a11b948 Mildly circuitously, accept ROM images. 2023-12-29 22:38:08 -05:00
Thomas Harte
09059ab869 Apply de minimis adaptations to get to build under Qt6. 2023-12-29 22:04:24 -05:00
Thomas Harte
051cdc63b8 Fix SDL build. 2023-12-29 14:54:47 -05:00
Thomas Harte
1b5b3e575c Add repeat-only functionality. 2023-12-29 14:45:48 -05:00
Thomas Harte
21e6f4d823 Update SDL intermediate struct. 2023-12-28 15:12:06 -05:00
Thomas Harte
2baae216ea This TODO is also already dispatched. 2023-12-28 15:09:45 -05:00
Thomas Harte
ffb992d04a Erase done TODO. 2023-12-28 15:07:39 -05:00
Thomas Harte
9344f6a824 Indicate whether a keypress is a repeat. Treat appropriately in the Apple II. 2023-12-28 15:05:55 -05:00
Thomas Harte
74bee31a78 Update version number. 2023-12-28 10:41:52 -05:00
Thomas Harte
96bcbc741f
Merge pull request #1291 from TomHarte/LoneDensityParser
Avoid erroneous early Parser exit.
2023-12-28 10:27:43 -05:00
Thomas Harte
54ddbb6b2b Avoid erroneous early exit. 2023-12-28 10:06:18 -05:00
Thomas Harte
99351ee2de Extend refresh address to 16-bit in 'EGA' mode. 2023-12-27 16:17:25 -05:00
Thomas Harte
a617f7305a Move personality into type. 2023-12-27 16:15:52 -05:00
Thomas Harte
be8994a7b4
Merge pull request #1289 from TomHarte/BuildWarnings
Resolve macOS/SDL build warnings.
2023-12-27 11:44:32 -05:00
Thomas Harte
574de0dbf3 Further reduce state. 2023-12-27 11:25:47 -05:00
Thomas Harte
518cd69d5c
Merge pull request #1288 from TomHarte/EGAVGAROMs
Add EGA and VGA ROM references; mildly clean up PC.
2023-12-27 11:14:38 -05:00
Thomas Harte
3793fbd978 Remove much unused storage; add virtual destructor. 2023-12-27 11:14:08 -05:00
Thomas Harte
eca0984739 Resolve switch-statement warnings. 2023-12-27 10:58:13 -05:00
Thomas Harte
d6073e0407 Fix typo, add bonus comment. 2023-12-27 10:52:43 -05:00
Thomas Harte
001b161568 Treat speed as more of a runtime selection. 2023-12-27 10:44:51 -05:00
Thomas Harte
088445575e 'Corresponding' better refers back, I think. 2023-12-27 10:12:46 -05:00
Thomas Harte
180ff2f0a7 Fix capitalisation. 2023-12-27 10:10:59 -05:00
Thomas Harte
11c7f2ee6e Make GlaTICK optional. 2023-12-27 10:10:42 -05:00
Thomas Harte
29ed449373 Add EGA and VGA ROMs. 2023-12-27 10:05:41 -05:00
Thomas Harte
f83c3e7af0 Name repeated constant.
(... and, I think, four is enough)
2023-12-27 10:00:01 -05:00
Thomas Harte
7b343b25cc Mildly reduce bit count weight; eliminate !!s. 2023-12-26 14:13:01 -05:00
Thomas Harte
497ae935d6 Bump version number. 2023-12-26 10:43:47 -05:00
Thomas Harte
acee513cd3
Merge pull request #1287 from TomHarte/ResettingKeyboard
Treat XT keyboard reset as a continuing state.
2023-12-25 19:01:41 -05:00
Thomas Harte
14e9ae014c Remove caveman log. 2023-12-25 18:44:11 -05:00
Thomas Harte
16b646ad2e Treat reset as a continuing state. 2023-12-25 18:43:35 -05:00
Thomas Harte
35f000f93c
Merge pull request #1286 from TomHarte/CMOSRAM
Adds RAM to the PC RTC.
2023-12-25 15:06:28 -05:00
Thomas Harte
fc9bea5b32 Iterate forwards. 2023-12-25 14:58:01 -05:00
Thomas Harte
0537e59486 Add RAM. 2023-12-25 14:35:24 -05:00
Thomas Harte
a15d4610f7
Merge pull request #1285 from TomHarte/24HourRTC
Default to 24-hour mode.
2023-12-24 18:11:40 -05:00
Thomas Harte
f58ab0d00d Default to 24-hour mode. 2023-12-24 17:37:52 -05:00
Thomas Harte
e0a07ad22f
Merge pull request #1284 from TomHarte/SomeWarnings
Resolve outstanding x86-related warnings.
2023-12-24 15:48:17 -05:00
Thomas Harte
795529ef97 Resolve sizing types. 2023-12-24 14:26:15 -05:00
Thomas Harte
cbd4f7965b Acknowledge one further 16-bit assumption. 2023-12-24 14:22:26 -05:00
Thomas Harte
bf9743cb38 Keep as regular int. 2023-12-24 14:16:12 -05:00
Thomas Harte
13631fb7bc Resolve various 32->16 conversion warnings. 2023-12-24 14:14:53 -05:00
Thomas Harte
3e328bed61 Be overt about jump size, albeit without internal rigour. 2023-12-24 14:11:41 -05:00
Thomas Harte
a3e4d38be3
Merge pull request #1283 from TomHarte/RedundantMove
Remove pointless — and damaging — `std::move`.
2023-12-23 22:09:11 -05:00
Thomas Harte
62410a04ef Remove pointless — and damaging — std::move. 2023-12-23 21:44:10 -05:00
Thomas Harte
8b4cabd228
Merge pull request #1280 from TomHarte/More68000Op
Move fact of fixed operations into type.
2023-12-22 19:59:00 -05:00
Thomas Harte
54f1c31c94 Apply changes on trailing edges only. 2023-12-22 18:38:43 -05:00
Thomas Harte
66bc1fd6fd Don't mix constructor delegation and variable instantiation. 2023-12-22 12:29:27 -05:00
Thomas Harte
c07f8d8ef8 Switch ordering. 2023-12-22 10:50:49 -05:00
Thomas Harte
e6ed45cb71
Merge pull request #1281 from ryandesign/TargetConditionals
Include TargetConditionals.h where needed
2023-12-22 10:49:23 -05:00
Thomas Harte
dbb14467ec Remove redundant using, add extra comment. 2023-12-22 10:48:35 -05:00
Thomas Harte
c266639a0c Improve commentary; use specialised types for TAS. 2023-12-22 10:46:10 -05:00
Ryan Carsten Schmidt
5e87692102 Include TargetConditionals.h where needed
Fixes build failure "error: 'TARGET_OS_IPHONE' is not defined, evaluates
to 0" on macOS with newer versions of clang.
2023-12-21 23:33:58 -06:00
Thomas Harte
5b43ea82f3 Lock down interrupt cycle types. 2023-12-21 23:12:14 -05:00
Thomas Harte
7c28a77b2b Fill in assignment operator. 2023-12-21 23:09:42 -05:00
Thomas Harte
85f814c632 Attempt to build fixed operations into type.
This simplifies callees and should make all helper functions automatically able to optimise themselves for fixed operations.
2023-12-21 23:08:18 -05:00
Thomas Harte
213dfe037d Shift operation stuff into its own namespace, making data_select_active a free function. 2023-12-21 16:03:53 -05:00
Thomas Harte
6c4905d961
Merge pull request #1279 from TomHarte/NoMoreEmuTOS
Eliminate use of EmuTOS.
2023-12-21 15:43:34 -05:00
Thomas Harte
160fec2439 Eliminate trace. 2023-12-21 15:31:09 -05:00
Thomas Harte
faaa89bb67 Eliminate all reference to EmuTOS. 2023-12-21 15:28:45 -05:00
Thomas Harte
3616a943a5
Merge pull request #1278 from TomHarte/AdmitToPC
Formalise the PC in macOS and under SDL.
2023-12-21 13:31:28 -05:00
Thomas Harte
98be6e690f Fully expose the PC to SDL, etc. 2023-12-21 13:01:41 -05:00
Thomas Harte
09867e1e6d Unhide the PC. 2023-12-21 12:59:53 -05:00
Thomas Harte
dc03b2c03b
Merge pull request #1226 from TomHarte/65c02STAAbsX
Adjust 65c02 STA abs,x behaviour.
2023-12-21 12:31:39 -05:00
Thomas Harte
1f2fbccf1f Update documentation. 2023-12-20 22:05:45 -05:00
Thomas Harte
356d8f469a Correct various throaway -> throwaway. 2023-12-20 22:02:51 -05:00
Thomas Harte
60bd81c4cc Use X. 2023-12-20 22:02:51 -05:00
Thomas Harte
38c3d302a3 Restore JMP (abs, x) length. 2023-12-20 22:02:51 -05:00
Thomas Harte
24c80060c8 Revise guess on JMP (abs, x). 2023-12-20 22:02:51 -05:00
Thomas Harte
d33deb676f Adjust (abs, y) addressing. 2023-12-20 22:02:19 -05:00
Thomas Harte
bf5ed98f35 Generalise 65c02 behaviour.
Partly to convince myself:
1. this change alters behaviour of `CycleAddXToAddressLowRead`
2. which affects only `AbsoluteXw` and the 65c02-specific `JMP (abs, x)`;
3. `AbsoluteXw` is then used only by `AbsoluteXWrite` and `AbsoluteXReadModifyWrite`;
4. `AbsoluteXWrite` is used for abs, x addressing by `SHY`, `STA` and `STZ`;
5. `AbsoluteXReadModifyWrite` is used for `ASL`, `ASO`, `ROL`, `RLA`, `LSR`, `LSE`, `ROR`, `RRA`, `DEC`, `DCP`, `INC` and `INS`.

... though many of the latter are replaced by instance of `FastAbsoluteXReadModifyWrite` for the 65c02 which don't include a dummy
access at all if the page boundary is crossed so the issue is moot.
2023-12-20 22:02:14 -05:00
Thomas Harte
abea3d10cc
Merge pull request #1270 from ryandesign/MacSDL
SDL build improvements
2023-12-18 21:58:30 -05:00
Thomas Harte
a779b4668e
Merge pull request #1269 from ryandesign/typos
Fix typos
2023-12-18 21:56:23 -05:00
Thomas Harte
be7e776fa4
Merge pull request #1276 from TomHarte/AppleIIColourText
Don't disable the colour burst in mixed mode.
2023-12-18 21:53:07 -05:00
Thomas Harte
08287edd61 Don't disable the colour burst in mixed mode. 2023-12-18 16:26:02 -05:00
Ryan Carsten Schmidt
5ef6b190af Fix typos 2023-12-16 03:53:07 -06:00
Ryan Carsten Schmidt
d12316dfcf Change phase from int to uint8_t
output_colour_burst expects a uint8_t so may as well make that clear.
2023-12-15 04:49:13 -06:00
Ryan Carsten Schmidt
81ad864659 Fix OpenGL Apple II colors
Adjust phase by 90 degress.

Closes #872
2023-12-15 04:48:32 -06:00
Ryan Carsten Schmidt
cd4498a36a Improve macOS SDL Macintosh video & Apple II colors
Hacks in AppleII/Video.cpp, AppleII/Video.hpp, and Macintosh/Video.cpp
assume that building on macOS means building for Metal unless
IGNORE_APPLE is defined. By defining this in the macOS SDL build,
Macintosh video is now sized and positioned correctly and Apple II
colors are now just as wrong as they are on other OpenGL builds instead
of being wrong in a unique way.

See #872
2023-12-15 01:27:28 -06:00
Ryan Carsten Schmidt
d31ecd8986 Link with OpenGL framework on macOS
Fixes "ld: library not found for -lGL"
2023-12-15 01:27:28 -06:00
Ryan Carsten Schmidt
bb030fc141 Silence macOS OpenGL deprecation warnings 2023-12-15 01:27:28 -06:00
Ryan Carsten Schmidt
778544b36e Link with Accelerate framework on macOS
Fixes "Undefined symbols for architecture x86_64: '_vDSP_dotpr_s1_15'"
2023-12-15 01:27:28 -06:00
Ryan Carsten Schmidt
dc657bdd51 Use the right include path for SDL.h
Fixes "main.cpp:22:10: fatal error: 'SDL2/SDL.h' file not found" when
SDL2 is not in a standard system include directory.
2023-12-15 01:27:28 -06:00
Ryan Carsten Schmidt
2352b4e6d8 Import PATH into scons environment
Fixes "/bin/sh: sdl2-config: command not found" when sdl2-config is not
in a standard system bin directory.
2023-12-15 01:27:28 -06:00
Ryan Carsten Schmidt
8256500877 Update GitHub workflow: also build SDL UI on macOS 2023-12-15 01:27:28 -06:00
Thomas Harte
def1f90d86
Merge pull request #1268 from TomHarte/EOI
Support auto-EOI.
2023-12-13 10:52:00 -05:00
Thomas Harte
5033d2046a Support auto-EOI. 2023-12-12 14:02:46 -05:00
Thomas Harte
b12ae263a3
Merge pull request #1267 from TomHarte/EOI
Support 8259 PIC specific EOIs.
2023-12-12 12:42:34 -05:00
Thomas Harte
a49a3da21c Merge branch 'master' into EOI 2023-12-12 12:15:13 -05:00
Thomas Harte
02b2b9d47e
Merge pull request #1265 from TomHarte/PCHD
Introduce high-density tracks.
2023-12-12 12:14:48 -05:00
Thomas Harte
2db04eb671 Add TODO list. 2023-12-12 10:59:43 -05:00
Thomas Harte
0c98a78bb5 Support specific EOIs. 2023-12-12 10:55:49 -05:00
Thomas Harte
d523242e08 Add TODO. 2023-12-12 09:35:05 -05:00
Thomas Harte
070f8d8bc3 Simplify control flow. 2023-12-12 09:29:28 -05:00
Thomas Harte
add3257258 Switch to using a Parser rather than duplicating one. 2023-12-11 19:13:37 -05:00
Thomas Harte
bfd6543067 Defaults can now be private. 2023-12-11 19:12:49 -05:00
Thomas Harte
50b4132db7
Merge pull request #1259 from TomHarte/NIBSlipBits
NIB: switch to a strategy supporting non-standard formats.
2023-12-11 10:33:22 -05:00
Thomas Harte
e79727d30d Enhance to support 'try-any' density. 2023-12-11 10:32:13 -05:00
Thomas Harte
a40ae08248 Be const correct; drop get_. 2023-12-11 09:58:24 -05:00
Thomas Harte
05bfab47d2 Merge branch 'master' into PCHD 2023-12-10 23:15:33 -05:00
Thomas Harte
44a19e8306
Merge pull request #1266 from TomHarte/DayOfMonth
Fix RTC day of the month, turbo keyboard resets.
2023-12-10 23:11:57 -05:00
Thomas Harte
ad6fe75296 Add yucky disk speed coupling. 2023-12-10 23:07:02 -05:00
Thomas Harte
d658e00f26 Add exposition, expand recorded data. 2023-12-10 22:59:50 -05:00
Thomas Harte
7b9cc2332e Extend amount of time it takes keyboard to reset. 2023-12-10 22:44:24 -05:00
Thomas Harte
04d75a3ab8 Return proper day-of-the-month value. 2023-12-10 22:44:08 -05:00
Thomas Harte
dae8a5cda2 Fix namespace. 2023-12-10 22:40:07 -05:00
Thomas Harte
98e05fb0e3 Introduce high-density tracks. 2023-12-10 22:17:23 -05:00
Thomas Harte
ada627d027 Decline to try to surface tracks past the end of the disk. 2023-12-09 15:36:47 -05:00
Thomas Harte
cbe5e69aa1 Add exposition. 2023-12-08 23:56:43 -05:00
Thomas Harte
39f2c8097e Remove second semicolon. 2023-12-08 23:55:27 -05:00
Thomas Harte
28cb0ad029 Try permitting a single sync section only. 2023-12-08 23:44:26 -05:00
Thomas Harte
371f109a84 Fix mark locations. 2023-12-08 23:41:14 -05:00
Thomas Harte
3c3cff568a Remove dead variable. 2023-12-08 23:25:56 -05:00
Thomas Harte
c481577f9f Simplify, and attempt to avoid reconversions. 2023-12-08 23:12:41 -05:00
Thomas Harte
0dfaca2a20 Merge branch 'master' into NIBSlipBits 2023-12-08 22:19:46 -05:00
Thomas Harte
671e59b27a
Merge pull request #1263 from TomHarte/IMDFiles
Add read-only support for IMD files.
2023-12-08 16:50:19 -05:00
Thomas Harte
42291cd789 Add documentation reference. 2023-12-08 15:38:05 -05:00
Thomas Harte
9ef28da322 Add read-only support for IMD images. 2023-12-08 15:37:13 -05:00
Thomas Harte
2a0176dde6
Merge pull request #1262 from TomHarte/PCTurbo
Add turbo option for PC execution.
2023-12-08 14:47:19 -05:00
Thomas Harte
f823310fe3 Add an appropriate crop. 2023-12-08 14:29:23 -05:00
Thomas Harte
1c47c64bcb Connect option to macOS UI. 2023-12-08 14:23:27 -05:00
Thomas Harte
fbf79c142a Undo accidental build-type switch. 2023-12-08 14:03:29 -05:00
Thomas Harte
0bf453199c Default to 'fast'. 2023-12-08 12:51:55 -05:00
Thomas Harte
604fca7fb1 Revise colour burst phase guess. 2023-12-08 11:55:00 -05:00
Thomas Harte
2ee873d1a1 This isn't intended to be exact. 2023-12-08 11:07:14 -05:00
Thomas Harte
e703721271 Tie snow avoidance to avoiding DEN. 2023-12-08 11:02:41 -05:00
Thomas Harte
664890cead Expose speed as an option. 2023-12-08 10:46:59 -05:00
Thomas Harte
3a103217d1 Add a compiletime 'turbo' flag for sort-of-80286 speeds. 2023-12-08 09:38:55 -05:00
Thomas Harte
e55a09962f
Merge pull request #1260 from TomHarte/QuietPC
Mostly silence PC.
2023-12-07 22:12:12 -05:00
Thomas Harte
4bfde2f30f Mostly silence PC. 2023-12-07 22:11:49 -05:00
Thomas Harte
2966a82690
Merge pull request #1258 from TomHarte/DiskWrite
Respond appropriately if a write is attempted.
2023-12-07 22:08:07 -05:00
Thomas Harte
ba91f461fa
Merge pull request #1257 from TomHarte/CGABorderColour
Switch back to yellow for composite.
2023-12-07 21:56:38 -05:00
Thomas Harte
d8d33ac419 Add a backup strategy for non-standard formats. 2023-12-07 21:52:51 -05:00
Thomas Harte
d61d80afec It seems that write protection ends in not-ready. 2023-12-07 16:50:12 -05:00
Thomas Harte
1985d7da6a Do something on a write rather than nothing. 2023-12-07 16:45:21 -05:00
Thomas Harte
75b6030516 Don't lose brown upon a blink. 2023-12-07 14:53:59 -05:00
Thomas Harte
e691cc8723 Retain dark yellow for composite output. 2023-12-07 14:21:09 -05:00
Thomas Harte
ac47b93542
Merge pull request #1256 from TomHarte/CGABorderColour
CGA: reduce repetition, map dark yellow to brown, support border colour.
2023-12-07 14:13:14 -05:00
Thomas Harte
c5745f71f6 Reduce repetition, map dark yellow to brown. 2023-12-07 13:11:20 -05:00
Thomas Harte
48d1fa7eab
Merge pull request #1255 from TomHarte/CGAClock
Revise CGA clock rate downward.
2023-12-07 12:28:44 -05:00
Thomas Harte
71069bef0f Correct get_scaled_scan_status. 2023-12-07 12:18:03 -05:00
Thomas Harte
8608f0f89d Adjust CGA clocking down by 1/7th. 2023-12-07 12:05:15 -05:00
Thomas Harte
d94791a82d
Merge pull request #1254 from TomHarte/BordersAplenty
Unify repeated setup/execution of output_level.
2023-12-07 11:45:42 -05:00
Thomas Harte
017fd84f36 Also use output level for CRAM dots. 2023-12-07 11:05:10 -05:00
Thomas Harte
fc63fcb751 Unify usages of output_level for border. 2023-12-07 11:04:18 -05:00
Thomas Harte
eb4a8bfef9
Merge pull request #1253 from TomHarte/RTC
Add some small portion of the AT real-time clock.
2023-12-07 10:52:45 -05:00
Thomas Harte
ad78a03300 Default to CGA40 if starting a new composite PC. 2023-12-07 10:14:06 -05:00
Thomas Harte
0f22ee5de4 Add TODO. 2023-12-07 10:08:43 -05:00
Thomas Harte
83cfacc0a5 Update TODOs. 2023-12-07 10:03:52 -05:00
Thomas Harte
ef0c3549d2 Attempt but fail to indicate PM. 2023-12-06 23:28:16 -05:00
Thomas Harte
e3119a4904 Hack in read-only versions of the main registers. 2023-12-06 23:25:34 -05:00
Thomas Harte
5fde3b8d5d Wire up a stub RTC plus appropriate option ROM. 2023-12-06 22:56:09 -05:00
Thomas Harte
d696c15be5
Merge pull request #1252 from TomHarte/CGAAddresses
Revise guess as to CGA address wrapping.
2023-12-06 22:32:54 -05:00
Thomas Harte
b385e6edad Revise guess as to address wrapping. 2023-12-06 22:03:24 -05:00
Thomas Harte
327dc51ece
Merge pull request #1250 from TomHarte/CGATarget
Add CGA emulation.
2023-12-06 16:23:10 -05:00
Thomas Harte
a44ffa769b
Merge pull request #1251 from TomHarte/PCScreenshots
Add PC screenshots, mention.
2023-12-06 16:21:51 -05:00
Thomas Harte
87438a3019 Add PC screenshots, mention. 2023-12-06 16:20:31 -05:00
Thomas Harte
1f976b8ccb Complete loop for macOS display selection. 2023-12-06 14:49:34 -05:00
Thomas Harte
8645a4b7b1 Walk further towards user display configuration. 2023-12-06 14:44:59 -05:00
Thomas Harte
ff000a5792 Support remainder of colour control. 2023-12-06 14:38:43 -05:00
Thomas Harte
1c7f8841f4 Avoid potential lengthy startup; work towards display option. 2023-12-06 13:55:41 -05:00
Thomas Harte
fd298ffbe9 Remove dead TODO. 2023-12-06 13:15:36 -05:00
Thomas Harte
987a5dbfbf Honour monochrome flag. 2023-12-06 13:15:17 -05:00
Thomas Harte
0bb74f405f Ensure lines are in-phase with the NTSC colour subcarrier. 2023-12-06 13:12:58 -05:00
Thomas Harte
1aa168054e Add a phoney colour burst. 2023-12-06 13:10:28 -05:00
Thomas Harte
6d7c6de32f Fix flush_pixels for 640px mode. 2023-12-06 11:50:16 -05:00
Thomas Harte
d3021e8c90 Attempt _something_ for 640px mode. 2023-12-06 11:42:35 -05:00
Thomas Harte
6adaf89934 Make first attempt at palette support. 2023-12-06 11:19:04 -05:00
Thomas Harte
bf49f745bf Attempt to distinguish clocks. 2023-12-06 10:41:20 -05:00
Thomas Harte
c5aa3fc75c Start mangling towards pixel output. 2023-12-06 10:30:30 -05:00
Thomas Harte
d88c7ae148 Switch to CGA as default. 2023-12-06 09:59:21 -05:00
Thomas Harte
f455f07ba2 Support half-clocked mode. 2023-12-06 09:59:14 -05:00
Thomas Harte
561e50a24d Implement most of CGA text mode. 2023-12-06 09:42:22 -05:00
Thomas Harte
2216fc37a1 Add CGA font. 2023-12-06 09:34:25 -05:00
Thomas Harte
23bdf0c2a2 Add CGA font references. 2023-12-06 09:34:04 -05:00
Thomas Harte
24eaf95e9d Limit to eight pixels per fetch, to produce stable video. 2023-12-06 09:13:47 -05:00
Thomas Harte
e43f960934 Produce incorrect output from proper clock; capture mode. 2023-12-05 23:01:08 -05:00
Thomas Harte
fdd599e71a Unify CRTC routing. 2023-12-05 23:00:43 -05:00
Thomas Harte
84ee683ad3 Remove redundant, false comment. 2023-12-05 23:00:21 -05:00
Thomas Harte
b2b05b590f Clone the MDA class to CGA. 2023-12-05 22:37:33 -05:00
Thomas Harte
c5ec9ae171 Adjust MDA clock; it's slightly slower than my guess. 2023-12-05 22:31:37 -05:00
Thomas Harte
5576588c2d Fix drive enables, go back to FF for non-existent ports. 2023-12-05 22:02:41 -05:00
Thomas Harte
084efdeb2d Resolve further type conversion warnings. 2023-12-05 16:54:11 -05:00
Thomas Harte
fd8afb6668 Devolve memory location and font ROM decision. 2023-12-05 16:46:39 -05:00
Thomas Harte
dd04909d58 Resolve some further warnings. 2023-12-05 16:43:55 -05:00
Thomas Harte
736a3841ce Wire up adaptor selection. 2023-12-05 16:42:55 -05:00
Thomas Harte
bdf9c4765b Loosen the assumption of MDA. 2023-12-05 16:38:09 -05:00
Thomas Harte
6659a1dec5 Exit on EOP. 2023-12-05 15:37:25 -05:00
Thomas Harte
f97e6095df Adjust option name. 2023-12-05 15:26:32 -05:00
Thomas Harte
23c60ae9bc Supply video adaptor type. 2023-12-05 15:19:58 -05:00
Thomas Harte
dc7ba11dff
Merge pull request #1246 from ryandesign/DidNotLoad
Disk II: Don't overwrite data bus when not asked to
2023-12-05 15:01:23 -05:00
Thomas Harte
6c0a746470
Merge pull request #1248 from TomHarte/FAT12Analyser
Add something of a FAT12 analyser.
2023-12-05 14:58:18 -05:00
Thomas Harte
c78a2c71d7
Merge pull request #1247 from ryandesign/ci
CI improvements
2023-12-05 14:57:56 -05:00
Thomas Harte
4265455c31 Unify DMA interface. 2023-12-05 14:52:14 -05:00
Thomas Harte
0bcb17985b Eliminate further warnings. 2023-12-05 14:44:20 -05:00
Thomas Harte
711575bf69 Avoid having two PC targets. 2023-12-05 14:18:10 -05:00
Ryan Carsten Schmidt
2ee062ea9e Rename workflow to Build 2023-12-05 12:11:22 -06:00
Ryan Carsten Schmidt
452e32ca4e Add macOS build job to workflow
Closes #1244
2023-12-05 12:10:35 -06:00
Ryan Carsten Schmidt
54f25b3e4e Split workflow step commands onto two lines 2023-12-05 12:10:35 -06:00
Ryan Carsten Schmidt
b1b4404b48 Use checkout@v4 in workflow 2023-12-05 12:10:35 -06:00
Ryan Carsten Schmidt
d1bfbac59e Rename workflow job step to Checkout 2023-12-05 12:10:34 -06:00
Ryan Carsten Schmidt
0a45e26c50 Rename workflow job to Build SDL UI 2023-12-05 12:10:34 -06:00
Thomas Harte
40de0189d9 Add some notes to self (now and future). 2023-12-05 12:50:53 -05:00
Thomas Harte
7ca9a0841f Add a text search to recognise common boot sectors. 2023-12-05 12:24:53 -05:00
Ryan Carsten Schmidt
01cf7462d5 Disk II: Don't overwrite data bus when not asked to
Return DidNotLoad rather than 0xff from read_address on odd-numbered
addresses so that the data bus is not overwritten with 0xff on those
accesses.
2023-12-05 10:03:52 -06:00
Thomas Harte
2d75fbe1bf Add nonfunctional FAT12 analyser. 2023-12-05 10:46:06 -05:00
Thomas Harte
e9420fc48d
Merge pull request #1245 from TomHarte/MDANoCursor
MDA: implement no cursor, blink attribute.
2023-12-04 22:10:12 -05:00
Thomas Harte
9601c69e12 Implement blinking text. 2023-12-04 22:02:38 -05:00
Thomas Harte
790e744bde
Merge pull request #1239 from ryandesign/sense-write-protect
Fix Disk II sense-write-protect clocking preference
2023-12-04 21:47:26 -05:00
Thomas Harte
9f65587a1d Correct scan status scaling; rearrange FDC marginally. 2023-12-04 21:46:03 -05:00
Thomas Harte
b0d1dedb65 Support MDA control: display enable. 2023-12-04 16:34:46 -05:00
Thomas Harte
8103f8e682 Switch interpretation to support cursor on/off. 2023-12-04 15:54:56 -05:00
Thomas Harte
3523278057
Merge pull request #1243 from TomHarte/FDCInfiniteLoop
Avoid potential FDC infinite loop; clear cache on disk change.
2023-12-04 13:03:42 -05:00
Thomas Harte
bf8a4b7efe Ensure sector cache is cleared upon disk change. 2023-12-04 12:28:29 -05:00
Thomas Harte
edef0732ac Avoid potential infinite read loops. 2023-12-04 12:19:21 -05:00
Thomas Harte
9cbc991510
Merge pull request #1240 from ryandesign/patch-1
Remove invalid uef.gz file type from Info.plist
2023-12-04 12:12:27 -05:00
Thomas Harte
d476a17275
Merge pull request #1241 from ryandesign/patch-2
Fix typos in comments
2023-12-04 12:12:16 -05:00
Ryan Carsten Schmidt
896632b9b6
Fix typos in comments 2023-12-04 10:39:03 -06:00
Ryan Carsten Schmidt
5ccd232541
Remove invalid uef.gz file type from Info.plist
Closes #1194
2023-12-04 10:25:35 -06:00
Thomas Harte
9b23984d35
Merge pull request #1238 from TomHarte/MissingIncludes
Add 6845/MDA cursor.
2023-12-04 10:36:44 -05:00
Ryan Carsten Schmidt
b91a791e01 Fix Disk II sense-write-protect clocking preference
Ensure we're actually in the sense-write-protect loop before deciding
that we don't need to process anymore.

Closes #1218
2023-12-04 09:19:52 -06:00
Thomas Harte
5845ce0a39 Ameliorate for race condition. 2023-12-04 09:56:06 -05:00
Thomas Harte
646c6b08f7 Make cursor blink. 2023-12-04 09:52:46 -05:00
Thomas Harte
0d7646d42a Add a cursor-type template parameter. 2023-12-04 09:45:32 -05:00
Ryan Carsten Schmidt
ab608178f3 Consider Disk II state machine state C to be a NOP
Continuation of #1224
2023-12-04 08:13:32 -06:00
Thomas Harte
606a04b0b8
Merge pull request #1236 from TomHarte/MissingIncludes
Add missing <array> #includes
2023-12-03 18:07:35 -05:00
Thomas Harte
15868eea24 Merge branch 'master' into MissingIncludes 2023-12-03 18:07:11 -05:00
Thomas Harte
881f9bc824
Merge pull request #1235 from TomHarte/MissingKeys
Add missing key mappings, queue, cursor
2023-12-03 18:06:53 -05:00
Thomas Harte
37c46d579d Add missing array imports. 2023-12-03 18:06:09 -05:00
Thomas Harte
5d8666b837 Enable the cursor signal; no blink action yet. 2023-12-03 17:57:19 -05:00
Thomas Harte
4957ae7de1 Support cursor at point of output. 2023-12-02 22:44:26 -05:00
Thomas Harte
e77f4457c2 Map various missing keys. 2023-12-02 22:40:05 -05:00
Thomas Harte
c6b989d85b Add an input queue, to avoid key drops. 2023-12-02 22:29:49 -05:00
Thomas Harte
41bd5298b7 Signal only changes in modifiers. 2023-12-02 22:25:19 -05:00
Thomas Harte
596267f62d
Merge pull request #1232 from TomHarte/8237TC
Improves 8237 TC/EOP support enough for some multisector reads
2023-12-02 22:24:58 -05:00
Thomas Harte
92913b7455 Fix mapping of Z. 2023-12-02 18:46:22 -05:00
Thomas Harte
208846a166 Attempt proper EOP semantics; multisector reads. 2023-12-02 18:38:26 -05:00
Thomas Harte
c31ee968df TC: start tending towards meaning. 2023-12-02 15:24:47 -05:00
Thomas Harte
ad9e0b664a
Merge pull request #1231 from TomHarte/DiskClassification
Improve format support; log more.
2023-12-02 15:11:24 -05:00
Thomas Harte
ef134e13a1
Merge pull request #1230 from TomHarte/Warnings
Avoid illegal reads in Enterprise Nick
2023-12-02 13:29:12 -05:00
Thomas Harte
1b7e109047 Remove nonsense comment. 2023-12-02 13:25:08 -05:00
Thomas Harte
6c10611150 Avoid potential out-of-bounds read. 2023-12-02 13:23:48 -05:00
Thomas Harte
0bae14be8f
Merge pull request #1229 from TomHarte/DiskClassification
Appropriately route 180kb non-FAT12 PC booters.
2023-12-02 10:42:51 -05:00
Thomas Harte
dde58faaf1 Add additional 8-sector format. 2023-12-02 00:00:57 -05:00
Thomas Harte
aa15fd1fff Comment more. 2023-12-02 00:00:44 -05:00
Thomas Harte
691d1cce9e Simplify and fix track caching. 2023-12-01 23:35:11 -05:00
Thomas Harte
7072a1661c Flag floppy as present. 2023-12-01 22:44:21 -05:00
Thomas Harte
ebe1d53220 Expand range of recognised formats. 2023-12-01 22:44:13 -05:00
Thomas Harte
bc89cb7d06 Hack attack: ignore TC. 2023-12-01 17:30:32 -05:00
Thomas Harte
b16e3de170 Accept what look like raw booters. 2023-12-01 17:23:13 -05:00
Thomas Harte
5693b3add3
Merge pull request #1228 from TomHarte/PCDiskImages 2023-12-01 16:11:01 -05:00
Thomas Harte
f50c45cc1a Treat 'invalid' as a silent failure. 2023-12-01 15:35:51 -05:00
Thomas Harte
33a0c40c02 Support HLT. 2023-12-01 13:15:01 -05:00
Thomas Harte
365b62b4a7 Add TODO. 2023-12-01 09:50:11 -05:00
Thomas Harte
4d1e976b55 Flag drive as interrupting. 2023-12-01 09:49:50 -05:00
Thomas Harte
4429448815 Make some effort at terminating appropriate if no sector. 2023-12-01 09:47:52 -05:00
Thomas Harte
88e67d9ad6 Return some status after reading. Seemingly wrong. 2023-12-01 09:37:30 -05:00
Thomas Harte
d101483714 Hack in enough that disk contents end up in RAM. 2023-12-01 09:34:31 -05:00
Thomas Harte
5feac8ef14 Avoid duplicate symbol. 2023-12-01 07:36:12 -05:00
Thomas Harte
a96cb1ebd6 Decommit debugging hook. 2023-12-01 06:46:00 -05:00
Thomas Harte
2da2240d34 Remove errant break. 2023-12-01 06:45:29 -05:00
Thomas Harte
ef37b09a78 Seed all transfers as complete. 2023-11-30 22:47:38 -05:00
Thomas Harte
9fc0d411fd Further flesh out DMA, breaking POST. 2023-11-30 22:45:40 -05:00
Thomas Harte
0dc44e8efd Adjust audio formulation.
Probably still not right, but less wrong with the current input.
2023-11-30 14:37:13 -05:00
Thomas Harte
c076636df1 Fix typo. 2023-11-30 14:26:26 -05:00
Thomas Harte
c397da3e5a Add TODOs. 2023-11-30 12:52:08 -05:00
Thomas Harte
5f6bbec741 Capture DMA high bytes, add actor for accesses. 2023-11-30 12:47:50 -05:00
Thomas Harte
ec39c4a5f0
Merge pull request #1225 from TomHarte/PCDiskImages
Add enough for FAT12 IMA images to get to the PC.
2023-11-29 16:11:33 -05:00
Thomas Harte
edc36bf3f4 Include the PC target and analyser. 2023-11-29 15:59:42 -05:00
Thomas Harte
f7acecfbff Protect set_geometry. 2023-11-29 15:56:07 -05:00
Thomas Harte
07b32844af Remove outdated comment. 2023-11-29 15:55:51 -05:00
Thomas Harte
7f0bb716f7 Grab sector contents, ready for more FDC work. 2023-11-29 15:55:37 -05:00
Thomas Harte
f25aaf2bb3 Adjust 65c02 STA abs,x behaviour. 2023-11-29 15:32:02 -05:00
Thomas Harte
b7d3633b38 Log slightly more. 2023-11-29 15:30:47 -05:00
Thomas Harte
05504c8389 Accept and keep hold of disk images. 2023-11-29 15:20:14 -05:00
Thomas Harte
ddf38595ff Add enough for FAT12 IMA images to get to the PC. 2023-11-29 14:54:33 -05:00
Thomas Harte
66b95a8b54
Merge pull request #1217 from TomHarte/PCFDC
Sketch the outline of a high-level emulation of the PC FDC
2023-11-29 12:48:55 -05:00
Thomas Harte
ab586b9965
Merge pull request #1224 from ryandesign/patch-3
Handle C, E, F operations in Disk II state machine
2023-11-29 12:48:39 -05:00
Thomas Harte
cd2567d868
Merge pull request #1222 from ryandesign/patch-1
Fix typo in comment in AppleDSK.hpp
2023-11-29 12:48:10 -05:00
Thomas Harte
c07ae43980
Merge pull request #1221 from TomHarte/More68000TemplateActions
Enable further compile-time optimisations.
2023-11-29 12:47:48 -05:00
Thomas Harte
4e10ef2816
Merge pull request #1223 from ryandesign/patch-2
Fix typo in comment in WOZ.cpp
2023-11-29 12:40:22 -05:00
Thomas Harte
8d01829fa7 Adopt PC-style naming, limit to one drive. 2023-11-29 11:35:21 -05:00
Thomas Harte
be842ee2f1 Add drive indicator lights. 2023-11-29 11:31:37 -05:00
Thomas Harte
e034daa6c8 Capture motor state. 2023-11-29 09:52:16 -05:00
Thomas Harte
ce4bcf9064 Improve comment. 2023-11-29 09:50:08 -05:00
Thomas Harte
a992ae37b1 Mildly rearrange, to match enum order. 2023-11-29 09:49:15 -05:00
Thomas Harte
439104c73a Add missing space. 2023-11-29 09:49:05 -05:00
Thomas Harte
fbbe3ab7f1 Include seek ended flag. 2023-11-29 09:45:45 -05:00
Thomas Harte
6e2e67fd46 Sculpt out enough to get to a read data command. 2023-11-29 09:42:43 -05:00
Ryan Carsten Schmidt
3293ab48ce
Handle C, E, F operations in Disk II state machine
This shouldn't matter since these operations are not requested by the
state machine but this is what those operations should do according to
Understanding the Apple II, Table 9.3, page 9-15.
2023-11-29 05:50:20 -06:00
Ryan Carsten Schmidt
2e314e7a08
Fix typo in comment in WOZ.cpp 2023-11-29 03:42:39 -06:00
Thomas Harte
3827a084ad Code to GlaBIOS expectations. 2023-11-28 23:18:22 -05:00
Ryan Carsten Schmidt
afc62f3d94
Fix typo in comment in AppleDSK.hpp 2023-11-28 22:09:35 -06:00
Thomas Harte
301442a0b1 Fix meaning of flag, use correctly. 2023-11-28 22:34:34 -05:00
Thomas Harte
dd4bcf68bf Load up on debugging logs. 2023-11-28 15:09:57 -05:00
Thomas Harte
b860fba0a3 Make an attempt at providing varied sense interrupt statuses. 2023-11-28 14:12:39 -05:00
Thomas Harte
7171e24ccf Enable further compile-time optimisations. 2023-11-28 13:50:53 -05:00
Thomas Harte
c19c356c10 Add disabled longer serialisation. 2023-11-27 23:23:00 -05:00
Thomas Harte
8fec9bef11 Attempt IRQ logic. 2023-11-27 23:16:24 -05:00
Thomas Harte
bffe3ffa25 Add an 8272 results phase. 2023-11-27 23:05:37 -05:00
Thomas Harte
993366ac5a Merge branch 'master' into PCFDC 2023-11-27 22:16:30 -05:00
Thomas Harte
b07cc5c2ec
Merge pull request #1219 from TomHarte/68000TemplatedPerform
Sometimes provide 68000 bus operations at compile time.
2023-11-27 21:54:24 -05:00
Thomas Harte
36a4629ce0 Explain new semantics. 2023-11-27 21:49:57 -05:00
Thomas Harte
87eec47b79 Mildly reduce cost of 8-byte ROM overlay. 2023-11-27 15:48:30 -05:00
Thomas Harte
2a0375e9c2 Mildly adjust layout of inner loop. 2023-11-27 15:16:22 -05:00
Thomas Harte
032eeb4757 Eliminate runtime switch. 2023-11-27 14:57:41 -05:00
Thomas Harte
5c7f94d2ef Introduce the possibility of operation type as a template parameter.
It's already proven possible to provide this for instruction fetch, so I think it'll immediately be a win. But more importantly it opens a path forwards for further improvement.
2023-11-27 11:48:34 -05:00
Thomas Harte
291723e85e Insert notes to self, trying to tie down FloppyController interface. 2023-11-27 10:27:36 -05:00
Thomas Harte
d2203484cc Avoid name duplication. 2023-11-26 15:29:08 -05:00
Thomas Harte
003c494aac Factor out a large number of status-related facts. 2023-11-26 15:04:10 -05:00
Thomas Harte
a6a464c240 Add printed TODO. 2023-11-25 21:40:13 -05:00
Thomas Harte
9bd75464b5 Proceed to receiving a sense interrupt status. 2023-11-25 18:15:37 -05:00
Thomas Harte
0bb048e24b Start formalising/extracting 8272 status. 2023-11-25 18:10:49 -05:00
Thomas Harte
8c70317d31 Introduce interrupt. 2023-11-24 23:06:52 -05:00
Thomas Harte
dd135bf3fe Start experimenting with a possible end-of-reset interrupt? 2023-11-24 22:41:33 -05:00
Thomas Harte
2efb5236f7 Add an agent for floppy control. 2023-11-24 22:19:39 -05:00
Thomas Harte
af70c8847d Factor out the stuff of accumulating and dissecting commands. 2023-11-24 18:24:58 -05:00
Thomas Harte
d5c30e3175 Add enough keyboard support to be able to bypass the initial FDC BIOS failure report. 2023-11-24 13:38:06 -05:00
Thomas Harte
ed31cfd80a
Merge pull request #1216 from TomHarte/ReduceNoise
Limit extraneous printing.
2023-11-23 23:05:46 -05:00
Thomas Harte
89423f28ef Limit extraneous printing. 2023-11-23 22:47:31 -05:00
Thomas Harte
593c32f621
Merge pull request #1215 from TomHarte/PCKeyboard
Attempt to implement the XT keyboard controller.
2023-11-23 22:26:09 -05:00
Thomas Harte
019d987623 Clear buffer on read. 2023-11-23 22:16:08 -05:00
Thomas Harte
7e8020df59 Avoid a spurious initial interrupt. 2023-11-23 22:15:20 -05:00
Thomas Harte
44d602e0f6 Seriously attempt a keyboard controller. 2023-11-23 22:10:51 -05:00
Thomas Harte
0674da0325 Flip IRQ priority. 2023-11-23 15:41:24 -05:00
Thomas Harte
113fc9f757 Add further TODO. 2023-11-23 15:29:43 -05:00
Thomas Harte
2c31452629 Add TODO, as exposition. 2023-11-23 15:19:31 -05:00
Thomas Harte
505df78108 Add column duplication, switch to green. 2023-11-23 15:18:28 -05:00
Thomas Harte
d92d0e87ac Honour MDA attributes. 2023-11-23 14:51:32 -05:00
Thomas Harte
df9e9c2c4d Start accumulating notes. 2023-11-22 15:21:45 -05:00
Thomas Harte
b3c07b76ee
Merge pull request #1214 from TomHarte/MDAOutput
Add basic MDA text output.
2023-11-22 15:04:21 -05:00
Thomas Harte
e0f72f2048 Tidy up. 2023-11-22 14:18:58 -05:00
Thomas Harte
825f3184eb Explain provenance. 2023-11-22 14:18:50 -05:00
Thomas Harte
a293a3a816 Document the future. 2023-11-22 14:14:53 -05:00
Thomas Harte
b22b489380 Mask into 4kb; I don't know whether hardware scrolling is in use. 2023-11-22 14:12:57 -05:00
Thomas Harte
231de8440e Add text display. 2023-11-22 14:11:22 -05:00
Thomas Harte
8993a9c4c1 Import MDA font. 2023-11-22 14:04:26 -05:00
Thomas Harte
381537fde9 Get as far as MDA being able to fetch. 2023-11-22 13:52:28 -05:00
Thomas Harte
f249e4ada6 Maintain an actual pixel buffer. 2023-11-22 13:40:50 -05:00
Thomas Harte
12179e486f Create a solid white rectangle. 2023-11-22 13:18:39 -05:00
Thomas Harte
80b2ccd418 Attempt to wire in a CRTC. 2023-11-22 12:53:09 -05:00
Thomas Harte
2af6259963
Merge pull request #1213 from TomHarte/PITClock
Standardise on the PIT clock as the definition of time.
2023-11-21 22:51:14 -05:00
Thomas Harte
24d0caf8e7 Fix Swift conditionality. 2023-11-21 22:48:26 -05:00
Thomas Harte
1828a10885 Use less branchy inner loop. 2023-11-21 22:42:53 -05:00
Thomas Harte
bcd4a2216a Improve clocking. 2023-11-21 22:36:11 -05:00
Thomas Harte
3da3401125 Attempt full audio output. 2023-11-21 22:28:33 -05:00
Thomas Harte
972d1d1ddd Add audio pipeline. 2023-11-21 22:11:32 -05:00
Thomas Harte
0344af986c Try to avoid having to edit this constantly. 2023-11-21 22:02:36 -05:00
Thomas Harte
6329a1208a Adopt PIT-centric timing. 2023-11-21 22:02:24 -05:00
Thomas Harte
c11d3b61d6
Merge pull request #1209 from TomHarte/SupportChipsAplenty
Add various other PC chips into the mix.
2023-11-21 21:53:29 -05:00
Thomas Harte
375a9f9ff5 Pull out the PIC, DMA. 2023-11-21 15:50:38 -05:00
Thomas Harte
a1e118a1ff Do some interrupt work. 2023-11-21 15:46:31 -05:00
Thomas Harte
83ca9b3af5 Hack in some MDA text logging. Boot seems to complete? 2023-11-21 11:37:36 -05:00
Thomas Harte
acdf32e820 Handle low/high switches. 2023-11-21 11:25:53 -05:00
Thomas Harte
931e6e7a56 Add, disable, logging detritus. 2023-11-21 11:19:47 -05:00
Thomas Harte
058080f6de Prove to my caveman self that no text is being written. 2023-11-20 23:11:27 -05:00
Thomas Harte
c4e9f75709 Edge towards but don't quite reach interrupt. 2023-11-20 22:52:20 -05:00
Thomas Harte
695282b838 PIT output now reaches the PIC. 2023-11-20 22:36:05 -05:00
Thomas Harte
f0e2ef5e28 Attempt to implement square-wave mode. 2023-11-20 22:19:18 -05:00
Thomas Harte
ee6012f6e9 Evict the PIT. 2023-11-20 19:00:16 -05:00
Thomas Harte
d3e90ce006 Capture some basics.
BIOS now seems to get as far as expecting channel 0 to trigger an interrupt, which never comes.
2023-11-20 15:36:52 -05:00
Thomas Harte
18ddc2c83a Route traffic. 2023-11-20 15:11:22 -05:00
Thomas Harte
abf0eead7a Add a functionless PIC. 2023-11-20 13:53:44 -05:00
Thomas Harte
a689f2b63e Relocate comment. 2023-11-20 12:22:30 -05:00
Thomas Harte
a3066fc040 Advance to the missing PIC. 2023-11-20 12:21:37 -05:00
Thomas Harte
7eed254de9 Bring an 8255 into the mix. 2023-11-20 12:13:42 -05:00
Thomas Harte
55f466f2fa Add enough of the DMA subsystem to trip over in PPI world. 2023-11-19 22:55:29 -05:00
Thomas Harte
119c83eb18 Fix field decoding. 2023-11-19 21:51:27 -05:00
Thomas Harte
4e077701c9 Exit without further modification upon latch. 2023-11-19 16:37:47 -05:00
Thomas Harte
a26bfd938e
Merge pull request #1210 from ryandesign/patch-1
Fix typos in Apple II ROM images readme.txt
2023-11-19 16:12:08 -05:00
Thomas Harte
8844812910 Merge branch 'SupportChipsAplenty' of github.com:TomHarte/CLK into SupportChipsAplenty 2023-11-19 16:08:38 -05:00
Thomas Harte
a8f1c72f5c Take a caveman run at debugging. 2023-11-19 16:05:44 -05:00
Thomas Harte
05e93f0eb3 Implementing counting for a couple of PIT modes. 2023-11-19 15:52:32 -05:00
Thomas Harte
af885ccf08 Decode PIT mode writes. 2023-11-19 15:01:21 -05:00
Thomas Harte
56aa9d101a Decode PIT mode writes. 2023-11-19 14:59:52 -05:00
Thomas Harte
2b69081fff Start sketching the PIT. 2023-11-19 07:15:30 -05:00
Ryan Carsten Schmidt
c0eed0fe78
Fix typos in Apple II ROM images readme.txt 2023-11-19 04:59:43 -06:00
Thomas Harte
a91449555f Add link for future self. 2023-11-17 17:38:17 -05:00
Thomas Harte
afc0ca3f1b Add XT roadmap. 2023-11-17 17:35:11 -05:00
Thomas Harte
9bc33c716e
Merge pull request #1208 from TomHarte/80286BIOS
Add an 80286 BIOS, for later.
2023-11-17 17:19:57 -05:00
Thomas Harte
f0ac62566c Add an 80286 BIOS, for later. 2023-11-17 17:15:57 -05:00
Thomas Harte
3843102609
Merge pull request #1207 from TomHarte/PhoneyPC
Start sketching out a PC compatible machine.
2023-11-17 17:12:10 -05:00
Thomas Harte
d202cfc2ca Add TODO. 2023-11-17 17:09:20 -05:00
Thomas Harte
ec2d878e3f End run around the template.
I have yet to get any insight whatsoever on the reason for GCC's failure here and won't have access to a suitable test
machine for a while so all I have for testing is the arduous CI cycle.
2023-11-17 17:02:46 -05:00
Thomas Harte
626e4fe6b3 Just pull requests will do. 2023-11-17 10:45:32 -05:00
Thomas Harte
ac12b256d4 Tweak syntax. 2023-11-17 10:44:52 -05:00
Thomas Harte
f4b1279342 Try a different GCC version. 2023-11-17 10:43:50 -05:00
Thomas Harte
a0ca5e6cdc Remove outdated comment. 2023-11-17 10:38:11 -05:00
Thomas Harte
83c8f9996e Switch back to the natural type. 2023-11-17 10:27:38 -05:00
Thomas Harte
f2fdfe86ec Reduce repetition. 2023-11-17 09:13:45 -05:00
Thomas Harte
3f27338b2c New guess: the definition of size_t varies? 2023-11-16 23:46:22 -05:00
Thomas Harte
fbe02e3ad5 Randomly try a different explicit instantiation. 2023-11-16 23:37:37 -05:00
Thomas Harte
effddcaf65 Hide PC option by default. 2023-11-16 23:33:42 -05:00
Thomas Harte
4b730c26d0 Satisfy GCC warning. 2023-11-16 23:31:51 -05:00
Thomas Harte
8af173c4bc Remove hopeful hit. 2023-11-16 15:48:27 -05:00
Thomas Harte
e1541543c3 Play hit and hope. 2023-11-16 15:40:47 -05:00
Thomas Harte
33486e69bf Remove CI trap. 2023-11-16 15:30:43 -05:00
Thomas Harte
1c7bb6d759 Add CI diagnosis trap. 2023-11-16 15:25:42 -05:00
Thomas Harte
99e7de5a8b Colocate memory. 2023-11-16 15:24:35 -05:00
Thomas Harte
095359017f Log first unhandled port. 2023-11-16 13:02:35 -05:00
Thomas Harte
25f0a373f3 Don't sign-extend ports (!). 2023-11-16 11:17:12 -05:00
Thomas Harte
233ec7b818 Soften some warnings. 2023-11-16 10:57:17 -05:00
Thomas Harte
832e31f7e5 Add note to self. 2023-11-16 10:34:24 -05:00
Thomas Harte
164a7fe848 Log port IO. 2023-11-16 06:48:24 -05:00
Thomas Harte
62b6219763 Install BIOS, albeit in writeable storage. 2023-11-15 22:02:53 -05:00
Thomas Harte
2bc9dfbef9 Albeit with no BIOS present, execute. 2023-11-15 16:10:37 -05:00
Thomas Harte
3b84299a05 Edge closer to PCCompatible doing _something_. 2023-11-15 15:58:49 -05:00
Thomas Harte
6f48ffba16 Add enough of a ScanProducer to run. 2023-11-15 14:30:30 -05:00
Thomas Harte
1a3b2b0620 Add necessary wiring for File -> New... 2023-11-15 14:27:04 -05:00
Thomas Harte
af7069ac21 Include and fetch a BIOS. 2023-11-15 11:32:23 -05:00
Thomas Harte
7323af0b41 Avoid shadowing template parameter. 2023-11-15 11:10:01 -05:00
Thomas Harte
1676ed9850 Add to SDL and Qt builds. 2023-11-15 11:02:44 -05:00
Thomas Harte
e927fd00d8 Do just enough to include x86 code in the main build. 2023-11-15 11:01:28 -05:00
Thomas Harte
70a4d59517
Merge pull request #1205 from TomHarte/80286Preparation
Clear a path towards implementing the 80286
2023-11-15 10:41:26 -05:00
Thomas Harte
f83d2a8740 Take a swing at ENTER. 2023-11-14 16:23:24 -05:00
Thomas Harte
a22ac2f88b Move towards privacy. 2023-11-14 11:39:44 -05:00
Thomas Harte
aafa7de536 Implement LEAVE, almost. 2023-11-14 11:39:36 -05:00
Thomas Harte
2533fd2da9 Fix segment comparisons. 2023-11-14 11:14:28 -05:00
Thomas Harte
29169ffed7
Merge pull request #1203 from ryandesign/apple-ii-floating-bus-3
Fix Apple II/II+/IIe floating bus first eight non-hbl vbl bytes
2023-11-14 10:59:29 -05:00
Thomas Harte
d2187a0442
Merge pull request #1206 from ryandesign/gui-wording
Minor Mac UI wording changes
2023-11-14 10:57:21 -05:00
Thomas Harte
ac826f90c3 Formalise a separate manager of segments. 2023-11-14 10:56:00 -05:00
Thomas Harte
6c405680f2 Implement PUSHA, POPA. 2023-11-14 10:42:06 -05:00
Ryan Carsten Schmidt
39df6daf3e Add ellipsis at end of New menu item
Menu items that elicit a dialog box in which further choices must be
made should end with an ellipsis.
2023-11-14 02:13:23 -06:00
Ryan Carsten Schmidt
480b5bef95 Add period at end of sentence 2023-11-14 02:11:00 -06:00
Ryan Carsten Schmidt
6bb85c98ba Change "Exit" button to "Quit" 2023-11-14 02:10:55 -06:00
Thomas Harte
1552500b10 Implement BOUND. 2023-11-13 22:33:46 -05:00
Thomas Harte
60cec9fc67 Expand commentary. 2023-11-13 11:45:17 -05:00
Ryan Carsten Schmidt
234292f163 Fix Apple II/II+/IIe first eight non-hbl vbl bytes
Closes #1196
2023-11-13 00:51:34 -06:00
Thomas Harte
03a2d4df80
Merge pull request #1202 from TomHarte/8088SegmentRegisters
Add means for tracking segment register changes.
2023-11-10 23:07:37 -05:00
Thomas Harte
08d9cc3bd3 Restore permitted IDIV miss. 2023-11-10 23:02:32 -05:00
Thomas Harte
47fc276afc Add note to future self. 2023-11-10 23:01:46 -05:00
Thomas Harte
3a782faaf3 Ensure shoutouts upon LDS, LES and any far jump/call/int. 2023-11-10 22:58:59 -05:00
Thomas Harte
19a61f867f Eliminate final misuse of 'selector'. 2023-11-10 22:56:00 -05:00
Thomas Harte
2551e73be1 Fully test segment registers. 2023-11-10 22:54:10 -05:00
Thomas Harte
7abd4d9b38 Fix AAA/AAS carry outcome. 2023-11-10 22:47:50 -05:00
Thomas Harte
e61dc0466f Add callout for tracking segment register changes. 2023-11-10 22:22:32 -05:00
Thomas Harte
79b126e6bb Add route for tracking segment register changes. 2023-11-10 22:11:52 -05:00
Thomas Harte
a230274306
Merge pull request #1201 from TomHarte/IDIVYuck
Improve IDIV marginally; require acceptable failures to have a reason.
2023-11-09 13:38:48 -05:00
Thomas Harte
e78e5c8101 Add remaining acceptable error cases. 2023-11-09 12:26:40 -05:00
Thomas Harte
ed3922e458 Switch to accepting failures only with a reason. 2023-11-09 11:55:36 -05:00
Thomas Harte
800c76a4fe Capture and respond to IDIV_REP. 2023-11-09 11:55:04 -05:00
Thomas Harte
bf179e8933
Merge pull request #1200 from TomHarte/MoreDAA
Correct 8086 DAA and DAS; unify those and AAA/AAS.
2023-11-08 22:45:26 -05:00
Thomas Harte
9e61d3e8cf Combine AAA and AAS. 2023-11-08 22:38:52 -05:00
Thomas Harte
5f1ea6c04c Unify AAA and AAS. 2023-11-08 22:30:39 -05:00
Thomas Harte
8d2a2bcf4a Unify DAA and DAS. 2023-11-08 22:26:48 -05:00
Thomas Harte
6b666bc92a Simplify DAS. 2023-11-08 22:19:51 -05:00
Thomas Harte
38933aa079 Bring fully into 8086 conformance. 2023-11-08 22:16:12 -05:00
Thomas Harte
502b9d2023 Simplify implementation of DAA. 2023-11-08 22:06:58 -05:00
Thomas Harte
da7582d4b5
Merge pull request #1199 from TomHarte/8088Groupings
Split up the ungainly PerformImplementation.hpp.
2023-11-08 19:02:59 -05:00
Thomas Harte
ec4a60b7da Further universalise function layout. 2023-11-08 11:30:33 -05:00
Thomas Harte
d7bb1a9ee1 Tidy up and comment a little further. 2023-11-08 11:23:21 -05:00
Thomas Harte
9566a8de67 Split up the ungainly PerformImplementation.hpp. 2023-11-08 10:52:36 -05:00
Thomas Harte
0fee3ff92c
Merge pull request #1198 from TomHarte/DirectWrite
Add compiler assistance on access types
2023-11-07 22:23:41 -05:00
Thomas Harte
b927cf4159 Resolve new decoding errors. 2023-11-07 22:08:44 -05:00
Thomas Harte
f608153c1a Don't bother prepropulating for writes. 2023-11-07 14:38:23 -05:00
Thomas Harte
413e7b7de1 Switch Memory to using accessors. 2023-11-07 14:03:20 -05:00
Thomas Harte
91b7d55871 Get strict about writeables. 2023-11-07 10:13:18 -05:00
Thomas Harte
e56e49a318 Fix SUB/SBB writes. 2023-11-07 10:09:04 -05:00
Thomas Harte
0262875088 Claw back to building. 2023-11-07 09:58:42 -05:00
Thomas Harte
2bed2c2c5c Further simplify syntax. 2023-11-07 09:14:42 -05:00
Thomas Harte
2af774601f Temporarily disentangle Memory and access internals; start to be overt in PerformImplementation. 2023-11-06 16:04:31 -05:00
Thomas Harte
797c9fe129 Temporarily avoid use of Writeable. 2023-11-05 21:47:52 -05:00
Thomas Harte
009915f4de Start promotion of ReturnType. 2023-11-05 21:42:22 -05:00
Thomas Harte
f96c33102a Add documentation. 2023-11-04 22:22:50 -04:00
Thomas Harte
5739862dbb Add specific entryway for preauthorised writes. 2023-11-03 15:36:30 -04:00
Thomas Harte
7f4fa914dd
Merge pull request #1195 from TomHarte/8088Flags
Commute: Status -> Flags as per usual x86 naming.
2023-11-02 17:05:13 -04:00
Thomas Harte
ebdf10525c Fix parameter case. 2023-11-02 17:00:22 -04:00
Thomas Harte
83850d7596 Commute: Status -> Flags as per usual x86 naming. 2023-11-02 16:55:38 -04:00
Thomas Harte
18820644b0
Merge pull request #1193 from TomHarte/8088Intentions
Work towards x86 access violations.
2023-11-02 16:46:36 -04:00
Thomas Harte
770803b073 Be more careful as to authorisation. 2023-11-02 15:37:59 -04:00
Thomas Harte
8d0deeb20e Clean up Memory. 2023-11-02 14:25:13 -04:00
Thomas Harte
e4fdf09149 Fix PUSH SP, far call. Further simplify FlowController. 2023-11-01 23:39:52 -04:00
Thomas Harte
acb55aa4e2 Subsume repetition of arguments into a single context.
Albeit that it (temporarily?) loses some context used during test validation.
2023-11-01 17:03:23 -04:00
Thomas Harte
bc095bb9ce Slim down the flow controller. 2023-11-01 14:49:30 -04:00
Thomas Harte
097b328075 Split the preauthorised tracks. 2023-11-01 14:31:42 -04:00
Thomas Harte
ef83ac855a Fix spelling of Preauthorised, think further on return types. 2023-11-01 14:11:10 -04:00
Thomas Harte
78df0d19e4 Start experimenting with varying return types. 2023-11-01 10:03:31 -04:00
Thomas Harte
430c60111e CMP doesn't write. 2023-10-31 22:42:39 -04:00
Thomas Harte
2432396eaa Fix SETMOC. 2023-10-31 22:04:26 -04:00
Thomas Harte
da2aea94e3 Fix CMPS. 2023-10-31 21:58:32 -04:00
Thomas Harte
9538491ee9 Fix pushes and pops. 2023-10-31 21:55:30 -04:00
Thomas Harte
8be03be529 Add test of ::Write mode. 2023-10-31 20:28:37 -04:00
Thomas Harte
724e08d4f1 Update commentary on semantics. 2023-10-31 15:09:21 -04:00
Thomas Harte
1d479ec2d7 Ensure that reads can only read, accept that source is sometimes written to. E.g. XCHG. 2023-10-31 15:06:19 -04:00
Thomas Harte
02af08ffd2 Fix counts. 2023-10-30 12:32:44 -04:00
Thomas Harte
3dc9b625a1
Partly dodge British/American spelling issue; slightly tighten otherwise. 2023-10-30 11:43:07 -04:00
Thomas Harte
444c5b94b9 Add summary of accepted failures. 2023-10-29 16:55:07 -04:00
Thomas Harte
1cd1bbd26c Make a first pass of access types. 2023-10-29 16:19:10 -04:00
Thomas Harte
8ecc9835f8 Merge branch 'master' into 8088Intentions 2023-10-29 16:10:21 -04:00
Thomas Harte
39e803aa71 Commit updated macOS version. 2023-10-29 14:47:09 -04:00
Thomas Harte
7a886f938a Propagate access types, even if incorrect. 2023-10-29 14:33:39 -04:00
Thomas Harte
8153cec455 Merge branch 'master' into 8088Intentions 2023-10-28 15:57:05 -04:00
Thomas Harte
3ee0fcaaeb Hatch an appropriate enum. 2023-10-28 15:56:37 -04:00
Thomas Harte
b98f54545f
Merge pull request #1182 from ryandesign/apple-ii-floating-bus-2
Fix Apple II/II+/IIe floating bus issues
2023-10-28 15:46:35 -04:00
Thomas Harte
0a5c24be19
Merge pull request #1192 from ryandesign/ryandesign-rpath
Fix LD_RUNPATH_SEARCH_PATHS for High Sierra
2023-10-28 15:41:10 -04:00
Ryan Carsten Schmidt
764a7b60f4 Fix LD_RUNPATH_SEARCH_PATHS for High Sierra
See #1118
See #1143
Closes #1191
2023-10-28 08:42:26 -05:00
Thomas Harte
b9891d25ee
Merge pull request #1184 from TomHarte/CompactInstruction
Compact normalised x86 instructions.
2023-10-27 16:40:11 -04:00
Thomas Harte
6da0add100 Permit 1654 failures, the current amount. 2023-10-27 16:30:30 -04:00
Thomas Harte
f9d1a4dd8f Add Repetition::Rep to unify repeat logic. 2023-10-27 16:27:24 -04:00
Thomas Harte
66cee41b99 Fix port. 2023-10-27 14:04:23 -04:00
Thomas Harte
a30cad5e8a Rearrange class for clarity. 2023-10-27 14:02:53 -04:00
Thomas Harte
f9d98ed219 Fix packing_size. 2023-10-27 13:46:14 -04:00
Thomas Harte
2d70b44303 Boil down segment ahead of time. 2023-10-27 12:54:42 -04:00
Thomas Harte
5b0d2d754f Update comments. 2023-10-26 23:27:56 -04:00
Thomas Harte
11b032fb06 Eliminate length extension. 2023-10-26 23:19:31 -04:00
Thomas Harte
8e35a56ff7 Include repetition in operation; simplify Instruction constructor. 2023-10-26 23:08:07 -04:00
Thomas Harte
167b52c4ff
Merge pull request #1171 from TomHarte/8088Execution
Add first seeds of x86 execution.
2023-10-26 22:20:38 -04:00
Thomas Harte
dafb134cdc Eliminate dead detour. 2023-10-25 22:27:44 -04:00
Thomas Harte
6ac66dad0c Remove stale notes. 2023-10-25 22:22:20 -04:00
Thomas Harte
de230fb6be Resolve for work factored out. 2023-10-25 22:21:23 -04:00
Thomas Harte
29a921f764 Remove TODO, add exposition. 2023-10-25 16:15:08 -04:00
Thomas Harte
a2826cdee5 Propagate address size. 2023-10-25 16:00:01 -04:00
Thomas Harte
3b62638b30 Remove dead DataPointerResolver and extra-conditional version of source(). 2023-10-25 14:43:58 -04:00
Thomas Harte
0c09c14baa Incorporate instruction length into offsets. 2023-10-25 13:02:43 -04:00
Thomas Harte
6dd5628dd6 Provide full pair for string conversion. 2023-10-25 11:21:11 -04:00
Thomas Harte
6cecb84878 Add #include. 2023-10-25 09:09:51 -04:00
Ryan Schmidt
18ed36d090 Update get_last_read_value source documentation 2023-10-25 03:25:52 -05:00
Ryan Schmidt
c206c7e2cb Fix Apple II/II+ text/lores hbl read addresses
Closes #1181
2023-10-25 03:25:48 -05:00
Ryan Schmidt
98730f1f90 Fix Apple II/II+/IIe first hbl byte read addresses
Closes #1180
2023-10-25 03:21:22 -05:00
Ryan Schmidt
c272632b5a Fix Apple II/II+/IIe hbl row < 64 read addresses
See #1180
2023-10-25 03:21:17 -05:00
Ryan Schmidt
577b01e80b Fix Apple II/II+/IIe vbl rows read addresses
See #1180
2023-10-25 03:21:06 -05:00
Thomas Harte
239ce75db6 Fix IN and OUT conversion. 2023-10-24 22:35:13 -04:00
Thomas Harte
cc9e8117ab Add note. 2023-10-24 16:43:22 -04:00
Thomas Harte
26c2a29b99 Fix int3 mapping. 2023-10-24 15:09:25 -04:00
Thomas Harte
e36274e5c2 Add segment prefix for MOVS, LODS, etc. 2023-10-24 15:07:53 -04:00
Thomas Harte
0e027445d4 Don't offer repne for reps; print far CALLs and JMPs as h-suffix rather than 0x prefix. 2023-10-24 11:01:38 -04:00
Thomas Harte
20d7079006 Start adaptation to new test disassembly form. 2023-10-23 16:37:27 -04:00
Thomas Harte
49d87c9f27 Fix 16-bit accesses that overlap memory's end.
1654 failures remaining.
2023-10-23 10:41:58 -04:00
Thomas Harte
7a4d74b8e4 Correct copy and paste error: 0x27 is DAA. 2023-10-23 10:07:57 -04:00
Thomas Harte
82c66e7433 Fix far jump with immediate operand.
1655 failures remaining.
2023-10-23 10:07:19 -04:00
Thomas Harte
569cf8bf34 Focus on remaining files with issues. 2023-10-23 10:02:13 -04:00
Thomas Harte
817a30332c Take a swing at LEA r16, r16. 2023-10-22 22:15:27 -04:00
Thomas Harte
599c123b36 Reenable all tests. 2023-10-21 22:55:10 -04:00
Thomas Harte
e3cdf113d1 Implement INS, OUTS. 2023-10-21 22:52:50 -04:00
Thomas Harte
aade91f043 Implement IN, OUT. 2023-10-21 22:37:25 -04:00
Thomas Harte
bf6fd8e5e4 Shuffle down TODO. 2023-10-20 21:57:03 -04:00
Thomas Harte
c2ebbe5ad9 Implement STOS with one failure. 2023-10-20 21:54:30 -04:00
Thomas Harte
4efc181f07 Fix memory handler, STOS. 2023-10-20 21:49:34 -04:00
Thomas Harte
93e90b09a0 Implement MOVS, STOS, revealing an issue in the memory handler. 2023-10-20 21:46:47 -04:00
Thomas Harte
dab3dcaafb Fix LODS: REP is not REPE. 2023-10-20 21:36:50 -04:00
Thomas Harte
8caad8b99d Document slightly. 2023-10-20 17:25:27 -04:00
Thomas Harte
bee094eba1 Add LODS; somehow manage to fail some of its tests. 2023-10-20 17:13:56 -04:00
Thomas Harte
bcebb2e520 Further reduce repetition overhead. 2023-10-20 17:08:11 -04:00
Thomas Harte
0f5e0e17a4 Fix address manipulation. 2023-10-20 17:03:23 -04:00
Thomas Harte
49ac2d8e0c Improve error reporting, remove some dead TODOs. 2023-10-20 17:00:32 -04:00
Thomas Harte
a71db54212 Simplify flow slightly; uncover issues in CMPSW. 2023-10-20 16:52:47 -04:00
Thomas Harte
efb854ddfa Fix repetition. Sufficient for tests. 2023-10-19 14:40:03 -04:00
Thomas Harte
387a952328 Reduce repetition. 2023-10-19 14:21:08 -04:00
Thomas Harte
f715cd89a9 Attempt CMPS, changing storage of direction; add flags check. 2023-10-19 14:07:59 -04:00
Thomas Harte
14851f407c
Merge pull request #1177 from omimakhare/patch-1
Remove Typo
2023-10-18 22:52:36 -04:00
Thomas Harte
617be7cba7 Implement PUSHes and POPs. 2023-10-18 15:59:39 -04:00
Thomas Harte
02cea3047e Implement LOOP, LOOPE, LOOPNE. 2023-10-18 14:04:21 -04:00
Thomas Harte
a8c7871b0c Implement JCXZ. 2023-10-18 13:20:28 -04:00
Thomas Harte
90f49a6e73 Implement JMP. 2023-10-18 13:15:00 -04:00
OMKAR MAKHARE
47c535414b
Update README.md
Corrected "generlaly" to "generally" in the README.md file.
2023-10-17 23:35:19 +05:30
Thomas Harte
440f3bdb10 Further improve error reporting. 2023-10-16 15:47:06 -04:00
Thomas Harte
89743f0ba0 Implement RET, IRET. 2023-10-16 15:40:24 -04:00
Thomas Harte
f1779e6067 Implement SHR. 2023-10-16 12:34:11 -04:00
Thomas Harte
e38fe7dffc Implement SAL, SAR. 2023-10-14 21:42:33 -04:00
Thomas Harte
f1cba4eb78 Implement remaining rolls. 2023-10-13 22:03:54 -04:00
Thomas Harte
f45d8bcbdb Implement RCR. 2023-10-13 21:44:48 -04:00
Thomas Harte
6f7991f54a Avoid loop. 2023-10-13 21:32:35 -04:00
Thomas Harte
6ec291d96f Move ownership of mask test. 2023-10-13 15:34:06 -04:00
Thomas Harte
1a0f848b21 Implement RCL. 2023-10-13 14:44:22 -04:00
Thomas Harte
bf832768e6 Implement XLAT. 2023-10-12 21:12:03 -04:00
Thomas Harte
d35377c776 Implement SALC, SETMO, SETMOC. 2023-10-12 15:52:05 -04:00
Thomas Harte
97d3a9fa78 Implement MOV. 2023-10-12 15:34:46 -04:00
Thomas Harte
da029ee344 Implement LEA. 2023-10-12 14:31:25 -04:00
Thomas Harte
cf846f501a Implement LDS, LES. 2023-10-12 14:24:28 -04:00
Thomas Harte
e948a67814 Implement SAHF, LAHF. 2023-10-12 13:54:51 -04:00
Thomas Harte
56e639e09a Add INT (including INT3), INTO. 2023-10-11 16:01:09 -04:00
Thomas Harte
e75ef70c96 Further generalise. 2023-10-11 15:08:04 -04:00
Thomas Harte
a768b101f8 Further clean up copy-and-paste mess. 2023-10-11 14:36:42 -04:00
Thomas Harte
7159366360 Collapse all flags accesses behind setters and getters. 2023-10-11 12:35:17 -04:00
Thomas Harte
033ba75376 Standardise repetitive sign/zero/parity sets. 2023-10-11 11:15:59 -04:00
Thomas Harte
fbd647080d Start factoring out useful ALU stuff. 2023-10-11 11:06:20 -04:00
Thomas Harte
4a803e2d43 Reduce ADD/ADC/SUB/SBB repetition. 2023-10-10 22:43:06 -04:00
Thomas Harte
7753497a93 Add header for std::swap. 2023-10-10 22:35:25 -04:00
Thomas Harte
a83b43a1ae Implement XCHG. 2023-10-10 22:34:42 -04:00
Thomas Harte
5125907048 Implement TEST. 2023-10-10 22:28:10 -04:00
Thomas Harte
08867f4970 Implement CMP. 2023-10-10 22:15:33 -04:00
Thomas Harte
d0a9b5cb81 Implement NEG, NOT. 2023-10-10 22:09:10 -04:00
Thomas Harte
0ecc319ee6 Add OR, XOR. 2023-10-10 17:12:06 -04:00
Thomas Harte
de95026076 Implement Jcc. 2023-10-10 16:27:06 -04:00
Thomas Harte
ec982444f7 Add getters to obscure internal flag storage. 2023-10-10 16:14:20 -04:00
Thomas Harte
f083eab011 Implement INC, DEC. 2023-10-10 15:57:33 -04:00
Thomas Harte
3d08953103 Add TODO. 2023-10-10 12:43:41 -04:00
Thomas Harte
dbf7d07609 Add DIV, faulty IDIV. 2023-10-10 10:34:18 -04:00
Thomas Harte
b420d4cbd7 Collect TODOs. 2023-10-09 22:22:06 -04:00
Thomas Harte
0412890923 Add STC, STD, STI. 2023-10-09 22:16:37 -04:00
Thomas Harte
5e830781cc Implement IMUL, improve test memory footprint. 2023-10-09 22:12:15 -04:00
Thomas Harte
ff6573dd02 Implement MUL. 2023-10-09 21:50:17 -04:00
Thomas Harte
e46e42d896 This is the same test either way around. 2023-10-09 16:47:02 -04:00
Thomas Harte
1cb26cb141 Pull add/sub distinction into templates. 2023-10-09 16:40:50 -04:00
Thomas Harte
f74ca8aee1 Fix SBB. 2023-10-09 16:32:01 -04:00
Thomas Harte
58aa1da649 Fix SUB. SBB still failing. 2023-10-09 16:30:47 -04:00
Thomas Harte
67d364cc89 Add faulty SUB, SBB. 2023-10-09 16:21:04 -04:00
Thomas Harte
d24fa381c7 'Implement' ESC, NOP. 2023-10-09 15:03:01 -04:00
Thomas Harte
fe6e2eb0a1 Generalise CBW. 2023-10-09 15:00:04 -04:00
Thomas Harte
08aed3bac5 Implement CWD. 2023-10-09 14:54:14 -04:00
Thomas Harte
6bbd896c34 Add DAS with a manageable number of failures. 2023-10-09 14:47:39 -04:00
Thomas Harte
0bf2099a70 Improve DAA. 2023-10-09 14:42:32 -04:00
Thomas Harte
1b9e6e8c8e Add DAA, which doesn't yet pass all tests. 2023-10-09 14:27:02 -04:00
Thomas Harte
59521f9d38 Implement CBW, CLC, CLD, CLI, CMC. 2023-10-09 11:59:38 -04:00
Thomas Harte
769aed10ea Reduce repetition. 2023-10-09 11:49:38 -04:00
Thomas Harte
5a77f0c93c Implement CALL. 2023-10-09 11:46:59 -04:00
Thomas Harte
4f14210ee0 Remove ideas discarded. 2023-10-08 22:27:01 -04:00
Thomas Harte
f618ca6046 Implement, test AND. 2023-10-08 22:18:40 -04:00
Thomas Harte
0a0d53103d Enable tests for all implemented operations.
Only the various AAM 00hs are failing, which I've yet to understand.
2023-10-08 22:12:22 -04:00
Thomas Harte
e3b18708c7 Handle segment-boundary word accesses.
With all ADDs and ADCs enabled, no remaining failures.
2023-10-08 22:11:05 -04:00
Thomas Harte
bd0b62232f Consider that displacements may always be signed.
Down to 1 failure.
2023-10-08 21:41:36 -04:00
Thomas Harte
dbfaef632a Fix DataPointer reference.
Down from 4521 to 1248 failures within 00.json.gz
2023-10-08 15:59:30 -04:00
Thomas Harte
6808f2c778 Attempt to catch illegal accesses ahead of time. 2023-10-08 15:44:11 -04:00
Thomas Harte
0d2af80f7f Avoid access issues if there's no index. 2023-10-08 13:50:36 -04:00
Thomas Harte
6f768d9a3d Start climbing towards address resolution. 2023-10-08 13:47:43 -04:00
Thomas Harte
dd3cc1f510 Fix ADD and ADC sign flags. 2023-10-08 13:39:46 -04:00
Thomas Harte
a4b1d2b00a Float out data resolution. 2023-10-08 13:34:28 -04:00
Thomas Harte
a5523c9feb Fail at scale.
108,645 current failures (!)
2023-10-07 14:37:12 -04:00
Thomas Harte
6e465b9159 Merge branch 'master' into 8088Execution 2023-10-07 14:31:09 -04:00
Thomas Harte
90f0e937e8
Merge pull request #1172 from TomHarte/AddNeskellBinaries
Import Neskell binaries.
2023-10-07 14:30:56 -04:00
Thomas Harte
6d1dd218d4 Import Neskell binaries. 2023-10-07 14:29:53 -04:00
Thomas Harte
6abc3b6cd7 Collate all failures for printing at the end. 2023-10-07 14:28:44 -04:00
Thomas Harte
7d093d71b3 Avoid allocating and reallocating per test. 2023-10-07 14:23:47 -04:00
Thomas Harte
ade5828035 Add a clear, in the hope of not recreating Memory every test.
It's a big allocation, and therefore likely the bottleneck on test running.
2023-10-07 13:39:23 -04:00
Thomas Harte
5c62606154 Simplify parity logic. 2023-10-07 13:38:36 -04:00
Thomas Harte
16bf7c6f26 Fix include guard. 2023-10-07 13:31:35 -04:00
Thomas Harte
cf4603cb33 Attempt to check defined flags only. 2023-10-06 16:32:35 -04:00
Thomas Harte
b6d000ac5e Add enough wiring to consolidate failure on lazy handling of flags. 2023-10-06 13:22:35 -04:00
Thomas Harte
82f0cd790f Find first failing execution, note reason. 2023-10-06 11:43:18 -04:00
Thomas Harte
2d17d9d316 Execute some tests at some facile level. 2023-10-06 11:31:45 -04:00
Thomas Harte
a0ca0bb3c0 Mark non-templates as inline. 2023-10-06 11:11:29 -04:00
Thomas Harte
c6b311b84a Explain source of comments. 2023-10-06 11:10:54 -04:00
Thomas Harte
28c7d27cac Establish some proportion of state, ready to execute _something_. 2023-10-06 11:07:33 -04:00
Thomas Harte
90a8999b4b Fix typo. 2023-10-05 22:29:15 -04:00
Thomas Harte
6d392852d2 Hack on through to something that builds. 2023-10-05 22:27:52 -04:00
Thomas Harte
f7d9116811 Merge branch 'master' into 8088Execution 2023-10-05 17:13:50 -04:00
Thomas Harte
451c687441
Merge pull request #1168 from TomHarte/8088Tests
Verify and correct 8086 instruction decoding.
2023-10-05 17:13:22 -04:00
Thomas Harte
f411a961a3 Create a central location for avoiding segment conditionality. 2023-10-05 17:12:38 -04:00
Thomas Harte
ada411c0d8 It's differing mildly from DataPointResolver, but segue towards a world of real data. 2023-10-05 17:06:00 -04:00
Thomas Harte
eb100e3b29 Start reforming; data size plus register aren't independent in finding a source. 2023-10-05 16:49:02 -04:00
Thomas Harte
15acb1fc7c Add ADC and ADD. 2023-10-05 15:49:07 -04:00
Thomas Harte
09b2cfad8a Add AAM and AAS. 2023-10-05 14:52:24 -04:00
Thomas Harte
059f300500 Start fleshing out x86 performance. 2023-10-05 14:37:58 -04:00
Thomas Harte
524e4ae65c Tidy up just slightly more. 2023-10-05 11:26:52 -04:00
Thomas Harte
488fceb42b Clean up, add a TODO. 2023-10-05 11:23:58 -04:00
Thomas Harte
01851874ea I guess this is what a perform looks like. 2023-10-05 11:23:41 -04:00
Thomas Harte
7f6e3cf8b7 Define the available flags. 2023-10-05 10:51:55 -04:00
Thomas Harte
2d20175472 Explain absence. 2023-10-05 09:27:02 -04:00
Thomas Harte
6597283c34 Simplify roll/shift case. 2023-10-05 09:26:12 -04:00
Thomas Harte
f6fd49d950 Relocate all text wrangling; this isn't really test-specific. 2023-10-04 22:35:52 -04:00
Thomas Harte
40af162214 Be overt about what's here to aid with printing only. 2023-10-04 22:15:13 -04:00
Thomas Harte
92c46faf84 Add SETMO and SETMOC. 2023-09-29 22:28:23 -04:00
Thomas Harte
ff9237be9f Decode SALC. 2023-09-29 22:06:42 -04:00
Thomas Harte
6cbb434482 Deal with all dangling aliases.
Leaves just five undocumented instructions.
2023-09-29 15:36:34 -04:00
Thomas Harte
9fe6e354a6 Determine what I'm up against re: outstanding unofficial opcodes. 2023-09-29 15:29:35 -04:00
Thomas Harte
103f42f0b0 Introduce FF.7 alias. 2023-09-29 15:26:25 -04:00
Thomas Harte
f2732962d0 Add 6x 8086 aliases. 2023-09-29 15:22:05 -04:00
Thomas Harte
ef5ee8cf94 Include missing context on JMP/CALL far.
Zero failing tests amongst official opcodes.
2023-09-29 14:57:08 -04:00
Thomas Harte
1a6c8a2aed Add outputters for IN and OUT.
2 failures remaining.
2023-09-29 09:39:51 -04:00
Thomas Harte
b76899f2bc Undo broken extension-word DS assumption.
8 failures.
2023-09-28 22:17:14 -04:00
Thomas Harte
a24e17c320 Simplify debugging hook; remove outdated notes. 2023-09-28 22:04:59 -04:00
Thomas Harte
245919e67d Resolve REPNE and whitespace issues. 2023-09-28 22:01:12 -04:00
Thomas Harte
6936cf1819 Handle special case of INT3.
10 failures.
2023-09-28 15:34:33 -04:00
Thomas Harte
ae4a588de3 Adjust semantics to avoid culling end of relevant RETs. 2023-09-28 15:24:15 -04:00
Thomas Harte
960cca163e Make better guess at CALL/JMP size; apply same sizing-logic as offset for disassembly matching.
13 failures.
2023-09-28 14:52:42 -04:00
Thomas Harte
86f12f4d4c Adopt test-set's preferred pointer type for LES and LDS.
15 failures.
2023-09-28 14:16:47 -04:00
Thomas Harte
249da884a7 Trim trailing space. 2023-09-28 13:59:41 -04:00
Thomas Harte
035a1265f6 Map invalid reg numbers properly for the 8086.
17 failures.
2023-09-28 13:11:15 -04:00
Thomas Harte
ff4d79e77e Add test synonym, fix operand size.
19 failures.
2023-09-28 09:43:26 -04:00
Thomas Harte
95df9bcb1e Accept SHL as a synonym of SAL.
20 failures.
2023-09-28 09:31:10 -04:00
Thomas Harte
78cb39ad67 Also fix AddrReg.
24 failures.
2023-09-27 22:47:14 -04:00
Thomas Harte
9207de4164 Fix RegAddr macro.
26 failures.
2023-09-27 22:44:10 -04:00
Thomas Harte
c20e7ed9b6 Fix TEST.
28 failures.
2023-09-27 22:30:40 -04:00
Thomas Harte
11c747e3c4 Defer worrying about immediate sign extensions. 2023-09-27 22:18:05 -04:00
Thomas Harte
02aeec0173 Prepare for greater nuance on testing sign extensions by text. 2023-09-27 17:06:34 -04:00
Thomas Harte
2d882d2153 Switch shift/roll semantics to reduce extension words and for sanity generally.
37 failures.
2023-09-27 16:40:46 -04:00
Thomas Harte
638f3d3a53 Add special case for shifts and rolls. 2023-09-27 11:10:21 -04:00
Thomas Harte
b59eae3676 Adopt normative ESC decoding.
55 failures.
2023-09-27 10:32:22 -04:00
Thomas Harte
2cc60563e0 Resolve rep vs repe.
63 failures.
2023-09-26 17:36:22 -04:00
Thomas Harte
5368f789f6 Shuffle list slightly. 2023-09-26 17:30:27 -04:00
Thomas Harte
b03b408984 Give the decoder responsibility for sanity-checking repetitions.
This may avoid some spurious extension words.
2023-09-26 17:29:20 -04:00
Thomas Harte
cd072e1b57 LEA implies a word. Otherwise add TODOs.
So that's now 69 failures.
2023-09-26 15:41:51 -04:00
Thomas Harte
f16ac603f2 Deal with printing segment:offset.
70 failing files remaining.
2023-09-26 15:28:51 -04:00
Thomas Harte
0a0051eb59 I've just been inconsistent with POP. Stop being so.
71 failures from 288 tests.
2023-09-26 15:16:41 -04:00
Thomas Harte
92c8e1ca93 Add missing #include. 2023-09-26 14:52:08 -04:00
Thomas Harte
4a38e6b4b5 Take si/di confusion and offset length off the table.
Now 74 failures of 288 tests.
2023-09-26 13:21:24 -04:00
Thomas Harte
e56a5899bd Ensure test order is deterministic. 2023-09-25 12:28:34 -04:00
Thomas Harte
87097c44b9 Curate list of known failures; apply easiest fixes.
Now at 157 failures of 288 applicable tests.
2023-09-25 11:39:12 -04:00
Thomas Harte
7fadf01e4e BP in isolation acts as a base. 2023-09-24 18:06:53 -04:00
Thomas Harte
0d65bf0c1f Take offset length off the table as a spurious cause of failures. 2023-09-24 15:26:58 -04:00
Thomas Harte
d2b9c435e5 Allow for non-sign-extended offsets/displacements. 2023-09-24 15:00:16 -04:00
Thomas Harte
d36f785428 Include file name in error. 2023-09-22 23:04:26 -04:00
Thomas Harte
5fd98e9833 Add an ignore list.
Leaves 180 failures amongst the valid 306 instructions.
2023-09-22 22:56:33 -04:00
Thomas Harte
787e9e770e Retain baseless addresses correctly. 2023-09-22 17:27:27 -04:00
Thomas Harte
c8c0c3ca6d Default segment is ::DS if there was no base. 2023-09-22 17:03:40 -04:00
Thomas Harte
5a5f71e703 JMPs imply their size. 2023-09-22 17:00:10 -04:00
Thomas Harte
587ec81900 Improve string output, better to find actual errors.
Still at 194/324 failures, but a lot of them seem reasonable.
2023-09-22 11:24:33 -04:00
Thomas Harte
9f63db991c Capture default segments, fix base/index confusion. 2023-09-22 11:07:09 -04:00
Thomas Harte
13f49fe8bf Merge branch 'master' into 8088Tests 2023-09-22 10:45:55 -04:00
Thomas Harte
5f95b32799
Merge pull request #1170 from TomHarte/NeskellTests
6502: fix SH[S/X/Y/A]
2023-09-21 21:35:33 -04:00
Thomas Harte
873b1122ab Correct SHA, SHX, SHY, SHS when page boundary crossed. 2023-09-21 15:31:04 -04:00
Thomas Harte
4c32fc9b11 These tests appear to be against a real 6502. 2023-09-21 10:22:04 -04:00
Thomas Harte
4a87aa06a5 Add use of AHX/TAS/SHX/SHY pagecross test. Which fails. 2023-09-21 10:07:09 -04:00
Thomas Harte
5731ab75a6 Test stack result, pass first test. 2023-09-21 10:00:26 -04:00
Thomas Harte
797ce89a26 Correct test trailer. 2023-09-21 09:52:38 -04:00
Thomas Harte
4dc7b1840c Start attempting to digest Neskell's NES 6502 tests. 2023-09-21 09:47:29 -04:00
Thomas Harte
3db21b0bed
Merge pull request #1169 from TomHarte/NESARR
Don't necessarily apply D for ARR.
2023-09-20 22:09:20 -04:00
Thomas Harte
74b5ad93c4 Don't necessarily apply D for ARR. 2023-09-20 10:17:00 -04:00
Thomas Harte
7ebecd2f41 Add notes to self, finally figuring out segment issue. 2023-09-19 23:27:42 -04:00
Thomas Harte
406c838c39 Attempt better to print DirectAddresss. 2023-09-19 22:46:53 -04:00
Thomas Harte
6f5fcf23dc Add missing substitutions. 2023-09-19 14:00:27 -04:00
Thomas Harte
02fcaf0dbd JCXZ seems to be preferred over JPCX. 2023-09-19 13:56:48 -04:00
Thomas Harte
a7cf7d3183 Resolve LOOPNE, LOOPE, etc. 2023-09-19 13:55:19 -04:00
Thomas Harte
9b3199d97b Reduce failures to 205/324. 2023-09-19 13:45:19 -04:00
Thomas Harte
e5dfc882cb Agree that JZ/JNZ are clearer (for me) of the synonyms. 2023-09-19 13:38:08 -04:00
Thomas Harte
2d928199d6 Clean up, add extra breakpoint points. 2023-09-18 17:10:09 -04:00
Thomas Harte
3582d2c9e3 Start to beef up operand count list. 2023-09-18 16:34:52 -04:00
Thomas Harte
da953fdf0d Complete 8086 operation list; standardise enum order. 2023-09-18 16:25:04 -04:00
Thomas Harte
710017ada2 Largely resolve the operation-name problem. 2023-09-18 15:57:26 -04:00
Thomas Harte
9d9194f194 Improve dumped information on a mismatch. 2023-09-17 17:09:40 -04:00
Thomas Harte
f8dc5b8ebc Attempt to get close on index + base addresses. 2023-09-17 17:05:19 -04:00
Thomas Harte
2ee028d74f Bluff through a few more simple cases. 2023-09-17 16:29:04 -04:00
Thomas Harte
2d2eda6f8c Bodge my way into passing some comparisons. 2023-09-17 16:22:17 -04:00
Thomas Harte
5b9c5e250d Increase version number. 2023-09-17 16:04:19 -04:00
Thomas Harte
c95df3cb6c Move a little towards string formation. 2023-09-15 22:28:30 -04:00
Thomas Harte
f039d44ee3 Fully handle rm = 6, mod = 0. 2023-09-15 22:08:20 -04:00
Thomas Harte
7ee5adc481 Forcing a displacement upon BP reduces to 29 failures.
(At the current limited fidelity of testing)
2023-09-15 16:09:04 -04:00
Thomas Harte
8d4393275c Add optional allow list, for ephemeral whittling. 2023-09-15 15:50:59 -04:00
Thomas Harte
9417996280 Also dump hex form of the instruction. 2023-09-14 15:40:40 -04:00
Thomas Harte
804f80d23c Provide sorted output. 2023-09-14 12:29:49 -04:00
Thomas Harte
28027385bc Attempt further to cheer via statistics.
Current opcode failure count: 164 out of 324. Just a shade more than 50%.
2023-09-14 09:33:45 -04:00
Thomas Harte
53d8322b46 Contort further for testing. 2023-09-13 16:45:39 -04:00
Thomas Harte
39840feae7 Added text to cheer myself up. 2023-09-13 16:09:58 -04:00
Thomas Harte
57087cc7c6 Provide feedback on prima facie failure. 2023-09-13 16:08:12 -04:00
Thomas Harte
a6abe3a51d Attempt actually to decode. No comparison yet. 2023-09-13 16:00:16 -04:00
Thomas Harte
aa127d9a9f Add an empty 8088 suite test class. 2023-09-13 15:53:38 -04:00
681 changed files with 23460 additions and 6965 deletions

87
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,87 @@
name: Build
on: [pull_request]
jobs:
build-mac-xcodebuild:
name: Mac UI / xcodebuild / ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Make
working-directory: OSBindings/Mac
run: xcodebuild CODE_SIGN_IDENTITY=-
build-sdl-cmake:
name: SDL UI / cmake / ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
shell: bash
run: |
case $RUNNER_OS in
Linux)
sudo apt-get --allow-releaseinfo-change update
sudo apt-get --fix-missing install cmake gcc-10 libsdl2-dev
;;
macOS)
brew install cmake sdl2
;;
esac
- name: Make
shell: bash
run: |
case $RUNNER_OS in
Linux)
jobs=$(nproc --all)
;;
macOS)
jobs=$(sysctl -n hw.activecpu)
;;
*)
jobs=1
esac
cmake -S. -Bbuild -DCLK_UI=SDL -DCMAKE_BUILD_TYPE=Release
cmake --build build -v -j"$jobs"
build-sdl-scons:
name: SDL UI / scons / ${{ matrix.os }}
strategy:
matrix:
os: [macos-14, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
shell: bash
run: |
case $RUNNER_OS in
Linux)
sudo apt-get --allow-releaseinfo-change update
sudo apt-get --fix-missing install gcc-10 libsdl2-dev scons
;;
macOS)
brew install scons sdl2
;;
esac
- name: Make
working-directory: OSBindings/SDL
shell: bash
run: |
case $RUNNER_OS in
Linux)
jobs=$(nproc --all)
;;
macOS)
jobs=$(sysctl -n hw.activecpu)
;;
*)
jobs=1
esac
scons -j"$jobs"

View File

@ -1,16 +0,0 @@
name: SDL/Ubuntu
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get --allow-releaseinfo-change update && sudo apt-get --fix-missing install libsdl2-dev scons
- name: Make
working-directory: OSBindings/SDL
run: scons -j$(nproc --all)

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef ActivityObserver_h
#define ActivityObserver_h
#pragma once
#include <cstdint>
#include <string>
@ -24,6 +23,8 @@ namespace Activity {
*/
class Observer {
public:
virtual ~Observer() = default;
/// Provides hints as to the sort of information presented on an LED.
enum LEDPresentation: uint8_t {
/// This LED informs the user of some sort of persistent state, e.g. scroll lock.
@ -56,5 +57,3 @@ class Observer {
};
}
#endif /* ActivityObserver_h */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef ActivitySource_h
#define ActivitySource_h
#pragma once
#include "Observer.hpp"
@ -19,6 +18,3 @@ class Source {
};
}
#endif /* ActivitySource_h */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef ConfidenceCounter_hpp
#define ConfidenceCounter_hpp
#pragma once
#include "ConfidenceSource.hpp"
@ -41,5 +40,3 @@ class ConfidenceCounter: public ConfidenceSource {
};
}
#endif /* ConfidenceCounter_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef ConfidenceSource_hpp
#define ConfidenceSource_hpp
#pragma once
namespace Analyser::Dynamic {
@ -22,5 +21,3 @@ struct ConfidenceSource {
};
}
#endif /* ConfidenceSource_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef ConfidenceSummary_hpp
#define ConfidenceSummary_hpp
#pragma once
#include "ConfidenceSource.hpp"
@ -40,5 +39,3 @@ class ConfidenceSummary: public ConfidenceSource {
};
}
#endif /* ConfidenceSummary_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef MultiConfigurable_hpp
#define MultiConfigurable_hpp
#pragma once
#include "../../../../Machines/DynamicMachine.hpp"
#include "../../../../Configurable/Configurable.hpp"
@ -36,5 +35,3 @@ class MultiConfigurable: public Configurable::Device {
};
}
#endif /* MultiConfigurable_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef MultiJoystickMachine_hpp
#define MultiJoystickMachine_hpp
#pragma once
#include "../../../../Machines/DynamicMachine.hpp"
@ -34,5 +33,3 @@ class MultiJoystickMachine: public MachineTypes::JoystickMachine {
};
}
#endif /* MultiJoystickMachine_hpp */

View File

@ -56,10 +56,10 @@ MultiKeyboardMachine::MultiKeyboard::MultiKeyboard(const std::vector<::MachineTy
}
}
bool MultiKeyboardMachine::MultiKeyboard::set_key_pressed(Key key, char value, bool is_pressed) {
bool MultiKeyboardMachine::MultiKeyboard::set_key_pressed(Key key, char value, bool is_pressed, bool is_repeat) {
bool was_consumed = false;
for(const auto &machine: machines_) {
was_consumed |= machine->get_keyboard().set_key_pressed(key, value, is_pressed);
was_consumed |= machine->get_keyboard().set_key_pressed(key, value, is_pressed, is_repeat);
}
return was_consumed;
}

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef MultiKeyboardMachine_hpp
#define MultiKeyboardMachine_hpp
#pragma once
#include "../../../../Machines/DynamicMachine.hpp"
#include "../../../../Machines/KeyboardMachine.hpp"
@ -31,7 +30,7 @@ class MultiKeyboardMachine: public MachineTypes::KeyboardMachine {
public:
MultiKeyboard(const std::vector<MachineTypes::KeyboardMachine *> &machines);
bool set_key_pressed(Key key, char value, bool is_pressed) final;
bool set_key_pressed(Key key, char value, bool is_pressed, bool is_repeat) final;
void reset_all_keys() final;
const std::set<Key> &observed_keys() const final;
bool is_exclusive() const final;
@ -55,5 +54,3 @@ class MultiKeyboardMachine: public MachineTypes::KeyboardMachine {
};
}
#endif /* MultiKeyboardMachine_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef MultiMediaTarget_hpp
#define MultiMediaTarget_hpp
#pragma once
#include "../../../../Machines/MediaTarget.hpp"
#include "../../../../Machines/DynamicMachine.hpp"
@ -35,5 +34,3 @@ struct MultiMediaTarget: public MachineTypes::MediaTarget {
};
}
#endif /* MultiMediaTarget_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef MultiProducer_hpp
#define MultiProducer_hpp
#pragma once
#include "../../../../Concurrency/AsyncTaskQueue.hpp"
#include "../../../../Machines/MachineTypes.hpp"
@ -115,5 +114,3 @@ class MultiAudioProducer: public MultiInterface<MachineTypes::AudioProducer>, pu
*/
}
#endif /* MultiProducer_hpp */

View File

@ -61,7 +61,7 @@ void MultiSpeaker::set_output_volume(float volume) {
}
void MultiSpeaker::speaker_did_complete_samples(Speaker *speaker, const std::vector<int16_t> &buffer) {
auto delegate = delegate_.load(std::memory_order::memory_order_relaxed);
auto delegate = delegate_.load(std::memory_order_relaxed);
if(!delegate) return;
{
std::lock_guard lock_guard(front_speaker_mutex_);
@ -71,7 +71,7 @@ void MultiSpeaker::speaker_did_complete_samples(Speaker *speaker, const std::vec
}
void MultiSpeaker::speaker_did_change_input_clock(Speaker *speaker) {
auto delegate = delegate_.load(std::memory_order::memory_order_relaxed);
auto delegate = delegate_.load(std::memory_order_relaxed);
if(!delegate) return;
{
std::lock_guard lock_guard(front_speaker_mutex_);
@ -85,7 +85,7 @@ void MultiSpeaker::set_new_front_machine(::Machine::DynamicMachine *machine) {
std::lock_guard lock_guard(front_speaker_mutex_);
front_speaker_ = machine->audio_producer()->get_speaker();
}
auto delegate = delegate_.load(std::memory_order::memory_order_relaxed);
auto delegate = delegate_.load(std::memory_order_relaxed);
if(delegate) {
delegate->speaker_did_change_input_clock(this);
}

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef MultiSpeaker_hpp
#define MultiSpeaker_hpp
#pragma once
#include "../../../../Machines/DynamicMachine.hpp"
#include "../../../../Outputs/Speaker/Speaker.hpp"
@ -55,5 +54,3 @@ class MultiSpeaker: public Outputs::Speaker::Speaker, Outputs::Speaker::Speaker:
};
}
#endif /* MultiSpeaker_hpp */

View File

@ -11,6 +11,12 @@
#include <algorithm>
namespace {
Log::Logger<Log::Source::MultiMachine> logger;
}
using namespace Analyser::Dynamic;
MultiMachine::MultiMachine(std::vector<std::unique_ptr<DynamicMachine>> &&machines) :
@ -61,13 +67,14 @@ bool MultiMachine::would_collapse(const std::vector<std::unique_ptr<DynamicMachi
void MultiMachine::did_run_machines(MultiTimedMachine *) {
std::lock_guard machines_lock(machines_mutex_);
#ifndef NDEBUG
for(const auto &machine: machines_) {
auto timed_machine = machine->timed_machine();
LOGNBR(PADHEX(2) << timed_machine->get_confidence() << " " << timed_machine->debug_type() << "; ");
if constexpr (logger.enabled) {
auto line = logger.info();
for(const auto &machine: machines_) {
auto timed_machine = machine->timed_machine();
line.append("%0.4f %s; ", timed_machine->get_confidence(), timed_machine->debug_type().c_str());
}
}
LOGNBR(std::endl);
#endif
DynamicMachine *front = machines_.front().get();
std::stable_sort(machines_.begin(), machines_.end(),

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef MultiMachine_hpp
#define MultiMachine_hpp
#pragma once
#include "../../../Machines/DynamicMachine.hpp"
@ -80,5 +79,3 @@ class MultiMachine: public ::Machine::DynamicMachine, public MultiTimedMachine::
};
}
#endif /* MultiMachine_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Machines_h
#define Machines_h
#pragma once
namespace Analyser {
@ -18,6 +17,7 @@ enum class Machine {
Atari2600,
AtariST,
Amiga,
Archimedes,
ColecoVision,
Electron,
Enterprise,
@ -25,11 +25,10 @@ enum class Machine {
MasterSystem,
MSX,
Oric,
PCCompatible,
Vic20,
ZX8081,
ZXSpectrum,
};
}
#endif /* Machines_h */

View File

@ -13,16 +13,17 @@
#include "../../../Numeric/CRC.hpp"
#include <algorithm>
#include <cstring>
using namespace Analyser::Static::Acorn;
std::unique_ptr<Catalogue> Analyser::Static::Acorn::GetDFSCatalogue(const std::shared_ptr<Storage::Disk::Disk> &disk) {
// c.f. http://beebwiki.mdfs.net/Acorn_DFS_disc_format
auto catalogue = std::make_unique<Catalogue>();
Storage::Encodings::MFM::Parser parser(false, disk);
Storage::Encodings::MFM::Parser parser(Storage::Encodings::MFM::Density::Single, disk);
const Storage::Encodings::MFM::Sector *const names = parser.get_sector(0, 0, 0);
const Storage::Encodings::MFM::Sector *const details = parser.get_sector(0, 0, 1);
const Storage::Encodings::MFM::Sector *const names = parser.sector(0, 0, 0);
const Storage::Encodings::MFM::Sector *const details = parser.sector(0, 0, 1);
if(!names || !details) return nullptr;
if(names->samples.empty() || details->samples.empty()) return nullptr;
@ -65,7 +66,7 @@ std::unique_ptr<Catalogue> Analyser::Static::Acorn::GetDFSCatalogue(const std::s
uint8_t track = uint8_t(start_sector / 10);
start_sector++;
Storage::Encodings::MFM::Sector *next_sector = parser.get_sector(0, track, sector);
const Storage::Encodings::MFM::Sector *next_sector = parser.sector(0, track, sector);
if(!next_sector) break;
long length_from_sector = std::min(data_length, 256l);
@ -84,36 +85,58 @@ std::unique_ptr<Catalogue> Analyser::Static::Acorn::GetDFSCatalogue(const std::s
*/
std::unique_ptr<Catalogue> Analyser::Static::Acorn::GetADFSCatalogue(const std::shared_ptr<Storage::Disk::Disk> &disk) {
auto catalogue = std::make_unique<Catalogue>();
Storage::Encodings::MFM::Parser parser(true, disk);
Storage::Encodings::MFM::Parser parser(Storage::Encodings::MFM::Density::Double, disk);
Storage::Encodings::MFM::Sector *free_space_map_second_half = parser.get_sector(0, 0, 1);
// Grab the second half of the free-space map because it has the boot option in it.
const Storage::Encodings::MFM::Sector *free_space_map_second_half = parser.sector(0, 0, 1);
if(!free_space_map_second_half) return nullptr;
catalogue->has_large_sectors = free_space_map_second_half->samples[0].size() == 1024;
// Possibility: this is a large-sector disk with an old-style free space map. In which
// case the above just read the start of the root directory.
uint8_t first_directory_sector = 2;
if(catalogue->has_large_sectors && !memcmp(&free_space_map_second_half->samples[0][1], "Hugo", 4)) {
free_space_map_second_half = parser.sector(0, 0, 0);
if(!free_space_map_second_half) return nullptr;
first_directory_sector = 1;
}
std::vector<uint8_t> root_directory;
root_directory.reserve(5 * 256);
for(uint8_t c = 2; c < 7; c++) {
const Storage::Encodings::MFM::Sector *const sector = parser.get_sector(0, 0, c);
root_directory.reserve(catalogue->has_large_sectors ? 2*1024 : 5*256);
for(uint8_t c = first_directory_sector; c < first_directory_sector + (catalogue->has_large_sectors ? 2 : 5); c++) {
const Storage::Encodings::MFM::Sector *const sector = parser.sector(0, 0, c);
if(!sector) return nullptr;
root_directory.insert(root_directory.end(), sector->samples[0].begin(), sector->samples[0].end());
}
// Quick sanity checks.
if(root_directory[0x4cb]) return nullptr;
if(root_directory[1] != 'H' || root_directory[2] != 'u' || root_directory[3] != 'g' || root_directory[4] != 'o') return nullptr;
if(root_directory[0x4FB] != 'H' || root_directory[0x4FC] != 'u' || root_directory[0x4FD] != 'g' || root_directory[0x4FE] != 'o') return nullptr;
// Check for end of directory marker.
if(root_directory[catalogue->has_large_sectors ? 0x7d7 : 0x4cb]) return nullptr;
switch(free_space_map_second_half->samples[0][0xfd]) {
default: catalogue->bootOption = Catalogue::BootOption::None; break;
case 1: catalogue->bootOption = Catalogue::BootOption::LoadBOOT; break;
case 2: catalogue->bootOption = Catalogue::BootOption::RunBOOT; break;
case 3: catalogue->bootOption = Catalogue::BootOption::ExecBOOT; break;
// Check for both directory identifiers.
const uint8_t *const start_id = &root_directory[1];
const uint8_t *const end_id = &root_directory[root_directory.size() - 5];
catalogue->is_hugo = !memcmp(start_id, "Hugo", 4) && !memcmp(end_id, "Hugo", 4);
const bool is_nick = !memcmp(start_id, "Nick", 4) && !memcmp(end_id, "Nick", 4);
if(!catalogue->is_hugo && !is_nick) {
return nullptr;
}
if(!catalogue->has_large_sectors) {
// TODO: I don't know where the boot option rests with large sectors.
switch(free_space_map_second_half->samples[0][0xfd]) {
default: catalogue->bootOption = Catalogue::BootOption::None; break;
case 1: catalogue->bootOption = Catalogue::BootOption::LoadBOOT; break;
case 2: catalogue->bootOption = Catalogue::BootOption::RunBOOT; break;
case 3: catalogue->bootOption = Catalogue::BootOption::ExecBOOT; break;
}
}
// Parse the root directory, at least.
for(std::size_t file_offset = 0x005; file_offset < 0x4cb; file_offset += 0x1a) {
for(std::size_t file_offset = 0x005; file_offset < (catalogue->has_large_sectors ? 0x7d7 : 0x4cb); file_offset += 0x1a) {
// Obtain the name, which will be at most ten characters long, and will
// be terminated by either a NULL character or a \r.
char name[11];
char name[11]{};
std::size_t c = 0;
for(; c < 10; c++) {
const char next = root_directory[file_offset + c] & 0x7f;
@ -122,8 +145,9 @@ std::unique_ptr<Catalogue> Analyser::Static::Acorn::GetADFSCatalogue(const std::
}
name[c] = '\0';
// Skip if the name is empty.
if(name[0] == '\0') continue;
// An empty name implies the directory has ended; files are always listed in case-insensitive
// sorted order, with that list being terminated by a '\0'.
if(name[0] == '\0') break;
// Populate a file then.
File new_file;
@ -166,7 +190,7 @@ std::unique_ptr<Catalogue> Analyser::Static::Acorn::GetADFSCatalogue(const std::
new_file.data.reserve(size);
while(new_file.data.size() < size) {
const Storage::Encodings::MFM::Sector *const sector = parser.get_sector(start_sector / (80 * 16), (start_sector / 16) % 80, start_sector % 16);
const Storage::Encodings::MFM::Sector *const sector = parser.sector(start_sector / (80 * 16), (start_sector / 16) % 80, start_sector % 16);
if(!sector) break;
const auto length_from_sector = std::min(size - new_file.data.size(), sector->samples[0].size());
@ -177,5 +201,20 @@ std::unique_ptr<Catalogue> Analyser::Static::Acorn::GetADFSCatalogue(const std::
catalogue->files.push_back(std::move(new_file));
}
// Include the directory title.
const char *title, *name;
if(catalogue->has_large_sectors) {
title = reinterpret_cast<const char *>(&root_directory[0x7dd]);
name = reinterpret_cast<const char *>(&root_directory[0x7f0]);
} else {
title = reinterpret_cast<const char *>(&root_directory[0x4d9]);
name = reinterpret_cast<const char *>(&root_directory[0x4cc]);
}
catalogue->name = std::string(title, strnlen(title, 19));
if(catalogue->name.empty() || catalogue->name == "$") {
catalogue->name = std::string(name, strnlen(name, 10));
}
return catalogue;
}

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Acorn_Disk_hpp
#define StaticAnalyser_Acorn_Disk_hpp
#pragma once
#include "File.hpp"
#include "../../../Storage/Disk/Disk.hpp"
@ -16,6 +15,8 @@ namespace Analyser::Static::Acorn {
/// Describes a DFS- or ADFS-format catalogue(/directory): the list of files available and the catalogue's boot option.
struct Catalogue {
bool is_hugo = false;
bool has_large_sectors = false;
std::string name;
std::vector<File> files;
enum class BootOption {
@ -30,5 +31,3 @@ std::unique_ptr<Catalogue> GetDFSCatalogue(const std::shared_ptr<Storage::Disk::
std::unique_ptr<Catalogue> GetADFSCatalogue(const std::shared_ptr<Storage::Disk::Disk> &disk);
}
#endif /* Disk_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Acorn_File_hpp
#define StaticAnalyser_Acorn_File_hpp
#pragma once
#include <memory>
#include <string>
@ -59,5 +58,3 @@ struct File {
};
}
#endif /* File_hpp */

View File

@ -12,7 +12,10 @@
#include "Tape.hpp"
#include "Target.hpp"
#include "../../../Numeric/StringSimilarity.hpp"
#include <algorithm>
#include <map>
using namespace Analyser::Static::Acorn;
@ -59,13 +62,14 @@ static std::vector<std::shared_ptr<Storage::Cartridge::Cartridge>>
return acorn_cartridges;
}
Analyser::Static::TargetList Analyser::Static::Acorn::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
auto target = std::make_unique<Target>();
Analyser::Static::TargetList Analyser::Static::Acorn::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType) {
auto target8bit = std::make_unique<ElectronTarget>();
auto targetArchimedes = std::make_unique<ArchimedesTarget>();
// strip out inappropriate cartridges
target->media.cartridges = AcornCartridgesFrom(media.cartridges);
// Copy appropriate cartridges to the 8-bit target.
target8bit->media.cartridges = AcornCartridgesFrom(media.cartridges);
// if there are any tapes, attempt to get data from the first
// If there are any tapes, attempt to get data from the first.
if(!media.tapes.empty()) {
std::shared_ptr<Storage::Tape::Tape> tape = media.tapes.front();
std::vector<File> files = GetFiles(tape);
@ -94,30 +98,34 @@ Analyser::Static::TargetList Analyser::Static::Acorn::GetTargets(const Media &me
// Inspect first file. If it's protected or doesn't look like BASIC
// then the loading command is *RUN. Otherwise it's CHAIN"".
target->loading_command = is_basic ? "CHAIN\"\"\n" : "*RUN\n";
target8bit->loading_command = is_basic ? "CHAIN\"\"\n" : "*RUN\n";
target->media.tapes = media.tapes;
target8bit->media.tapes = media.tapes;
}
}
if(!media.disks.empty()) {
std::shared_ptr<Storage::Disk::Disk> disk = media.disks.front();
std::unique_ptr<Catalogue> dfs_catalogue, adfs_catalogue;
// Get any sort of catalogue that can be found.
dfs_catalogue = GetDFSCatalogue(disk);
if(dfs_catalogue == nullptr) adfs_catalogue = GetADFSCatalogue(disk);
if(dfs_catalogue || adfs_catalogue) {
// 8-bit options: DFS and Hugo-style ADFS.
if(dfs_catalogue || (adfs_catalogue && !adfs_catalogue->has_large_sectors && adfs_catalogue->is_hugo)) {
// Accept the disk and determine whether DFS or ADFS ROMs are implied.
// Use the Pres ADFS if using an ADFS, as it leaves Page at &EOO.
target->media.disks = media.disks;
target->has_dfs = bool(dfs_catalogue);
target->has_pres_adfs = bool(adfs_catalogue);
target8bit->media.disks = media.disks;
target8bit->has_dfs = bool(dfs_catalogue);
target8bit->has_pres_adfs = bool(adfs_catalogue);
// Check whether a simple shift+break will do for loading this disk.
Catalogue::BootOption bootOption = (dfs_catalogue ?: adfs_catalogue)->bootOption;
if(bootOption != Catalogue::BootOption::None) {
target->should_shift_restart = true;
target8bit->should_shift_restart = true;
} else {
target->loading_command = "*CAT\n";
target8bit->loading_command = "*CAT\n";
}
// Check whether adding the AP6 ROM is justified.
@ -133,39 +141,79 @@ Analyser::Static::TargetList Analyser::Static::Acorn::GetTargets(const Media &me
"VERIFY", "ZERO"
}) {
if(std::search(file.data.begin(), file.data.end(), command, command+strlen(command)) != file.data.end()) {
target->has_ap6_rom = true;
target->has_sideways_ram = true;
target8bit->has_ap6_rom = true;
target8bit->has_sideways_ram = true;
}
}
}
} else if(adfs_catalogue) {
// Archimedes options, implicitly: ADFS, non-Hugo.
targetArchimedes->media.disks = media.disks;
// Also look for the best possible startup program name, if it can be discerned.
std::multimap<double, std::string, std::greater<double>> options;
for(const auto &file: adfs_catalogue->files) {
// Skip non-Pling files.
if(file.name[0] != '!') continue;
// Take whatever else comes with a preference for things that don't
// have 'boot' or 'read' in them (the latter of which will tend to be
// read_me or read_this or similar).
constexpr char read[] = "read";
constexpr char boot[] = "boot";
const auto has = [&](const char *begin, const char *end) {
return std::search(
file.name.begin(), file.name.end(),
begin, end - 1, // i.e. don't compare the trailing NULL.
[](char lhs, char rhs) {
return std::tolower(lhs) == rhs;
}
) != file.name.end();
};
const auto has_read = has(std::begin(read), std::end(read));
const auto has_boot = has(std::begin(boot), std::end(boot));
const auto probability =
Numeric::similarity(file.name, adfs_catalogue->name) +
Numeric::similarity(file.name, file_name) -
((has_read || has_boot) ? 0.2 : 0.0);
options.emplace(probability, file.name);
}
if(!options.empty()) {
targetArchimedes->main_program = options.begin()->second;
}
}
}
// Enable the Acorn ADFS if a mass-storage device is attached;
// unlike the Pres ADFS it retains SCSI logic.
if(!media.mass_storage_devices.empty()) {
target->has_pres_adfs = false; // To override a floppy selection, if one was made.
target->has_acorn_adfs = true;
target8bit->has_pres_adfs = false; // To override a floppy selection, if one was made.
target8bit->has_acorn_adfs = true;
// Assume some sort of later-era Acorn work is likely to happen;
// so ensure *TYPE, etc are present.
target->has_ap6_rom = true;
target->has_sideways_ram = true;
target8bit->has_ap6_rom = true;
target8bit->has_sideways_ram = true;
target->media.mass_storage_devices = media.mass_storage_devices;
target8bit->media.mass_storage_devices = media.mass_storage_devices;
// Check for a boot option.
const auto sector = target->media.mass_storage_devices.front()->get_block(1);
const auto sector = target8bit->media.mass_storage_devices.front()->get_block(1);
if(sector[0xfd]) {
target->should_shift_restart = true;
target8bit->should_shift_restart = true;
} else {
target->loading_command = "*CAT\n";
target8bit->loading_command = "*CAT\n";
}
}
TargetList targets;
if(!target->media.empty()) {
targets.push_back(std::move(target));
if(!target8bit->media.empty()) {
targets.push_back(std::move(target8bit));
}
if(!targetArchimedes->media.empty()) {
targets.push_back(std::move(targetArchimedes));
}
return targets;
}

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Acorn_StaticAnalyser_hpp
#define StaticAnalyser_Acorn_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::Acorn {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* AcornAnalyser_hpp */

View File

@ -19,8 +19,10 @@ static std::unique_ptr<File::Chunk> GetNextChunk(const std::shared_ptr<Storage::
auto new_chunk = std::make_unique<File::Chunk>();
int shift_register = 0;
// TODO: move this into the parser
#define shift() shift_register = (shift_register >> 1) | (parser.get_next_bit(tape) << 9)
// TODO: move this into the parser
const auto shift = [&] {
shift_register = (shift_register >> 1) | (parser.get_next_bit(tape) << 9);
};
// find next area of high tone
while(!tape->is_at_end() && (shift_register != 0x3ff)) {
@ -32,8 +34,6 @@ static std::unique_ptr<File::Chunk> GetNextChunk(const std::shared_ptr<Storage::
shift();
}
#undef shift
parser.reset_crc();
parser.reset_error_flag();

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Acorn_Tape_hpp
#define StaticAnalyser_Acorn_Tape_hpp
#pragma once
#include <memory>
@ -19,5 +18,3 @@ namespace Analyser::Static::Acorn {
std::vector<File> GetFiles(const std::shared_ptr<Storage::Tape::Tape> &tape);
}
#endif /* Tape_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_Acorn_Target_h
#define Analyser_Static_Acorn_Target_h
#pragma once
#include "../../../Reflection/Struct.hpp"
#include "../StaticAnalyser.hpp"
@ -15,7 +14,7 @@
namespace Analyser::Static::Acorn {
struct Target: public ::Analyser::Static::Target, public Reflection::StructImpl<Target> {
struct ElectronTarget: public ::Analyser::Static::Target, public Reflection::StructImpl<ElectronTarget> {
bool has_acorn_adfs = false;
bool has_pres_adfs = false;
bool has_dfs = false;
@ -24,7 +23,7 @@ struct Target: public ::Analyser::Static::Target, public Reflection::StructImpl<
bool should_shift_restart = false;
std::string loading_command;
Target() : Analyser::Static::Target(Machine::Electron) {
ElectronTarget() : Analyser::Static::Target(Machine::Electron) {
if(needs_declare()) {
DeclareField(has_pres_adfs);
DeclareField(has_acorn_adfs);
@ -35,6 +34,10 @@ struct Target: public ::Analyser::Static::Target, public Reflection::StructImpl<
}
};
}
struct ArchimedesTarget: public ::Analyser::Static::Target, public Reflection::StructImpl<ArchimedesTarget> {
std::string main_program;
#endif /* Analyser_Static_Acorn_Target_h */
ArchimedesTarget() : Analyser::Static::Target(Machine::Archimedes) {}
};
}

View File

@ -6,8 +6,7 @@
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_Amiga_StaticAnalyser_hpp
#define Analyser_Static_Amiga_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::Amiga {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* Analyser_Static_Amiga_StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_Amiga_Target_h
#define Analyser_Static_Amiga_Target_h
#pragma once
#include "../../../Reflection/Struct.hpp"
#include "../StaticAnalyser.hpp"
@ -40,5 +39,3 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Ta
};
}
#endif /* Analyser_Static_Amiga_Target_h */

View File

@ -159,8 +159,8 @@ void InspectCatalogue(
}
bool CheckBootSector(const std::shared_ptr<Storage::Disk::Disk> &disk, const std::unique_ptr<Analyser::Static::AmstradCPC::Target> &target) {
Storage::Encodings::MFM::Parser parser(true, disk);
Storage::Encodings::MFM::Sector *boot_sector = parser.get_sector(0, 0, 0x41);
Storage::Encodings::MFM::Parser parser(Storage::Encodings::MFM::Density::Double, disk);
const Storage::Encodings::MFM::Sector *boot_sector = parser.sector(0, 0, 0x41);
if(boot_sector != nullptr && !boot_sector->samples.empty() && boot_sector->samples[0].size() == 512) {
// Check that the first 64 bytes of the sector aren't identical; if they are then probably
// this disk was formatted and the filler byte never replaced.

View File

@ -6,8 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_AmstradCPC_StaticAnalyser_hpp
#define Analyser_Static_AmstradCPC_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::AmstradCPC {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* Analyser_Static_AmstradCPC_StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_AmstradCPC_Target_h
#define Analyser_Static_AmstradCPC_Target_h
#pragma once
#include "../../../Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp"
@ -30,5 +29,3 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Ta
};
}
#endif /* Analyser_Static_AmstradCPC_Target_h */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_AppleII_StaticAnalyser_hpp
#define Analyser_Static_AppleII_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::AppleII {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* Analyser_Static_AppleII_StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_AppleII_Target_h
#define Analyser_Static_AppleII_Target_h
#pragma once
#include "../../../Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp"
@ -35,12 +34,14 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Ta
Model model = Model::IIe;
DiskController disk_controller = DiskController::None;
SCSIController scsi_controller = SCSIController::None;
bool has_mockingboard = true;
Target() : Analyser::Static::Target(Machine::AppleII) {
if(needs_declare()) {
DeclareField(model);
DeclareField(disk_controller);
DeclareField(scsi_controller);
DeclareField(has_mockingboard);
AnnounceEnum(Model);
AnnounceEnum(DiskController);
@ -49,6 +50,8 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Ta
}
};
constexpr bool is_iie(Target::Model model) {
return model == Target::Model::IIe || model == Target::Model::EnhancedIIe;
}
#endif /* Analyser_Static_AppleII_Target_h */
}

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_AppleIIgs_StaticAnalyser_hpp
#define Analyser_Static_AppleIIgs_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::AppleIIgs {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* Analyser_Static_AppleIIgs_StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_AppleIIgs_Target_h
#define Analyser_Static_AppleIIgs_Target_h
#pragma once
#include "../../../Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp"
@ -41,5 +40,3 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Ta
};
}
#endif /* Analyser_Static_AppleIIgs_Target_h */

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Atari_StaticAnalyser_hpp
#define StaticAnalyser_Atari_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::Atari2600 {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_Atari2600_Target_h
#define Analyser_Static_Atari2600_Target_h
#pragma once
#include "../StaticAnalyser.hpp"
@ -37,5 +36,3 @@ struct Target: public ::Analyser::Static::Target {
};
}
#endif /* Analyser_Static_Atari_Target_h */

View File

@ -6,8 +6,7 @@
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_AtariST_StaticAnalyser_hpp
#define Analyser_Static_AtariST_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::AtariST {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* Analyser_Static_AtariST_StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_AtariST_Target_h
#define Analyser_Static_AtariST_Target_h
#pragma once
#include "../../../Reflection/Struct.hpp"
#include "../StaticAnalyser.hpp"
@ -30,5 +29,3 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Ta
};
}
#endif /* Analyser_Static_AtariST_Target_h */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Coleco_StaticAnalyser_hpp
#define StaticAnalyser_Coleco_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::Coleco {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* StaticAnalyser_hpp */

View File

@ -37,7 +37,7 @@ class CommodoreGCRParser: public Storage::Disk::Controller {
@returns a sector if one was found; @c nullptr otherwise.
*/
std::shared_ptr<Sector> get_sector(uint8_t track, uint8_t sector) {
std::shared_ptr<Sector> sector(uint8_t track, uint8_t sector) {
int difference = int(track) - int(track_);
track_ = track;
@ -182,7 +182,7 @@ std::vector<File> Analyser::Static::Commodore::GetFiles(const std::shared_ptr<St
uint8_t next_track = 18;
uint8_t next_sector = 1;
while(1) {
sector = parser.get_sector(next_track, next_sector);
sector = parser.sector(next_track, next_sector);
if(!sector) break;
directory.insert(directory.end(), sector->data.begin(), sector->data.end());
next_track = sector->data[0];
@ -221,7 +221,7 @@ std::vector<File> Analyser::Static::Commodore::GetFiles(const std::shared_ptr<St
bool is_first_sector = true;
while(next_track) {
sector = parser.get_sector(next_track, next_sector);
sector = parser.sector(next_track, next_sector);
if(!sector) break;
next_track = sector->data[0];

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Commodore_Disk_hpp
#define StaticAnalyser_Commodore_Disk_hpp
#pragma once
#include "../../../Storage/Disk/Disk.hpp"
#include "File.hpp"
@ -19,5 +18,3 @@ namespace Analyser::Static::Commodore {
std::vector<File> GetFiles(const std::shared_ptr<Storage::Disk::Disk> &disk);
}
#endif /* Disk_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef File_hpp
#define File_hpp
#pragma once
#include <cstdint>
#include <string>
@ -35,5 +34,3 @@ struct File {
};
}
#endif /* File_hpp */

View File

@ -93,7 +93,7 @@ Analyser::Static::TargetList Analyser::Static::Commodore::GetTargets(const Media
// make a first guess based on loading address
switch(files.front().starting_address) {
default:
LOG("Unrecognised loading address for Commodore program: " << PADHEX(4) << files.front().starting_address);
Log::Logger<Log::Source::CommodoreStaticAnalyser>().error().append("Unrecognised loading address for Commodore program: %04x", files.front().starting_address);
[[fallthrough]];
case 0x1001:
memory_model = Target::MemoryModel::Unexpanded;

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Commodore_StaticAnalyser_hpp
#define StaticAnalyser_Commodore_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::Commodore {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* CommodoreAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Commodore_Tape_hpp
#define StaticAnalyser_Commodore_Tape_hpp
#pragma once
#include "../../../Storage/Tape/Tape.hpp"
#include "File.hpp"
@ -17,5 +16,3 @@ namespace Analyser::Static::Commodore {
std::vector<File> GetFiles(const std::shared_ptr<Storage::Tape::Tape> &tape);
}
#endif /* Tape_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_Commodore_Target_h
#define Analyser_Static_Commodore_Target_h
#pragma once
#include "../../../Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp"
@ -70,5 +69,3 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Ta
};
}
#endif /* Analyser_Static_Commodore_Target_h */

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Disassembler_6502_hpp
#define StaticAnalyser_Disassembler_6502_hpp
#pragma once
#include <cstdint>
#include <functional>
@ -93,5 +92,3 @@ Disassembly Disassemble(
std::vector<uint16_t> entry_points);
}
#endif /* Disassembler6502_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef AddressMapper_hpp
#define AddressMapper_hpp
#pragma once
#include <functional>
@ -24,5 +23,3 @@ template <typename T> std::function<std::size_t(T)> OffsetMapper(T start_address
}
}
#endif /* AddressMapper_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef Kernel_hpp
#define Kernel_hpp
#pragma once
namespace Analyser::Static::Disassembly {
@ -65,5 +64,3 @@ template <typename D, typename S, typename Disassembler> D Disassemble(
}
}
#endif /* Kernel_hpp */

View File

@ -56,11 +56,11 @@ class Accessor {
bool overrun_ = false;
};
#define x(v) (v >> 6)
#define y(v) ((v >> 3) & 7)
#define q(v) ((v >> 3) & 1)
#define p(v) ((v >> 4) & 3)
#define z(v) (v & 7)
constexpr uint8_t x(uint8_t v) { return v >> 6; }
constexpr uint8_t y(uint8_t v) { return (v >> 3) & 7; }
constexpr uint8_t q(uint8_t v) { return (v >> 3) & 1; }
constexpr uint8_t p(uint8_t v) { return (v >> 4) & 3; }
constexpr uint8_t z(uint8_t v) { return v & 7; }
Instruction::Condition condition_table[] = {
Instruction::Condition::NZ, Instruction::Condition::Z,

View File

@ -6,8 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Disassembler_Z80_hpp
#define StaticAnalyser_Disassembler_Z80_hpp
#pragma once
#include <cstdint>
#include <functional>
@ -91,5 +90,3 @@ Disassembly Disassemble(
Approach approach);
}
#endif /* StaticAnalyser_Disassembler_Z80_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_DiskII_StaticAnalyser_hpp
#define Analyser_Static_DiskII_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::DiskII {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* Analyser_Static_DiskII_StaticAnalyser_hpp */

View File

@ -40,6 +40,8 @@ Analyser::Static::TargetList Analyser::Static::Enterprise::GetTargets(const Medi
target->basic_version = Target::BASICVersion::Any;
// Inspect any supplied disks.
//
// TODO: how best can these be discerned from MS-DOS and MSX disks?
if(!media.disks.empty()) {
// DOS will be needed.
target->dos = Target::DOS::EXDOS;

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_Enterprise_StaticAnalyser_hpp
#define Analyser_Static_Enterprise_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::Enterprise {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* Analyser_Static_Enterprise_StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_Enterprise_Target_h
#define Analyser_Static_Enterprise_Target_h
#pragma once
#include "../../../Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp"
@ -49,5 +48,3 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Ta
};
}
#endif /* Analyser_Static_Enterprise_Target_h */

View File

@ -0,0 +1,100 @@
//
// StaticAnalyser.cpp
// Clock Signal
//
// Created by Thomas Harte on 05/12/2023.
// Copyright 2023 Thomas Harte. All rights reserved.
//
#include "StaticAnalyser.hpp"
#include "../Enterprise/StaticAnalyser.hpp"
#include "../PCCompatible/StaticAnalyser.hpp"
#include "../../../Storage/Disk/Track/TrackSerialiser.hpp"
#include "../../../Storage/Disk/Encodings/MFM/Constants.hpp"
#include "../../../Storage/Disk/Encodings/MFM/SegmentParser.hpp"
Analyser::Static::TargetList Analyser::Static::FAT12::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType platforms) {
// This analyser can comprehend disks only.
if(media.disks.empty()) return {};
auto &disk = media.disks.front();
TargetList targets;
// Total list of potential platforms is:
//
// * the Enterprise (and, by extension, CP/M-targetted software);
// * the Atari ST;
// * the MSX (ditto on CP/M); and
// * the PC.
//
// (though the MSX and Atari ST don't currently call in here for now)
// If the disk image is very small or large, map it to the PC. That's the only option old enough
// to have used 5.25" media.
if(disk->get_maximum_head_position() <= Storage::Disk::HeadPosition(40)) {
return Analyser::Static::PCCompatible::GetTargets(media, file_name, platforms);
}
// Attempt to grab MFM track 0, sector 1: the boot sector.
const auto track_zero = disk->get_track_at_position(Storage::Disk::Track::Address(0, Storage::Disk::HeadPosition(0)));
const auto sector_map = Storage::Encodings::MFM::sectors_from_segment(
Storage::Disk::track_serialisation(
*track_zero,
Storage::Encodings::MFM::MFMBitLength
), Storage::Encodings::MFM::Density::Double);
// If no sectors were found, assume this disk was either single density or high density, which both imply the PC.
if(sector_map.empty() || sector_map.size() > 10) {
return Analyser::Static::PCCompatible::GetTargets(media, file_name, platforms);
}
const Storage::Encodings::MFM::Sector *boot_sector = nullptr;
for(const auto &pair: sector_map) {
if(pair.second.address.sector == 1) {
boot_sector = &pair.second;
break;
}
}
// This shouldn't technically be possible since the disk has been identified as FAT12, but be safe.
if(!boot_sector) {
return {};
}
// Check for key phrases that imply a PC disk.
const auto &sample = boot_sector->samples[0];
const std::vector<std::string> pc_strings = {
// MS-DOS strings.
"MSDOS",
"Non-System disk or disk error",
// DOS Plus strings.
"Insert a SYSTEM disk",
};
for(const auto &string: pc_strings) {
if(
std::search(sample.begin(), sample.end(), string.begin(), string.end()) != sample.end()
) {
return Analyser::Static::PCCompatible::GetTargets(media, file_name, platforms);
}
}
// TODO: look for a COM, EXE or BAT, inspect. AUTOEXEC.BAT and/or CONFIG.SYS could be either PC or MSX.
// Disassembling the boot sector doesn't necessarily work, as several Enterprise titles out there in the wild seem
// to have been created by WINIMAGE which adds an x86 PC-style boot sector.
// Enterprise notes: EXOS files all start with a 16-byte header which should begin with a 0 and then have a type
// byte that will be 0xa or lower; cf http://epbas.lgb.hu/readme.html
//
// Some disks commonly passed around as Enterprise software are actually CP/M software, expecting IS-DOS (the CP/M
// clone) to be present. It's certainly possible the same could be true of MSX disks and MSX-DOS. So analysing COM
// files probably means searching for CALL 5s and/or INT 21hs, if not a more rigorous disassembly.
//
// I have not been able to locate a copy of IS-DOS so there's probably not much that can be done here; perhaps I
// could redirect to an MSX2 with MSX-DOS2? Though it'd be nicer if I had a machine that was pure CP/M.
// Being unable to prove that this is a PC disk, throw it to the Enterprise.
return Analyser::Static::Enterprise::GetTargets(media, file_name, platforms);
}

View File

@ -0,0 +1,19 @@
//
// StaticAnalyser.hpp
// Clock Signal
//
// Created by Thomas Harte on 05/12/2023.
// Copyright 2023 Thomas Harte. All rights reserved.
//
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
#include <string>
namespace Analyser::Static::FAT12 {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Cartridge_hpp
#define Cartridge_hpp
#pragma once
#include "../../../Storage/Cartridge/Cartridge.hpp"
@ -32,5 +31,3 @@ struct Cartridge: public ::Storage::Cartridge::Cartridge {
};
}
#endif /* Cartridge_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_MSX_StaticAnalyser_hpp
#define StaticAnalyser_MSX_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::MSX {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* StaticAnalyser_MSX_StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_MSX_Tape_hpp
#define StaticAnalyser_MSX_Tape_hpp
#pragma once
#include "../../../Storage/Tape/Tape.hpp"
@ -36,5 +35,3 @@ struct File {
std::vector<File> GetFiles(const std::shared_ptr<Storage::Tape::Tape> &tape);
}
#endif /* StaticAnalyser_MSX_Tape_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_MSX_Target_h
#define Analyser_Static_MSX_Target_h
#pragma once
#include "../../../Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp"
@ -47,5 +46,3 @@ struct Target: public ::Analyser::Static::Target, public Reflection::StructImpl<
};
}
#endif /* Analyser_Static_MSX_Target_h */

View File

@ -6,8 +6,7 @@
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_Macintosh_StaticAnalyser_hpp
#define Analyser_Static_Macintosh_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::Macintosh {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* Analyser_Static_Macintosh_StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_Macintosh_Target_h
#define Analyser_Static_Macintosh_Target_h
#pragma once
#include "../../../Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp"
@ -29,5 +28,3 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Ta
};
}
#endif /* Analyser_Static_Macintosh_Target_h */

View File

@ -85,7 +85,7 @@ bool is_microdisc(Storage::Encodings::MFM::Parser &parser) {
/*
The Microdisc boot sector is sector 2 of track 0 and contains a 23-byte signature.
*/
Storage::Encodings::MFM::Sector *sector = parser.get_sector(0, 0, 2);
const Storage::Encodings::MFM::Sector *sector = parser.sector(0, 0, 2);
if(!sector) return false;
if(sector->samples.empty()) return false;
@ -108,7 +108,7 @@ bool is_400_loader(Storage::Encodings::MFM::Parser &parser, uint16_t range_start
use disassembly to test for likely matches.
*/
Storage::Encodings::MFM::Sector *sector = parser.get_sector(0, 0, 1);
const Storage::Encodings::MFM::Sector *sector = parser.sector(0, 0, 1);
if(!sector) return false;
if(sector->samples.empty()) return false;
@ -175,7 +175,7 @@ Analyser::Static::TargetList Analyser::Static::Oric::GetTargets(const Media &med
// 8-DOS is recognised by a dedicated Disk II analyser, so check only for Microdisc,
// Jasmin and BD-DOS formats here.
for(auto &disk: media.disks) {
Storage::Encodings::MFM::Parser parser(true, disk);
Storage::Encodings::MFM::Parser parser(Storage::Encodings::MFM::Density::Double, disk);
if(is_microdisc(parser)) {
target->disk_interface = Target::DiskInterface::Microdisc;

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Oric_StaticAnalyser_hpp
#define StaticAnalyser_Oric_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::Oric {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Oric_Tape_hpp
#define StaticAnalyser_Oric_Tape_hpp
#pragma once
#include "../../../Storage/Tape/Tape.hpp"
@ -32,5 +31,3 @@ struct File {
std::vector<File> GetFiles(const std::shared_ptr<Storage::Tape::Tape> &tape);
}
#endif /* Tape_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_Oric_Target_h
#define Analyser_Static_Oric_Target_h
#pragma once
#include "../../../Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp"
@ -55,5 +54,3 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Ta
};
}
#endif /* Analyser_Static_Oric_Target_h */

View File

@ -0,0 +1,25 @@
//
// StaticAnalyser.cpp
// Clock Signal
//
// Created by Thomas Harte on 03/10/2019.
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#include "StaticAnalyser.hpp"
#include "Target.hpp"
Analyser::Static::TargetList Analyser::Static::PCCompatible::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
// This analyser can comprehend disks only.
if(media.disks.empty()) return {};
// No analysis is applied yet.
Analyser::Static::TargetList targets;
using Target = Analyser::Static::PCCompatible::Target;
auto *const target = new Target();
target->media = media;
targets.push_back(std::unique_ptr<Analyser::Static::Target>(target));
return targets;
}

View File

@ -0,0 +1,19 @@
//
// StaticAnalyser.hpp
// Clock Signal
//
// Created by Thomas Harte on 29/11/2019.
// Copyright © 2023 Thomas Harte. All rights reserved.
//
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
#include <string>
namespace Analyser::Static::PCCompatible {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}

View File

@ -0,0 +1,37 @@
//
// Target.hpp
// Clock Signal
//
// Created by Thomas Harte on 29/11/2023.
// Copyright © 2023 Thomas Harte. All rights reserved.
//
#pragma once
#include "../../../Reflection/Struct.hpp"
#include "../StaticAnalyser.hpp"
namespace Analyser::Static::PCCompatible {
struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Target> {
ReflectableEnum(VideoAdaptor,
MDA,
CGA);
VideoAdaptor adaptor = VideoAdaptor::CGA;
ReflectableEnum(Speed,
ApproximatelyOriginal,
Fast);
Speed speed = Speed::Fast;
Target() : Analyser::Static::Target(Machine::PCCompatible) {
if(needs_declare()) {
AnnounceEnum(VideoAdaptor);
AnnounceEnum(Speed);
DeclareField(adaptor);
DeclareField(speed);
}
}
};
}

View File

@ -6,8 +6,7 @@
// Copyright © 2018 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_Sega_StaticAnalyser_hpp
#define StaticAnalyser_Sega_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::Sega {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright © 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_Sega_Target_h
#define Analyser_Static_Sega_Target_h
#pragma once
#include "../../../Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp"
@ -51,5 +50,3 @@ constexpr bool is_master_system(Analyser::Static::Sega::Target::Model model) {
}
}
#endif /* Analyser_Static_Sega_Target_h */

View File

@ -9,6 +9,7 @@
#include "StaticAnalyser.hpp"
#include <algorithm>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <iterator>
@ -25,9 +26,11 @@
#include "Commodore/StaticAnalyser.hpp"
#include "DiskII/StaticAnalyser.hpp"
#include "Enterprise/StaticAnalyser.hpp"
#include "FAT12/StaticAnalyser.hpp"
#include "Macintosh/StaticAnalyser.hpp"
#include "MSX/StaticAnalyser.hpp"
#include "Oric/StaticAnalyser.hpp"
#include "PCCompatible/StaticAnalyser.hpp"
#include "Sega/StaticAnalyser.hpp"
#include "ZX8081/StaticAnalyser.hpp"
#include "ZXSpectrum/StaticAnalyser.hpp"
@ -48,10 +51,12 @@
#include "../../Storage/Disk/DiskImage/Formats/FAT12.hpp"
#include "../../Storage/Disk/DiskImage/Formats/HFE.hpp"
#include "../../Storage/Disk/DiskImage/Formats/IPF.hpp"
#include "../../Storage/Disk/DiskImage/Formats/IMD.hpp"
#include "../../Storage/Disk/DiskImage/Formats/MacintoshIMG.hpp"
#include "../../Storage/Disk/DiskImage/Formats/MSA.hpp"
#include "../../Storage/Disk/DiskImage/Formats/NIB.hpp"
#include "../../Storage/Disk/DiskImage/Formats/OricMFMDSK.hpp"
#include "../../Storage/Disk/DiskImage/Formats/PCBooter.hpp"
#include "../../Storage/Disk/DiskImage/Formats/SSD.hpp"
#include "../../Storage/Disk/DiskImage/Formats/STX.hpp"
#include "../../Storage/Disk/DiskImage/Formats/WOZ.hpp"
@ -84,6 +89,7 @@
template<class> inline constexpr bool always_false_v = false;
using namespace Analyser::Static;
using namespace Storage;
namespace {
@ -97,46 +103,90 @@ std::string get_extension(const std::string &name) {
return extension;
}
class MediaAccumulator {
public:
MediaAccumulator(const std::string &file_name, TargetPlatform::IntType &potential_platforms) :
file_name_(file_name), potential_platforms_(potential_platforms), extension_(get_extension(file_name)) {}
/// Adds @c instance to the media collection and adds @c platforms to the set of potentials.
/// If @c instance is an @c TargetPlatform::TypeDistinguisher then it is given an opportunity to restrict the set of potentials.
template <typename InstanceT>
void insert(TargetPlatform::IntType platforms, std::shared_ptr<InstanceT> instance) {
if constexpr (std::is_base_of_v<Storage::Disk::Disk, InstanceT>) {
media.disks.push_back(instance);
} else if constexpr (std::is_base_of_v<Storage::Tape::Tape, InstanceT>) {
media.tapes.push_back(instance);
} else if constexpr (std::is_base_of_v<Storage::Cartridge::Cartridge, InstanceT>) {
media.cartridges.push_back(instance);
} else if constexpr (std::is_base_of_v<Storage::MassStorage::MassStorageDevice, InstanceT>) {
media.mass_storage_devices.push_back(instance);
} else {
static_assert(always_false_v<InstanceT>, "Unexpected type encountered.");
}
potential_platforms_ |= platforms;
// Check whether the instance itself has any input on target platforms.
TargetPlatform::TypeDistinguisher *const distinguisher =
dynamic_cast<TargetPlatform::TypeDistinguisher *>(instance.get());
if(distinguisher) potential_platforms_ &= distinguisher->target_platform_type();
}
/// Concstructs a new instance of @c InstanceT supplying @c args and adds it to the back of @c list using @c insert_instance.
template <typename InstanceT, typename... Args>
void insert(TargetPlatform::IntType platforms, Args &&... args) {
insert(platforms, std::make_shared<InstanceT>(std::forward<Args>(args)...));
}
/// Calls @c insert with the specified parameters, ignoring any exceptions thrown.
template <typename InstanceT, typename... Args>
void try_insert(TargetPlatform::IntType platforms, Args &&... args) {
try {
insert<InstanceT>(platforms, std::forward<Args>(args)...);
} catch(...) {}
}
/// Performs a @c try_insert for an object of @c InstanceT if @c extension matches that of the file name,
/// providing the file name as the only construction argument.
template <typename InstanceT>
void try_standard(TargetPlatform::IntType platforms, const char *extension) {
if(name_matches(extension)) {
try_insert<InstanceT>(platforms, file_name_);
}
}
bool name_matches(const char *extension) {
return extension_ == extension;
}
Media media;
private:
const std::string &file_name_;
TargetPlatform::IntType &potential_platforms_;
const std::string extension_;
};
}
static Media GetMediaAndPlatforms(const std::string &file_name, TargetPlatform::IntType &potential_platforms) {
Media result;
const std::string extension = get_extension(file_name);
#define InsertInstance(list, instance, platforms) \
list.emplace_back(instance);\
potential_platforms |= platforms;\
TargetPlatform::TypeDistinguisher *const distinguisher = dynamic_cast<TargetPlatform::TypeDistinguisher *>(list.back().get());\
if(distinguisher) potential_platforms &= distinguisher->target_platform_type();
#define Insert(list, class, platforms, ...) \
InsertInstance(list, new Storage::class(__VA_ARGS__), platforms);
#define TryInsert(list, class, platforms, ...) \
try {\
Insert(list, class, platforms, __VA_ARGS__) \
} catch(...) {}
#define Format(ext, list, class, platforms) \
if(extension == ext) { \
TryInsert(list, class, platforms, file_name) \
}
MediaAccumulator accumulator(file_name, potential_platforms);
// 2MG
if(extension == "2mg") {
if(accumulator.name_matches("2mg")) {
// 2MG uses a factory method; defer to it.
try {
const auto media = Storage::Disk::Disk2MG::open(file_name);
std::visit([&result, &potential_platforms](auto &&arg) {
const auto media = Disk::Disk2MG::open(file_name);
std::visit([&](auto &&arg) {
using Type = typename std::decay<decltype(arg)>::type;
if constexpr (std::is_same<Type, nullptr_t>::value) {
if constexpr (std::is_same<Type, std::nullptr_t>::value) {
// It's valid for no media to be returned.
} else if constexpr (std::is_same<Type, Storage::Disk::DiskImageHolderBase *>::value) {
InsertInstance(result.disks, arg, TargetPlatform::DiskII);
} else if constexpr (std::is_same<Type, Storage::MassStorage::MassStorageDevice *>::value) {
} else if constexpr (std::is_same<Type, Disk::DiskImageHolderBase *>::value) {
accumulator.insert(TargetPlatform::DiskII, std::shared_ptr<Disk::DiskImageHolderBase>(arg));
} else if constexpr (std::is_same<Type, MassStorage::MassStorageDevice *>::value) {
// TODO: or is it Apple IIgs?
InsertInstance(result.mass_storage_devices, arg, TargetPlatform::AppleII);
accumulator.insert(TargetPlatform::AppleII, std::shared_ptr<MassStorage::MassStorageDevice>(arg));
} else {
static_assert(always_false_v<Type>, "Unexpected type encountered.");
}
@ -144,95 +194,108 @@ static Media GetMediaAndPlatforms(const std::string &file_name, TargetPlatform::
} catch(...) {}
}
Format("80", result.tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // 80
Format("81", result.tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // 81
Format("a26", result.cartridges, Cartridge::BinaryDump, TargetPlatform::Atari2600) // A26
Format("adf", result.disks, Disk::DiskImageHolder<Storage::Disk::AcornADF>, TargetPlatform::Acorn) // ADF (Acorn)
Format("adf", result.disks, Disk::DiskImageHolder<Storage::Disk::AmigaADF>, TargetPlatform::Amiga) // ADF (Amiga)
Format("adl", result.disks, Disk::DiskImageHolder<Storage::Disk::AcornADF>, TargetPlatform::Acorn) // ADL
Format("bin", result.cartridges, Cartridge::BinaryDump, TargetPlatform::AllCartridge) // BIN (cartridge dump)
Format("cas", result.tapes, Tape::CAS, TargetPlatform::MSX) // CAS
Format("cdt", result.tapes, Tape::TZX, TargetPlatform::AmstradCPC) // CDT
Format("col", result.cartridges, Cartridge::BinaryDump, TargetPlatform::Coleco) // COL
Format("csw", result.tapes, Tape::CSW, TargetPlatform::AllTape) // CSW
Format("d64", result.disks, Disk::DiskImageHolder<Storage::Disk::D64>, TargetPlatform::Commodore) // D64
Format("dat", result.mass_storage_devices, MassStorage::DAT, TargetPlatform::Acorn) // DAT
Format("dmk", result.disks, Disk::DiskImageHolder<Storage::Disk::DMK>, TargetPlatform::MSX) // DMK
Format("do", result.disks, Disk::DiskImageHolder<Storage::Disk::AppleDSK>, TargetPlatform::DiskII) // DO
Format("dsd", result.disks, Disk::DiskImageHolder<Storage::Disk::SSD>, TargetPlatform::Acorn) // DSD
Format( "dsk",
result.disks,
Disk::DiskImageHolder<Storage::Disk::CPCDSK>,
TargetPlatform::AmstradCPC | TargetPlatform::Oric | TargetPlatform::ZXSpectrum) // DSK (Amstrad CPC, etc)
Format("dsk", result.disks, Disk::DiskImageHolder<Storage::Disk::AppleDSK>, TargetPlatform::DiskII) // DSK (Apple II)
Format("dsk", result.disks, Disk::DiskImageHolder<Storage::Disk::MacintoshIMG>, TargetPlatform::Macintosh) // DSK (Macintosh, floppy disk)
Format("dsk", result.mass_storage_devices, MassStorage::HFV, TargetPlatform::Macintosh) // DSK (Macintosh, hard disk, single volume image)
Format("dsk", result.mass_storage_devices, MassStorage::DSK, TargetPlatform::Macintosh) // DSK (Macintosh, hard disk, full device image)
Format("dsk", result.disks, Disk::DiskImageHolder<Storage::Disk::FAT12>, TargetPlatform::MSX) // DSK (MSX)
Format("dsk", result.disks, Disk::DiskImageHolder<Storage::Disk::OricMFMDSK>, TargetPlatform::Oric) // DSK (Oric)
Format("g64", result.disks, Disk::DiskImageHolder<Storage::Disk::G64>, TargetPlatform::Commodore) // G64
Format("hdv", result.mass_storage_devices, MassStorage::HDV, TargetPlatform::AppleII) // HDV (Apple II, hard disk, single volume image)
Format( "hfe",
result.disks,
Disk::DiskImageHolder<Storage::Disk::HFE>,
TargetPlatform::Acorn | TargetPlatform::AmstradCPC | TargetPlatform::Commodore | TargetPlatform::Oric | TargetPlatform::ZXSpectrum)
// HFE (TODO: switch to AllDisk once the MSX stops being so greedy)
Format("img", result.disks, Disk::DiskImageHolder<Storage::Disk::MacintoshIMG>, TargetPlatform::Macintosh) // IMG (DiskCopy 4.2)
Format("image", result.disks, Disk::DiskImageHolder<Storage::Disk::MacintoshIMG>, TargetPlatform::Macintosh) // IMG (DiskCopy 4.2)
Format("img", result.disks, Disk::DiskImageHolder<Storage::Disk::FAT12>, TargetPlatform::Enterprise) // IMG (Enterprise/MS-DOS style)
Format( "ipf",
result.disks,
Disk::DiskImageHolder<Storage::Disk::IPF>,
TargetPlatform::Amiga | TargetPlatform::AtariST | TargetPlatform::AmstradCPC | TargetPlatform::ZXSpectrum) // IPF
Format("msa", result.disks, Disk::DiskImageHolder<Storage::Disk::MSA>, TargetPlatform::AtariST) // MSA
Format("mx2", result.cartridges, Cartridge::BinaryDump, TargetPlatform::MSX) // MX2
Format("nib", result.disks, Disk::DiskImageHolder<Storage::Disk::NIB>, TargetPlatform::DiskII) // NIB
Format("o", result.tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // O
Format("p", result.tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // P
Format("po", result.disks, Disk::DiskImageHolder<Storage::Disk::AppleDSK>, TargetPlatform::DiskII) // PO (original Apple II kind)
accumulator.try_standard<Tape::ZX80O81P>(TargetPlatform::ZX8081, "80");
accumulator.try_standard<Tape::ZX80O81P>(TargetPlatform::ZX8081, "81");
// PO (Apple IIgs kind)
if(extension == "po") {
TryInsert(result.disks, Disk::DiskImageHolder<Storage::Disk::MacintoshIMG>, TargetPlatform::AppleIIgs, file_name, Storage::Disk::MacintoshIMG::FixedType::GCR)
accumulator.try_standard<Cartridge::BinaryDump>(TargetPlatform::Atari2600, "a26");
accumulator.try_standard<Disk::DiskImageHolder<Disk::AcornADF>>(TargetPlatform::Acorn, "adf");
accumulator.try_standard<Disk::DiskImageHolder<Disk::AmigaADF>>(TargetPlatform::Amiga, "adf");
accumulator.try_standard<Disk::DiskImageHolder<Disk::AcornADF>>(TargetPlatform::Acorn, "adl");
accumulator.try_standard<Cartridge::BinaryDump>(TargetPlatform::AllCartridge, "bin");
accumulator.try_standard<Tape::CAS>(TargetPlatform::MSX, "cas");
accumulator.try_standard<Tape::TZX>(TargetPlatform::AmstradCPC, "cdt");
accumulator.try_standard<Cartridge::BinaryDump>(TargetPlatform::Coleco, "col");
accumulator.try_standard<Tape::CSW>(TargetPlatform::AllTape, "csw");
accumulator.try_standard<Disk::DiskImageHolder<Disk::D64>>(TargetPlatform::Commodore, "d64");
accumulator.try_standard<MassStorage::DAT>(TargetPlatform::Acorn, "dat");
accumulator.try_standard<Disk::DiskImageHolder<Disk::DMK>>(TargetPlatform::MSX, "dmk");
accumulator.try_standard<Disk::DiskImageHolder<Disk::AppleDSK>>(TargetPlatform::DiskII, "do");
accumulator.try_standard<Disk::DiskImageHolder<Disk::SSD>>(TargetPlatform::Acorn, "dsd");
accumulator.try_standard<Disk::DiskImageHolder<Disk::CPCDSK>>(
TargetPlatform::AmstradCPC | TargetPlatform::Oric | TargetPlatform::ZXSpectrum, "dsk");
accumulator.try_standard<Disk::DiskImageHolder<Disk::AppleDSK>>(TargetPlatform::DiskII, "dsk");
accumulator.try_standard<Disk::DiskImageHolder<Disk::MacintoshIMG>>(TargetPlatform::Macintosh, "dsk");
accumulator.try_standard<MassStorage::HFV>(TargetPlatform::Macintosh, "dsk");
accumulator.try_standard<MassStorage::DSK>(TargetPlatform::Macintosh, "dsk");
accumulator.try_standard<Disk::DiskImageHolder<Disk::FAT12>>(TargetPlatform::MSX, "dsk");
accumulator.try_standard<Disk::DiskImageHolder<Disk::OricMFMDSK>>(TargetPlatform::Oric, "dsk");
accumulator.try_standard<Disk::DiskImageHolder<Disk::G64>>(TargetPlatform::Commodore, "g64");
accumulator.try_standard<MassStorage::HDV>(TargetPlatform::AppleII, "hdv");
accumulator.try_standard<Disk::DiskImageHolder<Disk::HFE>>(
TargetPlatform::Acorn | TargetPlatform::AmstradCPC | TargetPlatform::Commodore | TargetPlatform::Oric | TargetPlatform::ZXSpectrum,
"hfe"); // TODO: switch to AllDisk once the MSX stops being so greedy.
accumulator.try_standard<Disk::DiskImageHolder<Disk::FAT12>>(TargetPlatform::PCCompatible, "ima");
accumulator.try_standard<Disk::DiskImageHolder<Disk::MacintoshIMG>>(TargetPlatform::Macintosh, "image");
accumulator.try_standard<Disk::DiskImageHolder<Disk::IMD>>(TargetPlatform::PCCompatible, "imd");
accumulator.try_standard<Disk::DiskImageHolder<Disk::MacintoshIMG>>(TargetPlatform::Macintosh, "img");
// Treat PC booter as a potential backup only if this doesn't parse as a FAT12.
if(accumulator.name_matches("img")) {
try {
accumulator.insert<Disk::DiskImageHolder<Disk::FAT12>>(TargetPlatform::FAT12, file_name);
} catch(...) {
accumulator.try_standard<Disk::DiskImageHolder<Disk::PCBooter>>(TargetPlatform::PCCompatible, "img");
}
}
Format("p81", result.tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // P81
accumulator.try_standard<Disk::DiskImageHolder<Disk::IPF>>(
TargetPlatform::Amiga | TargetPlatform::AtariST | TargetPlatform::AmstradCPC | TargetPlatform::ZXSpectrum,
"ipf");
// PRG
if(extension == "prg") {
// try instantiating as a ROM; failing that accept as a tape
accumulator.try_standard<Disk::DiskImageHolder<Disk::MSA>>(TargetPlatform::AtariST, "msa");
accumulator.try_standard<Cartridge::BinaryDump>(TargetPlatform::MSX, "mx2");
accumulator.try_standard<Disk::DiskImageHolder<Disk::NIB>>(TargetPlatform::DiskII, "nib");
accumulator.try_standard<Tape::ZX80O81P>(TargetPlatform::ZX8081, "o");
accumulator.try_standard<Tape::ZX80O81P>(TargetPlatform::ZX8081, "p");
accumulator.try_standard<Disk::DiskImageHolder<Disk::AppleDSK>>(TargetPlatform::DiskII, "po");
if(accumulator.name_matches("po")) {
accumulator.try_insert<Disk::DiskImageHolder<Disk::MacintoshIMG>>(
TargetPlatform::AppleIIgs,
file_name, Disk::MacintoshIMG::FixedType::GCR);
}
accumulator.try_standard<Tape::ZX80O81P>(TargetPlatform::ZX8081, "p81");
if(accumulator.name_matches("prg")) {
// Try instantiating as a ROM; failing that accept as a tape.
try {
Insert(result.cartridges, Cartridge::PRG, TargetPlatform::Commodore, file_name)
accumulator.insert<Cartridge::PRG>(TargetPlatform::Commodore, file_name);
} catch(...) {
try {
Insert(result.tapes, Tape::PRG, TargetPlatform::Commodore, file_name)
accumulator.insert<Tape::PRG>(TargetPlatform::Commodore, file_name);
} catch(...) {}
}
}
Format( "rom",
result.cartridges,
Cartridge::BinaryDump,
TargetPlatform::AcornElectron | TargetPlatform::Coleco | TargetPlatform::MSX) // ROM
Format("sg", result.cartridges, Cartridge::BinaryDump, TargetPlatform::Sega) // SG
Format("sms", result.cartridges, Cartridge::BinaryDump, TargetPlatform::Sega) // SMS
Format("ssd", result.disks, Disk::DiskImageHolder<Storage::Disk::SSD>, TargetPlatform::Acorn) // SSD
Format("st", result.disks, Disk::DiskImageHolder<Storage::Disk::FAT12>, TargetPlatform::AtariST) // ST
Format("stx", result.disks, Disk::DiskImageHolder<Storage::Disk::STX>, TargetPlatform::AtariST) // STX
Format("tap", result.tapes, Tape::CommodoreTAP, TargetPlatform::Commodore) // TAP (Commodore)
Format("tap", result.tapes, Tape::OricTAP, TargetPlatform::Oric) // TAP (Oric)
Format("tap", result.tapes, Tape::ZXSpectrumTAP, TargetPlatform::ZXSpectrum) // TAP (ZX Spectrum)
Format("tsx", result.tapes, Tape::TZX, TargetPlatform::MSX) // TSX
Format("tzx", result.tapes, Tape::TZX, TargetPlatform::ZX8081 | TargetPlatform::ZXSpectrum) // TZX
Format("uef", result.tapes, Tape::UEF, TargetPlatform::Acorn) // UEF (tape)
Format("woz", result.disks, Disk::DiskImageHolder<Storage::Disk::WOZ>, TargetPlatform::DiskII) // WOZ
accumulator.try_standard<Cartridge::BinaryDump>(
TargetPlatform::AcornElectron | TargetPlatform::Coleco | TargetPlatform::MSX,
"rom");
#undef Format
#undef Insert
#undef TryInsert
#undef InsertInstance
accumulator.try_standard<Cartridge::BinaryDump>(TargetPlatform::Sega, "sg");
accumulator.try_standard<Cartridge::BinaryDump>(TargetPlatform::Sega, "sms");
accumulator.try_standard<Disk::DiskImageHolder<Disk::SSD>>(TargetPlatform::Acorn, "ssd");
accumulator.try_standard<Disk::DiskImageHolder<Disk::FAT12>>(TargetPlatform::AtariST, "st");
accumulator.try_standard<Disk::DiskImageHolder<Disk::STX>>(TargetPlatform::AtariST, "stx");
return result;
accumulator.try_standard<Tape::CommodoreTAP>(TargetPlatform::Commodore, "tap");
accumulator.try_standard<Tape::OricTAP>(TargetPlatform::Oric, "tap");
accumulator.try_standard<Tape::ZXSpectrumTAP>(TargetPlatform::ZXSpectrum, "tap");
accumulator.try_standard<Tape::TZX>(TargetPlatform::MSX, "tsx");
accumulator.try_standard<Tape::TZX>(TargetPlatform::ZX8081 | TargetPlatform::ZXSpectrum, "tzx");
accumulator.try_standard<Tape::UEF>(TargetPlatform::Acorn, "uef");
accumulator.try_standard<Disk::DiskImageHolder<Disk::WOZ>>(TargetPlatform::DiskII, "woz");
return accumulator.media;
}
Media Analyser::Static::GetMedia(const std::string &file_name) {
@ -241,26 +304,28 @@ Media Analyser::Static::GetMedia(const std::string &file_name) {
}
TargetList Analyser::Static::GetTargets(const std::string &file_name) {
TargetList targets;
const std::string extension = get_extension(file_name);
TargetList targets;
// Check whether the file directly identifies a target; if so then just return that.
#define Format(ext, class) \
if(extension == ext) { \
try { \
auto target = Storage::State::class::load(file_name); \
if(target) { \
targets.push_back(std::move(target)); \
return targets; \
} \
} catch(...) {} \
}
const auto try_snapshot = [&](const char *ext, auto loader) -> bool {
if(extension != ext) {
return false;
}
try {
auto target = loader(file_name);
if(target) {
targets.push_back(std::move(target));
return true;
}
} catch(...) {}
Format("sna", SNA);
Format("szx", SZX);
Format("z80", Z80);
return false;
};
#undef TryInsert
if(try_snapshot("sna", Storage::State::SNA::load)) return targets;
if(try_snapshot("szx", Storage::State::SZX::load)) return targets;
if(try_snapshot("z80", Storage::State::Z80::load)) return targets;
// Otherwise:
//
@ -271,28 +336,33 @@ TargetList Analyser::Static::GetTargets(const std::string &file_name) {
// Hand off to platform-specific determination of whether these
// things are actually compatible and, if so, how to load them.
#define Append(x) if(potential_platforms & TargetPlatform::x) {\
auto new_targets = x::GetTargets(media, file_name, potential_platforms);\
std::move(new_targets.begin(), new_targets.end(), std::back_inserter(targets));\
}
Append(Acorn);
Append(AmstradCPC);
Append(AppleII);
Append(AppleIIgs);
Append(Amiga);
Append(Atari2600);
Append(AtariST);
Append(Coleco);
Append(Commodore);
Append(DiskII);
Append(Enterprise);
Append(Macintosh);
Append(MSX);
Append(Oric);
Append(Sega);
Append(ZX8081);
Append(ZXSpectrum);
#undef Append
const auto append = [&](TargetPlatform::IntType platform, auto evaluator) {
if(!(potential_platforms & platform)) {
return;
}
auto new_targets = evaluator(media, file_name, potential_platforms);
std::move(new_targets.begin(), new_targets.end(), std::back_inserter(targets));
};
append(TargetPlatform::Acorn, Acorn::GetTargets);
append(TargetPlatform::AmstradCPC, AmstradCPC::GetTargets);
append(TargetPlatform::AppleII, AppleII::GetTargets);
append(TargetPlatform::AppleIIgs, AppleIIgs::GetTargets);
append(TargetPlatform::Amiga, Amiga::GetTargets);
append(TargetPlatform::Atari2600, Atari2600::GetTargets);
append(TargetPlatform::AtariST, AtariST::GetTargets);
append(TargetPlatform::Coleco, Coleco::GetTargets);
append(TargetPlatform::Commodore, Commodore::GetTargets);
append(TargetPlatform::DiskII, DiskII::GetTargets);
append(TargetPlatform::Enterprise, Enterprise::GetTargets);
append(TargetPlatform::FAT12, FAT12::GetTargets);
append(TargetPlatform::Macintosh, Macintosh::GetTargets);
append(TargetPlatform::MSX, MSX::GetTargets);
append(TargetPlatform::Oric, Oric::GetTargets);
append(TargetPlatform::PCCompatible, PCCompatible::GetTargets);
append(TargetPlatform::Sega, Sega::GetTargets);
append(TargetPlatform::ZX8081, ZX8081::GetTargets);
append(TargetPlatform::ZXSpectrum, ZXSpectrum::GetTargets);
// Reset any tapes to their initial position.
for(const auto &target : targets) {

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef StaticAnalyser_hpp
#define StaticAnalyser_hpp
#pragma once
#include "../Machines.hpp"
@ -39,12 +38,15 @@ struct Media {
}
Media &operator +=(const Media &rhs) {
#define append(name) name.insert(name.end(), rhs.name.begin(), rhs.name.end());
append(disks);
append(tapes);
append(cartridges);
append(mass_storage_devices);
#undef append
const auto append = [&](auto &destination, auto &source) {
destination.insert(destination.end(), source.begin(), source.end());
};
append(disks, rhs.disks);
append(tapes, rhs.tapes);
append(cartridges, rhs.cartridges);
append(mass_storage_devices, rhs.mass_storage_devices);
return *this;
}
};
@ -55,7 +57,7 @@ struct Media {
*/
struct Target {
Target(Machine machine) : machine(machine) {}
virtual ~Target() {}
virtual ~Target() = default;
// This field is entirely optional.
std::unique_ptr<Reflection::Struct> state;
@ -79,5 +81,3 @@ TargetList GetTargets(const std::string &file_name);
Media GetMedia(const std::string &file_name);
}
#endif /* StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_ZX8081_StaticAnalyser_hpp
#define Analyser_Static_ZX8081_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::ZX8081 {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_ZX8081_Target_h
#define Analyser_Static_ZX8081_Target_h
#pragma once
#include "../../../Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp"
@ -39,5 +38,3 @@ struct Target: public ::Analyser::Static::Target, public Reflection::StructImpl<
};
}
#endif /* Analyser_Static_ZX8081_Target_h */

View File

@ -33,14 +33,14 @@ bool IsSpectrumTape(const std::shared_ptr<Storage::Tape::Tape> &tape) {
}
bool IsSpectrumDisk(const std::shared_ptr<Storage::Disk::Disk> &disk) {
Storage::Encodings::MFM::Parser parser(true, disk);
Storage::Encodings::MFM::Parser parser(Storage::Encodings::MFM::Density::Double, disk);
// Get logical sector 1; the Spectrum appears to support various physical
// sectors as sector 1.
Storage::Encodings::MFM::Sector *boot_sector = nullptr;
const Storage::Encodings::MFM::Sector *boot_sector = nullptr;
uint8_t sector_mask = 0;
while(!boot_sector) {
boot_sector = parser.get_sector(0, 0, sector_mask + 1);
boot_sector = parser.sector(0, 0, sector_mask + 1);
sector_mask += 0x40;
if(!sector_mask) break;
}

View File

@ -6,8 +6,7 @@
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_ZXSpectrum_StaticAnalyser_hpp
#define Analyser_Static_ZXSpectrum_StaticAnalyser_hpp
#pragma once
#include "../StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp"
@ -18,5 +17,3 @@ namespace Analyser::Static::ZXSpectrum {
TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms);
}
#endif /* StaticAnalyser_hpp */

View File

@ -6,8 +6,7 @@
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef Analyser_Static_ZXSpectrum_Target_h
#define Analyser_Static_ZXSpectrum_Target_h
#pragma once
#include "../../../Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp"
@ -37,5 +36,3 @@ struct Target: public ::Analyser::Static::Target, public Reflection::StructImpl<
};
}
#endif /* Target_h */

99
BUILD.md Normal file
View File

@ -0,0 +1,99 @@
![Clock Signal Application Icon](READMEImages/Icon.png)
# Building Clock Signal
Clock Signal is available as [a macOS native application using
Metal](#macos-app) or as [a cross-platform command-line-driven SDL executable
using OpenGL](#sdl-app).
## macOS app
The macOS native application requires a Metal-capable Mac running macOS 10.13 or
later and has no prerequisites beyond the normal system libraries. It can be
built [using Xcode](#building-the-macos-app-using-xcode) or on the command line
[using `xcodebuild`](#building-the-macos-app-using-xcodebuild).
Machine ROMs are intended to be built into the application bundle; populate the
dummy folders below ROMImages before building.
The Xcode project is configured to sign the application using the developer's
certificate, but if you are not the developer then you will get a "No signing
certificate" error. To avoid this, you'll specify that you want to sign the
application to run locally.
### Building the macOS app using Xcode
Open the Clock Signal Xcode project in OSBindings/Mac.
To avoid signing errors, edit the project, select the Signing & Capabilities
tab, and change the Signing Certificate drop-down menu from "Development" to
"Sign to Run Locally".
To avoid crashes when running Clock Signal via Xcode on older Macs due to
"unrecognized selector sent to instance" errors, edit the scheme, and in the Run
section, scroll down to the Metal heading and uncheck the "API Validation"
checkbox.
To build, choose "Build" from Xcode's Product menu or press
<kbd>Command</kbd> + <kbd>B</kbd>.
To build and run, choose "Run" from the Product menu or press
<kbd>Command</kbd> + <kbd>R</kbd>.
To see the folder where the Clock Signal application was built, choose "Show
Build Folder in Finder" from the Product menu. Look in the "Products" folder for
a folder named after the configuration (e.g. "Debug" or "Release").
### Building the macOS app using `xcodebuild`
To build, change to the OSBindings/Mac directory in the Terminal, then run
`xcodebuild`, specifying `-` as the code sign identity to sign the application
to run locally to avoid signing errors:
cd OSBindings/Mac
xcodebuild CODE_SIGN_IDENTITY=-
`xcodebuild` will create a "build" folder in this directory which is where you
can find the Clock Signal application after it's compiled, in a directory named
after the configuration (e.g. "Debug" or "Release").
## SDL app
The SDL app can be built on Linux, BSD, macOS, and other Unix-like operating
systems. Prerequisites are SDL 2, ZLib and OpenGL (or Mesa). OpenGL 3.2 or
better is required at runtime. It can be built [using
SCons](#building-the-sdl-app-using-scons).
### Building the SDL app using SCons
To build, change to the OSBindings/SDL directory and run `scons`. You can add a
`-j` flag to build in parallel. For example, if you have 8 processor cores:
cd OSBindings/SDL
scons -j8
The `clksignal` executable will be created in this directory. You can run it
from here or install it by copying it where you want it, for example:
cp clksignal /usr/local/bin
To start an emulator with a particular disk image `file`, if you've installed
`clksignal` to a directory in your `PATH`, run:
clksignal file
Or if you're running it from the current directory:
./clksignal file
Other options are availble. Run `clksignal` or `./clksignal` with no arguments
to learn more.
Setting up `clksignal` as the associated program for supported file types in
your favoured filesystem browser is recommended; it has no file navigation
abilities of its own.
Some emulated systems require the provision of original machine ROMs. These are
not included and may be located in either /usr/local/share/CLK/ or
/usr/share/CLK/. You will be prompted for them if they are found to be missing.
The structure should mirror that under OSBindings in the source archive; see the
readme.txt in each folder to determine the proper files and names ahead of time.

View File

@ -1,30 +0,0 @@
Linux, BSD
==========
Prerequisites are SDL 2, ZLib and OpenGL (or Mesa), and SCons for the provided build script. OpenGL 3.2 or better is required at runtime.
Build:
cd OSBindings/SDL
scons
Optionally:
cp clksignal /usr/bin
To launch:
clksignal file
Setting up clksignal as the associated program for supported file types in your favoured filesystem browser is recommended; it has no file navigation abilities of its own.
Some emulated systems require the provision of original machine ROMs. These are not included and may be located in either /usr/local/share/CLK/ or /usr/share/CLK/. You will be prompted for them if they are found to be missing. The structure should mirror that under OSBindings in the source archive; see the readme.txt in each folder to determine the proper files and names ahead of time.
macOS
=====
There are no prerequisites beyond the normal system libraries; the macOS build is a native Cocoa application.
Build: open the Xcode project in OSBindings/Mac and press command+b.
Machine ROMs are intended to be built into the application bundle; populate the dummy folders below ROMImages before building.

70
CMakeLists.txt Normal file
View File

@ -0,0 +1,70 @@
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
project(CLK
LANGUAGES CXX
VERSION 24.01.22
)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CLK_UIS "SDL")
#list(PREPEND CLK_UIS "QT")
#if(APPLE)
# list(PREPEND CLK_UIS "MAC")
# set(CLK_DEFAULT_UI "MAC")
#else()
set(CLK_DEFAULT_UI "SDL")
#endif()
set(CLK_UI ${CLK_DEFAULT_UI} CACHE STRING "User interface")
set_property(CACHE CLK_UI PROPERTY STRINGS ${CLK_UIS})
if(NOT CLK_UI IN_LIST CLK_UIS)
list(JOIN CLK_UIS ", " CLK_UIS_PRETTY)
message(FATAL_ERROR "Invalid value for 'CLK_UI'; must be one of ${CLK_UIS_PRETTY}")
endif()
message(STATUS "Configuring for ${CLK_UI} UI")
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include("CLK_SOURCES")
add_executable(clksignal ${CLK_SOURCES})
if(MSVC)
target_compile_options(clksignal PRIVATE /W4)
else()
# TODO: Add -Wpedandic.
target_compile_options(clksignal PRIVATE -Wall -Wextra)
endif()
find_package(ZLIB REQUIRED)
target_link_libraries(clksignal PRIVATE ZLIB::ZLIB)
if(CLK_UI STREQUAL "MAC")
enable_language(OBJC OBJCXX SWIFT)
# TODO: Build the Mac version.
else()
find_package(OpenGL REQUIRED)
target_link_libraries(clksignal PRIVATE OpenGL::GL)
if(APPLE)
target_compile_definitions(clksignal PRIVATE "GL_SILENCE_DEPRECATION" "IGNORE_APPLE")
endif()
endif()
if(CLK_UI STREQUAL "QT")
# TODO: Build the Qt version.
elseif(APPLE)
set(BLA_VENDOR Apple)
find_package(BLAS REQUIRED)
target_link_libraries(clksignal PRIVATE BLAS::BLAS)
endif()
if(CLK_UI STREQUAL "SDL")
find_package(SDL2 REQUIRED CONFIG REQUIRED COMPONENTS SDL2)
target_link_libraries(clksignal PRIVATE SDL2::SDL2)
endif()
# TODO: Investigate building on Windows.

View File

@ -6,8 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef ClockReceiver_hpp
#define ClockReceiver_hpp
#pragma once
#include "ForceInline.hpp"
@ -277,5 +276,3 @@ template <class T> class HalfClockReceiver: public T {
private:
HalfCycles half_cycles_;
};
#endif /* ClockReceiver_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef ClockingHintSource_hpp
#define ClockingHintSource_hpp
#pragma once
namespace ClockingHint {
@ -84,5 +83,3 @@ class Source {
};
}
#endif /* ClockingHintSource_h */

View File

@ -6,8 +6,7 @@
// Copyright © 2018 Thomas Harte. All rights reserved.
//
#ifndef DeferredQueue_h
#define DeferredQueue_h
#pragma once
#include <functional>
#include <vector>
@ -74,6 +73,11 @@ template <typename TimeUnit> class DeferredQueue {
}
}
/// @returns @c true if no actions are enqueued; @c false otherwise.
bool empty() const {
return pending_actions_.empty();
}
private:
// The list of deferred actions.
struct DeferredAction {
@ -120,5 +124,3 @@ template <typename TimeUnit> class DeferredQueuePerformer: public DeferredQueue<
private:
std::function<void(TimeUnit)> target_;
};
#endif /* DeferredQueue_h */

View File

@ -6,8 +6,7 @@
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef DeferredValue_h
#define DeferredValue_h
#pragma once
/*!
Provides storage for a single deferred value: one with a current value and a certain number
@ -44,5 +43,3 @@ template <int DeferredDepth, typename ValueT> class DeferredValue {
(backlog[DeferredDepth / elements_per_uint32] & insert_mask) | (value << insert_shift);
}
};
#endif /* DeferredValue_h */

View File

@ -6,8 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef ForceInline_hpp
#define ForceInline_hpp
#pragma once
#ifndef NDEBUG
@ -22,5 +21,3 @@
#endif
#endif
#endif /* ForceInline_h */

View File

@ -6,8 +6,7 @@
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#ifndef JustInTime_h
#define JustInTime_h
#pragma once
#include "ClockReceiver.hpp"
#include "../Concurrency/AsyncTaskQueue.hpp"
@ -335,5 +334,3 @@ template <class T, class LocalTimeScale = HalfCycles, class TargetTimeScale = Lo
bool is_flushed_ = true;
Concurrency::AsyncTaskQueue<true> task_queue_;
};
#endif /* JustInTime_h */

View File

@ -6,8 +6,7 @@
// Copyright © 2020 Thomas Harte. All rights reserved.
//
#ifndef ScanSynchroniser_h
#define ScanSynchroniser_h
#pragma once
#include "../Outputs/ScanTarget.hpp"
@ -84,5 +83,3 @@ class ScanSynchroniser {
};
}
#endif /* ScanSynchroniser_h */

View File

@ -6,8 +6,7 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef TimeTypes_h
#define TimeTypes_h
#pragma once
#include <chrono>
@ -25,6 +24,3 @@ inline Seconds seconds(Nanos nanos) {
}
}
#endif /* TimeTypes_h */

View File

@ -6,8 +6,7 @@
// Copyright © 2020 Thomas Harte. All rights reserved.
//
#ifndef VSyncPredictor_hpp
#define VSyncPredictor_hpp
#pragma once
#include "TimeTypes.hpp"
#include <cassert>
@ -151,5 +150,3 @@ class VSyncPredictor {
};
}
#endif /* VSyncPredictor_hpp */

View File

@ -9,10 +9,12 @@
#include "1770.hpp"
#include "../../Storage/Disk/Encodings/MFM/Constants.hpp"
#define LOG_PREFIX "[WD FDC] "
#include "../../Outputs/Log.hpp"
namespace {
Log::Logger<Log::Source::WDFDC> logger;
}
using namespace WD;
WD1770::WD1770(Personality p) :
@ -29,10 +31,10 @@ void WD1770::write(int address, uint8_t value) {
if((value&0xf0) == 0xd0) {
if(value == 0xd0) {
// Force interrupt **immediately**.
LOG("Force interrupt immediately");
logger.info().append("Force interrupt immediately");
posit_event(int(Event1770::ForceInterrupt));
} else {
ERROR("!!!TODO: force interrupt!!!");
logger.error().append("TODO: force interrupt");
update_status([] (Status &status) {
status.type = Status::One;
});
@ -99,14 +101,14 @@ uint8_t WD1770::read(int address) {
if(status_.type == Status::One)
status |= (status_.spin_up ? Flag::SpinUp : 0);
}
// LOG("Returned status " << PADHEX(2) << int(status) << " of type " << 1+int(status_.type));
// logger.info().append("Returned status %02x of type %d", status, 1+int(status_.type));
return status;
}
case 1:
LOG("Returned track " << int(track_));
logger.info().append("Returned track %d", track_);
return track_;
case 2:
LOG("Returned sector " << int(sector_));
logger.info().append("Returned sector %d", sector_);
return sector_;
case 3:
update_status([] (Status &status) {
@ -212,7 +214,7 @@ void WD1770::posit_event(int new_event_type) {
// Wait for a new command, branch to the appropriate handler.
case 0:
wait_for_command:
LOG("Idle...");
logger.info().append("Idle...");
set_data_mode(DataMode::Scanning);
index_hole_count_ = 0;
@ -229,7 +231,7 @@ void WD1770::posit_event(int new_event_type) {
status.track_zero = false; // Always reset by a non-type 1; so reset regardless and set properly later.
});
LOG("Starting " << PADHEX(2) << int(command_));
logger.info().append("Starting %02x", command_);
if(!(command_ & 0x80)) goto begin_type_1;
if(!(command_ & 0x40)) goto begin_type_2;
@ -259,7 +261,7 @@ void WD1770::posit_event(int new_event_type) {
status.data_request = false;
});
LOG("Step/Seek/Restore with track " << int(track_) << " data " << int(data_));
logger.info().append("Step/Seek/Restore with track %d data %d", track_, data_);
if(!has_motor_on_line() && !has_head_load_line()) goto test_type1_type;
if(has_motor_on_line()) goto begin_type1_spin_up;
@ -339,7 +341,7 @@ void WD1770::posit_event(int new_event_type) {
READ_ID();
if(index_hole_count_ == 6) {
LOG("Nothing found to verify");
logger.info().append("Nothing found to verify");
update_status([] (Status &status) {
status.seek_error = true;
});
@ -357,7 +359,7 @@ void WD1770::posit_event(int new_event_type) {
}
if(header_[0] == track_) {
LOG("Reached track " << std::dec << int(track_));
logger.info().append("Reached track %d", track_);
update_status([] (Status &status) {
status.crc_error = false;
});
@ -430,7 +432,7 @@ void WD1770::posit_event(int new_event_type) {
READ_ID();
if(index_hole_count_ == 5) {
LOG("Failed to find sector " << std::dec << int(sector_));
logger.info().append("Failed to find sector %d", sector_);
update_status([] (Status &status) {
status.record_not_found = true;
});
@ -440,12 +442,12 @@ void WD1770::posit_event(int new_event_type) {
distance_into_section_ = 0;
set_data_mode(DataMode::Scanning);
LOG("Considering " << std::dec << int(header_[0]) << "/" << int(header_[2]));
logger.info().append("Considering %d/%d", header_[0], header_[2]);
if( header_[0] == track_ && header_[2] == sector_ &&
(has_motor_on_line() || !(command_&0x02) || ((command_&0x08) >> 3) == header_[1])) {
LOG("Found " << std::dec << int(header_[0]) << "/" << int(header_[2]));
logger.info().append("Found %d/%d", header_[0], header_[2]);
if(get_crc_generator().get_value()) {
LOG("CRC error; back to searching");
logger.info().append("CRC error; back to searching");
update_status([] (Status &status) {
status.crc_error = true;
});
@ -503,18 +505,18 @@ void WD1770::posit_event(int new_event_type) {
set_data_mode(DataMode::Scanning);
if(get_crc_generator().get_value()) {
LOG("CRC error; terminating");
logger.info().append("CRC error; terminating");
update_status([] (Status &status) {
status.crc_error = true;
});
goto wait_for_command;
}
LOG("Finished reading sector " << std::dec << int(sector_));
logger.info().append("Finished reading sector %d", sector_);
if(command_ & 0x10) {
sector_++;
LOG("Advancing to search for sector " << std::dec << int(sector_));
logger.info().append("Advancing to search for sector %d", sector_);
goto test_type2_write_protection;
}
goto wait_for_command;
@ -598,7 +600,7 @@ void WD1770::posit_event(int new_event_type) {
sector_++;
goto test_type2_write_protection;
}
LOG("Wrote sector " << std::dec << int(sector_));
logger.info().append("Wrote sector %d", sector_);
goto wait_for_command;

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef _770_hpp
#define _770_hpp
#pragma once
#include "../../Storage/Disk/Controller/MFMDiskController.hpp"
@ -31,7 +30,7 @@ class WD1770: public Storage::Disk::MFMController {
@param p The type of controller to emulate.
*/
WD1770(Personality p);
virtual ~WD1770() {}
virtual ~WD1770() = default;
/// Sets the value of the double-density input; when @c is_double_density is @c true, reads and writes double-density format data.
using Storage::Disk::MFMController::set_is_double_density;
@ -141,5 +140,3 @@ class WD1770: public Storage::Disk::MFMController {
};
}
#endif /* _770_hpp */

View File

@ -8,13 +8,11 @@
#include "ncr5380.hpp"
#ifndef NDEBUG
#define NDEBUG
#endif
#define LOG_PREFIX "[5380] "
#include "../../Outputs/Log.hpp"
namespace {
Log::Logger<Log::Source::NCR5380> logger;
}
// TODO:
//
// end_of_dma_ should be set if: /EOP && /DACK && (/RD || /WR); for at least 100ns.
@ -38,7 +36,7 @@ NCR5380::NCR5380(SCSI::Bus &bus, int clock_rate) :
void NCR5380::write(int address, uint8_t value, bool) {
switch(address & 7) {
case 0:
LOG("[0] Set current SCSI bus state to " << PADHEX(2) << int(value));
logger.info().append("[0] Set current SCSI bus state to %02x", value);
data_bus_ = value;
if(dma_request_ && dma_operation_ == DMAOperation::Send) {
@ -47,7 +45,7 @@ void NCR5380::write(int address, uint8_t value, bool) {
break;
case 1: {
LOG("[1] Initiator command register set: " << PADHEX(2) << int(value));
logger.info().append("[1] Initiator command register set: %02x", value);
initiator_command_ = value;
bus_output_ &= ~(Line::Reset | Line::Acknowledge | Line::Busy | Line::SelectTarget | Line::Attention);
@ -63,7 +61,7 @@ void NCR5380::write(int address, uint8_t value, bool) {
} break;
case 2:
LOG("[2] Set mode: " << PADHEX(2) << int(value));
logger.info().append("[2] Set mode: %02x", value);
mode_ = value;
// bit 7: 1 = use block mode DMA mode (if DMA mode is also enabled)
@ -104,27 +102,27 @@ void NCR5380::write(int address, uint8_t value, bool) {
break;
case 3: {
LOG("[3] Set target command: " << PADHEX(2) << int(value));
logger.info().append("[3] Set target command: %02x", value);
target_command_ = value;
update_control_output();
} break;
case 4:
LOG("[4] Set select enabled: " << PADHEX(2) << int(value));
logger.info().append("[4] Set select enabled: %02x", value);
break;
case 5:
LOG("[5] Start DMA send: " << PADHEX(2) << int(value));
logger.info().append("[5] Start DMA send: %02x", value);
dma_operation_ = DMAOperation::Send;
break;
case 6:
LOG("[6] Start DMA target receive: " << PADHEX(2) << int(value));
logger.info().append("[6] Start DMA target receive: %02x", value);
dma_operation_ = DMAOperation::TargetReceive;
break;
case 7:
LOG("[7] Start DMA initiator receive: " << PADHEX(2) << int(value));
logger.info().append("[7] Start DMA initiator receive: %02x", value);
dma_operation_ = DMAOperation::InitiatorReceive;
break;
}
@ -148,7 +146,7 @@ void NCR5380::write(int address, uint8_t value, bool) {
uint8_t NCR5380::read(int address, bool) {
switch(address & 7) {
case 0:
LOG("[0] Get current SCSI bus state: " << PADHEX(2) << (bus_.get_state() & 0xff));
logger.info().append("[0] Get current SCSI bus state: %02x", (bus_.get_state() & 0xff));
if(dma_request_ && dma_operation_ == DMAOperation::InitiatorReceive) {
return dma_acknowledge();
@ -156,7 +154,7 @@ uint8_t NCR5380::read(int address, bool) {
return uint8_t(bus_.get_state());
case 1:
LOG("[1] Initiator command register get: " << (arbitration_in_progress_ ? 'p' : '-') << (lost_arbitration_ ? 'l' : '-'));
logger.info().append("[1] Initiator command register get: %c%c", arbitration_in_progress_ ? 'p' : '-', lost_arbitration_ ? 'l' : '-');
return
// Bits repeated as they were set.
(initiator_command_ & ~0x60) |
@ -168,11 +166,11 @@ uint8_t NCR5380::read(int address, bool) {
(lost_arbitration_ ? 0x20 : 0x00);
case 2:
LOG("[2] Get mode");
logger.info().append("[2] Get mode");
return mode_;
case 3:
LOG("[3] Get target command");
logger.info().append("[3] Get target command");
return target_command_;
case 4: {
@ -186,7 +184,7 @@ uint8_t NCR5380::read(int address, bool) {
((bus_state & Line::Input) ? 0x04 : 0x00) |
((bus_state & Line::SelectTarget) ? 0x02 : 0x00) |
((bus_state & Line::Parity) ? 0x01 : 0x00);
LOG("[4] Get current bus state: " << PADHEX(2) << int(result));
logger.info().append("[4] Get current bus state: %02x", result);
return result;
}
@ -201,16 +199,16 @@ uint8_t NCR5380::read(int address, bool) {
/* b2 = busy error */
((bus_state & Line::Attention) ? 0x02 : 0x00) |
((bus_state & Line::Acknowledge) ? 0x01 : 0x00);
LOG("[5] Get bus and status: " << PADHEX(2) << int(result));
logger.info().append("[5] Get bus and status: %02x", result);
return result;
}
case 6:
LOG("[6] Get input data");
logger.info().append("[6] Get input data");
return 0xff;
case 7:
LOG("[7] Reset parity/interrupt");
logger.info().append("[7] Reset parity/interrupt");
irq_ = false;
return 0xff;
}

View File

@ -6,8 +6,7 @@
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#ifndef ncr5380_hpp
#define ncr5380_hpp
#pragma once
#include <cstdint>
@ -86,5 +85,3 @@ class NCR5380 final: public SCSI::Bus::Observer {
};
}
#endif /* ncr5380_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2016 Thomas Harte. All rights reserved.
//
#ifndef _522_hpp
#define _522_hpp
#pragma once
#include <cstdint>
@ -69,7 +68,7 @@ class IRQDelegatePortHandler: public PortHandler {
/// Sets the delegate that will receive notification of changes in the interrupt line.
void set_interrupt_delegate(Delegate *delegate);
/// Overrides PortHandler::set_interrupt_status, notifying the delegate if one is set.
/// Overrides @c PortHandler::set_interrupt_status, notifying the delegate if one is set.
void set_interrupt_status(bool new_status);
private:
@ -140,5 +139,3 @@ template <class BusHandlerT> class MOS6522: public MOS6522Storage {
}
#include "Implementation/6522Implementation.hpp"
#endif /* _522_hpp */

View File

@ -6,8 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef _522Storage_hpp
#define _522Storage_hpp
#pragma once
#include <cstdint>
@ -107,5 +106,3 @@ class MOS6522Storage {
};
}
#endif /* _522Storage_hpp */

View File

@ -6,8 +6,7 @@
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef _526_h
#define _526_h
#pragma once
#include <cstdint>
@ -83,10 +82,10 @@ template <typename PortHandlerT, Personality personality> class MOS6526:
void advance_counters(int);
bool serial_line_did_produce_bit(Serial::Line<true> *line, int bit) final;
Log::Logger<Log::Source::MOS6526> log;
};
}
#include "Implementation/6526Implementation.hpp"
#endif /* _526_h */

View File

@ -6,11 +6,7 @@
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef _526Implementation_h
#define _526Implementation_h
#include <cassert>
#include <cstdio>
#pragma once
namespace MOS::MOS6526 {
@ -133,13 +129,11 @@ void MOS6526<BusHandlerT, personality>::write(int address, uint8_t value) {
// Shift control.
case 12:
printf("TODO: write to shift register\n");
log.error().append("TODO: write to shift register");
break;
default:
printf("Unhandled 6526 write: %02x to %d\n", value, address);
assert(false);
break;
// Logically unreachable.
default: break;
}
}
@ -180,10 +174,8 @@ uint8_t MOS6526<BusHandlerT, personality>::read(int address) {
// Shift register.
case 12: return shift_data_;
default:
printf("Unhandled 6526 read from %d\n", address);
assert(false);
break;
// Logically unreachable.
default: break;
}
return 0xff;
}
@ -238,5 +230,3 @@ bool MOS6526<BusHandlerT, personality>::serial_line_did_produce_bit(Serial::Line
}
}
#endif /* _526Implementation_h */

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