debugger_constructor() { CONSTRUCTOR_PRINT("CONSTRUCTOR_PRIORITY_DEBUGGER_CONSTRUCTOR=%d, construct debugger\n", CONSTRUCTOR_PRIORITY_DEBUGGER_CONSTRUCTOR); debugger_gp = debugger_creator("dbg.ini",0); debugger_init(debugger_gp); return 0; }
int main() { int ret = 0; printf("LIBCDF_VERSION:%s\n",LIBCDF_VERSION); register_all_lib_modules(); debugger_gp = debugger_creator("dbg.ini",0); debugger_init(debugger_gp); dbg_str(DBG_DETAIL,"debugger is start up"); test_container(); test_datastructure(); test_analyzer(); dbg_str(DBG_DETAIL,"test end"); return ret; }
void running_machine::start() { // initialize basic can't-fail systems here config_init(*this); m_input = auto_alloc(*this, input_manager(*this)); output_init(*this); palette_init(*this); m_render = auto_alloc(*this, render_manager(*this)); generic_machine_init(*this); generic_sound_init(*this); // allocate a soft_reset timer m_soft_reset_timer = m_scheduler.timer_alloc(timer_expired_delegate(FUNC(running_machine::soft_reset), this)); // init the osd layer m_osd.init(*this); // create the video manager m_video = auto_alloc(*this, video_manager(*this)); ui_init(*this); // initialize the base time (needed for doing record/playback) ::time(&m_base_time); // initialize the input system and input ports for the game // this must be done before memory_init in order to allow specifying // callbacks based on input port tags time_t newbase = input_port_init(*this); if (newbase != 0) m_base_time = newbase; // intialize UI input ui_input_init(*this); // initialize the streams engine before the sound devices start m_sound = auto_alloc(*this, sound_manager(*this)); // first load ROMs, then populate memory, and finally initialize CPUs // these operations must proceed in this order rom_init(*this); memory_init(*this); watchdog_init(*this); // must happen after memory_init because this relies on generic.spriteram generic_video_init(*this); // allocate the gfx elements prior to device initialization gfx_init(*this); // initialize natural keyboard support inputx_init(*this); // initialize image devices image_init(*this); tilemap_init(*this); crosshair_init(*this); // initialize the debugger if ((debug_flags & DEBUG_FLAG_ENABLED) != 0) debugger_init(*this); // call the game driver's init function // this is where decryption is done and memory maps are altered // so this location in the init order is important ui_set_startup_text(*this, "Initializing...", true); // start up the devices const_cast<device_list &>(devicelist()).start_all(); // if we're coming in with a savegame request, process it now const char *savegame = options().state(); if (savegame[0] != 0) schedule_load(savegame); // if we're in autosave mode, schedule a load else if (options().autosave() && (m_system.flags & GAME_SUPPORTS_SAVE) != 0) schedule_load("auto"); // set up the cheat engine m_cheat = auto_alloc(*this, cheat_manager(*this)); // disallow save state registrations starting here m_save.allow_registration(false); }
void running_machine::start() { /* initialize basic can't-fail systems here */ fileio_init(this); config_init(this); input_init(this); output_init(this); state_init(this); state_save_allow_registration(this, true); palette_init(this); render_init(this); ui_init(this); generic_machine_init(this); generic_video_init(this); generic_sound_init(this); /* initialize the timers and allocate a soft_reset timer this must be done before cpu_init so that CPU's can allocate timers */ timer_init(this); m_soft_reset_timer = timer_alloc(this, static_soft_reset, NULL); /* init the osd layer */ osd_init(this); /* initialize the base time (needed for doing record/playback) */ time(&m_base_time); /* initialize the input system and input ports for the game this must be done before memory_init in order to allow specifying callbacks based on input port tags */ time_t newbase = input_port_init(this, m_game.ipt); if (newbase != 0) m_base_time = newbase; /* intialize UI input */ ui_input_init(this); /* initialize the streams engine before the sound devices start */ streams_init(this); /* first load ROMs, then populate memory, and finally initialize CPUs these operations must proceed in this order */ rom_init(this); memory_init(this); watchdog_init(this); /* allocate the gfx elements prior to device initialization */ gfx_init(this); /* initialize natural keyboard support */ inputx_init(this); /* initialize image devices */ image_init(this); /* start up the devices */ m_devicelist.start_all(); /* call the game driver's init function this is where decryption is done and memory maps are altered so this location in the init order is important */ ui_set_startup_text(this, "Initializing...", true); if (m_game.driver_init != NULL) (*m_game.driver_init)(this); /* finish image devices init process */ image_postdevice_init(this); /* start the video and audio hardware */ video_init(this); tilemap_init(this); crosshair_init(this); sound_init(this); /* initialize the debugger */ if ((debug_flags & DEBUG_FLAG_ENABLED) != 0) debugger_init(this); /* call the driver's _START callbacks */ if (m_config.m_machine_start != NULL) (*m_config.m_machine_start)(this); if (m_config.m_sound_start != NULL) (*m_config.m_sound_start)(this); if (m_config.m_video_start != NULL) (*m_config.m_video_start)(this); /* set up the cheat engine */ cheat_init(this); /* set up the hiscore engine */ hiscore_init(this); /* disallow save state registrations starting here */ state_save_allow_registration(this, false); }
void running_machine::start() { // initialize basic can't-fail systems here fileio_init(this); config_init(this); input_init(this); output_init(this); state_init(this); state_save_allow_registration(this, true); palette_init(this); render_init(this); ui_init(this); generic_machine_init(this); generic_video_init(this); generic_sound_init(this); // initialize the timers and allocate a soft_reset timer // this must be done before cpu_init so that CPU's can allocate timers timer_init(this); m_soft_reset_timer = timer_alloc(this, static_soft_reset, NULL); // init the osd layer osd_init(this); // initialize the base time (needed for doing record/playback) time(&m_base_time); // initialize the input system and input ports for the game // this must be done before memory_init in order to allow specifying // callbacks based on input port tags time_t newbase = input_port_init(this, m_game.ipt); if (newbase != 0) m_base_time = newbase; // intialize UI input ui_input_init(this); // initialize the streams engine before the sound devices start streams_init(this); // first load ROMs, then populate memory, and finally initialize CPUs // these operations must proceed in this order rom_init(this); memory_init(this); watchdog_init(this); // allocate the gfx elements prior to device initialization gfx_init(this); // initialize natural keyboard support inputx_init(this); // initialize image devices image_init(this); // start up the devices m_devicelist.start_all(); // call the game driver's init function // this is where decryption is done and memory maps are altered // so this location in the init order is important ui_set_startup_text(this, "Initializing...", true); if (m_game.driver_init != NULL) (*m_game.driver_init)(this); // finish image devices init process image_postdevice_init(this); // start the video and audio hardware video_init(this); tilemap_init(this); crosshair_init(this); sound_init(this); // initialize the debugger if ((debug_flags & DEBUG_FLAG_ENABLED) != 0) debugger_init(this); // call the driver's _START callbacks if (m_config.m_machine_start != NULL) (*m_config.m_machine_start)(this); if (m_config.m_sound_start != NULL) (*m_config.m_sound_start)(this); if (m_config.m_video_start != NULL) (*m_config.m_video_start)(this); // if we're coming in with a savegame request, process it now const char *savegame = options_get_string(&m_options, OPTION_STATE); if (savegame[0] != 0) schedule_load(savegame); // if we're in autosave mode, schedule a load else if (options_get_bool(&m_options, OPTION_AUTOSAVE) && (m_game.flags & GAME_SUPPORTS_SAVE) != 0) schedule_load("auto"); // set up the cheat engine if (options_get_bool(&m_options, OPTION_CHEAT)) cheat_init(this); // disallow save state registrations starting here state_save_allow_registration(this, false); }
void running_machine::start() { // initialize basic can't-fail systems here config_init(*this); m_input = auto_alloc(*this, input_manager(*this)); output_init(*this); palette_init(*this); m_render = auto_alloc(*this, render_manager(*this)); generic_machine_init(*this); // allocate a soft_reset timer m_soft_reset_timer = m_scheduler.timer_alloc(timer_expired_delegate(FUNC(running_machine::soft_reset), this)); // init the osd layer m_osd.init(*this); // create the video manager m_video = auto_alloc(*this, video_manager(*this)); ui_init(*this); // initialize the base time (needed for doing record/playback) ::time(&m_base_time); // initialize the input system and input ports for the game // this must be done before memory_init in order to allow specifying // callbacks based on input port tags time_t newbase = m_ioport.initialize(); if (newbase != 0) m_base_time = newbase; // intialize UI input ui_input_init(*this); // initialize the streams engine before the sound devices start m_sound = auto_alloc(*this, sound_manager(*this)); // first load ROMs, then populate memory, and finally initialize CPUs // these operations must proceed in this order rom_init(*this); m_memory.initialize(); // initialize the watchdog m_watchdog_timer = m_scheduler.timer_alloc(timer_expired_delegate(FUNC(running_machine::watchdog_fired), this)); if (config().m_watchdog_vblank_count != 0 && primary_screen != NULL) primary_screen->register_vblank_callback(vblank_state_delegate(FUNC(running_machine::watchdog_vblank), this)); save().save_item(NAME(m_watchdog_enabled)); save().save_item(NAME(m_watchdog_counter)); // allocate the gfx elements prior to device initialization gfx_init(*this); // initialize image devices image_init(*this); m_tilemap = auto_alloc(*this, tilemap_manager(*this)); crosshair_init(*this); network_init(*this); // initialize the debugger if ((debug_flags & DEBUG_FLAG_ENABLED) != 0) debugger_init(*this); // call the game driver's init function // this is where decryption is done and memory maps are altered // so this location in the init order is important ui_set_startup_text(*this, "Initializing...", true); // register callbacks for the devices, then start them add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(running_machine::reset_all_devices), this)); add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(running_machine::stop_all_devices), this)); save().register_presave(save_prepost_delegate(FUNC(running_machine::presave_all_devices), this)); start_all_devices(); save().register_postload(save_prepost_delegate(FUNC(running_machine::postload_all_devices), this)); // if we're coming in with a savegame request, process it now const char *savegame = options().state(); if (savegame[0] != 0) schedule_load(savegame); // if we're in autosave mode, schedule a load else if (options().autosave() && (m_system.flags & GAME_SUPPORTS_SAVE) != 0) schedule_load("auto"); // set up the cheat engine m_cheat = auto_alloc(*this, cheat_manager(*this)); // allocate autoboot timer m_autoboot_timer = scheduler().timer_alloc(timer_expired_delegate(FUNC(running_machine::autoboot_callback), this)); // initialize lua m_lua_engine.initialize(); // disallow save state registrations starting here m_save.allow_registration(false); }
int main(int ac, char** av) { vm_t* vm; display_gl_t* display = NULL; int bound; int i; debugger_t* debugger = NULL; vm = vm_initialize(); if ( (parse_arguments(vm, ac, av) <= 0) || (check_core_endianess(vm) < 0)) { return -1; } bound = VM_MEMORY_SIZE / (vm->core_count - 1); for (i = 0; i < vm->core_count; ++i) { vm->cores[i]->bound.start = vm->cores[i]->start_address; vm->cores[i]->bound.size = bound; } memory_access_initialize(is_cpu_big_endian() != vm->big_endian); #if defined(_DEBUG) vm->full_screen = 0; #endif #ifdef RENDER_GL display = display_gl_initialize(1980, 1080, vm->full_screen); if (vm->step != -1) { debugger = debugger_init(vm->dbg_same_window ? display_gl_get_window(display) : NULL); } #endif while (vm->process_count && !display_gl_should_exit(display)) { int32 i; int update_display = 0; if (vm->cycle_barrier == vm->cycle_total) { for (i = 0; i < vm->core_count; ++i) { vm->cores[i]->bound.start = 0; vm->cores[i]->bound.size = vm->memory_size; } } if (vm->step != 0) { vm->cycle_current++; vm->cycle_total++; int32 process_count = vm->process_count; for (i = process_count; i > 0; --i) { process_t* process = vm->processes[i - 1]; process->cycle_wait--; if (process->cycle_wait <= 0) { vm_reset_process_io_op(process); vm_execute(vm, process); update_display = 1; if (vm->step > 0 && (vm->step_process == NULL || vm->step_process == process) ) { vm->step --; } } } if (vm->cycle_current > vm->cycle_to_die) { vm->cycle_current = 0; vm_kill_process_if_no_live(vm); vm_clean_dead_process(vm); } } else { update_display = 1; } #ifdef RENDER_GL update_display |= display_gl_update_input(display); if (update_display) { float y = 1; y = display_gl_text(display, 0, y, 0xffffffff, "cycle to die %d", vm->cycle_to_die); y = display_gl_text(display, 0, y, 0xffffffff, "live count %d ", vm->live_count); y = display_gl_text(display, 0, y, 0xffffffff, "process count %d ", vm->process_count); y = display_gl_text(display, 0, y, 0xffffffff, "cycle %d ", vm->cycle_total); y = display_gl_text(display, 0, y, 0xffffffff, "barrier %d ", vm->cycle_barrier); for (i = 0; i < vm->core_count; ++i) { core_t* core = vm->cores[i]; char* name = core->header ? core->header->name : "Unknow"; y = display_gl_text(display, 0, y, 0xffffffff, "%s %d", name, core->live_count); } display_gl_step(vm, display); display_gl_swap(display); } if (debugger && vm->step != 1) { debugger_render(debugger, vm); } #endif } print_winning_core(vm); if (debugger) { debugger_destroy(debugger); } #ifdef RENDER_GL display_gl_destroy(display); #endif vm_destroy(vm); }
int main(int argc, char ** argv) { int ret; DCC_LOG_INIT(); DCC_LOG_CONNECT(); stdio_init(); printf("\n---\n"); cm3_udelay_calibrate(); thinkos_init(THINKOS_OPT_PRIORITY(0) | THINKOS_OPT_ID(0)); trace_init(); tracef("## YARD-ICE " VERSION_NUM " - " VERSION_DATE " ##"); stm32f_nvram_env_init(); bsp_io_ini(); rtc_init(); supervisor_init(); __os_sleep(10); #if ENABLE_NETWORK DCC_LOG(LOG_TRACE, "network_config()."); network_config(); #endif DCC_LOG(LOG_TRACE, "modules_init()."); modules_init(); tracef("* Starting system module ..."); DCC_LOG(LOG_TRACE, "sys_start()."); sys_start(); tracef("* Initializing YARD-ICE debugger..."); DCC_LOG(LOG_TRACE, "debugger_init()."); debugger_init(); tracef("* Initializing JTAG module ..."); DCC_LOG(LOG_TRACE, "jtag_start()."); if ((ret = jtag_start()) < 0) { tracef("jtag_start() failed! [ret=%d]", ret); debugger_except("JTAG driver fault"); } #if (ENABLE_NAND) tracef("* Initializing NAND module..."); if (mod_nand_start() < 0) { tracef("mod_nand_start() failed!"); return 0; } #endif #if (ENABLE_I2C) tracef("* starting I2C module ... "); i2c_init(); #endif tracef("* configuring initial target ... "); init_target(); #if (ENABLE_VCOM) tracef("* starting VCOM daemon ... "); /* connect the UART to the JTAG auxiliary pins */ jtag3ctrl_aux_uart(true); vcom_start(); #endif #if (ENABLE_COMM) tracef("* starting COMM daemon ... "); comm_tcp_start(&debugger.comm); #endif #if (ENABLE_TFTP) tracef("* starting TFTP server ... "); tftpd_start(); #endif #if (ENABLE_GDB) tracef("* starting GDB daemon ... "); gdb_rspd_start(); #endif #if ENABLE_USB tracef("* starting USB shell ... "); usb_shell(); #endif #if ENABLE_TELNET tracef("* starting TELNET server ... "); telnet_shell(); #endif return console_shell(); }