more roms to play with

egui now renders the video correctly
This commit is contained in:
2024-10-12 14:16:14 -04:00
parent 6be443fa2b
commit 683b0fc51a
7 changed files with 35 additions and 21 deletions
+11 -4
View File
@@ -22,7 +22,7 @@ mod support;
const LIN_KEYS: [(u16, u8); 0x10] = [(537, 0x01),(538, 0x02),(539, 0x03),(540, 0x0c),
(562, 0x04),(568, 0x05),(550, 0x06),(563, 0x0d),
(546, 7),(564, 8),(549, 9),(551, 0xe),
(571, 0xa),(569, 0),(548, 0xb),(569, 0xf)];
(571, 0xa),(569, 0),(548, 0xb),(567, 0xf)];
fn main() {
pretty_env_logger::init();
@@ -34,6 +34,11 @@ fn main() {
// Key Checks
let down_keys = ui.io().keys_down;
for (idx, val) in down_keys.iter().enumerate() {
if *val {
println!("{idx} = {val}");
}
}
for (key_code, key_reg) in LIN_KEYS {
if down_keys[key_code as usize] {
system.keypad.push_key(key_reg);
@@ -66,15 +71,17 @@ fn main() {
}
// GUI Parts
if ui_state.show_video {
GemmaImguiSupport::video_display(&system, &ui_state, ui);
}
GemmaImguiSupport::system_controls(&mut system, &mut ui_state, ui);
if ui_state.show_registers {
GemmaImguiSupport::registers_view(&system, ui);
}
if ui_state.show_video {
GemmaImguiSupport::video_display(&system, &ui_state, ui);
}
if ui_state.show_memory {
let active_instruction = system.registers.peek_pc();
+1 -1
View File
@@ -42,7 +42,7 @@ impl Default for ImGuiUiState {
on_colour: ImColor32::from_rgb(0xff, 0xff, 0x00),
off_colour: ImColor32::from_rgb(0x00, 0xff, 0xff),
is_running: false,
frame_time: 10.0,
frame_time: 1.0,
last_frame_instant: Instant::now()
}
}