#152743 - Dwedit - Thu Mar 20, 2008 9:40 am
How hard would it be to modify the CRT0, Linkscript, and makefile to apply compression on any code which is loaded into RAM?
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
#152806 - strager - Fri Mar 21, 2008 12:23 am
Dwedit wrote: |
How hard would it be to modify the CRT0, Linkscript, and makefile to apply compression on any code which is loaded into RAM? |
No. It's certainly possible; it's been done before (though NDA says I cannot say where).
#152808 - Miked0801 - Fri Mar 21, 2008 1:14 am
Compressing code is usually a last resort tactic. Are you really that short on RAM that you need to deal with all the BS that is comp/uncomp code all over the place?
#152811 - eKid - Fri Mar 21, 2008 1:52 am
I did it a few times :). What I did was modify the linkscript to put all RAM sections into one big section at the end. Then I objcopy'd that section from the elf, ran gbalzss on it (i used lz77 compression). Then I objcopy'd the other sections, and appended my compressed section. After that i can just use the LZ77 swi to decompress into ram.
I only did this on small ASM only projects, never C. Also, the LZ77 compression didn't really save much space.. :(
#152815 - tepples - Fri Mar 21, 2008 3:24 am
I wonder how hard it would be to add mb.gba and .nds to UPX.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#152817 - eKid - Fri Mar 21, 2008 3:50 am
That would be interesting... But how big is the UPX decompressor itself? :)
#152831 - tepples - Fri Mar 21, 2008 1:06 pm
For x86, the UPX decompressor is less than a kilobyte. I don't know how big it is for Thumb. But I saw on upx.sf.net that it already exists for at least some ARM executable formats, which is why I suggested it.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#152844 - Miked0801 - Fri Mar 21, 2008 4:29 pm
PUCrunch is still the best GBA compressor I know of.