Save System
MD Engine supports saving with on both the Flash memory and the SRAM memory, you can change the way of saving on the Settings.
For you there won't be any difference on using Flash or SRAM saving as MD Engine manages that internally.
You only need to select what you want on the settings menu, but nonetheless, we've outlined a few important things about each of the systems so all information is presented properly so you can choose the best option.
Saving Procedure
The saving procedure consists on either Game Data Save or Game Data Load events.
Each of these events takes a process script.
Process Script
The process script has the responsibility of processing the variables and arrays to the save system.
- Game Data Process - Saves or loads the selected variable into the save system.
- Game Data Process Array - Saves or loads the selected array into the save system.
If you need to patch the game, be aware removing variables from the process script is very risky.
Adding a new variable is less risky, but make sure to test properly.
Saving Types
There are two types of saving systems: Flash Saving and SRAM Saving.
Flash Saving
Flash saving relies on modifying the end part of the flash chip where the game is stored.
MD Engine uses the SGDK flash saving module and save manager which supports the following features:
- Wear leveling - The module intelligently appends data in an efficient way to avoid flash chip wear as much as possible. The mechanism is specially efficient if you use small slots with big flash sectors.
- Safe save - The module avoids data loss even in the case of a power cut while data is being saved. In this case, the incomplete save condition is detected on initialization, and data is corrected, so you can keep the last data set properly recorded before the incomplete save was initiated.
Flash Saving restrictions
Saving directly to the flash has one clear advantage, you don't need extra parts on your PCB like SRAM, a battery, etc or FRAM chip. Your data will also last longer since there’s no battery to run out.
On the other hand, there are a few limitations you should be aware:
- Smaller ROM space - The save data area takes space from your game. It's something to plan for if your game is going to be large.
- No Music or Sounds while saving - Most save functions stop the audio. This means you can't play music or sound during saving.
These are normally not a big deal, but sometimes they can be serious enough that you might prefer using an SRAM saving instead.
If you use our desktop or web exports, this won't affect you. That's why this is not on the restrictions list, but it's still worth mentioning.
There is no emulator support currently for flash saving!
So if you were planning on using any other emulator besides our desktop or web export, be aware of this!
SRAM Saving
SRAM saving fallbacks to the usage of the classic static RAM (SRAM) chip + battery module or ferroelectric RAM (FRAM) chip, which doesn't need a battery but it's more expensive.
You need to be aware of this if you are planning to produce your own games and ship them to your players as SRAM normally relies on CR2032 lithium batteries, which may have complicated shipping procedures.
Beyond the shipping concerns, cartridge costs may be higher than when using regular flash saving, but you won't be limited to the previous restrictions.