Fix a silly bug

This commit is contained in:
Lior Halphon 2019-07-18 00:53:11 +03:00
parent 9ba6915c85
commit 772289c545
1 changed files with 12 additions and 2 deletions

View File

@ -375,6 +375,8 @@ static void render_pixel_if_possible(GB_gameboy_t *gb)
bg_enabled = false; bg_enabled = false;
} }
} }
uint8_t icd_pixel = 0;
{ {
uint8_t pixel = bg_enabled? fifo_item->pixel : 0; uint8_t pixel = bg_enabled? fifo_item->pixel : 0;
@ -391,7 +393,8 @@ static void render_pixel_if_possible(GB_gameboy_t *gb)
} }
else if (gb->model & GB_MODEL_NO_SFC_BIT) { else if (gb->model & GB_MODEL_NO_SFC_BIT) {
if (gb->icd_pixel_callback) { if (gb->icd_pixel_callback) {
gb->icd_pixel_callback(gb, pixel); icd_pixel = pixel;
//gb->icd_pixel_callback(gb, pixel);
} }
} }
else { else {
@ -412,13 +415,20 @@ static void render_pixel_if_possible(GB_gameboy_t *gb)
} }
else if (gb->model & GB_MODEL_NO_SFC_BIT) { else if (gb->model & GB_MODEL_NO_SFC_BIT) {
if (gb->icd_pixel_callback) { if (gb->icd_pixel_callback) {
gb->icd_pixel_callback(gb, pixel); icd_pixel = pixel;
//gb->icd_pixel_callback(gb, pixel);
} }
} }
else { else {
gb->screen[gb->position_in_line + gb->current_line * WIDTH] = gb->sprite_palettes_rgb[oam_fifo_item->palette * 4 + pixel]; gb->screen[gb->position_in_line + gb->current_line * WIDTH] = gb->sprite_palettes_rgb[oam_fifo_item->palette * 4 + pixel];
} }
} }
if (gb->model & GB_MODEL_NO_SFC_BIT) {
if (gb->icd_pixel_callback) {
gb->icd_pixel_callback(gb, icd_pixel);
}
}
gb->position_in_line++; gb->position_in_line++;
} }