mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-11-22 15:02:20 +00:00
[ADD] USB_Gecko ouput facilities.
This commit is contained in:
parent
9a4bdc04ae
commit
8ede687af8
2 changed files with 38 additions and 1 deletions
32
GRRLIB/GRRLIB/GRRLIB_gecko.c
Normal file
32
GRRLIB/GRRLIB/GRRLIB_gecko.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include <gccore.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
bool geckoinit = false;
|
||||
|
||||
bool GRRLIB_GeckoInit()
|
||||
{
|
||||
u32 geckoattached = usb_isgeckoalive(EXI_CHANNEL_1);
|
||||
if (geckoattached)
|
||||
{
|
||||
usb_flush(EXI_CHANNEL_1);
|
||||
geckoinit = true;
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
void GRRLIB_GeckoPrintf (const char *text, ...) {
|
||||
int size;
|
||||
char tmp[1024];
|
||||
|
||||
if (!(geckoinit))return;
|
||||
|
||||
va_list argp;
|
||||
va_start(argp, text);
|
||||
size = vsprintf(tmp, text, argp);
|
||||
va_end(argp);
|
||||
|
||||
usb_sendbuffer_safe(1,tmp,size);
|
||||
}
|
||||
|
|
@ -124,12 +124,17 @@ void GRRLIB_Render (void) ;
|
|||
void GRRLIB_Screen2Texture (int posx, int posy, GRRLIB_texImg *tex, bool clear) ;
|
||||
void GRRLIB_CompoStart (void);
|
||||
void GRRLIB_CompoEnd(int posx, int posy, GRRLIB_texImg *tex);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// GRRLIB_texEdit.c - Modifying the content of a texture
|
||||
|
||||
GRRLIB_texImg* GRRLIB_LoadTexture (const u8 *my_img) ;
|
||||
GRRLIB_texImg* GRRLIB_LoadTexturePNG (const u8 *my_png) ;
|
||||
GRRLIB_texImg* GRRLIB_LoadTextureJPG (const u8 *my_jpg) ;
|
||||
GRRLIB_texImg* GRRLIB_LoadTextureBMP (const u8 *my_bmp) ;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// GRRLIB_gecko.c - USB_Gecko output facilities
|
||||
bool GRRLIB_GeckoInit();
|
||||
void GRRLIB_GeckoPrintf (const char *text, ...);
|
||||
|
||||
#endif // __GRRLIB_FNLIB_H__
|
||||
|
|
Loading…
Reference in a new issue