mvdnes / rboy

A Gameboy Emulator in Rust
MIT License
605 stars 39 forks source link

Allow Device to load rom data #19

Closed greenfox1505 closed 6 months ago

greenfox1505 commented 7 months ago

Allow Device to load by buffer instead of by rom path.

let data = fs::read(rom_name).unwrap(); //this will come from an external source
let a = Device::new_cgb_from_buffer(data,true);

I'd also like to extract the save data via Device.

I'm using rboy as a library and I want to have more control over where files save, etc.

mvdnes commented 7 months ago

I think this is a great idea! I have pushed some changes in 4a05e1e, does this cover your use cases?

greenfox1505 commented 7 months ago

Oh, cool! That was quick, I was nearly going to do it myself. The first thing I can think of to add though would be a dirty flag like the GPU so I can update only when something's changed.

mvdnes commented 6 months ago

I am closing this issue as I think the original question is answered. Feel free to make a pull request for the dirty flag feature.