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 770783 - [nes] Serialization/deserialisation fails
[nes] Serialization/deserialisation fails
Status: RESOLVED FIXED
Product: gnome-games
Classification: Core
Component: general
unspecified
Other Linux
: High critical
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks: 772081
 
 
Reported: 2016-09-03 11:05 UTC by Mathieu Bridon
Modified: 2017-01-24 10:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
retro: Be more tolerant about serialization sizes (1.88 KB, patch)
2016-11-28 08:40 UTC, Mathieu Bridon
committed Details | Review

Description Mathieu Bridon 2016-09-03 11:05:48 UTC
The libretro wiki says this is supposed to work.

However, when trying to resume the game, I get this message in the terminal:

** (gnome-games:2): WARNING **: application-window.vala:300: [/app/lib/retro-1.0/plugins/nestopia_libretro.so] Unexpected serialization data size: got 21380, expected 21400

Is this a bug in Games or in the nestopia core?
Comment 1 Mathieu Bridon 2016-11-28 08:40:31 UTC
Created attachment 340882 [details] [review]
retro: Be more tolerant about serialization sizes

We are having problems with Nestopia, which returns 21400 the first
time, and then 21380 every time after that.

With the current code, which checks for equality, we always fail to
deserialize the Nestopia saved states.

The libretro.h header has this to say about the function:

    // Returns the amount of data the implementation requires to serialize internal state (save states).
    // Beetween calls to retro_load_game() and retro_unload_game(), the returned size is never allowed to be larger than a previous returned value, to
    // ensure that the frontend can allocate a save state buffer once.

They seem to implicitly acknowledge that this value can change, but that
it can only ever be smaller than a previous value.

This commit changes the check for equality into a check for inferiority,
which makes loading a saved state for Nestopia work.
Comment 2 Adrien Plazas 2017-01-24 10:49:45 UTC
The following fixes have been pushed:
Comment 3 Adrien Plazas 2017-01-24 10:51:04 UTC
Comment on attachment 340882 [details] [review]
retro: Be more tolerant about serialization sizes

Committed with changes.