Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Copperhead ! (Registered 2024-05-08) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Warp compression method (AR)
2010-04-09 12:39
Mr. Mouse

Registered: Dec 2001
Posts: 235
Warp compression method (AR)

Does anyone know the compression scheme used in Action Replay's "warp" disksaving method? I notice the sectors look a little different, where's the information about which next sector to go to while decompressing?
 
... 24 posts hidden. Click here to view all posts....
 
2010-04-10 11:12
Krill

Registered: Apr 2002
Posts: 2852
So it seems like you CAN have several warp files on a track, but still with implied sector linkage - the next sector in the chain is always implicitly known, no matter on which sector the file starts.

The rest seems fairly easy: Some custom encoding which can be decoded and checksummed while reading the raw data, at the expense of more format loss, which means you can store less useable data on a warp track compared to a normal one. I don't think any warp-saved file gets smaller compared to its KERNAL-formatted counterpart.
2010-04-10 14:33
Count Zero

Registered: Jan 2003
Posts: 1825
AFAIK there is just Warp25 at all. There should be no differences on saving the same file with Warp25 on several versions. It may be that the drivecode was slightly changed between 4.x and 5.x Action Replays but I am not fully aware of that. The Bank2-link above is 4.x code resourced by Crisp and MWS.

/cz
2010-04-10 17:17
TNT
Account closed

Registered: Oct 2004
Posts: 189
I have somewhere a comparison of several *25 loaders (Warp*25, VorpaLoad, Heureka and at least one more I can't remember just now - Super Snapsot?) and not so surprisingly most of them seem to be copies of each other. Decoding routines may have index registers swapped or RAW -> decoded tables altered, but they all use eight raw bits as an index to six decoded bits (extra bits set/reset depending on the index value to keep hardware happy). That makes decoding much faster than GCR, but limits bytes per sector to 240.
2010-04-10 18:40
Mr. Mouse

Registered: Dec 2001
Posts: 235
If I use vice to plug in an AR cart and warp save a test file on a d64 image, and transfer it to a c64 it works and loads, so the info on the d64 file is accurate enough to work with. Call me stupid, and I probably am, but using g64 then should not make a difference. [EDIT] I am stupid, it doesn't work with D64, never mind. :)

I've read in the original manual of the AR that warp*25 files will always be 6% larger than the original, because only 240 bytes of the 255 in the sectors contain file-data, so more sectors are needed. That rules out compression, but introduces some kind of encoding.

In the d64 image you can see that a warped file of only 8 bytes long originally has data that is about 9 or 10 bytes long. But this data is encoded somehow, perhaps as presented above. It will be interesting to find out how.

I'm wanting to find out, because I have a corrupted image of a warped file that used to work, and I want to find out where exactly things go awry when decoding those bytes, perhaps I can repair it. The BAM points to the start of these files and indeed the next sectors are probably arranged in a fixed order. I wonder if the code also checked for occupied sectors or would simply overwrite existing. If the latter is the case, then warp saving multiple large files may corrupt others.
2010-04-10 21:22
tlr

Registered: Sep 2003
Posts: 1723
@mr.mouse: so you are saying is ...
warp save (GCR, not valid block data) -> d64 -> GCR -> warp load
... doesn't lose data in the general case.
I'd say it's unlikely, but not impossible.
(it also depends on what software interprets the invalid encodings into .d64)

I think you'll find it a hard time trying to find out how .d64 data gets mapped from the custom encoding by analysing the code though.
Better start by understanding the gcr encoding, and maybe then you can prove the next step...
2010-04-10 21:24
Mr. Mouse

Registered: Dec 2001
Posts: 235
Yeah, you are right, I've tried it on other warped files, and it failed. So back to reading up on GCR and the source code.
2010-04-10 21:50
Count Zero

Registered: Jan 2003
Posts: 1825
Quote: I have somewhere a comparison of several *25 loaders (Warp*25, VorpaLoad, Heureka and at least one more I can't remember just now - Super Snapsot?) and not so surprisingly most of them seem to be copies of each other. Decoding routines may have index registers swapped or RAW -> decoded tables altered, but they all use eight raw bits as an index to six decoded bits (extra bits set/reset depending on the index value to keep hardware happy). That makes decoding much faster than GCR, but limits bytes per sector to 240.

Dig it up and pass the comparison over please!

/cz
2010-04-10 22:03
TNT
Account closed

Registered: Oct 2004
Posts: 189
I found some early notes comparing Epyx Vorpal and Datel Warp*25 drive code, here they are side by side.

First code snipped is disk reading part and related table, the second one is serial transfer and related table. Tables have unused parts blanked so you can compare them...

Sorry for missing memory locations for Vorpal code in these notes.
Vorpal                                                        Action Replay Warp*25

    BVC *                                                     05e0   50 FE      BVC $05E0
    CLV                                                       05e2   B8         CLV
    LDX $1C01                                                 05e3   AE 01 1C   LDX $1C01
    EOR $04D1,X                                               05e6   5D E4 04   EOR $04E4,X
    STA $0146,Y                                               05e9   99 46 01   STA $0146,Y
                                                              
>8:04d1 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..       04e4 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
>8:04e1 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..       04f4 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
>8:04f1 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..       0504 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
>8:0501 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..       0514 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
>8:0511 .. .. .. .. .. .. .. .. .. 00 01 02 .. 03 04 ..       0524 .. .. .. .. .. .. .. .. .. 00 01 02 .. 03 04 ..
>8:0521 .. .. 05 06 .. 07 08 .. .. 09 0a 0b .. 0c 0d ..       0534 .. .. 05 06 .. 07 08 .. .. 09 0a 0b .. 0c 0d ..
>8:0531 .. .. .. .. .. 0e 0f .. .. 20 21 22 .. 23 24 ..       0544 .. .. .. .. .. 0e 0f .. .. 20 21 22 .. 23 24 ..
>8:0541 .. .. 25 26 .. 27 28 .. .. 29 2a 2b .. .. .. ..       0554 .. .. 25 26 .. 27 28 .. .. 29 2a 2b .. .. .. ..
>8:0551 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..       0564 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
>8:0561 .. .. 2c 2d .. 2e 2f .. .. 40 41 42 .. 43 44 ..       0574 .. .. 2c 2d .. 2e 2f .. .. 40 41 42 .. 43 44 ..
>8:0571 .. .. .. .. .. 45 46 .. .. 47 48 49 .. 4a 4b ..       0584 .. .. .. .. .. 45 46 .. .. 47 48 49 .. 4a 4b ..
>8:0581 .. .. 4c 4d .. 4e 4f .. .. 60 61 62 .. 63 .. ..       0594 .. .. 4c 4d .. 4e 4f .. .. 60 61 62 .. 63 .. ..
>8:0591 .. .. .. .. .. .. .. .. .. 64 65 66 .. 67 68 ..       05a4 .. .. .. .. .. .. .. .. .. 64 65 66 .. 67 68 ..
>8:05a1 .. .. 69 6a .. 6b 6c .. .. 6d 6e 6f .. .. .. ..       05b4 .. .. 69 6a .. 6b 6c .. .. 6d 6e 6f .. .. .. ..
>8:05b1 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..       05c4 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
>8:05c1 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..       05d4 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
                                                              
    LDX $0146,Y                                               047c   BE 46 01   LDX $0146,Y
    STX $1800                                                 047f   8E 00 18   STX $1800
    LDA $0690,X                                               0482   BD 74 06   LDA $0674,X
    STA $1800                                                 0485   8D 00 18   STA $1800
    ASL A                                                     0488   0A         ASL A
    AND #$0F                                                  0489   29 0F      AND #$0F
    STA $1800                                                 048b   8D 00 18   STA $1800
                                                              
>8:0690 00 01 00 01 02 03 02 03 00 01 00 01 02 03 02 03       0674 00 01 00 01 02 03 02 03 00 01 00 01 02 03 02 03
>8:06a0 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..       0684 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
>8:06b0 04 05 04 05 06 07 06 07 04 05 04 05 06 07 06 07       0694 04 05 04 05 06 07 06 07 04 05 04 05 06 07 06 07
>8:06c0 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..       06a4 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
>8:06d0 08 09 08 09 0a 0b 0a 0b 08 09 08 09 0a 0b 0a 0b       06b4 08 09 08 09 0a 0b 0a 0b 08 09 08 09 0a 0b 0a 0b
>8:06e0 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..       06c4 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
>8:06f0 0c 0d 0c 0d 0e 0f 0e 0f 0c 0d 0c 0d 0e 0f 0e 0f       06d4 0c 0d 0c 0d 0e 0f 0e 0f 0c 0d 0c 0d 0e 0f 0e 0f
>8:0700 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..       06e4 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
2010-04-12 18:11
Count Zero

Registered: Jan 2003
Posts: 1825
TNT: Very nice - thanx a lot!

/cz
2010-04-12 21:50
Krill

Registered: Apr 2002
Posts: 2852
That leaves the question of what being first.. :) Of course, there are just so many ways to do warp-speed loading, but the similarities here are glaring.
Previous - 1 | 2 | 3 | 4 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
hedning/G★P
wbochar
zscs
chesser/Nigaz
El Jefe @ X2024
Unlock/Padua/Albion
Kakka/Extend, Damone..
Guests online: 119
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.044 sec.