Skip to content

Commit

Permalink
Skip memory test on boot
Browse files Browse the repository at this point in the history
  • Loading branch information
twvd committed Nov 16, 2024
1 parent d13011c commit 48e9987
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
nursery = { level = "deny", priority = -1 }

cast_possible_truncation = "allow"
cognitive_complexity = "allow"
doc_markdown = "allow"
option_if_let_else = "allow"
missing_const_for_fn = "allow"
Expand Down
10 changes: 9 additions & 1 deletion core/src/mac/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ where
let sound_alt_start = ram_size - Self::SOUND_ALT_OFFSET;
let sound_main_start = ram_size - Self::SOUND_MAIN_OFFSET;

Self {
let mut bus = Self {
cycles: 0,
model,
trace: false,
Expand Down Expand Up @@ -128,7 +128,15 @@ where
scsi_enable: true,
speed: EmulatorSpeed::Accurate,
last_audiosample: 0,
};

// Disable memory test
if let Some((addr, value)) = model.disable_memtest() {
info!("Skipping memory test");
bus.write_ram(addr, value);
}

bus
}

pub(crate) fn get_audio_channel(&self) -> AudioReceiver {
Expand Down
10 changes: 9 additions & 1 deletion core/src/mac/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt::Display;

use crate::{keymap::Keymap, tickable::Ticks};
use crate::{bus::Address, keymap::Keymap, tickable::Ticks};

pub mod adb;
pub mod audio;
Expand Down Expand Up @@ -83,6 +83,14 @@ impl MacModel {
Self::SE | Self::Classic => cycles % 16 >= 4,
}
}

pub const fn disable_memtest(self) -> Option<(Address, u32)> {
match self {
Self::Early128K | Self::Early512K => None,
Self::Plus => Some((0x0002AE, 0x0040_0000)),
Self::SE | Self::Classic => Some((0x000CFC, 0x574C5343)),
}
}
}

impl Display for MacModel {
Expand Down

0 comments on commit 48e9987

Please sign in to comment.