From 89a8e88a616301c0cec4cbfebf96301ce9d5244c Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 17 Aug 2024 01:38:45 +0300 Subject: [PATCH] gpu_neon: fix wrong mask bit for fills Fixes notaz/pcsx_rearmed#344 --- plugins/gpu_neon/psx_gpu/psx_gpu.c | 6 +-- plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S | 46 +-------------------- 2 files changed, 3 insertions(+), 49 deletions(-) diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.c b/plugins/gpu_neon/psx_gpu/psx_gpu.c index b671a757..a59e9cdc 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu.c +++ b/plugins/gpu_neon/psx_gpu/psx_gpu.c @@ -4810,8 +4810,7 @@ void render_block_fill(psx_gpu_struct *psx_gpu, u32 color, u32 x, u32 y, u32 r = color & 0xFF; u32 g = (color >> 8) & 0xFF; u32 b = (color >> 16) & 0xFF; - u32 color_16bpp = (r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10) | - psx_gpu->mask_msb; + u32 color_16bpp = (r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10); u32 color_32bpp = color_16bpp | (color_16bpp << 16); u32 *vram_ptr = (u32 *)(psx_gpu->vram_out_ptr + x + (y * 1024)); @@ -4863,8 +4862,7 @@ void render_block_fill_enh(psx_gpu_struct *psx_gpu, u32 color, u32 x, u32 y, u32 r = color & 0xFF; u32 g = (color >> 8) & 0xFF; u32 b = (color >> 16) & 0xFF; - u32 color_16bpp = (r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10) | - psx_gpu->mask_msb; + u32 color_16bpp = (r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10); u32 color_32bpp = color_16bpp | (color_16bpp << 16); u32 *vram_ptr = (u32 *)(psx_gpu->vram_out_ptr + x + (y * 1024)); diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S b/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S index ffbea043..1ba562b5 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S +++ b/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S @@ -4386,51 +4386,6 @@ function(warmup) #undef vram_ptr #undef color -#undef width -#undef height -#undef pitch - -#define vram_ptr r0 -#define color r1 -#define width r2 -#define height r3 - -#define pitch r1 - -#define num_width r12 - -#undef colors_a -#undef colors_b - -#define colors_a q0 -#define colors_b q1 - -.align 3 - -function(render_block_fill_body) - vdup.u16 colors_a, color - mov pitch, #2048 - - vmov colors_b, colors_a - sub pitch, pitch, width, lsl #1 - - mov num_width, width - - 0: - vst1.u32 { colors_a, colors_b }, [vram_ptr, :256]! - - subs num_width, num_width, #16 - bne 0b - - add vram_ptr, vram_ptr, pitch - mov num_width, width - - subs height, height, #1 - bne 0b - - bx lr - - #undef x #undef y #undef width @@ -4523,6 +4478,7 @@ function(render_block_fill_body) #define texels_wide_high d15 #define texels_wide q7 +.align 3 setup_sprite_flush_blocks: vpush { q1 - q5 } -- 2.39.5