View Single Post
Old January 27th, 2013 (12:31 PM).
miksy91's Avatar
miksy91 miksy91 is offline
Dark Energy is back in action! ;)
Join Date: Oct 2008
Location: A small country in the North
Gender: Male
Nature: Relaxed
Posts: 1,401
Originally Posted by Chaos Rush View Post
How would you find the ASM routine that the game runs when pressing A while selecting "Pokedex" on the Start Menu? I tried pausing the game in VBA-SDL-H right after pressing A, but I can't find the exact routine, because whenever I put in a breakpoint, it breaks even in other places that have nothing to do with the Pokedex, and that it seems like the game is always running multiple routines or something :/
There are several things you can try but you're currently on a wrong path if I understood right what you're saying here. The processor executes code so fast that if you're trying to press some button on that program to stop executing at certain point, you can never be quick enough.
Anyway, can't you just set a breakpoint to the ram address having the buttons stored in them? There should be some high ram area in GBA where certain universal things like key presses are stored. When you press A, one bit is set in a certain ram address and you can set a breakpoint to that address and follow the code onwards from there.

Another way would be trying to use an asm editor and get hang of the processes being executed before you press A button at that time.
You should be able to find some table defining text strings "Pokedex", "Pokemon", [Player's name]", "Option" and all that stuff. Find the pointer to "Pokedex" for instance and see how it is accessed. Somewhere close to it (either in that routine or some "main routine" calling that subroutine) you should find a routine for making the game wait for the player to press either A button or Up/Down for scrolling up or down in the menu.

For reference;
My Rom Hack

Learn how to hack GB/C games:

Check my GameBoy/Color hacking videos in Youtube
-The video set uses Pokemon Silver (U) rom for demonstrations