strat wrote:
I've never seriously looked at a raw disassembly before and thought it would be neat to hack Balloon Kid. It should've been easy to find a few things, like the joypad reading code. Just follow the byte with the joypad state and you'll find the player moving code, right? Nope. The joypad state is constantly moved elsewhere and xor'ed with other bytes.
I did find where the oam buffer is written but everytime something becomes clear it branches off like a hydra.
Any tips from people who've studied commercial games?
Yes, keep at it.
Trace through several frames and try to figure out what is going on.
With joypad reading code, it's common to compare this frame's button states with last frame's button states to get some different information.
For example if you XOR last frame's button states by #$FF and then AND the result with this frame's button states, you will get a nice byte that tells you which buttons were newly pressed this frame (ie, unpressed last frame, but pressed this frame).
On the flipside, if you XOR this frame's button states by #$FF and then AND the result with last frame's button states, you get the opposite - a byte that tells you which buttons were released this frame.
Some games also read the controller twice in a frame and compare the results to make sure they match. I forget the exact reason, but I think it had something to do with the DPCM affecting $4016.
I have no idea what Balloon Kid does since I've never looked at it, but it may be using one or more of these techniques.