void BFM_dm01_config(running_machine &machine, const bfmdm01_interface *intf) { assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call BFM_dm01_config at init time!"); assert_always(intf, "BFM_dm01_config called with an invalid interface!"); dm01.intf = intf; BFM_dm01_reset(machine); }
void stepper_config(running_machine &machine, int which, const stepper_interface *intf) { assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call stepper_config at init time!"); assert_always((which >= 0) && (which < MAX_STEPPERS), "stepper_config called on an invalid stepper motor!"); assert_always(intf, "stepper_config called with an invalid interface!"); step[which].intf = intf; step[which].type = intf->type; step[which].index_start = intf->index_start;/* location of first index value in half steps */ step[which].index_end = intf->index_end; /* location of last index value in half steps */ step[which].index_patt = intf->index_patt; /* hex value of coil pattern (0 if not needed)*/ step[which].initphase = intf->initphase; /* Phase at 0 steps, for alignment) */ step[which].pattern = 0; step[which].old_pattern = 0; step[which].step_pos = 0; step[which].phase = step[which].initphase; step[which].old_phase = step[which].initphase; switch ( step[which].type ) { default: case STARPOINT_48STEP_REEL: /* STARPOINT RMxxx */ case BARCREST_48STEP_REEL : /* Barcrest Reel unit */ case MPU3_48STEP_REEL : case GAMESMAN_48STEP_REEL : /* Gamesman GMxxxx */ case PROJECT_48STEP_REEL : step[which].max_steps = (48*2); break; case GAMESMAN_100STEP_REEL : step[which].max_steps = (100*2); break; case STARPOINT_144STEP_DICE :/* STARPOINT 1DCU DICE mechanism */ //Dice reels are 48 step motors, but complete three full cycles between opto updates step[which].max_steps = ((48*3)*2); break; case STARPOINT_200STEP_REEL : case GAMESMAN_200STEP_REEL : case ECOIN_200STEP_REEL : step[which].max_steps = (200*2); break; } state_save_register_item(machine, "stepper", NULL, which, step[which].index_start); state_save_register_item(machine, "stepper", NULL, which, step[which].index_end); state_save_register_item(machine, "stepper", NULL, which, step[which].index_patt); state_save_register_item(machine, "stepper", NULL, which, step[which].initphase); state_save_register_item(machine, "stepper", NULL, which, step[which].phase); state_save_register_item(machine, "stepper", NULL, which, step[which].old_phase); state_save_register_item(machine, "stepper", NULL, which, step[which].pattern); state_save_register_item(machine, "stepper", NULL, which, step[which].old_pattern); state_save_register_item(machine, "stepper", NULL, which, step[which].step_pos); state_save_register_item(machine, "stepper", NULL, which, step[which].max_steps); state_save_register_item(machine, "stepper", NULL, which, step[which].type); }
static UINT8 read_dsw(running_machine &machine) { UINT8 result; switch(machine.phase()) { case MACHINE_PHASE_RESET: case MACHINE_PHASE_RUNNING: result = machine.root_device().ioport("DSW")->read(); break; default: result = 0x00; break; } return result; }
void stepper_config(running_machine &machine, int which, const stepper_interface *intf) { assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call stepper_config at init time!"); assert_always((which >= 0) && (which < MAX_STEPPERS), "stepper_config called on an invalid stepper motor!"); assert_always(intf, "stepper_config called with an invalid interface!"); step[which].intf = intf; step[which].type = intf->type; step[which].index_start = intf->index_start;/* location of first index value in half steps */ step[which].index_end = intf->index_end; /* location of last index value in half steps */ step[which].index_patt = intf->index_patt; /* hex value of coil pattern (0 if not needed)*/ step[which].reverse = intf->reverse; step[which].phase = 0; step[which].pattern = 0; step[which].old_pattern = 0; step[which].step_pos = 0; switch ( step[which].type ) { default: case STARPOINT_48STEP_REEL: /* STARPOINT RMxxx */ case BARCREST_48STEP_REEL : /* Barcrest Reel unit */ case MPU3_48STEP_REEL : step[which].max_steps = (48*2); break; case STARPOINT_144STEPS_DICE :/* STARPOINT 1DCU DICE mechanism */ step[which].max_steps = (144*2); break; } state_save_register_item(machine, "stepper", NULL, which, step[which].index_start); state_save_register_item(machine, "stepper", NULL, which, step[which].index_end); state_save_register_item(machine, "stepper", NULL, which, step[which].index_patt); state_save_register_item(machine, "stepper", NULL, which, step[which].phase); state_save_register_item(machine, "stepper", NULL, which, step[which].pattern); state_save_register_item(machine, "stepper", NULL, which, step[which].old_pattern); state_save_register_item(machine, "stepper", NULL, which, step[which].step_pos); state_save_register_item(machine, "stepper", NULL, which, step[which].max_steps); state_save_register_item(machine, "stepper", NULL, which, step[which].type); state_save_register_item(machine, "stepper", NULL, which, step[which].reverse); }
void debug_console_register_command(running_machine &machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine &machine, int ref, int params, const char **param)) { debug_command *cmd; assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call debug_console_register_command() at init time!"); assert_always((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running"); cmd = auto_alloc_clear(machine, debug_command); /* fill in the command */ strcpy(cmd->command, command); cmd->flags = flags; cmd->ref = ref; cmd->minparams = minparams; cmd->maxparams = maxparams; cmd->handler = handler; /* link it */ cmd->next = commandlist; commandlist = cmd; }
void soundlatch_setclearedvalue(running_machine &machine, int value) { generic_audio_private *state = machine.generic_audio_data; assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call soundlatch_setclearedvalue at init time!"); state->latch_clear_value = value; }
void osd_update(running_machine &machine, int skip_redraw) { int i; attotime time_limit; attotime current_time; target->get_primitives(); /* don't do anything if we are initializing! */ switch(machine.phase()) { case MACHINE_PHASE_PREINIT: case MACHINE_PHASE_INIT: case MACHINE_PHASE_RESET: return; default: break; } /* if we have already aborted or completed, our work is done */ if ((state == STATE_ABORTED) || (state == STATE_DONE)) { machine.schedule_exit(); return; } /* have we hit the time limit? */ current_time = machine.time(); time_limit = (current_testcase.time_limit != attotime::zero) ? current_testcase.time_limit : attotime::from_seconds(600); if (current_time > time_limit) { state = STATE_ABORTED; report_message(MSG_FAILURE, "Time limit of %s attoseconds exceeded", time_limit.as_string(9)); return; } for (i = 0; i < ARRAY_LENGTH(commands); i++) { if (current_command->command_type == commands[i].command_type) { commands[i].proc(machine); break; } } /* if we are ready for the next command, advance to it */ if (state == STATE_READY) { /* if we are at the end, and we are dumping screenshots, and we didn't * just dump a screenshot, dump one now */ if ((test_flags & MESSTEST_ALWAYS_DUMP_SCREENSHOT) && (current_command[0].command_type != MESSTEST_COMMAND_SCREENSHOT) && (current_command[1].command_type == MESSTEST_COMMAND_END)) { dump_screenshot(machine, TRUE); } current_command++; } }