From b8d961effdd3fc2a00dc073cae06b6d937682420 Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 18 Jul 2012 01:56:37 +0300 Subject: [PATCH] psx_gpu: fix line cmd length and move w/h masking w/h masking untested, I'm lazy --- plugins/gpu_neon/psx_gpu/psx_gpu_parse.c | 5 +++-- plugins/gpulib/gpu.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c index 3fc040d8..e409aa5a 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c +++ b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c @@ -496,7 +496,7 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command) } if(num_vertexes > 2) - command_length += ((num_vertexes * 2) - 2); + command_length += ((num_vertexes - 2) * 2); break; } @@ -597,7 +597,8 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command) 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], list_s16[7]); + list_s16[4] & 0x3FF, list_s16[5] & 0x1FF, + ((list_s16[6] - 1) & 0x3FF) + 1, ((list_s16[7] - 1) & 0x1FF) + 1); break; #ifdef PCSX diff --git a/plugins/gpulib/gpu.c b/plugins/gpulib/gpu.c index ea172376..79a5fa46 100644 --- a/plugins/gpulib/gpu.c +++ b/plugins/gpulib/gpu.c @@ -333,6 +333,7 @@ static noinline int do_cmd_list_skip(uint32_t *data, int count, int *last_cmd) int cmd = 0, pos = 0, len, dummy; int skip = 1; + // XXX: polylines are not properly handled while (pos < count && skip) { uint32_t *list = data + pos; cmd = list[0] >> 24; -- 2.39.5