Skip to content
Snippets Groups Projects
Verified Commit eaf6e9b2 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: better graphics

parent 5c0d48e7
No related branches found
No related tags found
No related merge requests found
use boytacean::{gb::GameBoy, ppu::{DISPLAY_WIDTH, DISPLAY_HEIGHT}}; use boytacean::{
use sdl2::{video::Window, pixels::PixelFormatEnum, VideoSubsystem, TimerSubsystem, EventPump}; gb::GameBoy,
ppu::{DISPLAY_HEIGHT, DISPLAY_WIDTH},
};
use sdl2::{
pixels::PixelFormatEnum, video::Window, AudioSubsystem, EventPump, TimerSubsystem,
VideoSubsystem,
};
/// The base title to be used in the window. /// The base title to be used in the window.
static TITLE: &'static str = "Boytacean"; static TITLE: &'static str = "Boytacean";
...@@ -8,6 +14,7 @@ pub struct Graphics { ...@@ -8,6 +14,7 @@ pub struct Graphics {
window: Window, window: Window,
video_subsystem: VideoSubsystem, video_subsystem: VideoSubsystem,
timer_subsystem: TimerSubsystem, timer_subsystem: TimerSubsystem,
audio_subsystem: AudioSubsystem,
event_pump: EventPump, event_pump: EventPump,
} }
...@@ -42,7 +49,8 @@ fn start_sdl() -> Graphics { ...@@ -42,7 +49,8 @@ fn start_sdl() -> Graphics {
window: window, window: window,
video_subsystem: video_subsystem, video_subsystem: video_subsystem,
timer_subsystem: timer_subsystem, timer_subsystem: timer_subsystem,
event_pump: event_pump audio_subsystem: audio_subsystem,
event_pump: event_pump,
} }
} }
...@@ -75,8 +83,7 @@ fn main() { ...@@ -75,8 +83,7 @@ fn main() {
break; break;
} }
while let Some(event) = graphics.event_pump.poll_event() { while let Some(event) = graphics.event_pump.poll_event() {}
}
let mut counter_ticks = 0u32; let mut counter_ticks = 0u32;
...@@ -106,6 +113,4 @@ fn main() { ...@@ -106,6 +113,4 @@ fn main() {
graphics.timer_subsystem.delay(17); graphics.timer_subsystem.delay(17);
} }
//println!("{:?}", game_boy.frame_buffer().as_ref());
} }
This diff is collapsed.
...@@ -113,7 +113,8 @@ impl Ppu { ...@@ -113,7 +113,8 @@ impl Ppu {
// screen we're now entering the v-blank // screen we're now entering the v-blank
if self.line == 143 { if self.line == 143 {
self.mode = PpuMode::VBlank; self.mode = PpuMode::VBlank;
// self.drawData @todo implement this one // self.drawData
// @todo implement this one
} else { } else {
self.mode = PpuMode::OamRead; self.mode = PpuMode::OamRead;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment