SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 6b947c46bc69689292b109515bd9ce53bf2ba3ad parent 893d7d162ac6b9656d4c87d3f3db3404e378044a Author: Lior Halphon <LIJI32@gmail.com> Date: Sat, 9 Oct 2021 22:41:43 +0300 Correct blank image detection on SGB Diffstat:
| M | Tester/main.c | 20 | ++++++++++++++++---- |
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/Tester/main.c b/Tester/main.c @@ -140,10 +140,22 @@ static void vblank(GB_gameboy_t *gb) if (frames >= test_length && !gb->disable_rendering) { bool is_screen_blank = true; - for (unsigned i = GB_get_screen_width(gb) * GB_get_screen_height(gb); i--;) { - if (bitmap[i] != bitmap[0]) { - is_screen_blank = false; - break; + if (!gb->sgb) { + for (unsigned i = 160 * 144; i--;) { + if (bitmap[i] != bitmap[0]) { + is_screen_blank = false; + break; + } + } + } + else { + if (gb->sgb->mask_mode == 0) { + for (unsigned i = 160 * 144; i--;) { + if (gb->sgb->screen_buffer[i] != gb->sgb->screen_buffer[0]) { + is_screen_blank = false; + break; + } + } } }
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.