From: notaz Date: Sat, 12 Nov 2022 15:57:31 +0000 (+0200) Subject: cdriso: unbreak cdda for chd X-Git-Tag: r24l~342 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f02c57eacd43b7a27111181dabc97b2c5ead78c4;p=pcsx_rearmed.git cdriso: unbreak cdda for chd notaz/pcsx_rearmed#272 --- diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index 8cd9ab5b..83677504 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -124,7 +124,7 @@ struct trackinfo { char start[3]; // MSF-format char length[3]; // MSF-format FILE *handle; // for multi-track images CDDA - unsigned int start_offset; // byte offset from start of above file + unsigned int start_offset; // byte offset from start of above file (chd: sector offset) }; #define MAXTRACKS 100 /* How many tracks can a CD hold? */ @@ -1431,7 +1431,7 @@ static int cdread_chd(FILE *f, unsigned int base, void *dest, int sector) { int hunk; - assert(base == 0); + sector += base; hunk = sector / chd_img->sectors_per_hunk; chd_img->sector_in_hunk = sector % chd_img->sectors_per_hunk;