mirror of
https://github.com/modmii/SysCheck-ModMii-Edition.git
synced 2024-11-25 09:36:54 +01:00
-Removed some unused code
-Fixed DM/DML report info
This commit is contained in:
parent
e2e99984ec
commit
4631271a75
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
#ifndef _GECKO_H_
|
||||
#define _GECKO_H_
|
||||
|
||||
@ -7,6 +5,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//#define NO_DEBUG
|
||||
|
||||
#ifndef NO_DEBUG
|
||||
//use this just like printf();
|
||||
void gprintf(const char *str, ...);
|
||||
@ -20,8 +20,6 @@ extern "C" {
|
||||
#define InitGecko() false
|
||||
#endif /* NO_DEBUG */
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
83
source/gui.c
83
source/gui.c
@ -38,89 +38,6 @@ GRRLIB_texImg *tex_loadingbarblue_png;
|
||||
GRRLIB_texImg *tex_window_png;
|
||||
GRRLIB_texImg *tex_ScreenBuf;
|
||||
|
||||
typedef struct map_entry
|
||||
{
|
||||
char name[8];
|
||||
u8 hash[20];
|
||||
} __attribute__((packed)) map_entry_t;
|
||||
static char contentMapPath[] ATTRIBUTE_ALIGN(32) = "/shared1/content.map";
|
||||
static const u8 WIIFONT_HASH[] = {0x32, 0xb3, 0x39, 0xcb, 0xbb, 0x50, 0x7d, 0x50, 0x27, 0x79, 0x25, 0x9a, 0x78, 0x66, 0x99, 0x5d, 0x03, 0x0b, 0x1d, 0x88};
|
||||
static const u8 WIIFONT_HASH_KOR[] = {0xb7, 0x15, 0x6d, 0xf0, 0xf4, 0xae, 0x07, 0x8f, 0xd1, 0x53, 0x58, 0x3e, 0x93, 0x6e, 0x07, 0xc0, 0x98, 0x77, 0x49, 0x0e};
|
||||
u8 *systemFont;
|
||||
s32 systemFontSize = 0;
|
||||
|
||||
|
||||
bool loadSystemFont(bool korean)
|
||||
{
|
||||
u8 *contentMap = NULL;
|
||||
u32 mapsize = 0;
|
||||
int i = 0;
|
||||
s32 ret = 0;
|
||||
|
||||
ret = read_file_from_nand(contentMapPath, &contentMap, &mapsize);
|
||||
if(ret < 0)
|
||||
return false;
|
||||
|
||||
int fileCount = mapsize / sizeof(map_entry_t);
|
||||
|
||||
map_entry_t *mapEntryList = (map_entry_t *) contentMap;
|
||||
|
||||
for (i = 0; i < fileCount; i++)
|
||||
{
|
||||
if (memcmp(mapEntryList[i].hash, korean ? WIIFONT_HASH_KOR : WIIFONT_HASH, 20) != 0)
|
||||
continue;
|
||||
|
||||
// Name found, load it and unpack it
|
||||
char font_filename[32] ATTRIBUTE_ALIGN(32);
|
||||
snprintf(font_filename, sizeof(font_filename), "/shared1/%.8s.app", mapEntryList[i].name);
|
||||
|
||||
u8 *fontArchive = NULL;
|
||||
u32 filesize = 0;
|
||||
|
||||
ret = read_file_from_nand(font_filename, &fontArchive, &filesize);
|
||||
if(ret < 0)
|
||||
return false;
|
||||
|
||||
const U8Header *u8Archive = (U8Header *) fontArchive;
|
||||
const U8Entry *fst = (const U8Entry *) (((const u8 *) u8Archive) + u8Archive->rootNodeOffset);
|
||||
|
||||
if(fst[0].numEntries < 1)
|
||||
{
|
||||
free(fontArchive);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(systemFont)
|
||||
free(systemFont);
|
||||
|
||||
systemFontSize = fst[1].fileLength;
|
||||
systemFont = allocate_memory(systemFontSize);
|
||||
if(!systemFont)
|
||||
{
|
||||
free(fontArchive);
|
||||
continue;
|
||||
}
|
||||
|
||||
memcpy(systemFont, fontArchive + fst[1].fileOffset, systemFontSize);
|
||||
|
||||
free(fontArchive);
|
||||
free(contentMap);
|
||||
MountSD();
|
||||
FILE *fp = fopen("sd:/test.ttf", "wb");
|
||||
if (fp)
|
||||
{
|
||||
fwrite(systemFont, 1, systemFontSize, fp);
|
||||
fclose(fp);
|
||||
}
|
||||
UnmountSD();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
free(contentMap);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int initGUI(void) {
|
||||
// Initialise the Graphics & Video subsystem
|
||||
|
@ -217,10 +217,10 @@ int main(int argc, char **argv)
|
||||
if(argc>=1){
|
||||
int i;
|
||||
for(i=0; i<argc; i++){
|
||||
if(strncmp("--debug=true", argv[i], 12)==0){
|
||||
if(strncmp("--debug=true", argv[i], sizeof("--debug=true"))==0){
|
||||
debug = true;
|
||||
gprintf("--debug=true\n");
|
||||
} else if(strncmp("--forceNoAHBPROT=true", argv[i], 21)==0){
|
||||
} else if(strncmp("--forceNoAHBPROT=true", argv[i], sizeof("--forceNoAHBPROT=true"))==0){
|
||||
forceNoAHBPROT = true;
|
||||
gprintf("--forceNoAHBPROT=true\n");
|
||||
}
|
||||
@ -228,6 +228,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
SYSSETTINGS SystemInfo;
|
||||
SystemInfo.deviceType = IS_WII_U;
|
||||
memset(SystemInfo.miosInfo, 0, sizeof(SystemInfo.miosInfo));
|
||||
|
||||
if (AHB_ACCESS && !forceNoAHBPROT) IosPatch_RUNTIME(true, false, false, false);
|
||||
SystemInfo.nandAccess = CheckNANDAccess();
|
||||
@ -844,12 +845,11 @@ int main(int argc, char **argv)
|
||||
strcat(ReportBuffer[SYSMENU], TXT_Unknown);
|
||||
|
||||
} else if (systemmenu.hasInfo) {
|
||||
u32 realSysVersion = systemmenu.realRevision;
|
||||
SystemInfo.sysNinVersion = GetSysMenuNintendoVersion(realSysVersion);
|
||||
SystemInfo.sysNinVersion = GetSysMenuNintendoVersion(systemmenu.realRevision);
|
||||
SystemInfo.sysMenuRegion = GetSysMenuRegion(SystemInfo.sysMenuVer);
|
||||
sprintf(ReportBuffer[TEXT_REGION], "%s: %s", TXT_Region, SystemInfo.validregion ? Regions[SystemInfo.systemRegion] : "");
|
||||
if (SystemInfo.validregion)
|
||||
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu3, SystemInfo.sysNinVersion, SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer, realSysVersion, systemmenu.info);
|
||||
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu3, SystemInfo.sysNinVersion, SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer, systemmenu.realRevision, systemmenu.info);
|
||||
else
|
||||
strcat(ReportBuffer[SYSMENU], TXT_Unknown);
|
||||
} else {
|
||||
|
@ -15,7 +15,7 @@ s32 downloadSyscheckFile(const char* fileName) {
|
||||
char buf[128] = {0};
|
||||
u32 http_status;
|
||||
u8* outbuf;
|
||||
u32 lenght;
|
||||
u32 length;
|
||||
|
||||
snprintf(buf, sizeof(buf), "http://syscheck-hd.googlecode.com/svn/trunk/SysCheckHDE/%s", fileName);
|
||||
|
||||
@ -33,7 +33,7 @@ s32 downloadSyscheckFile(const char* fileName) {
|
||||
}
|
||||
}
|
||||
|
||||
ret = http_get_result(&http_status, &outbuf, &lenght);
|
||||
ret = http_get_result(&http_status, &outbuf, &length);
|
||||
|
||||
if (((int)*outbuf & 0xF0000000) == 0xF0000000)
|
||||
{
|
||||
@ -49,7 +49,7 @@ s32 downloadSyscheckFile(const char* fileName) {
|
||||
gprintf("File Error\n");
|
||||
return -3;
|
||||
} else {
|
||||
fwrite(outbuf, lenght, 1, file);
|
||||
fwrite(outbuf, length, 1, file);
|
||||
fclose(file);
|
||||
}
|
||||
free(outbuf);
|
||||
|
Loading…
Reference in New Issue
Block a user