Help compiling a boot.dol

Discussion in 'Wii - Hacking' started by zantzue, Jan 29, 2011.

Jan 29, 2011

Help compiling a boot.dol by zantzue at 8:52 AM (2,067 Views / 0 Likes) 11 replies

  1. zantzue
    OP

    Member zantzue GBAtemp Regular

    Joined:
    Mar 14, 2009
    Messages:
    102
    Location:
    Basque Country
    Country:
    Antarctica
    Hi! Here's a code I found on the Internet (credits go to giantpune):
    CODE//super complicated channel loader- giantpune
    #include
    #include
    //#include
    #include

    #define TITLE_ID(x,y) (((u64)(x) viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();

    //if you want to put a splash screen, put it here, but it will just be a waste of time. the splash in the forwarder
    //is only showed while loading dols into memory, this would be shown before the channel even started to load
    //so i wouldn't do it.

    WII_Initialize();
    //just change the 4A4F4449 to the hex value for the ID4 of the title to boot.
    //all channels that show up on the system menu should be 00010001
    WII_LaunchTitle(TITLE_ID(0x00010001,0x4A4F4449));

    //should not reach this point if the title is installed on the wii, but if it does, it will fall back on a stub to direct it
    //if using a newer version of libogc, exit(0) returns the system menu if no stub is found.
    exit (0);

    //really, really should never make it this far. if it does, the wii will just blackscreen and need a hard reset
    return 0;
    }
    I compiled it and it worked properly; it launches new HBC from NAND. The thing is that I want to change that code so that it looks for new HBC but if it doesn't find it, looks for JODI and HAXX. Here's what I changed:
    CODE#include
    #include
    //#include
    #include


    #define TITLE_ID(x,y) (((u64)(x) viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();

    WII_Initialize();
    printf("Launching Homebrew Channel 1.0.7/1.0.8");
    WII_LaunchTitle(TITLE_ID(0x00010001,0xAF1BF516));
    If (WII_LaunchTitle(TITLE_ID(0x00010001,0xAF1BF516))
     
  2. chonka

    Newcomer chonka Member

    Joined:
    Oct 17, 2010
    Messages:
    26
    Country:
    Australia
    i cant code but just looking at this seems to me it would be talking about this line

    if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();

    its saying IF this - but nothing there after it
     
  3. tj_cool

    Supervisor tj_cool Stuff

    Joined:
    Jan 7, 2009
    Messages:
    9,942
    Location:
    This planet
    Country:
    Belgium
    Something I noticed myself is that there's a Capitalized if. I believe C is Capital sensitive, so try changing that.
     
  4. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,405
    Location:
    Engine room, learning
    Country:
    France
    No, there's something after that "if" :
     
  5. zantzue
    OP

    Member zantzue GBAtemp Regular

    Joined:
    Mar 14, 2009
    Messages:
    102
    Location:
    Basque Country
    Country:
    Antarctica
    The problem was that I wrote "IF" instead of "if" [​IMG]. Now it compiles but It doesn't do what I want. I think the probem is "if WII_LaunchTitle(TITLE_ID(0x00010001,0x48415858))[/b]0)" instead of "if WII_LaunchTitle(TITLE_ID(0x00010001,0x48415858))
     
  6. FIX94

    Global Moderator FIX94 Global Moderator

    Joined:
    Dec 3, 2009
    Messages:
    6,531
    Location:
    ???
    Country:
    Germany
     
  7. conanac

    Member conanac Be an Angel

    Joined:
    Sep 13, 2009
    Messages:
    252
    Country:
    United States
    I am not sure why you call WII_LaunchTitle two times for each of HBC version. Another bug perhaps is that you use
    0x48415858 as JODI but this is actually HAXX.

    There is almost a similar goal in the sys.cpp code (taken from usbloadergx) that perhaps could help you trying, but
    without those printf statements (you could re-add them if you want):

    #define HBC_HAXX 0x0001000148415858LL
    #define HBC_JODI 0x000100014A4F4449LL
    #define HBC_1_0_7 0x00010001AF1BF516LL

    WII_Initialize();

    int ret = WII_LaunchTitle(HBC_1_0_7);
    if(ret < 0)
    WII_LaunchTitle(HBC_JODI);
    if(ret < 0)
    WII_LaunchTitle(HBC_HAXX);
     
  8. FIX94

    Global Moderator FIX94 Global Moderator

    Joined:
    Dec 3, 2009
    Messages:
    6,531
    Location:
    ???
    Country:
    Germany

    I have not tested it yet but I'm sure it will work fine!
     
  9. zantzue
    OP

    Member zantzue GBAtemp Regular

    Joined:
    Mar 14, 2009
    Messages:
    102
    Location:
    Basque Country
    Country:
    Antarctica
    @FIX94 It seems to work. I launched the boot.dol from HAXX HBC. It should have launched JODI HBC but it didn't (I have both installed on my Wii). But that's normal as I switched channels' IDs by mistake. I used 0x48415858 as JODI but that's actually HAXX and viceversa. Thank you for compiling it and pointing me in the right direction: there's no need for "if" sentences. I compiled the code of your last post and it seems to work properly. Displays text and it launches the HBC is installed on the Wii. Thank you very much indeed!

    @conanac hopefully you realized of the ID istake. I didn't finally try the changes you suggest as the code FIX94 gave me works perfectly but I do much appreciate your help.

    Now I'm trying to figure out how to use delay function...
    EDIT: I´m using
    CODEtime_t start_time, cur_time;

    ÂÂÂÂÂÂÂÂ time(&start_time);
    ÂÂÂÂÂÂÂÂ do
    ÂÂÂÂÂÂÂÂ {
    ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ time(&cur_time);
    ÂÂÂÂÂÂÂÂ }
    ÂÂÂÂÂÂÂÂ while((cur_time - start_time) < 10);
    It works. Now I'm trying to make the boot.dol to write the text in different lines...
     
  10. FIX94

    Global Moderator FIX94 Global Moderator

    Joined:
    Dec 3, 2009
    Messages:
    6,531
    Location:
    ???
    Country:
    Germany
    edit2:
    Here is a compiled version:
    http://www.mediafire.com/?77kzp77o9xupjak
    Please say me if it works!
     
  11. zantzue
    OP

    Member zantzue GBAtemp Regular

    Joined:
    Mar 14, 2009
    Messages:
    102
    Location:
    Basque Country
    Country:
    Antarctica
    I agree with you. "usleep" is easier to use. Thank you! Ah, and I discovered how to create a new line by using "\n".
     
  12. DEFIANT

    Member DEFIANT GBAtemp Fan

    Joined:
    Dec 9, 2008
    Messages:
    344
    Location:
    Gallifrey
    Country:
    United States
    Warning: Spoilers inside!


    How do I compile this code? What do I need? There's no makefile. I'm a newbie so type slow...ha. And if I want to point it to another channel and I have the ID number how would I do that also?
     

Share This Page