How do you save SRAM on MasterED?

Discussion in 'Everdrive Master System - Master Everdrive' started by phoenixdownita, Jan 19, 2013.

  1. phoenixdownita

    phoenixdownita Spirited Member

    Joined:
    Apr 29, 2012
    Messages:
    160
    Likes Received:
    8
    How do you save the SRAM on MasterED?

    It seems like you have to precreate 32KB long files beforehand and then use them with the save to SD feature?
    Is there a way to have the MasterED create the file by itself asking for names thru a virtual keyboard?
    Or am I doing something wrong?
     
  2. Chilly Willy

    Chilly Willy Robust Member

    Joined:
    Mar 15, 2011
    Messages:
    242
    Likes Received:
    0
    The issue is the filesystem - it's tough to get a FULL filesystem that can create files on a tiny 8-bit computer. So both the MasterED and the SMS Myth require you to create the save file ahead of time at the proper size and with the proper name. The filesystem then merely finds the file just the same as for reading the file, then writes the sectors directly overwriting the data already in the file. It cannot change the length or position on the disc, only overwrite existing data.

    There's only a couple SMS games that have sram in any case, so requiring the user to create those couple of files themselves is not too much of a hardship. It saves a LOT of headaches in trying to cram a full filesystem into the SMS.
     
  3. butfluffy

    butfluffy Robust Member

    Joined:
    Aug 17, 2012
    Messages:
    204
    Likes Received:
    3
    i purchased my master ed a little while back but i've been busy playing some 360 games lately so i aint played a lot with the master system. i dodn't know anything about this. is there a list of master system games that use sram? also how do you create 32kb long files beforehand and whats the proper filename? i gather it will need to be the same as the rom name but what filename extension should it be? also where would the precreated sram file be placed on the sd?
     
  4. keropi

    keropi Familiar Face

    Joined:
    Feb 2, 2011
    Messages:
    1,071
    Likes Received:
    70
    I don't remember creating any sram files for my MasterED...

    edit:
    of course Chilly Willy is correct as always, I have only tester Golden Axe Warrior... it worked after power cycles so I just thought that it created sram files automatically... one should be VERY careful when writing the SRAM back to the cart via the menu, you can destroy your rom file LOL , I just did it with GAW

    Is there a list or a download with all empty SRAM files for the SMS? or a place to get an empty one?
     
    Last edited: Jan 20, 2013
  5. butfluffy

    butfluffy Robust Member

    Joined:
    Aug 17, 2012
    Messages:
    204
    Likes Received:
    3
    there should be a small tutorial about this issue. i cant find any mention of it on krikzz's website. an empty sram file and knowing all the games that use sram would be handy. how exactly did you destroy the rom file? some more info on what to and what not to do regarding sram saves on the master everdrive would be cool :)
     
  6. keropi

    keropi Familiar Face

    Joined:
    Feb 2, 2011
    Messages:
    1,071
    Likes Received:
    70
    Well, I chose to "save sram file" and selected the GAW rom... it's first 32kb were overwritten with the sram contents and ofcourse the rom did not work after that.
    I also agree with the tutorial/empty sram file, I had NO idea all that time that the MasterED does not create sram files automatically...
     
  7. butfluffy

    butfluffy Robust Member

    Joined:
    Aug 17, 2012
    Messages:
    204
    Likes Received:
    3
    if it's a matter of selecting the rom instead of the sram file by mistake that breaks the roms then i gather that can be easily avoided by taking extra care while using sram functions. i doubt it will happen again now you know. without a tutorial though i gather others might make the same mistake first time using the function. chilly willy is there any chance you could upload a blank sram file? i may sound like a complete noob but i'm not sure how to make one without any info.
     
  8. phoenixdownita

    phoenixdownita Spirited Member

    Joined:
    Apr 29, 2012
    Messages:
    160
    Likes Received:
    8
    Glad to know it wasn't only me.

    Anyway this is how I did it. I created a Directory called MS-Everdrive and inside of it a subdir called SAVE.
    The I copied onto the save directory a SG-1000 game that is 32KB (there are quite a few you can pick anyone), and renamed the file for the game I cared (in my case it was Golden Axe Warrior).

    Then I played the game and restarted MasterED and used "save to SD" function to use the file I just created early.
    I use the convention to name the file exactly as the game rom but replace the .sms with a .sav extension, I am pretty sure there are other viable schemas.

    The painful part is to create a different .sav for each game that supports the feature (a list would come in handy) and remember to actually save the SRAM. One nice thing about MasterED is that SRAM is actually FeRAM chip that keeps the content upon power cycle. That way you can discover after the fact if the game allows Save, once you saved in the game you can take your SD to your computer and create the file at the moment with the name you like, then go back to MasterED and use the "save to SD" feature, so if you have a computer available you can wait until you discover the need. Another way would be for someone with the list of SRAM games to create one save file for each, put it in a directory and zip it and give it to everyone else, but then ROM names may not match (not that it matters now but if autoload is implemented it may matter, read more).

    It works, it is not optimal but it's workable. Of course every time before loading a game you would have to remember to reload the SRAM from SD. I would have appreciated an automated way to at least do this part. But then again the Altera Max II CPLD used on MasterED is likely the smallest of the Max II (the one close with the minimum amount of gates) so I suspect there's not much space left to implement this feature, although maybe there's enough Flash left to add to the OS load game routine a piece that first loads the SRAM from SD if the right file exists at the right spot.
    If I understand the way MasterED works the OS is executed by the SMS Z80 so I suspect that if there's enough CPLD Flash left maybe a future OS could implement "SRAM autoload" (simple name matching in a specific directory like MegaED does).

    Anyway, now we know and we can avoid overwriting the game roms ;-)
     
    Last edited: Jan 20, 2013
  9. butfluffy

    butfluffy Robust Member

    Joined:
    Aug 17, 2012
    Messages:
    204
    Likes Received:
    3
    ahh i see. the everdrive menu allows you to browse the sd and backup restore sram manually. thats why i was asking where the save file needed to be placed in case the everdrive os looked for the saves in a specific location on the sd card. this makes sense now. anyone who owned old type backup units in the past will be used to restoring and backing up sram manually. i used to do this all the time with my snes super wild card, megadrive super magic drive and the old n64 doctor v64 mempak tool and it's no hassle. good thinking placing all the sav files in a save folder this reduces the risk of overwritting roms in the rom folder. i didn't realise you could use any 32kb file and it would be overwritten with sav data, for some reason i thought i would need to create a compatible file or something lol (doh!)
    anyhow thanks for the info, you have made things a lot clearer to me. all i need now is that damn list of games using sram so i can make those .sav files :)
     
  10. keropi

    keropi Familiar Face

    Joined:
    Feb 2, 2011
    Messages:
    1,071
    Likes Received:
    70
    yes, that save list would be EXTREMELY helpful!
     
  11. Chilly Willy

    Chilly Willy Robust Member

    Joined:
    Mar 15, 2011
    Messages:
    242
    Likes Received:
    0
    The filesystem is part of the menu, not the CPLD. Remember that the SMS uses 16KB pages for its memory management (bank switching), so all code/data must fit into 16, 32, or 48 KB of space, depending on where your hardware is, and how you use the three main banks. It's nearly impossible to get a full FAT filesystem with writing into 16KB of space, so you go with a partial filesystem. There's a reason old 8-bit systems with floppies used very simple filesystems.

    Someone with the time and gumption could probably write a full FAT filesystem for the SMS, but it is too much work for what you get, in my opinion.

    List of SMS games using sram:
    Golden Axe Warrior
    Golfamania
    Miracle Warriors: Seal of the Dark Lord
    Monopoly
    Penguin Land
    Phantasy Star
    Ultima IV: Quest of the Avatar
    Ys: The Vanished Omens
     
  12. keropi

    keropi Familiar Face

    Joined:
    Feb 2, 2011
    Messages:
    1,071
    Likes Received:
    70
    awesome! thanks for the list Chilly Willy!

    also a tip: to create a blank file with any size you want you can use the FSUTIL program that comes with windows, just type this in the command prompt: FSUTIL file createnew c:\32kb.srm 32768
    and it will make a 32kb file filled with zeroes called 32kb.srm in C:\ , just rename to the rom's name for ease of use

    edit: here's the blank sram in case you don't have windows...
     

    Attached Files:

    Last edited: Jan 20, 2013
  13. DECADER

    DECADER Newly Registered

    Joined:
    Apr 12, 2013
    Messages:
    1
    Likes Received:
    0
    Wait so how exactly does this work? I rename the file keropi posted to -for example- Phantasy Star.sav (i assume .sav is the right extension, right?), then tell MasterED to load SRAM from SD or whatever? Then what, do I need to used the save to SD option, or do I load the save from SD before playing the game each time?
     

Share This Page