View Single Post
June 18th, 2010 (3:52 PM).
Join Date: May 2006
Originally Posted by
Uhm, hardly any routines in Pokemon is ARM based, besides the routine calling the main loop I think.
You'll find this is the case with pretty well all GBA games for one simple reason: An ARM Opcode is 32 bits, a THUMB opcode (with the exception of the bl instruction) is 16 bits and the GBA's bus width for reading from cartridge is 16 bits. Thus, any ARM opcodes take two reads to load which is slow. Very slow. That being said, if you pre-load the code to areas in RAM (and you will find this happens) it will execute fine.
46C0 mov r8, r8 is a functional but completely useless opcode that in that particular situation is just being used as padding to make all of the bx rx opcodes word aligned, but some people also like to use it as a breakpoint opcode when debugging. Anyhow, that chunk of code would be used for launching subroutines, as the address range of a bl opcode is limited.
View Public Profile
Send a private message to Xenesis
Visit Xenesis's homepage!
Find all posts by Xenesis
Find threads started by Xenesis