summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/debug/debugcmd.cpp')
-rw-r--r--src/emu/debug/debugcmd.cpp270
1 files changed, 135 insertions, 135 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index a2e0d43a0c1..323a0e2c746 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -49,15 +49,15 @@ bool debugger_commands::cheat_address_is_valid(address_space &space, offs_t addr
the current cheat width, if signed
-------------------------------------------------*/
-UINT64 debugger_commands::cheat_sign_extend(const cheat_system *cheatsys, UINT64 value)
+uint64_t debugger_commands::cheat_sign_extend(const cheat_system *cheatsys, uint64_t value)
{
if (cheatsys->signed_cheat)
{
switch (cheatsys->width)
{
- case 1: value = (INT8)value; break;
- case 2: value = (INT16)value; break;
- case 4: value = (INT32)value; break;
+ case 1: value = (int8_t)value; break;
+ case 2: value = (int16_t)value; break;
+ case 4: value = (int32_t)value; break;
}
}
return value;
@@ -67,7 +67,7 @@ UINT64 debugger_commands::cheat_sign_extend(const cheat_system *cheatsys, UINT64
cheat_byte_swap - swap a value
-------------------------------------------------*/
-UINT64 debugger_commands::cheat_byte_swap(const cheat_system *cheatsys, UINT64 value)
+uint64_t debugger_commands::cheat_byte_swap(const cheat_system *cheatsys, uint64_t value)
{
if (cheatsys->swapped_cheat)
{
@@ -88,7 +88,7 @@ UINT64 debugger_commands::cheat_byte_swap(const cheat_system *cheatsys, UINT64 v
and swapping if necessary
-------------------------------------------------*/
-UINT64 debugger_commands::cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address)
+uint64_t debugger_commands::cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address)
{
return cheat_sign_extend(cheatsys, cheat_byte_swap(cheatsys, m_cpu.read_memory(space, address, cheatsys->width, TRUE)));
}
@@ -111,7 +111,7 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu
/* add all single-entry save state globals */
for (int itemnum = 0; itemnum < MAX_GLOBALS; itemnum++)
{
- UINT32 valsize, valcount;
+ uint32_t valsize, valcount;
void *base;
/* stop when we run out of items */
@@ -281,7 +281,7 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu
execute_min - return the minimum of two values
-------------------------------------------------*/
-UINT64 debugger_commands::execute_min(symbol_table &table, void *ref, int params, const UINT64 *param)
+uint64_t debugger_commands::execute_min(symbol_table &table, void *ref, int params, const uint64_t *param)
{
return (param[0] < param[1]) ? param[0] : param[1];
}
@@ -291,7 +291,7 @@ UINT64 debugger_commands::execute_min(symbol_table &table, void *ref, int params
execute_max - return the maximum of two values
-------------------------------------------------*/
-UINT64 debugger_commands::execute_max(symbol_table &table, void *ref, int params, const UINT64 *param)
+uint64_t debugger_commands::execute_max(symbol_table &table, void *ref, int params, const uint64_t *param)
{
return (param[0] > param[1]) ? param[0] : param[1];
}
@@ -301,7 +301,7 @@ UINT64 debugger_commands::execute_max(symbol_table &table, void *ref, int params
execute_if - if (a) return b; else return c;
-------------------------------------------------*/
-UINT64 debugger_commands::execute_if(symbol_table &table, void *ref, int params, const UINT64 *param)
+uint64_t debugger_commands::execute_if(symbol_table &table, void *ref, int params, const uint64_t *param)
{
return param[0] ? param[1] : param[2];
}
@@ -316,15 +316,15 @@ UINT64 debugger_commands::execute_if(symbol_table &table, void *ref, int params,
global_get - symbol table getter for globals
-------------------------------------------------*/
-UINT64 debugger_commands::global_get(symbol_table &table, void *ref)
+uint64_t debugger_commands::global_get(symbol_table &table, void *ref)
{
global_entry *global = (global_entry *)ref;
switch (global->size)
{
- case 1: return *(UINT8 *)global->base;
- case 2: return *(UINT16 *)global->base;
- case 4: return *(UINT32 *)global->base;
- case 8: return *(UINT64 *)global->base;
+ case 1: return *(uint8_t *)global->base;
+ case 2: return *(uint16_t *)global->base;
+ case 4: return *(uint32_t *)global->base;
+ case 8: return *(uint64_t *)global->base;
}
return ~0;
}
@@ -334,15 +334,15 @@ UINT64 debugger_commands::global_get(symbol_table &table, void *ref)
global_set - symbol table setter for globals
-------------------------------------------------*/
-void debugger_commands::global_set(symbol_table &table, void *ref, UINT64 value)
+void debugger_commands::global_set(symbol_table &table, void *ref, uint64_t value)
{
global_entry *global = (global_entry *)ref;
switch (global->size)
{
- case 1: *(UINT8 *)global->base = value; break;
- case 2: *(UINT16 *)global->base = value; break;
- case 4: *(UINT32 *)global->base = value; break;
- case 8: *(UINT64 *)global->base = value; break;
+ case 1: *(uint8_t *)global->base = value; break;
+ case 2: *(uint16_t *)global->base = value; break;
+ case 4: *(uint32_t *)global->base = value; break;
+ case 8: *(uint64_t *)global->base = value; break;
}
}
@@ -357,7 +357,7 @@ void debugger_commands::global_set(symbol_table &table, void *ref, UINT64 value)
number parameter
-------------------------------------------------*/
-bool debugger_commands::validate_number_parameter(const char *param, UINT64 *result)
+bool debugger_commands::validate_number_parameter(const char *param, uint64_t *result)
{
/* nullptr parameter does nothing and returns no error */
if (param == nullptr)
@@ -432,7 +432,7 @@ bool debugger_commands::validate_cpu_parameter(const char *param, device_t **res
return true;
/* then evaluate as an expression; on an error assume it was a tag */
- UINT64 cpunum;
+ uint64_t cpunum;
try
{
parsed_expression expression(m_cpu.get_visible_symtable(), param, &cpunum);
@@ -552,7 +552,7 @@ void debugger_commands::execute_help(int ref, int params, const char *param[])
void debugger_commands::execute_print(int ref, int params, const char *param[])
{
/* validate the other parameters */
- UINT64 values[MAX_COMMAND_PARAMS];
+ uint64_t values[MAX_COMMAND_PARAMS];
for (int i = 0; i < params; i++)
if (!validate_number_parameter(param[i], &values[i]))
return;
@@ -568,7 +568,7 @@ void debugger_commands::execute_print(int ref, int params, const char *param[])
mini_printf - safe printf to a buffer
-------------------------------------------------*/
-int debugger_commands::mini_printf(char *buffer, const char *format, int params, UINT64 *param)
+int debugger_commands::mini_printf(char *buffer, const char *format, int params, uint64_t *param)
{
const char *f = format;
char *p = buffer;
@@ -624,11 +624,11 @@ int debugger_commands::mini_printf(char *buffer, const char *format, int params,
m_console.printf("Not enough parameters for format!\n");
return 0;
}
- if ((UINT32)(*param >> 32) != 0)
- p += sprintf(p, zerofill ? "%0*X" : "%*X", (width <= 8) ? 1 : width - 8, (UINT32)(*param >> 32));
+ if ((uint32_t)(*param >> 32) != 0)
+ p += sprintf(p, zerofill ? "%0*X" : "%*X", (width <= 8) ? 1 : width - 8, (uint32_t)(*param >> 32));
else if (width > 8)
p += sprintf(p, zerofill ? "%0*X" : "%*X", width - 8, 0);
- p += sprintf(p, zerofill ? "%0*X" : "%*X", (width < 8) ? width : 8, (UINT32)*param);
+ p += sprintf(p, zerofill ? "%0*X" : "%*X", (width < 8) ? width : 8, (uint32_t)*param);
param++;
params--;
break;
@@ -640,7 +640,7 @@ int debugger_commands::mini_printf(char *buffer, const char *format, int params,
m_console.printf("Not enough parameters for format!\n");
return 0;
}
- p += sprintf(p, zerofill ? "%0*d" : "%*d", width, (UINT32)*param);
+ p += sprintf(p, zerofill ? "%0*d" : "%*d", width, (uint32_t)*param);
param++;
params--;
break;
@@ -665,7 +665,7 @@ int debugger_commands::mini_printf(char *buffer, const char *format, int params,
void debugger_commands::execute_printf(int ref, int params, const char *param[])
{
/* validate the other parameters */
- UINT64 values[MAX_COMMAND_PARAMS];
+ uint64_t values[MAX_COMMAND_PARAMS];
for (int i = 1; i < params; i++)
if (!validate_number_parameter(param[i], &values[i]))
return;
@@ -684,7 +684,7 @@ void debugger_commands::execute_printf(int ref, int params, const char *param[])
void debugger_commands::execute_logerror(int ref, int params, const char *param[])
{
/* validate the other parameters */
- UINT64 values[MAX_COMMAND_PARAMS];
+ uint64_t values[MAX_COMMAND_PARAMS];
for (int i = 1; i < params; i++)
if (!validate_number_parameter(param[i], &values[i]))
return;
@@ -703,7 +703,7 @@ void debugger_commands::execute_logerror(int ref, int params, const char *param[
void debugger_commands::execute_tracelog(int ref, int params, const char *param[])
{
/* validate the other parameters */
- UINT64 values[MAX_COMMAND_PARAMS];
+ uint64_t values[MAX_COMMAND_PARAMS];
for (int i = 1; i < params; i++)
if (!validate_number_parameter(param[i], &values[i]))
return;
@@ -732,7 +732,7 @@ void debugger_commands::execute_quit(int ref, int params, const char *param[])
void debugger_commands::execute_do(int ref, int params, const char *param[])
{
- UINT64 dummy;
+ uint64_t dummy;
validate_number_parameter(param[0], &dummy);
}
@@ -744,7 +744,7 @@ void debugger_commands::execute_do(int ref, int params, const char *param[])
void debugger_commands::execute_step(int ref, int params, const char *param[])
{
/* if we have a parameter, use it */
- UINT64 steps = 1;
+ uint64_t steps = 1;
if (!validate_number_parameter(param[0], &steps))
return;
@@ -759,7 +759,7 @@ void debugger_commands::execute_step(int ref, int params, const char *param[])
void debugger_commands::execute_over(int ref, int params, const char *param[])
{
/* if we have a parameter, use it */
- UINT64 steps = 1;
+ uint64_t steps = 1;
if (!validate_number_parameter(param[0], &steps))
return;
@@ -783,7 +783,7 @@ void debugger_commands::execute_out(int ref, int params, const char *param[])
void debugger_commands::execute_go(int ref, int params, const char *param[])
{
- UINT64 addr = ~0;
+ uint64_t addr = ~0;
/* if we have a parameter, use it instead */
if (!validate_number_parameter(param[0], &addr))
@@ -810,7 +810,7 @@ void debugger_commands::execute_go_vblank(int ref, int params, const char *param
void debugger_commands::execute_go_interrupt(int ref, int params, const char *param[])
{
- UINT64 irqline = -1;
+ uint64_t irqline = -1;
/* if we have a parameter, use it instead */
if (!validate_number_parameter(param[0], &irqline))
@@ -826,7 +826,7 @@ void debugger_commands::execute_go_interrupt(int ref, int params, const char *pa
void debugger_commands::execute_go_time(int ref, int params, const char *param[])
{
- UINT64 milliseconds = -1;
+ uint64_t milliseconds = -1;
/* if we have a parameter, use it instead */
if (!validate_number_parameter(param[0], &milliseconds))
@@ -987,7 +987,7 @@ void debugger_commands::execute_observe(int ref, int params, const char *param[]
void debugger_commands::execute_comment_add(int ref, int params, const char *param[])
{
device_t *cpu;
- UINT64 address;
+ uint64_t address;
/* param 1 is the address for the comment */
if (!validate_number_parameter(param[0], &address))
@@ -1017,7 +1017,7 @@ void debugger_commands::execute_comment_add(int ref, int params, const char *par
void debugger_commands::execute_comment_del(int ref, int params, const char *param[])
{
device_t *cpu;
- UINT64 address;
+ uint64_t address;
/* param 1 can either be a command or the address for the comment */
if (!validate_number_parameter(param[0], &address))
@@ -1093,7 +1093,7 @@ void debugger_commands::execute_bpset(int ref, int params, const char *param[])
{
device_t *cpu;
const char *action = nullptr;
- UINT64 address;
+ uint64_t address;
int bpnum;
/* CPU is implicit */
@@ -1126,7 +1126,7 @@ void debugger_commands::execute_bpset(int ref, int params, const char *param[])
void debugger_commands::execute_bpclear(int ref, int params, const char *param[])
{
- UINT64 bpindex;
+ uint64_t bpindex;
/* if 0 parameters, clear all */
if (params == 0)
@@ -1146,9 +1146,9 @@ void debugger_commands::execute_bpclear(int ref, int params, const char *param[]
if (device.debug()->breakpoint_clear(bpindex))
found = true;
if (found)
- m_console.printf("Breakpoint %X cleared\n", (UINT32)bpindex);
+ m_console.printf("Breakpoint %X cleared\n", (uint32_t)bpindex);
else
- m_console.printf("Invalid breakpoint number %X\n", (UINT32)bpindex);
+ m_console.printf("Invalid breakpoint number %X\n", (uint32_t)bpindex);
}
}
@@ -1160,7 +1160,7 @@ void debugger_commands::execute_bpclear(int ref, int params, const char *param[]
void debugger_commands::execute_bpdisenable(int ref, int params, const char *param[])
{
- UINT64 bpindex;
+ uint64_t bpindex;
/* if 0 parameters, clear all */
if (params == 0)
@@ -1183,9 +1183,9 @@ void debugger_commands::execute_bpdisenable(int ref, int params, const char *par
if (device.debug()->breakpoint_enable(bpindex, ref))
found = true;
if (found)
- m_console.printf("Breakpoint %X %s\n", (UINT32)bpindex, ref ? "enabled" : "disabled");
+ m_console.printf("Breakpoint %X %s\n", (uint32_t)bpindex, ref ? "enabled" : "disabled");
else
- m_console.printf("Invalid breakpoint number %X\n", (UINT32)bpindex);
+ m_console.printf("Invalid breakpoint number %X\n", (uint32_t)bpindex);
}
}
@@ -1233,7 +1233,7 @@ void debugger_commands::execute_wpset(int ref, int params, const char *param[])
{
address_space *space;
const char *action = nullptr;
- UINT64 address, length;
+ uint64_t address, length;
int type;
int wpnum;
@@ -1284,7 +1284,7 @@ void debugger_commands::execute_wpset(int ref, int params, const char *param[])
void debugger_commands::execute_wpclear(int ref, int params, const char *param[])
{
- UINT64 wpindex;
+ uint64_t wpindex;
/* if 0 parameters, clear all */
if (params == 0)
@@ -1304,9 +1304,9 @@ void debugger_commands::execute_wpclear(int ref, int params, const char *param[]
if (device.debug()->watchpoint_clear(wpindex))
found = true;
if (found)
- m_console.printf("Watchpoint %X cleared\n", (UINT32)wpindex);
+ m_console.printf("Watchpoint %X cleared\n", (uint32_t)wpindex);
else
- m_console.printf("Invalid watchpoint number %X\n", (UINT32)wpindex);
+ m_console.printf("Invalid watchpoint number %X\n", (uint32_t)wpindex);
}
}
@@ -1318,7 +1318,7 @@ void debugger_commands::execute_wpclear(int ref, int params, const char *param[]
void debugger_commands::execute_wpdisenable(int ref, int params, const char *param[])
{
- UINT64 wpindex;
+ uint64_t wpindex;
/* if 0 parameters, clear all */
if (params == 0)
@@ -1341,9 +1341,9 @@ void debugger_commands::execute_wpdisenable(int ref, int params, const char *par
if (device.debug()->watchpoint_enable(wpindex, ref))
found = true;
if (found)
- m_console.printf("Watchpoint %X %s\n", (UINT32)wpindex, ref ? "enabled" : "disabled");
+ m_console.printf("Watchpoint %X %s\n", (uint32_t)wpindex, ref ? "enabled" : "disabled");
else
- m_console.printf("Invalid watchpoint number %X\n", (UINT32)wpindex);
+ m_console.printf("Invalid watchpoint number %X\n", (uint32_t)wpindex);
}
}
@@ -1426,7 +1426,7 @@ void debugger_commands::execute_rpset(int ref, int params, const char *param[])
void debugger_commands::execute_rpclear(int ref, int params, const char *param[])
{
- UINT64 rpindex;
+ uint64_t rpindex;
/* if 0 parameters, clear all */
if (params == 0)
@@ -1446,9 +1446,9 @@ void debugger_commands::execute_rpclear(int ref, int params, const char *param[]
if (device.debug()->registerpoint_clear(rpindex))
found = true;
if (found)
- m_console.printf("Registerpoint %X cleared\n", (UINT32)rpindex);
+ m_console.printf("Registerpoint %X cleared\n", (uint32_t)rpindex);
else
- m_console.printf("Invalid registerpoint number %X\n", (UINT32)rpindex);
+ m_console.printf("Invalid registerpoint number %X\n", (uint32_t)rpindex);
}
}
@@ -1460,7 +1460,7 @@ void debugger_commands::execute_rpclear(int ref, int params, const char *param[]
void debugger_commands::execute_rpdisenable(int ref, int params, const char *param[])
{
- UINT64 rpindex;
+ uint64_t rpindex;
/* if 0 parameters, clear all */
if (params == 0)
@@ -1483,9 +1483,9 @@ void debugger_commands::execute_rpdisenable(int ref, int params, const char *par
if (device.debug()->registerpoint_enable(rpindex, ref))
found = true;
if (found)
- m_console.printf("Registerpoint %X %s\n", (UINT32)rpindex, ref ? "enabled" : "disabled");
+ m_console.printf("Registerpoint %X %s\n", (uint32_t)rpindex, ref ? "enabled" : "disabled");
else
- m_console.printf("Invalid registerpoint number %X\n", (UINT32)rpindex);
+ m_console.printf("Invalid registerpoint number %X\n", (uint32_t)rpindex);
}
}
@@ -1552,10 +1552,10 @@ void debugger_commands::execute_hotspot(int ref, int params, const char *param[]
device_t *device = nullptr;
if (!validate_cpu_parameter((params > 0) ? param[0] : nullptr, &device))
return;
- UINT64 count = 64;
+ uint64_t count = 64;
if (!validate_number_parameter(param[1], &count))
return;
- UINT64 threshhold = 250;
+ uint64_t threshhold = 250;
if (!validate_number_parameter(param[2], &threshhold))
return;
@@ -1602,10 +1602,10 @@ void debugger_commands::execute_stateload(int ref, int params, const char *param
void debugger_commands::execute_save(int ref, int params, const char *param[])
{
- UINT64 offset, endoffset, length;
+ uint64_t offset, endoffset, length;
address_space *space;
FILE *f;
- UINT64 i;
+ uint64_t i;
/* validate parameters */
if (!validate_number_parameter(param[1], &offset))
@@ -1630,7 +1630,7 @@ void debugger_commands::execute_save(int ref, int params, const char *param[])
/* now write the data out */
for (i = offset; i <= endoffset; i++)
{
- UINT8 byte = m_cpu.read_byte(*space, i, TRUE);
+ uint8_t byte = m_cpu.read_byte(*space, i, TRUE);
fwrite(&byte, 1, 1, f);
}
@@ -1646,10 +1646,10 @@ void debugger_commands::execute_save(int ref, int params, const char *param[])
void debugger_commands::execute_load(int ref, int params, const char *param[])
{
- UINT64 offset, endoffset, length;
+ uint64_t offset, endoffset, length;
address_space *space;
FILE *f;
- UINT64 i;
+ uint64_t i;
/* validate parameters */
if (!validate_number_parameter(param[1], &offset))
@@ -1672,7 +1672,7 @@ void debugger_commands::execute_load(int ref, int params, const char *param[])
}
/* now read the data in, ignore endoffset and load entire file if length has been set to zero (offset-1) */
- UINT8 byte;
+ uint8_t byte;
for (i = offset; i <= endoffset || endoffset == offset - 1 ; i++)
{
fread(&byte, 1, 1, f);
@@ -1697,23 +1697,23 @@ void debugger_commands::execute_load(int ref, int params, const char *param[])
void debugger_commands::execute_dump(int ref, int params, const char *param[])
{
/* validate parameters */
- UINT64 offset;
+ uint64_t offset;
if (!validate_number_parameter(param[1], &offset))
return;
- UINT64 length;
+ uint64_t length;
if (!validate_number_parameter(param[2], &length))
return;
- UINT64 width = 0;
+ uint64_t width = 0;
if (!validate_number_parameter(param[3], &width))
return;
- UINT64 ascii = 1;
+ uint64_t ascii = 1;
if (!validate_number_parameter(param[4], &ascii))
return;
- UINT64 rowsize = 16;
+ uint64_t rowsize = 16;
if (!validate_number_parameter(param[5], &rowsize))
return;
@@ -1737,7 +1737,7 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[])
return;
}
- UINT64 endoffset = space->address_to_byte(offset + length - 1) & space->bytemask();
+ uint64_t endoffset = space->address_to_byte(offset + length - 1) & space->bytemask();
offset = space->address_to_byte(offset) & space->bytemask();
/* open the file */
@@ -1751,23 +1751,23 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[])
/* now write the data out */
util::ovectorstream output;
output.reserve(200);
- for (UINT64 i = offset; i <= endoffset; i += rowsize)
+ for (uint64_t i = offset; i <= endoffset; i += rowsize)
{
output.clear();
output.rdbuf()->clear();
/* print the address */
- util::stream_format(output, "%0*X: ", space->logaddrchars(), (UINT32)space->byte_to_address(i));
+ util::stream_format(output, "%0*X: ", space->logaddrchars(), (uint32_t)space->byte_to_address(i));
/* print the bytes */
- for (UINT64 j = 0; j < rowsize; j += width)
+ for (uint64_t j = 0; j < rowsize; j += width)
{
if (i + j <= endoffset)
{
offs_t curaddr = i + j;
if (space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr))
{
- UINT64 value = m_cpu.read_memory(*space, i + j, width, TRUE);
+ uint64_t value = m_cpu.read_memory(*space, i + j, width, TRUE);
util::stream_format(output, " %0*X", width * 2, value);
}
else
@@ -1783,12 +1783,12 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[])
if (ascii)
{
util::stream_format(output, " ");
- for (UINT64 j = 0; j < rowsize && (i + j) <= endoffset; j++)
+ for (uint64_t j = 0; j < rowsize && (i + j) <= endoffset; j++)
{
offs_t curaddr = i + j;
if (space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr))
{
- UINT8 byte = m_cpu.read_byte(*space, i + j, TRUE);
+ uint8_t byte = m_cpu.read_byte(*space, i + j, TRUE);
util::stream_format(output, "%c", (byte >= 32 && byte < 127) ? byte : '.');
}
else
@@ -1815,11 +1815,11 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[])
void debugger_commands::execute_cheatinit(int ref, int params, const char *param[])
{
- UINT64 offset, length = 0, real_length = 0;
+ uint64_t offset, length = 0, real_length = 0;
address_space *space;
- UINT32 active_cheat = 0;
- UINT64 curaddr;
- UINT8 i, region_count = 0;
+ uint32_t active_cheat = 0;
+ uint64_t curaddr;
+ uint8_t i, region_count = 0;
cheat_region_map cheat_region[100];
@@ -1969,10 +1969,10 @@ void debugger_commands::execute_cheatinit(int ref, int params, const char *param
void debugger_commands::execute_cheatnext(int ref, int params, const char *param[])
{
address_space *space;
- UINT64 cheatindex;
- UINT32 active_cheat = 0;
- UINT8 condition;
- UINT64 comp_value = 0;
+ uint64_t cheatindex;
+ uint32_t active_cheat = 0;
+ uint8_t condition;
+ uint64_t comp_value = 0;
enum
{
@@ -2038,9 +2038,9 @@ void debugger_commands::execute_cheatnext(int ref, int params, const char *param
for (cheatindex = 0; cheatindex < m_cheat.cheatmap.size(); cheatindex += 1)
if (m_cheat.cheatmap[cheatindex].state == 1)
{
- UINT64 cheat_value = cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset);
- UINT64 comp_byte = (ref == 0) ? m_cheat.cheatmap[cheatindex].previous_value : m_cheat.cheatmap[cheatindex].first_value;
- UINT8 disable_byte = FALSE;
+ uint64_t cheat_value = cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset);
+ uint64_t comp_byte = (ref == 0) ? m_cheat.cheatmap[cheatindex].previous_value : m_cheat.cheatmap[cheatindex].first_value;
+ uint8_t disable_byte = FALSE;
switch (condition)
{
@@ -2065,30 +2065,30 @@ void debugger_commands::execute_cheatnext(int ref, int params, const char *param
case CHEAT_DECREASE:
if (m_cheat.signed_cheat)
- disable_byte = ((INT64)cheat_value >= (INT64)comp_byte);
+ disable_byte = ((int64_t)cheat_value >= (int64_t)comp_byte);
else
- disable_byte = ((UINT64)cheat_value >= (UINT64)comp_byte);
+ disable_byte = ((uint64_t)cheat_value >= (uint64_t)comp_byte);
break;
case CHEAT_INCREASE:
if (m_cheat.signed_cheat)
- disable_byte = ((INT64)cheat_value <= (INT64)comp_byte);
+ disable_byte = ((int64_t)cheat_value <= (int64_t)comp_byte);
else
- disable_byte = ((UINT64)cheat_value <= (UINT64)comp_byte);
+ disable_byte = ((uint64_t)cheat_value <= (uint64_t)comp_byte);
break;
case CHEAT_DECREASE_OR_EQUAL:
if (m_cheat.signed_cheat)
- disable_byte = ((INT64)cheat_value > (INT64)comp_byte);
+ disable_byte = ((int64_t)cheat_value > (int64_t)comp_byte);
else
- disable_byte = ((UINT64)cheat_value > (UINT64)comp_byte);
+ disable_byte = ((uint64_t)cheat_value > (uint64_t)comp_byte);
break;
case CHEAT_INCREASE_OR_EQUAL:
if (m_cheat.signed_cheat)
- disable_byte = ((INT64)cheat_value < (INT64)comp_byte);
+ disable_byte = ((int64_t)cheat_value < (int64_t)comp_byte);
else
- disable_byte = ((UINT64)cheat_value < (UINT64)comp_byte);
+ disable_byte = ((uint64_t)cheat_value < (uint64_t)comp_byte);
break;
case CHEAT_DECREASEOF:
@@ -2101,16 +2101,16 @@ void debugger_commands::execute_cheatnext(int ref, int params, const char *param
case CHEAT_SMALLEROF:
if (m_cheat.signed_cheat)
- disable_byte = ((INT64)cheat_value >= (INT64)comp_value);
+ disable_byte = ((int64_t)cheat_value >= (int64_t)comp_value);
else
- disable_byte = ((UINT64)cheat_value >= (UINT64)comp_value);
+ disable_byte = ((uint64_t)cheat_value >= (uint64_t)comp_value);
break;
case CHEAT_GREATEROF:
if (m_cheat.signed_cheat)
- disable_byte = ((INT64)cheat_value <= (INT64)comp_value);
+ disable_byte = ((int64_t)cheat_value <= (int64_t)comp_value);
else
- disable_byte = ((UINT64)cheat_value <= (UINT64)comp_value);
+ disable_byte = ((uint64_t)cheat_value <= (uint64_t)comp_value);
break;
case CHEAT_CHANGEDBY:
if (cheat_value > comp_byte)
@@ -2148,9 +2148,9 @@ void debugger_commands::execute_cheatlist(int ref, int params, const char *param
char spaceletter, sizeletter;
address_space *space;
device_t *cpu;
- UINT32 active_cheat = 0;
- UINT64 cheatindex;
- UINT64 sizemask;
+ uint32_t active_cheat = 0;
+ uint64_t cheatindex;
+ uint64_t sizemask;
FILE *f = nullptr;
if (!validate_cpu_space_parameter(m_cheat.cpu, AS_PROGRAM, space))
@@ -2185,7 +2185,7 @@ void debugger_commands::execute_cheatlist(int ref, int params, const char *param
{
if (m_cheat.cheatmap[cheatindex].state == 1)
{
- UINT64 value = cheat_byte_swap(&m_cheat, cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset)) & sizemask;
+ uint64_t value = cheat_byte_swap(&m_cheat, cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset)) & sizemask;
offs_t address = space->byte_to_address(m_cheat.cheatmap[cheatindex].offset);
if (params > 0)
@@ -2226,8 +2226,8 @@ void debugger_commands::execute_cheatlist(int ref, int params, const char *param
void debugger_commands::execute_cheatundo(int ref, int params, const char *param[])
{
- UINT64 cheatindex;
- UINT32 undo_count = 0;
+ uint64_t cheatindex;
+ uint32_t undo_count = 0;
if (m_cheat.undo > 0)
{
@@ -2255,10 +2255,10 @@ void debugger_commands::execute_cheatundo(int ref, int params, const char *param
void debugger_commands::execute_find(int ref, int params, const char *param[])
{
- UINT64 offset, endoffset, length;
+ uint64_t offset, endoffset, length;
address_space *space;
- UINT64 data_to_find[256];
- UINT8 data_size[256];
+ uint64_t data_to_find[256];
+ uint8_t data_size[256];
int cur_data_size;
int data_count = 0;
int found = 0;
@@ -2300,10 +2300,10 @@ void debugger_commands::execute_find(int ref, int params, const char *param[])
{
/* check for a 'b','w','d',or 'q' prefix */
data_size[data_count] = cur_data_size;
- if (tolower((UINT8)pdata[0]) == 'b' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 1; pdata += 2; }
- if (tolower((UINT8)pdata[0]) == 'w' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 2; pdata += 2; }
- if (tolower((UINT8)pdata[0]) == 'd' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 4; pdata += 2; }
- if (tolower((UINT8)pdata[0]) == 'q' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 8; pdata += 2; }
+ if (tolower((uint8_t)pdata[0]) == 'b' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 1; pdata += 2; }
+ if (tolower((uint8_t)pdata[0]) == 'w' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 2; pdata += 2; }
+ if (tolower((uint8_t)pdata[0]) == 'd' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 4; pdata += 2; }
+ if (tolower((uint8_t)pdata[0]) == 'q' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 8; pdata += 2; }
/* look for a wildcard */
if (!strcmp(pdata, "?"))
@@ -2316,7 +2316,7 @@ void debugger_commands::execute_find(int ref, int params, const char *param[])
}
/* now search */
- for (UINT64 i = offset; i <= endoffset; i += data_size[0])
+ for (uint64_t i = offset; i <= endoffset; i += data_size[0])
{
int suboffset = 0;
int match = 1;
@@ -2326,10 +2326,10 @@ void debugger_commands::execute_find(int ref, int params, const char *param[])
{
switch (data_size[j])
{
- case 1: match = ((UINT8)m_cpu.read_byte(*space, i + suboffset, TRUE) == (UINT8)data_to_find[j]); break;
- case 2: match = ((UINT16)m_cpu.read_word(*space, i + suboffset, TRUE) == (UINT16)data_to_find[j]); break;
- case 4: match = ((UINT32)m_cpu.read_dword(*space, i + suboffset, TRUE) == (UINT32)data_to_find[j]); break;
- case 8: match = ((UINT64)m_cpu.read_qword(*space, i + suboffset, TRUE) == (UINT64)data_to_find[j]); break;
+ case 1: match = ((uint8_t)m_cpu.read_byte(*space, i + suboffset, TRUE) == (uint8_t)data_to_find[j]); break;
+ case 2: match = ((uint16_t)m_cpu.read_word(*space, i + suboffset, TRUE) == (uint16_t)data_to_find[j]); break;
+ case 4: match = ((uint32_t)m_cpu.read_dword(*space, i + suboffset, TRUE) == (uint32_t)data_to_find[j]); break;
+ case 8: match = ((uint64_t)m_cpu.read_qword(*space, i + suboffset, TRUE) == (uint64_t)data_to_find[j]); break;
default: /* all other cases are wildcards */ break;
}
suboffset += data_size[j] & 0x0f;
@@ -2339,7 +2339,7 @@ void debugger_commands::execute_find(int ref, int params, const char *param[])
if (match)
{
found++;
- m_console.printf("Found at %0*X\n", space->addrchars(), (UINT32)space->byte_to_address(i));
+ m_console.printf("Found at %0*X\n", space->addrchars(), (uint32_t)space->byte_to_address(i));
}
}
@@ -2355,7 +2355,7 @@ void debugger_commands::execute_find(int ref, int params, const char *param[])
void debugger_commands::execute_dasm(int ref, int params, const char *param[])
{
- UINT64 offset, length, bytes = 1;
+ uint64_t offset, length, bytes = 1;
int minbytes, maxbytes, byteswidth;
address_space *space, *decrypted_space;
FILE *f;
@@ -2402,7 +2402,7 @@ void debugger_commands::execute_dasm(int ref, int params, const char *param[])
/* now write the data out */
util::ovectorstream output;
output.reserve(512);
- for (UINT64 i = 0; i < length; )
+ for (uint64_t i = 0; i < length; )
{
int pcbyte = space->address_to_byte(offset + i) & space->bytemask();
char disasm[200];
@@ -2413,13 +2413,13 @@ void debugger_commands::execute_dasm(int ref, int params, const char *param[])
output.rdbuf()->clear();
/* print the address */
- stream_format(output, "%0*X: ", space->logaddrchars(), (UINT32)space->byte_to_address(pcbyte));
+ stream_format(output, "%0*X: ", space->logaddrchars(), (uint32_t)space->byte_to_address(pcbyte));
/* make sure we can translate the address */
tempaddr = pcbyte;
if (space->device().memory().translate(space->spacenum(), TRANSLATE_FETCH_DEBUG, tempaddr))
{
- UINT8 opbuf[64], argbuf[64];
+ uint8_t opbuf[64], argbuf[64];
/* fetch the bytes up to the maximum */
for (numbytes = 0; numbytes < maxbytes; numbytes++)
@@ -2573,7 +2573,7 @@ void debugger_commands::execute_history(int ref, int params, const char *param[]
else
decrypted_space = space;
- UINT64 count = device_debug::HISTORY_SIZE;
+ uint64_t count = device_debug::HISTORY_SIZE;
if (!validate_number_parameter(param[1], &count))
return;
@@ -2597,7 +2597,7 @@ void debugger_commands::execute_history(int ref, int params, const char *param[]
/* fetch the bytes up to the maximum */
offs_t pcbyte = space->address_to_byte(pc) & space->bytemask();
- UINT8 opbuf[64], argbuf[64];
+ uint8_t opbuf[64], argbuf[64];
for (int numbytes = 0; numbytes < maxbytes; numbytes++)
{
opbuf[numbytes] = m_cpu.read_opcode(*decrypted_space, pcbyte + numbytes, 1);
@@ -2619,7 +2619,7 @@ void debugger_commands::execute_history(int ref, int params, const char *param[]
void debugger_commands::execute_trackpc(int ref, int params, const char *param[])
{
// Gather the on/off switch (if present)
- UINT64 turnOn = true;
+ uint64_t turnOn = true;
if (!validate_number_parameter(param[0], &turnOn))
return;
@@ -2629,7 +2629,7 @@ void debugger_commands::execute_trackpc(int ref, int params, const char *param[]
return;
// Should we clear the existing data?
- UINT64 clear = false;
+ uint64_t clear = false;
if (!validate_number_parameter(param[2], &clear))
return;
@@ -2661,7 +2661,7 @@ void debugger_commands::execute_trackpc(int ref, int params, const char *param[]
void debugger_commands::execute_trackmem(int ref, int params, const char *param[])
{
// Gather the on/off switch (if present)
- UINT64 turnOn = true;
+ uint64_t turnOn = true;
if (!validate_number_parameter(param[0], &turnOn))
return;
@@ -2671,7 +2671,7 @@ void debugger_commands::execute_trackmem(int ref, int params, const char *param[
return;
// Should we clear the existing data?
- UINT64 clear = false;
+ uint64_t clear = false;
if (!validate_number_parameter(param[2], &clear))
return;
@@ -2699,7 +2699,7 @@ void debugger_commands::execute_trackmem(int ref, int params, const char *param[
void debugger_commands::execute_pcatmem(int ref, int params, const char *param[])
{
// Gather the required address parameter
- UINT64 address;
+ uint64_t address;
if (!validate_number_parameter(param[0], &address))
return;
@@ -2715,7 +2715,7 @@ void debugger_commands::execute_pcatmem(int ref, int params, const char *param[]
// Get the value of memory at the address
const int native_data_width = space->data_width() / 8;
- const UINT64 data = m_cpu.read_memory(*space, space->address_to_byte(address), native_data_width, true);
+ const uint64_t data = m_cpu.read_memory(*space, space->address_to_byte(address), native_data_width, true);
// Recover the pc & print
const address_spacenum space_num = (address_spacenum)ref;
@@ -2791,7 +2791,7 @@ void debugger_commands::execute_map(int ref, int params, const char *param[])
{
address_space *space;
offs_t taddress;
- UINT64 address;
+ uint64_t address;
int intention;
/* validate parameters */
@@ -2899,7 +2899,7 @@ void debugger_commands::execute_symlist(int ref, int params, const char **param)
{
const symbol_entry *entry = symtable->find(namelist[symnum]);
assert(entry != nullptr);
- UINT64 value = entry->value();
+ uint64_t value = entry->value();
/* only display "register" type symbols */
m_console.printf("%s = %X", namelist[symnum], value);