tracer/logger fixed unlogged ram code
This commit is contained in:
parent
7c0604e323
commit
f3d6e617d5
|
@ -205,10 +205,13 @@ unsigned int NewBreak(const char* name, int start, int end, unsigned int type, c
|
|||
|
||||
int GetPRGAddress(int A){
|
||||
int result;
|
||||
if((A < 0x8000) || (A > 0xFFFF))return -1;
|
||||
if(A > 0xFFFF)
|
||||
return -1;
|
||||
result = &Page[A>>11][A]-PRGptr[0];
|
||||
if((result > (int)PRGsize[0]) || (result < 0))return -1;
|
||||
else return result;
|
||||
if((result > (int)PRGsize[0]) || (result < 0))
|
||||
return -1;
|
||||
else
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -349,26 +349,30 @@ void FCEUD_TraceInstruction(uint8 *opcode, int size)
|
|||
uint8 tmp;
|
||||
static int unloggedlines;
|
||||
|
||||
if(((logging_options & LOG_NEW_INSTRUCTIONS) && (oldcodecount != codecount)) ||
|
||||
((logging_options & LOG_NEW_DATA) && (olddatacount != datacount)))
|
||||
{
|
||||
//something new was logged
|
||||
oldcodecount = codecount;
|
||||
olddatacount = datacount;
|
||||
if(unloggedlines > 0)
|
||||
// if instruction executed from the RAM, skip this, log all instead
|
||||
// TODO: loops folding mame-lyke style
|
||||
if(GetPRGAddress(addr) != -1) {
|
||||
if(((logging_options & LOG_NEW_INSTRUCTIONS) && (oldcodecount != codecount)) ||
|
||||
((logging_options & LOG_NEW_DATA) && (olddatacount != datacount)))
|
||||
{
|
||||
sprintf(str_temp, "(%d lines skipped)", unloggedlines);
|
||||
OutputLogLine(str_temp);
|
||||
unloggedlines = 0;
|
||||
}
|
||||
} else
|
||||
{
|
||||
if((logging_options & LOG_NEW_INSTRUCTIONS) ||
|
||||
(logging_options & LOG_NEW_DATA))
|
||||
//something new was logged
|
||||
oldcodecount = codecount;
|
||||
olddatacount = datacount;
|
||||
if(unloggedlines > 0)
|
||||
{
|
||||
sprintf(str_temp, "(%d lines skipped)", unloggedlines);
|
||||
OutputLogLine(str_temp);
|
||||
unloggedlines = 0;
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(FCEUI_GetLoggingCD())
|
||||
unloggedlines++;
|
||||
return;
|
||||
if((logging_options & LOG_NEW_INSTRUCTIONS) ||
|
||||
(logging_options & LOG_NEW_DATA))
|
||||
{
|
||||
if(FCEUI_GetLoggingCD())
|
||||
unloggedlines++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue