dMZX Forums: Reading counters from SAV files - dMZX Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Reading counters from SAV files

#1 User is offline   CJA 

  • «≡larch bucket≡»
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,262
  • Joined: 23-June 05
  • Gender:Male
  • Location:......@.c....

Posted 09 March 2016 - 10:06 PM

Hello, it's me.

How does one use the file access commands to read the values of counters from MZX save game (.SAV) files (without loading the game, of course)? I was thinking that this could be pretty awesome for games that use custom save/load menus. The obvious use case is reading data from the save to identify each save file: how long it's been played, the time it was last played, the level, the player's name, the in-game location, or completion percentage.

Just thought this would be a cool Robotic experiment that goes beyond what I already know about the world and save file formats.
Need a dispenser here.
0

#2 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,936
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 10 March 2016 - 03:24 AM

Check out the old version save loader packaged with 'red' - it does exactly this. Basically, it reads enough to find the offset where the counters and strings are saved, then reads them all in.

Obviously an easier way of accomplishing the thing you describe is just to write out an extra file for each save with that additional information. I'd be worried about my game breaking in a future version of MZX (not that there's been one of those in a while) that changes the save format if I made this kind of thing an integral part of the game - but the old version save loader with 'red' made a lot of sense because it was only created to allow saves made in older versions of 'red' to be loaded.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#3 User is offline   CJA 

  • «≡larch bucket≡»
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,262
  • Joined: 23-June 05
  • Gender:Male
  • Location:......@.c....

Posted 10 March 2016 - 04:49 PM

That's true, I didn't consider the fact that the save file might change drastically. I guess having external files with metadata would be the best way to go.
Need a dispenser here.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users