mirror of
https://github.com/MiSTer-devel/Main_MiSTer.git
synced 2026-04-19 03:04:28 +00:00
CD-i: Fix table of contents (#1043)
Repair of accidental removal of subcode generation
during Lead-In. (negative lba)
Bug was introduced with c0171c9
This commit is contained in:
@@ -657,6 +657,8 @@ void subcode_data(int lba, struct subcode &out)
|
||||
as = rem_lba / 75;
|
||||
af = rem_lba % 75;
|
||||
|
||||
if (toc_entry_count == 0) // catch division by zero
|
||||
return;
|
||||
auto &toc_entry = toc_buffer[lba % toc_entry_count];
|
||||
|
||||
out.control = htons(toc_entry.control);
|
||||
@@ -817,6 +819,7 @@ void cdi_read_cd(uint8_t *buffer, int lba, int cnt)
|
||||
}
|
||||
|
||||
buffer += CD_SECTOR_LEN;
|
||||
subcode_data(lba, *reinterpret_cast<struct subcode *>(buffer));
|
||||
buffer += sizeof(struct subcode);
|
||||
cnt--;
|
||||
lba++;
|
||||
|
||||
Reference in New Issue
Block a user