1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-03 08:05:40 +00:00
Commit Graph

340 Commits

Author SHA1 Message Date
Thomas Harte
ae1a130843 Fixed: length of 0 is a special case. 2017-07-13 20:57:27 -04:00
Thomas Harte
33d16ae0cd Fixes: individual static analysers reset tapes, for potential successors. The ZX81 file analyser no longer overruns its buffer upon receiving a file that is shorter than 11 bytes. 2017-07-12 21:34:08 -04:00
Thomas Harte
f09fe30af5 Attempted a full implementation of CSW. All in memory for now. 2017-07-12 21:23:59 -04:00
Thomas Harte
33eadb5549 Started taking further steps towards CSW support; reading the ZLib documentation is next. 2017-07-11 22:41:10 -04:00
Thomas Harte
368bff1a82 Added a shell class that will one day be able to parse CSW files, plus the logic and metadata to instantiate it when a CSW presents itself. 2017-07-10 21:43:58 -04:00
Thomas Harte
d853841dd5 Further lightened up my file-is-ZX81 check. 2017-07-10 20:44:13 -04:00
Thomas Harte
bcb7c27cc4 Given that I'm not racing this any more, turned the intended 1 second back into 1 second. 2017-07-08 19:21:33 -04:00
Thomas Harte
2f42874fd3 Another fix to deal with real-time fighting: allow 8 and 18 pulses to be recognised as 1s and 0s. That's because the hand-off from ROM routines to parsing may occur very shortly before the first pulse of a valid sequence, making it look like there's a ghost. A cleaner solution needs to be found, probably revolving around allowing parsers to be attached to tapes and therefore to run constantly. 2017-07-06 22:33:03 -04:00
Thomas Harte
84d0e9b4cd Accept a pulse that begins exactly on seek_time as being found while seeking. 2017-07-06 22:31:45 -04:00
Thomas Harte
a53011f778 Extended intro and outro length because right now I'm racing this myself. Can return to normal once tape motor control is implemented. 2017-07-06 22:31:12 -04:00
Thomas Harte
919fc48cc5 Fixed dumb out-of-bounds access error. 2017-06-22 22:28:50 -04:00
Thomas Harte
87ee8450fe Minor rejig: it's much more likely that something that can't be distinguished is a ZX81 program. TODO: some sort of BASIC token parsing, to be more confident. 2017-06-22 20:23:14 -04:00
Thomas Harte
52d9ddf9e5 Gave the binary tape player a more logical assignment of wave level to output level. Which miraculously appears to have been the issue with the ZX80/81 tape loading — the inconsistency of silences seems to have been the issue. 2017-06-21 22:13:24 -04:00
Thomas Harte
e6e6e4e62b Adds an extra character for padding the ZX81 table. 2017-06-12 22:08:11 -04:00
Thomas Harte
626737b9fa Started mucking about with some string conversion routines. Not finished yet. 2017-06-12 21:32:36 -04:00
Thomas Harte
22de481557 Made an attempt to get .p/.80 checked and as far as the emulated machine. 2017-06-12 19:41:59 -04:00
Thomas Harte
77aa3c187e Rebranded ZX80O as ZX80O81P, with an eye to making it accept ZX81 .p files. Adjusted the initial selection part of the static analyser appropriately. 2017-06-11 21:38:32 -04:00
Thomas Harte
ee0283c985 Modified to use an in-memory buffer for file contents. 2017-06-11 21:35:09 -04:00
Thomas Harte
2c6414ce11 Adjusted to allow inspect_waves to swallow a gap before a bit if necessary, increasing the opportunities for its call. 2017-06-11 18:31:09 -04:00
Thomas Harte
e5aea632ee Updated curly bracket placement. 2017-06-11 17:29:22 -04:00
Thomas Harte
c2bc9a8c62 Ensured no namespace collision in double-include guards. 2017-06-11 16:41:15 -04:00
Thomas Harte
256ba4028b Rejigged to eliminate semi-duplication of the is-a-file test. 2017-06-08 21:52:13 -04:00
Thomas Harte
b07af2660d Adjusted to make sure that the very end of a tape is properly measured. 2017-06-08 21:33:35 -04:00
Thomas Harte
bc0d70b2f7 Added: a shout-out when the tape has been exhausted. 2017-06-08 21:32:27 -04:00
Thomas Harte
c6e48dfd56 Given that a final gap is semantically part of describing tape contents, ensured one formally appears before declaring that the tape has ended. 2017-06-08 21:31:54 -04:00
Thomas Harte
c775db50ef Ensured no out-of-bounds accesses. 2017-06-08 21:31:03 -04:00
Thomas Harte
ee4c8b5ad2 Ensured final byte plays out. 2017-06-08 19:51:49 -04:00
Thomas Harte
d8b76e31c3 Added and improved the is-this-ZX80-stuff test. It seems some bytes are going missing in the to->from tape conversion. 2017-06-08 19:49:18 -04:00
Thomas Harte
7e10c7f9d8 Relocated the ZX80/81 concept of a 'file' out from Tape into Data, given that it's an exact duplicate of memory. 2017-06-08 19:09:51 -04:00
Thomas Harte
c47128f433 Widened tolerances and ensured zero bits aren't prematurely discarded. 2017-06-07 17:50:03 -04:00
Thomas Harte
8aab9acc10 Eliminated use of the zero level; now definitively returns a low/high input. 2017-06-07 17:39:29 -04:00
Thomas Harte
dbd2944c13 Took an initial run at the ZX80/81 parser. 2017-06-07 17:27:05 -04:00
Thomas Harte
4603fa6f24 Extended explicitly to support a token of lookahead, which is pretty much what was on offer anyway. Also corrected instance variable names, as per better adoption of C++ norms. 2017-06-07 17:21:57 -04:00
Thomas Harte
60300851ea Started sketching out a tape parser for ZX80 and '81 files. I think this'll help me to verify whether the .O input is working. 2017-06-07 10:12:13 -04:00
Thomas Harte
58312ea2b7 Updated to new standardisation on curly bracket placement. 2017-06-07 10:05:43 -04:00
Thomas Harte
cb534d8b85 Corrected comment. 2017-06-07 10:05:16 -04:00
Thomas Harte
4677cebf40 Rejigged to correct: spaces go after bits, not after bytes. 2017-06-06 18:29:15 -04:00
Thomas Harte
7399f3d798 Caveman debugging in place, it looks like this file is returning nonsense. 2017-06-06 18:18:55 -04:00
Thomas Harte
faeecf7665 Made sure that there's nothing but silence at the end of the tape, even if the .O file is too long. 2017-06-06 18:16:47 -04:00
Thomas Harte
8c1769f157 Made a quick attempt at serialising from ZX80 .O to waves. 2017-06-04 16:59:26 -04:00
Thomas Harte
655809517c Ensured that there is a subclass of file that is entrusted to load .O/.80 files, and that the code routes such files to it, noting that it should consider whether a ZX80 is required. 2017-06-04 16:37:03 -04:00
Thomas Harte
5d91a2600d Permitted ROM-style PRGs that are not a power-of-two in size, and added extra safety checks on loading data from a tape. 2017-05-08 22:15:35 -04:00
Thomas Harte
2807e3134f Implemented speedy header finding. So that's half of it. 2017-05-07 20:32:48 -04:00
Thomas Harte
e01f3f06c8 Completed curly bracket movement. 2017-03-26 14:34:47 -04:00
Thomas Harte
f94f34f053 Made an attempt at read track. Which means process_input_bit can't just swallow syncs any more; it now reports them as tokens of type ::Sync. 2017-01-01 20:39:19 -05:00
Thomas Harte
b3c33d993a Made an attempt to explain the requirements placed upon Disk subclasses that wish to support writing. 2016-12-31 15:30:48 -05:00
Thomas Harte
8eb21c6702 The "MFM...Byte"s aren't MFM-specific, they're relevant to both FM and MFM encoding. So renamed them. Also slimmed syntax within MFM.cpp mostly where emigration from the Acorn disk analyser had left a residue of lengthy namespace specification. 2016-12-31 15:25:11 -05:00
Thomas Harte
52b850a3f5 Quick extra: make sure parsed tracks don't overflow the 6400 byte space available in an MFM disk. Which might be better expressed as 6250? 2016-12-31 12:51:52 -05:00
Thomas Harte
cfbab1448c Switched to a track parsing that disallows synchronisation values within sector contents. 2016-12-31 12:23:08 -05:00
Thomas Harte
12549ff412 Might as well get the file offset before entering the critical section; also moved the lock guard down more explicitly to group with the second set of actions. 2016-12-31 11:48:46 -05:00
Thomas Harte
6f0b5427e4 Made an attempt to avoid repetition of sync bytes. 2016-12-31 00:20:00 -05:00
Thomas Harte
0123b37213 Made an attempt to include sync values in the stream and properly to align. 2016-12-31 00:11:31 -05:00
Thomas Harte
ea4d85e1cd The virtual disk constructed is the same across all tracks. So why not just request zero? 2016-12-31 00:10:35 -05:00
Thomas Harte
f217d508b8 Completed first attempt at write support for Oric disk images. 2016-12-30 23:12:46 -05:00
Thomas Harte
1f625fad66 Decided that if this is an [M]FM parsing function then it should be something more intelligent than a mere PLL record. Which I guess conveniently implies Oric DSK-esque behaviour. But properly defined, rather than very vaguely. 2016-12-30 23:10:52 -05:00
Thomas Harte
632b3c63b1 Added the infrastructure necessary for Oric disks to appear writeable to the machine and to receive changed tracks. 2016-12-30 22:51:48 -05:00
Thomas Harte
d581294479 Added get_track to get the PLL output for a complete track. 2016-12-30 19:59:23 -05:00
Thomas Harte
0f399b0a0c Made type conversion explicit. 2016-12-30 19:59:01 -05:00
Thomas Harte
3b29e6a473 Ensured SSD and ADFs are grown if required. 2016-12-30 18:08:12 -05:00
Thomas Harte
07dacff42d Added writing for Acorn ADF disks, plus appropriate TODOs in both similar bits of boilerplate. 2016-12-30 18:03:30 -05:00
Thomas Harte
c85450648f Fix: make sure copies have proper event lengths. Also made it much clearer what's going on with the initial copy to the heap. 2016-12-30 17:55:46 -05:00
Thomas Harte
c740d9655a Fixed: index_count_ may have been left high by a previous call; reset it just in case. 2016-12-30 17:55:06 -05:00
Thomas Harte
d09e7ac1e8 Made an attempt at reacting appropriately if the very first thing that looks like a sector doesn't pan out. 2016-12-30 17:44:35 -05:00
Thomas Harte
5d63556870 Periods need a custom copy constructor too, if they're going to avoid sharing an event_source. 2016-12-30 17:39:52 -05:00
Thomas Harte
81a3cbac45 Ensured a copy is passed for writing back rather than the original. 2016-12-30 17:26:44 -05:00
Thomas Harte
63ff5165a4 After a quick bit of reading, discovered the virtual copy constructor pattern really is only a convention in C++, and conformed to it. Which hopefully gives copyable tracks. 2016-12-30 17:25:39 -05:00
Thomas Harte
71dbd78cf2 If asynchronous background processing is to occur on tracks then, given that they inherently have state, they'll need to be copyable, and ideally 'cheaply' (though it's not too great a priority). So started implementing appropriate copy constructors. Also introduced an extra level of indirection to PCMSegmentEventSource so that it can copy itself without copying the underlying PCMSegment, which is 95% of the heft of a track in all currently-implemented cases. 2016-12-30 14:23:26 -05:00
Thomas Harte
f88f3c65e9 Removed duplicated newline. 2016-12-30 14:21:36 -05:00
Thomas Harte
82bb78fb2d Ensured that get_sector copes even if any invalid sectors are encountered. 2016-12-30 14:21:14 -05:00
Thomas Harte
6fc692cd34 Attempted to switch to an asynchronous means for continuous file updates. Testing with SSD, as usual. 2016-12-29 22:15:58 -05:00
Thomas Harte
bbd94749f4 ... and I guess an instant maximal simplification is also easy if length ends up being 0 2016-12-29 11:02:21 -05:00
Thomas Harte
54900ca3fb Addition and subtraction can end immediately without performing any extra work if the operand is 0 2016-12-29 11:00:47 -05:00
Thomas Harte
b9fad184d7 Added just enough for a complete manual test of writing to a .ADF with the 1770 then getting the correct result parsing it back on the host side in order potentially to update a file.
... which means that now it's time to worry about when and how mounted files should actually update themselves. Which will make for some fun with threading, I dare say.
2016-12-28 23:00:47 -05:00
Thomas Harte
af1b396c9e Found an ugly issue with Storage::Time as implemented (i) to be unsigned; and (ii) automatically to simplify. Will need to fix. Here's a quick workaround for this one segment of code. 2016-12-28 22:57:11 -05:00
Thomas Harte
9cb902cc4f Experimentally marked ADF as writable too, immediately discovering a mistake in the analysing MFM decoder. 2016-12-28 22:34:22 -05:00
Thomas Harte
bfe6c0a0c1 Ensured that FileHolder gets a writeable file reference if one is possible, and records whether the file in hand is read-only. So now the SSD class can answer honestly. 2016-12-28 20:09:14 -05:00
Thomas Harte
46a93d2e12 Fixed errors to ensure that FM disks, at least, follow the same CRC generation rules when being built from sectors and when being parsed. 2016-12-28 19:48:46 -05:00
Thomas Harte
720b1e5802 Attempted to ensure proper CRC generation for FM-format input. 2016-12-28 18:56:53 -05:00
Thomas Harte
3a9ad3fb08 Fixed Oric .DSK handling, per my latest understanding. Which creates a desire to write shorts directly to the disk surface, so exposed that in the encoder. 2016-12-28 18:50:28 -05:00
Thomas Harte
a568172758 Made steps towards proper CRC generation. Am currently comparing against Oric disk images, as — amongst other things — they include precomputed CRCs. 2016-12-28 18:29:37 -05:00
Thomas Harte
0490a47058 Worked on the all-around framework for decoding sectors back from tracks when closing down a file. Hit the wall that the parser is more observant of CRCs than the WD. No, really. So I guess I have to stop avoiding that whole issue. 2016-12-26 14:24:33 -05:00
Thomas Harte
742c5df367 With lots of logging arising temporarily, fixed bug whereby conversion to a patched track would lead to holding a track with a distinct measure of time, leading to improperly-placed patches. 2016-12-25 22:00:39 -05:00
Thomas Harte
b538ee5bd8 Fixed discovery of correct active period and setting of track time, when seeking. 2016-12-25 21:32:50 -05:00
Thomas Harte
a6d038cad9 Eliminated special case that doesn't seek properly and isn't needed. Added TODO. 2016-12-25 21:32:14 -05:00
Thomas Harte
4fca30b81f Made the Plus 3 less chatty, documented invalidate_track. 2016-12-25 21:06:58 -05:00
Thomas Harte
26710c988d Modified SSD to ensure a fully-formatted surface is represented even if no track data is in the source file. This corrects the controller's sense of write success. 2016-12-25 20:40:06 -05:00
Thomas Harte
acc35885cd Attempted to reduce track invalidations. 2016-12-25 20:38:25 -05:00
Thomas Harte
beaa868079 Factored the MFM parser out into encodings. 2016-12-25 20:00:57 -05:00
Thomas Harte
1349e85d83 [Mostly] fixed track write-back. 2016-12-25 19:19:22 -05:00
Thomas Harte
007c13ec16 Fixed: cycles_per_bit_ isn't a function of the rotational multiplier, it's absolute. Also made sure that exactly hitting the end of a bit counts. 2016-12-25 16:35:39 -05:00
Thomas Harte
98be6ede45 Shuffled a little to reduce risk of overflow, ensured writing is a loop, still seem to be writing too quickly for some reason. 2016-12-25 16:13:05 -05:00
Thomas Harte
d2ad2c756e Added enough shovelling to write rubbish for an entire sector. 2016-12-25 15:46:49 -05:00
Thomas Harte
ec55a25620 It makes sense to simplify these ahead of time. 2016-12-25 12:32:25 -05:00
Thomas Harte
aceb7e3b6b Started implementing write sector on the 1770, immediately deciding it would be useful to have a callback for end-of-queued-data-written from disk controller. So had a go at implementing that, naively. More investigation required. 2016-12-25 12:31:38 -05:00
Thomas Harte
901f19f89c Added enough stuff that SSDs attached to a 1770 will now reach the entry point for writing. 2016-12-25 09:46:12 -05:00
Thomas Harte
9d555c4a02 Let's try just declining to pump the PLL while in write mode. Added documentation to explain. 2016-12-25 09:19:18 -05:00
Thomas Harte
b57038edc5 Actually, at least index holes will still be receivable while writing, so this wasn't entirely correct. Probably best to leave it in. 2016-12-25 09:16:09 -05:00
Thomas Harte
d606bd7ce5 Added saturation test, fixed code as indicated. 2016-12-24 23:29:37 -05:00
Thomas Harte
09ff9d6a26 Introduced a couple more floating-point conversion tests, fixed errors uncovered. 2016-12-24 23:21:19 -05:00
Thomas Harte
e25195a718 Added a single test for Storage::Time, discovering that I had the wrong sign on float conversions. 2016-12-24 22:59:01 -05:00