mirror of
https://github.com/holub/mame
synced 2025-04-26 18:23:08 +03:00
Fix debug commands in drivers and devices (nw)
This commit is contained in:
parent
f988720197
commit
5f50d85c29
@ -642,24 +642,24 @@ void z8002_device::state_string_export(const device_state_entry &entry, std::str
|
||||
}
|
||||
}
|
||||
|
||||
void z8001_device::z8k_disass_mode(int ref, int params, const char *param[])
|
||||
void z8001_device::z8k_disass_mode(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
size_t len;
|
||||
if (params == 1)
|
||||
if (params.size() == 1)
|
||||
{
|
||||
len = strlen(param[0]);
|
||||
if (!core_strnicmp(param[0], "segmented", len) || !core_stricmp(param[0], "z8001")) {
|
||||
len = params[0].length();
|
||||
if (!core_strnicmp(params[0].c_str(), "segmented", len) || !core_stricmp(params[0].c_str(), "z8001")) {
|
||||
z8k_segm = true;
|
||||
z8k_segm_mode = Z8K_SEGM_MODE_SEG;
|
||||
machine().debugger().console().printf("Disassembler mode set to Z8001/segmented\n");
|
||||
}
|
||||
else if (!core_strnicmp(param[0], "non-segmented", len) || !core_stricmp(param[0], "z8002"))
|
||||
else if (!core_strnicmp(params[0].c_str(), "non-segmented", len) || !core_stricmp(params[0].c_str(), "z8002"))
|
||||
{
|
||||
z8k_segm = false;
|
||||
z8k_segm_mode = Z8K_SEGM_MODE_NONSEG;
|
||||
machine().debugger().console().printf("Disassembler mode set to Z8002/non-segmented\n");
|
||||
}
|
||||
else if (!core_strnicmp(param[0], "automatic", len))
|
||||
else if (!core_strnicmp(params[0].c_str(), "automatic", len))
|
||||
{
|
||||
z8k_segm_mode = Z8K_SEGM_MODE_AUTO;
|
||||
machine().debugger().console().printf("Disassembler mode set to automatic\n");
|
||||
@ -667,7 +667,7 @@ void z8001_device::z8k_disass_mode(int ref, int params, const char *param[])
|
||||
else
|
||||
goto usage;
|
||||
}
|
||||
else if (params > 1)
|
||||
else if (params.size() > 1)
|
||||
{
|
||||
usage:
|
||||
machine().debugger().console().printf("Usage: z8k_disass_mode <mode>\n");
|
||||
@ -706,7 +706,7 @@ void z8001_device::device_start()
|
||||
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
machine().debugger().console().register_command("z8k_disass_mode", CMDFLAG_NONE, 0, 0, 1, std::bind(&z8001_device::z8k_disass_mode, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("z8k_disass_mode", CMDFLAG_NONE, 0, 0, 1, std::bind(&z8001_device::z8k_disass_mode, this, _1, _2));
|
||||
}
|
||||
|
||||
z8k_segm = true;
|
||||
|
@ -667,7 +667,7 @@ protected:
|
||||
virtual uint32_t read_irq_vector() override;
|
||||
|
||||
private:
|
||||
void z8k_disass_mode(int ref, int params, const char *param[]);
|
||||
void z8k_disass_mode(int ref, const std::vector<std::string> ¶ms);
|
||||
};
|
||||
|
||||
|
||||
|
@ -558,9 +558,9 @@ public:
|
||||
|
||||
private:
|
||||
void jamtable_disasm(address_space &space, uint32_t address, uint32_t size);
|
||||
void jamtable_disasm_command(int ref, int params, const char **param);
|
||||
void chihiro_help_command(int ref, int params, const char **param);
|
||||
void debug_commands(int ref, int params, const char **param);
|
||||
void jamtable_disasm_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void chihiro_help_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void debug_commands(int ref, const std::vector<std::string> ¶ms);
|
||||
};
|
||||
|
||||
/* jamtable instructions for Chihiro (different from Xbox console)
|
||||
@ -676,21 +676,21 @@ void chihiro_state::jamtable_disasm(address_space &space, uint32_t address, uint
|
||||
}
|
||||
}
|
||||
|
||||
void chihiro_state::jamtable_disasm_command(int ref, int params, const char **param)
|
||||
void chihiro_state::jamtable_disasm_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
address_space &space = m_maincpu->space();
|
||||
uint64_t addr, size;
|
||||
|
||||
if (params < 2)
|
||||
if (params.size() < 3)
|
||||
return;
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[0], &addr))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[1], addr))
|
||||
return;
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[1], &size))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[2], size))
|
||||
return;
|
||||
jamtable_disasm(space, (uint32_t)addr, (uint32_t)size);
|
||||
}
|
||||
|
||||
void chihiro_state::chihiro_help_command(int ref, int params, const char **param)
|
||||
void chihiro_state::chihiro_help_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_console &con = machine().debugger().console();
|
||||
|
||||
@ -699,14 +699,14 @@ void chihiro_state::chihiro_help_command(int ref, int params, const char **param
|
||||
con.printf(" chihiro help -- this list\n");
|
||||
}
|
||||
|
||||
void chihiro_state::debug_commands(int ref, int params, const char **param)
|
||||
void chihiro_state::debug_commands(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
if (params < 1)
|
||||
if (params.size() < 1)
|
||||
return;
|
||||
if (strcmp("jamdis", param[0]) == 0)
|
||||
jamtable_disasm_command(ref, params - 1, param + 1);
|
||||
if (params[0] == "jamdis")
|
||||
jamtable_disasm_command(ref, params);
|
||||
else
|
||||
chihiro_help_command(ref, params - 1, param + 1);
|
||||
chihiro_help_command(ref, params);
|
||||
}
|
||||
|
||||
void chihiro_state::hack_eeprom()
|
||||
@ -1579,7 +1579,7 @@ void chihiro_state::machine_start()
|
||||
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
machine().debugger().console().register_command("chihiro", CMDFLAG_NONE, 0, 1, 4, std::bind(&chihiro_state::debug_commands, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("chihiro", CMDFLAG_NONE, 0, 1, 4, std::bind(&chihiro_state::debug_commands, this, _1, _2));
|
||||
}
|
||||
usbhack_index = -1;
|
||||
for (int a = 1; a < HACK_ITEMS; a++)
|
||||
|
@ -597,7 +597,7 @@ void sat_console_state::nvram_init(nvram_device &nvram, void *data, size_t size)
|
||||
memcpy(data, init, sizeof(init));
|
||||
}
|
||||
|
||||
void saturn_state::debug_scuirq_command(int ref, int params, const char **param)
|
||||
void saturn_state::debug_scuirq_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_console con = machine().debugger().console();
|
||||
const char *const irqnames[16] = {
|
||||
@ -608,7 +608,7 @@ void saturn_state::debug_scuirq_command(int ref, int params, const char **param)
|
||||
con.printf("%s irq enabled: %s\n",irqnames[irq_lv],(m_scu.ism & (1 << irq_lv)) == 0 ? "1" : "0");
|
||||
}
|
||||
|
||||
void saturn_state::debug_scudma_command(int ref, int params, const char **param)
|
||||
void saturn_state::debug_scudma_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_console con = machine().debugger().console();
|
||||
|
||||
@ -621,7 +621,7 @@ void saturn_state::debug_scudma_command(int ref, int params, const char **param)
|
||||
}
|
||||
}
|
||||
|
||||
void saturn_state::debug_help_command(int ref, int params, const char **param)
|
||||
void saturn_state::debug_help_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_console con = machine().debugger().console();
|
||||
|
||||
@ -632,17 +632,17 @@ void saturn_state::debug_help_command(int ref, int params, const char **param)
|
||||
}
|
||||
|
||||
|
||||
void saturn_state::debug_commands(int ref, int params, const char **param)
|
||||
void saturn_state::debug_commands(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
if (params < 1)
|
||||
if (params.size() < 1)
|
||||
return;
|
||||
|
||||
if (strcmp("scudma", param[0]) == 0)
|
||||
debug_scudma_command(ref, params - 1, param + 1);
|
||||
else if(strcmp("scuirq", param[0]) == 0)
|
||||
debug_scuirq_command(ref, params - 1, param + 1);
|
||||
else if(strcmp("help", param[0]) == 0)
|
||||
debug_help_command(ref, params - 1, param + 1);
|
||||
if (params[0] == "scudma")
|
||||
debug_scudma_command(ref, params);
|
||||
else if (params[0] == "scuirq")
|
||||
debug_scuirq_command(ref, params);
|
||||
else if (params[0] == "help")
|
||||
debug_help_command(ref, params);
|
||||
}
|
||||
|
||||
|
||||
@ -654,7 +654,7 @@ MACHINE_START_MEMBER(sat_console_state, saturn)
|
||||
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
machine().debugger().console().register_command("saturn", CMDFLAG_NONE, 0, 1, 4, std::bind(&saturn_state::debug_commands, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("saturn", CMDFLAG_NONE, 0, 1, 4, std::bind(&saturn_state::debug_commands, this, _1, _2));
|
||||
}
|
||||
|
||||
machine().device<scsp_device>("scsp")->set_ram_base(m_sound_ram);
|
||||
|
@ -647,8 +647,8 @@ private:
|
||||
|
||||
void start_timer(int num);
|
||||
|
||||
void l2p_command(int ref, int params, const char **param);
|
||||
void fcodes_command(int ref, int params, const char **param);
|
||||
void l2p_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void fcodes_command(int ref, const std::vector<std::string> ¶ms);
|
||||
};
|
||||
|
||||
uint32_t sun4_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
@ -1265,11 +1265,11 @@ WRITE32_MEMBER( sun4_state::sun4_mmu_w )
|
||||
printf("sun4: %08x to asi %d byte offset %x, PC = %x, mask = %08x\n", data, asi, offset << 2, m_maincpu->pc(), mem_mask);
|
||||
}
|
||||
|
||||
void sun4_state::l2p_command(int ref, int params, const char **param)
|
||||
void sun4_state::l2p_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
uint64_t addr, offset;
|
||||
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[0], &addr)) return;
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[0], addr)) return;
|
||||
|
||||
addr &= 0xffffffff;
|
||||
offset = addr >> 2;
|
||||
@ -1302,14 +1302,14 @@ void sun4_state::l2p_command(int ref, int params, const char **param)
|
||||
}
|
||||
}
|
||||
|
||||
void sun4_state::fcodes_command(int ref, int params, const char **param)
|
||||
void sun4_state::fcodes_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
#if SUN4_LOG_FCODES
|
||||
if (params < 1)
|
||||
return;
|
||||
|
||||
bool is_on = strcmp(param[0], "on") == 0;
|
||||
bool is_off = strcmp(param[0], "off") == 0;
|
||||
bool is_on = (params[0] == "on");
|
||||
bool is_off = (params[0] == "off");
|
||||
|
||||
if (!is_on && !is_off)
|
||||
{
|
||||
@ -1360,9 +1360,9 @@ void sun4_state::machine_start()
|
||||
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
machine().debugger().console().register_command("l2p", CMDFLAG_NONE, 0, 1, 1, std::bind(&sun4_state::l2p_command, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("l2p", CMDFLAG_NONE, 0, 1, 1, std::bind(&sun4_state::l2p_command, this, _1, _2));
|
||||
#if SUN4_LOG_FCODES
|
||||
machine().debugger().console().register_command("fcodes", CMDFLAG_NONE, 0, 1, 1, std::bind(&sun4_state::fcodes_command, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("fcodes", CMDFLAG_NONE, 0, 1, 1, std::bind(&sun4_state::fcodes_command, this, _1, _2));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -224,8 +224,8 @@ public:
|
||||
offs_t dgnbeta_dasm_override(device_t &device, std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options);
|
||||
|
||||
private:
|
||||
void execute_beta_key_dump(int ref, int params, const char *param[]);
|
||||
void execute_beta_dat_log(int ref, int params, const char *param[]);
|
||||
void execute_beta_key_dump(int ref, const std::vector<std::string> ¶ms);
|
||||
void execute_beta_dat_log(int ref, const std::vector<std::string> ¶ms);
|
||||
};
|
||||
|
||||
#endif /* DGN_BETA_H_ */
|
||||
|
@ -182,8 +182,8 @@ public:
|
||||
void set_ram_size();
|
||||
|
||||
private:
|
||||
void debug_command(int ref, int params, const char *param[]);
|
||||
void video_debug(int ref, int params, const char *param[]);
|
||||
void debug_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void video_debug(int ref, const std::vector<std::string> ¶ms);
|
||||
};
|
||||
|
||||
/*----------- defined in drivers/mbc55x.c -----------*/
|
||||
|
@ -220,6 +220,6 @@ public:
|
||||
} m_nimbus_mouse;
|
||||
|
||||
private:
|
||||
void debug_command(int ref, int params, const char *param[]);
|
||||
void video_debug(int ref, int params, const char *param[]);
|
||||
void debug_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void video_debug(int ref, const std::vector<std::string> ¶ms);
|
||||
};
|
||||
|
@ -689,10 +689,10 @@ public:
|
||||
DECLARE_READ8_MEMBER( stv_SMPC_r );
|
||||
DECLARE_WRITE8_MEMBER( stv_SMPC_w );
|
||||
|
||||
void debug_scudma_command(int ref, int params, const char **param);
|
||||
void debug_scuirq_command(int ref, int params, const char **param);
|
||||
void debug_help_command(int ref, int params, const char **param);
|
||||
void debug_commands(int ref, int params, const char **param);
|
||||
void debug_scudma_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void debug_scuirq_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void debug_help_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void debug_commands(int ref, const std::vector<std::string> ¶ms);
|
||||
|
||||
};
|
||||
|
||||
|
@ -130,22 +130,22 @@ public:
|
||||
const debugger_constants *debugc_bios;
|
||||
|
||||
private:
|
||||
void dump_string_command(int ref, int params, const char **param);
|
||||
void dump_process_command(int ref, int params, const char **param);
|
||||
void dump_list_command(int ref, int params, const char **param);
|
||||
void dump_dpc_command(int ref, int params, const char **param);
|
||||
void dump_timer_command(int ref, int params, const char **param);
|
||||
void curthread_command(int ref, int params, const char **param);
|
||||
void threadlist_command(int ref, int params, const char **param);
|
||||
void generate_irq_command(int ref, int params, const char **param);
|
||||
void nv2a_combiners_command(int ref, int params, const char **param);
|
||||
void nv2a_wclipping_command(int ref, int params, const char **param);
|
||||
void waitvblank_command(int ref, int params, const char **param);
|
||||
void grab_texture_command(int ref, int params, const char **param);
|
||||
void grab_vprog_command(int ref, int params, const char **param);
|
||||
void vprogdis_command(int ref, int params, const char **param);
|
||||
void help_command(int ref, int params, const char **param);
|
||||
void xbox_debug_commands(int ref, int params, const char **param);
|
||||
void dump_string_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void dump_process_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void dump_list_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void dump_dpc_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void dump_timer_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void curthread_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void threadlist_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void generate_irq_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void nv2a_combiners_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void nv2a_wclipping_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void waitvblank_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void grab_texture_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void grab_vprog_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void vprogdis_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void help_command(int ref, const std::vector<std::string> ¶ms);
|
||||
void xbox_debug_commands(int ref, const std::vector<std::string> ¶ms);
|
||||
int find_bios_index(running_machine &mach);
|
||||
bool find_bios_hash(running_machine &mach, int bios, uint32_t &crc32);
|
||||
void find_debug_params(running_machine &mach);
|
||||
|
@ -940,8 +940,8 @@ void dgn_beta_state::machine_start()
|
||||
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
machine().debugger().console().register_command("beta_dat_log", CMDFLAG_NONE, 0, 0, 0, std::bind(&dgn_beta_state::execute_beta_dat_log, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("beta_key_dump", CMDFLAG_NONE, 0, 0, 0, std::bind(&dgn_beta_state::execute_beta_key_dump, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("beta_dat_log", CMDFLAG_NONE, 0, 0, 0, std::bind(&dgn_beta_state::execute_beta_dat_log, this, _1, _2));
|
||||
machine().debugger().console().register_command("beta_key_dump", CMDFLAG_NONE, 0, 0, 0, std::bind(&dgn_beta_state::execute_beta_key_dump, this, _1, _2));
|
||||
}
|
||||
m_LogDatWrites = false;
|
||||
}
|
||||
@ -956,14 +956,14 @@ offs_t dgn_beta_state::dgnbeta_dasm_override(device_t &device, std::ostream &str
|
||||
return coco_state::os9_dasm_override(device, stream, pc, oprom, opram, options);
|
||||
}
|
||||
|
||||
void dgn_beta_state::execute_beta_dat_log(int ref, int params, const char *param[])
|
||||
void dgn_beta_state::execute_beta_dat_log(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
m_LogDatWrites = !m_LogDatWrites;
|
||||
|
||||
machine().debugger().console().printf("DAT register write info set : %d\n", m_LogDatWrites);
|
||||
}
|
||||
|
||||
void dgn_beta_state::execute_beta_key_dump(int ref, int params, const char *param[])
|
||||
void dgn_beta_state::execute_beta_key_dump(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
for (int idx = 0; idx < NoKeyrows; idx++)
|
||||
{
|
||||
|
@ -338,7 +338,7 @@ void mbc55x_state::machine_start()
|
||||
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
machine().debugger().console().register_command("mbc55x_debug", CMDFLAG_NONE, 0, 0, 1, std::bind(&mbc55x_state::debug_command, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("mbc55x_debug", CMDFLAG_NONE, 0, 0, 1, std::bind(&mbc55x_state::debug_command, this, _1, _2));
|
||||
|
||||
/* set up the instruction hook */
|
||||
m_maincpu->debug()->set_instruction_hook(instruction_hook);
|
||||
@ -351,12 +351,12 @@ void mbc55x_state::machine_start()
|
||||
}
|
||||
|
||||
|
||||
void mbc55x_state::debug_command(int ref, int params, const char *param[])
|
||||
void mbc55x_state::debug_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
if (params > 0)
|
||||
if (params.size() > 0)
|
||||
{
|
||||
int temp;
|
||||
sscanf(param[0], "%d", &temp);
|
||||
sscanf(params[0].c_str(), "%d", &temp);
|
||||
m_debug_machine = temp;
|
||||
}
|
||||
else
|
||||
|
@ -232,7 +232,7 @@ void rmnimbus_state::machine_start()
|
||||
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
machine().debugger().console().register_command("nimbus_debug", CMDFLAG_NONE, 0, 0, 1, std::bind(&rmnimbus_state::debug_command, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("nimbus_debug", CMDFLAG_NONE, 0, 0, 1, std::bind(&rmnimbus_state::debug_command, this, _1, _2));
|
||||
|
||||
/* set up the instruction hook */
|
||||
m_maincpu->debug()->set_instruction_hook(instruction_hook);
|
||||
@ -242,12 +242,12 @@ void rmnimbus_state::machine_start()
|
||||
m_fdc->dden_w(0);
|
||||
}
|
||||
|
||||
void rmnimbus_state::debug_command(int ref, int params, const char *param[])
|
||||
void rmnimbus_state::debug_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
if (params > 0)
|
||||
if (params.size() > 0)
|
||||
{
|
||||
int temp;
|
||||
sscanf(param[0],"%d",&temp);
|
||||
sscanf(params[0].c_str(), "%d", &temp);
|
||||
m_debug_machine = temp;
|
||||
}
|
||||
else
|
||||
|
@ -72,7 +72,7 @@ void xbox_base_state::find_debug_params(running_machine &mach)
|
||||
}
|
||||
}
|
||||
|
||||
void xbox_base_state::dump_string_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::dump_string_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_cpu &cpu = machine().debugger().cpu();
|
||||
debugger_console &con = machine().debugger().console();
|
||||
@ -80,10 +80,10 @@ void xbox_base_state::dump_string_command(int ref, int params, const char **para
|
||||
uint64_t addr;
|
||||
offs_t address;
|
||||
|
||||
if (params < 1)
|
||||
if (params.size() < 2)
|
||||
return;
|
||||
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[0], &addr))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[1], addr))
|
||||
return;
|
||||
|
||||
address = (offs_t)addr;
|
||||
@ -113,7 +113,7 @@ void xbox_base_state::dump_string_command(int ref, int params, const char **para
|
||||
con.printf("\n");
|
||||
}
|
||||
|
||||
void xbox_base_state::dump_process_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::dump_process_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_cpu &cpu = machine().debugger().cpu();
|
||||
debugger_console &con = machine().debugger().console();
|
||||
@ -121,10 +121,10 @@ void xbox_base_state::dump_process_command(int ref, int params, const char **par
|
||||
uint64_t addr;
|
||||
offs_t address;
|
||||
|
||||
if (params < 1)
|
||||
if (params.size() < 2)
|
||||
return;
|
||||
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[0], &addr))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[1], addr))
|
||||
return;
|
||||
|
||||
address = (offs_t)addr;
|
||||
@ -145,7 +145,7 @@ void xbox_base_state::dump_process_command(int ref, int params, const char **par
|
||||
con.printf("_padding %d byte\n", cpu.read_byte(space, address + 27, true));
|
||||
}
|
||||
|
||||
void xbox_base_state::dump_list_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::dump_list_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_cpu &cpu = machine().debugger().cpu();
|
||||
debugger_console &con = machine().debugger().console();
|
||||
@ -153,17 +153,17 @@ void xbox_base_state::dump_list_command(int ref, int params, const char **param)
|
||||
uint64_t addr;
|
||||
offs_t address;
|
||||
|
||||
if (params < 1)
|
||||
if (params.size() < 2)
|
||||
return;
|
||||
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[0], &addr))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[1], addr))
|
||||
return;
|
||||
|
||||
uint64_t offs = 0;
|
||||
offs_t offset = 0;
|
||||
if (params >= 2)
|
||||
if (params.size() >= 3)
|
||||
{
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[1], &offs))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[2], offs))
|
||||
return;
|
||||
offset = (offs_t)offs;
|
||||
}
|
||||
@ -176,7 +176,7 @@ void xbox_base_state::dump_list_command(int ref, int params, const char **param)
|
||||
return;
|
||||
}
|
||||
address = (offs_t)addr;
|
||||
if (params >= 2)
|
||||
if (params.size() >= 3)
|
||||
con.printf("Entry Object\n");
|
||||
else
|
||||
con.printf("Entry\n");
|
||||
@ -184,7 +184,7 @@ void xbox_base_state::dump_list_command(int ref, int params, const char **param)
|
||||
uint64_t old;
|
||||
for (int num = 0; num < 32; num++)
|
||||
{
|
||||
if (params >= 2)
|
||||
if (params.size() >= 3)
|
||||
con.printf("%08X %08X\n", (uint32_t)addr, (offs_t)addr - offset);
|
||||
else
|
||||
con.printf("%08X\n", (uint32_t)addr);
|
||||
@ -201,7 +201,7 @@ void xbox_base_state::dump_list_command(int ref, int params, const char **param)
|
||||
}
|
||||
}
|
||||
|
||||
void xbox_base_state::dump_dpc_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::dump_dpc_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_cpu &cpu = machine().debugger().cpu();
|
||||
debugger_console &con = machine().debugger().console();
|
||||
@ -209,10 +209,10 @@ void xbox_base_state::dump_dpc_command(int ref, int params, const char **param)
|
||||
uint64_t addr;
|
||||
offs_t address;
|
||||
|
||||
if (params < 1)
|
||||
if (params.size() < 2)
|
||||
return;
|
||||
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[0], &addr))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[1], addr))
|
||||
return;
|
||||
|
||||
address = (offs_t)addr;
|
||||
@ -232,7 +232,7 @@ void xbox_base_state::dump_dpc_command(int ref, int params, const char **param)
|
||||
con.printf("SystemArgument2 %08X dword\n", cpu.read_dword(space, address + 24, true));
|
||||
}
|
||||
|
||||
void xbox_base_state::dump_timer_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::dump_timer_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_cpu &cpu = machine().debugger().cpu();
|
||||
debugger_console &con = machine().debugger().console();
|
||||
@ -240,10 +240,10 @@ void xbox_base_state::dump_timer_command(int ref, int params, const char **param
|
||||
uint64_t addr;
|
||||
offs_t address;
|
||||
|
||||
if (params < 1)
|
||||
if (params.size() < 2)
|
||||
return;
|
||||
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[0], &addr))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[1], addr))
|
||||
return;
|
||||
|
||||
address = (offs_t)addr;
|
||||
@ -265,7 +265,7 @@ void xbox_base_state::dump_timer_command(int ref, int params, const char **param
|
||||
con.printf("Period %d dword\n", cpu.read_dword(space, address + 36, true));
|
||||
}
|
||||
|
||||
void xbox_base_state::curthread_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::curthread_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_cpu &cpu = machine().debugger().cpu();
|
||||
debugger_console &con = machine().debugger().console();
|
||||
@ -295,7 +295,7 @@ void xbox_base_state::curthread_command(int ref, int params, const char **param)
|
||||
con.printf("Current thread function is %08X\n", cpu.read_dword(space, address, true));
|
||||
}
|
||||
|
||||
void xbox_base_state::threadlist_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::threadlist_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
address_space &space = m_maincpu->space();
|
||||
debugger_cpu &cpu = machine().debugger().cpu();
|
||||
@ -324,13 +324,13 @@ void xbox_base_state::threadlist_command(int ref, int params, const char **param
|
||||
}
|
||||
}
|
||||
|
||||
void xbox_base_state::generate_irq_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::generate_irq_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
uint64_t irq;
|
||||
|
||||
if (params < 1)
|
||||
if (params.size() < 2)
|
||||
return;
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[0], &irq))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[1], irq))
|
||||
return;
|
||||
if (irq > 15)
|
||||
return;
|
||||
@ -339,7 +339,7 @@ void xbox_base_state::generate_irq_command(int ref, int params, const char **par
|
||||
debug_generate_irq((int)irq, true);
|
||||
}
|
||||
|
||||
void xbox_base_state::nv2a_combiners_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::nv2a_combiners_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_console &con = machine().debugger().console();
|
||||
bool en = nvidia_nv2a->toggle_register_combiners_usage();
|
||||
@ -349,7 +349,7 @@ void xbox_base_state::nv2a_combiners_command(int ref, int params, const char **p
|
||||
con.printf("Register combiners disabled\n");
|
||||
}
|
||||
|
||||
void xbox_base_state::nv2a_wclipping_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::nv2a_wclipping_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_console &con = machine().debugger().console();
|
||||
bool en = nvidia_nv2a->toggle_clipping_w_support();
|
||||
@ -359,7 +359,7 @@ void xbox_base_state::nv2a_wclipping_command(int ref, int params, const char **p
|
||||
con.printf("W clipping disabled\n");
|
||||
}
|
||||
|
||||
void xbox_base_state::waitvblank_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::waitvblank_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_console &con = machine().debugger().console();
|
||||
bool en = nvidia_nv2a->toggle_wait_vblank_support();
|
||||
@ -369,29 +369,29 @@ void xbox_base_state::waitvblank_command(int ref, int params, const char **param
|
||||
con.printf("Vblank method disabled\n");
|
||||
}
|
||||
|
||||
void xbox_base_state::grab_texture_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::grab_texture_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
uint64_t type;
|
||||
|
||||
if (params < 2)
|
||||
if (params.size() < 3)
|
||||
return;
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[0], &type))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[1], type))
|
||||
return;
|
||||
if ((param[1][0] == 0) || (strlen(param[1]) > 127))
|
||||
if (params[2].empty() || params[2].length() > 127)
|
||||
return;
|
||||
nvidia_nv2a->debug_grab_texture((int)type, param[1]);
|
||||
nvidia_nv2a->debug_grab_texture((int)type, params[2].c_str());
|
||||
}
|
||||
|
||||
void xbox_base_state::grab_vprog_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::grab_vprog_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
uint32_t instruction[4];
|
||||
FILE *fil;
|
||||
|
||||
if (params < 1)
|
||||
if (params.size() < 2)
|
||||
return;
|
||||
if ((param[0][0] == 0) || (strlen(param[0]) > 127))
|
||||
if (params[1].empty() || params[1].length() > 127)
|
||||
return;
|
||||
if ((fil = fopen(param[0], "wb")) == nullptr)
|
||||
if ((fil = fopen(params[1].c_str(), "wb")) == nullptr)
|
||||
return;
|
||||
for (int n = 0; n < 136; n++) {
|
||||
nvidia_nv2a->debug_grab_vertex_program_slot(n, instruction);
|
||||
@ -400,24 +400,24 @@ void xbox_base_state::grab_vprog_command(int ref, int params, const char **param
|
||||
fclose(fil);
|
||||
}
|
||||
|
||||
void xbox_base_state::vprogdis_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::vprogdis_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
address_space &space = m_maincpu->space();
|
||||
|
||||
if (params < 2)
|
||||
if (params.size() < 3)
|
||||
return;
|
||||
|
||||
uint64_t address;
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[0], &address))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[1], address))
|
||||
return;
|
||||
|
||||
uint64_t length;
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[1], &length))
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[2], length))
|
||||
return;
|
||||
|
||||
uint64_t type = 0;
|
||||
if (params > 2)
|
||||
if (!machine().debugger().commands().validate_number_parameter(param[2], &type))
|
||||
if (params.size() > 3)
|
||||
if (!machine().debugger().commands().validate_number_parameter(params[3], type))
|
||||
return;
|
||||
|
||||
vertex_program_disassembler vd;
|
||||
@ -452,7 +452,7 @@ void xbox_base_state::vprogdis_command(int ref, int params, const char **param)
|
||||
}
|
||||
}
|
||||
|
||||
void xbox_base_state::help_command(int ref, int params, const char **param)
|
||||
void xbox_base_state::help_command(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
debugger_console &con = machine().debugger().console();
|
||||
|
||||
@ -474,40 +474,40 @@ void xbox_base_state::help_command(int ref, int params, const char **param)
|
||||
con.printf(" xbox help -- this list\n");
|
||||
}
|
||||
|
||||
void xbox_base_state::xbox_debug_commands(int ref, int params, const char **param)
|
||||
void xbox_base_state::xbox_debug_commands(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
if (params < 1)
|
||||
if (params.size() < 1)
|
||||
return;
|
||||
if (strcmp("dump_string", param[0]) == 0)
|
||||
dump_string_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("dump_process", param[0]) == 0)
|
||||
dump_process_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("dump_list", param[0]) == 0)
|
||||
dump_list_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("dump_dpc", param[0]) == 0)
|
||||
dump_dpc_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("dump_timer", param[0]) == 0)
|
||||
dump_timer_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("curthread", param[0]) == 0)
|
||||
curthread_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("threadlist", param[0]) == 0)
|
||||
threadlist_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("irq", param[0]) == 0)
|
||||
generate_irq_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("nv2a_combiners", param[0]) == 0)
|
||||
nv2a_combiners_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("nv2a_wclipping", param[0]) == 0)
|
||||
nv2a_wclipping_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("waitvblank", param[0]) == 0)
|
||||
waitvblank_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("grab_texture", param[0]) == 0)
|
||||
grab_texture_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("grab_vprog", param[0]) == 0)
|
||||
grab_vprog_command(ref, params - 1, param + 1);
|
||||
else if (strcmp("vprogdis", param[0]) == 0)
|
||||
vprogdis_command(ref, params - 1, param + 1);
|
||||
if (params[0] == "dump_string")
|
||||
dump_string_command(ref, params);
|
||||
else if (params[0] == "dump_process")
|
||||
dump_process_command(ref, params);
|
||||
else if (params[0] == "dump_list")
|
||||
dump_list_command(ref, params);
|
||||
else if (params[0] == "dump_dpc")
|
||||
dump_dpc_command(ref, params);
|
||||
else if (params[0] == "dump_timer")
|
||||
dump_timer_command(ref, params);
|
||||
else if (params[0] == "curthread")
|
||||
curthread_command(ref, params);
|
||||
else if (params[0] == "threadlist")
|
||||
threadlist_command(ref, params);
|
||||
else if (params[0] == "irq")
|
||||
generate_irq_command(ref, params);
|
||||
else if (params[0] == "nv2a_combiners")
|
||||
nv2a_combiners_command(ref, params);
|
||||
else if (params[0] == "nv2a_wclipping")
|
||||
nv2a_wclipping_command(ref, params);
|
||||
else if (params[0] == "waitvblank")
|
||||
waitvblank_command(ref, params);
|
||||
else if (params[0] == "grab_texture")
|
||||
grab_texture_command(ref, params);
|
||||
else if (params[0] == "grab_vprog")
|
||||
grab_vprog_command(ref, params);
|
||||
else if (params[0] == "vprogdis")
|
||||
vprogdis_command(ref, params);
|
||||
else
|
||||
help_command(ref, params - 1, param + 1);
|
||||
help_command(ref, params);
|
||||
}
|
||||
|
||||
void xbox_base_state::debug_generate_irq(int irq, bool active)
|
||||
@ -1235,7 +1235,7 @@ void xbox_base_state::machine_start()
|
||||
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
machine().debugger().console().register_command("xbox", CMDFLAG_NONE, 0, 1, 4, std::bind(&xbox_base_state::xbox_debug_commands, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("xbox", CMDFLAG_NONE, 0, 1, 4, std::bind(&xbox_base_state::xbox_debug_commands, this, _1, _2));
|
||||
}
|
||||
// PIC challenge handshake data
|
||||
pic16lc_buffer[0x1c] = 0x0c;
|
||||
|
@ -78,12 +78,12 @@ give the leftmost column of the rectangle, the next four give the next column, a
|
||||
|
||||
#define DEBUG_SET(flags) ((m_debug_video & (flags))==(flags))
|
||||
|
||||
void mbc55x_state::video_debug(int ref, int params, const char *param[])
|
||||
void mbc55x_state::video_debug(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
if (params > 0)
|
||||
if (params.size() > 0)
|
||||
{
|
||||
int temp;
|
||||
sscanf(param[0],"%d",&temp);
|
||||
sscanf(params[0].c_str(), "%d", &temp);
|
||||
m_debug_video = temp;
|
||||
}
|
||||
else
|
||||
@ -172,7 +172,7 @@ void mbc55x_state::video_start()
|
||||
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
machine().debugger().console().register_command("mbc55x_vid_debug", CMDFLAG_NONE, 0, 0, 1, std::bind(&mbc55x_state::video_debug, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("mbc55x_vid_debug", CMDFLAG_NONE, 0, 0, 1, std::bind(&mbc55x_state::video_debug, this, _1, _2));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -470,12 +470,12 @@ void rmnimbus_state::change_palette(uint8_t bank, uint16_t colours)
|
||||
}
|
||||
}
|
||||
|
||||
void rmnimbus_state::video_debug(int ref, int params, const char *param[])
|
||||
void rmnimbus_state::video_debug(int ref, const std::vector<std::string> ¶ms)
|
||||
{
|
||||
if (params > 0)
|
||||
if (params.size() > 0)
|
||||
{
|
||||
int temp;
|
||||
sscanf(param[0],"%d",&temp);
|
||||
sscanf(params[0].c_str(), "%d", &temp);
|
||||
m_debug_video = temp;
|
||||
}
|
||||
else
|
||||
@ -494,7 +494,7 @@ void rmnimbus_state::video_start()
|
||||
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
machine().debugger().console().register_command("nimbus_vid_debug", CMDFLAG_NONE, 0, 0, 1, std::bind(&rmnimbus_state::video_debug, this, _1, _2, _3));
|
||||
machine().debugger().console().register_command("nimbus_vid_debug", CMDFLAG_NONE, 0, 0, 1, std::bind(&rmnimbus_state::video_debug, this, _1, _2));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user