Users browsing this thread: 1 Guest(s)
Usable Magic for all Characters
author: B-Run
Apply to FF3us
Download
This patch gives every character a usable magic list to pull from, as well as allows each character to learn magic via espers/equipment. All of the magic lists are shared with the first twelve actors (Terra and Co.). On the flipside, I overwrote Gogo's magic code in order to create this patch, meaning Gogo no longer learns everyone's magic.
Actors above 0B will share the magic lists with one of the other characters. Notable actors who can now learn Magic:
-Gogo shares a magic list and learning with Terra.
-Umaro shares a magic list and learning with Locke.
-Bannon shares a magic list and learning with Cyan.
-Leo shares a magic list and learning with Shadow.
-Wedge shares a magic list and learning with Relm.
-Vicks shares a magic list and learning with Setzer.
-Kefka shares a magic list and learning with Sabin, Celes, Strago, Relm, or Setzer (depending on which instance of Kefka is used).
Note: This patch does not add magic to each actors menu, you must do that yourself with an editor. This patch also does not allow all actors to be reequipped. This is only for magic lists.
Here are the changes in the code:
Now for how it gets used.
Thanks to Madsiur for help finding and understanding code and Angelo26 for the disassemblies of the Battle and Menu banks and pointing me to a patch maker!
Feel free to use this in your own hacks, simply give credit where credit is due. Please contact me if you find any bugs. Hope this helps!
Apply to FF3us
Download
This patch gives every character a usable magic list to pull from, as well as allows each character to learn magic via espers/equipment. All of the magic lists are shared with the first twelve actors (Terra and Co.). On the flipside, I overwrote Gogo's magic code in order to create this patch, meaning Gogo no longer learns everyone's magic.
Actors above 0B will share the magic lists with one of the other characters. Notable actors who can now learn Magic:
-Gogo shares a magic list and learning with Terra.
-Umaro shares a magic list and learning with Locke.
-Bannon shares a magic list and learning with Cyan.
-Leo shares a magic list and learning with Shadow.
-Wedge shares a magic list and learning with Relm.
-Vicks shares a magic list and learning with Setzer.
-Kefka shares a magic list and learning with Sabin, Celes, Strago, Relm, or Setzer (depending on which instance of Kefka is used).
Note: This patch does not add magic to each actors menu, you must do that yourself with an editor. This patch also does not allow all actors to be reequipped. This is only for magic lists.
Here are the changes in the code:
Code:
This is where the magic happens, literally. This is where Gogo's magic population used to occur.
C3/50C4: C90C CMP #$0C
C3/50C6: 9006 BCC $50CE (branch if less than #$0C)
C3/50C8: E90C SBC #$0C (else, subtract #$0C)
C3/50CA: C90C CMP #$0C
C3/50CC: B0FA BCS $50C8 (if still greater than #$0C, subtract again)
C3/50CE: 60 RTS
This is the subroutine when called from the C2 bank.
C3/50CF: C90C CMP #$0C
C3/50D1: 9006 BCC $50D9 (branch if less than #$0C)
C3/50D3: E90C SBC #$0C (else, subtract #$0C)
C3/50D5: C90C CMP #$0C
C3/50D7: B0FA BCS $50D3 (if still greater than #$0C, subtract again)
C3/50D9: 6B RTS
C3/50DA: EA NOP (Filling out the rest of Gogo's old magic block)
...
C3/50EB: EA NOP
Now for how it gets used.
Code:
Determine if a character actually knows magic [MENU]
C3/0D2B: AD691A LDA $1A69 (from C3/0CB7)
C3/0D2E: 0D6A1A ORA $1A6A
C3/0D31: 0D6B1A ORA $1A6B
C3/0D34: 0D6C1A ORA $1A6C
C3/0D37: D027 BNE $0D60 (branch if you have at least one esper)
C3/0D39: A667 LDX $67
C3/0D3B: 7B TDC
C3/0D3C: BD0000 LDA $0000,X (character ID)
C3/0D3F: 20C450 JSR $50C4 (Reduce character ID)
C3/0D42: EA NOP
C3/0D43: EA NOP
C3/0D44: EA NOP
C3/0D45: 8D0242 STA $4202 (reduced actor ID as multiplier A)
C3/0D48: A936 LDA #$36
C3/0D4A: 8D0342 STA $4203 (#$36 as multiplier B)
C3/0D4D: A03600 LDY #$0036 (TAY?)
C3/0D50: AE1642 LDX $4216 (load character * spell total)
C3/0D53: BD6E1A LDA $1A6E,X (load spell at X)
C3/0D56: C9FF CMP #$FF (learned it?)
C3/0D58: F006 BEQ $0D63 (branch if so)
C3/0D5A: E8 INX
C3/0D5B: 88 DEY
C3/0D5C: D0F5 BNE $0D56 (branch if we haven't checked every spell)
C3/0D5E: 18 CLC (used by C3/0C6C, says that this character doesn't know magic)
C3/0D5F: 60 RTS
C3/0D60: 38 SEC (flag MP as ok to display)
C3/0D61: 60 RTS
C3/0D62: EA NOP
C3/0D63: EA NOP
C3/0D64: EA NOP
Code:
Get spell's learned amount [MENU]
C3/50A2: 85E0 STA $E0
C3/50A4: 20DD4E JSR $4EDD
C3/50A7: B90000 LDA $0000,Y
C3/50AA: 20C450 JSR $50C4 (Reduce character ID)
C3/50AD: 8D0242 STA $4202
C3/50B0: A936 LDA #$36
C3/50B2: 8D0342 STA $4203
C3/50B5: 7B TDC
C3/50B6: A5E0 LDA $E0
C3/50B8: C220 REP #$20 (16 bit memory/accum.)
C3/50BA: 6D1642 ADC $4216
C3/50BD: AA TAX
C3/50BE: E220 SEP #$20 (8 bit memory/accum.)
C3/50C0: BD6E1A LDA $1A6E,X
C3/50C3: 60 RTS
Code:
Relevant code for looking up magic [BATTLE]
C2/56C9: BD D8 3E LDA $3ED8,X (character ID)
C2/56CC: 22CF50C3 JSR $C3/50CF (reduce character ID)
C2/56D0: C8 INY
C2/56D1: C8 INY (Y = 2)
C2/56D2: EA NOP
C2/56D3: EA NOP
C2/56D4: C8 INY
C2/56D5: C8 INY (Y = 4)
C2/56D6: EB XBA
C2/56D7: A9 36 LDA #$36
C2/56D9: 20 81 47 JSR $4781
C2/56DC: C2 21 REP #$21 (Set 16-bit A, clear Carry)
C2/56DE: 69 6E 1A ADC #$1A6E
C2/56E1: 85 F0 STA $F0
Code:
Learning Magic [BATTLE]
C2/5E59: B9 D8 3E LDA $3ED8,Y (Which character it is)
C2/5E5C: 22CF50C3 JSR $C3/50CF(reduce character ID)
C2/5E60: 20 83 62 JSR $6283 (Stores address for spells known by character in $F4)
C2/5E63: BE 10 30 LDX $3010,Y (get offset to character info block)
C2/5E66: 5A PHY
C2/5E67: 20 EF 5F JSR $5FEF (Cursed Shield check)
C2/5E6A: BD 1E 16 LDA $161E,X (Esper equipped)
C2/5E6D: 30 03 BMI $5E72 (Branch if no esper equipped)
C2/5E6F: 20 2A 60 JSR $602A (Learn spells taught by esper)
C2/5E72: 7A PLY
C2/5E73: 88 DEY
C2/5E74: 88 DEY
C2/5E75: 10 9C BPL $5E13 (Check next character)
Code:
Populating battle magic list
C2/5589: BD D8 3E LDA $3ED8,X (Character ID)
C2/558C: 22 CF 50 C3 JSR $C3/50CF (Reduce character ID)
C2/5590: EB XBA
C2/5591: A9 36 LDA #$36
C2/5593: 20 81 47 JSR $4781
C2/5596: C2 21 REP #$21
C2/5598: 69 6E ADC #$6E
C2/559A: 1A INC
C2/559B: F0 STA $F0 (Characters magic list address)
Thanks to Madsiur for help finding and understanding code and Angelo26 for the disassemblies of the Battle and Menu banks and pointing me to a patch maker!
Feel free to use this in your own hacks, simply give credit where credit is due. Please contact me if you find any bugs. Hope this helps!
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 1 Guest(s)