40 lines
1.1 KiB
Rust
40 lines
1.1 KiB
Rust
use crate::support::GemmaEGuiSupport::GemmaEGui;
|
|
use crate::support::EmmaEGuiState::EmmaEGuiState;
|
|
use eframe::egui;
|
|
use egui::Ui;
|
|
use gemma::chip8::computer::Chip8Computer;
|
|
|
|
mod support;
|
|
|
|
fn main() -> eframe::Result {
|
|
println!("Taxation is Theft");
|
|
|
|
let options = eframe::NativeOptions {
|
|
viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]),
|
|
..Default::default()
|
|
};
|
|
|
|
let mut state = EmmaEGuiState::default();
|
|
let mut computer = Chip8Computer::new();
|
|
|
|
eframe::run_simple_native("EGUI Emma", options, move |ctx, _frame| {
|
|
egui::CentralPanel::default().show(ctx, |ui| {
|
|
ui.heading("Gemma");
|
|
|
|
GemmaEGui::controls_view(&mut computer, &mut state, ui);
|
|
|
|
if state.display_memory {
|
|
GemmaEGui::memory_view(&computer, ui);
|
|
}
|
|
|
|
if state.display_video {
|
|
GemmaEGui::video_view(&computer, ui);
|
|
}
|
|
|
|
if state.display_registers {
|
|
GemmaEGui::registers_view(&computer, ui);
|
|
}
|
|
});
|
|
})
|
|
}
|