aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/psxetc/font.c
diff options
context:
space:
mode:
authorJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-04-06 10:11:07 +0800
committerJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-04-06 10:11:07 +0800
commitf3e040230772f978540a71aea43dfde200992922 (patch)
treebd8ca31b72dd01e24980b073854e263589530f56 /libpsn00b/psxetc/font.c
downloadpsn00bsdk-f3e040230772f978540a71aea43dfde200992922.tar.gz
First commit
Diffstat (limited to 'libpsn00b/psxetc/font.c')
-rw-r--r--libpsn00b/psxetc/font.c37
1 files changed, 37 insertions, 0 deletions
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 <stdio.h>
+#include <ctype.h>
+#include <psxgpu.h>
+
+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