Homebrew postLoader4

  • Thread starter Thread starter stfour
  • Start date Start date
  • Views Views 563,506
  • Replies Replies 4,203
  • Likes Likes 16
No problem. I'll see if I can implement the classic controller support I was wanting a few days ago as well. :P
 
I've added Classic Controller D-Pad support to postloader as well; it mimics the Wii remote's dpad functionality. I'm struggling to get Postloader to let the Classic Controller start or cancel applications/games however. It just seems to ignore A and B on those zoomed in portions, when you've selected one. It's strange since A and B work everywhere else in postloader.

Edit: I seem to have fixed it, it's caused by a redundant grlib_GetUserInput call before assigning the input variable, it looks like. It has a weird bug though: if you hold A on the CC, it causes the zooming in animation to slow down like crazy, but it doesn't do that with the Wii remote or GC controller.

Here's what I modified in browserApps.c:
Code:
Index: browserApps.c
===================================================================
--- browserApps.c    (revision 97)
+++ browserApps.c    (working copy)
@@ -22,7 +22,7 @@
#define INC_Y ICONH+25

#define AT_HBA 1
-#define AT_FOLDER 2
+#define AT_FOLDER 2
#define AT_FOLDERUP 3 // This is to clear subfolder...

/*
@@ -52,7 +52,7 @@

static u16 sortMode = 0;

-static int browserRet = 0;
+static int browserRet = 0;
static int showHidden = 0;
static int disableSpots;

@@ -934,7 +934,7 @@
static void ShowMainMenu (void)
{
char buff[512];
-    
+    
spotSelected = -1;

buff[0] = '\0';
@@ -1362,7 +1362,7 @@
grlib_printf (XMIDLEINFO, theme.line2Y, GRLIB_ALIGNCENTER, 0, "Press (A) to start, (B) Cancel");        
grlibSettings.fontReverse = fr;

-        grlib_GetUserInput();
+        //grlib_GetUserInput();
grlib_DrawIRCursor ();
grlib_Render();
btn = grlib_GetUserInput();
@@ -1393,7 +1393,7 @@
//memset (&apps, 0, sizeof (apps));
apps = calloc (APPSMAX, sizeof(s_app));

-    subpath[0] = '\0';
+    subpath[0] = '\0';
submount[0] = '\0';
config.run.enabled = 0;

In browserChans.c:
Code:
Index: browserChans.c
===================================================================
--- browserChans.c    (revision 97)
+++ browserChans.c    (working copy)
@@ -45,7 +45,7 @@
static bool redrawIcons = true;

static s_grlib_iconSetting is;
-
+
static void Redraw (void);
static int ChnBrowse (void);

@@ -670,7 +670,7 @@

// Update configuration
ReadTitleConfig (chansCnt);
-            
+            
if (chansCnt % 20 == 0) Video_WaitPanel (TEX_HGL, "Please wait...|Loading channels configuration");

chans[chansCnt].png = NULL;
@@ -1537,7 +1537,7 @@
if (mag >= 2.7 && ico.x == 320 && ico.y == y) break;
}

-    vars.useChannelCompatibleMode = 0;
+    vars.useChannelCompatibleMode = 0;

int fr = grlibSettings.fontReverse;
u32 btn;
@@ -1553,7 +1553,7 @@
grlib_printf (XMIDLEINFO, theme.line2Y, GRLIB_ALIGNCENTER, 0, "Press (A) to start, (B) Cancel");        
grlibSettings.fontReverse = fr;

-        grlib_GetUserInput();
+        //grlib_GetUserInput();
grlib_DrawIRCursor ();
grlib_Render();
In browserEmu.c:
[spoiler][code]
Index: browserEmu.c
===================================================================
--- browserEmu.c    (revision 97)
+++ browserEmu.c    (working copy)
@@ -1214,7 +1214,7 @@
grlib_printf (XMIDLEINFO, theme.line2Y, GRLIB_ALIGNCENTER, 0, "Press (A) to start, (B) Cancel");
grlibSettings.fontReverse = fr;

-        grlib_GetUserInput();
+        //grlib_GetUserInput();
grlib_DrawIRCursor ();
grlib_Render();

In browserGames.c:
Code:
Index: browserGames.c
===================================================================
--- browserGames.c    (revision 97)
+++ browserGames.c    (working copy)
@@ -942,6 +942,7 @@
grlib_menuAddItem (buff, 8, "DML: Patch NODISC (%s)", gameConf.dmlNoDisc ? "Yes" : "No" );
grlib_menuAddItem (buff, 9, "DML: Patch PADHOOK (%s)", gameConf.dmlPadHook ? "Yes" : "No" );
grlib_menuAddItem (buff,10, "DML: Patch NMM (%s)", gameConf.dmlNMM ? "Yes" : "No" );
+                grlib_menuAddItem (buff,11, "DML: Enable Cheats (%s)", gameConf.ocarina ? "Yes" : "No" );
}
}
/*
@@ -1080,6 +1081,12 @@
goto start;
}

+    if (item == 11)
+        {
+        gameConf.ocarina = !gameConf.ocarina;
+        goto start;
+        }
+
WriteGameConfig (ai);

//GameBrowse (0);
@@ -1623,7 +1630,7 @@
grlib_printf (XMIDLEINFO, theme.line2Y, GRLIB_ALIGNCENTER, 0, "Press (A) to start, (B) Cancel");
grlibSettings.fontReverse = fr;

-        grlib_GetUserInput();
+        //grlib_GetUserInput();
grlib_DrawIRCursor ();
grlib_Render();

In grlib.c:
Code:
Index: grlib.c
===================================================================
--- grlib.c    (revision 97)
+++ grlib.c    (working copy)
@@ -753,6 +753,11 @@
if (cbtn & CLASSIC_CTRL_BUTTON_X) return WPAD_BUTTON_1;
if (cbtn & CLASSIC_CTRL_BUTTON_Y) return WPAD_BUTTON_2;
if (cbtn & CLASSIC_CTRL_BUTTON_HOME) return WPAD_BUTTON_HOME;
+
+        if (cbtn & CLASSIC_CTRL_BUTTON_UP) return WPAD_BUTTON_UP;
+        if (cbtn & CLASSIC_CTRL_BUTTON_DOWN) return WPAD_BUTTON_DOWN;
+        if (cbtn & CLASSIC_CTRL_BUTTON_LEFT) return WPAD_BUTTON_LEFT;
+        if (cbtn & CLASSIC_CTRL_BUTTON_RIGHT) return WPAD_BUTTON_RIGHT;
}
 
EDIT @[member='stfour']: just noticed a but in b27. Up until now, I used DML. Since, I switched to DM. So I moved whatever games I had to the USB drive. Now I noticed that those games I had on SD don't show up there. All the rebuilding didn't make a difference. In the end, I had to remove the dml.* files in the \ploader folder to make them come up. Would you take a look into this, please? :)

With dm 2.x active, postloader will not show more games on sd. AFAIK dm cannot run games from sd.
That's true. But I think I wasn't very clear in what I meant. I didn't want to play on SD. I just pointed out that when changing the gamecube list after the initial initialisation, it's impossible to make those changes come through.

Just yesterday, I added a couple of other gamecube games to the USB drive (that were never on the SD card in the first place). Once again, there was no way to get those new games to show up. Rebuilding the list, either the postloader way or the neek2o way, did nothing. At all. In the end, I had to remove the dml.* files from SD:\postloader (which caused postloader to rebuild the list...and find those new games).
 
That's true. But I think I wasn't very clear in what I meant. I didn't want to play on SD. I just pointed out that when changing the gamecube list after the initial initialisation, it's impossible to make those changes come through.

Just yesterday, I added a couple of other gamecube games to the USB drive (that were never on the SD card in the first place). Once again, there was no way to get those new games to show up. Rebuilding the list, either the postloader way or the neek2o way, did nothing. At all. In the end, I had to remove the dml.* files from SD:\postloader (which caused postloader to rebuild the list...and find those new games).

Ah ok... thats clear now !


 
No problem. Any idea why holding A tends to slow down the zooming animation, though? Scratch that, holding down any of the buttons on the classic controller causes it to repeat, almost like a keyboard does on a PC.

Edit: I think I found why it repeats. Making an edit in grlib.c now.
 
The zooming is done in QuerySelection... during zooming there is a grlib_GetUserInput that shouldn't really be there. It wait until a button is released or 200msec... so I think that keeping pressed (A) it drawn a frame every 200msec...
 
Yeah, I saw it after you mentioned it. I'll see if commenting them out fixes it.

Edit: That fixes the zooming in slowdown, but the repeat problem is still there. I'll have to look at the code when I get back though. I have to go for a while.
 
No problem. Any idea why holding A tends to slow down the zooming animation, though? Scratch that, holding down any of the buttons on the classic controller causes it to repeat, almost like a keyboard does on a PC.

Edit: I think I found why it repeats. Making an edit in grlib.c now.

repeat isn't really a bugs... grlib_GetUserInput wait until the button is released or 200ms are elapsed... maybe a greater value is needed ;)

... or a more intelligent way to make autorepeat... so the first time wait for 1 sec and then faster.... i will check.
 
I know repeating isn't a bug, but it doesn't happen with the GC controller or Wii remote, so something with the Classic Controller code is a bit off.
 
Ah, so repeat was to be intended? That's interesting. I'm just an amateur at Wii coding, so I'm not really sure what the proper way to fix it would be. I'm satisfied for now with it repeating like every 500ms or so. I can start all of my applications with my trusty CC pro now. ;)

Edit: A minor thought: Is it possible to add GC DVD launching support? When you try launching one it just reboots the Wii, while Wii disks work fine.
 
Just yesterday, I added a couple of other gamecube games to the USB drive (that were never on the SD card in the first place). Once again, there was no way to get those new games to show up. Rebuilding the list, either the postloader way or the neek2o way, did nothing. At all. In the end, I had to remove the dml.* files from SD:\postloader (which caused postloader to rebuild the list...and find those new games).

@Wever, for sure b27 (and previous) do not show USB GC games if they are also on SD. Even if DM 2.x is select. I don't think that deleting dml.* has done the trick... maybe you have removed the sd or moved away games from sd. I've corrected this, but can you confirm that this is your case ?
 
;)

postLoader 4.b28

* removed crosscheck of dml for sd games. This will give a great speedup for fst games scan, but will not check consistency from game on usb and the same on sd. (thx FIX94 for pointing that)
* removed an useless space check during dml scanner
* corrected autorepeat for wiimote keys (you can now keep +/- pressed to change pages)
* fixed classic controllers button and key repeat (thx daxtu!)
* added DML1.x and DM2.x cheats support (thx daxtu)
* removed source path from emulators filters (thx wever)
* corrected DM2.x game search (games on both sd and usb where not listed) (thx wever)
* remove bottom bar neek icon when postloader is already running in neek (thx wever)
* corrected gamecube game section under neek
 

Site & Scene News

Popular threads in this forum