Restarting now reloads the file

This commit is contained in:
jan 2025-01-11 14:53:55 +01:00
parent dab743dafc
commit defac087c7
3 changed files with 4 additions and 5 deletions

2
Cargo.lock generated
View File

@ -539,7 +539,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "svc16"
version = "0.9.1"
version = "0.9.2"
dependencies = [
"anyhow",
"clap",

View File

@ -1,6 +1,6 @@
[package]
name = "svc16"
version = "0.9.1"
version = "0.9.2"
edition = "2021"
authors = ["Jan Neuendorf"]
description = "An emulator for a simple virtual computer"

View File

@ -43,8 +43,7 @@ async fn main() -> Result<()> {
}
let mut raw_buffer = [0 as u16; 256 * 256];
let initial_state = read_u16s_from_file(&cli.program)?;
let mut engine = Engine::new(initial_state.clone());
let mut engine = Engine::new(read_u16s_from_file(&cli.program)?);
let mut paused = false;
let mut ipf = 0;
@ -63,7 +62,7 @@ async fn main() -> Result<()> {
paused = !paused;
}
if is_key_pressed(KeyCode::R) {
engine = Engine::new(initial_state.clone());
engine = Engine::new(read_u16s_from_file(&cli.program)?);
paused = false;
}
if is_key_pressed(KeyCode::V) {