4
« on: June 20, 2011, 09:46:03 AM »
Hmm so I'm working on making blitz use a menu, rather than do "street fighter" button matching because as awesome as the original functionality is/was... it is some what obnoxious to use at times compared to other abilities...
All of this work is heavily based on, and not possible without the documentation provided on this site credit of Imzogelmo, assassin, Lenophis, and Novalia Spirit. Anywhere I say Assassin here, I really mean any of these four individuals but since I no way to break that down, and for brevity's sake... I'll just say Assassin. Also since I'm looking at his C2 doc on occasion as well... its safer ^_^
So I got it to the point that selecting blitz brings up a menu with 8 entries, which correctly correspond to Pummel through Bum Rush in two columns in a normal english reading order (left->right, next line below). Selecting an ability causes that ability to occur normal, etc.
However I have two problems:
The first problem that I have is that the method I've chosen for loading the available Blitz commands is modeled after Magitek, so it loads a static list of the 8 entries... meaning if you only know Pummel, it still allows you to try and use... say Fire Dance, and then when he tries to execute it, "Incorrect Blitz Command" happens as if you messed up the button entries.
I'm not too worried about this, because I've not really tried to fix this yet but seems like I can use the old Blitz code as a guide there, as this is minor compared to my second issue... though it should be noted that in general I modeled all the crap I changed the Blitz code to is based off Magitek / Dance.
The second problem that I have is that the text for the entries isn't being loaded correctly, and isn't in the right location (though the finger selector is). See the attached screen shot [edit: removed]...
Anyone have any thoughts on this?
Here is the ASM for the changes I made for this (along with my insane and possibly wrong/confusing notes... as well as some original comments from Assassain's C2 doc on Magitek):
hirom ; don't change this
header ; comment out if your rom has no header
;;; WTF THIS WORKS!!!
;org $C155A6
;DW #$8625
;org $C17CFD
;DW #$5983
;;;;;;;;;;;;;;;;;;;;;
; caveat is it uses magitek menu text and non-Terra only have acces to 4 abilites lol
;;;;;;;;;;;;;;;;;;;;;
;change blitz? menu pointer
org $C155A2
;DW #$5755
DW #$6F72
;change blitz? pre-function pointer
;org $C155A4
;DW #$575F
DW #$7076
;change blitz function pointer
;org $C155A6
;DW #$6FF8
DW #$6FC7
; TODO change other pointers?
; change blitz menu pointer
;C1/7CFD: 6B77 (Blitz)
org $C17CFD
DW #$6F72
; TODO change this? draw menu...
; change blitz 7BF0 function pointers ; no idea what impact this has, alters spacing on menu that I can tell...
;C1/4565: 3E50 (27) ($5757)
;C1/4568: 6250 (28) ($5761)
org $C14565
DW #$5088
DW #$50B6
;reference what magitek does in this table (and several other similar ability menus)
;C1/454D: 8850 (1B) ($59A5)
;C1/454F: B650 (1C) ($5718)
;change blitz functions
org $C16F6A
;Data: Blitz targetting ;taken from C1/9104
;DD #$6A434343
;DD #$43436A03
DD #$6A6A6A6A
DD #$6A036A03
;Data: Blitz attacks ;using magitek terra values to save space for now
;DD #$03020100
;DD #$07060504
;DD #$24180C00
;DD #$54483C30
;Maybe model off of this? no because it expects an index number, not a "where is my button matching code" number
;C1/6F88: 00 (Pummel)
;C1/6F89: 0C (Aura Bolt)
;C1/6F8A: 18 (Suplex)
;C1/6F8B: 24 (Fire Dance)
;C1/6F8C: 30 (Mantra)
;C1/6F8D: 3C (Air Blade)
;C1/6F8E: 48 (Spiraler)
;C1/6F8F: 54 (Bum Rush)
; @ 6F72
;Blitz command ;;;;;;;;;;;;;;;;;;;; from C1/5983
LDA #$3B ; magitek is 28...but blitz is 3D not sure what to use here but...maybe 3B? (from C1/5529, X = 28)
STA $7BC2
LDA $7BA5
BMI Branch1 ; branch if minus ?
JSR $5A17 ; common routine
STZ $7BA6
LDA #$80
STA $7BA5
Branch1:
LDA $7BA6
JSR MenuBuild
JSR $5729 ; common routine
BCC Return
LDA #$27 ; lore (19) loads #$11, rage (1C) #$13, dance (1F) #$15, row (22) #$17, def (25) #$19, magitek (28) #$1B, throw (2B) #$1D, tools (2D?) #$20...
STA $7BF0 ; ?
LDA #$11 ; lore (19) loads #$07, rage (1C) #$09, dance (1F) #$0A, row (22) #$0B, def (25) #$0C,03,08,?,05,04 , magitek (28) #$0D, throw (2B) #$0E, tools (2D?) #$0F...
JMP $5A2C ; common routine .. maybe calls into continuing menu pointer thing?.. stores into $7BC2 so...
Return:
RTS
; @ 6F9D
;Build the Blitz menu ;;;;;;;;;;;;;; taken from 4D2E
MenuBuild:
PHY
ASL A
TAY
TDC
TAX
LoadCyc:
;C1/4D33: BF4DE0C2 LDA $C2E04D,X (format for drawing magitek menu)
LDA $C1704A,X ; format for drawing blitz menu
STA $5755,X
INX
CPX #$000D ; did we get 13 bytes
BNE LoadCyc ; branch if not
TYA
TAX
; Note that the following two lines statically load list of available blitzes, that means it will act as if you know all blitzes at all levels...
LDA $C1910C,X ; (Left column Blitz attacks) ; dance does this: C1/4D1A: B97E26 LDA $267E,Y (List of known dances, even (left))
STA $575A
LDA $C1910D,X ; (Right column Blitz attacks)
STA $5760
JSR $4E07 ; common function - used to set up menu format??
JSR $63AB ; common function - used to get text to display based on what is in the accumlator when called? 06 for magitek, 15 for blitz?...
PLY
RTS
; @ 6FC7
; Load commands entry point ;;;;;;;;;;;;;;;;;;;;;;;
; taken from C1/8625
Enter:
STZ $88E3 ; (from C1/5529, X = 2A) ; What does 2A mean? What does it have to do with magitek?
LDA $7BCB
BEQ LoadComm
LDA #$3C ;LDA #$29
STA $7BC2 ; (queue up to execute at C1/5716)
RTS
; @ 6FD5
LoadComm:
LDY $62CA
LDA $893F,Y
STA $36
LDA $8943,Y
STA $37
STZ $38
LDA #$01
STA $39
JSR $80DB ; common function
LDA $3C
BNE LoadContrl
LDA $36
STA $893F,Y
LDA $37
STA $8943,Y
LoadContrl:
LDA $09 ; (load controller 1)
;C1/8659: 1006 BPL $8661 (branch if not pressing B)
BPL LoadOptn ; (branch if not pressing B)
INC $96
JSR RageSet
RTS
; @ 7003
;Load command options ;;;;;;;;;;;;;;;;;;
LoadOptn:
STY $36
LDA $04 ; (load shared controller byte)
BPL SkipMid ; (branch if nobody is pressing A)
;C1/8667: 209184 JSR $8491
JSR $8491 ; not common function, but probably don't want to replicate
LDA $C1910C,X ; (load blitz commands)
BMI SlotEmpty ; (branch if slot is empty, note that this will never be taken)
INC $96
STA $7A85
LDY $36
LDA $C16F6A,X ; (Targeting byte for Blitz commands)
STA $7A84 ; (save as character targeting byte)
JMP $7795 ; common function ; jump into fight routine
SlotEmpty:
INC $95
SkipMid:
LDY $36
LDA $893F,Y
TAX
LDA $C18289,X ; load finger positioning for magitek menu
STA $88E4
LDA $8943,Y
TAX
LDA $C1828D,X ; load something... out of a data table? Vertical finger positioning?
STA $88E5
INC $88E3
RTS
; @ 7041 is next byte after end of this...
; magitek data format bytes ;;;;;;;;;;;;;;;;;;;;;;;;
;C2/E04D: 05 04 ORA $04
;C2/E04F: 04 21 TSB $21
;C2/E051: 06 00 ASL $00 ; the 06 here is what controls what word retrieval code we use
;C2/E053: 05 03 ORA $03
;C2/E055: 04 21 TSB $21
;C2/E057: 06 00 ASL $00 ; the 06 here is what controls what word retrieval code we use
;C2/E059: 00
DD #$21040405
DD #$03050015 ; swap word retrieval code to use 0x15 pointer... Not sure what used this originally though!! BUG RISK
DD #$00152104 ; swap word retrieval code to use 0x15 pointer... Not sure what used this originally though!! BUG RISK
DB #$00
; @ 704E
; take from C1/64EF - C1/6517
JSR $63F7 ; (from C1/6411, X = 15) ; does some counters
LDA ($4F)
STA $2C ; storing if the attack is available or not?
CMP #$FF
BNE GetName
LDA #$0A
JMP $66A5 ; common function?
GetName:
;STA $2C
LDA #$0A ; (10 = Blitz attack name length)
STA $2E
STA $40
JSR $18B0 ; common function
LDX $30
LoadName:
;C1/650A: BFADF9E6 LDA $E6F9AD,X (Loads Magitek attack name X)
LDA $E6F831,X ; (Loads Blitz attack name X)
JSR $63FE ; common function?
INX
DEC $40
BNE LoadName
RTS
; @ 7076
; Not sure what this does but its between Magitek 28 and 2A command so probably related? ;;;;;;;;;;;;;;;;;;;;
; taken from C1/5716
; yes I'm aware this 1C does not reference Rage, but when I first started out I didn't realize 7BF0 was an index for a separate function pointer table
; so yes, this name is mislead and dumb for now.
RageSet:
;LDA #$1C ; Why 1C?? ;(from C1/5529, X = 29) ; X=3B uses #$27, X=3C uses #$28
;STA $7BF0
;TDC
;JMP $5A2C ; common function
LDA #$28 ; Why 1C?? ;(from C1/5529, X = 29) ; X=3B uses #$27, X=3C uses #$28
STA $7BF0
TDC ;LDA #$11 ;causes an infinite loop when using abilities...
JMP $5A2C ; common function
;@ 7080 is next byte
;@ 7095 is where blitz originally ended
; change blitz menu text pointer
; BUG RISK this overrides whatever was using 15, which I don't see anywhere but...
; C1/643E: 4767 (15) (exits)
org $C1643E
DW #$704E
; Pointer, but for what command I don't know, pretty sure this is for blitz...
; other commands point to "action" portion, i.e. magitek points to '2A' BUG RISK
;C2/E38C: 01 00
org $C2E38C
DW #$3D01 ; total risk here....but make point to 3D