mirror of
https://github.com/FranLMSP/snes.git
synced 2026-01-01 07:21:35 -05:00
fix bug when loading different roms
This commit is contained in:
@@ -20,6 +20,7 @@ impl LoROM {
|
||||
|
||||
impl ROM for LoROM {
|
||||
fn load(&mut self, filename: &str) -> std::io::Result<bool> {
|
||||
self.data = vec![];
|
||||
load_rom(filename, &mut self.data)
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ pub fn build_menu_bar(emulator: &mut Emulator, ui: &mut egui::Ui, state: &mut Ap
|
||||
if ui.button("Load ROM file").clicked() {
|
||||
if let Some(path) = rfd::FileDialog::new().pick_file() {
|
||||
let picked_path = path.display().to_string();
|
||||
// TODO: replace this load function by an external function as each ROM may not always be LoROM
|
||||
match emulator.bus.rom.load(&picked_path) {
|
||||
Ok(_) => {
|
||||
emulator.hard_reset();
|
||||
|
||||
Reference in New Issue
Block a user