Document and (under AVOID_UB) fix the attract timer hijacking an in-flight menu fade (#769)

Vanilla bug: pressing START on the splash screen in the last moments
before the demo timeout plays the enter chime but then drops into the
demo reel with no music. The attract timer fires while the press-start
fade is still in flight and overwrites the fade target, so the fade
completes as a demo entry instead of the main menu.

Adds a @bug comment documenting it, and guards the demo arm with
is_screen_being_faded() under AVOID_UB only, so the matching build is
byte-identical (the non-AVOID_UB path is unchanged).
This commit is contained in:
quarrel07
2026-07-26 21:17:07 -07:00
committed by GitHub
parent 44c71a7978
commit 2ccda00a89
+11
View File
@@ -2618,7 +2618,18 @@ void func_80095574(void) {
if (gMenuTimingCounter == 2) {
play_sound2(SOUND_INTRO_WELCOME);
}
/**
* @bug Pressing START in the last moments before the demo timeout plays the
* menu-enter chime but then drops into the demo with no music. The attract
* timer fires while the press-start fade is still in flight and overwrites
* the fade target, so the fade completes as a demo entry instead of the
* main menu. Roughly a 0.7 second window every attract cycle.
*/
#ifdef AVOID_UB
if ((gMenuTimingCounter > 300) && (is_screen_being_faded() == 0)) {
#else
if (gMenuTimingCounter > 300) {
#endif
func_8009E230();
func_800CA0A0();
}