feat(egui): add timer window
This commit is contained in:
parent
b1bf6c5868
commit
86f3a897f1
|
@ -72,6 +72,10 @@ impl Bus {
|
|||
self.timer.step(cycles);
|
||||
self.sound.step(cycles);
|
||||
}
|
||||
|
||||
pub fn timer(&self) -> Timer {
|
||||
self.timer
|
||||
}
|
||||
}
|
||||
|
||||
impl Bus {
|
||||
|
|
24
src/gui.rs
24
src/gui.rs
|
@ -143,6 +143,30 @@ impl Egui {
|
|||
});
|
||||
});
|
||||
|
||||
egui::Window::new("Timer").show(ctx, |ui| {
|
||||
let timer = game_boy.bus.timer();
|
||||
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("DIV");
|
||||
ui.monospace(format!("{:#06X}", timer.divider));
|
||||
});
|
||||
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("TIMA");
|
||||
ui.monospace(format!("{:#04X}", timer.counter));
|
||||
});
|
||||
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("TMA");
|
||||
ui.monospace(format!("{:#04X}", timer.modulo));
|
||||
});
|
||||
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("TAC");
|
||||
ui.monospace(format!("{:?}", timer.control));
|
||||
});
|
||||
});
|
||||
|
||||
egui::Window::new("Registers")
|
||||
.open(&mut self.show_registers)
|
||||
.show(ctx, |ui| {
|
||||
|
|
Loading…
Reference in New Issue