if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (strcmp(var.value, "async") == 0)
+ {
Config.AsyncCD = 1;
- else
+ Config.CHD_Precache = 0;
+ }
+ else if (strcmp(var.value, "sync") == 0)
+ {
Config.AsyncCD = 0;
+ Config.CHD_Precache = 0;
+ }
+ else if (strcmp(var.value, "precache") == 0)
+ {
+ Config.AsyncCD = 0;
+ Config.CHD_Precache = 1;
+ }
}
#endif
{
"pcsx_rearmed_async_cd",
"CD Access Method (Restart)",
- "Select method used to read data from content disk images. 'Synchronous' mimics original hardware. 'Asynchronous' can reduce stuttering on devices with slow storage.",
+ "Select method used to read data from content disk images. 'Synchronous' mimics original hardware. 'Asynchronous' can reduce stuttering on devices with slow storage. 'Precache' loads disk image into memory for faster access (CHD only).",
{
- { "sync", "Synchronous" },
- { "async", "Asynchronous" },
+ { "sync", "Synchronous" },
+ { "async", "Asynchronous" },
+ { "precache", "Precache" },
{ NULL, NULL},
},
"sync",
goto fail_io;
if(chd_open(isofile, CHD_OPEN_READ, NULL, &chd_img->chd) != CHDERR_NONE)
- goto fail_io;
+ goto fail_io;
+
+ if (Config.CHD_Precache && (chd_precache(chd_img->chd) != CHDERR_NONE))
+ goto fail_io;
chd_img->header = chd_get_header(chd_img->chd);