The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.3.33 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




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)



Messages In This Thread
Class Names function - by madsiur - 04-28-2012, 04:39 PM
RE: Class Names function - by pjmcphee87 - 05-17-2012, 11:02 AM
RE: Class Names function - by madsiur - 05-17-2012, 12:43 PM
RE: Class Names function - by Catone - 08-09-2012, 08:28 PM
RE: Class Names function - by madsiur - 12-30-2012, 11:27 PM
RE: Class Names function - by Rodimus Primal - 06-13-2013, 02:39 PM
RE: Class Names function - by madsiur - 06-13-2013, 08:01 PM
RE: Class Names function - by Rodimus Primal - 06-14-2013, 09:20 AM
RE: Class Names function - by madsiur - 06-14-2013, 07:59 PM
RE: Class Names function - by Rodimus Primal - 06-15-2013, 02:13 AM
RE: Class Names function - by madsiur - 06-15-2013, 03:49 PM
RE: Class Names function - by Gi Nattak - 10-07-2013, 04:07 PM
RE: Class Names function - by ShinMrKarate - 11-20-2014, 02:35 AM
RE: Class Names function - by seibaby - 04-06-2016, 01:50 PM
RE: Class Names function - by madsiur - 04-07-2016, 05:25 PM
RE: Class Names function - by B-Run - 04-08-2016, 07:34 AM
RE: Class Names function - by seibaby - 09-14-2017, 10:13 AM
RE: Class Names function - by Warrax - 09-14-2017, 03:44 PM
RE: Class Names function - by Warrax - 10-02-2017, 07:39 PM
RE: Class Names function - by assassin - 10-02-2017, 10:20 PM
RE: Class Names function - by PowerPanda - 08-09-2018, 02:31 PM
RE: Class Names function - by DrakeyC - 08-09-2018, 09:58 PM
RE: Class Names function - by madsiur - 08-10-2018, 12:21 AM
RE: Class Names function - by Warrax - 08-10-2018, 09:48 AM
RE: Class Names function - by DrakeyC - 08-10-2018, 12:27 AM
RE: Class Names function - by DrakeyC - 08-10-2018, 08:46 PM
RE: Class Names function - by PowerPanda - 08-10-2018, 11:51 PM
RE: Class Names function - by DrakeyC - 08-11-2018, 12:30 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite