// by oggzee, usptactical & Dr. Clipper #include #include #include #include #include #include #include #include #include #include #include #include "dir.h" #include "cfg.h" #include "wpad.h" #include "gui.h" #include "video.h" #include "fat.h" #include "net.h" #include "xml.h" #include "gettext.h" #include "menu.h" #include "console.h" #include "sys.h" #include "menu.h" #include "wbfs.h" #include "wgui.h" #include "sort.h" char FAT_DRIVE[8] = SDHC_DRIVE; char USBLOADER_PATH[200] = "sd:/usb-loader"; char APPS_DIR[200] = ""; char LAST_CFG_PATH[200]; char direct_start_id_buf[] = "#GAMEID\0\0\0\0\0CFGUSB0000000000"; char DIOS_MIOS_INFO[200] = ""; u32 HBC_LOWER_TID = 0x00000000; NIN_CFG *ncfg = NULL; /* configurable fields */ int ENTRIES_PER_PAGE = 12; int MAX_CHARACTERS = 30; int CONSOLE_XCOORD = 258; int CONSOLE_YCOORD = 112; int CONSOLE_WIDTH = 354; int CONSOLE_HEIGHT = 304; int CONSOLE_FG_COLOR = 15; int CONSOLE_BG_COLOR = 0; int COVER_XCOORD = 24; int COVER_YCOORD = 104; struct CFG CFG; int COVER_WIDTH_FRONT; int COVER_HEIGHT_FRONT; #define TITLE_MAX 64 struct ID_Title { u8 id[8]; char title[TITLE_MAX]; int hnext; // linked list next with same hash }; // renamed titles int num_title = 0; //number of titles struct ID_Title *cfg_title = NULL; HashTable title_hash_id6; HashTable title_hash_id4; #define MAX_CFG_GAME 500 int num_cfg_game = 0; struct Game_CFG_2 cfg_game[MAX_CFG_GAME]; struct TextMap map_video[] = { { "system", CFG_VIDEO_SYS }, { "game", CFG_VIDEO_GAME }, { "auto", CFG_VIDEO_AUTO }, { "pal50", CFG_VIDEO_PAL50 }, { "pal60", CFG_VIDEO_PAL60 }, { "ntsc", CFG_VIDEO_NTSC }, { "pal480p",CFG_VIDEO_NUM }, { NULL, -1 } }; struct TextMap map_video_patch[] = { { "0", CFG_VIDEO_PATCH_OFF }, { "1", CFG_VIDEO_PATCH_ON }, { "all", CFG_VIDEO_PATCH_ALL }, { "sneek", CFG_VIDEO_PATCH_SNEEK }, { "sneek+all", CFG_VIDEO_PATCH_SNEEK_ALL }, { NULL, -1 } }; char *names_vpatch[CFG_VIDEO_PATCH_NUM] = { gts("Off"), gts("On"), gts("All"), "sneek", "sneek+all", }; struct TextMap map_language[] = { { "console", CFG_LANG_CONSOLE }, { "japanese", CFG_LANG_JAPANESE }, { "english", CFG_LANG_ENGLISH }, { "german", CFG_LANG_GERMAN }, { "french", CFG_LANG_FRENCH }, { "spanish", CFG_LANG_SPANISH }, { "italian", CFG_LANG_ITALIAN }, { "dutch", CFG_LANG_DUTCH }, { "s.chinese", CFG_LANG_S_CHINESE }, { "t.chinese", CFG_LANG_T_CHINESE }, { "korean", CFG_LANG_KOREAN }, { NULL, -1 } }; struct TextMap map_layout[] = { { "original", CFG_LAYOUT_ORIG }, { "original1", CFG_LAYOUT_ORIG }, { "original2", CFG_LAYOUT_ORIG_12 }, { "small", CFG_LAYOUT_SMALL }, { "medium", CFG_LAYOUT_MEDIUM }, { "large", CFG_LAYOUT_LARGE }, { "large2", CFG_LAYOUT_LARGE_2 }, { "large3", CFG_LAYOUT_LARGE_3 }, { "ultimate1", CFG_LAYOUT_ULTIMATE1 }, { "ultimate2", CFG_LAYOUT_ULTIMATE2 }, { "ultimate3", CFG_LAYOUT_ULTIMATE3 }, { "kosaic", CFG_LAYOUT_KOSAIC }, { NULL, -1 } }; struct TextMap map_ios[] = { { "245", CFG_IOS_245 }, { "246", CFG_IOS_246 }, { "247", CFG_IOS_247 }, { "248", CFG_IOS_248 }, { "249", CFG_IOS_249 }, { "250", CFG_IOS_250 }, { "251", CFG_IOS_251 }, { "252", CFG_IOS_252 }, { "222-mload", CFG_IOS_222_MLOAD }, { "223-mload", CFG_IOS_223_MLOAD }, { "224-mload", CFG_IOS_224_MLOAD }, { "222-yal", CFG_IOS_222_YAL }, { "223-yal", CFG_IOS_223_YAL }, { "Auto", CFG_IOS_AUTO }, { NULL, -1 } }; u8 cIOS_base[11]; struct TextMap map_gui_style[] = { { "grid", GUI_STYLE_GRID }, { "flow", GUI_STYLE_FLOW }, { "flow-z", GUI_STYLE_FLOW_Z }, { "coverflow3d", GUI_STYLE_COVERFLOW + coverflow3d }, { "coverflow2d", GUI_STYLE_COVERFLOW + coverflow2d }, { "frontrow", GUI_STYLE_COVERFLOW + frontrow }, { "vertical", GUI_STYLE_COVERFLOW + vertical }, { "carousel", GUI_STYLE_COVERFLOW + carousel }, { NULL, -1 } }; struct TextMap map_button[] = { { "-", CFG_BTN_M }, { "+", CFG_BTN_P }, { "A", CFG_BTN_A }, { "B", CFG_BTN_B }, { "H", CFG_BTN_H }, { "1", CFG_BTN_1 }, { "2", CFG_BTN_2 }, { "nothing", CFG_BTN_NOTHING }, { "options", CFG_BTN_OPTIONS }, { "gui", CFG_BTN_GUI }, { "reboot", CFG_BTN_REBOOT }, { "exit", CFG_BTN_EXIT }, { "hbc", CFG_BTN_HBC }, { "screenshot", CFG_BTN_SCREENSHOT }, { "install", CFG_BTN_INSTALL }, { "remove", CFG_BTN_REMOVE }, { "main_menu", CFG_BTN_MAIN_MENU }, { "global_ops", CFG_BTN_GLOBAL_OPS }, { "favorites", CFG_BTN_FAVORITES }, { "boot_game", CFG_BTN_BOOT_GAME }, { "boot_disc", CFG_BTN_BOOT_DISC }, { "theme", CFG_BTN_THEME }, { "profile", CFG_BTN_PROFILE }, { "unlock", CFG_BTN_UNLOCK }, { "sort", CFG_BTN_SORT }, { "filter", CFG_BTN_FILTER }, { "priiloader", CFG_BTN_PRIILOADER }, { "channel", CFG_BTN_CHANNEL }, { "wii_menu", CFG_BTN_WII_MENU }, { "random", CFG_BTN_RANDOM }, { NULL, -1 } }; struct TextMap map_button_menu[] = { //{ "A", NUM_BUTTON_A }, { "B", NUM_BUTTON_B }, { "1", NUM_BUTTON_1 }, { "2", NUM_BUTTON_2 }, { "-", NUM_BUTTON_MINUS }, { "M", NUM_BUTTON_MINUS }, { "+", NUM_BUTTON_PLUS }, { "P", NUM_BUTTON_PLUS }, { "H", NUM_BUTTON_HOME }, { "X", NUM_BUTTON_X }, { "Y", NUM_BUTTON_Y }, { "Z", NUM_BUTTON_Z }, { "C", NUM_BUTTON_C }, { "L", NUM_BUTTON_L }, { "R", NUM_BUTTON_R }, { NULL, -1 } }; struct TextMap map_hook[] = { { "nohooks", 0 }, { "vbi", 1 }, { "wiipad", 2 }, { "gcpad", 3 }, { "gxdraw", 4 }, { "gxflush", 5 }, { "ossleep", 6 }, { "axframe", 7 }, { NULL, -1 } }; char *hook_name[NUM_HOOK] = { "No Hooks", "VBI", "Wii Pad", "GC Pad", "GXDraw", "GXFlush", "OSSleepThread", "AXNextFrame" }; struct TextMap map_nand_emu[] = { { "off", 0 }, { "partitial", 1 }, { "full", 2 }, { NULL, -1 } }; struct TextMap map_boot_method[] = //combination of map_channel_boot and map_gc_boot { { "Mighty Plugin", 0 }, { "Neek2o Plugin", 1 }, { "Default", 0 }, { "DIOS MIOS", 1 }, { "Devolution", 2 }, { "Nintendont", 3 }, { NULL, -1 } }; struct TextMap map_channel_boot[] = { { "Mighty Plugin", 0 }, { "Neek2o Plugin", 1 }, { NULL, -1 } }; struct TextMap map_gc_boot[] = { { "Default", 0 }, { "DIOS MIOS", 1 }, { "Devolution", 2 }, { "Nintendont", 3 }, { NULL, -1 } }; struct TextMap map_mem_card_size[] = { { " 59 blocks", 0 }, // 512KB { " 123 blocks", 1 }, // 1MB { " 251 blocks", 2 }, // 2MB { " 507 blocks", 3 }, // 4MB { "1019 blocks", 4 }, // 8MB { "2043 blocks", 5 }, // 16MB { NULL, -1 } }; struct TextMap map_filter_type[] = { { "all", -1 }, { "online", 0 }, { "unplayed", 1 }, { "genre", 2 }, { "features", 3 }, { "controller", 4 }, { "gamecube", 5 }, { "wii", 6 }, { "channel", 7 }, { "duplicate", 8 }, { "game_type", 9 }, { "search", 10 }, { NULL, -2 } }; struct TextMap map_game_type[] = { { "wii", 0 }, { "gamecube", 1 }, { "all_channels", 2 }, { "wiiware", 3 }, { "vc_nes", 4 }, { "vc_snes", 5 }, { "vc_n64", 6 }, { "vc_sms", 7 }, { "vc_md", 8 }, { "vc_pce", 9 }, { "vc_neogeo", 10 }, { "vc_arcade", 11 }, { "vc_c64", 12 }, { "wii_channels", 13 }, { "fwd_emu", 14 }, { NULL, -1 } }; struct TextMap map_game_controller[] = { { "wiimote", 0 }, { "nunchuk", 1 }, { "motionplus", 2 }, { "gamecube", 3 }, { "nintendods", 4 }, { "classiccontroller", 5 }, { "wheel", 6 }, { "zapper", 7 }, { "balanceboard", 8 }, { "microphone", 9 }, { "guitar", 10 }, { "drums", 11 }, { "camera", 12 }, { "dancepad", 13 }, { "infinitybase", 14 }, { "keyboard", 15 }, { "portalofpower", 16 }, { "skateboard", 17 }, { "totalbodytracking", 18 }, { "turntable", 19 }, { "udraw", 20 }, { "wiispeak", 21 }, { "vitalitysensor", 22 }, { NULL, -1 } }; struct TextMap map_game_feature[] = { { "online", 0 }, { "download", 1 }, { "score", 2 }, { "nintendods", 3 }, { NULL, -1 } }; struct TextMap map_game_genre[] = { { "action", 0 }, { "adventure", 1 }, { "fighting", 2 }, { "music", 3 }, { "platformer", 4 }, { "puzzle", 5 }, { "racing", 6 }, { "role-playing", 7 }, { "shooter", 8 }, { "simulation", 9 }, { "sports", 10 }, { "strategy", 11 }, { "arcade", 12 }, { "baseball", 13 }, { "basketball", 14 }, { "bike_racing", 15 }, { "billiards", 16 }, { "board_game", 17 }, { "bowling", 18 }, { "boxing", 19 }, { "business_simulation", 20 }, { "cards", 21 }, { "chess", 22 }, { "coaching", 23 }, { "compilation", 24 }, { "construction_simulation", 25 }, { "cooking", 26 }, { "cricket", 27 }, { "dance", 28 }, { "darts", 29 }, { "drawing", 30 }, { "educational", 31 }, { "exercise", 32 }, { "first-person_shooter", 33 }, { "fishing", 34 }, { "fitness", 35 }, { "flight_simulation", 36 }, { "football", 37 }, { "futuristic_racing", 38 }, { "golf", 39 }, { "health", 40 }, { "hidden_object", 41 }, { "hockey", 42 }, { "hunting", 43 }, { "karaoke", 44 }, { "kart_racing", 45 }, { "life_simulation", 46 }, { "management_simulation", 47 }, { "martial_arts", 48 }, { "motorcycle_racing", 49 }, { "off-road_racing", 50 }, { "party", 51 }, { "petanque", 52 }, { "pinball", 53 }, { "poker", 54 }, { "rail_shooter", 55 }, { "rhythm", 56 }, { "rugby", 57 }, { "sim_racing", 58 }, { "skateboarding", 59 }, { "ski", 60 }, { "snowboarding", 61 }, { "soccer", 62 }, { "stealth_action", 63 }, { "surfing", 64 }, { "survival_horror", 65 }, { "table_tennis", 66 }, { "tennis", 67 }, { "third-person_shooter", 68 }, { "train_simulation", 69 }, { "trivia", 70 }, { "truck_racing", 71 }, { "virtual_pet", 72 }, { "volleyball", 73 }, { "watercraft_racing", 74 }, { "wrestling", 75 }, { NULL, -1 } }; struct TextMap map_search_field[] = { { "title", 0 }, { "synopsis", 1 }, { "developer", 2 }, { "publisher", 3 }, { "id6", 4 }, { "region", 5 }, { "rating", 6 }, { "players", 7 }, { "online_players", 8 }, { "play_count", 9 }, { "synopsis_len", 10 }, { "covers_available", 11 }, { NULL, -1 } }; struct TextMap map_private_server[] = { { "Off", 0 }, { "NoSSL only", 1 }, { "wiimmfi.de", 2 }, { "Custom", 3 }, { NULL, -1 } }; struct playStat { char id[7]; s32 playCount; time_t playTime; }; bool playStatsRead = false; int playStatsSize = 0; struct playStat *playStats; int CFG_IOS_MAX = MAP_NUM(map_ios) - 1; int CURR_IOS_IDX = -1; // theme //#define MAX_THEME 100 int num_theme = 0; int cur_theme = -1; char theme_list[MAX_THEME][MAX_THEME_NAME]; char theme_path[200]; void game_set(char *name, char *val); void load_theme(char *theme); void cfg_setup1(); void cfg_setup2(); void cfg_setup3(); void cfg_direct_start(int argc, char **argv); void cfg_layout() { // CFG_LAYOUT_ORIG (1.0 - base for most) ENTRIES_PER_PAGE = 6; MAX_CHARACTERS = 30; CONSOLE_XCOORD = 260; CONSOLE_YCOORD = 115; CONSOLE_WIDTH = 340; CONSOLE_HEIGHT = 218; CONSOLE_FG_COLOR = 15; CONSOLE_BG_COLOR = 0; // orig 1.2 COVER_XCOORD = 24; COVER_YCOORD = 104; //COVER_WIDTH = 160; // set by cover_style //COVER_HEIGHT = 225; // set by cover_style // widescreen CFG.W_CONSOLE_XCOORD = CONSOLE_XCOORD; CFG.W_CONSOLE_YCOORD = CONSOLE_YCOORD; CFG.W_CONSOLE_WIDTH = CONSOLE_WIDTH; CFG.W_CONSOLE_HEIGHT = CONSOLE_HEIGHT; CFG.W_COVER_XCOORD = COVER_XCOORD; CFG.W_COVER_YCOORD = COVER_YCOORD; //CFG.W_COVER_WIDTH = 0; // auto //CFG.W_COVER_HEIGHT = 0; // auto switch (CFG.layout) { case CFG_LAYOUT_ORIG: // 1.0+ ENTRIES_PER_PAGE = 6; MAX_CHARACTERS = 30; CONSOLE_XCOORD = 260; CONSOLE_YCOORD = 115; CONSOLE_WIDTH = 340; CONSOLE_HEIGHT = 218; CONSOLE_FG_COLOR = 15; CONSOLE_BG_COLOR = 0; break; case CFG_LAYOUT_ORIG_12: // 1.2+ ENTRIES_PER_PAGE = 12; MAX_CHARACTERS = 30; CONSOLE_XCOORD = 258; CONSOLE_YCOORD = 112; CONSOLE_WIDTH = 354; CONSOLE_HEIGHT = 304; CONSOLE_FG_COLOR = 15; CONSOLE_BG_COLOR = 0; COVER_XCOORD = 24; COVER_YCOORD = 104; break; case CFG_LAYOUT_SMALL: // same as 1.0 + use more space ENTRIES_PER_PAGE = 9; MAX_CHARACTERS = 38; break; case CFG_LAYOUT_MEDIUM: ENTRIES_PER_PAGE = 19; //17; MAX_CHARACTERS = 38; CONSOLE_YCOORD = 50; CONSOLE_HEIGHT = 380; COVER_XCOORD = 28; COVER_YCOORD = 175; break; // nixx: case CFG_LAYOUT_LARGE: ENTRIES_PER_PAGE = 21; MAX_CHARACTERS = 38; CONSOLE_YCOORD = 40; CONSOLE_HEIGHT = 402; COVER_XCOORD = 28; COVER_YCOORD = 175; break; // usptactical: case CFG_LAYOUT_LARGE_2: ENTRIES_PER_PAGE = 21; MAX_CHARACTERS = 38; CONSOLE_YCOORD = 40; CONSOLE_HEIGHT = 402; COVER_XCOORD = 30; COVER_YCOORD = 180; break; // oggzee case CFG_LAYOUT_LARGE_3: ENTRIES_PER_PAGE = 21; MAX_CHARACTERS = 38; CONSOLE_YCOORD = 40; CONSOLE_WIDTH = 344; CONSOLE_HEIGHT = 402; COVER_XCOORD = 42; COVER_YCOORD = 102; CFG.W_CONSOLE_XCOORD = CONSOLE_XCOORD; CFG.W_CONSOLE_YCOORD = CONSOLE_YCOORD; CFG.W_CONSOLE_WIDTH = CONSOLE_WIDTH; CFG.W_CONSOLE_HEIGHT = CONSOLE_HEIGHT; CFG.W_COVER_XCOORD = COVER_XCOORD+14; CFG.W_COVER_YCOORD = COVER_YCOORD; break; // Ultimate1: (WiiShizza) white background case CFG_LAYOUT_ULTIMATE1: ENTRIES_PER_PAGE = 12; MAX_CHARACTERS = 37; CONSOLE_YCOORD = 30; CONSOLE_HEIGHT = 290; CONSOLE_FG_COLOR = 0; CONSOLE_BG_COLOR = 15; COVER_XCOORD = 28; COVER_YCOORD = 105; break; // Ultimate2: (jservs7 / hungyip84) case CFG_LAYOUT_ULTIMATE2: ENTRIES_PER_PAGE = 12; MAX_CHARACTERS = 37; CONSOLE_YCOORD = 30; CONSOLE_HEIGHT = 290; CONSOLE_FG_COLOR = 15; CONSOLE_BG_COLOR = 0; COVER_XCOORD = 28; COVER_YCOORD = 105; break; // Ultimate3: (WiiShizza) white background, covers on right case CFG_LAYOUT_ULTIMATE3: ENTRIES_PER_PAGE = 12; MAX_CHARACTERS = 37; CONSOLE_XCOORD = 40; CONSOLE_YCOORD = 71; CONSOLE_WIDTH = 344; CONSOLE_HEIGHT = 290; CONSOLE_FG_COLOR = 0; CONSOLE_BG_COLOR = 15; COVER_XCOORD = 446; COVER_YCOORD = 109; CFG.W_CONSOLE_XCOORD = CONSOLE_XCOORD; CFG.W_CONSOLE_YCOORD = CONSOLE_YCOORD; CFG.W_CONSOLE_WIDTH = CONSOLE_WIDTH; CFG.W_CONSOLE_HEIGHT = CONSOLE_HEIGHT; CFG.W_COVER_XCOORD = 482; CFG.W_COVER_YCOORD = 110; break; // Kosaic (modified U3) case CFG_LAYOUT_KOSAIC: ENTRIES_PER_PAGE = 12; MAX_CHARACTERS = 37; CONSOLE_XCOORD = 40; CONSOLE_YCOORD = 71; CONSOLE_WIDTH = 344; CONSOLE_HEIGHT = 290; CONSOLE_FG_COLOR = 15; CONSOLE_BG_COLOR = 0; COVER_XCOORD = 446; COVER_YCOORD = 109; CFG.W_CONSOLE_XCOORD = 34; CFG.W_CONSOLE_YCOORD = 71; CFG.W_CONSOLE_WIDTH = CONSOLE_WIDTH; CFG.W_CONSOLE_HEIGHT = CONSOLE_HEIGHT; CFG.W_COVER_XCOORD = 444; CFG.W_COVER_YCOORD = 109; break; } } void set_colors(int x) { switch(x) { case CFG_COLORS_MONO: CFG.color_header = CFG.color_inactive = CFG.color_footer = CFG.color_help = CFG.color_selected_bg = CONSOLE_FG_COLOR; CFG.color_selected_fg = CONSOLE_BG_COLOR; break; case CFG_COLORS_DARK: CFG.color_header = 14; CFG.color_selected_fg = 11; CFG.color_selected_bg = 12; CFG.color_inactive = 8; CFG.color_footer = 6; CFG.color_help = 2; break; case CFG_COLORS_BRIGHT: CFG.color_header = 6; CFG.color_selected_fg = 11; CFG.color_selected_bg = 12; CFG.color_inactive = 7; CFG.color_footer = 4; CFG.color_help = 2; break; } } void cfg_set_covers_path() { //STRCOPY(CFG.covers_path_2d, CFG.covers_path); snprintf(D_S(CFG.covers_path_2d), "%s/%s", CFG.covers_path, "2d"); snprintf(D_S(CFG.covers_path_3d), "%s/%s", CFG.covers_path, "3d"); snprintf(D_S(CFG.covers_path_disc), "%s/%s", CFG.covers_path, "disc"); snprintf(D_S(CFG.covers_path_full), "%s/%s", CFG.covers_path, "full"); snprintf(D_S(CFG.covers_path_cache), "%s/%s", CFG.covers_path, "cache"); CFG.covers_path_2d_set = 0; } char *cfg_get_covers_path(int style) { switch (style) { default: case CFG_COVER_STYLE_2D: if (CFG.covers_path_2d_set) { return CFG.covers_path_2d; } else { return CFG.covers_path; } case CFG_COVER_STYLE_3D: return CFG.covers_path_3d; case CFG_COVER_STYLE_DISC: return CFG.covers_path_disc; case CFG_COVER_STYLE_FULL: case CFG_COVER_STYLE_HQ: return CFG.covers_path_full; case CFG_COVER_STYLE_CACHE: return CFG.covers_path_cache; } return NULL; } void cfg_set_cover_style(int style) { CFG.cover_style = style; CFG.W_COVER_WIDTH = 0; // auto CFG.W_COVER_HEIGHT = 0; // auto switch (style) { case CFG_COVER_STYLE_2D: COVER_WIDTH = 160; COVER_HEIGHT = 225; break; case CFG_COVER_STYLE_3D: COVER_WIDTH = 160; COVER_HEIGHT = 225; break; case CFG_COVER_STYLE_DISC: COVER_WIDTH = 160; COVER_HEIGHT = 160; break; case CFG_COVER_STYLE_FULL: COVER_WIDTH = 512; if (CFG.gui_compress_covers) COVER_HEIGHT = 336; else COVER_HEIGHT = 340; //Calculate the width of the front cover only, given the cover dimensions above. // Divide the height by 1.4, which is the 2d cover height:width ratio (225x160 = 1.4) // and then divide by 4 and multiply by 4 so it's divisible. This makes it easier if // we want to change the fullcover dimensions in the future. COVER_WIDTH_FRONT = (int)(COVER_HEIGHT / 1.4) >> 2 << 2; COVER_HEIGHT_FRONT = COVER_HEIGHT; break; } } void cfg_set_cover_style_str(char *val) { if (strcmp(val, "standard")==0) { cfg_set_cover_style(CFG_COVER_STYLE_2D); } else if (strcmp(val, "3d")==0) { cfg_set_cover_style(CFG_COVER_STYLE_3D); } else if (strcmp(val, "disc")==0) { cfg_set_cover_style(CFG_COVER_STYLE_DISC); } else if (strcmp(val, "full")==0) { cfg_set_cover_style(CFG_COVER_STYLE_FULL); } } // setup cover style: path & url /* void cfg_setup_cover_style() { switch (CFG.cover_style) { case CFG_COVER_STYLE_3D: STRCOPY(CFG.covers_path, CFG.covers_path_3d); STRCOPY(CFG.cover_url, CFG.cover_url_3d); break; case CFG_COVER_STYLE_DISC: STRCOPY(CFG.covers_path, CFG.covers_path_disc); STRCOPY(CFG.cover_url, CFG.cover_url_disc); break; case CFG_COVER_STYLE_FULL: STRCOPY(CFG.covers_path, CFG.covers_path_full); STRCOPY(CFG.cover_url, CFG.cover_url_full); break; default: case CFG_COVER_STYLE_2D: STRCOPY(CFG.covers_path, CFG.covers_path_2d); STRCOPY(CFG.cover_url, CFG.cover_url_2d); break; } } */ void cfg_default_url() { CFG.download_id_len = 6; CFG.download_all = 1; //strcpy(CFG.download_cc_pal, "EN"); *CFG.download_cc_pal = 0; // means AUTO - console language *CFG.cover_url_2d = 0; *CFG.cover_url_3d = 0; *CFG.cover_url_disc = 0; *CFG.cover_url_full = 0; *CFG.cover_url_hq = 0; STRCOPY(CFG.cover_url_2d, " http://art.gametdb.com/wii/cover/{CC}/{ID6}.png" //" http://www.wiiboxart.com/artwork/cover/{ID6}.png" //" http://boxart.rowdyruff.net/flat/{ID6}.png" //" http://www.muntrue.nl/covers/ALL/160/225/boxart/{ID6}.png" //" http://wiicover.gateflorida.com/sites/default/files/cover/2D%20Cover/{ID6}.png" //" http://awiibit.com/BoxArt160x224/{ID6}.png" ); STRCOPY(CFG.cover_url_3d, " http://art.gametdb.com/wii/cover3D/{CC}/{ID6}.png" //" http://www.wiiboxart.com/artwork/cover3D/{ID6}.png" //" http://boxart.rowdyruff.net/3d/{ID6}.png" //" http://www.muntrue.nl/covers/ALL/160/225/3D/{ID6}.png" //" http://wiicover.gateflorida.com/sites/default/files/cover/3D%20Cover/{ID6}.png" //" http://awiibit.com/3dBoxArt176x248/{ID6}.png" ); STRCOPY(CFG.cover_url_disc, " http://art.gametdb.com/wii/disc/{CC}/{ID6}.png" " http://art.gametdb.com/wii/disccustom/{CC}/{ID6}.png" //" http://www.wiiboxart.com/artwork/disc/{ID6}.png" //" http://www.wiiboxart.com/artwork/disccustom/{ID6}.png" //" http://boxart.rowdyruff.net/fulldisc/{ID6}.png" //" http://www.muntrue.nl/covers/ALL/160/160/disc/{ID6}.png" //" http://wiicover.gateflorida.com/sites/default/files/cover/Disc%20Cover/{ID6}.png" //" http://awiibit.com/WiiDiscArt/{ID6}.png" ); STRCOPY(CFG.cover_url_full, " http://art.gametdb.com/wii/coverfull/{CC}/{ID6}.png" //" http://www.wiiboxart.com/artwork/coverfull/{ID6}.png" //" http://www.muntrue.nl/covers/ALL/512/340/fullcover/{ID6}.png" //" http://wiicover.gateflorida.com/sites/default/files/cover/Full%20Cover/{ID6}.png" ); STRCOPY(CFG.cover_url_hq, " http://art.gametdb.com/wii/coverfullHQ/{CC}/{ID6}.png" ); STRCOPY(CFG.gamercard_url, " http://www.wiinnertag.com/wiinnertag_scripts/update_sign.php?key={KEY}&game_id={ID6}" " http://www.messageboardchampion.com/ncard/API/?cmd=tdbupdate&key={KEY}&game={ID6}" " http://tag.darkumbra.net/{KEY}.update={ID6}" ); *CFG.gamercard_key = 0; } /** * Method that populates the coverflow global settings structure * @return void */ void CFG_Default_Coverflow() { CFG_cf_global.covers_3d = true; CFG_cf_global.number_of_covers = 7; CFG_cf_global.selected_cover = 1; CFG_cf_global.theme = coverflow3d; // default to coverflow 3D CFG_cf_global.cover_back_xpos = 0; CFG_cf_global.cover_back_ypos = 0; CFG_cf_global.cover_back_zpos = -45; CFG_cf_global.cover_back_xrot = 0; CFG_cf_global.cover_back_yrot = 0; CFG_cf_global.cover_back_zrot = 0; CFG_cf_global.screen_fade_alpha = 210; } /** * Method that populates the coverflow theme settings structure * @return void */ void CFG_Default_Coverflow_Themes() { int i = 0; //allocate the structure array //SAFE_FREE(CFG_cf_theme); //CFG_cf_theme = malloc(5 * sizeof *CFG_cf_theme); // coverflow 3D CFG_cf_theme[i].rotation_frames = 40; CFG_cf_theme[i].rotation_frames_fast = 7; CFG_cf_theme[i].cam_pos_x = 0.0; CFG_cf_theme[i].cam_pos_y = 0.0; CFG_cf_theme[i].cam_pos_z = 0.0; CFG_cf_theme[i].cam_look_x = 0.0; CFG_cf_theme[i].cam_look_y = 0.0; CFG_cf_theme[i].cam_look_z = -1.0; if (CFG.widescreen) CFG_cf_theme[i].number_of_side_covers = 4; else CFG_cf_theme[i].number_of_side_covers = 3; CFG_cf_theme[i].reflections_color_bottom = 0x666666FF; CFG_cf_theme[i].reflections_color_top = 0xAAAAAA33; CFG_cf_theme[i].alpha_rolloff = 0; CFG_cf_theme[i].floating_cover = false; CFG_cf_theme[i].title_text_xpos = -1; CFG_cf_theme[i].title_text_ypos = 434; CFG_cf_theme[i].cover_rolloff_x = 0; CFG_cf_theme[i].cover_rolloff_y = 0; CFG_cf_theme[i].cover_rolloff_z = 0; CFG_cf_theme[i].cover_center_xpos = 0; CFG_cf_theme[i].cover_center_ypos = 0; CFG_cf_theme[i].cover_center_zpos = -70; CFG_cf_theme[i].cover_center_xrot = 0; CFG_cf_theme[i].cover_center_yrot = 0; CFG_cf_theme[i].cover_center_zrot = 0; CFG_cf_theme[i].cover_center_reflection_used = true; CFG_cf_theme[i].cover_distance_from_center_left_x = -21; CFG_cf_theme[i].cover_distance_from_center_left_y = 0; CFG_cf_theme[i].cover_distance_from_center_left_z = 0; CFG_cf_theme[i].cover_distance_between_covers_left_x = -10; CFG_cf_theme[i].cover_distance_between_covers_left_y = 0; CFG_cf_theme[i].cover_distance_between_covers_left_z = 0; CFG_cf_theme[i].cover_left_xpos = 0; CFG_cf_theme[i].cover_left_ypos = 0; CFG_cf_theme[i].cover_left_zpos = -93; CFG_cf_theme[i].cover_left_xrot = 0; CFG_cf_theme[i].cover_left_yrot = 70; CFG_cf_theme[i].cover_left_zrot = 0; CFG_cf_theme[i].cover_distance_from_center_right_x = 21; CFG_cf_theme[i].cover_distance_from_center_right_y = 0; CFG_cf_theme[i].cover_distance_from_center_right_z = 0; CFG_cf_theme[i].cover_distance_between_covers_right_x = 10; CFG_cf_theme[i].cover_distance_between_covers_right_y = 0; CFG_cf_theme[i].cover_distance_between_covers_right_z = 0; CFG_cf_theme[i].cover_right_xpos = 0; CFG_cf_theme[i].cover_right_ypos = 0; CFG_cf_theme[i].cover_right_zpos = -93; CFG_cf_theme[i].cover_right_xrot = 0; CFG_cf_theme[i].cover_right_yrot = -70; CFG_cf_theme[i].cover_right_zrot = 0; // coverflow 2D i++; CFG_cf_theme[i].rotation_frames = 40; CFG_cf_theme[i].rotation_frames_fast = 7; CFG_cf_theme[i].cam_pos_x = 0.0; CFG_cf_theme[i].cam_pos_y = 0.0; CFG_cf_theme[i].cam_pos_z = 0.0; CFG_cf_theme[i].cam_look_x = 0.0; CFG_cf_theme[i].cam_look_y = 0.0; CFG_cf_theme[i].cam_look_z = -1.0; if (CFG.widescreen) CFG_cf_theme[i].number_of_side_covers = 4; else CFG_cf_theme[i].number_of_side_covers = 3; CFG_cf_theme[i].reflections_color_bottom = 0x666666FF; CFG_cf_theme[i].reflections_color_top = 0xAAAAAA33; CFG_cf_theme[i].alpha_rolloff = 0; CFG_cf_theme[i].floating_cover = false; CFG_cf_theme[i].title_text_xpos = -1; CFG_cf_theme[i].title_text_ypos = 434; CFG_cf_theme[i].cover_rolloff_x = 0; CFG_cf_theme[i].cover_rolloff_y = 0; CFG_cf_theme[i].cover_rolloff_z = 0; CFG_cf_theme[i].cover_center_xpos = 0; CFG_cf_theme[i].cover_center_ypos = 0; CFG_cf_theme[i].cover_center_zpos = -70; CFG_cf_theme[i].cover_center_xrot = 0; CFG_cf_theme[i].cover_center_yrot = 0; CFG_cf_theme[i].cover_center_zrot = 0; CFG_cf_theme[i].cover_center_reflection_used = true; CFG_cf_theme[i].cover_distance_from_center_left_x = -36; CFG_cf_theme[i].cover_distance_from_center_left_y = 0; CFG_cf_theme[i].cover_distance_from_center_left_z = 0; CFG_cf_theme[i].cover_distance_between_covers_left_x = -22; CFG_cf_theme[i].cover_distance_between_covers_left_y = 0; CFG_cf_theme[i].cover_distance_between_covers_left_z = 0; CFG_cf_theme[i].cover_left_xpos = 0; CFG_cf_theme[i].cover_left_ypos = 0; CFG_cf_theme[i].cover_left_zpos = -167; CFG_cf_theme[i].cover_left_xrot = 0; CFG_cf_theme[i].cover_left_yrot = 0; CFG_cf_theme[i].cover_left_zrot = 0; CFG_cf_theme[i].cover_distance_from_center_right_x = 36; CFG_cf_theme[i].cover_distance_from_center_right_y = 0; CFG_cf_theme[i].cover_distance_from_center_right_z = 0; CFG_cf_theme[i].cover_distance_between_covers_right_x = 22; CFG_cf_theme[i].cover_distance_between_covers_right_y = 0; CFG_cf_theme[i].cover_distance_between_covers_right_z = 0; CFG_cf_theme[i].cover_right_xpos = 0; CFG_cf_theme[i].cover_right_ypos = 0; CFG_cf_theme[i].cover_right_zpos = -167; CFG_cf_theme[i].cover_right_xrot = 0; CFG_cf_theme[i].cover_right_yrot = 0; CFG_cf_theme[i].cover_right_zrot = 0; // frontrow i++; CFG_cf_theme[i].rotation_frames = 40; CFG_cf_theme[i].rotation_frames_fast = 7; CFG_cf_theme[i].cam_pos_x = 0.0; CFG_cf_theme[i].cam_pos_y = 0.0; CFG_cf_theme[i].cam_pos_z = 0.0; CFG_cf_theme[i].cam_look_x = 0.0; CFG_cf_theme[i].cam_look_y = 0.0; CFG_cf_theme[i].cam_look_z = -1.0; CFG_cf_theme[i].number_of_side_covers = 4; CFG_cf_theme[i].reflections_color_bottom = 0x666666FF; CFG_cf_theme[i].reflections_color_top = 0xAAAAAA33; CFG_cf_theme[i].alpha_rolloff = 0; CFG_cf_theme[i].floating_cover = false; CFG_cf_theme[i].title_text_xpos = -1; CFG_cf_theme[i].title_text_ypos = 434; CFG_cf_theme[i].cover_rolloff_x = 0; CFG_cf_theme[i].cover_rolloff_y = 0; CFG_cf_theme[i].cover_rolloff_z = 0; CFG_cf_theme[i].cover_center_xpos = 0; CFG_cf_theme[i].cover_center_ypos = 0; CFG_cf_theme[i].cover_center_zpos = -70; CFG_cf_theme[i].cover_center_xrot = 0; CFG_cf_theme[i].cover_center_yrot = 0; CFG_cf_theme[i].cover_center_zrot = 0; CFG_cf_theme[i].cover_center_reflection_used = true; CFG_cf_theme[i].cover_distance_from_center_left_x = -27; CFG_cf_theme[i].cover_distance_from_center_left_y = 0; CFG_cf_theme[i].cover_distance_from_center_left_z = 47; CFG_cf_theme[i].cover_distance_between_covers_left_x = -35; CFG_cf_theme[i].cover_distance_between_covers_left_y = 0; CFG_cf_theme[i].cover_distance_between_covers_left_z = 80; CFG_cf_theme[i].cover_left_xpos = 0; CFG_cf_theme[i].cover_left_ypos = 0; CFG_cf_theme[i].cover_left_zpos = -87; CFG_cf_theme[i].cover_left_xrot = 0; CFG_cf_theme[i].cover_left_yrot = 0; CFG_cf_theme[i].cover_left_zrot = 0; if (CFG.widescreen) { CFG_cf_theme[i].cover_distance_from_center_right_x = 37; CFG_cf_theme[i].cover_distance_from_center_right_y = 0; CFG_cf_theme[i].cover_distance_from_center_right_z = -30; CFG_cf_theme[i].cover_distance_between_covers_right_x = 45; CFG_cf_theme[i].cover_distance_between_covers_right_y = 0; CFG_cf_theme[i].cover_distance_between_covers_right_z = -50; } else { CFG_cf_theme[i].cover_distance_from_center_right_x = 34; CFG_cf_theme[i].cover_distance_from_center_right_y = 0; CFG_cf_theme[i].cover_distance_from_center_right_z = -37; CFG_cf_theme[i].cover_distance_between_covers_right_x = 50; CFG_cf_theme[i].cover_distance_between_covers_right_y = 0; CFG_cf_theme[i].cover_distance_between_covers_right_z = -80; } CFG_cf_theme[i].cover_right_xpos = 0; CFG_cf_theme[i].cover_right_ypos = 0; CFG_cf_theme[i].cover_right_zpos = -87; CFG_cf_theme[i].cover_right_xrot = 0; CFG_cf_theme[i].cover_right_yrot = 0; CFG_cf_theme[i].cover_right_zrot = 0; // vertical i++; CFG_cf_theme[i].rotation_frames = 40; CFG_cf_theme[i].rotation_frames_fast = 7; CFG_cf_theme[i].cam_pos_x = 0.0; CFG_cf_theme[i].cam_pos_y = 0.0; CFG_cf_theme[i].cam_pos_z = 0.0; CFG_cf_theme[i].cam_look_x = 0.0; CFG_cf_theme[i].cam_look_y = 0.0; CFG_cf_theme[i].cam_look_z = -1.0; CFG_cf_theme[i].number_of_side_covers = 4; CFG_cf_theme[i].reflections_color_bottom = 0xFFFFFF00; CFG_cf_theme[i].reflections_color_top = 0xFFFFFF00; CFG_cf_theme[i].alpha_rolloff = 0; CFG_cf_theme[i].floating_cover = true; CFG_cf_theme[i].title_text_xpos = -1; CFG_cf_theme[i].title_text_ypos = 434; CFG_cf_theme[i].cover_rolloff_x = 0; CFG_cf_theme[i].cover_rolloff_y = 0; CFG_cf_theme[i].cover_rolloff_z = 0; CFG_cf_theme[i].cover_center_xpos = 8; CFG_cf_theme[i].cover_center_ypos = 0; CFG_cf_theme[i].cover_center_zpos = -85; CFG_cf_theme[i].cover_center_xrot = 0; CFG_cf_theme[i].cover_center_yrot = 0; CFG_cf_theme[i].cover_center_zrot = 0; CFG_cf_theme[i].cover_center_reflection_used = false; CFG_cf_theme[i].cover_distance_from_center_left_x = 0; CFG_cf_theme[i].cover_distance_from_center_left_y = -25; CFG_cf_theme[i].cover_distance_from_center_left_z = 0; CFG_cf_theme[i].cover_distance_between_covers_left_x = -25; CFG_cf_theme[i].cover_distance_between_covers_left_y = -5; CFG_cf_theme[i].cover_distance_between_covers_left_z = 0; CFG_cf_theme[i].cover_left_xpos = -15; CFG_cf_theme[i].cover_left_ypos = 0; CFG_cf_theme[i].cover_left_zpos = -130; CFG_cf_theme[i].cover_left_xrot = 0; CFG_cf_theme[i].cover_left_yrot = 0; CFG_cf_theme[i].cover_left_zrot = 0; CFG_cf_theme[i].cover_distance_from_center_right_x = 0; CFG_cf_theme[i].cover_distance_from_center_right_y = 25; CFG_cf_theme[i].cover_distance_from_center_right_z = 0; CFG_cf_theme[i].cover_distance_between_covers_right_x = -25; CFG_cf_theme[i].cover_distance_between_covers_right_y = 5; CFG_cf_theme[i].cover_distance_between_covers_right_z = 0; CFG_cf_theme[i].cover_right_xpos = -15; CFG_cf_theme[i].cover_right_ypos = 0; CFG_cf_theme[i].cover_right_zpos = -130; CFG_cf_theme[i].cover_right_xrot = 0; CFG_cf_theme[i].cover_right_yrot = 0; CFG_cf_theme[i].cover_right_zrot = 0; // carousel i++; CFG_cf_theme[i].rotation_frames = 40; CFG_cf_theme[i].rotation_frames_fast = 7; CFG_cf_theme[i].cam_pos_x = 0.0; CFG_cf_theme[i].cam_pos_y = 0.0; CFG_cf_theme[i].cam_pos_z = 0.0; CFG_cf_theme[i].cam_look_x = 0.0; CFG_cf_theme[i].cam_look_y = 0.0; CFG_cf_theme[i].cam_look_z = -1.0; CFG_cf_theme[i].number_of_side_covers = 4; CFG_cf_theme[i].reflections_color_bottom = 0x666666FF; CFG_cf_theme[i].reflections_color_top = 0xAAAAAA33; CFG_cf_theme[i].alpha_rolloff = 0; CFG_cf_theme[i].floating_cover = false; CFG_cf_theme[i].title_text_xpos = -1; CFG_cf_theme[i].title_text_ypos = 434; CFG_cf_theme[i].cover_rolloff_x = 0; CFG_cf_theme[i].cover_rolloff_y = 17; CFG_cf_theme[i].cover_rolloff_z = 0; CFG_cf_theme[i].cover_center_xpos = 0; CFG_cf_theme[i].cover_center_ypos = 0; CFG_cf_theme[i].cover_center_zpos = -122; CFG_cf_theme[i].cover_center_xrot = 0; CFG_cf_theme[i].cover_center_yrot = 0; CFG_cf_theme[i].cover_center_zrot = 0; CFG_cf_theme[i].cover_center_reflection_used = true; CFG_cf_theme[i].cover_distance_from_center_left_x = -22; CFG_cf_theme[i].cover_distance_from_center_left_y = 0; CFG_cf_theme[i].cover_distance_from_center_left_z = 0; CFG_cf_theme[i].cover_distance_between_covers_left_x = -22; CFG_cf_theme[i].cover_distance_between_covers_left_y = 0; CFG_cf_theme[i].cover_distance_between_covers_left_z = 0; CFG_cf_theme[i].cover_left_xpos = 0; CFG_cf_theme[i].cover_left_ypos = 0; CFG_cf_theme[i].cover_left_zpos = -120; CFG_cf_theme[i].cover_left_xrot = 0; CFG_cf_theme[i].cover_left_yrot = 12; CFG_cf_theme[i].cover_left_zrot = 0; CFG_cf_theme[i].cover_distance_from_center_right_x = 22; CFG_cf_theme[i].cover_distance_from_center_right_y = 0; CFG_cf_theme[i].cover_distance_from_center_right_z = 0; CFG_cf_theme[i].cover_distance_between_covers_right_x = 22; CFG_cf_theme[i].cover_distance_between_covers_right_y = 0; CFG_cf_theme[i].cover_distance_between_covers_right_z = 0; CFG_cf_theme[i].cover_right_xpos = 0; CFG_cf_theme[i].cover_right_ypos = 0; CFG_cf_theme[i].cover_right_zpos = -120; CFG_cf_theme[i].cover_right_xrot = 0; CFG_cf_theme[i].cover_right_yrot = -12; CFG_cf_theme[i].cover_right_zrot = 0; /* // Bookshelf i++; CFG_cf_theme[i].rotation_frames = 17; CFG_cf_theme[i].rotation_frames_fast = 6; CFG_cf_theme[i].cam_pos_x = 0.0; CFG_cf_theme[i].cam_pos_y = 0.0; CFG_cf_theme[i].cam_pos_z = 0.0; CFG_cf_theme[i].cam_look_x = 0.0; CFG_cf_theme[i].cam_look_y = 0.0; CFG_cf_theme[i].cam_look_z = -1.0; if (CFG.widescreen) CFG_cf_theme[i].number_of_side_covers = 5; else CFG_cf_theme[i].number_of_side_covers = 5; CFG_cf_theme[i].reflections_color_bottom = 0x666666FF; CFG_cf_theme[i].reflections_color_top = 0xAAAAAA33; CFG_cf_theme[i].alpha_rolloff = 0; CFG_cf_theme[i].floating_cover = false; CFG_cf_theme[i].title_text_xpos = -1; CFG_cf_theme[i].title_text_ypos = 434; CFG_cf_theme[i].cover_rolloff_x = 0; CFG_cf_theme[i].cover_rolloff_y = 0; CFG_cf_theme[i].cover_rolloff_z = 0; CFG_cf_theme[i].cover_center_xpos = 1; CFG_cf_theme[i].cover_center_ypos = 0; CFG_cf_theme[i].cover_center_zpos = -75; CFG_cf_theme[i].cover_center_xrot = 0; CFG_cf_theme[i].cover_center_yrot = 0; CFG_cf_theme[i].cover_center_zrot = 0; CFG_cf_theme[i].cover_center_reflection_used = true; CFG_cf_theme[i].cover_distance_from_center_left_x = -13; CFG_cf_theme[i].cover_distance_from_center_left_y = 0; CFG_cf_theme[i].cover_distance_from_center_left_z = 0; CFG_cf_theme[i].cover_distance_between_covers_left_x = -2; CFG_cf_theme[i].cover_distance_between_covers_left_y = 0; CFG_cf_theme[i].cover_distance_between_covers_left_z = 0; CFG_cf_theme[i].cover_left_xpos = 0; CFG_cf_theme[i].cover_left_ypos = 0; CFG_cf_theme[i].cover_left_zpos = -75; CFG_cf_theme[i].cover_left_xrot = 0; CFG_cf_theme[i].cover_left_yrot = 90; CFG_cf_theme[i].cover_left_zrot = 0; CFG_cf_theme[i].cover_distance_from_center_right_x = 13; CFG_cf_theme[i].cover_distance_from_center_right_y = 0; CFG_cf_theme[i].cover_distance_from_center_right_z = 0; CFG_cf_theme[i].cover_distance_between_covers_right_x = 2; CFG_cf_theme[i].cover_distance_between_covers_right_y = 0; CFG_cf_theme[i].cover_distance_between_covers_right_z = 0; CFG_cf_theme[i].cover_right_xpos = 0; CFG_cf_theme[i].cover_right_ypos = 0; CFG_cf_theme[i].cover_right_zpos = -75; CFG_cf_theme[i].cover_right_xrot = 0; CFG_cf_theme[i].cover_right_yrot = 90; CFG_cf_theme[i].cover_right_zrot = 0; */ } // theme controls the looks, not behaviour void CFG_Default_Theme() { CFG_Default_Coverflow_Themes(); *CFG.theme = 0; snprintf(D_S(CFG.background), "%s/%s", USBLOADER_PATH, "background.png"); snprintf(D_S(CFG.w_background), "%s/%s", USBLOADER_PATH, "background_wide.png"); snprintf(D_S(CFG.bg_gui), "%s/%s", USBLOADER_PATH, "bg_gui.png"); STRCOPY(CFG.theme_path, USBLOADER_PATH); *CFG.bg_gui_wide = 0; CFG.covers = 1; CFG.hide_header = 0; CFG.hide_hddinfo = CFG_HIDE_HDDINFO; CFG.hide_footer = 0; CFG.console_transparent = 0; //CFG.buttons = CFG_BTN_OPTIONS_1; strcpy(CFG.cursor, ">>"); strcpy(CFG.cursor_space, " "); strcpy(CFG.menu_plus, "[+] "); strcpy(CFG.menu_plus_s, " "); strcpy(CFG.favorite, "*"); strcpy(CFG.saved, "#"); CFG.gui_text_cfg.color = 0x000000FF; // black CFG.gui_text_cfg.outline = 0xFF; //0; CFG.gui_text_cfg.outline_auto = 1; //0; CFG.gui_text_cfg.shadow = 0; CFG.gui_text_cfg.shadow_auto = 0; CFG.gui_text2_cfg.color = 0xFFFFFFFF; // white CFG.gui_text2_cfg.outline = 0xFF; CFG.gui_text2_cfg.outline_auto = 1; CFG.gui_text2_cfg.shadow = 0; CFG.gui_text2_cfg.shadow_auto = 0; CFG.gui_tc[GUI_TC_MENU] = wgui_fc; CFG.gui_tc[GUI_TC_TITLE] = CFG.gui_tc[GUI_TC_BUTTON] = CFG.gui_tc[GUI_TC_RADIO] = CFG.gui_tc[GUI_TC_CHECKBOX] = CFG.gui_tc[GUI_TC_MENU]; CFG.gui_tc[GUI_TC_INFO] = text_fc; CFG.gui_tc[GUI_TC_ABOUT] = about_fc; CFG.gui_window_color[GUI_COLOR_BASE] = 0xFFFFFF80; CFG.gui_window_color[GUI_COLOR_POPUP] = 0xFFFFFFB0; memset(CFG.gui_button, 0, sizeof(CFG.gui_button)); CFG.gui_bar = 1; CFG.gui_title_top = 0; //set cover and console postition defaults CFG.layout = CFG_LAYOUT_LARGE_3; cfg_layout(); //set cover height and width cfg_set_cover_style(CFG_COVER_STYLE_2D); set_colors(CFG_COLORS_DARK); //set theme preview image size and pos CFG.theme_previewX = -1; CFG.theme_previewY = -1; CFG.theme_previewW = 0; CFG.theme_previewH = 0; CFG.w_theme_previewX = -1; CFG.w_theme_previewY = -1; CFG.w_theme_previewW = 0; CFG.w_theme_previewH = 0; //set up button mappings CFG.button_A = CFG_BTN_BOOT_GAME; CFG.button_B = CFG_BTN_GUI; CFG.button_1 = CFG_BTN_OPTIONS; CFG.button_2 = CFG_BTN_FAVORITES; CFG.button_H = CFG_BTN_REBOOT; CFG.button_P = CFG_BTN_INSTALL; CFG.button_M = CFG_BTN_MAIN_MENU; CFG.button_X = CFG_BTN_2; CFG.button_Y = CFG_BTN_1; CFG.button_Z = CFG_BTN_B; CFG.button_C = CFG_BTN_A; CFG.button_L = CFG_BTN_M; CFG.button_R = CFG_BTN_P; CFG.home = CFG_HOME_REBOOT; CFG.button_gui = NUM_BUTTON_B; CFG.button_opt = NUM_BUTTON_1; CFG.button_fav = NUM_BUTTON_2; CFG.button_confirm.mask = WPAD_BUTTON_A; CFG.button_confirm.num = NUM_BUTTON_A; CFG.button_cancel.mask = WPAD_BUTTON_B; CFG.button_cancel.num = NUM_BUTTON_B; CFG.button_exit.mask = WPAD_BUTTON_HOME; CFG.button_exit.num = NUM_BUTTON_HOME; CFG.button_other.mask = WPAD_BUTTON_1; CFG.button_other.num = NUM_BUTTON_1; CFG.button_save.mask = WPAD_BUTTON_2; CFG.button_save.num = NUM_BUTTON_2; memset(&CFG.gui_cover_area, 0, sizeof(CFG.gui_cover_area)); memset(&CFG.gui_title_area, 0, sizeof(CFG.gui_title_area)); CFG.gui_clock_pos.x = -1; CFG.gui_page_pos.x = -1; } void CFG_default_path() { snprintf(D_S(CFG.covers_path), "%s/%s", USBLOADER_PATH, "covers"); cfg_set_covers_path(); CFG_Default_Theme(); snprintf(D_S(CFG.bg_gui_wide), "%s/%s", USBLOADER_PATH, "bg_gui_wide.png"); } void CFG_Default() { int i; memset(&CFG, 0, sizeof(CFG)); // set coverflow defaults CFG_Default_Coverflow(); CFG_default_path(); cfg_default_url(); //STRCOPY(CFG.gui_font, "font.png"); STRCOPY(CFG.gui_font, "font_uni.png"); //CFG.home = CFG_HOME_REBOOT; #ifdef BUILD_DBG CFG.debug = BUILD_DBG; CFG.home = CFG_HOME_SCRSHOT; #else CFG.debug = 0; CFG.home = CFG_HOME_REBOOT; #endif CFG.device = CFG_DEV_ASK; STRCOPY(CFG.partition, CFG_DEFAULT_PARTITION); CFG.confirm_start = 1; CFG.install_partitions = CFG_INSTALL_GAME; //CFG_INSTALL_ALL; CFG.disable_format = 0; CFG.disable_remove = 0; CFG.disable_install = 0; CFG.disable_options = 0; CFG.music = 1; CFG.widescreen = CFG_WIDE_AUTO; CFG.gui = CFG_GUI_START_WGUI; CFG.gui_menu = 1; CFG.gui_start = 1; CFG.gui_rows = 2; CFG.admin_lock = 1; CFG.admin_mode_locked = 1; STRCOPY(CFG.unlock_password, CFG_UNLOCK_PASSWORD); CFG.gui_antialias = 4; CFG.gui_compress_covers = 1; CFG.gui_pointer_scroll = 1; // default game settings CFG.game.video = CFG_VIDEO_AUTO; CFG.game.hooktype = 1; // VBI CFG.game.wide_screen = 0; // WIDE IS OFF CFG.game.ntsc_j_patch = 0; CFG.game.channel_boot = 0; CFG.game.nodisc = 0; CFG.game.screenshot = 0; CFG.game.block_ios_reload = 2; // 2=auto CFG.game.alt_controller_cfg = 0; CFG.game.rem_speed_limit = 0; CFG.game.private_server = 0; //off cfg_ios_set_idx(DEFAULT_IOS_IDX); // all other game settings are 0 (memset(0) above) STRCOPY(CFG.sort_ignore, "A,An,The"); CFG.clock_style = 24; // profiles CFG.num_profiles = 1; //CFG.current_profile = 0; STRCOPY(CFG.profile_names[0], "default"); for (i = 0; i < MAX_PROFILES; i++) CFG.profile_filter[i] = -1; STRCOPY(CFG.titles_url, "http://www.gametdb.com/titles.txt?LANG={DBL}"); CFG.intro = 4; CFG.fat_install_dir = 1; CFG.fat_split_size = 4; CFG.db_show_info = 1; //CFG.db_ignore_titles = 0; //CFG.write_playlog = 0; CFG.write_playstats = 1; STRCOPY(CFG.db_url, "http://www.gametdb.com/wiitdb.zip?LANG={DBL}&FALLBACK=true&GAMECUBE=true&WIIWARE=true"); STRCOPY(CFG.db_language, auto_cc()); STRCOPY(CFG.translation, getLang(CONF_GetLanguage())); STRCOPY(CFG.sort, "title-asc"); CFG.delay_patch = 1; CFG.theme_previews = 1; // dvd slot check is handled properly now by all cios // so the patch is disabled by default CFG.disable_dvd_patch = 1; //CFG.dml = CFG_DM_2_2; STRCOPY(CFG.nand_emu_path, "usb:/nand"); STRCOPY(CFG.wbfs_fat_dir, "/wbfs"); CFG.game.nand_emu = 0; //private server STRCOPY(CFG.custom_private_server, "wiimmfi.de"); CFG.nin_cfg_mode = 0; CFG.nin_upd_plugin = 0; } bool map_auto_token(char *name, char *name2, char *val, struct TextMap *map, struct MenuButton *var) { int single, all; char *next; char buf[12]; if (strcmp(name, name2) != 0) return 0; next = val; all = 0; while ((next = split_tokens(buf, next, ",", 12))) { int res; buf[1]=0; res = map_auto_i(name, name2, buf, map, &single); if (res >= 0 && !all) var->num = single; if (res >= 0) all |= buttonmap[MASTER][single]; } if (all) { var->mask = all; return 1; } else return 0; } bool cfg_map_auto_token(char *name, struct TextMap *map, struct MenuButton *var) { return map_auto_token(name, cfg_name, cfg_val, map, var); } u32 hash_id4(void *cb, void *id) { // id4 is usually unique, except for customs return hash_string_n(id, 4); } u32 hash_id6(void *cb, void *id) { return hash_string_n(id, 6); } bool title_cmp_id6(void *cb, void *key, int i) { if (i < 0 || i >= num_title) return false; return strncmp((char*)cfg_title[i].id, (char*)key, 6) == 0; } bool title_cmp_id4(void *cb, void *key, int i) { if (i < 0 || i >= num_title) return false; return strncmp((char*)cfg_title[i].id, (char*)key, 4) == 0; } int* title_get_hnext(void *cb, int i) { if (i < 0 || i >= num_title) return NULL; return &cfg_title[i].hnext; } struct ID_Title* cfg_get_id_title(u8 *id) { // check ID6 first int i = hash_get(&title_hash_id6, id); if (i < 0) { // if not found try ID4 i = hash_get(&title_hash_id4, id); } if (i >= 0 && i < num_title) return &cfg_title[i]; return NULL; } char *cfg_get_title(u8 *id) { // titles.txt struct ID_Title *idt = cfg_get_id_title(id); if (idt) return idt->title; // wiitdb if (!CFG.db_ignore_titles) { gameXMLinfo *g = get_game_info_id(id); if (!g) return NULL; if (g->title[0] != 0) return g->title; } return NULL; } char *get_title(struct discHdr *header) { // titles.txt or wiitdb char *title; if ((memcmp("G",(char*)header->id,1)==0) && (strlen((char*)header->id)>6)) title = header->title; else title = cfg_get_title(header->id); if (title) return title; // disc header return header->title; } void title_set(char *id, char *title) { struct ID_Title *idt = cfg_get_id_title((u8*)id); if (idt && strncmp(id, (char*)idt->id, 6) == 0) { // replace mbs_copy(idt->title, title, TITLE_MAX); } else { cfg_title = mem1_realloc(cfg_title, (num_title+1) * sizeof(struct ID_Title)); if (!cfg_title) { // error num_title = 0; return; } // add memset(&cfg_title[num_title], 0, sizeof(cfg_title[num_title])); strcopy((char*)cfg_title[num_title].id, id, 7); mbs_copy(cfg_title[num_title].title, title, TITLE_MAX); num_title++; // update hash if (id[3] == 0 || id[4] == 0) { // id3 or id4 hash_check_init(&title_hash_id4, 0, NULL, &hash_id4, &title_cmp_id4, &title_get_hnext); hash_add(&title_hash_id4, id, num_title - 1); } else { // id6 hash_check_init(&title_hash_id6, 0, NULL, &hash_id6, &title_cmp_id6, &title_get_hnext); hash_add(&title_hash_id6, id, num_title - 1); } } } #define COPY_PATH(D,S) copy_path(D,S,sizeof(D)) void copy_path(char *dest, char *val, int size) { if (strchr(val, ':')) { // absolute path with drive (sd:/images/...) strcopy(dest, val, size); } else if (val[0] == '/') { // absolute path without drive (/images/...) snprintf(dest, size, "%s%s", FAT_DRIVE, val); } else { snprintf(dest, size, "%s/%s", USBLOADER_PATH, val); } } bool copy_theme_path(char *dest, char *val, int size) { // check if it's an absolute path (contains : as in sd:/...) if (strchr(val, ':')) { // absolute path with drive (sd:/images/...) strcopy(dest, val, size); return true; } else if (val[0] == '/') { // absolute path without drive (/images/...) snprintf(dest, size, "%s%s", FAT_DRIVE, val); return true; } else if (*theme_path) { struct stat st; snprintf(dest, size, "%s/%s", theme_path, val); if (stat(dest, &st) == 0) return true; } snprintf(dest, size, "%s/%s", USBLOADER_PATH, val); return false; } int find_in_hdr_list(char *id, struct discHdr *list, int num) { int i; for (i=0; i= maxn) return false; // add memset(list[*num], 0, sizeof(list[0])); memcpy(list[*num], id, 4); *num += 1; return true; } bool is_in_game_list(u8 *id, char list[][8], int num) { int i = find_in_game_list(id, list, num); return (i >= 0); } bool is_in_hide_list(struct discHdr *game) { return is_in_game_list(game->id, CFG.hide_game, CFG.num_hide_game); } void cfg_id_list(char *name, char list[][8], int *num_list, int max_list) { int i; if (strcmp(name, cfg_name)==0) { char id[8], *next = cfg_val; while (next) { *id = 0; next = split_token(id, next, ',', sizeof(id)); if (strcmp(id, "0")==0) { // reset list *num_list = 0; } if (strlen(id) == 4) { if (*num_list >= max_list) continue; // add id to hide list. i = find_in_game_list((u8*)id, list, *num_list); if (i < 0) { strcopy(list[*num_list], id, 8); (*num_list)++; } } } } } bool cfg_color(char *name, u32 *var) { if (cfg_map(name, "black", (int*)var, 0x000000FF)) return true; if (cfg_map(name, "white", (int*)var, 0xFFFFFFFF)) return true; if (cfg_int_hex(name, (int*)var)) return true; return false; } // text color void font_color_cfg_set(char *base_name, struct FontColor_CFG *fc) { if (strncmp(cfg_name, base_name, strlen(base_name)) != 0) return; char name[100]; char *old_name; STRCOPY(name, cfg_name); str_replace(name, base_name, "gui_text_", sizeof(name)); old_name = cfg_name; cfg_name = name; cfg_color("gui_text_color", &fc->color); if (cfg_color("gui_text_outline", &fc->outline)) { if (strlen(cfg_val) == 2) fc->outline_auto = 1; else fc->outline_auto = 0; } if (cfg_color("gui_text_shadow", &fc->shadow)) { if (strlen(cfg_val) == 2) fc->shadow_auto = 1; else fc->shadow_auto = 0; } cfg_name = old_name; } bool font_color_set(char *name, struct FontColor *fc) { if (strcmp(name, cfg_name)) return false; char color_val[16]; char *old_val = cfg_val; char *next = cfg_val; u32 *c = &fc->color; int i = 0; memset(fc, 0, sizeof(*fc)); while ((next = split_tokens(color_val, next, "/", sizeof(color_val)))) { cfg_val = color_val; if (!cfg_color(name, c+i)) break; i++; if (i >= 3) break; } cfg_val = old_val; return true; } int get_outline_color(int text_color, int outline_color, int outline_auto) { unsigned color, alpha; if (!outline_color) return 0; if (outline_auto) { // only alpha specified int avg; avg = ( ((text_color>>8) & 0xFF) + ((text_color>>16) & 0xFF) + ((text_color>>24) & 0xFF) ) / 3; if (avg > 0x80) { color = 0x00000000; } else { color = 0xFFFFFF00; } } else { // full color specified color = outline_color; } // apply text alpha to outline alpha alpha = (outline_color & 0xFF) * (text_color & 0xFF) / 0xFF; color = (color & 0xFFFFFF00) | alpha; return color; } void expand_font_color_cfg(FontColor *fc, FontColor_CFG *fcc) { fc->color = fcc->color; fc->outline = get_outline_color( fcc->color, fcc->outline, fcc->outline_auto); fc->shadow = get_outline_color( fcc->color, fcc->shadow, fcc->shadow_auto); } int cfg_pos_xy(char *name, struct PosCoords *pos) { if (strcmp(name, cfg_name)) return 0; int i, x, y; pos->x = -1; pos->y = -1; i = sscanf(cfg_val, "%d,%d", &x, &y); if (i == 2) { // check for valid range if (x >= 0 && y >= 0 && x < 640 && y < 480) { pos->x = x; pos->y = y; return 1; } } return -1; } int cfg_pos_area(char *name, struct RectCoords *pos, int min_w, int min_h) { if (strcmp(name, cfg_name)) return 0; int i, x, y, w, h; memset(pos, 0, sizeof(*pos)); i = sscanf(cfg_val, "%d,%d,%d,%d", &x, &y, &w, &h); if (i == 4) { // check for valid range // min w * h : 480 * 320 if (x >= 0 && y >= 0 && w >= min_w && h >= min_h && x+w <= 640 && y+h <= 480) { pos->x = x; pos->y = y; pos->w = w / 2 * 2; pos->h = h / 2 * 2; return 1; } } return -1; } char *custom_button_name(int i); char *strtolower(char *s) { char *ss = s; int c; while (*ss) { c = (unsigned char)*ss; *ss = tolower(c); ss++; } return s; } // n starts at 0 char* get_token_n(char *dest, int size, char *src, char *delim, int n) { int i; char *next = src; *dest = 0; for (i=0; i<=n; i++) { next = split_tokens(dest, next, delim, size); if (!next) break; } //dbg_printf("==== tok %d : %s.\n", n, dest); return next; } bool cfg_gui_button(int i) { int ret; char token[64]; char *save_val = cfg_val; struct CfgButton *bb = &CFG.gui_button[i]; memset(bb, 0, sizeof(*bb)); ret = cfg_pos_area(cfg_name, &bb->pos, 4, 4); if (ret <= 0) return false; bb->enabled = 1; // defaults: CFG.gui_tc[GUI_TC_CBUTTON + i] = wgui_fc; bb->hover_zoom = 10; if (get_token_n(token, sizeof(token), cfg_val, ",", 4)) { cfg_val = token; font_color_set(cfg_name, &CFG.gui_tc[GUI_TC_CBUTTON + i]); cfg_val = save_val; } if (get_token_n(token, sizeof(token), cfg_val, ",", 5)) { STRCOPY(bb->image, token); } if (get_token_n(token, sizeof(token), cfg_val, ",", 6)) { cfg_val = token; cfg_map(cfg_name, "button", &bb->type, 0); cfg_map(cfg_name, "icon", &bb->type, 1); cfg_val = save_val; } if (get_token_n(token, sizeof(token), cfg_val, ",", 7)) { cfg_val = token; cfg_int_max(cfg_name, &bb->hover_zoom, 50); cfg_val = save_val; } return true; } bool cfg_gui_custom_buttons() { int i; // gui_button_main // gui_button_quit ... char *opt = "gui_button_"; int len = strlen(opt); char *name = cfg_name + len; char bname[32]; if (strncmp(cfg_name, opt, len) == 0) { for (i=0; i 0) { if (i == 1) bot = top; for (i=0; i CFG_IOS_MAX) return false; if (i != id) return false; // safety check for correct defines *idx = i; return true; } void cfg_ios(char *name, char *val) { int i; if (!cfg_ios_idx(name, val, &i)) return; cfg_ios_set_idx(i); /* int ios; if (sscanf(val, "%d", &ios) != 1) return; CFG.game.ios_idx = i; CFG.ios = ios; CFG.ios_yal = 0; CFG.ios_mload = 0; if (strstr(val, "-yal")) { CFG.ios_yal = 1; } if (strstr(val, "-mload")) { CFG.ios_yal = 1; CFG.ios_mload = 1; } */ } bool is_ios_idx_mload(int ios_idx) { switch (ios_idx) { case CFG_IOS_222_MLOAD: case CFG_IOS_223_MLOAD: case CFG_IOS_224_MLOAD: return true; } return false; } int get_ios_idx_type(int ios_idx) { switch (ios_idx) { case CFG_IOS_245: case CFG_IOS_246: case CFG_IOS_247: case CFG_IOS_248: case CFG_IOS_249: case CFG_IOS_250: case CFG_IOS_251: case CFG_IOS_252: return IOS_TYPE_WANIN; case CFG_IOS_222_MLOAD: case CFG_IOS_223_MLOAD: case CFG_IOS_224_MLOAD: return IOS_TYPE_HERMES; case CFG_IOS_222_YAL: case CFG_IOS_223_YAL: return IOS_TYPE_KWIIRK; } return IOS_TYPE_UNK; } void cfg_set_game(char *name, char *val, struct Game_CFG *game_cfg) { cfg_name = name; cfg_val = val; cfg_map_auto("language", map_language, &game_cfg->language); cfg_map_auto("video", map_video, &game_cfg->video); if (strcmp("video", name) == 0 && strcmp("vidtv", val) == 0) { game_cfg->video = CFG_VIDEO_AUTO; game_cfg->vidtv = 1; } if (strcmp("video", name) == 0 && strcmp("patch", val) == 0) { game_cfg->video = CFG_VIDEO_AUTO; game_cfg->video_patch = 1; } cfg_map_auto("video_patch", map_video_patch, &game_cfg->video_patch); cfg_map_auto("nand_emu", map_nand_emu, &game_cfg->nand_emu); cfg_map_auto("channel_boot", map_boot_method, &game_cfg->channel_boot); cfg_bool("vidtv", &game_cfg->vidtv); cfg_bool("country_patch", &game_cfg->country_patch); cfg_int_max("mem_card_emu", &game_cfg->mem_card_emu, 2); cfg_int_max("mem_card_size", &game_cfg->mem_card_size, 5); cfg_bool("clear_patches", &game_cfg->clean); cfg_map("clear_patches", "all", &game_cfg->clean, CFG_CLEAN_ALL); cfg_bool("fix_002", &game_cfg->fix_002); cfg_bool("wide_screen", &game_cfg->wide_screen); cfg_bool("ntsc_j_patch", &game_cfg->ntsc_j_patch); cfg_bool("nodisc", &game_cfg->nodisc); cfg_bool("screenshot", &game_cfg->screenshot); cfg_ios_idx(name, val, &game_cfg->ios_idx); cfg_bool("block_ios_reload", &game_cfg->block_ios_reload); cfg_map("block_ios_reload", "auto", &game_cfg->block_ios_reload, 2); cfg_bool("alt_controller_cfg", &game_cfg->alt_controller_cfg); cfg_bool("rem_speed_limit", &game_cfg->rem_speed_limit); if (strcmp("alt_dol", name) == 0) { int set = 0; if (cfg_bool("alt_dol", &game_cfg->alt_dol)) set = 1; if (cfg_map ("alt_dol", "sd", &game_cfg->alt_dol, 1)) set = 1; if (cfg_map ("alt_dol", "disc", &game_cfg->alt_dol, 2)) set = 1; if (cfg_int_max("alt_dol", &game_cfg->alt_dol, 100)) set = 1; if (!set) { // name specified game_cfg->alt_dol = 2; STRCOPY(game_cfg->dol_name, val); } } if (strcmp("dol_name", name) == 0 && *val) { STRCOPY(game_cfg->dol_name, val); } cfg_bool("ocarina", &game_cfg->ocarina); cfg_map_auto("hooktype", map_hook, &game_cfg->hooktype); cfg_int_max("write_playlog", &game_cfg->write_playlog, 3); cfg_int_max("private_server", &game_cfg->private_server, 3); } bool cfg_set_gbl(char *name, char *val) { if (cfg_map("device", "ask", &CFG.device, CFG_DEV_ASK)) return true; if (cfg_map("device", "usb", &CFG.device, CFG_DEV_USB)) return true; if (cfg_map("device", "sdhc", &CFG.device, CFG_DEV_SDHC)) return true; CFG_STR("partition", CFG.partition); if (cfg_map_auto("gui_style", map_gui_style, &CFG.gui_style)) return true; //if (cfg_int_max("dml", &CFG.dml, 6)) return true; cfg_int_max("devo", &CFG.default_gc_loader,2); cfg_bool("old_button_color", &CFG.old_button_color); int rows = 0; if (cfg_int_max("gui_rows", &rows, 4)) { if (rows > 0) { CFG.gui_rows = rows; return true; } } CFG_STR("profile", CFG.current_profile_name); // theme must be last, because it changes cfg_name, cfg_val if (strcmp(name, "theme")==0) { if (*val) { load_theme(val); int i; for (i=0; i 1) CFG.gui_compress_covers = 1; cfg_bool("gui_pointer_scroll", &CFG.gui_pointer_scroll); if (cfg_set_gbl(name, val)) { return; } cfg_set_game(name, val, &CFG.game); if (!CFG.direct_launch) { *CFG.game.dol_name = 0; } // covers path if (strcmp(name, "covers_path")==0) { COPY_PATH(CFG.covers_path, val); cfg_set_covers_path(); } if (strcmp(name, "covers_path_2d")==0) { COPY_PATH(CFG.covers_path_2d, val); CFG.covers_path_2d_set = 1; } if (strcmp(name, "covers_path_3d")==0) { COPY_PATH(CFG.covers_path_3d, val); } if (strcmp(name, "covers_path_disc")==0) { COPY_PATH(CFG.covers_path_disc, val); } if (strcmp(name, "covers_path_full")==0) { COPY_PATH(CFG.covers_path_full, val); } CFG_STR_LIST("gamercard_url", CFG.gamercard_url); CFG_STR_LIST("gamercard_key", CFG.gamercard_key); // urls CFG_STR("titles_url", CFG.titles_url); CFG_STR("nand_emu_path", CFG.nand_emu_path); CFG_STR("wbfs_fat_dir", CFG.wbfs_fat_dir); CFG_STR_LIST("cover_url", CFG.cover_url_2d); CFG_STR_LIST("cover_url_3d", CFG.cover_url_3d); CFG_STR_LIST("cover_url_disc", CFG.cover_url_disc); CFG_STR_LIST("cover_url_full", CFG.cover_url_full); CFG_STR_LIST("cover_url_hq", CFG.cover_url_hq); // download options cfg_bool("download_all_styles", &CFG.download_all); cfg_map("download_id_len", "4", &CFG.download_id_len, 4); cfg_map("download_id_len", "6", &CFG.download_id_len, 6); if (strcmp("download_cc_pal", name) == 0) { if (strcmp(val, "auto") == 0 || strcmp(val, "AUTO") == 0) { *CFG.download_cc_pal = 0; } else if (strlen(val) == 2) { strcpy(CFG.download_cc_pal, val); } } // gui if (cfg_int_max("gui", &CFG.gui, CFG_GUI_START_WGUI) || cfg_map("gui", "start", &CFG.gui, CFG_GUI_START_WGUI)) { if (CFG.gui == CFG_GUI_START || CFG.gui == CFG_GUI_START_WGUI) { CFG.gui_start = 1; } else { CFG.gui_start = 0; } if (CFG.gui > CFG_GUI_START) { CFG.gui_menu = 1; } else { CFG.gui_menu = 0; } } cfg_map("gui_transition", "scroll", &CFG.gui_transit, 0); cfg_map("gui_transition", "fade", &CFG.gui_transit, 1); CFG_STR("gui_font", CFG.gui_font); cfg_bool("gui_lock", &CFG.gui_lock); // simple changes dependant options int simpl; if (cfg_bool("simple", &simpl)) { if (simpl == 1) { CFG.confirm_start = 0; //if (CFG_HIDE_HDDINFO == 0) { // // normal version affects hddinfo // // fat version does not change it. // CFG.hide_hddinfo = 1; //} CFG.hide_footer = 1; CFG.disable_remove = 1; CFG.disable_install = 1; CFG.disable_options = 1; CFG.disable_format = 1; } else { // simple == 0 CFG.confirm_start = 1; //if (CFG_HIDE_HDDINFO == 0) { // // normal version affects hddinfo // // fat version does not change it. // CFG.hide_hddinfo = 0; //} CFG.hide_footer = 0; CFG.disable_remove = 0; CFG.disable_install = 0; CFG.disable_options = 0; CFG.disable_format = 0; } } cfg_map("install_partitions", "only_game", &CFG.install_partitions, CFG_INSTALL_GAME); cfg_map("install_partitions", "all", &CFG.install_partitions, CFG_INSTALL_ALL); cfg_map("install_partitions", "1:1", &CFG.install_partitions, CFG_INSTALL_1_1); cfg_map("install_partitions", "iso", &CFG.install_partitions, CFG_INSTALL_ISO); cfg_int_max("fat_split_size", &CFG.fat_split_size, 4); //cfg_bool("write_playlog", &CFG.write_playlog); cfg_int_max("fat_install_dir", &CFG.fat_install_dir, 3); cfg_int_max("fs_install_layout", &CFG.fat_install_dir, 3); cfg_bool("ntfs_write", &CFG.ntfs_write); cfg_map("ntfs_write", "norecover", &CFG.ntfs_write, 2); cfg_bool("disable_nsmb_patch", &CFG.disable_nsmb_patch); cfg_bool("disable_pop_patch", &CFG.disable_pop_patch); cfg_bool("disable_dvd_patch", &CFG.disable_dvd_patch); cfg_bool("disable_wip", &CFG.disable_wip); cfg_bool("disable_bca", &CFG.disable_bca); //cfg_int_max("dml", &CFG.dml, 6); cfg_int_max("devo", &CFG.default_gc_loader,2); cfg_bool("old_button_color", &CFG.old_button_color); cfg_id_list("hide_game", CFG.hide_game, &CFG.num_hide_game, MAX_HIDE_GAME); cfg_id_list("pref_game", CFG.pref_game, &CFG.num_pref_game, MAX_PREF_GAME); cfg_id_list("favorite_game", CFG.favorite_game, &CFG.num_favorite_game, MAX_FAVORITE_GAME); CFG_STR("sort_ignore", CFG.sort_ignore); cfg_map("clock_style", "0", &CFG.clock_style, 0); cfg_map("clock_style", "24", &CFG.clock_style, 24); cfg_map("clock_style", "12", &CFG.clock_style, 12); cfg_map("clock_style", "12am", &CFG.clock_style, 13); if (strcmp(name, "music")==0) { if (cfg_bool("music", &CFG.music)) { *CFG.music_file = 0; } else { COPY_PATH(CFG.music_file, val); } } cfg_bool("delay_patch", &CFG.delay_patch); if (strncmp(name, "title:", 6)==0) { char id[8]; trimcopy(id, name+6, sizeof(id)); title_set(id, val); } if (strncmp(name, "game:", 5)==0) { game_set(name, val); } if (strcmp(name, "profile_names")==0) { char *next; next = val; CFG.num_profiles = 0; while ((next = split_tokens( CFG.profile_names[CFG.num_profiles], next, ",", sizeof(CFG.profile_names[0])) )) { if (*CFG.profile_names[CFG.num_profiles] == 0) break; CFG.num_profiles++; if (CFG.num_profiles >= MAX_PROFILES) break; } if (CFG.num_profiles == 0) { CFG.num_profiles = 1; STRCOPY(CFG.profile_names[0], "default"); } } if (strcmp(name, "profile_start_favorites")==0) { int i; char token[25]; for (i=0; i= 0) { // alerady on the list if (fav) return true; // remove remove_from_list(i, CFG.favorite_game, &CFG.num_favorite_game); return CFG_Save_Settings(0); } // not on list if (!fav) return true; // add ret = add_to_list(id, CFG.favorite_game, &CFG.num_favorite_game, MAX_FAVORITE_GAME); if (!ret) return ret; return CFG_Save_Settings(0); } int CFG_filter_favorite(struct discHdr *list, int cnt) { int i; int kept_cnt = 0; //printf("f filter %p %d\n", list, cnt); sleep(2); for (i=0; i= 0) { // already in the list if (hide) return true; // remove remove_from_list(i, CFG.hide_game, &CFG.num_hide_game); return CFG_Save_Settings(0); } // not on list if (!hide) return true; // add ret = add_to_list(id, CFG.hide_game, &CFG.num_hide_game, MAX_HIDE_GAME); if (!ret) return ret; return CFG_Save_Settings(0); } void cfg_parsearg(int argc, char **argv) { int i; char pathname[200]; bool is_opt; for (i=1; i= 0 && CFG.saved_device <= 2) { SAVE_OPT("device = %s\n", dev_str[CFG.saved_device]); } SAVE_OPT("partition = %s\n", CFG.saved_partition); char *s = map_get_name(map_gui_style, CFG.saved_gui_style); if (s) { SAVE_OPT("gui_style = %s\n", s); } if (CFG.saved_gui_rows > 0 && CFG.saved_gui_rows <= 4 ) { SAVE_OPT("gui_rows = %d\n", CFG.saved_gui_rows); } //SAVE_OPT("dml = %d\n", CFG.dml); SAVE_OPT("devo = %d\n", CFG.default_gc_loader); SAVE_OPT("old_button_color = %d", CFG.old_button_color); } fprintf(f, "\n# Profiles: %d\n", CFG.num_profiles); int save_prof = CFG.current_profile; for (j=0; j= 0) { fprintf(f, "profile_filter = %s\n", map_get_name(map_filter_type, CFG.profile_filter[j])); switch (CFG.profile_filter[j]) { case FILTER_GENRE: fprintf(f, "profile_filter_genre = %s\n", map_get_name(map_game_genre, CFG.profile_filter_genre[j])); break; case FILTER_FEATURES: fprintf(f, "profile_filter_feature = %s\n", map_get_name(map_game_feature, CFG.profile_filter_feature[j])); break; case FILTER_CONTROLLER: fprintf(f, "profile_filter_controller = %s\n", map_get_name(map_game_controller, CFG.profile_filter_controller[j])); break; case FILTER_GAME_TYPE: fprintf(f, "profile_filter_gametype = %s\n", map_get_name(map_game_type, CFG.profile_filter_gametype[j])); break; case FILTER_SEARCH: fprintf(f, "profile_search_field = %s\n", map_get_name(map_search_field, CFG.profile_search_field[j])); fprintf(f, "profile_search_string = %s\n", CFG.profile_search_string[j]); break; } } } fprintf(f, "# Favorite Games: %d\n", CFG.num_favorite_game); for (i=0; i