Users browsing this thread: 2 Guest(s)
The New FFIV
04-19-2012, 05:09 PM
(04-19-2012, 01:17 PM)Zeemis Wrote: Madsiur, check this out bro:
https://www.ff6hacking.com/forums/showth...43#pid7543
Yeah using the control command could work. For your targetting issue you could change this portion of code, it's from the sketch command but both commands use this routine. Right now you can select your party but the command miss, if I understand right. I can't tell because I never use sketch/control:
Code:
C2/3B29: C0 08 CPY #$08
C2/3B2B: 90 EE BCC $3B1B (Miss if aimed at party)
You could populate you control menu with the same 4 spells everytime, no matter who you target. You simply create a data table with four entries like this:
Code:
C2/0000: 00 02 01 FF (Fire, Bolt, Ice and nothing)
Then you draw one value each time you loop in this routine:
Code:
C2/3756: 7B TDC
C2/3757: 48 PHA
***** replace the next line with the new offset of the table *****
C2/3758: BF 00 3D CF LDA $CF3D00,X (get the spell number/command from the created table)
C2/375C: 8F 80 21 00 STA $002180 (store it in a menu)
C2/3760: C9 FF CMP #$FF
C2/3762: F0 1C BEQ $3780 (branch if the command [aka the spell #] was null)
C2/3764: EB XBA
C2/3765: A9 0E LDA #$0E (there are 14d bytes per spell in magic data)
C2/3767: 20 81 47 JSR $4781 (spell number * 14)
C2/376A: DA PHX
C2/376B: AA TAX
C2/376C: BF C5 6A C4 LDA $C46AC5,X (get MP cost)
C2/3770: EB XBA
C2/3771: BF C0 6A C4 LDA $C46AC0,X (get targeting byte)
C2/3775: FA PLX (restore X = monster num * 4)
C2/3776: 83 01 STA $01,S (replace zero value on stack from C2/3757 with
targeting byte?)
C2/3778: 18 CLC (clear carry)
C2/3779: A5 EF LDA $EF (retrieve (MP of monster + 1) / 256 ?)
C2/377B: D0 03 BNE $3780 (if it's nonzero, branch. spell MP costs are
only 1 byte, so we don't have to worry whether
it's castable)
C2/377D: EB XBA (get MP cost of spell)
C2/377E: C5 EE CMP $EE (carry will be clear if the Cost of spell is less
than (monster MP + 1), or if the foe has >= 255 MP)
(IOW, if the spell is affordable.)
C2/3780: 6A ROR (rotate carry into top bit of A. doubt the other bits
matter, given the XBA above is only done sometimes..)
C2/3781: 8F 80 21 00 STA $002180
C2/3785: 68 PLA (get the targeting byte, or zero if the menu entry
was null)
C2/3786: 8F 80 21 00 STA $002180
C2/378A: E8 INX
C2/378B: 88 DEY
C2/378C: D0 C8 BNE $3756 (loop 4 times, once for each Control command)
Then most of the code previous to that become unnecessary, because it's loading the monster # to get the control commands from the monster:
Code:
C2/372F: DA PHX
C2/3730: 5A PHY
C2/3731: 08 PHP
C2/3732: C2 31 REP #$31 (set 16-bit A, X and Y. clear Carry)
C2/3734: BF 4A 54 C2 LDA $C2544A,X (address of controlling character's menu?)
C2/3738: 69 30 00 ADC #$0030
C2/373B: 8F 81 21 00 STA $002181
C2/373F: BB TYX
C2/3740: BD 08 3C LDA $3C08,X (MP of monster?)
C2/3743: 1A INC
C2/3744: 85 EE STA $EE (add 1, as it'll make future comparisons easier)
C2/3746: BD F9 1F LDA $1FF9,X (Monster Type)
C2/3749: 0A ASL
C2/374A: 0A ASL
C2/374B: AA TAX (X = monster number * 4)
C2/374C: E2 20 SEP #$20 (set 8-bit accumulator)
C2/374E: 7B TDC (clear A)
C2/374F: 8F 83 21 00 STA $002183
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 2 Guest(s)