Assembly modification 1
|
Requirements: |
|
Introduction |
Step 1
First we'll need to pick something to modify. Asuming you already know Megaman X,
let's modify the
code responsible for depleting the energybar. First we'll analyze it. Let's take a look:
![]()
If you'll count them, you will see that there are 16 stripes in the bar.
Very often the value that's is stored in memory is
the same as the value you count on the screen. But not always. Luckily in this case it's
the same, as we'll see.
|
Step 2 |
![]()
|
Step 3
* Depends on operation Of course these are not all instructions, but most of the times they're used for this kind of things. So in our case we would be looking for 0xADCF0B and 0x8DCF0B. If you check all instances with ADXXXX and 8DXXXX you'll see that nowhere near most of them a SBC intruction will be found. The only one you'll find is at 0x21F4B in the file (ED0000) without a SBC-like instruction you can't lose energy. So this must be the one. Let's test it. Change the 0xED0000 to 0xEAEAEA. 0xEA = NOP(No OPeration)so that's 3 NOP intructions wich do excactly nothing (but waste time). Fire up zsnes and load the rom you just modded. If correctly done zsnes should say that the checksum is wrong, wich it is. Walk into the fist spikey you see, and surprise. It works. Next go fight the purple guy, hmmm not very good you're supposed to get whooped here. We'll fix that next time, then we'll take a look at how to hack in your own code.
I know there is a lot more to explain, but I hope this will get you started. Try to learn as many instructions as you can and try to learn as much as you can about the 65c816 and the snes. * One very cool and at the same time annoying feature of the
65c816 is the variable accumulator and index register size wich can be changed between
8 and 16 bits by setting or resetting certain bits of the processor status. This makes
disassembling a little more difficult. Make sure you understand this concept. ISDA
allows you to set the status by pressing A and X. |