#113930 - rodif - Mon Jan 01, 2007 7:48 am
So I got bit by this issue, searching the forums i found your faq that talks about this.
My problem is i had const strings in my file and based on the string length it would screw up my sprites and background.
After I realized what the problem was, I could fix it by simply declaring the string as a
and everything worked.
EDIT:
sorry i just realized what I was doing, i was missing a "__attribute__((aligned(4))) " for my sprite data declaration, I had them on my tile data but missed it for my sprite.
Quote: |
Also, make sure that both your map data, your tile data, and your palette data are aligned to a 4-byte boundary within your binary. If you use assembly language, put .balign 4 on a line before the data; in C do this (recommended only for smaller arrays such as palette data):
__attribute__((aligned(4))) const char foo[8192] = { /*...*/ }; Aligns the start of the array to a 4-byte boundary. |
My problem is i had const strings in my file and based on the string length it would screw up my sprites and background.
Code: |
doSomething("text"); |
After I realized what the problem was, I could fix it by simply declaring the string as a
Code: |
const char text[] = "text"; |
and everything worked.
EDIT:
sorry i just realized what I was doing, i was missing a "__attribute__((aligned(4))) " for my sprite data declaration, I had them on my tile data but missed it for my sprite.