Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Decrunching from ram with Exomizer 1.1.5
2007-04-29 08:50
Mantiz
Account closed

Registered: Apr 2006
Posts: 36
Decrunching from ram with Exomizer 1.1.5

Howdy!

I have tried to study the tutorial for quite a long time how to decrunch and run a file from ram with Exomizer, and I've reached a point where I just about have had enough. I just don't get it. The docs and decruncher sources are like hebrew with a lot of text but makes very little sense to me. Implement a get_byte routine? zp_len_lo? I admit I have always had difficulties to understand other peoples code most of the time so that could be a big part of the problem I'm having. Okay okay, I've had problems understanding my own code too but that's another story :)

I've got a file which I have crunched with the -l parameter and put it at $9000. At some point in a demopart (like pressing space or whatever), I would like to call the decruncher to work on that data and the execute the results. I understand I have to put the decruncher in a safe area which won't be overwritten. The uncrunched data will fit between ~0800-~8000 something. But how to feed the decruncher with the location and range of the data that it should decrunch and where the results should go? And how do I get the thing to cooperate? :)

Many thanks,
Mantiz
2007-04-29 09:25
Mace

Registered: May 2002
Posts: 1799
Did you check the source code?

; zero page addresses used
; -------------------------------------------------------------------
exod_zp_len_lo = $a7

exod_zp_src_lo  = $ae
exod_zp_src_hi  = exod_zp_src_lo + 1

exod_zp_bits_hi = $fc

exod_zp_bitbuf  = $fd
exod_zp_dest_lo = exod_zp_bitbuf + 1	; dest addr lo
exod_zp_dest_hi = exod_zp_bitbuf + 2	; dest addr hi

exod_tabl_bi = exod_decrunch_table
exod_tabl_lo = exod_decrunch_table + 52
exod_tabl_hi = exod_decrunch_table + 104

This looks like you have to put the 'source' in $ae/$af and the destination in $fe/$ff.
2007-04-29 10:04
Raf

Registered: Nov 2003
Posts: 343
now I don't remember how it all looked like exactly , but I used exo 1.1.5 in '69 positions' so you may have a look into source code I released - it works okay in the collection - I load packed music using fastload to $c100 or so and then I do memory-to-memory unpack (music is placed @ $1000)
However I remeber that one address in original depacker's soure has got reversed lo/hi nibble ;-) this confused me a lot when I started using exomizer.

www.vulture.c64.org
2007-04-29 10:21
cadaver

Registered: Feb 2002
Posts: 1160
No, you don't have to put anything into the ZP variables, as src/dest addresses are contained within the crunched datastream. Just make sure you don't use those areas for something important you need preserved, and that there's enough space reserved for exod_decrunch_table (all 3 sub-tables are same size, so 156 bytes total). Isn't there a sample getbyte routine? Like..

getbyte:
lda $9000
inc getbyte+1
bne getbyte_ok
inc getbyte+2
getbyte_ok:
rts

So the idea is to return the next byte of datastream in A and you're not allowed to touch the carry flag.

I never remember though, if you should use the forward- or backward-crunching datastream, and if it has changed in new exomizers. In old versions it was backwards I think. But you can try both until it works :)
2007-04-29 11:41
Mantiz
Account closed

Registered: Apr 2006
Posts: 36
You guys are simply the best. I finally got it to work.

Mace: I had read the sourcecode but I didn't get much smarter from that. The zeropage adresses confused me a lot, I didn't understand they were handled automatically by the datastream so I got very frustrated since it crashed no matter how I'd set them up.

Raf: Very kind of you to share the whole source to the public. And I must tell you that even if my Polish could need some polishing (oh how funny I am), I really see that one day I need to learn to write more structured sources. The stuff I write ends up in a mess within the main file.

Cadaver, finally: You helped me understand my biggest error I made from the whole beginning. It was indeed a backwards crunched datafile you needed to make it work with no mysterious crashes.

I owe you all a big thank you.
/Mantiz
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
BYB/Hokuto Force
megasoftargentina
DKT/Samar/sidDivers
Murphy/Exceed
t0m3000/hf^boom!^ibx
LightSide
Raf/Vulture Design
zscs
Guests online: 104
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Graphicians
1 Mirage  (9.8)
2 Archmage  (9.7)
3 Pal  (9.6)
4 Carrion  (9.6)
5 Sulevi  (9.6)

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