The New FFIV
(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


Messages In This Thread
The New FFIV - by Zeemis - 12-31-2010, 07:46 PM
RE: Super Boss: Brachioraidos - by FEOK - 12-31-2010, 07:56 PM
RE: Super Boss: Brachioraidos - by Angelo26 - 12-31-2010, 08:06 PM
RE: Super Boss: Brachioraidos - by Zeemis - 12-31-2010, 08:52 PM
RE: Super Boss: Brachioraidos - by FEOK - 01-01-2011, 05:39 AM
RE: Super Boss: Brachioraidos - by Angelo26 - 12-31-2010, 11:03 PM
RE: Super Boss: Brachioraidos - by Zeemis - 12-31-2010, 11:18 PM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 01-01-2011, 01:29 AM
RE: Super Boss: Brachioraidos - by Zeemis - 01-01-2011, 01:31 AM
RE: Super Boss: Brachioraidos - by Zeemis - 01-01-2011, 04:32 PM
RE: Super Boss: Brachioraidos - by FEOK - 01-01-2011, 04:39 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-01-2011, 09:30 PM
RE: Super Boss: Brachioraidos - by FEOK - 01-02-2011, 05:48 AM
RE: Super Boss: Brachioraidos - by Zeemis - 01-02-2011, 11:03 AM
RE: Super Boss: Brachioraidos - by SSJ Rick - 01-02-2011, 12:02 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-02-2011, 12:09 PM
RE: Super Boss: Brachioraidos - by FEOK - 01-02-2011, 12:51 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-02-2011, 12:59 PM
RE: Super Boss: Brachioraidos - by FEOK - 01-02-2011, 02:52 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-02-2011, 02:53 PM
RE: Super Boss: Brachioraidos - by FEOK - 01-02-2011, 02:59 PM
RE: Super Boss: Brachioraidos - by Angelo26 - 01-02-2011, 05:17 PM
RE: Super Boss: Brachioraidos - by FEOK - 01-02-2011, 06:19 PM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 01-02-2011, 07:34 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-02-2011, 07:43 PM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 01-02-2011, 08:21 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-02-2011, 09:36 PM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 01-02-2011, 09:48 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-02-2011, 10:46 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-05-2011, 11:09 PM
RE: Super Boss: Brachioraidos - by Angelo26 - 01-05-2011, 11:46 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-06-2011, 12:01 AM
RE: Super Boss: Brachioraidos - by FEOK - 01-08-2011, 01:42 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-08-2011, 03:45 PM
RE: Super Boss: Brachioraidos - by FEOK - 01-08-2011, 03:59 PM
RE: Super Boss: Brachioraidos - by Sutebenukun - 01-08-2011, 11:02 PM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 01-09-2011, 12:13 AM
RE: Super Boss: Brachioraidos - by Zeemis - 01-09-2011, 04:14 AM
RE: Super Boss: Brachioraidos - by FEOK - 01-09-2011, 07:05 AM
RE: Super Boss: Brachioraidos - by SSJ Rick - 01-09-2011, 03:08 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-09-2011, 04:34 PM
RE: Super Boss: Brachioraidos - by Sutebenukun - 01-11-2011, 06:08 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-10-2011, 02:07 AM
RE: Super Boss: Brachioraidos - by Angelo26 - 01-10-2011, 08:48 AM
RE: Super Boss: Brachioraidos - by FEOK - 01-10-2011, 10:34 AM
RE: Super Boss: Brachioraidos - by SSJ Rick - 01-11-2011, 03:35 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-11-2011, 04:41 PM
RE: Super Boss: Brachioraidos - by Zeemis - 01-11-2011, 07:13 PM
RE: Super Boss: Brachioraidos - by Angelo26 - 01-12-2011, 04:26 PM
RE: Super Boss: Brachioraidos - by FEOK - 01-26-2011, 07:40 AM
RE: Super Boss: Brachioraidos - by Zeemis - 01-12-2011, 08:27 PM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 01-15-2011, 05:14 PM
RE: Super Boss: Brachioraidos - by Sutebenukun - 01-15-2011, 05:53 PM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 01-19-2011, 11:48 PM
RE: Super Boss: Brachioraidos - by Zeemis - 02-01-2011, 04:22 AM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 02-01-2011, 11:23 AM
RE: Super Boss: Brachioraidos - by Zeemis - 02-01-2011, 03:16 PM
RE: Super Boss: Brachioraidos - by Zeemis - 02-04-2011, 05:46 AM
RE: Super Boss: Brachioraidos - by Twinees - 02-04-2011, 08:17 PM
RE: Super Boss: Brachioraidos - by Zeemis - 02-04-2011, 08:25 PM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 02-04-2011, 08:55 PM
RE: Super Boss: Brachioraidos - by Zeemis - 02-05-2011, 12:04 AM
RE: Super Boss: Brachioraidos - by Zeemis - 02-05-2011, 11:54 PM
RE: Super Boss: Brachioraidos - by FEOK - 02-06-2011, 07:24 AM
RE: Super Boss: Brachioraidos - by Zeemis - 02-06-2011, 08:10 AM
RE: Super Boss: Brachioraidos - by Angelo26 - 02-06-2011, 04:25 PM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 02-06-2011, 04:59 PM
RE: Super Boss: Brachioraidos - by Zeemis - 02-06-2011, 05:25 PM
RE: Super Boss: Brachioraidos - by FEOK - 02-06-2011, 05:44 PM
RE: Super Boss: Brachioraidos - by Sutebenukun - 02-06-2011, 06:01 PM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 02-06-2011, 06:55 PM
RE: Super Boss: Brachioraidos - by Zeemis - 02-06-2011, 07:28 PM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 02-06-2011, 11:39 PM
RE: Super Boss: Brachioraidos - by Angelo26 - 02-06-2011, 11:53 PM
RE: Super Boss: Brachioraidos - by Zeemis - 02-07-2011, 12:58 AM
RE: Super Boss: Brachioraidos - by .Gilgamesh// - 02-08-2011, 11:38 AM
RE: Super Boss: Brachioraidos - by FEOK - 02-08-2011, 06:29 PM
RE: Super Boss: Brachioraidos - by Zeemis - 02-08-2011, 06:45 PM
RE: Super Boss: Brachioraidos - by Sutebenukun - 02-09-2011, 08:05 PM
RE: Super Boss: Brachioraidos - by SSJ Rick - 02-10-2011, 01:00 AM
RE: Super Boss: Brachioraidos - by Zeemis - 02-10-2011, 03:52 AM
RE: Super Boss: Brachioraidos - by FEOK - 02-10-2011, 05:07 AM
RE: Super Boss: Brachioraidos - by Zeemis - 02-21-2011, 03:40 AM
RE: The New FFIV - by Angelo26 - 02-21-2011, 10:47 AM
RE: The New FFIV - by FEOK - 02-21-2011, 11:56 AM
RE: The New FFIV - by Zeemis - 02-21-2011, 01:33 PM
RE: The New FFIV - by Angelo26 - 02-21-2011, 02:11 PM
RE: The New FFIV - by FEOK - 02-21-2011, 02:43 PM
RE: The New FFIV - by Zeemis - 02-21-2011, 06:02 PM
RE: The New FFIV - by DjinnAndTonic - 02-21-2011, 07:10 PM
RE: The New FFIV - by Zeemis - 02-21-2011, 08:50 PM
RE: The New FFIV - by FEOK - 02-22-2011, 05:32 AM
RE: The New FFIV - by DjinnAndTonic - 02-22-2011, 07:04 PM
RE: The New FFIV - by Zeemis - 02-22-2011, 07:51 PM
RE: The New FFIV - by DjinnAndTonic - 02-22-2011, 09:02 PM
RE: The New FFIV - by Zeemis - 02-25-2011, 07:00 PM
RE: The New FFIV - by SSJ Rick - 02-25-2011, 07:05 PM
RE: The New FFIV - by Zeemis - 02-25-2011, 07:07 PM
RE: The New FFIV - by .Gilgamesh// - 02-25-2011, 10:40 PM
RE: The New FFIV - by Zeemis - 02-25-2011, 11:43 PM
RE: The New FFIV - by FEOK - 02-26-2011, 05:08 AM
RE: The New FFIV - by Zeemis - 02-26-2011, 05:38 AM
RE: The New FFIV - by FEOK - 02-26-2011, 05:42 AM
RE: The New FFIV - by Zeemis - 03-01-2011, 03:23 AM
RE: The New FFIV - by RajaHibiki - 03-04-2011, 12:22 AM
RE: The New FFIV - by Zeemis - 03-04-2011, 01:14 AM
RE: The New FFIV - by DjinnAndTonic - 03-04-2011, 01:23 AM
RE: The New FFIV - by Zeemis - 03-04-2011, 01:33 AM
RE: The New FFIV - by DjinnAndTonic - 03-04-2011, 02:52 AM
RE: The New FFIV - by Zeemis - 03-04-2011, 04:15 AM
RE: The New FFIV - by DjinnAndTonic - 03-04-2011, 04:24 AM
RE: The New FFIV - by Zeemis - 03-07-2011, 01:40 AM
RE: The New FFIV - by Angelo26 - 03-26-2011, 10:31 PM
RE: The New FFIV - by Zeemis - 03-27-2011, 02:33 AM
RE: The New FFIV - by Zeemis - 04-27-2011, 11:19 AM
RE: The New FFIV - by ArcadianKnight - 04-27-2011, 03:04 PM
RE: The New FFIV - by Zeemis - 05-14-2011, 09:10 PM
RE: The New FFIV - by Zeemis - 05-26-2011, 04:25 PM
RE: The New FFIV - by Zeemis - 05-26-2011, 05:53 PM
RE: The New FFIV - by Zeemis - 06-30-2011, 01:29 AM
RE: The New FFIV - by DjinnAndTonic - 06-30-2011, 02:08 AM
RE: The New FFIV - by Zeemis - 06-30-2011, 02:26 AM
RE: The New FFIV - by DjinnAndTonic - 06-30-2011, 02:33 AM
RE: The New FFIV - by Zeemis - 06-30-2011, 02:35 AM
RE: The New FFIV - by DjinnAndTonic - 06-30-2011, 08:10 AM
RE: The New FFIV - by darkmage - 06-30-2011, 01:09 PM
RE: The New FFIV - by Zeemis - 06-30-2011, 01:14 PM
RE: The New FFIV - by Sutebenukun - 08-04-2011, 09:28 PM
RE: The New FFIV - by Zeemis - 11-20-2011, 10:47 PM
RE: The New FFIV - by DjinnAndTonic - 11-21-2011, 01:01 PM
RE: The New FFIV - by Zeemis - 11-21-2011, 08:58 PM
RE: The New FFIV - by JCE3000GT - 12-02-2011, 09:48 AM
RE: The New FFIV - by ribbits - 12-01-2011, 11:22 PM
RE: The New FFIV - by Zeemis - 12-02-2011, 01:41 PM
RE: The New FFIV - by JCE3000GT - 12-02-2011, 02:49 PM
RE: The New FFIV - by Zeemis - 12-03-2011, 05:50 AM
RE: The New FFIV - by Sutebenukun - 04-17-2012, 10:34 AM
RE: The New FFIV - by Zeemis - 04-18-2012, 12:14 PM
RE: The New FFIV - by madsiur - 04-18-2012, 07:40 PM
RE: The New FFIV - by Sutebenukun - 04-18-2012, 06:16 PM
RE: The New FFIV - by Zeemis - 04-19-2012, 01:17 PM
RE: The New FFIV - by madsiur - 04-19-2012, 05:09 PM
RE: The New FFIV - by Zeemis - 04-20-2012, 01:56 AM
RE: The New FFIV - by NeoBahamut - 05-05-2012, 06:06 PM
RE: The New FFIV - by madsiur - 05-05-2012, 08:30 PM
RE: The New FFIV - by Zeemis - 06-25-2012, 10:46 AM
RE: The New FFIV - by madsiur - 06-27-2012, 08:41 PM
RE: The New FFIV - by Zeemis - 07-05-2012, 11:11 AM
RE: The New FFIV - by CrumpledMedal - 07-05-2012, 05:12 PM
RE: The New FFIV - by Zeemis - 12-18-2012, 01:58 PM
RE: The New FFIV - by CrumpledMedal - 12-18-2012, 04:08 PM
RE: The New FFIV - by Zeemis - 12-18-2012, 06:25 PM
RE: The New FFIV - by CrumpledMedal - 12-18-2012, 07:52 PM
RE: The New FFIV - by Zeemis - 02-08-2013, 11:15 AM
RE: The New FFIV - by Zeemis - 02-11-2013, 03:09 AM
RE: The New FFIV - by Sutebenukun - 02-12-2013, 12:02 PM
RE: The New FFIV - by DrROBschiz - 02-13-2013, 02:55 PM
RE: The New FFIV - by Zeemis - 02-13-2013, 05:04 PM
RE: The New FFIV - by Darkdrago909 - 02-13-2013, 08:21 PM
RE: The New FFIV - by Endarire - 07-16-2013, 12:28 AM
RE: The New FFIV - by Sutebenukun - 07-16-2013, 09:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sprite Request::FFIV Dwarf DruidX 6 6,891 12-13-2012, 12:37 PM
Last Post: LordSutebenu
  Cid FFIV WIP Twinees 28 29,880 02-28-2012, 03:48 AM
Last Post: Badass
  FFIV DS ribbits 12 14,109 07-01-2011, 04:03 AM
Last Post: Archaic
  I'm Playing an FFIV Hack anyone else tried it yet? CrumpledMedal 5 5,815 11-12-2010, 03:14 PM
Last Post: xJCSx
  FFIV Hack Zeemis 14 15,702 07-09-2010, 10:31 PM
Last Post: Gilgameshversion

Forum Jump:


Users browsing this thread: 1 Guest(s)