Hacking Wii U Hacking & Homebrew Discussion

cmdj13

Well-Known Member
Member
Joined
Aug 28, 2015
Messages
139
Trophies
0
Location
In front of my computer
XP
219
Country
Gambia, The
OSScreenPutFontEx()
I can't get that to work. My code looks like this (I got some parts from the osscreenexample template, but the whole thing didn't work for some friends, so I wnated to do it myself and see whether that works):

loader.c
Code:
#include "loader.h"

void _start()
{
    unsigned int coreinit_handle;
    OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);

    /****************************>       External Prototypes       <****************************/
    void(*_Exit)();
    //OSScreen functions
    void(*OSScreenInit)();
    void(*OSScreenPutFontEx)(int bufferNum, uint32_t posX, uint32_t posY, const char *str);

    /****************************>             Exports             <****************************/
    OSDynLoad_FindExport(coreinit_handle, 0, "_Exit", &_Exit);
    //OSScreen functions
    OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenInit", &OSScreenInit);
    OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenPutFontEx", &OSScreenPutFontEx);

    OSScreenInit();
    OSScreenPutFontEx(1, 0, 0, "Hello World!");

    int wait = 0x1FFFFF;
    while (wait)
        --wait;

    _Exit;
}

loader.h
Code:
#ifndef LOADER_H
#define LOADER_H

#include "../../../libwiiu/src/coreinit.h"
#include "../../../libwiiu/src/vpad.h"
#include "../../../libwiiu/src/types.h"
#include "../../../libwiiu/src/draw.h"

void _start();

#endif /* LOADER_H */

But when I run it on my WiiU, I just get a messed up screen :(
 

Kakkoii

Old fart
Member
Joined
Sep 14, 2007
Messages
631
Trophies
0
XP
586
Country
Canada
I can't get that to work. My code looks like this (I got some parts from the osscreenexample template, but the whole thing didn't work for some friends, so I wnated to do it myself and see whether that works):
Try this instead:
Code:
unsigned int(*OSScreenPutFontEx)(unsigned int bufferNum, unsigned int posX, unsigned int line, void * buffer);
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenPutFontEx", &OSScreenPutFontEx);
OSScreenPutFontEx(0, x, line, string);
OSScreenPutFontEx(1, x, line, string);

We really need some guides how to actually use the kernel exploit to code shit. It's kinda hard now if you're not an asm ninja with just a pong example...
You don't need to know ASM to do this.. Just look up what the functions do, implement them and then utilize them in your code just like you would in any other coding project.
 
Last edited by Kakkoii,
  • Like
Reactions: AboodXD and cmdj13

JaceCearK1

Well-Known Member
Member
Joined
May 18, 2015
Messages
540
Trophies
0
Age
27
XP
415
Country
Gambia, The
We really need some guides how to actually use the kernel exploit to code shit. It's kinda hard now if you're not an asm ninja with just a pong example...
You don't need to know ASM to write good C code yourself! ;) (wouldn't hurt though! ^^)
What program exactly do you expect? :P
 
Last edited by JaceCearK1,

Kakkoii

Old fart
Member
Joined
Sep 14, 2007
Messages
631
Trophies
0
XP
586
Country
Canada
Is there a function to make the WiiU wait for some time? I hate the solution with
Code:
int wait;
while (wait)
    --wait;
Programming 101: If you're going to be doing the same thing over and over again, make it a method/function and/or loop.

Code:
void wait(int wait)
{
    while(wait--) ; //Continue to operate while 'wait' isn't 0. Decrement by 1 each time it checks.
}

Then whenever you want to wait, you simple do something like this: wait(124);

Make sure to place the method outside of start() or any other methods. Preferably at the bottom of your code, out of the way.
 
Last edited by Kakkoii,

Marionumber1

Well-Known Member
Member
Joined
Nov 7, 2010
Messages
1,234
Trophies
3
XP
4,045
Country
United States
We really need some guides how to actually use the kernel exploit to code shit. It's kinda hard now if you're not an asm ninja with just a pong example...

The central idea behind the kernel exploit is that you can map any non-IOSU physical address as read-write, and do whatever you want to it. This includes the loader, system libraries, the kernel, and game code, but you need to know what you're doing with that memory. A guide for all of that would be too broad, in my opinion.
 

ploggy

WAKA! WAKA!
Member
Joined
Aug 29, 2007
Messages
4,834
Trophies
2
XP
7,911
Country
United Kingdom
Has anyone tried to see if it's possible to enable the WiiU tablet Controls while in vWii mode?
I remember there was talk about it early on but nothing has been said about it for a while.
 

cmdj13

Well-Known Member
Member
Joined
Aug 28, 2015
Messages
139
Trophies
0
Location
In front of my computer
XP
219
Country
Gambia, The
Programming 101: If you're going to be doing the same thing over and over again, make it a method/function and/or loop.

Code:
void wait(int wait)
{
    while(wait--) ; //Continue to operate while 'wait' isn't 0. Decrement by 1 each time it checks.
}

Then whenever you want to wait, you simple do something like this: wait(124);

Make sure to place the method outside of start() or any other methods. Preferably at the bottom of your code, out of the way.

I know, my problem with it is that I'd find a function that I can give a certain time to wait much better. I just can't estimate how long wait() will wait for a certain number, but when I call a function sleep(500) which sleeps for 0,5 seconds I know that it will wait exactly 0,5 seconds.
 
Last edited by cmdj13,

Marionumber1

Well-Known Member
Member
Joined
Nov 7, 2010
Messages
1,234
Trophies
3
XP
4,045
Country
United States
I know, my problem with it is that I'd find a function that I can give a certain time to wait much better. I just can't estimate how long wait() will wait for a certain number, but when I call a function sleep(500) which sleeps for 0,5 seconds I know that it will wait exactly 0,5 secands.

OSSleepTicks() exists; it waits for a certain number of ticks of the internal PPC timer. You can experiment/do math to figure out what that is in seconds.
 

cmdj13

Well-Known Member
Member
Joined
Aug 28, 2015
Messages
139
Trophies
0
Location
In front of my computer
XP
219
Country
Gambia, The
I tried to use OSSleepTicks() after loading it like this:
Code:
    void(*OSSleepTicks)(unsigned int ticks);
    OSDynLoad_FindExport(coreinit_handle, 0, "OSSleepTicks", &OSSleepTicks);
but my WiiU doesn't like it that way and crashes :( I also couldn't find OSSleepTicks() on WiiuBrew, so I have no idea how to load it the right way.
 

Marionumber1

Well-Known Member
Member
Joined
Nov 7, 2010
Messages
1,234
Trophies
3
XP
4,045
Country
United States
I tried to use OSSleepTicks() after loading it like this:
Code:
    void(*OSSleepTicks)(unsigned int ticks);
    OSDynLoad_FindExport(coreinit_handle, 0, "OSSleepTicks", &OSSleepTicks);
but my WiiU doesn't like it that way and crashes :( I also couldn't find OSSleepTicks() on WiiuBrew, so I have no idea how to load it the right way.

You can also try the worse method of polling OSGetTick(), which gives you the current PPC tick count. Store the initial value, and keep calling it until a certain number of ticks has elapsed.
 
  • Like
Reactions: cmdj13

cmdj13

Well-Known Member
Member
Joined
Aug 28, 2015
Messages
139
Trophies
0
Location
In front of my computer
XP
219
Country
Gambia, The
You can also try the worse method of polling OSGetTick(), which gives you the current PPC tick count. Store the initial value, and keep calling it until a certain number of ticks has elapsed.
Like this?
Code:
void wait(unsigned int ticks)
{
    unsigned int coreinit_handle;
    OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);

    unsigned int(*OSGetTick)();
    OSDynLoad_FindExport(coreinit_handle, 0, "OSGetTick", &OSGetTick);

    unsigned int start_ticks = OSGetTick();
    unsigned int current_ticks = OSGetTick();

    while (current_ticks != start_ticks + ticks)
        current_ticks = OSGetTick();
}
edit: Hm, seems to do nothing...
btw it seems to just crash on a random base, it mostly works, but sometimes crashes...
 
Last edited by cmdj13,

afra

Well-Known Member
Newcomer
Joined
Jul 13, 2015
Messages
59
Trophies
0
Age
38
XP
208
Country
Iran
Hi and thank u for reading this . my friend's Wii u is on 5.4'( Mario maker bundle) and we have some questions : to aks
1 he has Mario maker physical copy but didn't put it in console . can he play Mario maker offline from disk without any update ? How about online course play ?

2 - For 5.4 F.M is there any iso loader ? Or it's only for 5.3.2 ?

Thank u so much for your time and wait for answer
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BigOnYa @ BigOnYa:
    Not even once, but 100's of times
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    My girlfriend at the time, she had me stay up with her all night because some how the crazy bitch had spent like 12 hours snorting 2 8 balls, didn't use any water (gotta clean your nose) so she had so much crusted in her nose I was sure she was gonna blow up her heart. I mean this was the stuff right off the boat so absolutely pure. ugghh so annoying
  • Psionic Roshambo @ Psionic Roshambo:
    Also doing like 320 dollars worth of coke in half a day lol damn it
  • Psionic Roshambo @ Psionic Roshambo:
    hmmm 360 even lol
  • Psionic Roshambo @ Psionic Roshambo:
    Well I was getting a discount so 320 is probably right
  • BigOnYa @ BigOnYa:
    That is cheap, I used to pay $100 for a tine.
  • Psionic Roshambo @ Psionic Roshambo:
    Tine? One gram?
  • BigOnYa @ BigOnYa:
    Sixteenth
  • Psionic Roshambo @ Psionic Roshambo:
    Also it was literally out of a kilo when I got it off the boat so absolutely pure
  • Psionic Roshambo @ Psionic Roshambo:
    Holy shiz that's a lot
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I was getting 3.5 Grams for 320 could have stepped on it and doubled my money easy lol
    +1
  • BigOnYa @ BigOnYa:
    I'd be afraid to it nowdays, my heart would explode prob. I just stick beers n buds nowdays.
  • Psionic Roshambo @ Psionic Roshambo:
    I would get to drive from tarpon springs to like Miami a thousand bucks lol do that twice a week and back in 92 that was good money
  • Xdqwerty @ Xdqwerty:
    @BigOnYa,
    @Psionic Roshambo what are you guys talking about?
  • Psionic Roshambo @ Psionic Roshambo:
    Blew it on women and muscle cars lol
    +1
  • BigOnYa @ BigOnYa:
    @Xdqwerty Hamster food, its pricey nowadays to keep PCs running.
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    I don't do anything except cigarettes and gotta stop eventually lol
    +1
  • BigOnYa @ BigOnYa:
    I'd do shrooms again if could find, and I was outside camping/fishing, and had a cooler full of beer.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I wouldn't mind some LSD, laughing until my face hurt sounds fun lol
    +1
  • BigOnYa @ BigOnYa:
    You ever try soaper powder/qauludes? I did once and like a dumbass drank beer on top of taking, I woke up laying in my backyard in the pouring rain, it knocked me out. I have not seen it around in many many years.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    No never tried a lot of things but never that lol
  • Psionic Roshambo @ Psionic Roshambo:
    I did pass out one time on a floor after taking a bunch of Ambien lol thought it would help me sleep and did it lol
  • Psionic Roshambo @ Psionic Roshambo:
    Girlfriend was working at a pharmacy and stole like 500 of them, was and still is the biggest pill bottle I have ever seen lol
    Psionic Roshambo @ Psionic Roshambo: Girlfriend was working at a pharmacy and stole like 500 of them, was and still is the biggest...