Skip to content

Launch vWii titles with no GamePad connected - #70

Open
grantendo wants to merge 7 commits into
wiiu-env:mainfrom
grantendo:pr-gamepad-off
Open

grantendo wants to merge 7 commits into
wiiu-env:mainfrom
grantendo:pr-gamepad-off

Conversation

@grantendo

@grantendo grantendo commented Nov 17, 2026 •

Copy link
Copy Markdown

Fixes #67. Builds on #69: @patapovich's three commits are included as they are, under his name, with the GamePad check and a fix for the GamePad pipe on top (as offered in #69).

Picking the vWii System Menu, the vWii Homebrew Channel or any vWii title from the boot menu (or as the autoboot title) gives a black screen when no GamePad is connected (its battery flat, out of range, or not there at all, as when the console travels without it). With a GamePad connected, the same launch works.

Cause

CMPTLaunchTitle/CMPTLaunchMenu return -512 because nn_cmpt's switch of the TV to Wii mode fails. The chain that fails:

CMPTLaunchTitle → nn_cmpt AV setup → AVMSetDCWiiCompat → AVMSetRenderAttr / AVMSetTVBufferAttr → avm's internal "apply render state" → DCGetBufferRequirement(1, …) = -2

While flag 0x100 of avm's per-process state is set, every render or buffer attribute change on the TV also reprograms dc pipe 1 (the GamePad) from avm's GamePad sub-state. With no GamePad connected, that sub-state's mode is 0, which is what GX2SetDRCBuffer with GX2_DRC_RENDER_MODE_DISABLE stores through AVMSetDRCBufferAttr, and DCGetBufferRequirement rejects mode 0 on pipe 1 with -2. AVMSetDCWiiCompat then returns FALSE, and nn_cmpt gives up with -512 before MCP_LaunchCompat. With the GamePad on, the mode is 6 (854×480), so the same path succeeds.

How I found it: a debug build logged nn_cmpt's launch step by step (each AV call made by hand with its result), plus the avm and dc state, comparing runs with a GamePad connected and with none, on the same console. The two runs differed only in the GamePad pipe and the sub-state's mode.

Change

Only when no GamePad is connected; with one connected, the launch is exactly as before (BOTH, then DRC, then TV), so the vWii keeps mirroring to the GamePad.

  • Is a GamePad connected? The GamePad is pinged over its radio link, CCRCDCDevicePing(CCR_CDC_DESTINATION_DRC0), up to 10 times 50 ms apart (a GamePad that wakes with the console may still be connecting at autoboot). Not VPADRead: a plugin that replaces it (the DRC Read Result Spoofer) makes it report a GamePad that isn't there.
  • Without one: CMPTAcctSetScreenType(CMPT_SCREEN_TYPE_TV) and CMPTAcctSetDrcCtrlEnabled(0) before launching, and the wait for CMPTCheckScreenState (from Fix vWii autoboot hanging when no GamePad is connected #69, by patapovich). The Wii U Menu makes the same calls for a TV-only launch. The wait is kept as Fix vWii autoboot hanging when no GamePad is connected #69 has it: it checks the screen setup rather than the compat subsystem itself, but it costs nothing when the check passes at once, and it caps at 5 s.
  • Also without one, give the GamePad pipe a normal mode with the exported AVMSetDRCBufferAttr(2, 1, 896): the call GX2SetDRCBuffer makes for GX2_DRC_RENDER_MODE_SINGLE (854×480) with double buffering. The Wii-mode switch can then reprogram pipe 1 without a GamePad, and AVMSetDCWiiCompat succeeds. No memory is patched.

(An earlier version cleared avm's internal flag 0x100 instead, found by decoding AVMSetDCWiiCompat. It works too, but needs a state address read out of avm's code, so the exported call is the cleaner fix.)

The state is per-process (Health & Safety, where the boot menu runs) and the process ends with the launch, so the changed GamePad setting doesn't carry over to the Wii U side.

Tested

Wii U (US), Aroma, from the boot menu and as the autoboot title (31 Oct, checked again 16 Nov):

  • No GamePad connected (battery flat, or out of range): the vWii System Menu, the vWii Homebrew Channel and a vWii channel boot on the TV
  • A GamePad connected: the launch is as before; the GamePad switches off at the launch as with stock, and HOME on it brings it back mirroring the vWii
  • The DRC Read Result Spoofer loaded and no GamePad in range: boots on the TV (with a VPADRead check it went black)
  • The ping answers in 2 to 4 ms with a GamePad; without one, the 10 tries take about half a second

Not changed here: when a vWii title starts from the boot menu, the GamePad switches itself off (stock does the same); pressing HOME on the GamePad brings it back, mirroring.

patapovich and others added 7 commits October 20, 2026 10:20
Works around vWii autoboot hanging on a black screen when the GamePad
is powered off (wiiu-env#67). The BOTH/DRC screen-state
probing succeeds even with no GamePad connected, after which the vWii
transition waits on the DRC forever.

Claude-Session: https://claude.ai/code/session_01PE4DJqPCXQzkGorJSUDrGv
(cherry picked from commit f8eacbf of patapovich/AutobootModule; the same
change is in his pull request wiiu-env#69)
CMPTAcctSetScreenType alone does not prevent the hang: the Wii U Menu
additionally calls CMPTAcctSetDrcCtrlEnabled (nn_cmpt.rpl export,
undeclared in wut) before launching vWii titles. Without it the vWii
transition waits on a GamePad connection (wiiu-env#67).

Claude-Session: https://claude.ai/code/session_01PE4DJqPCXQzkGorJSUDrGv
(cherry picked from commit 474b98e of patapovich/AutobootModule; the same
change is in his pull request wiiu-env#69)
On autoboot the launch runs much earlier than a manual selection from
the boot menu, and launching before the compat subsystem is ready gives
a black screen. Wait for CMPTCheckScreenState, launching anyway after 5s.

From patapovich's wiiu-env#69 (commit 653bf27), which adds
this wait to the two earlier commits above: its author found the screen
type and DRC changes alone did not fix the black screen with the GamePad
off.
With the GamePad off, CMPTLaunchTitle and CMPTLaunchMenu return -512:
avm's AVMSetDCWiiCompat, which switches the TV to Wii mode, also
reprograms the GamePad's display pipe from avm's GamePad settings, and
with no GamePad those say "off" (what GX2SetDRCBuffer with
GX2_DRC_RENDER_MODE_DISABLE stores), which dc rejects. Set the GamePad
display to 854x480 first, the call GX2SetDRCBuffer makes for
GX2_DRC_RENDER_MODE_SINGLE: AVMSetDRCBufferAttr(2, 1, 896), found with
OSDynLoad.
The fixes for issue wiiu-env#67 forced TV-only output and turned GamePad control
off for every vWii launch, which would cost GamePad users the vWii on
their GamePad. Ask VPADRead whether a GamePad is connected (for up to
half a second, as one switched on with the console may still be
connecting at autoboot): if one is, launch exactly as before, trying
both screens, then the GamePad, then the TV; if none is, take the
TV-only path with the compat wait and the GamePad pipe mode.
VPADRead can report a GamePad that isn't there: the DRC Read Result Spoofer
plugin makes every read succeed, so a vWii launch with no GamePad took the
GamePad path and went black. CCRCDCDevicePing answers 0 only when a GamePad
replies (2 to 4 ms either way on a Wii U, with and without the spoofer).
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.

vWii autoboot hangs if GamePad is disconnected

2 participants