Skip to content
Snippets Groups Projects
Verified Commit e4656ac0 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

chore: initial state component definition

parent 1e849c3a
No related branches found
No related tags found
1 merge request!59`StateComponent` creation and implementation
......@@ -50,6 +50,20 @@ pub const BOS_VERSION: u8 = 1;
/// Magic number for the BESS file format.
pub const BESS_MAGIC: u32 = 0x53534542;
/// Represents a component that is able to store and retrieve
/// the state of its internal structure.
///
/// This trait is used to define the behavior of the state
/// components that are used to store the emulator state.
///
/// Ideally each of Game Boy's components should implement
/// this trait to allow the state to be saved and restored
/// in a consistent way.
pub trait StateComponent {
fn get_state(&self) -> Result<Vec<u8>, Error>;
fn set_state(&mut self, data: &[u8]) -> Result<(), Error>;
}
#[cfg_attr(feature = "wasm", wasm_bindgen)]
pub enum SaveStateFormat {
/// Boytacean Save Compressed format (BOSC).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment