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


Forums > CSDb Discussions > Self extracting decrunchers and low memory
2018-01-18 13:02
ChristopherJam

Registered: Aug 2004
Posts: 1370
Self extracting decrunchers and low memory

If you're using a cruncher to create a self extracting .prg, do you care whether or not it disables the system IRQ and/or scribbles over low memory?

I'm about to add an executable output option for nucrunch, and so I was wondering what would make it most useful to others; if I copy the ~400 bytes the decruncher occupies down to $0200 I could then support decoding to $0801+

(Not sure which forum this lives in; happy for the mods to move it if appropriate obviously).
2018-01-18 13:32
Krill

Registered: Apr 2002
Posts: 2821
Disabling the system IRQ while decrunching the executable is de facto standard behaviour.

Then try to use as much as possible of the stack, and make sure to preserve at least the vectors around $0300-$0330.

This just off the top of my head, there may be other important values in $0200-$0400. Refer to http://unusedino.de/ec64/technical/aay/c64/zpmain.htm .

Speaking of $0400, running the decruncher at $0400-$0800 is not an option?
2018-01-18 13:38
Krill

Registered: Apr 2002
Posts: 2821
Ah, preserving this:
$0286/646 Current Character Color code
sounds like a good idea.

And IIRC, one of the other variables must have a specific value in order for KERNAL load to work. Maybe it was
$0285/645 Serial IEEE Bus timeout defeat Flag
or one of the RS232 variables.
2018-01-18 13:55
Didi

Registered: Nov 2011
Posts: 478
Most crunchers use tape buffer $0334-$0400 and stack. Messing the zeropage should be done carefully.
2018-01-18 14:26
ChristopherJam

Registered: Aug 2004
Posts: 1370
Ah, excellent. Tape buffer plus stack is heaps of space. I was starting to consider seeing if there was 400 bytes of zeros anywhere in or after the file to be compressed, but this is much easier.

I'd rather not blat 0400-0800; it looks untidy to me, and precludes people doing their own transitions.
2018-01-18 14:34
ChristopherJam

Registered: Aug 2004
Posts: 1370
Next question, only slightly off topic...

Zeroing unused memory in between &/or after the provided sections to compress - yes/no?

I already take a list of .prgs to include so people can leave out memory they don't care about, but even given that I was thinking I should autodetect included runs to avoid the wrath of Ian Coog.

Perhaps I should just default to zeroing everything north of 0800 that's not otherwise specified? There'd the an added bonus of reducing the chance of demos accidentally relying on uninitialised RAM, too.
2018-01-18 14:47
iAN CooG

Registered: May 2002
Posts: 3132
=)
Exomizer zeroes the mem between different sections because it callocs a 64k array before loading into it the sections, some other old native linker/packer left garbage in the space between linked sections if the crunched data was already in those areas (example: you link 2 sections 0801-0fff and $c000-cfff, the packed file occupies $0801-$2000, when depacking you'll end up with $1000-$2000 still filled with the leftover packed data).
So all depends what one needs to do.
2018-01-18 15:13
ChristopherJam

Registered: Aug 2004
Posts: 1370
Ah, so it's mostly an implementation side effect, and not something you can disable? Interesting. Doesn't sound like it's done exo's popularity any harm.

I hadn't really thought about the garbage issue, that's a good point. Something I should watch out for, really.

Thanks all.
2018-01-19 16:05
Didi

Registered: Nov 2011
Posts: 478
For the filling of space I'd opt for default filling it with zeros but an option to leave memory as is in these places might be useful in some cases.
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
Ghost/Quantum
Exploding Fi../Techn..
Sentinel/Excess/TREX
Mr. SID
Bacchus/FairLight
Acidchild/Padua
psych
Guests online: 172
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 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.9)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Jeroen Tel  (9.7)
3 Stinsen  (9.6)
4 Mutetus  (9.6)
5 Linus  (9.6)

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