From 2d13d7cb20b944025174d5d54762a9a47a5b3b4b Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 22 Jul 2017 11:51:00 +0200 Subject: [PATCH] ISO mounting code now defaults to 2048 bytes per sector Mode 1 if it can not read the PVD rather than refusing to load the ISO, fixes mounting of Apple Rhapsody ISO's. --- src/cdrom_dosbox.cpp | 6 +++++- src/cdrom_dosbox.h | 2 ++ src/cdrom_image.cc | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cdrom_dosbox.cpp b/src/cdrom_dosbox.cpp index 4def610ca..0b2ea24c6 100644 --- a/src/cdrom_dosbox.cpp +++ b/src/cdrom_dosbox.cpp @@ -247,7 +247,11 @@ bool CDROM_Interface_Image::LoadIsoFile(char* filename) } else if (CanReadPVD(track.file, RAW_SECTOR_SIZE, true)) { track.sectorSize = RAW_SECTOR_SIZE; track.mode2 = true; - } else return false; + } else { + /* Unknown mode: Assume regular 2048-byte sectors, this is needed so Apple Rhapsody ISO's can be mounted. */ + track.sectorSize = COOKED_SECTOR_SIZE; + track.mode2 = false; + } track.length = track.file->getLength() / track.sectorSize; tracks.push_back(track); diff --git a/src/cdrom_dosbox.h b/src/cdrom_dosbox.h index dc88bbe45..8a6364f48 100644 --- a/src/cdrom_dosbox.h +++ b/src/cdrom_dosbox.h @@ -171,4 +171,6 @@ typedef std::vector::iterator track_it; std::string mcn; }; +void cdrom_image_log(const char *format, ...); + #endif /* __CDROM_INTERFACE__ */ diff --git a/src/cdrom_image.cc b/src/cdrom_image.cc index a7fee4477..42d40be77 100644 --- a/src/cdrom_image.cc +++ b/src/cdrom_image.cc @@ -988,6 +988,7 @@ int image_open(uint8_t id, wchar_t *fn) wcstombs(afn, fn, sizeof(afn)); if (!cdimg[id]->SetDevice(afn, false)) { + pclog("Image failed to load\n"); image_close(id); cdrom_set_null_handler(id); return 1;