Compare commits

..

10 Commits

Author SHA1 Message Date
61671f2ec1 Initial commit
Some checks failed
TegraExplorer builder / build (push) Has been cancelled
2025-11-23 00:09:05 +01:00
Sims
eea3728127 Bump version 2024-07-07 19:22:27 +02:00
Sims
b1460c13cb Merge pull request #99 from JeffVi/Lockpick-1.19.10-bdk-upgrade
Fix compile error and index 053 before 120
2024-07-07 19:16:37 +02:00
Jeff
f504c09441 Merge branch 'suchmememanyskill:Lockpick-1.19.10-bdk-upgrade' into Lockpick-1.19.10-bdk-upgrade 2024-07-02 13:22:28 +02:00
Jeff
b9c1b00482 Index 053 before 120 2024-07-02 13:21:36 +02:00
Jeff
11ebd537d8 Fix compile errors 2024-06-22 13:22:21 +02:00
suchmememanyskill
76781f6fb7 Update systemwipe script message 2024-05-28 21:14:29 +02:00
Sims
6bc0772647 Merge pull request #97 from JeffVi/Lockpick-1.19.10-bdk-upgrade
Keep DeviceSettings when running a system wipe
2024-05-28 21:02:31 +02:00
Jeff
51e8efc6a5 Add a check if 120 or 053 is missing 2024-05-27 20:36:57 +02:00
Jeff
6b84d6cd86 Keep DeviceSettings when running a system wipe 2024-05-26 16:26:38 +02:00
12 changed files with 238 additions and 162 deletions

View File

@@ -10,8 +10,8 @@ include $(DEVKITARM)/base_rules
IPL_LOAD_ADDR := 0x40008000 IPL_LOAD_ADDR := 0x40008000
LPVERSION_MAJOR := 4 LPVERSION_MAJOR := 4
LPVERSION_MINOR := 1 LPVERSION_MINOR := 2
LPVERSION_BUGFX := 1 LPVERSION_BUGFX := 0
LPVERSION := \"$(LPVERSION_MAJOR).$(LPVERSION_MINOR).$(LPVERSION_BUGFX)\" LPVERSION := \"$(LPVERSION_MAJOR).$(LPVERSION_MINOR).$(LPVERSION_BUGFX)\"
################################################################################ ################################################################################
@@ -52,6 +52,7 @@ CUSTOMDEFINES += -DGFX_INC=$(GFX_INC) -DFFCFG_INC=$(FFCFG_INC)
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork
CFLAGS = $(ARCH) -Os -nostdlib -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -std=gnu11 -Wall -Wno-missing-braces $(CUSTOMDEFINES) CFLAGS = $(ARCH) -Os -nostdlib -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -std=gnu11 -Wall -Wno-missing-braces $(CUSTOMDEFINES)
LDFLAGS = $(ARCH) -nostartfiles -lgcc -Wl,--nmagic,--gc-sections -Xlinker --defsym=IPL_LOAD_ADDR=$(IPL_LOAD_ADDR) LDFLAGS = $(ARCH) -nostartfiles -lgcc -Wl,--nmagic,--gc-sections -Xlinker --defsym=IPL_LOAD_ADDR=$(IPL_LOAD_ADDR)
SCRIPT_SRCS := $(shell find scripts -name '*.te')
################################################################################ ################################################################################
@@ -109,13 +110,13 @@ $(BUILDDIR)/$(TARGET)/script/builtin.o: $(BUILDDIR)/$(TARGET)/script/builtin.c
@mkdir -p "$(@D)" @mkdir -p "$(@D)"
$(CC) $(CFLAGS) $(BDKINC) -c $< -o $@ $(CC) $(CFLAGS) $(BDKINC) -c $< -o $@
$(BUILDDIR)/$(TARGET)/script/builtin.c: scripts/*.te $(BUILDDIR)/$(TARGET)/script/builtin.c: $(SCRIPT_SRCS)
@mkdir -p "$(@D)" @mkdir -p "$(@D)"
@mkdir -p "$(BUILDDIR)/$(TARGET)/scripts" @mkdir -p "$(BUILDDIR)/$(TARGET)/scripts"
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
@py ts-minifier.py --such-meme -d "$(BUILDDIR)/$(TARGET)/scripts" $(wildcard scripts/*.te) @py ts-minifier.py --such-meme -d "$(BUILDDIR)/$(TARGET)/scripts" $(SCRIPT_SRCS)
@py te2c.py "$(BUILDDIR)/$(TARGET)/script/builtin" "$(BUILDDIR)/$(TARGET)/scripts" @py te2c.py "$(BUILDDIR)/$(TARGET)/script/builtin" "$(BUILDDIR)/$(TARGET)/scripts"
else else
@python3 ts-minifier.py --such-meme -d "$(BUILDDIR)/$(TARGET)/scripts" $(wildcard scripts/*.te) @python3 ts-minifier.py --such-meme -d "$(BUILDDIR)/$(TARGET)/scripts" $(SCRIPT_SRCS)
@python3 te2c.py "$(BUILDDIR)/$(TARGET)/script/builtin" "$(BUILDDIR)/$(TARGET)/scripts" @python3 te2c.py "$(BUILDDIR)/$(TARGET)/script/builtin" "$(BUILDDIR)/$(TARGET)/scripts"
endif endif

2
scripts/HelloWorld.te Normal file
View File

@@ -0,0 +1,2 @@
println("Hello world from TegraScript!")
pause()

View File

@@ -0,0 +1,7 @@
println("Joy-Con Kalibrierungshinweis")
println("Dieser Hinweis beschreibt die manuelle Neukalibrierung der Joy-Cons.")
println("")
println("1. Gehe im Hauptmenü auf \"Rekalibrieren\" oder halte L3+R3 gedrückt.")
println("2. Bewege beide Sticks in alle Richtungen und lasse sie in Mittelstellung los.")
println("3. Drücke beliebige Taste, um zurückzukehren.")
pause()

View File

@@ -0,0 +1,6 @@
println("SD-Karten Schnelltest")
println("1. Entferne die SD-Karte sicher vom Switch.")
println("2. Setze die SD-Karte erneut ein und warte einige Sekunden.")
println("3. Wähle im Hauptmenü \"Mount SD\" oder starte TegraExplorer neu.")
println("Drücke den Power- oder B-Button, um fortzufahren.")
pause()

View File

@@ -0,0 +1,5 @@
println("USB-Reconnect Assistent")
println("1. Ziehe das USB-Kabel kurz ab und stecke es wieder ein.")
println("2. Drücke bei Bedarf den Power-Button, um den Bildschirm zu aktivieren.")
println("3. Wenn TegraExplorer wieder reagiert, wähle mit B diese Hilfe ab.")
pause()

View File

@@ -1,5 +1,5 @@
#REQUIRE KEYS #REQUIRE KEYS
is=["8000000000000120","8000000000000000"] is=["8000000000000120","8000000000000053","8000000000000000"]
p=println p=println
pr=print pr=print
pe={pause() exit()} pe={pause() exit()}
@@ -26,9 +26,9 @@ border = {
setpixels(1260,20,1279,699,border_color) setpixels(1260,20,1279,699,border_color)
} }
i = 20 i = 10
x_pos = 10 x_pos = 10
y_pos = 8 y_pos = 12
["WARNING!!!", ["WARNING!!!",
"", "",
@@ -37,27 +37,34 @@ y_pos = 8
"- Your Save Data", "- Your Save Data",
"- Your Game Data", "- Your Game Data",
"- Your User Data", "- Your User Data",
"- (Some) System Calibration Data"
"",
"This script includes wiping some calibration data.",
"Among other uses, this data is used for battery calibration.",
"This is especially problematic for lite systems,",
" as it makes the system initialize with unsafe",
" battery calibration values!",
"", "",
"Restoring an emmc backup is always preferable over wiping.", "Restoring an emmc backup is always preferable over wiping.",
"Please only use this as a last resort.", "Please only use this as a last resort.",
"This script is intended to be used in aid of unbricking.", "This script is intended to be used in aid of unbricking."
"", ].foreach("line")
"Pull requests to fix the calibration issue are welcome",
"https://github.com/suchmememanyskill/TegraExplorer"].foreach("line")
{ {
printpos(x_pos, y_pos) printpos(x_pos, y_pos)
y_pos = y_pos + 1 y_pos = y_pos + 1
print(line) print(line)
} }
time = 10000 if (!fsexists("bis:/save/"+is[1]))
{
[
"",
"DeviceSettings save (8000000000000053) is missing!!!",
"This script cannot recover lost battery calibration data.",
"The system will initialize with default values.",
"These values are unsafe for lite systems!"
].foreach("line")
{
printpos(x_pos, y_pos)
y_pos = y_pos + 1
print(line)
}
}
time = 5000
y_pos = y_pos + 4 y_pos = y_pos + 4
while (i > 0) while (i > 0)
@@ -97,45 +104,110 @@ f=readdir("bis:/save")
if(f.folders.len()!=0){p("Folders in save dir???")pe()} if(f.folders.len()!=0){p("Folders in save dir???")pe()}
f.files.foreach("x"){if(!is.contains(x)){if(delfile("bis:/save/"+x)){p("File deletion failed: ", x)pe()}}} f.files.foreach("x"){if(!is.contains(x)){if(delfile("bis:/save/"+x)){p("File deletion failed: ", x)pe()}}}
pr("Done!\nSetting up indexer save...") pr("Done!\nSetting up indexer save...")
s=getfilesize("bis:/save/"+is[0])
ba0=["BYTE[]",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00] if(fsexists("bis:/save/"+is[0]))
ba120=["BYTE[]",0x20,0x01,0x00,0x00,0x00,0x00,0x00,0x80] {
s1=s&0xFF ba0=["BYTE[]",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
s2=(s>>8)&0xFF ba120=["BYTE[]",0x20,0x01,0x00,0x00,0x00,0x00,0x00,0x80]
s3=(s>>16)&0xFF ba53=["BYTE[]",0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x80]
s4=(s>>24)&0xFF imen=["BYTE[]",0x49,0x4D,0x45,0x4E,0x40,0x00,0x00,0x00,0x40,0x00,0x00,0x00]
idb=["BYTE[]",0x49,0x4D,0x4B,0x56,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x49,0x4D,0x45,0x4E,0x40,0x00,0x00,0x00,0x40,0x00,0x00,0x00].copy()
idb.addrange(ba0) idb=["BYTE[]",0x49,0x4D,0x4B,0x56,0x00,0x00,0x00,0x00].copy() # imkv
idb.addrange(ba0)
idb.addrange(ba0) skip53 = !fsexists("bis:/save/"+is[1])
idb.addrange(ba120)
idb.addrange(ba0) if(skip53)
idb.addrange(ba0) {
idb.addrange(ba0) idb.add(0x01) # 0x01 imen
idb.addrange(ba0) pr("053 save not found!!! Skip indexing it...")
idb.addrange(ba120) }.else()
idb.add(s1) {
idb.add(s2) idb.add(0x02) # 0x02 imens
idb.add(s3) }
idb.add(s4)
idb.add(0x00) idb.add(0x00)
idb.add(0x00) idb.add(0x00)
idb.add(0x00) idb.add(0x00)
idb.add(0x00)
idb.addrange(ba0) if(!skip53)
idb.addrange(ba0) {
idb.addrange(ba0) # 53 save
idb.addrange(ba0) s=getfilesize("bis:/save/"+is[1])
idb.addrange(ba0) s1=s&0xFF
idb.addrange(ba0) s2=(s>>8)&0xFF
idxs=readsave("bis:/save/"+is[1]) s3=(s>>16)&0xFF
if(idxs.resize("/imkvdb.arc",idb.len())){p("imkvdb resize failed")pe()} s4=(s>>24)&0xFF
if(idxs.write("/imkvdb.arc",idb)){p("imkvdb write failed")pe()} idb.addrange(imen)
if(idxs.resize("/lastPublishedId",ba0.len())){p("lastPublishedId resize failed")pe()} idb.addrange(ba0)
if(idxs.write("/lastPublishedId",ba0)){p("lastPublishedId write failed")pe()} idb.addrange(ba0)
if(idxs.commit()){p("Indexer save commit failed")pe()} idb.addrange(ba0)
idxs=0 idb.addrange(ba53)
pr("Done!\nDeleting user dirs...")ud=["Album","Contents","save","saveMeta","temp"] idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba53)
idb.add(s1)
idb.add(s2)
idb.add(s3)
idb.add(s4)
idb.add(0x00)
idb.add(0x00)
idb.add(0x00)
idb.add(0x00)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
}
# 120 save
s=getfilesize("bis:/save/"+is[0])
s1=s&0xFF
s2=(s>>8)&0xFF
s3=(s>>16)&0xFF
s4=(s>>24)&0xFF
idb.addrange(imen)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba120)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba120)
idb.add(s1)
idb.add(s2)
idb.add(s3)
idb.add(s4)
idb.add(0x00)
idb.add(0x00)
idb.add(0x00)
idb.add(0x00)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idb.addrange(ba0)
idxs=readsave("bis:/save/"+is[2])
if(idxs.resize("/imkvdb.arc",idb.len())){p("imkvdb resize failed")pe()}
if(idxs.write("/imkvdb.arc",idb)){p("imkvdb write failed")pe()}
if(idxs.resize("/lastPublishedId",ba0.len())){p("lastPublishedId resize failed")pe()}
if(idxs.write("/lastPublishedId",ba0)){p("lastPublishedId write failed")pe()}
if(idxs.commit()){p("Indexer save commit failed")pe()}
idxs=0
pr("Done!")
}.else()
{
pr("120 save not found!!! Skip editing indexer save!!!")
}
pr("\nDeleting user dirs...")ud=["Album","Contents","save","saveMeta","temp"]
if(mount("USER")){p("Mount failed!")pe()} if(mount("USER")){p("Mount failed!")pe()}
ud.foreach("x"){pr("\n"+x,"")if(deldir("bis:/"+x)){p("Dir deletion failed")pe()}mkdir("bis:/"+x)} ud.foreach("x"){pr("\n"+x,"")if(deldir("bis:/"+x)){p("Dir deletion failed")pe()}mkdir("bis:/"+x)}
mkdir("bis:/Contents/placehld")mkdir("bis:/Contents/registered") mkdir("bis:/Contents/placehld")mkdir("bis:/Contents/registered")

View File

@@ -232,7 +232,7 @@ u8 nextToken(char** inPtr, void** val) {
if (!memcmp(t.strToken, in, (t.strToken[1] == '\0') ? 1 : 2)) { if (!memcmp(t.strToken, in, (t.strToken[1] == '\0') ? 1 : 2)) {
//gfx_printf("Token: '%s'\n", t.strToken); //gfx_printf("Token: '%s'\n", t.strToken);
ret = Token_Token; ret = Token_Token;
*val = t.token; *val = (void*)t.token;
if (t.strToken[1] != '\0') if (t.strToken[1] != '\0')
in++; in++;

View File

@@ -1,6 +1,7 @@
#include "scriptError.h" #include "scriptError.h"
#include "compat.h" #include "compat.h"
#include <stdarg.h> #include <stdarg.h>
#include "../hid/hid.h"
s64 scriptCurrentLine; s64 scriptCurrentLine;
u8 scriptLastError = 0; u8 scriptLastError = 0;

View File

@@ -27,22 +27,92 @@
#ifdef INCLUDE_BUILTIN_SCRIPTS #ifdef INCLUDE_BUILTIN_SCRIPTS
#include "../../build/TegraExplorer/script/builtin.h" #include "../../build/TegraExplorer/script/builtin.h"
#define MAX_BUILTIN_MENU_ENTRIES (EMBEDDED_SCRIPTS_LEN * 2)
typedef struct {
char name[64];
int scriptIndices[EMBEDDED_SCRIPTS_LEN];
int scriptCount;
} EmbeddedScriptFolder_t;
static void GetScriptDisplayName(const char *fullName, char *out, size_t outSize) {
if (!out || outSize == 0) {
return;
}
const char *start = strrchr(fullName, '/');
start = (start) ? start + 1 : fullName;
size_t len = 0;
while (start[len] && len < outSize - 1) {
len++;
}
if (len >= 3 && start[len - 3] == '.' && start[len - 2] == 't' && start[len - 1] == 'e') {
len -= 3;
}
if (len >= outSize) {
len = outSize - 1;
}
memcpy(out, start, len);
out[len] = '\0';
}
static void RunEmbeddedScriptIndex(int index) {
if (index < 0 || index >= EMBEDDED_SCRIPTS_LEN) {
return;
}
RunScriptString((char*)embedded_scripts_g[index].script, (u32)strlen(embedded_scripts_g[index].script));
}
static void ShowEmbeddedFolder(const EmbeddedScriptFolder_t *folder) {
if (!folder || folder->scriptCount <= 0) {
return;
}
Vector_t ent = newVec(sizeof(MenuEntry_t), folder->scriptCount + 1);
MenuEntry_t backEntry = {.optionUnion = COLORTORGB(COLOR_WHITE), .name = "<- Zurück"};
vecAdd(&ent, backEntry);
char displayNames[EMBEDDED_SCRIPTS_LEN][64] = {{0}};
for (int i = 0; i < folder->scriptCount; i++) {
int scriptIndex = folder->scriptIndices[i];
if (scriptIndex < 0 || scriptIndex >= EMBEDDED_SCRIPTS_LEN) {
continue;
}
GetScriptDisplayName(embedded_scripts_g[scriptIndex].name, displayNames[i], sizeof(displayNames[i]));
MenuEntry_t entry = {.optionUnion = COLORTORGB(COLOR_BLUE), .name = displayNames[i], .icon = 128};
vecAdd(&ent, entry);
}
int selected = (ent.count > 1) ? 1 : 0;
while (1) {
gfx_clearscreen();
gfx_printf("%s\n\n", folder->name);
int res = newMenu(&ent, selected, 79, 28, ALWAYSREDRAW | ENABLEPAGECOUNT, ent.count - 1);
if (res <= 0) {
break;
}
selected = res;
int scriptIndex = folder->scriptIndices[res - 1];
RunEmbeddedScriptIndex(scriptIndex);
}
free(ent.data);
}
#endif #endif
extern hekate_config h_cfg; extern hekate_config h_cfg;
enum { enum {
#ifndef SCRIPT_ONLY #ifndef SCRIPT_ONLY
MainExplore = 0, MainExit = 0,
MainBrowseSd,
MainMountSd,
MainBrowseEmmc,
MainBrowseEmummc,
MainTools,
MainPartitionSd,
MainViewKeys,
MainViewCredits,
MainExit,
#else #else
MainExit = 0, MainExit = 0,
#endif #endif
@@ -56,18 +126,9 @@ enum {
MenuEntry_t mainMenuEntries[] = { MenuEntry_t mainMenuEntries[] = {
#ifndef SCRIPT_ONLY #ifndef SCRIPT_ONLY
[MainExplore] = {.optionUnion = COLORTORGB(COLOR_WHITE) | SKIPBIT, .name = "-- Explore --"}, [MainExit] = {.optionUnion = COLORTORGB(COLOR_WHITE) | SKIPBIT, .name = "-- Exit --"},
[MainBrowseSd] = {.optionUnion = COLORTORGB(COLOR_GREEN), .name = "Browse SD"},
[MainMountSd] = {.optionUnion = COLORTORGB(COLOR_YELLOW)}, // To mount/unmount the SD
[MainBrowseEmmc] = {.optionUnion = COLORTORGB(COLOR_BLUE), .name = "Browse EMMC"},
[MainBrowseEmummc] = {.optionUnion = COLORTORGB(COLOR_BLUE), .name = "Browse EMUMMC"},
[MainTools] = {.optionUnion = COLORTORGB(COLOR_WHITE) | SKIPBIT, .name = "\n-- Tools --"},
[MainPartitionSd] = {.optionUnion = COLORTORGB(COLOR_ORANGE), .name = "Partition the sd"},
[MainViewKeys] = {.optionUnion = COLORTORGB(COLOR_YELLOW), .name = "View dumped keys"},
[MainViewCredits] = {.optionUnion = COLORTORGB(COLOR_YELLOW), .name = "Credits"},
[MainExit] = {.optionUnion = COLORTORGB(COLOR_WHITE) | SKIPBIT, .name = "\n-- Exit --"},
#else #else
[MainExit] = {.optionUnion = COLORTORGB(COLOR_WHITE), .name = "\n-- Exit --"}, [MainExit] = {.optionUnion = COLORTORGB(COLOR_WHITE), .name = "-- Exit --"},
#endif #endif
[MainPowerOff] = {.optionUnion = COLORTORGB(COLOR_VIOLET), .name = "Power off"}, [MainPowerOff] = {.optionUnion = COLORTORGB(COLOR_VIOLET), .name = "Power off"},
[MainRebootRCM] = {.optionUnion = COLORTORGB(COLOR_VIOLET), .name = "Reboot to RCM"}, [MainRebootRCM] = {.optionUnion = COLORTORGB(COLOR_VIOLET), .name = "Reboot to RCM"},
@@ -77,62 +138,7 @@ MenuEntry_t mainMenuEntries[] = {
[MainScripts] = {.optionUnion = COLORTORGB(COLOR_WHITE) | SKIPBIT, .name = "\n-- Scripts --"} [MainScripts] = {.optionUnion = COLORTORGB(COLOR_WHITE) | SKIPBIT, .name = "\n-- Scripts --"}
}; };
void HandleSD(){
gfx_clearscreen();
TConf.curExplorerLoc = LOC_SD;
if (!sd_mount() || sd_get_card_removed()){
gfx_printf("Sd is not mounted!");
hidWait();
}
else
FileExplorer("sd:/");
}
void HandleEMMC(){
GptMenu(MMC_CONN_EMMC);
}
void HandleEMUMMC(){
GptMenu(MMC_CONN_EMUMMC);
}
void ViewKeys(){
gfx_clearscreen();
for (int i = 0; i < 3; i++){
gfx_printf("\nBis key 0%d: ", i);
PrintKey(dumpedKeys.bis_key[i], AES_128_KEY_SIZE * 2);
}
gfx_printf("\nMaster key 0: ");
PrintKey(dumpedKeys.master_key, AES_128_KEY_SIZE);
gfx_printf("\nHeader key: ");
PrintKey(dumpedKeys.header_key, AES_128_KEY_SIZE * 2);
gfx_printf("\nSave mac key: ");
PrintKey(dumpedKeys.save_mac_key, AES_128_KEY_SIZE);
u8 fuseCount = 0;
for (u32 i = 0; i < 32; i++){
if ((fuse_read_odm(7) >> i) & 1)
fuseCount++;
}
gfx_printf("\n\nPkg1 ID: '%s'\nFuse count: %d", TConf.pkg1ID, fuseCount);
hidWait();
}
void ViewCredits(){
gfx_clearscreen();
gfx_printf("\nTegraexplorer v%d.%d.%d\nBy SuchMemeManySkill\n\nBased on Lockpick_RCM & Hekate, from shchmue & CTCaer\n\n\n", LP_VER_MJ, LP_VER_MN, LP_VER_BF);
if (hidRead()->r)
gfx_printf("%k\"I'm not even sure if it works\" - meme", COLOR_ORANGE);
hidWait();
}
extern bool sd_mounted; extern bool sd_mounted;
extern bool is_sd_inited;
extern int launch_payload(char *path); extern int launch_payload(char *path);
void RebootToAMS(){ void RebootToAMS(){
@@ -143,26 +149,11 @@ void RebootToHekate(){
launch_payload("sd:/bootloader/update.bin"); launch_payload("sd:/bootloader/update.bin");
} }
void MountOrUnmountSD(){
gfx_clearscreen();
if (sd_mounted)
sd_unmount();
else if (!sd_mount())
hidWait();
}
menuPaths mainMenuPaths[] = { menuPaths mainMenuPaths[] = {
#ifndef SCRIPT_ONLY #ifndef SCRIPT_ONLY
[MainBrowseSd] = HandleSD,
[MainMountSd] = MountOrUnmountSD,
[MainBrowseEmmc] = HandleEMMC,
[MainBrowseEmummc] = HandleEMUMMC,
[MainPartitionSd] = FormatSD,
[MainViewKeys] = ViewKeys,
[MainViewCredits] = ViewCredits,
#endif
[MainRebootAMS] = RebootToAMS, [MainRebootAMS] = RebootToAMS,
[MainRebootHekate] = RebootToHekate, [MainRebootHekate] = RebootToHekate,
#endif
[MainRebootRCM] = reboot_rcm, [MainRebootRCM] = reboot_rcm,
[MainPowerOff] = power_off, [MainPowerOff] = power_off,
[MainRebootNormal] = reboot_normal, [MainRebootNormal] = reboot_normal,
@@ -175,16 +166,6 @@ void EnterMainMenu(){
sd_unmount(); sd_unmount();
#ifndef SCRIPT_ONLY #ifndef SCRIPT_ONLY
// -- Explore --
mainMenuEntries[MainBrowseSd].hide = !sd_mounted;
mainMenuEntries[MainMountSd].name = (sd_mounted) ? "Unmount SD" : "Mount SD";
mainMenuEntries[MainBrowseEmummc].hide = (!emu_cfg.enabled || !sd_mounted);
// -- Tools --
mainMenuEntries[MainPartitionSd].hide = (!is_sd_inited || sd_get_card_removed());
mainMenuEntries[MainViewKeys].hide = !TConf.keysDumped;
// -- Exit --
mainMenuEntries[MainRebootAMS].hide = (!sd_mounted || !FileExists("sd:/atmosphere/reboot_payload.bin")); mainMenuEntries[MainRebootAMS].hide = (!sd_mounted || !FileExists("sd:/atmosphere/reboot_payload.bin"));
mainMenuEntries[MainRebootHekate].hide = (!sd_mounted || !FileExists("sd:/bootloader/update.bin")); mainMenuEntries[MainRebootHekate].hide = (!sd_mounted || !FileExists("sd:/bootloader/update.bin"));
mainMenuEntries[MainRebootRCM].hide = h_cfg.t210b01; mainMenuEntries[MainRebootRCM].hide = h_cfg.t210b01;

View File

@@ -18,6 +18,7 @@
#include <string.h> #include <string.h>
#include "../fs/fscopy.h" #include "../fs/fscopy.h"
#include "../utils/utils.h" #include "../utils/utils.h"
#include <display/di.h>
extern sdmmc_storage_t sd_storage; extern sdmmc_storage_t sd_storage;
extern bool is_sd_inited; extern bool is_sd_inited;

BIN
tools/bin2c/bin2c Executable file

Binary file not shown.

BIN
tools/lz/lz77 Executable file

Binary file not shown.