Repository navigation
Conversation
Reads up to 4 entries ("Name,0x<64-bit title id>") from bootOptions.cfg
next to autoboot.cfg and adds the installed ones to the boot menu. The
title id decides the launch path: 0x0001... titles launch on vWii via
mocha and CMPTLaunchTitle, 0x0005... titles via
_SYSLaunchTitleWithStdArgsInNoSplash after account selection.
A custom autoboot choice is saved by title id, so renaming an entry keeps
it. If the saved title is no longer installed, the menu opens without
overwriting the choice.
Builds on wiiu-env#25 by Romulo Leitão (razor85), which
introduced bootOptions.cfg and the custom entries, and follows the
review there: full title ids, no vWii/Wii U string field, and
fgets/strtoull instead of streams. The installed-title check
now looks for title.tmd, which every installed title has.
Co-authored-by: Romulo Leitão <abra185@gmail.com>
fprintf pulled in about 4.8 KB of formatting code that snprintf, already linked, covers. The branch now builds 4.4 KB larger than main. Formatted with clang-format 13.0.1, which leaves main unchanged.
The menu gets -1 for such an entry, so pressing X left the choice unchanged and nothing was written: the old title came back as the autoboot title once it was reinstalled. X and Y now always save. Also skip mbstowcs's result when it reports a byte it can't convert ((size_t) -1), now that entry names come from a file.
The menu doesn't scroll: with all four built-in entries and four custom ones, the eighth row covered the update status line. Custom entries that don't fit are left out with a log message. System applets (title ids 00050030..., like the Internet Browser) need their own launch calls, so bootOptions.cfg skips them.
A saved Homebrew Launcher or vWii Homebrew Channel that is missing was passed to the menu unchanged, which then read its id as a row number: with a custom entry in that row, A started the custom title and saved it as the autoboot entry. Every saved entry the menu doesn't show now opens the menu with nothing preselected and stays saved, as a custom entry whose title is gone already did.
An "@" line in bootOptions.cfg names a built-in entry by its autoboot.cfg name (@wiiu_menu, @homebrew_launcher, @vwii_system_menu, @vwii_homebrew_channel). When the file has any, entries appear in the order of its lines; built-in entries it doesn't list follow in the usual order, so none can disappear, and unavailable ones stay hidden. Without "@" lines the menu looks as before. Names match in any case, an unknown one is skipped with a log message, and a byte order mark that some editors write at the start of the file is ignored. The menu is now an ordered list instead of a map keyed by option id, which also fixes the autoboot highlight and the starting cursor: they were found by matching ids to positions, which skipped the Wii U Menu (id 0) as the autoboot option. With no autoboot option the cursor starts on the Wii U Menu, as before.
With "@" lines in bootOptions.cfg and no autoboot entry, the menu's cursor starts on the first entry instead of the Wii U Menu, so the entry put first is also the one A starts. Without "@" lines nothing changes.
A custom entry's name may start with @ ("@games,0x..."), which the
parser took for a built-in entry and skipped. Only lines without a
comma name built-in entries now.
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.
Stacked on #71 (custom entries) and includes its commits; only the last three commits are new here. I'll rebase it once that one is merged or changed.
The boot menu shows its entries in a fixed order, with custom entries (#71) at the end. This lets
bootOptions.cfgset the order. Without the new lines, the menu looks exactly as before.Usage
Besides custom entries,
bootOptions.cfgcan name the built-in entries with an@line. Entries appear in the order of the lines:@wiiu_menu@homebrew_launcher@vwii_system_menu@vwii_homebrew_channelautoboot.cfgalready uses.@name is skipped with a log message.@.Also fixed
The autoboot highlight and the starting cursor were found by matching option ids to positions in an ordered map, which only worked while the ids sorted in display order. The menu is now an ordered list, with ids looked up by position. With no autoboot title set, the cursor starts on the first entry when
@lines set the order (so the entry put first is also the one A starts), and on the Wii U Menu otherwise, as before.Tested
Wii U (US), Aroma, used daily since 24 Oct; the final version checked again on 16 Nov:
@lines reorder built-ins and custom entries@lines and no autoboot entry, the cursor starts on the first entry; with an autoboot entry it starts there@lines: same order as before, custom entries lastA follow-up that adds a
countdown=Nboot countdown (the menu shows on every boot and starts the autoboot entry after N seconds unless a button is pressed) is ready on my fork, branchpr-countdown, if that's wanted.