Starting point for MCS-4 emulation and MOS 6502 inheritance
This commit is contained in:
parent
4ddb4a060f
commit
ac8ebbafe9
13 changed files with 823 additions and 4 deletions
32
src/systems/intel_mcs_4.rs
Normal file
32
src/systems/intel_mcs_4.rs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
use std::thread;
|
||||
use std::time::Duration;
|
||||
use crate::Component;
|
||||
use crate::components::clock::generic_clock::GenericClock;
|
||||
use crate::components::cpu::intel_4004::Intel4004;
|
||||
|
||||
fn emulation() {
|
||||
println!("Starting MCS-4 emulation with pin state resolution...");
|
||||
|
||||
// Create components
|
||||
let mut clock = GenericClock::new("sys_clock".to_string(), 2); // 2Hz clock
|
||||
let mut cpu = Intel4004::new("cpu4004".to_string());
|
||||
|
||||
// Connect clock to CPU using the connection macro
|
||||
if let (Some(clock_out), Some(cpu_clk)) = (clock.out(), cpu.clk()) {
|
||||
connect_pin!(&clock_out, &cpu_clk);
|
||||
println!("Connected clock to CPU");
|
||||
}
|
||||
|
||||
// Start components
|
||||
clock.run();
|
||||
cpu.run();
|
||||
|
||||
// Let it run for a while
|
||||
thread::sleep(Duration::from_secs(5));
|
||||
|
||||
// Stop components
|
||||
clock.stop();
|
||||
cpu.stop();
|
||||
|
||||
println!("Emulation completed");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue