diff --git a/runtime/include/gpu.h b/runtime/include/gpu.h index b4191114..059b7430 100644 --- a/runtime/include/gpu.h +++ b/runtime/include/gpu.h @@ -261,6 +261,9 @@ void psx_ws_sprite_tag(struct CPUState* cpu); * by this; 0 when native-wide is inactive). */ int ws_native_wide_active(void); int ws_nw_extra(void); +/* Configured per-side reveal, excluding the world-culling safety envelope. + * Available before scene classification so first-frame overlays can fit. */ +int gpu_ws_configured_x_reveal(void); int ws_nw_present_width(void); /* Display width (native px) the native-wide margins are derived from. */ int gpu_ws_display_width(void); diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index b83950eb..775806ef 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -106,8 +106,11 @@ uint32_t psx_mod_alloc_gpu_dma_memory(uint32_t size, uint32_t alignment); */ int psx_mod_set_main_ram_8mb(int enabled); -/* Current per-side widescreen reveal in native game pixels (zero at 4:3). */ +/* World-culling envelope in native game pixels, including safety guards. */ int32_t psx_mod_widescreen_x_margin(void); +/* Configured per-side visible reveal, excluding culling guards; zero at 4:3. + * Use for screen-space layout, including the first frame of a new scene. */ +int32_t psx_mod_widescreen_view_x_margin(void); /* Mark a guest GPU packet (P_TAG address) as persistent screen-space HUD. * edge = -1 left, +1 right, 0 clears a reused packet's tag. The native-wide diff --git a/runtime/src/gpu.c b/runtime/src/gpu.c index c2e15fe3..e384cf2a 100644 --- a/runtime/src/gpu.c +++ b/runtime/src/gpu.c @@ -548,6 +548,7 @@ static int ws_nw_offset(void) { if (!ws_native_wide_active()) return 0; return ws_nw_configured_offset(); } +int gpu_ws_configured_x_reveal(void) { return ws_nw_configured_offset(); } int ws_nw_extra(void) { return 2 * ws_nw_offset(); } static uint32_t ws_view_camera_addr, ws_view_min_addr, ws_view_max_addr, ws_view_active_addr; diff --git a/runtime/src/mod_runtime.cpp b/runtime/src/mod_runtime.cpp index 91478239..6470aa92 100644 --- a/runtime/src/mod_runtime.cpp +++ b/runtime/src/mod_runtime.cpp @@ -1526,6 +1526,9 @@ extern "C" uint32_t psx_mod_alloc_gpu_dma_memory(uint32_t size, extern "C" int32_t psx_mod_widescreen_x_margin(void) { return (int32_t)psx_ws_x_margin(); } +extern "C" int32_t psx_mod_widescreen_view_x_margin(void) { + return (int32_t)gpu_ws_configured_x_reveal(); +} extern "C" void psx_mod_tag_hud_primitive(uint32_t primitive, int edge) { gpu_ws_tag_hud_primitive(primitive, edge);