#130252 - biubid_boy - Fri Jun 01, 2007 2:55 pm
Hello everyone.
I was reading through the TONC section on loading sprites when I noticed that the author used a technique to allow easy access to charblocks by making an array of tiles. (bottom of this page). So, I tried to do the same to the object palette ram and cut it into 16 palettes, thinking I could simplify things further. So here is my current (unworking) code:
And...
Funnily enough, if I use palette entry zero with this code, it works fine, but as soon as go any further, there is no object displayed. This leads me to believe that I have the size of the palette_4bpp struct wrong, but I can figure out why it is wrong. Can anyone lighten things for for me?
Thanks,
Biubid_boy.[/code]
I was reading through the TONC section on loading sprites when I noticed that the author used a technique to allow easy access to charblocks by making an array of tiles. (bottom of this page). So, I tried to do the same to the object palette ram and cut it into 16 palettes, thinking I could simplify things further. So here is my current (unworking) code:
Code: |
typedef struct {u32 data[8 ];} palette_4bpp; typedef palette_4bpp obj_pal_mem_4bpp[16]; #define obj_pal_4bpp ((obj_pal_mem_4bpp*)0x5000000) |
And...
Code: |
memcpy(&obj_pal_4bpp[n], palette, 32); |
Funnily enough, if I use palette entry zero with this code, it works fine, but as soon as go any further, there is no object displayed. This leads me to believe that I have the size of the palette_4bpp struct wrong, but I can figure out why it is wrong. Can anyone lighten things for for me?
Thanks,
Biubid_boy.[/code]