Users browsing this thread: 1 Guest(s)
Command Edit Upgrade patch [WIP] Alpha Patch Available

#31
Posts: 96
Threads: 3
Thanks Received: 2
Thanks Given: 3
Joined: Dec 2011
Reputation: 1
Status
None
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.
  Find
Quote  



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

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite