Skip to content

Commit

Permalink
Fix push switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Kogepan229 committed Jan 16, 2025
1 parent f32dfbb commit 4db4cd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ impl Simulator {
prev_timing: time::Instant::now(),
};
simulator.init_io_port();
simulator.write_io_port(0x5, 0x3);
simulator
}

Expand Down
8 changes: 4 additions & 4 deletions src/simulator/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ impl Simulator {
if is_changed {
let switches = self.ui_states.push_switches.borrow();
if switches[0] {
self.io_port[4] |= 1 << 0
} else {
self.io_port[4] &= !(1 << 0)
} else {
self.io_port[4] |= 1 << 0
}
if switches[1] {
self.io_port[4] |= 1 << 1
} else {
self.io_port[4] &= !(1 << 1)
} else {
self.io_port[4] |= 1 << 1
}
if let Some(emulator) = self.emulator.as_mut() {
emulator.send_message(format!("ioport:{:x}:{:x}", 0x5, self.io_port[4]));
Expand Down

0 comments on commit 4db4cd5

Please sign in to comment.