Skip to content

GB_load_state_from_buffer

Lior Halphon edited this page Nov 30, 2024 · 4 revisions

Definition

int GB_load_state_from_buffer(GB_gameboy_t *gb, const uint8_t *buffer, size_t length);

In save_state.h

Description

Loads a snapshot of an emulation state of the emulator instance from buffer with size length. Returns 0 on success, EIO if the buffer is too short, and -1 on other failures. Detailed error messages will be written to the log on failure.

Thread Safety

GB_load_state_from_buffer must not be called if the instance is being run in any thread, including the current one (via a callback).

Notes

SameBoy follows the BESS specification and will load save states from other BESS-compliant emulators.

Loading a save state will fail if the save state's model is from a different model family. Loading a save state from a different model in the same model family will not change the current model in the emulator instance. If this behavior is not desired, call GB_switch_model_and_reset with the correct model before loading the save state.

See Also

Clone this wiki locally