mirror of
https://github.com/holub/mame
synced 2025-07-02 08:39:21 +03:00
map command in the debugger now does separate read/write/fetch lookups
This commit is contained in:
parent
0f5d57d29c
commit
cfab49b884
@ -2055,6 +2055,7 @@ static void execute_map(int ref, int params, const char *param[])
|
|||||||
const debug_cpu_info *info;
|
const debug_cpu_info *info;
|
||||||
int spacenum = ref;
|
int spacenum = ref;
|
||||||
offs_t taddress;
|
offs_t taddress;
|
||||||
|
int intention;
|
||||||
|
|
||||||
/* validate parameters */
|
/* validate parameters */
|
||||||
if (!debug_command_parameter_number(param[0], &address))
|
if (!debug_command_parameter_number(param[0], &address))
|
||||||
@ -2062,23 +2063,26 @@ static void execute_map(int ref, int params, const char *param[])
|
|||||||
info = debug_get_cpu_info(cpunum);
|
info = debug_get_cpu_info(cpunum);
|
||||||
|
|
||||||
/* do the translation first */
|
/* do the translation first */
|
||||||
taddress = ADDR2BYTE_MASKED(address, info, spacenum);
|
for (intention = TRANSLATE_READ_DEBUG; intention <= TRANSLATE_FETCH_DEBUG; intention++)
|
||||||
if (info->translate != NULL)
|
|
||||||
{
|
{
|
||||||
if ((*info->translate)(spacenum, TRANSLATE_READ_DEBUG, &taddress))
|
static const char *intnames[] = { "Read", "Write", "Fetch" };
|
||||||
debug_console_printf("%08X logical -> %08X physical\n", (UINT32)address, BYTE2ADDR(taddress, info, spacenum));
|
taddress = ADDR2BYTE_MASKED(address, info, spacenum);
|
||||||
|
if (info->translate != NULL)
|
||||||
|
{
|
||||||
|
if ((*info->translate)(spacenum, intention, &taddress))
|
||||||
|
{
|
||||||
|
const char *mapname = memory_get_handler_string(intention == TRANSLATE_WRITE_DEBUG, cpunum, spacenum, taddress);
|
||||||
|
debug_console_printf("%7s: %08X logical == %08X physical -> %s\n", intnames[intention & 3], (UINT32)address, BYTE2ADDR(taddress, info, spacenum), mapname);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
debug_console_printf("%7s: %08X logical is unmapped\n", intnames[intention & 3], (UINT32)address);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
debug_console_printf("%08X logical -> unmapped\n", (UINT32)address);
|
const char *mapname = memory_get_handler_string(intention == TRANSLATE_WRITE_DEBUG, cpunum, spacenum, taddress);
|
||||||
return;
|
debug_console_printf("%7s: %08X -> %s\n", intnames[intention & 3], BYTE2ADDR(taddress, info, spacenum), mapname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
debug_console_printf("%08X physical\n", BYTE2ADDR(taddress, info, spacenum));
|
|
||||||
|
|
||||||
/* now do the mapping */
|
|
||||||
debug_console_printf(" -> read: %s\n", memory_get_handler_string(0, cpunum, spacenum, taddress));
|
|
||||||
debug_console_printf(" -> write: %s\n", memory_get_handler_string(1, cpunum, spacenum, taddress));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user