remove memory(), add cwd(), #REQUIRE SD
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
#ifndef WIN32
|
||||
#include "../tegraexplorer/tconf.h"
|
||||
#include <storage/nx_sd.h>
|
||||
#endif
|
||||
|
||||
static inline int isValidWord(char c) {
|
||||
@@ -123,6 +124,17 @@ u8 nextToken(char** inPtr, void** val) {
|
||||
return Token_Fatal_Err;
|
||||
}
|
||||
}
|
||||
else if (!memcmp(in + 9, "SD", 2)) {
|
||||
#ifdef WIN32
|
||||
u8 gotSd = 0;
|
||||
#else
|
||||
u8 gotSd = sd_mount();
|
||||
#endif
|
||||
if (!gotSd){
|
||||
printScriptError(SCRIPT_LEXER_FATAL, "Sd required.");
|
||||
return Token_Fatal_Err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (*in && *in != '\n')
|
||||
|
||||
@@ -453,6 +453,10 @@ ClassFunction(stdEscPaths){
|
||||
return newStringVariablePtr(EscapeFolder(args[0]->string.value), 0, 1);
|
||||
}
|
||||
|
||||
ClassFunction(stdGetCwd){
|
||||
return newStringVariablePtr(CpyStr(TConf.scriptCWD), 0, 1);
|
||||
}
|
||||
|
||||
#else
|
||||
#define STUBBED(name) ClassFunction(name) { return newIntVariablePtr(0); }
|
||||
|
||||
@@ -529,9 +533,9 @@ ClassFunctionTableEntry_t standardFunctionDefenitions[] = {
|
||||
{"setpixel", stdSetPixel, 3, threeIntsStd},
|
||||
{"setpixels", stdSetPixels, 5, threeIntsStd},
|
||||
{"emu", stdHasEmu, 0, 0},
|
||||
{"cwd", stdGetCwd, 0, 0},
|
||||
{"clear", stdClear, 0, 0},
|
||||
{"timer", stdGetMs, 0, 0},
|
||||
{"memory", stdGetMemUsage, 0, 0},
|
||||
{"pause", stdPauseMask, 1, threeIntsStd},
|
||||
{"pause", stdPause, 0, 0},
|
||||
{"color", stdColor, 1, threeIntsStd},
|
||||
|
||||
Reference in New Issue
Block a user