comparison m68k_core.c @ 1772:75172d440900 mame_interp

Wrote a version of m68k_invalidate_code_range for interpreter build so that MMAP_PTR_IDX regions can safely get "fast" pointers
author Michael Pavone <pavone@retrodev.com>
date Tue, 12 Mar 2019 21:58:53 -0700
parents b7ecd0d6a77b
children d5118d6f9c75
comparison
equal deleted inserted replaced
1771:e59045f781ce 1772:75172d440900
1340 context->int_cycle = load_int32(buf); 1340 context->int_cycle = load_int32(buf);
1341 context->int_num = load_int8(buf); 1341 context->int_num = load_int8(buf);
1342 context->int_pending = load_int8(buf); 1342 context->int_pending = load_int8(buf);
1343 context->trace_pending = load_int8(buf); 1343 context->trace_pending = load_int8(buf);
1344 } 1344 }
1345
1346 #ifndef USE_NATIVE
1347 void m68k_invalidate_code_range(m68k_context *context, uint32_t start, uint32_t end)
1348 {
1349 m68000_base_device *device = (m68000_base_device *)context;
1350 for(uint32_t address = start; address < end; address += 0x10000)
1351 {
1352 device->read_pointers[address >> 16] = NULL;
1353 device->write_pointers[address >> 16] = NULL;
1354 memmap_chunk const *chunk = find_map_chunk(address, &context->options->gen, 0, NULL);
1355 if (!chunk || chunk->end < (address + 64*1024) || (chunk->flags & (MMAP_ONLY_ODD | MMAP_ONLY_EVEN)) || !chunk->buffer) {
1356 continue;
1357 }
1358 void *ptr = get_native_pointer(address, (void **)context->mem_pointers, &context->options->gen);
1359 if (!ptr) {
1360 continue;
1361 }
1362 if (chunk->flags & MMAP_READ) {
1363 device->read_pointers[address >> 16] = ptr;
1364 }
1365 if (chunk->flags & MMAP_WRITE) {
1366 device->write_pointers[address >> 16] = ptr;
1367 }
1368 }
1369 }
1370 #endif