Skip to content

Commit

Permalink
gpu_neon: try to patch more pal vs enhancement trouble
Browse files Browse the repository at this point in the history
  • Loading branch information
notaz committed Dec 6, 2023
1 parent 894cbc4 commit a3fcdfc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugins/gpu_neon/psx_gpu_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ sync_enhancement_buffers(int x, int y, int w, int h)
// due to intersection stuff, see the update_enhancement_buf_scanouts() mess
int s_w = max(gpu.screen.hres, gpu.screen.w);
int s_h = gpu.screen.vres;
if (gpu.screen.y < 0)
s_h -= gpu.screen.y;
s_w = min(s_w, 512);
for (i = 0; i < ARRAY_SIZE(egpu.enhancement_scanouts); i++) {
const struct psx_gpu_scanout *s = &egpu.enhancement_scanouts[i];
Expand Down Expand Up @@ -164,10 +166,13 @@ void renderer_update_caches(int x, int y, int w, int h, int state_changed)

if (gpu.state.enhancement_active) {
if (state_changed) {
int vres = gpu.screen.vres;
if (gpu.screen.y < 0)
vres -= gpu.screen.y;
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);
gpu.screen.src_x, gpu.screen.src_y, gpu.screen.hres, vres);
return;
}
sync_enhancement_buffers(x, y, w, h);
Expand Down Expand Up @@ -195,10 +200,13 @@ void renderer_notify_res_change(void)

void renderer_notify_scanout_change(int x, int y)
{
int vres = gpu.screen.vres;
if (!gpu.state.enhancement_active || !egpu.enhancement_buf_ptr)
return;

update_enhancement_buf_scanouts(&egpu, x, y, gpu.screen.hres, gpu.screen.vres);
if (gpu.screen.y < 0)
vres -= gpu.screen.y;
update_enhancement_buf_scanouts(&egpu, x, y, gpu.screen.hres, vres);
}

#include "../../frontend/plugin_lib.h"
Expand Down

0 comments on commit a3fcdfc

Please sign in to comment.