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.

Beginners > Compressed graphics formats

#5358 - gimp - Sat Apr 26, 2003 12:08 am

Hi

I'm looking into developing for the gba and have a question regarding graphics which I couldn't find answers to anywhere around here.

See, only having 32MB available cart storage place freaks me out, can the gba use any compressed graphics formats?

Thanks,
Erik

#5360 - niltsair - Sat Apr 26, 2003 12:52 am

There's some Bios function to compress data that i haven't tried. But i think their result are so-so.

The alternative is to write code that can decode compressed format, be it your own format , or JPeg, Gif, etc..

#5362 - Dae - Sat Apr 26, 2003 1:29 am

Here's some code for you. Use GBACrusher to compress files on the pc.

Code:

.GLOBAL LZ77UnCompVram
.GLOBAL LZ77UnCompWram
.GLOBAL HuffUnComp
.GLOBAL RLUnCompVram
.GLOBAL RLUnCompWram

LZ77UnCompVram:
swi 0x120000
bx lr

LZ77UnCompWram:
swi 0x110000
bx lr

HuffUnComp:
swi 0x130000
bx lr

RLUnCompVram:
swi 0x150000
bx lr

RLUnCompWram:
swi 0x140000
bx lr


Code:

extern void LZ77UnCompWram(void *src, void *dest);
extern void LZ77UnCompVram(void *src, void *dest);
extern void HuffUnComp(void *src, void *dest);
extern void RLUnCompWram(void *src, void *dest);
extern void RLUnCompVram(void *src, void *dest);