øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1803.msg18166e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index6f7c.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1803.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index6f7c.html.zxGUg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ@>{ OKtext/htmlISO-8859-1gzip8:Ö{ ÿÿÿÿÿÿÿÿTue, 10 Mar 2020 09:08:47 GMT0ó°° ®0®P®€§²ð®GUg^-{  Monster Attacks/Spells

Author Topic: Monster Attacks/Spells  (Read 1774 times)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Monster Attacks/Spells
« on: January 23, 2013, 08:39:37 AM »
I'm trying to make a Blue Mage, but I'm having trouble with the 6/8 character monster spell name issue.

on this thread: http://slickproductions.org/forum/index.php?topic=1713.60 Dragonsbrethren suggested shortening the names to six letters, then making a separate 8-letter name list to show up in the top-right when the spell is cast.  As it turns out, there is just about exactly enough blank space after the end of the spell name bank to do all of this, but I don't know how to change the spell routine to start reading at a different spot.  I figure there must be a pointer (or set of pointers?) somewhere, but I can't find that info documented anywhere.

Alternate, acceptable solutions I have thought of (but also can't figure out how to implement) would be:

-Make the spell name that shows up when the spell is cast 6 letters instead of 8

-make the spell name not show up at all when the spell is cast (which happens for some - but not all - by default. this is my least favorite solution)

Any thoughts/ideas/info?

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,429
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: Monster Attacks/Spells
« Reply #1 on: January 23, 2013, 12:05:01 PM »
Didn't J2e relocate the spell (and item) names elsewhere then repointed the data?

I would love to relocate and use linger magic spell names as well...

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Monster Attacks/Spells
« Reply #2 on: January 23, 2013, 01:06:19 PM »
The menu code is fine. Leave the six character spells where they currently are and redo all of the enemy spells you want to be six characters. For the name display in battle, you're in luck since the game actually has two different loading routines, so it's pretty painless to do this hack.

Here's the relevant code:

Code: [Select]
$02/CB95 AD C8 34    LDA $34C8  [$7E:34C8]   A:0040 X:0004 Y:6400 P:envMxdiZC
$02/CB98 D0 01       BNE $01    [$CB9B]      A:0023 X:0004 Y:6400 P:envMxdizC
$02/CB9B C9 48       CMP #$48                A:0023 X:0004 Y:6400 P:envMxdizC
$02/CB9D 90 25       BCC $25    [$CBC4]      A:0023 X:0004 Y:6400 P:eNvMxdizc

; load eight character spell name ---------------------------------------------
$02/CB9F 38          SEC                     A:0051 X:0004 Y:0012 P:envMxdizC
$02/CBA0 E9 48       SBC #$48                A:0051 X:0004 Y:0012 P:envMxdizC
$02/CBA2 85 26       STA $26    [$00:0026]   A:0009 X:0004 Y:0012 P:envMxdizC
$02/CBA4 A9 08       LDA #$08                A:0009 X:0004 Y:0012 P:envMxdizC
$02/CBA6 85 28       STA $28    [$00:0028]   A:0008 X:0004 Y:0012 P:envMxdizC
$02/CBA8 20 60 85    JSR $8560  [$02:8560]   A:0008 X:0004 Y:0012 P:envMxdizC

$02/CBAB A6 2A       LDX $2A    [$00:002A]   A:0009 X:0004 Y:0012 P:envMxdizc
$02/CBAD 7B          TDC                     A:0009 X:0048 Y:0012 P:envMxdizc
$02/CBAE A8          TAY                     A:0000 X:0048 Y:0012 P:envMxdiZc
$02/CBAF BF B0 8A 0F LDA $0F8AB0,x[$0F:8AF8] A:0000 X:0048 Y:0000 P:envMxdiZc
$02/CBB3 99 FD 74    STA $74FD,y[$7E:74FD]   A:0044 X:0048 Y:0000 P:envMxdizc
$02/CBB6 C8          INY                     A:0044 X:0048 Y:0000 P:envMxdizc
$02/CBB7 E8          INX                     A:0044 X:0048 Y:0001 P:envMxdizc
$02/CBB8 C0 08 00    CPY #$0008              A:0044 X:0049 Y:0001 P:envMxdizc
$02/CBBB D0 F2       BNE $F2    [$CBAF]      A:0044 X:0049 Y:0001 P:eNvMxdizc
$02/CBBD 7B          TDC                     A:00FF X:0050 Y:0008 P:envMxdiZC
$02/CBBE 99 FD 74    STA $74FD,y[$7E:7505]   A:0000 X:0050 Y:0008 P:envMxdiZC
$02/CBC1 4C A0 BC    JMP $BCA0  [$02:BCA0]   A:0000 X:0050 Y:0008 P:envMxdiZC

; load six character spell name ------------------------------------------------
$02/CBC4 AD C8 34    LDA $34C8  [$7E:34C8]   A:0023 X:0004 Y:6400 P:eNvMxdizc
$02/CBC7 85 26       STA $26    [$00:0026]   A:0023 X:0004 Y:6400 P:envMxdizc
$02/CBC9 A9 06       LDA #$06                A:0023 X:0004 Y:6400 P:envMxdizc
$02/CBCB 85 28       STA $28    [$00:0028]   A:0006 X:0004 Y:6400 P:envMxdizc
$02/CBCD 20 60 85    JSR $8560  [$02:8560]   A:0006 X:0004 Y:6400 P:envMxdizc

$02/CBD0 7B          TDC                     A:0034 X:0004 Y:6400 P:envMxdizc
$02/CBD1 A8          TAY                     A:0000 X:0004 Y:6400 P:envMxdiZc
$02/CBD2 A6 2A       LDX $2A    [$00:002A]   A:0000 X:0004 Y:0000 P:envMxdiZc
$02/CBD4 A9 03       LDA #$03                A:0000 X:00D2 Y:0000 P:envMxdizc
$02/CBD6 99 FD 74    STA $74FD,y[$7E:74FD]   A:0003 X:00D2 Y:0000 P:envMxdizc
$02/CBD9 C8          INY                     A:0003 X:00D2 Y:0000 P:envMxdizc
$02/CBDA BF 00 89 0F LDA $0F8900,x[$0F:89D2] A:0003 X:00D2 Y:0001 P:envMxdizc
$02/CBDE 99 FD 74    STA $74FD,y[$7E:74FE]   A:003F X:00D2 Y:0001 P:envMxdizc
$02/CBE1 C8          INY                     A:003F X:00D2 Y:0001 P:envMxdizc
$02/CBE2 E8          INX                     A:003F X:00D2 Y:0002 P:envMxdizc
$02/CBE3 C0 07 00    CPY #$0007              A:003F X:00D3 Y:0002 P:envMxdizc
$02/CBE6 D0 F2       BNE $F2    [$CBDA]      A:003F X:00D3 Y:0002 P:eNvMxdizc
$02/CBE8 7B          TDC                     A:0081 X:00D8 Y:0007 P:envMxdiZC
$02/CBE9 99 FD 74    STA $74FD,y[$7E:7504]   A:0000 X:00D8 Y:0007 P:envMxdiZC
$02/CBEC 4C A0 BC    JMP $BCA0  [$02:BCA0]   A:0000 X:00D8 Y:0007 P:envMxdiZC

chilly, all you're interested in is this:

Code: [Select]
$02/CBAF BF B0 8A 0F LDA $0F8AB0,x
This is the code loading the eight character names. The offset is in SNES LoROM SlowROM format (WindHex can show offsets as this, there's Lunar Address, probably other programs to convert if you're not familiar with it). All you need to do is change that to another offset where you've placed the eight character names and you're good to go.

JCE, this isn't going to be as extensive as what J2e did. If you want the text window changes and ridiculously long names, you're on your own. This'll give normal spells eight characters when cast; they'll still use six in the menu.

Code: [Select]
$02/CB9B C9 48       CMP #$48
$02/CB9D 90 25       BCC $25

This is what's checking if the spell value is below $48. NOP it all out ($EA).

Code: [Select]
$02/CB9F 38          SEC
$02/CBA0 E9 48       SBC #$48

This is subtracting $48 from the spell value. This is because they started the eight character names at index 0 to save ROM space. NOP it out as well.  Conveniently, the previous code runs directly into this, so you're basically going to 2/CB9B and typing $EA seven times.

Code: [Select]
$02/CBAF BF B0 8A 0F LDA $0F8AB0,x
Same as chilly's example, except you've got to have all of the spell names at the new offset.

 :edit:

Remember that the spells start with a blank entry. Doesn't matter for chilly's hack (because everything was already set up to handle it properly), but JCE, you're starting with a blank eight character entry, not <white>Hold.
« Last Edit: January 23, 2013, 01:39:52 PM by Dragonsbrethren »

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,429
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: Monster Attacks/Spells
« Reply #3 on: January 23, 2013, 02:27:19 PM »
Cool, this is excellent!  Thanks man. This should prove useful for my hack.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Monster Attacks/Spells
« Reply #4 on: January 23, 2013, 02:38:09 PM »
Thanks! You don't even want to know the ridiculous and time-consuming workaround I was going to try if this didn't surface...

 :edit:Works like a charm (but don't worry, I'm attacking my friends). Thanks!
Plus I learned about LoROM SloROM offsets, which will probably also prove useful, so thanks for that, too.
« Last Edit: January 24, 2013, 08:34:05 AM by chillyfeez »