mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-27 03:31:49 +01:00
[Core/SCD] improved CD drive seek time emulation (fixes Panic!/Switch intro)
This commit is contained in:
parent
5b33778524
commit
c3db7ade7d
@ -879,10 +879,24 @@ void cdd_update(void)
|
|||||||
error("LBA = %d (track n°%d)\n", cdd.lba, cdd.index);
|
error("LBA = %d (track n°%d)\n", cdd.lba, cdd.index);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* reading disc */
|
/* seeking disc */
|
||||||
if (cdd.status == CD_PLAY)
|
if (cdd.status == CD_SEEK)
|
||||||
{
|
{
|
||||||
/* drive access latency */
|
/* drive latency */
|
||||||
|
if (cdd.latency > 0)
|
||||||
|
{
|
||||||
|
cdd.latency--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* drive is ready */
|
||||||
|
cdd.status = CD_READY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* reading disc */
|
||||||
|
else if (cdd.status == CD_PLAY)
|
||||||
|
{
|
||||||
|
/* drive latency */
|
||||||
if (cdd.latency > 0)
|
if (cdd.latency > 0)
|
||||||
{
|
{
|
||||||
cdd.latency--;
|
cdd.latency--;
|
||||||
@ -1216,7 +1230,17 @@ void cdd_process(void)
|
|||||||
(scd.regs[0x46>>1].byte.h * 10 + scd.regs[0x46>>1].byte.l)) * 75 +
|
(scd.regs[0x46>>1].byte.h * 10 + scd.regs[0x46>>1].byte.l)) * 75 +
|
||||||
(scd.regs[0x48>>1].byte.h * 10 + scd.regs[0x48>>1].byte.l) - 150;
|
(scd.regs[0x48>>1].byte.h * 10 + scd.regs[0x48>>1].byte.l) - 150;
|
||||||
|
|
||||||
/* update current LBA (TODO: add some delay ?) */
|
/* CD drive seek time (required by Switch / Panic intro - see CD_PLAY command for details)*/
|
||||||
|
if (lba < cdd.lba)
|
||||||
|
{
|
||||||
|
cdd.latency = (((cdd.lba - lba) * 120) / 270000);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cdd.latency = (((lba - cdd.lba) * 120) / 270000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* update current LBA */
|
||||||
cdd.lba = lba;
|
cdd.lba = lba;
|
||||||
|
|
||||||
/* update current track index */
|
/* update current track index */
|
||||||
@ -1241,7 +1265,7 @@ void cdd_process(void)
|
|||||||
scd.regs[0x36>>1].byte.h = 0x01;
|
scd.regs[0x36>>1].byte.h = 0x01;
|
||||||
|
|
||||||
/* update status */
|
/* update status */
|
||||||
cdd.status = CD_READY;
|
cdd.status = CD_SEEK;
|
||||||
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;
|
||||||
scd.regs[0x3c>>1].w = 0x0000;
|
scd.regs[0x3c>>1].w = 0x0000;
|
||||||
|
Loading…
Reference in New Issue
Block a user