Homebrew Official Homebrew Launcher for WiiU

  • Thread starter Cyan
  • Start date
  • Views 804,320
  • Replies 1,173
  • Likes 98

cyb0rg

Well-Known Member
Newcomer
Joined
Aug 29, 2014
Messages
79
Trophies
0
XP
1,707
Country
United States
Works great.

Stupid question? When I exit back to the WiiU home screen from Loadine_GX2 how do I get back to the loadine_GX2 select game screen or the homebrew screen. I tried going back into the internet and launching the Homebrew/exploit page but the WiiU just locks and I have to reboot the WiiU from the main unit.

Clicking on Mii Maker relaunches HBL for me.
 

sj33

Well-Known Member
Member
Joined
Oct 22, 2013
Messages
4,072
Trophies
2
XP
4,726
Country
Japan
Ok guys as promised since MN1 officially released his exploit and the sources. Here is the HBL installer merged with the new gx2sploit. Single launch link.

Before I commit it I want to ask people on 5.3.2, 5.4.0, 5.5.0 and 5.5.1 to test these files:
http://www100.zippyshare.com/v/TmcRPVvU/file.html

(actually I tested it on 5.3.2 so that one is not needed)

Hey

so as mentioned in the above posts here is RC3 of v1.2 with the new stable kernel exploit for firmwares >= 5.3.2. Older firmwares still use the OSDriver exploit as there are a few missing addresses for it. If someone is going to provide the addresses I will merge them.

This also adds the promised single web link launch of the HBL for firmwares 5.5.0 and 5.5.1.

Here is v1.2 RC3:
https://github.com/dimok789/homebrew_launcher/releases/tag/v1.2_RC3

As usual report whatever bugs you find.
I can confirm this working perfectly on a WAMP local server, Japanese 5.5.1.
 

Filzek

Well-Known Member
Newcomer
Joined
Jul 18, 2015
Messages
50
Trophies
0
Age
46
XP
103
Country
Brazil
@dimok do you think with the 5.5.x kernel exploit is possible to do the same as in WII and finally install the HBC with loader inside the WIIU?

My suggestion to this is quite simple, can you try to do this?
1) replace a current Channel Application in WIIU with a SIGNED APP/ELF to run
2) As it run it touch the kernel exploit again and enable full system usage.

3) Will a USB HDD will be really usable in nearby future?
 

Net-KILLER

computer says no
Member
Joined
Oct 22, 2009
Messages
611
Trophies
0
Location
in a pineapple under the sea
XP
526
Country
Saint Kitts and Nevis
@dimok do you think with the 5.5.x kernel exploit is possible to do the same as in WII and finally install the HBC with loader inside the WIIU?

My suggestion to this is quite simple, can you try to do this?
1) replace a current Channel Application in WIIU with a SIGNED APP/ELF to run
2) As it run it touch the kernel exploit again and enable full system usage.

3) Will a USB HDD will be really usable in nearby future?
If you have signed applications you don't need kernel access to install them, or am I wrong ?
 

Filzek

Well-Known Member
Newcomer
Joined
Jul 18, 2015
Messages
50
Trophies
0
Age
46
XP
103
Country
Brazil
@Net-KILLER problem is that you need FIRST to EXPLOIT the KERNEL to be able to REPLACE the current APP.

So after you replace the current APP, the new APP will RUN in the USER MODE as it is in all APPs with WIIU, BUT inside will be the EXPLOIT to touch the KERNEL area, so this APP will do is replace the current INTERNET/BROWSER mode to access the KERNEL area.

@TotalInsanity4 I neved did program for WIIU or know the filesystem/apps, but MAYBE they can SIGN an elf to be RUN in usermode without being exploit, this MAYBE because as they have the KEYS to decrypt an file/app, so, they can CRYPT/SIGN it back? Have no idea.

Devs sometimes need some clues or some push to do things, as KERNEL area is new to 5.5.1 there will be plent new playground to move on, so this is the right time to brainstorm ideas.
 

Net-KILLER

computer says no
Member
Joined
Oct 22, 2009
Messages
611
Trophies
0
Location
in a pineapple under the sea
XP
526
Country
Saint Kitts and Nevis
@Net-KILLER problem is that you need FIRST to EXPLOIT the KERNEL to be able to REPLACE the current APP.

So after you replace the current APP, the new APP will RUN in the USER MODE as it is in all APPs with WIIU, BUT inside will be the EXPLOIT to touch the KERNEL area, so this APP will do is replace the current INTERNET/BROWSER mode to access the KERNEL area.

@TotalInsanity4 I neved did program for WIIU or know the filesystem/apps, but MAYBE they can SIGN an elf to be RUN in usermode without being exploit, this MAYBE because as they have the KEYS to decrypt an file/app, so, they can CRYPT/SIGN it back? Have no idea.

Devs sometimes need some clues or some push to do things, as KERNEL area is new to 5.5.1 there will be plent new playground to move on, so this is the right time to brainstorm ideas.
Ok - I see.
But STOP this THING with the upper case WORDS please.
You do that often and it's annoying.
 

Filzek

Well-Known Member
Newcomer
Joined
Jul 18, 2015
Messages
50
Trophies
0
Age
46
XP
103
Country
Brazil
@Net-KILLER sorry I will quit using upper case to "bold" and idea....

I think the efforts to do this will be the next step into wiiu sceene...

Offline HBC, Realtime Exploit, USB Loader.

This is the final frontier to match wii era...

--------------------- MERGED ---------------------------

@Net-KILLER to all I know on wiiu besides the signed application you need a key ticket in the system to run it, so, even just signed file doesnt allow you to run it.... so, Kernel mode replace one application with the exploit/app, also add the key ticket to the system. When you normal boot/turn on the wiiu it will be fully executable.
 
  • Like
Reactions: Net-KILLER

Net-KILLER

computer says no
Member
Joined
Oct 22, 2009
Messages
611
Trophies
0
Location
in a pineapple under the sea
XP
526
Country
Saint Kitts and Nevis
@Net-KILLER sorry I will quit using upper case to "bold" and idea....

I think the efforts to do this will be the next step into wiiu sceene...

Offline HBC, Realtime Exploit, USB Loader.

This is the final frontier to match wii era...
Sounds good ;)

Do you have experience with this stuff ?
Naehrwert published some interesting stuff
You maybe want to read it.
 
  • Like
Reactions: TotalInsanity4

brienj

Trying to avoid getting cancer
Member
Joined
Jan 3, 2016
Messages
1,232
Trophies
0
Website
twitter.com
XP
2,142
Country
United States
Using the code from the hello world example at https://github.com/dimok789/hello_world in my conversion of Ast-U-Roids to be compatible with the Homebrew Launcher I came across a problem. The code on line 62 - 65 in main.c to set pointer to the variable screenbuffer results in the graphics and text being shifted to the right.
Code:
unsigned char *screenBuffer = MEM1_alloc(screen_buf0_size + screen_buf1_size, 0x40);

OSScreenSetBufferEx(0, screenBuffer);
OSScreenSetBufferEx(1, (screenBuffer + screen_buf0_size));

But by not setting pointer to variable screenbuffer and using hardcoded address as below results in the graphics and text being shown correctly.
Code:
OSScreenSetBufferEx(0, (void *)0xF4000000);
OSScreenSetBufferEx(1, ((void *)0xF4000000 + screen_buf0_size));

And of course I also removed all code references to the screenbuffer variable.

It at least works, but wondering if there may be a better way of fixing this problem, or perhaps maybe my draw.h needs fixing instead. Anyone else having this issue?

Also, I am debating on creating my own sound functions, but you have so much sound coding already done in your apps, both Homebrew Launcher and Loadiine GX2, I hate to reinvent the wheel. All of my code is done in C though, and all of your sound functions are done in C++. What is the easiest way to wrap and use those functions in my C code? I've only ever dealt with it the other way, the main code in C++, and then using code or libraries written in C in that. Any easy pointers on doing it? But thanks for making the Homebrew Launcher so developers can easily share their apps with everyone.
 

dimok

Well-Known Member
Member
Joined
Jan 11, 2009
Messages
728
Trophies
3
XP
2,635
Country
United States
@dimok do you think with the 5.5.x kernel exploit is possible to do the same as in WII and finally install the HBC with loader inside the WIIU?

My suggestion to this is quite simple, can you try to do this?
1) replace a current Channel Application in WIIU with a SIGNED APP/ELF to run
2) As it run it touch the kernel exploit again and enable full system usage.

3) Will a USB HDD will be really usable in nearby future?
Yeah, I do not have the key to sign the applications and actually it would be illegal to have it and doing that. So that means we can't install any channel. We need to patch the IOS signature check and verify function to always return success, then this would be possible. Though that would have to happen somewhere in the WiiU boot sequence before loading the system menu.

Using the code from the hello world example at https://github.com/dimok789/hello_world in my conversion of Ast-U-Roids to be compatible with the Homebrew Launcher I came across a problem. The code on line 62 - 65 in main.c to set pointer to the variable screenbuffer results in the graphics and text being shifted to the right.
Code:
unsigned char *screenBuffer = MEM1_alloc(screen_buf0_size + screen_buf1_size, 0x40);

OSScreenSetBufferEx(0, screenBuffer);
OSScreenSetBufferEx(1, (screenBuffer + screen_buf0_size));

But by not setting pointer to variable screenbuffer and using hardcoded address as below results in the graphics and text being shown correctly.
Code:
OSScreenSetBufferEx(0, (void *)0xF4000000);
OSScreenSetBufferEx(1, ((void *)0xF4000000 + screen_buf0_size));

And of course I also removed all code references to the screenbuffer variable.

It at least works, but wondering if there may be a better way of fixing this problem, or perhaps maybe my draw.h needs fixing instead. Anyone else having this issue?

Also, I am debating on creating my own sound functions, but you have so much sound coding already done in your apps, both Homebrew Launcher and Loadiine GX2, I hate to reinvent the wheel. All of my code is done in C though, and all of your sound functions are done in C++. What is the easiest way to wrap and use those functions in my C code? I've only ever dealt with it the other way, the main code in C++, and then using code or libraries written in C in that. Any easy pointers on doing it? But thanks for making the Homebrew Launcher so developers can easily share their apps with everyone.
Hey. Intressting. I never noticed it moved the text. Your solution might actually be the only correct one as that is how nintendo uses the OSScreen functions. Though the only place I saw them using that in is the OSFatal function after which the console hangs anyway. It is weird though that the position of framebuffer modifies the screen X-position of the text. Right now I dont have a suggestion for you for a better fix. Would need to look at it again. Just leave out the memory heap initialization/deinitialization of MEM1 (memory.c) and use your method for now. That initialization/deinitialization is required for GX2 only for now.

As for the sound stuff I will write you up something and point you to the things that need to be done later today as I am currently short on time right now.

Btw just a tip since you develop with HBL now you should definately get yourself SendElf or wiiload.py.

http://wiibrew.org/wiki/Sendelf
http://pastebin.com/raw/4nWAkBpw or http://wiibrew.org/wiki/Wiiload

Enter the IP of your WiiU in it and you can directly send the ELF file to HBL and launch it via WiFi/LAN without putting it on SD card. You will love that feature as this speeds up developing / testing by a lot.
 
Last edited by dimok,
  • Like
Reactions: brienj

brienj

Trying to avoid getting cancer
Member
Joined
Jan 3, 2016
Messages
1,232
Trophies
0
Website
twitter.com
XP
2,142
Country
United States
Hey. Intressting. I never noticed it moved the text. Your solution might actually be the only correct one as that is how nintendo uses the OSScreen functions. Though the only place I saw them using that in is the OSFatal function after which the console hangs anyway. It is weird though that the position of framebuffer modifies the screen X-position of the text. Right now I dont have a suggestion for you for a better fix. Would need to look at it again. Just leave out the memory heap initialization/deinitialization of MEM1 (memory.c) and use your method for now. That initialization/deinitialization is required for GX2 only for now.

As for the sound stuff I will write you up something and point you to the things that need to be done later today as I am currently short on time right now.

Btw just a tip since you develop with HBL now you should definately get yourself SendElf or wiiload.py.

http://wiibrew.org/wiki/Sendelf
http://pastebin.com/raw/4nWAkBpw or http://wiibrew.org/wiki/Wiiload

Enter the IP of your WiiU in it and you can directly send the ELF file to HBL and launch it via WiFi/LAN without putting it on SD card. You will love that feature as this speeds up developing / testing by a lot.
I was thinking of converting all my graphics to GX2 eventually, but honestly, for the game, using the draw functions is actually fast enough, and almost too fast, although using GX2 would be so much more powerful and would be easier to sync everything correctly. But once I get sound working, I'll probably look into using GX2 and then I would need that anyway, but figured I'd share in case anyone looks at your example program, but only uses the OSScreen functions to draw with. And thanks for the tip about Sendelf, it would come in handy for sure, although I am not able to work on things as much as I did before unfortunately.
 
Joined
Apr 19, 2015
Messages
1,023
Trophies
1
Location
Stuck in the PowerPC
Website
heyquark.com
XP
3,909
Country
Australia
For some reason I can't build any code I wrote for the HBL. I'm able to build and run the hello elf without any issues, but when I try my own code with the exact same Makefile and the exact same linker script I just can't get it to work.

My project contains the hello elf's Makefile and linker script and 3 code files:
entry.c:
Code:
#include "main.h"
int __entry_menu(int argc, char **argv) {
   return main();
}

main.c:
Code:
#include "main.h"
#define OSFatal ((void (*)(char* msg))0x01031618)
int main() {
   OSFatal("That worked.");
   return 0;
}

main.h contains the usual #ifndef stuff and "int main();". That's it. My error is:
Code:
linking ... hello_world.elf
`.got2' referenced in section `.text' of /Users/ash/Downloadsold/devkitPPC/bin/../lib/gcc/powerpc-eabi/4.8.2/libgcc.a(eabi.o): defined in discarded section `.got2' of /Users/ash/Downloadsold/devkitPPC/bin/../lib/gcc/powerpc-eabi/4.8.2/libgcc.a(eabi.o)
`.got2' referenced in section `.text' of /Users/ash/Downloadsold/devkitPPC/bin/../lib/gcc/powerpc-eabi/4.8.2/libgcc.a(eabi.o): defined in discarded section `.got2' of /Users/ash/Downloadsold/devkitPPC/bin/../lib/gcc/powerpc-eabi/4.8.2/libgcc.a(eabi.o)
/Users/ash/Downloadsold/devkitPPC/bin/../lib/gcc/powerpc-eabi/4.8.2/libgcc.a(eabi.o): In function `__eabi':
(.text+0x44): undefined reference to `__init'
collect2: error: ld returned 1 exit status
Yes, devKitPPC is in a different place to usual (it's also separate from the rest of devKitPro) but it didn't affect hello elf. I simply can't figure out why it's not building. Any help would be awesome!
 

Chebico

Well-Known Member
Newcomer
Joined
Feb 24, 2010
Messages
51
Trophies
0
Location
England
Website
Visit site
XP
504
Country
Hey

so as mentioned in the above posts here is RC3 of v1.2 with the new stable kernel exploit for firmwares >= 5.3.2. Older firmwares still use the OSDriver exploit as there are a few missing addresses for it. If someone is going to provide the addresses I will merge them.

This also adds the promised single web link launch of the HBL for firmwares 5.5.0 and 5.5.1.

Here is v1.2 RC3:
https://github.com/dimok789/homebrew_launcher/releases/tag/v1.2_RC3

As usual report whatever bugs you find.

Is there a one click to GX2 anywhere? instead of HBL?
 

dimok

Well-Known Member
Member
Joined
Jan 11, 2009
Messages
728
Trophies
3
XP
2,635
Country
United States
For some reason I can't build any code I wrote for the HBL. I'm able to build and run the hello elf without any issues, but when I try my own code with the exact same Makefile and the exact same linker script I just can't get it to work.

My project contains the hello elf's Makefile and linker script and 3 code files:
entry.c:
Code:
#include "main.h"
int __entry_menu(int argc, char **argv) {
   return main();
}

main.c:
Code:
#include "main.h"
#define OSFatal ((void (*)(char* msg))0x01031618)
int main() {
   OSFatal("That worked.");
   return 0;
}

main.h contains the usual #ifndef stuff and "int main();". That's it. My error is:
Code:
linking ... hello_world.elf
`.got2' referenced in section `.text' of /Users/ash/Downloadsold/devkitPPC/bin/../lib/gcc/powerpc-eabi/4.8.2/libgcc.a(eabi.o): defined in discarded section `.got2' of /Users/ash/Downloadsold/devkitPPC/bin/../lib/gcc/powerpc-eabi/4.8.2/libgcc.a(eabi.o)
`.got2' referenced in section `.text' of /Users/ash/Downloadsold/devkitPPC/bin/../lib/gcc/powerpc-eabi/4.8.2/libgcc.a(eabi.o): defined in discarded section `.got2' of /Users/ash/Downloadsold/devkitPPC/bin/../lib/gcc/powerpc-eabi/4.8.2/libgcc.a(eabi.o)
/Users/ash/Downloadsold/devkitPPC/bin/../lib/gcc/powerpc-eabi/4.8.2/libgcc.a(eabi.o): In function `__eabi':
(.text+0x44): undefined reference to `__init'
collect2: error: ld returned 1 exit status
Yes, devKitPPC is in a different place to usual (it's also separate from the rest of devKitPro) but it didn't affect hello elf. I simply can't figure out why it's not building. Any help would be awesome!
Hey the problem is you called your main function "main". It conflicts with the pre-defined stuff in devkitPPC for the Wii. Rename the function to something different like for example "_main()". That will work.

Is there a one click to GX2 anywhere? instead of HBL?
Check out the loadiine gx2 nightly build packages. It is integrated in them.
 
  • Like
Reactions: QuarkTheAwesome

kavid

Well-Known Member
Member
Joined
Sep 28, 2008
Messages
566
Trophies
1
XP
629
Country
Switzerland
@dimok

wiiu 5.5.1 likely can't one click enter the hbl while it freeze the white screen at the playing video scene.

hbl 1.2 rc3 doesnt work
rc2 can work
 

Attachments

  • QQ图片20160504225015.jpg
    QQ图片20160504225015.jpg
    64.2 KB · Views: 235
Last edited by kavid,

dimok

Well-Known Member
Member
Joined
Jan 11, 2009
Messages
728
Trophies
3
XP
2,635
Country
United States
Also, I am debating on creating my own sound functions, but you have so much sound coding already done in your apps, both Homebrew Launcher and Loadiine GX2, I hate to reinvent the wheel. All of my code is done in C though, and all of your sound functions are done in C++. What is the easiest way to wrap and use those functions in my C code? I've only ever dealt with it the other way, the main code in C++, and then using code or libraries written in C in that. Any easy pointers on doing it? But thanks for making the Homebrew Launcher so developers can easily share their apps with everyone.
So as said before I will point you to the functions that you have to call consecutively to get sounds to work.

The first thing to call of course is the intialisation of AX:
https://github.com/dimok789/loadiin...htly-8f0f7a8/src/sounds/SoundHandler.cpp#L225

Use init with parameters as the other function is old and should not be used anymore with sound lib 2.

After that you have to register a callback function in the AX frame cycle.
https://github.com/dimok789/loadiin...htly-8f0f7a8/src/sounds/SoundHandler.cpp#L242

Just some C function that will be called every 3ms. In this C callback you have to handle your voices. Which you still have to create (you can of course create the voices before registering for the AX frame callback).

Here is my frame callback:
https://github.com/dimok789/loadiin...htly-8f0f7a8/src/sounds/SoundHandler.cpp#L279

(Don't worry about it being C++ its a static function in a class which works very alike to a C function but just with a namespace before it)

So as you see you will have to make a state machine handling all your voices in that function. You must check their current status and process them accordingly. Don't forget to protect the voice with a mutex if you access them from another thread. The AX callback is its own thread.

Ok now to the point on how to aqcuire a voice.
https://github.com/dimok789/loadiine_gx2/blob/Loadiine-nightly-8f0f7a8/src/sounds/Voice.h#L47

This is just a struct with a few internal states. I treat it as a void* because I dont care about its internal variables (which isnt very "clean"). The priority of the voices go from 1 to 31 where 1 is the highest priority.

Once you have acquired a voice you have to define the type of voice. It's either a streaming voice or a normal voice. I always use normal voices as I can do streaming with them as well.

Once you define the type of the voice you can set its volume (AXSetVoiceVe) and mix (AXSetVoiceDeviceMix). The volume is set by the upper 16 bit of the uint you see in that code and max is 0x8000. As for mixing you can do some crazy mixing of up to 6 channels in it. I juse use the two channels of the stereo output in one voice at full volume. It is the simplest form of mixing. That also means that both channel play exactly the same samples here and therefore its only "mono" in my code. To do real stereo you would need to acquire two voices and play the different samples of a channel accordingly. Also I setup the same mixing for TV (device = 0) and DRC (device = 1). So actually one voice does the work for 4 channels. You can of course assign each channel its own voice and play different sounds on them.

Thats all you will actually need to setup the voices.

Now to start playing the voice with your samples. The first step is to set the buffer you want to play. This is set by the AXSetVoiceOffsets function in my code.
https://github.com/dimok789/loadiine_gx2/blob/Loadiine-nightly-8f0f7a8/src/sounds/Voice.h#L79

It takes a struct as an argument that defines the sample buffer, format of it and the offset in the buffer to play and if it should be looped or not. Here is the struct:
https://github.com/dimok789/loadiine_gx2/blob/Loadiine-nightly-8f0f7a8/src/sounds/Voice.h#L155

The sample format should be ADPCM (big endian s8 or s16 samples). The format can either be 8 bit = 0x0A or 16 bit 0x19. If you just want the samples to be played once then define the loop parameter as 0 otherwise 1. Then you define the current position and end position in samples count (so either in 8 bit or 16 bit steps, I use always 16 bit samples so 2 byte per sample). You can also define a loop offset where it should continue to play once it is reached the end sample. The offset is an offset from the start in samples count. It can be any location in memory and does not have to be directly behind the first buffer. With this you can make a 2nd buffer, fill it up with samples and make the voic jump to the start of the 2nd buffer as soon as the end sample of the first buffer is reached. Once it switches to the 2nd buffer you change the end sample variable to the end value of the 2nd buffer and the loop offset back to the start of the 1st buffer. While the 2nd buffer is playing you re-fill the samples of the first buffer. When the 2nd buffer is finished playing and the end sample of the 2nd buffer is reached it will jump back to 1st buffer start. This can go on as long as you want and you can make an endless flawless playing of a stream with it. And that is exactly what I do there. I check in each AX frame callback the loop counter of the voice with AXGetVoiceLoopCount(voice) and if it is changed then I know it switched to a knew buffer. In that case I change the end sample of the voice with AXSetVoiceEndOffset() and then change the loop offset with AXSetVoiceLoopOffset().

So this was a little detour to how to make a stream. Now back to how to start the voice playing. The first initial buffer is set with the function AXSetVoiceOffsets() which takes a pointer to the struct i described before as an argument together with the voice that is used.
After you set the initial sample buffer what is left to do is to define the pitch of the voice by calling AXSetVoiceSrc. It takes another struct that defines a fixed point converted pitch value. See here for the calculation:
https://github.com/dimok789/loadiine_gx2/blob/Loadiine-nightly-8f0f7a8/src/sounds/Voice.h#L91

I dont remember what the last 3 unsigned int values were but they seemed to be always 0. The next function sets the voice interpolation type with AXSetVoiceSrcType which defines what kind of converter should be used. I chose 1 as it is linear interpolation which is ok in most use cases.

The last thing to do is to actually start the voice by calling AXSetVoiceState() with the voice and 1 as parameter (or 0 to stop).

Well that is all to it. I hope I didnt leave anything out. To stop playing you just call AXSetVoiceState() with 0 and then free the voice with AXFreeVoice().

If you still have troubles with getting this to work then let me know. I will write up a simple example application on how to use it which will probably take less time for me than writing this huge post (sorry about it :P).
 
Last edited by dimok,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: 10 tabs open on chrome and no slow downs suck it low ram ple bs lol