void config_save_settings(running_machine &machine) { config_type *type; /* loop over all registrants and call their init function */ for (type = typelist; type; type = type->next) type->save(CONFIG_TYPE_INIT, NULL); /* save the defaults file */ emu_file file(machine.options().cfg_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); file_error filerr = file.open("default.cfg"); if (filerr == FILERR_NONE) config_save_xml(machine, file, CONFIG_TYPE_DEFAULT); /* finally, save the game-specific file */ filerr = file.open(machine.basename(), ".cfg"); if (filerr == FILERR_NONE) config_save_xml(machine, file, CONFIG_TYPE_GAME); /* loop over all registrants and call their final function */ for (type = typelist; type; type = type->next) type->save(CONFIG_TYPE_FINAL, NULL); }