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


Forums > C64 Coding > Cruncher Plugins + Exomizer + Krill's Loader
2025-03-20 13:57
Sabbi

Registered: Jan 2002
Posts: 13
Cruncher Plugins + Exomizer + Krill's Loader

Hi Guys,

Currently pulling my hair with Kick Assembler Cruncher Plugins & Exomizer....

My goal is easy(?) - crunching "a.prg" ($9d00-$cfff) with Exomizer & loadcmp it with Krill's Loader.

If I compress with Exomizer manually (exomizer.exe mem -f -o compressed.prg a.prg), everything works fine, loads and decompresses without any issues.


Now I just try to do the same inside Kick Assembler with the Cruncher Plugins:
---------------------------------------
.plugin "se.booze.kickass.CruncherPlugins"

.disk [filename="lazy.d64", name="A", id="1"]
{
[name="TEST", type="prg", segments="Main", modify="B2exe", _jmpAdress=start],
[name="CP", type="prg", segments="CompressTest"],
}


.var a = LoadBinary("a.prg", BF_C64FILE)

.segment CompressTest [start = $9d00] // ???
.modify MemExomizer(true,false)
{
.pc = $9d00 // ??
.fill a.getSize(), a.get(i)
// .import c64 "a.prg"
}
---------------------------------------

A compressed file gets generated and stored to the d64, but it's not loadable/decompressable.


I've tried all possible combinations (MemExomizer, BackwardMemExomizer, ForwardMemExomizer, true/false, direct in .disk ([name="CP", type="prg", prgFiles= "a.prg", modify="ForwardMemExomizer"]).

Can't seem to find the right settings for start or PC, the generated file has a loading address of $9d00, instead of somewhere around $c600 which has the file created with Exomizer directly.

What am I missing? If it's even possible, there has to be a simple fix for this :) Any help is much appreciated!

Thanks!
2025-03-21 09:10
Krill

Registered: Apr 2002
Posts: 3070
As no further processing is required on the crunched Exomizer output file, can't you just invoke Exomizer "directly" from your KickAss script and be done with it?

And the usual framing challenge: Why must it be Exomizer in the first place?
Its decruncher is among the slower ones, and with things like Dali/ZX0 you can expect a lot higher combined loading+decrunching speeds at a very similar compression ratio on average, plus full in-place decrunching.
2025-03-21 13:06
tonysavon

Registered: Apr 2014
Posts: 27
The plugin only supports exomizer and B2.
I don't know java and never made it to change the plugin to support other crunchers, but you can force it to use an external executable for exomizer. Since I want to use my own tscrunch with this awesome plugin, the trick I used was to compile a special version of TScrunch with same "interface" as exomizer. So the plugin thinks it's using exomizer when it's really using TSCrunch.
2025-03-21 13:27
Krill

Registered: Apr 2002
Posts: 3070
Quoting tonysavon
The plugin only supports exomizer and B2.
Ah well, the loader supports B2 as well. =)

What's the purpose of this plugin?
And why would one need it to generate packed files on a disk image?
2025-03-21 14:02
tonysavon

Registered: Apr 2014
Posts: 27
For assets it doesn't offer much advantages over a well designed build script, but for code it's invaluable. I've used this plug in all my games. Take for instance L'abbaye does mortes: each room has its specific custom code. That code is crunched, and it's decrunched at runtime upon entering a room. The room code references main code and viceversa, so you can't (easily) build , say, room32.prg, crunch it and import the crunched file into your main as you would do with an asset.
With the plugin you can code all of the room specific code as if it was uncompressed.
2025-03-21 15:52
Jetboy

Registered: Jul 2006
Posts: 354
Quoting tonysavon
The room code references main code and viceversa, so you can't (easily) build , say, room32.prg, crunch it and import the crunched file into your main as you would do with an asset.


Why not? I’m trying to come up with some worthy reasons and i cannot find any.

Quote:
With the plugin you can code all of the room specific code as if it was uncompressed.


How would you even write code as it was compressed? That would be something few grades above average demo coder.
2025-03-21 16:21
Krill

Registered: Apr 2002
Posts: 3070
Quoting Jetboy
Quoting tonysavon
The room code references main code and viceversa, so you can't (easily) build , say, room32.prg, crunch it and import the crunched file into your main as you would do with an asset.


Why not? I’m trying to come up with some worthy reasons and i cannot find any.
Me neither. :)

I'd go for ca65 + ld65 with overlays, should be no problem to have all code portions reference each other.

But back to the OP:

Sabbi, what is it that you _actually_ want to achieve? =)
2025-03-21 16:55
Sabbi

Registered: Jan 2002
Posts: 13
Quote:
Sabbi, what is it that you _actually_ want to achieve? =)


Thanks :) Just for my own personal (flawed) workflow it would be nice to use those cruncher plugins, simple as that.

So I could just place an prg somewhere, and it exomizes inside Kick Assembler (so to speak) and gets put on a .d64 without any additional scripting other than the one in the .asm-File itself.

If it's possible with those plugins nice, if not, I know there are other solutions.
2025-03-22 05:36
Martin Piper

Registered: Nov 2007
Posts: 739
It would be better to use a known working external tool to compress the data, then another known working tool to construct the D64 with the files you need. Trying to do it all in the assembler isn't a good workflow, as you've found out.
2025-03-23 09:32
Slammer

Registered: Feb 2004
Posts: 435
I tend to disagree that building disk images from the assemebler is flawed - its simply a matter of taste and what suits your needs and yes, you have to use a combination of tools that suits your purpuse.

I don't know the detail of Krills loader and exomizer, but I can help with the KickAss part and give a couple of pointers.

First of all, if you are just compressing files, you don't have to define segments explicitly. Just do it as onelines like this:

	
.plugin "se.booze.kickass.CruncherPlugins"
.disk [filename="lazy.d64", name="A", id="1"]
{
   [name="UNCOMPRESSED", type="prg", prgFiles="a.prg"]
   [name="BYTEBOOZER",   type="prg", prgFiles="a.prg", modify="B2exe",  _jmpAdress=$0900],
   [name="EXOMIZER",     type="prg", prgFiles="a.prg", modify="MemExomizer", _forwardCrunching]
}


This is also the way to go, if you use it like a stand-alone tool.

Now, about exomizer. I did a quick little test where I converted Krills code from the exomizer-repo to a KickAssembler macro (ExoDecrunch). The following crunches a sidfile while assembling, and decrunches&play it when running.

	.segment DecrunchAndPlaySid [outPrg="CrunchedAlibi.prg" ] 
	:BasicUpstart2(start)
	start: 
	    sei
	    jsr exo.decrunch

	    // Init and play
	    lda #0
	    tax
	    tay
	    jsr $4000     

	l:  lda #$f0 
	    cmp $d012
	    bne *-3
	    inc $d020
	    jsr $4006
	    dec $d020
	    jmp l
	    
	// Decrunch
	exo: ExoDecrunch(data)

	// Crunched data 
	data: .segmentout [sidFiles="Resources/Alibi.sid", modify="MemExomizer", _forwardCrunching]


This worked witout problems, so the correct unpack addresses gets included in the crunchdata.

What exomizer version are you using. When I read Ruk's documentation Exomizer3 is not the default setting (Krill, Do you expect V3 these days?)
2025-03-23 13:02
Sabbi

Registered: Jan 2002
Posts: 13
Thanks Slammer,
 [name="EXOMIZER",     type="prg", prgFiles="a.prg", modify="MemExomizer", _forwardCrunching] 

This creates a file which is exomized, but with a load address of $0002 - maybe the Cruncher plugins just can't handle this case?
 
... 10 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
eryngi
E$G/HF ⭐ 7
Guests online: 132
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.6)
4 Coma Light 13  (9.6)
5 Codeboys & Endians  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Comaland 100%  (9.6)
9 What Is The Matrix 2  (9.6)
10 Uncensored  (9.6)
Top onefile Demos
1 Scan and Spin  (10)
2 At the Cinema  (9.8)
3 Nine  (9.8)
4 Layers  (9.6)
5 Cubic Dream  (9.6)
6 Party Elk 2  (9.6)
7 Datastiltje 2014 Win..  (9.5)
8 Copper Booze  (9.5)
9 Onscreen 5k  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Artline Designs  (9.4)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Musicians
1 Conrad  (9.7)
2 Reyn Ouwehand  (9.7)
3 Stinsen  (9.7)
4 LMan  (9.7)
5 Rob Hubbard  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.062 sec.