Title: Decoupled Color-Coded MP Digits Author: SilentEnigma (updates), Imzogelmo (original implementation) Version: 1.3 Release Date: 2021-04-19 Applies to: Final Fantasy III (v1.0) (U) Archive Contents: MPDigits-Decoupled_Anti_H.ips = the anti-patch for headered ROMs MPDigits-Decoupled_Anti_NH.ips = the anti-patch for unheadered ROMs MPDigits-Decoupled_Full_H.ips = the patch for headered ROMs MPDigits-Decoupled_Full_NH.ips = the patch for unheadered ROMs MPDigits-Decoupled_Upgr_H.ips = the upgrade patch for headered ROMs MPDigits-Decoupled_Upgr_NH.ips = the upgrade patch for unheadered ROMs readme.txt = this file ROM Addresses: C1/91A0 - C1/91A1, C1/91A6 - C1/91A7, C1/A5A9 - C1/A5AD, C1/A6E6 - C1/A6EA, C1/2B9B - C1/2BA0, C1/2D2B - C1/2D30, C1/AC21 - C1/AC34 C2/63A9 - C2/63AB, C2/63BC - C2/63BD Free space used: C0/DE5E - C0/DEBC (95 bytes) C2/F740 - C2/F783 (68 bytes) ________________________________________________________________________________ TABLE OF CONTENTS 0. Description 1. Relevant Offsets & Disassembly 2. Revision History 3. Credits 4. Legal ________________________________________________________________________________ 0. DESCRIPTION ________________________________________________________________________________ "Decoupled Color-Coded MP Digits" is a reworking of Imzogelmo's "Color-Coded MP Digits" patch, which recolors the MP damage and healing numerals displayed during battle. Pink is used for MP damage, and blue is used for MP healing. The implementation of Imzogelmo's original patch has the unfortunate side effect of corrupting the color palette used by the reflected spells animation. This patch accomplishes the MP numeral recoloring without affecting the appearance of the reflected spells animation. It also fixes the "Crusader redecorates Reflect barriers" / "Red Reflect" bug as a side effect. Since the new colors are no longer coupled to the reflected spells graphic, a different blue color is used for the MP healing numerals. This patch's implementation uses Imzogelmo's original "Color-Coded MP Digits" patch as a base. Some of Imgozelmo's code has been moved in order to make the new patch compatible with C. V. Reynolds' Bug-Fix Compilation (version 1.16). Two methods are available for applying the mod (See archive contents): - MPDigits-Decoupled_Full_* is the default full version patch for fresh ROMs. - MPDigits-Decoupled_Upgr_* is an upgrade patch for ROMs which already have Imzogelmo's version applied [MPDigits-5.ips, modified 2016-02-01 23:41]. Patches for both headered and non-headered ROMs are available. ________________________________________________________________________________ 1. RELEVANT OFFSETS & DISASSEMBLY ________________________________________________________________________________ New Subroutine C0/DE5E (Executes before displaying numerals): Original: C1/A5A9: 09 01 ORA #$01 C1/D5AB: 9D 1A 63 STA $631A,x Modified (Imzogelmo): C1/A5A9: EA NOP C1/A5AA: 00 5E DE C0 JSL $C0DE5E ; Jump to new subroutine C0/DE5E New Subroutine C0/DE5E (Imzogelmo) C0/DE5E: 09 01 ORA #$01 ; Originally at C1/A599 C0/DE60: 48 PHA C0/DE61: B2 76 LDA ($76) C0/DE63: C9 0B CMP #$0B ; Is it HP? C0/DE65: F0 05 BEQ $DE6C ; If so, branch C0/DE67: 68 PLA *C0/DE68: 09 40 ORA #$40 ; Set MP bit *C0/DE6A: 80 01 BRA $DE6D C0/DE6C: 68 PLA C0/DE6D: 9D 1A 63 STA $631A,x ; Originally at C1/D59B C0/DE70: 6B RTL Modified ... C0/DE68: 20 A4 DE JSR $DEA4 ; Jump to new subroutine C0/DEA4 C0/DE6B: 48 PHA ... ---------------------------------------- Original: C1/A6E6: 09 01 ORA #$01 C1/A6E8: 9D 3F 7B STA $7B3F,x Modified (Imzogelmo): C1/A6E6: EA NOP C1/A6E7: 22 71 DE C0 JSL $C0DE71 ; Jump to new subroutine C0/DE71 New Subroutine C0/DE71 (Imzogelmo) C0/DE71: 09 01 ORA #$01 C0/DE73: 48 PHA C0/DE74: B2 76 LDA ($76) C0/DE76: C9 03 CMP #$03 C0/DE78: F0 05 BEQ $DE7F C0/DE7A: 68 PLA *C0/DE7B: 09 40 ORA #$40 *C0/DE7D: 80 01 BRA $DE80 C0/DE7F: 68 PLA C0/DE80: 9D 3F 7B STA $7B3F,x C0/DE83: 6B RTL Modified ... C0/DE7B: 20 A4 DE JSR $DEA4 ; Jump to new subroutine C0/DEA4 C0/DE7E: 48 PHA ... ---------------------------------------- Executes repeatedly during battle Original: C1/2B9B: 99 03 03 STA $0303,y C1/2B9E: 99 07 03 STA $0307,y Modified (Imzogelmo): C1/2B9B: EA NOP C1/2B9C: EA NOP C1/2B9D: 22 8A DE C0 JSL $C0DE8A ; Jump to new subroutine C0/DE8A Original: C1/2D2B: 99 03 03 STA $0303,y C1/2D2E: 99 07 03 STA $0307,y Modified (Imzogelmo): C1/2D2B: EA C1/2D2C: EA C1/2D2D: 22 84 DE C0 JSL $C0DE84 ; Jump to new subroutine C0/DE84 New Subroutine C0/DE84 (Alt entry C0/DE8A) (Imzogelmo): C0/DE84: 48 PHA C0/DE85: BD 1A 63 LDA $631A,x C0/DE88: 80 04 BRA $DE8E C0/DE8A: 48 PHA C0/DE8B: BD 3F 7B LDA $7B3F,x C0/DE8E: 29 40 AND #$40 C0/DE90: F0 06 BEQ $DE98 C0/DE92: 68 PLA C0/DE93: 18 CLC C0/DE94: 69 04 ADC #$04 C0/DE96: 80 01 BRA $DE99 C0/DE98: 68 PLA C0/DE99: 99 03 03 STA $0303,y C0/DE9C: 99 07 03 STA $0307,y C0/DE9F: 6B RTL ---------------------------------------- Blue palette for MP healing New Data: C0/DEA0: 63 14 ; Dark gray C0/DEA2: E2 7D ; Blue ---------------------------------------- New Subroutine C0/DEA4 (Load blue palette for MP healing) C0/DEA4: 48 PHA C0/DEA5: DA PHX C0/DEA6: 7B TDC ; set accumulator to 0 C0/DEA7: AA TAX ; set X to 0 C0/DEA8: BF A0 DE C0 LDA $C0DEA0,X ; Blue mp healing palette C0/DEAC: 9D F8 7F STA $7FF8,X ; write over reflect barrier palette C0/DEAF: 9D F8 7D STA $7DF8,X ; write over reflect barrier palette C0/DEB2: E8 INX C0/DEB3: E0 04 00 CPX #$0004 C0/DEB6: D0 F0 BNE $DEA7 C0/DEB8: FA PLX C0/DEB9: 68 PLA ; Moved from C0/DE67 & C0/DE7A C0/DEBA: 09 40 ORA #$40 ; Moved from C0/DE68 & C0/DE7B C0/DEBC: 60 RTS ---------------------------------------- Original: C1/91A0: E2 93 Modified (Imzogelmo): C1/91A0: B3 A4 Original: C1/91A6: E2 93 Modified (Imzogelmo): C1/91A6: 09 96 ---------------------------------------- Imzogelmo Subroutine C2/A7DD moved to C2/A740 Original: C2/63A9: 09 0B 00 Imzogelmo: C2/63A9: 20 DD A7 JSR $A7DD ; Jump to new subroutine C2/A7DD Modified: C2/63A9: 20 40 A7 JSR $A740 ; Jump to new subroutine C2/A740 New Subroutine C2/A7DD (Imzogelmo) (Moved): *C2/A7DD: 48 PHA *C2/A7DE: E2 20 SEP #$20 ; 8-bit accumulator *C2/A7E0: AD A3 11 LDA $11A3 *C2/A7E3: C2 20 REP #20 ; 16-bit accumulator *C2/A7E5: 10 05 BPL $A7EC *C2/A7E7: 68 PLA *C2/A7E8: 09 05 00 ORA #$0005 *C2/A7EB: 60 RTS *C2/A7EC: 68 PLA *C2/A7ED: 09 0B 00 ORA #$000B *C2/A7F0: 60 RTS New Subroutine C2/A740: C2/A740: 48 PHA C2/A741: E2 20 SEP #$20 ; 8-bit accumulator C2/A743: AD A3 11 LDA $11A3 C2/A746: C2 20 REP #20 ; 16-bit accumulator C2/A748: 10 05 BPL $A74F C2/A74A: 68 PLA C2/A74B: 09 05 00 ORA #$0005 C2/A74E: 60 RTS C2/A74F: 68 PLA C2/A750: 09 0B 00 ORA #$000B C2/A753: 60 RTS ---------------------------------------- Imzogelmo Subroutine C2/A7F1 moved to C2/A754 Original: C2/63BC: 9B 62 ; Pointer to subroutine C2/629B Imzogelmo: C2/63BC: F1 A7 ; New subroutine C2/A7F1 Modified: C2/63BC: 54 A7 ; New subroutine C2/A754 New Subroutine C2/A7DD (Imzogelmo) (Moved): *C2/A7F1: 48 PHA *C2/A7F2: AD A3 11 LDA $11A3 *C2/A7F5: 10 05 BPL $A7FC *C2/A7F7: 68 PLA *C2/A7F8: A9 08 LDA #$08 *C2/A7FA: 80 01 BRA $A7FD *C2/A7FC: 68 PLA *C2/A7FD: 4C 9B 62 JMP $629B New Subroutine C2/A754 C2/A754: 48 PHA C2/A755: AD A3 11 LDA $11A3 C2/A758: 10 05 BPL $A75F C2/A75A: 68 PLA C2/A75B: A9 08 LDA #$08 C2/A75D: 80 01 BRA $A760 C2/A75F: 68 PLA C2/A760: 4C 9B 62 JMP $629B ---------------------------------------- Original: C1/AC21: 90 0E BCC $AC31 C1/AC23: 7B TDC C1/AC24: A8 TAY C1/AC25: 84 1E STY $1E C1/AC27: C8 INY C1/AC28: C8 INY C1/AC29: B1 76 LDA ($76),Y C1/AC2B: 20 B3 9C JSR $9CB3 ; Load gfx data for spell Battle Dynamics C1/AC2E: 20 5B AC JSR $AC5B ; Shows the spell animation C1/AC31: 20 35 AC JSR $AC35 C1/AC34: 60 RTS Modified: C1/AC21: 90 07 BCC $AC2A C1/AC23: 22 63 A7 C2 JSL $C2A763 ; Jump to new subroutine C2/A763 C1/AC27: 20 5B AC JSR $AC5B C1/AC2A: 20 35 AC JSR $AC35 C1/AC2D: 60 RTS C1/AC2E: 20 B3 9C JSR $9CB3 ; Long access to subroutine C1/9CB3 C1/AC31: 6B RTL C1/AC32: FF C1/AC33: FF C1/AC34: FF New Subroutine C2/A763 (Restore reflect palette - also fixes Crusader bug) C2/A763: 7B TDC ; originally at C1/AC23 C2/A764: A8 TAY ; originally at C1/AC24 C2/A765: 84 1E STY $1E ; originally at C1/AC25 C2/A767: C8 INY ; originally at C1/AC27 C2/A768: C8 INY ; originally at C1/AC28 C2/A769: B1 76 LDA ($76),Y ; originally at C1/AC29 C2/A76B: 22 2E AC C1 JSL $C1AC2E ; long access to subroutine C1/9CB3 ; (originally called at C1/AC2B) C2/A76F: DA PHX C2/A770: 7B TDC ; set accumulator to 0 C2/A771: AA TAX ; set X to 0 C2/A772: BF A1 C6 C2 LDA $C2C6A1,X ; Default reflect barrier palette C2/A776: 9D F8 7F STA $7FF8,X ; write over reflect barrier palette C2/A779: 9D F8 7D STA $7DF8,X ; write over reflect barrier palette C2/A77C: E8 INX C2/A77D: E0 08 00 CPX #$0008 C2/A780: D0 F0 BNE $A772 C2/A782: FA PLX C2/A783: 6B RTL ---------------------------------------- Imzogelmo reflect palette reverted to original Imzogelmo: C2/C6A1: 63 14 ; Dark gray C2/C6A3: 41 7F ; Baby blue C2/C6A5: E0 03 ; Lime green C2/C6A8: 00 7F ; Sky blue Modified/Original: C2/C6A1: FD 43 ; Pale yellow C2/C6A3: F1 3F ; Pale green C2/C6A5: E0 03 ; Lime green C2/C6A7: E0 02 ; Green ________________________________________________________________________________ 2. CREDITS ________________________________________________________________________________ Imzogelmo ( http://www.angelfire.com/al2/imzogelmo/patches.html ) - Wrote the original "Color-Coded MP Digits" patch upon which this patch is based. SilentEnigma ( https://silentenigma.neocities.org ) - Wrote the fixes & compatibility updates Special thanks: Warrax ( https://www.ff6hacking.com/forums/user-1647.html ) - Identified the glitch in v1.0. Gi Nattak ( https://www.ff6hacking.com/forums/user-44.html ) - Identified the crash bug in v1.1. - Tested the solution used in v1.2. ________________________________________________________________________________ 3. REVISION HISTORY ________________________________________________________________________________ 2020-04-26 : Version 1.0 released. 2020-06-02 : Version 1.1 released. - Fixed a brief palette glitch that occurs with MP healing when it immediately precedes Auto-Shell/Auto-Protect activation. 2020-06-13 : Version 1.2 released. - Fixed a bug from Version 1.1 which causes the game to crash in certain cases when a pending spell animation is canceled. 2021-04-19 : Version 1.3 released. - Resolved conflict with Assassin's Alphabetical Rage patch. ________________________________________________________________________________ 4. LEGAL ________________________________________________________________________________ Copyright (C) 2020, 2021 David R. Thompson (SilentEnigma). The copyright holder ("author") permits the free use of the attributed work referenced by this document exclusively for non-commercial purposes, provided that the following conditions are met: 1. The author and all contributors credited in this readme document shall be given credit for their respective contributions wherever the attributed work is reused, redistributed, or modified. 2. This readme document shall accompany any of the files comprising the attributed work wherever they are redistributed in unmodified form. The work(s) and file(s) distributed with this document are provided "AS-IS", WITHOUT ANY WARRANTY. The author shall not be held responsible for any damages related to the use of work(s) and file(s) distributed with this document.