Users browsing this thread: 1 Guest(s)
Class Names function

#1
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
[Image: Expanded_Names_00000.png]


I took some time recently to look at Angelo's Longer name patch and I did some optimization concerning class names. This is no major breakthrough because class names are already present in Pandora's Box and in The Eternal Crystals but I wanted to post the code for anyone who would like to implement it without expanding the ROM. There is many way to implement class names. In this case, the class name is displayed only if there is no status on the character which is not the case in Pandora'S Box because they made class name and status both displayable at the same time I believe.

So first if the status of the character is normal we make a jump:

Code:
C3/34A9:  A9 20      LDA #$20          (status is normal)      
C3/34AB:  85 29      STA $29           (set color text to white)        
C3/34AD:  4C 91 F0   JMP $F091         (jump to class name routine)

The original code was from Metroid Quest but I removed the unnecessary pointer table, the many instances of the same class name in the data table and the unnecessary 00 at the end of each string. The routine is about the same length but you save a lot of space as for data. In the way I optimized it, actor $12 to $1F are "Moogles" and any actor above is an "Imp.Soldier". The code is good for all playable characters but doesn't take in account that someone would use Kefka as PC or open the menu (which you can't) when you are Maduin for example. It would then display the wrong class.

Code:
C3/F091:  C2 20         REP #S20        (16 bit memory)
C3/F093:  B9 00 00      LDA $0000,Y     (load actor number plus next byte)
C3/F096:  29 FF 00      AND #$00FF      (leave only actor number)
C3/F099:  E2 20         SEP #$20        (8 bit memory)
C3/F09B:  18            CLC
C3/F09C:  C9 10         CMP #$10
C3/F09E:  90 12         BCC $F0B2       (branch if actor 00 to 0F)
C3/F0A0:  C9 12         CMP #$12
C3/F0A2:  90 0C         BCC $F0B0       (branch if actor 10 or 11 )
C3/F0A4:  C9 1F         CMP #$1F
C3/F0A6:  90 04         BCC $F0AC       (Branch if actor 12 to 1F)
C3/F0A8:  A9 11         LDA #$11        (if not load "Imp.Soldier" class name)
C3/F0AA:  80 06         BRA $F0B2
C3/F0AC:  A9 0A         LDA #$0A        (load "Moogle" class name)
C3/F0AE:  80 02         BRA $F0B2
C3/F0B0:  A9 10         LDA #$10        (load "Ghost" class name)        
C3/F0B2:  8D 02 42      STA $4202
C3/F0B5:  A9 0C         LDA #$0C        (12 = class name length)
C3/F0B7:  A8            TAY             (store for future loop)    
C3/F0B8:  8D 03 42      STA $4203       (multiply by 12)
C3/F0BB:  EA            NOP
C3/F0BC:  EA            NOP
C3/F0BD:  AD 16 42      LDA $4216       (result of multiplication)
C3/F0C0:  AA            TAX
C3/F0C1:  BF 00 F1 C3   LDA $C3F100,X   (load class name letter)
C3/F0C5:  8D 80 21      STA $2180       (write letter)
C3/F0C8:  E8            INX             (next letter)
C3/F0C9:  88            DEY             (decrement loop)
C3/F0CA:  F0 02         BEQ $F0CE       (exit if we reached 12 letters)    
C3/F0CC:  80 F3         BRA $F0C1       (if not, branch to next letter)    
C3/F0CE:  9C 80 21      STZ $2180       (next String)
C3/F0D1:  4C D9 7F      JMP $7FD9       (jump to general text drawing routine)

The data would look like this:

Code:
C3/F100: 92 A8 AB 9C 9E AB 9E AC AC FF FF FF  ("Sorceress")
C3/F10C: 80 9D AF 9E A7 AD AE AB 9E AB FF FF  ("Adventurer")
C3/F118: 92 9A A6 AE AB 9A A2 FF FF FF FF FF  ("Samurai")
C3/F124: 80 AC AC 9A AC AC A2 A7 FF FF FF FF  ("Assasin")
C3/F130: 8C 9A 9C A1 A2 A7 A2 AC AD FF FF FF  ("Machinist")
C3/F13C: 8C A8 A7 A4 FF FF FF FF FF FF FF FF  ("Monk")
C3/F148: 91 AE A7 9E FE 8A A7 A2 A0 A1 AD FF  ("Rune Knight")
C3/F154: 81 A5 AE 9E FE 8C 9A A0 9E FF FF FF  ("Blue Mage")
C3/F160: 8F A2 9C AD A8 A6 9A A7 9C 9E AB FF  ("Pictomancer")
C3/F16C: 86 9A A6 9B A5 9E AB FF FF FF FF FF  ("Gambler")
C3/F178: 8C A8 A8 A0 A5 9E FF FF FF FF FF FF  ("Moogle")
C3/F184: 96 A2 A5 9D FE 9B A8 B2 FF FF FF FF  ("Wild Boy")
C3/F190: 8C A2 A6 A2 9C FF FF FF FF FF FF FF  ("Mimic")
C3/F19C: 98 9E AD A2 FF FF FF FF FF FF FF FF  ("Yeti")
C3/F1A8: 8F AB A2 9E AC AD FF FF FF FF FF FF  ("Priest")
C3/F1B4: 92 A1 A8 A0 AE A7 FF FF FF FF FF FF  ("Shogun")
C3/F1C0: 86 A1 A8 AC AD FF FF FF FF FF FF FF  ("Ghost")
C3/F1CC: 88 A6 A9 C5 92 A8 A5 9D A2 9E AB FF  ("Imp.Soldier")
  Find
Quote  
[-] The following 13 users say Thank You to madsiur for this post:
  • C-Dude (11-11-2019), DrakeyC (08-10-2018), Gi Nattak (12-03-2012), h.carrell (03-18-2022), icyraven93 (01-22-2015), JCE3000GT (06-16-2013), pjmcphee87 (06-05-2012), PowerPanda (11-11-2017), Rodimus Primal (06-14-2013), ShinMrKarate (10-25-2014), SSJ Rick (06-13-2013), Warrax (09-08-2017), Zeemis (12-31-2012)

#2
Posts: 170
Threads: 12
Thanks Received: 3
Thanks Given: 7
Joined: Oct 2011
Reputation: 3
Status
None
Very nice! I'm going to make a patch from this for practice.

I didn't think there was this much free space in C3, should I assume that this may not work with other patches that also modify C3?


NNID (Wii U): pjmcphee
PSN: PaJMtree
Xbox Live: PJ_McPhizzle
  Find
Quote  

#3
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(05-17-2012, 11:02 AM)PJM Wrote: I didn't think there was this much free space in C3, should I assume that this may not work with other patches that also modify C3?

I didn't checked when I wrote the code but it would overwrite existing patches I'm pretty sure... There is place for everyone though and the only value you would need to change is the JMP at the beginning (C3/34AD). The rest of the branching is done by bytes count so there is no problem there.
  Find
Quote  

#4
 
Status
None
Good code to play with, and better than a patch for someone that's still trying to learn what they are doing. Although, when I was adding it myself, I didn't see anything about changing the code to drop the displayed title under the character name instead of at the end of it (causing it to spill over into the side menu). Just four number changes though.
Code:
0033306 :  A0 27 39
0033352 :  A0 A7 3A
003339E :  A0 27 3C
00333EA :  A0 A7 3D

Change it to...

0033306 :  A0 59 39
0033352 :  A0 D9 3A
003339E :  A0 59 3C
00333EA :  A0 D9 3D
Please correct me if I'm wrong, I have been known to miss things.
 
Quote  
[-] The following 4 users say Thank You to Catone for this post:
  • DrakeyC (08-10-2018), Scorcher (07-26-2014), ShinMrKarate (11-20-2014), Warrax (09-08-2017)

#5
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Necropost !

I fixed two things with the routine one being that Leo was a ghost and the second one being that the game was crashing when you recruit a ghost. Better late than never I guess...

The code in the first post has been fixed. Thanks to Gi Nattak for testing everything.
  Find
Quote  

#6
Posts: 139
Threads: 6
Thanks Received: 1
Thanks Given: 4
Joined: May 2013
Reputation: 0
Status
None
Sorry for all the newbie comments but is there a place to put this code without overriding other hacks? If so where?


Experience is the benchmark to maturity.

Final Fantasy VI - Ted Woolsey Uncensored Edition:
http://www.romhacking.net/hacks/1386

Final Fantasy IV - Namingway Edition:
http://www.romhacking.net/hacks/2337
  Find
Quote  

#7
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(06-13-2013, 02:39 PM)Rodimus Primal Wrote: Sorry for all the newbie comments but is there a place to put this code without overriding other hacks? If so where?

I depends which patches you have applied to your hack. But assuming you have applied all ''official'' patch, C0, C1, C2 and C3 would be mostly full. You should check the empty space list that Gi Nattak posted. It's a sticky thread.

Edit: You can put the code elsewhere but you can't just copy it anywhere without changing some part of it.
  Find
Quote  

#8
Posts: 139
Threads: 6
Thanks Received: 1
Thanks Given: 4
Joined: May 2013
Reputation: 0
Status
None
I applied that to fix the overlapping issue but now there's a glitch when you go to the sub menus. It cuts off half the names when, lets say you go to Skills. It shows fine in the main menu though.


Experience is the benchmark to maturity.

Final Fantasy VI - Ted Woolsey Uncensored Edition:
http://www.romhacking.net/hacks/1386

Final Fantasy IV - Namingway Edition:
http://www.romhacking.net/hacks/2337
  Find
Quote  

#9
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(06-14-2013, 09:20 AM)Rodimus Primal Wrote: I applied that to fix the overlapping issue but now there's a glitch when you go to the sub menus.

This code is working fine in other hacks so the problem is not on my end. Maybe your problem is with the stating position in the Window. It might be related to Canote's post. Check a bit higher in the thread.
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • Jeff (02-16-2014)

#10
Posts: 139
Threads: 6
Thanks Received: 1
Thanks Given: 4
Joined: May 2013
Reputation: 0
Status
None
I double checked your code and without Cantone's code, the status names spill over into the side menu. With them, it looks fine in the main menu, but is cut off from the top in the skills menu.

[Image: Final%20Fantasy%20VI003.png]


Experience is the benchmark to maturity.

Final Fantasy VI - Ted Woolsey Uncensored Edition:
http://www.romhacking.net/hacks/1386

Final Fantasy IV - Namingway Edition:
http://www.romhacking.net/hacks/2337
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite