Homebrew XML title launching in gridlauncher

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
39
Location
Kongo Jungle
XP
5,054
Country
Just tagging @suloku and @smealum in this thread.

I don't use XML titles myself but am trying to get them working in gridlauncher as it's a frequently requested feature. I'm having a really difficult time working out what is actually different between gridlauncher and suloku's changes. The handling of title selection in the menu is completely different, so I added some logging just before the titles get booted at the end of main():

Code:
//Gridlauncher main.c

int main() {

    // ...

    if(!strcmp(me->executablePath, REGIONFREE_PATH) && regionFreeAvailable && !netloader_boot) {
            logText("Region free boot");
        }
        else {
            logText(me->executablePath);
        }
   
        exitServices();
   
        if(!strcmp(me->executablePath, REGIONFREE_PATH) && regionFreeAvailable && !netloader_boot) {
            return regionFreeRun2(target_title.title_id & 0xffffffff, (target_title.title_id >> 32) & 0xffffffff, target_title.mediatype, 0x1);
        }
   
        regionFreeExit();
   
        return bootApp(me->executablePath, &me->descriptor.executableMetadata, NULL);
}

Code:
//Suloku's launcher main.c

int main() {

    // ...

    if(!strcmp(me->executablePath, REGIONFREE_PATH) && regionFreeAvailable && !netloader_boot){
            logText("Title boot");
        }
        else {
            logText(me->executablePath);
        }

    // cleanup whatever we have to cleanup
    netloader_exit();
    titlesExit();
    ptmExit();
    acExit();
    hidExit();
    gfxExit();
    closeSDArchive();
    exitFilesystem();
    aptExit();
    srvExit();

    //Title launching
    if(!strcmp(me->executablePath, REGIONFREE_PATH) && regionFreeAvailable && !netloader_boot){
        if (strlen(HansPath) > 0){
            regionFreeExit();
            return bootApp(HansPath, NULL, HansArg);
        }else{
            return regionFreeRun2(target_title.title_id & 0xffffffff, (target_title.title_id >> 32) & 0xffffffff, target_title.mediatype, 0x1);
        }
    }
   
    regionFreeExit();
   
    return bootApp(me->executablePath, &me->descriptor.executableMetadata, me->arg);
}


In both cases (with both launchers), if I run the Ironhax installer then I get the path to the Ironhax installer 3dsx show in the log. This means that bootApp is being called with the path to the 3dsx executable as its first parameter. I am using bootApp() from suloku's launcher boot.c as well (but passing NULL as the arg parameter as I haven't implemented HANS launching yet), so I can't see any difference between what the gridlauncher is doing and what Suloku's launcher is doing.

Any help would be much appreciated!
 

suloku

Well-Known Member
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
839
Country
I think the problem lies with the changes you made here (main.c):
Code:
else if(updateMenu(&menu))
{
menuEntry_s* me = getMenuEntry(&menu, menu.selectedEntry);
if(me && !strcmp(me->executablePath, REGIONFREE_PATH) && regionFreeAvailable && !netloader_boot)
{
regionFreeUpdate();
if (regionFreeGamecardIn) {
break;
}
}else
{
// if appropriate, look for specified titles in list
if(me->descriptor.numTargetTitles)
{
// go through target title list in order so that first ones on list have priority
int i;
titleInfo_s* ret = NULL;
for(i=0; i<me->descriptor.numTargetTitles; i++)
{
launchSVDTFromTitleMenu();
}
if(ret)
{
targetProcessId = -2;
target_title = *ret;
break;
}
// if we get here, we aint found shit
// if appropriate, let user select target title
if(me->descriptor.selectTargetProcess){
showSVDTTitleSelect();
}
else {
/*
XML titles
*/
//If the title menu has not been loaded yet
if (!titleMenuInitialLoadDone && !titlemenuIsUpdating) {
//Force an updatae to the title menu and then break out of the main loop to boot the title
updateTitleMenu(&titleBrowser, &titleMenu, "Preparing title", true, false);
titleMenuInitialLoadDone = true;
menuForceReturnTrue = true;
// break;
}
//The title menu has been populated but there is still no matching title
//Show an error
else {
hbmenu_state = HBMENU_TITLETARGET_ERROR;
}
}
}else
{
if(me->descriptor.selectTargetProcess) {
showSVDTTitleSelect();
}
else {
break;
}
}
}
}
You should revert to what smea's HBL does, adapting it to your new title structures.
 

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
39
Location
Kongo Jungle
XP
5,054
Country
It works! Thank you my friend! I'm not entirely sure *why* it works, since the whole point of the code I added here was that loading the XML titles didn't work if the title list hadn't been opened at least once. But now it seems to work fine. Perhaps something to do with subsequent changes to the grid loading code. In any case, it seems to be working now as the Ironhax installer successfully completes. Thanks again pal! :)
 
  • Like
Reactions: fiese_nase
General chit-chat
Help Users
  • No one is chatting at the moment.
  • JuanMena @ JuanMena:
    Will you give me mouth to mouth oxygen if my throat closes?
  • K3N1 @ K3N1:
    Nah the air can do that
  • K3N1 @ K3N1:
    Ask @x65943 he's trained for that stuff
  • JuanMena @ JuanMena:
    Kissing random dudes choking in celery? Really? Need to study for that?
  • K3N1 @ K3N1:
    Yes it requires a degree
  • K3N1 @ K3N1:
    I could also yank out the rest of my teeth but theirs professionals for that
  • x65943 @ x65943:
    If your throat closes, putting oxygen in your mouth will not solve anything - as you will be introducing oxygen prior to the area of obstruction
  • JuanMena @ JuanMena:
    Just kiss me Kyle.
  • x65943 @ x65943:
    You either need to be intubated to bypass obstruction or create a stoma inferior to the the area of obstruction to survive
  • x65943 @ x65943:
    "Just kiss me Kyle." And I thought all the godreborn gay stuff was a smear campaign
  • JuanMena @ JuanMena:
    If I die, tell my momma I won't be carrying Baby Jesus this christmas :sad::cry:
  • K3N1 @ K3N1:
    Smear campaigns are in The political section now?
  • JuanMena @ JuanMena:
    Chary! Chary! Chary, Chary, Chary!
  • Sonic Angel Knight @ Sonic Angel Knight:
    Pork Provolone :P
  • Psionic Roshambo @ Psionic Roshambo:
    Sounds yummy
  • K3N1 @ K3N1:
    Sweet found my Wii u PSU right after I ordered a new one :tpi:
  • JuanMena @ JuanMena:
    It was waiting for you to order another one.
    Seems like, your PSU was waiting for a partner.
  • JuanMena @ JuanMena:
    Keep them both
    separated or you'll have more PSUs each year.
  • K3N1 @ K3N1:
    Well one you insert one PSU into the other one you get power
  • JuanMena @ JuanMena:
    It literally turns it on.
  • K3N1 @ K3N1:
    Yeah power supplies are filthy perverts
  • K3N1 @ K3N1:
    @Psionic Roshambo has a new friend
    +1
  • JuanMena @ JuanMena:
    It's Kyle, the guy that went to school to be a Certified man Kisser.
  • Psionic Roshambo @ Psionic Roshambo:
    Cartmans hand has taco flavored kisses
  • A @ abraarukuk:
    hi guys
    A @ abraarukuk: hi guys