Fast decompression

Página 2/2
1 |

Por Prodatron

Paragon (1788)

Imagen del Prodatron

23-10-2006, 17:40

The Crown Cruncher didn't have an own disc loader, this is still done by the OS.

Por ARTRAG

Enlighted (6323)

Imagen del ARTRAG

23-10-2006, 18:16

If I understand, the bin file is the compiled version of the encoder. It seems commented.
How do you disassembe the code ? Is there a specific format for bin files on CPC?

Por Prodatron

Paragon (1788)

Imagen del Prodatron

23-10-2006, 18:29

Sorry, I missunderstood you. CPC bin files have a 128byte header. Most stuff inside the headers are senseless, but these are the three important words:
#15: Loading address
#18: Length
#1a: Autostart address
So if the user types RUN"file.bin" Amsdos loads the data behind the 128byte header at address (#15) and does a CALL to (#1a) after this.

Por ARTRAG

Enlighted (6323)

Imagen del ARTRAG

23-10-2006, 18:30

great
thanks

Por dvik

Prophet (2200)

Imagen del dvik

23-10-2006, 19:16

@Prodatron: Thanks. I just took a quick look at the decruncher. It looks like the compression rate may not be as high as bitbuster, but on the other hand it looks faster. For my little app, speed is more important so I'll try to modify it to out the data instead of unpacking to ram.

@ARTRAG: Here is my decoder. Its quite simple so I think you'll understand how the data is being packed. As I said, its not that generic but fits my data pretty well.

; Unpacks 256 bytes of data located at HL to the VRAM at DE
depack:                 
        ld      a,e
        out     [$99],a
        ld      a,d
        and     $3f
        or      $40
        out     [$99],a
        ld      c,$98

        xor     a               ; Make sure we get a reload on the
                                ; byte with bits
        ld      b,a             ; Reset loop counter (this routine
                                ; unpacks 256 bytes but that could
                                ; easliy be changed
.Loop:
        add     a,a             ; Get next bit
        jp      nz,.NoReload    ; If byte with bits is zero, get next
        ld      a,(hl)
        inc     hl
        add     a,a             ; Get next bit in new byte
.NoReload:
        jp      c,.NoNewVal     ; If high bit was set, we have a new
                                ; value, else the old value is outed
        ld      d,(hl)
        inc     hl
.NoNewVal:
        out     (c),d           ; Out the value

        djnz    .Loop           ; Continue loop
        ret   

Por ARTRAG

Enlighted (6323)

Imagen del ARTRAG

23-10-2006, 19:43

60Kbps? Humm....

full screen 2 B/W at 10fps = 60Kbps
or
full screen 2 full color at 5 fps = 60Kbps
or
half screen2 (128x192) full color at 10fps = 60Kbps

Smile

Por dvik

Prophet (2200)

Imagen del dvik

23-10-2006, 19:57

@ARTRAG: Its something better than that Smile But you have to wait a while before we have something to show...

Página 2/2
1 |