Users browsing this thread: 1 Guest(s)
Expanded Skills Menu

#1
Posts: 175
Threads: 11
Thanks Received: 10
Thanks Given: 8
Joined: May 2013
Reputation: 13
Status
Well-Fed
So I've been working on this primarily with some additional skills in my hack (I've built them using LightPhoenix's FF6Skills patch, which is developed from Ronnen's MenuBlitz hack, as a basis), but I thought the base code might be useful for other people! This particular .asm code doesn't get into the meat of the actual new skill, and in fact is currently duplicating Dance in the new slot -- but it's a good explanation, I think, of how to actually increase the size of the menu itself. 

Code:
hirom   ; don't change this
header  ; comment out if your rom has no header (not necessary w/ asar)

; comments in () are from the disassembly
; all other comments are my own


org $C3208E                    ; our list of skills-in-memory starts one earlier
LDA $78,X                      ; this was original $79,X

org $C3209B
JMP (C3_JMPTable_209B,X)       ; we've expanded this jump table, so it's relocated into free space

org $C34B59                    ; likewise, the finger positioning data is relocated
LDY #$F130                     ; I hardcoded this, so adjust as necessary if you put the data
                              ; somewhere else; you could easily define it, as well, for flexibility

org $C34B73            ; Hotspot data at C3/4B6F
DB $08                 ; adds one row to skills menu, from $07 to $08
                      ; This is the last of five values in the hotspot data


;Enabling and disabling aspects of the skills menu
org $C34D3D            ; (from C3/1E89, C3/4CDB)
LDA #$24               ; this is mostly vanilla code with some updated values
LDX $00
C3_Skills_DisableSkills:
STA $78,X              ; originally $79,X
INX
CPX #$0008             ; Increased by 1 to check additional command
BNE C3_Skills_DisableSkills     ; (disable all commands for that character)
JSR $4EDD
PHY
LDX #$0004             ; Check all four abilities the character has
C3_Skills_NextCharacter:
PHX
LDX $00
C3_Skills_ActivateSkills:
LDA $0016,Y
CMP $C3F0C0,X         ; This was originally at C3/4D78
BNE C3_Skills_NotSkill             ; (branch if skill does not match one on list)
LDA #$20
STA $78,X             ; (enable the skill for that character) again, this is updated from $79,X
C3_Skills_NotSkill:
INX
CPX #$0008            ; and again, this is increased by 1 to check an additional skill
BNE C3_Skills_ActivateSkills     ; (branch if haven't checked all 8 skills?)
INY
PLX
DEX
BNE C3_Skills_NextCharacter


org $C34D9F
DB $0C  ; expand Skills menu by one extra line
       ; this is the last value in a line of data at C3/4D9C
       ; increase by 2 for each additional skill

org $C34CDE   ; This loads a data set to memory in array $78,x
LDA $78       ; from the above function re: activating skills known by players
STA $29       ; and then pulls the skill names from a dataset that was moved to C3/F0D0
LDY #$F0D0
JSR $02F9     ; (display the word "Espers")
LDA $79
STA $29       ; (set text color)
LDY #$F0D9
JSR $02F9     ; (display the word "Magic")
LDA $7A
STA $29       ; (set text color)
LDY #$F0E1
JSR $02F9     ; (display the word "SwdTech")
LDA $7B
STA $29       ; (set text color)
LDY #$F0EB
JSR $02F9     ; (display the word "Blitz")
LDA $7C
STA $29       ; (set text color)
LDY #$F0F3
JSR $02F9     ; (display the word "Lore")
LDA $7D
STA $29       ; (set text color)
LDY #$F0FA
JSR $02F9     ; (display the word "Rage")
LDA $7E
STA $29       ; (set text color)
LDY #$F101
JSR $02F9     ; (display the word "Dance")
JMP C3_SkillsWindow_PrintNewSkill     ; I've left the existing function where it sits
                                     ; and since it originally JMPs anyway, I'm just JMPing first
                                     ; to the code that prints the name of the additional skills


org $C3F091
C3_SkillsWindow_PrintNewSkill:
LDA $7F
STA $29
LDY #$F109
JSR $02F9     ; (display the word "Dance")
JMP $0E6E




org $C3F0A0         ; New Data Tables
C3_JMPTable_209B:   ; C3/F0A0-F0AF
DW $20B3    ; Esper
DW $211C    ; Magic
DW $20EE    ; SwdTech
DW $2105    ; Blitz
DW $216E    ; Lore
DW $21A6    ; Rage
DW $21DE    ; Dance
DW $21DE    ; Dance

org $C3F0C0
C3_Skills_CommandTable:     ; originally $C34D78
DB $02  ; Magic (for Esper)
DB $02  ; Magic
DB $07  ; SwdTech
DB $0A  ; Blitz
DB $0C  ; Lore
DB $10  ; Rage
DB $13  ; Dance
DB $13  ; Dance

org $C3F0D0
C3_SkillTable_C35C48:
DB $0D, $79, $84, $AC, $A9, $9E, $AB, $AC, $00        ;(position of and word "Espers")  [F0D0-D8]
DB $8D, $79, $8C, $9A, $A0, $A2, $9C, $00             ;(position of and word "Magic")   [F0D9-E0]
DB $8D, $7A, $92, $B0, $9D, $93, $9E, $9C, $A1, $00   ;(position of and word "SwdTech") [F0E1-EA]
DB $0D, $7B, $81, $A5, $A2, $AD, $B3, $00             ;(position of and word "Blitz")   [F0EB-F2]
DB $8D, $7B, $8B, $A8, $AB, $9E, $00                  ;(position of and word "Lore")    [F0F3-F9]
DB $0D, $7C, $91, $9A, $A0, $9E, $00                  ;(position of and word "Rage")    [F0FA-F100]
DB $8D, $7C, $83, $9A, $A7, $9C, $9E, $00             ;(position of and word "Dance")   [F101-F108]
DB $0D, $7D, $83, $9A, $A7, $9C, $9E, $00             ;(position of and word "Dance")   [F109-F110]

org $C3F130  ; new skills menu finger positioning data
DB $00, $14, $00, $24, $00, $44, $00, $54, $00, $64, $00, $74, $00, $84, $00, $94


Right now, this is all using free space in C3, but with the exception of C3_SkillsWindow_PrintNewSkill, it's all data tables that could be moved pretty much anywhere you need to, included expanded ROM, so you only actually need 13/0Dh bytes of free space in C3 itself. Realistically, there's visual space for probably three, maybe four more abilities, rather than just the one I've added here, but you'll require more freespace for PrintNewSkill and will almost definitely want to move the data tables into another bank.


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  
[-] The following 1 user says Thank You to GrayShadows for this post:
  • Lockirby2 (12-16-2016)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite