1
0
Fork 0

Make the MSCDEX Audio Disk Info return compliant track-ranges

The specification says that legal track values range from 1 to 99,
where as the prior code would return 0 if any issue was encountered.
The spec has no allowance for issues in this function, and therefore
we're bound to simply return 1 instead.
This commit is contained in:
krcroft 2020-02-05 23:29:20 -08:00
parent 1cc88953de
commit 0272145955
No known key found for this signature in database
GPG key ID: 4AD3678F4A2C291C

View file

@ -920,7 +920,16 @@ static Bit16u MSCDEX_IOCTL_Input(PhysPt buffer,Bit8u drive_unit) {
break;
case 0x0A : /* Get Audio Disk info */
Bit8u tr1,tr2; TMSF leadOut;
if (!mscdex->GetCDInfo(drive_unit,tr1,tr2,leadOut)) return 0x05;
if (!mscdex->GetCDInfo(drive_unit,tr1,tr2,leadOut)) {
// The MSCDEX spec says that tracks return values
// must be bounded inclusively between 1 and 99, so
// set acceptable defaults if GetCDInfo fails.
tr1 = 1;
tr2 = 1;
leadOut.min = 0;
leadOut.sec = 0;
leadOut.fr = 0;
}
mem_writeb(buffer+1,tr1);
mem_writeb(buffer+2,tr2);
mem_writeb(buffer+3,leadOut.fr);