mirror of
https://github.com/FranLMSP/snes.git
synced 2026-08-03 08:30:01 -04:00
fix bug when loading different roms
This commit is contained in:
@@ -20,6 +20,7 @@ impl LoROM {
|
|||||||
|
|
||||||
impl ROM for LoROM {
|
impl ROM for LoROM {
|
||||||
fn load(&mut self, filename: &str) -> std::io::Result<bool> {
|
fn load(&mut self, filename: &str) -> std::io::Result<bool> {
|
||||||
|
self.data = vec![];
|
||||||
load_rom(filename, &mut self.data)
|
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 ui.button("Load ROM file").clicked() {
|
||||||
if let Some(path) = rfd::FileDialog::new().pick_file() {
|
if let Some(path) = rfd::FileDialog::new().pick_file() {
|
||||||
let picked_path = path.display().to_string();
|
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) {
|
match emulator.bus.rom.load(&picked_path) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
emulator.hard_reset();
|
emulator.hard_reset();
|
||||||
|
|||||||
Reference in New Issue
Block a user