Here are my experiences:
graphic.h
. It was the file where I declared all graphics from the project. So I added this line: external unsigned short obj_Palette[] __attribute__ ((aligned(2)));
But ... I need a way to find out the array size. The sizeof
operator can do this if the exact array size is specified. To get the array size, I had to open the generated assembler file first, to see what the size is actually:
.SECTION .rodata .ALIGN 2 .GLOBAL obj_Palette obj_Palette: .short 0x0000, 0x7fff, 0x001f ... @ lot of data here .short 0x0000, 0x0000, 0x0000 ... .SIZE obj_Palette, 512
Since the size in this file is specified in bytes, I have to divide it by two, because the declaration, in this case, uses halfwords. Finally I got this:
external unsigned short obj_Palette[512/2] __attribute__ ((aligned(2)));
Now it compiles pretty fast, but there are too much steps involved to get a resource into the program.
katie
process them. katie
creates a header and an assembler file with all resouces (padded/aligned/whatever).I have to add this assembler file once to the files to compile and don't need to touch it anymore, no matter if I add new resources or remove one. The generated c/c++ compatible header file has definitions to all the resources, plus the size of each resource in different formats.
No extra typing neccessary, katie does it for you. Plus, if you change the size of a graphic for example and convert the resources again, all changes are reflected automatically! No extra work is neccessary, like adjusting the array size!