Why am I doing this?
I'm getting sucked back into DS programming, because my expedition into Atari programming taught me some basic concepts that I just wasn't finding in the source material for DS stuff. I swear, I need to write a huge book on computer concepts from the ground up.
So the main problem I was having with understanding ARM assembly on the DS was the black magic / voodoo performed behind the scenes by GNU as. Specifically, that it takes labels and creates relocatable code, and that everything resides in memory, usually.
Well ok, so relocatable code means that only offset-based addressing is used, not hard-coded memory locations, so the code can be anywhere in memory. This is why the intermediate format used in compiling/assembling is ELF, I guess. The NDS header specifies where the code is to be placed, namely the start of shared ram, or 0x2000000. So how do we get graphics data in there?
Well, without using some kind of filesystem, all data has to be stored in main memory, either interleaved with the code (yuck) or in a blorb at the end (not as bad). Properly aligned, etc. So my next trick is to figure out what directives I need to use with as to accomplish that.
Update: Well, I figured it out, you can plop in data with either .word or .hword for 32-bit or 16-bit values, respectively. And it survives the objcopy process. I should be able to use output from grit, at this rate.
Update 2: Hooooooly shit it works
Update 3: There is something very strange going on with the code I'm using, time to do it all from scratch.