From 6ae77271f24e0de83cdb169d113e6503e9c1819c Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 25 Oct 2023 23:08:48 +0300 Subject: [PATCH] gpu_neon: fix some missing ebuf updates --- plugins/gpu_neon/psx_gpu/psx_gpu_parse.c | 11 ++++++++--- plugins/gpu_neon/psx_gpu_if.c | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c index de227d5b..5f69919e 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c +++ b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c @@ -889,8 +889,8 @@ static void *select_enhancement_buf_ptr(psx_gpu_struct *psx_gpu, s32 x, s32 y) static void select_enhancement_buf(psx_gpu_struct *psx_gpu) { - s32 x = psx_gpu->saved_viewport_start_x; - s32 y = psx_gpu->saved_viewport_start_y; + s32 x = psx_gpu->saved_viewport_start_x + 16; + s32 y = psx_gpu->saved_viewport_start_y + 16; psx_gpu->enhancement_current_buf_ptr = select_enhancement_buf_ptr(psx_gpu, x, y); } @@ -1704,7 +1704,12 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size, psx_gpu->saved_viewport_end_y = viewport_end_y; select_enhancement_buf(psx_gpu); - +#if 0 + if (!psx_gpu->enhancement_current_buf_ptr) + log_anomaly("vp %3d,%3d %3d,%d - no buf\n", + psx_gpu->viewport_start_x, psx_gpu->viewport_start_y, + viewport_end_x, viewport_end_y); +#endif #ifdef TEXTURE_CACHE_4BPP psx_gpu->viewport_mask = texture_region_mask(psx_gpu->viewport_start_x, diff --git a/plugins/gpu_neon/psx_gpu_if.c b/plugins/gpu_neon/psx_gpu_if.c index a1fbb910..3dab827c 100644 --- a/plugins/gpu_neon/psx_gpu_if.c +++ b/plugins/gpu_neon/psx_gpu_if.c @@ -160,6 +160,8 @@ void renderer_update_caches(int x, int y, int w, int h, int state_changed) if (state_changed) { memset(egpu.enhancement_scanouts, 0, sizeof(egpu.enhancement_scanouts)); egpu.enhancement_scanout_eselect = 0; + update_enhancement_buf_scanouts(&egpu, + gpu.screen.src_x, gpu.screen.src_y, gpu.screen.hres, gpu.screen.vres); return; } sync_enhancement_buffers(x, y, w, h); -- 2.39.5