Fix SSMOD (though still float hack).

This commit is contained in:
Brad Nelson
2022-07-14 17:27:10 -07:00
parent fb2366c5f4
commit d4de8aaa17

View File

@ -178,8 +178,14 @@ function SSMOD(sp) {
var b = i32[(sp - 4)>>2];
var c = i32[sp>>2];
a *= b;
i32[(sp - 8)>>2] = a / c;
i32[sp>>2] = a % c;
var x = Math.floor(a / c);
var m = a - x * c;
if (m < 0) {
x--;
m += c;
}
i32[(sp - 8)>>2] = m;
i32[sp>>2] = x;
}
function Finish() {