mirror of
https://github.com/suchmememanyskill/TegraExplorer.git
synced 2024-11-08 13:11:54 +00:00
Misc changes
This commit is contained in:
parent
3f6d1b532c
commit
761ceb7dbe
5 changed files with 34 additions and 9 deletions
|
@ -10,6 +10,7 @@
|
||||||
#include "../utils/util.h"
|
#include "../utils/util.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "script.h"
|
#include "script.h"
|
||||||
|
#include "te.h"
|
||||||
|
|
||||||
fs_entry *fileobjects;
|
fs_entry *fileobjects;
|
||||||
char rootpath[10] = "";
|
char rootpath[10] = "";
|
||||||
|
@ -19,7 +20,7 @@ u8 clipboardhelper = 0;
|
||||||
extern const char sizevalues[4][3];
|
extern const char sizevalues[4][3];
|
||||||
extern int launch_payload(char *path);
|
extern int launch_payload(char *path);
|
||||||
|
|
||||||
menu_item explfilemenu[12] = {
|
menu_item explfilemenu[13] = {
|
||||||
{"-- File Menu --", COLOR_BLUE, -1, 0},
|
{"-- File Menu --", COLOR_BLUE, -1, 0},
|
||||||
{"FILE", COLOR_GREEN, -1, 0},
|
{"FILE", COLOR_GREEN, -1, 0},
|
||||||
{"\nSIZE", COLOR_VIOLET, -1, 0},
|
{"\nSIZE", COLOR_VIOLET, -1, 0},
|
||||||
|
@ -31,7 +32,8 @@ menu_item explfilemenu[12] = {
|
||||||
{"Launch Payload", COLOR_ORANGE, PAYLOAD, 1},
|
{"Launch Payload", COLOR_ORANGE, PAYLOAD, 1},
|
||||||
{"Launch Script", COLOR_YELLOW, SCRIPT, 1},
|
{"Launch Script", COLOR_YELLOW, SCRIPT, 1},
|
||||||
{"View Hex", COLOR_GREEN, HEXVIEW, 1},
|
{"View Hex", COLOR_GREEN, HEXVIEW, 1},
|
||||||
{"Extract Bis", COLOR_RED, DUMPBIS, 1}
|
{"Extract BIS", COLOR_RED, DUMPBIS, 1},
|
||||||
|
{"Restore BIS", COLOR_RED, RESTOREBIS, 1}
|
||||||
};
|
};
|
||||||
|
|
||||||
menu_item explfoldermenu[6] = {
|
menu_item explfoldermenu[6] = {
|
||||||
|
@ -317,12 +319,16 @@ int filemenu(fs_entry file){
|
||||||
else
|
else
|
||||||
explfilemenu[9].property = -1;
|
explfilemenu[9].property = -1;
|
||||||
|
|
||||||
if (strstr(file.name, ".bis") != NULL)
|
if (strstr(file.name, ".bis") != NULL){
|
||||||
explfilemenu[11].property = 1;
|
explfilemenu[11].property = 1;
|
||||||
else
|
explfilemenu[12].property = 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
explfilemenu[11].property = -1;
|
explfilemenu[11].property = -1;
|
||||||
|
explfilemenu[12].property = -1;
|
||||||
|
}
|
||||||
|
|
||||||
temp = makemenu(explfilemenu, 12);
|
temp = makemenu(explfilemenu, 13);
|
||||||
|
|
||||||
switch (temp){
|
switch (temp){
|
||||||
case COPY:
|
case COPY:
|
||||||
|
@ -348,6 +354,9 @@ int filemenu(fs_entry file){
|
||||||
extract_bis_file(getnextloc(currentpath, file.name), currentpath);
|
extract_bis_file(getnextloc(currentpath, file.name), currentpath);
|
||||||
btn_wait();
|
btn_wait();
|
||||||
break;
|
break;
|
||||||
|
case RESTOREBIS:
|
||||||
|
message(COLOR_ORANGE, "Stubbed");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -36,7 +36,8 @@ enum filemenuoptions {
|
||||||
PAYLOAD,
|
PAYLOAD,
|
||||||
SCRIPT,
|
SCRIPT,
|
||||||
HEXVIEW,
|
HEXVIEW,
|
||||||
DUMPBIS
|
DUMPBIS,
|
||||||
|
RESTOREBIS
|
||||||
};
|
};
|
||||||
|
|
||||||
enum foldermenuoptions {
|
enum foldermenuoptions {
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#include "../mem/minerva.h"
|
#include "../mem/minerva.h"
|
||||||
#include "../power/max17050.h"
|
#include "../power/max17050.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include "../storage/emummc.h"
|
||||||
|
#include "emmc.h"
|
||||||
|
|
||||||
const char fixedoptions[3][50] = {
|
const char fixedoptions[3][50] = {
|
||||||
"Folder -> previous folder ",
|
"Folder -> previous folder ",
|
||||||
|
@ -136,6 +138,16 @@ int makewaitmenunoclear(char *initialmessage, char *hiddenmessage, int timer){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
int mmcChoiceMenu(){
|
||||||
|
if (emu_cfg.enabled){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return SYSMMC;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
void gfx_print_length(int size, char *toprint){
|
void gfx_print_length(int size, char *toprint){
|
||||||
char *temp;
|
char *temp;
|
||||||
temp = (char*) malloc (size + 1);
|
temp = (char*) malloc (size + 1);
|
||||||
|
|
|
@ -375,6 +375,11 @@ int restore_emmc_part(char *path, sdmmc_storage_t *mmcstorage, emmc_part_t *part
|
||||||
|
|
||||||
buf = calloc(16384, sizeof(u8));
|
buf = calloc(16384, sizeof(u8));
|
||||||
|
|
||||||
|
if (!buf){
|
||||||
|
message(COLOR_RED, "Calloc returned null!");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if ((res = f_stat(path, &fno))){
|
if ((res = f_stat(path, &fno))){
|
||||||
message(COLOR_RED, "f_stat() failed! err: %d", res);
|
message(COLOR_RED, "f_stat() failed! err: %d", res);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -430,7 +435,7 @@ int restore_emmc_part(char *path, sdmmc_storage_t *mmcstorage, emmc_part_t *part
|
||||||
totalSectors -= num;
|
totalSectors -= num;
|
||||||
bytesWritten += num * NX_EMMC_BLOCKSIZE;
|
bytesWritten += num * NX_EMMC_BLOCKSIZE;
|
||||||
|
|
||||||
pct = (u64)((u64)(lba_curr - part->lba_start) * 100u) / (u64)(part->lba_end - part->lba_start);
|
pct = (u64)((u64)(bytesWritten) * 100u) / (u64)(fno.fsize);
|
||||||
gfx_printf("Progress: %d%%\r", pct);
|
gfx_printf("Progress: %d%%\r", pct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,7 +462,6 @@ int restore_emmc_file(char *path, const char *target, u8 partition, u8 mmctype){
|
||||||
restore_emmc_part(path, &storage, &bootPart);
|
restore_emmc_part(path, &storage, &bootPart);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sdmmc_storage_set_mmc_partition(&storage, partition);
|
|
||||||
if (connect_part(target)){
|
if (connect_part(target)){
|
||||||
message(COLOR_RED, "Find of partition failed!\nPart: %s", target);
|
message(COLOR_RED, "Find of partition failed!\nPart: %s", target);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -130,7 +130,6 @@ void MainMenu_Tools(){
|
||||||
dump_emmc_parts(PART_BOOT | PART_PKG2, SYSMMC);
|
dump_emmc_parts(PART_BOOT | PART_PKG2, SYSMMC);
|
||||||
break;
|
break;
|
||||||
case RESTORE_BOOT:
|
case RESTORE_BOOT:
|
||||||
SWAPCOLOR(COLOR_ORANGE);
|
|
||||||
if (makewaitmenu(
|
if (makewaitmenu(
|
||||||
"WARNING!\nThis will mess with your switch boot files\nMake a nand backup beforehand!\n\nThis will pull from path:\nsd:/tegraexplorer/boot.bis\n\nVol +/- to cancel\n",
|
"WARNING!\nThis will mess with your switch boot files\nMake a nand backup beforehand!\n\nThis will pull from path:\nsd:/tegraexplorer/boot.bis\n\nVol +/- to cancel\n",
|
||||||
"Power to confirm",
|
"Power to confirm",
|
||||||
|
|
Loading…
Reference in a new issue