implement ALL of abhoriels patch correctly.
git-svn-id: https://svn.code.sf.net/p/vbam/code/branches/bgk-link@1160 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
parent
ec117abec9
commit
bd0de11177
|
@ -754,16 +754,12 @@ static void count(u32 opcode, int cond_res)
|
||||||
#ifndef VALUE_LSL_REG_C
|
#ifndef VALUE_LSL_REG_C
|
||||||
#define VALUE_LSL_REG_C \
|
#define VALUE_LSL_REG_C \
|
||||||
unsigned int shift = reg[(opcode >> 8)&15].B.B0; \
|
unsigned int shift = reg[(opcode >> 8)&15].B.B0; \
|
||||||
unsigned int rm = reg[opcode & 0x0F].I; \
|
|
||||||
if(opcode & 0x0F == 15) { \
|
|
||||||
rm += 4; \
|
|
||||||
} \
|
|
||||||
if (LIKELY(shift)) { \
|
if (LIKELY(shift)) { \
|
||||||
if (shift == 32) { \
|
if (shift == 32) { \
|
||||||
value = 0; \
|
value = 0; \
|
||||||
C_OUT = (rm & 1 ? true : false);\
|
C_OUT = (reg[opcode & 0x0F].I & 1 ? true : false);\
|
||||||
} else if (LIKELY(shift < 32)) { \
|
} else if (LIKELY(shift < 32)) { \
|
||||||
u32 v = rm; \
|
u32 v = reg[opcode & 0x0F].I; \
|
||||||
C_OUT = (v >> (32 - shift)) & 1 ? true : false;\
|
C_OUT = (v >> (32 - shift)) & 1 ? true : false;\
|
||||||
value = v << shift; \
|
value = v << shift; \
|
||||||
} else { \
|
} else { \
|
||||||
|
@ -771,7 +767,7 @@ static void count(u32 opcode, int cond_res)
|
||||||
C_OUT = false; \
|
C_OUT = false; \
|
||||||
} \
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
value = rm; \
|
value = reg[opcode & 0x0F].I; \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// OP Rd,Rb,Rm LSR #
|
// OP Rd,Rb,Rm LSR #
|
||||||
|
@ -791,23 +787,20 @@ static void count(u32 opcode, int cond_res)
|
||||||
#ifndef VALUE_LSR_REG_C
|
#ifndef VALUE_LSR_REG_C
|
||||||
#define VALUE_LSR_REG_C \
|
#define VALUE_LSR_REG_C \
|
||||||
unsigned int shift = reg[(opcode >> 8)&15].B.B0; \
|
unsigned int shift = reg[(opcode >> 8)&15].B.B0; \
|
||||||
unsigned int rm = reg[opcode & 0x0F].I; \
|
|
||||||
if(opcode & 0x0F == 15) { \
|
|
||||||
rm += 4; \
|
|
||||||
} \
|
|
||||||
if (LIKELY(shift)) { \
|
if (LIKELY(shift)) { \
|
||||||
if (shift == 32) { \
|
if (shift == 32) { \
|
||||||
value = 0; \
|
value = 0; \
|
||||||
C_OUT = (rm & 0x80000000 ? true : false); \
|
C_OUT = (reg[opcode & 0x0F].I & 0x80000000 ? true : false);\
|
||||||
} else if (LIKELY(shift < 32)) { \
|
} else if (LIKELY(shift < 32)) { \
|
||||||
C_OUT = (rm >> (shift - 1)) & 1 ? true : false;\
|
u32 v = reg[opcode & 0x0F].I; \
|
||||||
value = rm >> shift; \
|
C_OUT = (v >> (shift - 1)) & 1 ? true : false;\
|
||||||
|
value = v >> shift; \
|
||||||
} else { \
|
} else { \
|
||||||
value = 0; \
|
value = 0; \
|
||||||
C_OUT = false; \
|
C_OUT = false; \
|
||||||
} \
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
value = rm; \
|
value = reg[opcode & 0x0F].I; \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// OP Rd,Rb,Rm ASR #
|
// OP Rd,Rb,Rm ASR #
|
||||||
|
@ -833,19 +826,16 @@ static void count(u32 opcode, int cond_res)
|
||||||
#ifndef VALUE_ASR_REG_C
|
#ifndef VALUE_ASR_REG_C
|
||||||
#define VALUE_ASR_REG_C \
|
#define VALUE_ASR_REG_C \
|
||||||
unsigned int shift = reg[(opcode >> 8)&15].B.B0; \
|
unsigned int shift = reg[(opcode >> 8)&15].B.B0; \
|
||||||
unsigned int rm = reg[opcode & 0x0F].I; \
|
|
||||||
if(opcode & 0x0F == 15) { \
|
|
||||||
rm += 4; \
|
|
||||||
} \
|
|
||||||
if (LIKELY(shift < 32)) { \
|
if (LIKELY(shift < 32)) { \
|
||||||
if (LIKELY(shift)) { \
|
if (LIKELY(shift)) { \
|
||||||
C_OUT = (rm >> (int)(shift - 1)) & 1 ? true : false;\
|
s32 v = reg[opcode & 0x0F].I; \
|
||||||
value = rm >> (int)shift; \
|
C_OUT = (v >> (int)(shift - 1)) & 1 ? true : false;\
|
||||||
|
value = v >> (int)shift; \
|
||||||
} else { \
|
} else { \
|
||||||
value = rm; \
|
value = reg[opcode & 0x0F].I; \
|
||||||
} \
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
if (rm & 0x80000000) { \
|
if (reg[opcode & 0x0F].I & 0x80000000) { \
|
||||||
value = 0xFFFFFFFF; \
|
value = 0xFFFFFFFF; \
|
||||||
C_OUT = true; \
|
C_OUT = true; \
|
||||||
} else { \
|
} else { \
|
||||||
|
@ -874,16 +864,13 @@ static void count(u32 opcode, int cond_res)
|
||||||
#ifndef VALUE_ROR_REG_C
|
#ifndef VALUE_ROR_REG_C
|
||||||
#define VALUE_ROR_REG_C \
|
#define VALUE_ROR_REG_C \
|
||||||
unsigned int shift = reg[(opcode >> 8)&15].B.B0; \
|
unsigned int shift = reg[(opcode >> 8)&15].B.B0; \
|
||||||
unsigned int rm = reg[opcode & 0x0F].I; \
|
|
||||||
if(opcode & 0x0F == 15) { \
|
|
||||||
rm += 4; \
|
|
||||||
} \
|
|
||||||
if (LIKELY(shift & 0x1F)) { \
|
if (LIKELY(shift & 0x1F)) { \
|
||||||
C_OUT = (rm >> (shift - 1)) & 1 ? true : false; \
|
u32 v = reg[opcode & 0x0F].I; \
|
||||||
value = ((rm << (32 - shift)) | \
|
C_OUT = (v >> (shift - 1)) & 1 ? true : false; \
|
||||||
(rm >> shift)); \
|
value = ((v << (32 - shift)) | \
|
||||||
|
(v >> shift)); \
|
||||||
} else { \
|
} else { \
|
||||||
value = rm; \
|
value = reg[opcode & 0x0F].I; \
|
||||||
if (shift) \
|
if (shift) \
|
||||||
C_OUT = (value & 0x80000000 ? true : false);\
|
C_OUT = (value & 0x80000000 ? true : false);\
|
||||||
}
|
}
|
||||||
|
@ -966,6 +953,7 @@ static void count(u32 opcode, int cond_res)
|
||||||
#define OP_RSB \
|
#define OP_RSB \
|
||||||
u32 lhs = value; \
|
u32 lhs = value; \
|
||||||
u32 rhs = reg[(opcode>>16)&15].I; \
|
u32 rhs = reg[(opcode>>16)&15].I; \
|
||||||
|
u32 res = lhs - rhs; \
|
||||||
reg[dest].I = res;
|
reg[dest].I = res;
|
||||||
#endif
|
#endif
|
||||||
#ifndef OP_RSBS
|
#ifndef OP_RSBS
|
||||||
|
@ -1003,9 +991,9 @@ static void count(u32 opcode, int cond_res)
|
||||||
#endif
|
#endif
|
||||||
#ifndef OP_RSC
|
#ifndef OP_RSC
|
||||||
#define OP_RSC \
|
#define OP_RSC \
|
||||||
u32 lhs = reg[(opcode>>16)&15].I; \
|
u32 lhs = value; \
|
||||||
u32 rhs = value; \
|
u32 rhs = reg[(opcode>>16)&15].I; \
|
||||||
u32 res = rhs - lhs - !((u32)C_FLAG); \
|
u32 res = lhs - rhs - !((u32)C_FLAG); \
|
||||||
reg[dest].I = res;
|
reg[dest].I = res;
|
||||||
#endif
|
#endif
|
||||||
#ifndef OP_RSCS
|
#ifndef OP_RSCS
|
||||||
|
|
Loading…
Reference in New Issue