Guest User

Untitled

a guest
Jan 23rd, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 10.91 KB | None | 0 0
  1. Index: source/appbrowser.c
  2. ===================================================================
  3. --- source/appbrowser.c (revision 28)
  4. +++ source/appbrowser.c (working copy)
  5. @@ -583,6 +583,7 @@
  6.             }
  7.         }
  8.     while (mooved);
  9. +   appsPageMax = apps2Disp / gui.spotsXpage;
  10.     }
  11.  
  12.  static int ScanApps (const char *mount)
  13. @@ -664,7 +665,6 @@
  14.        
  15.    
  16.     appsPage = 0;
  17. -   appsPageMax = appsCnt / gui.spotsXpage;
  18.    
  19.     AppsSort ();
  20.    
  21. @@ -1227,7 +1227,7 @@
  22.             {
  23.             while (WPAD_ButtonsDown(0)) WPAD_ScanPads();
  24.            
  25. -           browserRet = ChooseDPadReturnMode (btn);
  26. +           browserRet = ChooseDPadReturnMode (btn, 0);
  27.             if (browserRet != -1) break;
  28.            
  29.             if (btn & WPAD_BUTTON_1)
  30. Index: source/chnbrowser.c
  31. ===================================================================
  32. --- source/chnbrowser.c (revision 28)
  33. +++ source/chnbrowser.c (working copy)
  34. @@ -1252,7 +1252,7 @@
  35.         // If [HOME] was pressed on the first Wiimote, break out of the loop
  36.         if (btn)
  37.             {
  38. -           browserRet = ChooseDPadReturnMode (btn);
  39. +           browserRet = ChooseDPadReturnMode (btn, 1);
  40.             if (browserRet != -1) break;
  41.            
  42.             if (btn & WPAD_BUTTON_1)
  43. Index: source/gamebrowser.c
  44. ===================================================================
  45. --- source/gamebrowser.c    (revision 28)
  46. +++ source/gamebrowser.c    (working copy)
  47. @@ -444,90 +444,91 @@
  48.     int item = grlib_menu ("Go to page", buff);
  49.     if (item >= 0) gamesPage = item;
  50.     }
  51. -
  52. -static int GameBrowse (int forcescan)
  53. -   {
  54. +  
  55. +static void AddGames ( char *titles, u32 gameMode )
  56. +{
  57.     char slot[8];
  58. -   Debug ("begin GameBrowse");
  59. +   int i;
  60. +   char *p;
  61. +      
  62. +   if (!titles) return;
  63.    
  64. -   gui.spotsIdx = 0;
  65. -   gui_Clean ();
  66. -   StructFree ();
  67. -
  68. +   p = titles;
  69. +   i = gamesCnt;
  70. +          
  71. +   do
  72.         {
  73. -       int i;
  74. -       char *titles;
  75. -       char *p;
  76. -      
  77. -       Video_WaitPanel (TEX_HGL, "Please wait...");
  78. -      
  79. -       if (config.gameMode == GM_WII)
  80. +       if (*p != '\0' && strlen(p))
  81.             {
  82. -           if (vars.neek != NEEK_NONE) // use neek interface to build up game listing
  83. -               titles = neek_GetGames ();
  84. -           else
  85. -               titles = WBFSSCanner (forcescan);
  86. -           }
  87. -       else
  88. -           titles = DMLScanner ();
  89. +           // Add name
  90. +           games[i].name = malloc (strlen(p));
  91. +           strcpy (games[i].name, p);
  92. +           p += (strlen(p) + 1);
  93.            
  94. -       if (!titles) return 0;
  95. -      
  96. -       p = titles;
  97. -       i = 0;
  98. -      
  99. -       Debug ("GameBrowse [begin]");
  100. -              
  101. -       do
  102. -           {
  103. -           if (*p != '\0' && strlen(p))
  104. +           // Add id
  105. +           strcpy (games[i].asciiId, p);
  106. +           p += (strlen(p) + 1);
  107. +
  108. +           if (gameMode == GM_WII)
  109.                 {
  110. -               // Add name
  111. -               games[i].name = malloc (strlen(p));
  112. -               strcpy (games[i].name, p);
  113. -               p += (strlen(p) + 1);
  114. -              
  115. -               // Add id
  116. -               strcpy (games[i].asciiId, p);
  117. -               p += (strlen(p) + 1);
  118. -
  119. -               if (config.gameMode == GM_WII)
  120. -                   {
  121. -                   // Setup slot
  122. -                   if (vars.neek != NEEK_NONE)
  123. -                       games[i].slot = i;
  124. -                   else
  125. -                       {
  126. -                       // Add slot
  127. -                       strcpy (slot, p);
  128. -                       p += (strlen(p) + 1);
  129. -
  130. -                       games[i].slot = atoi (slot); // PArtition number
  131. -                       }
  132. -                   }
  133. +               // Setup slot
  134. +               if (vars.neek != NEEK_NONE)
  135. +                   games[i].slot = i;
  136.                 else
  137.                     {
  138. +                   // Add slot
  139.                     strcpy (slot, p);
  140.                     p += (strlen(p) + 1);
  141.  
  142. -                   games[i].slot = atoi (slot); // sd = 0 / usb = 1 ?
  143. +                   games[i].slot = atoi (slot); // PArtition number
  144.                     }
  145. -              
  146. -               if (i % 10 == 0) Video_WaitPanel (TEX_HGL, "Please wait...|Loading game configuration");
  147. -               ReadGameConfig (i);
  148. -              
  149. -               i ++;
  150. +                   games[i].dml = false;
  151.                 }
  152.             else
  153. -               break;
  154. +               {
  155. +               strcpy (slot, p);
  156. +               p += (strlen(p) + 1);
  157. +
  158. +               games[i].slot = atoi (slot); // sd = 0 / usb = 1 ?
  159. +               games[i].dml = true;
  160. +               }
  161. +          
  162. +           if (i % 10 == 0) Video_WaitPanel (TEX_HGL, "Please wait...|Loading game configuration");
  163. +           ReadGameConfig (i);
  164. +          
  165. +           i ++;
  166.             }
  167. -       while (TRUE);
  168. -      
  169. -       gamesCnt = i;
  170. -      
  171. -       free (titles);
  172. +       else
  173. +           break;
  174.         }
  175. +   while (TRUE);
  176. +  
  177. +   gamesCnt = i;
  178. +  
  179. +   free (titles);
  180. +}
  181.  
  182. +static int GameBrowse (int forcescan)
  183. +   {
  184. +   Debug ("begin GameBrowse");
  185. +  
  186. +   gui.spotsIdx = 0;
  187. +   gui_Clean ();
  188. +   StructFree ();
  189. +  
  190. +   Video_WaitPanel (TEX_HGL, "Please wait...");
  191. +  
  192. +   Debug ("GameBrowse [begin]");
  193. +   if (config.gameMode == GM_WII || config.gameMode == GM_BOTH)
  194. +       {
  195. +       if (vars.neek != NEEK_NONE) // use neek interface to build up game listing
  196. +           AddGames(neek_GetGames (), GM_WII);
  197. +       else
  198. +           AddGames(WBFSSCanner (forcescan), GM_WII);
  199. +       }
  200. +   if (config.gameMode == GM_DML || config.gameMode == GM_BOTH)
  201. +       AddGames(DMLScanner (), GM_DML);
  202. +  
  203.     AppsSort ();
  204.    
  205.     scanned = 1;
  206. @@ -568,7 +569,7 @@
  207.                 {
  208.                 char part[32];
  209.                
  210. -               if (config.gameMode == GM_WII)
  211. +               if (!games[gamesSelected].dml)
  212.                     {
  213.                     if (games[gamesSelected].slot < 10)
  214.                         sprintf (part, " (FAT%d)", games[gamesSelected].slot + 1);
  215. @@ -822,7 +823,7 @@
  216.         else
  217.             strcat (buff, "Hide this title ##3|");
  218.  
  219. -       if (config.gameMode == GM_WII)
  220. +       if (!games[ai].dml)
  221.             {
  222.             if (vars.neek != NEEK_NONE)
  223.                 {
  224. @@ -1084,7 +1085,7 @@
  225.    
  226.     buff[0] = '\0';
  227.    
  228. -   strcat (buff, "Switch Wii/GC(DML) mode...##14||");
  229. +   strcat (buff, "Switch Wii/GC(DML)/Wii&GC modes...##14||");
  230.    
  231.     strcat (buff, "Download covers...##10||");
  232.     if (vars.neek != NEEK_NONE)
  233. @@ -1138,7 +1139,10 @@
  234.     if (item == 14)
  235.         {
  236.         //DMLSelect ();
  237. -       config.gameMode = 1 - config.gameMode;//DMLSelect ();
  238. +       if (config.gameMode == 2)
  239. +           config.gameMode = 0;
  240. +       else
  241. +           config.gameMode++;
  242.         browserRet = INTERACTIVE_RET_TOGAMES;
  243.         }
  244.        
  245. @@ -1253,6 +1257,7 @@
  246.     int i;
  247.     int ai; // Application index (corrected by the offset)
  248.     char sdev[64];
  249. +   char gamesType[8];
  250.    
  251.     Video_DrawBackgroud (1);
  252.    
  253. @@ -1264,8 +1269,9 @@
  254.             sprintf (sdev, "WII Games - EmuNAND [SD] %s", config.chnBrowser.nandPath);
  255.         else if (config.chnBrowser.nand == NAND_EMUUSB)
  256.             sprintf (sdev, "WII Games - EmuNAND [USB] %s", config.chnBrowser.nandPath);
  257. +       strcpy(gamesType,"Wii");
  258.         }
  259. -   else
  260. +   else if (config.gameMode == GM_DML)
  261.         {
  262.         if (config.chnBrowser.nand == NAND_REAL)
  263.             strcpy (sdev, "GC Games(DML) - Real NAND");
  264. @@ -1273,7 +1279,18 @@
  265.             sprintf (sdev, "GC Games(DML) - EmuNAND [SD] %s", config.chnBrowser.nandPath);
  266.         else if (config.chnBrowser.nand == NAND_EMUUSB)
  267.             sprintf (sdev, "GC Games(DML) - EmuNAND [USB] %s", config.chnBrowser.nandPath);
  268. +       strcpy(gamesType,"GC");
  269.         }
  270. +   else
  271. +       {
  272. +       if (config.chnBrowser.nand == NAND_REAL)
  273. +           strcpy (sdev, "Games - Real NAND");
  274. +       else if (config.chnBrowser.nand == NAND_EMUSD)
  275. +           sprintf (sdev, "Games - EmuNAND [SD] %s", config.chnBrowser.nandPath);
  276. +       else if (config.chnBrowser.nand == NAND_EMUUSB)
  277. +           sprintf (sdev, "Games - EmuNAND [USB] %s", config.chnBrowser.nandPath);
  278. +       strcpy(gamesType,"Wii/GC");
  279. +       }
  280.  
  281.     grlib_SetFontBMF(fonts[FNTNORM]);
  282.     char ahpbrot[16];
  283. @@ -1294,9 +1311,9 @@
  284.             strcpy (neek, "neek");
  285.  
  286.         if (strlen(vars.neekName))
  287. -           grlib_printf ( 25, 26, GRLIB_ALIGNLEFT, 0, "postLoader"VER" (%s %s) - Games", neek, vars.neekName);
  288. +           grlib_printf ( 25, 26, GRLIB_ALIGNLEFT, 0, "postLoader"VER" (%s %s) - %s Games", neek, vars.neekName, gamesType);
  289.         else
  290. -           grlib_printf ( 25, 26, GRLIB_ALIGNLEFT, 0, "postLoader"VER" (%s) - Games", neek);
  291. +           grlib_printf ( 25, 26, GRLIB_ALIGNLEFT, 0, "postLoader"VER" (%s) - %s Games", neek, gamesType);
  292.         }
  293.        
  294.     grlib_printf ( 615, 26, GRLIB_ALIGNRIGHT, 0, "Page %d of %d", gamesPage+1, gamesPageMax+1);
  295. @@ -1334,7 +1351,7 @@
  296.             else
  297.                 gui.spots[gui.spotsIdx].ico.title[0] = '\0';
  298.  
  299. -           if (config.gameMode == GM_DML)
  300. +           if (games[ai].dml)
  301.                 {
  302.                 if (games[ai].slot)
  303.                     gui.spots[gui.spotsIdx].ico.transparency = 128;
  304. @@ -1471,7 +1488,7 @@
  305.         // If [HOME] was pressed on the first Wiimote, break out of the loop
  306.         if (btn)
  307.             {
  308. -           browserRet = ChooseDPadReturnMode (btn);
  309. +           browserRet = ChooseDPadReturnMode (btn, 2);
  310.             if (browserRet != -1) break;
  311.            
  312.             if (btn & WPAD_BUTTON_1)
  313. @@ -1482,7 +1499,7 @@
  314.            
  315.             if (btn & WPAD_BUTTON_A && gamesSelected != -1)
  316.                 {
  317. -               if (config.gameMode == GM_WII)
  318. +               if (!games[gamesSelected].dml)
  319.                     {
  320.                     ReadGameConfig (gamesSelected);
  321.                     games[gamesSelected].playcount++;
  322. Index: source/globals.h
  323. ===================================================================
  324. --- source/globals.h    (revision 28)
  325. +++ source/globals.h    (working copy)
  326. @@ -33,6 +33,7 @@
  327.  
  328.  #define GM_WII 0
  329.  #define GM_DML 1
  330. +#define GM_BOTH 2
  331.  
  332.  enum {
  333.     INTERACTIVE_RET_NONE=0,
  334. Index: source/grlib/grlib.c
  335. ===================================================================
  336. --- source/grlib/grlib.c    (revision 28)
  337. +++ source/grlib/grlib.c    (working copy)
  338. @@ -585,6 +585,10 @@
  339.         if (gcbtn & PAD_BUTTON_X) return WPAD_BUTTON_1;
  340.         if (gcbtn & PAD_BUTTON_Y) return WPAD_BUTTON_2;
  341.         if (gcbtn & PAD_BUTTON_MENU) return WPAD_BUTTON_HOME;
  342. +       if (gcbtn & PAD_BUTTON_UP) return WPAD_BUTTON_UP;
  343. +       if (gcbtn & PAD_BUTTON_LEFT) return WPAD_BUTTON_LEFT;
  344. +       if (gcbtn & PAD_BUTTON_DOWN) return WPAD_BUTTON_DOWN;
  345. +       if (gcbtn & PAD_BUTTON_RIGHT) return WPAD_BUTTON_RIGHT;
  346.         }
  347.        
  348.     // Classic
  349. Index: source/gui.c
  350. ===================================================================
  351. --- source/gui.c    (revision 28)
  352. +++ source/gui.c    (working copy)
  353. @@ -28,16 +28,28 @@
  354.    
  355.  /////////////////////////////////////////////////////////////////////////
  356.  
  357. -int ChooseDPadReturnMode (u32 btn)
  358. +int ChooseDPadReturnMode (u32 btn, u8 current)
  359.     {
  360. -   if (btn & WPAD_BUTTON_UP) // WII Games
  361. +   if (btn & WPAD_BUTTON_UP) // Alternates Which Games Display
  362.         {
  363. -       config.gameMode = 0;
  364. +       if (current == 2)
  365. +           {
  366. +           if (config.gameMode == 2)
  367. +               config.gameMode = 0;
  368. +           else
  369. +               config.gameMode++;
  370. +           }
  371.         return INTERACTIVE_RET_TOGAMES;
  372.         }
  373. -   if (btn & WPAD_BUTTON_DOWN) // GC Games
  374. +   if (btn & WPAD_BUTTON_DOWN) // Alternates Which Games Display
  375.         {
  376. -       config.gameMode = 1;
  377. +       if (current == 2)
  378. +           {
  379. +           if (config.gameMode == 0)
  380. +               config.gameMode = 2;
  381. +           else
  382. +               config.gameMode--;
  383. +           }
  384.         return INTERACTIVE_RET_TOGAMES;
  385.         }
  386.     if (btn & WPAD_BUTTON_LEFT) // Homebrew
  387. @@ -61,6 +73,7 @@
  388.     strcat (buff, "Channel mode##101|");
  389.     strcat (buff, "WII Game mode##102|");
  390.     strcat (buff, "GC Game mode##103|");
  391. +   strcat (buff, "GC/WII mode##104|");
  392.    
  393.     strcat (buff, "|");
  394.     strcat (buff, "Close##-1");
  395. @@ -73,6 +86,7 @@
  396.     if (ret == 101) return INTERACTIVE_RET_TOCHANNELS;
  397.     if (ret == 102) {config.gameMode = 0; return INTERACTIVE_RET_TOGAMES;}
  398.     if (ret == 103) {config.gameMode = 1; return INTERACTIVE_RET_TOGAMES;}
  399. +   if (ret == 104) {config.gameMode = 2; return INTERACTIVE_RET_TOGAMES;}
  400.    
  401.     return -1;
  402.     }
  403. \ No newline at end of file
  404. Index: source/gui.h
  405. ===================================================================
  406. --- source/gui.h    (revision 28)
  407. +++ source/gui.h    (working copy)
  408. @@ -22,5 +22,5 @@
  409.  void gui_Init (void);
  410.  void gui_Clean (void);
  411.  
  412. -int ChooseDPadReturnMode (u32 btn);
  413. +int ChooseDPadReturnMode (u32 btn, u8 current);
  414.  int Menu_SelectBrowsingMode (void);
  415. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment