#526 - mentz - Wed Jan 08, 2003 1:28 pm
Hi,
I'm searching (if exists) for a tool that compress and decompress the strange lzxx routine (for GBA).
Thanks to all and sorry for may bad english....
_________________
xXx
#552 - JSensebe - Wed Jan 08, 2003 7:42 pm
My GBA Crusher can compress data using algorithms compatible with the GBA BIOS routines. It comes in two versions, a GUI version and a console version suitable for use in makefiles.
#563 - arog - Wed Jan 08, 2003 8:53 pm
Is there any documentation for GBA Crusher? I didn't
see any on your website.
- Aaron Rogers
HAM Tutorial
#577 - JSensebe - Wed Jan 08, 2003 9:43 pm
Just type "GBACrusherCL" at the prompt, and you'll get a list of options. There really isn't that much to it. ;-)
#646 - coca77 - Thu Jan 09, 2003 11:54 am
Thanks for that tool, thought I was gonna have to go and code my own for a while.
#650 - mentz - Thu Jan 09, 2003 12:03 pm
Wow that GBA Crusher is Amazing !!
But how can i decompress the file using the same gba-bios-routines ??
_________________
xXx
#776 - anli - Fri Jan 10, 2003 3:44 pm
Put this in an assembler file:
.GLOBAL LZ77UnCompVram
.GLOBAL LZ77UnCompWram
LZ77UnCompVram:
swi 18
bx lr
LZ77UnCompWram:
swi 17
bx lr
This file is assembled like this:
For arm mode:
as -marm7tdmi file.s
For thumb mode:
as -mthumb file.s
This produces a file.o.
Now add this to your C code:
extern void LZ77UnCompWram(void *src, void *dest);
extern void LZ77UnCompVram(void *src, void *dest);
Now, you have two extra functions to play with. The "V" version is
used when you are decompressing to video memory.
Dont forget to add file.o on the command line to your linker.
#786 - mentz - Fri Jan 10, 2003 5:49 pm
thank you very much.............i will try....
_________________
xXx
#791 - lordmetroid - Fri Jan 10, 2003 6:18 pm
useing compressed data will use some extra cycles right?
or does it uncompress in hardware?
_________________
*Spam*
Open Solutions for an open mind, www.areta.org
Areta is an organization of coders codeing mostly open source project, but there is alot of sections like GBA dev, Language learning communities, RPG communities, etc...
#792 - anli - Fri Jan 10, 2003 6:26 pm
It is decompressed with code in bios, so its a software decompression.
And it is really slow.
But it works
:)
One thing that I forgot to mention before is that it is important that the source buffer is on an address that is divisable with 4.
Before I knew that, I was trying to decompress bitmapped pixel data that only rendered a black screen. Then I saw that the address wasnt divisable with 4. When I changed the alignment, it worked.
If you are using the bin2o utility, that I have written, you can use the argument /align=4.
/anli
#794 - Touchstone - Fri Jan 10, 2003 6:28 pm
The decompression is done by hardware but it ain't free because of that. It was a while since I tested the decompression and I've lost the results so I can't tell you how long it takes, I'm sorry.
_________________
You can't beat our meat
#795 - anli - Fri Jan 10, 2003 6:32 pm
Hey!
It is a BIOS routine that does the decompression!
/anli
#796 - Touchstone - Fri Jan 10, 2003 6:35 pm
Ooh, I got my bits mixed up, sorry about that. :) The decompression is not done by the hardware but the software that does the decompression is stored in the gba firmware.
_________________
You can't beat our meat
#2536 - MayFly - Thu Feb 06, 2003 12:52 am
While playing with the BIOS compression calls I?ve come across something that mystifies me.
My code works correctly under VisualBoyAdvance 1.3.1, but when I try the binary in my actual GBA with the FLASH cart all I see is a blank screen.
Here?s a synopsis of the process I use:
1: Convert my 240x160 (8 bit) image using Bimbo version 1.3 to a binary (say mona.bin)
2: Use GBACrusher version 0.1.1.10 with the LZ77, VRAM safe option (to create compmona.bin)
3: Use Anli?s obj2bin v1.0 as follows:
obj2bin /align=4 /interwork /const compmona.bin mona.o mona
4: When it?s time I called the code:
LZ77UnCompVram((u16*)mona, VideoBuffer);
I made sure the source address is divisible by 4.
Can you suggest what I?m missing, or doing wrong?
Thanks,
MayFly
#2556 - anli - Thu Feb 06, 2003 9:19 am
Hello!
Did you use the "video safe" compression option in gbacrusher?
/anli
#2557 - Splam - Thu Feb 06, 2003 10:04 am
Quote: |
2: Use GBACrusher version 0.1.1.10 with the LZ77, VRAM safe option (to create compmona.bin)
|
;)
#2611 - MayFly - Sun Feb 09, 2003 2:00 am
Hi Guys,
First off, thank you for releasing GBAcrusher and bin2o: they are excellent utilities and we're (at least me and other GBA programmers) are better for it.
After doing some more research, consulting and digging around I found out what was wrong.
I used Anli's suggested code meantioned earlier in this thread. The assumption was the assembler code was targeted as THUMB (I think). In my project I was using the -thumb-interwork switch for the C and assembler code.
The addresses called must be left shifted 16 bits (at least in ARM so I understand).
When I changed swi 0x12 to swi 0x120000 the issue was resolved.
I thought -thumb-interwork switch created THUMB code unless you specify address space in the IRAM. D'oh!
With all the issues I'm having/learning about programming this wonderful device I'm contimplating the creation of a GBA programming wtf FAQ. I imagine it could save folks a lot of grief.
Thank you all.
Regards,
MayFly
#2712 - dummer Anf?nger - Tue Feb 11, 2003 11:09 am
Hmm ... i had much trouble about using lzss into my photoshop filter because the gba seems to kill colours while decompressing.
I dont found working way to use it for mode 4 or 3 bitmaps...
_________________
... but im just a dummy Newbie
(sorry for my terrible english)
#2714 - anli - Tue Feb 11, 2003 11:14 am
You have to use video safe compression, which is an option in gbacrusher.
/anli