libfb.h
1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*====================================================================
based on:
File : graph.h
Created by Koji Mitsunari. Mar,14 1996.
Copyright by Nintendo, Co., Ltd. 1996.
=====================================================================*/
#ifndef __libfb_h__
#define __libfb_h__
#include <ultra64.h>
#define FB_LOW_RES 0
#define FB_HIGH_RES 1
extern int FB_SCREEN_WD;
extern int FB_SCREEN_HT;
extern u16 FB_BGCOLOR;
#define fbWhite 0xffff
#define FB_WHITE 0xffff
#define fbBlack 0x0000
#define FB_BLACK 0x0000
#define fbGray GPACK_RGBA5551(127,127,127,1)
#define fbBlue GPACK_RGBA5551(0,0,255,1)
#define fbGreen GPACK_RGBA5551(0,255,0,1)
#define fbRed GPACK_RGBA5551(255,0,0,1)
#define fbYellow GPACK_RGBA5551(255,255,0,1)
#define fbMagenta GPACK_RGBA5551(255,0,255,1)
#define fbCyan GPACK_RGBA5551(0,255,255,1)
#define fbDark GPACK_RGBA5551(50,50,128,1)
#define fbMarkColor GPACK_RGBA5551(50,250,50,1)
#define FB_CHAR_WD 8
#define FB_CHAR_HT 16
#define FB_TEXT_WD (FB_SCREEN_WD/FB_CHAR_WD)
#define FB_TEXT_HT (FB_SCREEN_HT/FB_CHAR_HT)
extern void fbInit(int res);
extern void fbPutChar(u16 color, int x, int y, char c);
extern void fbRevChar(u16 color, int x, int y, char c);
extern void fbPutHex(u16 color, int x, int y, int v, char width);
extern void fbPutDec(u16 color, int x, int y, int v);
extern void fbPrintStr(u16 color, int x, int y, const char* str);
extern void fbCircle(int x, int y, int r, u16 color);
extern void fbPixel(int x, int y, u16 color);
extern void fbLine(int x0, int y0, int x1, int y1, u16 color);
extern void fbBox(int x0, int y0, int x1, int y1, u16 color);
extern void fbRect(int x0, int y0, int x1, int y1, u16 color);
extern void fbClear(void);
extern void fbBigPutc(u16 color, int x, int y, char c, int xsize, int ysize);
extern void fbBigPrintStr(u16 color, int x, int y, const char*, int xsize, int ysize);
extern void fbSetBg(u16 bg);
extern int fbPrintf(u16 color, int curs_x, int curs_y, const char *fmt, ...);
extern u8 fb_font[][FB_CHAR_HT];
#endif