#include "loader.h"
// Save this file as $(libwiiu_root)/examples/helloworld/src/loader.c
const char* Month[] = {
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
};
unsigned int rand()
{
unsigned int coreinit_handle;
unsigned int (*OSScreenGetBufferSizeEx)(int bufferNum);
OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenGetBufferSizeEx", &OSScreenGetBufferSizeEx);
return 0;//(unsigned int)( ( (coreinit_handle / &OSScreenGetBufferSizeEx * 2) - 0xC2588633) );
}
void _start()
{
unsigned int coreinit_handle;
unsigned int snprintf_handle;
char buffer[200];
int (*snprintf)(char* buf, int n, char* format, ... );
OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);
OSDynLoad_FindExport(snprintf_handle, 0, "__os_snprintf", &snprintf);
snprintf(
buffer,
sizeof(buffer),
"I can already tell you of a %u%% possibility of a 5.%u.0 release before %s of %u. Maybe even earlier.\n",
rand() % 100, 4 + rand() % 5,
Month[rand() % 12],
2015 + rand() % 10
);
// Draw to the TV
drawString(0, 0, buffer);
// Draw to the GamePad
drawString(1, 0, buffer);
}