[SCD] incremented CD drive read latency: fixes Space Adventure Cobra (freeze when opening coffin at 2nd morgue scene)

This commit is contained in:
EkeEke 2012-11-06 21:04:29 +01:00
parent b02141b5e1
commit 9540bf1fe0

View File

@ -91,7 +91,7 @@ static const unsigned char waveHeader[32] =
0x44,0xac,0x00,0x00,0x10,0xb1,0x02,0x00,0x04,0x00,0x10,0x00,0x64,0x61,0x74,0x61 0x44,0xac,0x00,0x00,0x10,0xb1,0x02,0x00,0x04,0x00,0x10,0x00,0x64,0x61,0x74,0x61
}; };
/* supported file extensions */ /* supported WAVE file extensions */
static const char extensions[10][16] = static const char extensions[10][16] =
{ {
"%02d.wav", "%02d.wav",
@ -1063,9 +1063,10 @@ void cdd_process(void)
{ {
/* Fixes a few games hanging during intro because they expect data to be read with some delay */ /* Fixes a few games hanging during intro because they expect data to be read with some delay */
/* Wolf Team games (Anet Futatabi, Cobra Command, Road Avenger & Time Gal) need at least 6 interrupts delay */ /* Wolf Team games (Anet Futatabi, Cobra Command, Road Avenger & Time Gal) need at least 6 interrupts delay */
/* Radical Rex need at least one interrupt delay */ /* Radical Rex needs at least one interrupt delay */
/* Jeopardy need at least 9 interrupts delay (without counting seek time delay below )*/ /* Jeopardy needs at least 9 interrupts delay */
cdd.latency = 9; /* Space Adventure Cobra (2nd morgue scene) needs at least 13 interrupts delay */
cdd.latency = 13;
} }
/* update current track index */ /* update current track index */
@ -1161,7 +1162,7 @@ void cdd_process(void)
/* no audio track playing */ /* no audio track playing */
scd.regs[0x36>>1].byte.h = 0x01; scd.regs[0x36>>1].byte.h = 0x01;
/* update status (TODO: figure what is returned in RS1-RS8) */ /* update status */
cdd.status = CD_READY; cdd.status = CD_READY;
scd.regs[0x38>>1].w = CD_SEEK << 8; scd.regs[0x38>>1].w = CD_SEEK << 8;
scd.regs[0x3a>>1].w = 0x0000; scd.regs[0x3a>>1].w = 0x0000;
@ -1176,7 +1177,7 @@ void cdd_process(void)
/* no audio track playing */ /* no audio track playing */
scd.regs[0x36>>1].byte.h = 0x01; scd.regs[0x36>>1].byte.h = 0x01;
/* update status (TODO: figure what is returned in RS1-RS8) */ /* update status */
cdd.status = CD_READY; cdd.status = CD_READY;
scd.regs[0x38>>1].w = CD_READY << 8; scd.regs[0x38>>1].w = CD_READY << 8;
scd.regs[0x3a>>1].w = 0x0000; scd.regs[0x3a>>1].w = 0x0000;
@ -1203,7 +1204,7 @@ void cdd_process(void)
cdd.scanOffset = CD_SCAN_SPEED; cdd.scanOffset = CD_SCAN_SPEED;
cdd.status = CD_SCAN; cdd.status = CD_SCAN;
scd.regs[0x38>>1].w = (CD_SCAN << 8) | 0x02; scd.regs[0x38>>1].w = (CD_SCAN << 8) | 0x02;
scd.regs[0x3a>>1].w = lut_BCD_16[cdd.index+1]; scd.regs[0x3a>>1].w = (cdd.index < cdd.toc.last) ? lut_BCD_16[cdd.index + 1] : 0x0A0A;
scd.regs[0x3c>>1].w = 0x0000; scd.regs[0x3c>>1].w = 0x0000;
scd.regs[0x3e>>1].w = 0x0000; scd.regs[0x3e>>1].w = 0x0000;
scd.regs[0x40>>1].byte.h = 0x00; scd.regs[0x40>>1].byte.h = 0x00;
@ -1215,7 +1216,7 @@ void cdd_process(void)
cdd.scanOffset = -CD_SCAN_SPEED; cdd.scanOffset = -CD_SCAN_SPEED;
cdd.status = CD_SCAN; cdd.status = CD_SCAN;
scd.regs[0x38>>1].w = (CD_SCAN << 8) | 0x02; scd.regs[0x38>>1].w = (CD_SCAN << 8) | 0x02;
scd.regs[0x3a>>1].w = lut_BCD_16[cdd.index+1]; scd.regs[0x3a>>1].w = (cdd.index < cdd.toc.last) ? lut_BCD_16[cdd.index + 1] : 0x0A0A;
scd.regs[0x3c>>1].w = 0x0000; scd.regs[0x3c>>1].w = 0x0000;
scd.regs[0x3e>>1].w = 0x0000; scd.regs[0x3e>>1].w = 0x0000;
scd.regs[0x40>>1].byte.h = 0x00; scd.regs[0x40>>1].byte.h = 0x00;