FF6 Hacking
Patch for keeping Shadow around? - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html)
+--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html)
+--- Thread: Patch for keeping Shadow around? (/thread-1012.html)



Patch for keeping Shadow around? - DjinnAndTonic - 06-05-2011

Some Event Editing questions about Shadow. I've gone through the Event Dump looking for what it is that makes Shadow suddenly leave the party in the WoB areas he's in. Also, I've been looking into the code that kills him off if you leave him on the Floating Continent.

I don't want either of these things to happen anymore. I vaguely recall that there's a patch out there already that does this. Does anyone know of it?

Otherwise, I'm going to have to go through these bits of code and figure out what to NOP:
Code:
Shadow leaves commands
CB/9AAE: DE    Load CaseWord with the characters in the currently active party?
CB/9AAF: BE    If character $03 (SHADOW) is in the current CaseWord, call subroutine $CBA3B9

CB/A0EC: DE    Load CaseWord with the characters in the currently active party?
CB/A0ED: BE    If character $03 (SHADOW) is in the current CaseWord, call subroutine $CBA3B9

Questionably a Shadow leaves command
CB/BBB6: BE    If character $03 (SHADOW) is in the current CaseWord, call subroutine $CBBEC4

Shadow leaves, but may be necessary?
CB/BE79: BE    If character $03 (SHADOW) is in the current CaseWord, call subroutine $CBBEDD

Shadow leaves, branches to the text involved
CB/BFD0: BE    If character $03 (SHADOW) is in the current CaseWord, call subroutine $CBBFE9



RE: Patch for keeping Shadow around? - Gi Nattak - 06-05-2011

That patch is one of Djibriel's, and is called the "Sticky Shadow patch"
You can find it here: http://www14.brinkster.com/assassin17/hosted_patches.htm


RE: Patch for keeping Shadow around? - Angelo26 - 06-05-2011

(06-05-2011, 12:58 PM)DjinnAndTonic Wrote:
Code:
Shadow leaves commands
CB/9AAE: DE    Load CaseWord with the characters in the currently active party?
CB/9AAF: BE    If character $03 (SHADOW) is in the current CaseWord, call subroutine $CBA3B9

This code removes shadow from the party when you're at the imperial camp and the doma map is loaded for the first time. Since you have the option of not recruiting shadow, the code is asking here "Did you recruit shadow? If you did, let's kick him out for Cyan's scene".

(06-05-2011, 12:58 PM)DjinnAndTonic Wrote:
Code:
Shadow leaves commands
CB/A0EC: DE    Load CaseWord with the characters in the currently active party?
CB/A0ED: BE    If character $03 (SHADOW) is in the current CaseWord, call subroutine $CBA3B9

Same as above, this one kicks shadow out of the party for the scene where Doma is poisoned and Cyan goes ballistic.

(06-05-2011, 12:58 PM)DjinnAndTonic Wrote:
Code:
Shadow leaves commands
Questionably a Shadow leaves command
CB/BBB6: BE    If character $03 (SHADOW) is in the current CaseWord, call subroutine $CBBEC4

This code is for just when you get off from the Phantom Train. The game checks if shadow is still in the party. If he is, then he is given some actions to perform (just before Owain and the wife boarding the train).


(06-05-2011, 12:58 PM)DjinnAndTonic Wrote:
Code:
Shadow leaves commands
Shadow leaves, but may be necessary?
CB/BE79: BE    If character $03 (SHADOW) is in the current CaseWord, call subroutine $CBBEDD

This kicks shadow out of the party if he is present in it, just after the Phantom Train departs with Cyan's wife and child.

(06-05-2011, 12:58 PM)DjinnAndTonic Wrote:
Code:
Shadow leaves commands
Shadow leaves, branches to the text involved
CB/BFD0: BE    If character $03 (SHADOW) is in the current CaseWord, call subroutine $CBBFE9

This last one kicks shadow out of the party when about to jump the waterfall for going to the veldt in sabin's scenario.

It seems to me that the code that randomizes shadow leaving from the party might be in the C2 bank.


Killing shadow on the floating continent is a consequence of the following code:
Code:
CA/579D: 4B    Display dialogue message $0872, wait for button press
               The airship's below.
               ^ (Jump!!)
               ^ (Wait!!)
CA/57A0: B6    Indexed branch based on prior dialogue selection [$CA48C1, $CA5EB3 (does nothing)]
CA/57A7: FE    Return

CA/57A8: 4B    Display dialogue message $0873, wait for button press
               ^ (Jump!!)
               ^ (Gotta wait for SHADOW…)
CA/57AB: B6    Indexed branch based on prior dialogue selection [$CA48C1, $CA5EB3(does nothing)]
CA/57B2: FE    Return

One way to do it may be to, instead of choosing to jump or to wait, NOP that part and instead make the code jump to CA/57BB, which is the code that is activated to bring shadow to the airship in the apocalypse scene

Code:
CA/57B3: C1    If ($1E80($1FE) [$1EBF, bit 6] is clear) or ($1E80($1FD) [$1EBF, bit 5] is clear), branch to $CA5EB3 (simply returns)
CA/57BB: A1    Reset timer 0
CA/57BD: A1    Reset timer 2
CA/57BF: 3D    Create object $03
CA/57C1: 45    Refresh objects
CA/57C2: 03    Begin action queue for character $03 (Actor in stot 3), 7 bytes long (Wait until complete)
CA/57C4: D5        Set vehicle/entity's position to (104, 12)
CA/57C7: C7        Set vehicle/entity to stay still when moving
CA/57C8: C1        Set vehicle/entity's event speed to slow
CA/57C9: 4F        Do vehicle/entity graphical action $0F, flipped horizontally
CA/57CA: FF        End queue
CA/57CB: 41    Show object $03
CA/57CD: 03    Begin action queue for character $03 (Actor in stot 3), 8 bytes long (Wait until complete)
CA/57CF: 85        Move vehicle/entity right 2 tiles
CA/57D0: 4B        Do vehicle/entity graphical action $0B, flipped horizontally
CA/57D1: C2        Set vehicle/entity's event speed to normal
CA/57D2: A6        Move vehicle/entity right/down 2x1 tiles
CA/57D3: C3        Set vehicle/entity's event speed to fast
CA/57D4: A6        Move vehicle/entity right/down 2x1 tiles
CA/57D5: 49        Do vehicle/entity graphical action $09, flipped horizontally
CA/57D6: FF        End queue
CA/57D7: 92    Pause for 30 units
CA/57D8: 31    Begin action queue for character $31 (Party Character 0), 5 bytes long (Wait until complete)
CA/57DA: 1F        Do vehicle/entity graphical action $1F
CA/57DB: E0        Pause for 4 * 3 (12) frames
CA/57DD: CF        Turn vehicle/entity left
CA/57DE: FF        End queue
CA/57DF: F4    Play sound effect 24
CA/57E1: 4B    Display dialogue message $0874, wait for button press (At bottom of screen)
               “SHADOW!!”
               SHADOW: I'll be blown to bits before I can even collect my pay…
CA/57E4: D6    Set event bit $1E80($37D) [$1EEF, bit 5]
CA/57E6: B2    Call subroutine $CA5806
CA/57EA: 03    Begin action queue for character $03 (Actor in stot 3), 21 bytes long (Wait until complete)
CA/57EC: C6        Set vehicle/entity to walk when moving
CA/57ED: C2        Set vehicle/entity's event speed to normal
CA/57EE: 81        Move vehicle/entity right 1 tile
CA/57EF: A1        Move vehicle/entity right/down 1x1 tiles
CA/57F0: A1        Move vehicle/entity right/down 1x1 tiles
CA/57F1: A1        Move vehicle/entity right/down 1x1 tiles
CA/57F2: E0        Pause for 4 * 3 (12) frames
CA/57F4: 16        Do vehicle/entity graphical action $16 (facing forward, head cocked left)
CA/57F5: E0        Pause for 4 * 1 (4) frames
CA/57F7: 09        Do vehicle/entity graphical action $09 (kneeling)
CA/57F8: E0        Pause for 4 * 1 (4) frames
CA/57FA: 4A        Do vehicle/entity graphical action $0A, flipped horizontally
CA/57FB: C7        Set vehicle/entity to stay still when moving
CA/57FC: DD        Make vehicle/entity jump (high)
CA/57FD: 86        Move vehicle/entity down 2 tiles
CA/57FE: C4        Set vehicle/entity's event speed to faster
CA/57FF: 96        Move vehicle/entity down 6 tiles
CA/5800: FF        End queue
CA/5801: B2    Call subroutine $CA48D6
CA/5805: FE    Return



RE: Patch for keeping Shadow around? - Drakkhen - 06-05-2011

The relevant code for Shadow leaving after combat can be found here:

Code:
C2/4861: AE 03 30     LDX $3003   (Which character is Shadow)
C2/4864: 30 26        BMI $488C   (Branch if Shadow not in party)
C2/4866: 20 5A 4B     JSR $4B5A   (0 to 255)
C2/4869: C9 10        CMP #$10    
C2/486B: B0 1F        BCS $488C   (15 in 16 chance branch)
C2/486D: AD 1F 20     LDA $201F   (get encounter type?  0 = front, 1 = back, 2 = pincer, 3 = side)
C2/4870: D0 1A        BNE $488C   (if not a front attack, branch)
C2/4872: AD 76 3A     LDA $3A76   (Number of characters in party)
C2/4875: C9 02        CMP #$02
C2/4877: 90 13        BCC $488C   (Branch if less than 2 characters in party)
C2/4879: BD E4 3E     LDA $3EE4,X
C2/487C: 89 C2        BIT #$C2    (Check for Dead, Zombie, or Petrify)
C2/487E: D0 0C        BNE $488C   (Branch if any set on Shadow)
C2/4880: A9 08        LDA #$08
C2/4882: 2C BD 3E     BIT $3EBD
C2/4885: D0 05        BNE $488C
C2/4887: 2C DE 1E     BIT $1EDE   (Which characters are in party)
C2/488A: D0 1A        BNE $48A6   (Branch if Shadow in party)

And here:

Code:
(Shadow randomly leaves after battle)

C2/48A6: 1C DE 1E     TRB $1EDE    (Remove Shadow from party)
C2/48A9: 20 E3 47     JSR $47E3
C2/48AC: C2 10        REP #$10
C2/48AE: BC 10 30     LDY $3010,X  (get offset to character info block)
C2/48B1: A9 FF        LDA #$FF
C2/48B3: 99 1E 16     STA $161E,Y  (clear his equipped Esper)
C2/48B6: E2 10        SEP #$10
C2/48B8: A9 FE        LDA #$FE
C2/48BA: 20 92 07     JSR $0792
C2/48BD: A9 02        LDA #$02
C2/48BF: 0C 49 2F     TSB $2F49
C2/48C2: A2 0B        LDX #$0B
C2/48C4: 68           PLA
C2/48C5: 68           PLA
C2/48C6: A9 23        LDA #$23
C2/48C8: 20 91 4E     JSR $4E91
C2/48CB: 4C 19 00     JMP $0019



RE: Patch for keeping Shadow around? - CrumpledMedal - 06-09-2011

Shadow will leave at random times, if you spend too much time in the overworld before the train or falls he will leave the party. MY question is, do you have to go straight through the levels to keep him in the party?


RE: Patch for keeping Shadow around? - DjinnAndTonic - 06-10-2011

Pretty certain that it's just a 1/16 chance that he leaves after every battle?


RE: Patch for keeping Shadow around? - Gi Nattak - 06-10-2011

Unless you are in the Imperial Camp, or the Phantom Train, yes.