From: notaz Date: Fri, 1 Nov 2024 00:02:55 +0000 (+0200) Subject: gpu_neon: mask before compare X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0f0e96fbd74408d0708fa1ac50ec3429f188bc6;p=pcsx_rearmed.git gpu_neon: mask before compare --- diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c index f398695d..e78feaf2 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c +++ b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c @@ -39,7 +39,7 @@ const u8 command_lengths[256] = }; #endif -void update_texture_ptr(psx_gpu_struct *psx_gpu) +static void update_texture_ptr(psx_gpu_struct *psx_gpu) { u8 *texture_base; u8 *texture_ptr; @@ -91,7 +91,7 @@ void update_texture_ptr(psx_gpu_struct *psx_gpu) psx_gpu->texture_page_ptr = texture_ptr; } -void set_texture(psx_gpu_struct *psx_gpu, u32 texture_settings) +static void set_texture(psx_gpu_struct *psx_gpu, u32 texture_settings) { texture_settings &= 0x1FF; if(psx_gpu->texture_settings != texture_settings) @@ -135,17 +135,18 @@ void set_texture(psx_gpu_struct *psx_gpu, u32 texture_settings) } } -void set_clut(psx_gpu_struct *psx_gpu, u32 clut_settings) +static void set_clut(psx_gpu_struct *psx_gpu, u32 clut_settings) { - if(psx_gpu->clut_settings != clut_settings) + clut_settings &= 0x7FFF; + if (psx_gpu->clut_settings != clut_settings) { flush_render_block_buffer(psx_gpu); psx_gpu->clut_settings = clut_settings; - psx_gpu->clut_ptr = psx_gpu->vram_ptr + ((clut_settings & 0x7FFF) * 16); + psx_gpu->clut_ptr = psx_gpu->vram_ptr + clut_settings * 16; } } -void set_triangle_color(psx_gpu_struct *psx_gpu, u32 triangle_color) +static void set_triangle_color(psx_gpu_struct *psx_gpu, u32 triangle_color) { if(psx_gpu->triangle_color != triangle_color) {