Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: source/appbrowser.c
- ===================================================================
- --- source/appbrowser.c (revision 28)
- +++ source/appbrowser.c (working copy)
- @@ -583,6 +583,7 @@
- }
- }
- while (mooved);
- + appsPageMax = apps2Disp / gui.spotsXpage;
- }
- static int ScanApps (const char *mount)
- @@ -664,7 +665,6 @@
- appsPage = 0;
- - appsPageMax = appsCnt / gui.spotsXpage;
- AppsSort ();
- @@ -1227,7 +1227,7 @@
- {
- while (WPAD_ButtonsDown(0)) WPAD_ScanPads();
- - browserRet = ChooseDPadReturnMode (btn);
- + browserRet = ChooseDPadReturnMode (btn, 0);
- if (browserRet != -1) break;
- if (btn & WPAD_BUTTON_1)
- Index: source/chnbrowser.c
- ===================================================================
- --- source/chnbrowser.c (revision 28)
- +++ source/chnbrowser.c (working copy)
- @@ -1252,7 +1252,7 @@
- // If [HOME] was pressed on the first Wiimote, break out of the loop
- if (btn)
- {
- - browserRet = ChooseDPadReturnMode (btn);
- + browserRet = ChooseDPadReturnMode (btn, 1);
- if (browserRet != -1) break;
- if (btn & WPAD_BUTTON_1)
- Index: source/gamebrowser.c
- ===================================================================
- --- source/gamebrowser.c (revision 28)
- +++ source/gamebrowser.c (working copy)
- @@ -444,90 +444,91 @@
- int item = grlib_menu ("Go to page", buff);
- if (item >= 0) gamesPage = item;
- }
- -
- -static int GameBrowse (int forcescan)
- - {
- +
- +static void AddGames ( char *titles, u32 gameMode )
- +{
- char slot[8];
- - Debug ("begin GameBrowse");
- + int i;
- + char *p;
- +
- + if (!titles) return;
- - gui.spotsIdx = 0;
- - gui_Clean ();
- - StructFree ();
- -
- + p = titles;
- + i = gamesCnt;
- +
- + do
- {
- - int i;
- - char *titles;
- - char *p;
- -
- - Video_WaitPanel (TEX_HGL, "Please wait...");
- -
- - if (config.gameMode == GM_WII)
- + if (*p != '\0' && strlen(p))
- {
- - if (vars.neek != NEEK_NONE) // use neek interface to build up game listing
- - titles = neek_GetGames ();
- - else
- - titles = WBFSSCanner (forcescan);
- - }
- - else
- - titles = DMLScanner ();
- + // Add name
- + games[i].name = malloc (strlen(p));
- + strcpy (games[i].name, p);
- + p += (strlen(p) + 1);
- - if (!titles) return 0;
- -
- - p = titles;
- - i = 0;
- -
- - Debug ("GameBrowse [begin]");
- -
- - do
- - {
- - if (*p != '\0' && strlen(p))
- + // Add id
- + strcpy (games[i].asciiId, p);
- + p += (strlen(p) + 1);
- +
- + if (gameMode == GM_WII)
- {
- - // Add name
- - games[i].name = malloc (strlen(p));
- - strcpy (games[i].name, p);
- - p += (strlen(p) + 1);
- -
- - // Add id
- - strcpy (games[i].asciiId, p);
- - p += (strlen(p) + 1);
- -
- - if (config.gameMode == GM_WII)
- - {
- - // Setup slot
- - if (vars.neek != NEEK_NONE)
- - games[i].slot = i;
- - else
- - {
- - // Add slot
- - strcpy (slot, p);
- - p += (strlen(p) + 1);
- -
- - games[i].slot = atoi (slot); // PArtition number
- - }
- - }
- + // Setup slot
- + if (vars.neek != NEEK_NONE)
- + games[i].slot = i;
- else
- {
- + // Add slot
- strcpy (slot, p);
- p += (strlen(p) + 1);
- - games[i].slot = atoi (slot); // sd = 0 / usb = 1 ?
- + games[i].slot = atoi (slot); // PArtition number
- }
- -
- - if (i % 10 == 0) Video_WaitPanel (TEX_HGL, "Please wait...|Loading game configuration");
- - ReadGameConfig (i);
- -
- - i ++;
- + games[i].dml = false;
- }
- else
- - break;
- + {
- + strcpy (slot, p);
- + p += (strlen(p) + 1);
- +
- + games[i].slot = atoi (slot); // sd = 0 / usb = 1 ?
- + games[i].dml = true;
- + }
- +
- + if (i % 10 == 0) Video_WaitPanel (TEX_HGL, "Please wait...|Loading game configuration");
- + ReadGameConfig (i);
- +
- + i ++;
- }
- - while (TRUE);
- -
- - gamesCnt = i;
- -
- - free (titles);
- + else
- + break;
- }
- + while (TRUE);
- +
- + gamesCnt = i;
- +
- + free (titles);
- +}
- +static int GameBrowse (int forcescan)
- + {
- + Debug ("begin GameBrowse");
- +
- + gui.spotsIdx = 0;
- + gui_Clean ();
- + StructFree ();
- +
- + Video_WaitPanel (TEX_HGL, "Please wait...");
- +
- + Debug ("GameBrowse [begin]");
- + if (config.gameMode == GM_WII || config.gameMode == GM_BOTH)
- + {
- + if (vars.neek != NEEK_NONE) // use neek interface to build up game listing
- + AddGames(neek_GetGames (), GM_WII);
- + else
- + AddGames(WBFSSCanner (forcescan), GM_WII);
- + }
- + if (config.gameMode == GM_DML || config.gameMode == GM_BOTH)
- + AddGames(DMLScanner (), GM_DML);
- +
- AppsSort ();
- scanned = 1;
- @@ -568,7 +569,7 @@
- {
- char part[32];
- - if (config.gameMode == GM_WII)
- + if (!games[gamesSelected].dml)
- {
- if (games[gamesSelected].slot < 10)
- sprintf (part, " (FAT%d)", games[gamesSelected].slot + 1);
- @@ -822,7 +823,7 @@
- else
- strcat (buff, "Hide this title ##3|");
- - if (config.gameMode == GM_WII)
- + if (!games[ai].dml)
- {
- if (vars.neek != NEEK_NONE)
- {
- @@ -1084,7 +1085,7 @@
- buff[0] = '\0';
- - strcat (buff, "Switch Wii/GC(DML) mode...##14||");
- + strcat (buff, "Switch Wii/GC(DML)/Wii&GC modes...##14||");
- strcat (buff, "Download covers...##10||");
- if (vars.neek != NEEK_NONE)
- @@ -1138,7 +1139,10 @@
- if (item == 14)
- {
- //DMLSelect ();
- - config.gameMode = 1 - config.gameMode;//DMLSelect ();
- + if (config.gameMode == 2)
- + config.gameMode = 0;
- + else
- + config.gameMode++;
- browserRet = INTERACTIVE_RET_TOGAMES;
- }
- @@ -1253,6 +1257,7 @@
- int i;
- int ai; // Application index (corrected by the offset)
- char sdev[64];
- + char gamesType[8];
- Video_DrawBackgroud (1);
- @@ -1264,8 +1269,9 @@
- sprintf (sdev, "WII Games - EmuNAND [SD] %s", config.chnBrowser.nandPath);
- else if (config.chnBrowser.nand == NAND_EMUUSB)
- sprintf (sdev, "WII Games - EmuNAND [USB] %s", config.chnBrowser.nandPath);
- + strcpy(gamesType,"Wii");
- }
- - else
- + else if (config.gameMode == GM_DML)
- {
- if (config.chnBrowser.nand == NAND_REAL)
- strcpy (sdev, "GC Games(DML) - Real NAND");
- @@ -1273,7 +1279,18 @@
- sprintf (sdev, "GC Games(DML) - EmuNAND [SD] %s", config.chnBrowser.nandPath);
- else if (config.chnBrowser.nand == NAND_EMUUSB)
- sprintf (sdev, "GC Games(DML) - EmuNAND [USB] %s", config.chnBrowser.nandPath);
- + strcpy(gamesType,"GC");
- }
- + else
- + {
- + if (config.chnBrowser.nand == NAND_REAL)
- + strcpy (sdev, "Games - Real NAND");
- + else if (config.chnBrowser.nand == NAND_EMUSD)
- + sprintf (sdev, "Games - EmuNAND [SD] %s", config.chnBrowser.nandPath);
- + else if (config.chnBrowser.nand == NAND_EMUUSB)
- + sprintf (sdev, "Games - EmuNAND [USB] %s", config.chnBrowser.nandPath);
- + strcpy(gamesType,"Wii/GC");
- + }
- grlib_SetFontBMF(fonts[FNTNORM]);
- char ahpbrot[16];
- @@ -1294,9 +1311,9 @@
- strcpy (neek, "neek");
- if (strlen(vars.neekName))
- - grlib_printf ( 25, 26, GRLIB_ALIGNLEFT, 0, "postLoader"VER" (%s %s) - Games", neek, vars.neekName);
- + grlib_printf ( 25, 26, GRLIB_ALIGNLEFT, 0, "postLoader"VER" (%s %s) - %s Games", neek, vars.neekName, gamesType);
- else
- - grlib_printf ( 25, 26, GRLIB_ALIGNLEFT, 0, "postLoader"VER" (%s) - Games", neek);
- + grlib_printf ( 25, 26, GRLIB_ALIGNLEFT, 0, "postLoader"VER" (%s) - %s Games", neek, gamesType);
- }
- grlib_printf ( 615, 26, GRLIB_ALIGNRIGHT, 0, "Page %d of %d", gamesPage+1, gamesPageMax+1);
- @@ -1334,7 +1351,7 @@
- else
- gui.spots[gui.spotsIdx].ico.title[0] = '\0';
- - if (config.gameMode == GM_DML)
- + if (games[ai].dml)
- {
- if (games[ai].slot)
- gui.spots[gui.spotsIdx].ico.transparency = 128;
- @@ -1471,7 +1488,7 @@
- // If [HOME] was pressed on the first Wiimote, break out of the loop
- if (btn)
- {
- - browserRet = ChooseDPadReturnMode (btn);
- + browserRet = ChooseDPadReturnMode (btn, 2);
- if (browserRet != -1) break;
- if (btn & WPAD_BUTTON_1)
- @@ -1482,7 +1499,7 @@
- if (btn & WPAD_BUTTON_A && gamesSelected != -1)
- {
- - if (config.gameMode == GM_WII)
- + if (!games[gamesSelected].dml)
- {
- ReadGameConfig (gamesSelected);
- games[gamesSelected].playcount++;
- Index: source/globals.h
- ===================================================================
- --- source/globals.h (revision 28)
- +++ source/globals.h (working copy)
- @@ -33,6 +33,7 @@
- #define GM_WII 0
- #define GM_DML 1
- +#define GM_BOTH 2
- enum {
- INTERACTIVE_RET_NONE=0,
- Index: source/grlib/grlib.c
- ===================================================================
- --- source/grlib/grlib.c (revision 28)
- +++ source/grlib/grlib.c (working copy)
- @@ -585,6 +585,10 @@
- if (gcbtn & PAD_BUTTON_X) return WPAD_BUTTON_1;
- if (gcbtn & PAD_BUTTON_Y) return WPAD_BUTTON_2;
- if (gcbtn & PAD_BUTTON_MENU) return WPAD_BUTTON_HOME;
- + if (gcbtn & PAD_BUTTON_UP) return WPAD_BUTTON_UP;
- + if (gcbtn & PAD_BUTTON_LEFT) return WPAD_BUTTON_LEFT;
- + if (gcbtn & PAD_BUTTON_DOWN) return WPAD_BUTTON_DOWN;
- + if (gcbtn & PAD_BUTTON_RIGHT) return WPAD_BUTTON_RIGHT;
- }
- // Classic
- Index: source/gui.c
- ===================================================================
- --- source/gui.c (revision 28)
- +++ source/gui.c (working copy)
- @@ -28,16 +28,28 @@
- /////////////////////////////////////////////////////////////////////////
- -int ChooseDPadReturnMode (u32 btn)
- +int ChooseDPadReturnMode (u32 btn, u8 current)
- {
- - if (btn & WPAD_BUTTON_UP) // WII Games
- + if (btn & WPAD_BUTTON_UP) // Alternates Which Games Display
- {
- - config.gameMode = 0;
- + if (current == 2)
- + {
- + if (config.gameMode == 2)
- + config.gameMode = 0;
- + else
- + config.gameMode++;
- + }
- return INTERACTIVE_RET_TOGAMES;
- }
- - if (btn & WPAD_BUTTON_DOWN) // GC Games
- + if (btn & WPAD_BUTTON_DOWN) // Alternates Which Games Display
- {
- - config.gameMode = 1;
- + if (current == 2)
- + {
- + if (config.gameMode == 0)
- + config.gameMode = 2;
- + else
- + config.gameMode--;
- + }
- return INTERACTIVE_RET_TOGAMES;
- }
- if (btn & WPAD_BUTTON_LEFT) // Homebrew
- @@ -61,6 +73,7 @@
- strcat (buff, "Channel mode##101|");
- strcat (buff, "WII Game mode##102|");
- strcat (buff, "GC Game mode##103|");
- + strcat (buff, "GC/WII mode##104|");
- strcat (buff, "|");
- strcat (buff, "Close##-1");
- @@ -73,6 +86,7 @@
- if (ret == 101) return INTERACTIVE_RET_TOCHANNELS;
- if (ret == 102) {config.gameMode = 0; return INTERACTIVE_RET_TOGAMES;}
- if (ret == 103) {config.gameMode = 1; return INTERACTIVE_RET_TOGAMES;}
- + if (ret == 104) {config.gameMode = 2; return INTERACTIVE_RET_TOGAMES;}
- return -1;
- }
- \ No newline at end of file
- Index: source/gui.h
- ===================================================================
- --- source/gui.h (revision 28)
- +++ source/gui.h (working copy)
- @@ -22,5 +22,5 @@
- void gui_Init (void);
- void gui_Clean (void);
- -int ChooseDPadReturnMode (u32 btn);
- +int ChooseDPadReturnMode (u32 btn, u8 current);
- int Menu_SelectBrowsingMode (void);
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment