From f02c57eacd43b7a27111181dabc97b2c5ead78c4 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 12 Nov 2022 17:57:31 +0200 Subject: [PATCH] cdriso: unbreak cdda for chd notaz/pcsx_rearmed#272 --- libpcsxcore/cdriso.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.5