gba_save
Tools for interacting with backup media on Game Boy Advance cartridges.
The Game Boy Advance has three forms of backup media for saving data: SRAM, EEPROM, and Flash. This library provides tools for interacting with all three different types.
Example Usage
To write and read save data using SRAM, use something like the following:
use RangedUsize;
use ;
use Sram;
let mut sram = unsafe ;
let mut writer = sram.writer;
// Write some data.
//
// Note that you'll usually want to handle the error here.
writer.write.expect;
// Write some more data.
writer.write.expect;
// Read the data back.
let mut reader = sram.reader;
let mut buffer = ;
assert_eq!;
// Both things that were written will be read back.
assert_eq!;
See the documentation for more details and examples for interacting with SRAM and the other backup media types.
Optional Features
serde: Enable serializing and deserializing the various error types using theserdelibrary.log: Enable log messages using theloglibrary. Helpful for development. This is best used when paired with a logger likemgba_logornocash_gba_log.
License
This project is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.