Repository navigation
Load the game from its path when the frontend gives no data - #219
Open
sunlollyking wants to merge 1 commit into
Open
sunlollyking wants to merge 1 commit into
sunlollyking wants to merge 1 commit into
Conversation
melonDS asks for the game in memory, but a frontend that can't load it there, such as Kodi when a game is too big for the memory it has, gives only the path. LoadROM() then copied from a null pointer and melonDS ran an empty cart, which crashes on some games. Without data the ROM is now read from the path, straight into the cart with no second copy, and a path that can't be opened fails the load. retro_reset() loads the game again the same way: it kept the frontend's retro_game_info pointer, which isn't guaranteed to outlive retro_load_game().
sunlollyking
added a commit
to sunlollyking/game.libretro.melonds
that referenced
this pull request
Oct 29, 2026
Carries libretro/melonDS#219 until it is merged. When game.libretro can't give melonDS the game in memory it passes only the path, and melonDS ran an empty cart, which crashes on some games. It now reads the game from the path, and loads it again the same way on reset.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
melonDS asks for the game in memory, but a frontend that can't load it there gives only the path. Kodi does this when a game won't fit in the memory it has.
NDS::LoadROM()then copied from a null pointer and melonDS ran an empty cart, which crashes on some games.With no data, the ROM is now read from
info->pathwith the existingNDS::LoadROM(path), which reads straight into the cart, so there's no second copy. A path that can't be opened fails the load. The GBA slot does the same.retro_reset()loads the game again the same way. It used to go through the frontend'sretro_game_infopointer, butpersistent_dataonly keeps the data, not the struct, so a frontend that builds it on the stack left it dangling.Tested in Kodi on Linux with a DS game padded past Kodi's in-memory limit, so Kodi passed only the path. Before: an empty cart ("Game code:" blank, "ROM entry not found"). After: the game loads (YK6E), and loads again on reset. Loading from memory, and resetting, work as before.