#3254 - CoolMan - Fri Feb 21, 2003 5:39 am
Okay, I'm trying to decompress some lz77 compressed arrays via bios calls, and I've discovered that gcc 3.1 (devkitadv for linux) is NOT aligning my data to word boundries.
(GBA is 32-bit words, which is 4 byte, which is why I keep hearing that the addy of your compressed data must be divisable by 4... right?)
I wrote a simple catch.
This worked at one point, but now my linker suddenly feels like mis-aligning all of this stuff...
So, my questions is, how do I force word alignment?
Thanks in advance...
_________________
Moron! You don't herd chickens with a shotgun!
--CoolMan
(GBA is 32-bit words, which is 4 byte, which is why I keep hearing that the addy of your compressed data must be divisable by 4... right?)
I wrote a simple catch.
Code: |
if( ((u32)mypic) != (u32)(((u32)mypic >> 2) << 2) ) //Check to make sure this addy is on a word boundry. { dprints("WARNING!!! Attempting to decompress an image whose beginning is not on a word boundry.\n"); sprintf(tstring, "Word Boundry: 0x%X, Actual Address: 0x%X\n", (u32)(((u32)mypic >> 2) << 2), ((u32)mypic)); dprints(tstring); } |
This worked at one point, but now my linker suddenly feels like mis-aligning all of this stuff...
So, my questions is, how do I force word alignment?
Thanks in advance...
_________________
Moron! You don't herd chickens with a shotgun!
--CoolMan