Added some fixes

This commit is contained in:
transistor 2024-03-09 23:58:07 -08:00
parent ec74b64984
commit e0330d41a5
3 changed files with 9 additions and 13 deletions

View File

@ -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<u64, Instant> for BusPort {
type Error = Error;

View File

@ -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};

View File

@ -67,7 +67,7 @@ impl M68kCycle {
}
#[inline]
pub fn begin<'a>(mut self, cpu: &'a mut M68k) -> M68kCycleExecutor<'a, bus::BusAdapter<M68kAddress, u64, Instant, &'a mut BusPort>> {
pub fn begin<'a>(mut self, cpu: &'a mut M68k) -> M68kCycleExecutor<'a, bus::BusAdapter<M68kAddress, u64, Instant, &'a mut BusPort, Error>> {
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<BusError: bus::BusError> From<M68kError<BusError>> for Error {
impl<BusError: bus::Error> From<M68kError<BusError>> for Error {
fn from(err: M68kError<BusError>) -> Self {
match err {
M68kError::Halted => Self::Other("cpu halted".to_string()),