øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1040.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexec9a.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=8.320e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexec9a.html.zx(h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ °VG:OKtext/htmlISO-8859-1gzip@øÕG:ÿÿÿÿÿÿÿÿWed, 11 Mar 2020 00:07:57 GMT0ó°° ®0®P®€§²ð®(h^ÿÿÿÿÿÿÿÿ)G: Natural Magic

Author Topic: Natural Magic  (Read 6920 times)

Poco Loco

  • Cagnazzo
  • *
  • Posts: 356
  • Gender: Male
    • View Profile
    • FF6hacking.com
Natural Magic
« on: June 02, 2009, 11:13:36 PM »
OK I'm not sure if this was put up yet in a pole, but I know you guys were working on giving some characters the ability to learn magic naturally, I want to know how exactly were you guys able to pull it off, not only that, but can you also surpass the number of spells characters learn naturally (ex: FF3USME provides Terra and Celes with 16 natural magic spells) to 20?

plz give me some feedback guys :)
"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"

-HNIC

Lenophis

  • Forum Overlord
  • *
  • Posts: 1,688
  • Gender: Male
  • I sad
    • View Profile
    • Slick Productions
Re: Natural Magic
« Reply #1 on: June 02, 2009, 11:46:51 PM »
You need to hook some code, here:

Code: [Select]
Teach Natural Abilities learned via Automatic Level-Up
C0/A17F: B90016  LDA $1600,Y    (character ID)
C0/A182: C900    CMP #$00       (is character Terra? note there's no need for this CMP here)
C0/A184: F010    BEQ $A196      (branch if so)
C0/A186: C906    CMP #$06       (is character Celes?)
C0/A188: F02E    BEQ $A1B8      (branch if so)
C0/A18A: C902    CMP #$02       (is character Cyan?)
C0/A18C: F04C    BEQ $A1DA      (branch if so)
C0/A18E: C905    CMP #$05       (is character Sabin?)
C0/A190: D003    BNE $A195      (branch if not)
C0/A192: 4C01A2  JMP $A201
C0/A195: 60      RTS
 
Fork: Terra's Spell list
C0/A196: A600    LDX $00
C0/A198: BFC1E3EC LDA $ECE3C1,X  (Natural Magic Level)
C0/A19C: D90816  CMP $1608,Y    (compare it to her current level)
C0/A19F: F002    BEQ $A1A3      (branch if they are the same)
C0/A1A1: B0F2    BCS $A195      (branch if her level is lower)
C0/A1A3: 5A      PHY
C0/A1A4: BFC0E3EC LDA $ECE3C0,X  (Natural Magic Spell)
C0/A1A8: A8      TAY
C0/A1A9: A9FF    LDA #$FF
C0/A1AB: 996E1A  STA $1A6E,Y    (set spell as learned)
C0/A1AE: 7A      PLY
C0/A1AF: E8      INX
C0/A1B0: E8      INX
C0/A1B1: E02000  CPX #$0020     (have we checked 16 spells yet?)
C0/A1B4: F0DF    BEQ $A195      (branch if so)
C0/A1B6: 80E0    BRA $A198      (otherwise loop and keep learning)

Fork: Celes's Spell list
C0/A1B8: A600    LDX $00
C0/A1BA: BFE1E3EC LDA $ECE3E1,X  (Natural Magic Level)
C0/A1BE: D90816  CMP $1608,Y    (compare it to her current level)
C0/A1C1: F002    BEQ $A1C5      (branch if they are the same)
C0/A1C3: B0D0    BCS $A195      (branch if her level is lower)
C0/A1C5: 5A      PHY
C0/A1C6: BFE0E3EC LDA $ECE3E0,X  (Natural Magic Spell)
C0/A1CA: A8      TAY
C0/A1CB: A9FF    LDA #$FF
C0/A1CD: 99B21B  STA $1BB2,Y    (set spell as learned)
C0/A1D0: 7A      PLY
C0/A1D1: E8      INX
C0/A1D2: E8      INX
C0/A1D3: E02000  CPX #$0020     (have we checked 16 spells yet?)
C0/A1D6: F0BD    BEQ $A195      (branch if so)
C0/A1D8: 80E0    BRA $A1BA      (otherwise loop and keep learning)

Fork: Cyan's SwdTech list
C0/A1DA: 641B    STZ $1B
C0/A1DC: A600    LDX $00
C0/A1DE: BF90F4E6 LDA $E6F490,X (Natural SwdTechs)
C0/A1E2: D90816  CMP $1608,Y
C0/A1E5: F002    BEQ $A1E9
C0/A1E7: B00A    BCS $A1F3
C0/A1E9: E61B    INC $1B
C0/A1EB: E8      INX
C0/A1EC: E00800  CPX #$0008
C0/A1EF: F002    BEQ $A1F3
C0/A1F1: 80EB    BRA $A1DE
C0/A1F3: A51B    LDA $1B
C0/A1F5: AA      TAX
C0/A1F6: ADF71C  LDA $1CF7      (known SwdTech's)
C0/A1F9: 1F2CA2C0 ORA $C0A22C,X
C0/A1FD: 8DF71C  STA $1CF7      (new known SwdTech's)
C0/A200: 60      RTS
 
Fork: Sabin's Blitz list
C0/A201: 641B    STZ $1B
C0/A203: A600    LDX $00
C0/A205: BF98F4E6 LDA $E6F498,X  (Natural Blitzes)
C0/A209: D90816  CMP $1608,Y
C0/A20C: F002    BEQ $A210
C0/A20E: B00A    BCS $A21A
C0/A210: E61B    INC $1B
C0/A212: E8      INX
C0/A213: E00800  CPX #$0008
C0/A216: F002    BEQ $A21A
C0/A218: 80EB    BRA $A205
C0/A21A: A51B    LDA $1B
C0/A21C: AA      TAX
C0/A21D: AD281D  LDA $1D28      (known Blitzes)
C0/A220: 1F2CA2C0 ORA $C0A22C,X
C0/A224: 8D281D  STA $1D28      (new known Blitzes)
C0/A227: 60      RTS

Adding more spells naturally is fairly simple, though you will have to move the data (and then it won't work in FF3usME). Then you need to change CPX #$0020 to a number higher (0x0020 is 32 in hex, to check for 16 spells since each piece of that data is 2 bytes). Changing it to an odd number will cause an infinite loop and freeze the game.

To add more characters, you need to add more checks at the beginning of that code mess. After that, you'll need to add code for new characters to teach them new magic. There's no room here, so you'll have to go near the end of the bank. Note that any character added will not work with FF3usME. There's probably something else I'm forgetting, too. :isuck:

119 bugs fixed and counting.

Poco Loco

  • Cagnazzo
  • *
  • Posts: 356
  • Gender: Male
    • View Profile
    • FF6hacking.com
Re: Natural Magic
« Reply #2 on: June 03, 2009, 12:06:44 AM »
ur the fukkin MAN Leno thnx :)

well I'll be sure to look into it and I'll go from there, when u remember what u r missing let me kno :D
"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"

-HNIC

Imzogelmo

  • Ogopogo Aficianado
  • *
  • Posts: 241
  • Gender: Male
  • Ask me about my other job.
    • View Profile
    • NEPROMR
Re: Natural Magic
« Reply #3 on: June 03, 2009, 12:33:35 AM »
Note that Leno's code will only fix the "automatic" level ups that occur from averaging levels... To get them all, you also have to do the level ups that occur in battle. That code is here:

Code: [Select]
(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
5/31/16 - I have an assembly of the battle portion of C2, relocated to the F0 bank, which has both vanilla and patch code in my dropbox. I'll be updating it with additional patches as I have time. I will *not* be releasing it publicly, but ask me for the link and I'll share.

Odbarc

  • Hell's Rider
  • *
  • Posts: 424
  • Gender: Male
  • FF6 obsessed
    • View Profile
    • Newage3.com, a text based web game RPG I Admin.
Re: Natural Magic
« Reply #4 on: June 03, 2009, 12:37:47 AM »
Quote
To add more characters, you need to add more checks at the beginning of that code mess.

You can add more characters?

Imzogelmo

  • Ogopogo Aficianado
  • *
  • Posts: 241
  • Gender: Male
  • Ask me about my other job.
    • View Profile
    • NEPROMR
Re: Natural Magic
« Reply #5 on: June 03, 2009, 01:16:41 AM »
He's saying that if you want to add to the list of characters that have immanent magic, then you have to code functions that check for their ID and then look up *their* list (which you'd have to create).
5/31/16 - I have an assembly of the battle portion of C2, relocated to the F0 bank, which has both vanilla and patch code in my dropbox. I'll be updating it with additional patches as I have time. I will *not* be releasing it publicly, but ask me for the link and I'll share.

Poco Loco

  • Cagnazzo
  • *
  • Posts: 356
  • Gender: Male
    • View Profile
    • FF6hacking.com
Re: Natural Magic
« Reply #6 on: June 03, 2009, 01:59:14 AM »
ah I see what you mean, but will there be enough space in the rom itself when I add all of this?

because I also want 2 tweak/add some events in my hack as well
"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"

-HNIC

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Natural Magic
« Reply #7 on: June 03, 2009, 04:09:52 PM »
You can easily expand the ROM to 32Mb (4MB, note the difference) to store more data, but I believe you should be able to find enough free space to add more code and level up spell lists without doing any expansion if you don't want to.

Poco Loco

  • Cagnazzo
  • *
  • Posts: 356
  • Gender: Male
    • View Profile
    • FF6hacking.com
Re: Natural Magic
« Reply #8 on: June 03, 2009, 05:56:08 PM »
if I expand the rom will there be any complications when editing it?
"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"

-HNIC

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Natural Magic
« Reply #9 on: June 03, 2009, 06:32:58 PM »
No, until you make use of it the only change will be the filesize.

Poco Loco

  • Cagnazzo
  • *
  • Posts: 356
  • Gender: Male
    • View Profile
    • FF6hacking.com
Re: Natural Magic
« Reply #10 on: June 03, 2009, 07:17:55 PM »
ah I see

so then I can use Lunar Expand then right?
"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"

-HNIC

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Natural Magic
« Reply #11 on: June 04, 2009, 09:30:34 AM »
Yeah.

Odbarc

  • Hell's Rider
  • *
  • Posts: 424
  • Gender: Male
  • FF6 obsessed
    • View Profile
    • Newage3.com, a text based web game RPG I Admin.
Re: Natural Magic
« Reply #12 on: June 04, 2009, 11:41:53 AM »
No, until you make use of it the only change will be the filesize.

So, is the size increase you can do with FF3 ME (Lord J's) necessary or do you have enough rom space to change everything without ever needing it? (Change, not add)

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Natural Magic
« Reply #13 on: June 04, 2009, 03:27:37 PM »
Oh, I forgot about FF3usME being able to expand the ROM as well, that feature wasn't in place back when we started Pandora's Box. FF3usME should expand it to the same size (32Mb), but you obviously can't use any of the space it expects to be able to use. Take a look at the documentation and it should tell you what offsets will be used.

Lenophis

  • Forum Overlord
  • *
  • Posts: 1,688
  • Gender: Male
  • I sad
    • View Profile
    • Slick Productions
Re: Natural Magic
« Reply #14 on: June 10, 2009, 03:56:46 AM »
Note that Leno's code will only fix the "automatic" level ups that occur from averaging levels... To get them all, you also have to do the level ups that occur in battle. That code is here:
And that would be what I forgot. :isuck:

119 bugs fixed and counting.