Merge remote-tracking branch 'refs/remotes/origin/main'

This commit is contained in:
2025-06-16 23:40:29 +01:00
6 changed files with 116 additions and 90 deletions
+9 -8
View File
@@ -59,9 +59,9 @@ impl Component for ControlPanel {
// Step
if ui.button("Step").clicked() {
self.sender
.send(Command::Step)
.unwrap_or_else(|_| state.error = Some("Failed to send command".to_string()));
self.sender.send(Command::Step).unwrap_or_else(|_| {
state.error = Some("Failed to send command".to_string());
});
}
ui.separator();
@@ -78,12 +78,13 @@ impl Component for ControlPanel {
ui.label(format!("Instructions: {}", state.instructions));
ui.label(format!("PC: 0x{:08X}", state.reg_file.get(Register::Pcx)));
let instruction = match Instruction::decode(state.reg_file.get(Register::Cir)) {
Ok(instruction) => instruction.to_string(),
Err(_) => "Invalid Instruction".to_string(),
};
let instruction = Instruction::decode(state.reg_file.get(Register::Cir))
.map_or_else(
|_| "Invalid Instruction".to_string(),
|instruction| instruction.to_string(),
);
ui.label(format!("Instruction: {}", instruction));
ui.label(format!("Instruction: {instruction}"));
});
render_register_table(state, ui, ctx);
+2 -2
View File
@@ -306,7 +306,7 @@ impl Editor {
self.sender
.send(Command::Write(self.load_offset, self.output.clone()))
.unwrap_or_else(|_| {
self.error = Some("Failed to send command".to_string())
self.error = Some("Failed to send command".to_string());
});
}
@@ -323,7 +323,7 @@ impl Editor {
// Resets the emulator and all attached devices
if ui.button("Reset Emulator").clicked() {
self.sender.send(Command::Reset).unwrap_or_else(|_| {
self.error = Some("Failed to send command".to_string())
self.error = Some("Failed to send command".to_string());
});
}
});