Add $EMUMMC$ flag, add DEL and DEL-R commands to scripting
This commit is contained in:
@@ -89,9 +89,10 @@ void connect_mmc(short mmctype){
|
|||||||
currentlyMounted = SYSMMC;
|
currentlyMounted = SYSMMC;
|
||||||
break;
|
break;
|
||||||
case EMUMMC:
|
case EMUMMC:
|
||||||
emummc_storage_init_mmc(&storage, &sdmmc);
|
if (emummc_storage_init_mmc(&storage, &sdmmc)){
|
||||||
emu_cfg.enabled = 1;
|
emu_cfg.enabled = 1;
|
||||||
currentlyMounted = EMUMMC;
|
currentlyMounted = EMUMMC;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ menu_item explfilemenu[11] = {
|
|||||||
{"Move to clipboard", COLOR_BLUE, MOVE, 1},
|
{"Move to clipboard", COLOR_BLUE, MOVE, 1},
|
||||||
{"\nDelete file\n", COLOR_RED, DELETE, 1},
|
{"\nDelete file\n", COLOR_RED, DELETE, 1},
|
||||||
{"Launch Payload", COLOR_ORANGE, PAYLOAD, 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}
|
{"View Hex", COLOR_GREEN, HEXVIEW, 1}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10,22 +10,19 @@
|
|||||||
#include "../utils/btn.h"
|
#include "../utils/btn.h"
|
||||||
#include "../gfx/gfx.h"
|
#include "../gfx/gfx.h"
|
||||||
#include "../utils/util.h"
|
#include "../utils/util.h"
|
||||||
|
#include "../storage/emummc.h"
|
||||||
#include "script.h"
|
#include "script.h"
|
||||||
|
|
||||||
char func[11] = "", args[2][128] = {"", ""};
|
char func[11] = "", args[2][128] = {"", ""};
|
||||||
int res;
|
int res;
|
||||||
script_parts parts[] = {
|
|
||||||
{"COPY", Part_Copy, 2},
|
int Part_Delete(){
|
||||||
{"COPY-R", Part_RecursiveCopy, 2},
|
return f_unlink(args[0]);
|
||||||
{"MKDIR", Part_MakeFolder, 1},
|
}
|
||||||
{"CON_MMC", Part_ConnectMMC, 1},
|
|
||||||
{"MNT_MMC", Part_MountMMC, 1},
|
int Part_DeleteRecursive(){
|
||||||
{"PRINT", Part_Print, 1},
|
return del_recursive(args[0]);
|
||||||
{"ERRPRINT", Part_ErrorPrint, 0},
|
}
|
||||||
{"EXIT", Part_Exit, 0},
|
|
||||||
{"PAUSE", Part_WaitOnUser, 0},
|
|
||||||
{"NULL", NULL, -1}
|
|
||||||
};
|
|
||||||
|
|
||||||
int Part_Copy(){
|
int Part_Copy(){
|
||||||
return copy(args[0], args[1], true, false);
|
return copy(args[0], args[1], true, false);
|
||||||
@@ -76,6 +73,21 @@ int Part_WaitOnUser(){
|
|||||||
return (buttons_pressed & BTN_POWER);
|
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 ParsePart(){
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; parts[i].arg_amount != -1; i++){
|
for (i = 0; parts[i].arg_amount != -1; i++){
|
||||||
@@ -187,6 +199,12 @@ void ParseScript(char* path){
|
|||||||
else if (strcmpcheck(func, "BTN_VOL-")){
|
else if (strcmpcheck(func, "BTN_VOL-")){
|
||||||
inifstatement = (buttons_pressed & BTN_VOL_DOWN);
|
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)
|
if (inifstatement)
|
||||||
while(currentchar != '{')
|
while(currentchar != '{')
|
||||||
|
|||||||
@@ -9,13 +9,3 @@ typedef struct _script_parts {
|
|||||||
} script_parts;
|
} script_parts;
|
||||||
|
|
||||||
void ParseScript(char* path);
|
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();
|
|
||||||
Reference in New Issue
Block a user