sim64 universal 64-bit cycle count support:
MaxCycleCount is accounted by countdown, eliminating the 1-instruction-overhead issue, and removing the need to compare against a growing TotalCycles. Makes main.c responsible for counting total cycles, instead of 6502.c, so the size of MaxCycleCount etc. is fully determined in one location. Makes error.c responsible for PrintCycles instead of paravirt.c, so that it can be treated globally instead of Return value of main() should be SIM65_ERROR because it is unreachable by design.
This commit is contained in:
@@ -64,18 +64,12 @@ static CPURegs Regs;
|
||||
/* Cycles for the current insn */
|
||||
static unsigned Cycles;
|
||||
|
||||
/* Total number of CPU cycles exec'd */
|
||||
static unsigned long TotalCycles;
|
||||
|
||||
/* NMI request active */
|
||||
static unsigned HaveNMIRequest;
|
||||
|
||||
/* IRQ request active */
|
||||
static unsigned HaveIRQRequest;
|
||||
|
||||
/* flag to print cycles at program termination */
|
||||
int PrintCycles;
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper functions and macros */
|
||||
@@ -3277,18 +3271,6 @@ unsigned ExecuteInsn (void)
|
||||
Handlers[CPU][OPC] ();
|
||||
}
|
||||
|
||||
/* Count cycles */
|
||||
TotalCycles += Cycles;
|
||||
|
||||
/* Return the number of clock cycles needed by this insn */
|
||||
return Cycles;
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned long GetCycles (void)
|
||||
/* Return the total number of cycles executed */
|
||||
{
|
||||
/* Return the total number of cycles */
|
||||
return TotalCycles;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user