libretro / desmume

DeSmuME is a Nintendo DS emulator
http://desmume.org
GNU General Public License v2.0
35 stars 33 forks source link

Compressed Formats Writing Temporary Files to Disk. #93

Closed 0x90shell closed 1 year ago

0x90shell commented 2 years ago

Currently, compressed formats will have temporary files extracted to disk, even if the load in memory core settings are used. This seems to be due to the core setting "need_fullpath" to "true." This is only necessary for disk-based games, based on an assumption of available memory being low.

In June 2021, RA 1.9.5 added per file extension "need_fullpath" override capability to the API. If there is a reason this cannot be set to "false" for specific files, the "RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE" function can be utilized. Additionally, the "RETRO_ENVIRONMENT_GET_GAME_INFO_EXT" function can be utilized to obtain the metadata for compressed formats to find the underlying ROM extension.

By setting "need_fullpath" to false by default, compressed ROM files can be loaded directly into memory rather than extracting temporary copies to disk. This also allows soft-patching and run ahead to be utilized more efficiently. For reference, this functionality was added in the MelonDS core, and a ROM ID issue for achievement support had to be implemented.

Setting "need_fullpath" to "false" would also correct the currently open soft-patching issue: https://github.com/libretro/desmume/issues/71

References: libretro/RetroArch#12473 https://github.com/libretro/melonDS/commit/02f0f0d75b22a6976df7b87e5496baa6240520a2 libretro/melonDS#140 https://www.libretro.com/index.php/retroarch-1-9-5-released/

Augusto7743 commented 2 years ago

Please where are being written the temporary files ? NVRAM path or Temp OS path ?

0x90shell commented 1 year ago

They are being written to the directory of the rom file.

0x90shell commented 1 year ago

I updated the core and base RA recently, and the files are no longer being written to the folders. Based on memory usage, it appears they are being decompressed into memory now.