diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c index 4c6c2907508..ba93ecb64e0 100644 --- a/src/emu/debug/debugcpu.c +++ b/src/emu/debug/debugcpu.c @@ -1736,6 +1736,7 @@ void debug_write_qword(const address_space *space, offs_t address, UINT64 data, UINT64 debug_read_opcode(const address_space *space, offs_t address, int size, int arg) { UINT64 result = ~(UINT64)0 & (~(UINT64)0 >> (64 - 8*size)), result2; + debugcpu_private *global = space->machine->debugcpu_data; cpu_debug_data *info = cpu_get_debug_data(space->cpu); /* keep in logical range */ @@ -1745,8 +1746,14 @@ UINT64 debug_read_opcode(const address_space *space, offs_t address, int size, i if (info->readop != NULL) { UINT64 result; + + /* return early if we got the result directly */ + memory_set_debugger_access(space, global->debugger_access = TRUE); if ((*info->readop)(space->cpu, address, size, &result)) + { + memory_set_debugger_access(space, global->debugger_access = FALSE); return result; + } } /* if we're bigger than the address bus, break into smaller pieces */ @@ -1820,6 +1827,10 @@ UINT64 debug_read_opcode(const address_space *space, offs_t address, int size, i fatalerror("debug_read_opcode: unknown type = %d", space->dbits / 8 * 10 + size); break; } + + /* turn on debugger access */ + if (!global->debugger_access) + memory_set_debugger_access(space, global->debugger_access = TRUE); /* switch off the size and handle unaligned accesses */ switch (size) @@ -1866,6 +1877,9 @@ UINT64 debug_read_opcode(const address_space *space, offs_t address, int size, i } break; } + + /* no longer accessing via the debugger */ + memory_set_debugger_access(space, global->debugger_access = FALSE); return result; } diff --git a/src/emu/memory.c b/src/emu/memory.c index 03ceb8446a7..2f2178c6baa 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -909,7 +909,8 @@ int memory_set_direct_region(const address_space *space, offs_t byteaddress) /* ensure future updates to land here as well until we get back into a bank */ spacerw->direct.byteend = 0; spacerw->direct.bytestart = 1; - logerror("CPU '%s': warning - attempt to direct-map address %08X in %s space\n", space->cpu->tag, byteaddress, space->name); + if (!spacerw->debugger_access) + logerror("CPU '%s': warning - attempt to direct-map address %08X in %s space\n", space->cpu->tag, byteaddress, space->name); return FALSE; } @@ -2967,9 +2968,9 @@ static direct_range *direct_range_find(address_space *space, offs_t byteaddress, /* determine which entry */ byteaddress &= space->bytemask; - *entry = space->readlookup[LEVEL1_INDEX(byteaddress)]; + *entry = space->read.table[LEVEL1_INDEX(byteaddress)]; if (*entry >= SUBTABLE_BASE) - *entry = space->readlookup[LEVEL2_INDEX(*entry, byteaddress)]; + *entry = space->read.table[LEVEL2_INDEX(*entry, byteaddress)]; rangelistptr = &space->direct.rangelist[*entry]; /* scan our table */