Users browsing this thread: 1 Guest(s)
Steal, GP Rain, and Steal GP as Spells?

#6
Posts: 3,971
Threads: 279
Thanks Received: 237
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(04-01-2017, 12:27 AM)Timbo Wrote: How exactly does it choose Fight & Gau + Rage? Looking at address C2/538C, I know that BEQ is Branch if Equal but I'm not sure what hex F0 08 is referring to or 5396 for that matter. The same is true for C2/538E. I have no idea what C9 means but I can see that it uses the Compare Accumulator opcode and I know that 1D is the hex value for the Magitek command. What I plan to do is give replace Locke's Fight with Capture and use the automatic Rage patch which replaces Gau's Leap with Fight. What I'd like to do is change the code from Gau+Rage to Locke+Capture. Can you help me understand this?

The first byte of an instruction is the command (there are 255 different). LDA $60, LDA #$60, LDA $0060 and LDA $C00060,X will each have a different command ID because they all load a value from a different place. Same for all commands. BEQ, BNE, BPL and BMI branch depending on certain flags. BRA is a mandatory branching (will always branch). The second byte of a branching instruction is the number of bytes to jump, forward if between #$01 and #$7F and backward for #$80 to #$FF.

The following code explain the "Gau+Rage" logic. Comments are not from me.

Code:
C2/5364: EB           XBA           (retrieve character index)
C2/5365: C9 0B        CMP #$0B
C2/5367: D0 08        BNE $5371     (branch if not Gau)
C2/5369: EB           XBA           (get command again)
C2/536A: C9 10        CMP #$10
C2/536C: D0 02        BNE $5370     (branch if not Rage)
C2/536E: A9 00        LDA #$00      (load Fight command into A so that Gau's Rage will get replaced
                                     by MagiTek too.  why not just replace "BNE $5370 / LDA #$00"
                                     with "BEQ formerly_$5376" ??  you got me..)
C2/5370: EB           XBA
C2/5371: EB           XBA           (once more, command is in bottom of A, character index in top)
C2/5372: C9 00        CMP #$00      (Fight?)
C2/5374: D0 04        BNE $537A     (branch if not.  if it is Fight, we'll replace it with MagiTek)
C2/5376: A9 1D        LDA #$1D      
C2/5378: 80 06        BRA $5380     (go store MagiTek command in menu slot)
C2/537A: C9 02        CMP #$02
C2/537C: F0 02        BEQ $5380     (if Magic, branch..  which just keeps Magic as command?
                                     rewriting it seems inefficient, unless i'm missing
                                     something.)
            
C2/537E: A9 FF        LDA #$FF      (empty command)
C2/5380: 95 FC        STA $FC,X     (update this menu slot)
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • Timbo (04-01-2017)



Messages In This Thread
RE: Steal, GP Rain, and Steal GP as Spells? - by madsiur - 04-01-2017, 09:47 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite