1
0
mirror of https://github.com/rzzzwilson/pymlac.git synced 2025-06-10 09:32:41 +00:00

Remove most logging

This commit is contained in:
Ross Wilson 2018-08-04 21:20:50 +07:00
parent 9765d14209
commit 334e5468f9
5 changed files with 3 additions and 36 deletions

View File

@ -203,8 +203,6 @@ Description : Execute a DEIM instruction byte.
static
char *doDEIMByte(BYTE byte, bool last)
{
vlog("doDEIMByte: entered, last=%s", last ? "true" : "false");
char *trace = DEIMdecode(byte);
if (byte & 0x80) // increment mode
@ -217,7 +215,6 @@ char *doDEIMByte(BYTE byte, bool last)
if (byte & 0x20) // get dx sign and move X
{
vlog("doDEIMByte: -x move");
DX -= dx * DScale;
}
else
@ -227,7 +224,6 @@ char *doDEIMByte(BYTE byte, bool last)
if (byte & 0x04) // get dy sign and move Y
{
vlog("doDEIMByte: -y move");
DY -= dy * DScale;
}
else
@ -278,8 +274,6 @@ char *doDEIMByte(BYTE byte, bool last)
}
}
vlog("doDEIMByte: finished, trace='%s'", trace);
return trace;
}
@ -310,12 +304,8 @@ int i_DDYM(void)
static
int i_DEIM(WORD address)
{
vlog("i_DEIM: entered");
Mode = MODE_DEIM;
vlog("i_DEIM: just before doDEIMByte+trace_dcpu");
trace_dcpu("DEIM %s", doDEIMByte(address & 0377, true));
vlog("i_DEIM: returning 1");
return 1;
}
@ -479,7 +469,6 @@ int i_DSTS(int scale)
else
illegal();
trace_dcpu("DSTS %d", scale);
vlog("i_DSTS: scale=%d, DScale set to %d", scale, DScale);
return 1; // FIXME check # cycles used
}
@ -534,8 +523,6 @@ Description : Function to execute one display processor instruction.
int
dcpu_execute_one(void)
{
vlog("dcpu_execute_one: entered");
if (!Running)
{
return 0;
@ -551,13 +538,11 @@ dcpu_execute_one(void)
static char tmp_buff[100];
strcpy(tmp_buff, doDEIMByte(instruction >> 8, false));
vlog("dcpu_execute_one: after first doDEIMByte()");
if (Mode == MODE_DEIM)
{
strcat(tmp_buff, ",");
strcat(tmp_buff, doDEIMByte(instruction & 0xff, true));
vlog("dcpu_execute_one: after second doDEIMByte()");
}
trace_dcpu("INC %s", tmp_buff);
@ -582,10 +567,7 @@ dcpu_execute_one(void)
}
else if (opcode == 003)
{
vlog("dcpu_execute_one: calling i_DEIM()");
int result = i_DEIM(address);
vlog("dcpu_execute_one: returning %d", result);
return result;
return i_DEIM(address);;
}
else if (opcode == 004)
{

View File

@ -37,9 +37,9 @@ vlog(char *fmt, ...)
vsprintf(buff, fmt, ap);
fd = fopen(LogFile, "a");
if (LogPrefix)
fprintf(fd, "%15.6f|%s: %s\n", now, LogPrefix, buff);
fprintf(fd, "%11.6f|%s: %s\n", now, LogPrefix, buff);
else
fprintf(fd, "%15.6f|%s\n", now, buff);
fprintf(fd, "%11.6f|%s\n", now, buff);
fclose(fd);
va_end(ap);
}

View File

@ -86,12 +86,6 @@ ptr_mount(char *fname)
device_cycle_count = PTR_NOT_PTR_READY_CYCLES;
device_use = InUsePTR;
vlog("ptr_mount: PTR_CHARS_PER_SECOND=%d", PTR_CHARS_PER_SECOND);
vlog("ptr_mount: PTR_CYCLES_PER_CHAR=(CPU_HERZ / PTR_CHARS_PER_SECOND)=%d/%d=%d",
CPU_HERZ, PTR_CHARS_PER_SECOND, PTR_CYCLES_PER_CHAR);
vlog("ptr_mount: PTR_READY_CYCLES=%d", PTR_READY_CYCLES);
vlog("ptr_mount: PTR_NOT_PTR_READY_CYCLES=%d", PTR_NOT_PTR_READY_CYCLES);
return 0;
}

View File

@ -116,10 +116,7 @@ trace_dregs(void)
if (TraceFlag != false)
{
// sprintf(DCPU_reg_trace, "DPC=%06o X=%04o, Y=%04o",
// dcpu_get_PC(), dcpu_get_x(), dcpu_get_y());
sprintf(DCPU_reg_trace, "X=%04o, Y=%04o", dcpu_get_x(), dcpu_get_y());
vlog(DCPU_reg_trace);
}
}
@ -156,8 +153,6 @@ Description : printf()-style trace routine for the display CPU.
void
trace_dcpu(char *fmt, ...)
{
vlog("trace_dcpu: entered");
TraceFlag = true; // DEBUG
if (TraceFlag != false)
@ -170,7 +165,5 @@ trace_dcpu(char *fmt, ...)
trace_dregs();
}
vlog("trace_dcpu: exit");
}

View File

@ -125,8 +125,6 @@ run(WORD pc)
int cycles;
int dcycles;
vlog("run: loop, PC=%06o", cpu_get_PC());
trace_start_line();
cycles = cpu_execute_one();