From f3e040230772f978540a71aea43dfde200992922 Mon Sep 17 00:00:00 2001 From: "John Wilbert M. Villamor" Date: Sat, 6 Apr 2019 10:11:07 +0800 Subject: First commit --- libpsn00b/psxetc/font.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 libpsn00b/psxetc/font.c (limited to 'libpsn00b/psxetc/font.c') diff --git a/libpsn00b/psxetc/font.c b/libpsn00b/psxetc/font.c new file mode 100644 index 0000000..3b0370b --- /dev/null +++ b/libpsn00b/psxetc/font.c @@ -0,0 +1,37 @@ +#include +#include +#include + +extern unsigned char dbugfont[]; + +unsigned short _font_tpage; +unsigned short _font_clut; + +void FntLoad(int x, int y) { + + RECT pos; + TIM_IMAGE tim; + + GetTimInfo( (unsigned int*)dbugfont, &tim ); + + // Load font image + pos = *tim.prect; + pos.x = x; + pos.y = y; + + _font_tpage = getTPage( 0, 0, pos.x, 0 ) | 0x200; + + LoadImage( &pos, tim.paddr ); + DrawSync(); + + // Load font clut + pos = *tim.crect; + pos.x = x; + pos.y = y+tim.prect->h; + + _font_clut = getClut( pos.x, pos.y ); + + LoadImage( &pos, tim.caddr ); + DrawSync(); + +} \ No newline at end of file -- cgit v1.2.3