Repository navigation
Load the game from its path when the frontend gives no data - #219
Merged
Merged
Conversation
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.
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, as does a Slot 1/2 boot whose GBA game can't be loaded. 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
force-pushed
the
load-from-path
branch
from
November 15, 2026 13:08
4eeac74 to
a194603
Compare
kel-mo
added a commit
to kel-mo/tv.kodi.Kodi
that referenced
this pull request
Nov 20, 2026
Update the add-ons to the tip of their branches, and these cores to the commits their add-ons now pin: Beetle PCE, Beetle Saturn, FCEUmm, Gearsystem, Hatari, LRPS2, MAME 2003-Plus, melonDS, mGBA, PPSSPP, PrBoom, VBA-M and Virtual Jaguar. Carries that are now upstream are dropped: game.libretro's own system folder (kodi-game/game.libretro#222), PPSSPP's log callback (hrydgard/ppsspp#23074), melonDS building without OpenGL (libretro/melonDS#215) and imagedecoder.svg's size bound (xbmc/imagedecoder.svg#7). The melonDS add-on also dropped its patch for loading from a path, now in the core (libretro/melonDS#219). Three cores need more than a new pin. game.libretro.mgba now builds upstream mGBA, so it is built with CMake here. The Hatari core links libm only into the standalone program, and the core is linked here with --no-undefined, so libm is added to its link. game.libretro.gearsystem dropped its core version patch, so it is dropped here too.
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.