From 5b745e5bbcb51267122821ed9dc1c8c2c77dc100 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 13 Aug 2011 02:13:13 +0300 Subject: gpu_neon: handle 0xEx cmds while frameskiping otherwise things go out of sync --- plugins/gpu_neon/gpu.c | 6 ++++-- plugins/gpu_neon/gpu.h | 1 + plugins/gpu_neon/peops_if.c | 10 ++++++++++ plugins/gpu_neon/vout_fb.c | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/gpu_neon/gpu.c b/plugins/gpu_neon/gpu.c index 2db4379..03b0c71 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 cc202c5..a0cdbf7 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 04c2595..1a4072f 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 1dfa8ab..b2b5b25 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; } -- cgit v1.2.3