From 4631271a75861644853b4245f592366c7f42bf60 Mon Sep 17 00:00:00 2001 From: Joostinonline Date: Tue, 18 Feb 2014 01:37:54 +0000 Subject: [PATCH] -Removed some unused code -Fixed DM/DML report info --- include/gecko.h | 6 ++-- source/gui.c | 83 ----------------------------------------------- source/sysCheck.c | 10 +++--- source/update.c | 6 ++-- 4 files changed, 10 insertions(+), 95 deletions(-) diff --git a/include/gecko.h b/include/gecko.h index f884fe7..284ace3 100644 --- a/include/gecko.h +++ b/include/gecko.h @@ -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 diff --git a/source/gui.c b/source/gui.c index a8b13cf..f6fa16a 100644 --- a/source/gui.c +++ b/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 diff --git a/source/sysCheck.c b/source/sysCheck.c index aef73d0..eed054c 100644 --- a/source/sysCheck.c +++ b/source/sysCheck.c @@ -217,10 +217,10 @@ int main(int argc, char **argv) if(argc>=1){ int i; for(i=0; i