| |
Compyx
Registered: Jan 2005 Posts: 631 |
Looking for corrupt T64 images
Hey there,
I'm developing a small tool to 'fix' corrupt T64 images, so hopefully we can one day get rid of this crappy format.
I know there's a lot faulty images out there, so far I've been looking for them with pokefinder, but this means downloading and testing every image and hoping I find a corrupted one.
This obviously takes way too much time, so I was hoping some people here know about faulty T64 images, perhaps on CSDb, perhaps on one of the FTP servers.
To give you an idea of what I'm attempting to fix, here's a run of my tool, first on a proper image, and then on a corrupt one:
compyx@aspire-7740 ~/projects/t64fix $ ./t64fix ~/projects/c64-toolkit/data/compunet.t64
-------------------------------------------------------------------------------
tape magic : "C64 tape image file"
tape version: 0100
tape name : "FBI CREW 1989"
file records: 3/4
-------------------------------------------------------------------------------
blocks filename type rep. memory real memory status
140 "COMPUNET +7 /GP" prg $0801-$92b0 $0801-$92b0 OK
18 "COMPUNET RIP /GP" prg $0801-$190f $0801-$190f OK
152 "COMPUNET / MD 64" prg $0801-$9e93 $0801-$9e93 OK
-------------------------------------------------------------------------------
OK, proper image
compyx@aspire-7740 ~/projects/t64fix $ ./t64fix ~/projects/c64-toolkit/data/kikstart-iii-corrupt-endaddr.t64
t64fix: warning: current records count reported as 0, adjusting to 1
t64fix: warning: reported size of $bbc5 does not match actual size of $795a
t64fix: illegal value $44 for C1541 file type, assuming $82 (prg)
-------------------------------------------------------------------------------
tape magic : "C64S tape file
Demo tape......"
tape version: 0100
tape name : "DEMO TAPE"
file records: 1/30
-------------------------------------------------------------------------------
blocks filename type rep. memory real memory status
190 "FILE " prg $0801-$c3c6 $0801-$815b fixed
-------------------------------------------------------------------------------
faulty image: fixes applied: 3
As you can see, quite a few corruptions can be fixed. I'm also looking for T64 images which contain snapshots (FRZ files) from the C64S emulator, the one that originated the T64 file format. Would be nice to see how those files are stored, so I can skip them when extracting files from a T64 into a D64 or something similar.
/Compyx |
|
| |
soci
Registered: Sep 2003 Posts: 480 |
Freeze of v2.52:
http://singularcrew.hu/temp/c64sfreeze.t64 |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
perhaps also change the magic to "C64S tape file"? or whatever the original docs said/what c64s created. |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
Quote: Freeze of v2.52:
http://singularcrew.hu/temp/c64sfreeze.t64
Thanks.
Looks like Peter Schepers' T64 article is correct: C64S filetype > 1 && C1541 filetype == 0: memory snapshot.
Both load and end address are set to 0, so apparently a snapshot has a fixed size that C64S knows about, in this case $104f4. |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
Quote: perhaps also change the magic to "C64S tape file"? or whatever the original docs said/what c64s created.
Yes, a magic check/fix would also guard against feeding my tool a D64 which will likely result in a big mess. ;)
Perhaps add a --force switch for T64 files with really fucked up headers I have yet to encounter.
Seems like "C64S tape image file" in ASCII, padded with $00 to make it 32 bytes long is the original magic for the containers. I'll go with that. |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
How come T64 files tend to be corrupt? Is there some particular tool that tends to produce faulty/incompatible T64's? |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
From what I understand, an old tool called CONV64 produced T64 images with the end address of files always set to $c3c6, no matter how large the files actually were (see kikstart-iii here on CSDb). Which caused a lot of tools and emulators to fail.
Other tools seem to get the number of files in the T64 container wrong: the number of files is set to 0. I haven't been able to pinpoint these tools yet.
Then there's the variety of 'magic' bytes in the headers, I think the proper magic should be 'C64S tape image file', in ASCII, padded with 0x00 to a length of 32 bytes (that's what C64S 2.52 uses, which is the emulator that spawned the hell that T64 is).
Also the C1541 file type is usually screwed, shouldn't matter too much, T64 can basically only store PRG files and memory snapshots.
Then there's the version number, which is either 0x100 or 0x101, but knowbody knows the difference.
So perhaps back in the day when bandwidth or BBS storage space mattered, T64 seemed like a good choice. Now, not so much. |