aboutsummaryrefslogtreecommitdiff
path: root/plugins/gpu_neon
diff options
context:
space:
mode:
authornotaz2012-01-01 17:42:30 +0200
committernotaz2012-01-01 17:42:30 +0200
commit1c72b1c2337be47ef7be2254209cc61a6407fdbb (patch)
tree5fed4149cc1c18d2814d162f0abaa453501533cb /plugins/gpu_neon
parent0486fdc9bd313ce2f01dafa4d3c151f40e2c729b (diff)
downloadpcsx_rearmed-1c72b1c2337be47ef7be2254209cc61a6407fdbb.tar.gz
pcsx_rearmed-1c72b1c2337be47ef7be2254209cc61a6407fdbb.tar.bz2
pcsx_rearmed-1c72b1c2337be47ef7be2254209cc61a6407fdbb.zip
gpu_neon: start calculating cycles
a bit rough (as usual) and list slots only, but better than nothing
Diffstat (limited to 'plugins/gpu_neon')
-rw-r--r--plugins/gpu_neon/gpu.c12
-rw-r--r--plugins/gpu_neon/gpu.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/plugins/gpu_neon/gpu.c b/plugins/gpu_neon/gpu.c
index c68e81c..4fc2897 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 c761bd6..227aaaa 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;