diff --git a/Cargo.toml b/Cargo.toml index c1a939e..6c17652 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/core/src/mac/bus.rs b/core/src/mac/bus.rs index 48feef1..33ccdb8 100644 --- a/core/src/mac/bus.rs +++ b/core/src/mac/bus.rs @@ -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, @@ -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 { diff --git a/core/src/mac/mod.rs b/core/src/mac/mod.rs index 2093250..a023e60 100644 --- a/core/src/mac/mod.rs +++ b/core/src/mac/mod.rs @@ -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; @@ -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 {