programming wii homebrew .dol restart wii??help needed

Post Reply
djdynamite123
Posts: 1
Joined: Tue Sep 23, 2008 10:13 am

programming wii homebrew .dol restart wii??help needed

Post by djdynamite123 » Tue Sep 23, 2008 1:26 pm

hi, im wanting to know how to edit a .dol so when i make it a wad channel, it can restart the wii when i quit, otherwise it will jsut code dump, which makes you have to power off wii, as it is trying to return to the loader(which there isnt one when made to a channel)
i want to program the dol, to make channels so it can restart wii....
and help, would be appreciated, i dont know what tool to use or how to do it, and where to find the source and replace it...


i understand there are developers tips on wiibrew site, which gives codes, but im lost help please....

lnuxguy
Posts: 5
Joined: Sat Jul 19, 2008 5:12 pm

Re: programming wii homebrew .dol restart wii??help needed

Post by lnuxguy » Tue Nov 11, 2008 6:40 pm

Just use exit(0); to exit the program.

bobpaul
Posts: 1
Joined: Fri Apr 17, 2009 9:14 pm

Re: programming wii homebrew .dol restart wii??help needed

Post by bobpaul » Fri Apr 17, 2009 9:24 pm

exit(0) will exit to the loader but will code dump if you loaded your program from the system menu (ie, as a channel). It sounds like djdynamite123 is already using exit(0).

To restart to the system menu, do SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);

If you want your channel to either exit to the loader or to the system menu, check the length of argc.

ie, if your main is "int main(int argc, char *argv[])" then argc will contain the number arguments passed. This will be 0 if loaded from the system menu. This will be 1 if loaded from a loader like HBC. Additionally, argv[0] will be a c-string listing the path of the dol file that was executed (eg: sd:/apps/program/boot.dol).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest