13 March 2023, 20:22 | #21 | |
Registered User
Join Date: Sep 2019
Location: Leicester / England
Posts: 201
|
The file was definitely 32767 bytes as it broke DMS when I made it 32768 bytes, so it's always possible my code had a bug and missed off the last byte, one for me to check.... Quote:
... and another oddity, maybe it was due to how the display of bootblocks worked that this was chosen? As the source code to my tool was last edited on 7th August 1994, my memory on it all is a little rusty. Thankfully, it's full of comments, so I'll try and refresh myself why and get back to you later in the week |
|
13 March 2023, 20:38 | #22 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Quote:
|
|
13 March 2023, 21:20 | #23 | |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
Quote:
And big thank you for this discussion. It really helps everyone when someone is paying attention |
|
13 March 2023, 22:15 | #24 |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
The second disk has broken DMS bitstream affecting the last 5 bytes of the file. Putting stuff there does not make it run any better - I strongly suspect the trouble is in the first disk, and it was there before it was compressed since the music and the anim is corrupted before it loads anything much from disk 2.
|
15 March 2023, 00:33 | #25 |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
I rewrote the decompressor - now it can decompress everything except this Parallax disk2 and theunt, which both are badly broken:
https://github.com/temisu/ancient/bl...compressor.cpp Maybe it is too early to say I'm done with this but now it works a bit better again Last edited by temisu; 15 March 2023 at 10:24. |
17 March 2023, 16:54 | #26 | ||
Registered User
Join Date: Sep 2019
Location: Leicester / England
Posts: 201
|
Quote:
Sorry, my mistake, the header file was actually 32766 bytes. It stopped working in DMS when I made it 32767 bytes or greater as the CRC was reported as being invalid. I thought this may because the CRC routine in my code was only capable of handling signed 16 bit data lengths, but I've just modified it to handle full unsigned 32-bit data lengths and DMS still doesn't like anything greater than 32766 bytes. Quote:
I've modified the check to allow for a larger bootblock and it works just fine, so I presume it was just an arbitrary size I decided upon when I wrote the tool. |
||
05 April 2023, 02:20 | #27 | ||||
Registered User
Join Date: Feb 2016
Location: Homeless
Posts: 62
|
Quote:
Disk A - https://files.scene.org/view/mirrors...ticalMassA.dms That disk does look seriously damaged (unrelated to DMS bugs). Most tracks seem to contain raw data (without OFS filesystem headers, supposedly loaded directly from the bootblock?). But there is also corrupted OFS filesystem in the middle of the disk (a root directory with name "Cocktail ?!", two damaged root entries, and several files that have intact file header, and intact data first 200h bytes, but then followed by corrupted data). As temisu said, Disk A seems to be the main problem, and the demo won't work even when repairing Disk B. Disk B - https://files.scene.org/view/mirrors...ticalMassB.dms That's interesting and nasty. For manually fixing it: It's easy to guess that the last 8 bytes should be 8000000000000000. But there is no way to fix that automatically. Looking at the decompressed data: It seems to contain a bitmap bitplane with values like ..FFFFFFFFFFFFFx000000..000000xFFFFFFFFFF.. but the last 8 bytes are wrong or missing (two garbage bytes, and 6 missing bytes). When repeating the pattern of the preceeding bitmap bytes, those last 8 bytes should be probably x000000000000000 (namely, 8000000000000000 will produce correct checksum). In the RLE layer, those 8 bytes should be RLE-encoded as 80 90 07 00. But the RLE data does instead contain two garbage bytes, and two missing bytes. And the LZ layer, it does contain two trailing garbage literal codes, which should be removed, and should be probably replaced by a single length/distance code that would represent 80 89 07 00. Anyways, no way to fix that automatically. DMS Testing I've finally got my floppy disk emulation working, and I can now emulate & test the DMS software : ) Albeit, it's a bit tiresome to boot up different DMS versions and to key in the command line strings each time : / Anyways, I've tested the repaired Eradication ADF file, and I can in fact reproduce the DMS error when re-compressing it via Heavy2, tested with DMS v1.11 thru DMS v2.04. and they are all bugged (even though the .guide file in v2.04 does (incorrectly) claim to have "found and solved" the DMS bug) (for 2.04, I've only tested the DMSWB gui version, the DMS commandline version wants me to run the DMS installer, and to install a newer OS for running the DMS installer). Eradication can be compressed without bugs when using Heavy1 (or when using DMS versions older than v1.10, which don't support Heavy1/Heavy2 at all). That doesn't necessarily mean that Heavy1 is more stable - but one can apparently switch to using a different compression method in case of problems. Warp (DMS predecessor, from same author, ie. SDS Software) A bit-offtopic, I've also looked into the older warp format. It's more simple, and has some similarities to DMS, and surprisingly some extra low-level features for sector "Labels" and raw MFM encoding. Code:
Warp files (.WRP) (SDS Software) The file contains several pairs of TOP and BOT chunks: 000h 0Ah ID ("Warp v1.1",00h) ;v1.1, although the sofrware version is 1.11 00Ah 2 Track (usually 00h..4Fh) (max FFFFh..0052h in UnWarp?) 00Ch 4 Side ("TOP",00h=Side0, "BOT",00h=Side1, FFh,xxh,xxh,xxh=Banner/Text) 010h 2 Type (1=Normal, 2=MFM) ... (8) Unused(?) extra 8 bytes (present only if Type=2=MFM) 012h 2 Compression Method (0..3) (usually 1 or 3) 014h 2 CRC16 with initial value 0000h on decompressed data 016h 4 Compressed Size (SIZ) 01Ah SIZ Compressed Data Compression Methods: 0=Replace (uncompressed) (ARC method 02h) (eg. random mixed with value 90h) 1=Crunch (RLE90+LZW) (ARC method 08h) (used for most tracks) 2=Squeeze (RLE90+Huffman) (ARC method 04h) (eg. random 7bit values) 3=Pack (RLE90) (ARC method 03h) (eg. random 8bit values) Decompressed Data (when Type=1) (written via SendIO with cmd=ETD_FORMAT): 0000h 0Bh*200h Sector Data (for sector body) 1600h 0Bh*10h Sector Labels (for sector header, usually zerofilled) Decompressed Data (when Type=2) (written via SendIO with cmd=ETD_RAWWRITE): 0000h 3xxxh Raw MFM data (sync marks, sector header, data, gaps) Decompressed Data (when Side=FFh) (shown as text) 0000h ... Banner/Text (max 8000h bytes or so) The WRP file may contain fewer than 2*80 tracks (it may omit unused tracks, and large disks may be split into several wrp files). Type=2 and Banner/Text are implemented in UNWARP decompressor, but unknown if (or how) the WARP compressor does actually support creating such files. Type=2 does include 8 extra bytes in the header (but those bytes seem to be unused). WARP is automatically using the best method for each track. RLE90/LZW/Huffman are exactly same as in ARC (but unknown if LZW has same gaps after clear codes; the small 16B0h-byte WRP tracks never(?) contain any clear codes at all). 1000h codes should occupy about 1520h bytes in LZW format, and with the right amount of random and non-random data, it should be possible to have more than 1000h codes that are smaller than 16B0h uncompressed bytes (and smaller than Huffman or plain RLE). Quote:
Quote:
And, the official DMS v1.xx versions from SDS Software seems to display only 200h bytes (which is fitting better on 640pix screens). Quote:
For example, CriticalMassB has 2 wrong bytes and 6 missing bytes (which is clearly unfixable). But there might be also cases where you get 2 wrong bytes and 1 missing byte (then all 3 bytes would be still wrong when adding the missing byte). Sure, I'll post them here if I find any. You also don't have more broken files than those posted here, or do you? The only other file that I am aware of is that "Superfrog disk 3" but I've no idea if that disk/version could be found online. Last edited by nocash; 06 April 2023 at 22:13. |
||||
06 April 2023, 08:35 | #28 | |||
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
Quote:
Makes me kind of sad though. I had completely forgotten this demo, although it is no gem it is still pretty nice. And all this because of broken disks First and last time I saw it properly was in ASM'92 big screen. Quote:
I've been thinking about supporting Warp as well, but there is the complication of raw MFM-data (how to represent that, it is not going to cleanly go into adf) and the fact that I don't see much Warp files lying around. I did earlier code for IPF->ADF with a side-API for raw-track data (not public yet). It has exactly the same problem of "I can make this work but how the data is going to be usable?"-thingy Quote:
So far thats the files I have. I thought I had more but no. I'll let you know if I stumble into more of them. |
|||
06 April 2023, 10:40 | #29 | |
CaptainM68K-SPS France
|
Quote:
|
|
06 April 2023, 20:55 | #30 |
Registered User
Join Date: Feb 2016
Location: Homeless
Posts: 62
|
Yes, there are extended .ADF files with MFM data. The format isn't officially documented anywhere, but it should look like so:
Code:
Extended ADF (v1) 000h 8 ID "UAE--ADF" (ADF_EXT1) 00Ch N*4 Track List (always A0h entries for 2*80 tracks) ... .. Track Data Track List entries: 000h 2 Type (0=NormalAmigaDosTrack, 1=RawMFM) 002h 2 Available space for track in bytes (must be even) (3380h) Extended ADF (v2) 000h 8 ID "UAE-1ADF" (ADF_EXT2) 008h 2 Reserved (0) 00Ah 2 Number of tracks (N) (default 2*80=160) 00Ch N*0Ch Track List ... .. Track Data Track List entries: 000h 2 Reserved (0) 002h 1 Disk revolutions-1 (when Type=1) 003h 1 Type (0=Normal AmigaDos Track, 1=Raw MFM) 004h 4 Available space for track in bytes (must be even) (3380h) 008h 4 Track length in bits (often len*8=19C00h) (0=empty/unformatted) Track Data, Type 0 000h .. Data (usually 1600h bytes for 11*200h) ... .. Zeropadding (to Track size, which is usually 3380h) Track Data, Type 1, one revolution 000h .. MFM data Track Data, Type 1, more revolutions ... .. Track Data, Type 1, unformatted 000h .. Zerofilled https://fossies.org/linux/uae/src/disk.c https://raw.githubusercontent.com/BlitterStudio/amiberry/master/src/disk.cpp WARP v1.11 doesn't mention any commandline switches for selecting MFM format. WARP v1.11 contains command 800Bh (ETD_FORMAT), but I can't see command 8011h (ETD_RAWWRITE) in the disassembly (unlike UNWARP, which supports both 800Bh and 8011h). WARP v1.11 is bundled with a generic Read.Me and UnWarp.doc, but unfortunately no Warp.doc (so there's no info on if or how one can use (or buy?) MFM support). Or wait... looking at the ascii strings in the WARP executable, there seem to be undocumented commandline switches: MFM, DOS, IBM, APPEND, NOCOMP, NOZERO. Which should be supposedly appended at end of the commandline as so: Code:
warp read 0 79 filename mfm There is also a "Could not open Text file" string in the WARP executable, but I don't know how to specifiy a text file in the commandline. And, it seems that can enter text via keyboard after compression, but I don't know to terminate the text input and return to the command prompt. In theory, there should have been a Warp.doc file that describes all those things, but it's missing in the warp downloads, or was there some printed warp manual on paper? EDIT: Found manuals here: http://janeway.exotica.org.uk/release.php?id=87807 that package seems to contain various hacked warp versions. The good thing is that those hacks include manuals, describing the "MFM" switch, and optional trailing "+TEXTFILE". The latter should also make it easy to test large LZW blocks with LZW clear codes. Last edited by nocash; 06 April 2023 at 21:39. |
06 April 2023, 21:49 | #31 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
Interesting... I have started to look at the Warp executable in ReSource.
I noticed one broken instruction, maybe due to a typo in the source code? There is one occurrence of Code:
BCLR #CIAB_DSKSIDE,($1BFD100).L |
07 April 2023, 00:52 | #32 | |
CaptainM68K-SPS France
|
Quote:
|
|
07 April 2023, 17:41 | #33 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Quote:
I have seen this demo working until end part on both real A500 and UAE but it is rare that it works fully.. Usually it dies. |
|
07 April 2023, 19:45 | #34 |
Registered User
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
|
I put a working Disk 2 in the zone. At least it can un-dms correctly. Doesn't change much unfortunately, demo always ends with a black screen.
|
09 April 2023, 22:32 | #35 | |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
Yes, this is accurate. Can we fix the DMS-compression errors? nocash did it as well I did it. so we definitely can. (manually that is)
Does it make the demo run any better? Not one bit, which is unfortunate. It would need patching by someone who has time. At least the code/data does not look like it is compressed (in disk) which will probably make stuff easier if someone wants to take a shot. You can just patch the adf directly. This Disk B on this demo is also very interesting in that it is not consistent on other breakage we've seen so far on DMS files. The data is corrupted but packed data checksum is valid. Other cases we have documented here are those the last byte is missing/corrupted in a some sort of off-by-one error. It is really special in a special way Quote:
The extended ADF seems to be something that I need to try how it works, it seems to be a perfect format for certain raw data. Or should it be called uadf? uae-adf? In any case searching extended adf in eab does not yield the most constructive discussions... |
|
28 June 2023, 18:41 | #36 |
Registered User
Join Date: Feb 2016
Location: Homeless
Posts: 62
|
I've disassembled another disk compressor...
Code:
Lhwarp .LHW (1989-1990, Jonathan Forbes) File Header (10h or 14h bytes, depending on version) 000h 1 Version High (01h) ;\ 001h 1 Version Mid (00h..09h) ; three digit version (1.39 = newest) 002h 1 Version Low (00h..09h) ;/ 003h 1 Unused (00h) 004h 2 First Track (00h..4Fh, usually 00h) 006h 2 Last Track (00h..4Fh, usually 4Fh) 008h 4 Text compressed size (or 0=None) 00Ch 4 Text uncompressed size (always 0 for bugged v1.20+text) 010h (4) Total Filesize (exists in v1.30 and up) ... .. LZHUF-Compressed Text (if any) ... (16) Copy of hdr[0..0Bh], plus nonzero Text size (for bugged v1.20+text) ... .. Track Headers & Compressed data for First..Last Track Track Headers (0Ch, 10h, or 14h bytes, depending on version) 000h 1 Compression Method (00h,01h,07h,0Ah) (used in v1.10 and up) 001h 1 Track Present Flag (00h=Normal, 02h=TrackNotPresent) (used in v1.1x) 002h 1 Track Number (00h..4Fh) (First..Last Track) 003h 1 Unused (00h) ... (4) Sector Present Flags (0..3FFFFFh) (little-endian!) (in v1.10 and up) ... 4 Decompressed Size (210h*num_sectors) (0..2D60h) ... 4 Compressed Size ... (4) Checksum (sum of all decompressed bytes) (exists in v1.02, v1.03) ... (4) CRC32 (with initial=0, result=uninverted) (exists in v1.10 and up) ... .. Compressed Track (if any sectors are present) Decompressed Track format Version v1.0x: 0000h 2C00h Sector data (22 x 200h bytes) 2C00h 160h Sector labels (22 x 10h bytes) Version v1.10 and up: 0000h 200h 1st Sector data 0200h 10h 1st Sector label (usually zerofilled) 0210h 200h 2nd Sector data 0410h 10h 2nd Sector label (usually zerofilled) ... .. etc. Methods 00h = Freeze/Unfreeze v1.00 (LZHUF) (aka LHA -lh1- method) 01h = Store/Unstore v1.40 (none) (aka uncompressed, or empty) 07h = Vaporise/Soldify v1.20 (ClearGapLZW) (aka Unix nCompress.Z Mode=8Eh) 0Ah = Squeeze/Unsqueeze v1.20 (Huffman+RLE90) (aka CP/M Squeeze.xQx) Most .LHW files are using LZHUF (the newer LZW/Huffman methods are rarely used; they were perhaps added to offer faster compression, albeit with worse compression ratio). Versions 1.00 Did exist (but doesn't seem to be supported any longer) 1.01 0Ch-byte track header (oldest supported version) 1.02 - 1.03 10h-byte track header (with checksum entry) 1.10 - 1.11 14h-byte track header (with CRC, TrackPresent, SectorPresent) 1.20 - 1.21 As above, no longer using TrackPresent flag, Squeeze/Vaporise 1.30 - 1.31 As above, with added total size entry in File header 1.40 Newest software version (stores 1.39 in file header, not 1.40) Bugs/Issues Most releases contain bugfixes. For files created with version v1.1x or v1.2x, it is common to have 1-5 corrupted tracks with bad CRC warnings (nonetheless, the sector data appears to be correct, the error might be in the sector labels (?) or in the CRC field). Lhwarp is slow (although v1.40 claims to use assembler functions with mysterious speed increases). |
21 July 2023, 23:16 | #37 |
Moderator
Join Date: Jun 2009
Location: France
Age: 46
Posts: 1,982
|
@nocash
if you need a particular type of DMS, I have a very nice collection, including ADF files corresponding to buggy DMS files |
22 July 2023, 11:38 | #38 |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
I’d very interested in the buggy files as well
|
22 July 2023, 13:00 | #39 |
Moderator
Join Date: Jun 2009
Location: France
Age: 46
Posts: 1,982
|
|
24 July 2023, 18:58 | #40 |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
Very interesting failure cases. I also love that you included the adfs for comparison.
Thanks! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Beginner question about WHLoad (2 different methods?) | c0dehunter | support.Apps | 17 | 13 January 2019 20:29 |
Internal scan-doubling methods for the A1200 | arkpandora | support.Hardware | 4 | 31 March 2015 15:56 |
Methods for removing labels from floppies | diablothe2nd | support.Other | 22 | 08 July 2013 21:43 |
Best Compression Methods For... | Lonewolf10 | Coders. General | 16 | 16 June 2013 17:31 |
How can I force DMS to write a dms in spite of fatal errors? | andreas | support.Apps | 43 | 10 January 2007 05:13 |
|
|