diff --git a/gfx/banner.png b/gfx/banner.png new file mode 100755 index 0000000..68878b1 Binary files /dev/null and b/gfx/banner.png differ diff --git a/include/gfx.h b/include/gfx.h new file mode 100755 index 0000000..58b1e0a --- /dev/null +++ b/include/gfx.h @@ -0,0 +1,3 @@ +#pragma once + +void gfxDrawSprite(gfxScreen_t screen, gfx3dSide_t side, u8* spriteData, u16 width, u16 height, s16 x, s16 y); \ No newline at end of file diff --git a/source/console.c b/source/console.c index bd7c461..86c1ae3 100644 --- a/source/console.c +++ b/source/console.c @@ -6,6 +6,7 @@ #include <3ds.h> #endif #include "debug.h" +#include "gfx.h" #ifdef _3DS #include "sans_8_kerning_bin.h" @@ -667,34 +668,6 @@ draw_text(gfxScreen_t screen, } } -/* Function to draw sprite, from smea/3ds_hb_menu */ -void gfxDrawSprite(gfxScreen_t screen, gfx3dSide_t side, u8* spriteData, u16 width, u16 height, s16 x, s16 y) -{ - if(!spriteData)return; - - u16 fbWidth, fbHeight; - u8* fbAdr=gfxGetFramebuffer(screen, side, &fbWidth, &fbHeight); - - if(x+width<0 || x>=fbWidth)return; - if(y+height<0 || y>=fbHeight)return; - - u16 xOffset=0, yOffset=0; - u16 widthDrawn=width, heightDrawn=height; - - if(x<0)xOffset=-x; - if(y<0)yOffset=-y; - if(x+width>=fbWidth)widthDrawn=fbWidth-x; - if(y+height>=fbHeight)heightDrawn=fbHeight-y; - widthDrawn-=xOffset; - heightDrawn-=yOffset; - - int j; - for(j=yOffset; j +#endif + +/* Function to draw sprite, from smea/3ds_hb_menu */ +void gfxDrawSprite(gfxScreen_t screen, gfx3dSide_t side, u8* spriteData, u16 width, u16 height, s16 x, s16 y) +{ + if(!spriteData)return; + + u16 fbWidth, fbHeight; + u8* fbAdr=gfxGetFramebuffer(screen, side, &fbWidth, &fbHeight); + + if(x+width<0 || x>=fbWidth)return; + if(y+height<0 || y>=fbHeight)return; + + u16 xOffset=0, yOffset=0; + u16 widthDrawn=width, heightDrawn=height; + + if(x<0)xOffset=-x; + if(y<0)yOffset=-y; + if(x+width>=fbWidth)widthDrawn=fbWidth-x; + if(y+height>=fbHeight)heightDrawn=fbHeight-y; + widthDrawn-=xOffset; + heightDrawn-=yOffset; + + int j; + for(j=yOffset; j