SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 9c23f0d685dcac856d9b3520a4f9894710442bad parent e084437370945c1ca8f39d2b950d87e1c75b0f95 Author: Lior Halphon <LIJI32@gmail.com> Date: Sat, 14 Feb 2026 00:48:58 +0200 Make the x command support hexadecimal lengths, change the syntax for assembler-like output Diffstat:
| M | Core/debugger.c | 11 | ++++++++--- |
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/Core/debugger.c b/Core/debugger.c @@ -1533,14 +1533,19 @@ static bool examine(GB_gameboy_t *gb, char *arguments, char *modifiers, const de bool assembler_syntax = false; if (modifiers) { size_t modifiers_length = strlen(modifiers); - if (modifiers_length && modifiers[modifiers_length - 1] == 'a') { + if (modifiers_length && modifiers[modifiers_length - 1] == 's') { assembler_syntax = true; modifiers[modifiers_length - 1] = 0; modifiers_length--; } if (modifiers_length) { char *end; - count = (uint16_t) (strtol(modifiers, &end, 10)); + if (modifiers[0] == '$' && modifiers_length > 1) { + count = (uint16_t) (strtol(modifiers + 1, &end, 16)); + } + else { + count = (uint16_t) (strtol(modifiers, &end, 10)); + } if (*end) { print_usage(gb, command); return true; @@ -2240,7 +2245,7 @@ static const debugger_command_t commands[] = { "decimal (d), hexadecimal (x), octal (o) or binary (b).", "<expression>", "format", .argument_completer = symbol_completer, .modifiers_completer = format_completer}, {"eval", 2, }, /* Alias */ - {"examine", 2, examine, "Examine values at address. Use the 'a' modifier to output in assembeler syntax.", "<expression>", "count[a]", .argument_completer = symbol_completer}, + {"examine", 2, examine, "Examine values at address. Use the 's' modifier to output in assembeler syntax.", "<expression>", "[$]count[s]", .argument_completer = symbol_completer}, {"x", 1, }, /* Alias */ {"disassemble", 1, disassemble, "Disassemble instructions at address", "<expression>", "count", .argument_completer = symbol_completer}, {"breakpoint", 1, breakpoint, "Add a new breakpoint at the specified address/expression or range. "
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.