diff --git a/src/gpu.rs b/src/gpu.rs index 96a5af5..a891243 100644 --- a/src/gpu.rs +++ b/src/gpu.rs @@ -72,7 +72,10 @@ impl GPU { } pub fn cycle(&mut self) { - self.draw_bg(); + self.ly = self.ly.wrapping_add(1); + self.frame_buffer = [[[self.ly, 0x00, 0x00, 0xFF]; SCREEN_W]; SCREEN_H]; + + // self.draw_bg(); } fn grey_to_l(v: u8, i: usize) -> u8 { diff --git a/src/main.rs b/src/main.rs index 2c2727b..cf2f226 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,7 @@ use winit::event::{ElementState, Event, WindowEvent}; use winit::keyboard::{Key, ModifiersState}; use winit::platform::modifier_supplement::KeyEventExtModifierSupplement; use winit::{event_loop::EventLoop, window::WindowBuilder}; +use winit::event_loop::ControlFlow; mod context; mod cpu; @@ -46,6 +47,7 @@ async fn main() -> Result<(), impl std::error::Error> { println!("Starting \"{game_name}\"..."); let event_loop = EventLoop::new().unwrap(); + event_loop.set_control_flow(ControlFlow::Poll); let window = WindowBuilder::new() .with_title(format!("gb-rs - {:}", game_name))