Repository navigation
Improvements - #2
Closed
reversallava63 wants to merge 5 commits into
Closed
reversallava63 wants to merge 5 commits into
reversallava63 wants to merge 5 commits into
Conversation
Stopped clearing everything before redrawing to fix flicker
Flicker: - Add scratch[200*56] buffer so interactive widgets are composed off-screen and pushed in one eadk_display_push_rect call instead of dozens of small round-trips. - Wrap every scratch push in eadk_display_wait_for_vblank() so the transfer lands during retrace and can never be caught mid-scan. - Partial redraws: list(), overlay(), time_select() and game_over() only redraw the button that lost the highlight and the one that gained it. - bot_select() split into bot_row()/bot_info()/side_buttons() so changing bot touches two rows + info block, changing side touches three small rects. - bot_info() pre-clear shrunk from 160x160 to just the text region so the avatar repaints without flashing the panel. - rrect_on() blends AA corners against a known background colour instead of reading the screen, removing the BG pre-clear in button()/tc_card()/overlay_item()/game_over(). Splash: - New splash() at startup: full-screen PNG blit from splash_data.h, then stepped fade into the menu. - Fade composed into framebuf[320*16] and pushed one 16-row band per vblank so the transition is smooth and never tears. Theme: - BG is pure black (0x0000).
Image converted to RGB565
Improved loading animation
Decreased resolution to make it fit in 64 KB
Owner
|
Thank you for this! NumChess has moved to NumPlay, which is where its development continues: https://github.com/Mason363/NumPlay . The flicker fix is being done there, so I'm closing this pull request here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the visible flicker on menu navigation and several other
screens, adds a startup splash screen, and moves the UI to a pure-black
dark theme. It also makes two small build/tooling improvements.
Why?
Interactive widgets (menu buttons, bot list rows, time-select cards,
pause overlay items, game-over buttons) were being drawn by pushing
dozens of small
eadk_display_push_rect/eadk_display_pull_rectcalls per frame. Because those calls happen at arbitrary phases of the
panel scan, the beam could catch a button mid-update, producing the
characteristic flicker / tearing on arrow-key navigation.
Fix
The core change is to compose each widget into a scratch buffer and
push it to the panel in a single call, gated on
eadk_display_wait_for_vblank():scratch[200*56]holds the largest widget.s_push()waits for vblank, then issues onepush_rect.never sees a partial update.
On top of that:
list(),overlay(),time_select()andgame_over()now onlyredraw the button that lost the highlight and the one that gained it,
instead of clearing and redrawing every item on each keypress.
bot_select()was split intobot_row()/bot_info()/side_buttons(), so changing bot touches two rows plus the infoblock, and changing side touches three small rects.
bot_info()pre-clears only the text region instead of the whole160×160 right column, so the avatar repaints without a flash.
rrect_on()blends anti-aliased rounded corners against a knownbackground colour rather than reading the screen, which lets the
widget pre-clears be removed entirely.
Splash screen
splash()at startup fades in a 120×120 image on a black backdrop,holds, then fades out into the menu. Fade frames are composed into a
framebuf[320*16]band and pushed one band per vblank, so thetransition is smooth and never tears.
Dark theme
BGis now pure black (0x0000).CARDwas retuned from a warm grey (0x3A,0x38,0x35) to a coolnear-black (
0x22,0x22,0x25) so buttons read as elevated surfacesagainst black rather than beige tiles.
CARDto match thebutton style, with their own buttons blending corners against
CARD.Testing
No flicker.
clocks, captures, pause overlay, resign, game-over dialog.
size line.
The splash adds ~28 KB of
.rodata(120×120×2). If that's a concernfor the N0110 build, I can downsample to 96×96 or drop the splash
behind a compile-time flag.