int main(int argc, char *argv[]) { /* Initialize random seed */ srand(time(NULL)); /* Initialize command line and fill all parameters */ cmdline_init(argc, argv); /* Check if user requires help */ if (help) { cmdline_print_usage(false); return 0; } /* Validate that a path was given */ if (!env_get_data_path()) { LOG_E("No path specified!\n"); goto err; } /* Initialize, run, and deinitialize machine */ if (!machine_init()) goto err; machine_run(); machine_deinit(); return 0; err: cmdline_print_usage(true); return 1; }
void quit() { /* Stop audio processing */ audio_stop(); /* Unregister quit events */ input_unregister(&input_config); /* Deinitialize machine */ machine_deinit(); }
void retro_unload_game(void) { /* Return already if machine was not initialized */ if (!machine_initialized) return; /* Stop audio processing */ audio_stop(); /* Deinitialize machine */ machine_deinit(); machine_initialized = false; }