Skip to content

Configurable boot menu order - #72

Open
grantendo wants to merge 8 commits into
wiiu-env:mainfrom
grantendo:pr-menu-order
Open

grantendo wants to merge 8 commits into
wiiu-env:mainfrom
grantendo:pr-menu-order

Conversation

@grantendo

Copy link
Copy Markdown

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.cfg set the order. Without the new lines, the menu looks exactly as before.

Usage

Besides custom entries, bootOptions.cfg can name the built-in entries with an @ line. Entries appear in the order of the lines:

My vWii Channel,0x0001000152494654
@wiiu_menu
@vwii_homebrew_channel
@vwii_system_menu
Line Entry
@wiiu_menu Wii U Menu
@homebrew_launcher Homebrew Launcher
@vwii_system_menu vWii System Menu
@vwii_homebrew_channel vWii Homebrew Channel
  • The names are the ones autoboot.cfg already uses.
  • Built-in entries without a line follow the listed ones, in the usual order, so none can disappear by accident.
  • An entry that isn't available (Homebrew Launcher without its installer, vWii Homebrew Channel without HBC) is still left out wherever it's listed.
  • An unknown @ name is skipped with a log message.
  • A line with a comma is always a custom entry, so a custom name may start with @.
  • The 7-row limit from Custom boot entries from bootOptions.cfg #71 still holds: built-in entries always keep their row, and custom entries share what's left in the order of their lines.

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
  • Autoboot highlight on the right row after reordering
  • With @ lines and no autoboot entry, the cursor starts on the first entry; with an autoboot entry it starts there
  • No @ lines: same order as before, custom entries last
  • The Wii U Menu as the autoboot entry, after reordering: highlighted on its row, and it autoboots
  • Unlisted built-ins appended after the listed ones; an unavailable one (the Homebrew Launcher, not installed) hidden

A follow-up that adds a countdown=N boot 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, branch pr-countdown, if that's wanted.

grantendo and others added 8 commits October 20, 2026 10:09
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.
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