Users browsing this thread: 1 Guest(s)
Strago natural magic

#2
Posts: 383
Threads: 34
Thanks Received: 10
Thanks Given: 13
Joined: Dec 2018
Reputation: 18
Status
Moog
Okay, you're using GrayShadow's Natural Ability Extension to give Relm magic, but you want it to give Strago magic as well.  That patch by itself can't do that, but I did manually code an expansion to it that adds natural learning to Strago, Mog, and Shadow.  You can exclude Shadow and Mog from it by setting their learn levels higher than max level (level 100+)

Here's the raw hex:
Code:
-----------------------
RAW Hex
-----------------------
[C0 Bank]
C0/9F6D:
-- -- -- -- -- -- -- -- -- -- -- -- -- 20 D7 D8

C0/A177:
-- -- -- -- -- -- -- 20 d7 D8 -- -- -- -- -- --

C0/C547:
-- -- -- -- -- -- -- 20 d7 D8 -- -- -- -- -- --

C0/D8D7:
-- -- -- -- -- -- -- B9 00 16 C9 0A D0 03 82 32
00 C9 07 D0 03 82 4D 00 C9 03 D0 03 82 68 00 C9
08 D0 03 82 83 00 C9 00 D0 03 82 A1 00 C9 06 D0
03 82 C4 00 C9 02 D0 03 82 E7 00 C9 05 D0 03 82
07 01 60 A6 00 BF 41 E3 EC D9 08 16 F0 02 B0 F2
5A BF 40 E3 EC A8 A9 FF 99 8A 1C 7A E8 E8 E0 20
00 F0 DF 80 E0 A6 00 BF 61 E3 EC D9 08 16 F0 02
B0 D0 5A BF 60 E3 EC A8 A9 FF 99 E8 1B 7A E8 E8
E0 20 00 F0 BD 80 E0 A6 00 BF 81 E3 EC D9 08 16
F0 02 B0 AE 5A BF 80 E3 EC A8 A9 FF 99 10 1B 7A
E8 E8 E0 20 00 F0 9B 80 E0 A6 00 BF A1 E3 EC D9
08 16 F0 02 B0 8C 5A BF A0 E3 EC A8 A9 FF 99 1E
1C 7A E8 E8 E0 20 00 D0 03 82 76 FF 80 DD A6 00
BF C1 E3 EC D9 08 16 F0 02 B0 02 80 03 82 62 FF
5A BF C0 E3 EC A8 A9 FF 99 6E 1A 7A E8 E8 E0 20
00 D0 03 82 50 FF 80 D8 A6 00 BF E1 E3 EC D9 08
16 F0 02 B0 02 80 03 82 38 FF 5A BF E0 E3 EC A8
A9 FF 99 B2 1B 7A E8 E8 E0 20 00 D0 03 82 22 FF
80 D8 64 1B A6 00 BF 90 F4 E6 D9 08 16 F0 02 B0
0A E6 1B E8 E0 08 00 F0 02 80 EB A5 1B AA AD F7
1C 1F 2C A2 C0 8D F7 1C 60 64 1B A6 00 BF 98 F4
E6 D9 08 16 F0 02 B0 0A E6 1B E8 E0 08 00 F0 02
80 EB A5 1B AA AD 28 1D 1F 2C A2 C0 8D 28 1D 60


[C2 Bank]
C2/60BC:
-- -- -- -- -- -- -- -- -- -- -- -- 20 70 A6 --

C2/A670:
A2 00 00 C9 0A D0 03 4C EB A6 A2 20 00 C9 07 D0
03 4C EB A6 A2 40 00 C9 03 D0 03 4C EB A6 A2 00
00 C9 08 D0 03 4C 11 A7 A2 20 00 C9 00 D0 03 4C
11 A7 A2 40 00 C9 06 D0 03 4C 11 A7 A2 00 00 C9
02 D0 18 20 37 A7 D0 01 60 0C F7 1C F0 01 60 A9
40 04 F0 F0 01 60 A9 42 4C C5 5F A2 08 00 C9 05
F0 01 60 20 37 A7 D0 01 60 0C 28 1D F0 01 60 A9
80 04 F0 F0 01 60 A9 33 4C C5 5F 5A EB A0 10 00
DF 41 E3 EC D0 14 48 5A 7B BF 40 E3 EC A8 B1 F4
C9 FF F0 04 A9 80 91 F4 7A 68 E8 E8 88 D0 E1 7A
60 5A EB A0 10 00 DF A1 E3 EC D0 14 48 5A 7B BF
A0 E3 EC A8 B1 F4 C9 FF F0 04 A9 80 91 F4 7A 68
E8 E8 88 D0 E1 7A 60 A9 01 85 EE EB DF 90 F4 E6
F0 05 E8 06 EE 90 F5 A5 EE 60 -- -- -- -- -- --


[EC Bank]
(Stop Mog from learning - Learn Levels higher than max)
EC/E340:
00 64 00 64 00 64 00 64 00 64 00 64 00 64 00 64
00 64 00 64 00 64 00 64 00 64 00 64 00 64 00 64

(Strago's Spells - Change as needed)
EC/E360:
00 01 01 02 02 03 03 04 24 07 05 1A 04 1C 07 1E
06 21 2D 26 0C 28 0D 2A 0E 2C 31 5A 30 5C 1F 5E

(Stop Shadow from learning - Learn Levels higher than max)
EC/E380:
00 64 00 64 00 64 00 64 00 64 00 64 00 64 00 64
00 64 00 64 00 64 00 64 00 64 00 64 00 64 00 64
The dashes indicate hex values you should not change while replacing this code, and are provided to help you more easily locate the start of each code block when you paste them in HxD.
EDIT: The raw hex assumes that you have the C.V. Reynolds Bugfix Compilation applied to your hack. There are some values that need to be changed if that is not the case.
Code:
C2/a6c8:    -- -- --
            <US 1_0>         C2/a6c8: 4C D4 5F        JMP $5FD4    [Vanilla location of this pointer]
            <CV Bugfixes>    C2/a6c8: 4C C5 5F        JMP $5FC5    [CV Bugfixes to C3 moves this pointer]

C2/a6e8:    -- -- --
            <US 1_0>         C2/a6e8: 4C D4 5F        JMP $5FD4    [Vanilla location of this pointer]
            <CV Bugfixes>     C2/a6e8: 4C C5 5F        JMP $5FC5    [CV Bugfixes to C3 moves this pointer]

These are my notes on the subject in disassembly format.  They borrow a lot from the groundwork GrayShadow laid out, as well as Assassin's work on the C2 bank (the battle hex for FF6).
Code:
====================================
Natural Ability Extended Disassembly
====================================
The original Natural Ability patch for FF6 was created by GrayShadows, and granted Relm her own spell learnset.
These hex edits were made to extend the premise of that patch to Strago, Mog, and Shadow.

Most of the information here was found in Slick Productions C0 Disassembly
and Assassin's C2 Disassembly, portions of which were been paraphrased in this document.
The RAM Data was obtained from FF6Hacking.com.

-------------------------
Relevent RAM data
-------------------------
$1A6E-$1CF5: Percentage learned of spells by characters (54 spells X 12 characters = 648 bytes) (#$FF = known)
    $1A6E Terra (natMagic recipient)
    $1AA4 Locke
    $1ADA Cyan
    $1B10 Shadow (natMagic recipient)
    $1B46 Edgar
    $1B7C Sabin
    $1BB2 Celes (natMagic recipient)
    $1BE8 Strago (natMagic recipient)
    $1C1E Relm (natMagic recipient)
    $1C54 Setzer
    $1C8A Mog (natMagic recipient)
    $1CC0 Gau
    (Gogo and Umaro don't get magic lists)

Actor Ids:
00 Terra
01 Locke
02 Cyan [WARNING]
03 Shadow
04 Edgar
05 Sabin [WARNING]
06 Celes
07 Strago
08 Relm
09 Setzer
0A Mog
0B Gau
0C Gogo [WARNING]
0D Umaro [WARNING]


The code writes FF to these locations to teach individual characters spells.  In order to change who learns spells,
look for ******* in the hex below and replace it with the appropriate data.  The format is little-endian.

For example, if you wanted to swap Shadow learning magic for Locke learning magic,
you would change  
C0/d8ea to C9 01
and
C2/a687 to C9 01
and
C0/d96c to 99 a4 1a

You can't teach Cyan or Sabin natural magic with this current setup; the code would need to be reworked to have them learn
magic first, then swordtechs/blitzes.  Gogo and Umaro do not have magic lists; teaching them magic breaks the RAM and
does weird things like set the menu to sky-blue Chocobos and freeze the game.


-------------------------
Relevent ROM data
-------------------------
[C0 Bank]
[Pointers]
<CHANGE>    C0/9F6D: 20 7F A1    ====>    20 d7 D8            JSR $A17F    ====>    JSR $d8d7
                                    (Checks Natural Abilities.  NatAbi moves it to $D68D.  I changed the branch to its updated spot, $d8d7.)
<CHANGE>    C0/A177: 20 7F A1    ====>    20 d7 D8            JSR $A17F    ====>    JSR $d8d7
                                    (Checks Natural Abilities. NatAbi moves it to $D68D. I changed the branch to its updated spot, $d8d7.)
<CHANGE>    C0/C547: 20 7F A1    ====>    20 d7 D8            JSR $A17F    ====>    JSR $d8d7
                                    (Checks Natural Abilities.  NatAbi moves it to $D68D.  I changed the branch to its updated spot, $d8d7.)
[Freespace consumed: C0/d8d7 to C0/da3f]
C0/d8d7:    B9 00 16        LDY $1600                [Load Character ID]
C0/d8da:    C9 0A            CMP $0A                    [Compare Character ID against Mog] ********************************
C0/d8dc:    D0 03            BNE $03 to C0/D8E1        [Branch if not (Skips BRL to Mog)]
C0/d8de:    82 32 00        BRL $32 to C0/D913        [If so, Branch long to Mog {$d913}]
C0/d8e1:    C9 07            CMP $07                    [Compare Character ID against Strago] *****************************
C0/d8e3:    D0 03            BNE $03 to C0/D8E5        [Branch if not (Skips BRL to Strago)]
C0/d8e5:    82 4D 00        BRL $4D to C0/D935        [If so, Branch long to Strago ($d935)]
C0/d8e8:    C9 03            CMP $03                    [Compare Character ID against Shadow] ******************************
C0/d8ea:    D0 03            BNE $03 to C0/D8EF        [Branch if not (Skips BRL to Shadow)]
C0/d8ec:    82 68 00        BRL $68 to C0/D957        [If so, Branch long to Shadow]
C0/d8ef:    C9 08            CMP $08                    [Compare Character ID against Relm] *******************************
C0/d8f1:    D0 03            BNE $03 to C0/D8F6        [Branch if not (Skips BRL to Relm)]
C0/d8f3:    82 83 00        BRL $83 to C0/D979        [If so, Branch long to Relm]
C0/d8f6:    C9 00            CMP $00                    [Compare Character ID against Terra] ******************************
C0/d8f8:    D0 03            BNE $03 to C0/D8FD        [Branch if not (Skips BRL to Terra)]
C0/d8fa:    82 A1 00        BRL $A1 to C0/D99E        [If so, Branch long to Terra]
C0/d8fd:    C9 06            CMP $06                    [Compare Character ID against Celes] ******************************
C0/d8ff:    D0 03            BNE $03 to C0/D904        [Branch if not (Skips BRL to Celes)]
C0/d901:    82 C4 00        BRL $C4 to C0/D9C8        [If so, Branch long to Celes]
C0/d904:    C9 02            CMP $02                    [Compare Character ID against Cyan]
C0/d906:    D0 03            BNE $03 to C0/D90B        [Branch if not (Skips BRL to Cyan)]
C0/d908:    82 E7 00        BRL $E7 to C0/D9F2        [If so, Branch long to Cyan]
C0/d90b:    C9 05            CMP $05                    [Compare Character ID against Sabin]
C0/d90d:    D0 03            BNE $03 to C0/D912        [Branch if not (Skips BRL to Sabin, going to Return to Sender)]
C0/d90f:    82 07 01        BRL $107 to C0/DA19        [If so, Branch long to Sabin]
C0/d912:    60                RTS                        [Return to Sender]
[Mog Branch]
C0/d913:    A6 00            LDA $00                    [Set spell offset to the start of the list]
C0/d915:    BF 41 E3 EC        LDX $EC E3 41            [Mog's natural magic level]
                                                    [The magic table starts at $ECE340 with Mog, with every two rows being a new]
                                                    [natural caster.  The table ends with Celes's last learning level at $ECE3BF]
C0/d919:    D9 08 16        CPY $1608                [Compare against $1608, the actor's current level]
C0/d91c:    F0 02            BEQ $02 to C0/D920        [If they match, skip the next line]
C0/d91e:    B0 F2            BCS $F2 to C0/D912        [If the comparison has a carry bit, branch back to Return to Sender ($d912)]
C0/d920:    5A                PHY                        [Push Y onto the Register]
C0/d921:    BF 40 E3 EC        LDX    $EC E3 40            [Mog's natural magic spell]
C0/d925:    A8                TAY                        [Trade A and Y]
C0/d926:    A9 FF            LDA $FF                    [Load FF into the register, so that it can be saved to the spell slot.  FF is learned]
C0/d928:    99 8A 1C        STY $1C8A                [Stores learned into the caster's magic list]
                                                    [Mog's Magic list is $1C8A]  *********************************************************
C0/d92b:    7A                PLY                        [Pull Y off the Register (Should be the nat learner's current level)]
C0/d92c:    E8                INX                        [Increment X]
C0/d92d:    E8                INX                        [And again.  Moves the table to the next spell/level pair]
C0/d92e:    E0 20 00        CPX $20                    [Have 32 bytes been checked?  16 spells, 16 levels?]
C0/d931:    F0 DF            BEQ $DF to C0/D912        [If so, branch back to Return to Sender ($d912)]
C0/d933:    80 E0            BRA $E0 to C0/D915        [If not, loop back to Mog's natural magic level ($d915) to check the next spell]
[Strago Branch]
C0/d935:    A6 00            LDA $00                    [Set spell offset to the start of the list]
C0/d937:    BF 61 E3 EC        LDX $EC E3 61            [Strago's natural magic level]
C0/d93b:    D9 08 16        CPY $1608                [Compare against $1608, the actor's current level]
C0/d93e:    F0 02            BEQ $02 to C0/D942        [If they match, skip the next line]
C0/d940:    B0 D0            BCS $D0 to C0/D912        [If the comparison has a carry bit, branch back to Return to Sender ($d912)]
C0/d942:    5A                PHY                        [Push Y onto the Register]
C0/d943:    BF 60 E3 EC        LDX    $EC E3 60            [Strago's natural magic spell]
C0/d947:    A8                TAY                        [Trade A and Y]
C0/d948:    A9 FF            LDA $FF                    [Load FF into the register, so that it can be saved to the spell slot.  FF is learned]
C0/d94a:    99 E8 1B        STY $1BE8                [Strago's Magic list is $1BE8]  ******************************************************
C0/d94d:    7A                PLY                        [Pull Y off the Register (Should be the nat learner's current level)]
C0/d94e:    E8                INX                        [Increment X]
C0/d94f:    E8                INX                        [And again.  Moves the table to the next spell/level pair]
C0/d950:    E0 20 00        CPX $20                    [Have 32 bytes been checked?  16 spells, 16 levels?]
C0/d953:    F0 BD            BEQ $BD to C0/D912        [If so, branch back to Return to Sender ($d912)]
C0/d955:    80 E0            BRA $E0 to C0/D937        [If not, loop back to Strago's natural magic level ($d937) to check the next spell]
[Shadow Branch]
C0/d957:    A6 00            LDA $00                    [Set spell offset to the start of the list]
C0/d959:    BF 81 E3 EC        LDX $EC E3 81            [Shadow's natural magic level]
C0/d95d:    D9 08 16        CPY $1608                [Compare against $1608, the actor's current level]
C0/d960:    F0 02            BEQ $02 to C0/D964        [If they match, skip the next line]
C0/d962:    B0 AE            BCS $AE to C0/D912        [If the comparison has a carry bit, branch back to Return to Sender ($d912)]
C0/d964:    5A                PHY                        [Push Y onto the Register]
C0/d965:    BF 80 E3 EC        LDX    $EC E3 80            [Shadow's natural magic spell]
C0/d969:    A8                TAY                        [Trade A and Y]
C0/d96a:    A9 FF            LDA $FF                    [Load FF into the register, so that it can be saved to the spell slot.  FF is learned]
C0/d96c:    99 10 1B        STY $1B10                [Shadow's Magic list is $1B10]  *******************************************************
C0/d96f:    7A                PLY                        [Pull Y off the Register (Should be the nat learner's current level)]
C0/d970:    E8                INX                        [Increment X]
C0/d971:    E8                INX                        [And again.  Moves the table to the next spell/level pair]
C0/d972:    E0 20 00        CPX $20                    [Have 32 bytes been checked?  16 spells, 16 levels?]
C0/d975:    F0 9B            BEQ $9B to C0/D912        [If so, branch back to Return to Sender ($d912)]
C0/d977:    80 E0            BRA $E0 to C0/D959        [If not, loop back to Shadow's natural magic level ($d959) to check the next spell]
[Relm Branch]
C0/d979:    A6 00            LDA $00                    [Set spell offset to the start of the list]
C0/d97b:    BF A1 E3 EC        LDX $EC E3 A1            [Relm's natural magic level]
C0/d97f:    D9 08 16        CPY $1608                [Compare against $1608, the actor's current level]
C0/d982:    F0 02            BEQ $02 to C0/D986        [If they match, skip the next line]
C0/d984:    B0 8C            BCS $8C to C0/D912        [If the comparison has a carry bit, branch back to Return to Sender ($d912)]
C0/d986:    5A                PHY                        [Push Y onto the Register]
C0/d987:    BF A0 E3 EC        LDX    $EC E3 A0            [Relm's natural magic spell]
C0/d98b:    A8                TAY                        [Trade A and Y]
C0/d98c:    A9 FF            LDA $FF                    [Load FF into the register, so that it can be saved to the spell slot.  FF is learned]
C0/d98e:    99 1E 1C        STY $1C1E                [Relm's Magic list is $1C1E]  ********************************************************
C0/d991:    7A                PLY                        [Pull Y off the Register (Should be the nat learner's current level)]
C0/d992:    E8                INX                        [Increment X]
C0/d993:    E8                INX                        [And again.  Moves the table to the next spell/level pair]
C0/d994:    E0 20 00        CPX $20                    [Have 32 bytes been checked?  16 spells, 16 levels?]
C0/d997:    D0 03            BNE $03 to C0/D99C        [If not, skip the next line]
C0/d999:    82 76 FF        BRL $FF76 to C0/D912    [If so, long-branch back to Return to Sender ($d912)]
                                                    [Has to be a long branch because that RTS is more than -128d bytes away]
                                                    [I was a little gunshy about using other RTS commands, for fear they might]
                                                    [muddle and go back too many subroutines]
C0/d99c:    80 DD            BRA $DD to C0/D97B        [Coming back to 'if not', loop back to Relm's natural magic level ($d97b) to check the next spell]
[Terra Branch]
C0/d99e:    A6 00            LDA $00                    [Set spell offset to the start of the list]
C0/d9a0:    BF C1 E3 EC        LDX $EC E3 C1            [Terra's natural magic level]
C0/d9a4:    D9 08 16        CPY $1608                [Compare against $1608, the actor's current level]
C0/d9a7:    F0 02            BEQ $02 to C0/D9AB        [If they match, skip the next line]
C0/d9a9:    B0 02            BCS $02 to C0/D9AD        [If the comparison has a carry bit, skip the next line]
C0/d9ab:    80 03            BRA $03 to C0/D9B0        [The result of the level comparison match: skip the next line]
C0/d9ad:    82 62 FF        BRL $FF62 to C0/D912    [The result of the carry bit match: branch long back to Return to Sender ($d912)]
C0/d9b0:    5A                PHY                        [Push Y onto the Register]
C0/d9b1:    BF C0 E3 EC        LDX    $EC E3 C0            [Terra's natural magic spell]
C0/d9b5:    A8                TAY                        [Trade A and Y]
C0/d9b6:    A9 FF            LDA $FF                    [Load FF into the register, so that it can be saved to the spell slot.  FF is learned]
C0/d9b8:    99 6E 1A        STY $1A6E                [Terra's Magic list is $1A6E]  *******************************************************
C0/d9bb:    7A                PLY                        [Pull Y off the Register (Should be the nat learner's current level)]
C0/d9bc:    E8                INX                        [Increment X]
C0/d9bd:    E8                INX                        [And again.  Moves the table to the next spell/level pair]
C0/d9be:    E0 20 00        CPX $20                    [Have 32 bytes been checked?  16 spells, 16 levels?]
C0/d9c1:    D0 03            BNE $03 to C0/D9C6        [If not, skip the next line]
C0/d9c3:    82 50 FF        BRL $FF50 to C0/D912    [If so, long-branch back to Return to Sender ($d912)]
C0/d9c6:    80 D8            BRA $D8 to C0/D9A0        [Coming back to 'if not', loop back to Terra's natural magic level ($d9a0) to check the next spell]
[Celes Branch]
C0/d9c8:    A6 00            LDA $00                    [Set spell offset to the start of the list]
C0/d9ca:    BF E1 E3 EC        LDX $EC E3 E1            [Celes's natural magic level]
C0/d9ce:    D9 08 16        CPY $1608                [Compare against $1608, the actor's current level]
C0/d9d1:    F0 02            BEQ $02 to C0/D9D5        [If they match, skip the next line]
C0/d9d3:    B0 02            BCS $02 to C0/D9D7        [If the comparison has a carry bit, skip the next line]
C0/d9d5:    80 03            BRA $03 to C0/D9DA        [The result of the level comparison match: skip the next line]
C0/d9d7:    82 38 FF        BRL $FF38 to C0/D912    [The result of the carry bit match: branch long back to Return to Sender ($d912)]
C0/d9da:    5A                PHY                        [Push Y onto the Register]
C0/d9db:    BF E0 E3 EC        LDX    $EC E3 E0            [Celes's natural magic spell]
C0/d9df:    A8                TAY                        [Trade A and Y]
C0/d9e0:    A9 FF            LDA $FF                    [Load FF into the register, so that it can be saved to the spell slot.  FF is learned]
C0/d9e2:    99 B2 1B        STY $1BB2                [Celes's Magic list is $1BB2]
C0/d9e5:    7A                PLY                        [Pull Y off the Register (Should be the nat learner's current level)]
C0/d9e6:    E8                INX                        [Increment X]
C0/d9e7:    E8                INX                        [And again.  Moves the table to the next spell/level pair]
C0/d9e8:    E0 20 00        CPX $20                    [Have 32 bytes been checked?  16 spells, 16 levels?]
C0/d9eb:    D0 03            BNE $03 to C0/D9F0        [If not, skip the next line]
C0/d9ed:    82 22 FF        BRL $FF22 to C0/D912    [If so, long-branch back to Return to Sender ($d912)]
C0/d9f0:    80 D8            BRA $D8 to C0/D9CA        [Coming back to 'if not', loop back to Celes's natural magic level ($d9ca) to check the next spell]
[Cyan Branch]
C0/d9f2:    64 1B            STZ $1B
C0/d9f4:    A6 00            LDA $00                    [Set spell offset to the start of the list]
C0/d9f6:    BF 90 F4 E6        LDX $E6 F4 90            [Swordtech Levels are the first half of the BushidoBlitz list]
C0/d9fa:    D9 08 16        CPY $1608                [Compare against $1608, the actor's current level]
C0/d9fd:    F0 02            BEQ $02 to C0/DA01        [If they match, skip the next line]
C0/d9ff:    B0 0A            BCS $0A to C0/DA0B        [If the carry bit is set, branch to $da0b]
C0/da01:    E6 1B            INC $1B
C0/da03:    E8                INX
C0/da04:    E0 08 00        CPX $08                    [Have 8 bytes been checked?  8 levels for 8 SwordTechs?]
C0/da07:    F0 02            BEQ $02 to C0/DA0B        [If so, skip the next line]
C0/da09:    80 EB            BRA $EB to C0/D9F6        [Elsewise, branch back to the BushidoBlitz list ($d9f6)]
C0/da0b:    A5 1B            LDA $1B                    [Loads the value in RAM $1B]
C0/da0d:    AA                TAX                        [Trade A and X]
C0/da0e:    AD F7 1C        LDA $1CF7                [Load $1cf7, the known SwordTechs RAM location]
C0/da11:    1F 2C A2 C0        ORA $C0 A2 2C            [Conduct Bitwise OR with the currently known SwordTechs and the ones learned in this loop]
C0/da15:    8D F7 1C        STA $1CF7                [Store to $1cf7, thereby learning the new SwordTechs]
C0/da18:    60                RTS                        [Return to Sender]
[Sabin Branch]
C0/da19:    64 1B            STZ $1B
C0/da1b:    A6 00            LDA $00                    [Set spell offset to the start of the list]
C0/da1d:    BF 98 F4 E6        LDX $E6 F4 98            [Blitz Levels are the second half of the BushidoBlitz list]
C0/da21:    D9 08 16        CPY $1608                [Compare against $1608, the actor's current level]
C0/da24:    F0 02            BEQ $02 to C0/DA28        [If they match, skip the next line]
C0/da26:    B0 0A            BCS $0A to C0/DA32        [If the carry bit is set, branch to $DA32]
C0/da28:    E6 1B            INC $1B
C0/da2a:    E8                INX
C0/da2b:    E0 08 00        CPX $08                    [Have 8 bytes been checked?  8 levels for 8 Blitzes?]
C0/da2e:    F0 02            BEQ $02 to C0/DA32        [If so, skip the next line]
C0/da30:    80 EB            BRA $EB to C0/DA1D        [Elsewise, branch back to the BushidoBlitz list ($da1d)]
C0/da32:    A5 1B            LDA $1B                    [Loads the value in RAM $1B]
C0/da34:    AA                TAX                        [Trade A and X]
C0/da35:    AD 28 1D        LDA $1D28                [Load $1d28, the known Blitzes RAM location]
C0/da38:    1F 2C A2 C0        ORA $C0 A2 2C            [Conduct Bitwise OR with the currently known Blitzes and the ones learned in this loop]
C0/da3c:    8D 28 1D        STA $1D28                [Store to $1d28, thereby learning the new Blitzes]
C0/da3f:    60                RTS                        [Return to Sender]

[C2 Bank]
[Pointers]
<CHANGE>    C2/60BC: 20 B6 61    ====>    20 70 A6            JSR $61B6    ====>    JSR $a670
                                    (Handles spells or abilities learned at level-up for
                                      character.  NatAbi moves it to $A736. I changed the branch to its updated spot, $a670.)
...
[Freespace consumed: C2/a670 to C2/a749]            [I was gunshy about numbers greater than $80 being referenced in a table,]
                                                    [as I was just learning how to use Hex to add oppcodes]
                                                    [As such, this section is probably very poorly optimized]
                                                    [You may want to make some aggressive changes]
C2/a670:    A2 00 00        LDX $0000                [Set offset to start of the men's natural learning table]
C2/a673:    C9 0A            CMP $0A                    [The A register currently holds the current actor]
                                                    [Check if the current actor is Mog]  *********************************************************
C2/a675:    D0 03            BNE $03 to C2/A67A        [If not, skip the next line]
C2/a677:    4C eb a6        JMP $A6EB                [If so, jump to $a6eb]  <<Could be BRL, will need to be changed if moved to other freespace>>
                                                    [I did this hex first, which is why it's less portable]
C2/a67a:    A2 20 00        LDX $0020                [Set offset to second segement of men's natural learning table]
C2/a67d:    C9 07            CMP $07                    [Check if the current actor is Strago]  ******************************************************
C2/a67f:    D0 03            BNE $03 to C2/A684        [If not, skip the next line]
C2/a681:    4C eb a6        JMP $A6EB                [If so, jump to $a6eb]  <<will need to be changed if moved to other freespace>>
C2/a684:    A2 40 00        LDX $0040                [Set offset to third segment of men's natural learning table]
C2/a687:    C9 03            CMP $03                    [Check if the current actor is Shadow]  ******************************************************
C2/a689:    D0 03            BNE $03 to C2/A68E        [If not, skip the next line]
C2/a68b:    4C eb a6        JMP $A6EB                [If so, jump to $a6eb]  <<will need to be changed if moved to other freespace>>
C2/a68e:    A2 00 00        LDA $0000                [Set offset to start of the women's natural learning table]
C2/a691:    C9 08            CMP $08                    [Check if the current actor is Relm]  ********************************************************
C2/a693:    D0 03            BNE $03 to C2/A698        [If not, skip the next line]
C2/a695:    4C 11 a7        JMP $A711                [If so, jump to $a711]  <<Could be BRL, will need to be changed if moved to other freespace>>
C2/a698:    A2 20 00        LDA $0020                [Set offset to second segment of women's natural learning table]
C2/a69b:    C9 00            CMP $00                    [Check if the current actor is Terra]  *******************************************************
C2/a69d:    D0 03            BNE $03 to C2/A6A2        [If not, skip the next line]
C2/a69f:    4C 11 a7        JMP $A711                [If so, jump to $a711]     <<will need to be changed if moved to other freespace>>
C2/a6a2:    A2 40 00        LDA 0040                [Set offset to third segment of women's natural learning table]
C2/a6a5:    C9 06            CMP $06                    [Check if the current actor is Celes]  *******************************************************
C2/a6a7:    D0 03            BNE $03 to C2/A6AC        [If not, skip the next line]
C2/a6a9:    4C 11 a7        JMP $A711                [If so, jump to $a711]  <<will need to be changed if moved to other freespace>>
C2/a6ac:    A2 00 00        LDA $0000                [Set offset to start of the BushidoBlitz level table]
C2/a6af:    C9 02            CMP $02                    [Check if the current actor is Cyan]  ********************************************************
C2/a6b1:    D0 18            BNE $18 to C2/A6CB        [If not, branch to Sabin at $a6cb]
C2/a6b3:    20 37 A7        JSR $A737                [Jump to Subroutine to check SwordTech list.  Is something learned this level?]
                                                    <<will need to be changed if moved to other freespace>>
C2/a6b6:    D0 01            BNE $01 to C2/A6B9        [If unequal, skip the next line and continue to check]
C2/a6b8:    60                RTS                        [Return to Sender]
C2/a6b9:    0C F7 1C        TSB $1CF7                [Otherwise enable the new SwordTech]
C2/a6bc:    F0 01            BEQ $01 to C2/A6BF        [If equal, skip the next line and continue the check]
C2/a6be:    60                RTS                        [Return to Sender]
C2/a6bf:    A9 40            LDA $40
C2/a6c1:    04 F0            TSB $F0                    [Test and set bits with A?]
                                                    [OR with binary 11110000?]
C2/a6c3:    F0 01            BEQ $01 to C2/A6C6        [Was formerly an unequal check, so applying DeMorgan's makes it an equal check to skip RTS]
C2/a6c5:    60                RTS                        [Return to Sender]
C2/a6c6:    A9 42            LDA $42
C2/a6c8:    -- -- --
            <US 1_0>         C2/a6c8: 4C D4 5F        JMP $5FD4    [Vanilla location of this pointer]
            <CV Bugfixes>    C2/a6c8: 4C C5 5F        JMP $5FC5    [CV Bugfixes to C3 moves this pointer]
C2/a6cb:    A2 08 00        LDX $0008
C2/a6ce:    C9 05            CMP $05                    [Check if the current actor is Sabin]  *******************************************************
C2/a6d0:    F0 01            BEQ $01 to C2/A6D3        [If so, skip the next line]
C2/a6d2:    60                RTS                        [Return to Sender]
C2/a6d3:    20 37 A7        JSR $A773                [Check Blitz list.  Is something learned this level?]  <<will need to be changed if moved to other freespace>>
C2/a6d6:    D0 01            BNE $01 to C2/A6D9        [If unequal, skip the next line and continue to check]
C2/a6d8:    60                RTS                        [Return to Sender]
C2/a6d9:    0C 28 1D        TSB $1D28                [Otherwise enable the new Blitz]
C2/a6dc:    F0 01            BEQ $01 to C2/A6DF        [If equal, skip the next line and continue to check]
C2/a6de:    60                RTS                        [Return to Sender]
C2/a6df:    A9 80            LDA $80
C2/a6e1:    04 F0            TSB $F0
C2/a6e3:    F0 01            BEQ $01 to C2/A6E6        [Was formerly an unequal check, so applying DeMorgan's makes it an equal check to skip RTS]
C2/a6e5:    60                RTS                        [Return to Sender]
C2/a6e6:    A9 33            LDA $33
C2/a6e8:    -- -- --
            <US 1_0>         C2/a6e8: 4C D4 5F        JMP $5FD4    [Vanilla location of this pointer]
            <CV Bugfixes>     C2/a6e8: 4C C5 5F        JMP $5FC5    [CV Bugfixes to C3 moves this pointer]
[Men's Natural Magic Recruitment]
<Split into Men and Women out of coincidence of the order spell lists were added, has no actual bearing on how this works>
C2/a6eb:    5A                PHY                        [Push Y onto the register]
C2/a6ec:    EB                XBA                        [Trade the low and high bytes of A]
C2/a6ed:    A0 10 00        LDX    $0010                [Check 16 bytes]
C2/a6f0:    DF 41 E3 EC        CPX $EC E3 41            [Start of Men's Magic levels (Mog's Levels)] <This is the only thing I changed>
C2/a6f4:    D0 14            BNE $14 to C2/A70A        [If no spell is learned this level, branch to check another one]
C2/a6f6:    48                PHA                        [Push A onto the register]
C2/a6f7:    5A                PHY                        [Push Y onto the register (again?)]
C2/a6f8:    7B                TDC                        [Transfer D to C?]
C2/a6f9:    BF 40 E3 EC        LDX $EC E3 40            [Start of Men's Magic spells (Mog's Spells)] <Well... and this>
C2/a6fd:    A8                TAY                        [Exchange A and Y]
C2/a6fe:    B1 F4            LDY $F4                    [Check Spell Learning Progress]
C2/a700:    C9 FF            CMP $FF                    [Compare against FF, learned]
C2/a702:    F0 04            BEQ $04 to C2/A708        [Branch if so]
C2/a704:    A9 80            LDA $80
C2/a706:    91 F4            STY $F4                    [Set spell as learned]
C2/a708:    7A                PLY                        [Pull Y off the register]
C2/a709:    68                PLA                        [Pull A off the register]
C2/a70a:    E8                INX                        [Increment X]
C2/a70b:    E8                INX                        [And Again]
C2/a70c:    88                DEY                        [Decrement Y]
C2/a70d:    D0 E1            BNE $E1 to C2/A6F0        [Branch back to $a6f0 if not equal, to check another spell]
C2/a70f:    7A                PLY                        [Pull Y off the register]
C2/a710:    60                RTS                        [Return to Sender]
[Women's Natural Magic Recruitment] <Need two because of signed values>
C2/a711:    5A                PHY                        [Push Y onto the register]
C2/a712:    EB                XBA                        [Trade the low and high bytes of A]
C2/a713:    A0 10 00        LDX    $0010                [Check 16 bytes]
C2/a716:    DF A1 E3 EC        CPX $EC E3 A1            [Start of Women's Magic levels (Relm's Levels)]
C2/a71a:    D0 14            BNE $14 to C2/A730        [If no spell is learned this level, branch to check another one]
C2/a71c:    48                PHA                        [Push A onto the register]
C2/a71d:    5A                PHY                        [Push Y onto the register (again?)]
C2/a71e:    7B                TDC                        [Transfer D to C?]
C2/a71f:    BF A0 E3 EC        LDX $EC E3 A0            [Start of Women's Magic spells (Relm's Spells)]
C2/a723:    A8                TAY                        [Exchange A and Y]
C2/a724:    B1 F4            LDY $F4                    [Compare against FF, learned]
C2/a726:    C9 FF            CMP $FF                    [Compare against FF, learned]
C2/a728:    F0 04            BEQ $04 to C2/A72E        [Branch if so]
C2/a72a:    A9 80            LDA $80
C2/a72c:    91 F4            STY $F4                    [Set spell as learned]
C2/a72e:    7A                PLY                        [Pull Y off the register]
C2/a72f:    68                PLA                        [Pull A off the register]
C2/a730:    E8                INX                        [Increment X]
C2/a731:    E8                INX                        [And Again]
C2/a732:    88                DEY                        [Decrement Y]
C2/a733:    D0 E1            BNE $E1 to C2/A716        [Branch back to $a716 if not equal, to check another spell]
C2/a735:    7A                PLY                        [Pull Y off the register]
C2/a736:    60                RTS                        [Return to Sender]
[BushidoBlitz Recruitment]
C2/a737:    A9 01            LDA $01
C2/a739:    85 EE            STA $EE                    [start by marking BushidoBlitz #0]
C2/a73b:    EB                XBA                        [get current level from top of A?]
C2/a73c:    DF 90 F4 E6        CPX $E6 F4 90            [BushidoBlitz Level List]
C2/a740:    F0 05            BEQ $05 to C2/A747        [Branch if the level matches]
C2/a742:    E8                INX                        [Increment X to check the next learning level]
C2/a743:    06 EE            ASL $EE                    [Arithmetic Shift Left: Mark next BushidoBlitz to be learned instead]
C2/a745:    90 F5            BCC $F5 to C2/6227        [Branch on Carry Clear: If Carry is Set we've checked all 8 to no avail]
C2/a747:    A5 EE            LDA $EE                    [Get the BushidoBlitz bitfield, where the bit corresponds to the move learned]
C2/a749:    60                RTS                        [Return to Sender]


[EC Bank]
[Freespace consumed: EC/e340 to EC/e3bf]
[Spell lists {At $ECE340}]
EC/e340:
[Mog]
17 01 02 02 32 07 12 0B 24 10 06 14 19 1B 20 21
2D 24 0A 28 1F 2D 27 32 28 3A 21 4B 51 53 0F 63
[Strago]
00 01 01 02 02 03 03 04 24 07 05 1A 04 1C 07 1E
06 21 2D 26 0C 28 0D 2A 0E 2C 31 5A 30 5C 1F 5E
[Shadow]
12 01 13 07 20 1F 32 22 2D 29 14 2D 19 34 1A 38
1C 3B 0E 3E 1D 3F 16 42 1B 44 2C 49 32 52 2F 5A
[Relm]
24 01 29 03 03 08 15 0C 2D 12 07 16 2C 1A 25 20
0E 23 1E 28 0B 2E 26 34 22 3C 2F 49 21 52 23 61
[Terra]
24 01 00 03 2D 04 12 0C 27 12 04 16 25 1A 2A 21
31 25 08 2B 2E 31 10 39 1D 44 0D 4B 0F 56 11 63
[Celes]
01 01 24 04 28 08 14 0D 2B 12 05 16 2D 1A 25 1E
30 20 1C 22 09 2A 2E 30 34 34 0C 48 33 51 35 62

The only way to set the learnsets for Relm, Shadow, Strago, and Mog is through hex-editing.  Use an editor to set up Terra's natural spells the way you wish
the target caster to learn them, then copy EC/E3C0-EC/E3DF and paste it over the corresponding caster.  Once you've done this for all spells desired, set Terra
up again with her own learnset.

I've been told the way I comment on notes is confusing, so you don't have to understand all or any of that to work with it.  It should work fine if you just use HxD to plug in the raw hex to what you've already patched: try it on a copy of your project and then load a save before Thamasa (so you can check that Strago and Relm's recruitment gives them spells).
  Find
Quote  
[-] The following 1 user says Thank You to C-Dude for this post:
  • MoisésDGT (09-15-2019)



Messages In This Thread
Strago natural magic - by MoisésDGT - 09-14-2019, 08:45 PM
RE: Strago natural magic - by C-Dude - 09-15-2019, 12:05 AM
RE: Strago natural magic - by MoisésDGT - 09-15-2019, 08:12 AM
RE: Strago natural magic - by C-Dude - 09-15-2019, 02:22 PM
RE: Strago natural magic - by MoisésDGT - 09-15-2019, 02:58 PM
RE: Strago natural magic - by C-Dude - 09-15-2019, 03:26 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite