Users browsing this thread: 1 Guest(s)
Adapting Angelo's Name Patch
08-10-2018, 09:27 AM
I only wanted select parts of the patch and had to change the bank they stored names in, so I used the patch notes in SilentEnigma's version to grab them. I began to the Spell Names path and it worked for the names, but the spell window did not. I double checked my code against the design doc and a rom patched with SE's patch, and it is identical, so not sure where to go from here. Below is the spell window code that SE's patch changes, as listed in his doc.
Code:
Position of Spell list in battle
Original Code (discontinuous):
C2/E237: 05 03 04 21
C2/E23C: FF FF 04 21
C3/4FB5: A00700 LDY #$0007 ; spell letter length
C3/4FBA: A067F5 LDY #$F567 ; spell name address
C3/4FBF: A9E6 LDA #$E6 ; spell name bank
C3/5052: A2929E LDX #$9E92 ; position of spell progress
C3/5AF9: A2929E LDX #$9E92 ; space between spell name and ':'
C3/5027: A00B00 LDY #$000B
Modified Code (discontinuous):
C2/E237: 01 FF 04 21
C2/E23C: 00 FF 16 01
C3/4FB5: A00900 LDY #$0009 ; spell letter length
C3/4FBA: A00000 LDY #$0000 ; spell name address
C3/4FBF: A9F2 LDA #$F2 ; spell name bank
C3/5052: A2949E LDX #$9E94 ; position of spell progress
C3/5AF9: A2949E LDX #$9E94 ; space between spell name and ':'
C3/5027: A00D00 LDY #$000D
I don't have time to test this but I can leave some info here. That #$9E94 might be a starting position so maybe reverting to #$9E92?
I would check if any of these offsets are changed too, this is the whole battle menu data for positioning and size (and maybe more):
Code:
(Magic menu drawing script.)
C2/E036: 05 03 (Draw 3 spaces)
C2/E038: 04 21 (Change tile palette to #$21)
C2/E03A: 0F 00 (Draw spell name)
C2/E03C: FF FF (Draw 2 spaces)
C2/E03E: 04 21 (Change tile palette to #$21)
C2/E040: 0F 00 (Draw spell name)
C2/E042: 05 0A (Draw 10 spaces)
C2/E044: 00 (End script)
I would check if any of these offsets are changed too, this is the whole battle menu data for positioning and size (and maybe more):
Code:
// windows sizes and positions
// 32-bit data called from C1/53AC.
C2/DD9E: 0C 08 15 8D // enemy name window
C2/DDA2: 12 08 2D 8D // character name / HP window
C2/DDA6: 0A 08 17 8D // skill window
C2/DDAA: 1E 08 15 8D
C2/DDAE: 1E 08 15 8D
C2/DDB2: 09 08 3F 8D
C2/DDB6: 1E 05 15 8D
C2/DDBA: 15 08 15 8D
C2/DDBE: 1E 04 15 8D
C2/DDC2: 07 04 13 8D
C2/DDC6: 0C 05 13 8D
C2/DDCA: 1E 04 C1 A9
C2/DDCE: 12 04 CD A9
C2/DDD2: 12 07 17 8D
C2/DDD6: 0C 08 17 8D
// unknown table
64-bit data.. This is called from a few places in a function located at C1/5165
C2/DDDA: 75 4E 51 4D 08 00 00 00
C2/DDE2: 75 4F 51 4D 08 00 00 00
C2/DDEA: D5 51 61 4D 08 00 00 00
C2/DDF2: D5 53 61 4D 05 00 00 00
C2/DDFA: 75 54 61 4D 06 00 00 00
C2/DE02: 75 4F 51 4D 05 00 00 00
C2/DE0A: 95 4F 71 4D 05 00 00 00
C2/DE12: C5 4F A1 4D 05 00 00 00
C2/DE1A: F5 4F D1 4D 05 00 00 00
C2/DE22: 75 4F 51 4D 06 00 00 00
C2/DE2A: 95 50 71 4D 08 00 00 00
// unknown table
// 32-bit data... This is called from a few places in a function located at C1/50FB
C2/DE32: 5C 02 08 00
C2/DE36: 5C 02 08 00
C2/DE3A: 6C 02 08 00
C2/DE3E: 6C 02 08 00
C2/DE42: 6C 02 08 00
C2/DE46: 7C 02 05 00
C2/DE4A: 6C 02 08 00
C2/DE4E: 7C 02 05 00
C2/DE52: 7C 02 04 00
C2/DE56: 7C 02 04 00
C2/DE5A: 5C 02 04 00
C2/DE5E: 8C 02 04 00
C2/DE62: BC 02 04 00
C2/DE66: EC 02 04 00
C2/DE6A: 5C 02 04 00
C2/DE6E: 8C 02 04 00
C2/DE72: BC 02 04 00
C2/DE76: EC 02 04 00
C2/DE7A: 6C 02 05 00
C2/DE7E: 6C 02 05 00
C2/DE82: 6C 02 08 00
C2/DE86: 6C 02 08 00
C2/DE8A: 5C 02 07 00
C2/DE8E: 5C 02 04 00
C2/DE92: 5C 02 04 00
C2/DE96: 7C 02 08 00
C2/DE9A: 7C 02 08 00
C2/DE9E: 7C 02 08 00
// unknown table
C2/DEA2: 00 00 68 00
C2/DEA6: 00 00 B8 00
C2/DEAA: 00 01 E4 00
C2/DEAE: 00 00 24 01
C2/DEB2: 00 01 64 00
C2/DEB6: 00 01 A0 00
C2/DEBA: 00 00 B8 00
C2/DEBE: 00 00 24 01
C2/DEC2: 00 01 20 01
C2/DEC6: 00 01 64 00
C2/DECA: F8 FF 68 FF
C2/DECE: F8 FF 5C FF
C2/DED2: F8 FF 50 FF
C2/DED6: F8 FF 44 FF
C2/DEDA: 00 00 00 00
C2/DEDE: 00 00 00 00
C2/DEE2: 00 00 00 00
C2/DEE6: 00 00 00 00
C2/DEEA: F0 FF A4 FF
C2/DEEE: 00 00 00 00
C2/DEF2: 00 00 24 01
C2/DEF6: 00 00 68 00
C2/DEFA: 00 00 B8 00
C2/DEFE: F0 FF 68 FF
C2/DF02: 00 00 00 00
C2/DF06: 00 00 60 00
C2/DF0A: 00 00 24 01
C2/DF0E: 00 01 64 00
// horizontal positionings, lengths
// This 32-bit data is used at C1/4E7E. The rightmost byte in each line is unused. Appears to be location data for drawing battle menus.
C2/DF12: D5 5A 0C 00 // character names
C2/DF16: 95 5B 07 00
C2/DF1A: 05 5C 04 00
C2/DF1E: 45 5C 06 00
C2/DF22: 59 58 20 00 // skills menu text
C2/DF26: 61 8D 20 00
C2/DF2A: 4D 5E 20 00
C2/DF2E: A5 5C 07 00
C2/DF32: 3F 5D 07 00
C2/DF36: 85 5D 07 00
C2/DF3A: A5 5C 07 00
C2/DF3E: C1 5C 07 00
C2/DF42: DD 5C 07 00
C2/DF46: F9 5C 07 00
C2/DF4A: 05 5C 04 00
C2/DF4E: 15 5C 04 00
C2/DF52: 25 5C 04 00
C2/DF56: 35 5C 04 00
C2/DF5A: 45 5C 06 00
C2/DF5E: 5D 5C 06 00
C2/DF62: 75 5C 06 00
C2/DF66: 8D 5C 06 00
C2/DF6A: 45 5C 06 00
C2/DF6E: 5D 5C 06 00
C2/DF72: 75 5C 06 00
C2/DF76: 8D 5C 06 00
C2/DF7A: 45 5C 06 00
C2/DF7E: 5D 5C 06 00
C2/DF82: 75 5C 06 00
C2/DF86: 8D 5C 06 00
C2/DF8A: BD 5D 0C 00
C2/DF8E: 59 58 20 00
C2/DF92: 59 58 20 00
C2/DF96: CD 5E 0A 00
C2/DF9A: 57 8D 20 00
// positions, length, height?
// 64-bit data used at C1/470B
C2/DF9E: D5 5A 59 58 18 00 08 00
C2/DFA6: 95 5B 71 58 0E 00 08 00 // character names
C2/DFAE: 05 5C 7F 58 08 00 08 00
C2/DFB6: 45 5C 87 58 0C 00 08 00
C2/DFBE: 31 5D 15 8D 0E 00 05 00
C2/DFC6: 31 5D 95 8D 0E 00 05 00
C2/DFCE: 31 5D 15 8E 0E 00 05 00
C2/DFD6: 31 5D 95 8E 0E 00 05 00
C2/DFDE: 77 5D 21 8D 0E 00 05 00
C2/DFE6: 77 5D A1 8D 0E 00 05 00
C2/DFEE: 77 5D 21 8E 0E 00 05 00
C2/DFF6: 77 5D A1 8E 0E 00 05 00
C2/DFFE: 05 5C 7D 8D 08 00 08 00
C2/E006: 45 5C 85 8D 0C 00 08 00
C2/E00E: BD 5D 57 8D 18 00 06 00
C2/E016: 31 5D 17 8D 0E 00 05 00
C2/E01E: 77 5D 2F 8D 0E 00 05 00
C2/E026: CD 5E 57 8D 14 00 08 00
C2/E02E: 95 5B 6F 8D 0E 00 08 00 // character names
08-10-2018, 03:15 PM
Well, the first kick in the teeth - SE's documentation is plain wrong. The stuff marked "Spell list in battle" is not the spell list in battle, it's the spell list in the main menu (the epiphany moment was remembering partially-learned spells don't display in battle, so why would the coding for the battle menu talk about spell progress?). I did a file comparison between patched and unpatched roms, found some pointers in the C2/E bank changed, matched them, and voila. Yay, Spells are working.
Spent my time after troubleshooting, and failing, a new problem. I mostly got my new Esper names working - the "mostly" is that, as best I can tell, something in the game seems to think it still uses 8-letter names instead of 12. I say this because Ifrit (second name in code) displays the last four letters, including the empty spaces, of Ramuh's name, and then Shiva displays the last eight of Ifrit, and so on as it builds up. I've double and triple checked my code, used the file comparison to check for any "08" bytes I may have missed, looked at C3 bank dumps for any hints and compared them to both the patched rom and my work-in-progress, nothing. The names display properly in battle and everything else in the new Esper menu works fine, it's just the names. I really did try myself on this one, spent several hours, but no success.
Here's SE's coding for the Esper names. Whatever the "0A0A0A -> 20D0F0" is, both of them make my game crash, so I've left those as-is.
Spent my time after troubleshooting, and failing, a new problem. I mostly got my new Esper names working - the "mostly" is that, as best I can tell, something in the game seems to think it still uses 8-letter names instead of 12. I say this because Ifrit (second name in code) displays the last four letters, including the empty spaces, of Ramuh's name, and then Shiva displays the last eight of Ifrit, and so on as it builds up. I've double and triple checked my code, used the file comparison to check for any "08" bytes I may have missed, looked at C3 bank dumps for any hints and compared them to both the patched rom and my work-in-progress, nothing. The names display properly in battle and everything else in the new Esper menu works fine, it's just the names. I really did try myself on this one, spent several hours, but no success.
Here's SE's coding for the Esper names. Whatever the "0A0A0A -> 20D0F0" is, both of them make my game crash, so I've left those as-is.
Code:
Esper Names:
Original Code (discontinuous)
C1/5FF3*: A908 LDA #$08 ; 8 = Esper name length
C1/6007*: BFE1F6E6 LDA $E6F6E1,X ; Load Esper name X
C1/65D0: A908 LDA #$08 ; 8 = Esper name length
C1/65DB: BFE1F6E6 LDA $E6F6E1,X ; Load Esper name X
C1/6688: A908
C1/668D: A908 LDA #$08 ; from C1/6686)(Sets name length?
C1/6698: BFE1F6E6 LDA $E6F6E1,X ; Loads Esper name X
C2/E091: 04 03 TSB $03 ; Change the 04 bit
C3/34F0: 0A ASL A
C3/34F1: 0A ASL A
C3/34F2: 0A ASL A
C3/34F4: A00800 LDY #$0008 ; Esper name length
C3/34F7: BFE1F6E6 LDA $E6F6E1,X ; Load Esper name
C3/3508: A00800 LDY #$0008
C3/4F12: 37 42 ; Level position, sub menu
C3/54E6: A20300 LDX #$0003 ; X position of left half of espers
C3/54F1: A21100 LDX #$0011 ; X position of right half of espers
C3/54FA: A00800 LDY #$0008 ; Esper name length
C3/54FF: A0E1F6 LDY #$F6E1 ; Esper name address
C3/5504: A9E6 LDA #$E6 ; Esper name bank
C3/5539: A2939E LDX #$9E93
C3/553F: A9C7 LDA #$C7 ; The '...' character in the font)
C3/5539: A2939E LDX #$9E93
C3/555D: A00C00 LDY #$000C ; Esper name is 8 letters, +1 for space, +3 for MP cost
C3/5991: 10 70 ; finger at esper name
C3/5993: 18 7C ; finger at spell name
C3/5995: 18 88 ; finger at spell name
C3/5997: 18 94 ; finger at spell name
C3/5999: 18 A0 ; finger at spell name
C3/599B: 18 AC ; finger at spell name
C3/59BD: 0A ASL A
C3/59BE: 0A ASL A
C3/59BF: 0A ASL A
C3/59C1: A00800 LDY #$0008 ; Indirectly says below is 8 chars long
C3/59C4: BFE1F6E6 LDA $E6F6E1,X ; Load Esper X's name
C3/5CC2: 2D 42 8B 95 00 ; Position of and word "LV"
C3/5CEA: 23 44 8B 9E 9A AB A7 C5 91 9A AD 9E 00 ; Position of and words "Learn rate"
C3/6055: A0B139 LDY #$39B1 ; Position of Esper name status menu
C3/7993: A05B3B LDY #$3B5B ; Position of Esper name airship menu
Modified Code (discontinuous)
C1/5FF3*: A90C LDA #$0C ; 12 = Esper name length
C1/6007*: BFE601F2 LDA $F201E6,X ; Load Esper name X
C1/65D0: A90C LDA #$0C ; 12 = Esper name length
C1/65DB: BFE601F2 LDA $F201E6,X ; Load Esper name X
C1/6688: A90C
C1/668D: A90C LDA #$0C ; from C1/6686 (Sets name length?)
C1/6698: BFE601F2 LDA $F201E6,X ; Loads Esper name X
C2/E091: 02 03 ; Change the 04 bit
C3/34F0: 20D0F0 JSR $F0D0
C3/34F4: A00C00 LDY #$000C ; Esper name length
C3/34F7: BFE601F2 LDA $F201E6,X ; Load Esper name
C3/3508: A00C00 LDY #$000C
C3/4F12: 41 42 ; Level position, sub menu
C3/54E6: A20300 LDX #$0003 ; X position of left half of espers (NOT CHANGED)
C3/54F1: A21100 LDX #$0011 ; X position of right half of espers (NOT CHANGED)
C3/54FA: A00C00 LDY #$000C ; Esper name length
C3/54FF: A0E601 LDY #$01E6 ; Esper name address
C3/5504: A9F2 LDA #$F2 ; Esper name bank
C3/5539: A29A9E LDX #$9E9A
C3/553F: A9FF LDA #$FF ; The '...' character in the font)
C3/5539: A29A9E LDX #$9E9A
C3/555D: A01000 LDY #$0010 ; Esper name is 12 letters, +1 for space, +3 for MP cost
C3/5991: 08 70 ; finger at esper name
C3/5993: 10 7C ; finger at spell name
C3/5995: 10 88 ; finger at spell name
C3/5997: 10 94 ; finger at spell name
C3/5999: 10 A0 ; finger at spell name
C3/599B: 10 AC ; finger at spell name
C3/59B4: A00F44 LDY #$440F
C3/59BD: 20D0F0 JSR $F0D0
C3/59C1: A00C00 LDY #$000C ; Indirectly says below is 12 chars long
C3/59C4: BFE601F2 LDA $F201E6,X ; Load Esper X's name
C3/5CC2: 37 42 8B 95 00 ; Position of and word "LV"
C3/5CEA: 1F 44 FF FF FF FF FF 91 9A AD 9E FF 00 ; Position of and word "Rate"
C3/6055: A0AD39 LDY #$39AD ; Position of Esper name status menu
C3/7993: A0513B LDY #$3B51 ; Position of Esper name airship menu
08-11-2018, 12:11 AM
I'm just throwing an idea but since your problem is in battle there is the esper menu script:
It's either this (remove the 4 spaces maybe) or something in bank $C1. Bank $C3 is overworld menu so it's not related.
Code:
(Esper menu drawing script.)
C2/E083: FF FF (Draw 2 spaces)
C2/E085: 84ACA99E (Draw "Espe")
C2/E089: AB FF FF (Draw "r ")
C2/E08C: 04 21 (Change tile palette to #$21)
C2/E08E: 1A 00 (Draw Esper name)
C2/E090: 05 04 (Draw 4 spaces)
C2/E092: 03 2C (Draw 'M', except that's the wrong value)
C2/E094: 03 2F (Draw 'P', except that's the wrong value)
C2/E096: FF (Draw ' ')
C2/E097: 16 00 (Display MP cost)
C2/E099: 00 (End script)
It's either this (remove the 4 spaces maybe) or something in bank $C1. Bank $C3 is overworld menu so it's not related.
08-11-2018, 12:38 AM
I think you got it backwards - in-battle the names display fine, it's in the overworld menu they appear garbled.
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)