Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a850baae06 | ||
|
|
1dabe126ac | ||
|
|
ed1361b33f | ||
|
|
81c8f0c92a | ||
|
|
2f07b26963 |
No files matched your search
@@ -26,5 +26,5 @@ jobs:
|
|||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: AllgemeinerProblemLoeser.bin
|
name: RepairNX.bin
|
||||||
path: output/AllgemeinerProblemLoeser.bin
|
path: output/RepairNX.bin
|
||||||
@@ -37,4 +37,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: |-
|
files: |-
|
||||||
output/AllgemeinerProblemLoeser.bin
|
output/RepairNX.bin
|
||||||
@@ -10,12 +10,12 @@ include $(DEVKITARM)/base_rules
|
|||||||
|
|
||||||
IPL_LOAD_ADDR := 0x40008000
|
IPL_LOAD_ADDR := 0x40008000
|
||||||
APLVERSION_MAJOR := 0
|
APLVERSION_MAJOR := 0
|
||||||
APLVERSION_MINOR := 3
|
APLVERSION_MINOR := 4
|
||||||
APLVERSION_BUGFX := 5
|
APLVERSION_BUGFX := 0
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
TARGET := AllgemeinerProblemLoeser
|
TARGET := RepairNX
|
||||||
BUILDDIR := build
|
BUILDDIR := build
|
||||||
OUTPUTDIR := output
|
OUTPUTDIR := output
|
||||||
SOURCEDIR = source
|
SOURCEDIR = source
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
# AllgemeinerProblemLoeser (APL)
|
# RepairNX
|
||||||
|
|
||||||
Rette deine Switch ohne PC!
|
Rette deine Switch ohne PC!
|
||||||
|
|
||||||
|
Vormals **AllgemeinerProblemLoeser (APL)**.
|
||||||
|
|
||||||
**Original-Projekt:** [Common Problem Resolver](https://github.com/Team-Neptune/CommonProblemResolver) von [Team Neptune](https://github.com/Team-Neptune).
|
**Original-Projekt:** [Common Problem Resolver](https://github.com/Team-Neptune/CommonProblemResolver) von [Team Neptune](https://github.com/Team-Neptune).
|
||||||
|
|
||||||
## Nutzung
|
## Nutzung
|
||||||
|
|
||||||
1. Besorge dir einen Payload-Injector deiner Wahl
|
1. Besorge dir einen Payload-Injector deiner Wahl
|
||||||
2. Lade APL als Payload
|
2. Lade RepairNX als Payload
|
||||||
|
|
||||||
Navigation in den Menues mit den Joy-Cons:
|
Navigation in den Menues mit den Joy-Cons:
|
||||||
- A: Auswaehlen
|
- A: Auswaehlen
|
||||||
|
|||||||
+181
-36
@@ -259,41 +259,6 @@ void m_entry_fixArchiveBit(u32 type){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _fixAMSErrorFolder(const char *titleId, const char *label){
|
|
||||||
gfx_clearscreen();
|
|
||||||
gfx_printf("\n\n-- Fix Fehlercode %s --\n\n", label);
|
|
||||||
if (!sd_mount()) {
|
|
||||||
gfx_printf("SD-Karte konnte nicht gemountet werden.\n");
|
|
||||||
hidWait();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
char *path = CpyStr("sd:/atmosphere/contents");
|
|
||||||
char *full = CombinePaths(path, titleId);
|
|
||||||
free(path);
|
|
||||||
if (FileExists(full)) {
|
|
||||||
gfx_printf("Entferne Ordner %s ...\n", titleId);
|
|
||||||
FolderDelete(full);
|
|
||||||
gfx_printf("Ordner erfolgreich geloescht.\n");
|
|
||||||
} else {
|
|
||||||
gfx_printf("Ordner %s nicht gefunden (evtl. bereits behoben).\n", titleId);
|
|
||||||
}
|
|
||||||
free(full);
|
|
||||||
gfx_printf("\n\n Fertig! Druecke eine Taste um zurueckzukehren");
|
|
||||||
hidWait();
|
|
||||||
}
|
|
||||||
|
|
||||||
void m_entry_fixAMSError_4200(void){
|
|
||||||
_fixAMSErrorFolder("4200000000000010", "4200000000000010");
|
|
||||||
}
|
|
||||||
|
|
||||||
void m_entry_fixAMSError_6900(void){
|
|
||||||
_fixAMSErrorFolder("690000000000000D", "690000000000000D");
|
|
||||||
}
|
|
||||||
|
|
||||||
void m_entry_fixAMSError_BD00(void){
|
|
||||||
_fixAMSErrorFolder("010000000000BD00", "010000000000BD00");
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _deleteTheme(char* basePath, char* folderId){
|
static int _deleteTheme(char* basePath, char* folderId){
|
||||||
int removed = 0;
|
int removed = 0;
|
||||||
char *path = CombinePaths(basePath, folderId);
|
char *path = CombinePaths(basePath, folderId);
|
||||||
@@ -942,7 +907,7 @@ void m_entry_stillNoBootInfo(){
|
|||||||
|
|
||||||
void m_entry_ViewCredits(){
|
void m_entry_ViewCredits(){
|
||||||
gfx_clearscreen();
|
gfx_clearscreen();
|
||||||
gfx_printf("\nAllgemeinerProblemLoeser %d.%d.%d\nVon Team Neptune - (NiklasCFW Fork - Uebersetzt von Switch Bros.)\n\nBasierend auf TegraExplorer von SuchMemeManySkill,\nLockpick_RCM & Hekate, von shchmue & CTCaer\n\n\n", APL_VER_MJ, APL_VER_MN, APL_VER_BF);
|
gfx_printf("\nRepairNX %d.%d.%d (vormals AllgemeinerProblemLoeser)\nVon Team Neptune - (NiklasCFW Fork - Uebersetzt von Switch Bros.)\n\nBasierend auf TegraExplorer von SuchMemeManySkill,\nLockpick_RCM & Hekate, von shchmue & CTCaer\n\n\n", APL_VER_MJ, APL_VER_MN, APL_VER_BF);
|
||||||
hidWait();
|
hidWait();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -953,3 +918,183 @@ void m_entry_fixAll(){
|
|||||||
|
|
||||||
m_entry_stillNoBootInfo();
|
m_entry_stillNoBootInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Sysmodule selector: lists every sd:/atmosphere/contents/<TID>/ that ships a
|
||||||
|
// toolbox.json (Hekate-Toolbox / Ultrahand convention) and removes the chosen
|
||||||
|
// one. Works for any sysmodule the user installed, no hardcoded title IDs.
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#define SYSMOD_MAX 64
|
||||||
|
#define SYSMOD_NAME_LEN 48
|
||||||
|
#define SYSMOD_LABEL_LEN 80
|
||||||
|
#define TOOLBOX_MAX_SIZE 4096
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
char tid[24];
|
||||||
|
char label[SYSMOD_LABEL_LEN];
|
||||||
|
} sysmod_entry_t;
|
||||||
|
|
||||||
|
// Extract the string value of "name" from a toolbox.json. Minimal parser:
|
||||||
|
// the file is a flat object, we only need one string key.
|
||||||
|
static bool _toolbox_read_name(const char *json_path, char *out, u32 out_sz)
|
||||||
|
{
|
||||||
|
FIL fp;
|
||||||
|
if (f_open(&fp, json_path, FA_READ) != FR_OK)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
u32 size = f_size(&fp);
|
||||||
|
if (size == 0 || size > TOOLBOX_MAX_SIZE)
|
||||||
|
{
|
||||||
|
f_close(&fp);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *buf = malloc(size + 1);
|
||||||
|
UINT br = 0;
|
||||||
|
FRESULT res = f_read(&fp, buf, size, &br);
|
||||||
|
f_close(&fp);
|
||||||
|
if (res != FR_OK)
|
||||||
|
{
|
||||||
|
free(buf);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
buf[br] = 0;
|
||||||
|
|
||||||
|
bool found = false;
|
||||||
|
char *p = strstr(buf, "\"name\"");
|
||||||
|
if (p)
|
||||||
|
{
|
||||||
|
p += 6;
|
||||||
|
while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
|
||||||
|
p++;
|
||||||
|
if (*p == ':')
|
||||||
|
{
|
||||||
|
p++;
|
||||||
|
while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
|
||||||
|
p++;
|
||||||
|
if (*p == '"')
|
||||||
|
{
|
||||||
|
p++;
|
||||||
|
u32 n = 0;
|
||||||
|
while (*p && *p != '"' && n + 1 < out_sz)
|
||||||
|
{
|
||||||
|
if (*p == '\\' && p[1])
|
||||||
|
p++;
|
||||||
|
// Font only covers ASCII; replace anything else.
|
||||||
|
out[n++] = ((u8)*p >= 0x20 && (u8)*p < 0x7F) ? *p : '?';
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
out[n] = 0;
|
||||||
|
found = n > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
free(buf);
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fills entries[], returns count (-1 if contents folder can't be read).
|
||||||
|
static int _sysmod_scan(sysmod_entry_t *entries, int max)
|
||||||
|
{
|
||||||
|
const char *base = "sd:/atmosphere/contents";
|
||||||
|
DIR dir;
|
||||||
|
static FILINFO fno;
|
||||||
|
if (f_opendir(&dir, base) != FR_OK)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
char json_path[128];
|
||||||
|
char name[SYSMOD_NAME_LEN];
|
||||||
|
while (count < max)
|
||||||
|
{
|
||||||
|
if (f_readdir(&dir, &fno) != FR_OK || fno.fname[0] == 0)
|
||||||
|
break;
|
||||||
|
if (!(fno.fattrib & AM_DIR))
|
||||||
|
continue;
|
||||||
|
if (strlen(fno.fname) != 16) // title IDs only
|
||||||
|
continue;
|
||||||
|
|
||||||
|
s_printf(json_path, "%s/%s/toolbox.json", base, fno.fname);
|
||||||
|
if (!_toolbox_read_name(json_path, name, sizeof(name)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
strcpy(entries[count].tid, fno.fname);
|
||||||
|
s_printf(entries[count].label, "%s (%s)", name, fno.fname);
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
f_closedir(&dir);
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
void m_entry_sysmoduleSelector(void)
|
||||||
|
{
|
||||||
|
sysmod_entry_t *mods = calloc(SYSMOD_MAX, sizeof(sysmod_entry_t));
|
||||||
|
MenuEntry_t *entries = calloc(SYSMOD_MAX + 1, sizeof(MenuEntry_t));
|
||||||
|
int sel = 0;
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
gfx_clearscreen();
|
||||||
|
gfx_printf("\n\n-- Sysmodule deinstallieren --\n\n");
|
||||||
|
|
||||||
|
if (!sd_mount())
|
||||||
|
{
|
||||||
|
gfx_printf("SD-Karte konnte nicht gemountet werden.\n");
|
||||||
|
gfx_printf("\n\n Druecke eine Taste um zurueckzukehren");
|
||||||
|
hidWait();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
int count = _sysmod_scan(mods, SYSMOD_MAX);
|
||||||
|
if (count <= 0)
|
||||||
|
{
|
||||||
|
if (count < 0)
|
||||||
|
gfx_printf("Ordner sd:/atmosphere/contents nicht gefunden.\n");
|
||||||
|
else
|
||||||
|
gfx_printf("Keine Sysmodule mit toolbox.json gefunden.\n");
|
||||||
|
gfx_printf("\n\n Druecke eine Taste um zurueckzukehren");
|
||||||
|
hidWait();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
gfx_printf("Auswahl mit A loescht das Sysmodul sofort.\n");
|
||||||
|
gfx_printf("Ordner: sd:/atmosphere/contents/<TitleID>\n\n");
|
||||||
|
|
||||||
|
entries[0].optionUnion = COLORTORGB(COLOR_WHITE);
|
||||||
|
entries[0].name = "<- Zurueck";
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
entries[i + 1].optionUnion = COLORTORGB(COLOR_CYAN);
|
||||||
|
entries[i + 1].name = mods[i].label;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sel > count)
|
||||||
|
sel = count;
|
||||||
|
|
||||||
|
Vector_t ent = vecFromArray(entries, count + 1, sizeof(MenuEntry_t));
|
||||||
|
sel = newMenu(&ent, sel, 79, 20, ENABLEB | ALWAYSREDRAW, count + 1);
|
||||||
|
if (sel <= 0 || sel > count)
|
||||||
|
break;
|
||||||
|
|
||||||
|
sysmod_entry_t *m = &mods[sel - 1];
|
||||||
|
char path[64];
|
||||||
|
s_printf(path, "sd:/atmosphere/contents/%s", m->tid);
|
||||||
|
|
||||||
|
gfx_clearscreen();
|
||||||
|
gfx_printf("\n\n-- Sysmodule deinstallieren --\n\n");
|
||||||
|
gfx_printf("Entferne %s ...\n", m->label);
|
||||||
|
ErrCode_t err = FolderDelete(path);
|
||||||
|
if (err.err)
|
||||||
|
gfx_printf("%kFehler beim Loeschen (Code %d).%k\n", COLOR_RED, err.err, COLOR_DEFAULT);
|
||||||
|
else
|
||||||
|
gfx_printf("%kErfolgreich deinstalliert.%k\n", 0xFF96FF00, 0xFFCCCCCC);
|
||||||
|
gfx_printf("\n\n Druecke eine Taste um zurueckzukehren");
|
||||||
|
hidWait();
|
||||||
|
}
|
||||||
|
|
||||||
|
free(entries);
|
||||||
|
free(mods);
|
||||||
|
}
|
||||||
+1
-3
@@ -2,9 +2,6 @@
|
|||||||
#include <utils/util.h>
|
#include <utils/util.h>
|
||||||
|
|
||||||
void m_entry_fixArchiveBit(u32 type);
|
void m_entry_fixArchiveBit(u32 type);
|
||||||
void m_entry_fixAMSError_4200(void);
|
|
||||||
void m_entry_fixAMSError_6900(void);
|
|
||||||
void m_entry_fixAMSError_BD00(void);
|
|
||||||
void m_entry_deleteInstalledThemes();
|
void m_entry_deleteInstalledThemes();
|
||||||
void m_entry_deleteBootFlags();
|
void m_entry_deleteBootFlags();
|
||||||
void m_entry_ViewCredits();
|
void m_entry_ViewCredits();
|
||||||
@@ -12,3 +9,4 @@ void m_entry_fixAll();
|
|||||||
void m_entry_stillNoBootInfo();
|
void m_entry_stillNoBootInfo();
|
||||||
void m_entry_fixMacSpecialFolders();
|
void m_entry_fixMacSpecialFolders();
|
||||||
void m_entry_fixMarikoWarmbootSleep(void);
|
void m_entry_fixMarikoWarmbootSleep(void);
|
||||||
|
void m_entry_sysmoduleSelector(void);
|
||||||
@@ -13,7 +13,7 @@ void gfx_printTopInfo() {
|
|||||||
bq24193_get_property(BQ24193_ChargeStatus, ¤t_charge_status);
|
bq24193_get_property(BQ24193_ChargeStatus, ¤t_charge_status);
|
||||||
SETCOLOR(COLOR_DEFAULT, COLOR_WHITE);
|
SETCOLOR(COLOR_DEFAULT, COLOR_WHITE);
|
||||||
gfx_con_setpos(0, 0);
|
gfx_con_setpos(0, 0);
|
||||||
gfx_printf("APL %d.%d.%d | Battery: %d%% %c\n", APL_VER_MJ, APL_VER_MN, APL_VER_BF, battery >> 8, ((current_charge_status) ? 129 : 32));
|
gfx_printf("RepairNX %d.%d.%d | Battery: %d%% %c\n", APL_VER_MJ, APL_VER_MN, APL_VER_BF, battery >> 8, ((current_charge_status) ? 129 : 32));
|
||||||
RESETCOLOR;
|
RESETCOLOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,9 +37,7 @@ enum {
|
|||||||
// FixAll,
|
// FixAll,
|
||||||
MainAMS,
|
MainAMS,
|
||||||
DeleteThemes,
|
DeleteThemes,
|
||||||
FixAMS_4200,
|
SysmoduleSelector,
|
||||||
FixAMS_6900,
|
|
||||||
FixAMS_BD00,
|
|
||||||
MainConvenience,
|
MainConvenience,
|
||||||
FixMarikoWarmbootSleep,
|
FixMarikoWarmbootSleep,
|
||||||
FixMacSpecialFolders,
|
FixMacSpecialFolders,
|
||||||
@@ -62,9 +60,7 @@ MenuEntry_t mainMenuEntries[] = {
|
|||||||
|
|
||||||
[MainAMS] = {.optionUnion = COLORTORGB(COLOR_WHITE) | SKIPBIT, .name = "\n-- Atmosphere Fehlercodes --"},
|
[MainAMS] = {.optionUnion = COLORTORGB(COLOR_WHITE) | SKIPBIT, .name = "\n-- Atmosphere Fehlercodes --"},
|
||||||
[DeleteThemes] = {.optionUnion = COLORTORGB(COLOR_CYAN), .name = "Fix 0100000000001000 (Installiertes Theme)"},
|
[DeleteThemes] = {.optionUnion = COLORTORGB(COLOR_CYAN), .name = "Fix 0100000000001000 (Installiertes Theme)"},
|
||||||
[FixAMS_4200] = {.optionUnion = COLORTORGB(COLOR_CYAN), .name = "Fix 4200000000000010 (ldn_mitm)"},
|
[SysmoduleSelector] = {.optionUnion = COLORTORGB(COLOR_CYAN), .name = "Sysmodul deinstallieren (Fehlercode = Title ID)"},
|
||||||
[FixAMS_6900] = {.optionUnion = COLORTORGB(COLOR_CYAN), .name = "Fix 690000000000000D (sys-con)"},
|
|
||||||
[FixAMS_BD00] = {.optionUnion = COLORTORGB(COLOR_CYAN), .name = "Fix 010000000000BD00 (MissionControl)"},
|
|
||||||
|
|
||||||
[MainConvenience] = {.optionUnion = COLORTORGB(COLOR_WHITE) | SKIPBIT, .name = "\n-- Bequemlichkeit --"},
|
[MainConvenience] = {.optionUnion = COLORTORGB(COLOR_WHITE) | SKIPBIT, .name = "\n-- Bequemlichkeit --"},
|
||||||
[FixMarikoWarmbootSleep] = {.optionUnion = COLORTORGB(COLOR_ORANGE), .name = "Mariko Sleep Fix (Warmboot)"},
|
[FixMarikoWarmbootSleep] = {.optionUnion = COLORTORGB(COLOR_ORANGE), .name = "Mariko Sleep Fix (Warmboot)"},
|
||||||
@@ -131,9 +127,7 @@ menuPaths mainMenuPaths[] = {
|
|||||||
[DeleteThemes] = m_entry_deleteInstalledThemes,
|
[DeleteThemes] = m_entry_deleteInstalledThemes,
|
||||||
[FixArchiveBitA] = archBitHelperA,
|
[FixArchiveBitA] = archBitHelperA,
|
||||||
[FixArchiveBitN] = archBitHelperN,
|
[FixArchiveBitN] = archBitHelperN,
|
||||||
[FixAMS_4200] = m_entry_fixAMSError_4200,
|
[SysmoduleSelector] = m_entry_sysmoduleSelector,
|
||||||
[FixAMS_6900] = m_entry_fixAMSError_6900,
|
|
||||||
[FixAMS_BD00] = m_entry_fixAMSError_BD00,
|
|
||||||
[FixMacSpecialFolders] = m_entry_fixMacSpecialFolders,
|
[FixMacSpecialFolders] = m_entry_fixMacSpecialFolders,
|
||||||
[FixMarikoWarmbootSleep] = m_entry_fixMarikoWarmbootSleep,
|
[FixMarikoWarmbootSleep] = m_entry_fixMarikoWarmbootSleep,
|
||||||
// [FixAll] = m_entry_fixAll,
|
// [FixAll] = m_entry_fixAll,
|
||||||
@@ -151,7 +145,9 @@ void EnterMainMenu(){
|
|||||||
sd_unmount();
|
sd_unmount();
|
||||||
|
|
||||||
// // -- Exit --
|
// // -- Exit --
|
||||||
mainMenuEntries[MainRebootHekate].hide = !h_cfg.t210b01 && (!sd_get_card_mounted() || !hekate_reboot_available());
|
// Always offered: on Erista, reboot_to_hekate_menu() mounts the SD card
|
||||||
|
// itself and says so if hekate is missing.
|
||||||
|
mainMenuEntries[MainRebootHekate].hide = false;
|
||||||
mainMenuEntries[MainRebootRCM].hide = h_cfg.t210b01;
|
mainMenuEntries[MainRebootRCM].hide = h_cfg.t210b01;
|
||||||
mainMenuEntries[FixMarikoWarmbootSleep].hide = !h_cfg.t210b01;
|
mainMenuEntries[FixMarikoWarmbootSleep].hide = !h_cfg.t210b01;
|
||||||
|
|
||||||
|
|||||||
@@ -325,11 +325,11 @@ void TakeScreenshot(){
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
char *name, *path;
|
char *name, *path;
|
||||||
const char basepath[] = "sd:/APL/screenshots";
|
const char basepath[] = "sd:/RepairNX/screenshots";
|
||||||
name = malloc(40);
|
name = malloc(40);
|
||||||
s_printf(name, "Screenshot_%08X.bmp", get_tmr_us());
|
s_printf(name, "Screenshot_%08X.bmp", get_tmr_us());
|
||||||
|
|
||||||
f_mkdir("sd:/APL");
|
f_mkdir("sd:/RepairNX");
|
||||||
f_mkdir(basepath);
|
f_mkdir(basepath);
|
||||||
path = CombinePaths(basepath, name);
|
path = CombinePaths(basepath, name);
|
||||||
free(name);
|
free(name);
|
||||||
|
|||||||
+19
-16
@@ -12,33 +12,22 @@
|
|||||||
#include "../fs/fsutils.h"
|
#include "../fs/fsutils.h"
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#include <rtc/max77620-rtc.h>
|
#include <rtc/max77620-rtc.h>
|
||||||
|
#include <storage/sd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
extern hekate_config h_cfg;
|
extern hekate_config h_cfg;
|
||||||
|
|
||||||
extern int launch_payload_ex(char *path, bool force_hekate_menu);
|
extern int launch_payload_ex(char *path, bool force_hekate_menu);
|
||||||
|
|
||||||
|
// Hekate files first: reboot_payload.bin is often Atmosphere's fusee (no hekate
|
||||||
|
// magic, skipped by launch_payload_ex), so it only helps when it is hekate.
|
||||||
static const char *hekate_payload_paths[] = {
|
static const char *hekate_payload_paths[] = {
|
||||||
"sd:/atmosphere/reboot_payload.bin",
|
|
||||||
"sd:/bootloader/update.bin",
|
"sd:/bootloader/update.bin",
|
||||||
"sd:/bootloader/payloads/hekate.bin",
|
"sd:/bootloader/payloads/hekate.bin",
|
||||||
|
"sd:/atmosphere/reboot_payload.bin",
|
||||||
"sd:/sept/payload.bin",
|
"sd:/sept/payload.bin",
|
||||||
};
|
};
|
||||||
|
|
||||||
bool hekate_reboot_available(void)
|
|
||||||
{
|
|
||||||
if (h_cfg.t210b01)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
for (u32 i = 0; i < sizeof(hekate_payload_paths) / sizeof(hekate_payload_paths[0]); i++)
|
|
||||||
{
|
|
||||||
if (FileExists(hekate_payload_paths[i]))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void reboot_to_hekate_menu(void)
|
void reboot_to_hekate_menu(void)
|
||||||
{
|
{
|
||||||
if (h_cfg.t210b01)
|
if (h_cfg.t210b01)
|
||||||
@@ -50,8 +39,22 @@ void reboot_to_hekate_menu(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Erista: chainload hekate from the SD card (mounted here, so the entry
|
||||||
|
// also works after an action unmounted the card).
|
||||||
|
if (!sd_get_card_mounted() && !sd_mount())
|
||||||
|
{
|
||||||
|
gfx_clearscreen();
|
||||||
|
gfx_printf("\n\nSD-Karte konnte nicht gemountet werden.\n\nNutze \"Neustart in RCM-Modus\" und starte\nhekate per Payload-Injector.\n\nDruecke eine Taste um zurueckzukehren");
|
||||||
|
hidWait();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (u32 i = 0; i < sizeof(hekate_payload_paths) / sizeof(hekate_payload_paths[0]); i++)
|
for (u32 i = 0; i < sizeof(hekate_payload_paths) / sizeof(hekate_payload_paths[0]); i++)
|
||||||
{
|
{
|
||||||
|
// launch_payload_ex() unmounts the card when it rejects a payload that is
|
||||||
|
// not hekate, so mount again before checking the next path.
|
||||||
|
if (!sd_get_card_mounted() && !sd_mount())
|
||||||
|
break;
|
||||||
if (!FileExists(hekate_payload_paths[i]))
|
if (!FileExists(hekate_payload_paths[i]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -60,7 +63,7 @@ void reboot_to_hekate_menu(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gfx_clearscreen();
|
gfx_clearscreen();
|
||||||
gfx_printf("\n\nHekate nicht gefunden.\n\nDruecke eine Taste um zurueckzukehren");
|
gfx_printf("\n\nHekate nicht gefunden (bootloader/update.bin).\n\nNutze \"Neustart in RCM-Modus\" und starte\nhekate per Payload-Injector.\n\nDruecke eine Taste um zurueckzukehren");
|
||||||
hidWait();
|
hidWait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ bool StrEndsWith(char *begin, char *end);
|
|||||||
void WaitFor(u32 ms);
|
void WaitFor(u32 ms);
|
||||||
void RebootToPayloadOrRcm();
|
void RebootToPayloadOrRcm();
|
||||||
void reboot_to_hekate_menu(void);
|
void reboot_to_hekate_menu(void);
|
||||||
bool hekate_reboot_available(void);
|
|
||||||
int launch_payload_ex(char *path, bool force_hekate_menu);
|
int launch_payload_ex(char *path, bool force_hekate_menu);
|
||||||
int launch_payload(char *path);
|
int launch_payload(char *path);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user