Repository navigation
Wood: redraw the battery after the free-space line, allow a full-width box - #2706
Merged
RocketRobz merged 1 commit intoOct 28, 2026
Merged
Conversation
…h box The free-space line repaints its whole box when R switches cards or a file is deleted. A theme that puts the battery inside that box lost the icon until the battery level next changed, because drawBattery() still had the frame marked as drawn. drawFreeSpace() now clears that mark after it repaints, so the icon comes back in the same pass. The free-space box may also reach the screen edge (x+w <= 256, y+h <= 192), the same bound [box art] uses.
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?
Two small follow-ups to the free-space line (#2704) and the battery icon (#2703).
The battery disappeared after R when it sits inside the free-space box.
bgOperations()callsdrawFreeSpace()and thendrawBattery(). When R switches between SD and the flashcard (or a file is deleted from the menu),drawFreeSpace()repaints its whole rectangle, which also covers a battery placed inside it.drawBattery()still had that frame marked as drawn (loadedBattery), so it returned early and the icon stayed gone until the battery level changed.drawFreeSpace()now setsloadedBattery = -1after it repaints, so the icon is drawn again in the same pass.loadedBatterymoves up a few lines sodrawFreeSpace()can see it. Themes that keep the battery outside the box are unaffected (the redraw is the same frame again).The free-space box can be full width. The box had to satisfy
x+w < 256andy+h < 192, so a 256-wide box was refused. It is now<= 256/<= 192, the same bound as[box art].printTopBox()only writes insidex..x+w-1andy..y+h-1, so the box still stays on screen.One file,
graphics.cpp, +3/−2.Where have you tested it?
New Nintendo 3DS XL with a DSpico, TWiLight on the console SD (master
a529f31b0modules; this build'sakmenu.srldronly), themes DSpico Dark and DSpico Light, whose battery sits in the free-space banner at the top:Left: the banner as it should look, with the battery in the top-right (master, SD). Middle and right: master after R, the battery is missing on the DSpico and on SD.
With this change:
battery-fixed-after-r.mp4
Pull Request status
Built in the
devkitpro/devkitarm:20241104Docker image that the nightly workflow uses: 96 warnings, the same set as master built the same way, so none are new.The code was written with help from an AI assistant (Claude Code). I reviewed it and tested it on my console.