Musashi icon indicating copy to clipboard operation
Musashi copied to clipboard

Incorrect used clocks returned by m68k_execute(int num_cycles) after a call to m68k_end_timeslice(void)

Open elmerucr opened this issue 6 years ago • 0 comments

I have noticed that the number of used clocks is incorrectly calculated by int m68k_execute(int num_cycles) (in m68kcpu.c) once a call is made to void m68k_end_timeslice(void) during the call to m68k_execute. The proposed solution would be to change:

void m68k_end_timeslice(void)
{
	m68ki_initial_cycles = GET_CYCLES();
	SET_CYCLES(0);
}

into:

void m68k_end_timeslice(void)
{
	m68ki_initial_cycles -= GET_CYCLES();
	SET_CYCLES(0);
}

(please note -= in stead of =)

Best regards, elmerucr

elmerucr avatar Oct 15 '19 19:10 elmerucr