aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2010-12-21 13:53:31 +0200
committernotaz2010-12-21 13:53:31 +0200
commita2544c926e9f382d57614ba2594ede0f56f4a108 (patch)
tree1dc3d36b002bf1d637184400ceaf8970c05ecff3
parent7e605697028dd22dbf2d6ee4701add1e31814b1a (diff)
downloadpcsx_rearmed-a2544c926e9f382d57614ba2594ede0f56f4a108.tar.gz
pcsx_rearmed-a2544c926e9f382d57614ba2594ede0f56f4a108.tar.bz2
pcsx_rearmed-a2544c926e9f382d57614ba2594ede0f56f4a108.zip
hack: use simple GTE division
that large table was slow, probably because of dcache trashing.
-rw-r--r--libpcsxcore/gte.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libpcsxcore/gte.c b/libpcsxcore/gte.c
index 72210d3..00e7954 100644
--- a/libpcsxcore/gte.c
+++ b/libpcsxcore/gte.c
@@ -348,6 +348,16 @@ void gteSWC2() {
psxMemWrite32(_oB_, MFC2(_Rt_));
}
+#define DIVIDE DIVIDE_
+static u32 DIVIDE_(s16 n, u16 d) {
+ if (n >= 0 && n < d * 2) {
+ s32 n_ = n;
+ return ((n_ << 16) + d / 2) / d;
+ //return (u32)((float)(n_ << 16) / (float)d + (float)0.5);
+ }
+ return 0xffffffff;
+}
+
void gteRTPS() {
int quotient;