feat: implement cpu interrupts

This commit is contained in:
2021-03-18 21:06:01 -05:00
parent fb38ef3f68
commit 558f9e7c72
5 changed files with 86 additions and 98 deletions

View File

@@ -30,11 +30,6 @@ fn main() -> Result<()> {
event_loop.run(move |event, _, control_flow| {
if let Event::RedrawRequested(_) = event {
let ppu = game_boy.get_ppu();
let frame = pixels.get_frame();
ppu.copy_to_gui(frame);
if pixels
.render()
.map_err(|e| anyhow!("pixels.render() failed: {}", e))
@@ -57,6 +52,10 @@ fn main() -> Result<()> {
// Emulation
let _cycles = game_boy.step();
let ppu = game_boy.get_ppu();
let frame = pixels.get_frame();
ppu.copy_to_gui(frame);
window.request_redraw();
}
});