Users browsing this thread: 1 Guest(s)
Additional Command Change Flag

#1
Posts: 776
Threads: 41
Thanks Received: 30
Thanks Given: 54
Joined: Jan 2016
Reputation: 6
Status
None
Thanks to Serity for their help with this one.

This is a walkthrough for how to turn the "raise pre-emptive strike" flag of the Gale Hairpin (which is pretty useless imho) into a flag to change commands like the Fake Mustache, etc.

There are two parts - the battle menu, and the Status menu.

Code:
C2/53A5: B9 FC 00     LDA $00FC,Y   (get command from menu slot)
C2/53A8: A2 04        LDX #$04
C2/53AA: 48           PHA
C2/53AB: A9 04        LDA #$04
C2/53AD: 85 EE        STA $EE        (start checking Bit 2 of variable $11D6)
C2/53AF: BF 52 54 C2  LDA $C25452,X  (commands that can be changed FROM)
C2/53B3: C3 01        CMP $01,S      (is current command one of those commands?)
C2/53B5: D0 0D        BNE $53C4      (branch if not)
C2/53B7: AD D6 11     LDA $11D6     (check Battle Effects 1 byte.
                                    Bit 2 = Fight -> Jump, Bit 3 = Magic -> X-Magic,
                                    Bit 4 = Sketch -> Control, Bit 5 = Slot -> GP Rain,
                                    Bit 6 = Steal -> Capture)
               
C2/53BA: 24 EE        BIT $EE
C2/53BC: F0 06        BEQ $53C4
C2/53BE: BF 57 54 C2  LDA $C25457,X   (commands to change TO)
C2/53C2: 83 01        STA $01,S       (replace command on stack)
C2/53C4: 06 EE        ASL $EE         (will check the next highest bit of $11D6
                                      in our next iteration)
C2/53C6: CA           DEX
C2/53C7: 10 E6        BPL $53AF       (loop for all 5 possible commands that can be
                                      converted)
The command lists at C2/5452 and C2/5457 will need to be relocated to empty space to make room to add an additional command to both lists. The bit counts backwards, so at the END of those lists, add "FF XX", where XX is the hex value for the command you want to change and what to change it into (FF is to skip the Back Guard byte). For my project I'm changing Runic to Shock, so that's 0B and 1B
You'll then have to change how long your list is. Change C2/53A8 to "A2 06" and C2/53AB to "A9 01".
The command will now be changed in battle, which is the most important, but it won't show up in the character's command list in the Status Menu.

Code:
C3/616F:    B91600      LDA $0016,Y    ; Command
C3/6172:    85E0        STA $E0        ; Memorize it
C3/6174:    7B          TDC            ; Clear A
C3/6175:    AA          TAX            ; 1st: Capture
C3/6176:    ADD611      LDA $11D6      ; Relic effects
C3/6179:    297C        AND #$7C       ; Cmd upgrades
C3/617B:    0A          ASL A          ; Shift bits
C3/617C:    0A          ASL A          ; Got current?
C3/617D:    900A        BCC $6189      ; Skip if not
C3/617F:    48          PHA            ; Save upgrades
C3/6180:    BF9861C3    LDA $C36198,X  ; Cmd to switch
C3/6184:    C5E0        CMP $E0        ; Current cmd?
C3/6186:    F00A        BEQ $6192      ; Replace if so
C3/6188:    68          PLA            ; Cmd upgrades
C3/6189:    E8          INX            ; Index +1
C3/618A:    E00500      CPX #$0005     ; Done Fight?
C3/618D:    D0ED        BNE $617C      ; Loop if not
C3/618F:    A5E0        LDA $E0        ; Original cmd
C3/6191:    60          RTS

Change C3/618A to "E0 05 XX", where XX is the hex value of whatever your original command being changed is; before Fight-Jump was the last command checked and then the game looped back, now with FF XX tacked onto the end, the XX will be the last command checked. Then change C3/6179 to "29 7B" to not filter out Bit 0 which DOES change a command now.

And you're done! The Gale Hairpin flag in usME is now a "change command" flag.
  Find
Quote  

#2
Posts: 129
Threads: 11
Thanks Received: 0
Thanks Given: 0
Joined: Jun 2021
Reputation: 2
Status
None
Any ideas on where the code for calling Interceptor would be located? It'd be cool to give Shadow a special relic that allows the player to call on Interceptor whenever they choose to do so.
  Find
Quote  

#3
Posts: 776
Threads: 41
Thanks Received: 30
Thanks Given: 54
Joined: Jan 2016
Reputation: 6
Status
None
No, that's entirely different from what this is.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite