- Joined
- Feb 10, 2016
- Messages
- 52
- Trophies
- 0
- Age
- 32
- Location
- mast:3rw0rld
- Website
- oddity.comxa.com
- XP
- 101
- Country
Hi!
I have problems with drawstring(yes, again).
The problem is the same, so:
After running this code, Wii U freezes, the .mp4 loading icon freezes, and the GamePad freezes too.
I tried with my custom library, same problem:
Can somebody help?
Thanks,
hugo
Edit: SOLVED!!!
I have problems with drawstring(yes, again).
The problem is the same, so:
Code:
fillScreen(0,0,0,0);
drawString(1, 1, "Hello World! we haxd u");
flipBuffers();
I tried with my custom library, same problem:
Code:
//flipBuffers(int bufferNum)
//This is for "executing drawing to the screen"
//Think about it like a piece of paper
//The program writes it to the bottom of the paper, so you need to flip it to see it
//There are 2 pieces of paper: 1 for the GamePad, 1 for the TV.
//bufferNums:
//TV: 0
//GamePad: 1
void flipBuffers(unsigned int bufferNum){
//"Including" coreinit module
unsigned int coreinit_handle;
OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);
//Setting functions
void(*DCFlushRange)(void *buffer, uint32_t length);
unsigned int(*OSScreenFlipBuffersEx)(unsigned int bufferNum);
OSDynLoad_FindExport(coreinit_handle, 0, "DCFlushRange", &DCFlushRange);
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenFlipBuffersEx", &OSScreenFlipBuffersEx);
unsigned int(*OSScreenGetBufferSizeEx)(unsigned int bufferNum);
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenGetBufferSizeEx", &OSScreenGetBufferSizeEx);
//Grabbing the buffer size for the screen in bufferNum
int buf_size = OSScreenGetBufferSizeEx(bufferNum);
//Flushing cache
DCFlushRange((void *)0xF4000000, buf_size);
//Flipping the buffer
OSScreenFlipBuffersEx(bufferNum);
}
//drawstring(unsigned int bufferNum, int x, int line, char * string)
//Drawing a string
//bufferNum = buffer number of display
//x = position on x axis
//line = line on y axis
//string = text to print
void drawString(unsigned int bufferNum, int x, int line, char * string)
{
//"Including" coreinit module
unsigned int coreinit_handle;
OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);
//Setting functions
unsigned int(*OSScreenPutFontEx)(unsigned int bufferNum, unsigned int posX, unsigned int line, void * buffer);
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenPutFontEx", &OSScreenPutFontEx);
//Drawing the string
OSScreenPutFontEx(bufferNum, x, line, string);
}
//fillScreen(unsigned int bufferNum, char r,char g,char b,char a)
//Filling screen
//bufferNum = buffer number of display
//r = amount of red
//g = amount of green
//b = amount of blue
//a = ???(maybe darkness)
void fillScreen(unsigned int bufferNum, char r,char g,char b,char a)
{
//"Including" coreinit module
unsigned int coreinit_handle;
OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);
//Setting functions
unsigned int(*OSScreenClearBufferEx)(unsigned int bufferNum, unsigned int temp);
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenClearBufferEx", &OSScreenClearBufferEx);
//Crafting a number from r, g, b and a
uint32_t num = (r << 24) | (g << 16) | (b << 8) | a;
//Filling screen (clearing buffer "with" a custom color)
OSScreenClearBufferEx(bufferNum, num);
}
Thanks,
hugo
Edit: SOLVED!!!
Last edited by hugofestA,