Skip to content

Commit 1bca579

Browse files
committed
CDImage: Support loading CloneCD images
This replaces the old "img" fallback, which did not work for multi-track games.
1 parent 3072e65 commit 1bca579

File tree

10 files changed

+483
-12
lines changed

10 files changed

+483
-12
lines changed

src/core/fullscreenui_game_list.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ ALIGN_TO_CACHE_LINE static GameListLocals s_game_list_locals;
6767

6868
FullscreenUI::FileSelectorFilters FullscreenUI::GetDiscImageFilters()
6969
{
70-
return {"*.bin", "*.cue", "*.iso", "*.img", "*.chd", "*.ecm", "*.mds", "*.cpe", "*.elf",
71-
"*.psexe", "*.ps-exe", "*.exe", "*.psx", "*.psf", "*.minipsf", "*.m3u", "*.pbp"};
70+
return {"*.bin", "*.cue", "*.iso", "*.chd", "*.ecm", "*.mds", "*.cpe", "*.elf", "*.psexe",
71+
"*.ps-exe", "*.exe", "*.psx", "*.psf", "*.minipsf", "*.m3u", "*.pbp", "*.ccd"};
7272
}
7373

7474
FullscreenUI::FileSelectorFilters FullscreenUI::GetImageFilters()

src/core/system.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,9 +881,9 @@ bool System::IsUsingKnownPS1BIOS()
881881
bool System::IsDiscPath(std::string_view path)
882882
{
883883
return (StringUtil::EndsWithNoCase(path, ".bin") || StringUtil::EndsWithNoCase(path, ".cue") ||
884-
StringUtil::EndsWithNoCase(path, ".img") || StringUtil::EndsWithNoCase(path, ".iso") ||
885-
StringUtil::EndsWithNoCase(path, ".chd") || StringUtil::EndsWithNoCase(path, ".ecm") ||
886-
StringUtil::EndsWithNoCase(path, ".mds") || StringUtil::EndsWithNoCase(path, ".pbp") ||
884+
StringUtil::EndsWithNoCase(path, ".iso") || StringUtil::EndsWithNoCase(path, ".chd") ||
885+
StringUtil::EndsWithNoCase(path, ".ecm") || StringUtil::EndsWithNoCase(path, ".mds") ||
886+
StringUtil::EndsWithNoCase(path, ".pbp") || StringUtil::EndsWithNoCase(path, ".ccd") ||
887887
StringUtil::EndsWithNoCase(path, ".m3u"));
888888
}
889889

src/duckstation-qt/gamelistwidget.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ static constexpr QSize COMPATIBILITY_PIXMAP_SIZE(96, 24);
7272

7373
static const char* SUPPORTED_FORMATS_STRING =
7474
QT_TRANSLATE_NOOP(GameListWidget, ".cue (Cue Sheets)\n"
75-
".iso/.img (Single Track Image)\n"
75+
".iso (Single Track Image)\n"
7676
".ecm (Error Code Modeling Image)\n"
7777
".mds (Media Descriptor Sidecar)\n"
78+
".ccd (CloneCD Image)\n"
7879
".chd (Compressed Hunks of Data)\n"
7980
".pbp (PlayStation Portable, Only Decrypted)");
8081

src/duckstation-qt/mainwindow.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ static constexpr const char* DEFAULT_TOOLBAR_ACTIONS =
105105
"ControllerSettings";
106106

107107
static constexpr char DISC_IMAGE_FILTER[] = QT_TRANSLATE_NOOP(
108-
"MainWindow",
109-
"All File Types (*.bin *.img *.iso *.cue *.chd *.cpe *.ecm *.mds *.pbp *.elf *.exe *.psexe *.ps-exe *.psx *.psf "
110-
"*.minipsf *.m3u *.psxgpu);;Single-Track Raw Images (*.bin *.img *.iso);;Cue Sheets (*.cue);;MAME CHD Images "
111-
"(*.chd);;Error Code Modeler Images (*.ecm);;Media Descriptor Sidecar Images (*.mds);;PlayStation EBOOTs (*.pbp "
112-
"*.PBP);;PlayStation Executables (*.cpe *.elf *.exe *.psexe *.ps-exe, *.psx);;Portable Sound Format Files (*.psf "
113-
"*.minipsf);;Playlists (*.m3u);;PSX GPU Dumps (*.psxgpu *.psxgpu.zst *.psxgpu.xz)");
108+
"MainWindow", "All File Types (*.bin *.iso *.cue *.chd *.cpe *.ecm *.mds *.pbp *.ccd *.elf *.exe *.psexe *.ps-exe "
109+
"*.psx *.psf *.minipsf *.m3u *.psxgpu);;Single-Track Raw Images (*.bin *.img *.iso);;Cue Sheets "
110+
"(*.cue);;MAME CHD Images (*.chd);;Error Code Modeler Images (*.ecm);;Media Descriptor Sidecar Images "
111+
"(*.mds);;CloneCD Images (*.ccd);;PlayStation EBOOTs (*.pbp *.PBP);;PlayStation Executables (*.cpe "
112+
"*.elf *.exe *.psexe *.ps-exe, *.psx);;Portable Sound Format Files (*.psf *.minipsf);;Playlists "
113+
"(*.m3u);;PSX GPU Dumps (*.psxgpu *.psxgpu.zst *.psxgpu.xz)");
114114

115115
static constexpr char IMAGE_FILTER[] = QT_TRANSLATE_NOOP("MainWindow", "Images (*.jpg *.jpeg *.png *.webp)");
116116

src/util/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ add_library(util
55
audio_stream.h
66
cd_image.cpp
77
cd_image.h
8+
cd_image_ccd.cpp
89
cd_image_cue.cpp
910
cd_image_chd.cpp
1011
cd_image_device.cpp

src/util/cd_image.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ std::unique_ptr<CDImage> CDImage::Open(const char* path, bool allow_patches, Err
9696
{
9797
image = OpenPBPImage(path, error);
9898
}
99+
else if (StringUtil::EqualNoCase(extension, "ccd"))
100+
{
101+
image = OpenCCDImage(path, error);
102+
}
99103
else if (StringUtil::EqualNoCase(extension, "m3u"))
100104
{
101105
// skip applying patches to the main path, which isn't a real disc

src/util/cd_image.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class CDImage
196196
static std::unique_ptr<CDImage> OpenCHDImage(const char* path, Error* error);
197197
static std::unique_ptr<CDImage> OpenMdsImage(const char* path, Error* error);
198198
static std::unique_ptr<CDImage> OpenPBPImage(const char* path, Error* error);
199+
static std::unique_ptr<CDImage> OpenCCDImage(const char* path, Error* error);
199200
static std::unique_ptr<CDImage> OpenM3uImage(const char* path, bool apply_patches, Error* error);
200201
static std::unique_ptr<CDImage> OpenDeviceImage(const char* path, Error* error);
201202
static std::unique_ptr<CDImage> CreateMemoryImage(CDImage* image, ProgressCallback* progress, Error* error);

0 commit comments

Comments
 (0)