After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787548 - mGBA fails to save memory
mGBA fails to save memory
Status: RESOLVED FIXED
Product: gnome-games
Classification: Core
Component: retro-gtk
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2017-09-11 14:33 UTC by Alexander Mikhaylenko
Modified: 2017-09-11 14:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
retro-core: Support partially setting memory regions (1.34 KB, patch)
2017-09-11 14:50 UTC, Adrien Plazas
committed Details | Review

Description Alexander Mikhaylenko 2017-09-11 14:33:19 UTC
In mGBA, retro_get_memory_size value can be less than the actual allocated memory size. In this case, retro-gtk doesn't save it at all and fails with this:
** (gnome-games:30172): WARNING **: retro-runner.vala:442: Unexpected RAM data size: got 65536, expected 131072

See: https://github.com/libretro/mgba/blob/master/src/platform/libretro/libretro.c#L611
https://github.com/libretro/mgba/blob/master/src/platform/libretro/libretro.c#L477
https://github.com/libretro/mgba/blob/master/src/platform/libretro/libretro.c#L513

This may be either a misbehavior on mGBA side or a corner-case retro-gtk should support.
Comment 1 Adrien Plazas 2017-09-11 14:50:06 UTC
Created attachment 359533 [details] [review]
retro-core: Support partially setting memory regions

When a memory region is set with less data than expected, fill the rest
with zeros instead of failing.

This helps supporting Libretro cores with fluctuating memory sizes.
Comment 2 Adrien Plazas 2017-09-11 14:51:28 UTC
Attachment 359533 [details] pushed as e3f9193 - retro-core: Support partially setting memory regions