[Core/CD] improved CD hardware reset timing accuracy on software reset

This commit is contained in:
ekeeke 2019-03-23 14:01:43 +01:00
parent 76d6fb87a2
commit b1ccc1aaba
2 changed files with 11 additions and 11 deletions

View File

@ -198,9 +198,6 @@ void cdd_init(int samplerate)
void cdd_reset(void) void cdd_reset(void)
{ {
/* reset cycle counter */
cdd.cycles = 0;
/* reset drive access latency */ /* reset drive access latency */
cdd.latency = 0; cdd.latency = 0;

View File

@ -1626,6 +1626,9 @@ void scd_reset(int hard)
s68k.cycles = 0; s68k.cycles = 0;
s68k_pulse_reset(); s68k_pulse_reset();
s68k_pulse_halt(); s68k_pulse_halt();
/* Reset frame cycle counter */
scd.cycles = 0;
} }
else else
{ {
@ -1649,10 +1652,7 @@ void scd_reset(int hard)
/* Reset Timer & Stopwatch counters */ /* Reset Timer & Stopwatch counters */
scd.timer = 0; scd.timer = 0;
scd.stopwatch = 0; scd.stopwatch = s68k.cycles;
/* Reset frame cycle counter */
scd.cycles = 0;
/* Clear pending interrupts */ /* Clear pending interrupts */
scd.pending = 0; scd.pending = 0;
@ -1661,6 +1661,9 @@ void scd_reset(int hard)
memset(&m68k.poll, 0, sizeof(m68k.poll)); memset(&m68k.poll, 0, sizeof(m68k.poll));
memset(&s68k.poll, 0, sizeof(s68k.poll)); memset(&s68k.poll, 0, sizeof(s68k.poll));
/* reset CDD cycle counter */
cdd.cycles = (scd.cycles - s68k.cycles) * 3;
/* Reset CD hardware */ /* Reset CD hardware */
cdd_reset(); cdd_reset();
cdc_reset(); cdc_reset();