Assembly Programming
#35
Here I put an idea of Angelo in practice. I made Terra gain 4 new commands replacing the old ones when she morph. She can't revert and has the morph status for the rest of the battle. She regain her default commands after battle. The code I modified is the portion when the morph/revert command is switched. Since for the purpose of the hack we don't have to consider revert anymore, I focused only on switching the commands. This is the original code:

Code:
C2/0AD1: BD 2E 20     LDA $202E,X  (get contents of menu slot)
C2/0AD4: C5 EE        CMP $EE
C2/0AD6: D0 05        BNE $0ADD    (if Morphed and menu item isn't Morph(3), branch  -OR-
                                    if not Morphed and menu item isn't Revert(4), branch)
C2/0AD8: 49 07        EOR #$07  
C2/0ADA: 9D 2E 20     STA $202E,X  (toggle menu item between Morph(3) and Revert(4) )
C2/0ADD: E8           INX
C2/0ADE: E8           INX
C2/0ADF: E8           INX
C2/0AE0: 88           DEY
C2/0AE1: D0 EE        BNE $0AD1    (loop for all 4 menu items)

I simply wrote NOPs to all that segment and I did a JSR to C2/6470. I'm looping four time checking if the current command is one of the four that Terra has. If there is a match, the command is replaced by another one. Simple idea that as usual could be optimized I'm sure:

Code:
C2/6470: BD 2E 20     LDA $202E,X   (get contents of menu slot)
C2/6473: C9 00        CMP #$00      (fight)
C2/6475: F0 12        BEQ $6489     (Branch if fight)
C2/6477: C9 01        CMP #$01      (Item)
C2/6479: F0 12        BEQ $648D     (Branch if item)
C2/647B: C9 02        CMP #$02      (magic)
C2/647D: F0 12        BEQ $6491     (branch if magic)
C2/647F: C9 03        CMP #$03      (morph)
C2/6481: F0 02        BEQ $6485     (branch if morph)
C2/6483: 80 11        BRA $6496     (branch to next menu item if none of the four)
C2/6485: 69 07        ADC #07       (change morph to runic)
C2/6487: 80 0A        BRA $6493     (branch to set new menu item)
C2/6489: 69 15        ADC #$16      (change fight to jump)
C2/648B: 80 06        BRA $6493     (branch to set new menu item)
C2/648D: 69 06        ADC #$06      (change item to throw)
C2/648F: 80 02        BRA $6493     (branch to set new menu item)
C2/6491: 69 14        ADC #$15      (change magic to X-magic)
C2/6493: 9D 2E 20     STA $202E,X   (set new menu item)
C2/6496: E8           INX           (Increase three times because            
C2/6497: E8           INX            the 4 commands are at
C2/6498: E8           INX            $202E,X - $2031,X - 2034,X and $2037,X)
C2/6499: 88           DEY           (We have finished another command)
C2/649A: D0 D4        BNE $6470     (loop for all 4 menu items)
C2/649C: 60           RTS

Here'S a small demonstration: http://www.youtube.com/watch?v=x6pXqHXa0Sc ファイナルファンタジー 修正
Reply


Messages In This Thread
Assembly Programming - by the_randomizer - 01-06-2012, 05:51 PM
RE: Assembly Programming - by Angelo26 - 01-12-2012, 08:50 PM
RE: Assembly Programming - by the_randomizer - 01-12-2012, 09:33 PM
RE: Assembly Programming - by madsiur - 01-15-2012, 03:01 AM
RE: Assembly Programming - by JCE3000GT - 01-16-2012, 04:40 PM
RE: Assembly Programming - by madsiur - 01-16-2012, 05:32 PM
RE: Assembly Programming - by JCE3000GT - 01-16-2012, 08:17 PM
RE: Assembly Programming - by madsiur - 01-23-2012, 02:47 AM
RE: Assembly Programming - by madsiur - 02-04-2012, 02:38 PM
RE: Assembly Programming - by madsiur - 03-25-2012, 04:32 AM
RE: Assembly Programming - by SSJ Rick - 03-25-2012, 01:05 PM
RE: Assembly Programming - by madsiur - 04-20-2012, 01:56 AM
RE: Assembly Programming - by Marketa Lazarova - 08-16-2016, 11:17 AM
RE: Assembly Programming - by seibaby - 08-16-2016, 01:21 PM
RE: Assembly Programming - by PinkMawile - 09-24-2016, 03:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Altering text via assembly without breaking things Kenefactor 3 3,084 12-06-2019, 12:15 AM
Last Post: madsiur
  Determinging sprite assembly Rydel 2 3,656 09-21-2016, 01:41 PM
Last Post: Rydel
  Question-Programming-Sprites Sczar Atmos 2 3,040 07-17-2013, 11:20 PM
Last Post: Sczar Atmos
  Sword Swing Assembly Question Zeemis 2 4,174 07-03-2011, 04:01 PM
Last Post: Zeemis
  My Assembly Notes Zeemis 1 3,202 03-04-2011, 07:49 PM
Last Post: Angelo26

Forum Jump:


Users browsing this thread: 1 Guest(s)