cargo fmt
This commit is contained in:
parent
55373a6948
commit
aa329237ba
@ -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]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user