Welcome! Log In Create A New Profile

Advanced

Launching titles with arguments

Posted by Aruskano 
Launching titles with arguments
October 30, 2011 02:58AM
Being more specific I want to know about WII_OpenURL() but I know what it does (in the end) is launching opera's title with the url as an argument. Can anyone confirm me it works with the latest libogc? It gets me to opera's homepage instead of the url I specify. I'm WII_Initialize()ing before calling the function.

I ask about libogc because I compiled bootOpera and it failed to work too. Am I missing anything here? Tips? Suggestions?

Thanks.
Re: Launching titles with arguments
October 30, 2011 01:08PM
Does the precompiled bootOpera work for you? And have you got the latest version of the Internet Channel?
Re: Launching titles with arguments
October 30, 2011 04:29PM
The precompiled bootOpera worked as expected.
I did not check the Internet Channel's version (but since bootOpera worked fine I think the problem relies somewhere else).

Is there any other homebrew launching titles with arguments out there?

I cannot test on a real Wii and the 20 minutes I was able to spend trying to figure this out yesterday did not get me anywhere.
Re: Launching titles with arguments
October 30, 2011 05:00PM
"I cannot test on a real Wii" - you're doing this on an emulator? Sure that's not the problem here? (EDIT: Wait, no it can't be seeing as it worked in bootOpera. Ignore this)

Anyway, I don't believe there are any other channels that are known to accept arguments, so there aren't any other homebrew apps to do so. And as you say, the Internet Channel is not the issue here seeing as bootOpera worked. I guess there must be some problem with the latest libogc.



Edited 1 time(s). Last edit at 10/30/2011 05:01PM by SifJar.
Re: Launching titles with arguments
October 30, 2011 05:50PM
I tested this (other things are being tested on an emulator, hence the word real :p) on a real Wii I have access to for about 20 minutes a week. I mentioned that to make clear I'm not asking this out of laziness - I just simply can't download older libogc versions, compile and test to see if the problem is there myself.

I'd really love to hear there's a way to make it work using the latest libogc. I could be overlooking something since this super-Wii-specific questions are out of my scope.

The only changelog point I found that may be related to this issue is this (libogc 1.8.7 release notes):
-update nandbootinfo before launching a title

But then again I have no idea of whether that's really related or not.

Edit: My project makes use of libwiigui which states "Ensure you have libogc 1.8.7 or higher installed" so I guess (have not tried downgrading libogc) I have to stick updated.



Edited 1 time(s). Last edit at 10/30/2011 06:00PM by Aruskano.
Re: Launching titles with arguments
October 30, 2011 11:08PM
Well from my reading of this page: [wiibrew.org] if nandbootinfo wasn't updated before launching a title, it wouldn't be possible to send arguments to a channel. In other words, it must have been doing that before...
Re: Launching titles with arguments
October 31, 2011 04:03AM
there are some functions in libogc to exit to the system menu and jump directly to a page in the settings.

WII_Initialize();
WII_ReturnToSettingsPage( SETTINGS_INTERNET );

this function uses the same args hocus pocus that the opera one uses. see if it works for you.
Re: Launching titles with arguments
October 31, 2011 05:01AM
I took the time to compile the following code:
	WII_Initialize();
	WII_OpenURL("http://facebook.com");
Using different combinations of devkitPPC/libogc and the results were:
-devkitPPC has nothing to do here (I downloaded devkitPPCr22 because libogc 1.8.5 had some compiling-switches that were not supported in r24).
-binaries compiled using libogc 1.8.5/1.8.6 and devkitPPCr22/r24 worked as expected
-libogc 1.8.8 using devkitPPCr22/r24 just forwarded me to internet channel's home.

I did not test using libogc 1.8.7. Can you test this? I sent the other 6 binaries to a friend and I feel I have disturbed him enough. I would like to know whether this was introduced with libogc 1.8.7 or 1.8.8. I won't even try to fix it but there's people working on libogc that read this forum and would possibly find it useful.

I expect the same behavior from giantpune's suggestion. I can not test it either. Anyone? (using latest libogc and devkitPPC).

As for me, it seems libwiigui works fine with libogc 1.8.6 so I'll use that (or 1.8.7 if the dol above works) for this project and hope nothing breaks.

Thanks!



Edited 1 time(s). Last edit at 10/31/2011 05:06AM by Aruskano.
Re: Launching titles with arguments
October 31, 2011 08:47AM
Looking at the code it's obvious Daco's patch breaks sending arguments (why am I not surprised). His "fix" zeroes out the nandbootinfo file after the arguments have been stored in it, so they are lost.
Re: Launching titles with arguments
October 31, 2011 03:10PM
What was the purpose of this patch, seeing as it was working before?
Re: Launching titles with arguments
October 31, 2011 03:51PM
By comparing the functions in version 1.8.5 against 1.8.8 it seems Daco needed the other registers (specifically apptype, tittletype and launcher) of nandbootinfo to be written by WII_LaunchTitle() (apparently the file is only written when arguments are passed) so he zero'd out the file and wrote those copy pasting the code that writes them from WII_LaunchTitleWithArgs(). Since LaunchTitleWithArgs() does nothing but writing to nandbootinfo and then calling LaunchTitle() the arguments, as tueidj already stated, are lost at that point.

Priiloader changelog states that patch fixes title launching for some Wiis. I don't know under which circumstances it would fail (Priiloader circumstances are a bit different, it may have something to do with not "booting to" the system menu and/or the system menu being at a different memory address) but I find that patch unnecessary. Using WII_LaunchTitleWithArgs() passing an empty argument (possibly adding an if to control unwanted side effects?) would have done the same thing.

Thank you, tueidj.



Edited 1 time(s). Last edit at 10/31/2011 03:53PM by Aruskano.
Re: Launching titles with arguments
October 31, 2011 04:58PM
The apptype setting might also wrong, 0x80 is for DVD based apps while 0x81 should be used for NAND based apps. Not sure if it refers to the app being launched or the app doing the launching though. Either way, Opera doesn't seem to care.
Re: Launching titles with arguments
October 31, 2011 05:18PM
Well in either case, it should be 0x81 surely, seeing as it is highly unlikely any homebrew is being run from a DVD?
Re: Launching titles with arguments
November 01, 2011 05:16PM
Quote
tueidj
Looking at the code it's obvious Daco's patch breaks sending arguments (why am I not surprised). His "fix" zeroes out the nandbootinfo file after the arguments have been stored in it, so they are lost.
the patch also fixes title booting on some wii's (i dont know why or w/e. it just does) as seen in some issue i had on my google code and wiiflow had (which uses the WII_LaunchTitle function while i do it step by step manually)

also, iirc i didn't clear the args function? (not that i remember. not sure why i would have done that in the argv booting function :s )

eitherway, fix it then, cause im to lazy to do it (and it shouldn't be so hard to fix)


(side note, afaik SM goes to the settings page trough flags in state.dat and not nandbootinfo. if state is 3(return to) and the return flag is set to the settings it'll do that... )

and the apptype is something that should be noted on the wiibrew page imo. not sure why nobody changed it yet?

EDIT : i see now, the arg launching code sets args and then calls the regular function. fail. like i said, easy fix.



Edited 13 time(s). Last edit at 11/01/2011 06:10PM by dacotaco.
Re: Launching titles with arguments
November 01, 2011 06:03PM
s32 WII_ReturnToSettingsPage(const char *page)
{
	if(!__initialized)
		return WII_ENOTINIT;

	return WII_LaunchTitleWithArgs(0x100000002LL, 1, page, NULL);
}
Re: Launching titles with arguments
November 01, 2011 06:05PM
a so to the main settings it does trough state.dat and an actual page trough the nandbootinfo. k
Sorry, only registered users may post in this forum.

Click here to login