From 3a6e3379f465034ec4a842162ed60fd3c99616c1 Mon Sep 17 00:00:00 2001 From: transistor Date: Wed, 20 Mar 2024 20:47:38 -0700 Subject: [PATCH] Fixed missing feature flag and clippy --- Cargo.lock | 3 +++ emulator/cpus/m68k/Cargo.toml | 2 +- emulator/cpus/m68k/src/debugger.rs | 6 +++--- emulator/cpus/m68k/src/state.rs | 10 +--------- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f09d94b..c8201a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -390,6 +390,9 @@ checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "emulator-hal" version = "0.1.0" +dependencies = [ + "femtos", +] [[package]] name = "emulator-hal-memory" diff --git a/emulator/cpus/m68k/Cargo.toml b/emulator/cpus/m68k/Cargo.toml index ee4eb8f..ff02b45 100644 --- a/emulator/cpus/m68k/Cargo.toml +++ b/emulator/cpus/m68k/Cargo.toml @@ -8,7 +8,7 @@ log = "0.4" thiserror = "1.0" femtos = "0.1" moa-parsing = { path = "../../libraries/parsing" } -emulator-hal = { path = "../../libraries/emulator-hal/emulator-hal" } +emulator-hal = { path = "../../libraries/emulator-hal/emulator-hal", features = ["femtos"] } moa-core = { path = "../../core", optional = true } diff --git a/emulator/cpus/m68k/src/debugger.rs b/emulator/cpus/m68k/src/debugger.rs index 7ae4e9c..d018421 100644 --- a/emulator/cpus/m68k/src/debugger.rs +++ b/emulator/cpus/m68k/src/debugger.rs @@ -38,7 +38,7 @@ where type Error = M68kError; - fn inspect(&mut self, info: Self::InfoType, bus: &mut Bus, writer: &mut Writer) -> Result<(), Self::Error> { + fn inspect(&mut self, info: Self::InfoType, _bus: &mut Bus, writer: &mut Writer) -> Result<(), Self::Error> { match info { M68kInfo::State => self .state @@ -77,11 +77,11 @@ where } fn add_breakpoint(&mut self, address: M68kAddress) { - self.debugger.breakpoints.push(address as u32); + self.debugger.breakpoints.push(address); } fn remove_breakpoint(&mut self, address: M68kAddress) { - if let Some(index) = self.debugger.breakpoints.iter().position(|a| *a == address as u32) { + if let Some(index) = self.debugger.breakpoints.iter().position(|a| *a == address) { self.debugger.breakpoints.remove(index); } } diff --git a/emulator/cpus/m68k/src/state.rs b/emulator/cpus/m68k/src/state.rs index caa0608..4dbe34a 100644 --- a/emulator/cpus/m68k/src/state.rs +++ b/emulator/cpus/m68k/src/state.rs @@ -194,19 +194,11 @@ pub enum M68kError { Other(String), } -#[derive(Clone)] +#[derive(Clone, Default)] pub struct M68kStatistics { pub cycle_number: usize, } -impl Default for M68kStatistics { - fn default() -> Self { - Self { - cycle_number: 0, - } - } -} - #[derive(Clone)] pub struct M68k { pub info: CpuInfo,