Users browsing this thread: 2 Guest(s)
It is the apocalypse after all.

#13
Posts: 383
Threads: 34
Thanks Received: 10
Thanks Given: 13
Joined: Dec 2018
Reputation: 18
Status
Moog
Yes, Gi is correct, a custom event that triggers some assembly code would work much better. I shouldn't have sent you astray the way I did, Masiur was right to begin with.
I've never coded something like that before, so you're going to be the guinea pig.

Code:
Custom Event $A4            (Inventory Flush) [This custom event command takes no arguments]
[I chose $A4 because event bit $0A4 means the game is in the World of Ruin.  It's an easy way to remember which event got used for this]


POINTER
C0/99A2:    83 DF        (act. A4: ** NOT USED **)        [Was 1A B9]


COMMAND
C0/DF83:    [Was Freespace, 29 bytes used]
A6 00        LDX $00        (Load X with $00)
A9 FF        LDA #$FF        (Get an "empty" item)
9D 69 18      STA $1869,X     (Put it in inventory at X)
E8          INX                (Increment X)
E0 00 01      CPX #$0100        (Is X over 256?)
D0 F5        BNE getNextSlot        (If not, branch -> get the next item)
C2 21        REP #$21        (16 bit accum./memory)
9C 60 18    STZ $1860        (Zero the low byte of GP)
7B          TDC             (Clear the accumulator)
E2 20        SEP #$20          (8 bit accum./memory)
9C 62 18      STZ $1862        (Zero the high byte of GP)
A9 01        LDA #$01        (Advance the script 1 place, as our command has no arguments)
4C 5C 9B      JMP $9B5C

    RAW HEX FOR COMMAND CODE
    C0/DF83:
        A6 00 A9 FF 9D 69 18 E8 E0 00 01 D0 F5 C2 21 9C 60 18 7B E2 20 9C 62 18 A9 01 4C 5C 9B
    
    
EVENT HOOK  [Unchanged from earlier post]
CA/530C:
    B2 01 AF 24            [Go to subroutine EE/AF01 (which is unused space in Vanilla)]


EVENT SUBROUTINE
EE/AF01:
    88 06 00 00            [Clean Celes's statuses (displaced vanilla code)]
    8D 06                [Unequip Celes]
    A4                    [Run Custom Command to flush inventory]
    FE                     [Return to sender]

    RAW HEX FOR EE/AF01 SUBROUTINE
    88 06 00 00 8D 06 A4 FE

You'll want to blank the rest of the 500-some bytes from the previous post's event code. Better yet, go back to a version of the file before you tried this and just do these changes with the hex editor. If you didn't make a backup, well, thankfully it was just freespace and it's relatively easy to repair (just hold down the F key after typing FE in the $EE bank until you reach another block of FFs), but make sure to make a backup now!

Everything above should make $A4 in the event script flush both inventory and GP. Because it's a custom event command, older programs like Zone Doctor won't be able to parse it and thus won't be able to give you accurate event text dumps (the only thing that editor is good for since its save corrupts ROMs). Luckily, we're putting it in a bank that Zone Doctor doesn't check.
  Find
Quote  
[-] The following 1 user says Thank You to C-Dude for this post:
  • Gi Nattak (07-21-2021)



Messages In This Thread
It is the apocalypse after all. - by fw4210 - 07-19-2021, 06:56 PM
RE: It is the apocalypse after all. - by madsiur - 07-19-2021, 07:09 PM
RE: It is the apocalypse after all. - by C-Dude - 07-19-2021, 07:44 PM
RE: It is the apocalypse after all. - by madsiur - 07-19-2021, 07:49 PM
RE: It is the apocalypse after all. - by C-Dude - 07-19-2021, 07:54 PM
RE: It is the apocalypse after all. - by madsiur - 07-19-2021, 07:55 PM
RE: It is the apocalypse after all. - by fw4210 - 07-20-2021, 01:43 PM
RE: It is the apocalypse after all. - by C-Dude - 07-20-2021, 03:16 PM
RE: It is the apocalypse after all. - by fw4210 - 07-20-2021, 07:24 PM
RE: It is the apocalypse after all. - by C-Dude - 07-20-2021, 07:49 PM
RE: It is the apocalypse after all. - by fw4210 - 07-20-2021, 08:19 PM
RE: It is the apocalypse after all. - by C-Dude - 07-20-2021, 10:07 PM
RE: It is the apocalypse after all. - by fw4210 - 07-20-2021, 11:13 PM
RE: It is the apocalypse after all. - by C-Dude - 07-20-2021, 11:16 PM
RE: It is the apocalypse after all. - by fw4210 - 07-21-2021, 12:04 AM
RE: It is the apocalypse after all. - by fw4210 - 07-21-2021, 12:29 AM
RE: It is the apocalypse after all. - by fw4210 - 07-21-2021, 02:12 AM
RE: It is the apocalypse after all. - by fw4210 - 07-21-2021, 03:39 AM

Forum Jump:

Users browsing this thread: 2 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite