Repository navigation
Wood: optional battery icon on the top screen - #2703
Merged
Merged
Conversation
1 task
A theme opts in with a [battery] section and battery.bmp: 8 frames, 1-4 bars, then 1-4 bars while charging. The frame follows sys().batteryStatus() and is redrawn only when it changes. A new frame is shown once it has held for 1 second (60 frames), so a single odd reading (seen near a full charge) doesn't make the icon blink. Skipped in macro mode; themes without the section are unchanged.
therenow9
force-pushed
the
feat/wood-battery-icon
branch
from
October 27, 2026 23:42
5e31590 to
a67609b
Compare
Contributor
Author
|
@RocketRobz the merge issues are now resolved |
1 task
1 task
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.
What's changed?
Wood themes can show the battery level on the top screen, like the DSi and 3DS themes already do. A theme opts in with a new
uisettings.inisection and one image:battery.bmp(in the theme folder, next tobrightness.bmp) holds 8 frames of equal height, stacked vertically: frames 0-3 are 1-4 bars, frames 4-7 the same while charging. Pure black (0,0,0) is transparent. A bottom-up BMP at 1, 8, 16, 24 or 32 bits works. Any other format is skipped, so nothing unfilled is drawn.The section is
[battery], not[battery icon]. The old akmenu used[battery icon]for a bottom-screen icon built from other files, so old themes that still carry it stay unaffected.drawBattery()readssys().batteryStatus()(the same levels the DSi theme maps: 0xF/0xB/0x7/lower → 4/3/2/1 bars, bit 7 = charging) and redraws only when the frame changes. It is called frombgOperations()next to the calendar parts.showCalendarand skipped in macro mode, like box art. Themes without the section are unchanged.graphics.cpp,graphics.handmain.cpp(+82/−4).[box art]panel, because the panel repaints its whole rectangle.Where have you tested it?
New Nintendo 3DS XL with a DSpico, TWiLight on the console SD (v27.25.1 + #2698 + this change):
[battery]shows the bars at the level, and the charging frames while on the charger;On battery, and on the charger:
Pull Request status
Built in the
devkitpro/devkitarm:20241104Docker image that the nightly workflow uses (no new warnings).The code was written with help from an AI assistant (Claude Code). I reviewed it and tested it on my console.