Commit Graph

200 Commits

Author SHA1 Message Date
David Given
3cb098f9ba Rip out the old approach to soft sector remapping as it wasn't working. 2022-09-11 17:05:40 +02:00
David Given
dda713a6be Remove the rest of the mapper. 2022-09-10 22:47:35 +02:00
David Given
085ad5f2a4 Actually start using the new physical sector stuff. 2022-09-10 20:43:24 +02:00
David Given
a6db36e7b3 Convert from LayoutData to Layout. 2022-09-10 19:53:05 +02:00
David Given
1a4caccd07 Rename Sector.logicalSector to Sector.physicalSector. 2022-09-10 18:59:06 +02:00
David Given
3256b4f627 Eliminate the IBM trackdata sector layout stuff in favour of the layout{}
clause.
2022-08-27 23:23:28 +02:00
David Given
fa760b702c Fix C automatic dependencies to actually work. 2022-06-16 19:39:47 +02:00
David Given
b025e6bb88 Remove dep/fmt completely. 2022-06-14 20:12:55 +02:00
David Given
07b1719b17 Let's try an actual vanilla Makefile. 2022-06-13 23:21:06 +02:00
David Given
15eb88e922 Convert, hopefully, the remaining encoders to do automatic disk sizing. Ther e
may be bugs.
2022-03-29 01:23:35 +02:00
David Given
9a299b758a Correctly set the format byte. 2022-03-29 00:03:59 +02:00
David Given
5c68b47a29 Add missing file. 2022-03-28 00:19:02 +02:00
David Given
adff739a5d Partial conversion to do automatic scaling of flux based on the disk rotation
speed. Although, something seems to have broken for 5.25" disks.
2022-03-27 23:50:32 +02:00
David Given
178aa9d32f Remove the obsolete reader.* and rename writer.* to readerwriter.*. 2022-03-25 20:57:42 +01:00
David Given
86c5cccb08 Rename cylinder to track throughout (mostly). 2022-03-25 20:16:12 +01:00
David Given
d303067deb Massive refactor to work in logical cylinders everywhere. The logical/physical
mapping is now done at the last stage and should, ideally, be automatic. I'm
sure there are bugs everywhere.
2022-03-25 00:22:28 +01:00
David Given
77a0c9f341 Typo fix. 2022-03-19 18:43:20 +01:00
David Given
fc7859dc27 Update comment about the generation of the desync sequence. 2022-03-19 18:41:03 +01:00
David Given
39d6b0525f Fix incredibly stupid bug. 2022-03-19 18:07:10 +01:00
David Given
51e091ded6 Better documentation of the missing clock bit. 2022-03-19 14:00:35 +01:00
David Given
52407848c1 Do more sanity checks for bad sectors, improving the reads by a lot. 2022-03-19 13:55:22 +01:00
David Given
276282e847 Merge from master. 2022-03-19 00:51:59 +01:00
Jeff Epler
6cfe69634c Merge remote-tracking branch 'origin/master' into further-apple-fixes 2022-03-08 07:45:20 -06:00
Jeff Epler
61be3714a5 apple2: encoder: Fix writing of "FF40"
I was writing "FF40" as "FF48": 1111 1111 0000 instead of 1111 1111 00.
This sequence of four zeros will not allow the real hardware to synchronize
to the bitstream.

With this change, I was able to boot a DOS 3.3 disk I rearranged into
"physical" order; some 'there's a disk error' raspberries occur (probably
indicating a data error within a sector) during the boot process, so
something is still obviously marginal, but this is a huge step forward.
2022-03-08 07:44:03 -06:00
Jeff Epler
0aed615ee5 Fix crash when reading disks written on real apple2
`readRaw8` throws an exception if you run out of data. This did not
turn up during my testing, because I was reading back a disk written by
fluxengine, so everything was aligned to the index pulse and no sector
ever straddled a revolution. On a "real" apple2-written disk, this was
not the case.

Incidentally, the "extra 0" problem exists on a real apple2-written
floppy as well.
2022-03-07 22:40:33 -06:00
David Given
aa805f81e0 Simplify. 2022-03-04 20:28:09 +01:00
David Given
93a67dadf6 Merge from master. 2022-03-04 20:19:42 +01:00
David Given
0edca836f0 Let the image reader do the physical/logical track mapping. 2022-03-03 00:18:49 +01:00
Jeff Epler
79eec41bcd Revamp how extra zeros are handled
It's not OK to call seek() here. Instead, add a function which can read
an apple 8-bit flux value in terms of readRaw8 and readRawBits. Apply
this function to all the data bytes, rather than just the first one.
2022-03-02 07:45:24 -06:00
Jeff Epler
d90fcbf7ad Handle extra 0-bits at the start of a sector 2022-03-02 07:43:45 -06:00
Jeff Epler
c4e4520058 apple2 decoder: explain the progression of sector status values 2022-03-02 07:43:43 -06:00
Jeff Epler
87cb4b6d18 Add apple2 encoder
This is tested with encodedecodetest.sh but is not tested on HW yet.
It's likely that the sector order (interleave) doesn't match real systems.
2022-02-28 16:22:53 -06:00
Paul Devine
f796b6b40d works in physical victor 9000 machine 2022-02-26 14:59:09 -08:00
Howard M. Harte
d028db1ba3 northstar: Improve decode a little more.
seekToPattern() can skip the index hole if it doesn't find the
SYNC pattern.  If this happens too close to the end of the flux
stream, it can result in a conflicted sector.  In this case,
discard the sector.
2022-02-25 22:08:57 -08:00
Howard M. Harte
2d4e2b87bc micropolis: Improve decode a little more.
seekToPattern() can skip the index hole if it doesn't find the
SYNC pattern.  If this happens too close to the end of the flux
stream, it can result in a conflicted sector.  In this case,
discard the sector.
2022-02-25 21:59:18 -08:00
David Given
eade2e279e Make the internal disk data structures all const, to allow us to pass them to
the GUI UI thread safely.
2022-02-24 22:46:10 +01:00
Howard M. Harte
8d04d17e39 Fix override warnings in decoders. 2022-02-22 22:45:39 -08:00
David Given
48414f0ce9 Merge pull request #467 from davidgiven/logging
Miscellaneous minor fixes
2022-02-22 22:53:19 +00:00
David Given
548e07ce17 Fix off-by-one error in the MX decoder. 2022-02-22 22:51:14 +01:00
Howard M. Harte
8cbef669b1 northstar: Fix after decoder change.
Recent changes to the decoders broke North Star.
2022-02-21 13:34:34 -08:00
Howard M. Harte
d69944dd8c Micropolis: Add support for MZOS checksum.
Vector MZOS uses a different sector checksum than the standard
Micropolis checksum used by MDOS, CP/M and OASIS.  Automatically
detect the checksum on the disk by default, but allow the user
to force the use of a specific checksum using the
--decoder.micropolis.checksum_type parameter.
2022-02-19 14:10:56 -08:00
Howard M. Harte
a25111e411 Micropolis: Improve decode.
* Discard a partial sector at the end of the track.
    * Do not seek to the index mark for the first sector.
    * Use a 64-bit pattern to match the SYNC.
    * If SYNC is found too early, search for a subsequent SYNC.
    * While decoding the sector record, enforce the SYNC pattern
      and track ID.
2022-02-19 14:10:44 -08:00
Howard M. Harte
6866d5d3fa Require 16 sectors for Micropolis disks. 2022-02-19 14:10:35 -08:00
David Given
0d7de7bbc0 Add support for ignoring certain sectors (needed for FastCopy disks on the
Atari ST).
2022-02-16 22:02:50 +01:00
David Given
482638601a Add missing files. 2022-02-13 21:07:01 +01:00
David Given
1bfe518f74 First draft (very bad) agat340 decoder. 2022-02-13 20:53:23 +01:00
David Given
f6b1d9c493 Fix a regression in the MX decoder. 2022-02-12 23:37:20 +01:00
David Given
c539debc84 Fix the Amiga decoder, which got broken with the decoder change. Also fix the
encoder which was always broken (but Amigas apparently didn't care).
2022-02-12 22:42:15 +01:00
David Given
e8d1c90182 Fix, hopefully, the rest of the decoders. 2022-02-12 15:02:42 +01:00
David Given
0933dc1afa Partially complete rework of all the decoders to avoid seeking inside the
fluxmap. This requires resetting the FluxDecoder, which loses any pending
state, resulting in bad reads for (some) formats which don't have gaps between
sectors --- the DVK MX is the main victim.
2022-02-12 00:55:09 +01:00