From 6888047102d86fc1fcf10503fc9bf921ad455cfc Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 1 Jun 2019 16:42:17 +0300 Subject: [PATCH] Show flags in the registers command --- Core/debugger.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/debugger.c b/Core/debugger.c index 79321a5..ba413ca 100644 --- a/Core/debugger.c +++ b/Core/debugger.c @@ -811,7 +811,12 @@ static bool registers(GB_gameboy_t *gb, char *arguments, char *modifiers, const return true; } - GB_log(gb, "AF = $%04x\n", gb->registers[GB_REGISTER_AF]); /* AF can't really be an address */ + + GB_log(gb, "AF = $%04x (%c%c%c%c)\n", gb->registers[GB_REGISTER_AF], /* AF can't really be an address */ + (gb->f & GB_CARRY_FLAG)? 'C' : '-', + (gb->f & GB_HALF_CARRY_FLAG)? 'H' : '-', + (gb->f & GB_SUBSTRACT_FLAG)? 'S' : '-', + (gb->f & GB_ZERO_FLAG)? 'Z' : '-'); GB_log(gb, "BC = %s\n", value_to_string(gb, gb->registers[GB_REGISTER_BC], false)); GB_log(gb, "DE = %s\n", value_to_string(gb, gb->registers[GB_REGISTER_DE], false)); GB_log(gb, "HL = %s\n", value_to_string(gb, gb->registers[GB_REGISTER_HL], false));