1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-09-12 02:24:31 +00:00

Compare commits

...

607 Commits

Author SHA1 Message Date
Thomas Harte
035713b4d3 Remove logging. 2025-09-10 23:00:42 -04:00
Thomas Harte
54b7dc56b5 Resolve risk of acknowledged interrupt refiring. 2025-09-10 22:59:57 -04:00
Thomas Harte
7fd39f44d0 Add some logging, take a stab at returning requests. 2025-09-10 21:46:58 -04:00
Thomas Harte
691292501a Promote constexprs to static. 2025-09-10 21:46:44 -04:00
Thomas Harte
a58158ae08 Add PIT and PIC. 2025-09-10 21:45:51 -04:00
Thomas Harte
ef09b971fa Watch software interrupt flags.
Now tracking: issue seems to be reaching TEST4.ASM:D11 with an interrupt that it believes to be software-originating.
2025-09-10 15:47:19 -04:00
Thomas Harte
e07dee380d Experiment with further delays. 2025-09-10 14:18:30 -04:00
Thomas Harte
125bc5baa6 Install communication delay. 2025-09-10 13:48:51 -04:00
Thomas Harte
995444b11b Add TODO on what seems to be the current issue. 2025-09-10 11:33:38 -04:00
Thomas Harte
8f2384dbfc Fix log entry interleaving. 2025-09-10 09:52:55 -04:00
Thomas Harte
0cdd1c23ce Guess at another ID.
Cf. https://stanislavs.org/helppc/keyboard_commands.html
2025-09-09 23:40:55 -04:00
Thomas Harte
4765a39759 New guess: writing to the keyboard implicitly enables communications. 2025-09-09 23:38:21 -04:00
Thomas Harte
7f4047772c Continue naming things. 2025-09-09 15:36:02 -04:00
Thomas Harte
45c4ca6bec Attempt further to elide storage. 2025-09-09 13:58:37 -04:00
Thomas Harte
4a573a5aae Clarify one magic constant. 2025-09-09 13:44:31 -04:00
Thomas Harte
5125ff6a8c Combine enables, silence port 61 for now. 2025-09-09 11:16:42 -04:00
Thomas Harte
482d3301ce Avoid faulty sector access. 2025-09-08 23:14:50 -04:00
Thomas Harte
cdeec8ac47 Take various more failed swings at which bits do what. 2025-09-08 22:54:10 -04:00
Thomas Harte
3cef12b53b Reintroduce proper ordering of log comments. 2025-09-08 22:27:40 -04:00
Thomas Harte
dd098a16a8 Log more. 2025-09-08 21:54:56 -04:00
Thomas Harte
61a175e84a Merge branch 'master' into Keyboard 2025-09-08 21:43:25 -04:00
Thomas Harte
a5bcd38fe8 Slightly reformat. 2025-09-08 21:43:18 -04:00
Thomas Harte
cad42beef4 Roll in some random style improvements. 2025-09-08 20:38:50 -04:00
Thomas Harte
5a57958639 Reduce log repetition. 2025-09-08 17:22:53 -04:00
Thomas Harte
260336c1e5 Adopt phase as communicative of whether more bytes are expected. 2025-09-08 17:13:27 -04:00
Thomas Harte
889cb9c78f Attempt a dual-queue solution to enabling/disabling keyboard. 2025-09-08 14:40:08 -04:00
Thomas Harte
b90e8f5af3 Further tweak reporting. 2025-09-06 23:16:10 -04:00
Thomas Harte
12361d2854 Adopt proper error/info distinction. 2025-09-06 23:13:33 -04:00
Thomas Harte
d307ddfa8e Merge branch 'master' into Keyboard 2025-09-05 23:21:41 -04:00
Thomas Harte
96fd0b7892 Merge pull request #1553 from TomHarte/IndentationSomeMore
Further reduce indentation.
2025-09-05 23:20:19 -04:00
Thomas Harte
6f1db15d7c Further reduce indentation. 2025-09-05 23:07:45 -04:00
Thomas Harte
1854296ee8 Merge pull request #1552 from TomHarte/ElectronIDE
Reduce code duplication within the ROM catalogue.
2025-09-05 22:45:55 -04:00
Thomas Harte
515cc5f326 Correct spelling. 2025-09-05 22:09:38 -04:00
Thomas Harte
091be7eafe Remove unused header. 2025-09-05 22:03:45 -04:00
Thomas Harte
27a19ea417 Eliminate line-length violations. 2025-09-05 22:03:19 -04:00
Thomas Harte
9a5e9af67c Standardise layout. 2025-09-05 22:00:42 -04:00
Thomas Harte
3a493f2428 Merge pull request #1551 from TomHarte/LogLevels
Allow logging of errors but not info.
2025-09-05 21:04:56 -04:00
Thomas Harte
ca6e34f4b4 Fix dangling OpenGL accesses. 2025-09-05 19:30:33 -04:00
Thomas Harte
e1e68312c4 Transcribe remaining catalogue entries. 2025-09-05 17:23:38 -04:00
Thomas Harte
c7ff2cece4 Head in search of a more-compact form. 2025-09-05 16:55:00 -04:00
Thomas Harte
8e6f4fa36f Fix NDEBUG route. 2025-09-05 14:34:08 -04:00
Thomas Harte
4d302da9fa Allow logging of errors but not info. 2025-09-05 14:25:56 -04:00
Thomas Harte
e0917dc734 Switch focus back to keyboard. 2025-09-04 22:21:05 -04:00
Thomas Harte
26f82e8143 Merge pull request #1550 from TomHarte/SpaceshipOperator
Adopt spaceship.
2025-09-04 22:08:35 -04:00
Thomas Harte
6518f08bc7 Adopt spaceship. 2025-09-04 21:25:12 -04:00
Thomas Harte
8599123b30 Merge pull request #1549 from TomHarte/MoreFDC
Implement further FDC commands.
2025-09-04 19:25:32 -04:00
Thomas Harte
f934a1aa10 Ensure std::hash is known. 2025-09-04 17:53:18 -04:00
Thomas Harte
81be5f809f Fix logged statement. 2025-09-04 17:48:50 -04:00
Thomas Harte
8bb94804d4 Attempt to bluster to something for read ID. 2025-09-04 17:45:41 -04:00
Thomas Harte
c3f64e85ce Support unordered maps; use spaceship operator. 2025-09-04 17:39:09 -04:00
Thomas Harte
53057aff5d Reduce type redundancy. 2025-09-04 17:29:34 -04:00
Thomas Harte
8cad5ac7e9 Reduce repetitive array references. 2025-09-04 17:00:10 -04:00
Thomas Harte
b4f643f3dd Merge pull request #1541 from TomHarte/Spelling
Adopt my native spelling: 'licence' is a noun.
2025-09-04 16:01:11 -04:00
Thomas Harte
2d659289e8 Merge pull request #1546 from TomHarte/SomeIDE
Add some IDE/ATA structure.
2025-09-04 15:58:26 -04:00
Thomas Harte
9883640b63 Better record scope of incomplete work. 2025-09-04 15:22:04 -04:00
Thomas Harte
bc3a0c3c91 Fix stqtic declaration. 2025-09-04 15:17:24 -04:00
Thomas Harte
4e822347a5 Finally crack case of controller failure. 2025-09-04 15:16:48 -04:00
Thomas Harte
d5650da8c0 Avoid strict aliasing violation. 2025-09-04 14:23:29 -04:00
Thomas Harte
d3c77523c3 Report normal terminations, usually. 2025-09-04 11:41:29 -04:00
Thomas Harte
787a5ce568 Reduce speed multiplier. 2025-09-03 22:22:12 -04:00
Thomas Harte
91dfd405d1 Adjust logging. 2025-09-03 13:44:30 -04:00
Thomas Harte
08c615c493 Improve ready flag. 2025-09-03 13:31:06 -04:00
Thomas Harte
5483102276 Add missing #includes. 2025-09-02 21:29:49 -04:00
Thomas Harte
32686d898b Fix again for concurrent seeks. 2025-09-02 21:18:35 -04:00
Thomas Harte
4b50c8d96c Toy with sense interrupt status being directly seek-linked. 2025-09-02 17:50:59 -04:00
Thomas Harte
c1780ee26b Add some form of sense drive status. 2025-09-02 15:21:11 -04:00
Thomas Harte
46b2db00bc Establish that the AT actually wants SenseDriveStatus. 2025-09-02 12:52:04 -04:00
Thomas Harte
7042e457ab Fix OUT sizes. 2025-09-02 12:32:27 -04:00
Thomas Harte
faeec1701f Add logging, reduce template specialisation. 2025-09-02 12:31:16 -04:00
Thomas Harte
2a75a1f9f2 Add IDE logging. 2025-09-02 12:21:01 -04:00
Thomas Harte
8c65dccc53 Support 16-bit IO access. 2025-09-01 23:31:31 -04:00
Thomas Harte
de7c3ba92f Mostly kick IDE accesses down the road. 2025-09-01 00:02:16 -04:00
Thomas Harte
ac204aadd2 Clean up, better constify SCSI innards. 2025-08-31 10:56:01 -04:00
Thomas Harte
46fc0d677f Merge branch 'master' into SomeIDE 2025-08-30 23:52:58 -04:00
Thomas Harte
2d4f4b0036 Merge pull request #1545 from TomHarte/SomeConsts
Improve `const` arguments.
2025-08-30 23:36:49 -04:00
Thomas Harte
c1de00bf9d Improve const arguments. 2025-08-30 23:25:19 -04:00
Thomas Harte
4639e1c47c Merge pull request #1544 from TomHarte/Macros
Further reduce historical dependence on macros.
2025-08-30 14:19:17 -04:00
Thomas Harte
5d2c156bc9 Use popcount. 2025-08-30 10:44:00 -04:00
Thomas Harte
357f98f015 Remove macros, shorten line lengths. 2025-08-30 10:41:28 -04:00
Thomas Harte
62f23ac27c Commute macros. 2025-08-30 10:34:49 -04:00
Thomas Harte
0936646ef9 Eliminate macros. 2025-08-30 10:29:53 -04:00
Thomas Harte
856c12f46f Eliminate macro. 2025-08-30 10:24:27 -04:00
Thomas Harte
7489783837 Eliminate macros. 2025-08-30 10:22:21 -04:00
Thomas Harte
a4f0a4c310 Merge pull request #1543 from TomHarte/MinorTidies
Perform further tidying steps.
2025-08-30 10:00:41 -04:00
Thomas Harte
bb1ef114f1 Fix header declaration. 2025-08-30 09:40:06 -04:00
Thomas Harte
f1610b6407 Fix Qt speaker delegation. 2025-08-30 00:13:47 -04:00
Thomas Harte
5e48a4c724 Fix SDL speaker sample receipt. 2025-08-30 00:10:17 -04:00
Thomas Harte
d825c03372 Prefer references for delegate protocols. 2025-08-30 00:09:38 -04:00
Thomas Harte
d177549dd6 Reduce more indentation. 2025-08-29 23:56:35 -04:00
Thomas Harte
9d1543401f Merge pull request #1542 from TomHarte/VHD
Sketch out VHD support.
2025-08-29 23:47:01 -04:00
Thomas Harte
094eb7e252 Resolve Github build breakage. 2025-08-29 23:09:13 -04:00
Thomas Harte
95e6726468 Reduce indentation. 2025-08-29 23:02:34 -04:00
Thomas Harte
8fded8f210 Add consts, remove get_s. 2025-08-29 22:55:50 -04:00
Thomas Harte
19c4940abd Extend and constify MassStorageDevice. 2025-08-29 22:17:01 -04:00
Thomas Harte
7b1f6b3c53 Add negative asserts. 2025-08-29 22:02:54 -04:00
Thomas Harte
43042c3737 Parse a little further. 2025-08-29 21:55:21 -04:00
Thomas Harte
30b50b8a1b Add missing header, CMake file. 2025-08-28 21:56:03 -04:00
Thomas Harte
095be3072b Distinguish when to include the trailing NULL. 2025-08-28 21:53:52 -04:00
Thomas Harte
91831200d6 Eliminate runtime strlen. 2025-08-28 18:45:04 -04:00
Thomas Harte
8295d4511b Improve whence type safety. 2025-08-28 17:41:58 -04:00
Thomas Harte
df589d9588 Test image type. 2025-08-28 17:29:26 -04:00
Thomas Harte
b826e1c661 Do some small measure of header parsing. 2025-08-28 17:20:29 -04:00
Thomas Harte
6727e2fe73 Add shell of a class for VHD files. 2025-08-27 17:09:52 -04:00
Thomas Harte
ecdcee8d4e Adopt my native spelling: 'licence' is a noun. 2025-08-26 23:48:00 -04:00
Thomas Harte
8b4a4369c1 Add a target for IDE activity. 2025-08-26 23:47:39 -04:00
Thomas Harte
eeb06de916 Merge pull request #1540 from TomHarte/KeyboardAgain
Be more rigorous about `static constexpr`
2025-08-26 23:22:19 -04:00
Thomas Harte
5018d7d577 Be more rigorous about static constexpr. 2025-08-26 22:54:39 -04:00
Thomas Harte
1ca279d99d Add keyboard command lookaside; dummy IDE read. 2025-08-25 22:49:32 -04:00
Thomas Harte
8a149a188c Store keyboard command until enabled. 2025-08-25 22:44:22 -04:00
Thomas Harte
076334bc4e Take first stab at separating keyboard & controller. 2025-08-25 22:14:51 -04:00
Thomas Harte
e6b45c978c Merge pull request #1539 from TomHarte/KeyboardAgain
Name keyoard commands, implement a couple more.
2025-08-25 22:12:00 -04:00
Thomas Harte
a07615445f Uncover likely issue: commands directly to keyboard. 2025-08-23 22:51:09 -04:00
Thomas Harte
41d30c2835 More formally designate the resets. 2025-08-23 22:41:58 -04:00
Thomas Harte
71f1635e23 Name commands, implement a couple more. 2025-08-23 22:33:19 -04:00
Thomas Harte
57df6d9bf7 Merge pull request #1538 from TomHarte/LessMemory
Reduce AT to 640kb RAM.
2025-08-23 22:02:28 -04:00
Thomas Harte
fd670d5175 Reduce AT to 640kb RAM.
This substantially speeds up the boot process, clearing the way for other experimentation.
2025-08-23 21:51:48 -04:00
Thomas Harte
39d4c315c8 Merge pull request #1537 from TomHarte/FloppyExists
Increase floppy logging, adjust sense interrupt.
2025-08-23 21:33:22 -04:00
Thomas Harte
6487086354 Increase floppy logging, adjust sense interrupt. 2025-08-23 21:21:16 -04:00
Thomas Harte
7d6e24b8ed Merge pull request #1536 from TomHarte/8042Redo
Rejig 8042; extend logger for common conditional use case.
2025-08-21 23:23:59 -04:00
Thomas Harte
4922073300 Reestablish pre-AT keyboard link. 2025-08-21 16:48:05 -04:00
Thomas Harte
778a02324e Add enabled flag. 2025-08-20 22:56:04 -04:00
Thomas Harte
8e89aa97a0 Switch status bit 3; fix reading of is_tested_; guess at it self-setting. 2025-08-20 22:09:08 -04:00
Thomas Harte
dfd521e938 Attempt to reformulate keyboard controller. 2025-08-20 17:17:54 -04:00
Thomas Harte
d47332adf5 Reduce need for scopes. 2025-08-20 17:17:27 -04:00
Thomas Harte
14e7ba8fab Merge pull request #1535 from TomHarte/MDAStatus
Add MDA status register.
2025-08-19 16:39:03 -04:00
Thomas Harte
e68a356fd0 Adjust AT switches input. 2025-08-18 23:26:58 -04:00
Thomas Harte
6e77b8659c Add various missing enum -> string mappings. 2025-08-18 14:59:58 -04:00
Thomas Harte
00fad7e424 Merge pull request #1534 from TomHarte/PCBASIC
Add PC BASIC ROM to the PC AT.
2025-08-14 22:28:48 -04:00
Thomas Harte
0a65248bf7 Add MDA status register, various notes. 2025-08-14 22:28:22 -04:00
Thomas Harte
9cff26b163 Install BASIC ROM. 2025-08-13 23:36:07 -04:00
Thomas Harte
9309d8c3f2 Add ROM BIOS to the ROM catalogue. 2025-08-13 22:18:16 -04:00
Thomas Harte
07e96c10d2 Merge pull request #1533 from TomHarte/MultifacetedCall
Further implement the 80286
2025-08-13 19:05:52 -04:00
Thomas Harte
d95abc99d9 Slightly increase logging. 2025-08-13 16:44:53 -04:00
Thomas Harte
b83c2615de Limit LSL types. 2025-08-13 13:53:02 -04:00
Thomas Harte
78a2b27e65 Attempt LSL, LAR. 2025-08-13 13:43:19 -04:00
Thomas Harte
bae594e34c Fix ARPL flag. 2025-08-12 21:32:20 -04:00
Thomas Harte
4ded6fceea Fix VERR/VERW. 2025-08-12 21:20:01 -04:00
Thomas Harte
0e498829f7 Attempt VERR, VERW.
Without complete success; IBM's third invocation (which I think is a VERR) doesn't give the result that BIOS is looking for.
2025-08-12 17:22:14 -04:00
Thomas Harte
ddd090d581 Implement STR. 2025-08-12 16:21:23 -04:00
Thomas Harte
4cd979e5fb Take a shot at LTR. 2025-08-12 13:49:59 -04:00
Thomas Harte
2f7a6bb242 Establish a specialised validate_call. 2025-08-11 17:10:58 -04:00
Thomas Harte
3b3b2e61b0 Overtly separate call authorisation. 2025-08-11 13:24:51 -04:00
Thomas Harte
ab4fde9bd7 Slightly clean up. 2025-08-11 09:41:31 -04:00
Thomas Harte
a9996f0b81 Add consts. 2025-08-11 09:34:17 -04:00
Thomas Harte
246d34e072 Merge pull request #1532 from TomHarte/SimplerDescriptors
Boil down descriptor attributes.
2025-08-10 20:49:44 -04:00
Thomas Harte
d35efe3f32 Boil down descriptor attributes. 2025-08-09 23:10:26 -04:00
Thomas Harte
ebd1a6b47c Merge pull request #1531 from TomHarte/286DecodingTests
Resolve majority of 286 test case failures.
2025-08-08 15:04:58 -04:00
Thomas Harte
83980678a0 Add additional known bad.
38 failures left.
2025-08-08 12:06:48 -04:00
Thomas Harte
201393f87d Start discounting test cases that look broken.
39 failures remaining.
2025-08-08 12:00:58 -04:00
Thomas Harte
055eb3873e Switch far jump to piece-by-piece authorisation.
43 failures.
2025-08-08 11:30:51 -04:00
Thomas Harte
dc94d58148 Switch CALL to access-by-access validation.
47 failures remaining.
2025-08-08 11:28:32 -04:00
Thomas Harte
0adaec1665 Allow ENTER to write partially.
51 failures left.
2025-08-08 11:18:14 -04:00
Thomas Harte
4ee30dc36f Correct stack validation, fixing POPA.
71 failures.
2025-08-08 11:05:01 -04:00
Thomas Harte
54ff2fa01f Fix new LES/etc failures.
Remaining: 72.
2025-08-08 09:55:31 -04:00
Thomas Harte
03c70b49ba Throw GPF for overlong instructions; fix BOUND validation.
79 failures outstanding.
2025-08-08 09:43:16 -04:00
Thomas Harte
4b2d8e13d1 Add consts, TODO. 2025-08-08 07:39:34 -04:00
Thomas Harte
a0c50f0521 Support 286-style DAS.
321 failures to go.
2025-08-07 19:49:41 -04:00
Thomas Harte
b15a865c88 Add extra MOV sanity check.
Failures still standing: 406.
2025-08-07 17:40:13 -04:00
Thomas Harte
8e5bbbbc71 Implement 80286 INS/OUTS oddities.
795 failures outstanding.
2025-08-07 15:31:07 -04:00
Thomas Harte
615ebaf711 Correct RCL overflow when shift count is 0.
1,013 failures remaining.
2025-08-07 15:23:11 -04:00
Thomas Harte
0882d2b7ce Correct LEAVE authorisation.
Failures: 1,207.
2025-08-07 15:16:12 -04:00
Thomas Harte
900195efac Correct HLT IP comparison.
Failures: 1,425.
2025-08-07 15:01:22 -04:00
Thomas Harte
b58b962ccf Apply 80286 LODS craziness.
2,425 errors remaining.
2025-08-07 14:53:16 -04:00
Thomas Harte
5255499445 Implement 286 weirdness for SCAS.
2,690 failures.
2025-08-07 14:50:59 -04:00
Thomas Harte
d9a2be4250 Avoid upfront testing for POPA.
Failures: 2,966.
2025-08-07 14:41:01 -04:00
Thomas Harte
256e14a8a6 Decline upfront validation for PUSHA.
Total failures remaining: 3,239.
2025-08-07 14:36:11 -04:00
Thomas Harte
1ab26d4a2f Determine 80286 CMPS rules.
Remaining: 3,521 failures.
2025-08-07 12:28:50 -04:00
Thomas Harte
91b2c751af Determine 80286 logic for MOVS.
4,043 failures left.
2025-08-07 12:17:52 -04:00
Thomas Harte
edf7617d1e Fix is_address.
Failures: 4,568.
2025-08-07 09:25:23 -04:00
Thomas Harte
32666d304f Filter out some illegal JMP/CALL fars.
Failure count now: 5,966.
2025-08-07 09:18:23 -04:00
Thomas Harte
b65f7b4a6a Restrict BOUNDS checks to 80286. 2025-08-06 22:32:50 -04:00
Thomas Harte
7c4df23c1c Fix BOUND.
7085 remaining failures.
2025-08-06 22:19:35 -04:00
Thomas Harte
a8e60163e1 Commute Overflow from fault to trap.
9,331 failures remaining.
2025-08-06 21:30:08 -04:00
Thomas Harte
02ec1b5da6 Fix SHR overflow flag.
Failing: 11,802.
2025-08-06 21:14:15 -04:00
Thomas Harte
a9a6aba862 Correct RCR overflow.
Now: 14,097 failures.
2025-08-06 17:46:05 -04:00
Thomas Harte
03c6a60f68 Avoid extra judgment on LEAVE.
Failures remaining: 16,295.
2025-08-06 17:19:20 -04:00
Thomas Harte
8ab688687e Decode .6 as SAL.
Amazingly: now 20,814 failures outstanding.
2025-08-06 16:30:55 -04:00
Thomas Harte
bdec32722e Include failures/file. 2025-08-06 16:07:54 -04:00
Thomas Harte
ad50e5c754 Ensure an invalid instruction is generated upon length limit. 2025-08-06 15:59:24 -04:00
Thomas Harte
9c48e44e9e Fix fast-path selection.
50,814 failures.
2025-08-06 15:33:51 -04:00
Thomas Harte
76284eb462 Fix 8088 assumption about unused flags; 80286 PUSHF now passes amongst others.
51,091 failures still to fix though.
2025-08-06 15:31:03 -04:00
Thomas Harte
0745c5128a Avoid expensive path for 8088; pull out allow list. 2025-08-06 15:21:54 -04:00
Thomas Harte
01fbe2d3de Support 808286 STOS oddities. 2025-08-06 13:37:34 -04:00
Thomas Harte
9e14c22259 Take another run at ENTER. 2025-08-06 12:55:37 -04:00
Thomas Harte
dff0111cd5 Overtly capture decoding failures. 2025-08-05 13:03:54 -04:00
Thomas Harte
e7452b0ea1 Continue accepting F7.2 as TEST. 2025-08-04 21:45:14 -04:00
Thomas Harte
61a0f892c4 Fix PUSH immediate. 2025-08-04 21:23:27 -04:00
Thomas Harte
4ceab01ed4 Fix result of IMUL_3. 2025-08-04 21:05:14 -04:00
Thomas Harte
9908969eea Diagnose, correct AAA and AAS. 2025-08-04 17:49:07 -04:00
Thomas Harte
19a78ef1ac Correct for 286+ PUSH SP. 2025-08-04 17:23:02 -04:00
Thomas Harte
4785c1ae84 Grab new punchlist. 2025-08-04 17:19:11 -04:00
Thomas Harte
ef03841efa Deal with potential reason for wrong top-of-flags. 2025-08-04 17:14:16 -04:00
Thomas Harte
4747a70ce7 Correct for accesses right at segment end. 2025-08-04 17:08:01 -04:00
Thomas Harte
cd986cc2dc Ensure tests get the default IDT. 2025-08-04 12:47:52 -04:00
Thomas Harte
c29d5ca4a8 Catch address wraparound out-of-bounds access. 2025-08-04 09:32:35 -04:00
Thomas Harte
56b49011d6 Shorten reports. 2025-08-04 09:21:49 -04:00
Thomas Harte
48c55211e6 Fix descriptor bounds test. 2025-08-04 09:16:33 -04:00
Thomas Harte
72f68f3b0b Include hash in error record. 2025-08-03 20:11:35 -04:00
Thomas Harte
7b6dddc994 Include number. 2025-08-03 17:57:26 -04:00
Thomas Harte
51fbe4e8c5 Consume 286 HLT. 2025-08-03 17:41:02 -04:00
Thomas Harte
c148d9ee6c Ensure ENTER can execute. 2025-08-03 17:30:02 -04:00
Thomas Harte
9dfe59a104 Take a swing at three-operand IMUL. 2025-08-02 22:23:34 -04:00
Thomas Harte
b6aae65afd Clean up, separate. 2025-08-02 21:45:01 -04:00
Thomas Harte
9fed93a771 Use 286 test suite for decoding tests too. 2025-08-02 21:31:04 -04:00
Thomas Harte
cdfb68f261 Merge pull request #1530 from TomHarte/FullerTests
Utilise 80286 real-mode tests.
2025-08-02 19:00:47 -04:00
Thomas Harte
46450bd080 Use proper perform in tests. 2025-08-02 18:47:06 -04:00
Thomas Harte
9a25d601f1 Fully transfer faulting logic. 2025-08-02 18:37:56 -04:00
Thomas Harte
fe0834ecda Fix type difference. 2025-08-02 18:32:23 -04:00
Thomas Harte
846f745e2c Attempt to transfer ownership of fault. 2025-08-02 18:26:00 -04:00
Thomas Harte
30d40e6f9b Add TODO. 2025-08-01 20:58:12 -04:00
Thomas Harte
f7501b10f7 Move ExecutionSupport to heap. 2025-08-01 20:11:26 -04:00
Thomas Harte
379c513f8a Add const getter, mode getter; further template. 2025-08-01 19:56:57 -04:00
Thomas Harte
5a6d77e958 Generalise, towards using 80286 tests. 2025-08-01 15:59:40 -04:00
Thomas Harte
6646039ffe Templatise to allow beyond-8086 execution. 2025-07-31 21:26:29 -04:00
Thomas Harte
5e0994270f Merge pull request #1529 from TomHarte/StatusFlagsMask
Correct metadata observation.
2025-07-31 19:52:16 -04:00
Thomas Harte
44fc801720 Correct metadata observation. 2025-07-31 15:47:07 -04:00
Thomas Harte
405c61f53d Merge pull request #1528 from TomHarte/ZX81Typer
ZX80/81: Reduce typing speed.
2025-07-31 15:16:43 -04:00
Thomas Harte
c40acb9406 Reduce typing speed. 2025-07-29 21:55:56 -04:00
Thomas Harte
7778d2a47e Merge pull request #1527 from TomHarte/8088TestFailures
Restore proper register and memory contents.
2025-07-29 21:36:12 -04:00
Thomas Harte
96afb245a5 Fix test suite memory state. 2025-07-29 21:25:15 -04:00
Thomas Harte
cf0677c30b Avoid spurious register comparison failures. 2025-07-28 17:44:32 -04:00
Thomas Harte
667614d9de Merge pull request #1525 from TomHarte/x86Tests
Revive x86 JSON tests
2025-07-27 22:23:27 -04:00
Thomas Harte
652ede57b3 Further clone FlowController. 2025-07-27 22:00:54 -04:00
Thomas Harte
09a34f880e Start trying to return preauthorisation testability. 2025-07-27 21:17:54 -04:00
Thomas Harte
a9f9be330d Allow SegmentedMemory to take different LinearMemorys. 2025-07-26 08:18:16 -04:00
Thomas Harte
39568d2464 Run headfirst into a LinearMemory substitution brick wall. 2025-07-25 21:43:54 -04:00
Thomas Harte
10e07a9966 Add missing concept requirement. 2025-07-25 21:27:51 -04:00
Thomas Harte
fe00a69136 Start transitioning to PCCompatible::Segments. 2025-07-25 16:58:07 -04:00
Thomas Harte
9d0c2cd67f Switch to a parasitic use of PCCompatible::LinearMemory. 2025-07-25 16:47:08 -04:00
Thomas Harte
b5aab442f8 Template immediate-read Segments; continue fixing 8088Tests. 2025-07-24 22:24:53 -04:00
Thomas Harte
7c010bd1ef Relocate validation logic, such as it is. 2025-07-22 22:42:01 -04:00
Thomas Harte
1bf898405f Generalise 'Registers'. 2025-07-21 21:17:54 -04:00
Thomas Harte
c490166b35 Fully apply line length limit. 2025-07-21 17:09:07 -04:00
Thomas Harte
e6862364ed Correct syntax to the point of failing only concepts. 2025-07-21 17:06:17 -04:00
Thomas Harte
cf20c84edd Merge pull request #1523 from TomHarte/MacintoshIMGStyle
Use <algorithm>, and otherwise reduce.
2025-07-19 21:56:50 -04:00
Thomas Harte
88e776ad5b Use <algorithm>, and otherwise reduce. 2025-07-19 21:37:03 -04:00
Thomas Harte
e79a60f5cd Merge pull request #1522 from TomHarte/MacintoshIMGStyle
Make minor style improvements.
2025-07-16 22:47:46 -04:00
Thomas Harte
fd4a91ba72 Make minor style improvements. 2025-07-16 22:31:41 -04:00
Thomas Harte
5705ece2a3 Merge pull request #1521 from atsampson/includes
Add some missing <cstdint> includes
2025-07-10 21:20:28 -04:00
Thomas Harte
c723f20f39 Merge pull request #1520 from TomHarte/ElectronTiming
Electron: move CPU slots to first half of each 1Mhz window.
2025-07-10 19:06:06 -04:00
Adam Sampson
0f7447d539 Add some missing <cstdint> includes. 2025-07-10 23:58:12 +01:00
Thomas Harte
1a08944854 std::tuple is defined in utility, not tuple. 2025-07-09 09:26:16 -04:00
Thomas Harte
7b0b06f6df Adhere to line length limit. 2025-07-09 13:27:53 +08:00
Thomas Harte
d2ad227a24 Relocate CPU activity to start of each 1Mhz slot. 2025-07-09 13:18:54 +08:00
Thomas Harte
71d7982d14 Tweak ownership of lookahead logic. 2025-07-09 12:55:53 +08:00
Thomas Harte
a94dcc12ef Reformat, consider CPU slot repositioning. 2025-07-09 10:41:03 +08:00
Thomas Harte
b7bfcfa1e3 Add note to future self. 2025-07-07 17:41:11 +08:00
Thomas Harte
416ae0ca04 Separate location tests from loop. 2025-07-07 17:37:31 +08:00
Thomas Harte
8d66cd4874 Merge pull request #1519 from TomHarte/ElectronTiming
Deduplicate Electron palette work.
2025-06-25 16:47:15 +07:00
Thomas Harte
a701ba8030 Switch to requires. 2025-06-25 16:28:26 +07:00
Thomas Harte
0160908522 Further deduplicate palette actions. 2025-06-25 16:23:25 +07:00
Thomas Harte
cdd0d6d127 Add consts. 2025-06-23 14:40:48 +07:00
Thomas Harte
65ee745d6e Avoid repetition of palette data. 2025-06-23 14:35:31 +07:00
Thomas Harte
4141dfc353 Merge pull request #1518 from TomHarte/ElectronColoursEtc
Correct Electron 1bpp palette G/B confusion.
2025-06-22 05:18:29 -04:00
Thomas Harte
fb6cd105c3 Overtly name type. 2025-06-22 16:03:50 +07:00
Thomas Harte
6ff9168146 Correct G/B 1bpp mismapping. 2025-06-22 15:58:16 +07:00
Thomas Harte
7b5e08aab6 Slightly improve palette semantics. 2025-06-22 15:25:20 +07:00
Thomas Harte
c7dd4526c1 Merge pull request #1516 from TomHarte/JFDFiles
Add elementary JFD support.
2025-06-01 22:48:00 -04:00
Thomas Harte
066036ccdd Add to CMake. 2025-05-31 21:28:02 -04:00
Thomas Harte
7c164453a5 Correct overrun test. 2025-05-30 22:33:27 -04:00
Thomas Harte
8b31cfeafb Correct offset into track table. 2025-05-30 21:47:16 -04:00
Thomas Harte
2ddaf0afa3 Attempt preliminary track building. 2025-05-30 21:25:07 -04:00
Thomas Harte
a8a97b4606 Get as far as printing sector stats. 2025-05-29 22:37:10 -04:00
Thomas Harte
a55b63a210 Add skeleton for JFD support. 2025-05-29 09:27:13 -04:00
Thomas Harte
2e4f7cd667 Merge pull request #1511 from TomHarte/PrivilegeLevels
Implement some of the missing 80286 operations.
2025-05-28 22:39:05 -04:00
Thomas Harte
bf257a8d9e Adjust ownership for segment load detection. 2025-05-28 22:08:43 -04:00
Thomas Harte
c4e66f7a35 Merge branch 'master' into PrivilegeLevels 2025-05-28 21:05:36 -04:00
Thomas Harte
efff433aa0 Merge pull request #1515 from TomHarte/BitwiseAF
x86: clear auxiliary carry on AND, OR, XOR and TEST.
2025-05-27 11:37:03 -04:00
Thomas Harte
ee60e36a16 x86: clear auxiliary carry on AND, OR, XOR and TEST. 2025-05-27 11:23:17 -04:00
Thomas Harte
841fc3cfaf Accept version-number increase. 2025-05-26 22:49:35 -04:00
Thomas Harte
2a44caea6c Merge pull request #1514 from TomHarte/ElectronChangeObsevrer
Add Electron to `MediaChangeObserver` gang.
2025-05-26 22:45:45 -04:00
Thomas Harte
0f661928ae Add Electron to MediaChangeObserver gang. 2025-05-26 22:35:08 -04:00
Thomas Harte
0961e5cc2e Add TSS deserialiser. 2025-05-20 21:56:58 -04:00
Thomas Harte
df621a8205 Add real and protected callbacks. 2025-05-18 23:35:49 -04:00
Thomas Harte
bfa416ca99 Fix #include. 2025-05-18 22:30:20 -04:00
Thomas Harte
8041b87317 Introduce segment preauthorisation. 2025-05-18 22:11:23 -04:00
Thomas Harte
b3000f6350 Made mode knowable; factor out main part of far jump. 2025-05-17 23:08:07 -04:00
Thomas Harte
947baab269 Add TODO. 2025-05-14 22:12:59 -04:00
Thomas Harte
a41ea90ca7 Implement CLTS. 2025-05-14 21:08:26 -04:00
Thomas Harte
8b3f0d8fd6 Implement ARPL. 2025-05-14 21:01:48 -04:00
Thomas Harte
bd9740a9a4 Add additional informative static asserts. 2025-05-13 22:54:05 -04:00
Thomas Harte
3f735e44f1 Merge pull request #1510 from TomHarte/LLDT
Begin LDT support.
2025-05-13 22:41:53 -04:00
Thomas Harte
9e5235fd30 Descriptor tables are always at most 64kb. 2025-05-13 14:07:28 -04:00
Thomas Harte
159f3cb780 Add SLDT. 2025-05-12 23:17:34 -04:00
Thomas Harte
61469f8e09 Reindent to avoid many false warnings. 2025-05-12 21:36:49 -04:00
Thomas Harte
71343b5131 Add additional possible exception causes. 2025-05-12 21:34:59 -04:00
Thomas Harte
82caee6d7d Add potential LLDT exceptions. 2025-05-12 17:31:56 -04:00
Thomas Harte
275e75980c Take initial swing at LLDT. 2025-05-12 17:22:11 -04:00
Thomas Harte
2572da872a Improve consts, use concepts, reduce indentation. 2025-05-12 09:13:27 -04:00
Thomas Harte
6934618589 Add note to self. 2025-05-11 22:53:28 -04:00
Thomas Harte
01fd07c372 Merge pull request #1509 from TomHarte/GPFs
Implement per-access GPF checks.
2025-05-11 22:34:09 -04:00
Thomas Harte
02f9cf0318 Add basic partial GPF testing. 2025-05-11 22:24:21 -04:00
Thomas Harte
6bc586025a Attempt per-access part of GPF test. 2025-05-11 22:05:33 -04:00
Thomas Harte
0d34960d60 Properly place ownership of linear authorisation. 2025-05-11 21:36:36 -04:00
Thomas Harte
99b94a31ea Give descriptors knowledge of their indices. 2025-05-11 21:32:00 -04:00
Thomas Harte
b0d4bcd26c Route all authorisation messages to a common receiver. 2025-05-11 21:08:02 -04:00
Thomas Harte
248ea52e06 Merge pull request #1508 from TomHarte/ExceptionBackfill
Improve IDT support.
2025-05-11 20:40:32 -04:00
Thomas Harte
9b51fe3db4 Take a shot at IDT dispatch. 2025-05-10 21:34:43 -04:00
Thomas Harte
5f95696815 Remove done TODO. 2025-05-05 22:56:24 -04:00
Thomas Harte
8c9df5556d Generalise support for multiple speeds. 2025-05-05 22:55:23 -04:00
Thomas Harte
32495f47b3 Bifurcate descriptor types. 2025-05-05 17:26:39 -04:00
Thomas Harte
23bc561524 Add note to self. 2025-05-04 22:21:37 -04:00
Thomas Harte
fa2cc0f62e Proceed as far as believing I probably need a gate descriptor type. 2025-05-04 22:11:53 -04:00
Thomas Harte
a686a167cc Factor out 'read descriptor'. 2025-05-04 21:03:17 -04:00
Thomas Harte
8a2468a4fb Apply IDT reset condition, factor in to real-mode interrupts. 2025-05-04 16:57:14 -04:00
Thomas Harte
4cc21a2c20 Include descriptor table and MSW requirements. 2025-05-03 23:01:31 -04:00
Thomas Harte
5350e41da1 Switch to mildly-more-modern template form. 2025-05-02 13:50:06 -04:00
Thomas Harte
e07e6b6954 Merge pull request #1507 from TomHarte/Morex86Exceptions
Reformulate x86 exceptions.
2025-05-02 10:42:11 -04:00
Thomas Harte
0a60e38d82 Abandon Interrupt naming. 2025-05-02 10:23:20 -04:00
Thomas Harte
f53b40e127 Focus on an Exception as the interrupt token. 2025-05-01 22:36:58 -04:00
Thomas Harte
4df51a00ed Try to be a bit more rigorous in exception generation syntax. 2025-05-01 17:17:29 -04:00
Thomas Harte
3981c4d101 Merge pull request #1506 from TomHarte/x86Concepts
Apply concepts to x86 interface.
2025-04-30 22:07:50 -04:00
Thomas Harte
fc3e8f7cef Add memory subsystem requirements. 2025-04-30 21:30:36 -04:00
Thomas Harte
f4d67ec5e6 Eliminate bad #include. 2025-04-29 22:32:29 -04:00
Thomas Harte
59aafa6c1e Add linear memory concept. 2025-04-29 22:28:23 -04:00
Thomas Harte
75da46dac5 Add CPU control concept. 2025-04-29 22:24:06 -04:00
Thomas Harte
1f1d380e26 Fill in flow-controller requirements. 2025-04-29 22:09:59 -04:00
Thomas Harte
35b3e425be Spell out registers requirements. 2025-04-29 22:06:59 -04:00
Thomas Harte
b4535c489d Wrangle test for segments interface. 2025-04-29 21:55:17 -04:00
Thomas Harte
f6bb502e87 Start bashing out an attempt at is_context. 2025-04-27 23:40:40 -04:00
Thomas Harte
6cf825d3d8 Lock down Intruction type. 2025-04-27 21:43:46 -04:00
Thomas Harte
f766841fad Add usage-hint concepts. 2025-04-27 14:51:34 -04:00
Thomas Harte
10e4e7f6c6 Limit integer types. 2025-04-27 14:47:56 -04:00
Thomas Harte
1277e56435 Limit integers that can be the subject of accessors. 2025-04-27 14:44:07 -04:00
Thomas Harte
4089532f81 Merge pull request #1505 from TomHarte/OtherC++20Improvements
Make other scattered C++20 improvements.
2025-04-25 23:54:31 -04:00
Thomas Harte
9790b4d2e9 Throw in some consts. 2025-04-25 23:17:00 -04:00
Thomas Harte
ad37c0d2ac Use std::rotr. 2025-04-25 23:10:09 -04:00
Thomas Harte
b7a1fd4f8f Autodetect whether shift count could be a register. 2025-04-25 23:01:04 -04:00
Thomas Harte
be5362e393 Eliminate builtin. 2025-04-25 23:00:36 -04:00
Thomas Harte
4977c9bc4c Further use rotl/r. 2025-04-25 22:53:11 -04:00
Thomas Harte
e13dbc03da Make elementary use of rotl and rotr. 2025-04-25 22:37:43 -04:00
Thomas Harte
16fec0679b Use std::popcount further. 2025-04-25 22:24:00 -04:00
Thomas Harte
55361b8552 Remove unused popcount. 2025-04-25 22:18:39 -04:00
Thomas Harte
cc67993621 Temporarily disable, in lieu of splitting memory. 2025-04-25 22:18:25 -04:00
Thomas Harte
49ba4998d6 Use std::popcount for parity. 2025-04-25 22:18:05 -04:00
Thomas Harte
03eb381b3b Adopt std::ranges::copy where it is trivial to do so. 2025-04-25 22:17:07 -04:00
Thomas Harte
e5161faa43 Merge pull request #1504 from TomHarte/M_PI
Eliminate all references to M_PI.
2025-04-25 21:43:06 -04:00
Thomas Harte
de78fb7a1c Eliminate all references to M_PI. 2025-04-24 21:57:29 -04:00
Thomas Harte
a9ceb5e21a Merge pull request #1503 from TomHarte/C++20
Bump to C++20.
2025-04-24 21:52:01 -04:00
Thomas Harte
e62b41f615 Avoid implicit capture of 'this' via '='. 2025-04-24 21:27:23 -04:00
Thomas Harte
592e339b70 Resolve syntax error, fix line lengths. 2025-04-24 21:12:17 -04:00
Thomas Harte
84a9138df7 Bump to C++20. 2025-04-24 20:56:15 -04:00
Thomas Harte
6db7c4a8eb Merge pull request #1502 from TomHarte/LocalFilesystemAccess
Make style corrections to the Enterprise and CPC.
2025-04-23 12:38:36 -04:00
Thomas Harte
213bd09a9c Remove test trap. 2025-04-23 11:36:29 -04:00
Thomas Harte
8eb246cdec Improve consts, line lengths. 2025-04-23 11:01:23 -04:00
Thomas Harte
caacf8e373 Eliminate macros. 2025-04-23 10:51:49 -04:00
Thomas Harte
c53d42a578 Eliminate macro. 2025-04-23 10:38:42 -04:00
Thomas Harte
cfc5ef4a3c Eliminate risk of overrun. 2025-04-22 22:50:38 -04:00
Thomas Harte
e78c1bbec9 Improve consts, indentation. 2025-04-22 22:42:13 -04:00
Thomas Harte
b1582d33c0 Adjust indentation, remove one macro. 2025-04-22 21:45:36 -04:00
Thomas Harte
5abcf28a0e Merge pull request #1498 from TomHarte/Descriptors
Edge further along on x86 descriptors.
2025-04-22 21:23:17 -04:00
Thomas Harte
4cd57856ce Take ownership of 32-bit assumption. 2025-04-22 21:10:20 -04:00
Thomas Harte
a826fd5c0e Add return. 2025-04-21 23:14:28 -04:00
Thomas Harte
7de23ec2aa Be specific about types. 2025-04-21 23:03:57 -04:00
Thomas Harte
d7d2957319 Avoid fallthrough warning. 2025-04-21 22:57:07 -04:00
Thomas Harte
fbd81b9930 Merge branch 'master' into Descriptors 2025-04-21 22:43:30 -04:00
Thomas Harte
dacb52403a Merge pull request #1501 from TomHarte/NoVLAs
Eliminate VLAs, resolve some fallthrough warnings, reduce macros.
2025-04-21 15:24:40 -04:00
Thomas Harte
e008a02b99 Shuffle further to avoid optics of a fallthrough. 2025-04-21 15:13:10 -04:00
Thomas Harte
9363453720 Reduce macros. 2025-04-21 15:00:49 -04:00
Thomas Harte
9c70615fd1 Trim maximum line length. 2025-04-21 15:00:02 -04:00
Thomas Harte
1c78c65816 Add missing constraint. 2025-04-21 09:19:36 -04:00
Thomas Harte
2a9a68ca53 Annotate further fallthroughs. 2025-04-21 09:15:55 -04:00
Thomas Harte
fb16baab99 Add further fallthrough. 2025-04-20 23:39:26 -04:00
Thomas Harte
54f509c210 Enforce size restriction. 2025-04-20 23:27:44 -04:00
Thomas Harte
5be8e5eff3 Avoid improper fallthroughs. 2025-04-20 22:55:03 -04:00
Thomas Harte
29b9f129f6 Improve constness, line lengths, eliminate macros. 2025-04-20 22:33:44 -04:00
Thomas Harte
f41629daae Add compiler-calming fallthroughs. 2025-04-20 22:19:11 -04:00
Thomas Harte
feea6023f4 Eliminate macro. 2025-04-20 12:37:14 -07:00
Thomas Harte
262d8cd0d9 Enable further warnings. 2025-04-20 12:31:57 -07:00
Thomas Harte
fbbec04f8c Update version check. 2025-04-20 12:29:03 -07:00
Thomas Harte
3e4eaee96b Overtly cast. 2025-04-20 12:27:38 -07:00
Thomas Harte
5f99a2240d Shorten lines; apply minor style fixes. 2025-04-20 12:26:37 -07:00
Thomas Harte
5937387e94 Overtly note fallthrough. 2025-04-20 11:55:07 -07:00
Thomas Harte
b3099d8e71 Eliminate use of VLAs. 2025-04-12 14:34:57 -04:00
Thomas Harte
7721f74200 Further flesh out descriptors: decode all bits, add printf warnings. 2025-04-10 17:07:45 -04:00
Thomas Harte
fa58cc05f3 Attempt to avoid type punning. 2025-04-06 22:48:22 -04:00
Thomas Harte
c61a9e47b2 Slightly tweak constness. 2025-04-06 22:40:29 -04:00
Thomas Harte
148ee266ed Extend operator== path. 2025-04-06 22:37:59 -04:00
Thomas Harte
8ccec81cc6 Disable awaiting_eoi_. 2025-04-06 22:24:25 -04:00
Thomas Harte
668901f71d Fix comparison. 2025-04-06 22:24:09 -04:00
Thomas Harte
ad6ad144a5 Don't regress PC for external interrupts. 2025-04-05 21:39:37 -04:00
Thomas Harte
d5997a30b2 Reset output on latch write in applicable modes. 2025-04-04 12:30:08 -04:00
Thomas Harte
ecc7501377 Avoid explicit instantiation, precedence error. 2025-04-03 22:09:49 -04:00
Thomas Harte
45262a1a46 Copy reload value to latch. 2025-04-03 21:59:26 -04:00
Thomas Harte
3c04e08df2 Ensure 16-bit ins and outs always occur as two 8-bit operations.
Advances the AT to system error 108, something about timer 2.
2025-04-03 19:52:40 -04:00
Thomas Harte
7c7675179e Restrict shift operand size, causing text output at last. 2025-04-03 17:42:15 -04:00
Thomas Harte
88ed49a833 Enable A20 at reset; fully propagate return to real mode. 2025-04-03 16:14:49 -04:00
Thomas Harte
0c88e62815 Add various caveman debugging comments. 2025-04-02 23:28:20 -04:00
Thomas Harte
88d34012c4 Continue trying to flesh out exceptions. 2025-04-02 23:27:43 -04:00
Thomas Harte
3be8de6fb0 Enforce set-only nature of protected mode bit. 2025-04-02 23:26:21 -04:00
Thomas Harte
804fbf5d5f Add [S/L]MSW. 2025-04-02 23:24:28 -04:00
Thomas Harte
1a68dcbc14 PUSH always pushes a word. 2025-04-02 23:24:00 -04:00
Thomas Harte
a9a72a767d Improve fault pathways. 2025-04-01 09:13:41 -04:00
Thomas Harte
afc3a8d373 Correct header path. 2025-03-31 09:54:11 -04:00
Thomas Harte
da00e6588c Consolidate on class. 2025-03-31 09:34:17 -04:00
Thomas Harte
d6376d0ddf Remove improper header. 2025-03-31 09:33:30 -04:00
Thomas Harte
1cca711560 Name MSW bits. 2025-03-30 14:04:43 -04:00
Thomas Harte
552f9196af Convert INTO, AAM; map which instructions post their IP. 2025-03-30 13:39:52 -04:00
Thomas Harte
c6fa72cd83 Bring bound inside new orthodoxy. 2025-03-30 13:31:39 -04:00
Thomas Harte
42edc46887 Add invalid-opcode exception; transcribe has-code table. 2025-03-30 13:29:20 -04:00
Thomas Harte
ec7e343673 Start to establish throw/catch of 80286 exceptions. 2025-03-30 13:23:36 -04:00
Thomas Harte
69d4d8acb0 Switch to construct and copy. 2025-03-29 17:27:29 -04:00
Thomas Harte
a7eab8df22 Add getter for local descriptor table. 2025-03-29 17:24:30 -04:00
Thomas Harte
4247da9118 Add notes to self on exceptions. 2025-03-27 18:08:09 -04:00
Thomas Harte
cfba8aeb89 Make style improvements. 2025-03-27 18:07:52 -04:00
Thomas Harte
db26a26926 Fix decoding of PUSH immediate. 2025-03-27 13:07:13 -04:00
Thomas Harte
1551fbeb1f Make some stab at descriptor fetch. 2025-03-27 12:50:50 -04:00
Thomas Harte
d5c53ca624 Set A20 line properly. 2025-03-26 21:51:43 -04:00
Thomas Harte
b34702e370 Set an initial A20 state. 2025-03-26 07:35:17 -04:00
Thomas Harte
8b1543d9c9 Fuzz memory, setup FS and GS. 2025-03-25 17:16:36 -04:00
Thomas Harte
e264375a97 Attempt to reintroduce 80286 support (as was). 2025-03-25 09:24:55 -04:00
Thomas Harte
fd31d07f41 Begin division of memory into linear and segmented mappings. 2025-03-24 22:58:19 -04:00
Thomas Harte
fac15f5539 Introduce a linear-memory holder. 2025-03-24 21:23:08 -04:00
Thomas Harte
6ad88101f1 Saunter up to a circular issue: segments needs memory access. 2025-03-24 17:31:17 -04:00
Thomas Harte
2768b66d10 Propagate mode change. 2025-03-22 23:00:51 -04:00
Thomas Harte
d10164be26 Merge branch 'Descriptors' of github.com:TomHarte/CLK into Descriptors 2025-03-22 22:09:50 -04:00
Thomas Harte
ce7ff13bbe Proceed to a local assert on LMSW. 2025-03-22 21:57:56 -04:00
Thomas Harte
c1d2c159f3 Reenable backdoor AT. 2025-03-21 11:22:09 -04:00
Thomas Harte
d3dbdb153c Use indexed descriptors. 2025-03-21 11:20:33 -04:00
Thomas Harte
e7218c0321 Add means for indexed segment access. 2025-03-21 11:16:25 -04:00
Thomas Harte
48d8fdb875 Adopt descriptors in memory handling. 2025-03-21 10:18:26 -04:00
Thomas Harte
b387ca921a Merge branch 'master' into Descriptors 2025-03-20 21:09:09 -04:00
Thomas Harte
53c1a322ed Increase version number. 2025-03-20 15:39:42 -04:00
Thomas Harte
0c502fc9cf Adopt more consistent 'Pointer' naming; eliminate size warning. 2025-03-20 15:33:07 -04:00
Thomas Harte
5d1e3b6c93 Create a home for descriptors. 2025-03-19 14:20:50 -04:00
Thomas Harte
7fc16fa2c8 Merge pull request #1495 from TomHarte/286StatusWord
Add extra 80286 registers.
2025-03-19 14:12:56 -04:00
Thomas Harte
fe6a88c5df Install [L/S][I/G]DT wiring. 2025-03-18 22:11:28 -04:00
Thomas Harte
7b14df82e0 Merge branch 'master' into 286StatusWord 2025-03-18 21:47:32 -04:00
Thomas Harte
966b41313d Merge pull request #1497 from TomHarte/LargeWindowMousing
Correct potential SCSI crash; tweak macOS mouse behaviour.
2025-03-18 21:46:41 -04:00
Thomas Harte
91f1c3322c Ensure tracking areas are updated. 2025-03-18 21:12:48 -04:00
Thomas Harte
0b276c5a76 Remove focus rings. 2025-03-18 20:38:09 -04:00
Thomas Harte
b654c2e170 Avoid potential out-of-bounds access. 2025-03-18 20:23:31 -04:00
Thomas Harte
32c88da6c4 Iterate towards LGDT/LIDT.
Specifically: add a means to get just an indirect address; add an enum for descriptor tables; add an `ldt` function for the global and interrupt tables, which currently just authorises the access and then stops.
2025-03-18 18:22:04 -04:00
Thomas Harte
3d19d0816b Do something for SMSW. 2025-03-16 22:05:14 -04:00
Thomas Harte
15da707324 Merge pull request #1494 from TomHarte/MoreAT
AT: adjust reported RAM refresh timing.
2025-03-16 15:54:27 -04:00
Thomas Harte
387e8b04f9 Adjust reported refresh timing. 2025-03-16 15:44:05 -04:00
Thomas Harte
4ca47be8a8 Add const. 2025-03-15 22:21:35 -04:00
Thomas Harte
f9d9dc68b7 Factor out BIOS installation. 2025-03-15 22:19:26 -04:00
Thomas Harte
14a8f4511c Merge pull request #1492 from TomHarte/ATBIOS
Support real IBM BIOS, either in odd/even or complete form.
2025-03-15 22:12:54 -04:00
Thomas Harte
97d237eed0 Support real IBM BIOS, either in odd/even or complete form. 2025-03-15 21:13:31 -04:00
Thomas Harte
20d0406a24 Merge pull request #1491 from TomHarte/PUSHA
Fix PUSHA register list; add illegal asserts.
2025-03-14 22:27:19 -04:00
Thomas Harte
73e843abd3 Assert on some hopefully unreachables. 2025-03-12 22:03:12 -04:00
Thomas Harte
8d956da65b Correct final thing written to stack by PUSHA. 2025-03-12 21:40:03 -04:00
Thomas Harte
9b9cdfe937 Merge pull request #1489 from TomHarte/MinorExtraStrings
Slightly improve x86 instruction to string lexicon.
2025-03-12 21:34:18 -04:00
Thomas Harte
3dcba9362c Add a couple of missing Operation:: mappings. 2025-03-12 13:51:38 -04:00
Thomas Harte
2d3a3ada57 Add AccessType to string conversion. 2025-03-12 13:51:17 -04:00
Thomas Harte
143d1d5e35 Merge pull request #1488 from TomHarte/ATKeyboard
Implement some proportion of the AT keyboard controller.
2025-03-12 13:19:15 -04:00
Thomas Harte
13b32b269c Force the AT in debug mode only. 2025-03-12 12:47:04 -04:00
Thomas Harte
592cea6a27 Tweak timing to once again pass BIOS controller test. 2025-03-12 12:31:29 -04:00
Thomas Harte
e76ca304e6 Attempt to support 60 and c0. 2025-03-11 22:54:54 -04:00
Thomas Harte
d77d8df1ac Add closer-to-real keyboard command loop. 2025-03-11 22:35:13 -04:00
Thomas Harte
4f35d5dabd Log A20 line. 2025-03-09 23:09:58 -04:00
Thomas Harte
e927feb2d6 Reintroduce is-tested flag. 2025-03-08 21:59:40 -05:00
Thomas Harte
98f20c57c1 Attempt to support reset-by-8042, resulting in boot loop. 2025-03-08 00:47:56 -05:00
Thomas Harte
7a88d31fd9 Add include for strlen. 2025-03-07 23:47:34 -05:00
Thomas Harte
96326411bf Move explicit specialization to namespace scope. 2025-03-07 23:41:56 -05:00
Thomas Harte
4e882e7d4d Accept uint8_ts only. 2025-03-07 23:36:47 -05:00
Thomas Harte
bff10c1714 Resolve newfound log ambiguity. 2025-03-07 23:34:12 -05:00
Thomas Harte
cee2484108 Flip input/output, perform commands instantly. 2025-03-07 23:32:07 -05:00
Thomas Harte
93078abe87 Buffer lines prior to output. 2025-03-07 23:25:22 -05:00
Thomas Harte
8caa1a9664 Experiment with dialogue. 2025-03-07 14:24:08 -05:00
Thomas Harte
d7b46ee03c Adopt compact form. 2025-03-07 14:23:50 -05:00
Thomas Harte
e07b3da983 Add commentary; start fleshing out AT keyboard controller. 2025-03-07 14:01:59 -05:00
Thomas Harte
0f166cee48 Merge pull request #1487 from TomHarte/PCSeparate
Separate the speaker, and keyboard and floppy controllers.
2025-03-07 14:01:19 -05:00
Thomas Harte
08df42d05b Just 'POST' is fine. 2025-03-07 13:46:07 -05:00
Thomas Harte
2c165c3873 Avoid repetition of 'PC'. 2025-03-07 13:44:49 -05:00
Thomas Harte
9135402d9e Extract keyboard controller. 2025-03-07 13:43:21 -05:00
Thomas Harte
53135ec2c0 Extract floppy controller, speaker. 2025-03-07 13:39:45 -05:00
Thomas Harte
4eb8c8dea9 Merge pull request #1485 from TomHarte/FurtherATDMA
Add second PIC and DMA controllers.
2025-03-06 22:46:55 -05:00
Thomas Harte
f318bec53c Reduce indentation, improve constness. 2025-03-06 22:33:58 -05:00
Thomas Harte
7d84d6909e Add TODO. 2025-03-06 22:16:51 -05:00
Thomas Harte
9224645473 Add second PIC. 2025-03-06 22:15:58 -05:00
Thomas Harte
6717771f9a Rejig doubling of DMA controllers. 2025-03-05 23:02:08 -05:00
Thomas Harte
99e0902b74 Reconnect speaker. 2025-03-05 21:51:50 -05:00
Thomas Harte
c7f2805b05 Install the AT keyboard controller. 2025-03-05 21:28:22 -05:00
Thomas Harte
6e1909647b Reformat; hatch separate AT keyboard controller; print POST codes. 2025-03-05 21:08:53 -05:00
Thomas Harte
0c7db56e15 Merge branch 'master' into FurtherATDMA 2025-03-05 16:34:50 -05:00
Thomas Harte
3287ca449e Update macOS version number. 2025-03-05 16:23:23 -05:00
Thomas Harte
53a8f65ecc Merge branch 'master' into FurtherATDMA 2025-03-05 16:03:46 -05:00
Thomas Harte
113035b374 Merge pull request #1486 from TomHarte/macOSCrashes
macOS: Don't crash if mouse exits window while picking machine.
2025-03-05 16:03:04 -05:00
Thomas Harte
c6e64837c3 Don't crash if mouse moves while picking machine. 2025-03-05 15:51:31 -05:00
Thomas Harte
82419e6df1 Revoke 'ForceAT', **again**. 2025-03-05 14:34:44 -05:00
Thomas Harte
faa76ee017 Not quite accurate, but segment out keyboard writes for the AT. 2025-03-05 14:33:55 -05:00
Thomas Harte
ffdefb4106 Don't crash if mouse moves while picking machine. 2025-03-05 14:27:33 -05:00
Thomas Harte
ba7b1c47b9 Improve constness, reduce trips to system clock. 2025-03-05 14:17:31 -05:00
Thomas Harte
342b8105c4 Improve constness. 2025-03-04 22:53:26 -05:00
Thomas Harte
367c2b568a Attempt to offer expanded DMA top bytes. 2025-03-04 22:51:17 -05:00
Thomas Harte
0eef2c0d04 Merge pull request #1484 from TomHarte/286Decoding
Repair 286 decoding and `perform`.
2025-03-04 21:21:16 -05:00
Thomas Harte
c9a065107b Further tweak ENTER. 2025-03-04 21:08:59 -05:00
Thomas Harte
cacacc00f6 Undo ForceAT. 2025-03-04 20:56:38 -05:00
Thomas Harte
1b94cfc72c Add nullptr backstop. 2025-03-04 20:46:10 -05:00
Thomas Harte
89fd41124f Template various bits of hardware on machine type. 2025-03-04 17:08:49 -05:00
Thomas Harte
4e3b0ae3c1 Resolve type warnings in ENTER, spurious new lines in PC. 2025-03-04 14:10:28 -05:00
Thomas Harte
9df6d535e2 Patch up enough to get an 80286 performer compilable. 2025-03-04 13:52:02 -05:00
Thomas Harte
d545cce276 Merge pull request #1483 from TomHarte/PC-AT
Tee up for an AT-class PC.
2025-03-04 11:57:09 -05:00
Thomas Harte
71b481d3be Bake PC model into template. 2025-03-04 11:45:56 -05:00
Thomas Harte
2710acaae6 Avoid repeating CPU model, normalise member names. 2025-03-04 11:35:11 -05:00
Thomas Harte
d79135ea01 Eliminate non-functional workaround. 2025-03-04 11:30:43 -05:00
Thomas Harte
1464011f6f Try throwing some externs at it. 2025-03-04 11:23:55 -05:00
Thomas Harte
409c8a6859 Keep poking at this. 2025-03-04 11:10:35 -05:00
Thomas Harte
805ce36592 Fix spelling, namespace. 2025-03-04 11:01:07 -05:00
Thomas Harte
07fa56c53d Get heavier with GCC workarounds. 2025-03-04 10:56:45 -05:00
Thomas Harte
28fca80023 Attempt lighter GCC workaround. 2025-03-04 10:46:14 -05:00
Thomas Harte
08c0ee9ca8 Fix further speed reference; eliminate Decoder8086 entirely. 2025-03-04 10:35:16 -05:00
Thomas Harte
2878ab1578 Update Qt UI. 2025-03-04 10:25:27 -05:00
Thomas Harte
16f850cbcc Attempt to eliminate Decoder8086. 2025-03-04 10:13:57 -05:00
Thomas Harte
b9177e50d3 Commute 'speed' to 'model approximation'. 2025-03-04 09:57:34 -05:00
Thomas Harte
c3258551d7 Merge pull request #1481 from TomHarte/x86Macros
Reduce macros in x86 decoder.
2025-03-03 23:27:39 -05:00
Thomas Harte
ea0799c546 Transition off printf. 2025-03-03 23:17:52 -05:00
Thomas Harte
4843b7f7b8 Update name expectations. 2025-03-01 22:35:15 -05:00
Thomas Harte
61694c625e Merge branch 'master' into x86Macros 2025-02-28 22:53:19 -05:00
Thomas Harte
64b4b99d48 Shave icon. 2025-02-28 22:24:06 -05:00
Thomas Harte
dad966b551 Merge pull request #1482 from TomHarte/IconAndReadme
Update README icon, mention Plus 4.
2025-02-28 22:10:51 -05:00
Thomas Harte
e46f503641 Try icon below title. 2025-02-28 22:09:21 -05:00
Thomas Harte
fc4a1e6ace Revert "See whether this affects title underlining."
This reverts commit 02b9a20c11.
2025-02-28 22:07:21 -05:00
Thomas Harte
02b9a20c11 See whether this affects title underlining. 2025-02-28 22:07:00 -05:00
Thomas Harte
1db4e4caed Try for on-left with wrapping. 2025-02-28 22:06:14 -05:00
Thomas Harte
991e176c85 Try as raw HTML. 2025-02-28 22:05:30 -05:00
Thomas Harte
4a41a6bb85 Try right alignment. 2025-02-28 22:04:30 -05:00
Thomas Harte
6229e1049b Move icon to other side of text. 2025-02-28 22:03:25 -05:00
Thomas Harte
3cfd6ed109 Experiment with top-line layout. 2025-02-28 22:02:41 -05:00
Thomas Harte
ad70180edd Update README icon, mention Plus 4. 2025-02-28 22:01:29 -05:00
Thomas Harte
efd4a83bd2 Remove dead #undefs. 2025-02-28 21:55:52 -05:00
Thomas Harte
e13b4ab7c9 Reduce reliance upon macros. 2025-02-28 21:51:44 -05:00
Thomas Harte
fee89cbaad Switch to absolute include paths. 2025-02-28 14:53:48 -05:00
Thomas Harte
2bdcba437c Fix include path. 2025-02-28 13:27:36 -05:00
Thomas Harte
2c2216afae Further eliminate file-relative includes. 2025-02-28 13:18:48 -05:00
Thomas Harte
0823fc32fe Eliminate file-relative paths. 2025-02-28 12:30:25 -05:00
Thomas Harte
091d19caf5 Qt: overtly add project home as include path. 2025-02-28 11:34:27 -05:00
Thomas Harte
00a7381f08 Add top-level base for includes. 2025-02-28 11:32:44 -05:00
Thomas Harte
d494d1e3ee Add SConstruct top-level include path. 2025-02-28 11:30:08 -05:00
Thomas Harte
b1c331a1df Add a canary for include paths. 2025-02-28 11:26:43 -05:00
Thomas Harte
b1a4fd085b Permit project-relative includes. 2025-02-27 18:37:33 -05:00
Thomas Harte
511ab2afe9 Merge pull request #1478 from TomHarte/C++23SDL
Bump macOS SDL target to C++23; fix incompatibilities.
2025-02-27 18:36:23 -05:00
Thomas Harte
30387ad654 Merge branch 'master' into C++23SDL 2025-02-27 18:34:01 -05:00
Thomas Harte
5d528ee1f3 Merge pull request #1479 from TomHarte/x86Documentation
Improve x86 `const`ness.
2025-02-27 18:33:20 -05:00
Thomas Harte
96bb4d50ba Promote macOS SDL target to C++23 as a testing chamber; resolve issues. 2025-02-27 18:13:35 -05:00
Thomas Harte
45f850adae Improve constness. 2025-02-27 15:47:06 -05:00
Thomas Harte
09341ddbe9 Merge pull request #1477 from TomHarte/C++20Deprecations
Resolve two immediate warnings in a C++20 test build.
2025-02-27 15:29:41 -05:00
Thomas Harte
eab4274737 Capture 'this' by reference. 2025-02-27 11:56:51 -05:00
Thomas Harte
49fec1bc10 Remove meaningless 'volatile'. 2025-02-27 11:56:24 -05:00
Thomas Harte
de164469c4 Update version, copyright string. 2025-02-26 21:30:41 -05:00
Thomas Harte
f595871cd9 Merge pull request #1476 from TomHarte/MoreChangeEffects
Widen media change observation.
2025-02-26 21:23:19 -05:00
Thomas Harte
ff86cbd48e Remove more get_s. 2025-02-26 20:26:06 -05:00
Thomas Harte
47bd4dade5 Avoid direct cstdio where meaningful. 2025-02-26 18:04:13 -05:00
Thomas Harte
ff8180920f Simplify extension finder, 80/81 file grabbing. 2025-02-26 17:17:24 -05:00
Thomas Harte
d4f08f0006 Remove get_. 2025-02-26 17:09:47 -05:00
Thomas Harte
1db756063b Further remove type info from function naming. 2025-02-26 16:00:34 -05:00
Thomas Harte
b44ea31bbf Deal with default sizes delcaratively. 2025-02-26 11:33:38 -05:00
Thomas Harte
ddccb946ff Fix precedence error in put_le. 2025-02-25 23:24:11 -05:00
Thomas Harte
1f6f30ae9e Implement MediaChangeObserver for the consoles. 2025-02-25 23:03:45 -05:00
Thomas Harte
4b19a3f4ed Split interface, make const. 2025-02-25 22:58:36 -05:00
Thomas Harte
c39d0ce2f7 Add note to self. 2025-02-25 22:37:12 -05:00
Thomas Harte
cbdf1a941c Merge pull request #1475 from TomHarte/FileDidChange
macOS: Reinsert media and/or restart machines upon underlying file changes.
2025-02-24 23:12:17 -05:00
Thomas Harte
a340635de5 Fix lost audio, race condition. 2025-02-24 23:04:41 -05:00
Thomas Harte
d62362db1a Reduce copy and paste. 2025-02-24 22:50:56 -05:00
Thomas Harte
a0aba69306 Resolve lost options. 2025-02-24 22:46:44 -05:00
Thomas Harte
765683cd34 Copy and paste to a mostly working substitution. 2025-02-24 22:44:10 -05:00
Thomas Harte
93ddf4f0ba Ensure ZX Spectrum, at least, returns correct indication. 2025-02-24 22:34:15 -05:00
Thomas Harte
8dcccf11bf Improve constness, remove unnecessary virtuals. 2025-02-24 18:18:12 -05:00
Thomas Harte
43353ce892 Confirm and wire through semantics. 2025-02-24 15:36:18 -05:00
Thomas Harte
a698fea078 Spell out some options. 2025-02-23 18:15:14 -05:00
Thomas Harte
390d9b0fe1 Add further note to self. 2025-02-22 23:12:41 -05:00
Thomas Harte
fd3ff05b17 Avoid undefined behaviour on left shift. 2025-02-22 23:06:40 -05:00
Thomas Harte
a5e4c9dd7b Add pure file-content change observer. 2025-02-22 22:40:15 -05:00
Thomas Harte
37f07dcc5a Add note to self on intentions. 2025-02-21 17:51:14 -05:00
Thomas Harte
75bae9a59c Merge pull request #1474 from TomHarte/LighterMouseovers
Adjust macOS UI to show options/volume only when _directly_ mouseovered.
2025-02-21 12:42:15 -05:00
Thomas Harte
1684d88a3b Don't hide mouse cursor if over an interesting subview. 2025-02-21 11:43:47 -05:00
Thomas Harte
50acbb70da Rename protocol method. 2025-02-21 11:37:37 -05:00
Thomas Harte
4de1025468 Avoid potential MSX 2 crash at startup. 2025-02-21 11:37:24 -05:00
Thomas Harte
c2506dd115 Show controls immediately at startup. 2025-02-21 11:31:13 -05:00
Thomas Harte
f8c9aa8e6c Require mouseover near the volume/controls to activate. 2025-02-21 11:28:53 -05:00
Thomas Harte
e19dc1f067 Make scan target the window's native view. 2025-02-21 10:43:56 -05:00
Thomas Harte
84776bced1 Merge pull request #1473 from TomHarte/BetterBitReader
Slim FileHolder; improve and extract BitSerialiser.
2025-02-20 23:03:39 -05:00
Thomas Harte
9162c86e21 Test, improve BitStream. 2025-02-20 22:42:02 -05:00
Thomas Harte
88ffcbc62b Work in terms of the number of bits to be handled. 2025-02-19 22:04:51 -05:00
Thomas Harte
6aff0b74cd Reduce redundant types. 2025-02-19 00:09:57 -05:00
Thomas Harte
79671890c5 Generalise and improve BitStream. 2025-02-18 23:17:39 -05:00
Thomas Harte
edd4ed307f Template away repetition. 2025-02-18 22:48:47 -05:00
Thomas Harte
f786f8a970 Merge pull request #1472 from TomHarte/FastPRGs
Withdraw PRG support for the Plus 4.
2025-02-18 21:57:32 -05:00
Thomas Harte
a1d10adaa3 Support only the Vic-20 for PRGs for now. 2025-02-18 20:46:43 -05:00
Thomas Harte
7f480e8e56 Swing desperately at fast tape loading. 2025-02-11 21:49:58 -05:00
Thomas Harte
94b972aaf4 Improve style. 2025-02-11 21:48:56 -05:00
Thomas Harte
9470775292 Avoid race condition on input/output frequencies. 2025-02-11 21:48:23 -05:00
Thomas Harte
93eb63d930 Add interrupt register to TED check set. 2025-02-11 21:47:36 -05:00
Thomas Harte
ea81096a43 Reinstall debugging temporariness. 2025-02-07 18:09:33 -05:00
Thomas Harte
594045b4e7 Merge pull request #1471 from TomHarte/CRCInterface
Remove need for a CRC generator instance.
2025-02-05 22:18:59 -05:00
Thomas Harte
1449330ed3 Use updated interface. 2025-02-04 23:14:49 -05:00
Thomas Harte
07493a6b18 Remove need for a CRC generator instance. 2025-02-04 22:54:39 -05:00
Thomas Harte
0310db5f24 Merge pull request #1470 from TomHarte/SimplerReverse
Unify and simplify bit reversal functions.
2025-02-04 21:49:57 -05:00
Thomas Harte
ed6d5a7d38 Correct test target. 2025-02-04 00:05:09 -05:00
Thomas Harte
ca7c1bc631 Remove redundant inlines. 2025-02-04 00:00:12 -05:00
Thomas Harte
259070c658 Unify reverse functions. 2025-02-03 23:58:41 -05:00
Thomas Harte
e1a7dd9b24 Implement recursive reverse. 2025-02-03 23:50:15 -05:00
Thomas Harte
e5945fbb3d Merge pull request #1469 from TomHarte/AllWarnings
Resolve all current compiler warnings.
2025-02-03 22:08:12 -05:00
Thomas Harte
247f636988 Reinstate ZRLE support. 2025-02-03 21:56:12 -05:00
Thomas Harte
c58a2ee624 Remove redundant moves. 2025-02-03 21:44:30 -05:00
Thomas Harte
35a1b44c21 Remove unused elements. 2025-02-03 21:42:07 -05:00
Thomas Harte
fd09f06507 Merge pull request #1468 from TomHarte/Qt6CI
Reinstate Xcode CI.
2025-02-03 21:34:36 -05:00
Thomas Harte
d66b501a99 Request latest Xcode. 2025-02-03 21:27:53 -05:00
Thomas Harte
349f6766ac Switch to array. 2025-02-03 21:24:05 -05:00
Thomas Harte
cd55ed1514 Persevere. 2025-02-03 21:22:50 -05:00
Thomas Harte
14d4c8accc Disable Qt 6; try to reenable Xcode. 2025-02-03 21:21:25 -05:00
Thomas Harte
37bca96bde Strip back. 2025-02-03 21:17:19 -05:00
Thomas Harte
b0e6ae58c4 Try 6.7. 2025-02-03 21:00:40 -05:00
Thomas Harte
0375e47359 Accept any 6.8. 2025-02-03 20:48:56 -05:00
Thomas Harte
8450ad2856 Add Qt 6 CI. 2025-02-03 20:28:46 -05:00
620 changed files with 19587 additions and 13521 deletions

View File

@@ -1,18 +1,24 @@
name: Build name: Build
on: [pull_request] on: [pull_request]
jobs: jobs:
# build-mac-xcodebuild:
# name: Mac UI / xcodebuild / ${{ matrix.os }} build-mac-xcodebuild:
# strategy: name: Mac UI / xcodebuild / ${{ matrix.os }}
# matrix: strategy:
# os: [macos-13, macos-14, macos-15] matrix:
# runs-on: ${{ matrix.os }} os: [macos-latest] #[macos-13, macos-14, macos-15]
# steps: runs-on: ${{ matrix.os }}
# - name: Checkout steps:
# uses: actions/checkout@v4 - name: Checkout
# - name: Make uses: actions/checkout@v4
# working-directory: OSBindings/Mac - name: Install Xcode
# run: xcodebuild CODE_SIGN_IDENTITY=- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Make
working-directory: OSBindings/Mac
run: xcodebuild CODE_SIGN_IDENTITY=-
build-sdl-cmake: build-sdl-cmake:
name: SDL UI / cmake / ${{ matrix.os }} name: SDL UI / cmake / ${{ matrix.os }}
strategy: strategy:
@@ -31,6 +37,7 @@ jobs:
sudo apt-get --fix-missing install cmake gcc-10 libsdl2-dev sudo apt-get --fix-missing install cmake gcc-10 libsdl2-dev
;; ;;
macOS) macOS)
brew uninstall cmake
brew install cmake sdl2 brew install cmake sdl2
;; ;;
esac esac
@@ -49,6 +56,7 @@ jobs:
esac esac
cmake -S. -Bbuild -DCLK_UI=SDL -DCMAKE_BUILD_TYPE=Release cmake -S. -Bbuild -DCLK_UI=SDL -DCMAKE_BUILD_TYPE=Release
cmake --build build -v -j"$jobs" cmake --build build -v -j"$jobs"
build-sdl-scons: build-sdl-scons:
name: SDL UI / scons / ${{ matrix.os }} name: SDL UI / scons / ${{ matrix.os }}
strategy: strategy:
@@ -85,8 +93,9 @@ jobs:
jobs=1 jobs=1
esac esac
scons -j"$jobs" scons -j"$jobs"
build-qt:
name: Qt / ${{ matrix.os }} build-qt5:
name: Qt 5 / ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest] os: [ubuntu-latest]
@@ -105,3 +114,24 @@ jobs:
run: | run: |
qmake -o Makefile clksignal.pro qmake -o Makefile clksignal.pro
make make
# build-qt6:
# name: Qt 6 / ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest]
# runs-on: ${{ matrix.os }}
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Install dependencies
# uses: jurplel/install-qt-action@v4
# with:
# version: '6.8'
# archives: qtbase
# - name: Make
# working-directory: OSBindings/Qt
# shell: bash
# run: |
# qmake -o Makefile clksignal.pro
# make

View File

@@ -14,7 +14,7 @@ namespace Activity {
class Source { class Source {
public: public:
virtual void set_activity_observer(Observer *observer) = 0; virtual void set_activity_observer(Observer *) = 0;
}; };
} }

View File

@@ -10,7 +10,7 @@
using namespace Analyser::Dynamic; using namespace Analyser::Dynamic;
float ConfidenceCounter::get_confidence() { float ConfidenceCounter::confidence() const {
return float(hits_) / float(hits_ + misses_); return float(hits_) / float(hits_ + misses_);
} }

View File

@@ -20,7 +20,7 @@ namespace Analyser::Dynamic {
class ConfidenceCounter: public ConfidenceSource { class ConfidenceCounter: public ConfidenceSource {
public: public:
/*! @returns The computed probability, based on the history of events. */ /*! @returns The computed probability, based on the history of events. */
float get_confidence() final; float confidence() const final;
/*! Records an event that implies this is the appropriate class: pushes probability up towards 1.0. */ /*! Records an event that implies this is the appropriate class: pushes probability up towards 1.0. */
void add_hit(); void add_hit();

View File

@@ -17,7 +17,7 @@ namespace Analyser::Dynamic {
program is handed to an Atari 2600 then its confidence should grow towards 1.0. program is handed to an Atari 2600 then its confidence should grow towards 1.0.
*/ */
struct ConfidenceSource { struct ConfidenceSource {
virtual float get_confidence() = 0; virtual float confidence() const = 0;
}; };
} }

View File

@@ -22,10 +22,10 @@ ConfidenceSummary::ConfidenceSummary(
weight_sum_ = std::accumulate(weights.begin(), weights.end(), 0.0f); weight_sum_ = std::accumulate(weights.begin(), weights.end(), 0.0f);
} }
float ConfidenceSummary::get_confidence() { float ConfidenceSummary::confidence() const {
float result = 0.0f; float result = 0.0f;
for(std::size_t index = 0; index < sources_.size(); ++index) { for(std::size_t index = 0; index < sources_.size(); ++index) {
result += sources_[index]->get_confidence() * weights_[index]; result += sources_[index]->confidence() * weights_[index];
} }
return result / weight_sum_; return result / weight_sum_;
} }

View File

@@ -30,7 +30,7 @@ public:
const std::vector<float> &weights); const std::vector<float> &weights);
/*! @returns The weighted sum of all sources. */ /*! @returns The weighted sum of all sources. */
float get_confidence() final; float confidence() const final;
private: private:
const std::vector<ConfidenceSource *> sources_; const std::vector<ConfidenceSource *> sources_;

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../../../../Machines/DynamicMachine.hpp" #include "Machines/DynamicMachine.hpp"
#include "../../../../Configurable/Configurable.hpp" #include "Configurable/Configurable.hpp"
#include <memory> #include <memory>
#include <vector> #include <vector>

View File

@@ -8,7 +8,7 @@
#pragma once #pragma once
#include "../../../../Machines/DynamicMachine.hpp" #include "Machines/DynamicMachine.hpp"
#include <memory> #include <memory>
#include <vector> #include <vector>

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../../../../Machines/DynamicMachine.hpp" #include "Machines/DynamicMachine.hpp"
#include "../../../../Machines/KeyboardMachine.hpp" #include "Machines/KeyboardMachine.hpp"
#include <memory> #include <memory>
#include <vector> #include <vector>

View File

@@ -7,6 +7,7 @@
// //
#include "MultiMediaTarget.hpp" #include "MultiMediaTarget.hpp"
#include <unordered_set>
using namespace Analyser::Dynamic; using namespace Analyser::Dynamic;
@@ -27,3 +28,29 @@ bool MultiMediaTarget::insert_media(const Analyser::Static::Media &media) {
} }
return inserted; return inserted;
} }
MultiMediaChangeObserver::MultiMediaChangeObserver(const std::vector<std::unique_ptr<::Machine::DynamicMachine>> &machines) {
for(const auto &machine: machines) {
auto media_change_observer = machine->media_change_observer();
if(media_change_observer) targets_.push_back(media_change_observer);
}
}
using ChangeEffect = MachineTypes::MediaChangeObserver::ChangeEffect;
ChangeEffect MultiMediaChangeObserver::effect_for_file_did_change(const std::string &name) const {
if(targets_.empty()) {
return ChangeEffect::None;
}
std::unordered_set<ChangeEffect> effects;
for(const auto &target: targets_) {
effects.insert(target->effect_for_file_did_change(name));
}
// No agreement => restart.
if(effects.size() > 1) {
return ChangeEffect::RestartMachine;
}
return *effects.begin();
}

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../../../../Machines/MediaTarget.hpp" #include "Machines/MediaTarget.hpp"
#include "../../../../Machines/DynamicMachine.hpp" #include "Machines/DynamicMachine.hpp"
#include <memory> #include <memory>
#include <vector> #include <vector>
@@ -33,4 +33,15 @@ private:
std::vector<MachineTypes::MediaTarget *> targets_; std::vector<MachineTypes::MediaTarget *> targets_;
}; };
struct MultiMediaChangeObserver: public MachineTypes::MediaChangeObserver {
public:
MultiMediaChangeObserver(const std::vector<std::unique_ptr<::Machine::DynamicMachine>> &);
// Below is the standard MediaTarget::Machine interface; see there for documentation.
ChangeEffect effect_for_file_did_change(const std::string &) const final;
private:
std::vector<MachineTypes::MediaChangeObserver *> targets_;
};
} }

View File

@@ -19,7 +19,7 @@ template <typename MachineType>
void MultiInterface<MachineType>::perform_parallel(const std::function<void(MachineType *)> &function) { void MultiInterface<MachineType>::perform_parallel(const std::function<void(MachineType *)> &function) {
// Apply a blunt force parallelisation of the machines; each run_for is dispatched // Apply a blunt force parallelisation of the machines; each run_for is dispatched
// to a separate queue and this queue will block until all are done. // to a separate queue and this queue will block until all are done.
volatile std::size_t outstanding_machines; std::size_t outstanding_machines;
std::condition_variable condition; std::condition_variable condition;
std::mutex mutex; std::mutex mutex;
{ {
@@ -33,7 +33,7 @@ void MultiInterface<MachineType>::perform_parallel(const std::function<void(Mach
if(machine) function(machine); if(machine) function(machine);
std::lock_guard lock(mutex); std::lock_guard lock(mutex);
outstanding_machines--; --outstanding_machines;
condition.notify_all(); condition.notify_all();
}); });
} }
@@ -106,5 +106,5 @@ void MultiTimedMachine::run_for(const Time::Seconds duration) {
if(machine->get_confidence() >= 0.01f) machine->run_for(duration); if(machine->get_confidence() >= 0.01f) machine->run_for(duration);
}); });
if(delegate_) delegate_->did_run_machines(this); if(delegate_) delegate_->did_run_machines(*this);
} }

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../../Concurrency/AsyncTaskQueue.hpp" #include "Concurrency/AsyncTaskQueue.hpp"
#include "../../../../Machines/MachineTypes.hpp" #include "Machines/MachineTypes.hpp"
#include "../../../../Machines/DynamicMachine.hpp" #include "Machines/DynamicMachine.hpp"
#include "MultiSpeaker.hpp" #include "MultiSpeaker.hpp"
@@ -60,7 +60,7 @@ public:
been received. been received.
*/ */
struct Delegate { struct Delegate {
virtual void did_run_machines(MultiTimedMachine *) = 0; virtual void did_run_machines(MultiTimedMachine &) = 0;
}; };
/// Sets @c delegate as the receiver of delegate messages. /// Sets @c delegate as the receiver of delegate messages.
void set_delegate(Delegate *const delegate) { void set_delegate(Delegate *const delegate) {

View File

@@ -60,24 +60,24 @@ void MultiSpeaker::set_output_volume(const float volume) {
} }
} }
void MultiSpeaker::speaker_did_complete_samples(Speaker *const speaker, const std::vector<int16_t> &buffer) { void MultiSpeaker::speaker_did_complete_samples(Speaker &speaker, const std::vector<int16_t> &buffer) {
auto delegate = delegate_.load(std::memory_order_relaxed); auto delegate = delegate_.load(std::memory_order_relaxed);
if(!delegate) return; if(!delegate) return;
{ {
std::lock_guard lock_guard(front_speaker_mutex_); std::lock_guard lock_guard(front_speaker_mutex_);
if(speaker != front_speaker_) return; if(&speaker != front_speaker_) return;
} }
did_complete_samples(this, buffer, stereo_output_); did_complete_samples(this, buffer, stereo_output_);
} }
void MultiSpeaker::speaker_did_change_input_clock(Speaker *const speaker) { void MultiSpeaker::speaker_did_change_input_clock(Speaker &speaker) {
auto delegate = delegate_.load(std::memory_order_relaxed); auto delegate = delegate_.load(std::memory_order_relaxed);
if(!delegate) return; if(!delegate) return;
{ {
std::lock_guard lock_guard(front_speaker_mutex_); std::lock_guard lock_guard(front_speaker_mutex_);
if(speaker != front_speaker_) return; if(&speaker != front_speaker_) return;
} }
delegate->speaker_did_change_input_clock(this); delegate->speaker_did_change_input_clock(*this);
} }
void MultiSpeaker::set_new_front_machine(::Machine::DynamicMachine *const machine) { void MultiSpeaker::set_new_front_machine(::Machine::DynamicMachine *const machine) {
@@ -87,6 +87,6 @@ void MultiSpeaker::set_new_front_machine(::Machine::DynamicMachine *const machin
} }
auto delegate = delegate_.load(std::memory_order_relaxed); auto delegate = delegate_.load(std::memory_order_relaxed);
if(delegate) { if(delegate) {
delegate->speaker_did_change_input_clock(this); delegate->speaker_did_change_input_clock(*this);
} }
} }

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../../../../Machines/DynamicMachine.hpp" #include "Machines/DynamicMachine.hpp"
#include "../../../../Outputs/Speaker/Speaker.hpp" #include "Outputs/Speaker/Speaker.hpp"
#include <memory> #include <memory>
#include <mutex> #include <mutex>
@@ -42,8 +42,8 @@ public:
void set_output_volume(float) override; void set_output_volume(float) override;
private: private:
void speaker_did_complete_samples(Speaker *speaker, const std::vector<int16_t> &buffer) final; void speaker_did_complete_samples(Speaker &, const std::vector<int16_t> &buffer) final;
void speaker_did_change_input_clock(Speaker *speaker) final; void speaker_did_change_input_clock(Speaker &) final;
MultiSpeaker(const std::vector<Outputs::Speaker::Speaker *> &speakers); MultiSpeaker(const std::vector<Outputs::Speaker::Speaker *> &speakers);
std::vector<Outputs::Speaker::Speaker *> speakers_; std::vector<Outputs::Speaker::Speaker *> speakers_;

View File

@@ -7,7 +7,7 @@
// //
#include "MultiMachine.hpp" #include "MultiMachine.hpp"
#include "../../../Outputs/Log.hpp" #include "Outputs/Log.hpp"
#include <algorithm> #include <algorithm>
@@ -27,7 +27,8 @@ MultiMachine::MultiMachine(std::vector<std::unique_ptr<DynamicMachine>> &&machin
audio_producer_(machines_, machines_mutex_), audio_producer_(machines_, machines_mutex_),
joystick_machine_(machines_), joystick_machine_(machines_),
keyboard_machine_(machines_), keyboard_machine_(machines_),
media_target_(machines_) media_target_(machines_),
media_change_observer_(machines_)
{ {
timed_machine_.set_delegate(this); timed_machine_.set_delegate(this);
} }
@@ -52,6 +53,7 @@ Provider(MachineTypes::AudioProducer, audio_producer, audio_producer_)
Provider(MachineTypes::JoystickMachine, joystick_machine, joystick_machine_) Provider(MachineTypes::JoystickMachine, joystick_machine, joystick_machine_)
Provider(MachineTypes::KeyboardMachine, keyboard_machine, keyboard_machine_) Provider(MachineTypes::KeyboardMachine, keyboard_machine, keyboard_machine_)
Provider(MachineTypes::MediaTarget, media_target, media_target_) Provider(MachineTypes::MediaTarget, media_target, media_target_)
Provider(MachineTypes::MediaChangeObserver, media_change_observer, media_change_observer_)
MachineTypes::MouseMachine *MultiMachine::mouse_machine() { MachineTypes::MouseMachine *MultiMachine::mouse_machine() {
// TODO. // TODO.
@@ -66,10 +68,10 @@ bool MultiMachine::would_collapse(const std::vector<std::unique_ptr<DynamicMachi
(machines.front()->timed_machine()->get_confidence() >= 2.0f * machines[1]->timed_machine()->get_confidence()); (machines.front()->timed_machine()->get_confidence() >= 2.0f * machines[1]->timed_machine()->get_confidence());
} }
void MultiMachine::did_run_machines(MultiTimedMachine *) { void MultiMachine::did_run_machines(MultiTimedMachine &) {
std::lock_guard machines_lock(machines_mutex_); std::lock_guard machines_lock(machines_mutex_);
if constexpr (logger.enabled) { if constexpr (logger.InfoEnabled) {
auto line = logger.info(); auto line = logger.info();
for(const auto &machine: machines_) { for(const auto &machine: machines_) {
auto timed_machine = machine->timed_machine(); auto timed_machine = machine->timed_machine();

View File

@@ -8,14 +8,14 @@
#pragma once #pragma once
#include "../../../Machines/DynamicMachine.hpp" #include "Machines/DynamicMachine.hpp"
#include "Implementation/MultiProducer.hpp" #include "Analyser/Dynamic/MultiMachine/Implementation/MultiProducer.hpp"
#include "Implementation/MultiConfigurable.hpp" #include "Analyser/Dynamic/MultiMachine/Implementation/MultiConfigurable.hpp"
#include "Implementation/MultiProducer.hpp" #include "Analyser/Dynamic/MultiMachine/Implementation/MultiProducer.hpp"
#include "Implementation/MultiJoystickMachine.hpp" #include "Analyser/Dynamic/MultiMachine/Implementation/MultiJoystickMachine.hpp"
#include "Implementation/MultiKeyboardMachine.hpp" #include "Analyser/Dynamic/MultiMachine/Implementation/MultiKeyboardMachine.hpp"
#include "Implementation/MultiMediaTarget.hpp" #include "Analyser/Dynamic/MultiMachine/Implementation/MultiMediaTarget.hpp"
#include <memory> #include <memory>
#include <mutex> #include <mutex>
@@ -58,10 +58,11 @@ public:
MachineTypes::KeyboardMachine *keyboard_machine() final; MachineTypes::KeyboardMachine *keyboard_machine() final;
MachineTypes::MouseMachine *mouse_machine() final; MachineTypes::MouseMachine *mouse_machine() final;
MachineTypes::MediaTarget *media_target() final; MachineTypes::MediaTarget *media_target() final;
MachineTypes::MediaChangeObserver *media_change_observer() final;
void *raw_pointer() final; void *raw_pointer() final;
private: private:
void did_run_machines(MultiTimedMachine *) final; void did_run_machines(MultiTimedMachine &) final;
std::vector<std::unique_ptr<DynamicMachine>> machines_; std::vector<std::unique_ptr<DynamicMachine>> machines_;
std::recursive_mutex machines_mutex_; std::recursive_mutex machines_mutex_;
@@ -73,6 +74,7 @@ private:
MultiJoystickMachine joystick_machine_; MultiJoystickMachine joystick_machine_;
MultiKeyboardMachine keyboard_machine_; MultiKeyboardMachine keyboard_machine_;
MultiMediaTarget media_target_; MultiMediaTarget media_target_;
MultiMediaChangeObserver media_change_observer_;
void pick_first(); void pick_first();
bool has_picked_ = false; bool has_picked_ = false;

View File

@@ -8,9 +8,9 @@
#include "Disk.hpp" #include "Disk.hpp"
#include "../../../Storage/Disk/Controller/DiskController.hpp" #include "Storage/Disk/Controller/DiskController.hpp"
#include "../../../Storage/Disk/Encodings/MFM/Parser.hpp" #include "Storage/Disk/Encodings/MFM/Parser.hpp"
#include "../../../Numeric/CRC.hpp" #include "Numeric/CRC.hpp"
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>

View File

@@ -9,7 +9,7 @@
#pragma once #pragma once
#include "File.hpp" #include "File.hpp"
#include "../../../Storage/Disk/Disk.hpp" #include "Storage/Disk/Disk.hpp"
namespace Analyser::Static::Acorn { namespace Analyser::Static::Acorn {

View File

@@ -8,6 +8,7 @@
#pragma once #pragma once
#include <cstdint>
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@@ -12,7 +12,7 @@
#include "Tape.hpp" #include "Tape.hpp"
#include "Target.hpp" #include "Target.hpp"
#include "../../../Numeric/StringSimilarity.hpp" #include "Numeric/StringSimilarity.hpp"
#include <algorithm> #include <algorithm>
#include <map> #include <map>
@@ -167,8 +167,8 @@ Analyser::Static::TargetList Analyser::Static::Acorn::GetTargets(
// Take whatever else comes with a preference for things that don't // 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 // have 'boot' or 'read' in them (the latter of which will tend to be
// read_me or read_this or similar). // read_me or read_this or similar).
constexpr char read[] = "read"; static constexpr char read[] = "read";
constexpr char boot[] = "boot"; static constexpr char boot[] = "boot";
const auto has = [&](const char *begin, const char *end) { const auto has = [&](const char *begin, const char *end) {
return std::search( return std::search(
file.name.begin(), file.name.end(), file.name.begin(), file.name.end(),

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::Acorn { namespace Analyser::Static::Acorn {

View File

@@ -10,8 +10,8 @@
#include <deque> #include <deque>
#include "../../../Numeric/CRC.hpp" #include "Numeric/CRC.hpp"
#include "../../../Storage/Tape/Parsers/Acorn.hpp" #include "Storage/Tape/Parsers/Acorn.hpp"
using namespace Analyser::Static::Acorn; using namespace Analyser::Static::Acorn;

View File

@@ -8,10 +8,10 @@
#pragma once #pragma once
#include <memory>
#include "File.hpp" #include "File.hpp"
#include "../../../Storage/Tape/Tape.hpp" #include "Storage/Tape/Tape.hpp"
#include <vector>
namespace Analyser::Static::Acorn { namespace Analyser::Static::Acorn {

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../../../Reflection/Struct.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
#include <string> #include <string>
namespace Analyser::Static::Acorn { namespace Analyser::Static::Acorn {

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::Amiga { namespace Analyser::Static::Amiga {

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../../../Reflection/Struct.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
namespace Analyser::Static::Amiga { namespace Analyser::Static::Amiga {

View File

@@ -8,15 +8,15 @@
#include "StaticAnalyser.hpp" #include "StaticAnalyser.hpp"
#include <algorithm> #include "Storage/Disk/Parsers/CPM.hpp"
#include <cstring> #include "Storage/Disk/Encodings/MFM/Parser.hpp"
#include "Storage/Tape/Parsers/Spectrum.hpp"
#include "../../../Storage/Disk/Parsers/CPM.hpp"
#include "../../../Storage/Disk/Encodings/MFM/Parser.hpp"
#include "../../../Storage/Tape/Parsers/Spectrum.hpp"
#include "Target.hpp" #include "Target.hpp"
#include <algorithm>
#include <cstring>
namespace { namespace {
bool strcmp_insensitive(const char *a, const char *b) { bool strcmp_insensitive(const char *a, const char *b) {

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::AmstradCPC { namespace Analyser::Static::AmstradCPC {

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../Reflection/Enum.hpp" #include "Reflection/Enum.hpp"
#include "../../../Reflection/Struct.hpp" #include "Reflection/Struct.hpp"
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include <string> #include <string>
namespace Analyser::Static::AmstradCPC { namespace Analyser::Static::AmstradCPC {

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::AppleII { namespace Analyser::Static::AppleII {

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../Reflection/Enum.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Reflection/Struct.hpp" #include "Reflection/Enum.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
namespace Analyser::Static::AppleII { namespace Analyser::Static::AppleII {

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::AppleIIgs { namespace Analyser::Static::AppleIIgs {

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../Reflection/Enum.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Reflection/Struct.hpp" #include "Reflection/Enum.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
namespace Analyser::Static::AppleIIgs { namespace Analyser::Static::AppleIIgs {

View File

@@ -10,7 +10,7 @@
#include "Target.hpp" #include "Target.hpp"
#include "../Disassembler/6502.hpp" #include "Analyser/Static/Disassembler/6502.hpp"
using namespace Analyser::Static::Atari2600; using namespace Analyser::Static::Atari2600;
using Target = Analyser::Static::Atari2600::Target; using Target = Analyser::Static::Atari2600::Target;

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::Atari2600 { namespace Analyser::Static::Atari2600 {

View File

@@ -8,7 +8,7 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
namespace Analyser::Static::Atari2600 { namespace Analyser::Static::Atari2600 {

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::AtariST { namespace Analyser::Static::AtariST {

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../../../Reflection/Struct.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
namespace Analyser::Static::AtariST { namespace Analyser::Static::AtariST {

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::Coleco { namespace Analyser::Static::Coleco {

View File

@@ -7,14 +7,14 @@
// //
#include "Disk.hpp" #include "Disk.hpp"
#include "../../../Storage/Disk/Controller/DiskController.hpp" #include "Storage/Disk/Controller/DiskController.hpp"
#include "../../../Storage/Disk/Encodings/CommodoreGCR.hpp" #include "Storage/Disk/Encodings/CommodoreGCR.hpp"
#include "../../../Storage/Data/Commodore.hpp" #include "Storage/Data/Commodore.hpp"
#include <limits>
#include <vector>
#include <array> #include <array>
#include <limits>
#include <unordered_map> #include <unordered_map>
#include <vector>
using namespace Analyser::Static::Commodore; using namespace Analyser::Static::Commodore;

View File

@@ -8,7 +8,7 @@
#pragma once #pragma once
#include "../../../Storage/Disk/Disk.hpp" #include "Storage/Disk/Disk.hpp"
#include "File.hpp" #include "File.hpp"
#include <vector> #include <vector>

View File

@@ -12,11 +12,11 @@
#include "File.hpp" #include "File.hpp"
#include "Tape.hpp" #include "Tape.hpp"
#include "Target.hpp" #include "Target.hpp"
#include "../../../Storage/Cartridge/Encodings/CommodoreROM.hpp" #include "Storage/Cartridge/Encodings/CommodoreROM.hpp"
#include "../../../Outputs/Log.hpp" #include "Outputs/Log.hpp"
#include "../Disassembler/6502.hpp" #include "Analyser/Static/Disassembler/6502.hpp"
#include "../Disassembler/AddressMapper.hpp" #include "Analyser/Static/Disassembler/AddressMapper.hpp"
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
@@ -180,9 +180,8 @@ bool obviously_uses_ted(const File &file) {
analysis->machine_code_addresses analysis->machine_code_addresses
); );
// If FF3E or FF3F is touched, this is for the +4. // Check for interrupt status and paging touches.
// TODO: probably require a very early touch. for(const auto address: {0xff3e, 0xff3f, 0xff09}) {
for(const auto address: {0xff3e, 0xff3f}) {
for(const auto &collection: { for(const auto &collection: {
disassembly.external_loads, disassembly.external_loads,
disassembly.external_stores, disassembly.external_stores,
@@ -299,7 +298,7 @@ std::unique_ptr<Analyser::Static::Target> get_target<TargetPlatform::Plus4>(
// Attach a 1541 if there are any disks here. // Attach a 1541 if there are any disks here.
target->has_c1541 = !target->media.disks.empty(); target->has_c1541 = !target->media.disks.empty();
return std::move(target); return target;
} }
template<> template<>
@@ -392,7 +391,7 @@ std::unique_ptr<Analyser::Static::Target> get_target<TargetPlatform::Vic20>(
// Attach a 1540 if there are any disks here. // Attach a 1540 if there are any disks here.
target->has_c1540 = !target->media.disks.empty(); target->has_c1540 = !target->media.disks.empty();
return std::move(target); return target;
} }
} }

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::Commodore { namespace Analyser::Static::Commodore {

View File

@@ -7,8 +7,9 @@
// //
#include "Tape.hpp" #include "Tape.hpp"
#include "Storage/Tape/Parsers/Commodore.hpp"
#include "../../../Storage/Tape/Parsers/Commodore.hpp" #include <algorithm>
using namespace Analyser::Static::Commodore; using namespace Analyser::Static::Commodore;
@@ -38,7 +39,7 @@ std::vector<File> Analyser::Static::Commodore::GetFiles(Storage::Tape::TapeSeria
header = parser.get_next_header(serialiser); header = parser.get_next_header(serialiser);
if(!header) continue; if(!header) continue;
if(header->type != Storage::Tape::Commodore::Header::DataBlock) break; if(header->type != Storage::Tape::Commodore::Header::DataBlock) break;
std::copy(header->data.begin(), header->data.end(), std::back_inserter(new_file.data)); std::ranges::copy(header->data, std::back_inserter(new_file.data));
} }
} }
break; break;

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../../../Storage/Tape/Tape.hpp" #include "Storage/Tape/Tape.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include "File.hpp" #include "File.hpp"
namespace Analyser::Static::Commodore { namespace Analyser::Static::Commodore {

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../Reflection/Enum.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Reflection/Struct.hpp" #include "Reflection/Enum.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
#include <string> #include <string>
namespace Analyser::Static::Commodore { namespace Analyser::Static::Commodore {

View File

@@ -60,11 +60,11 @@ private:
bool overrun_ = false; bool overrun_ = false;
}; };
constexpr uint8_t x(uint8_t v) { return v >> 6; } constexpr uint8_t x(const uint8_t v) { return v >> 6; }
constexpr uint8_t y(uint8_t v) { return (v >> 3) & 7; } constexpr uint8_t y(const uint8_t v) { return (v >> 3) & 7; }
constexpr uint8_t q(uint8_t v) { return (v >> 3) & 1; } constexpr uint8_t q(const uint8_t v) { return (v >> 3) & 1; }
constexpr uint8_t p(uint8_t v) { return (v >> 4) & 3; } constexpr uint8_t p(const uint8_t v) { return (v >> 4) & 3; }
constexpr uint8_t z(uint8_t v) { return v & 7; } constexpr uint8_t z(const uint8_t v) { return v & 7; }
Instruction::Condition condition_table[] = { Instruction::Condition condition_table[] = {
Instruction::Condition::NZ, Instruction::Condition::Z, Instruction::Condition::NZ, Instruction::Condition::Z,
@@ -92,7 +92,7 @@ Instruction::Location RegisterTableEntry(
Instruction &instruction, Instruction &instruction,
const bool needs_indirect_offset const bool needs_indirect_offset
) { ) {
constexpr Instruction::Location register_table[] = { static constexpr Instruction::Location register_table[] = {
Instruction::Location::B, Instruction::Location::C, Instruction::Location::B, Instruction::Location::C,
Instruction::Location::D, Instruction::Location::E, Instruction::Location::D, Instruction::Location::E,
Instruction::Location::H, Instruction::Location::L, Instruction::Location::H, Instruction::Location::L,

View File

@@ -8,14 +8,14 @@
#include "StaticAnalyser.hpp" #include "StaticAnalyser.hpp"
#include "../AppleII/Target.hpp" #include "Analyser/Static/AppleII/Target.hpp"
#include "../AppleIIgs/Target.hpp" #include "Analyser/Static//AppleIIgs/Target.hpp"
#include "../Oric/Target.hpp" #include "Analyser/Static//Oric/Target.hpp"
#include "../Disassembler/6502.hpp" #include "Analyser/Static//Disassembler/6502.hpp"
#include "../Disassembler/AddressMapper.hpp" #include "Analyser/Static//Disassembler/AddressMapper.hpp"
#include "../../../Storage/Disk/Track/TrackSerialiser.hpp" #include "Storage/Disk/Track/TrackSerialiser.hpp"
#include "../../../Storage/Disk/Encodings/AppleGCR/SegmentParser.hpp" #include "Storage/Disk/Encodings/AppleGCR/SegmentParser.hpp"
namespace { namespace {
@@ -60,7 +60,7 @@ Analyser::Static::TargetList Analyser::Static::DiskII::GetTargets(
TargetList targets; TargetList targets;
// If the disk image is too large for a 5.25" disk, map this to the IIgs. // If the disk image is too large for a 5.25" disk, map this to the IIgs.
if(disk->get_maximum_head_position() > Storage::Disk::HeadPosition(40)) { if(disk->maximum_head_position() > Storage::Disk::HeadPosition(40)) {
targets.push_back(std::unique_ptr<Analyser::Static::Target>(AppleIIgsTarget())); targets.push_back(std::unique_ptr<Analyser::Static::Target>(AppleIIgsTarget()));
targets.back()->media = media; targets.back()->media = media;
return targets; return targets;

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::DiskII { namespace Analyser::Static::DiskII {

View File

@@ -9,7 +9,7 @@
#include "StaticAnalyser.hpp" #include "StaticAnalyser.hpp"
#include "Target.hpp" #include "Target.hpp"
#include "../../../Storage/Disk/Parsers/FAT.hpp" #include "Storage/Disk/Parsers/FAT.hpp"
#include <algorithm> #include <algorithm>

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::Enterprise { namespace Analyser::Static::Enterprise {

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../Reflection/Enum.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Reflection/Struct.hpp" #include "Reflection/Enum.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
#include <string> #include <string>

View File

@@ -8,12 +8,12 @@
#include "StaticAnalyser.hpp" #include "StaticAnalyser.hpp"
#include "../Enterprise/StaticAnalyser.hpp" #include "Analyser/Static/Enterprise/StaticAnalyser.hpp"
#include "../PCCompatible/StaticAnalyser.hpp" #include "Analyser/Static/PCCompatible/StaticAnalyser.hpp"
#include "../../../Storage/Disk/Track/TrackSerialiser.hpp" #include "Storage/Disk/Track/TrackSerialiser.hpp"
#include "../../../Storage/Disk/Encodings/MFM/Constants.hpp" #include "Storage/Disk/Encodings/MFM/Constants.hpp"
#include "../../../Storage/Disk/Encodings/MFM/SegmentParser.hpp" #include "Storage/Disk/Encodings/MFM/SegmentParser.hpp"
Analyser::Static::TargetList Analyser::Static::FAT12::GetTargets( Analyser::Static::TargetList Analyser::Static::FAT12::GetTargets(
@@ -39,7 +39,7 @@ Analyser::Static::TargetList Analyser::Static::FAT12::GetTargets(
// If the disk image is very small or large, map it to the PC. That's the only option old enough // 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. // to have used 5.25" media.
if(disk->get_maximum_head_position() <= Storage::Disk::HeadPosition(40)) { if(disk->maximum_head_position() <= Storage::Disk::HeadPosition(40)) {
return Analyser::Static::PCCompatible::GetTargets(media, file_name, platforms, true); return Analyser::Static::PCCompatible::GetTargets(media, file_name, platforms, true);
} }

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::FAT12 { namespace Analyser::Static::FAT12 {

View File

@@ -8,7 +8,7 @@
#pragma once #pragma once
#include "../../../Storage/Cartridge/Cartridge.hpp" #include "Storage/Cartridge/Cartridge.hpp"
namespace Analyser::Static::MSX { namespace Analyser::Static::MSX {

View File

@@ -12,8 +12,8 @@
#include "Tape.hpp" #include "Tape.hpp"
#include "Target.hpp" #include "Target.hpp"
#include "../Disassembler/Z80.hpp" #include "Analyser/Static/Disassembler/Z80.hpp"
#include "../Disassembler/AddressMapper.hpp" #include "Analyser/Static//Disassembler/AddressMapper.hpp"
#include <algorithm> #include <algorithm>

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::MSX { namespace Analyser::Static::MSX {

View File

@@ -8,7 +8,7 @@
#include "Tape.hpp" #include "Tape.hpp"
#include "../../../Storage/Tape/Parsers/MSX.hpp" #include "Storage/Tape/Parsers/MSX.hpp"
using namespace Analyser::Static::MSX; using namespace Analyser::Static::MSX;

View File

@@ -8,7 +8,7 @@
#pragma once #pragma once
#include "../../../Storage/Tape/Tape.hpp" #include "Storage/Tape/Tape.hpp"
#include <string> #include <string>
#include <vector> #include <vector>

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../Reflection/Enum.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Reflection/Struct.hpp" #include "Reflection/Enum.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
#include <string> #include <string>
namespace Analyser::Static::MSX { namespace Analyser::Static::MSX {

View File

@@ -29,7 +29,7 @@ Analyser::Static::TargetList Analyser::Static::Macintosh::GetTargets(
if(media.mass_storage_devices.empty()) { if(media.mass_storage_devices.empty()) {
bool has_800kb_disks = false; bool has_800kb_disks = false;
for(const auto &disk: media.disks) { for(const auto &disk: media.disks) {
has_800kb_disks |= disk->get_head_count() > 1; has_800kb_disks |= disk->head_count() > 1;
} }
if(!has_800kb_disks) { if(!has_800kb_disks) {

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::Macintosh { namespace Analyser::Static::Macintosh {

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../Reflection/Enum.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Reflection/Struct.hpp" #include "Reflection/Enum.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
namespace Analyser::Static::Macintosh { namespace Analyser::Static::Macintosh {

View File

@@ -11,10 +11,10 @@
#include "Tape.hpp" #include "Tape.hpp"
#include "Target.hpp" #include "Target.hpp"
#include "../Disassembler/6502.hpp" #include "Analyser/Static/Disassembler/6502.hpp"
#include "../Disassembler/AddressMapper.hpp" #include "Analyser/Static/Disassembler/AddressMapper.hpp"
#include "../../../Storage/Disk/Encodings/MFM/Parser.hpp" #include "Storage/Disk/Encodings/MFM/Parser.hpp"
#include <cstring> #include <cstring>

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::Oric { namespace Analyser::Static::Oric {

View File

@@ -7,7 +7,7 @@
// //
#include "Tape.hpp" #include "Tape.hpp"
#include "../../../Storage/Tape/Parsers/Oric.hpp" #include "Storage/Tape/Parsers/Oric.hpp"
using namespace Analyser::Static::Oric; using namespace Analyser::Static::Oric;

View File

@@ -8,7 +8,7 @@
#pragma once #pragma once
#include "../../../Storage/Tape/Tape.hpp" #include "Storage/Tape/Tape.hpp"
#include <string> #include <string>
#include <vector> #include <vector>

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../Reflection/Enum.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Reflection/Struct.hpp" #include "Reflection/Enum.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
#include <string> #include <string>
namespace Analyser::Static::Oric { namespace Analyser::Static::Oric {

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::PCCompatible { namespace Analyser::Static::PCCompatible {

View File

@@ -8,21 +8,36 @@
#pragma once #pragma once
#include "../../../Reflection/Struct.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
namespace Analyser::Static::PCCompatible { namespace Analyser::Static::PCCompatible {
ReflectableEnum(Model,
XT,
TurboXT,
AT
);
constexpr bool is_xt(const Model model) {
return model <= Model::TurboXT;
}
constexpr bool is_at(const Model model) {
return model >= Model::AT;
}
constexpr bool has_ide(const Model model) {
return model >= Model::AT;
}
struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Target> { struct Target: public Analyser::Static::Target, public Reflection::StructImpl<Target> {
ReflectableEnum(VideoAdaptor, ReflectableEnum(VideoAdaptor,
MDA, MDA,
CGA); CGA,
);
VideoAdaptor adaptor = VideoAdaptor::CGA; VideoAdaptor adaptor = VideoAdaptor::CGA;
Model model = Model::TurboXT;
ReflectableEnum(Speed,
ApproximatelyOriginal,
Fast);
Speed speed = Speed::Fast;
Target() : Analyser::Static::Target(Machine::PCCompatible) {} Target() : Analyser::Static::Target(Machine::PCCompatible) {}
@@ -30,9 +45,9 @@ private:
friend Reflection::StructImpl<Target>; friend Reflection::StructImpl<Target>;
void declare_fields() { void declare_fields() {
AnnounceEnum(VideoAdaptor); AnnounceEnum(VideoAdaptor);
AnnounceEnum(Speed); AnnounceEnum(Model);
DeclareField(adaptor); DeclareField(adaptor);
DeclareField(speed); DeclareField(model);
} }
}; };

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::Sega { namespace Analyser::Static::Sega {

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../Reflection/Enum.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Reflection/Struct.hpp" #include "Reflection/Enum.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
namespace Analyser::Static::Sega { namespace Analyser::Static::Sega {

View File

@@ -9,82 +9,85 @@
#include "StaticAnalyser.hpp" #include "StaticAnalyser.hpp"
#include <algorithm> #include <algorithm>
#include <bit>
#include <cstddef> #include <cstddef>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iterator> #include <iterator>
// Analysers // Analysers
#include "Acorn/StaticAnalyser.hpp" #include "Analyser/Static/Acorn/StaticAnalyser.hpp"
#include "Amiga/StaticAnalyser.hpp" #include "Analyser/Static/Amiga/StaticAnalyser.hpp"
#include "AmstradCPC/StaticAnalyser.hpp" #include "Analyser/Static/AmstradCPC/StaticAnalyser.hpp"
#include "AppleII/StaticAnalyser.hpp" #include "Analyser/Static/AppleII/StaticAnalyser.hpp"
#include "AppleIIgs/StaticAnalyser.hpp" #include "Analyser/Static/AppleIIgs/StaticAnalyser.hpp"
#include "Atari2600/StaticAnalyser.hpp" #include "Analyser/Static/Atari2600/StaticAnalyser.hpp"
#include "AtariST/StaticAnalyser.hpp" #include "Analyser/Static/AtariST/StaticAnalyser.hpp"
#include "Coleco/StaticAnalyser.hpp" #include "Analyser/Static/Coleco/StaticAnalyser.hpp"
#include "Commodore/StaticAnalyser.hpp" #include "Analyser/Static/Commodore/StaticAnalyser.hpp"
#include "DiskII/StaticAnalyser.hpp" #include "Analyser/Static/DiskII/StaticAnalyser.hpp"
#include "Enterprise/StaticAnalyser.hpp" #include "Analyser/Static/Enterprise/StaticAnalyser.hpp"
#include "FAT12/StaticAnalyser.hpp" #include "Analyser/Static/FAT12/StaticAnalyser.hpp"
#include "Macintosh/StaticAnalyser.hpp" #include "Analyser/Static/Macintosh/StaticAnalyser.hpp"
#include "MSX/StaticAnalyser.hpp" #include "Analyser/Static/MSX/StaticAnalyser.hpp"
#include "Oric/StaticAnalyser.hpp" #include "Analyser/Static/Oric/StaticAnalyser.hpp"
#include "PCCompatible/StaticAnalyser.hpp" #include "Analyser/Static/PCCompatible/StaticAnalyser.hpp"
#include "Sega/StaticAnalyser.hpp" #include "Analyser/Static/Sega/StaticAnalyser.hpp"
#include "ZX8081/StaticAnalyser.hpp" #include "Analyser/Static/ZX8081/StaticAnalyser.hpp"
#include "ZXSpectrum/StaticAnalyser.hpp" #include "Analyser/Static/ZXSpectrum/StaticAnalyser.hpp"
// Cartridges // Cartridges
#include "../../Storage/Cartridge/Formats/BinaryDump.hpp" #include "Storage/Cartridge/Formats/BinaryDump.hpp"
#include "../../Storage/Cartridge/Formats/PRG.hpp" #include "Storage/Cartridge/Formats/PRG.hpp"
// Disks // Disks
#include "../../Storage/Disk/DiskImage/Formats/2MG.hpp" #include "Storage/Disk/DiskImage/Formats/2MG.hpp"
#include "../../Storage/Disk/DiskImage/Formats/AcornADF.hpp" #include "Storage/Disk/DiskImage/Formats/AcornADF.hpp"
#include "../../Storage/Disk/DiskImage/Formats/AmigaADF.hpp" #include "Storage/Disk/DiskImage/Formats/AmigaADF.hpp"
#include "../../Storage/Disk/DiskImage/Formats/AppleDSK.hpp" #include "Storage/Disk/DiskImage/Formats/AppleDSK.hpp"
#include "../../Storage/Disk/DiskImage/Formats/CPCDSK.hpp" #include "Storage/Disk/DiskImage/Formats/CPCDSK.hpp"
#include "../../Storage/Disk/DiskImage/Formats/D64.hpp" #include "Storage/Disk/DiskImage/Formats/D64.hpp"
#include "../../Storage/Disk/DiskImage/Formats/G64.hpp" #include "Storage/Disk/DiskImage/Formats/G64.hpp"
#include "../../Storage/Disk/DiskImage/Formats/DMK.hpp" #include "Storage/Disk/DiskImage/Formats/DMK.hpp"
#include "../../Storage/Disk/DiskImage/Formats/FAT12.hpp" #include "Storage/Disk/DiskImage/Formats/FAT12.hpp"
#include "../../Storage/Disk/DiskImage/Formats/HFE.hpp" #include "Storage/Disk/DiskImage/Formats/HFE.hpp"
#include "../../Storage/Disk/DiskImage/Formats/IPF.hpp" #include "Storage/Disk/DiskImage/Formats/IPF.hpp"
#include "../../Storage/Disk/DiskImage/Formats/IMD.hpp" #include "Storage/Disk/DiskImage/Formats/IMD.hpp"
#include "../../Storage/Disk/DiskImage/Formats/MacintoshIMG.hpp" #include "Storage/Disk/DiskImage/Formats/JFD.hpp"
#include "../../Storage/Disk/DiskImage/Formats/MSA.hpp" #include "Storage/Disk/DiskImage/Formats/MacintoshIMG.hpp"
#include "../../Storage/Disk/DiskImage/Formats/NIB.hpp" #include "Storage/Disk/DiskImage/Formats/MSA.hpp"
#include "../../Storage/Disk/DiskImage/Formats/OricMFMDSK.hpp" #include "Storage/Disk/DiskImage/Formats/NIB.hpp"
#include "../../Storage/Disk/DiskImage/Formats/PCBooter.hpp" #include "Storage/Disk/DiskImage/Formats/OricMFMDSK.hpp"
#include "../../Storage/Disk/DiskImage/Formats/SSD.hpp" #include "Storage/Disk/DiskImage/Formats/PCBooter.hpp"
#include "../../Storage/Disk/DiskImage/Formats/STX.hpp" #include "Storage/Disk/DiskImage/Formats/SSD.hpp"
#include "../../Storage/Disk/DiskImage/Formats/WOZ.hpp" #include "Storage/Disk/DiskImage/Formats/STX.hpp"
#include "Storage/Disk/DiskImage/Formats/WOZ.hpp"
// Mass Storage Devices (i.e. usually, hard disks) // Mass Storage Devices (i.e. usually, hard disks)
#include "../../Storage/MassStorage/Formats/DAT.hpp" #include "Storage/MassStorage/Formats/DAT.hpp"
#include "../../Storage/MassStorage/Formats/DSK.hpp" #include "Storage/MassStorage/Formats/DSK.hpp"
#include "../../Storage/MassStorage/Formats/HDV.hpp" #include "Storage/MassStorage/Formats/HDV.hpp"
#include "../../Storage/MassStorage/Formats/HFV.hpp" #include "Storage/MassStorage/Formats/HFV.hpp"
#include "Storage/MassStorage/Formats/VHD.hpp"
// State Snapshots // State Snapshots
#include "../../Storage/State/SNA.hpp" #include "Storage/State/SNA.hpp"
#include "../../Storage/State/SZX.hpp" #include "Storage/State/SZX.hpp"
#include "../../Storage/State/Z80.hpp" #include "Storage/State/Z80.hpp"
// Tapes // Tapes
#include "../../Storage/Tape/Formats/CAS.hpp" #include "Storage/Tape/Formats/CAS.hpp"
#include "../../Storage/Tape/Formats/CommodoreTAP.hpp" #include "Storage/Tape/Formats/CommodoreTAP.hpp"
#include "../../Storage/Tape/Formats/CSW.hpp" #include "Storage/Tape/Formats/CSW.hpp"
#include "../../Storage/Tape/Formats/OricTAP.hpp" #include "Storage/Tape/Formats/OricTAP.hpp"
#include "../../Storage/Tape/Formats/TapePRG.hpp" #include "Storage/Tape/Formats/TapePRG.hpp"
#include "../../Storage/Tape/Formats/TapeUEF.hpp" #include "Storage/Tape/Formats/TapeUEF.hpp"
#include "../../Storage/Tape/Formats/TZX.hpp" #include "Storage/Tape/Formats/TZX.hpp"
#include "../../Storage/Tape/Formats/ZX80O81P.hpp" #include "Storage/Tape/Formats/ZX80O81P.hpp"
#include "../../Storage/Tape/Formats/ZXSpectrumTAP.hpp" #include "Storage/Tape/Formats/ZXSpectrumTAP.hpp"
// Target Platform Types // Target Platform Types
#include "../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
template<class> inline constexpr bool always_false_v = false; template<class> inline constexpr bool always_false_v = false;
@@ -205,6 +208,7 @@ static Media GetMediaAndPlatforms(const std::string &file_name, TargetPlatform::
accumulator.try_standard<Disk::DiskImageHolder<Disk::AcornADF>>(TargetPlatform::Acorn, "adf"); 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::AmigaADF>>(TargetPlatform::Amiga, "adf");
accumulator.try_standard<Disk::DiskImageHolder<Disk::AcornADF>>(TargetPlatform::Acorn, "adl"); accumulator.try_standard<Disk::DiskImageHolder<Disk::AcornADF>>(TargetPlatform::Acorn, "adl");
accumulator.try_standard<Disk::DiskImageHolder<Disk::JFD>>(TargetPlatform::Archimedes, "jfd");
accumulator.try_standard<Cartridge::BinaryDump>(TargetPlatform::AllCartridge, "bin"); accumulator.try_standard<Cartridge::BinaryDump>(TargetPlatform::AllCartridge, "bin");
@@ -269,13 +273,14 @@ static Media GetMediaAndPlatforms(const std::string &file_name, TargetPlatform::
accumulator.try_standard<Tape::ZX80O81P>(TargetPlatform::ZX8081, "p81"); accumulator.try_standard<Tape::ZX80O81P>(TargetPlatform::ZX8081, "p81");
static constexpr auto PRGTargets = TargetPlatform::Vic20; //Commodore8bit; // Disabled until analysis improves.
if(accumulator.name_matches("prg")) { if(accumulator.name_matches("prg")) {
// Try instantiating as a ROM; failing that accept as a tape. // Try instantiating as a ROM; failing that accept as a tape.
try { try {
accumulator.insert<Cartridge::PRG>(TargetPlatform::Commodore8bit, file_name); accumulator.insert<Cartridge::PRG>(PRGTargets, file_name);
} catch(...) { } catch(...) {
try { try {
accumulator.insert<Tape::PRG>(TargetPlatform::Commodore8bit, file_name); accumulator.insert<Tape::PRG>(PRGTargets, file_name);
} catch(...) {} } catch(...) {}
} }
} }
@@ -298,6 +303,8 @@ static Media GetMediaAndPlatforms(const std::string &file_name, TargetPlatform::
accumulator.try_standard<Tape::UEF>(TargetPlatform::Acorn, "uef"); accumulator.try_standard<Tape::UEF>(TargetPlatform::Acorn, "uef");
accumulator.try_standard<MassStorage::VHD>(TargetPlatform::PCCompatible, "vhd");
accumulator.try_standard<Disk::DiskImageHolder<Disk::WOZ>>(TargetPlatform::DiskII, "woz"); accumulator.try_standard<Disk::DiskImageHolder<Disk::WOZ>>(TargetPlatform::DiskII, "woz");
return accumulator.media; return accumulator.media;
@@ -339,13 +346,7 @@ TargetList Analyser::Static::GetTargets(const std::string &file_name) {
TargetPlatform::IntType potential_platforms = 0; TargetPlatform::IntType potential_platforms = 0;
Media media = GetMediaAndPlatforms(file_name, potential_platforms); Media media = GetMediaAndPlatforms(file_name, potential_platforms);
// TODO: std::popcount here. int total_options = std::popcount(potential_platforms);
int total_options = 0;
TargetPlatform::IntType mask = 1;
while(mask) {
total_options += bool(potential_platforms & mask);
mask <<= 1;
}
const bool is_confident = total_options == 1; const bool is_confident = total_options == 1;
// i.e. This analyser `is_confident` if file analysis suggested only one potential target platform. // i.e. This analyser `is_confident` if file analysis suggested only one potential target platform.
// The machine-specific static analyser will still run in case it can provide meaningful annotations on // The machine-specific static analyser will still run in case it can provide meaningful annotations on

View File

@@ -8,14 +8,14 @@
#pragma once #pragma once
#include "../Machines.hpp" #include "Analyser/Machines.hpp"
#include "../../Storage/Cartridge/Cartridge.hpp" #include "Storage/Cartridge/Cartridge.hpp"
#include "../../Storage/Disk/Disk.hpp" #include "Storage/Disk/Disk.hpp"
#include "../../Storage/MassStorage/MassStorageDevice.hpp" #include "Storage/MassStorage/MassStorageDevice.hpp"
#include "../../Storage/Tape/Tape.hpp" #include "Storage/Tape/Tape.hpp"
#include "../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include "../../Reflection/Struct.hpp" #include "Reflection/Struct.hpp"
#include <memory> #include <memory>
#include <string> #include <string>

View File

@@ -12,7 +12,7 @@
#include <vector> #include <vector>
#include "Target.hpp" #include "Target.hpp"
#include "../../../Storage/Tape/Parsers/ZX8081.hpp" #include "Storage/Tape/Parsers/ZX8081.hpp"
static std::vector<Storage::Data::ZX8081::File> GetFiles(Storage::Tape::TapeSerialiser &serialiser) { static std::vector<Storage::Data::ZX8081::File> GetFiles(Storage::Tape::TapeSerialiser &serialiser) {
std::vector<Storage::Data::ZX8081::File> files; std::vector<Storage::Data::ZX8081::File> files;

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::ZX8081 { namespace Analyser::Static::ZX8081 {

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../Reflection/Enum.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Reflection/Struct.hpp" #include "Reflection/Enum.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
#include <string> #include <string>
namespace Analyser::Static::ZX8081 { namespace Analyser::Static::ZX8081 {

View File

@@ -8,9 +8,9 @@
#include "StaticAnalyser.hpp" #include "StaticAnalyser.hpp"
#include "../../../Storage/Disk/Parsers/CPM.hpp" #include "Storage/Disk/Parsers/CPM.hpp"
#include "../../../Storage/Disk/Encodings/MFM/Parser.hpp" #include "Storage/Disk/Encodings/MFM/Parser.hpp"
#include "../../../Storage/Tape/Parsers/Spectrum.hpp" #include "Storage/Tape/Parsers/Spectrum.hpp"
#include "Target.hpp" #include "Target.hpp"

View File

@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "../StaticAnalyser.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Storage/TargetPlatforms.hpp" #include "Storage/TargetPlatforms.hpp"
#include <string> #include <string>
namespace Analyser::Static::ZXSpectrum { namespace Analyser::Static::ZXSpectrum {

View File

@@ -8,9 +8,9 @@
#pragma once #pragma once
#include "../../../Reflection/Enum.hpp" #include "Analyser/Static/StaticAnalyser.hpp"
#include "../../../Reflection/Struct.hpp" #include "Reflection/Enum.hpp"
#include "../StaticAnalyser.hpp" #include "Reflection/Struct.hpp"
namespace Analyser::Static::ZXSpectrum { namespace Analyser::Static::ZXSpectrum {

View File

@@ -5,7 +5,7 @@ project(CLK
VERSION 24.01.22 VERSION 24.01.22
) )
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
@@ -29,6 +29,7 @@ endif()
message(STATUS "Configuring for ${CLK_UI} UI") message(STATUS "Configuring for ${CLK_UI} UI")
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include_directories(".")
include("CLK_SOURCES") include("CLK_SOURCES")
add_executable(clksignal ${CLK_SOURCES}) add_executable(clksignal ${CLK_SOURCES})

View File

@@ -128,12 +128,7 @@ public:
forceinline constexpr T operator -() const { return T(- length_); } forceinline constexpr T operator -() const { return T(- length_); }
forceinline constexpr bool operator <(const T &rhs) const { return length_ < rhs.length_; } auto operator <=>(const WrappedInt &) const = default;
forceinline constexpr bool operator >(const T &rhs) const { return length_ > rhs.length_; }
forceinline constexpr bool operator <=(const T &rhs) const { return length_ <= rhs.length_; }
forceinline constexpr bool operator >=(const T &rhs) const { return length_ >= rhs.length_; }
forceinline constexpr bool operator ==(const T &rhs) const { return length_ == rhs.length_; }
forceinline constexpr bool operator !=(const T &rhs) const { return length_ != rhs.length_; }
forceinline constexpr bool operator !() const { return !length_; } forceinline constexpr bool operator !() const { return !length_; }
// bool operator () is not supported because it offers an implicit cast to int, // bool operator () is not supported because it offers an implicit cast to int,

View File

@@ -16,10 +16,10 @@ template <int DeferredDepth, typename ValueT> class DeferredValue {
private: private:
static_assert(sizeof(ValueT) <= 4); static_assert(sizeof(ValueT) <= 4);
constexpr int elements_per_uint32 = sizeof(uint32_t) / sizeof(ValueT); static constexpr int elements_per_uint32 = sizeof(uint32_t) / sizeof(ValueT);
constexpr int unit_shift = sizeof(ValueT) * 8; static constexpr int unit_shift = sizeof(ValueT) * 8;
constexpr int insert_shift = (DeferredDepth & (elements_per_uint32 - 1)) * unit_shift; static constexpr int insert_shift = (DeferredDepth & (elements_per_uint32 - 1)) * unit_shift;
constexpr uint32_t insert_mask = ~(0xffff'ffff << insert_shift); static constexpr uint32_t insert_mask = ~(0xffff'ffff << insert_shift);
std::array<uint32_t, (DeferredDepth + elements_per_uint32 - 1) / elements_per_uint32> backlog; std::array<uint32_t, (DeferredDepth + elements_per_uint32 - 1) / elements_per_uint32> backlog;

View File

@@ -9,7 +9,7 @@
#pragma once #pragma once
#include "ClockReceiver.hpp" #include "ClockReceiver.hpp"
#include "../Concurrency/AsyncTaskQueue.hpp" #include "Concurrency/AsyncTaskQueue.hpp"
#include "ClockingHintSource.hpp" #include "ClockingHintSource.hpp"
#include "ForceInline.hpp" #include "ForceInline.hpp"

View File

@@ -8,7 +8,7 @@
#pragma once #pragma once
#include "../Outputs/ScanTarget.hpp" #include "Outputs/ScanTarget.hpp"
#include <cmath> #include <cmath>

View File

@@ -8,8 +8,8 @@
#include "1770.hpp" #include "1770.hpp"
#include "../../Storage/Disk/Encodings/MFM/Constants.hpp" #include "Storage/Disk/Encodings/MFM/Constants.hpp"
#include "../../Outputs/Log.hpp" #include "Outputs/Log.hpp"
namespace { namespace {
Log::Logger<Log::Source::WDFDC> logger; Log::Logger<Log::Source::WDFDC> logger;
@@ -77,7 +77,7 @@ uint8_t WD1770::read(const int address) {
status |= status |=
(status_.track_zero ? Flag::TrackZero : 0) | (status_.track_zero ? Flag::TrackZero : 0) |
(status_.seek_error ? Flag::SeekError : 0) | (status_.seek_error ? Flag::SeekError : 0) |
(get_drive().get_is_read_only() ? Flag::WriteProtect : 0) | (get_drive().is_read_only() ? Flag::WriteProtect : 0) |
(get_drive().get_index_pulse() ? Flag::Index : 0); (get_drive().get_index_pulse() ? Flag::Index : 0);
break; break;
@@ -132,26 +132,29 @@ void WD1770::run_for(const Cycles cycles) {
} }
} }
void WD1770::posit_event(const int new_event_type) {
#define WAIT_FOR_EVENT(mask) resume_point_ = __LINE__; interesting_event_mask_ = int(mask); return; case __LINE__: #define WAIT_FOR_EVENT(mask) resume_point_ = __LINE__; interesting_event_mask_ = int(mask); return; case __LINE__:
#define WAIT_FOR_TIME(ms) resume_point_ = __LINE__; delay_time_ = ms * 8000; WAIT_FOR_EVENT(Event1770::Timer); #define WAIT_FOR_TIME(ms) resume_point_ = __LINE__; delay_time_ = ms * 8000; WAIT_FOR_EVENT(Event1770::Timer);
#define WAIT_FOR_BYTES(count) resume_point_ = __LINE__; distance_into_section_ = 0; WAIT_FOR_EVENT(Event::Token); if(get_latest_token().type == Token::Byte) distance_into_section_++; if(distance_into_section_ < count) { interesting_event_mask_ = int(Event::Token); return; } #define WAIT_FOR_BYTES(count) distance_into_section_ = 0; \
WAIT_FOR_EVENT(Event::Token); \
if(get_latest_token().type == Token::Byte) ++distance_into_section_; \
if(distance_into_section_ < count) { \
return; \
}
#define BEGIN_SECTION() switch(resume_point_) { default: #define BEGIN_SECTION() switch(resume_point_) { default:
#define END_SECTION() (void)0; } #define END_SECTION() (void)0; }
#define READ_ID() \ const auto READ_ID = [&] {
if(new_event_type == int(Event::Token)) { \ if(new_event_type == int(Event::Token)) {
if(!distance_into_section_ && get_latest_token().type == Token::ID) {\ if(!distance_into_section_ && get_latest_token().type == Token::ID) {
set_data_mode(DataMode::Reading); \ set_data_mode(DataMode::Reading);
++distance_into_section_; \ ++distance_into_section_;
} else if(distance_into_section_ && distance_into_section_ < 7 && get_latest_token().type == Token::Byte) { \ } else if(distance_into_section_ && distance_into_section_ < 7 && get_latest_token().type == Token::Byte) {
header_[distance_into_section_ - 1] = get_latest_token().byte_value; \ header_[distance_into_section_ - 1] = get_latest_token().byte_value;
++distance_into_section_; \ ++distance_into_section_;
} \
} }
}
#define CONCATENATE(x, y) x ## y };
#define INDIRECT_CONCATENATE(x, y) TOKENPASTE(x, y)
#define LINE_LABEL INDIRECT_CONCATENATE(label, __LINE__)
#define SPIN_UP() \ #define SPIN_UP() \
set_motor_on(true); \ set_motor_on(true); \
@@ -160,24 +163,6 @@ void WD1770::run_for(const Cycles cycles) {
WAIT_FOR_EVENT(Event1770::IndexHoleTarget); \ WAIT_FOR_EVENT(Event1770::IndexHoleTarget); \
status_.spin_up = true; status_.spin_up = true;
// +--------+----------+-------------------------+
// ! ! ! BITS !
// ! TYPE ! COMMAND ! 7 6 5 4 3 2 1 0 !
// +--------+----------+-------------------------+
// ! 1 ! Restore ! 0 0 0 0 h v r1 r0 !
// ! 1 ! Seek ! 0 0 0 1 h v r1 r0 !
// ! 1 ! Step ! 0 0 1 u h v r1 r0 !
// ! 1 ! Step-in ! 0 1 0 u h v r1 r0 !
// ! 1 ! Step-out ! 0 1 1 u h v r1 r0 !
// ! 2 ! Rd sectr ! 1 0 0 m h E 0 0 !
// ! 2 ! Wt sectr ! 1 0 1 m h E P a0 !
// ! 3 ! Rd addr ! 1 1 0 0 h E 0 0 !
// ! 3 ! Rd track ! 1 1 1 0 h E 0 0 !
// ! 3 ! Wt track ! 1 1 1 1 h E P 0 !
// ! 4 ! Forc int ! 1 1 0 1 i3 i2 i1 i0 !
// +--------+----------+-------------------------+
void WD1770::posit_event(const int new_event_type) {
if(new_event_type == int(Event::IndexHole)) { if(new_event_type == int(Event::IndexHole)) {
index_hole_count_++; index_hole_count_++;
if(index_hole_count_target_ == index_hole_count_) { if(index_hole_count_target_ == index_hole_count_) {
@@ -209,6 +194,23 @@ void WD1770::posit_event(const int new_event_type) {
interesting_event_mask_ &= ~new_event_type; interesting_event_mask_ &= ~new_event_type;
} }
// +--------+----------+-------------------------+
// ! ! ! BITS !
// ! TYPE ! COMMAND ! 7 6 5 4 3 2 1 0 !
// +--------+----------+-------------------------+
// ! 1 ! Restore ! 0 0 0 0 h v r1 r0 !
// ! 1 ! Seek ! 0 0 0 1 h v r1 r0 !
// ! 1 ! Step ! 0 0 1 u h v r1 r0 !
// ! 1 ! Step-in ! 0 1 0 u h v r1 r0 !
// ! 1 ! Step-out ! 0 1 1 u h v r1 r0 !
// ! 2 ! Rd sectr ! 1 0 0 m h E 0 0 !
// ! 2 ! Wt sectr ! 1 0 1 m h E P a0 !
// ! 3 ! Rd addr ! 1 1 0 0 h E 0 0 !
// ! 3 ! Rd track ! 1 1 1 0 h E 0 0 !
// ! 3 ! Wt track ! 1 1 1 1 h E P 0 !
// ! 4 ! Forc int ! 1 1 0 1 i3 i2 i1 i0 !
// +--------+----------+-------------------------+
BEGIN_SECTION() BEGIN_SECTION()
// Wait for a new command, branch to the appropriate handler. // Wait for a new command, branch to the appropriate handler.
@@ -417,7 +419,7 @@ void WD1770::posit_event(const int new_event_type) {
WAIT_FOR_TIME(30); WAIT_FOR_TIME(30);
test_type2_write_protection: test_type2_write_protection:
if(command_&0x20 && get_drive().get_is_read_only()) { if(command_&0x20 && get_drive().is_read_only()) {
update_status([] (Status &status) { update_status([] (Status &status) {
status.write_protect = true; status.write_protect = true;
}); });
@@ -716,7 +718,7 @@ void WD1770::posit_event(const int new_event_type) {
status.lost_data = false; status.lost_data = false;
}); });
if(get_drive().get_is_read_only()) { if(get_drive().is_read_only()) {
update_status([] (Status &status) { update_status([] (Status &status) {
status.write_protect = true; status.write_protect = true;
}); });
@@ -818,7 +820,7 @@ void WD1770::update_status(const std::function<void(Status &)> updater) {
(status_.busy != old_status.busy) || (status_.busy != old_status.busy) ||
(status_.data_request != old_status.data_request) || (status_.data_request != old_status.data_request) ||
(status_.interrupt_request != old_status.interrupt_request); (status_.interrupt_request != old_status.interrupt_request);
if(did_change) delegate_->wd1770_did_change_output(this); if(did_change) delegate_->wd1770_did_change_output(*this);
} else updater(status_); } else updater(status_);
if(status_.busy != old_status.busy) update_clocking_observer(); if(status_.busy != old_status.busy) update_clocking_observer();

View File

@@ -8,7 +8,7 @@
#pragma once #pragma once
#include "../../Storage/Disk/Controller/MFMDiskController.hpp" #include "Storage/Disk/Controller/MFMDiskController.hpp"
namespace WD { namespace WD {
@@ -66,9 +66,8 @@ public:
/// @returns The current value of the DRQ line output. /// @returns The current value of the DRQ line output.
inline bool get_data_request_line() const { return status_.data_request; } inline bool get_data_request_line() const { return status_.data_request; }
class Delegate { struct Delegate {
public: virtual void wd1770_did_change_output(WD1770 &) = 0;
virtual void wd1770_did_change_output(WD1770 *wd1770) = 0;
}; };
inline void set_delegate(Delegate *delegate) { delegate_ = delegate; } inline void set_delegate(Delegate *delegate) { delegate_ = delegate; }

View File

@@ -8,7 +8,7 @@
#include "ncr5380.hpp" #include "ncr5380.hpp"
#include "../../Outputs/Log.hpp" #include "Outputs/Log.hpp"
namespace { namespace {
Log::Logger<Log::Source::NCR5380> logger; Log::Logger<Log::Source::NCR5380> logger;
@@ -25,7 +25,7 @@ NCR5380::NCR5380(SCSI::Bus &bus, const int clock_rate) :
bus_(bus), bus_(bus),
clock_rate_(clock_rate) { clock_rate_(clock_rate) {
device_id_ = bus_.add_device(); device_id_ = bus_.add_device();
bus_.add_observer(this); bus_.add_observer(*this);
// TODO: use clock rate and expected phase. This implementation currently // TODO: use clock rate and expected phase. This implementation currently
// provides only CPU-driven polling behaviour. // provides only CPU-driven polling behaviour.
@@ -146,12 +146,12 @@ void NCR5380::write(const int address, const uint8_t value, bool) {
uint8_t NCR5380::read(const int address, bool) { uint8_t NCR5380::read(const int address, bool) {
switch(address & 7) { switch(address & 7) {
case 0: case 0:
logger.info().append("[0] Get current SCSI bus state: %02x", (bus_.get_state() & 0xff)); logger.info().append("[0] Get current SCSI bus state: %02x", (bus_.state() & 0xff));
if(dma_request_ && dma_operation_ == DMAOperation::InitiatorReceive) { if(dma_request_ && dma_operation_ == DMAOperation::InitiatorReceive) {
return dma_acknowledge(); return dma_acknowledge();
} }
return uint8_t(bus_.get_state()); return uint8_t(bus_.state());
case 1: case 1:
logger.info().append( logger.info().append(
@@ -177,7 +177,7 @@ uint8_t NCR5380::read(const int address, bool) {
return target_command_; return target_command_;
case 4: { case 4: {
const auto bus_state = bus_.get_state(); const auto bus_state = bus_.state();
const uint8_t result = const uint8_t result =
((bus_state & Line::Reset) ? 0x80 : 0x00) | ((bus_state & Line::Reset) ? 0x80 : 0x00) |
((bus_state & Line::Busy) ? 0x40 : 0x00) | ((bus_state & Line::Busy) ? 0x40 : 0x00) |
@@ -192,7 +192,7 @@ uint8_t NCR5380::read(const int address, bool) {
} }
case 5: { case 5: {
const auto bus_state = bus_.get_state(); const auto bus_state = bus_.state();
const uint8_t result = const uint8_t result =
(end_of_dma_ ? 0x80 : 0x00) | (end_of_dma_ ? 0x80 : 0x00) |
((dma_request_ && state_ == ExecutionState::PerformingDMA) ? 0x40 : 0x00) | ((dma_request_ && state_ == ExecutionState::PerformingDMA) ? 0x40 : 0x00) |
@@ -242,7 +242,7 @@ void NCR5380::update_control_output() {
} }
} }
void NCR5380::scsi_bus_did_change(SCSI::Bus *, const SCSI::BusState new_state, const double time_since_change) { void NCR5380::scsi_bus_did_change(SCSI::Bus &, const SCSI::BusState new_state, const double time_since_change) {
/* /*
When connected as an Initiator with DMA Mode True, When connected as an Initiator with DMA Mode True,
if the phase lines I//O, C//D, and /MSG do not match the if the phase lines I//O, C//D, and /MSG do not match the
@@ -350,7 +350,7 @@ bool NCR5380::dma_request() {
} }
uint8_t NCR5380::dma_acknowledge() { uint8_t NCR5380::dma_acknowledge() {
const uint8_t bus_state = uint8_t(bus_.get_state()); const uint8_t bus_state = uint8_t(bus_.state());
dma_acknowledge_ = true; dma_acknowledge_ = true;
dma_request_ = false; dma_request_ = false;
@@ -370,7 +370,7 @@ void NCR5380::dma_acknowledge(const uint8_t value) {
} }
bool NCR5380::phase_matches() const { bool NCR5380::phase_matches() const {
const auto bus_state = bus_.get_state(); const auto bus_state = bus_.state();
return return
(target_output() & (Line::Message | Line::Control | Line::Input)) == (target_output() & (Line::Message | Line::Control | Line::Input)) ==
(bus_state & (Line::Message | Line::Control | Line::Input)); (bus_state & (Line::Message | Line::Control | Line::Input));

View File

@@ -8,11 +8,9 @@
#pragma once #pragma once
#include "Storage/MassStorage/SCSI/SCSI.hpp"
#include <cstdint> #include <cstdint>
#include "../../Storage/MassStorage/SCSI/SCSI.hpp"
namespace NCR::NCR5380 { namespace NCR::NCR5380 {
/*! /*!
@@ -80,7 +78,7 @@ private:
SCSI::BusState target_output() const; SCSI::BusState target_output() const;
void update_control_output(); void update_control_output();
void scsi_bus_did_change(SCSI::Bus *, SCSI::BusState new_state, double time_since_change) final; void scsi_bus_did_change(SCSI::Bus &, SCSI::BusState, double) final;
bool phase_matches() const; bool phase_matches() const;
}; };

View File

@@ -8,12 +8,10 @@
#pragma once #pragma once
#include "Components/6522/Implementation/6522Storage.hpp"
#include "ClockReceiver/ClockReceiver.hpp"
#include <cstdint> #include <cstdint>
#include "Implementation/6522Storage.hpp"
#include "../../ClockReceiver/ClockReceiver.hpp"
namespace MOS::MOS6522 { namespace MOS::MOS6522 {
enum Port { enum Port {
@@ -62,8 +60,7 @@ public:
*/ */
class IRQDelegatePortHandler: public PortHandler { class IRQDelegatePortHandler: public PortHandler {
public: public:
class Delegate { struct Delegate {
public:
/// Indicates that the interrupt status has changed for the IRQDelegatePortHandler provided. /// Indicates that the interrupt status has changed for the IRQDelegatePortHandler provided.
virtual void mos6522_did_change_interrupt_status(void *irq_delegate) = 0; virtual void mos6522_did_change_interrupt_status(void *irq_delegate) = 0;
}; };

View File

@@ -6,7 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved. // Copyright 2017 Thomas Harte. All rights reserved.
// //
#include "../../../Outputs/Log.hpp" #include "Outputs/Log.hpp"
// As-yet unimplemented (incomplete list): // As-yet unimplemented (incomplete list):
// //

View File

@@ -6,7 +6,7 @@
// Copyright 2017 Thomas Harte. All rights reserved. // Copyright 2017 Thomas Harte. All rights reserved.
// //
#include "../6522.hpp" #include "Components/6522/6522.hpp"
using namespace MOS::MOS6522; using namespace MOS::MOS6522;

View File

@@ -11,7 +11,7 @@
#include <cstdint> #include <cstdint>
#include "Implementation/6526Storage.hpp" #include "Implementation/6526Storage.hpp"
#include "../Serial/Line.hpp" #include "Components/Serial/Line.hpp"
namespace MOS::MOS6526 { namespace MOS::MOS6526 {

View File

@@ -10,8 +10,8 @@
#include <array> #include <array>
#include "../../../ClockReceiver/ClockReceiver.hpp" #include "ClockReceiver/ClockReceiver.hpp"
#include "../../../Outputs/Log.hpp" #include "Outputs/Log.hpp"
namespace MOS::MOS6526 { namespace MOS::MOS6526 {
@@ -125,11 +125,11 @@ private:
uint32_t alarm_ = 0xff'ffff; uint32_t alarm_ = 0xff'ffff;
public: public:
template <int byte> void write(uint8_t v) { template <int byte> void write(const uint8_t v) {
if constexpr (byte == 3) { if constexpr (byte == 3) {
return; return;
} }
constexpr int shift = byte << 3; static constexpr int shift = byte << 3;
// Write to either the alarm or the current value as directed; // Write to either the alarm or the current value as directed;
// writing to any part of the current value other than the LSB // writing to any part of the current value other than the LSB
@@ -147,7 +147,7 @@ public:
if constexpr (byte == 3) { if constexpr (byte == 3) {
return 0xff; // Assumed. Just a guess. return 0xff; // Assumed. Just a guess.
} }
constexpr int shift = byte << 3; static constexpr int shift = byte << 3;
if constexpr (byte == 2) { if constexpr (byte == 2) {
latch_ = value_ | 0xff00'0000; latch_ = value_ | 0xff00'0000;
@@ -163,7 +163,7 @@ public:
return result; return result;
} }
bool advance(int count) { bool advance(const int count) {
// The 8250 uses a simple binary counter to replace the // The 8250 uses a simple binary counter to replace the
// 6526's time-of-day clock. So this is easy. // 6526's time-of-day clock. So this is easy.
const uint32_t distance_to_alarm = (alarm_ - value_) & 0xff'ffff; const uint32_t distance_to_alarm = (alarm_ - value_) & 0xff'ffff;

View File

@@ -8,11 +8,11 @@
#pragma once #pragma once
#include "ClockReceiver/ClockReceiver.hpp"
#include <cstdint> #include <cstdint>
#include <cstdio> #include <cstdio>
#include "../../ClockReceiver/ClockReceiver.hpp"
namespace MOS { namespace MOS {
/*! /*!

View File

@@ -97,19 +97,29 @@ constexpr uint8_t noise_pattern[] = {
0xf0, 0xe1, 0xe0, 0x78, 0x70, 0x38, 0x3c, 0x3e, 0x1e, 0x3c, 0x1e, 0x1c, 0x70, 0x3c, 0x38, 0x3f, 0xf0, 0xe1, 0xe0, 0x78, 0x70, 0x38, 0x3c, 0x3e, 0x1e, 0x3c, 0x1e, 0x1c, 0x70, 0x3c, 0x38, 0x3f,
}; };
#define shift(r) shift_registers_[r] = \
(shift_registers_[r] << 1) | (((shift_registers_[r]^0x80)&control_registers_[r]) >> 7)
#define increment(r) shift_registers_[r] = (shift_registers_[r]+1)%8191
#define update(r, m, up) \
counters_[r]++; if((counters_[r] >> m) == 0x80) { up(r); counters_[r] = unsigned(control_registers_[r]&0x7f) << m; }
// Note on slightly askew test: as far as I can make out, if the value in the register is 0x7f then what's supposed to
// happen is that the 0x7f is loaded, on the next clocked cycle the Vic spots a 0x7f, pumps the output, reloads, etc. No
// increment ever occurs. It's conditional. I don't really want two conditionals if I can avoid it so I'm incrementing
// regardless and testing against 0x80. The effect should be the same: loading with 0x7f means an output update every
// cycle, loading with 0x7e means every second cycle, etc.
template <Outputs::Speaker::Action action> template <Outputs::Speaker::Action action>
void AudioGenerator::apply_samples(const std::size_t number_of_samples, Outputs::Speaker::MonoSample *const target) { void AudioGenerator::apply_samples(const std::size_t number_of_samples, Outputs::Speaker::MonoSample *const target) {
const auto shift = [&](const int r) {
shift_registers_[r] =
(shift_registers_[r] << 1) | (((shift_registers_[r] ^ 0x80) & control_registers_[r]) >> 7);
};
const auto increment = [&](const int r) {
shift_registers_[r] = (shift_registers_[r] + 1) % 8191;
};
const auto update = [&](const int r, const int m, auto &&up) {
++counters_[r];
if((counters_[r] >> m) == 0x80) {
up(r);
counters_[r] = unsigned(control_registers_[r]&0x7f) << m;
}
// Note on slightly askew test: as far as I can make out, if the value in the register is 0x7f then what's
// supposed to happen is that the 0x7f is loaded, on the next clocked cycle the Vic spots a 0x7f, pumps the
// output, reloads, etc. No increment ever occurs. It's conditional. I don't really want two conditionals if I
// can avoid it so I'm incrementing regardless and testing against 0x80. The effect should be the same: loading
// with 0x7f means an output update every cycle, loading with 0x7e means every second cycle, etc.
};
for(unsigned int c = 0; c < number_of_samples; ++c) { for(unsigned int c = 0; c < number_of_samples; ++c) {
update(0, 2, shift); update(0, 2, shift);
update(1, 1, shift); update(1, 1, shift);

View File

@@ -8,11 +8,11 @@
#pragma once #pragma once
#include "../../ClockReceiver/ClockReceiver.hpp" #include "ClockReceiver/ClockReceiver.hpp"
#include "../../Concurrency/AsyncTaskQueue.hpp" #include "Concurrency/AsyncTaskQueue.hpp"
#include "../../Outputs/CRT/CRT.hpp" #include "Outputs/CRT/CRT.hpp"
#include "../../Outputs/Speaker/Implementation/LowpassSpeaker.hpp" #include "Outputs/Speaker/Implementation/LowpassSpeaker.hpp"
#include "../../Outputs/Speaker/Implementation/BufferSource.hpp" #include "Outputs/Speaker/Implementation/BufferSource.hpp"
namespace MOS::MOS6560 { namespace MOS::MOS6560 {

View File

@@ -8,7 +8,7 @@
#pragma once #pragma once
#include "../../ClockReceiver/ClockReceiver.hpp" #include "ClockReceiver/ClockReceiver.hpp"
#include <cstdint> #include <cstdint>
#include <cstdio> #include <cstdio>
@@ -29,7 +29,7 @@ struct BusState {
}; };
class BusHandler { class BusHandler {
public: public:
void perform_bus_cycle(const BusState &) {} void perform_bus_cycle(const BusState &) {}
}; };
@@ -96,7 +96,7 @@ public:
target = (target & 0xff00) | value; target = (target & 0xff00) | value;
}; };
const auto load_high = [value](uint16_t &target) { const auto load_high = [value](uint16_t &target) {
constexpr uint8_t mask = RefreshMask >> 8; static constexpr uint8_t mask = RefreshMask >> 8;
target = uint16_t((target & 0x00ff) | ((value & mask) << 8)); target = uint16_t((target & 0x00ff) | ((value & mask) << 8));
}; };

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