class

Swanium::Platform::StateStore

Inherits Reference < Object

Restricts save states to Swanium's own settings directory and numbered slots, so arbitrary paths never enter the product UI.

Constants

STATE_MAGIC = "SWCSLOT1".to_slice

Constructors

default
Source
new(root : Path = self.class.default_root)
Source

Class methods

default_root

The application may inspect the platform-default root while tests and alternate frontends inject a different root through the initializer.

Source

Instance methods

cartridge_save_path(game_id : String) : Path
Source
clear_recent_roms
Source
load(machine : Core::Machine, bus : Core::WonderSwanBus, rom_id : String, slot : Int32 = 0) : Path
Source
load_cartridge_save(bus : Core::WonderSwanBus, game_id : String) : Nil
Source
path(rom_id : String = "demo", slot : Int32 = 0) : Path
Source
recent_roms
Source
recent_roms_path
Source
record_recent_rom(path : String) : Nil
Source
save(machine : Core::Machine, bus : Core::WonderSwanBus, rom_id : String, slot : Int32 = 0) : Path
Source
save_cartridge_save(bus : Core::WonderSwanBus, game_id : String) : Path | Nil
Source
save_settings(values : Hash(String, String)) : Nil
Source
save_window_position(x : Int32, y : Int32) : Nil
Source
settings
Source
settings_path
Source
state_exists?(rom_id : String, slot : Int32) : Bool
Source
state_slot_labels(rom_id : String) : Array(String)
Source
window_position

Window placement belongs with the other user preferences, rather than with a particular ROM or save-state slot. Invalid or incomplete values are ignored so an edited or older settings file falls back to centering.

Source