SWTP: Fixed overflown bit logic for addition and subtraction (from Bill Beech)
This commit is contained in:
parent
1666cef8e3
commit
028f152f6f
1 changed files with 3 additions and 5 deletions
|
@ -1886,8 +1886,7 @@ int32 get_flag(int32 flg)
|
||||||
void condevalVa(int32 op1, int32 op2)
|
void condevalVa(int32 op1, int32 op2)
|
||||||
{
|
{
|
||||||
if (get_flag(CF)) {
|
if (get_flag(CF)) {
|
||||||
COND_SET_FLAG_V(((op1 & 0x80) && (op2 & 0x80)) || (
|
COND_SET_FLAG_V((op1 & op2 & 0x80) || (((op1 | op2) & 0x80) == 0));
|
||||||
((op1 & 0x80) == 0) && ((op2 & 0x80) == 0)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1896,8 +1895,7 @@ void condevalVa(int32 op1, int32 op2)
|
||||||
void condevalVs(int32 op1, int32 op2)
|
void condevalVs(int32 op1, int32 op2)
|
||||||
{
|
{
|
||||||
if (get_flag(CF)) {
|
if (get_flag(CF)) {
|
||||||
COND_SET_FLAG_V(((op1 & 0x80) && ((op2 & 0x80) == 0)) ||
|
COND_SET_FLAG_V(op1 & op2 & 0x80);
|
||||||
(((op1 & 0x80) == 0) && (op2 & 0x80)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue