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
Sourcenew(root : Path = self.class.default_root)
SourceClass methods
default_root
The application may inspect the platform-default root while tests and alternate frontends inject a different root through the initializer.
Instance methods
cartridge_save_path(game_id : String) : Path
Sourceclear_recent_roms
Sourceload(machine : Core::Machine, bus : Core::WonderSwanBus, rom_id : String, slot : Int32 = 0) : Path
Sourceload_cartridge_save(bus : Core::WonderSwanBus, game_id : String) : Nil
Sourcepath(rom_id : String = "demo", slot : Int32 = 0) : Path
Sourcerecent_roms
Sourcerecent_roms_path
Sourcerecord_recent_rom(path : String) : Nil
Sourcesave(machine : Core::Machine, bus : Core::WonderSwanBus, rom_id : String, slot : Int32 = 0) : Path
Sourcesave_cartridge_save(bus : Core::WonderSwanBus, game_id : String) : Path | Nil
Sourcesave_settings(values : Hash(String, String)) : Nil
Sourcesave_window_position(x : Int32, y : Int32) : Nil
Sourcesettings
Sourcesettings_path
Sourcestate_exists?(rom_id : String, slot : Int32) : Bool
Sourcestate_slot_labels(rom_id : String) : Array(String)
Sourcewindow_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.