[PR #2808] [CLOSED] Add CHD precache support #1173

Open
opened 2026-01-29 19:15:39 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/stenzek/duckstation/pull/2808
Author: @realnc
Created: 1/23/2022
Status: Closed

Base: masterHead: duckstation_chd_precache


📝 Commits (1)

📊 Changes

23 files changed (+133 additions, -76 deletions)

View changed files

📝 src/common/cd_image.cpp (+10 -10)
📝 src/common/cd_image.h (+23 -11)
📝 src/common/cd_image_bin.cpp (+4 -4)
📝 src/common/cd_image_chd.cpp (+15 -4)
📝 src/common/cd_image_cue.cpp (+4 -4)
📝 src/common/cd_image_device.cpp (+5 -5)
📝 src/common/cd_image_ecm.cpp (+4 -4)
📝 src/common/cd_image_m3u.cpp (+5 -5)
📝 src/common/cd_image_mds.cpp (+4 -4)
📝 src/common/cd_image_memory.cpp (+3 -3)
📝 src/common/cd_image_pbp.cpp (+3 -3)
📝 src/common/cd_image_ppf.cpp (+4 -4)
📝 src/core/host_interface.cpp (+1 -0)
📝 src/core/settings.cpp (+2 -0)
📝 src/core/settings.h (+1 -0)
📝 src/core/system.cpp (+8 -4)
📝 src/duckstation-qt/consolesettingswidget.cpp (+14 -0)
📝 src/duckstation-qt/consolesettingswidget.h (+1 -0)
📝 src/duckstation-qt/consolesettingswidget.ui (+12 -5)
📝 src/duckstation-qt/gamepropertiesdialog.cpp (+3 -3)

...and 3 more files

📄 Description

This uses the chd_precache() function of libchdr which just loads the
CHD image to memory without decompressing it. So this is "weaker" than
the full preload to RAM option, which fully decompresses the CHD image,
but it still solves the problem of having the CHD images stored on
unreliable network storage.

The point of this is to be able to use M3U files to run multi-disc games
and still be able to work around unreliable storage. The full preload to
RAM option does not work with M3U files. This option does.

CHD precache is ignored (and the option disabled in the UI) if the full
preload to RAM option is enabled.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/stenzek/duckstation/pull/2808 **Author:** [@realnc](https://github.com/realnc) **Created:** 1/23/2022 **Status:** ❌ Closed **Base:** `master` ← **Head:** `duckstation_chd_precache` --- ### 📝 Commits (1) - [`3c897e3`](https://github.com/stenzek/duckstation/commit/3c897e35b5a503a828d22a584b46afa2294648b6) Add CHD precache support ### 📊 Changes **23 files changed** (+133 additions, -76 deletions) <details> <summary>View changed files</summary> 📝 `src/common/cd_image.cpp` (+10 -10) 📝 `src/common/cd_image.h` (+23 -11) 📝 `src/common/cd_image_bin.cpp` (+4 -4) 📝 `src/common/cd_image_chd.cpp` (+15 -4) 📝 `src/common/cd_image_cue.cpp` (+4 -4) 📝 `src/common/cd_image_device.cpp` (+5 -5) 📝 `src/common/cd_image_ecm.cpp` (+4 -4) 📝 `src/common/cd_image_m3u.cpp` (+5 -5) 📝 `src/common/cd_image_mds.cpp` (+4 -4) 📝 `src/common/cd_image_memory.cpp` (+3 -3) 📝 `src/common/cd_image_pbp.cpp` (+3 -3) 📝 `src/common/cd_image_ppf.cpp` (+4 -4) 📝 `src/core/host_interface.cpp` (+1 -0) 📝 `src/core/settings.cpp` (+2 -0) 📝 `src/core/settings.h` (+1 -0) 📝 `src/core/system.cpp` (+8 -4) 📝 `src/duckstation-qt/consolesettingswidget.cpp` (+14 -0) 📝 `src/duckstation-qt/consolesettingswidget.h` (+1 -0) 📝 `src/duckstation-qt/consolesettingswidget.ui` (+12 -5) 📝 `src/duckstation-qt/gamepropertiesdialog.cpp` (+3 -3) _...and 3 more files_ </details> ### 📄 Description This uses the chd_precache() function of libchdr which just loads the CHD image to memory without decompressing it. So this is "weaker" than the full preload to RAM option, which fully decompresses the CHD image, but it still solves the problem of having the CHD images stored on unreliable network storage. The point of this is to be able to use M3U files to run multi-disc games and still be able to work around unreliable storage. The full preload to RAM option does not work with M3U files. This option does. CHD precache is ignored (and the option disabled in the UI) if the full preload to RAM option is enabled. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 19:15:39 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/duckstation#1173