diff options
Diffstat (limited to 'plugins/gpu_neon/psx_gpu')
-rw-r--r-- | plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S | 35 | ||||
-rw-r--r-- | plugins/gpu_neon/psx_gpu/psx_gpu_parse.c | 45 |
2 files changed, 54 insertions, 26 deletions
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 3239412..87a14f6 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S +++ b/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S @@ -5410,3 +5410,38 @@ function(update_texture_8bpp_cache_slice) vpop { q0 - q3 } ldmia sp!, { r4 - r11, pc } + +/* void scale2x_tiles8(void *dst, const void *src, int w8, int h) */ +function(scale2x_tiles8) + push { r4, r14 } + + mov r4, r1 + add r12, r0, #1024*2 + mov r14, r2 + +0: + vld1.u16 { q0 }, [ r1, :128 ]! + vld1.u16 { q2 }, [ r1, :128 ]! + vmov q1, q0 + vmov q3, q2 + vzip.16 q0, q1 + vzip.16 q2, q3 + subs r14, #2 + vst1.u16 { q0, q1 }, [ r0, :128 ]! + vst1.u16 { q0, q1 }, [ r12, :128 ]! + blt 1f + vst1.u16 { q2, q3 }, [ r0, :128 ]! + vst1.u16 { q2, q3 }, [ r12, :128 ]! + bgt 0b +1: + subs r3, #1 + mov r14, r2 + add r0, #1024*2*2 + add r4, #1024*2 + sub r0, r2, lsl #4+1 + mov r1, r4 + add r12, r0, #1024*2 + bgt 0b + nop + + pop { r4, pc } diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c index 86a816e..af82d7e 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c +++ b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c @@ -798,6 +798,8 @@ breakloop: #define shift_triangle_area() \ psx_gpu->triangle_area *= 4 +extern void scale2x_tiles8(void *dst, const void *src, int w8, int h); + static int disable_main_render; static void do_triangle_enhanced(psx_gpu_struct *psx_gpu, @@ -1292,37 +1294,28 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_c } case 0x80: // vid -> vid - render_block_move(psx_gpu, list_s16[2] & 0x3FF, list_s16[3] & 0x1FF, - list_s16[4] & 0x3FF, list_s16[5] & 0x1FF, - ((list_s16[6] - 1) & 0x3FF) + 1, ((list_s16[7] - 1) & 0x1FF) + 1); + { + u32 sx = list_s16[2] & 0x3FF; + u32 sy = list_s16[3] & 0x1FF; + u32 dx = list_s16[4] & 0x3FF; + u32 dy = list_s16[5] & 0x1FF; + u32 w = ((list_s16[6] - 1) & 0x3FF) + 1; + u32 h = ((list_s16[7] - 1) & 0x1FF) + 1; + + render_block_move(psx_gpu, sx, sy, dx, dy, w, h); + if (dy + h > 512) + h = 512 - dy; + sx = sx & ~7; // FIXME? + dx = dx * 2 & ~7; + dy *= 2; + scale2x_tiles8(psx_gpu->enhancement_buf_ptr + dy * 1024 + dx, + psx_gpu->vram_ptr + sy * 1024 + sx, w / 8, h); break; + } -#ifdef PCSX case 0xA0: // sys -> vid case 0xC0: // vid -> sys goto breakloop; -#else - case 0xA0: // sys -> vid - { - u32 load_x = list_s16[2] & 0x3FF; - u32 load_y = list_s16[3] & 0x1FF; - u32 load_width = list_s16[4] & 0x3FF; - u32 load_height = list_s16[5] & 0x1FF; - u32 load_size = load_width * load_height; - - command_length += load_size / 2; - - if(load_size & 1) - command_length++; - - render_block_copy(psx_gpu, (u16 *)&(list_s16[6]), load_x, load_y, - load_width, load_height, load_width); - break; - } - - case 0xC0: // vid -> sys - break; -#endif case 0xE1: set_texture(psx_gpu, list[0]); |