closer to being able to run a cycle?
This commit is contained in:
@@ -24,6 +24,8 @@ impl BenEaterPC {
|
||||
// tick the clock.
|
||||
// tick the memory
|
||||
// tick the VIA
|
||||
} else {
|
||||
self.cpu.tick();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
pub enum Via6522Port {
|
||||
A(u8),
|
||||
B(u8)
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Via6522 {
|
||||
data_bus: u8,
|
||||
address_bus: u16,
|
||||
port_a_state: u8,
|
||||
port_b_data: u8,
|
||||
port_a_direction: u8,
|
||||
@@ -15,8 +22,15 @@ impl Via6522 {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_a_direction(&mut self, new_direction: u8) {
|
||||
|
||||
pub fn set_port_direction(&mut self, port: Via6522Port) {
|
||||
match port {
|
||||
Via6522Port::A(x) => {
|
||||
self.port_a_direction = x;
|
||||
},
|
||||
Via6522Port::B(x) => {
|
||||
self.port_b_direction = x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// check for output pins and see what they say
|
||||
|
||||
Reference in New Issue
Block a user