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 > CSDb Discussions > Self extracting decrunchers and low memory
2018-01-18 13:02
ChristopherJam

Registered: Aug 2004
Posts: 1408
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: 2968
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: 2968
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: 486
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: 1408
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: 1408
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: 3186
=)
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: 1408
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: 486
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
CA$H/TRiAD
REBEL 1/HF
cba
SoNiC/Onslaught/tOM
krissz
Airwolf/F4CG
Mojzesh/TGR🇬🇧
Fred/Channel 4
rambo/Therapy/ Resou..
Guests online: 110
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Wonderland XIV  (9.6)
8 Comaland 100%  (9.6)
9 No Bounds  (9.6)
10 Christmas Megademo  (9.5)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Morph  (9.5)
9 Dawnfall V1.1  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Censor Design  (9.3)
Top Logo Graphicians
1 t0m3000  (10)
2 Sander  (9.8)
3 Mermaid  (9.5)
4 Facet  (9.4)
5 Shine  (9.4)

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