math.floor in divs rounds down with negative numbers. Replaced with double binary not

This commit is contained in:
dmcoles 2013-09-03 17:37:39 +01:00
commit 39b46c1d34

View file

@ -1063,7 +1063,7 @@ function CPU() {
regs.pc = fault.pc;
return exception(5);
} else {
var quo = Math.floor(d / s);
var quo = ~~(d / s);
if (quo < 0) quo += 0x10000;
@ -5253,4 +5253,4 @@ function CPU() {
cycle_spc(cpu_cycles);
}
}
}
}