Adds ComputerManager so no write access to the computer directly happens.

ComputerManager has a thread to run the CPU whenever its told to either
step or run.  It can be told to stop the CPU too.  Cycle count and keystate
feedback is available along with read-only of the computer from status()
This commit is contained in:
2024-10-18 09:59:43 -04:00
parent 902d5c1875
commit d829b9f03f
10 changed files with 209 additions and 87 deletions
@@ -1,11 +1,12 @@
use std::ops::Range;
use gemma::chip8::computer_manager::Chip8ComputerManager;
pub struct GemmaEGuiState {
pub display_video: bool,
pub display_memory: bool,
pub display_registers: bool,
pub memory_view_min: i32,
pub memory_view_max: i32,
pub is_running: bool,
pub memory_view: Range<i32>,
pub computer: Chip8ComputerManager,
pub selected_rom_filename: String
}
@@ -15,9 +16,8 @@ impl Default for GemmaEGuiState {
display_video: true,
display_memory: true,
display_registers: true,
memory_view_min: 0x00,
memory_view_max: 0x100,
is_running: false,
memory_view: 0x00..0x200,
computer: Chip8ComputerManager::new(),
selected_rom_filename: String::new()
}
}