Corrected BG enable's behavior (Fixes visual glitch with Krusty's Funhouse)
This commit is contained in:
parent
42c01a21b2
commit
52ed2ca55e
@ -144,10 +144,7 @@ static uint32_t get_pixel(GB_gameboy_t *gb, uint8_t x, uint8_t y)
|
|||||||
return gb->sprite_palletes_rgb[sprite_palette * 4 + sprite_pixel];
|
return gb->sprite_palletes_rgb[sprite_palette * 4 + sprite_pixel];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bg_enabled) {
|
if (bg_enabled) {
|
||||||
return gb->background_palletes_rgb[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gb->io_registers[GB_IO_LCDC] & 0x10) {
|
if (gb->io_registers[GB_IO_LCDC] & 0x10) {
|
||||||
tile_address = tile * 0x10;
|
tile_address = tile * 0x10;
|
||||||
}
|
}
|
||||||
@ -168,6 +165,7 @@ static uint32_t get_pixel(GB_gameboy_t *gb, uint8_t x, uint8_t y)
|
|||||||
|
|
||||||
background_pixel = (((gb->vram[tile_address + (y & 7) * 2 ] >> ((~x)&7)) & 1 ) |
|
background_pixel = (((gb->vram[tile_address + (y & 7) * 2 ] >> ((~x)&7)) & 1 ) |
|
||||||
((gb->vram[tile_address + (y & 7) * 2 + 1] >> ((~x)&7)) & 1) << 1 );
|
((gb->vram[tile_address + (y & 7) * 2 + 1] >> ((~x)&7)) & 1) << 1 );
|
||||||
|
}
|
||||||
|
|
||||||
if (priority && sprite_pixel && !background_pixel) {
|
if (priority && sprite_pixel && !background_pixel) {
|
||||||
if (!gb->cgb_mode) {
|
if (!gb->cgb_mode) {
|
||||||
|
Loading…
Reference in New Issue
Block a user