aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authornotaz2015-01-10 03:51:44 +0200
committernotaz2015-01-12 03:01:01 +0200
commit8f5f2dd5a70f47322614eda6f97304808447199c (patch)
tree66119eb69ce26ba93ce13246e82de5677b0d73ea /plugins
parentc632283d5c48d7731ec5704c3d5eef54951fec20 (diff)
downloadpcsx_rearmed-8f5f2dd5a70f47322614eda6f97304808447199c.tar.gz
pcsx_rearmed-8f5f2dd5a70f47322614eda6f97304808447199c.tar.bz2
pcsx_rearmed-8f5f2dd5a70f47322614eda6f97304808447199c.zip
some random improvements
Diffstat (limited to 'plugins')
-rw-r--r--plugins/dfsound/spu.c14
-rw-r--r--plugins/gpulib/gpu.c12
2 files changed, 20 insertions, 6 deletions
diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c
index f5edd3a..ec31b0c 100644
--- a/plugins/dfsound/spu.c
+++ b/plugins/dfsound/spu.c
@@ -595,24 +595,26 @@ make_do_samples(simple, , ,
static int do_samples_skip(int ch, int ns_to)
{
SPUCHAN *s_chan = &spu.s_chan[ch];
+ int spos = s_chan->spos;
+ int sinc = s_chan->sinc;
int ret = ns_to, ns, d;
- s_chan->spos += s_chan->iSBPos << 16;
+ spos += s_chan->iSBPos << 16;
for (ns = 0; ns < ns_to; ns++)
{
- s_chan->spos += s_chan->sinc;
- while (s_chan->spos >= 28*0x10000)
+ spos += sinc;
+ while (spos >= 28*0x10000)
{
d = skip_block(ch);
if (d && ns < ret)
ret = ns;
- s_chan->spos -= 28*0x10000;
+ spos -= 28*0x10000;
}
}
- s_chan->iSBPos = s_chan->spos >> 16;
- s_chan->spos &= 0xffff;
+ s_chan->iSBPos = spos >> 16;
+ s_chan->spos = spos & 0xffff;
return ret;
}
diff --git a/plugins/gpulib/gpu.c b/plugins/gpulib/gpu.c
index 337e27a..c9b05d4 100644
--- a/plugins/gpulib/gpu.c
+++ b/plugins/gpulib/gpu.c
@@ -13,8 +13,16 @@
#include "gpu.h"
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#ifdef __GNUC__
#define unlikely(x) __builtin_expect((x), 0)
+#define preload __builtin_prefetch
#define noinline __attribute__((noinline))
+#else
+#define unlikely(x)
+#define preload(...)
+#define noinline
+#error huh
+#endif
#define gpu_log(fmt, ...) \
printf("%d:%03d: " fmt, *gpu.state.frame_count, *gpu.state.hcnt, ##__VA_ARGS__)
@@ -518,6 +526,8 @@ long GPUdmaChain(uint32_t *rambase, uint32_t start_addr)
int len, left, count;
long cpu_cycles = 0;
+ preload(rambase + (start_addr & 0x1fffff) / 4);
+
if (unlikely(gpu.cmd_len > 0))
flush_cmd_buffer();
@@ -537,6 +547,8 @@ long GPUdmaChain(uint32_t *rambase, uint32_t start_addr)
list = rambase + (addr & 0x1fffff) / 4;
len = list[0] >> 24;
addr = list[0] & 0xffffff;
+ preload(rambase + (addr & 0x1fffff) / 4);
+
cpu_cycles += 10;
if (len > 0)
cpu_cycles += 5 + len;