feat/savestates: Add write_bin_file
util function
Former-commit-id: 88e12df1d8a88ad97756e943b4b959f73bb99c35
This commit is contained in:
parent
d887602266
commit
87999122da
|
@ -65,6 +65,6 @@ pub mod prelude {
|
|||
pub use super::core::{GBAError, GBAResult, GameBoyAdvance};
|
||||
#[cfg(feature = "debugger")]
|
||||
pub use super::debugger::Debugger;
|
||||
pub use super::util::read_bin_file;
|
||||
pub use super::util::{read_bin_file, write_bin_file};
|
||||
pub use super::{AudioInterface, InputInterface, VideoInterface};
|
||||
}
|
||||
|
|
|
@ -11,6 +11,13 @@ pub fn read_bin_file(filename: &Path) -> io::Result<Vec<u8>> {
|
|||
Ok(buf)
|
||||
}
|
||||
|
||||
pub fn write_bin_file(filename: &Path, data: &Vec<u8>) -> io::Result<()> {
|
||||
let mut f = File::create(filename)?;
|
||||
f.write_all(data)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub struct FpsCounter {
|
||||
count: u32,
|
||||
timer: time::Instant,
|
||||
|
|
Reference in a new issue