From: notaz Date: Fri, 12 Aug 2011 23:13:13 +0000 (+0300) Subject: gpu_neon: handle 0xEx cmds while frameskiping X-Git-Tag: r9~2 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b745e5bbcb51267122821ed9dc1c8c2c77dc100;p=pcsx_rearmed.git gpu_neon: handle 0xEx cmds while frameskiping otherwise things go out of sync --- diff --git a/plugins/gpu_neon/gpu.c b/plugins/gpu_neon/gpu.c index 2db43797..03b0c71b 100644 --- a/plugins/gpu_neon/gpu.c +++ b/plugins/gpu_neon/gpu.c @@ -328,11 +328,12 @@ static int check_cmd(uint32_t *data, int count) start_vram_transfer(data[pos + 1], data[pos + 2], cmd == 0xc0); pos += len; } - - if (cmd == -1) + else if (cmd == -1) break; } + if (gpu.frameskip.active) + renderer_sync_ecmds(gpu.ex_regs); gpu.state.fb_dirty |= vram_dirty; return count - pos; @@ -498,6 +499,7 @@ long GPUfreeze(uint32_t type, GPUFreeze_t *freeze) gpu.regs[i] ^= 1; // avoid reg change detection GPUwriteStatus((i << 24) | (gpu.regs[i] ^ 1)); } + renderer_sync_ecmds(gpu.ex_regs); break; } diff --git a/plugins/gpu_neon/gpu.h b/plugins/gpu_neon/gpu.h index cc202c53..a0cdbf74 100644 --- a/plugins/gpu_neon/gpu.h +++ b/plugins/gpu_neon/gpu.h @@ -86,6 +86,7 @@ extern const unsigned char cmd_lengths[256]; void do_cmd_list(uint32_t *list, int count); int renderer_init(void); +void renderer_sync_ecmds(uint32_t * ecmds); void renderer_invalidate_caches(int x, int y, int w, int h); void renderer_flush_queues(void); diff --git a/plugins/gpu_neon/peops_if.c b/plugins/gpu_neon/peops_if.c index 04c2595c..1a4072f6 100644 --- a/plugins/gpu_neon/peops_if.c +++ b/plugins/gpu_neon/peops_if.c @@ -365,6 +365,16 @@ void do_cmd_list(unsigned int *list, int list_len) } } +void renderer_sync_ecmds(uint32_t *ecmds) +{ + cmdTexturePage((unsigned char *)&ecmds[1]); + cmdTextureWindow((unsigned char *)&ecmds[2]); + cmdDrawAreaStart((unsigned char *)&ecmds[3]); + cmdDrawAreaEnd((unsigned char *)&ecmds[4]); + cmdDrawOffset((unsigned char *)&ecmds[5]); + cmdSTP((unsigned char *)&ecmds[6]); +} + void renderer_invalidate_caches(int x, int y, int w, int h) { } diff --git a/plugins/gpu_neon/vout_fb.c b/plugins/gpu_neon/vout_fb.c index 1dfa8abe..b2b5b250 100644 --- a/plugins/gpu_neon/vout_fb.c +++ b/plugins/gpu_neon/vout_fb.c @@ -85,7 +85,7 @@ void GPUupdateLace(void) return; if (gpu.frameskip.enabled) { - if (!gpu.frameskip.frame_ready && gpu.frameskip.skipped_blits < 6) { + if (!gpu.frameskip.frame_ready && gpu.frameskip.skipped_blits < 9) { gpu.frameskip.skipped_blits++; return; }