seibaby / ff3us

Final Fantasy VI SNES assembly source project
11 stars 2 forks source link

Palidor's Long Wait #262

Open bropedio opened 5 years ago

bropedio commented 5 years ago

At the end of processing a character's turn, there is a check for whether that character just finished summoning Palidor, followed by a branch that ensures the character is not marked to have their next action processed immediately. Unfortunately, the branch lands a bit too early, including the following code meant only for non-Palidor-summoners who have completed their linked list queue:

https://github.com/seibaby/ff3us/blob/48ce1f627539ca5fc137d799639ba995dd55e63e/ff6_bank_c2_battle.asm#L273-L281

This code does the following:

  1. Increments ATB by 1 if $3AA0:$10 is unset.
  2. Nulls the wait time for their next action
  3. Resets their wait timer gauge to zero

All of these steps are made redundant for Palidor summoners by the subroutine at C20B4A, which sets $3AA0:$10, zeroes the characters' wait timers, and sets the Palidor/Jump wait time to $E0.

The bug is that the Palidor wait time $E0 is overwritten by the redundant code above. The branch at C201AF should leap to C201CE