From 87fdf91e0c40253cb127c9f483d1a5af157c7c32 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 13 May 2022 00:58:21 +0300 Subject: [PATCH] Better debugger output for scrolling adjustment --- Core/debugger.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Core/debugger.c b/Core/debugger.c index 49749a6..5fa168b 100644 --- a/Core/debugger.c +++ b/Core/debugger.c @@ -1727,8 +1727,13 @@ static bool lcd(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugg GB_log(gb, "Glitched line 0 OAM mode (%d cycles to next event)\n", -gb->display_cycles / 2); } else if (gb->mode_for_interrupt == 3) { - signed pixel = gb->position_in_line > 160? (int8_t) gb->position_in_line : gb->position_in_line; - GB_log(gb, "Rendering pixel (%d/160)\n", pixel); + if (((uint8_t)(gb->position_in_line + 16) < 8)) { + GB_log(gb, "Adjusting for scrolling (%d/%d)\n", gb->position_in_line & 7, gb->io_registers[GB_IO_SCX] & 7); + } + else { + signed pixel = gb->position_in_line > 160? (int8_t) gb->position_in_line : gb->position_in_line; + GB_log(gb, "Rendering pixel (%d/160)\n", pixel); + } } else { GB_log(gb, "Sleeping (%d cycles to next event)\n", -gb->display_cycles / 2);