static bool break_if_enforcer;
static uaecptr debug_pc;
+static int trace_cycles;
+static int last_hpos1, last_hpos2;
+static int last_vpos1, last_vpos2;
+static int last_frame = -1;
+static uae_u32 last_cycles1, last_cycles2;
+
static uaecptr processptr;
static uae_char *processname;
extern int audio_channel_mask;
extern int inputdevice_logging;
+static void debug_cycles(void)
+{
+ trace_cycles = 1;
+ last_cycles2 = get_cycles();
+ last_vpos2 = vpos;
+ last_hpos2 = current_hpos();
+}
+
void deactivate_debugger (void)
{
debugger_active = 0;
trace_mode = 0;
if (debugger_active)
return;
+ debug_cycles();
debugger_active = 1;
set_special (SPCFLAG_BRK);
debugging = 1;
return true;
}
+
int firsthist = 0;
int lasthist = 0;
struct cpuhistory {
memwatch_triggered = i + 1;
debugging = 1;
debug_pc = mwhit.pc;
+ debug_cycles();
set_special (SPCFLAG_BRK);
return 1;
}
break;
case 't':
no_trace_exceptions = 0;
+ debug_cycles();
if (*inptr == 't') {
no_trace_exceptions = 1;
inptr++;
trace_mode = TRACE_MATCH_PC;
trace_param1 = nextpc;
exception_debugging = 1;
+ debug_cycles();
return true;
case 'f':
break_if_enforcer = break_if_enforcer ? false : true;
console_out_f(_T("Break when enforcer hit: %s\n"), break_if_enforcer ? _T("enabled") : _T("disabled"));
} else {
- if (instruction_breakpoint (&inptr))
+ if (instruction_breakpoint(&inptr)) {
+ debug_cycles();
return true;
+ }
}
break;
}
if (bp > 0)
console_out_f(_T("Breakpoint %d triggered.\n"), bp - 1);
+ debug_cycles();
}
} else {
console_out_f (_T("Memwatch %d: break at %08X.%c %c%c%c %08X PC=%08X "), memwatch_triggered - 1, mwhit.addr,
}
#endif
debugmem_disable();
+
+ if (trace_cycles && last_frame >= 0) {
+ if (last_frame + 2 >= timeframes) {
+ console_out_f(_T("Cycles: %d Chip, %d CPU. (V=%d H=%d -> V=%d H=%d)\n"),
+ (last_cycles2 - last_cycles1) / CYCLE_UNIT,
+ (last_cycles2 - last_cycles1) / cpucycleunit,
+ last_vpos1, last_hpos1,
+ last_vpos2, last_hpos2);
+ }
+ }
+ trace_cycles = 0;
+
debug_1 ();
debugmem_enable();
if (!debug_rewind && !currprefs.cachesize
uae_ppc_pause(0);
#endif
setmouseactive(0, wasactive ? 2 : 0);
+
+ last_cycles1 = get_cycles();
+ last_vpos1 = vpos;
+ last_hpos1 = current_hpos();
+ last_frame = timeframes;
}
const TCHAR *debuginfo (int mode)