FF6 Hacking
Natural Magic for more than 2 people? - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html)
+--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html)
+--- Thread: Natural Magic for more than 2 people? (/thread-2855.html)



Natural Magic for more than 2 people? - Pingurules - 04-26-2015

Basically I want more than 2 people to learn natural magic, is this possible or is it really hard to do? If it is the latter, I'll just stop trying and move on to another aspect.Laugh

(also I'm back)


RE: Natural Magic for more than 2 people? - madsiur - 04-26-2015

Possible yes, "hard to do" it depends of your skills. If you don't want to learn basic ASM and look up disassemblies, I suggest you move on. Otherwise I can come up with a more elaborated answer.


RE: Natural Magic for more than 2 people? - Pingurules - 04-27-2015

I'll have to learn ASM and/or disassemblies sooner or later for my FFIV hack, so I might as well.
EDIT:... anyone? Sad


RE: Natural Magic for more than 2 people? - m06 - 06-02-2015

Start by trying to move and expand the following table:

2CE5C0 2CE5FF DATA "Natural magic table: spell then level: 16 for Terra, then 16 for Celes" 9/9/2002

The natural spell learning happens in the C2 bank.
Here is a link to a C2 bank disassembly by NovaliaSpirit:
https://dl.dropboxusercontent.com/u/128528/FFVI/ff6_bank_C2_NovaliaSpirit.txt


Here is the routine that specifically teaches the magic:
Code:
(Terra and Celes natural magic learning at level up)

C2/61FC: 5A           PHY
C2/61FD: EB           XBA
C2/61FE: A0 10 00     LDY #$0010     (check a total of 32 bytes, as Terra and Celes
                                      each have a 16-element spell list, with
                                      2 bytes per element [spell #, then level] )
C2/6201: DF C1 E3 EC  CMP $ECE3C1,X  (Terra/Celes level-up spell list: Level at
                                      which spell learned)
C2/6205: D0 14        BNE $621B      (if this level isn't one where the character
                                      learns a spell, branch to check the next
                                      list element)
C2/6207: 48           PHA
C2/6208: 5A           PHY
C2/6209: 7B           TDC            (Clear 16-bit A)
C2/620A: BF C0 E3 EC  LDA $ECE3C0,X  (Terra/Celes level-up spell list: Spell number)
C2/620E: A8           TAY
C2/620F: B1 F4        LDA ($F4),Y    (?? check entry in spell list ??)
C2/6211: C9 FF        CMP #$FF      
C2/6213: F0 04        BEQ $6219    
C2/6215: A9 80        LDA #$80
C2/6217: 91 F4        STA ($F4),Y
C2/6219: 7A           PLY
C2/621A: 68           PLA
C2/621B: E8           INX
C2/621C: E8           INX            (check next spell and level pair)
C2/621D: 88           DEY
C2/621E: D0 E1        BNE $6201
C2/6220: 7A           PLY
C2/6221: 60           RTS

This routine does not need to be modified directly, the X register should be loaded with an index for the natural spell table, and then this routine runs. So no need to edit here, just read the routine briefly and know where the action happens (the offset).

So we need to see how X is set before entering this routine. Consider the following block:
Code:
C2/61B6: A2 00 00     LDX #$0000   (point to start of Terra's magic learned at
                                    level up block)
C2/61B9: C9 00        CMP #$00     (is it character #0, Terra?)
C2/61BB: F0 3F        BEQ $61FC    (if yes, branch to see if she learns any spells)
C2/61BD: A2 20 00     LDX #$0020   (point to start of Celes' magic learned at
                                    level up block)
C2/61C0: C9 06        CMP #$06     (is it character #6, Celes?)
C2/61C2: F0 38        BEQ $61FC    (if yes, branch to see if she learns any spells)

So this is the code you need to expand and make similar 3 line entries (LDX, CMP, BEQ) for each character you want to have naturally learn magic.