Skip to content

Commit

Permalink
mask sprites / show bg
Browse files Browse the repository at this point in the history
  • Loading branch information
SirBob01 committed Nov 28, 2023
1 parent c295461 commit 65d550e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ppu.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,8 @@ void draw_dot_ppu(ppu_t *ppu) {

unsigned char bg_palette = bg_pa0 | (bg_pa1 << 1);
unsigned char bg_color = bg_pt0 | (bg_pt1 << 1);
if (ppu->dot <= 7 && !(ppu->mask & PPU_MASK_SHOW_BG_LEFT)) {
if ((ppu->dot <= 7 && !(ppu->mask & PPU_MASK_SHOW_BG_LEFT)) ||
!(ppu->mask & PPU_MASK_SHOW_BG)) {
bg_color = 0;
}

Expand All @@ -573,7 +574,8 @@ void draw_dot_ppu(ppu_t *ppu) {
bool sp_pt0 = ppu->sprite_shift[i * 2] & 0x100;
bool sp_pt1 = ppu->sprite_shift[i * 2 + 1] & 0x100;
unsigned char sp_color_tmp = sp_pt0 | (sp_pt1 << 1);
if (ppu->dot <= 7 && !(ppu->mask & PPU_MASK_SHOW_SPRITES_LEFT)) {
if ((ppu->dot <= 7 && !(ppu->mask & PPU_MASK_SHOW_SPRITES_LEFT)) ||
!(ppu->mask & PPU_MASK_SHOW_SPRITES)) {
sp_color_tmp = 0;
}

Expand Down

0 comments on commit 65d550e

Please sign in to comment.