Fixed resolution: let the dynamic path run first (black 3D at startup) #102

Closed
vzeol wants to merge 1 commit from fix/fixed-resolution-black-3d into main
vzeol commented 2026-11-07 10:46:29 +00:00 (Migrated from github.com)

Problem

With Resolution 100% saved in hookshot_options.ini (and, here, Upscaling = Lanczos), loading a save shows the HUD and the minimap, but the 3D is completely black. The log shows the frame is drawn (~4700 draws, ~28 fps): it just comes out black. Switching to 100% from the Insert menu during play works fine. The bug only happens when the option is active from the first frame.

I checked that it is the resolution and not the upscaler: Resolution 100% + Upscaling off at startup gives the same black 3D.

Cause

oot_patches.py sends the engine to the fixed path (L_8082640c) as soon as hos_fixed_resolution is set. That path skips the whole dynamic block, and the dynamic block also writes fields the rest of the frame reads (the controller's +8, +16 and +168, written between the branch and L_80825c14). When the menu turns the option on mid-game, those fields have already been written by earlier frames. When the option is on from boot, they never are.

Fix

  • The lifted branch counts the dynamic path's runs (hos_dynres_runs++ right after the patched if).
  • realtime_step only sets hos_fixed_resolution after 30 of them, a fraction of a second, the same order as turning it on from the menu.

Two files: host/nn_vi.c and nx2/oot_patches.py. No change to the dynamic path itself or to the scale handling.

Tested

RX 7900 XTX, Ryzen 9 3950X, Windows 11, built with the same flags as the Builder (RX_RELEASE=1, hot chunk, PGO profile). With Resolution 100% + Lanczos at startup, the 3D now shows and the save even loads faster. Kokiri Forest runs at ~46-60 fps.

This probably isn't AMD specific: anyone who saves Resolution 100% should hit it on the next start.

🤖 Generated with Claude Code

## Problem With **Resolution 100%** saved in `hookshot_options.ini` (and, here, Upscaling = Lanczos), loading a save shows the HUD and the minimap, but the 3D is completely black. The log shows the frame is drawn (~4700 draws, ~28 fps): it just comes out black. Switching to 100% from the Insert menu during play works fine. The bug only happens when the option is active from the first frame. I checked that it is the resolution and not the upscaler: Resolution 100% + Upscaling off at startup gives the same black 3D. ## Cause `oot_patches.py` sends the engine to the fixed path (`L_8082640c`) as soon as `hos_fixed_resolution` is set. That path skips the whole dynamic block, and the dynamic block also writes fields the rest of the frame reads (the controller's +8, +16 and +168, written between the branch and `L_80825c14`). When the menu turns the option on mid-game, those fields have already been written by earlier frames. When the option is on from boot, they never are. ## Fix - The lifted branch counts the dynamic path's runs (`hos_dynres_runs++` right after the patched `if`). - `realtime_step` only sets `hos_fixed_resolution` after 30 of them, a fraction of a second, the same order as turning it on from the menu. Two files: `host/nn_vi.c` and `nx2/oot_patches.py`. No change to the dynamic path itself or to the scale handling. ## Tested RX 7900 XTX, Ryzen 9 3950X, Windows 11, built with the same flags as the Builder (`RX_RELEASE=1`, hot chunk, PGO profile). With Resolution 100% + Lanczos at startup, the 3D now shows and the save even loads faster. Kokiri Forest runs at ~46-60 fps. This probably isn't AMD specific: anyone who saves Resolution 100% should hit it on the next start. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
NotRexed commented 2026-11-07 13:25:27 +00:00 (Migrated from github.com)

Thank you! Applied in c02f290 and tested: with Resolution 100% saved before starting, the 3D now shows. It's in https://github.com/NotRexed/Hookshot/releases/tag/small-vram

Thank you! Applied in c02f290 and tested: with Resolution 100% saved before starting, the 3D now shows. It's in https://github.com/NotRexed/Hookshot/releases/tag/small-vram
Commenting is not possible because the repository is archived.
No description provided.