Users browsing this thread: 1 Guest(s)
Revert Waits for Action

#11
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
The problem is on my end, I forgot to run Patch Conflict Finder and there's a conflict with Morph Mayhem patch. I'll try to fix that later tonight and see how it goes.

EDIT: I got it working but there's a bug, Revert doesn't proceed automatically when the gauge becomes depleted. An idle Terra stays morphed forever until you order her something.

Here's Morph Mayhem v1.2 full ASM with my changes at the bottom:

Code:
hirom  ; don't change this
header  ; comment out if your rom has no header

org $C21211  ; location in v1.0 or v1.1
;org $C2120C  ; location in SFC version
    LDA $3AA0,X
    LSR A  ; is entity present?
    BCC update_and_remove  ; branch if not
    BIT #$08  ; is entity Stopped, or is someone else using Quick?
    BNE exit  ; if so, exit
C2121B:    REP #$20  ; 16-bit A
;REMOVED1:    SEC
C2121D:    LDA $3F30
C21220:    SBC $3F32
C21223:    STA $3F30  ; decrease Morph timer
C21226:    SEP #$20  ; 8-bit A
    XBA  ; high byte of timer
C21229:    BCS update_timer  ; if timer ran out...
C2122B:    STZ $3F31  ; ...zero out high byte
;REMOVED2:
;    JSR $0B36  ; v1.0 or v1.1
;    JSR $0B2E  ; SFC only
;    LDA #$FF
;    STA $3EE2
C2122E:    LDA #$04  ; queue Revert, if not already queued
REPLACE1:
C21230:    JSR check_queue  ; this one instruction replaces two
;C21230:    STA $3A7A
;    JSR $4EB2  ; v1.0 or v1.1
;    JSR $4E9A  ; SFC only

update_and_remove:
    JSR check_gauge
    TDC

update_timer:
;REMOVED3:    LDA $3F31
C21237:    STA $3B04,X  ; store high byte of timer to Morph gauge

exit:
C2123A:    RTS

org $C220DD  ; location in v1.0 or v1.1
;org $C220D8  ; location in SFC version
return:  ; comment out this label if reversing
C220DD:    RTS

C220DE:    LDA $2F45
C220E1:    BEQ return  ; exit if not trying to run
    LDA $3A38
    BEQ return  ; exit if no one is able to run
;REMOVED4:    REP #$20
REPLACE2:
C220E8:    PEA $0902  ; save "no run" animation
;C220E8:    LDA #$0902
;REMOVED5:
;    STA $3A28
;    SEP #$20
    PHA
C220EC:    LDA $B1
REPLACE3:
C220EE:    LSR A  ; five instructions replace two
C220EF:    LSR A
C220F0:    PLA
C220F1:    BCS save_animation
;C220EE:    BIT #$02
;C220F0:    BNE save_animation
;REMOVED6:
;    LDA $3A38
;    BEQ return
C220F3:    STA $B8  ; copy list
C220F5:    STZ $3A38  ; clear original list
C220F8:    JSR $6400  ; v1.0 or v1.1
;C220F8:    JSR $63E8  ; SFC only
C220FB:    LDX #$06

party_loop:
C220FD:    LDA $3018,X
C22100:    TRB $B8  ; remove party member from list of escapees
C22102:    BEQ iterate  ; skip party member if they weren't on the list
C22104:    XBA
C22105:    LDA $3219,X  ; top byte of ATB timer
C22108:    BNE iterate  ; if not 0, skip party member
C2210A:    LDA $3AA0,X
C2210D:    BIT #$50
C2210F:    BNE iterate
C22111:    LSR A
C22112:    BCC iterate  ; skip absent party members
C22114:    LDA $3EE4,X
C22117:    BIT #$02
C22119:    BNE iterate  ; skip Zombies
C2211B:    LDA $3EF9,X
C2211E:    BIT #$20
C22120:    BNE iterate  ; skip Hidden party members
C22122:    XBA
C22123:    TSB $B8
C22125:    TSB $3A39  ; list of escapees
C22128:    TSB $2F4C  ; entities to remove from battlefield
REPLACE4:
C2212B:    LDA #$40  ; these five instructions replace six
C2212D:    JSR $5BAB  ; v1.0 or v1.1
;C2212D:    JSR $5B93  ; SFC only
C22130:    TXY
C22131:    LDA #$40
C22133:    JSR $464C  ; v1.0 or v1.1
;C22133:    JSR $4634  ; SFC only
;C2212B:    LDA $3AA1,X  ; these instructions are the ones replaced
;    ORA #$40
;    STA $3AA1,X
;    LDA $3204,X
;    ORA #$40
;    STA $3204,X
C22136:    JSR $07C8  ; v1.0 or v1.1
;C22136:    JSR $07C0  ; SFC only
    CPX $3EE2
    BNE after_revert
    JSR $0AE7  ; v1.0 or v1.1
;    JSR $0ADF  ; SFC only

after_revert:
C22141:    TXY

iterate:
C22142:    DEX
C22143:    DEX
C22144:    BPL party_loop
    PLA  ; revoke saved animation
    PLA
C22148:    LDA $B8
C2214A:    BEQ return  ; exit if nobody escaped
    PEA $2206  ; save "flee" animation
C2214F:    STZ $B9
C22151:    TYX
C22152:    JSR $57C2  ; v1.0 or v1.1
;C22152:    JSR $57AA  ; SFC only
C22155:    JSR $63DB  ; v1.0 or v1.1
;C22155:    JSR $63C3  ; SFC only

save_animation:
C22158:    REP #$20
REPLACE5:
C2215A:    PLA  ; single-instruction replacement
;C22158:    LDA #$2206
C2215B:    STA $3A28
C2215E:    SEP #$20
REPLACE6:
C22160:    JMP $629E  ; v1.0 or v1.1
;C22160:    JSR $629E  ; replaces this
;C22160:    JMP $6286  ; SFC only
;C22160:    JSR $6286  ; replaces this

;REMOVED7:
;return:
;    RTS

;;;;;;;;;;;;;;; Polite Revert changes starts here.

org $C26752
check_queue:
C26752:    CMP $3A7A  ; is command queued?
C26755:    BEQ no_queue  ; if not, queue it
;C26757: JMP $4CEE  ; Old location, using end of Dog Block part which I believe should not be touched.
;C26757: JMP $4CD6  ; Old location, SFC only.
C26757:    STA $3A7A  ; I copied the necessary code from C24CEE here to avoid changing the Dog Block part.
C2675A:    JMP $4ECB  ; Intended jump for the Polite Revert patch.

no_queue:
;C2675A:    RTS ; old offset
C2675D:     RTS ; new offset since we're using 3 more bytes.

;;;;;;;;;;;;;;; Polite Revert changes ends here.

org $C2A7F7
check_gauge:
C2A7F7:    LDA $3B04,X  ; is Morph gauge zero?
C2A7FA:    BEQ is_zero  ; if not, update Morph supply
C2A7FC:    JSR $0B36  ; v1.0 or v1.1
;C2A7FC:    JSR $0B2E  ; SFC only

is_zero:
C2A7FF:    RTS



  Find
Quote  

#12
Posts: 614
Threads: 49
Thanks Received: 0
Thanks Given: 4
Joined: Feb 2017
Reputation: 25
Status
None
Hmmm... so after some testing, it looks like this needs some work, and possibly a combination with Morph Mayhem. Warrax, the behavior you're describing is what I'm seeing too. For Freeze and Stop, the Morph Gauge keeps going down, and when cured of the status, Terra stays morphed until her next ordered action. Sleep worked when I tested it the other day, but now it's not doing it. I think Sleep works if Revert was queued up BEFORE Terra was put to sleep, but not during her sleep. Other action-changing statuses, like Muddle and Berserk, work fine. No problems there.

This is... going to be trickier than I thought. Words that every hacker has uttered at some point.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#13
Posts: 614
Threads: 49
Thanks Received: 0
Thanks Given: 4
Joined: Feb 2017
Reputation: 25
Status
None
Okay, after every single member of my family got sick one by one, I'm BACK.

I think I've identified the portion of Morph Mayhem that needs to be changed. Here's the line that was throwing me off:

Code:
org $C26752
check_queue:
C26752:    CMP $3A7A  ; is command queued?
C26755:    BEQ no_queue  ; if not, queue it
C26757:    JMP $4CEE  ; v1.0 or v1.1        <------------This Line

no_queue:
C2675A:    RTS

First, the description of "BEQ no_queue" is opposite. It only branches to no_queue if it IS already queued. If not, the line I marked jumps to the middle of the Dog Block routine. That's why I couldn't make heads or tails of it. Anyway, it jumped to this line of code:

Code:
C2/4CEE: 8D 7A 3A     STA $3A7A      (Store command)
C2/4CF1: 4C B2 4E     JMP $4EB2      (queue it, in entity's counterattack and periodic
                                     damage/healing queue)

I simply changed the Morph Mayhem routine to the following:
Code:
org $C26752
check_queue:
C26752:    CMP $3A7A  ; is command queued?
C26755:    BEQ $675D  ; if so, skip
C26757:    STA $3A7A  ; queue command
C2675A: JMP $4ECB  ; add it to normal queue
C2675D: RTS

Initial testing worked, but now I need to test it in a few more situations.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#14
Posts: 6
Threads: 2
Thanks Received: 0
Thanks Given: 0
Joined: Aug 2018
Reputation: 0
Status
None
This sounds like something I'd love to have in my game. Do I need to install Morph Mayhem in addition to your code in order to test it?  Also, which situations do you need tested?
  Find
Quote  

#15
Posts: 614
Threads: 49
Thanks Received: 0
Thanks Given: 4
Joined: Feb 2017
Reputation: 25
Status
None
Yes, install Morph Mayhem first. Then you can make the edits I detailed above.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite