Sleep time for threads extended

Fix for ActiveBus check (thread did not run)
This commit is contained in:
Jan-Peter von Hunnius 2025-09-24 15:13:17 +02:00
parent 974fa25a3c
commit e64d3edbd8
8 changed files with 46 additions and 14 deletions

View file

@ -1,6 +1,6 @@
use crate::component::Component;
use crate::components::cpu::cmos_65c02::CMOS65C02;
use crate::components::cpu::mos_6502::{Registers, MOS6502};
use crate::components::cpu::mos_6502::MOS6502;
use crate::components::cpu::WDC65C02;
pub trait CPU: Component {
fn reset(&mut self);
@ -71,7 +71,7 @@ impl MOS6502Family for MOS6502 {
// Implement other methods...
}
impl CPU for CMOS65C02 {
impl CPU for WDC65C02 {
fn reset(&mut self) {
todo!()
}
@ -97,9 +97,9 @@ impl CPU for CMOS65C02 {
}
}
impl MOS6502Family for CMOS65C02 {
impl MOS6502Family for WDC65C02 {
fn lda(&mut self, value: u8) {
self.base_6502.lda(value)
self.base.lda(value)
}
fn sta(&mut self, address: u16) {
@ -113,7 +113,7 @@ impl MOS6502Family for CMOS65C02 {
// Implement other methods...
}
impl CMOS65C02Extensions for CMOS65C02 {
impl CMOS65C02Extensions for WDC65C02 {
fn bra(&mut self, address: u16) {
self.bra(address)
}

View file

@ -2,6 +2,7 @@
pub mod mos_6502;
pub mod wdc_65c02;
pub mod intel_4004;
mod cpu_traits;
// Re-export the CPU types
pub use mos_6502::MOS6502;

View file

@ -7,7 +7,7 @@ use crate::pin::Pin;
/// WDC 65C02 - CMOS version of 6502 with additional instructions
pub struct WDC65C02 {
base: MOS6502,
pub(crate) base: MOS6502,
// 65C02-specific state
stop_mode: bool,
wait_mode: bool,

View file

@ -289,7 +289,7 @@ impl Component for GenericRam {
while self.is_running() {
self.update();
thread::sleep(Duration::from_micros(1));
thread::sleep(Duration::from_micros(10));
}
}

View file

@ -253,7 +253,7 @@ impl Component for GenericRom {
while self.base.is_running() {
self.update();
thread::sleep(Duration::from_micros(1)); // Small delay to prevent busy waiting
thread::sleep(Duration::from_micros(10)); // Small delay to prevent busy waiting
}
}

View file

@ -313,7 +313,7 @@ impl Component for Intel4001 {
while self.is_running() {
self.update();
thread::sleep(Duration::from_micros(1));
thread::sleep(Duration::from_micros(10));
}
}

View file

@ -327,7 +327,7 @@ impl Component for Intel4002 {
while self.is_running() {
self.update();
thread::sleep(Duration::from_micros(1));
thread::sleep(Duration::from_micros(10));
}
}