Thank you.
Maybe we could make this thread the main WiiU Homebrew development thread, like we have on 3DS homebrew section.
The other wiiU hacking thread is for the hack development discussion, it's old and have a lot of old informations, not only related to homebrew development.
Having a specific place where developers could share homebrew and ask for help to develop their own homebrew is a good idea to me.
I thought creating such a thread would be a good idea, but we needed someone to create a tutorial on first post, and you did !
I'll rename your thread, if you don't mind, and put it in sticky.
I don't think there's really enough justification quite yet. Maybe if the scene explodes after the IOSU exploit or a lot of stuff comes out now that the Homebrew Loader is a thing, but otherwise there's just not much thereCan we have a separated section for homebrew just like the 3ds
Yeah, the browser was the only thing that was updatedAny one know what the browser version is for 5.5.1 , is the same as 5.5.0 = 3.0.4.2.11 ??
no matter found it , its 3.0.4.2.12 .. would you beleive.
int crand() {
static long seed = OSGetTime(); // the seed value for more randomnes
seed = (seed * 32719 + 3) % 32749;
return ((seed % 32719) + 1);
}
For the most robust solution, you could include this small library and use it, it's well regarded as one of the most "true" random number generators.Does some found a real solution to generate a random Number?
The standard rand(); function from: "cstdlib" will freeze the wiiu.
My current solution:
Code:int crand() { static long seed = OSGetTime(); // the seed value for more randomnes seed = (seed * 32719 + 3) % 32749; return ((seed % 32719) + 1); }
#include "tinymt32.h"
// And if you can't link:
#include "tinymt32.c"
#include <time.h>
#include <stdio.h>
int main(int argc, const char* argv[])
{
tinymt32_t state;
uint32_t seed = OSGetTime();
tinymt32_init(&state, seed);
for (int i=0; i<10; i++)
printf("random number %d: %u\n", i, (unsigned int)tinymt32_generate_uint32(&state));
}
Look up Mongoose server for self-hosting. It's very straightforward. Just launch the .exe from whatever directory you want your server pointing to. When you launch Mongoose, it will bring up a browser tab on your PC. Whatever IP address in the the address bar of that tab, navigate to that address in your Wii U browser.Which is the fastest/easiest way to selfhost an homebrew? I tried wampserver/easyphp, but nothing works. (i always get the forbidden error)
I know i'm total noob, but i'm going mad.
Help me please
char* keyboard()
{
unsigned int coreinit_handle;
OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);
unsigned int vpad_handle;
OSDynLoad_Acquire("vpad.rpl", &vpad_handle);
int(*VPADRead)(int controller, VPADData *buffer, unsigned int num, int *error);
OSDynLoad_FindExport(vpad_handle, 0, "VPADRead", &VPADRead);
static struct renderFlags flags;
//[set all the flags to 0]
VPADData vpad_data;
__os_snprintf(flags.theme, 32, "Zelda ");
__os_snprintf(flags.touching, 32, "");
flags.text[0] = ' ';
int error, n;
VPADRead(0, &vpad_data, 1, &error);
while (1)
{
VPADRead(0, &vpad_data, 1, &error);
if (vpad_data.tpdata.touched == 1) {
flags.touch=1;
__os_snprintf(flags.touching, 32, "%i, %i", vpad_data.tpdata.x, vpad_data.tpdata.y);
//[check for all the keys etc.]
}
if ((vpad_data.btn_hold & BUTTON_X) || flags.xTouched) {
for (n = 0; n < flags.textLength; ++n)
flags.text[n] = ' ';
flags.textLength = 1;
} else if ((vpad_data.btn_hold & BUTTON_B) || flags.bTouched)
flags.b=1;
else if ((vpad_data.btn_hold & BUTTON_PLUS) || flags.plusTouched)
flags.plus=1;
else if((vpad_data.btn_hold & BUTTON_HOME) || flags.HomeTouched)
break;
render(&flags);
}
return flags.text;
}
void _entryPoint()
{
unsigned int coreinit_handle;
OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);
unsigned int vpad_handle;
OSDynLoad_Acquire("vpad.rpl", &vpad_handle);
int(*VPADRead)(int controller, VPADData *buffer, unsigned int num, int *error);
void(*_Exit)();
OSDynLoad_FindExport(vpad_handle, 0, "VPADRead", &VPADRead);
OSDynLoad_FindExport(coreinit_handle, 0, "_Exit", &_Exit);
struct renderFlags flags;
flags.y=0;
flags.x=0;
flags.a=0;
flags.b=0;
__os_snprintf(flags.aPressed, 32, "A button pressed");
__os_snprintf(flags.bPressed, 32, "B button pressed");
__os_snprintf(flags.xPressed, 32, "X button pressed");
__os_snprintf(flags.yPressed, 32, "Y button pressed");
VPADData vpad_data;
VPADRead(0, &vpad_data, 1, &error);
while(1)
{
VPADRead(0, &vpad_data, 1, &error);
if (vpad_data.btn_hold & BUTTON_A)
flags.text = keyboard();
if (vpad_data.btn_hold & BUTTON_B)
flags.b=1;
if (vpad_data.btn_hold & BUTTON_X)
flags.x=1;
if (vpad_data.btn_hold & BUTTON_Y)
flags.y=1;
if (vpad_data.btn_hold & BUTTON_HOME)
break;
render2(&flags);
}
int ii = 0;
for(ii; ii<2; ii++)
{
fillScreen(0, 0, 0, 0);
flipBuffers();
}
_Exit();
}
void render2(struct renderFlags *flags)
{
int i = 0;
for(i; i<2; i++)
{
fillScreen(0, 0, 0, 0);
drawString(0, 0, "Press A to open the keyboard.");
flipBuffers();
}
flags->a = 0;
flags->b = 0;
flags->x = 0;
flags->y = 0;
}
#include "vpad.h"
#include "types.h"
#include "draw.h"
struct renderFlags {
int a;
int b;
int x;
int y;
char aPressed[32];
char bPressed[32];
char xPressed[32];
char yPressed[32];
char* text;
};
void _entryPoint();
void render2(struct renderFlags *flags);
if (vpad_data.btn_hold & BUTTON_A) flags.text = keyboard();Hi guys, I'm trying to finish my keyboard project at the moment. The last feature to be implemented is the "library" for developers.
So I'm trying to make my keyboard a function which returns the entered text.
My solution looks like this:
Code:char* keyboard() { unsigned int coreinit_handle; OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle); unsigned int vpad_handle; OSDynLoad_Acquire("vpad.rpl", &vpad_handle); int(*VPADRead)(int controller, VPADData *buffer, unsigned int num, int *error); OSDynLoad_FindExport(vpad_handle, 0, "VPADRead", &VPADRead); static struct renderFlags flags; //[set all the flags to 0] VPADData vpad_data; __os_snprintf(flags.theme, 32, "Zelda "); __os_snprintf(flags.touching, 32, ""); flags.text[0] = ' '; int error, n; VPADRead(0, &vpad_data, 1, &error); while (1) { VPADRead(0, &vpad_data, 1, &error); if (vpad_data.tpdata.touched == 1) { flags.touch=1; __os_snprintf(flags.touching, 32, "%i, %i", vpad_data.tpdata.x, vpad_data.tpdata.y); //[check for all the keys etc.] } if ((vpad_data.btn_hold & BUTTON_X) || flags.xTouched) { for (n = 0; n < flags.textLength; ++n) flags.text[n] = ' '; flags.textLength = 1; } else if ((vpad_data.btn_hold & BUTTON_B) || flags.bTouched) flags.b=1; else if ((vpad_data.btn_hold & BUTTON_PLUS) || flags.plusTouched) flags.plus=1; else if((vpad_data.btn_hold & BUTTON_HOME) || flags.HomeTouched) break; render(&flags); } return flags.text; }
Code:void _entryPoint() { unsigned int coreinit_handle; OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle); unsigned int vpad_handle; OSDynLoad_Acquire("vpad.rpl", &vpad_handle); int(*VPADRead)(int controller, VPADData *buffer, unsigned int num, int *error); void(*_Exit)(); OSDynLoad_FindExport(vpad_handle, 0, "VPADRead", &VPADRead); OSDynLoad_FindExport(coreinit_handle, 0, "_Exit", &_Exit); struct renderFlags flags; flags.y=0; flags.x=0; flags.a=0; flags.b=0; __os_snprintf(flags.aPressed, 32, "A button pressed"); __os_snprintf(flags.bPressed, 32, "B button pressed"); __os_snprintf(flags.xPressed, 32, "X button pressed"); __os_snprintf(flags.yPressed, 32, "Y button pressed"); VPADData vpad_data; VPADRead(0, &vpad_data, 1, &error); while(1) { VPADRead(0, &vpad_data, 1, &error); if (vpad_data.btn_hold & BUTTON_A) flags.text = keyboard(); if (vpad_data.btn_hold & BUTTON_B) flags.b=1; if (vpad_data.btn_hold & BUTTON_X) flags.x=1; if (vpad_data.btn_hold & BUTTON_Y) flags.y=1; if (vpad_data.btn_hold & BUTTON_HOME) break; render2(&flags); } int ii = 0; for(ii; ii<2; ii++) { fillScreen(0, 0, 0, 0); flipBuffers(); } _Exit(); } void render2(struct renderFlags *flags) { int i = 0; for(i; i<2; i++) { fillScreen(0, 0, 0, 0); drawString(0, 0, "Press A to open the keyboard."); flipBuffers(); } flags->a = 0; flags->b = 0; flags->x = 0; flags->y = 0; }
Everything works fine (exiting too) but when I press A the application crashed and I have to reset my console. Please help me fix this to make it easier for others to use my keyboard in their projects!Code:#include "vpad.h" #include "types.h" #include "draw.h" struct renderFlags { int a; int b; int x; int y; char aPressed[32]; char bPressed[32]; char xPressed[32]; char yPressed[32]; char* text; }; void _entryPoint(); void render2(struct renderFlags *flags);
Yeah of course the problem lies somewhere there, that is when it tries to launch the keyboard and crashes.if (vpad_data.btn_hold & BUTTON_A) flags.text = keyboard();
?? I'm not sure if this is the problem but it looked different than everything else. In program.c