Skip to content

Commit

Permalink
Fix CGB Sprite Prio
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz committed Oct 24, 2024
1 parent 87a3f46 commit c46d70f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/ppu/ppu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl PPU {

self.cycle_count += cycles;

return match self.ppu_mode {
match self.ppu_mode {
PPUMode::OAMScan => {
self.check_lyc();

Expand Down Expand Up @@ -151,7 +151,7 @@ impl PPU {
self.check_lyc();
}
}
};
}
}

fn check_lyc(&mut self) {
Expand Down Expand Up @@ -411,7 +411,13 @@ impl PPU {
let skip = match self.mode {
GBMode::CGB => {
if self.lcdc.contains(LCDC::WINDOW_PRIORITY) {
prio == Priority::Priority
if prio == Priority::Color0 {
false
} else if !tile_attributes.contains(Attributes::PRIORITY) && prio != Priority::Priority {
false
} else {
true
}
} else {
tile_attributes.contains(Attributes::PRIORITY) && prio != Priority::Color0
}
Expand Down

0 comments on commit c46d70f

Please sign in to comment.