LED Mod for Ultimate Loader v7.3 (1.5)

Discussion in 'Wii - Hacking' started by Dteyn, Apr 18, 2009.

  1. Dteyn
    OP

    Dteyn GBAtemp Fan

    Member
    338
    2
    Aug 3, 2008
    Canada
    I was using the USB Loader to backup my original discs and with some of the larger games (GH, SSBB) taking up to 30 mins or more, I tend to switch back to TV to occupy the time while the game installs. I wanted a way to know when the game is done installing without having to switch video to the Wii and back to TV.

    So I did some digging and found wiilight, a demo implementation by Bool of how to turn the wii slot light on and off. I narrowed down which portion of the code turns the slot light LED on/off, modified one function name (just to make it easier to read) and placed the proper bits and pieces into the right spots in the source code for the USB Loader.

    The result is a copy of Ultimate Loader v7.3 (based on SD/USB Loader v1.5) that will turn on the slot light LED when a game is done ripping. It will turn the light off again as soon as you press a button to continue. I've tested it and it works fine for me, so I thought I'd share it.

    You can download the package (including compiled .dol and source code) at the following link. Enjoy!

    http://sharebee.com/0e383191


    Here are the relevant bits of code, if someone wants to incorporate this functionality into their own source. All of the modifications are in menu.c:

    Place at the top of menu.c (line 55). This is used to set the location of the register used to control the slot light:
    Code:
    /* Slot light patch - Dteyn (with source from Bool's wiilight) */
    static vu32 *_wiilight_reg = (u32*)0xCD0000C0;
    Place in the Menu_Install() routine at line 708. This must go before the out: label in order to properly turn on the light when the game ripping succeeds. The light will not be turned on if the ripping fails.
    Code:
    ÂÂÂÂ/* Turn on the Slot Light - Dteyn (with source from Bool's wiilight) */
    ÂÂÂÂwiilight(1);
    Place at line 718. This will turn off the slot light:
    Code:
    ÂÂÂÂ/* Turn off the Slot Light */
    ÂÂÂÂwiilight(0);
    Finally, the routine that does the dirty work. I placed this at the end of the file, but you can put it anywhere so long as it's not in the middle of another routine. [​IMG]
    Code:
    void wiilight(int enable){ÂÂÂÂÂÂÂÂÂÂÂÂ // Toggle wiilight (thanks Bool for wiilight source)
    ÂÂÂÂu32 val = (*_wiilight_reg&~0x20);ÂÂÂÂÂÂÂÂ
    ÂÂÂÂif(enable) val |= 0x20;ÂÂÂÂÂÂÂÂÂÂÂÂ 
    ÂÂÂÂ*_wiilight_reg=val;ÂÂÂÂÂÂÂÂÂÂÂÂ
    }
    Edit: Almost forgot, you'll also need to add a prototype entry to the menu.h file as such, I added it on line 12:
    Code:
    void wiilight(int enable);
     


  2. kedest

    kedest GBAtemp Psycho!

    Member
    3,287
    110
    Feb 6, 2007
    Netherlands
    That's pretty cool man, very useful. Good thinking!
     
  3. adam_the_1st

    adam_the_1st GBAtemp Regular

    Member
    118
    0
    Apr 10, 2009
    Canada
    Sounds wonderful, will this be included officially on each release fro now on? (it should) THANKS
     
  4. saelee84

    saelee84 Advanced Member

    Newcomer
    95
    0
    Feb 19, 2009
    United States
    Works like you said, thank you.
     
  5. rommy667

    rommy667 GBAtemp Advanced Fan

    Member
    514
    7
    Mar 21, 2008
    Down the road around the corner
    Thanks a lot even though i use windows guis mostly this is indeed handy [​IMG]
     
  6. lajd

    lajd GBAtemp Regular

    Member
    146
    0
    Apr 3, 2008
    United States
    thanks for sharing the info on how to do it.
     
  7. Dueler

    Dueler GBAtemp Regular

    Member
    124
    1
    Jan 22, 2009
    I love it.
    Makes me even more anxious to get my black katana case with red led xD
    It will be a silly thing for them not to add this into the main Ultimate source [​IMG]
     
  8. kallstar

    kallstar Advanced Member

    Newcomer
    80
    0
    Dec 22, 2008
    United States
    Good work Dteyn. Its a very useful addition!
     
  9. Dteyn
    OP

    Dteyn GBAtemp Fan

    Member
    338
    2
    Aug 3, 2008
    Canada
    Thanks guys, I'm glad you find it useful! [​IMG]

    I would like to see it added to the main source tree, since it's a small addition and could easily be made an option in the config file.

    All in all it was pretty fun putting it all together too, considering I'm not much of a C coder... I have VB (Visual Bullshit) and 8-bit assembly experience, but only ever dabbled in C enough that I can somewhat read and understand it, but I can't yet write C code from scratch... I envy the guys that know C like a second language, it's such a useful programming language. [​IMG]
     
  10. daknight

    daknight Member

    Newcomer
    49
    0
    Sep 30, 2008
    That is an useful function [​IMG] I do the same with big games and then to play my 360 while is ripping the game so this function is pretty sweet [​IMG]

    Thanks a lot for doing this [​IMG]
     
  11. Don Killah

    Don Killah GBAtemp Maniac

    Member
    1,127
    0
    Nov 21, 2002
    France
    nice tweak mate, do you mind if i'm using it?
     
  12. FenrirWolf

    FenrirWolf GBAtemp Psycho!

    Member
    4,346
    326
    Nov 19, 2008
    United States
    Sandy, UT
    Sounds cool. People should test it to make sure that nothing broke during the changes for some reason.
     
  13. forbore

    forbore GBAtemp Regular

    Member
    247
    0
    Oct 30, 2008
    Canada
    /dev/canada/quebec
    Thanks a lot! Now I don't have to let the TV on to know if the dump is done! [​IMG]

    I really thought that there was a bug on my screen a first! :wtf:
     
  14. Dteyn
    OP

    Dteyn GBAtemp Fan

    Member
    338
    2
    Aug 3, 2008
    Canada
    [​IMG] [​IMG] [​IMG]
     
  15. wiistarter

    wiistarter GBAtemp Fan

    Member
    385
    0
    Apr 11, 2009
    This is nice.. Now the kids can still watch TV while Im ripping games and it will spare me from the frowning and moaning..

    Thanks
     
  16. Dteyn
    OP

    Dteyn GBAtemp Fan

    Member
    338
    2
    Aug 3, 2008
    Canada
    The LED mod is now included in the main source for Ultimate v7.4. You can find hungryip84's post here: http://gbatemp.net/index.php?showtopic=147...t&p=1919972

    I kinda surprised myself by figuring it out to be honest, it started out as an idea earlier this afternoon, I did a couple searches on Wiibrew and about 30 mins later I was ready to test the first compile, which worked first try. I'm glad I'm able to share a new feature instead of just requesting one. [​IMG]

    It's amazing to see how fast this project is developing. Hehe, I can just imagine the people who haven't logged in in 6 months, logging in today.. they would be floored! Heheh, I remember when the idea of playing DVD-R backups without a modchip was considered impossible.. and here we are with a USB Loader, lol. Anyways that's enough rambling, I'm just glad everyone seems to like the LED mod and that I could contribute something to this community. [​IMG]
     
  17. Don Killah

    Don Killah GBAtemp Maniac

    Member
    1,127
    0
    Nov 21, 2002
    France
    thanks mate, then i'm gonna use it.
     
  18. Elfish

    Elfish GBAtemp Fan

    Member
    447
    3
    Sep 20, 2004
    Gambia, The
    cool!

    would be nice if the disc would auto eject [​IMG]

    but the led thingy is nice too
     
  19. Firedrake1

    Firedrake1 GBAtemp Regular

    Member
    100
    0
    Dec 20, 2007
    United States
    Traverse City, Mi
    Much obliged
     
  20. jeremiz

    jeremiz Advanced Member

    Newcomer
    70
    1
    May 24, 2007
    France
    Could you make please, with the latest version of ultimate usb loader, the led glow when you launch a game too?