Skip to content

Commit

Permalink
“works”
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz committed Dec 10, 2023
1 parent 493ef04 commit fd4361a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit fd4361a

Please sign in to comment.