1. JoostinOnline

    OP JoostinOnline Certified Crash Test Dummy
    Member

    Joined:
    Apr 2, 2011
    Messages:
    11,000
    Country:
    United States
    The next version of Settings Editor GUI prompts you how you want to exit when in an emu nand (using exit(0) doesn't work). Currently all the options (various channels and shutdown/reset) are displayed, but, if the channel isn't installed, it gives a message and asks again. That works okay, but I want to limit the list of channels depending on what you have installed. Here is my code:
    Code:
    void EmuExitPrompt(void) {
    int item;
    char menu[1024];
    do
    {
    *menu = '\0';
    grlib_menuAddItem (menu, 1, "Load Homebrew Channel");
    grlib_menuAddItem (menu, 2, "Load Homebrew Filter");
    grlib_menuAddItem (menu, 3, "Load PostLoader Channel");
    grlib_menuAddSeparetor (menu);
    grlib_menuAddItem (menu, 4, "Restart Wii");
    grlib_menuAddItem (menu, 5, "Shutdown Wii");
    
    item = grlib_menu ("------ Select an exit type ------", menu);
    if (item == 1) {
    WII_LaunchTitle(TITLE_ID(0x00010001,0xAF1BF516)); // HBC v1.0.7+
    WII_LaunchTitle(TITLE_ID(0x00010001,0x4a4f4449)); // HBC JODI
    WII_LaunchTitle(TITLE_ID(0x00010001,0x48415858)); // HBC HAXX
    Message ("Homebrew Channel not installed");
    sleep (1);
    }
    if (item == 2) {
    WII_LaunchTitle(TITLE_ID(0x00010001,0x54484246)); // Homebrew Filter THBF
    Message ("Homebrew Filter not installed");
    sleep (1);
    }
    if (item == 3) {
    WII_LaunchTitle(TITLE_ID(0x00010001,0x504f5354)); // postLoader2 Channel POST
    Message ("PostLoader Channel not installed");
    sleep (1);
    }
    if (item == 4) {
    SYS_ResetSystem(SYS_RESTART,0,0); // Restart Wii
    }
    if (item == 5) {
    SYS_ResetSystem(SYS_SHUTDOWN,0,0); // Shutdown Wii
    }
    }
    while (true);
    
    } // EmuExitPromt
    
     
  2. JoostinOnline

    OP JoostinOnline Certified Crash Test Dummy
    Member

    Joined:
    Apr 2, 2011
    Messages:
    11,000
    Country:
    United States
    Anybody have a response to this?
     
  3. obcd

    obcd GBAtemp Advanced Maniac
    Member

    Joined:
    Apr 5, 2011
    Messages:
    1,594
    Country:
    Belgium
    Either you can scan the title/00010001 folder or you can search for entries in the uid.sys file.

    You can find usfull code snippets in channel loader programs like Mighty Channels, Postloader, Triiforce.
     
    1 person likes this.
  4. JoostinOnline

    OP JoostinOnline Certified Crash Test Dummy
    Member

    Joined:
    Apr 2, 2011
    Messages:
    11,000
    Country:
    United States
    Thanks. Wouldn't uid.sys contain entries for deleted channels?
     
  5. obcd

    obcd GBAtemp Advanced Maniac
    Member

    Joined:
    Apr 5, 2011
    Messages:
    1,594
    Country:
    Belgium
    Don't know. Logically, they should be removed from that file if the channel is properly deinstalled. Scanning the folder is a better solution.
     
  6. SifJar

    SifJar Not a pirate
    Member

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    uid.sys will include deleted channels, it's not a log of what is installed, it's a log of what has been run (and the uids associated with them). Scanning the folder is the best way to do I think.
     
  7. JoostinOnline

    OP JoostinOnline Certified Crash Test Dummy
    Member

    Joined:
    Apr 2, 2011
    Messages:
    11,000
    Country:
    United States
    Thanks guys. I'm about to release a new version already (just waiting for one more report), but I'll probably add this in the one after.
     
  8. giantpune

    giantpune GBAtemp Addict
    Member

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    ES_GetNumContents or whatever its called
    or ISFS_ReadDir( "/title/00010001/blablabla/content", ... )
     
    1 person likes this.
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - installed, easiest, Whats