Open ourIThome opened 3 years ago
So if I'm getting this right, an ADF file format is just raw data of sectors, ordered by their numbers ("80 cylinders × 2 heads × 11 sectors × 512 bytes/sector" = 901,120 Bytes). That is, if sectors are physically ordered on the track as 1, 3, 5, 2, 4, 6, then in the image their data are logically stored ascending 1, 2, 3, 4, 5, 6. Aka., an ADF file is just a nickname for a classical IMA/IMG file. Correct?
"80 cylinders × 2 heads × 11 sectors × 512 bytes/sector" = 901,120 Bytes). -- correct for DD disks, although when I do my reads I read up to 83 cylinders and check if there was any data retrieved 80 ... 83 and trim these cylinders back, only if the highest cylinders ... side 0 and side 1 contain no sector data. These extended tracks I can discuss further around what to do with them later, one we get the basic range correct.
This might be useful... http://lclevy.free.fr/adflib/adf_info.html
Amiga disks have a marker of 4489 ... I believe twice ... At least for my non original disks... They aren't index aligned.
This marks where the track starts. There is some header information which contains track number which is being read, and sector CRC information.
Because when you read a revolution of the disk, you might start reading partly middle of a sector. You have to read a full revolution and a little bit more ... I think we discovered 1.1 revolution captures enough.
You then look for the 4489 marker ... This lets you know where the starting point is. And then when you reach the end, you wrap around to the start.
I believe the sectors are written sector 0,1,2...10 for DD disks.
The adf file just contains the raw mfm decoded bytes. So in the end the adf contains no mfm marker of 4489, and contains no track header information. And doesn't store any copy protection.
It's important that the expected track being read and the actual track being read from the disk matches.
Also if the CRC fails to match the sector that you fill the sector with -=[BAD SECTOR]=- ... Same for the above line.
Let me know if there is something else I can try explain more for you.
http://lclevy.free.fr/adflib/adf_info.html seems to be a fantastic source, many thanks for it! 👍
I started to be interested in solving this issue because if an ADF file is just unstructured sector data, then it could be done using just a handful of lines in the code (similarly as other unstructured formats are).
I've been postponing Issue #11 for almost three years, but I think it will be necessary to have it to at least browse ADF files in hexa-mode (as there is no Amiga DOS to recognize the raw image's geometry). For encoding/decoding at magnetic flux level, I will then use the document from above, comparing my implementation with Simon Owen's Samdisk. I will include Issue #11 in v1.6.1, but will postpone Amiga encoding/decoding + ADF until 1.6.2 when I will have studied up a bit about Paula (or Pauline? - still confuse these two) 🙂
Brill, wished I was talented enough to code and help out... Appreciate everything you doing.
With Amiga DOS disks, you get track header that contains sector and CRC values. But then in top of this, you also get file level file and CRC too. I'm hoping when you get around to file stuff, that I can find files that don't match CRC ... And be able to inject and overwrite current file wherever the bytes are spread over the disk with a new replacement file ... As long as the CRC matches... But for the moment, a basic file viewer / select file ... View bytes would be a great starting point.
I keep watching this progress :)
Hi Stephen,
so I today committed the initial solution to Issue #11 and, after renaming an ADF to IMA, opened my beloved The Secret of Monkey Island. I was just hoping to see some form of FAT typically visible by continuous rainbow colors somewhere at the beginning of the disk, like in the following MS-DOS image on Cylinder 0.
But regretaly, I don't see such rainbow, not even a non-continuous, so I can't confirm :-( These are my settings (the number of cylinders is not important and is computed based on the other values and the size of the image).
The following is the result.
The handful of plain text that is present in the image reveals that the sectors might have been somehow interleaved as the text doesn't seem to be fluent at the boundaries of sectors? (Though I'm not much proficient in German language.) Will yet use some other images from the Planetemu database. If the text is nicely connected across sector boundaries, then I can add an ADF image as another form of IMA image and we shall be one step closer to finishing this issue :-)
Would it be possible to rip Amiga (non copy protected) disks to ADF file format.
Ideally :
The imaging code should read the track and decode the track header information. There should be some warning if the track read, differs from the track header information about what track it believes it is reading. The track header information also contains knowledge of Sectors and their CRC values. Good sectors should be dumped into the ADF file. Bad sectors should be mark the ADF sector information filled with -=[BAD SECTOR]=- ... filled for the entire sector.
During a retry or a post retry / repair ... the track should be re-read and then only where good sectors are read, and the current ADF shows -=[BAD SECTOR]=- .... should now get replaced with the good data. This is particularly useful if you try to clean the disk after its been imaged.
I have some further requests around automating ripping ...
Disk0001.adf Disk0002.adf etc
Also naming the file based on the AmigaDOS disk label name.
I can raise these depending how my current requests go / interest by the community.