Hacking LED Mod for Ultimate Loader v7.3 (1.5)

Dteyn

Well-Known Member
OP
Member
Joined
Aug 3, 2008
Messages
335
Trophies
0
XP
115
Country
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.
smile.gif

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);
 

Dueler

Well-Known Member
Member
Joined
Jan 22, 2009
Messages
124
Trophies
0
Age
34
Website
dueler.blogspot.com
XP
206
Country
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
tongue.gif
 

Dteyn

Well-Known Member
OP
Member
Joined
Aug 3, 2008
Messages
335
Trophies
0
XP
115
Country
Canada
Thanks guys, I'm glad you find it useful!
smile.gif


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.
smile.gif
 

daknight

Well-Known Member
Newcomer
Joined
Sep 30, 2008
Messages
49
Trophies
0
XP
72
Country
That is an useful function
biggrin.gif
I do the same with big games and then to play my 360 while is ripping the game so this function is pretty sweet
biggrin.gif


Thanks a lot for doing this
happy.gif
 

Dteyn

Well-Known Member
OP
Member
Joined
Aug 3, 2008
Messages
335
Trophies
0
XP
115
Country
Canada
Don Killah said:
nice tweak mate, do you mind if i'm using it?

Not at all, go for it!
smile.gif


FenrirWolf said:
Sounds cool. People should test it to make sure that nothing broke during the changes for some reason.

I've tested it pretty thoroughly (played quite a few games), so far nothing has come up. The only change is adding some code to the menu.c portion of the code, so it shouldn't break any functionality... just add some.
smile.gif


QUOTE(forbore @ Apr 18 2009, 07:18 PM)
I really thought that there was a bug on my screen a first! :wtf:

unsure.gif
smileipb2.png
wink.gif
 

wiistarter

Well-Known Member
Member
Joined
Apr 11, 2009
Messages
385
Trophies
0
XP
114
Country
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
 

Dteyn

Well-Known Member
OP
Member
Joined
Aug 3, 2008
Messages
335
Trophies
0
XP
115
Country
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.
smile.gif


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.
smile.gif
 

jeremiz

Well-Known Member
Newcomer
Joined
May 24, 2007
Messages
82
Trophies
0
XP
689
Country
France
Could you make please, with the latest version of ultimate usb loader, the led glow when you launch a game too?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    NinStar @ NinStar: you can't turn link into a femboy in tears of the kingdom