Help compiling a boot.dol

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

  1. zantzue
    OP

    zantzue GBAtemp Regular

    Member
    3
    Mar 14, 2009
    Basque Country
    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

    chonka Member

    Newcomer
    1
    Oct 17, 2010
    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

    tj_cool Site dev

    Supervisor
    8
    Jan 7, 2009
    Belgium
    This planet
    Something I noticed myself is that there's a Capitalized if. I believe C is Capital sensitive, so try changing that.
     
  4. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    20
    Oct 27, 2002
    France
    Engine room, learning
    No, there's something after that "if" :
     
  5. zantzue
    OP

    zantzue GBAtemp Regular

    Member
    3
    Mar 14, 2009
    Basque Country
    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

    FIX94 Global Moderator

    Global Moderator
    20
    Dec 3, 2009
    Germany
    ???
     
  7. conanac

    conanac Be an Angel

    Member
    3
    Sep 13, 2009
    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

    FIX94 Global Moderator

    Global Moderator
    20
    Dec 3, 2009
    Germany
    ???

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

    zantzue GBAtemp Regular

    Member
    3
    Mar 14, 2009
    Basque Country
    @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

    FIX94 Global Moderator

    Global Moderator
    20
    Dec 3, 2009
    Germany
    ???
    edit2:
    Here is a compiled version:
    http://www.mediafire.com/?77kzp77o9xupjak
    Please say me if it works!
     
  11. zantzue
    OP

    zantzue GBAtemp Regular

    Member
    3
    Mar 14, 2009
    Basque Country
    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

    DEFIANT GBAtemp Fan

    Member
    3
    Dec 9, 2008
    United States
    Gallifrey
    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?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice