This repository has been archived on 2024-06-01. You can view files and clone it, but cannot push or open issues or pull requests.
rustboyadvance-ng/src/util.rs

18 lines
346 B
Rust
Raw Normal View History

use std::fs::File;
use std::io;
use std::io::prelude::*;
pub fn read_bin_file(filename: &str) -> io::Result<Vec<u8>> {
let mut buf = Vec::new();
let mut file = File::open(filename)?;
file.read_to_end(&mut buf)?;
Ok(buf)
}
#[macro_export]
macro_rules! index2d {
($x:expr, $y:expr, $w:expr) => {
$w * $y + $x
};
}