gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Self decompression program works--snip--

#79210 - Dwedit - Wed Apr 12, 2006 3:58 am

I'm working on writing a self-decompression program, which would allow a compressed GBA rom to decompress itself to the 32MB of RAM found on an M3, G6, or SuperCard. I'm completely perplexed that the program doesn't work on the M3, but I've built a special version of VisualBoyAdvance which allows writes to the ROM area, and it works fine in that.

If you want to try out the stub program, compression tool, or special VBA, let me know.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."


Last edited by Dwedit on Fri Apr 14, 2006 11:38 pm; edited 1 time in total

#79242 - tepples - Wed Apr 12, 2006 12:58 pm

In what way does it "not work"? Perhaps the RAM unlocking code isn't correct.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#79264 - Dwedit - Wed Apr 12, 2006 3:47 pm

The RAM unlocking code seems to work fine. After doing the unlock, I verify that ram is writable by writing 0xDEADBEEF to address 0x09876540, and that works. It seems that the M3's loader software tends to behave like One of these programs, but now it appears that good old fashioned BUGS (on my part) may be preventing the program from working.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#79265 - wintermute - Wed Apr 12, 2006 3:50 pm

You'll need to use VRAM safe compression and decompression. GBA cart space can't be written in 8bit increments either.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#79266 - Dwedit - Wed Apr 12, 2006 3:58 pm

I fixed a few bugs in the custom VBA, now it behaves just like the M3.

Looks like this code to write streaming bytes to vram type memory was probably incorrect:
Code:

   tst dest,#1
   streqb temp,[dest],#1
   ldrneb sbdata,[dest,#-1]!
   orrne sbdata,sbdata,temp,lsl#8
   strneh sbdata,[dest],#2

_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#79343 - swimgod - Thu Apr 13, 2006 1:26 am

dwedit,
your program at first does not work
when i compress it and try it on supercard,
then i sent it through their patcher,
then i gives me
"SuperCard
AP32
Copying<red screen during this>
decompressing<blue screen during>
<then black and nothing else and seems to be frozen >.<;>"

whats wrong?
_________________

1x WII 2x remotes
2x NDS/L(FMv7-ORG:v4,FMv7-org:DSL)
1x GBAMP
2x 1gb (MicroDrive{typeII}&SanDisk{typeI})
1x SuperPass2
1x Supercard-CF

MoonShell skins

#79357 - Dwedit - Thu Apr 13, 2006 3:53 am

What's wrong is that my program is buggy and broken. I'll go post the fixed version here once it works.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#79359 - swimgod - Thu Apr 13, 2006 4:17 am

thanks dwedit,
i hope this project is sucessfull :D
maybe it will convince more people to take advantage of the ram avalible :).
might as well use the ram in the m3 and supercard,
or else the power is just being wasted :P,

(maybe i should come up with a hard ware hack to turn off sram,
so you don't waste power?,
that would be nice conserving tool :D)
_________________

1x WII 2x remotes
2x NDS/L(FMv7-ORG:v4,FMv7-org:DSL)
1x GBAMP
2x 1gb (MicroDrive{typeII}&SanDisk{typeI})
1x SuperPass2
1x Supercard-CF

MoonShell skins

#79645 - Dwedit - Fri Apr 14, 2006 11:40 pm

Fixed the problem, I missed one of the writes and failed to make it VRAM safe like I did with all the rest. Fixed.

Here's the self extractor tool!
http://home.comcast.net/~alanweiss3/dwedit/files/decomp_stub.zip

And here's the special version of VBA which supports writing to rom:
http://home.comcast.net/~alanweiss3/dwedit/files/vba_romwrite.7z
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."