void driver_device::device_start() { // bind our legacy callbacks for (int index = 0; index < ARRAY_LENGTH(m_legacy_callbacks); index++) if (m_legacy_callbacks[index] != NULL) m_callbacks[index] = driver_callback_delegate(m_legacy_callbacks[index], "legacy_callback", &machine()); // reschedule ourselves to be last device_iterator iter(*this); for (device_t *test = iter.first(); test != NULL; test = iter.next()) if (test != this && !test->started()) throw device_missing_dependencies(); // call the game-specific init if (m_system->driver_init != NULL) (*m_system->driver_init)(machine()); // finish image devices init process image_postdevice_init(machine()); // call palette_init if present if (!m_callbacks[CB_PALETTE_INIT].isnull()) m_callbacks[CB_PALETTE_INIT](); else palette_init(); // start the various pieces driver_start(); if (!m_callbacks[CB_MACHINE_START].isnull()) m_callbacks[CB_MACHINE_START](); else machine_start(); if (!m_callbacks[CB_SOUND_START].isnull()) m_callbacks[CB_SOUND_START](); else sound_start(); if (!m_callbacks[CB_VIDEO_START].isnull()) m_callbacks[CB_VIDEO_START](); else video_start(); // save generic states save_item(NAME(m_flip_screen_x)); save_item(NAME(m_flip_screen_y)); }
void driver_device::device_start() { // reschedule ourselves to be last device_iterator iter(*this); for (device_t *test = iter.first(); test != NULL; test = iter.next()) if (test != this && !test->started()) throw device_missing_dependencies(); // call the game-specific init if (m_system->driver_init != NULL) (*m_system->driver_init)(machine()); // finish image devices init process image_postdevice_init(machine()); // start the various pieces driver_start(); if (!m_callbacks[CB_MACHINE_START].isnull()) m_callbacks[CB_MACHINE_START](); else machine_start(); if (!m_callbacks[CB_SOUND_START].isnull()) m_callbacks[CB_SOUND_START](); else sound_start(); if (!m_callbacks[CB_VIDEO_START].isnull()) m_callbacks[CB_VIDEO_START](); else video_start(); // save generic states save_item(NAME(m_latch_clear_value)); save_item(NAME(m_latched_value)); save_item(NAME(m_flip_screen_x)); save_item(NAME(m_flip_screen_y)); }
void driver_device::device_start() { // reschedule ourselves to be last if (next() != NULL) throw device_missing_dependencies(); // call the game-specific init if (m_system->driver_init != NULL) (*m_system->driver_init)(machine()); // finish image devices init process image_postdevice_init(machine()); // call palette_init if present if (m_palette_init != NULL) (*m_palette_init)(machine(), machine().region("proms")->base()); // start the various pieces driver_start(); machine_start(); sound_start(); video_start(); }
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); }