mirror of
https://github.com/suchmememanyskill/TegraExplorer.git
synced 2024-11-22 11:56:42 +00:00
Save bytes, add screenshots into main and more
- Also run script on bootup if a script called startup.te is found on the root of the sd - Saved bytes by just disabling making exfat partitions, lol
This commit is contained in:
parent
5485f5ca06
commit
3f80693d9e
8 changed files with 18 additions and 9 deletions
|
@ -5929,6 +5929,7 @@ FRESULT f_mkfs (
|
||||||
|
|
||||||
#if FF_FS_EXFAT
|
#if FF_FS_EXFAT
|
||||||
if (fmt == FS_EXFAT) { /* Create an exFAT volume */
|
if (fmt == FS_EXFAT) { /* Create an exFAT volume */
|
||||||
|
LEAVE_MKFS(FR_NO_FILESYSTEM); // Muh frii bytes
|
||||||
DWORD szb_bit, szb_case, sum, nb, cl;
|
DWORD szb_bit, szb_case, sum, nb, cl;
|
||||||
WCHAR ch, si;
|
WCHAR ch, si;
|
||||||
UINT j, st;
|
UINT j, st;
|
||||||
|
|
|
@ -22,4 +22,6 @@ typedef struct {
|
||||||
};
|
};
|
||||||
u16 sizeUnion;
|
u16 sizeUnion;
|
||||||
};
|
};
|
||||||
} FSEntry_t;
|
} FSEntry_t;
|
||||||
|
|
||||||
|
#define newFSEntry(filename) (FSEntry_t) {.name = filename}
|
|
@ -83,7 +83,7 @@ void RunScript(char *path, FSEntry_t entry){
|
||||||
|
|
||||||
gfx_clearscreen();
|
gfx_clearscreen();
|
||||||
scriptCtx_t ctx = createScriptCtx();
|
scriptCtx_t ctx = createScriptCtx();
|
||||||
ctx.script = runLexar(script, size);
|
ctx.script = runLexer(script, size);
|
||||||
free(script);
|
free(script);
|
||||||
|
|
||||||
dictVectorAdd(&ctx.varDict, newDict(CpyStr("_CWD"), (newVar(StringType, 0, .stringType = path))));
|
dictVectorAdd(&ctx.varDict, newDict(CpyStr("_CWD"), (newVar(StringType, 0, .stringType = path))));
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
|
|
||||||
typedef void (*fileMenuPath)(char *path, FSEntry_t entry);
|
typedef void (*fileMenuPath)(char *path, FSEntry_t entry);
|
||||||
|
|
||||||
void FileMenu(char *path, FSEntry_t entry);
|
void FileMenu(char *path, FSEntry_t entry);
|
||||||
|
void RunScript(char *path, FSEntry_t entry);
|
|
@ -24,10 +24,8 @@ Input_t *hidRead(){
|
||||||
if (controller->home)
|
if (controller->home)
|
||||||
RebootToPayloadOrRcm();
|
RebootToPayloadOrRcm();
|
||||||
|
|
||||||
#ifdef TAKESCREENSHOT
|
if (controller->cap)
|
||||||
if (controller->cap)
|
TakeScreenshot();
|
||||||
TakeScreenshot();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
inputs.buttons = controller->buttons;
|
inputs.buttons = controller->buttons;
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,9 @@
|
||||||
#include "keys/keys.h"
|
#include "keys/keys.h"
|
||||||
#include "keys/keyfile.h"
|
#include "keys/keyfile.h"
|
||||||
#include "storage/mountmanager.h"
|
#include "storage/mountmanager.h"
|
||||||
|
#include "fs/fsutils.h"
|
||||||
|
#include "fs/fstypes.h"
|
||||||
|
#include "fs/menus/filemenu.h"
|
||||||
|
|
||||||
|
|
||||||
hekate_config h_cfg;
|
hekate_config h_cfg;
|
||||||
|
@ -304,6 +307,10 @@ void ipl_main()
|
||||||
|
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
hidWait();
|
hidWait();
|
||||||
|
|
||||||
|
if (FileExists("sd:/startup.te"))
|
||||||
|
RunScript("sd:/", newFSEntry("startup.te"));
|
||||||
|
|
||||||
EnterMainMenu();
|
EnterMainMenu();
|
||||||
|
|
||||||
// Halt BPMP if we managed to get out of execution.
|
// Halt BPMP if we managed to get out of execution.
|
||||||
|
|
|
@ -92,7 +92,7 @@ void lexarVectorClear(Vector_t *v){
|
||||||
|
|
||||||
#define ELIFC(c) else if (*in == c)
|
#define ELIFC(c) else if (*in == c)
|
||||||
|
|
||||||
Vector_t runLexar(const char* in, u32 len) {
|
Vector_t runLexer(const char* in, u32 len) {
|
||||||
const char *start = in;
|
const char *start = in;
|
||||||
Vector_t vec = newVec(sizeof(lexarToken_t), 16);
|
Vector_t vec = newVec(sizeof(lexarToken_t), 16);
|
||||||
// store last var for re-assignment
|
// store last var for re-assignment
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
Vector_t runLexar(const char* in, u32 len);
|
Vector_t runLexer(const char* in, u32 len);
|
||||||
char lexarDebugGetTokenC(u8 tokenN);
|
char lexarDebugGetTokenC(u8 tokenN);
|
||||||
void lexarVectorClear(Vector_t *v);
|
void lexarVectorClear(Vector_t *v);
|
Loading…
Reference in a new issue