Fix re order instructions for quake II with lle graphics

This commit is contained in:
Nicholas 2015-01-25 08:07:38 +11:00
parent cb9d25fc5a
commit 1e1249903d
1 changed files with 8 additions and 0 deletions

View File

@ -34,6 +34,8 @@
#include "opcode.h" #include "opcode.h"
#include "log.h" #include "log.h"
//#define COMPARE_INSTRUCTIONS_VERBOSE
/************************************************************ /************************************************************
** IsOpcodeNop ** IsOpcodeNop
** **
@ -1647,6 +1649,11 @@ BOOL CompareInstructions(DWORD PC, OPCODE * Top, OPCODE * Bottom) {
GetInstructionInfo(PC - 4, Top, &info0); GetInstructionInfo(PC - 4, Top, &info0);
GetInstructionInfo(PC, Bottom, &info1); GetInstructionInfo(PC, Bottom, &info1);
#ifdef COMPARE_INSTRUCTIONS_VERBOSE
CPU_Message("Comparing %s (%X)", RSPOpcodeName ( Top->Hex, PC - 4 ), PC - 4);
CPU_Message("to %s (%X)", RSPOpcodeName ( Bottom->Hex, PC), PC);
#endif
/* usually branches and such */ /* usually branches and such */
if ((info0.flags & InvalidOpcode) != 0) return FALSE; if ((info0.flags & InvalidOpcode) != 0) return FALSE;
if ((info1.flags & InvalidOpcode) != 0) return FALSE; if ((info1.flags & InvalidOpcode) != 0) return FALSE;
@ -1799,6 +1806,7 @@ BOOL CompareInstructions(DWORD PC, OPCODE * Top, OPCODE * Bottom) {
if (info0.SourceReg0 == info1.DestReg) { return FALSE; } if (info0.SourceReg0 == info1.DestReg) { return FALSE; }
if (info0.SourceReg0 == info1.SourceReg0) { return FALSE; } if (info0.SourceReg0 == info1.SourceReg0) { return FALSE; }
if (info0.SourceReg0 == info1.SourceReg1) { return FALSE; } if (info0.SourceReg0 == info1.SourceReg1) { return FALSE; }
if (info0.DestReg == info1.SourceReg0) { return FALSE; }
} else { } else {
CompilerWarning("ReOrder: Unhandled Cop2 than Vector"); CompilerWarning("ReOrder: Unhandled Cop2 than Vector");
} }