Attempting to create a new event command
#8
Ha! I did know part of it! SEP and REP, 8-bit/16-bit how many values it loads at once... I just drive to slow and could have never explained it as pretty as m06 does.

That being said, that code at $9A6D, it kinda makes sense how it works, but I'd be guessing the whole way. By the way, where is this "Madsiur's custom event 83 readme"? I need to save that one.

As far as portable and reusable: Yeah, long as you treat it as an event command.

Code:
F1/A049        C2 21            REP #$21
F1/A04B        A5 E5            LDA $E5            (Load low and middle byte of currnt offset) (Load the location of where the command was used?)
F1/A04D        69 05 00          ADC #$0005        (Command + parameters length)(Account for length of command in order to return to byte after in the event of return)
F1/A050        85 E5            STA $E5            (Save in $E5)(Save the address for no-jump/return)
F1/A052        7B              TDC             (Transfer D to C)
F1/A053        E2 20            SEP #$20          (8 bit accum./memory)
F1/A055        65 E7            ADC $E7            (Add to A $E7)
F1/A057        85 E7            STA $E7            (Store A in $E7)
F1/A059        5C 6D 9A C0     JMP $C09A6D        (Make a 5 bytes jump from the command number in the event)(Failed check,continue with normal script)
F1/A05D        C2 20            REP #$20          (16 bit accum./memory)
F1/A05F        A6 EC            LDX $EC            (Load parameter 2 and 3)
F1/A061        86 E5            STX $E5            (store the low and middle byte of the offset in $E5)(Load the desired JMP address "/0000" if check OK)
F1/A063        E2 20            SEP #$20        (8 bit accum./memory)
F1/A065        A5 EE            LDA $EE            (Load parameter 4) (Load "00/" of desired JMP address)
F1/A067        18              CLC                (clear carry)
F1/A068        69 CA            ADC #$CA        (Add #$CA to the high byte of the offset) (Add CA to the high byte of address like other event commands)
F1/A06A        85 E7            STA $E7            (Store high byte of the offset in $E7)
F1/A06C        5C 6D 9A C0      JMP $C09A6D        (Make the event branching/jumping effective)

Least that's what I see it doing. Still don't fully get the "exit" though. Please correct me if I'm wrong, it has been known to happen. (The added comments to that block of code is what I'm talking about btw)
The only true wisdom is knowing you know nothing.
Reply


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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Command Change Custom Event GrayShadows 8 8,574 05-22-2022, 11:07 PM
Last Post: fedorajoe
  Invoke Game Saving Screen Event Command Morendo 1 1,777 09-05-2020, 10:29 PM
Last Post: C-Dude
  Attempting something... justincreedon 4 4,529 05-21-2015, 07:44 AM
Last Post: justincreedon
  How to create a new version of The Soul Shrine ShinMrKarate 23 21,990 11-01-2014, 06:42 AM
Last Post: Tenkarider
  Need help to create a custom event Astaroth_ 12 14,982 09-01-2013, 05:22 PM
Last Post: madsiur

Forum Jump:


Users browsing this thread: 1 Guest(s)