update bdk

This commit is contained in:
suchmememanyskill
2021-06-24 21:44:59 +02:00
parent fec68fbe45
commit 050e7e9ba2
53 changed files with 1015 additions and 911 deletions

View File

@@ -12,7 +12,7 @@ char *CombinePaths(const char *current, const char *add){
size_t size = strlen(current) + strlen(add) + 2;
ret = (char*) malloc (size);
sprintf(ret, (current[strlen(current) - 1] == '/') ? "%s%s" : "%s/%s", current, add);
s_printf(ret, (current[strlen(current) - 1] == '/') ? "%s%s" : "%s/%s", current, add);
return ret;
}

View File

@@ -180,7 +180,7 @@ void FileMenu(char *path, FSEntry_t entry){
FileMenuEntries[0].sizeUnion = entry.sizeUnion;
char attribs[16];
char *attribList = GetFileAttribs(entry);
sprintf(attribs, "Attribs:%s\n", attribList);
s_printf(attribs, "Attribs:%s\n", attribList);
free(attribList);
FileMenuEntries[2].name = attribs;

View File

@@ -114,7 +114,7 @@ int FolderMenu(const char *path){
char attribs[16];
char *attribList = GetFileAttribs(file);
sprintf(attribs, "Attribs:%s\n", attribList);
s_printf(attribs, "Attribs:%s\n", attribList);
free(attribList);
FolderMenuEntries[2].name = attribs;

View File

@@ -72,7 +72,7 @@ int newMenu(Vector_t* vec, int startIndex, int screenLenX, int screenLenY, u8 op
if (options & ENABLEPAGECOUNT){
SETCOLOR(COLOR_DEFAULT, COLOR_WHITE);
char temp[40] = "";
sprintf(temp, " Page %d / %d | Total %d entries", (selected / screenLenY) + 1, ((vec->count - 1) / screenLenY) + 1, entryCount);
s_printf(temp, " Page %d / %d | Total %d entries", (selected / screenLenY) + 1, ((vec->count - 1) / screenLenY) + 1, entryCount);
gfx_con_setpos(YLEFT - strlen(temp) * 18, 0);
gfx_printf(temp);
}

View File

@@ -318,8 +318,8 @@ void nx_emmc_bis_cluster_cache_init()
free(cluster_lookup_buf);
// Check if carveout protected, in case of old hwinit (pre 4.0.0) chainload.
*(vu32 *)NX_BIS_LOOKUP_ADR = 0;
if (*(vu32 *)NX_BIS_LOOKUP_ADR != 0)
*(vu32 *)NX_BIS_LOOKUP_ADDR = 0;
if (*(vu32 *)NX_BIS_LOOKUP_ADDR != 0)
{
cluster_lookup_buf = (u32 *)malloc(cluster_lookup_size + 0x2000);
cluster_lookup = (u32 *)ALIGN((u32)cluster_lookup_buf, 0x1000);
@@ -327,7 +327,7 @@ void nx_emmc_bis_cluster_cache_init()
else
{
cluster_lookup_buf = NULL;
cluster_lookup = (u32 *)NX_BIS_LOOKUP_ADR;
cluster_lookup = (u32 *)NX_BIS_LOOKUP_ADDR;
}
// Clear cluster lookup table and reset end index.

View File

@@ -41,7 +41,7 @@ void DumpSysFw(){
}
baseSdPath = malloc(36 + 16);
sprintf(baseSdPath, "sd:/tegraexplorer/Firmware/%d (%s)", TConf.pkg1ver, TConf.pkg1ID);
s_printf(baseSdPath, "sd:/tegraexplorer/Firmware/%d (%s)", TConf.pkg1ver, TConf.pkg1ID);
int baseSdPathLen = strlen(baseSdPath);
f_mkdir("sd:/tegraexplorer");
@@ -81,7 +81,7 @@ void DumpSysFw(){
int total = 1;
vecDefArray(FSEntry_t*, fsEntries, fileVec);
for (int i = 0; i < fileVec.count; i++){
sprintf(sysPath, (fsEntries[i].isDir) ? "%s/%s/00" : "%s/%s", "bis:/Contents/registered", fsEntries[i].name);
s_printf(sysPath, (fsEntries[i].isDir) ? "%s/%s/00" : "%s/%s", "bis:/Contents/registered", fsEntries[i].name);
int contentType = GetNcaType(sysPath);
if (contentType < 0){
@@ -90,7 +90,7 @@ void DumpSysFw(){
}
char *sdPath = malloc(baseSdPathLen + 45);
sprintf(sdPath, "%s/%s", baseSdPath, fsEntries[i].name);
s_printf(sdPath, "%s/%s", baseSdPath, fsEntries[i].name);
if (contentType == Meta)
memcpy(sdPath + strlen(sdPath) - 4, ".cnmt.nca", 10);
@@ -214,7 +214,7 @@ void TakeScreenshot(){
char *name, *path;
const char basepath[] = "sd:/tegraexplorer/screenshots";
name = malloc(40);
sprintf(name, "Screenshot_%08X.bmp", get_tmr_us());
s_printf(name, "Screenshot_%08X.bmp", get_tmr_us());
f_mkdir("sd:/tegraexplorer");
f_mkdir(basepath);