notaz.gp2x.de
/
pcsx_rearmed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b03e0ca
)
psxinterpreter: fix division by zero
author
notaz
<notasas@gmail.com>
Sat, 25 Jun 2011 17:09:44 +0000
(20:09 +0300)
committer
notaz
<notasas@gmail.com>
Thu, 7 Jul 2011 21:15:08 +0000
(
00:15
+0300)
Based on info from Ryphecha.
libpcsxcore/psxinterpreter.c
patch
|
blob
|
blame
|
history
diff --git
a/libpcsxcore/psxinterpreter.c
b/libpcsxcore/psxinterpreter.c
index
f171205
..
8eb4749
100644
(file)
--- a/
libpcsxcore/psxinterpreter.c
+++ b/
libpcsxcore/psxinterpreter.c
@@
-504,6
+504,10
@@
void psxDIV() {
_i32(_rLo_) = _i32(_rRs_) / _i32(_rRt_);
_i32(_rHi_) = _i32(_rRs_) % _i32(_rRt_);
}
+ else {
+ _i32(_rLo_) = _i32(_rRs_) >= 0 ? 0xffffffff : 1;
+ _i32(_rHi_) = _i32(_rRs_);
+ }
}
void psxDIVU() {
@@
-511,6
+515,10
@@
void psxDIVU() {
_rLo_ = _rRs_ / _rRt_;
_rHi_ = _rRs_ % _rRt_;
}
+ else {
+ _i32(_rLo_) = 0xffffffff;
+ _i32(_rHi_) = _i32(_rRs_);
+ }
}
void psxMULT() {