Fastfs testing

This commit is contained in:
Such Meme, Many Skill
2020-05-19 17:54:21 +02:00
parent a8e86c2de3
commit b91c36d3fa
6 changed files with 249 additions and 23 deletions

View File

@@ -191,7 +191,6 @@ int filemenu(menu_entry file){
break;
}
fsreader_readfolder(currentpath);
break;
case FILE_PAYLOAD:
launch_payload(fsutil_getnextloc(currentpath, file.name));
@@ -205,7 +204,6 @@ int filemenu(menu_entry file){
*/
runScript(fsutil_getnextloc(currentpath, file.name));
fsreader_readfolder(currentpath);
break;
case FILE_HEXVIEW:
viewbytes(fsutil_getnextloc(currentpath, file.name));
@@ -213,7 +211,6 @@ int filemenu(menu_entry file){
case FILE_DUMPBIS:
gfx_clearscreen();
extract_bis_file(fsutil_getnextloc(currentpath, file.name), currentpath);
fsreader_readfolder(currentpath);
hidWait();
break;
case FILE_SIGN:
@@ -231,5 +228,6 @@ int filemenu(menu_entry file){
return -1;
}
fsreader_readfolder(currentpath);
return 0;
}

View File

@@ -15,9 +15,8 @@ int fsact_copy(const char *locin, const char *locout, u8 options){
FIL in, out;
FILINFO in_info;
u64 sizeRemaining, toCopy;
UINT temp1, temp2;
u8 *buff, toPrint = options & COPY_MODE_PRINT, toCancel = options & COPY_MODE_CANCEL;
u32 x, y, i = 11;
u32 x, y, i = 11, toSpeed;
int res;
gfx_con_getpos(&x, &y);
@@ -53,22 +52,20 @@ int fsact_copy(const char *locin, const char *locout, u8 options){
sizeRemaining = f_size(&in);
const u64 totalsize = sizeRemaining;
DWORD *clmt_in = f_expand_cltbl(&in, BUFSIZE / 4, 0);
DWORD *clmt_out = f_expand_cltbl(&out, BUFSIZE / 4, totalsize);
while (sizeRemaining > 0){
toCopy = MIN(sizeRemaining, BUFSIZE);
if ((res = f_read(&in, buff, toCopy, &temp1))){
if ((res = f_read_fast(&in, buff, toCopy))){
gfx_errDisplay("copy", res, 5);
return 1;
break;
}
if ((res = f_write(&out, buff, toCopy, &temp2))){
if ((res = f_write_fast(&out, buff, toCopy))){
gfx_errDisplay("copy", res, 6);
return 1;
}
if (temp1 != temp2){
gfx_errDisplay("copy", ERR_DISK_WRITE_FAILED, 7);
return 1;
break;
}
sizeRemaining -= toCopy;
@@ -100,13 +97,10 @@ int fsact_copy(const char *locin, const char *locout, u8 options){
f_close(&out);
free(buff);
if ((res = f_chmod(locout, in_info.fattrib, 0x3A))){
gfx_errDisplay("copy", res, 8);
return 1;
}
f_chmod(locout, in_info.fattrib, 0x3A);
f_stat(locin, &in_info); //somehow stops fatfs from being weird
return 0;
return res;
}
int fsact_del_recursive(char *path){

View File

@@ -286,7 +286,9 @@ void runScript(char *path){
gfx_clearscreen();
utils_copystring(path, &path_local);
res = f_open(&scriptin, path, FA_READ | FA_OPEN_EXISTING);
DWORD *clmt_in = f_expand_cltbl(&scriptin, BUFSIZE / 4, 0);
if (res != FR_OK){
gfx_errDisplay("ParseScript", res, 1);
return;