From e2e99984ec5ecedd57776a4406ab762b7b3509d5 Mon Sep 17 00:00:00 2001 From: Joostinonline Date: Sat, 15 Feb 2014 05:16:55 +0000 Subject: [PATCH] -Added translations for "Shop Channel Code" -Removed unused video code --- include/languages.h | 1 + include/video.h | 17 ------ source/languages.c | 8 ++- source/sys.c | 3 +- source/sysCheck.c | 5 +- source/tools.c | 3 +- source/upload.c | 3 +- source/video.c | 132 -------------------------------------------- sysCheck.pnproj | 2 +- 9 files changed, 13 insertions(+), 161 deletions(-) delete mode 100644 include/video.h delete mode 100644 source/video.c diff --git a/include/languages.h b/include/languages.h index 4711928..071569a 100644 --- a/include/languages.h +++ b/include/languages.h @@ -38,6 +38,7 @@ const char* TXT_HBC_STUB; const char* TXT_Hollywood; const char* TXT_ConsoleID; const char* TXT_ConsoleType; +const char* TXT_ShopCountry; const char* TXT_vBoot2; const char* TXT_NrOfTitles; const char* TXT_NrOfIOS; diff --git a/include/video.h b/include/video.h deleted file mode 100644 index 810aa87..0000000 --- a/include/video.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _VIDEO_H_ -#define _VIDEO_H_ - -// Wii Light state -#define WIILIGHT_OFF 0 -#define WIILIGHT_ON 1 - -// Prototypes -void InitialiseVideo(void); -void SetConsoleForegroundColor(u8, u8); -void SetConsoleBackgroundColor(u8, u8); -void ClearConsole(int); -void PrintText(char *, bool, bool, bool, int, int); -void WiiLightControl(int); - -#endif - diff --git a/source/languages.c b/source/languages.c index 553490f..35c148b 100644 --- a/source/languages.c +++ b/source/languages.c @@ -1,7 +1,6 @@ #include #include -#include "sys.h" -#include "video.h" +#include "sys.h" #include "fatMounter.h" #include "languages.h" @@ -60,6 +59,7 @@ int initLanguages(struct tm today) TXT_Hollywood = "Hollywood v0x%x"; TXT_ConsoleID = "Konsolen-ID: %d"; TXT_ConsoleType = "Konsolentyp: %s"; + TXT_ShopCountry ="Shop-Kanal-Land: %s (%u)"; TXT_vBoot2 = "Boot2 v%u"; TXT_NrOfTitles = "Es wurden %d Titel gefunden."; TXT_NrOfIOS = "Es wurden %d IOS gefunden, von denen %d funktionslos (Stub) sind."; @@ -134,6 +134,7 @@ int initLanguages(struct tm today) TXT_Hollywood = "Hollywood v0x%x"; TXT_ConsoleID = "Identifiant de la console: %d"; TXT_ConsoleType = "Type de Console: %s"; + TXT_ShopCountry ="Pays de la chaîne boutique: %s (%u)"; TXT_vBoot2 = "Boot2 v%u"; TXT_NrOfTitles = "%d titres trouves."; TXT_NrOfIOS = "%d IOS trouves sur cette console. %d sont des stubs."; @@ -208,6 +209,7 @@ int initLanguages(struct tm today) TXT_Hollywood = "Hollywood v0x%x"; TXT_ConsoleID = "ID console: %d"; TXT_ConsoleType = "Tipo Console: %s"; + TXT_ShopCountry ="Paese canale Shop: %s (%u)"; TXT_vBoot2 = "Boot2 v%u"; TXT_NrOfTitles = "Trovati %d giochi."; TXT_NrOfIOS = "Trovati %d IOS in questa console. %d di questi sono stub."; @@ -282,6 +284,7 @@ int initLanguages(struct tm today) TXT_Hollywood = "Hollywood v0x%x"; TXT_ConsoleID = "ID de consola: %d"; TXT_ConsoleType = "Tipo Consola: %s"; + TXT_ShopCountry ="Canal Tienda Country: %s (%u)"; TXT_vBoot2 = "Boot2 v%u"; TXT_NrOfTitles = "Encontrados %d titulos."; TXT_NrOfIOS = "Se encontraron %d IOS en esta consola. %d de ellos son stubs."; @@ -356,6 +359,7 @@ int initLanguages(struct tm today) TXT_Hollywood = "Hollywood v0x%x"; TXT_ConsoleID = "Console ID: %d"; TXT_ConsoleType = "Console Type: %s"; + TXT_ShopCountry =": %s (%u)"; TXT_vBoot2 = "Boot2 v%u"; TXT_NrOfTitles = "Found %d titles."; TXT_NrOfIOS = "Found %d IOS on this console. %d of them are stub."; diff --git a/source/sys.c b/source/sys.c index 2fc701d..d31e87f 100644 --- a/source/sys.c +++ b/source/sys.c @@ -13,8 +13,7 @@ #include #include -#include "sys.h" -#include "video.h" +#include "sys.h" #include "SysMenuInfo.h" #include "ticket_dat.h" diff --git a/source/sysCheck.c b/source/sysCheck.c index 62211b6..aef73d0 100644 --- a/source/sysCheck.c +++ b/source/sysCheck.c @@ -16,8 +16,7 @@ #include #include "tmd_dat.h" -#include "sys.h" -#include "video.h" +#include "sys.h" #include "fatMounter.h" #include "languages.h" #include "gui.h" @@ -1017,7 +1016,7 @@ int main(int argc, char **argv) sprintf(ReportBuffer[HOLLYWOOD], TXT_Hollywood, *HOLLYWOOD_VERSION); sprintf(ReportBuffer[CONSOLE_ID], TXT_ConsoleID, SystemInfo.deviceID); sprintf(ReportBuffer[CONSOLE_TYPE], TXT_ConsoleType, SystemInfo.deviceType ? "vWii" : "Wii"); - sprintf(ReportBuffer[COUNTRY], "Shop Channel Country: %s (%u)", (strlen(SystemInfo.country)) ? SystemInfo.country : TXT_Unknown, SystemInfo.shopcode); + sprintf(ReportBuffer[COUNTRY], TXT_ShopCountry, (strlen(SystemInfo.country)) ? SystemInfo.country : TXT_Unknown, SystemInfo.shopcode); sprintf(ReportBuffer[BOOT2_VERSION], TXT_vBoot2, SystemInfo.boot2version); sprintf(ReportBuffer[NR_OF_TITLES], TXT_NrOfTitles, SystemInfo.countTitles); sprintf(ReportBuffer[NR_OF_IOS], TXT_NrOfIOS, (SystemInfo.countIOS - SystemInfo.countBCMIOS), SystemInfo.countStubs); diff --git a/source/tools.c b/source/tools.c index c48b7c3..19f9c97 100644 --- a/source/tools.c +++ b/source/tools.c @@ -13,8 +13,7 @@ #include #include -#include "sys.h" -#include "video.h" +#include "sys.h" #include "SysMenuInfo.h" #include "ticket_dat.h" diff --git a/source/upload.c b/source/upload.c index c5263d7..deeabdf 100644 --- a/source/upload.c +++ b/source/upload.c @@ -13,8 +13,7 @@ #include #include -#include "sys.h" -#include "video.h" +#include "sys.h" #include "SysMenuInfo.h" #include "ticket_dat.h" diff --git a/source/video.c b/source/video.c deleted file mode 100644 index 356135a..0000000 --- a/source/video.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "video.h" - -static GXRModeObj *rmode = NULL; -static void *frontBuffer = NULL; - -// Initialise video -void InitialiseVideo(void) -{ - // Initialise the video system - VIDEO_Init(); - - // Get the preferred video mode from the system (corresponding to the settings in the Wii menu) - rmode = VIDEO_GetPreferredMode(NULL); - - GX_AdjustForOverscan(rmode, rmode, 32, 24); - - // Allocate memory for the display in the uncached region - frontBuffer = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - - // Initialise the console (required for printf) - console_init(frontBuffer, 20, 20, rmode->fbWidth, rmode->xfbHeight, rmode->fbWidth*VI_DISPLAY_PIX_SZ); - - // Set up the video registers with the chosen mode - VIDEO_Configure(rmode); - - // Now configure the FrameBuffer (display memory) - VIDEO_SetNextFramebuffer(frontBuffer); - - // Make the display visible - VIDEO_SetBlack(FALSE); - - // Flush the video register changes to the hardware - VIDEO_Flush(); - - // Wait for Video setup to complete - VIDEO_WaitVSync(); - - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); -} - -// Set the console foreground color -void SetConsoleForegroundColor(u8 color, u8 bold) -{ - printf("\x1b[%u;%um", color+30, bold); - fflush(stdout); -} - -// Set the console background color -void SetConsoleBackgroundColor(u8 color, u8 bold) -{ - printf("\x1b[%u;%um", color+40, bold); - fflush(stdout); -} - -// Clears the console setting the background with the specified colour -// The console supports VT terminal escape codes -void ClearConsole(int backgroundCol) -{ - printf("\x1b[4%im", backgroundCol); - printf("\x1b[2J"); - fflush(stdout); -} - -// Print text to the center of the screen -void PrintCenter(char *text, int width) -{ - int textLen = strlen(text); - int leftPad = (width - textLen) / 2; - int rightPad = (width - textLen) - leftPad; - - printf("%*s%s%*s", leftPad, " ", text, rightPad, " "); -} - -// Print text -void PrintText(char *text, bool clear, bool border, bool center, int backgroundCol, int foregroundCol) -{ - const int consoleLineLength = 72; - const int defaultBGColor = 0; // Black is the default background color - const int defaultFGColor = 7; // White is the default background color - - // Clear the screen - if (clear) ClearConsole(backgroundCol); - - // Set the console background and foreground color - SetConsoleBackgroundColor(backgroundCol, 0); - SetConsoleForegroundColor(foregroundCol, 0); - - // Draw the upper border - if (border) printf("%*s", consoleLineLength, " "); - - // Display the text - if (center) - PrintCenter(text, consoleLineLength); - else - printf(text); - - // Draw the lower border - if (border) printf("%*s", consoleLineLength, " "); - - // Set the console background and foreground default color - SetConsoleBackgroundColor(defaultBGColor, 0); - SetConsoleForegroundColor(defaultFGColor, 0); - - fflush(stdout); -} - -// Turn on/off the Wii Light -void WiiLightControl(int state) -{ - switch (state) - { - case WIILIGHT_ON: - WIILIGHT_SetLevel(255); - WIILIGHT_TurnOn(); - break; - - case WIILIGHT_OFF: - - default: - WIILIGHT_SetLevel(0); - WIILIGHT_TurnOn(); - WIILIGHT_Toggle(); - break; - } -} diff --git a/sysCheck.pnproj b/sysCheck.pnproj index c90a5dd..84f1a51 100644 --- a/sysCheck.pnproj +++ b/sysCheck.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file