How are .fs files created?
-
Hi all,
I've been working on a Python GameList generator and I've been reading in .hi and .nv files to create high score information in each game's description for my ES theme. I've had reasonable success so far https://r3dstar.co.uk/ .I've been trying to figure out .fs files and through a single post on one site I found it looks like the file is compressed, with the compressed data starting from byte 76.
The byte in yellow is the length of the data and the block within borders is the compressed data. The blue bytes is ccastles in ASCII.In Python I've extracted the bytes in the range and decompressed using zlib.
filepath = 'Z:/roms/arcade/fbneo/ccastles.fs' file = open(filepath,"rb") bArray = file.read() dataLength = bArray[24] decompressed = zlib.decompress(bArray[76:76+dataLength]) print(decompressed) f = open("Z:/roms/arcade/fbneo/ccastles.txt","wb",) f.write(bytearray(decompressed)) f.close()
What I've ended up with are bytes I can't identify a high score in. It's as if the decompression has messed something up. I should be able to see a highscore for Crystal Castles of
33822 DAZ.
Any ideas where I'm going wrong? -
Why not look in the source ?
-
@mitu Thanks for the link. I did start to look into the source code but couldn't find the script that dealt with this specific point. Not a C++ person so this is giving me a good reason to get my head around this before I start a summer project in Unreal Engine 5.
Even having a quick look, .fs = Full Scan! So it includes more than just scores which is good to know. -
@r3dstar said in How are .fs files created?:
It's as if the decompression has messed something up. I should be able to see a highscore for Crystal Castles of
33822 DAZdoes it work using mame cores ? mame uses uncompressed nvrams, so if it doesn't appear there either, i guess that would mean that data is encrypted and not something you can easily extract.
-
@barbudreadmon Not sure, I'll try later. fbneo does also create .nv and .hi files, but for some Atari games, a .fs file is created. Tempest, Gauntlet and Crystal Castles all kicked out a .fs file
-
@r3dstar nv files are handled by an eeprom device which i think is saving the bytes sequentially (which might make them more readable in some way, assuming that eeprom is not encrypted), while fs are a direct memcpy of a memory pointer, meaning they are probably endianized in some way (could be big or little depending on the emulated board). Normaly those fs files only contain the required memory pointers, in the case of
ccastles
it would be the 2 eerom pointers associated with the 2 x2212 chips of that board. -
@barbudreadmon Interesting. Following from earlier, I've just switched to mame2003 and it kicked out a .nv which I've opened and I've been able to identify the first three scores 32199, 30000 and 30000.
The daft thing is, the bytes look very similar to the decompressed bytes I got from the .fs file, if I took half the preceding zeros off. I think I was nearly there. Here's the decompressed bytes from the fbeno .fs file on the left and the .nv file from mame2003 on the right
Rather enjoying this, but this image keeps popping into my head.
/////////////////////EDIT///////////////////
Re: How are .fs files created?
OK, so I've nailed the .nv that mame2003 created, but going to try and nail how the data I've decompressed form the .fs file is structured... so close I can taste it.
<game> <name>118 : Crystal Castles</name> <video>/mnt/usbhd/videos/ccastles.mp4</video> <path>/mnt/usbhd/roms/arcade\ccastles.zip</path> <image>/mnt/usbhd/images/arcade\ccastles.png</image> <marquee>~/.emulationstation/themes/carbon-2022/art/systems/arcade.svg</marquee> <releasedate>19700101T001720</releasedate> <favorite>true</favorite> <desc>Crystal Castles (Atari, 1983) Arcade DAZ 32199 FXL 30000 FXL 30000 </desc> </game>
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.