Decoding the ARM7TDMI Instruction Set (Game Boy Advance)
Learn how to decode the entire ARM7TDMI instruction set to develop your own Game Boy Advance emulator.
My favorite console is the Game Boy Advance. I remember spending hours playing Pokemon in the dead of night then quickly hiding the console under my pillow when my mother barged into my room. In short, the console holds a special place in my heart. After discovering emulation, I knew I had to make a Game Boy Advance emulator someday. Unfortunately, writing an emulator is extremely difficult 😢.
I got stuck on decoding the ARM7TDMI instructions. The CPU is arguably one the most crucial component of an emulator; if it fails, the emulator fails. My first attempts were ugly switch statements within nested if-else statements.
I endlessly googled for tutorials, but none seemed clear outside of copying decoding charts from other people's code. After months of trial and error, I figured out a simple pattern, and today, I'll try to explain how to easily decode the ARM7TDMI instruction set without creating a confusing bit table.