本文整理汇总了C++中running_machine::init_phase_percent_complete方法的典型用法代码示例。如果您正苦于以下问题:C++ running_machine::init_phase_percent_complete方法的具体用法?C++ running_machine::init_phase_percent_complete怎么用?C++ running_machine::init_phase_percent_complete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类running_machine
的用法示例。
在下文中一共展示了running_machine::init_phase_percent_complete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startup_callback
static void startup_callback(running_machine &machine)
{
/**
* If the special input ports have not been configured yet, do so now.
* This is the earliest opportunity we have to do this, which must be done
* after osd_customize_input_type_list.
**/
if (!g_state.special_inputs_configured) {
g_state.special_inputs_configured = true;
input_device *keyboard = 0;
input_item_id keyboard_item = ITEM_ID_A;
int keyboard_count = 0;
int special_button_index = 0;
ioport_list &ioportlist = g_state.machine->m_portlist;
const input_port_config *port;
const input_field_config *field;
for (port = ioportlist.first(); port; port = port->next()) {
for (field = port->fieldlist; field; field = field->next) {
if ((field->type != IPT_OTHER) || !field->name) {
continue;
}
if (!keyboard || (keyboard_item > ITEM_ID_Z)) {
char namebuf[256];
snprintf(namebuf, sizeof(namebuf),
"libmame_virtual_special_keyboard_%d",
keyboard_count++);
keyboard = input_device_add
(g_state.machine, DEVICE_CLASS_KEYBOARD,
namebuf, NULL);
keyboard_item = ITEM_ID_A;
}
keyboard_item++;
int input_code =
INPUT_CODE(DEVICE_CLASS_KEYBOARD,
input_device_get_index(g_state.machine,
keyboard),
ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE,
keyboard_item);
input_device_item_add(keyboard, "",
(void *) special_button_index++,
keyboard_item, &get_special_state);
input_field_user_settings settings;
input_seq_set_1(&(settings.seq[SEQ_TYPE_STANDARD]),
input_code);
input_field_set_user_settings(field, &settings);
}
}
}
LibMame_StartupPhase phase;
switch (machine.init_phase()) {
case STARTUP_PHASE_PREPARING:
phase = LibMame_StartupPhase_Preparing;
break;
case STARTUP_PHASE_LOADING_ROMS:
phase = LibMame_StartupPhase_LoadingRoms;
break;
case STARTUP_PHASE_INITIALIZING_STATE:
phase = LibMame_StartupPhase_InitializingMachine;
break;
default:
/* Else ignore, unknown phase? */
return;
}
/* Currently, only one running game at a time is supported, so just pass
in a bogus value */
(*(g_state.callbacks->StartingUp))
(phase, machine.init_phase_percent_complete(),
(LibMame_RunningGame *) 0x1, g_state.callback_data);
}