||Locating and Understanding Key Routines
Using DIP Switch Info
DIP switch information can be very valuable when understanding disassembled code. Once you've located were the DIP switch info is read and stored, it should be easy to find each switch and located the routines associated with it.
Find the switch that controls Coins/Credit and that should tell you the RAM locations for storing Number of Coins and Number of Credits. Doing a search on that RAM location should
yield the coin input and credit awarding routines.
Searching for DIP control of number of lives per credit should help you find the RAM location for the Number of Lives. Searching on that location should help you find death routines (loss of life) and bonus routines (award of life).
Take a Guess
It doesn't hurt to guess when you don't know what a certain variable does. Keep with your assumption until something tells you that it is wrong. For example, location XXX may hold the number of lives, unless you find a routine that divides XXX by 60. That would indicate that it probably
isn't' the number of lives, but maybe a minute or second counter of some kind.
Identifying the Diagnostic Mode can be very helpful. It could help identify such things as RAM location, Video RAM location, ROM Checksums, Sprite X/Y locations, Joystick Input routines, Coin Input Routines, DIP Settings, and Sound Routines,
INs and OUTs
Searching for IN and OUT instructions can help you identify input and output routines. Variables read in may include Control Panel Inputs, Status bytes, or DIP Switches. Output routine variables may include LDP Commands, LED/Scoreboard Controls, Graphic Chip Communications. Search for these instructions right away and make some early assumptions, chances are you may be right!
Look for routines that are called a lot. These routines can sometimes be math-type routines. Finding a routine that, say, adds two numbers together can possible lead to a point-award routine. Finding math routines that subtract may lead to timeout routines or death routines.
Interrupts normally have routines that must be run "continuously". Routines such as checking for coins or redrawing/refreshing the screen are commonly found in interrupts.
The first hunk of code is mostly used for initialization. Often times it's not very useful. Most variables are simply set to "zero", which of course gives no
indication as to what those variables actually do. Look for variables that are initialized to non-zero values. Variables that are set to 5 or 10, etc. may provide better clues as to what they are.
Timers can be count UP or count DOWN timers. They can be one or two bytes. Look for a one or two byte variable that gets decremented (DEC) or incremented (INC) in a interrupt. It's probably a timer of some sort. Analyze your game and find our where timers may be used. Does the attract mode run for a certain time? Do you have a certain amount of time to continue? Are you timed when you enter your initials?
Keep at it. You'd be amazed and how something can come to you if you stare at it long enough!