Welcome!
Final Burn Neo => FBN Discussion => Topic started by: 90sDoomer on March 30, 2021, 10:29:58 AM
-
Hi, i'm tring to import some nvrams generated with MAME into FBN.
I've made this bash script to rename the files, but the binary data inside does not seem compatible:
for f in $(find . -type f -print)
do
SAVEFILENAME="$(basename $f)"
GAMENAME="$(basename $(dirname $f))"
[ "$SAVEFILENAME" = "nvram" ] && cp "$f" "$GAMENAME.fs"
[ "$SAVEFILENAME" = "eeprom" ] && cp "$f" "$GAMENAME.nv"
[ "$SAVEFILENAME" = "saveram" ] && cp "$f" "$GAMENAME.memcard"
done
Is there a tool/some code i can use to perform the conversion?
-
It's slightly complicated I'm afraid:
first, fbn's nvram file (.fs) is compressed somehow. I'm not exactly sure how. On the other hand, if the nvram is a standard 93c46-style eeprom, its uncompressed as "romname.nv"
most 68k games have byte-swapped nvram in mame, but fbn is not byte swapped.
best regards,
- dink
-
i've investigated these ".fs" files a bit more: they have an header + Zlib compressed data starting at byte 76.
So this is the updated ver. of my script (still need to find a way to generate the complete header for those .fs files):
for f in $(find $HOME/.mame/nvram -type f -print)
do
SAVEFILENAME="$(basename $f)"
GAMENAME="$(basename $(dirname $f))"
if [ "$SAVEFILENAME" = "eeprom" ]; then
# no need to compress these
# "most 68k games have byte-swapped nvram in mame, but fbn is not byte swapped.
dd if="$f" of="$GAMENAME.nv" conv=swab
fi
if [ "$SAVEFILENAME" = "nvram" ] || [ "$SAVEFILENAME" = "saveram" ]; then
echo "FB1 FS1 " > "$GAMENAME.fs"
truncate -s 76 "$GAMENAME.fs" # makes an empty header
# TODO: generate the correct 76-bytes header
zlib-flate -compress < "$f" >> "$GAMENAME.fs"
fi
done
-
Nice work :)
a little OT:
I wanted to have fbn write uncompressed data for states and nvram data for ages now. The little bit of time it takes to compress the data causes some games to stutter while saving afar state, since we have a lot less than 1/60th of a second to work with.
Best regards,
- dink
-
I've always wondered why FBAlpha's/FBNeo's nvram files were incompatible with MAME. Now I know. Something like an nvram files should be compatible with all emulators, if you ask me. It's created/written by the emulated system -- what benefit could there possibly be for compressing it?
-
what benefit could there possibly be for compressing it?
Saving space back when HDDs could only hold a few GBs, I guess. Now it is no longer desirable.