#include "loader.h"
// loader.c
// 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(int min, int max)
{
unsigned int randgen_handle;
unsigned int (*NSSGetRandom)(int min, int max);
OSDynLoad_Acquire("randgen.rpl", &randgen_handle);
OSDynLoad_FindExport(randgen_handle, 0, "NSSGetRandom", &NSSGetRandom);
return NSSGetRandom(min, max);
}
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(0, 99), 4 + rand(0, 4),
Month[rand(0, 11)],
2015 + rand(0, 9)
);
// Draw to the TV
drawString(0, 0, buffer);
// Draw to the GamePad
drawString(1, 0, buffer);
}