Oct 16, 2023

I found how to allow Sypha to freeze ALL bosses for up to FOUR seconds!

When I mapped the RAM addresses for CV3, I forgot a couple of the identifiers I used were simply meant to be notes, because I didn't know what exactly the bytes were used for. Two of those bytes were $00C1 and $00C2 (CV3u: $00C4 and $00C5). I noticed the bosses kept reading one of those two bytes. My notary identifier simply said "Ally Disabled", because you could not change allies while either of those bytes were set. 

I played through the game countless times, fighting every enemy and every boss, waiting for my breakpoint on $00C1 and $00C2 to trigger. It finally occurred to me to search the ROM for any writes to $00C1,X. I knew where the read point was, so manually set $00C1 to trigger the read, then searched for #99C100, which would be the write operation. I looked at the code surrounding the first hit. That was when I spotted something I hadn't seen in while -- a check on the boss's "Hit Effect" variable for a value of #02. Somehow, the significance of that value was still fresh in the recesses of my mind. 

That was the damage modifier for Sypha's Ice spell!

It totally slipped my mind that ally swapping is also disabled when Sypha freezes anything. I had studied Sypha's code, as well as the ally swap code, never giving much thought as to why $00C1 and $00C2 were checked separately from the enemies' status (if an enemy's status is set to "frozen", you can't swap allies). It hadn't occurred to me that since bosses were programmed distinctly from regular enemies, any special considerations for the PC might also need some considerations. 

While inspecting the two bytes, I learned that the same timer that was used to stun the boss was also used to handle freezing. How did the game know what value to set the timer to? I followed the code and found the database of frozen times. Most bosses had freeze times, most projectiles didn't. One notable boss without a freeze time is The Creature. I wanted to verify this, so I warped to it and started spamming Ice. Sypha could freeze the rocks, but not The Creature. I changed the freeze time in the ROM to #FF, the max duration. And that's all she wrote.


You can find the boss freeze duration database in the ROM at $24330 (CV3j) or $24328 (CV3u). The data set is 47 bytes long (48 if you count the #00 immediately before it).

No comments:

Post a Comment

©TheouAegis Productions™. Powered by Blogger.