Optimize LH in RSP Recompiler

Star Wars Battle For Naboo LLE graphics uses unaligned LH
This commit is contained in:
LegendOfDragoon 2015-09-07 13:48:51 -07:00
parent e9c1c23120
commit 48baf1df7c
1 changed files with 9 additions and 2 deletions

View File

@ -655,8 +655,15 @@ void Compile_LH ( void ) {
Addr &= 0xfff; Addr &= 0xfff;
if ((Addr & 1) != 0) { if ((Addr & 1) != 0) {
CompilerWarning("Unaligned LH at constant address PC = %04X", CompilePC); if ((Addr & 2) == 0) {
Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LH,"RSP_Opcode_LH"); CompilerWarning("Unaligned LH at constant address PC = %04X", CompilePC);
Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LH,"RSP_Opcode_LH");
} else {
char Address[32];
sprintf(Address, "Dmem + %Xh", Addr);
MoveSxVariableToX86regHalf(RSPInfo.DMEM + (Addr ^ 2), Address, x86_EAX);
MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt));
}
} else { } else {
char Address[32]; char Address[32];
sprintf(Address, "Dmem + %Xh", Addr); sprintf(Address, "Dmem + %Xh", Addr);