void loadskin(const char *dir, const char *altdir, Texture *&skin, Texture *&masks, model *m) // model skin sharing { #define ifnoload(tex, path) if((tex = textureload(path, false, true, false))==crosshair) #define tryload(tex, path, name, success, fail) \ s_sprintfd(path)("packages/models/%s/%s.jpg", dir, name); \ ifnoload(tex, path) \ { \ strcpy(path+strlen(path)-3, "png"); \ ifnoload(tex, path) \ { \ s_sprintf(path)("packages/models/%s/%s.jpg", altdir, name); \ ifnoload(tex, path) \ { \ strcpy(path+strlen(path)-3, "png"); \ ifnoload(tex, path) fail; \ } else success; \ } else success; \ } else success; if(renderpath==R_FIXEDFUNCTION) masks = crosshair; else { tryload(masks, maskspath, "masks", m->masked = true, {}); }; tryload(skin, skinpath, "skin", {}, return);
bool settings_load(Settings *setfile) { if (!setfile) setfile = &normal_settings; if (tryload(settings)) { stat("No saved settings; using defaults."); memset(setfile, 0, sizeof(Settings)); setfile->resolution = 2; // 640x480 Windowed, should be safe value setfile->last_save_slot = 0; setfile->multisave = true; setfile->enable_debug_keys = false; setfile->sound_enabled = true; setfile->music_enabled = 1; // both Boss and Regular music setfile->instant_quit = false; setfile->emulate_bugs = false; setfile->no_quake_in_hell = false; setfile->inhibit_fullscreen = false; setfile->files_extracted = true; setfile->show_fps = true; setfile->game_fps = 60; setfile->log = 0; //do default theme settings... settings->theme[THEME_DRUMSINT] = 1; settings->theme[THEME_INVNUM] = 0; settings->theme[THEME_WATERJUMP] = 1; settings->theme[THEME_DRUMSBETA] = 1; // I found that 8bpp->32bpp blits are actually noticably faster // than 32bpp->32bpp blits on several systems I tested. Not sure why // but calling SDL_DisplayFormat seems to actually be slowing things // down. This goes against established wisdom so if you want it back on, // run "displayformat 1" in the console and restart. setfile->displayformat = false; return 1; } else { #ifdef __SDLSHIM__ stat("settings_load(): Hey FIXME!!!"); settings->show_fps = true; #else input_set_mappings(settings->input_mappings); #endif } return 0; }
void fsboot(int devnr) { int size; unsigned int cmdline_adr, initrdstart_adr, initrdend_adr; printf("I: Booting from filesystem...\n"); if(!fatfs_init(devnr)) { printf("E: Unable to initialize filesystem\n"); return; } if(tryload("BOOT.BIN", SDRAM_BASE) <= 0) { printf("E: Firmware image not found\n"); fatfs_done(); return; } cmdline_adr = SDRAM_BASE+0x1000000; size = tryload("CMDLINE.TXT", cmdline_adr); if(size <= 0) { printf("I: No command line parameters found (CMDLINE.TXT)\n"); cmdline_adr = 0; } else *((char *)(cmdline_adr+size)) = 0x00; initrdstart_adr = SDRAM_BASE+0x1002000; size = tryload("INITRD.BIN", initrdstart_adr); if(size <= 0) { printf("I: No initial ramdisk found (INITRD.BIN)\n"); initrdstart_adr = 0; initrdend_adr = 0; } else initrdend_adr = initrdstart_adr + size - 1; fatfs_done(); printf("I: Booting...\n"); boot(cmdline_adr, initrdstart_adr, initrdend_adr, rescue, SDRAM_BASE); }
bool settings_load(Settings *setfile) { if (!setfile) setfile = &normal_settings; if (tryload(settings)) { stat("No saved settings; using defaults."); memset(setfile, 0, sizeof(Settings)); setfile->resolution = 1; // Fixed 320x240 for Dreamcast setfile->last_save_slot = 0; setfile->multisave = true; setfile->enable_debug_keys = false; setfile->sound_enabled = true; setfile->music_enabled = 1; // both Boss and Regular music setfile->instant_quit = false; setfile->emulate_bugs = false; setfile->no_quake_in_hell = false; setfile->inhibit_fullscreen = false; setfile->files_extracted = false; // I found that 8bpp->32bpp blits are actually noticably faster // than 32bpp->32bpp blits on several systems I tested. Not sure why // but calling SDL_DisplayFormat seems to actually be slowing things // down. This goes against established wisdom so if you want it back on, // run "displayformat 1" in the console and restart. //setfile->displayformat = false; return 1; } else { #ifdef __SDLSHIM__ stat("settings_load()"); //settings->show_fps = true; input_set_mappings(settings->input_mappings); #else input_set_mappings(settings->input_mappings); #endif } return 0; }