Users browsing this thread: 1 Guest(s)
Status Icon Overflow Patch

#1
Posts: 154
Threads: 21
Thanks Received: 173
Thanks Given: 84
Joined: Feb 2016
Reputation: 8
Status
Enlight
Status Icon Overflow
Author: SilentEnigma
Version: 1.1
Released: 2022-04-23
Applies to: FF3us 1.0, FF3us 1.1, FF6j
Download


Description

Did you know that navigating the Skills menu in FF6 is like walking a tightrope while running with scissors?
That one wrong move can send you plummeting into the depths of resetting your SNES? *

...Yeah, long story short, I ran into a game-freezing bug while doing some testing recently.
To my knowledge, it has never been reported before:
  • Inflict a character with any permanent status such that a status icon is displayed
  • Open their Skills screen
  • Navigate back and forth between the Skills menu and a skill submenu (Espers, Magic, etc.)
  • After about 16 repetitions, the portrait graphics will become corrupt, and after about 38 repetitions, the menu locks up entirely.
  • It takes fewer repetitions to glitch out if the character has more than one status effect.
[Image: status-icon-overflow.png]
Don't push your luck, kiddo

The problem is caused by the game creating new instances of the active status effect icons every time you navigate back to the top-level Skills menu from an ability submenu. Eventually the game runs out of internal slots for the icon graphics, and it winds up stuck inside the infinite loop instruction at C3/11AD:

Code:
C3/11A0: E8          INX
C3/11A1: E8          INX
C3/11A2: E0 80 00    CPX #$0080
C3/11A5: D0 EF       BNE $1196   ; last chance to escape
C3/11A7: CA          DEX
C3/11A8: CA          DEX
C3/11A9: 98          TYA
C3/11AA: 9D 49 32    STA $3249,X
C3/11AD: 80 FE       BRA $11AD   ; game over

Imzogelmo's C3 disassembly has the comment for C3/11AD: "Changing this to 80 ED unfreezes Novalia Spirit's Shop bug". The same change would prevent the lockup here while leaving the graphical glitch.

I'm thinking the code snippet containing C3/11AD was originally meant as protection against overflow scenarios like this one. However, the infinite loop was inserted during development (possibly for testing) and never removed.

Anyway, this patch fixes the bug for real by selectively skipping over the icon display code in the Skills menu. It uses no free space. Frog 
Thanks to @Gi Nattak for keeping a lid on this long enough for me to get a patch out.




* assuming you've already done the other 38 steps necessary to trigger the freeze


Attached Files
.zip  StatusIconOverflow_v1.1.zip (4.43 KB, 6 downloads)
Quote  
[-] The following 4 users say Thank You to SilentEnigma for this post:
  • C-Dude (04-23-2022), CVReynolds (04-22-2022), Gi Nattak (04-21-2022), madsiur (04-22-2022)

#2
Posts: 154
Threads: 21
Thanks Received: 173
Thanks Given: 84
Joined: Feb 2016
Reputation: 8
Status
Enlight
Patch updated to v1.1 to correct a text color issue with HP/MP/level values on the Skills page.
Still uses no free space! And the footprint only grew by a couple of bytes.

Thanks @Gi Nattak for reporting the issue in v1.0. I think we're in good shape now.
Quote  
[-] The following 1 user says Thank You to SilentEnigma for this post:
  • CVReynolds (04-23-2022)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite