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

fix: clippy warnings

parent 687b17e5
No related branches found
No related tags found
No related merge requests found
Pipeline #1861 failed
......@@ -128,7 +128,9 @@ impl Mmu {
0xe00 => self.ppu.read(addr),
0xf00 => match addr & 0x00ff {
// 0xFF0F — IF: Interrupt flag
0x0f => {
0x0f =>
{
#[allow(clippy::bool_to_int_with_if)]
(if self.ppu.int_vblank() { 0x01 } else { 0x00 }
| if self.ppu.int_stat() { 0x02 } else { 0x00 }
| if self.timer.int_tima() { 0x04 } else { 0x00 }
......@@ -136,13 +138,7 @@ impl Mmu {
}
// 0xFF50 - Boot active flag
0x50 => {
if self.boot_active {
0x01
} else {
0x00
}
}
0x50 => u8::from(self.boot_active),
// 0xFF80-0xFFFE - High RAM (HRAM)
0x80..=0xfe => self.ppu.read(addr),
......@@ -249,6 +245,9 @@ impl Mmu {
// 0xFF51-0xFF52 - VRAM DMA source (CGB only)
0x51..=0x52 => (),
// 0xFF53-0xFF54 - VRAM DMA destination (CGB only)
0x53..=0x54 => (),
_ => debugln!("Writing to unknown IO control 0x{:04x}", addr),
},
_ => debugln!("Writing to unknown IO control 0x{:04x}", addr),
......
......@@ -471,7 +471,9 @@ impl Ppu {
0x8000..=0x9fff => self.vram[(addr & 0x1fff) as usize],
0xfe00..=0xfe9f => self.oam[(addr & 0x009f) as usize],
0xff80..=0xfffe => self.hram[(addr & 0x007f) as usize],
0xff40 => {
0xff40 =>
{
#[allow(clippy::bool_to_int_with_if)]
(if self.switch_bg { 0x01 } else { 0x00 }
| if self.switch_obj { 0x02 } else { 0x00 }
| if self.obj_size { 0x04 } else { 0x00 }
......@@ -675,6 +677,7 @@ impl Ppu {
for x in 0..TILE_WIDTH {
mask = 1 << (7 - x);
#[allow(clippy::bool_to_int_with_if)]
tile.set(
x,
y,
......
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