1
ROM Hacking Discussion / Pokemon Red priority move altering
« on: May 10, 2012, 04:39:00 am »
I'm trying to work on a hack of Pokemon Red, and this aspect is proving to be a bit of a challenge for me. In Gen I, the only high priority move was Quick Attack. What I'd like to do is alter the check so that more moves are recognized as priority moves, but this is a bit of an issue. The code at $3C2E5 is where the check for Quick Attack takes place, as translated by DASMX (the comments are mine):
If I change the "62" into "21", I can make it so that Tackle is the high priority move rather than Quick Attack. That's all fine and good, but if I want to have it check another move by inserting code "FE 21 20 0A" at $3C2EC and removing some blank data at the end of the bank so the ROM doesn't exceed $FFFFF in size, battles will always fail to load and you will be unable to move after speaking with a trainer.
Could the issue with this be the fact that adding in this code messes up jump addresses, and is there any way I can alleviate this issue other than going through the entire bank and modifying every jump address, which will no doubt be a pain in the butt? I was thinking I could put a "jump to" that leads to an area in the middle of the blank data where I can have all the necessary compares and whatnot, then another jump that leads back to the original code, flooding any unused bytes with NOPs so that the offsets don't actually change.
Code: [Select]
3C2E5 : FA DC CC " " ld a,(X1D1D) ; load value from (CCDCh) to accumulator, which is the byte used to indicate your selected move
3C2E8 : FE 62 " b" cp 01DH ; compare to 62h, which is the indicator for the move Quick Attack
3C2EA : 20 0A " " jr nz,LC2F2 ; jump if not equal to LC2F2
3C2EC : FA DD CC " " ld a,(X1717) ; (CCDDh) is the byte that indicates your foe's selected move (for a CPU trainer, this value is set immediately once you select your move)
3C2EF : FE 62 " b" cp 007H ; once again, compare with 62h
3C2F1 : 28 21 "(!" jr z,LC30A ; jump if equal to LC30A
3C2F3 : C3 7D 43 " }C" jp L1207 ; jump to L1207
If I change the "62" into "21", I can make it so that Tackle is the high priority move rather than Quick Attack. That's all fine and good, but if I want to have it check another move by inserting code "FE 21 20 0A" at $3C2EC and removing some blank data at the end of the bank so the ROM doesn't exceed $FFFFF in size, battles will always fail to load and you will be unable to move after speaking with a trainer.
Could the issue with this be the fact that adding in this code messes up jump addresses, and is there any way I can alleviate this issue other than going through the entire bank and modifying every jump address, which will no doubt be a pain in the butt? I was thinking I could put a "jump to" that leads to an area in the middle of the blank data where I can have all the necessary compares and whatnot, then another jump that leads back to the original code, flooding any unused bytes with NOPs so that the offsets don't actually change.