comparison gdb_remote.c @ 1965:3a46ff899fa6

More correct implementation of byte printing in builtin debugger. Fix GDB debugger to use helper in backend.c for reading bytes
author Michael Pavone <pavone@retrodev.com>
date Sun, 03 May 2020 23:28:42 -0700
parents 495569c1dc61
children a7b753e260a2 f80c6111e1ae
comparison
equal deleted inserted replaced
1964:9d35ce5012a6 1965:3a46ff899fa6
130 context->flags[i] = value & 1; 130 context->flags[i] = value & 1;
131 value >>= 1; 131 value >>= 1;
132 } 132 }
133 } 133 }
134 134
135 uint8_t m68k_read_byte(m68k_context * context, uint32_t address) 135 static uint8_t m68k_read_byte(m68k_context *context, uint32_t address)
136 { 136 {
137 137 //TODO: share this implementation with builtin debugger
138 genesis_context *gen = context->system; 138 return read_byte(address, (void **)context->mem_pointers, &context->options->gen, context);
139 //TODO: Use generated read/write functions to support access to hardware that is not ROM or RAM
140 uint16_t * word = get_native_pointer(address & 0xFFFFFFFE, (void **)context->mem_pointers, &context->options->gen);
141 if (word) {
142 if (address & 1) {
143 return *word;
144 }
145 return *word >> 8;
146 }
147 if (address >= 0xA00000 && address < 0xA04000) {
148 return gen->zram[address & 0x1FFF];
149 }
150 return 0;
151 } 139 }
152 140
153 void m68k_write_byte(m68k_context * context, uint32_t address, uint8_t value) 141 void m68k_write_byte(m68k_context * context, uint32_t address, uint8_t value)
154 { 142 {
155 genesis_context *gen = context->system; 143 genesis_context *gen = context->system;