More small tweaks/fixes

This commit is contained in:
J-D-K 2018-09-03 15:32:13 -04:00
parent fceaf2e21f
commit f5465b2152
6 changed files with 62 additions and 47 deletions

View File

@ -38,7 +38,7 @@ INCLUDES := inc
EXEFS_SRC := exefs_src
APP_TITLE := JKSV
APP_AUTHOR := JK_
APP_VERSION := 08/27/2018
APP_VERSION := 09/03/2018
ROMFS := romfs
#---------------------------------------------------------------------------------

View File

@ -61,7 +61,9 @@ int main(int argc, const char *argv[])
//Just to be sure
fsdevUnmountDevice("sv");
data::sysSave = true, data::forceMount = false;
data::sysSave = true;
if(ui::confirm("Do you want to disable isMountable Checks?"))
data::forceMount = false;
data::loadDataInfo();
//Kick back to user

View File

@ -11,7 +11,7 @@
#include "util.h"
#include "file.h"
static std::string TITLE_TEXT = "JKSV - 08/27/2018";
static std::string TITLE_TEXT = "JKSV - 09/03/2018";
//background that can be drawn from "/JKSV/back.jpg"
//txtSide and fldSide are to fake alpha blending so the framerate doesn't suffer

View File

@ -229,7 +229,7 @@ namespace ui
devMenu.addOpt("Bis: SAFE");
devMenu.addOpt("Bis: SYSTEM");
devMenu.addOpt("Bis: USER");
devMenu.addOpt("NAND Backup");
devMenu.addOpt("NAND Backup (exFat only)");
}
void updateDevMenu(const uint64_t& down, const uint64_t& held, const touchPosition& p)
@ -246,75 +246,89 @@ namespace ui
fsdevUnmountDevice("sv");
fsOpenBisFileSystem(&sv, 28, "");
fsdevMountDevice("sv", sv);
advModePrep();
mstate = ADV_MDE;
prevState = DEV_MNU;
break;
case 1:
fsdevUnmountDevice("sv");
fsOpenBisFileSystem(&sv, 29, "");
fsdevMountDevice("sv", sv);
advModePrep();
mstate = ADV_MDE;
prevState = DEV_MNU;
break;
case 2:
fsdevUnmountDevice("sv");
fsOpenBisFileSystem(&sv, 31, "");
fsdevMountDevice("sv", sv);
advModePrep();
mstate = ADV_MDE;
prevState = DEV_MNU;
break;
case 3:
fsdevUnmountDevice("sv");
fsOpenBisFileSystem(&sv, 30, "");
fsdevMountDevice("sv", sv);
advModePrep();
mstate = ADV_MDE;
prevState = DEV_MNU;
break;
case 4:
fsdevUnmountDevice("sv");
FsStorage nand;
fsOpenBisStorage(&nand, 20);
uint64_t nandSize = 0, offset = 0;
fsStorageGetSize(&nand, &nandSize);
std::fstream nandOut("sdmc:/nand.bin", std::ios::out | std::ios::binary);
size_t nandBuffSize = 1024 * 1024 * 6;
uint8_t *nandBuff = new uint8_t[nandBuffSize];
progBar nandProg(nandSize);
while(offset < nandSize)
{
size_t readLen = 0;
if(offset + nandBuffSize < nandSize)
readLen = nandBuffSize;
else
readLen = nandSize - offset;
fsdevUnmountDevice("sv");
if(R_SUCCEEDED(fsStorageRead(&nand, offset, nandBuff, readLen)))
FsStorage nand;
fsOpenBisStorage(&nand, 20);
uint64_t nandSize = 0, offset = 0;
fsStorageGetSize(&nand, &nandSize);
std::fstream nandOut("sdmc:/JKSV/nand.bin", std::ios::out | std::ios::binary);
size_t nandBuffSize = 1024 * 1024 * 4;
uint8_t *nandBuff = new uint8_t[nandBuffSize];
progBar nandProg(nandSize);
while(offset < nandSize)
{
fsStorageFlush(&nand);
nandOut.write((char *)nandBuff, readLen);
offset += readLen;
}
else
{
ui::showMessage("Something went wrong while dumping your NAND.");
break;
size_t readLen = 0;
if(offset + nandBuffSize < nandSize)
readLen = nandBuffSize;
else
readLen = nandSize - offset;
if(R_SUCCEEDED(fsStorageRead(&nand, offset, nandBuff, readLen)))
{
fsStorageFlush(&nand);
nandOut.write((char *)nandBuff, readLen);
offset += readLen;
}
else
{
ui::showMessage("Something went wrong while dumping your NAND.");
break;
}
nandProg.update(offset);
nandProg.draw("Backing up NAND...");
gfxHandleBuffs();
}
nandProg.update(offset);
nandProg.draw("Backing up NAND...");
gfxHandleBuffs();
delete[] nandBuff;
nandOut.close();
fsStorageClose(&nand);
}
delete[] nandBuff;
nandOut.close();
fsStorageClose(&nand);
break;
}
advModePrep();
mstate = ADV_MDE;
prevState = DEV_MNU;
}
else if(down & KEY_B)
{

View File

@ -17,9 +17,7 @@ namespace ui
{
prog = _prog;
float divProg = prog / max;
float percent = (float)(divProg * 100);
width = (float)(percent * 1088) / 100;
width = (float)(((float)prog / (float)max) * 1088);
}
void progBar::draw(const std::string& text)

View File

@ -116,6 +116,7 @@ namespace ui
{
util::makeTitleDir(data::curUser, data::curData);
folderMenuPrepare(data::curUser, data::curData);
folderMenuInfo = util::getInfoString(data::curUser, data::curData);
mstate = FLD_SEL;
}