Use a typesafe struct for opcodes.

Also, correctly read delayslots using Read_Instruction on ARM.
This commit is contained in:
Unknown W. Brackets committed 2013-08-24 15:36:24 -07:00
1 parent ec46fdd06c
commit 109ad17ac6
41 files changed
+736 -704

No files matched your search

+9 -9
View File
@@ -31,8 +31,8 @@ namespace MIPSCodeUtils
u32 GetJumpTarget(u32 addr)
{
u32 op = Memory::Read_Instruction(addr);
if (op)
MIPSOpcode op = Memory::Read_Instruction(addr);
if (op != 0)
{
MIPSInfo info = MIPSGetInfo(op);
if ((info & IS_JUMP) && (info & IN_IMM26))
@@ -49,8 +49,8 @@ namespace MIPSCodeUtils
u32 GetBranchTarget(u32 addr)
{
u32 op = Memory::Read_Instruction(addr);
if (op)
MIPSOpcode op = Memory::Read_Instruction(addr);
if (op != 0)
{
MIPSInfo info = MIPSGetInfo(op);
if (info & IS_CONDBRANCH)
@@ -66,8 +66,8 @@ namespace MIPSCodeUtils
u32 GetBranchTargetNoRA(u32 addr)
{
u32 op = Memory::Read_Instruction(addr);
if (op)
MIPSOpcode op = Memory::Read_Instruction(addr);
if (op != 0)
{
MIPSInfo info = MIPSGetInfo(op);
if ((info & IS_CONDBRANCH) && !(info & OUT_RA))
@@ -83,8 +83,8 @@ namespace MIPSCodeUtils
u32 GetSureBranchTarget(u32 addr)
{
u32 op = Memory::Read_Instruction(addr);
if (op)
MIPSOpcode op = Memory::Read_Instruction(addr);
if (op != 0)
{
MIPSInfo info = MIPSGetInfo(op);
if (info & IS_CONDBRANCH)
@@ -133,7 +133,7 @@ namespace MIPSCodeUtils
return INVALIDTARGET;
}
bool IsVFPUBranch(u32 op) {
bool IsVFPUBranch(MIPSOpcode op) {
return (MIPSGetInfo(op) & (IS_VFPU | IS_CONDBRANCH)) == (IS_VFPU | IS_CONDBRANCH);
}
}