RDebug: Cleanup variable scope.

Codacy.
This commit is contained in:
lightningterror 2022-06-24 17:59:17 +02:00
parent 72218929b9
commit 3099d55b40
1 changed files with 6 additions and 6 deletions

View File

@ -105,7 +105,6 @@ void D2_DBGP(const u8 *inbuffer, u8 *outbuffer, char *message, char *eepc, char
const DECI2_DBGP_RUN*run =(DECI2_DBGP_RUN*) &in[1];
static char line[1024];
int i, s;
memcpy(outbuffer, inbuffer, 128*1024);//BUFFERSIZE
//out->h.length=sizeof(DECI2_DBGP_HEADER);
@ -132,7 +131,7 @@ void D2_DBGP(const u8 *inbuffer, u8 *outbuffer, char *message, char *eepc, char
sprintf(line, "%s/GETREG count=%d kind[0]=%d number[0]=%d",
in->id==0?"CPU":in->id==1?"VU0":"VU1", in->count, eregs[0].kind, eregs[0].number);
if (in->h.destination=='I'){
for (i=0; i<in->count; i++)
for (int i=0; i<in->count; i++)
switch (iregs[i].kind){
case 1:switch (iregs[i].number){
case 0:iregs[i].value=psxRegs.GPR.n.lo;break;
@ -150,7 +149,7 @@ void D2_DBGP(const u8 *inbuffer, u8 *outbuffer, char *message, char *eepc, char
iregs[0].value++;//dummy; might be assert(0)
}
}else
for (i=0; i<in->count; i++)
for (int i=0; i<in->count; i++)
switch (eregs[i].kind){
case 0:memcpy(eregs[i].value, &cpuRegs.GPR.r[eregs[i].number], 16);break;
case 1:
@ -181,7 +180,7 @@ void D2_DBGP(const u8 *inbuffer, u8 *outbuffer, char *message, char *eepc, char
sprintf(line, "%s/PUTREG count=%d kind[0]=%d number[0]=%d value=%016I64X_%016I64X",
in->id==0?"CPU":in->id==1?"VU0":"VU1", in->count, eregs[0].kind, eregs[0].number, eregs[0].value[1], eregs[0].value[0]);
if (in->h.destination=='I'){
for (i=0; i<in->count; i++)
for (int i=0; i<in->count; i++)
switch (iregs[i].kind){
case 1:switch (iregs[i].number){
case 0:psxRegs.GPR.n.lo=iregs[i].value;break;
@ -199,7 +198,7 @@ void D2_DBGP(const u8 *inbuffer, u8 *outbuffer, char *message, char *eepc, char
;//dummy; might be assert(0)
}
}else
for (i=0; i<in->count; i++)
for (int i=0; i<in->count; i++)
switch (eregs[i].kind){
case 0:memcpy(&cpuRegs.GPR.r[eregs[i].number], eregs[i].value, 16);break;
case 1:
@ -388,7 +387,8 @@ void D2_DBGP(const u8 *inbuffer, u8 *outbuffer, char *message, char *eepc, char
cpuRegs.GPR.n.gp.UL[0]=run->gp;
// threads_array[0].argc = run->argc;
u32* argv = (u32*)&run[1];
for (i=0, s=0; i<(int)run->argc; i++, argv++) s+=argv[i];
int s = 0;
for (int i=0; i<(int)run->argc; i++, argv++) s+=argv[i];
memcpy(PSM(0), argv, s);
// threads_array[0].argstring = 0;
runStatus = STOP;