hmm ...
you are calling functions without giving parameters which takes parameters
Here is what FBI said in his asm tut:
Code:
Remember when I was talking about paramaters to ASM functions? I said that paramaters, by ASM standards, are defined to be the first four low registers. If there are more than four paramaters, that's a different story (the extra paramaters are writting to the stack pointer). Similarly to paramaters, the output from a function is also like this. Generally, if a function outputs values or pointers for other functions to use (these are often called helper functions in other programming languages), the outputs are stored into r0-r3. They are always filled in consecutive order. So if some function outputted one value, that value would be in r0. Never will you see the value in r1, r2, or r3 and not in r0. Hopefully that makes sense to you, as it's important.
So.....
* before calling update_pal function you have to put current_mapheader in r0
.
like this:
Code:
ldr 0, map
ldr r0, [r0]
ldr r5, updatePal
bl bx_r5
* And updateNPCPal also takes a parameter.
You don't need to push that many register. You just did some check in this routine so r0-r2 is enough for the task.