SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit cb73e0b91a194689a2e87b64ff4a8de59532cf67 parent 6337e3e43affa55d830f36767494f20736ec8ee0 Author: Lior Halphon <LIJI32@gmail.com> Date: Mon, 9 May 2022 00:43:49 +0300 Oops, I broke the window Diffstat:
| M | Core/display.c | 3 | +++ |
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/Core/display.c b/Core/display.c @@ -19,6 +19,7 @@ static void fifo_clear(GB_fifo_t *fifo) static GB_fifo_item_t *fifo_pop(GB_fifo_t *fifo) { + assert(fifo->size); GB_fifo_item_t *ret = &fifo->fifo[fifo->read_end]; fifo->read_end++; fifo->read_end &= (GB_FIFO_LENGTH - 1); @@ -553,6 +554,8 @@ static void render_pixel_if_possible(GB_gameboy_t *gb) bool draw_oam = false; bool bg_enabled = true, bg_priority = false; + if (unlikely(gb->wx_triggered && !fifo_size(&gb->bg_fifo))) return; + fifo_item = fifo_pop(&gb->bg_fifo); bg_priority = fifo_item->bg_priority;
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.