widescreen: stretch backdrop X-stores about screen centre in native-wide mode - #78
Merged
Merged
Conversation
The FMV draw-area early-outs in gp0_exec_* reject prims against the guest's authored 4:3 draw area before the renderer's wide mirror can draw them. In native-wide mode every margin prim submitted through the widened game culls ([widescreen.cull] hooks) is killed at the door, so world and actor geometry pops in at the revealed edges. Reported on Xenogears; affects any title using cull widening. The mirror maps local_x = x - draw_area_left + offset and clips at [0, disp_w + 2*offset), so the host-side check is only lossless when it tests exactly that window. draw_area_cull_window() now computes [left - off, max(right, left + disp_w) + off]: with native-wide inactive the offset is 0 and the check is byte-identical to the original optimization (4:3 / squash / FMV keep the host-side skip); with native-wide active, margin prims pass while genuinely off-screen prims are still culled host-side.
# Conflicts: # runtime/src/gpu.c
…ide mode psx_ws_backdrop_x() was identity in native-wide (its ws_active() gate only covers the 4:3-squash path), so [widescreen.backdrop] x_sites did nothing there. Add a native-wide branch that stretches the stored screenX about the display centre by (disp_w + nw_extra)/disp_w, letting 4:3-authored 2D backdrops cover the widened frame. Verified on Xenogears battle mountain panels (POLY_FT4 quads with pre-calculated screen coords; main-EXE sh store sites 0x80027BE8/BEC/BF0/BF8, wtrace-evidenced). Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Merged
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.
Problem
psx_ws_backdrop_x(), the transform applied at[widescreen.backdrop] x_sitesstore PCs, is gated on
ws_active(), which only covers the 4:3-squash path.In native-wide mode the function is identity, so configured
x_sitessilently do nothing and 4:3-authored 2D backdrops leave unpainted margins in
the widened frame.
Concrete case: Xenogears battle backdrops. The panels are POLY_FT4
quads with pre-calculated screen coordinates (they never touch the GTE),
written to the OT by main-EXE
shstores. Listing those PCs asx_siteshad noeffect in native-wide because the hook returned the value unchanged.
Change
Add a native-wide branch to
psx_ws_backdrop_x(): stretch the stored screenXabout the display centre by
(disp_w + nw_extra) / disp_w, mirroring how theexisting squash branch scales about the same centre by the inverse factor.
13 lines, one function.
a panel spanning
[0, 320)on a 320px display withnw_extra = 106nowspans
[-53, 373), covering the full 16:9 reveal.Testing
full wide frame, no sky-coloured margins; no distortion of the 3D terrain
layer (GTE-projected, untouched by this path).
store sites observed before/after.