Add new functions to script and properly handle indexer save in the SystemWipe script
This commit is contained in:
@@ -399,6 +399,16 @@ ClassFunction(stdFileRead){
|
||||
return copyVariableToPtr(v);
|
||||
}
|
||||
|
||||
ClassFunction(stdFileReadSize) {
|
||||
u32 fSize = 0;
|
||||
u8* buff = sd_file_read(args[0]->string.value, &fSize);
|
||||
if (buff == NULL) {
|
||||
SCRIPT_FATAL_ERR("Failed to read file");
|
||||
}
|
||||
|
||||
return newIntVariablePtr(fSize);
|
||||
}
|
||||
|
||||
ClassFunction(stdFileWrite){
|
||||
return newIntVariablePtr(sd_save_to_file(args[1]->solvedArray.vector.data, args[1]->solvedArray.vector.count, args[0]->string.value));
|
||||
}
|
||||
@@ -506,6 +516,7 @@ STUBBED(stdFileMove)
|
||||
STUBBED(stdLaunchPayload)
|
||||
STUBBED(stdFileWrite)
|
||||
STUBBED(stdFileRead)
|
||||
STUBBED(stdFileReadSize)
|
||||
STUBBED(stdCombinePaths)
|
||||
STUBBED(stdEmmcFileWrite)
|
||||
STUBBED(stdEmmcFileRead)
|
||||
@@ -579,6 +590,7 @@ ClassFunctionTableEntry_t standardFunctionDefenitions[] = {
|
||||
{"movefile", stdFileMove, 2, twoStringArgStd},
|
||||
{"delfile", stdFileDel, 1, twoStringArgStd},
|
||||
{"readfile", stdFileRead, 1, twoStringArgStd},
|
||||
{"getfilesize", stdFileReadSize, 1, twoStringArgStd},
|
||||
{"writefile", stdFileWrite, 2, oneStringOneByteArrayStd},
|
||||
|
||||
// Utils
|
||||
|
||||
Reference in New Issue
Block a user