correct SemaphoreExit

This commit is contained in:
purplemarshmallow 2016-03-20 20:06:39 +01:00
parent e09569e9da
commit d46a9bc55a
2 changed files with 5 additions and 7 deletions

View File

@ -318,14 +318,13 @@ void RSP_Cop0_MF (void) {
case 5: RSP_GPR[RSPOpC.rt].UW = *RSPInfo.SP_DMA_FULL_REG; break; case 5: RSP_GPR[RSPOpC.rt].UW = *RSPInfo.SP_DMA_FULL_REG; break;
case 6: RSP_GPR[RSPOpC.rt].UW = *RSPInfo.SP_DMA_BUSY_REG; break; case 6: RSP_GPR[RSPOpC.rt].UW = *RSPInfo.SP_DMA_BUSY_REG; break;
case 7: case 7:
if (AudioHle || GraphicsHle) if (AudioHle || GraphicsHle || SemaphoreExit == 0)
{ {
RSP_GPR[RSPOpC.rt].W = 0; RSP_GPR[RSPOpC.rt].W = 0;
} else { } else {
RSP_GPR[RSPOpC.rt].W = *RSPInfo.SP_SEMAPHORE_REG; RSP_GPR[RSPOpC.rt].W = *RSPInfo.SP_SEMAPHORE_REG;
*RSPInfo.SP_SEMAPHORE_REG = 1; *RSPInfo.SP_SEMAPHORE_REG = 1;
if (SemaphoreExit != 0) RSP_Running = FALSE;
RSP_Running = FALSE;
} }
break; break;
case 8: RSP_GPR[RSPOpC.rt].UW = *RSPInfo.DPC_START_REG ; break; case 8: RSP_GPR[RSPOpC.rt].UW = *RSPInfo.DPC_START_REG ; break;

View File

@ -1683,7 +1683,7 @@ void Compile_Cop0_MF ( void ) {
MoveVariableToX86reg(RSPInfo.SP_STATUS_REG, "SP_STATUS_REG", x86_EAX); MoveVariableToX86reg(RSPInfo.SP_STATUS_REG, "SP_STATUS_REG", x86_EAX);
if (Mfc0Count != 0) { if (Mfc0Count != 0) {
CompConstToX86reg(x86_ECX, Mfc0Count); CompConstToX86reg(x86_ECX, Mfc0Count);
JbLabel8("label", Mfc0Count); JbLabel8("label", 10);
MoveConstToVariable(0, &RSP_Running, "RSP_Running"); MoveConstToVariable(0, &RSP_Running, "RSP_Running");
} }
IncX86reg(x86_ECX); IncX86reg(x86_ECX);
@ -1702,13 +1702,12 @@ void Compile_Cop0_MF ( void ) {
} }
break; break;
case 7: case 7:
if (AudioHle || GraphicsHle) if (AudioHle || GraphicsHle || SemaphoreExit == 0)
{ {
MoveConstToVariable(0, &RSP_GPR[RSPOpC.rt].W, GPR_Name(RSPOpC.rt)); MoveConstToVariable(0, &RSP_GPR[RSPOpC.rt].W, GPR_Name(RSPOpC.rt));
} else { } else {
MoveVariableToX86reg(RSPInfo.SP_SEMAPHORE_REG, "SP_SEMAPHORE_REG", x86_EAX); MoveVariableToX86reg(RSPInfo.SP_SEMAPHORE_REG, "SP_SEMAPHORE_REG", x86_EAX);
if (SemaphoreExit != 0) MoveConstToVariable(0, &RSP_Running, "RSP_Running");
MoveConstToVariable(0, &RSP_Running, "RSP_Running");
MoveConstToVariable(1, RSPInfo.SP_SEMAPHORE_REG, "SP_SEMAPHORE_REG"); MoveConstToVariable(1, RSPInfo.SP_SEMAPHORE_REG, "SP_SEMAPHORE_REG");
MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].W, GPR_Name(RSPOpC.rt)); MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].W, GPR_Name(RSPOpC.rt));
if (NextInstruction == NORMAL) if (NextInstruction == NORMAL)