libretro-mirrors / libretro-arb

For proposed improvements to libretro API.
8 stars 2 forks source link

Serialization improvment suggestion #20

Open Monroe88 opened 9 years ago

Monroe88 commented 9 years ago

http://pastebin.com/TSeDD8ey

This was posted by someone on 4chan's /vg/ emulation general thread and was not written by me. I'm only posting it here so it gets looked at since the author of this post appears to be unwilling to post an issue on here himself.

Alcaro commented 9 years ago

I'm having trouble figuring out what that change would solve. The current method allows keeping the pointer around for multiple frames, and I'd rather keep it that way; there is no way to combine that with allowing saving and loading to go to different places. There seems to be no way to tell the core "I'm done writing here, load it in" and "I'm done reading this, free it for me", either, so the core will have to fake it by doing it on retro_run or something, and I hate that kind of implicit pointer invalidations.

A better way to improve saving and loading would be extending retro_serialize/etc to allow saying "give me the entire thing" (savestate) and "give me only the important stuff" (SRAM and similar). Perhaps something like this.

This would also get rid of the ridiculous real-time clock memory type (libsnes leftover) and merge that into the .srm (at the end for compatibility with existing stuff, but that's not really related to libretro), as well as removing retro_subsystem_memory_info. If we want to keep the files separate for whatever reason, we can probably figure something out, but it will be more complex than this proposal.

If we follow this path, we could probably remove the retro_getmemory{data,size} functions entirely, as all their functionality will have moved into serialization and the memory map env.

sergiobenrocha2 commented 6 years ago

https://github.com/ekeeke/Genesis-Plus-GX/issues/19