mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-11-10 21:05:12 +01:00
[Core/CD] improved CD hardware reset timing accuracy on software reset
This commit is contained in:
parent
76d6fb87a2
commit
b1ccc1aaba
@ -198,15 +198,12 @@ 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;
|
||||||
|
|
||||||
/* reset track index */
|
/* reset track index */
|
||||||
cdd.index = 0;
|
cdd.index = 0;
|
||||||
|
|
||||||
/* reset logical block address */
|
/* reset logical block address */
|
||||||
cdd.lba = 0;
|
cdd.lba = 0;
|
||||||
|
|
||||||
|
@ -793,7 +793,7 @@ static void scd_write_byte(unsigned int address, unsigned int data)
|
|||||||
|
|
||||||
case 0x01: /* RESET status */
|
case 0x01: /* RESET status */
|
||||||
{
|
{
|
||||||
/* RESET bit cleared ? */
|
/* RESET bit cleared ? */
|
||||||
if (!(data & 0x01))
|
if (!(data & 0x01))
|
||||||
{
|
{
|
||||||
/* reset CD hardware */
|
/* reset CD hardware */
|
||||||
@ -1071,7 +1071,7 @@ static void scd_write_word(unsigned int address, unsigned int data)
|
|||||||
/* only update LED status (register $00 is reserved for MAIN-CPU, use $06 instead) */
|
/* only update LED status (register $00 is reserved for MAIN-CPU, use $06 instead) */
|
||||||
scd.regs[0x06>>1].byte.h = data >> 8;
|
scd.regs[0x06>>1].byte.h = data >> 8;
|
||||||
|
|
||||||
/* RESET bit cleared ? */
|
/* RESET bit cleared ? */
|
||||||
if (!(data & 0x01))
|
if (!(data & 0x01))
|
||||||
{
|
{
|
||||||
/* reset CD hardware */
|
/* reset CD hardware */
|
||||||
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user