SWTP: Fixed overflown bit logic for addition and subtraction (from Bill Beech)

This commit is contained in:
Mark Pizzolato 2014-01-01 10:33:29 -08:00
parent 1666cef8e3
commit 028f152f6f

View file

@ -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)));
} }
} }