1
0
Fork 0
mirror of https://github.com/suchmememanyskill/TegraExplorer.git synced 2024-12-26 11:26:05 +00:00

Move over script and tools

This commit is contained in:
Such Meme, Many Skill 2020-03-18 12:18:39 +01:00
parent c60eb4b722
commit ff618bc285
10 changed files with 67 additions and 44 deletions

View file

@ -4,6 +4,7 @@
extern const char *gfx_file_size_names[];
extern const char *menu_sd_states[];
extern const char *emmc_fs_entries[];
extern const char *utils_err_codes[];
enum mainmenu_main_return {
MAIN_SDCARD = 0,

View file

@ -16,4 +16,22 @@ const char *emmc_fs_entries[] = {
"SYSTEM",
"USER",
"SAFE"
};
const char *utils_err_codes[] = {
"OK",
"I/O ERROR",
"DRIVE LOOKUP FAILED",
"NOT READY",
"NO FILE",
"NO PATH",
"PATH INVALID",
"ACCESS DENIED",
"ACCESS DENIED",
"INVALID PTR",
"PROTECTED",
"INVALID DRIVE",
"NO MEM",
"NO FAT",
"MKFS ABORT"
};

View file

@ -9,7 +9,7 @@
#include "../gfx/gfx.h"
#include "../utils/util.h"
#include "io.h"
#include "script.h"
#include "utils/script.h"
#include "te.h"
fs_entry *fileobjects;

View file

@ -7,6 +7,7 @@
#include "../../utils/btn.h"
#include "../../utils/util.h"
#include "../../mem/heap.h"
#include "../common/common.h"
void gfx_clearscreen(){
@ -41,18 +42,20 @@ int gfx_message(u32 color, const char* message, ...){
return btn_wait();
}
int gfx_errprint(u32 color, int func, int err, int add){
int gfx_errprint(char *src_func, int err, int loc){
gfx_clearscreen();
SWAPCOLOR(COLOR_ORANGE);
gfx_printf("\nAn error occured:\n\n");
gfx_printf("Function: %s\nErrcode: %d\nDesc: %s\n");
gfx_printf("Function: %s\nErrcode: %d\n", src_func, err);
if (add)
gfx_printf("Additional info: %d");
if (err < 15)
gfx_printf("Desc: %s\n", utils_err_codes[err]);
if (loc)
gfx_printf("Loc: %d\n", loc);
gfx_printf("\nPress any button to return");
RESETCOLOR;
return btn_wait();
}

View file

@ -8,7 +8,7 @@
void gfx_clearscreen();
int gfx_message(u32 color, const char* message, ...);
int gfx_errprint(u32 color, int func, int err, int add);
int gfx_errprint(char *src_func, int err, int loc);
int gfx_makewaitmenu(char *hiddenmessage, int timer);
void gfx_printlength(int size, char *toprint);
void gfx_printandclear(char *in, int length);

View file

@ -3,18 +3,19 @@
#include "te.h"
#include "gfx.h"
#include "../utils/util.h"
#include "tools.h"
#include "utils/tools.h"
#include "fs.h"
#include "io.h"
#include "../utils/btn.h"
#include "emmc.h"
#include "../storage/emummc.h"
#include "script.h"
#include "utils/script.h"
#include "common/common.h"
#include "gfx/menu.h"
#include "utils/utils.h"
#include "gfx/gfxutils.h"
extern bool sd_mount();
extern void sd_unmount();

View file

@ -1,18 +1,18 @@
#include <string.h>
#include "../mem/heap.h"
#include "gfx.h"
#include "fs.h"
#include "io.h"
#include "emmc.h"
#include "../utils/types.h"
#include "../libs/fatfs/ff.h"
#include "../utils/sprintf.h"
#include "../utils/btn.h"
#include "../gfx/gfx.h"
#include "../utils/util.h"
#include "../storage/emummc.h"
#include "../../mem/heap.h"
#include "../gfx/gfxutils.h"
#include "../fs.h"
#include "../io.h"
#include "../emmc.h"
#include "../../utils/types.h"
#include "../../libs/fatfs/ff.h"
#include "../../utils/sprintf.h"
#include "../../utils/btn.h"
#include "../../gfx/gfx.h"
#include "../../utils/util.h"
#include "../../storage/emummc.h"
#include "script.h"
#include "common/common.h"
#include "../common/common.h"
#include <stdlib.h>
@ -182,11 +182,11 @@ void ParseScript(char* path){
forceExit = false;
currentcolor = COLOR_WHITE;
clearscreen();
gfx_clearscreen();
res = f_open(&in, path, FA_READ | FA_OPEN_EXISTING);
if (res != FR_OK){
message(COLOR_RED, "File Opening Failed\nErrcode %d", res);
gfx_errprint("ParseScript", res, 1);
return;
}

View file

@ -1,26 +1,26 @@
#include "tools.h"
#include "gfx.h"
#include "../libs/fatfs/ff.h"
#include "../gfx/gfx.h"
#include "../utils/btn.h"
#include "../soc/gpio.h"
#include "../utils/util.h"
#include "../utils/types.h"
#include "../libs/fatfs/diskio.h"
#include "../storage/sdmmc.h"
#include "../utils/sprintf.h"
#include "../soc/fuse.h"
#include "emmc.h"
#include "fs.h"
#include "io.h"
#include "common/common.h"
#include "../gfx/gfxutils.h"
#include "../../libs/fatfs/ff.h"
#include "../../gfx/gfx.h"
#include "../../utils/btn.h"
#include "../../soc/gpio.h"
#include "../../utils/util.h"
#include "../../utils/types.h"
#include "../../libs/fatfs/diskio.h"
#include "../../storage/sdmmc.h"
#include "../../utils/sprintf.h"
#include "../../soc/fuse.h"
#include "../emmc.h"
#include "../fs.h"
#include "../io.h"
#include "../common/common.h"
extern bool sd_mount();
extern void sd_unmount();
extern sdmmc_storage_t sd_storage;
void displayinfo(){
clearscreen();
gfx_clearscreen();
FATFS *fs;
DWORD fre_clust, fre_sect, tot_sect;
@ -68,7 +68,7 @@ void displayinfo(){
void displaygpio(){
int res;
clearscreen();
gfx_clearscreen();
gfx_printf("Updates gpio pins every 50ms:\nPress power to exit");
msleep(200);
while (1){
@ -99,7 +99,7 @@ int dumpfirmware(int mmc){
pkg1_info pkg1 = returnpkg1info();
u32 timer = get_tmr_s();
clearscreen();
gfx_clearscreen();
connect_mmc(mmc);
mount_mmc("SYSTEM", 2);
@ -149,7 +149,7 @@ void dumpusersaves(int mmc){
connect_mmc(mmc);
mount_mmc("USER", 2);
clearscreen();
gfx_clearscreen();
res = f_mkdir("sd:/tegraexplorer");
gfx_printf("Creating sd:/tegraexplorer, res: %d\nCopying:\n", res);
@ -173,7 +173,7 @@ void dumpusersaves(int mmc){
}
int format(int mode){
clearscreen();
gfx_clearscreen();
int res;
bool fatalerror = false;
DWORD plist[] = {666, 61145088};