4747 MainRebootRCM ,
4848 // MainRebootNormal,
4949 MainRebootHekate ,
50- // MainRebootAMS,
50+ MainRebootAMS ,
5151};
5252
5353MenuEntry_t mainMenuEntries [] = {
@@ -81,7 +81,7 @@ MenuEntry_t mainMenuEntries[] = {
8181 [MainRebootRCM ] = {.optionUnion = COLORTORGB (COLOR_VIOLET ), .name = "Reboot to RCM" },
8282 // [MainRebootNormal] = {.optionUnion = COLORTORGB(COLOR_VIOLET), .name = "Reboot normally"},
8383 [MainRebootHekate ] = {.optionUnion = COLORTORGB (COLOR_VIOLET ), .name = "Reboot to bootloader/update.bin" },
84- // [MainRebootAMS] = {.optionUnion = COLORTORGB(COLOR_VIOLET), .name = "Reboot to atmosphere/reboot_payload.bin"}
84+ [MainRebootAMS ] = {.optionUnion = COLORTORGB (COLOR_VIOLET ), .name = "Reboot to atmosphere/reboot_payload.bin" }
8585};
8686
8787void HandleSD (){
@@ -100,325 +100,6 @@ extern bool sd_mounted;
100100extern bool is_sd_inited ;
101101extern int launch_payload (char * path );
102102
103- ///////////////////////////////////////////////////////////////////////
104-
105- // void _DeleteFileSimple(char *thing){
106- // //char *thing = CombinePaths(path, entry.name);
107- // int res = f_unlink(thing);
108- // if (res)
109- // DrawError(newErrCode(res));
110- // free(thing);
111- // }
112- // void _RenameFileSimple(char *sourcePath, char *destPath){
113- // int res = f_rename(sourcePath, destPath);
114- // if (res){
115- // DrawError(newErrCode(res));
116- // }
117- // }
118-
119- // int _fix_attributes(char *path, u32 *total, u32 hos_folder, u32 check_first_run){
120- // FRESULT res;
121- // DIR dir;
122- // u32 dirLength = 0;
123- // static FILINFO fno;
124-
125- // if (check_first_run)
126- // {
127- // // Read file attributes.
128- // res = f_stat(path, &fno);
129- // if (res != FR_OK)
130- // return res;
131-
132- // // Check if archive bit is set.
133- // if (fno.fattrib & AM_ARC)
134- // {
135- // *(u32 *)total = *(u32 *)total + 1;
136- // f_chmod(path, 0, AM_ARC);
137- // }
138- // }
139-
140- // // Open directory.
141- // res = f_opendir(&dir, path);
142- // if (res != FR_OK)
143- // return res;
144-
145- // dirLength = strlen(path);
146- // for (;;)
147- // {
148- // // Clear file or folder path.
149- // path[dirLength] = 0;
150-
151- // // Read a directory item.
152- // res = f_readdir(&dir, &fno);
153-
154- // // Break on error or end of dir.
155- // if (res != FR_OK || fno.fname[0] == 0)
156- // break;
157-
158- // // Skip official Nintendo dir if started from root.
159- // if (!hos_folder && !strcmp(fno.fname, "Nintendo"))
160- // continue;
161-
162- // // Set new directory or file.
163- // memcpy(&path[dirLength], "/", 1);
164- // memcpy(&path[dirLength + 1], fno.fname, strlen(fno.fname) + 1);
165-
166- // // Check if archive bit is set.
167- // if (fno.fattrib & AM_ARC)
168- // {
169- // *total = *total + 1;
170- // f_chmod(path, 0, AM_ARC);
171- // }
172-
173- // // Is it a directory?
174- // if (fno.fattrib & AM_DIR)
175- // {
176- // // Set archive bit to NCA folders.
177- // if (hos_folder && !strcmp(fno.fname + strlen(fno.fname) - 4, ".nca"))
178- // {
179- // *total = *total + 1;
180- // f_chmod(path, AM_ARC, AM_ARC);
181- // }
182-
183- // // Enter the directory.
184- // res = _fix_attributes(path, total, hos_folder, 0);
185- // if (res != FR_OK)
186- // break;
187- // }
188- // }
189-
190- // f_closedir(&dir);
191-
192- // return res;
193- // }
194-
195-
196- // void m_entry_fixArchiveBit(u32 type){
197- // gfx_clearscreen();
198- // gfx_printf("\n\n-- Fix Archive Bits\n\n");
199-
200- // char path[256];
201- // char label[16];
202-
203- // u32 total = 0;
204- // if (sd_mount())
205- // {
206- // switch (type)
207- // {
208- // case 0:
209- // strcpy(path, "/");
210- // strcpy(label, "SD Card");
211- // break;
212- // case 1:
213- // default:
214- // strcpy(path, "/Nintendo");
215- // strcpy(label, "Nintendo folder");
216- // break;
217- // }
218-
219- // gfx_printf("Traversing all %s files!\nThis may take some time...\n\n", label);
220- // _fix_attributes(path, &total, type, type);
221- // gfx_printf("%kTotal archive bits cleared: %d!%k", 0xFF96FF00, total, 0xFFCCCCCC);
222-
223- // gfx_printf("\n\n Done, press a key to proceed.");
224- // hidWait();
225- // }
226- // }
227-
228-
229- // void m_entry_fixAIOUpdate(){
230- // gfx_clearscreen();
231- // gfx_printf("\n\n-- Fix broken Switch-AiO-Updater update.\n\n");
232-
233- // char *aio_fs_path = CpyStr("sd:/atmosphere/fusee-secondary.bin.aio");
234- // char *aio_p_path = CpyStr("sd:/sept/payload.bin.aio");
235- // char *aio_strt_path = CpyStr("sd:/atmosphere/stratosphere.romfs.aio");
236-
237- // char *o_fs_path = CpyStr("sd:/atmosphere/fusee-secondary.bin");
238- // char *o_p_path = CpyStr("sd:/sept/payload.bin");
239- // char *o_strt_path = CpyStr("sd:/atmosphere/stratosphere.romfs");
240-
241- // if (FileExists(aio_fs_path)) {
242- // gfx_printf("Detected aio updated fusee-secondary file -> replacing original\n\n");
243- // if (FileExists(o_fs_path)) {
244- // _DeleteFileSimple(o_fs_path);
245- // }
246- // _RenameFileSimple(aio_fs_path, o_fs_path);
247- // }
248- // free(aio_fs_path);
249- // free(o_fs_path);
250-
251- // if (FileExists(aio_p_path)) {
252- // gfx_printf("Detected aio updated paload file -> replacing original\n\n");
253- // if (FileExists(o_p_path)) {
254- // _DeleteFileSimple(o_p_path);
255- // }
256- // _RenameFileSimple(aio_p_path, o_p_path);
257- // }
258- // free(aio_p_path);
259- // free(o_p_path);
260-
261- // if (FileExists(aio_strt_path)) {
262- // gfx_printf("Detected aio updated stratosphere file -> replacing original\n\n");
263- // if (FileExists(o_strt_path)) {
264- // _DeleteFileSimple(o_strt_path);
265- // }
266- // _RenameFileSimple(aio_strt_path, o_strt_path);
267- // }
268- // free(aio_strt_path);
269- // free(o_strt_path);
270-
271-
272- // gfx_printf("\n\n Done, press a key to proceed.");
273- // hidWait();
274- // }
275-
276- // void m_entry_fixClingWrap(){
277- // gfx_clearscreen();
278- // gfx_printf("\n\n-- Fixing ClingWrap.\n\n");
279- // char *bpath = CpyStr("sd:/_b0otloader");
280- // char *bopath = CpyStr("sd:/bootloader");
281- // char *kpath = CpyStr("sd:/atmosphere/_k1ps");
282- // char *kopath = CpyStr("sd:/atmosphere/kips");
283-
284- // char *ppath = CpyStr("sd:/bootloader/_patchesCW.ini");
285- // char *popath = CpyStr("sd:/atmosphere/patches.ini");
286-
287- // if (FileExists(bpath)) {
288- // if (FileExists(bopath)) {
289- // FolderDelete(bopath);
290- // }
291- // int res = f_rename(bpath, bopath);
292- // if (res){
293- // DrawError(newErrCode(res));
294- // }
295- // gfx_printf("-- Fixed Bootloader\n");
296- // }
297-
298- // if (FileExists(kpath)) {
299- // if (FileExists(kopath)) {
300- // FolderDelete(kopath);
301- // }
302- // int res = f_rename(kpath, kopath);
303- // if (res){
304- // DrawError(newErrCode(res));
305- // }
306- // gfx_printf("-- Fixed kips\n");
307- // }
308-
309- // if (FileExists(ppath)) {
310- // if (FileExists(popath)) {
311- // _DeleteFileSimple(popath);
312- // }
313- // _RenameFileSimple(ppath,popath);
314- // gfx_printf("-- Fixed patches.ini\n");
315- // }
316-
317- // free(bpath);
318- // free(bopath);
319- // free(kpath);
320- // free(kopath);
321- // free(ppath);
322- // free(popath);
323-
324- // gfx_printf("\n\n Done, press a key to proceed.");
325- // hidWait();
326- // }
327-
328- // void _deleteTheme(char* basePath, char* folderId){
329- // char *path = CombinePaths(basePath, folderId);
330- // if (FileExists(path)) {
331- // gfx_printf("-- Theme found: %s\n", path);
332- // FolderDelete(path);
333- // }
334- // free(path);
335- // }
336-
337- // void m_entry_deleteInstalledThemes(){
338- // gfx_clearscreen();
339- // gfx_printf("\n\n-- Deleting installed themes.\n\n");
340- // _deleteTheme("sd:/atmosphere/contents", "0100000000001000");
341- // _deleteTheme("sd:/atmosphere/contents", "0100000000001007");
342- // _deleteTheme("sd:/atmosphere/contents", "0100000000001013");
343-
344- // gfx_printf("\n\n Done, press a key to proceed.");
345- // hidWait();
346- // }
347-
348- // void m_entry_deleteBootFlags(){
349- // gfx_clearscreen();
350- // gfx_printf("\n\n-- Disabling automatic sysmodule startup.\n\n");
351- // char *storedPath = CpyStr("sd:/atmosphere/contents");
352- // int readRes = 0;
353- // Vector_t fileVec = ReadFolder(storedPath, &readRes);
354- // if (readRes){
355- // clearFileVector(&fileVec);
356- // DrawError(newErrCode(readRes));
357- // } else {
358- // vecDefArray(FSEntry_t*, fsEntries, fileVec);
359- // for (int i = 0; i < fileVec.count; i++){
360-
361- // char *suf = "/flags/boot2.flag";
362- // char *flagPath = CombinePaths(storedPath, fsEntries[i].name);
363- // flagPath = CombinePaths(flagPath, suf);
364-
365- // if (FileExists(flagPath)) {
366- // gfx_printf("Deleting: %s\n", flagPath);
367- // _DeleteFileSimple(flagPath);
368- // }
369- // free(flagPath);
370- // }
371- // }
372- // gfx_printf("\n\n Done, press a key to proceed.");
373- // hidWait();
374- // }
375-
376- // void m_entry_fixMacSpecialFolders(char *path){
377- // // browse path
378- // // list files & folders
379- // // if file -> delete
380- // // if folder !== nintendo
381- // // if folder m_entry_fixMacSpecialFolders with new path
382- // }
383-
384- // void m_entry_stillNoBootInfo(){
385- // gfx_clearscreen();
386- // gfx_printf("\n\n-- My switch still does not boot.\n\n");
387-
388- // gfx_printf("%kDo you have a gamecard inserted?\n", COLOR_WHITE);
389- // gfx_printf("Try taking it out and reboot.\n\n");
390-
391- // gfx_printf("%kDid you recently update Atmosphere/DeepSea?\n", COLOR_WHITE);
392- // gfx_printf("Insert your sdcard into a computer, delete 'atmosphere', 'bootloader' & 'sept', download your preffered CFW and put the files back on your switch.\n\n");
393-
394- // gfx_printf("%kDid you just buy a new SD-card?\n", COLOR_WHITE);
395- // gfx_printf("Make sure its not a fake card.\n\n");
396-
397- // gfx_printf("\n\n Done, press a key to proceed.");
398- // hidWait();
399- // }
400-
401- // void m_entry_ViewCredits(){
402- // gfx_clearscreen();
403- // gfx_printf("\nCommon Problem Resolver v%d.%d.%d\nBy Team Neptune\n\nBased on TegraExplorer by SuchMemeManySkill,\nLockpick_RCM & Hekate, from shchmue & CTCaer\n\n\n", LP_VER_MJ, LP_VER_MN, LP_VER_BF);
404- // hidWait();
405- // }
406-
407- // void m_entry_fixAll(){
408- // gfx_clearscreen();
409- // m_entry_deleteBootFlags();
410- // m_entry_deleteInstalledThemes();
411- // m_entry_fixClingWrap();
412- // m_entry_fixAIOUpdate();
413-
414-
415- // m_entry_stillNoBootInfo();
416- // }
417-
418-
419- ///////////////////////////////////////////
420-
421-
422103void RebootToAMS (){
423104 launch_payload ("sd:/atmosphere/reboot_payload.bin" );
424105}
@@ -457,6 +138,7 @@ menuPaths mainMenuPaths[] = {
457138 [MainRebootHekate ] = RebootToHekate ,
458139 [MainRebootRCM ] = reboot_rcm ,
459140 [MainPowerOff ] = power_off ,
141+ [MainRebootAMS ] = RebootToAMS ,
460142 [MainViewCredits ] = m_entry_ViewCredits ,
461143};
462144
@@ -466,18 +148,8 @@ void EnterMainMenu(){
466148 if (sd_get_card_removed ())
467149 sd_unmount ();
468150
469- // // -- Explore --
470- // mainMenuEntries[MainBrowseSd].hide = !sd_mounted;
471- // mainMenuEntries[MainMountSd].name = (sd_mounted) ? "Unmount SD" : "Mount SD";
472- // mainMenuEntries[MainBrowseEmummc].hide = (!emu_cfg.enabled || !sd_mounted);
473-
474- // // -- Tools --
475- // mainMenuEntries[MainPartitionSd].hide = (!is_sd_inited || sd_get_card_removed());
476- // mainMenuEntries[MainDumpFw].hide = (!TConf.keysDumped || !sd_mounted);
477- // mainMenuEntries[MainViewKeys].hide = !TConf.keysDumped;
478-
479151 // // -- Exit --
480- // mainMenuEntries[MainRebootAMS].hide = (!sd_mounted || !FileExists("sd:/atmosphere/reboot_payload.bin"));
152+ mainMenuEntries [MainRebootAMS ].hide = (!sd_mounted || !FileExists ("sd:/atmosphere/reboot_payload.bin" ));
481153 mainMenuEntries [MainRebootHekate ].hide = (!sd_mounted || !FileExists ("sd:/bootloader/update.bin" ));
482154 mainMenuEntries [MainRebootRCM ].hide = h_cfg .t210b01 ;
483155
0 commit comments