libretro / nxengine-libretro

Port of NxEngine to the libretro API. NXEngine is a Cave Story game engine clone
85 stars 89 forks source link

Enable 'contentless' operation by automatically loading game files from frontend system directory (+ fix memory leaks) #91

Closed jdgleaver closed 2 years ago

jdgleaver commented 2 years ago

This PR allows the core to be run in 'contentless' fashion (i.e. Load Core -> Start Core) by automatically loading the game file nxengine/Doukutsu.exe from inside the frontend system directory. Game assets will be installable via the new Core System Files Downloader menu (https://github.com/libretro/RetroArch/pull/13524) once this is merged: https://github.com/libretro/libretro-system-files/pull/5

Note that regular 'Load Content' operation is unaffected.

The idea here is to facilitate operation of 'single use' cores by skipping the unnecessary manual loading of essential content, and to enable the frontend to automatically place said content in the correct location. This is a required step for the planned addition of a RetroArch menu tab for launching 'single use' cores in a more refined manner.

While doing this, I noticed that the core leaks most of the memory that it allocates. This PR additionally fixes this issue.