Compare commits
9 Commits
4.1.0-b1
...
save-close
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
520cf179cc | ||
|
|
2b2c5b7c5f | ||
|
|
1e5a09a407 | ||
|
|
efe0843706 | ||
|
|
c117f53b5c | ||
|
|
9e01bbf13e | ||
|
|
8bc5a23425 | ||
|
|
91261f1671 | ||
|
|
94e60e0ded |
2
Makefile
2
Makefile
@@ -11,7 +11,7 @@ include $(DEVKITARM)/base_rules
|
|||||||
IPL_LOAD_ADDR := 0x40008000
|
IPL_LOAD_ADDR := 0x40008000
|
||||||
LPVERSION_MAJOR := 4
|
LPVERSION_MAJOR := 4
|
||||||
LPVERSION_MINOR := 1
|
LPVERSION_MINOR := 1
|
||||||
LPVERSION_BUGFX := 0
|
LPVERSION_BUGFX := 1
|
||||||
LPVERSION := \"$(LPVERSION_MAJOR).$(LPVERSION_MINOR).$(LPVERSION_BUGFX)\"
|
LPVERSION := \"$(LPVERSION_MAJOR).$(LPVERSION_MINOR).$(LPVERSION_BUGFX)\"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|||||||
@@ -51,16 +51,18 @@ For question specifically for TegraExplorer, go to [my discord](https://discord.
|
|||||||
Based on [Lockpick_RCM](https://github.com/shchmue/Lockpick_RCM), and thus also based on [Hekate](https://github.com/CTCaer/hekate)
|
Based on [Lockpick_RCM](https://github.com/shchmue/Lockpick_RCM), and thus also based on [Hekate](https://github.com/CTCaer/hekate)
|
||||||
|
|
||||||
Awesome people who helped with this project:
|
Awesome people who helped with this project:
|
||||||
- shchmue
|
- [shchmue](https://github.com/shchmue)
|
||||||
- Dennthecafebabe
|
- [maddiethecafebabe](https://github.com/maddiethecafebabe/)
|
||||||
|
- [bleck9999](https://github.com/bleck9999)
|
||||||
|
|
||||||
Other awesome people:
|
Other awesome people:
|
||||||
- PhazonicRidley
|
- PhazonicRidley
|
||||||
- Dax
|
- Dax
|
||||||
- Huhen
|
- Huhen
|
||||||
- Bleck9999
|
|
||||||
- Exelix
|
- Exelix
|
||||||
- Emmo
|
- Emmo
|
||||||
|
- Gengar
|
||||||
|
- Einso
|
||||||
- JeffV
|
- JeffV
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|||||||
@@ -15,18 +15,22 @@ fv={a=readsave("bis:/save/8000000000000120")
|
|||||||
maj=((ver>>26)&((1<<6)- 1))
|
maj=((ver>>26)&((1<<6)- 1))
|
||||||
}.else(){print("Fw not found")pe()}
|
}.else(){print("Fw not found")pe()}
|
||||||
a=0 fwstr()}
|
a=0 fwstr()}
|
||||||
if(mountsys("SYSTEM")){print("SYSTEM MOUNT FAIL")pe()}
|
|
||||||
fv()
|
|
||||||
sysfw=fw
|
|
||||||
p("Sys' fw is",fw)
|
|
||||||
emufw=""
|
|
||||||
if (emu()){if(!mountemu("SYSTEM")){fv()emufw=fw p("Emu's fw is",fw)}}
|
|
||||||
op=["Exit","Dump sysmmc"].copy()
|
op=["Exit","Dump sysmmc"].copy()
|
||||||
if (emufw!=""){op+"Dump emummc"}
|
if (emu()){op+"Dump emummc"}
|
||||||
p()r=menu(op,0)clear()
|
p()r=menu(op,0)clear()
|
||||||
if(r==0){exit()}
|
if(r==0){exit()}
|
||||||
if(r==1){fw=sysfw if(mountsys("SYSTEM")){print("SYSTEM MOUNT FAIL")pe()}}
|
if(r==1){if(mountsys("SYSTEM")){print("SYSTEM MOUNT FAIL")pe()}}
|
||||||
if(r==2){fw=emufw if(mountemu("SYSTEM")){print("SYSTEM MOUNT FAIL")pe()}}
|
if(r==2){if(mountemu("SYSTEM")){print("SYSTEM MOUNT FAIL")pe()}}
|
||||||
|
|
||||||
|
clear()
|
||||||
|
fv()
|
||||||
|
p("Found firmware",fw)
|
||||||
|
p("Press Power or A to dump firmware, any other key to exit")
|
||||||
|
a = pause()
|
||||||
|
if (!a.a) {exit()}
|
||||||
|
clear()
|
||||||
|
|
||||||
mkdir("sd:/tegraexplorer")
|
mkdir("sd:/tegraexplorer")
|
||||||
mkdir("sd:/tegraexplorer/Firmware")
|
mkdir("sd:/tegraexplorer/Firmware")
|
||||||
bsp="sd:/tegraexplorer/Firmware/"+fw
|
bsp="sd:/tegraexplorer/Firmware/"+fw
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#REQUIRE KEYS
|
#REQUIRE KEYS
|
||||||
is=["8000000000000120","80000000000000d1","8000000000000047"]
|
is=["8000000000000120","8000000000000000"]
|
||||||
p=println
|
p=println
|
||||||
pr=print
|
pr=print
|
||||||
pe={pause() exit()}
|
pe={pause() exit()}
|
||||||
@@ -24,6 +24,45 @@ pr("Deleting system saves... ")
|
|||||||
f=readdir("bis:/save")
|
f=readdir("bis:/save")
|
||||||
if(f.folders.len()!=0){p("Folders in save dir???")pe()}
|
if(f.folders.len()!=0){p("Folders in save dir???")pe()}
|
||||||
f.files.foreach("x"){if(!is.contains(x)){if(delfile("bis:/save/"+x)){p("File deletion failed: ", x)pe()}}}
|
f.files.foreach("x"){if(!is.contains(x)){if(delfile("bis:/save/"+x)){p("File deletion failed: ", x)pe()}}}
|
||||||
|
pr("Done!\nSetting up indexer save...")
|
||||||
|
s=getfilesize("bis:/save/"+is[0])
|
||||||
|
ba0=["BYTE[]",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
|
||||||
|
ba120=["BYTE[]",0x20,0x01,0x00,0x00,0x00,0x00,0x00,0x80]
|
||||||
|
s1=s&0xFF
|
||||||
|
s2=(s>>8)&0xFF
|
||||||
|
s3=(s>>16)&0xFF
|
||||||
|
s4=(s>>24)&0xFF
|
||||||
|
idb=["BYTE[]",0x49,0x4D,0x4B,0x56,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x49,0x4D,0x45,0x4E,0x40,0x00,0x00,0x00,0x40,0x00,0x00,0x00].copy()
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba120)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba120)
|
||||||
|
idb.add(s1)
|
||||||
|
idb.add(s2)
|
||||||
|
idb.add(s3)
|
||||||
|
idb.add(s4)
|
||||||
|
idb.add(0x00)
|
||||||
|
idb.add(0x00)
|
||||||
|
idb.add(0x00)
|
||||||
|
idb.add(0x00)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idb.addrange(ba0)
|
||||||
|
idxs=readsave("bis:/save/"+is[1])
|
||||||
|
if(idxs.resize("/imkvdb.arc",idb.len())){p("imkvdb resize failed")pe()}
|
||||||
|
if(idxs.write("/imkvdb.arc",idb)){p("imkvdb write failed")pe()}
|
||||||
|
if(idxs.resize("/lastPublishedId",ba0.len())){p("lastPublishedId resize failed")pe()}
|
||||||
|
if(idxs.write("/lastPublishedId",ba0)){p("lastPublishedId write failed")pe()}
|
||||||
|
if(idxs.commit()){p("Indexer save commit failed")pe()}
|
||||||
|
idxs=0
|
||||||
pr("Done!\nDeleting user dirs...")ud=["Album","Contents","save","saveMeta","temp"]
|
pr("Done!\nDeleting user dirs...")ud=["Album","Contents","save","saveMeta","temp"]
|
||||||
if(mount("USER")){p("Mount failed!")pe()}
|
if(mount("USER")){p("Mount failed!")pe()}
|
||||||
ud.foreach("x"){pr("\n"+x,"")if(deldir("bis:/"+x)){p("Dir deletion failed")pe()}mkdir("bis:/"+x)}
|
ud.foreach("x"){pr("\n"+x,"")if(deldir("bis:/"+x)){p("Dir deletion failed")pe()}mkdir("bis:/"+x)}
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ Input_t *hidRead(){
|
|||||||
LbaseY = controller->lstick_y;
|
LbaseY = controller->lstick_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
inputs.up = (controller->up || (controller->lstick_y > LbaseY + 500)) ? 1 : 0;
|
inputs.up = (controller->up || inputs.volp || (controller->lstick_y > LbaseY + 500)) ? 1 : 0;
|
||||||
inputs.down = (controller->down || (controller->lstick_y < LbaseY - 500)) ? 1 : 0;
|
inputs.down = (controller->down || inputs.volm || (controller->lstick_y < LbaseY - 500)) ? 1 : 0;
|
||||||
inputs.left = (controller->left || (controller->lstick_x < LbaseX - 500)) ? 1 : 0;
|
inputs.left = (controller->left || (controller->lstick_x < LbaseX - 500)) ? 1 : 0;
|
||||||
inputs.right = (controller->right || (controller->lstick_x > LbaseX + 500)) ? 1 : 0;
|
inputs.right = (controller->right || (controller->lstick_x > LbaseX + 500)) ? 1 : 0;
|
||||||
}
|
}
|
||||||
@@ -71,8 +71,7 @@ Input_t *hidRead(){
|
|||||||
inputs.rLeft = (controller->rstick_x < RbaseX - 500) ? 1 : 0;
|
inputs.rLeft = (controller->rstick_x < RbaseX - 500) ? 1 : 0;
|
||||||
inputs.rRight = (controller->rstick_x > RbaseX + 500) ? 1 : 0;
|
inputs.rRight = (controller->rstick_x > RbaseX + 500) ? 1 : 0;
|
||||||
}
|
}
|
||||||
else
|
inputs.a = inputs.a || inputs.power;
|
||||||
inputs.a = inputs.power;
|
|
||||||
|
|
||||||
return &inputs;
|
return &inputs;
|
||||||
}
|
}
|
||||||
@@ -104,4 +103,4 @@ Input_t *hidWait(){
|
|||||||
bool hidConnected(){
|
bool hidConnected(){
|
||||||
jc_gamepad_rpt_t *controller = joycon_poll();
|
jc_gamepad_rpt_t *controller = joycon_poll();
|
||||||
return (controller->conn_l && controller->conn_r) ? 1 : 0;
|
return (controller->conn_l && controller->conn_r) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,27 @@ int arrayClassAdd(Variable_t *caller, Variable_t *add){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int arrayClassAddRange(Variable_t* caller, Variable_t* add)
|
||||||
|
{
|
||||||
|
// Check if IntArrayClass or StringArrayClass or ByteArrayClass
|
||||||
|
if ((caller->variableType == IntArrayClass) || (caller->variableType == StringArrayClass) || (caller->variableType == ByteArrayClass)) {
|
||||||
|
if (caller->variableType != add->variableType) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (s64 i = 0; i < add->solvedArray.vector.count; i++)
|
||||||
|
{
|
||||||
|
Variable_t v = arrayClassGetIdx(add, i);
|
||||||
|
if (arrayClassAdd(caller, &v))
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ClassFunction(getArrayIdx) {
|
ClassFunction(getArrayIdx) {
|
||||||
s64 getVal = (*args)->integer.value;
|
s64 getVal = (*args)->integer.value;
|
||||||
// Out of bounds
|
// Out of bounds
|
||||||
@@ -167,6 +188,20 @@ ClassFunction(arrayAdd) {
|
|||||||
return &emptyClass;
|
return &emptyClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClassFunction(arrayAddRange) {
|
||||||
|
Variable_t* arg = *args;
|
||||||
|
|
||||||
|
if (caller->readOnly) {
|
||||||
|
SCRIPT_FATAL_ERR("Array is read-only");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrayClassAddRange(caller, arg)) {
|
||||||
|
SCRIPT_FATAL_ERR("Adding the wrong type to a typed array");
|
||||||
|
}
|
||||||
|
|
||||||
|
return &emptyClass;
|
||||||
|
}
|
||||||
|
|
||||||
ClassFunction(arrayContains) {
|
ClassFunction(arrayContains) {
|
||||||
Vector_t* v = &caller->solvedArray.vector;
|
Vector_t* v = &caller->solvedArray.vector;
|
||||||
Variable_t* arg = *args;
|
Variable_t* arg = *args;
|
||||||
@@ -258,6 +293,7 @@ ClassFunctionTableEntry_t arrayFunctions[] = {
|
|||||||
{"set", arraySet, 2, oneIntOneAny},
|
{"set", arraySet, 2, oneIntOneAny},
|
||||||
{"+", arrayAdd, 1, anotherAnotherOneVarArg},
|
{"+", arrayAdd, 1, anotherAnotherOneVarArg},
|
||||||
{"add", arrayAdd, 1, anotherAnotherOneVarArg},
|
{"add", arrayAdd, 1, anotherAnotherOneVarArg},
|
||||||
|
{"addrange", arrayAddRange, 1, anotherAnotherOneVarArg},
|
||||||
{"-", arrayMinus, 1, anotherOneIntArg},
|
{"-", arrayMinus, 1, anotherOneIntArg},
|
||||||
{"contains", arrayContains, 1, anotherAnotherOneVarArg},
|
{"contains", arrayContains, 1, anotherAnotherOneVarArg},
|
||||||
{"bytestostr", bytesToStr, 0, 0},
|
{"bytestostr", bytesToStr, 0, 0},
|
||||||
|
|||||||
@@ -278,6 +278,7 @@ void freeVariableInternal(Variable_t* referencedTarget) {
|
|||||||
save_free_contexts(&referencedTarget->save->saveCtx);
|
save_free_contexts(&referencedTarget->save->saveCtx);
|
||||||
f_close(&referencedTarget->save->saveFile);
|
f_close(&referencedTarget->save->saveFile);
|
||||||
FREE(referencedTarget->save);
|
FREE(referencedTarget->save);
|
||||||
|
gfx_printf("Save closed\n");
|
||||||
#endif // !WIN32
|
#endif // !WIN32
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
u8 oneStringArgSave[] = {StringClass};
|
u8 oneStringArgSave[] = {StringClass};
|
||||||
u8 oneStrOneByteArrayArgSave[] = {StringClass, ByteArrayClass};
|
u8 oneStrOneByteArrayArgSave[] = {StringClass, ByteArrayClass};
|
||||||
|
u8 oneStringOneIntArgSave[] = {StringClass, IntClass};
|
||||||
|
|
||||||
ClassFunction(readFile){
|
ClassFunction(readFile){
|
||||||
Variable_t *arg = (*args);
|
Variable_t *arg = (*args);
|
||||||
@@ -96,11 +97,25 @@ ClassFunction(saveClassCommit){
|
|||||||
return newIntVariablePtr(!save_commit(&caller->save->saveCtx));
|
return newIntVariablePtr(!save_commit(&caller->save->saveCtx));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClassFunction(writeFileSize) {
|
||||||
|
Variable_t* arg = (*args);
|
||||||
|
save_data_file_ctx_t dataArc;
|
||||||
|
if (!save_open_file(&caller->save->saveCtx, &dataArc, arg->string.value, OPEN_MODE_WRITE))
|
||||||
|
return newIntVariablePtr(1);
|
||||||
|
|
||||||
|
if (!save_data_file_set_size(&dataArc, args[1]->integer.value)) {
|
||||||
|
return newIntVariablePtr(2);
|
||||||
|
};
|
||||||
|
|
||||||
|
return newIntVariablePtr(0);
|
||||||
|
}
|
||||||
|
|
||||||
ClassFunctionTableEntry_t saveFunctions[] = {
|
ClassFunctionTableEntry_t saveFunctions[] = {
|
||||||
{"read", readFile, 1, oneStringArgSave},
|
{"read", readFile, 1, oneStringArgSave},
|
||||||
{"write", writeFile, 2, oneStrOneByteArrayArgSave},
|
{"write", writeFile, 2, oneStrOneByteArrayArgSave},
|
||||||
//{"readdir", getFiles, 1, oneStringArgSave}, // Seems broken?
|
//{"readdir", getFiles, 1, oneStringArgSave}, // Seems broken?
|
||||||
{"commit", saveClassCommit, 0, 0},
|
{"commit", saveClassCommit, 0, 0},
|
||||||
|
{"resize", writeFileSize, 2, oneStringOneIntArgSave},
|
||||||
};
|
};
|
||||||
|
|
||||||
Variable_t getSaveMember(Variable_t* var, char* memberName) {
|
Variable_t getSaveMember(Variable_t* var, char* memberName) {
|
||||||
|
|||||||
@@ -399,6 +399,16 @@ ClassFunction(stdFileRead){
|
|||||||
return copyVariableToPtr(v);
|
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){
|
ClassFunction(stdFileWrite){
|
||||||
return newIntVariablePtr(sd_save_to_file(args[1]->solvedArray.vector.data, args[1]->solvedArray.vector.count, args[0]->string.value));
|
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(stdLaunchPayload)
|
||||||
STUBBED(stdFileWrite)
|
STUBBED(stdFileWrite)
|
||||||
STUBBED(stdFileRead)
|
STUBBED(stdFileRead)
|
||||||
|
STUBBED(stdFileReadSize)
|
||||||
STUBBED(stdCombinePaths)
|
STUBBED(stdCombinePaths)
|
||||||
STUBBED(stdEmmcFileWrite)
|
STUBBED(stdEmmcFileWrite)
|
||||||
STUBBED(stdEmmcFileRead)
|
STUBBED(stdEmmcFileRead)
|
||||||
@@ -579,6 +590,7 @@ ClassFunctionTableEntry_t standardFunctionDefenitions[] = {
|
|||||||
{"movefile", stdFileMove, 2, twoStringArgStd},
|
{"movefile", stdFileMove, 2, twoStringArgStd},
|
||||||
{"delfile", stdFileDel, 1, twoStringArgStd},
|
{"delfile", stdFileDel, 1, twoStringArgStd},
|
||||||
{"readfile", stdFileRead, 1, twoStringArgStd},
|
{"readfile", stdFileRead, 1, twoStringArgStd},
|
||||||
|
{"getfilesize", stdFileReadSize, 1, twoStringArgStd},
|
||||||
{"writefile", stdFileWrite, 2, oneStringOneByteArrayStd},
|
{"writefile", stdFileWrite, 2, oneStringOneByteArrayStd},
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
|
|||||||
@@ -157,12 +157,19 @@ char *ShowKeyboard(const char *toEdit, u8 alwaysRet){
|
|||||||
}
|
}
|
||||||
int val = (input->up || input->down) ? 11 : 1;
|
int val = (input->up || input->down) ? 11 : 1;
|
||||||
|
|
||||||
// Btn buttons do not work lol
|
if (input->volm) {
|
||||||
if (input->buttons & (JoyLLeft | JoyLUp | BtnVolM)){
|
if (pos > 0)
|
||||||
|
pos -= 1;
|
||||||
|
}
|
||||||
|
else if (input->volp) {
|
||||||
|
if (pos < 43)
|
||||||
|
pos += 1;
|
||||||
|
}
|
||||||
|
else if (input->buttons & (JoyLLeft | JoyLUp)){
|
||||||
if (pos > -1 + val)
|
if (pos > -1 + val)
|
||||||
pos -= val;
|
pos -= val;
|
||||||
}
|
}
|
||||||
if (input->buttons & (JoyLRight | JoyLDown | BtnVolP)){
|
else if (input->buttons & (JoyLRight | JoyLDown)){
|
||||||
if (pos < 44 - val)
|
if (pos < 44 - val)
|
||||||
pos += val;
|
pos += val;
|
||||||
}
|
}
|
||||||
@@ -178,4 +185,4 @@ char *ShowKeyboard(const char *toEdit, u8 alwaysRet){
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user