Skip to content

fix: consistent fade-in and fade-out on start end exit of nextui and apps - #856

Open
nborodikhin wants to merge 2 commits into
LoveRetro:mainfrom
nborodikhin:fix/app-transitions
Open

nborodikhin wants to merge 2 commits into
LoveRetro:mainfrom
nborodikhin:fix/app-transitions

Conversation

@nborodikhin

@nborodikhin nborodikhin commented Oct 5, 2026 •

Copy link
Copy Markdown

Description

SDL apps always show a black frame on start, that's unavoidable - SDL_CreateWindow always fills screen buffer with black pixels. On light themes, this leads to a jarring experience with multiple flashes of black.

Observations:

  • black screen on start unavoidable, we should embrace the fact, and use opening/closing animations to avoid flashes
  • opening NextUI has a fade-in animation (it causes background flickering on light background due to bad orchestration though)
  • starting a game in NextUI has an opening animation (defunct, but the code is still there)
  • opening emulator has 8 frames of opening fade-in animation
  • exiting emulator has a fade-out animation

This PR extends the ideas and observations and adds (and re-adds) a fade-in animation on start and fade-out animation on exit, both for NextUI and built-in apps. It complements #854 which improves light theme support on built-in apps.

Change

  • CFG_getAppStartExitAnimationDuration():
    • consistent and stable way to get the fade in/out duration
    • use standard durations 20/150/250
  • GFX_init():
    • keeps the screen black, sets the background color without a present, so a subsequent fade-in animation could start from black
      -GFX_animateBlack()
    • runs and animation mixing captured screenshot and black frame
    • a fade-out also leaves the screen texture black, thus the exit clear in GFX_quit() stays black
  • nextui.c:
    • fade the first frame in from black after the pill and the art are drawn
      • this solves an issue with only parts of the screen being drawn today
    • do not draw more ui frames once it decided to start a game or pak
      • this solves an issue with only parts of the ui being visible during animation
    • fade out to black before exit (note that exit always starts a app)
  • battery.c, clock.c, gametime.c, ledcontrol.c, minput.c, settings.cpp:
    • fade in on the first frame, fade out on exit

Testing

  • tested on tg5040
  • Default and Catppuccin Latte themes
  • open Settings from the game list and quick menu: the quick menu fades out, not the game list
  • cold boot: the launcher fades in from black

On a light palette, switching between an app and the launcher flickered:
the app cleared the screen to black, the launcher showed its background,
then the launcher faded in from black again.

GFX_animateBlack() fades the composed frame in from black or out to black.
The launcher and the bundled tool apps call it on start and on exit, and
GFX_init() keeps the screen black until the app presents its first frame.
@nborodikhin
nborodikhin marked this pull request as ready for review October 5, 2026 02:33
@nborodikhin nborodikhin changed the title fix: fade apps and the launcher in and out through black fix: consistent fade-in and fade-out on start end exit of nextui and apps Oct 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant