52 |
|
#include "debug.h" |
53 |
|
|
54 |
|
// Emulation time statistics |
55 |
< |
#define EMUL_TIME_STATS 1 |
55 |
> |
#ifndef EMUL_TIME_STATS |
56 |
> |
#define EMUL_TIME_STATS 0 |
57 |
> |
#endif |
58 |
|
|
59 |
|
#if EMUL_TIME_STATS |
60 |
|
static clock_t emul_start_time; |
61 |
< |
static uint32 interrupt_count = 0; |
61 |
> |
static uint32 interrupt_count = 0, ppc_interrupt_count = 0; |
62 |
|
static clock_t interrupt_time = 0; |
63 |
|
static uint32 exec68k_count = 0; |
64 |
|
static clock_t exec68k_time = 0; |
598 |
|
void sheepshaver_cpu::interrupt(uint32 entry) |
599 |
|
{ |
600 |
|
#if EMUL_TIME_STATS |
601 |
< |
interrupt_count++; |
601 |
> |
ppc_interrupt_count++; |
602 |
|
const clock_t interrupt_start = clock(); |
603 |
|
#endif |
604 |
|
|
990 |
|
printf("Total emulation time : %.1f sec\n", double(emul_time) / double(CLOCKS_PER_SEC)); |
991 |
|
printf("Total interrupt count: %d (%2.1f Hz)\n", interrupt_count, |
992 |
|
(double(interrupt_count) * CLOCKS_PER_SEC) / double(emul_time)); |
993 |
+ |
printf("Total ppc interrupt count: %d (%2.1f %%)\n", ppc_interrupt_count, |
994 |
+ |
(double(ppc_interrupt_count) * 100.0) / double(interrupt_count)); |
995 |
|
|
996 |
|
#define PRINT_STATS(LABEL, VAR_PREFIX) do { \ |
997 |
|
printf("Total " LABEL " count : %d\n", VAR_PREFIX##_count); \ |
1071 |
|
if (*(int32 *)XLM_IRQ_NEST > 0) |
1072 |
|
return; |
1073 |
|
|
1070 |
– |
// Do nothing if there is no interrupt pending |
1071 |
– |
if (InterruptFlags == 0) |
1072 |
– |
return; |
1073 |
– |
|
1074 |
|
// Current interrupt nest level |
1075 |
|
static int interrupt_depth = 0; |
1076 |
|
++interrupt_depth; |
1077 |
+ |
#if EMUL_TIME_STATS |
1078 |
+ |
interrupt_count++; |
1079 |
+ |
#endif |
1080 |
|
|
1081 |
|
// Disable MacOS stack sniffer |
1082 |
|
WriteMacInt32(0x110, 0); |
1116 |
|
// 68k emulator active, within EMUL_OP routine, execute 68k interrupt routine directly when interrupt level is 0 |
1117 |
|
if ((ReadMacInt32(XLM_68K_R25) & 7) == 0) { |
1118 |
|
interrupt_context ctx(this, "68k mode"); |
1119 |
+ |
#if EMUL_TIME_STATS |
1120 |
+ |
const clock_t interrupt_start = clock(); |
1121 |
+ |
#endif |
1122 |
|
#if 1 |
1123 |
|
// Execute full 68k interrupt routine |
1124 |
|
M68kRegisters r; |
1144 |
|
} |
1145 |
|
} |
1146 |
|
#endif |
1147 |
+ |
#if EMUL_TIME_STATS |
1148 |
+ |
interrupt_time += (clock() - interrupt_start); |
1149 |
+ |
#endif |
1150 |
|
} |
1151 |
|
break; |
1152 |
|
#endif |