[RSP] junk trailing whitespace cleanups

This commit is contained in:
unknown 2015-06-19 13:09:24 -04:00
parent debcb502a0
commit fcfad37360
12 changed files with 167 additions and 168 deletions

View File

@ -167,7 +167,7 @@ void Build_RSP ( void )
BYTE Temp; BYTE Temp;
Temp = Indx[i].B[count]; Temp = Indx[i].B[count];
Indx[i].B[count] = Indx[i].B[7 - count]; Indx[i].B[count] = Indx[i].B[7 - count];
Indx[i].B[7 - count] = Temp; Indx[i].B[7 - count] = Temp;
} }
} }
@ -200,7 +200,7 @@ __declspec(dllexport) DWORD DoRspCycles ( DWORD Cycles )
/* if (*RSPInfo.SP_STATUS_REG & SP_STATUS_SIG0) /* if (*RSPInfo.SP_STATUS_REG & SP_STATUS_SIG0)
{ {
*RSPInfo.SP_STATUS_REG &= ~SP_STATUS_SIG0; *RSPInfo.SP_STATUS_REG &= ~SP_STATUS_SIG0;
*RSPInfo.MI_INTR_REG |= MI_INTR_SP; *RSPInfo.MI_INTR_REG |= MI_INTR_SP;
RSPInfo.CheckInterrupts(); RSPInfo.CheckInterrupts();
return Cycles; return Cycles;
} }

View File

@ -432,7 +432,7 @@ DWORD RunInterpreterCPU(DWORD Cycles) {
SetRSPCommandViewto( *PrgCount ); SetRSPCommandViewto( *PrgCount );
UpdateRSPRegistersScreen(); UpdateRSPRegistersScreen();
while ( WaitingForStep == TRUE ){ while ( WaitingForStep == TRUE ){
Sleep(20); Sleep(20);
if (!Stepping_Commands) { if (!Stepping_Commands) {
WaitingForStep = FALSE; WaitingForStep = FALSE;
} }
@ -448,22 +448,22 @@ DWORD RunInterpreterCPU(DWORD Cycles) {
switch (RSP_NextInstruction) { switch (RSP_NextInstruction) {
case NORMAL: case NORMAL:
*PrgCount = (*PrgCount + 4) & 0xFFC; *PrgCount = (*PrgCount + 4) & 0xFFC;
break; break;
case DELAY_SLOT: case DELAY_SLOT:
RSP_NextInstruction = JUMP; RSP_NextInstruction = JUMP;
*PrgCount = (*PrgCount + 4) & 0xFFC; *PrgCount = (*PrgCount + 4) & 0xFFC;
break; break;
case JUMP: case JUMP:
RSP_NextInstruction = NORMAL; RSP_NextInstruction = NORMAL;
*PrgCount = RSP_JumpTo; *PrgCount = RSP_JumpTo;
break; break;
case SINGLE_STEP: case SINGLE_STEP:
*PrgCount = (*PrgCount + 4) & 0xFFC; *PrgCount = (*PrgCount + 4) & 0xFFC;
RSP_NextInstruction = SINGLE_STEP_DONE; RSP_NextInstruction = SINGLE_STEP_DONE;
break; break;
case SINGLE_STEP_DONE: case SINGLE_STEP_DONE:
*PrgCount = (*PrgCount + 4) & 0xFFC; *PrgCount = (*PrgCount + 4) & 0xFFC;
*RSPInfo.SP_STATUS_REG |= SP_STATUS_HALT; *RSPInfo.SP_STATUS_REG |= SP_STATUS_HALT;
RSP_Running = FALSE; RSP_Running = FALSE;
break; break;
@ -471,4 +471,3 @@ DWORD RunInterpreterCPU(DWORD Cycles) {
} }
return Cycles; return Cycles;
} }

View File

@ -340,7 +340,7 @@ void RSP_Cop0_MF (void) {
case 1: RSP_GPR[RSPOpC.rt].UW = *RSPInfo.SP_DRAM_ADDR_REG; break; case 1: RSP_GPR[RSPOpC.rt].UW = *RSPInfo.SP_DRAM_ADDR_REG; break;
case 4: case 4:
RSP_MfStatusCount += 1; RSP_MfStatusCount += 1;
RSP_GPR[RSPOpC.rt].UW = *RSPInfo.SP_STATUS_REG; RSP_GPR[RSPOpC.rt].UW = *RSPInfo.SP_STATUS_REG;
if (RSP_MfStatusCount > 10) if (RSP_MfStatusCount > 10)
{ {
RSP_Running = FALSE; RSP_Running = FALSE;
@ -377,12 +377,12 @@ void RSP_Cop0_MT (void) {
case 0: *RSPInfo.SP_MEM_ADDR_REG = RSP_GPR[RSPOpC.rt].UW; break; case 0: *RSPInfo.SP_MEM_ADDR_REG = RSP_GPR[RSPOpC.rt].UW; break;
case 1: *RSPInfo.SP_DRAM_ADDR_REG = RSP_GPR[RSPOpC.rt].UW; break; case 1: *RSPInfo.SP_DRAM_ADDR_REG = RSP_GPR[RSPOpC.rt].UW; break;
case 2: case 2:
*RSPInfo.SP_RD_LEN_REG = RSP_GPR[RSPOpC.rt].UW; *RSPInfo.SP_RD_LEN_REG = RSP_GPR[RSPOpC.rt].UW;
SP_DMA_READ(); SP_DMA_READ();
break; break;
case 3: case 3:
*RSPInfo.SP_WR_LEN_REG = RSP_GPR[RSPOpC.rt].UW; *RSPInfo.SP_WR_LEN_REG = RSP_GPR[RSPOpC.rt].UW;
SP_DMA_WRITE(); SP_DMA_WRITE();
break; break;
case 4: case 4:
if ( ( RSP_GPR[RSPOpC.rt].W & SP_CLR_HALT ) != 0) { *RSPInfo.SP_STATUS_REG &= ~SP_STATUS_HALT; } if ( ( RSP_GPR[RSPOpC.rt].W & SP_CLR_HALT ) != 0) { *RSPInfo.SP_STATUS_REG &= ~SP_STATUS_HALT; }
@ -397,7 +397,7 @@ void RSP_Cop0_MT (void) {
} }
if ( ( RSP_GPR[RSPOpC.rt].W & SP_CLR_SSTEP ) != 0) if ( ( RSP_GPR[RSPOpC.rt].W & SP_CLR_SSTEP ) != 0)
{ {
*RSPInfo.SP_STATUS_REG &= ~SP_STATUS_SSTEP; *RSPInfo.SP_STATUS_REG &= ~SP_STATUS_SSTEP;
} }
if ( ( RSP_GPR[RSPOpC.rt].W & SP_SET_SSTEP ) != 0) if ( ( RSP_GPR[RSPOpC.rt].W & SP_SET_SSTEP ) != 0)
{ {
@ -425,11 +425,11 @@ void RSP_Cop0_MT (void) {
break; break;
case 7: *RSPInfo.SP_SEMAPHORE_REG = 0; break; case 7: *RSPInfo.SP_SEMAPHORE_REG = 0; break;
case 8: case 8:
*RSPInfo.DPC_START_REG = RSP_GPR[RSPOpC.rt].UW; *RSPInfo.DPC_START_REG = RSP_GPR[RSPOpC.rt].UW;
*RSPInfo.DPC_CURRENT_REG = RSP_GPR[RSPOpC.rt].UW; *RSPInfo.DPC_CURRENT_REG = RSP_GPR[RSPOpC.rt].UW;
break; break;
case 9: case 9:
*RSPInfo.DPC_END_REG = RSP_GPR[RSPOpC.rt].UW; *RSPInfo.DPC_END_REG = RSP_GPR[RSPOpC.rt].UW;
RDP_LogDlist(); RDP_LogDlist();
if (RSPInfo.ProcessRdpList != NULL) { RSPInfo.ProcessRdpList(); } if (RSPInfo.ProcessRdpList != NULL) { RSPInfo.ProcessRdpList(); }
break; break;
@ -499,7 +499,7 @@ void RSP_Vector_VMULF (void) {
del = EleSpec[RSPOpC.rs].B[el]; del = EleSpec[RSPOpC.rs].B[el];
if (RSP_Vect[RSPOpC.rd].UHW[el] != 0x8000 || RSP_Vect[RSPOpC.rt].UHW[del] != 0x8000) { if (RSP_Vect[RSPOpC.rd].UHW[el] != 0x8000 || RSP_Vect[RSPOpC.rt].UHW[del] != 0x8000) {
temp.W = ((long)RSP_Vect[RSPOpC.rd].HW[el] * (long)RSP_Vect[RSPOpC.rt].HW[del]) << 1; temp.W = ((long)RSP_Vect[RSPOpC.rd].HW[el] * (long)RSP_Vect[RSPOpC.rt].HW[del]) << 1;
temp.UW += 0x8000; temp.UW += 0x8000;
RSP_ACCUM[el].HW[2] = temp.HW[1]; RSP_ACCUM[el].HW[2] = temp.HW[1];
RSP_ACCUM[el].HW[1] = temp.HW[0]; RSP_ACCUM[el].HW[1] = temp.HW[0];
@ -510,7 +510,7 @@ void RSP_Vector_VMULF (void) {
} }
result.HW[el] = RSP_ACCUM[el].HW[2]; result.HW[el] = RSP_ACCUM[el].HW[2];
} else { } else {
temp.W = 0x80000000; temp.W = 0x80000000;
RSP_ACCUM[el].UHW[3] = 0; RSP_ACCUM[el].UHW[3] = 0;
RSP_ACCUM[el].UHW[2] = 0x8000; RSP_ACCUM[el].UHW[2] = 0x8000;
RSP_ACCUM[el].UHW[1] = 0x8000; RSP_ACCUM[el].UHW[1] = 0x8000;
@ -550,7 +550,7 @@ void RSP_Vector_VMUDL (void) {
temp.UW = (DWORD)RSP_Vect[RSPOpC.rd].UHW[el] * (DWORD)RSP_Vect[RSPOpC.rt].UHW[del]; temp.UW = (DWORD)RSP_Vect[RSPOpC.rd].UHW[el] * (DWORD)RSP_Vect[RSPOpC.rt].UHW[del];
RSP_ACCUM[el].W[1] = 0; RSP_ACCUM[el].W[1] = 0;
RSP_ACCUM[el].HW[1] = temp.HW[1]; RSP_ACCUM[el].HW[1] = temp.HW[1];
result.HW[el] = RSP_ACCUM[el].HW[1]; result.HW[el] = RSP_ACCUM[el].HW[1];
} }
RSP_Vect[RSPOpC.sa] = result; RSP_Vect[RSPOpC.sa] = result;
} }
@ -604,7 +604,7 @@ void RSP_Vector_VMUDH (void) {
for (el = 0; el < 8; el ++ ) { for (el = 0; el < 8; el ++ ) {
del = EleSpec[RSPOpC.rs].B[el]; del = EleSpec[RSPOpC.rs].B[el];
RSP_ACCUM[el].W[1] = (long)RSP_Vect[RSPOpC.rd].HW[el] * (long)RSP_Vect[RSPOpC.rt].HW[del]; RSP_ACCUM[el].W[1] = (long)RSP_Vect[RSPOpC.rd].HW[el] * (long)RSP_Vect[RSPOpC.rt].HW[del];
RSP_ACCUM[el].HW[1] = 0; RSP_ACCUM[el].HW[1] = 0;
if (RSP_ACCUM[el].HW[3] < 0) { if (RSP_ACCUM[el].HW[3] < 0) {
if (RSP_ACCUM[el].UHW[3] != 0xFFFF) { if (RSP_ACCUM[el].UHW[3] != 0xFFFF) {
@ -694,10 +694,10 @@ void RSP_Vector_VMACU (void) {
result.HW[el] = 0; result.HW[el] = 0;
} else { } else {
if (RSP_ACCUM[el].UHW[3] != 0) { if (RSP_ACCUM[el].UHW[3] != 0) {
result.UHW[el] = 0xFFFF; result.UHW[el] = 0xFFFF;
} else { } else {
if (RSP_ACCUM[el].HW[2] < 0) { if (RSP_ACCUM[el].HW[2] < 0) {
result.UHW[el] = 0xFFFF; result.UHW[el] = 0xFFFF;
} else { } else {
result.HW[el] = RSP_ACCUM[el].HW[2]; result.HW[el] = RSP_ACCUM[el].HW[2];
} }
@ -776,10 +776,10 @@ void RSP_Vector_VMADL (void) {
} }
} else { } else {
if (RSP_ACCUM[el].UHW[3] != 0) { if (RSP_ACCUM[el].UHW[3] != 0) {
result.UHW[el] = 0xFFFF; result.UHW[el] = 0xFFFF;
} else { } else {
if (RSP_ACCUM[el].HW[2] < 0) { if (RSP_ACCUM[el].HW[2] < 0) {
result.UHW[el] = 0xFFFF; result.UHW[el] = 0xFFFF;
} else { } else {
result.HW[el] = RSP_ACCUM[el].HW[1]; result.HW[el] = RSP_ACCUM[el].HW[1];
} }
@ -804,7 +804,7 @@ void RSP_Vector_VMADM (void) {
RSP_ACCUM[el].HW[2] = temp2.HW[0]; RSP_ACCUM[el].HW[2] = temp2.HW[0];
RSP_ACCUM[el].HW[3] += temp2.HW[1]; RSP_ACCUM[el].HW[3] += temp2.HW[1];
if (temp.W < 0) { if (temp.W < 0) {
RSP_ACCUM[el].HW[3] -= 1; RSP_ACCUM[el].HW[3] -= 1;
} }
if (RSP_ACCUM[el].HW[3] < 0) { if (RSP_ACCUM[el].HW[3] < 0) {
if (RSP_ACCUM[el].UHW[3] != 0xFFFF) { if (RSP_ACCUM[el].UHW[3] != 0xFFFF) {
@ -847,7 +847,7 @@ void RSP_Vector_VMADN (void) {
RSP_ACCUM[el].HW[2] = temp2.HW[0]; RSP_ACCUM[el].HW[2] = temp2.HW[0];
RSP_ACCUM[el].HW[3] += temp2.HW[1]; RSP_ACCUM[el].HW[3] += temp2.HW[1];
if (temp.W < 0) { if (temp.W < 0) {
RSP_ACCUM[el].HW[3] -= 1; RSP_ACCUM[el].HW[3] -= 1;
} }
if (RSP_ACCUM[el].HW[3] < 0) { if (RSP_ACCUM[el].HW[3] < 0) {
if (RSP_ACCUM[el].UHW[3] != 0xFFFF) { if (RSP_ACCUM[el].UHW[3] != 0xFFFF) {
@ -881,7 +881,7 @@ void RSP_Vector_VMADH (void) {
for (el = 0; el < 8; el ++ ) { for (el = 0; el < 8; el ++ ) {
del = EleSpec[RSPOpC.rs].B[el]; del = EleSpec[RSPOpC.rs].B[el];
RSP_ACCUM[el].W[1] += (long)RSP_Vect[RSPOpC.rd].HW[el] * (long)RSP_Vect[RSPOpC.rt].HW[del]; RSP_ACCUM[el].W[1] += (long)RSP_Vect[RSPOpC.rd].HW[el] * (long)RSP_Vect[RSPOpC.rt].HW[del];
if (RSP_ACCUM[el].HW[3] < 0) { if (RSP_ACCUM[el].HW[3] < 0) {
if (RSP_ACCUM[el].UHW[3] != 0xFFFF) { if (RSP_ACCUM[el].UHW[3] != 0xFFFF) {
result.HW[el] = (WORD)0x8000; result.HW[el] = (WORD)0x8000;
@ -911,7 +911,7 @@ void RSP_Vector_VADD (void) {
int el, del; int el, del;
UWORD32 temp; UWORD32 temp;
VECTOR result = {0}; VECTOR result = {0};
for ( el = 0; el < 8; el++ ) { for ( el = 0; el < 8; el++ ) {
del = EleSpec[RSPOpC.rs].B[el]; del = EleSpec[RSPOpC.rs].B[el];
@ -940,7 +940,7 @@ void RSP_Vector_VSUB (void) {
int el, del; int el, del;
UWORD32 temp; UWORD32 temp;
VECTOR result = {0}; VECTOR result = {0};
for ( el = 0; el < 8; el++ ) { for ( el = 0; el < 8; el++ ) {
del = EleSpec[RSPOpC.rs].B[el]; del = EleSpec[RSPOpC.rs].B[el];
@ -992,7 +992,7 @@ void RSP_Vector_VADDC (void) {
int el, del; int el, del;
UWORD32 temp; UWORD32 temp;
VECTOR result = {0}; VECTOR result = {0};
RSP_Flags[0].UW = 0; RSP_Flags[0].UW = 0;
for ( el = 0; el < 8; el++ ) { for ( el = 0; el < 8; el++ ) {
del = EleSpec[RSPOpC.rs].B[el]; del = EleSpec[RSPOpC.rs].B[el];
@ -1011,7 +1011,7 @@ void RSP_Vector_VSUBC (void) {
int el, del; int el, del;
UWORD32 temp; UWORD32 temp;
VECTOR result = {0}; VECTOR result = {0};
RSP_Flags[0].UW = 0x0; RSP_Flags[0].UW = 0x0;
for ( el = 0; el < 8; el++ ) { for ( el = 0; el < 8; el++ ) {
del = EleSpec[RSPOpC.rs].B[el]; del = EleSpec[RSPOpC.rs].B[el];
@ -1073,7 +1073,7 @@ void RSP_Vector_VSAW (void) {
void RSP_Vector_VLT (void) { void RSP_Vector_VLT (void) {
int el, del; int el, del;
VECTOR result = {0}; VECTOR result = {0};
RSP_Flags[1].UW = 0; RSP_Flags[1].UW = 0;
for ( el = 0; el < 8; el++ ) { for ( el = 0; el < 8; el++ ) {
del = EleSpec[RSPOpC.rs].B[el]; del = EleSpec[RSPOpC.rs].B[el];
@ -1092,7 +1092,7 @@ void RSP_Vector_VLT (void) {
RSP_Flags[1].UW &= ~( 1 << (7 - el) ); RSP_Flags[1].UW &= ~( 1 << (7 - el) );
} }
} }
RSP_ACCUM[el].HW[1] = result.HW[el]; RSP_ACCUM[el].HW[1] = result.HW[el];
} }
RSP_Flags[0].UW = 0; RSP_Flags[0].UW = 0;
RSP_Vect[RSPOpC.sa] = result; RSP_Vect[RSPOpC.sa] = result;
@ -1101,7 +1101,7 @@ void RSP_Vector_VLT (void) {
void RSP_Vector_VEQ (void) { void RSP_Vector_VEQ (void) {
int el, del; int el, del;
VECTOR result = {0}; VECTOR result = {0};
RSP_Flags[1].UW = 0; RSP_Flags[1].UW = 0;
for ( el = 0; el < 8; el++ ) { for ( el = 0; el < 8; el++ ) {
del = EleSpec[RSPOpC.rs].B[el]; del = EleSpec[RSPOpC.rs].B[el];
@ -1112,7 +1112,7 @@ void RSP_Vector_VEQ (void) {
} }
} }
result.HW[el] = RSP_Vect[RSPOpC.rt].UHW[del]; result.HW[el] = RSP_Vect[RSPOpC.rt].UHW[del];
RSP_ACCUM[el].HW[1] = RSP_Vect[RSPOpC.rt].UHW[del]; RSP_ACCUM[el].HW[1] = RSP_Vect[RSPOpC.rt].UHW[del];
} }
RSP_Flags[0].UW = 0; RSP_Flags[0].UW = 0;
RSP_Vect[RSPOpC.sa] = result; RSP_Vect[RSPOpC.sa] = result;
@ -1121,7 +1121,7 @@ void RSP_Vector_VEQ (void) {
void RSP_Vector_VNE (void) { void RSP_Vector_VNE (void) {
int el, del; int el, del;
VECTOR result = {0}; VECTOR result = {0};
RSP_Flags[1].UW = 0; RSP_Flags[1].UW = 0;
for ( el = 0; el < 8; el++ ) { for ( el = 0; el < 8; el++ ) {
del = EleSpec[RSPOpC.rs].B[el]; del = EleSpec[RSPOpC.rs].B[el];
@ -1134,7 +1134,7 @@ void RSP_Vector_VNE (void) {
} }
} }
result.HW[el] = RSP_Vect[RSPOpC.rd].UHW[el]; result.HW[el] = RSP_Vect[RSPOpC.rd].UHW[el];
RSP_ACCUM[el].HW[1] = RSP_Vect[RSPOpC.rd].UHW[el]; RSP_ACCUM[el].HW[1] = RSP_Vect[RSPOpC.rd].UHW[el];
} }
RSP_Flags[0].UW = 0; RSP_Flags[0].UW = 0;
RSP_Vect[RSPOpC.sa] = result; RSP_Vect[RSPOpC.sa] = result;
@ -1143,7 +1143,7 @@ void RSP_Vector_VNE (void) {
void RSP_Vector_VGE (void) { void RSP_Vector_VGE (void) {
int el, del; int el, del;
VECTOR result = {0}; VECTOR result = {0};
RSP_Flags[1].UW = 0; RSP_Flags[1].UW = 0;
for ( el = 0; el < 8; el++ ) { for ( el = 0; el < 8; el++ ) {
del = EleSpec[RSPOpC.rs].B[el]; del = EleSpec[RSPOpC.rs].B[el];
@ -1162,7 +1162,7 @@ void RSP_Vector_VGE (void) {
result.HW[el] = RSP_Vect[RSPOpC.rt].UHW[del]; result.HW[el] = RSP_Vect[RSPOpC.rt].UHW[del];
RSP_Flags[1].UW &= ~( 1 << (7 - el) ); RSP_Flags[1].UW &= ~( 1 << (7 - el) );
} }
RSP_ACCUM[el].HW[1] = result.HW[el]; RSP_ACCUM[el].HW[1] = result.HW[el];
} }
RSP_Flags[0].UW = 0; RSP_Flags[0].UW = 0;
RSP_Vect[RSPOpC.sa] = result; RSP_Vect[RSPOpC.sa] = result;
@ -1228,7 +1228,7 @@ void RSP_Vector_VCL (void) {
void RSP_Vector_VCH (void) { void RSP_Vector_VCH (void) {
int el, del; int el, del;
VECTOR result = {0}; VECTOR result = {0};
RSP_Flags[0].UW = 0; RSP_Flags[0].UW = 0;
RSP_Flags[1].UW = 0; RSP_Flags[1].UW = 0;
RSP_Flags[2].UW = 0; RSP_Flags[2].UW = 0;
@ -1445,7 +1445,7 @@ void RSP_Vector_VRCP (void) {
void RSP_Vector_VRCPL (void) { void RSP_Vector_VRCPL (void) {
int count, neg; int count, neg;
RecpResult.UW = RSP_Vect[RSPOpC.rt].UHW[EleSpec[RSPOpC.rs].B[(RSPOpC.rd & 0x7)]] | Recp.W; RecpResult.UW = RSP_Vect[RSPOpC.rt].UHW[EleSpec[RSPOpC.rs].B[(RSPOpC.rd & 0x7)]] | Recp.W;
if (RecpResult.UW == 0) { if (RecpResult.UW == 0) {
RecpResult.UW = 0x7FFFFFFF; RecpResult.UW = 0x7FFFFFFF;
@ -1500,10 +1500,10 @@ void RSP_Vector_VRCPH (void) {
void RSP_Vector_VMOV (void) { void RSP_Vector_VMOV (void) {
int count; int count;
for ( count = 0; count < 8; count++ ) { for ( count = 0; count < 8; count++ ) {
RSP_ACCUM[count].HW[1] = RSP_Vect[RSPOpC.rt].UHW[EleSpec[RSPOpC.rs].B[count]]; RSP_ACCUM[count].HW[1] = RSP_Vect[RSPOpC.rt].UHW[EleSpec[RSPOpC.rs].B[count]];
} }
RSP_Vect[RSPOpC.sa].UHW[7 - (RSPOpC.rd & 0x7)] = RSP_Vect[RSPOpC.sa].UHW[7 - (RSPOpC.rd & 0x7)] =
RSP_Vect[RSPOpC.rt].UHW[EleSpec[RSPOpC.rs].B[(RSPOpC.rd & 0x7)]]; RSP_Vect[RSPOpC.rt].UHW[EleSpec[RSPOpC.rs].B[(RSPOpC.rd & 0x7)]];
} }
@ -1553,7 +1553,7 @@ void RSP_Vector_VRSQ (void) {
void RSP_Vector_VRSQL (void) { void RSP_Vector_VRSQL (void) {
int count, neg; int count, neg;
SQrootResult.UW = RSP_Vect[RSPOpC.rt].UHW[EleSpec[RSPOpC.rs].B[(RSPOpC.rd & 0x7)]] | SQroot.W; SQrootResult.UW = RSP_Vect[RSPOpC.rt].UHW[EleSpec[RSPOpC.rs].B[(RSPOpC.rd & 0x7)]] | SQroot.W;
if (SQrootResult.UW == 0) { if (SQrootResult.UW == 0) {
SQrootResult.UW = 0x7FFFFFFF; SQrootResult.UW = 0x7FFFFFFF;
@ -1738,7 +1738,7 @@ void rsp_UnknownOpcode (void) {
} else { } else {
sprintf(Message,"Unhandled Opcode\n%s\n\nStoping Emulation!\n\nDo you wish to enter the debugger ?", sprintf(Message,"Unhandled Opcode\n%s\n\nStoping Emulation!\n\nDo you wish to enter the debugger ?",
RSPOpcodeName(RSPOpC.Hex,*PrgCount)); RSPOpcodeName(RSPOpC.Hex,*PrgCount));
response = MessageBox(NULL,Message,"Error", MB_YESNO | MB_ICONERROR ); response = MessageBox(NULL,Message,"Error", MB_YESNO | MB_ICONERROR);
if (response == IDYES) { if (response == IDYES) {
Enter_RSP_Commands_Window (); Enter_RSP_Commands_Window ();
} }

View File

@ -91,7 +91,7 @@ void Create_RSP_Commands_Window ( int Child )
{ {
Stepping_Commands = TRUE; Stepping_Commands = TRUE;
CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)Create_RSP_Commands_Window, CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)Create_RSP_Commands_Window,
(LPVOID)TRUE,0, &ThreadID); (LPVOID)TRUE,0, &ThreadID);
} }
else else
{ {
@ -129,7 +129,7 @@ int DisplayRSPCommand (DWORD location, int InsertPos)
{ {
uint32_t OpCode; uint32_t OpCode;
DWORD LinesUsed = 1, status; DWORD LinesUsed = 1, status;
BOOL Redraw = FALSE; BOOL Redraw = FALSE;
RSP_LW_IMEM(location, &OpCode); RSP_LW_IMEM(location, &OpCode);
@ -148,12 +148,12 @@ int DisplayRSPCommand (DWORD location, int InsertPos)
RSPOpcodeName ( OpCode, location )); RSPOpcodeName ( OpCode, location ));
if ( SendMessage(hList,LB_GETCOUNT,0,0) <= InsertPos) if ( SendMessage(hList,LB_GETCOUNT,0,0) <= InsertPos)
{ {
SendMessage(hList,LB_INSERTSTRING,(WPARAM)InsertPos, (LPARAM)location); SendMessage(hList,LB_INSERTSTRING,(WPARAM)InsertPos, (LPARAM)location);
} }
else else
{ {
RECT ItemRC; RECT ItemRC;
SendMessage(hList,LB_GETITEMRECT,(WPARAM)InsertPos, (LPARAM)&ItemRC); SendMessage(hList,LB_GETITEMRECT,(WPARAM)InsertPos, (LPARAM)&ItemRC);
RedrawWindow(hList,&ItemRC,NULL, RDW_INVALIDATE ); RedrawWindow(hList,&ItemRC,NULL, RDW_INVALIDATE );
} }
} }
@ -305,21 +305,21 @@ void DrawRSPCommand ( LPARAM lParam )
} }
} }
FillRect( ditem->hDC, &ditem->rcItem,hBrush); FillRect( ditem->hDC, &ditem->rcItem,hBrush);
SetBkMode( ditem->hDC, TRANSPARENT ); SetBkMode( ditem->hDC, TRANSPARENT );
if (strlen (Command) == 0 ) if (strlen (Command) == 0 )
{ {
SetRect(&TextRect,ditem->rcItem.left,ditem->rcItem.top, ditem->rcItem.left + 83, SetRect(&TextRect,ditem->rcItem.left,ditem->rcItem.top, ditem->rcItem.left + 83,
ditem->rcItem.bottom); ditem->rcItem.bottom);
DrawText(ditem->hDC,Offset,strlen(Offset), &TextRect,DT_SINGLELINE | DT_VCENTER); DrawText(ditem->hDC,Offset,strlen(Offset), &TextRect,DT_SINGLELINE | DT_VCENTER);
SetRect(&TextRect,ditem->rcItem.left + 83,ditem->rcItem.top, ditem->rcItem.left + 165, SetRect(&TextRect,ditem->rcItem.left + 83,ditem->rcItem.top, ditem->rcItem.left + 165,
ditem->rcItem.bottom); ditem->rcItem.bottom);
DrawText(ditem->hDC,Instruction,strlen(Instruction), &TextRect,DT_SINGLELINE | DT_VCENTER); DrawText(ditem->hDC,Instruction,strlen(Instruction), &TextRect,DT_SINGLELINE | DT_VCENTER);
SetRect(&TextRect,ditem->rcItem.left + 165,ditem->rcItem.top, ditem->rcItem.right, SetRect(&TextRect,ditem->rcItem.left + 165,ditem->rcItem.top, ditem->rcItem.right,
ditem->rcItem.bottom); ditem->rcItem.bottom);
DrawText(ditem->hDC,Arguments,strlen(Arguments), &TextRect,DT_SINGLELINE | DT_VCENTER); DrawText(ditem->hDC,Arguments,strlen(Arguments), &TextRect,DT_SINGLELINE | DT_VCENTER);
} }
else else
@ -358,7 +358,7 @@ void Enable_RSP_Commands_Window ( void )
si.nMax = (0x1000 >> 2) -1; si.nMax = (0x1000 >> 2) -1;
si.nPos = (*PrgCount >> 2); si.nPos = (*PrgCount >> 2);
si.nPage = 30; si.nPage = 30;
SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE);
SetRSPCommandViewto( *PrgCount ); SetRSPCommandViewto( *PrgCount );
SetForegroundWindow(RSPCommandshWnd); SetForegroundWindow(RSPCommandshWnd);
@ -469,8 +469,8 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
if (HIWORD(wParam) == LBN_DBLCLK ) if (HIWORD(wParam) == LBN_DBLCLK )
{ {
DWORD Location, Selected; DWORD Location, Selected;
Selected = SendMessage(hList,LB_GETCURSEL,(WPARAM)0, (LPARAM)0); Selected = SendMessage(hList,LB_GETCURSEL,(WPARAM)0, (LPARAM)0);
Location = RSPCommandLine[Selected].Location; Location = RSPCommandLine[Selected].Location;
if (Location != (DWORD)-1) if (Location != (DWORD)-1)
{ {
if (CheckForRSPBPoint(Location)) if (CheckForRSPBPoint(Location))
@ -507,7 +507,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
case IDC_BP_BUTTON: case IDC_BP_BUTTON:
if (DebugInfo.Enter_BPoint_Window != NULL) if (DebugInfo.Enter_BPoint_Window != NULL)
{ {
DebugInfo.Enter_BPoint_Window(); DebugInfo.Enter_BPoint_Window();
} }
break; break;
case IDC_RSP_REGISTERS_BUTTON: case IDC_RSP_REGISTERS_BUTTON:
@ -516,19 +516,19 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
case IDC_R4300I_DEBUGGER_BUTTON: case IDC_R4300I_DEBUGGER_BUTTON:
if (DebugInfo.Enter_R4300i_Commands_Window != NULL) if (DebugInfo.Enter_R4300i_Commands_Window != NULL)
{ {
DebugInfo.Enter_R4300i_Commands_Window(); DebugInfo.Enter_R4300i_Commands_Window();
} }
break; break;
case IDC_R4300I_REGISTERS_BUTTON: case IDC_R4300I_REGISTERS_BUTTON:
if (DebugInfo.Enter_R4300i_Register_Window != NULL) if (DebugInfo.Enter_R4300i_Register_Window != NULL)
{ {
DebugInfo.Enter_R4300i_Register_Window(); DebugInfo.Enter_R4300i_Register_Window();
} }
break; break;
case IDC_MEMORY_BUTTON: case IDC_MEMORY_BUTTON:
if (DebugInfo.Enter_Memory_Window != NULL) if (DebugInfo.Enter_Memory_Window != NULL)
{ {
DebugInfo.Enter_Memory_Window(); DebugInfo.Enter_Memory_Window();
} }
break; break;
case IDCANCEL: case IDCANCEL:
@ -551,7 +551,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
case SB_THUMBTRACK: case SB_THUMBTRACK:
sprintf(Value,"%03X",((short int)HIWORD(wParam) << 2 )); sprintf(Value,"%03X",((short int)HIWORD(wParam) << 2 ));
SetWindowText(hAddress,Value); SetWindowText(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = (short int)HIWORD(wParam); si.nPos = (short int)HIWORD(wParam);
SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE);
@ -561,7 +561,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
{ {
sprintf(Value,"%03X",location + 0x4); sprintf(Value,"%03X",location + 0x4);
SetWindowText(hAddress,Value); SetWindowText(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = ((location + 0x4) >> 2); si.nPos = ((location + 0x4) >> 2);
SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE);
@ -570,7 +570,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
{ {
sprintf(Value,"%03X",0xF88); sprintf(Value,"%03X",0xF88);
SetWindowText(hAddress,Value); SetWindowText(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = (0xFFC >> 2); si.nPos = (0xFFC >> 2);
SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE);
@ -581,7 +581,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
{ {
sprintf(Value,"%03X",location - 0x4); sprintf(Value,"%03X",location - 0x4);
SetWindowText(hAddress,Value); SetWindowText(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = ((location - 0x4) >> 2); si.nPos = ((location - 0x4) >> 2);
SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE);
@ -590,7 +590,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
{ {
sprintf(Value,"%03X",0); sprintf(Value,"%03X",0);
SetWindowText(hAddress,Value); SetWindowText(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = 0; si.nPos = 0;
SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE);
@ -601,7 +601,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
{ {
sprintf(Value,"%03X",location + 0x74); sprintf(Value,"%03X",location + 0x74);
SetWindowText(hAddress,Value); SetWindowText(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = ((location + 0x74) >> 2); si.nPos = ((location + 0x74) >> 2);
SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE);
@ -610,18 +610,18 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
{ {
sprintf(Value,"%03X",0xF88); sprintf(Value,"%03X",0xF88);
SetWindowText(hAddress,Value); SetWindowText(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = (0xF8F >> 2); si.nPos = (0xF8F >> 2);
SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE);
} }
break; break;
case SB_PAGEUP: case SB_PAGEUP:
if ((location - 0x74) > 0x74 ) if ((location - 0x74) > 0x74 )
{ {
sprintf(Value,"%03X",location - 0x74); sprintf(Value,"%03X",location - 0x74);
SetWindowText(hAddress,Value); SetWindowText(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = ((location - 0x74) >> 2); si.nPos = ((location - 0x74) >> 2);
SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE);
@ -630,7 +630,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
{ {
sprintf(Value,"%03X",0); sprintf(Value,"%03X",0);
SetWindowText(hAddress,Value); SetWindowText(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = 0; si.nPos = 0;
SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE);
@ -672,7 +672,7 @@ void RSP_Commands_Setup ( HWND hDlg )
hFunctionlist = CreateWindowEx(0,"COMBOBOX","", WS_CHILD | WS_VSCROLL | hFunctionlist = CreateWindowEx(0,"COMBOBOX","", WS_CHILD | WS_VSCROLL |
CBS_DROPDOWNLIST | CBS_SORT | WS_TABSTOP,352,56,89,150,hDlg, CBS_DROPDOWNLIST | CBS_SORT | WS_TABSTOP,352,56,89,150,hDlg,
(HMENU)IDC_FUNCTION_COMBO,hinstDLL,NULL); (HMENU)IDC_FUNCTION_COMBO,hinstDLL,NULL);
if (hFunctionlist) if (hFunctionlist)
{ {
SendMessage(hFunctionlist,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); SendMessage(hFunctionlist,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);

View File

@ -83,7 +83,7 @@ void Create_RSP_Register_Window ( int Child ) {
} else { } else {
if (!InRSPRegisterWindow) { if (!InRSPRegisterWindow) {
CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)Create_RSP_Register_Window, CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)Create_RSP_Register_Window,
(LPVOID)TRUE,0, &ThreadID); (LPVOID)TRUE,0, &ThreadID);
} else { } else {
SetForegroundWindow(RSP_Registers_hDlg); SetForegroundWindow(RSP_Registers_hDlg);
} }
@ -112,7 +112,7 @@ void HideRSP_RegisterPanel ( int Panel) {
break; break;
case Vector2: case Vector2:
for (count = 0; count < 16;count ++) { ShowWindow(hVECT2[count], FALSE ); } for (count = 0; count < 16;count ++) { ShowWindow(hVECT2[count], FALSE ); }
break; break;
} }
} }
@ -138,11 +138,11 @@ void PaintRSP_HiddenPanel (HWND hWnd) {
rcBox.left = 75; rcBox.top = 35; rcBox.left = 75; rcBox.top = 35;
rcBox.right = 150; rcBox.bottom = 50; rcBox.right = 150; rcBox.bottom = 50;
FillRect( ps.hdc, &rcBox,(HBRUSH)COLOR_WINDOW); FillRect( ps.hdc, &rcBox,(HBRUSH)COLOR_WINDOW);
rcBox.left = 365; rcBox.top = 35; rcBox.left = 365; rcBox.top = 35;
rcBox.right = 425; rcBox.bottom = 50; rcBox.right = 425; rcBox.bottom = 50;
FillRect( ps.hdc, &rcBox,(HBRUSH)COLOR_WINDOW); FillRect( ps.hdc, &rcBox,(HBRUSH)COLOR_WINDOW);
hOldFont = SelectObject( ps.hdc, hOldFont = SelectObject( ps.hdc,
GetStockObject(DEFAULT_GUI_FONT) ); GetStockObject(DEFAULT_GUI_FONT) );
@ -398,7 +398,7 @@ LRESULT CALLBACK RSP_Registers_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
switch (((NMHDR *)lParam)->code) { switch (((NMHDR *)lParam)->code) {
case TCN_SELCHANGE: case TCN_SELCHANGE:
InvalidateRect( hTab, &rcDisp, TRUE ); InvalidateRect( hTab, &rcDisp, TRUE );
HideRSP_RegisterPanel (CurrentPanel); HideRSP_RegisterPanel (CurrentPanel);
item.mask = TCIF_PARAM; item.mask = TCIF_PARAM;
TabCtrl_GetItem( hTab, TabCtrl_GetCurSel( hTab ), &item ); TabCtrl_GetItem( hTab, TabCtrl_GetCurSel( hTab ), &item );
CurrentPanel = (int)item.lParam; CurrentPanel = (int)item.lParam;
@ -491,19 +491,19 @@ void SetupRSP_RegistersMain (HWND hDlg) {
item.mask = TCIF_TEXT | TCIF_PARAM; item.mask = TCIF_TEXT | TCIF_PARAM;
item.pszText = " General Purpose "; item.pszText = " General Purpose ";
item.lParam = GeneralPurpose; item.lParam = GeneralPurpose;
TabCtrl_InsertItem( hTab,0, &item); TabCtrl_InsertItem( hTab,0, &item);
item.lParam = ControlProcessor0; item.lParam = ControlProcessor0;
item.pszText = " Control Processor 0 "; item.pszText = " Control Processor 0 ";
TabCtrl_InsertItem( hTab,1, &item); TabCtrl_InsertItem( hTab,1, &item);
item.lParam = HiddenRegisters; item.lParam = HiddenRegisters;
item.pszText = " Hidden Registers "; item.pszText = " Hidden Registers ";
TabCtrl_InsertItem( hTab,2, &item); TabCtrl_InsertItem( hTab,2, &item);
item.lParam = Vector1; item.lParam = Vector1;
item.pszText = " RSP Vectors $v0 - $v15 "; item.pszText = " RSP Vectors $v0 - $v15 ";
TabCtrl_InsertItem( hTab,3, &item); TabCtrl_InsertItem( hTab,3, &item);
item.lParam = Vector2; item.lParam = Vector2;
item.pszText = " RSP Vectors $v16 - $v31 "; item.pszText = " RSP Vectors $v16 - $v31 ";
TabCtrl_InsertItem( hTab,4, &item); TabCtrl_InsertItem( hTab,4, &item);
} }
SetupRSP_HiddenPanel ( hDlg ); SetupRSP_HiddenPanel ( hDlg );
@ -579,10 +579,10 @@ void ShowRSP_RegisterPanel ( int Panel) {
break; break;
case Vector1: case Vector1:
for (count = 0; count < 16;count ++) { ShowWindow(hVECT1[count], TRUE ); } for (count = 0; count < 16;count ++) { ShowWindow(hVECT1[count], TRUE ); }
break; break;
case Vector2: case Vector2:
for (count = 0; count < 16;count ++) { ShowWindow(hVECT2[count], TRUE ); } for (count = 0; count < 16;count ++) { ShowWindow(hVECT2[count], TRUE ); }
break; break;
} }
} }
@ -621,7 +621,7 @@ void UpdateRSPRegistersScreen ( void ) {
sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_DMA_BUSY_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_DMA_BUSY_REG);
SetWindowText(hCP0[6],RegisterValue); SetWindowText(hCP0[6],RegisterValue);
sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_SEMAPHORE_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_SEMAPHORE_REG);
SetWindowText(hCP0[7],RegisterValue); SetWindowText(hCP0[7],RegisterValue);
sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_START_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_START_REG);
SetWindowText(hCP0[8],RegisterValue); SetWindowText(hCP0[8],RegisterValue);
sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_END_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_END_REG);
@ -658,14 +658,14 @@ void UpdateRSPRegistersScreen ( void ) {
RSP_Vect[count].W[2], RSP_Vect[count].W[1], RSP_Vect[count].W[0]); RSP_Vect[count].W[2], RSP_Vect[count].W[1], RSP_Vect[count].W[0]);
SetWindowText(hVECT1[count],RegisterValue); SetWindowText(hVECT1[count],RegisterValue);
} }
break; break;
case Vector2: case Vector2:
for (count = 0; count < 16;count ++) { for (count = 0; count < 16;count ++) {
sprintf(RegisterValue," 0x%08X - %08X - %08X - %08X", RSP_Vect[count + 16].W[3], sprintf(RegisterValue," 0x%08X - %08X - %08X - %08X", RSP_Vect[count + 16].W[3],
RSP_Vect[count + 16].W[2], RSP_Vect[count + 16].W[1], RSP_Vect[count + 16].W[0]); RSP_Vect[count + 16].W[2], RSP_Vect[count + 16].W[1], RSP_Vect[count + 16].W[0]);
SetWindowText(hVECT2[count],RegisterValue); SetWindowText(hVECT2[count],RegisterValue);
} }
break; break;
} }
} }
} }

View File

@ -142,7 +142,7 @@ DWORD WriteToAccum2 (int Location, int PC, BOOL RecursiveCall) {
if (Compiler.bAccum == FALSE) return TRUE; if (Compiler.bAccum == FALSE) return TRUE;
if (Instruction_State == DELAY_SLOT) { if (Instruction_State == DELAY_SLOT) {
return TRUE; return TRUE;
} }
do { do {
@ -378,7 +378,7 @@ DWORD WriteToAccum2 (int Location, int PC, BOOL RecursiveCall) {
Instruction_State = DELAY_SLOT; Instruction_State = DELAY_SLOT;
break; break;
case DELAY_SLOT: case DELAY_SLOT:
Instruction_State = FINISH_BLOCK; Instruction_State = FINISH_BLOCK;
break; break;
} }
} while (Instruction_State != FINISH_BLOCK); } while (Instruction_State != FINISH_BLOCK);
@ -455,7 +455,7 @@ BOOL WriteToVectorDest2 (DWORD DestReg, int PC, BOOL RecursiveCall) {
if (Compiler.bDest == FALSE) return TRUE; if (Compiler.bDest == FALSE) return TRUE;
if (Instruction_State == DELAY_SLOT) { if (Instruction_State == DELAY_SLOT) {
return TRUE; return TRUE;
} }
do { do {
@ -693,7 +693,7 @@ BOOL WriteToVectorDest2 (DWORD DestReg, int PC, BOOL RecursiveCall) {
Instruction_State = DELAY_SLOT; Instruction_State = DELAY_SLOT;
break; break;
case DELAY_SLOT: case DELAY_SLOT:
Instruction_State = FINISH_BLOCK; Instruction_State = FINISH_BLOCK;
break; break;
} }
} while (Instruction_State != FINISH_BLOCK); } while (Instruction_State != FINISH_BLOCK);
@ -770,7 +770,7 @@ BOOL UseRspFlags (int PC) {
if (Compiler.bFlags == FALSE) return TRUE; if (Compiler.bFlags == FALSE) return TRUE;
if (Instruction_State == DELAY_SLOT) { if (Instruction_State == DELAY_SLOT) {
return TRUE; return TRUE;
} }
do { do {
@ -971,7 +971,7 @@ BOOL UseRspFlags (int PC) {
Instruction_State = DELAY_SLOT; Instruction_State = DELAY_SLOT;
break; break;
case DELAY_SLOT: case DELAY_SLOT:
Instruction_State = FINISH_BLOCK; Instruction_State = FINISH_BLOCK;
break; break;
} }
} while ( Instruction_State != FINISH_BLOCK); } while ( Instruction_State != FINISH_BLOCK);
@ -1058,7 +1058,7 @@ BOOL IsRegisterConstant (DWORD Reg, DWORD * Constant) {
if (RspOp.rt == Reg) { if (RspOp.rt == Reg) {
if (RspOp.rs == 0) { if (RspOp.rs == 0) {
if (References > 0) { if (References > 0) {
return FALSE; return FALSE;
} }
Const = (short)RspOp.immediate; Const = (short)RspOp.immediate;
References++; References++;
@ -1572,7 +1572,7 @@ void GetInstructionInfo(DWORD PC, OPCODE * RspOp, OPCODE_INFO * info) {
info->StoredReg = RspOp->rt; info->StoredReg = RspOp->rt;
info->IndexReg = RspOp->base; info->IndexReg = RspOp->base;
info->SourceReg1 = UNUSED_OPERAND; info->SourceReg1 = UNUSED_OPERAND;
info->flags = Store_Operation | GPR_Instruction; info->flags = Store_Operation | GPR_Instruction;
break; break;
case RSP_LC2: case RSP_LC2:
switch (RspOp->rd) { switch (RspOp->rd) {

View File

@ -509,10 +509,10 @@ void ReOrderSubBlock(RSP_BLOCK * Block) {
DWORD count; DWORD count;
if (!Compiler.bReOrdering) { if (!Compiler.bReOrdering) {
return; return;
} }
if (Block->CurrPC > 0xFF0) { if (Block->CurrPC > 0xFF0) {
return; return;
} }
/* find the label or jump closest to us */ /* find the label or jump closest to us */
@ -550,7 +550,7 @@ void DetectGPRConstants(RSP_CODE * code) {
memset(&code->MipsRegConst, 0, sizeof(DWORD) * 0x20); memset(&code->MipsRegConst, 0, sizeof(DWORD) * 0x20);
if (!Compiler.bGPRConstants) { if (!Compiler.bGPRConstants) {
return; return;
} }
CPU_Message("***** Detecting constants *****"); CPU_Message("***** Detecting constants *****");
@ -634,7 +634,7 @@ void LinkBranches(RSP_BLOCK * Block) {
RSP_BLOCK Save; RSP_BLOCK Save;
if (!CurrentBlock.ResolveCount) { if (!CurrentBlock.ResolveCount) {
return; return;
} }
CPU_Message("***** Linking branches (%i) *****", CurrentBlock.ResolveCount); CPU_Message("***** Linking branches (%i) *****", CurrentBlock.ResolveCount);
@ -732,7 +732,7 @@ BOOL IsJumpLabel(DWORD PC) {
DWORD Count; DWORD Count;
if (!RspCode.LabelCount) { if (!RspCode.LabelCount) {
return FALSE; return FALSE;
} }
for (Count = 0; Count < RspCode.LabelCount; Count++) { for (Count = 0; Count < RspCode.LabelCount; Count++) {
@ -827,7 +827,7 @@ void CompilerRSPBlock ( void ) {
if (LogRDP && NextInstruction != DELAY_SLOT_DONE){ if (LogRDP && NextInstruction != DELAY_SLOT_DONE){
char str[40]; char str[40];
sprintf(str,"%X",CompilePC); sprintf(str,"%X",CompilePC);
PushImm32(str,CompilePC); PushImm32(str,CompilePC);
Call_Direct(RDP_LogLoc,"RDP_LogLoc"); Call_Direct(RDP_LogLoc,"RDP_LogLoc");
AddConstToX86Reg(x86_ESP, 4); AddConstToX86Reg(x86_ESP, 4);
@ -860,7 +860,7 @@ void CompilerRSPBlock ( void ) {
NextInstruction = NORMAL; NextInstruction = NORMAL;
CompilePC += 8; CompilePC += 8;
if (CompilePC >= 0x1000) { if (CompilePC >= 0x1000) {
NextInstruction = FINISH_BLOCK; NextInstruction = FINISH_BLOCK;
} else if (NULL == *(JumpTable + (CompilePC >> 2))) { } else if (NULL == *(JumpTable + (CompilePC >> 2))) {
/* this is for the new block being compiled now */ /* this is for the new block being compiled now */
CPU_Message("**** Continuing static SubBlock (jump table entry added for PC: %04X at X86: %08X) *****", CompilePC, RecompPos); CPU_Message("**** Continuing static SubBlock (jump table entry added for PC: %04X at X86: %08X) *****", CompilePC, RecompPos);
@ -923,7 +923,7 @@ DWORD RunRecompilerCPU ( DWORD Cycles ) {
** that go out of it, let's rock ** that go out of it, let's rock
**/ **/
LinkBranches(&CurrentBlock); LinkBranches(&CurrentBlock);
if (Profiling && !IndvidualBlock) { if (Profiling && !IndvidualBlock) {
StopTimer(); StopTimer();
} }

View File

@ -155,7 +155,7 @@ void CompileBranchExit(DWORD TargetPC, DWORD ContinuePC)
{ {
DWORD * X86Loc = NULL; DWORD * X86Loc = NULL;
NextInstruction = FINISH_SUB_BLOCK; NextInstruction = FINISH_SUB_BLOCK;
CompConstToVariable(TRUE, &BranchCompare, "BranchCompare"); CompConstToVariable(TRUE, &BranchCompare, "BranchCompare");
JeLabel32("BranchEqual", 0); JeLabel32("BranchEqual", 0);
X86Loc = (DWORD*)(RecompPos - 4); X86Loc = (DWORD*)(RecompPos - 4);
@ -187,7 +187,7 @@ void Compile_J ( void ) {
NextInstruction = FINISH_SUB_BLOCK; NextInstruction = FINISH_SUB_BLOCK;
} else if ( NextInstruction == DELAY_SLOT_EXIT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_EXIT_DONE ) {
MoveConstToVariable((RSPOpC.target << 2) & 0xFFC,PrgCount,"RSP PC"); MoveConstToVariable((RSPOpC.target << 2) & 0xFFC,PrgCount,"RSP PC");
NextInstruction = FINISH_SUB_BLOCK; NextInstruction = FINISH_SUB_BLOCK;
Ret(); Ret();
} else { } else {
CompilerWarning("J error\nWeird Delay Slot.\n\nNextInstruction = %X\nEmulation will now stop", NextInstruction); CompilerWarning("J error\nWeird Delay Slot.\n\nNextInstruction = %X\nEmulation will now stop", NextInstruction);
@ -217,7 +217,7 @@ void Compile_JAL ( void ) {
NextInstruction = FINISH_SUB_BLOCK; NextInstruction = FINISH_SUB_BLOCK;
} else if ( NextInstruction == DELAY_SLOT_EXIT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_EXIT_DONE ) {
MoveConstToVariable((RSPOpC.target << 2) & 0xFFC,PrgCount,"RSP PC"); MoveConstToVariable((RSPOpC.target << 2) & 0xFFC,PrgCount,"RSP PC");
NextInstruction = FINISH_SUB_BLOCK; NextInstruction = FINISH_SUB_BLOCK;
Ret(); Ret();
} else { } else {
CompilerWarning("J error\nWeird Delay Slot.\n\nNextInstruction = %X\nEmulation will now stop", NextInstruction); CompilerWarning("J error\nWeird Delay Slot.\n\nNextInstruction = %X\nEmulation will now stop", NextInstruction);
@ -231,7 +231,7 @@ void Compile_BEQ ( void ) {
if ( NextInstruction == NORMAL ) { if ( NextInstruction == NORMAL ) {
CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC)); CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC));
if (RSPOpC.rs == 0 && RSPOpC.rt == 0) { if (RSPOpC.rs == 0 && RSPOpC.rt == 0) {
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
return; return;
} }
bDelayAffect = DelaySlotAffectBranch(CompilePC); bDelayAffect = DelaySlotAffectBranch(CompilePC);
@ -248,7 +248,7 @@ void Compile_BEQ ( void ) {
CompX86regToVariable(x86_EAX,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs)); CompX86regToVariable(x86_EAX,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs));
} }
SetzVariable(&BranchCompare, "BranchCompare"); SetzVariable(&BranchCompare, "BranchCompare");
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
} else if ( NextInstruction == DELAY_SLOT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_DONE ) {
DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC; DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC;
@ -308,7 +308,7 @@ void Compile_BNE ( void ) {
CompX86regToVariable(x86_EAX,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs)); CompX86regToVariable(x86_EAX,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs));
} }
SetnzVariable(&BranchCompare, "BranchCompare"); SetnzVariable(&BranchCompare, "BranchCompare");
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
} else if ( NextInstruction == DELAY_SLOT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_DONE ) {
DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC; DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC;
@ -349,7 +349,7 @@ void Compile_BLEZ ( void ) {
if ( NextInstruction == NORMAL ) { if ( NextInstruction == NORMAL ) {
CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC)); CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC));
if (RSPOpC.rs == 0) { if (RSPOpC.rs == 0) {
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
return; return;
} }
bDelayAffect = DelaySlotAffectBranch(CompilePC); bDelayAffect = DelaySlotAffectBranch(CompilePC);
@ -359,7 +359,7 @@ void Compile_BLEZ ( void ) {
} }
CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs)); CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs));
SetleVariable(&BranchCompare, "BranchCompare"); SetleVariable(&BranchCompare, "BranchCompare");
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
} else if ( NextInstruction == DELAY_SLOT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_DONE ) {
DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC; DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC;
@ -395,7 +395,7 @@ void Compile_BGTZ ( void ) {
if ( NextInstruction == NORMAL ) { if ( NextInstruction == NORMAL ) {
CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC)); CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC));
if (RSPOpC.rs == 0) { if (RSPOpC.rs == 0) {
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
return; return;
} }
bDelayAffect = DelaySlotAffectBranch(CompilePC); bDelayAffect = DelaySlotAffectBranch(CompilePC);
@ -405,7 +405,7 @@ void Compile_BGTZ ( void ) {
} }
CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs)); CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs));
SetgVariable(&BranchCompare, "BranchCompare"); SetgVariable(&BranchCompare, "BranchCompare");
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
} else if ( NextInstruction == DELAY_SLOT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_DONE ) {
DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC; DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC;
@ -454,7 +454,7 @@ void Compile_ADDI ( void ) {
if (Immediate != 0) { if (Immediate != 0) {
AddConstToX86Reg(x86_EAX, Immediate); AddConstToX86Reg(x86_EAX, Immediate);
} }
MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt));
} }
} }
@ -617,7 +617,7 @@ void Compile_LH ( void ) {
CompilerWarning("Unaligned LH at constant address PC = %04X", CompilePC); CompilerWarning("Unaligned LH at constant address PC = %04X", CompilePC);
Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LH,"RSP_Opcode_LH"); Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LH,"RSP_Opcode_LH");
} else { } else {
char Address[32]; char Address[32];
sprintf(Address, "Dmem + %Xh", Addr); sprintf(Address, "Dmem + %Xh", Addr);
MoveSxVariableToX86regHalf(RSPInfo.DMEM + Addr, Address, x86_EAX); MoveSxVariableToX86regHalf(RSPInfo.DMEM + Addr, Address, x86_EAX);
MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt));
@ -671,7 +671,7 @@ void Compile_LW ( void ) {
CompilerWarning("Unaligned LW at constant address PC = %04X", CompilePC); CompilerWarning("Unaligned LW at constant address PC = %04X", CompilePC);
Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LW,"RSP_Opcode_LW"); Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LW,"RSP_Opcode_LW");
} else { } else {
char Address[32]; char Address[32];
sprintf(Address, "Dmem + %Xh", Addr); sprintf(Address, "Dmem + %Xh", Addr);
MoveVariableToX86reg(RSPInfo.DMEM + Addr, Address, x86_EAX); MoveVariableToX86reg(RSPInfo.DMEM + Addr, Address, x86_EAX);
MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt));
@ -760,7 +760,7 @@ void Compile_LHU ( void ) {
Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LHU,"RSP_Opcode_LHU"); Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LHU,"RSP_Opcode_LHU");
return; return;
} else { } else {
char Address[32]; char Address[32];
sprintf(Address, "Dmem + %Xh", Addr); sprintf(Address, "Dmem + %Xh", Addr);
MoveZxVariableToX86regHalf(RSPInfo.DMEM + Addr, Address, x86_ECX); MoveZxVariableToX86regHalf(RSPInfo.DMEM + Addr, Address, x86_ECX);
MoveX86regToVariable(x86_ECX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); MoveX86regToVariable(x86_ECX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt));
@ -834,7 +834,7 @@ void Compile_SH ( void ) {
Cheat_r4300iOpcodeNoMessage(RSP_Opcode_SH,"RSP_Opcode_SH"); Cheat_r4300iOpcodeNoMessage(RSP_Opcode_SH,"RSP_Opcode_SH");
return; return;
} else { } else {
char Address[32]; char Address[32];
sprintf(Address, "Dmem + %Xh", Addr); sprintf(Address, "Dmem + %Xh", Addr);
MoveVariableToX86regHalf(&RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt), x86_EAX); MoveVariableToX86regHalf(&RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt), x86_EAX);
MoveX86regHalfToVariable(x86_EAX, RSPInfo.DMEM + Addr, Address); MoveX86regHalfToVariable(x86_EAX, RSPInfo.DMEM + Addr, Address);
@ -888,10 +888,10 @@ void Compile_SW ( void ) {
Cheat_r4300iOpcodeNoMessage(RSP_Opcode_SW,"RSP_Opcode_SW"); Cheat_r4300iOpcodeNoMessage(RSP_Opcode_SW,"RSP_Opcode_SW");
return; return;
} else { } else {
char Address[32]; char Address[32];
sprintf(Address, "Dmem + %Xh", Addr); sprintf(Address, "Dmem + %Xh", Addr);
MoveVariableToX86reg(&RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt), x86_EAX); MoveVariableToX86reg(&RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt), x86_EAX);
MoveX86regToVariable(x86_EAX, RSPInfo.DMEM + Addr, Address); MoveX86regToVariable(x86_EAX, RSPInfo.DMEM + Addr, Address);
return; return;
} }
} }
@ -941,7 +941,7 @@ void Compile_SW ( void ) {
if (RSPOpC.rt == 0) { if (RSPOpC.rt == 0) {
XorX86RegToX86Reg(x86_EAX,x86_EAX); XorX86RegToX86Reg(x86_EAX,x86_EAX);
} else { } else {
MoveVariableToX86reg(&RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt), x86_EAX); MoveVariableToX86reg(&RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt), x86_EAX);
} }
MoveX86regToN64Mem(x86_EAX, x86_EBX); MoveX86regToN64Mem(x86_EAX, x86_EBX);
@ -1025,7 +1025,7 @@ void Compile_Special_SRLV ( void ) {
MoveVariableToX86reg(&RSP_GPR[RSPOpC.rs].W, GPR_Name(RSPOpC.rs), x86_ECX); MoveVariableToX86reg(&RSP_GPR[RSPOpC.rs].W, GPR_Name(RSPOpC.rs), x86_ECX);
AndConstToX86Reg(x86_ECX, 0x1F); AndConstToX86Reg(x86_ECX, 0x1F);
ShiftRightUnsign(x86_EAX); ShiftRightUnsign(x86_EAX);
MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rd].W, GPR_Name(RSPOpC.rd)); MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rd].W, GPR_Name(RSPOpC.rd));
} }
void Compile_Special_SRAV ( void ) { void Compile_Special_SRAV ( void ) {
@ -1080,7 +1080,7 @@ void Compile_Special_JR (void) {
ChangedPC = FALSE; ChangedPC = FALSE;
NextInstruction = FINISH_SUB_BLOCK; NextInstruction = FINISH_SUB_BLOCK;
} else if ( NextInstruction == DELAY_SLOT_EXIT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_EXIT_DONE ) {
NextInstruction = FINISH_SUB_BLOCK; NextInstruction = FINISH_SUB_BLOCK;
Ret(); Ret();
} else { } else {
CompilerWarning("WTF\n\nJR\nNextInstruction = %X", NextInstruction); CompilerWarning("WTF\n\nJR\nNextInstruction = %X", NextInstruction);
@ -1114,7 +1114,7 @@ void Compile_Special_JALR ( void ) {
Ret(); Ret();
NextInstruction = FINISH_SUB_BLOCK; NextInstruction = FINISH_SUB_BLOCK;
} else if ( NextInstruction == DELAY_SLOT_EXIT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_EXIT_DONE ) {
NextInstruction = FINISH_SUB_BLOCK; NextInstruction = FINISH_SUB_BLOCK;
Ret(); Ret();
} else { } else {
CompilerWarning("WTF\n\nJALR\nNextInstruction = %X", NextInstruction); CompilerWarning("WTF\n\nJALR\nNextInstruction = %X", NextInstruction);
@ -1361,7 +1361,7 @@ void Compile_RegImm_BLTZ ( void ) {
if ( NextInstruction == NORMAL ) { if ( NextInstruction == NORMAL ) {
CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC)); CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC));
if (RSPOpC.rs == 0) { if (RSPOpC.rs == 0) {
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
return; return;
} }
bDelayAffect = DelaySlotAffectBranch(CompilePC); bDelayAffect = DelaySlotAffectBranch(CompilePC);
@ -1371,7 +1371,7 @@ void Compile_RegImm_BLTZ ( void ) {
} }
CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs)); CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs));
SetlVariable(&BranchCompare, "BranchCompare"); SetlVariable(&BranchCompare, "BranchCompare");
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
} else if ( NextInstruction == DELAY_SLOT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_DONE ) {
DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC; DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC;
@ -1404,7 +1404,7 @@ void Compile_RegImm_BGEZ ( void ) {
if ( NextInstruction == NORMAL ) { if ( NextInstruction == NORMAL ) {
CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC)); CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC));
if (RSPOpC.rs == 0) { if (RSPOpC.rs == 0) {
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
return; return;
} }
bDelayAffect = DelaySlotAffectBranch(CompilePC); bDelayAffect = DelaySlotAffectBranch(CompilePC);
@ -1414,7 +1414,7 @@ void Compile_RegImm_BGEZ ( void ) {
} }
CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs)); CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs));
SetgeVariable(&BranchCompare, "BranchCompare"); SetgeVariable(&BranchCompare, "BranchCompare");
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
} else if ( NextInstruction == DELAY_SLOT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_DONE ) {
DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC; DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC;
@ -1448,12 +1448,12 @@ void Compile_RegImm_BLTZAL ( void ) {
CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC)); CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC));
MoveConstToVariable(CompilePC + 8, &RSP_GPR[31].UW, "RA.W"); MoveConstToVariable(CompilePC + 8, &RSP_GPR[31].UW, "RA.W");
if (RSPOpC.rs == 0) { if (RSPOpC.rs == 0) {
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
return; return;
} }
CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs)); CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs));
SetlVariable(&BranchCompare, "BranchCompare"); SetlVariable(&BranchCompare, "BranchCompare");
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
} else if ( NextInstruction == DELAY_SLOT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_DONE ) {
DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC; DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC;
@ -1493,7 +1493,7 @@ void Compile_RegImm_BGEZAL ( void ) {
} }
CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs)); CompConstToVariable(0,&RSP_GPR[RSPOpC.rs].W,GPR_Name(RSPOpC.rs));
SetgeVariable(&BranchCompare, "BranchCompare"); SetgeVariable(&BranchCompare, "BranchCompare");
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
} else if ( NextInstruction == DELAY_SLOT_DONE ) { } else if ( NextInstruction == DELAY_SLOT_DONE ) {
DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC; DWORD Target = (CompilePC + ((short)RSPOpC.offset << 2) + 4) & 0xFFC;
@ -1532,14 +1532,14 @@ void Compile_Cop0_MF ( void ) {
sprintf(str,"%d",RSPOpC.rd); sprintf(str,"%d",RSPOpC.rd);
PushImm32(str,RSPOpC.rd); PushImm32(str,RSPOpC.rd);
sprintf(str,"%X",CompilePC); sprintf(str,"%X",CompilePC);
PushImm32(str,CompilePC); PushImm32(str,CompilePC);
Call_Direct(RDP_LogMF0,"RDP_LogMF0"); Call_Direct(RDP_LogMF0,"RDP_LogMF0");
AddConstToX86Reg(x86_ESP, 8); AddConstToX86Reg(x86_ESP, 8);
} }
#ifndef Compile_Cop0 #ifndef Compile_Cop0
Cheat_r4300iOpcode(RSP_Cop0_MF,"RSP_Cop0_MF"); Cheat_r4300iOpcode(RSP_Cop0_MF,"RSP_Cop0_MF");
if (NextInstruction == NORMAL) if (NextInstruction == NORMAL)
{ {
MoveConstToVariable(CompilePC + 4,PrgCount,"RSP PC"); MoveConstToVariable(CompilePC + 4,PrgCount,"RSP PC");
@ -1625,7 +1625,7 @@ void Compile_Cop0_MT ( void )
Push(x86_EAX); Push(x86_EAX);
sprintf(str,"%d",RSPOpC.rd); sprintf(str,"%d",RSPOpC.rd);
PushImm32(str,RSPOpC.rd); PushImm32(str,RSPOpC.rd);
sprintf(str,"%X",CompilePC); sprintf(str,"%X",CompilePC);
PushImm32(str,CompilePC); PushImm32(str,CompilePC);
Call_Direct(RDP_LogMT0,"RDP_LogMT0"); Call_Direct(RDP_LogMT0,"RDP_LogMT0");
AddConstToX86Reg(x86_ESP, 12); AddConstToX86Reg(x86_ESP, 12);
@ -2541,7 +2541,7 @@ BOOL Compile_Vector_VMUDH_MMX ( void ) {
MmxUnpackLowWord(x86_MM0, x86_MM4); MmxUnpackLowWord(x86_MM0, x86_MM4);
MmxUnpackHighWord(x86_MM6, x86_MM4); MmxUnpackHighWord(x86_MM6, x86_MM4);
MmxUnpackLowWord(x86_MM1, x86_MM5); MmxUnpackLowWord(x86_MM1, x86_MM5);
MmxUnpackHighWord(x86_MM7, x86_MM5); MmxUnpackHighWord(x86_MM7, x86_MM5);
/* Integrate copies */ /* Integrate copies */
@ -3528,7 +3528,7 @@ void Compile_Vector_VABS ( void ) {
} }
if (bWriteToAccum == TRUE) { if (bWriteToAccum == TRUE) {
sprintf(Reg, "RSP_ACCUM[%i].HW[1]", el); sprintf(Reg, "RSP_ACCUM[%i].HW[1]", el);
MoveX86regHalfToVariable(x86_EDI, &RSP_ACCUM[el].HW[1], Reg); MoveX86regHalfToVariable(x86_EDI, &RSP_ACCUM[el].HW[1], Reg);
} }
} }
} }
@ -4689,7 +4689,7 @@ void Compile_Opcode_LDV ( void ) {
jne $Loop */ jne $Loop */
LoopEntry = RecompPos; LoopEntry = RecompPos;
CPU_Message(" Loop:"); CPU_Message(" Loop:");
MoveX86RegToX86Reg(x86_EBX, x86_EAX); MoveX86RegToX86Reg(x86_EBX, x86_EAX);
XorConstToX86Reg(x86_EAX, 3); XorConstToX86Reg(x86_EAX, 3);
MoveN64MemToX86regByte(x86_EDX, x86_EAX); MoveN64MemToX86regByte(x86_EDX, x86_EAX);
@ -4878,9 +4878,9 @@ void Compile_Opcode_LRV ( void ) {
MoveN64MemToX86regHalf(x86_EDX, x86_ESI); MoveN64MemToX86regHalf(x86_EDX, x86_ESI);
MoveX86regHalfToX86regPointer(x86_EDX, x86_EAX); MoveX86regHalfToX86regPointer(x86_EDX, x86_EAX);
AddConstToX86Reg(x86_EBX, 2); /* Dmem pointer */ AddConstToX86Reg(x86_EBX, 2); /* Dmem pointer */
SubConstFromX86Reg(x86_EAX, 2); /* Vector pointer */ SubConstFromX86Reg(x86_EAX, 2); /* Vector pointer */
DecX86reg(x86_ECX); /* Loop counter */ DecX86reg(x86_ECX); /* Loop counter */
JneLabel8("Loop", 0); JneLabel8("Loop", 0);
x86_SetBranch8b(RecompPos - 1, Loop); x86_SetBranch8b(RecompPos - 1, Loop);
@ -4965,7 +4965,7 @@ void Compile_Opcode_SSV ( void ) {
sprintf(Reg, "RSP_Vect[%i].B[%i]", RSPOpC.rt, 15 - (RSPOpC.del + 1)); sprintf(Reg, "RSP_Vect[%i].B[%i]", RSPOpC.rt, 15 - (RSPOpC.del + 1));
MoveVariableToX86regHalf(&RSP_Vect[RSPOpC.rt].B[15 - (RSPOpC.del + 1)], Reg, x86_ECX); MoveVariableToX86regHalf(&RSP_Vect[RSPOpC.rt].B[15 - (RSPOpC.del + 1)], Reg, x86_ECX);
XorConstToX86Reg(x86_EBX, 2); XorConstToX86Reg(x86_EBX, 2);
MoveX86regHalfToN64Mem(x86_ECX, x86_EBX); MoveX86regHalfToN64Mem(x86_ECX, x86_EBX);
} else { } else {
LeaSourceAndOffset(x86_EAX, x86_EBX, 1); LeaSourceAndOffset(x86_EAX, x86_EBX, 1);
XorConstToX86Reg(x86_EBX, 3); XorConstToX86Reg(x86_EBX, 3);
@ -5288,7 +5288,7 @@ void Compile_Opcode_SWV ( void ) {
/************************** Other functions **************************/ /************************** Other functions **************************/
void Compile_UnknownOpcode (void) { void Compile_UnknownOpcode (void) {
CPU_Message(" %X Unhandled Opcode: %s",CompilePC, RSPOpcodeName(RSPOpC.Hex,CompilePC) ); CPU_Message(" %X Unhandled Opcode: %s",CompilePC, RSPOpcodeName(RSPOpC.Hex,CompilePC) );
NextInstruction = FINISH_BLOCK; NextInstruction = FINISH_BLOCK;
MoveConstToVariable(CompilePC,PrgCount,"RSP PC"); MoveConstToVariable(CompilePC,PrgCount,"RSP PC");
MoveConstToVariable(RSPOpC.Hex,&RSPOpC.Hex, "RSPOpC.Hex"); MoveConstToVariable(RSPOpC.Hex,&RSPOpC.Hex, "RSPOpC.Hex");

View File

@ -748,7 +748,7 @@ void RSP_Sections_VMACF ( OPCODE RspOp, DWORD AccumStyle ) {
/******************** Microcode Sections *********************/ /******************** Microcode Sections *********************/
static DWORD Section_000_VMADN; /* Yah i know, but leave it */ static DWORD Section_000_VMADN; /* Yah i know, but leave it */
BOOL Check_Section_000(void) { BOOL Check_Section_000(void) {
DWORD i; DWORD i;
@ -809,7 +809,7 @@ void Compile_Section_000(void) {
CPU_Message(" %X %s",CompilePC+0x00,RSPOpcodeName(vmudn.Hex,CompilePC + 0x00)); CPU_Message(" %X %s",CompilePC+0x00,RSPOpcodeName(vmudn.Hex,CompilePC + 0x00));
if (LogRDP){ if (LogRDP){
char str[40]; char str[40];
sprintf(str,"%X",CompilePC); sprintf(str,"%X",CompilePC);
PushImm32(str,CompilePC); PushImm32(str,CompilePC);
Call_Direct(RDP_LogLoc,"RDP_LogLoc"); Call_Direct(RDP_LogLoc,"RDP_LogLoc");
AddConstToX86Reg(x86_ESP, 4); AddConstToX86Reg(x86_ESP, 4);
@ -821,7 +821,7 @@ void Compile_Section_000(void) {
if (LogRDP){ if (LogRDP){
char str[40]; char str[40];
sprintf(str,"%X",CompilePC+0x04+(i*4)); sprintf(str,"%X",CompilePC+0x04+(i*4));
PushImm32(str,CompilePC+0x04+(i*4)); PushImm32(str,CompilePC+0x04+(i*4));
Call_Direct(RDP_LogLoc,"RDP_LogLoc"); Call_Direct(RDP_LogLoc,"RDP_LogLoc");
AddConstToX86Reg(x86_ESP, 4); AddConstToX86Reg(x86_ESP, 4);
@ -977,7 +977,7 @@ BOOL Check_Section_002 ( void ) {
return FALSE; return FALSE;
} }
if ((op[0].rs & 0xF) < 8) { if ((op[0].rs & 0xF) < 8) {
return FALSE; return FALSE;
} }
for (Count = 1; Count < 10; Count++) { for (Count = 1; Count < 10; Count++) {
@ -1009,13 +1009,13 @@ void Compile_Section_002 ( void ) {
OPCODE vmudh, vsaw; OPCODE vmudh, vsaw;
CPU_Message("Compiling: %X to ..., RSP Optimization $002", CompilePC); CPU_Message("Compiling: %X to ..., RSP Optimization $002", CompilePC);
for (Count = 0; Count < 0xC; Count++) { for (Count = 0; Count < 0xC; Count++) {
RSP_LW_IMEM(CompilePC + (Count * 0x04), &op[Count].Hex); RSP_LW_IMEM(CompilePC + (Count * 0x04), &op[Count].Hex);
CPU_Message(" %X %s",CompilePC+(Count*0x04),RSPOpcodeName(op[Count].Hex,CompilePC + (Count*0x04))); CPU_Message(" %X %s",CompilePC+(Count*0x04),RSPOpcodeName(op[Count].Hex,CompilePC + (Count*0x04)));
if (LogRDP){ if (LogRDP){
char str[40]; char str[40];
sprintf(str,"%X",CompilePC+(Count*0x04)); sprintf(str,"%X",CompilePC+(Count*0x04));
PushImm32(str,CompilePC+(Count*0x04)); PushImm32(str,CompilePC+(Count*0x04));
Call_Direct(RDP_LogLoc,"RDP_LogLoc"); Call_Direct(RDP_LogLoc,"RDP_LogLoc");
AddConstToX86Reg(x86_ESP, 4); AddConstToX86Reg(x86_ESP, 4);
@ -1079,10 +1079,10 @@ static void resampler_hle() {
UDWORD accum, initial; UDWORD accum, initial;
DWORD const2 = (DWORD)RSP_Vect[18].UHW[4 ^ 7]; DWORD const2 = (DWORD)RSP_Vect[18].UHW[4 ^ 7];
__int64 const3 = (__int64)((int)RSP_Vect[30].HW[0 ^ 7]) << 16; __int64 const3 = (__int64)((int)RSP_Vect[30].HW[0 ^ 7]) << 16;
int i; int i;
// VMUDM $v23, $v31, $v23 [7] // VMUDM $v23, $v31, $v23 [7]
initial.DW = (__int64)((DWORD)RSP_Vect[23].UHW[7 ^ 7]) << 16; initial.DW = (__int64)((DWORD)RSP_Vect[23].UHW[7 ^ 7]) << 16;
// VMADH $v23, $v31, $v22 [7] // VMADH $v23, $v31, $v22 [7]
initial.W[1] += (int)RSP_Vect[22].HW[7 ^ 7]; initial.W[1] += (int)RSP_Vect[22].HW[7 ^ 7];
@ -1112,7 +1112,7 @@ static void resampler_hle() {
} }
void Compile_Section_003 ( void ) { void Compile_Section_003 ( void ) {
CPU_Message("Compiling: %X to ..., RSP Optimization $003", CompilePC); CPU_Message("Compiling: %X to ..., RSP Optimization $003", CompilePC);
Call_Direct(resampler_hle, "Resampler_HLE"); Call_Direct(resampler_hle, "Resampler_HLE");
CompilePC += 4 * sizeof(OPCODE); CompilePC += 4 * sizeof(OPCODE);
} }

View File

@ -95,11 +95,11 @@ void AdcX86regToVariable(int x86reg, void * Variable, char * VariableName) {
case x86_ESI: PUTDST16(RecompPos,0x3511); break; case x86_ESI: PUTDST16(RecompPos,0x3511); break;
case x86_EDI: PUTDST16(RecompPos,0x3D11); break; case x86_EDI: PUTDST16(RecompPos,0x3D11); break;
case x86_ESP: PUTDST16(RecompPos,0x2511); break; case x86_ESP: PUTDST16(RecompPos,0x2511); break;
case x86_EBP: PUTDST16(RecompPos,0x2D11); break; case x86_EBP: PUTDST16(RecompPos,0x2D11); break;
default: default:
DisplayError("AddVariableToX86reg\nUnknown x86 Register"); DisplayError("AddVariableToX86reg\nUnknown x86 Register");
} }
PUTDST32(RecompPos,Variable); PUTDST32(RecompPos,Variable);
} }
void AdcX86regHalfToVariable(int x86reg, void * Variable, char * VariableName) { void AdcX86regHalfToVariable(int x86reg, void * Variable, char * VariableName) {
@ -114,11 +114,11 @@ void AdcX86regHalfToVariable(int x86reg, void * Variable, char * VariableName) {
case x86_ESI: PUTDST16(RecompPos,0x3511); break; case x86_ESI: PUTDST16(RecompPos,0x3511); break;
case x86_EDI: PUTDST16(RecompPos,0x3D11); break; case x86_EDI: PUTDST16(RecompPos,0x3D11); break;
case x86_ESP: PUTDST16(RecompPos,0x2511); break; case x86_ESP: PUTDST16(RecompPos,0x2511); break;
case x86_EBP: PUTDST16(RecompPos,0x2D11); break; case x86_EBP: PUTDST16(RecompPos,0x2D11); break;
default: default:
DisplayError("AdcX86regHalfToVariable\nUnknown x86 Register"); DisplayError("AdcX86regHalfToVariable\nUnknown x86 Register");
} }
PUTDST32(RecompPos,Variable); PUTDST32(RecompPos,Variable);
} }
void AdcConstToVariable(void *Variable, char *VariableName, BYTE Constant) { void AdcConstToVariable(void *Variable, char *VariableName, BYTE Constant) {
@ -142,7 +142,7 @@ void AdcConstToX86reg( BYTE Constant, int x86reg ) {
default: default:
DisplayError("AdcConstantToX86reg\nUnknown x86 Register"); DisplayError("AdcConstantToX86reg\nUnknown x86 Register");
} }
PUTDST8(RecompPos,Constant); PUTDST8(RecompPos,Constant);
} }
void AddConstToVariable (DWORD Const, void *Variable, char *VariableName) { void AddConstToVariable (DWORD Const, void *Variable, char *VariableName) {
@ -207,7 +207,7 @@ void AddVariableToX86reg(int x86reg, void * Variable, char * VariableName) {
default: default:
DisplayError("AddVariableToX86reg\nUnknown x86 Register"); DisplayError("AddVariableToX86reg\nUnknown x86 Register");
} }
PUTDST32(RecompPos,Variable); PUTDST32(RecompPos,Variable);
} }
void AddX86regToVariable(int x86reg, void * Variable, char * VariableName) { void AddX86regToVariable(int x86reg, void * Variable, char * VariableName) {
@ -224,7 +224,7 @@ void AddX86regToVariable(int x86reg, void * Variable, char * VariableName) {
default: default:
DisplayError("AddVariableToX86reg\nUnknown x86 Register"); DisplayError("AddVariableToX86reg\nUnknown x86 Register");
} }
PUTDST32(RecompPos,Variable); PUTDST32(RecompPos,Variable);
} }
void AddX86regHalfToVariable(int x86reg, void * Variable, char * VariableName) { void AddX86regHalfToVariable(int x86reg, void * Variable, char * VariableName) {
@ -1145,7 +1145,7 @@ void MoveConstToX86reg(DWORD Const, int x86reg) {
default: default:
DisplayError("MoveConstToX86reg\nUnknown x86 Register"); DisplayError("MoveConstToX86reg\nUnknown x86 Register");
} }
PUTDST32(RecompPos,Const); PUTDST32(RecompPos,Const);
} }
void MoveOffsetToX86reg(DWORD Const, char * VariableName, int x86reg) { void MoveOffsetToX86reg(DWORD Const, char * VariableName, int x86reg) {
@ -1162,7 +1162,7 @@ void MoveOffsetToX86reg(DWORD Const, char * VariableName, int x86reg) {
default: default:
DisplayError("MoveOffsetToX86reg\nUnknown x86 Register"); DisplayError("MoveOffsetToX86reg\nUnknown x86 Register");
} }
PUTDST32(RecompPos,Const); PUTDST32(RecompPos,Const);
} }
void MoveX86regPointerToX86regByte(int Destination, int AddrReg) { void MoveX86regPointerToX86regByte(int Destination, int AddrReg) {
@ -2609,7 +2609,7 @@ void SubVariableFromX86reg(int x86reg, void * Variable, char * VariableName) {
default: default:
DisplayError("SubVariableFromX86reg\nUnknown x86 Register"); DisplayError("SubVariableFromX86reg\nUnknown x86 Register");
} }
PUTDST32(RecompPos,Variable); PUTDST32(RecompPos,Variable);
} }
void SubX86regFromVariable(int x86reg, void * Variable, char * VariableName) { void SubX86regFromVariable(int x86reg, void * Variable, char * VariableName) {
@ -2626,7 +2626,7 @@ void SubX86regFromVariable(int x86reg, void * Variable, char * VariableName) {
default: default:
DisplayError("SubX86regFromVariable\nUnknown x86 Register"); DisplayError("SubX86regFromVariable\nUnknown x86 Register");
} }
PUTDST32(RecompPos,Variable); PUTDST32(RecompPos,Variable);
} }
void SubX86RegToX86Reg(int Destination, int Source) { void SubX86RegToX86Reg(int Destination, int Source) {

View File

@ -40,7 +40,7 @@ void Add_BPoint ( void )
GetWindowText(hRSPLocation,Title,sizeof(Title)); GetWindowText(hRSPLocation,Title,sizeof(Title));
if (!AddRSP_BPoint(AsciiToHex(Title),TRUE )) { if (!AddRSP_BPoint(AsciiToHex(Title),TRUE )) {
SendMessage(hRSPLocation,EM_SETSEL,(WPARAM)0,(LPARAM)-1); SendMessage(hRSPLocation,EM_SETSEL,(WPARAM)0,(LPARAM)-1);
SetFocus(hRSPLocation); SetFocus(hRSPLocation);
} }
} }
@ -69,7 +69,7 @@ int AddRSP_BPoint( DWORD Location, int Confirm )
int Response; int Response;
sprintf(Message,"Break when:\n\nRSP's Program Counter = 0x%03X\n\nIs this correct?", sprintf(Message,"Break when:\n\nRSP's Program Counter = 0x%03X\n\nIs this correct?",
Location); Location);
Response = MessageBox(BPoint_Win_hDlg, Message, "Breakpoint", MB_YESNO | MB_ICONINFORMATION); Response = MessageBox(BPoint_Win_hDlg, Message, "Breakpoint", MB_YESNO | MB_ICONINFORMATION);
if (Response == IDNO) if (Response == IDNO)
{ {
@ -142,8 +142,8 @@ void RefreshBpoints ( HWND hList )
for (count = 0; count < NoOfBpoints; count ++ ) { for (count = 0; count < NoOfBpoints; count ++ ) {
sprintf(Message," at 0x%03X (RSP)", BPoint[count].Location); sprintf(Message," at 0x%03X (RSP)", BPoint[count].Location);
location = SendMessage(hList,LB_ADDSTRING,0,(LPARAM)Message); location = SendMessage(hList,LB_ADDSTRING,0,(LPARAM)Message);
SendMessage(hList,LB_SETITEMDATA,(WPARAM)location,(LPARAM)BPoint[count].Location); SendMessage(hList,LB_SETITEMDATA,(WPARAM)location,(LPARAM)BPoint[count].Location);
} }
} }
@ -156,7 +156,7 @@ void RemoveBpoint ( HWND hList, int index )
{ {
DWORD location; DWORD location;
location = SendMessage(hList,LB_GETITEMDATA,(WPARAM)index,0); location = SendMessage(hList,LB_GETITEMDATA,(WPARAM)index,0);
RemoveRSPBreakPoint(location); RemoveRSPBreakPoint(location);
} }

View File

@ -48,7 +48,7 @@ void SP_DMA_READ (void)
if ((*RSPInfo.SP_RD_LEN_REG & 0xFFF) + 1 + (*RSPInfo.SP_MEM_ADDR_REG & 0xFFF) > 0x1000) if ((*RSPInfo.SP_RD_LEN_REG & 0xFFF) + 1 + (*RSPInfo.SP_MEM_ADDR_REG & 0xFFF) > 0x1000)
{ {
MessageBox(NULL,"SP DMA READ\ncould not fit copy in memory segment","Error",MB_OK); MessageBox(NULL,"SP DMA READ\ncould not fit copy in memory segment","Error",MB_OK);
return; return;
} }
Length = ((*RSPInfo.SP_RD_LEN_REG & 0xFFF) | 7) + 1; Length = ((*RSPInfo.SP_RD_LEN_REG & 0xFFF) | 7) + 1;
@ -124,7 +124,7 @@ void SP_DMA_WRITE (void)
if ((*RSPInfo.SP_WR_LEN_REG & 0xFFF) + 1 + (*RSPInfo.SP_MEM_ADDR_REG & 0xFFF) > 0x1000) if ((*RSPInfo.SP_WR_LEN_REG & 0xFFF) + 1 + (*RSPInfo.SP_MEM_ADDR_REG & 0xFFF) > 0x1000)
{ {
MessageBox(NULL,"SP DMA WRITE\ncould not fit copy in memory segment","Error",MB_OK); MessageBox(NULL,"SP DMA WRITE\ncould not fit copy in memory segment","Error",MB_OK);
return; return;
} }
Length = ((*RSPInfo.SP_WR_LEN_REG & 0xFFF) | 7) + 1; Length = ((*RSPInfo.SP_WR_LEN_REG & 0xFFF) | 7) + 1;