diff --git a/src/core/gpu.rs b/src/core/gpu.rs index 2da9460..901028a 100644 --- a/src/core/gpu.rs +++ b/src/core/gpu.rs @@ -309,6 +309,16 @@ impl Gpu { } } + fn scanline_mode3(&mut self, bg: u32, sb: &mut SysBus) { + let y = self.current_scanline; + + for x in 0..Self::DISPLAY_WIDTH { + let pixel_index = x + y * Self::DISPLAY_WIDTH; + let pixel_addr = 0x0600_0000 + 2 * (pixel_index as u32); + self.pixeldata[x + y * 512] = sb.read_16(pixel_addr).into(); + } + } + fn scanline_mode4(&mut self, bg: u32, dispcnt: &DisplayControl, sysbus: &mut SysBus) { let page: u32 = match dispcnt.display_frame { 0 => 0x0600_0000, @@ -337,6 +347,9 @@ impl Gpu { } } } + BGMode::BGMode3 => { + self.scanline_mode3(2, sysbus); + } BGMode::BGMode4 => { self.scanline_mode4(2, &dispcnt, sysbus); }