From aa329237bac0d74208905590deff9a1070f8e849 Mon Sep 17 00:00:00 2001 From: Kevin Hamacher Date: Tue, 18 Feb 2020 16:29:29 +0100 Subject: [PATCH] cargo fmt --- src/display.rs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/display.rs b/src/display.rs index 9aa2ecc..2d8f9e3 100644 --- a/src/display.rs +++ b/src/display.rs @@ -374,7 +374,7 @@ impl Display { } 0xFF69 => { let idx = self.background_palette_index as usize; - if idx < 64 { + if idx < 64 { self.background_palette_cgb[idx / 8].0[idx % 8] = val; } else { panic!("OOB palette w/ autoinc"); @@ -389,7 +389,7 @@ impl Display { } 0xFF6B => { let idx = self.object_palette_index as usize; - if idx < 64 { + if idx < 64 { self.object_palette_cgb[idx / 8].0[idx % 8] = val; } else { panic!("OOB obj palette w/ autoinc"); @@ -459,7 +459,10 @@ impl Display { background_map + ((tile_index_y as usize) * 32) + tile_index_x as usize; */ // Background attributes are only in this memory range. - assert!(vram_offset >= 0x1800 && vram_offset < 0x2000, format!("offset: {:04X}", vram_offset)); + assert!( + vram_offset >= 0x1800 && vram_offset < 0x2000, + format!("offset: {:04X}", vram_offset) + ); BgMapAttributes(self.vram1[vram_offset]) } @@ -670,7 +673,12 @@ impl Display { continue; } let c = self.object_palette_cgb[sprite.palette() as usize].get_color(c); - self.set_pixel(x.wrapping_add(x_maybe_flipped), render_y, c, PixelOrigin::Sprite); + self.set_pixel( + x.wrapping_add(x_maybe_flipped), + render_y, + c, + PixelOrigin::Sprite, + ); } } } @@ -690,8 +698,12 @@ impl Display { } pub fn dump_vram(&self) { - std::fs::File::create("vram0.dat").unwrap().write_all(&self.vram0); - std::fs::File::create("vram1.dat").unwrap().write_all(&self.vram1); + std::fs::File::create("vram0.dat") + .unwrap() + .write_all(&self.vram0); + std::fs::File::create("vram1.dat") + .unwrap() + .write_all(&self.vram1); } #[inline]