Users browsing this thread: 1 Guest(s)
Attempting to create a new event command

#9
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
Quite enlightening...
Maaaaaaaaybe $E5 $E6 and $E7 are used as passive parameters of the dynamic value to use for the jump(or for continue in the case the check is false)
Now i'd like to understand why/how a JMP to itself allows the command to do something so much elaborate.
The other question is... if $E5-7 values have a so much important role, then why in the RAM map document they're not even mentioned?!? Surprised

I'm gonna try to do something with those new info... we'll see what happens.

PS. Madsiur's custom event 83 is inside this site, among hack patches, i believe...

____________________________________


Ok, i finished... the good new is that the game won't crash when i use the command, the problem is that it always returns false... Sad
Here's the code i wrote:
Code:
C0/D613: A6 EB        LDX $EB     (First byte for FC)
C0/D615: 20 45 D6    JSR $D645   ($EB = variable #X)
C0/D618: A5 EB        LDA $EB  (after the JSR the n. of the var is changed into its value)
C0/D61A: C5 EC        CMP $EC
C0/D61C: 30 13          BMI             (Branch if AA value < BB)

C0/D61E: C2 20            REP #$20          (16 bit accum./memory)
C0/D620: A6 ED            LDX $ED            (Load parameter 3 and 4)
C0/D622: 86 E5            STX $E5            (store the low and middle byte of the offset in $E5)
C0/D624: E2 20            SEP #$20        (8 bit accum./memory)
C0/D626: A5 EF            LDA $EF            (Load parameter 5)
C0/D628: 18                      CLC                (clear carry)
C0/D629: 69 CA            ADC #$CA        (Add #$CA to the high byte of the offset)
C0/D62B: 85 E7            STA $E7            (Stre high byte of the offset in $E7)
C0/D62D: 5C 6D 9A C0      JMP $C09A6D        (Make the event branching/jumping effective)
C0/D631: C2 21            REP #$21
C0/D633: A5 E5            LDA $E5            (Load low and middle byte of current offset)
C0/D635: 69 06 00          ADC #$0006        (Command + parameters length)
C0/D638: 85 E5            STA $E5            (Save in $E5)
C0/D63A: 7B                      TDC             (Transfer D to C)
C0/D63B: E2 20            SEP #$20          (8 bit accum./memory)
C0/D63D: 65 E7            ADC $E7            (Add to A $E7)
C0/D63F: 85 E7            STA $E7            (Store A in $E7)
C0/D641: 5C 6D 9A C0     JMP $C09A6D        (Make a 6 bytes jump from the command number in the event)


C0/D645: 48            PHA
C0/D646: E0 24        CPX #$24
C0/D648: B0 05        BCS $D64F  
C0/D64A: BD B0 3E   LDA $3EB0,X
C0/D64D: 80 03        BRA $D652
C0/D64F: B9 AC 3D   LDA $3DAC,Y
C0/D652: 85 EB        STA $EB
C0/D654: 68            PLA
C0/D655: 18            CLC
C0/D656: 60            RTS


This is the code i tested for see if that works:
Code:
003F0200:  A3 04 32 0B 00 35   //  if battle var 04 >= 50 then jump to 3F020B  
                B2 BA BD 00          // calls whatever command
                FE                        // return
003F020B:  A3 04 64 18 00 35   //  if battle var 04 >= 100 then jump to 3F0218
                F4 1F                    // whatever sound
                4B 00 40               // message 0
                BB                       // whatever command
                FE                       // return
003F0218:   A3 04 96 25 00 35 // if battle var 04 >= 150 then jump to 3F0225
                 F4 B8
                 4B 01 40             // message 1
                 BB
                 FE
003F0225:   A3 04 C8 32 00 35 // if battle var 04 >= 200 then jump to 3F0232
                F4 E1
                4B 02 40              // message 2
                BB
                FE
003F0232:  A3 04 FF 3F 00 35  // if battle var 04 >=  then jump to 3F020B
                F4 D0
                4B 03 40              // message 3
                BB
                FE
003F023F    F4 E1
                91
                F4 D0
                91
                F0 2C
                92
                F0 2F
                4B 04 40   // message 4
                BB
                FE

I start a battle, var 04 chances its value and then battle ends: after the battle this code above is triggered... and always returns false.
Could you try to figure out if i missed something?


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  



Messages In This Thread
RE: Attempting to create a new event command - by Tenkarider - 04-05-2015, 10:32 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite