WIP: feat(gameplay): Mirror mode: the world mirrored left for right, the HUD and the menus as they are #1671
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1671
Loading…
Reference in a new issue
No description provided.
Delete branch "TrashPanda/Longshot:feat/mirror-mode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: feat · Risk: medium · Tested on: Linux (Ubuntu 26.04), RTX 4070 Ti · Needs: Windows; AMD and Intel; with DLSS, FSR and frame generation
TL;DR
Longshot has no mirrored mode for a second playthrough. This PR adds Mirror mode, a Gameplay row that's off by
default. The world plays mirrored left for right, while the hearts, text, menus and movies stay readable. The sticks and
mouse still turn the way you push them on screen. In the game, a 100% save showed the world mirrored and the HUD and
pause menu not, and the stick's left still went left on screen. A new game-free test covers every upscale path and the
input rule.
Breakdown
tests/test_mirror_mode.py;tests/run_all.py.Why
A mirrored world is how the 3DS version's Master Quest felt new again, and players ask for it in remakes. The remake has
no mirror of its own: its data has no mirror flag, and Master Quest isn't mirrored. Longshot can add it without
touching the game's logic.
What changed
The world is mirrored in the finished picture, not in the game's camera. The picture is turned over just after the scene
is upscaled into it and before the game draws its HUD over it.
The camera wasn't an option: sead's perspective projection keeps the aspect ratio at +0xb0, and culling reads it there.
Mirroring the camera would also have reversed the triangles' winding for the scene's passes only.
Renderer:
gpu/vk/vk_mirror.cppmirror_picturedoes the flip: a blit into a scratch image with x reversed, thena copy back.
vk_work.h). Called directly, the driver crashed in the recorder thread.came first lost the GPU (Xid 32 / 69) when the parts ran in another order.
One point for every path:
gpu/vk/vk_draw.cpppicture_writtenis where every upscale path ends:upscale_picturetakes the full-size pass in Mirrormode);
It mirrors first, then calls
framegen_hud_before, so frame generation's HUD copy is of the picture as shown.Input:
host/nn_hid.chos_mirror_inputswaps the sticks' x innpad_states, where every pad, the keyboard andthe mouse-as-stick arrive.
select keep their own left and right.
host/mouse_native.cinvert_xswaps the mouse camera's horizontal inversion by the same rule.Option:
HOS_OPT_MIRROR75 ingpu/vk/vk_api.h, served by the existing option callback (no API version change).The Gameplay row and the README's line come with it.
Docs:
docs/mirror-mode.mdis new.Tests:
tests/test_mirror_mode.pyis new.tests/test_input_background.pyandtests/test_mouse_native.py: their fixtures compilenpad_statesandinvert_x, and now carry the new helpers. Mirror mode is off in them, as before.Measurements
Verdict: nothing measured yet. With the row Off, nothing runs. With it On, there's one 2560x1440 blit and one copy a
frame, measured next (CONTRIBUTING.md, "Measurements") before this leaves WIP.
Flags and settings
One new Insert menu row.
mirror_mode(Gameplay → Mirror mode)Testing
Tested:
mainat9dff58e6withthis branch as a pack (
dev_build.py), on a copy of a 100% save in Link's house, the game's own upscale at thedefault Render resolution. The runs were driven through the control bridge.
cow, Link's sword and shield were on the other side. The hearts, item buttons, minimap's place and "Talk" prompt were
where they were, and readable.
On. That's the screen's left both times.
tests/test_mirror_mode.pycompiles the input helpers and reads the renderer's hooks, and catches each of thesebroken copies: the flip with the menu open, the mirror after frame generation's copy, no x reversal.
python -I -B tests/run_all.py --changed: no failure thatmaindoesn't have (test_host_guest_writes.pyfailson
maintoo).Not tested:
Must be tested:
@Beanstalk windows): a save in play, Gameplay → Mirror mode On. Expect the worldmirrored and the HUD not, and no device lost in
longshot_log.txt.@Beanstalk linux, amd, radv): the same, and with the Upscaler set to FSR 4where available.
generation 2x. Expect the made frames mirrored as the shown ones, and the HUD not smeared.
Risks
What could break: a GPU fault in the new copy on a driver I haven't run. Two such faults on NVIDIA during
development are fixed and named in What changed. Anything the HUD places from a world position would point at the
unmirrored side.
Turning it off: the row (Off by default).
Compatibility:
mirror_mode, inlongshot_options.ini.Screenshots
A copied 100% save in Link's house, the same spot, this PR @
134e104e:Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks. Same: the On cost.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
Tested in game: RTX 4070 Ti, NVIDIA 595.99.02, Ubuntu 26.04, main @
9dff58e6+ this branch as a pack, the game's own upscale at the default Render resolution: a copied 100% save in Link's house, Mirror mode turned on in play: the world mirrored (the house, the cow, Link's sword and shield on the other side), the hearts, item buttons, minimap's place and the Talk prompt where they were and readable; the same stick push left went +z off and -z on with the camera the same (the screen's left both times); the pause menu not mirrored; no device lost after the two fixes named in What changed. Not seen yet: DLSS / FSR / frame generation, other GPUs, Windows.mooki referenced this pull request2026-11-19 02:05:59 +00:00
134e104ea2ef7848ce4eView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.