Skip to content

Commit

Permalink
cfg macro
Browse files Browse the repository at this point in the history
  • Loading branch information
pineman committed Aug 10, 2024
1 parent ed2a59a commit 25673f6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions fpt-egui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,17 @@ impl FPT {
bootrom: bootrom.clone(),
..Default::default()
};
#[cfg(not(target_arch = "wasm32"))]
if std::env::var("CI").is_err() {
if let Ok(rom) = std::fs::read(rom_path) {
fpt.gb.load_rom(&rom);
} else {
panic!("Unable to open {}", rom_path);
if cfg!(target_arch = "wasm32") {
fpt.gb.cpu_mut().set_paused(true);
} else {
if std::env::var("CI").is_err() {
if let Ok(rom) = std::fs::read(rom_path) {
fpt.gb.load_rom(&rom);
} else {
panic!("Unable to open {}", rom_path);
}
}
}
#[cfg(target_arch = "wasm32")]
app.gb.cpu_mut().set_paused(true);
// XXX duplicated logic from fpt-cli main.rs
if let Some(BootromToFake::DMG0) = bootrom {
fpt.gb.boot_fake();
Expand Down

0 comments on commit 25673f6

Please sign in to comment.