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 > Pack chunks and depack anywhere EXOMIZER
2018-02-18 21:16
Golara
Account closed

Registered: Jan 2018
Posts: 212
Pack chunks and depack anywhere EXOMIZER

I have a question about the exomizer. In my demo part there's a lot of empty bytes between specific parts. For example, my code starts at $0801 and ends at about 2500, my music is at 2700, then i put stuff in the vic bank $4000, inside the bank i skip forward to $5000 to load bitmap etc...

Of course exomizer is quite good at packing this anyway, since it's just zeros, but I'm sure it can be better. I could put all my data back to back, compress that, extract and then copy it where I want it, but I'm sure there's an option to pack the stuff separatelly and just extract it to a specific address. The question is, how do you do it ? I can't find any exomizer tutorials or documentation except on how to do a basic sfx program.

This is what I'm looking for more or less

*=0801
; the addres of packed stuff
; and destination on some ZP addr
lda #<packed_for_0x1000
sta $10
lda #>packed_for_0x1000
sta $11
lda #$00
sta $12
lda #$10
sta $13
jsr depacker
; depack next stuff
lda #<packed_for_0x4000
sta $10
lda #>packed_for_0x4000
sta $11
lda #$00
sta $12
lda #$40
sta $13
jsr depacker
; depack next stuff
lda #<packed_for_0x6000
sta $10
lda #>packed_for_0x6000
sta $11
lda #$00
sta $12
lda #$60
sta $13
jsr depacker
depacker:
!binary depacker.bin
;-------
packed_for_0x1000:
!binary some_stuff_for_0x1000.bin
packed_for_0x4000:
!binary some_stuff_for_0x4000.bin
packed_for_0x6000:
!binary some_stuff_for_0x6000.bin
....
2018-02-18 21:28
chatGPZ

Registered: Dec 2001
Posts: 11386
no point, the few bytes you will gain will be eaten up by additional depack effort
2018-02-18 21:28
iAN CooG

Registered: May 2002
Posts: 3193
If you move things around, why even bothering? Just let exomizer do its job, pack everything as a single prg.
2018-02-18 22:01
Golara
Account closed

Registered: Jan 2018
Posts: 212
Ok if you say so. But I'd like to know how to do this anyway in case I wanted to do let's say a single file demo with different effects. So I have let's say the depacker, 3 8kb binary blobs. How to depack them one after the other. (each packed part would have the call to the depacker in it, the depacker would be present in memory all the time)
2018-02-18 22:32
ChristopherJam

Registered: Aug 2004
Posts: 1409
NuCrunch 0.1 does some of what you want; you give it a list of lists of .prgs, and each call to the decruncher unpacks a set of .prgs to their required locations.

But at the moment it doesn't do any checks for overwriting data it hasn't read from yet, and nor does it produce the final .prg for you; just a block of compressed data, and source for the decrunch routine that you need to assemble and put somewhere useful yourself. Adding a few of those is on my list of things to do Real Soon Now (hopefully sometime the next two to four weeks??); if nothing else I'd find them useful for my own productions..
2018-02-18 22:41
cadaver

Registered: Feb 2002
Posts: 1160
It's easier if you use forward mode. In that case, you can strip the first 2 bytes from the Exomizer output (which are the destination address, contained in the output itself) and modify the Exomizer decrunch routine to only read zp_bitbuf in the beginning, by changing the ldx #3 to ldx #1. Now you can write zp_dest_lo & zp_dest_hi with the destination address you wish, before calling the decrunch.
2018-02-19 08:27
Oswald

Registered: Apr 2002
Posts: 5094
arent level packers for this kind of shit ?
2018-02-19 08:42
oziphantom

Registered: Oct 2014
Posts: 490
exomizer mem -q -l $0700 -o dest.exo src.prg
or
exomizer mem -q -l none -o dest.exo src.prg

You then need to have the emoxiser depack routine which in one of the folders with exomiser, to which you set the get byte address in the function and call depack.
2018-02-19 09:11
Zirias

Registered: Jan 2014
Posts: 48
It's actually quite simple using the exomizer mem command, every crunched file will include the decrunching target address. I currently do something similar like this:

.import decrunch
.import start
.export get_crunched_byte

                ; BASIC PRG header
		.word	$0801
		.word	$080b
		.word	2018
		.byte	$9e
		.byte	"2061",$0,$0,$0

                ; disable system IRQ
		lda	#$7f
		sta	$dc0d
		lda	$dc0d

                ; all RAM for the part going to D000
		lda	#$30
		sta	$01
		jsr	decrunch

                ; re-enable I/O area
		lda	#$35
		sta	$01
		jsr	decrunch
		jsr	decrunch
		jsr	decrunch
		jsr	decrunch
		jmp	start

get_crunched_byte:
		lda	_byte_lo
		bne	_byte_skip_hi
		dec	_byte_hi
_byte_skip_hi:
		dec	_byte_lo
_byte_lo = * + 1
_byte_hi = * + 2
		lda	end_of_data
		rts

.incbin "part4000.exo"
.incbin "part5000.exo"
.incbin "part8000.exo"
.incbin "partc000.exo"
.incbin "partd000.exo"
end_of_data:	.res	0


This is just slighly modified from original exomizer example code. Note that the last included binary will be unpacked first.
2018-02-19 10:41
Cruzer

Registered: Dec 2001
Posts: 1048
Quoting Groepaz
no point
Quoting iAN CooG
why even bothering?
To save time by not zerofilling areas that don't need to be zerofilled?
2018-02-19 14:19
cadaver

Registered: Feb 2002
Posts: 1160
Yeah, if it's OK that a specific compressed chunk is always depacked to the same address, then disregard my advice on the modification and stripping, and follow just the advice on the mem command (as given by others). I just took literally the requirement to specify the destination address in code at runtime.
 
... 8 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - 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
Flashback
wil
LightSide
St0rmfr0nt/Quantum
Paladin/G★P
RetroGL
Nith/TRIɅD
CreaMD/React
pcollins/Quantum
Guests online: 81
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 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (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 Triad  (9.3)
5 Censor Design  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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