diff --git a/emulator/core/src/memory.rs b/emulator/core/src/memory.rs index 52db709..dd411f7 100644 --- a/emulator/core/src/memory.rs +++ b/emulator/core/src/memory.rs @@ -360,11 +360,7 @@ pub fn dump_slice(data: &[u8], mut count: usize) { use emulator_hal::bus::{self, BusAccess}; -//impl bus::Error for Error {} - -//impl ErrorType for BusPort { -// type Error = Error; -//} +impl bus::Error for Error {} impl BusAccess for BusPort { type Error = Error; diff --git a/emulator/cpus/m68k/src/decode.rs b/emulator/cpus/m68k/src/decode.rs index 5699240..43e0956 100644 --- a/emulator/cpus/m68k/src/decode.rs +++ b/emulator/cpus/m68k/src/decode.rs @@ -1,6 +1,6 @@ use femtos::Instant; -use emulator_hal::bus::{self, BusAccess, BusError}; +use emulator_hal::bus::{self, BusAccess, Error as BusError}; use moa_core::{Error, Address, Addressable}; diff --git a/emulator/cpus/m68k/src/execute.rs b/emulator/cpus/m68k/src/execute.rs index e9161e0..39a9355 100644 --- a/emulator/cpus/m68k/src/execute.rs +++ b/emulator/cpus/m68k/src/execute.rs @@ -67,7 +67,7 @@ impl M68kCycle { } #[inline] - pub fn begin<'a>(mut self, cpu: &'a mut M68k) -> M68kCycleExecutor<'a, bus::BusAdapter> { + pub fn begin<'a>(mut self, cpu: &'a mut M68k) -> M68kCycleExecutor<'a, bus::BusAdapter> { cpu.stats.cycle_number += 1; if cpu.stats.cycle_number > cpu.stats.last_update { cpu.stats.last_update = cpu.stats.last_update + 1_000_000; @@ -76,11 +76,11 @@ impl M68kCycle { cpu.stats.last_time = now; } - let adapter = bus::BusAdapter { - bus: &mut cpu.port, - translate: translate_address, - instant: core::marker::PhantomData, - }; + let adapter = bus::BusAdapter::new( + &mut cpu.port, + translate_address, + |err| err, + ); M68kCycleExecutor { state: &mut cpu.state, @@ -162,7 +162,7 @@ impl Transmutable for M68k { } } -impl From> for Error { +impl From> for Error { fn from(err: M68kError) -> Self { match err { M68kError::Halted => Self::Other("cpu halted".to_string()),