Skip to content

Commit

Permalink
Fix COL0_FLAG behavior in SGB
Browse files Browse the repository at this point in the history
  • Loading branch information
krs013 authored and Baekalfen committed Jan 19, 2024
1 parent ee3c43b commit c007cde
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pyboy/core/lcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ def __init__(self, cgb, cartridge_cgb, disable_renderer, color_palette, cgb_colo
self.OBP1.palette_mem_rgb = [(c << 8) for c in color_palette]
self.renderer = Renderer(False)

self.BGP.palette_mem_rgb[0] |= COL0_FLAG
self.OBP0.palette_mem_rgb[0] |= COL0_FLAG
self.OBP1.palette_mem_rgb[0] |= COL0_FLAG

def get_lcdc(self):
return self._LCDC.value

Expand Down Expand Up @@ -302,7 +298,10 @@ def get(self):
return self.value

def getcolor(self, i):
return self.palette_mem_rgb[self.lookup[i]]
if i==0:
return self.palette_mem_rgb[self.lookup[0]] | COL0_FLAG
else:
return self.palette_mem_rgb[self.lookup[i]]


class STATRegister:
Expand Down

0 comments on commit c007cde

Please sign in to comment.