From cbd88286c7e8473e1062fbe740ec59a302031531 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 31895794..f47fcfdd 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -110,7 +110,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? */ @@ -1229,7 +1229,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