trunk/src/emu/emuopts.c
| r22685 | r22686 | |
| 195 | 195 | { OPTION_RAMSIZE ";ram", NULL, OPTION_STRING, "size of RAM (if supported by driver)" }, |
| 196 | 196 | { OPTION_CONFIRM_QUIT, "0", OPTION_BOOLEAN, "display confirm quit screen on exit" }, |
| 197 | 197 | { OPTION_UI_MOUSE, "0", OPTION_BOOLEAN, "display ui mouse cursor" }, |
| 198 | { OPTION_AUTOBOOT_COMMAND ";ab", NULL, OPTION_STRING, "command to execute after machine boot" }, |
| 199 | { OPTION_AUTOBOOT_DELAY, "2", OPTION_INTEGER, "timer delay in sec to trigger command execution on autoboot" }, |
| 198 | 200 | { NULL } |
| 199 | 201 | }; |
| 200 | 202 | |
trunk/src/emu/emuopts.h
| r22685 | r22686 | |
| 199 | 199 | #define OPTION_CONFIRM_QUIT "confirm_quit" |
| 200 | 200 | #define OPTION_UI_MOUSE "ui_mouse" |
| 201 | 201 | |
| 202 | #define OPTION_AUTOBOOT_COMMAND "autoboot_command" |
| 203 | #define OPTION_AUTOBOOT_DELAY "autoboot_delay" |
| 202 | 204 | |
| 203 | 205 | //************************************************************************** |
| 204 | 206 | // TYPE DEFINITIONS |
| r22685 | r22686 | |
| 352 | 354 | |
| 353 | 355 | bool confirm_quit() const { return bool_value(OPTION_CONFIRM_QUIT); } |
| 354 | 356 | bool ui_mouse() const { return bool_value(OPTION_UI_MOUSE); } |
| 357 | |
| 358 | const char *autoboot_command() const { return value(OPTION_AUTOBOOT_COMMAND); } |
| 359 | int autoboot_delay() const { return int_value(OPTION_AUTOBOOT_DELAY); } |
| 355 | 360 | |
| 356 | 361 | // device-specific options |
| 357 | 362 | const char *device_option(device_image_interface &image); |
trunk/src/emu/machine.c
| r22685 | r22686 | |
| 232 | 232 | return m_context; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | TIMER_CALLBACK_MEMBER(running_machine::autoboot_callback) |
| 236 | { |
| 237 | if (strlen(options().autoboot_command())!=0) { |
| 238 | ioport().natkeyboard().post_utf8(options().autoboot_command()); |
| 239 | ioport().natkeyboard().post_utf8("\r"); |
| 240 | } |
| 241 | } |
| 235 | 242 | |
| 236 | 243 | //------------------------------------------------- |
| 237 | 244 | // start - initialize the emulated machine |
| r22685 | r22686 | |
| 322 | 329 | // set up the cheat engine |
| 323 | 330 | m_cheat = auto_alloc(*this, cheat_manager(*this)); |
| 324 | 331 | |
| 332 | /* allocate a timer */ |
| 333 | m_autoboot_timer = scheduler().timer_alloc(timer_expired_delegate(FUNC(running_machine::autoboot_callback), this)); |
| 334 | |
| 325 | 335 | // disallow save state registrations starting here |
| 326 | 336 | m_save.allow_registration(false); |
| 327 | 337 | } |
| r22685 | r22686 | |
| 839 | 849 | // call all registered reset callbacks |
| 840 | 850 | call_notifiers(MACHINE_NOTIFY_RESET); |
| 841 | 851 | |
| 852 | // setup autoboot if needed |
| 853 | m_autoboot_timer->adjust(attotime(options().autoboot_delay(),0),0); |
| 854 | |
| 842 | 855 | // now we're running |
| 843 | | m_current_phase = MACHINE_PHASE_RUNNING; |
| 856 | m_current_phase = MACHINE_PHASE_RUNNING; |
| 844 | 857 | } |
| 845 | 858 | |
| 846 | 859 | |