From: notaz Date: Sun, 1 Jan 2012 15:42:30 +0000 (+0200) Subject: gpu_neon: start calculating cycles X-Git-Tag: r13~19 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c72b1c2337be47ef7be2254209cc61a6407fdbb;p=pcsx_rearmed.git gpu_neon: start calculating cycles a bit rough (as usual) and list slots only, but better than nothing --- diff --git a/plugins/gpu_neon/gpu.c b/plugins/gpu_neon/gpu.c index c68e81c3..4fc28970 100644 --- a/plugins/gpu_neon/gpu.c +++ b/plugins/gpu_neon/gpu.c @@ -394,7 +394,7 @@ long GPUdmaChain(uint32_t *rambase, uint32_t start_addr) uint32_t addr, *list; uint32_t *llist_entry = NULL; int len, left, count; - long dma_words = 0; + long cpu_cycles = 0; if (unlikely(gpu.cmd_len > 0)) flush_cmd_buffer(); @@ -402,7 +402,7 @@ long GPUdmaChain(uint32_t *rambase, uint32_t start_addr) // ff7 sends it's main list twice, detect this if (*gpu.state.frame_count == gpu.state.last_list.frame && *gpu.state.hcnt - gpu.state.last_list.hcnt <= 1 && - gpu.state.last_list.words > 1024) + gpu.state.last_list.cycles > 2048) { llist_entry = rambase + (gpu.state.last_list.addr & 0x1fffff) / 4; *llist_entry |= 0x800000; @@ -415,7 +415,9 @@ long GPUdmaChain(uint32_t *rambase, uint32_t start_addr) list = rambase + (addr & 0x1fffff) / 4; len = list[0] >> 24; addr = list[0] & 0xffffff; - dma_words += 1 + len; + cpu_cycles += 10; + if (len > 0) + cpu_cycles += 5 + len; log_io(".chain %08x #%d\n", (list - rambase) * 4, len); @@ -446,10 +448,10 @@ long GPUdmaChain(uint32_t *rambase, uint32_t start_addr) gpu.state.last_list.frame = *gpu.state.frame_count; gpu.state.last_list.hcnt = *gpu.state.hcnt; - gpu.state.last_list.words = dma_words; + gpu.state.last_list.cycles = cpu_cycles; gpu.state.last_list.addr = start_addr; - return dma_words; + return cpu_cycles; } void GPUreadDataMem(uint32_t *mem, int count) diff --git a/plugins/gpu_neon/gpu.h b/plugins/gpu_neon/gpu.h index c761bd6e..227aaaac 100644 --- a/plugins/gpu_neon/gpu.h +++ b/plugins/gpu_neon/gpu.h @@ -68,7 +68,7 @@ struct psx_gpu { uint32_t *hcnt; /* hsync count */ struct { uint32_t addr; - uint32_t words; + uint32_t cycles; uint32_t frame; uint32_t hcnt; } last_list;