mirror of
https://github.com/suchmememanyskill/TegraExplorer.git
synced 2024-11-22 11:56:42 +00:00
Add $EMUMMC$ flag, add DEL and DEL-R commands to scripting
This commit is contained in:
parent
37ce49a31f
commit
eecefd634c
4 changed files with 35 additions and 26 deletions
|
@ -89,9 +89,10 @@ void connect_mmc(short mmctype){
|
|||
currentlyMounted = SYSMMC;
|
||||
break;
|
||||
case EMUMMC:
|
||||
emummc_storage_init_mmc(&storage, &sdmmc);
|
||||
emu_cfg.enabled = 1;
|
||||
currentlyMounted = EMUMMC;
|
||||
if (emummc_storage_init_mmc(&storage, &sdmmc)){
|
||||
emu_cfg.enabled = 1;
|
||||
currentlyMounted = EMUMMC;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ menu_item explfilemenu[11] = {
|
|||
{"Move to clipboard", COLOR_BLUE, MOVE, 1},
|
||||
{"\nDelete file\n", COLOR_RED, DELETE, 1},
|
||||
{"Launch Payload", COLOR_ORANGE, PAYLOAD, 1},
|
||||
{"Launch Script", COLOR_BLUE, SCRIPT, 1},
|
||||
{"Launch Script", COLOR_YELLOW, SCRIPT, 1},
|
||||
{"View Hex", COLOR_GREEN, HEXVIEW, 1}
|
||||
};
|
||||
|
||||
|
|
|
@ -10,22 +10,19 @@
|
|||
#include "../utils/btn.h"
|
||||
#include "../gfx/gfx.h"
|
||||
#include "../utils/util.h"
|
||||
#include "../storage/emummc.h"
|
||||
#include "script.h"
|
||||
|
||||
char func[11] = "", args[2][128] = {"", ""};
|
||||
int res;
|
||||
script_parts parts[] = {
|
||||
{"COPY", Part_Copy, 2},
|
||||
{"COPY-R", Part_RecursiveCopy, 2},
|
||||
{"MKDIR", Part_MakeFolder, 1},
|
||||
{"CON_MMC", Part_ConnectMMC, 1},
|
||||
{"MNT_MMC", Part_MountMMC, 1},
|
||||
{"PRINT", Part_Print, 1},
|
||||
{"ERRPRINT", Part_ErrorPrint, 0},
|
||||
{"EXIT", Part_Exit, 0},
|
||||
{"PAUSE", Part_WaitOnUser, 0},
|
||||
{"NULL", NULL, -1}
|
||||
};
|
||||
|
||||
int Part_Delete(){
|
||||
return f_unlink(args[0]);
|
||||
}
|
||||
|
||||
int Part_DeleteRecursive(){
|
||||
return del_recursive(args[0]);
|
||||
}
|
||||
|
||||
int Part_Copy(){
|
||||
return copy(args[0], args[1], true, false);
|
||||
|
@ -76,6 +73,21 @@ int Part_WaitOnUser(){
|
|||
return (buttons_pressed & BTN_POWER);
|
||||
}
|
||||
|
||||
script_parts parts[] = {
|
||||
{"COPY", Part_Copy, 2},
|
||||
{"COPY-R", Part_RecursiveCopy, 2},
|
||||
{"MKDIR", Part_MakeFolder, 1},
|
||||
{"CON_MMC", Part_ConnectMMC, 1},
|
||||
{"MNT_MMC", Part_MountMMC, 1},
|
||||
{"PRINT", Part_Print, 1},
|
||||
{"ERRPRINT", Part_ErrorPrint, 0},
|
||||
{"EXIT", Part_Exit, 0},
|
||||
{"PAUSE", Part_WaitOnUser, 0},
|
||||
{"DEL", Part_Delete, 1},
|
||||
{"DEL-R", Part_DeleteRecursive, 1},
|
||||
{"NULL", NULL, -1}
|
||||
};
|
||||
|
||||
int ParsePart(){
|
||||
int i;
|
||||
for (i = 0; parts[i].arg_amount != -1; i++){
|
||||
|
@ -187,6 +199,12 @@ void ParseScript(char* path){
|
|||
else if (strcmpcheck(func, "BTN_VOL-")){
|
||||
inifstatement = (buttons_pressed & BTN_VOL_DOWN);
|
||||
}
|
||||
else if (strcmpcheck(func, "EMUMMC")){
|
||||
inifstatement = (emu_cfg.enabled);
|
||||
}
|
||||
else if (strcmpcheck(func, "NOEMUMMC")){
|
||||
inifstatement = (!emu_cfg.enabled);
|
||||
}
|
||||
|
||||
if (inifstatement)
|
||||
while(currentchar != '{')
|
||||
|
|
|
@ -9,13 +9,3 @@ typedef struct _script_parts {
|
|||
} script_parts;
|
||||
|
||||
void ParseScript(char* path);
|
||||
int Part_WaitOnUser();
|
||||
int Part_Exit();
|
||||
int Part_ErrorPrint();
|
||||
int Part_Print();
|
||||
int Part_MountMMC();
|
||||
int Part_ConnectMMC();
|
||||
int Part_MakeFolder();
|
||||
int Part_RecursiveCopy();
|
||||
int Testing_Part_Handler();
|
||||
int Part_Copy();
|
Loading…
Reference in a new issue