Mercurial > repos > blastem
comparison gdb_remote.c @ 1506:ded16f3d7eb4 mame_interp
Super hacky integration of the version of Musashi from MAME
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 27 Dec 2017 13:46:52 -0800 |
parents | 85a90964b557 |
children | 8fe162bdb038 |
comparison
equal
deleted
inserted
replaced
1471:2e6320d261ff | 1506:ded16f3d7eb4 |
---|---|
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 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 |
138 genesis_context *gen = context->system; | 138 genesis_context *gen = context->system; |
139 //TODO: Use generated read/write functions to support access to hardware that is not ROM or RAM | 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); | 140 uint16_t * word = get_native_pointer(address & 0xFFFFFFFE, (void **)context->mem_pointers, &context->options->gen); |
148 return gen->zram[address & 0x1FFF]; | 148 return gen->zram[address & 0x1FFF]; |
149 } | 149 } |
150 return 0; | 150 return 0; |
151 } | 151 } |
152 | 152 |
153 void write_byte(m68k_context * context, uint32_t address, uint8_t value) | 153 static void m68k_write_byte(m68k_context * context, uint32_t address, uint8_t value) |
154 { | 154 { |
155 genesis_context *gen = context->system; | 155 genesis_context *gen = context->system; |
156 //TODO: Use generated read/write functions so that memory map is properly respected | 156 //TODO: Use generated read/write functions so that memory map is properly respected |
157 uint16_t * word = get_native_pointer(address & 0xFFFFFFFE, (void **)context->mem_pointers, &context->options->gen); | 157 uint16_t * word = get_native_pointer(address & 0xFFFFFFFE, (void **)context->mem_pointers, &context->options->gen); |
158 if (word) { | 158 if (word) { |
303 size = (sizeof(send_buf)-1)/2; | 303 size = (sizeof(send_buf)-1)/2; |
304 } | 304 } |
305 char *cur = send_buf; | 305 char *cur = send_buf; |
306 while (size) | 306 while (size) |
307 { | 307 { |
308 hex_8(read_byte(context, address), cur); | 308 hex_8(m68k_read_byte(context, address), cur); |
309 cur += 2; | 309 cur += 2; |
310 address++; | 310 address++; |
311 size--; | 311 size--; |
312 } | 312 } |
313 *cur = 0; | 313 *cur = 0; |
324 { | 324 { |
325 char tmp[3]; | 325 char tmp[3]; |
326 tmp[0] = *(cur++); | 326 tmp[0] = *(cur++); |
327 tmp[1] = *(cur++); | 327 tmp[1] = *(cur++); |
328 tmp[2] = 0; | 328 tmp[2] = 0; |
329 write_byte(context, address, strtoul(tmp, NULL, 16)); | 329 m68k_write_byte(context, address, strtoul(tmp, NULL, 16)); |
330 address++; | 330 address++; |
331 size--; | 331 size--; |
332 } | 332 } |
333 gdb_send_command("OK"); | 333 gdb_send_command("OK"); |
334 break; | 334 break; |