FBNeo icon indicating copy to clipboard operation
FBNeo copied to clipboard

Write uncompressed data for states and nvram

Open eadmaster opened this issue 3 years ago • 12 comments

Followup

This should help sharing the nvram files with MAME and other emulators.

eadmaster avatar Apr 16 '21 03:04 eadmaster

It would also make it easier to use those files in programs that read score files. Many games save those scores in the nvram (fs) or saveram file.

coyonut avatar Jul 04 '22 18:07 coyonut

I remember looking further into this, iirc it turned out that even if the data was uncompressed, in many systems there would still be inconsistencies between MAME and FBNeo nvrams, which defeat the purpose of uncompressing them tbh.

barbudreadmon avatar Jul 04 '22 18:07 barbudreadmon

I was thinking of taking advantage of what the hi2txt program does with those Mame nvram and if it were possible to do it with FBNeo and its fs or nv. Do you see any possibility? Would those differences make it impossible to use it uncompressed? It would be great to be able to get the valid data to work as well as it does with .hi (also from FBNeo) or Mame nvram files. In the end the data of scores inside those nvram should be the same in Mame and FBNeo, shouldn't it be?

coyonut avatar Jul 05 '22 08:07 coyonut

Do you see any possibility?

None that wouldn't definitely break compatibility with older nvrams, which is a deal breaker.

barbudreadmon avatar Jul 05 '22 08:07 barbudreadmon

yes, it seems logical to maintain backwards compatibilities. maybe as an alternative save format or so that hi2txt can read and understand fs files. Thanks for answering barbudreadmon ;)

coyonut avatar Jul 05 '22 09:07 coyonut

I've an idea to remove headers and uncompress data without breaking backward compatibility, so i'll try to implement it to lessen the discrepancies and ease the parsing of those nvrams, but the compatibility with MAME nvrams for all emulated systems won't be guaranteed.

barbudreadmon avatar Jul 05 '22 09:07 barbudreadmon

Great barbudreadmon. I hope you get it. Any progress will be welcome, even if it's a handful of more supported games. Thanks!

coyonut avatar Jul 05 '22 10:07 coyonut

Libretro port should be fine with https://github.com/libretro/FBNeo/commit/44fabff39fea401297246fe8ad9f0c9aec2658fb

@dinkc64 @tmaul @0xe1f Maybe it should be backported to other ports ? Compiling the src/burner/nvram.cpp file i added a while ago is also required.

barbudreadmon avatar Jul 05 '22 11:07 barbudreadmon

Not against the idea, I just don't want to do it until I understand the system better.

dinkc64 avatar Jul 05 '22 13:07 dinkc64

What about an option to load/save mame nvram (if supported)?

On Tue, Jul 5, 2022, 9:30 AM dinkc64 @.***> wrote:

Not against the idea, I just don't want to do it until I understand the system better.

— Reply to this email directly, view it on GitHub https://github.com/finalburnneo/FBNeo/issues/759#issuecomment-1175063902, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJC6HJFNRWX4GKB63HOOXDVSQ2IZANCNFSM43AWZKIA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

iq132 avatar Jul 05 '22 13:07 iq132

Not against the idea, I just don't want to do it until I understand the system better.

Nothing fancy :

  • when loading i try the newer unheadered/uncompressed format first (using BurnNvramLoad), then fallback to the headered/compressed format (using BurnStateLoad)
  • when saving i always use the newer unheadered/uncompressed format (using BurnNvramSave)

That way, nvrams get automatically converted to the unheadered/uncompressed format when loading a game.

What about an option to load/save mame nvram (if supported)?

Not against the idea, the unheadered/uncompressed format is way bigger (my 500B neogeo nvram became a 65KB nvram) so it feels like wasting disk space tbh.

barbudreadmon avatar Jul 05 '22 14:07 barbudreadmon

I'm just worried about the bugs that will come with those changes.... I make more bugs when I actually write code :P

btw there probably is no change in disk usage either way (cluster size)

best regards,

  • dink

dinkc64 avatar Jul 05 '22 14:07 dinkc64