Skip to content

Adding a New Save File Type

Matthew LaRocca edited this page Feb 23, 2022 · 3 revisions

Save files represent a fixed size data buffer that can be used to save game data. An example is N64 EEPROM which is built into cartridges.

In CMake the save file type is passed into the platform specific implementation of create_game via the SAVE_FILE_TYPE parameter. Each platform dependent implementation should handle this parameter in its own way (or ignore it the platform does not support this type of save data)

Desktop Build Support

In order to add support for a new save file type in the desktop build, the following steps should be taken:

  1. Add a new enumerated type to fw64SaveFile::SaveFileType in desktop/save_file.h
  2. Add an entry to fw64SaveFile::getFileSize() in save_file.cpp
  3. Add an entry to getSaveFileType() in desktop_main.cpp

N64 Modern SDK

If new save types beyond the basic EEPROM ones are added they will need to be added to the if statement in framework64.modernsdk.cmake and the rom header string updated accordingly.

For N64 the following values are accepted and written into the ROM header so that the everdrive can emulate the storage:

  • N64_EEPROM_4K
  • N64_EEPROM_16K
Clone this wiki locally