Command Edit Upgrade patch [WIP] Alpha Patch Available
#31
Thanks, HatZen. I'll have a look at those when I get a chance.

Right now I'm working on a new routine that blocks certain commands from loading for certain characters.
I ran into a little trouble after I got Mimic to only appear on Gogo's menu.
Getting Morph to only appear for Terra and then only after it gets unlocked normally was a nightmare for a while there.
Eventually, I got it to work by checking $1DD1, bit 3. The RAM Map document I'm using says this is specifically the Morph availability flag.
Then I ran into more trouble when I added Magic into the mix. I think my code got overly complex and something was wrong with my logic because Terra and Gogo worked fine, but every other character made the status screen go all black. I think I was causing an infinite loop.

I rewrote the code and am in the middle of figuring out the proper values for the branches.
Check it out and let me know if there any mistakes or possible optimizations I could add.

Code:
Set Up Registers & Data:
C3/FF99: 5A           PHY         (save # of valid commands)            Stack =>    2, 1.
C3/FF9A: 48           PHA         (save command ID)                    Stack => 3, 2, 1.
C3/FF9B: 20 A6 22     JSR $22A6   (go to GSub1)                        Stack => 3, 2, 1.
C3/FF9E: B9 00 00     LDA $0000,Y (get character ID)                    Stack => 3, 2, 1.
C3/FFA1: AA           TAX         (copy character ID to X)                Stack => 3, 2, 1.
C3/FFA2: 68           PLA         (retrieve command ID)                Stack =>    2, 1.
C3/FFA3: A8           TAY         (copy command ID to Y)                Stack =>    2, 1.
C3/FFA4: AD D1 1D     LDA $1DD1   (load ??? RAM byte, bit 2 = morph flag)    Stack =>    2, 1.

CheckGogo:
C3/FFA7: E0 0C        CPX #$0C    (is character Gogo?)                Stack =>    2, 1.
C3/FFA9: D0 xx        BNE $FFxx   (if not, go to CheckMimic)            Stack =>    2, 1.
C3/FFAB: 80 xx        BRA $FFxx   (go to CheckMorph)                    Stack =>    2, 1.

CheckMimic:
C3/FFAD: C0 12        CPY #$12    (is command Mimic?)                    Stack =>    2, 1.
C3/FFAF: F0 xx        BEQ $FFxx   (if so, go to SkipCommand)            Stack =>    2, 1.

CheckTerra:
C3/FFB1: E0 00        CPX #$00    (is character Terra?)                Stack =>    2, 1.
C3/FFB3: D0 xx        BNE $FFxx   (if not, go to CheckMorph)            Stack =>    2, 1.
C3/FFB5: C0 02        CPY #$02    (is command Magic?)                    Stack =>    2, 1.
C3/FFB7: F0 xx        BEQ $FFxx   (if so, go to AddCommand)                Stack =>    2, 1.
C3/FFB9: C0 03        CPY #$03    (is command Morph?)                    Stack =>    2, 1.
C3/FFBB: F0 xx        BEQ $FFxx   (if so, go to MorphFlag)                Stack =>    2, 1.
C3/FFBD: 80 xx        BRA $FFxx   (go to AddCommand)                    Stack =>    2, 1.

CheckMorph:
C3/FFBF: C0 03        CPY #$03    (is command Morph?)                    Stack =>    2, 1.
C3/FFC1: F0 xx        BEQ $FFxx   (if so, go to SkipCommand)            Stack =>    2, 1.

CheckCeles:
C3/FFC3: E0 06        CPX #$06    (is character Celes?)                Stack =>    2, 1.
C3/FFC5: D0 xx        BNE $FFxx   (if not, go to CheckMagic)            Stack =>    2, 1.
C3/FFC7: 80 xx        BRA $FFxx   (go to AddCommand)                    Stack =>    2, 1.

CheckMagic:
C3/FFC9: C0 02        CPY #$02    (is command Magic?)                    Stack =>    2, 1.
C3/FFCB: D0 xx        BNE $FFxx   (if not, go to AddCommand)            Stack =>    2, 1.

MorphFlag:
C3/FFCD: 89 04        BIT #$04    (check morph flag)                    Stack =>    2, 1.
C3/FFCF: F0 xx        BEQ $FFxx   (if clear, go to SkipCommand)            Stack =>    2, 1.

AddCommand:
C3/FFD1: 20 DD FF     JSR $FFDD   (go to Exit Prep)                    Stack =>       1.
C3/FFD4: 4C 4E 5E     JMP $5E4E   (go to BR5)

SkipCommand:
C3/FFD7: 20 DD FF     JSR $FFDD   (go to Exit Prep)                    Stack =>       1.
C3/FFDA: 4C 60 5E     JMP $5E60   (go to BR4)

Exit Prep:
C3/FFDD: 98           TYA         (copy command ID to A)                Stack =>    2, 1.
C3/FFDE: 7A           PLY         (retrieve # of valid commands)            Stack =>       1.
C3/FFDF: 60           RTS

I don't think I double checked the hex values for these opcodes, so some of them might be wrong.
PS: the stuff on the far right is me keeping track of what is in the stack so that I don't throw anything out of wack when going back to the command edit loop I cam here from.
Reply


Messages In This Thread
RE: Skills Menu Hack Idea - by Catone - 10-06-2015, 07:56 PM
RE: Skills Menu Hack Idea - by Vanya - 10-07-2015, 02:29 AM
RE: Skills Menu Hack Idea - by Catone - 10-07-2015, 04:08 AM
RE: Skills Menu Hack Idea - by dn - 10-07-2015, 06:29 AM
RE: Skills Menu Hack Idea - by HatZen08 - 10-07-2015, 10:17 AM
RE: Skills Menu Hack Idea - by Vanya - 10-07-2015, 12:56 PM
RE: Skills Menu Hack Idea - by HatZen08 - 10-08-2015, 01:26 PM
RE: Skills Menu Hack Idea - by Vanya - 10-09-2015, 12:47 AM
RE: Skills Menu Hack Idea - by HatZen08 - 10-09-2015, 09:15 AM
RE: Skills Menu Hack Idea - by Catone - 10-09-2015, 01:13 PM
RE: Skills Menu Hack Idea - by Vanya - 10-10-2015, 12:39 PM
RE: Skills Menu Hack Idea - by Catone - 10-13-2015, 10:30 PM
RE: Skills Menu Hack Idea - by Vanya - 10-14-2015, 12:56 AM
RE: Skills Menu Hack Idea - by dn - 10-14-2015, 02:09 AM
RE: Skills Menu Hack Idea - by Vanya - 10-14-2015, 02:27 AM
RE: Skills Menu Hack Idea - by HatZen08 - 10-14-2015, 03:57 PM
RE: Skills Menu Hack Idea - by Vanya - 10-14-2015, 05:37 PM
RE: Skills Menu Hack Idea - by HatZen08 - 10-15-2015, 11:24 AM
RE: Skills Menu Hack Idea - by Vanya - 10-15-2015, 05:20 PM
RE: Skills Menu Hack Idea - by abyssonym - 10-15-2015, 05:52 PM
RE: Skills Menu Hack Idea - by Vanya - 10-15-2015, 07:11 PM
RE: Skills Menu Hack Idea - by abyssonym - 10-15-2015, 07:17 PM
RE: Skills Menu Hack Idea - by HatZen08 - 10-15-2015, 08:07 PM
RE: Skills Menu Hack Idea - by Vanya - 10-15-2015, 11:38 PM
RE: Command Edit Upgrade patch [WIP] - by Vanya - 10-17-2015, 12:30 AM
RE: Command Edit Upgrade patch [WIP] - by Vanya - 10-26-2015, 08:46 AM
RE: Command Edit Upgrade patch [WIP] Alpha Patch Available - by Vanya - 10-27-2015, 04:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Utility Patch - Moved Ending (Free your CA bank!) DrakeyC 0 1,287 06-14-2022, 03:18 PM
Last Post: DrakeyC
  Mod-agnostic no-text patch SirNewtonFig 4 4,068 07-31-2021, 09:14 AM
Last Post: SirNewtonFig
  Tentative Runic -> SwdMagic patch FF6Fanatic 29 27,997 09-05-2020, 05:52 PM
Last Post: kamesennin
  Glitchy shop sprite (Expanded Palette Patch) Febreeze 1 1,852 08-11-2020, 12:50 PM
Last Post: Gi Nattak
  Portrait removal patch request for FFVI advance Feanor17 14 13,623 04-27-2020, 06:17 PM
Last Post: Feanor17
  Blue MP Digits patch? Alex Rodrick 27 26,948 05-28-2019, 09:49 AM
Last Post: Imzogelmo
  Patch: Quake reveals invisible floaters seibaby 1 2,836 02-19-2019, 01:26 PM
Last Post: seibaby
  Adapting Angelo's Name Patch DrakeyC 4 3,664 08-11-2018, 12:38 AM
Last Post: DrakeyC
  Looking for patch that fix item loss when dying before using said item Warrax 4 3,561 08-03-2018, 09:49 AM
Last Post: Warrax
  Issue with SwdTech Speed Patch ExiaTreason 4 5,914 11-24-2017, 01:53 PM
Last Post: Warrax

Forum Jump:


Users browsing this thread: 1 Guest(s)