From f1761340fce635b16f847272547658494e3d0049 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 9 Oct 2021 18:45:08 +0300 Subject: [PATCH] Fix ATTR_SET command --- Core/debugger.c | 1 - Core/sgb.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Core/debugger.c b/Core/debugger.c index 36072e6..f7f3335 100644 --- a/Core/debugger.c +++ b/Core/debugger.c @@ -2243,7 +2243,6 @@ bool GB_debugger_execute_command(GB_gameboy_t *gb, char *input) } } -/* Returns true if debugger waits for more commands */ char *GB_debugger_complete_substring(GB_gameboy_t *gb, char *input, uintptr_t *context) { char *command_string = input; diff --git a/Core/sgb.c b/Core/sgb.c index 66f2f20..40fbd7a 100644 --- a/Core/sgb.c +++ b/Core/sgb.c @@ -402,9 +402,9 @@ static void command_ready(GB_gameboy_t *gb) gb->sgb->transfer_dest = TRANSFER_ATTRIBUTES; break; case ATTR_SET: - load_attribute_file(gb, gb->sgb->command[0] & 0x3F); + load_attribute_file(gb, gb->sgb->command[1] & 0x3F); - if (gb->sgb->command[0] & 0x40) { + if (gb->sgb->command[1] & 0x40) { gb->sgb->mask_mode = MASK_DISABLED; } break;