Mercurial > repos > blastem
diff debug.c @ 1983:a7b753e260a2 mame_interp
Merge from default
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 09 May 2020 23:39:44 -0700 |
parents | 374a5ae694e8 3a46ff899fa6 |
children | b119e0de9a70 |
line wrap: on
line diff
--- a/debug.c Sun Apr 19 00:59:49 2020 -0700 +++ b/debug.c Sat May 09 23:39:44 2020 -0700 @@ -95,6 +95,12 @@ } } +static uint8_t m68k_read_byte(uint32_t address, m68k_context *context) +{ + //TODO: share this implementation with GDB debugger + return read_byte(address, (void **)context->mem_pointers, &context->options->gen, context); +} + uint16_t m68k_read_word(uint32_t address, m68k_context *context) { return read_word(address, (void **)context->mem_pointers, &context->options->gen, context); @@ -158,6 +164,8 @@ uint32_t p_addr = strtol(param+(param[0] == '0' ? 2 : 1), &after, 16); if (after[0] == '.' && after[1] == 'l') { value = m68k_read_long(p_addr, context); + } else if (after[0] == '.' && after[1] == 'b') { + value = m68k_read_byte(p_addr, context); } else { value = m68k_read_word(p_addr, context); } @@ -166,6 +174,8 @@ uint32_t p_addr = param[1] == 'a' ? context->aregs[reg] : context->dregs[reg]; if (param[4] == '.' && param[5] == 'l') { value = m68k_read_long(p_addr, context); + } else if (param[4] == '.' && param[5] == 'b') { + value = m68k_read_byte(p_addr, context); } else { value = m68k_read_word(p_addr, context); }