gdrom: return blank sector if FAD miss

Fixes NBA Hoopz (US) voice samples
Issue #1247
This commit is contained in:
Flyinghead 2023-10-17 14:29:05 +02:00
parent e96b38ff5c
commit e94b26f1df
2 changed files with 9 additions and 5 deletions

View File

@ -690,11 +690,14 @@ void gd_process_spi_cmd()
#define readcmd packet_cmd.GDReadBlock
cdda.status = cdda_t::NoInfo;
u32 sector_type=2048;
if (readcmd.head ==1 && readcmd.subh==1 && readcmd.data==1 && readcmd.expdtype==3 && readcmd.other==0)
sector_type=2340;
else if(readcmd.head ||readcmd.subh || readcmd.other || (!readcmd.data)) // assert
WARN_LOG(GDROM, "GDROM: *FIXME* ADD MORE CD READ SETTINGS %d %d %d %d 0x%01X",readcmd.head,readcmd.subh,readcmd.other,readcmd.data,readcmd.expdtype);
u32 sector_type = 2048;
if (readcmd.head == 1 && readcmd.subh == 1 && readcmd.data == 1 && readcmd.expdtype == 3 && readcmd.other == 0)
sector_type = 2340;
else if (readcmd.other == 1 || readcmd.expdtype == 1) // Expected Data Type: CD-DA
sector_type = 2352;
else if (readcmd.head == 1 || readcmd.subh == 1 || readcmd.other == 1 || readcmd.data == 0)
WARN_LOG(GDROM, "GDROM: *FIXME* ADD MORE CD READ SETTINGS head %d subh %d other %d data %d type %d",
readcmd.head, readcmd.subh, readcmd.other, readcmd.data, readcmd.expdtype);
read_params.start_sector = GetFAD(&readcmd.b[2], readcmd.prmtype);
if (packet_cmd.data_8[0] == SPI_CD_READ)

View File

@ -297,6 +297,7 @@ void Disc::ReadSectors(u32 FAD, u32 count, u8* dst, u32 fmt, LoadProgress *progr
else
{
WARN_LOG(GDROM, "Sector Read miss FAD: %d", FAD);
memset(dst, 0, fmt);
}
dst+=fmt;
FAD++;