summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-01-27 21:28:10 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-01-27 21:28:10 +0000
commit308cedf358e596a58cda1adc200e548940384720 (patch)
tree7c99a4919e7ac3190c90997c75049175354a8633
parenta68be7bc456cf7fed19cd90854e23f8c150aac6b (diff)
downloadpcsxr-308cedf358e596a58cda1adc200e548940384720.tar.gz
gte avsz3/avsz4;
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@82547 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rwxr-xr-xlibpcsxcore/gte.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libpcsxcore/gte.c b/libpcsxcore/gte.c
index 3c9ea449..d664328a 100755
--- a/libpcsxcore/gte.c
+++ b/libpcsxcore/gte.c
@@ -177,8 +177,8 @@ static inline s64 BOUNDS(s64 n_value, s64 n_max, int n_maxflag, s64 n_min, int n
return n_value;
}
-static inline s32 LIM(s32 value, s32 max, s32 min, u32 flag) {
- s32 ret = value;
+static inline s64 LIM(s64 value, s64 max, s64 min, u32 flag) {
+ s64 ret = value;
if (value > max) {
gteFLAG |= flag;
ret = max;
@@ -495,8 +495,9 @@ void gteAVSZ3() {
#endif
gteFLAG = 0;
- gteMAC0 = F((s64)(gteZSF3 * gteSZ1) + (gteZSF3 * gteSZ2) + (gteZSF3 * gteSZ3));
- gteOTZ = limD(gteMAC0 >> 12);
+ s64 t = (s64)(gteZSF3 * (s64)(gteSZ1 + gteSZ2 + gteSZ3));
+ gteMAC0 = F(t);
+ gteOTZ = limD(t >> 12);
}
void gteAVSZ4() {
@@ -505,8 +506,9 @@ void gteAVSZ4() {
#endif
gteFLAG = 0;
- gteMAC0 = F((s64)(gteZSF4 * (gteSZ0 + gteSZ1 + gteSZ2 + gteSZ3)));
- gteOTZ = limD(gteMAC0 >> 12);
+ s64 t = (s64)(gteZSF4 * (s64)(gteSZ0 + gteSZ1 + gteSZ2 + gteSZ3));
+ gteMAC0 = F(t);
+ gteOTZ = limD(t >> 12);
}
void gteSQR() {