1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - MB - demos - multiboot
3   File:     dispfunc.h
4 
5   Copyright 2006-2008 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law. They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2008-09-18#$
14   $Rev: 8573 $
15   $Author: okubata_ryoma $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef _DISPFUNC_H_
19 #define _DISPFUNC_H_
20 
21 #include <nitro.h>
22 
23 /* Palette color for text */
24 enum
25 {
26     WHITE,
27     RED,
28     GREEN,
29     BLUE,
30     YELLOW,
31     CYAN,
32     PURPLE,
33     LIGHT_GREEN,
34     HI_YELLOW,
35     HI_CYAN,
36     HI_WHITE,
37     HI_BLUE,
38     HI_PURPLE,
39     HI_LIGHT_GREEN,
40     BROWN,
41     HI_BROWN,
42     COLOR_NUM
43 };
44 
45 /* Constant array for each type of rendering */
46 extern const u32 sampleCharData[8 * 0xe0];
47 extern const u16 samplePlttData[16][16];
48 
49 /*
50 	=================================================================================
51 
52 	OBJ character drawing
53 
54 	=================================================================================
55 */
56 
57 // --- global value
58 extern GXOamAttr oamBak[128];
59 
60 //      Set OBJ
61 void    ObjSet(int objNo, int x, int y, int charNo, int paletteNo);
62 
63 //      Set OBJ character string
64 void    ObjSetString(int startobjNo, int x, int y, char *string, int paletteNo);
65 
66 //      Clears OBJ
67 void    ObjClear(int objNo);
68 
69 //      Clears OBJ (specified range)
70 void    ObjClearRange(int start, int end);
71 
72 //      Set message
73 void    ObjSetMessage(int objNo, char *message);
74 
75 /*
76 	=================================================================================
77 
78 	BG character drawing (BG0 fixed)
79 
80 	=================================================================================
81 */
82 
83 // --- Definition
84 
85 // --- Initialize
86 void    BgInitForPrintStr(void);
87 
88 // --- For main LCD
89 void    BgPrintf(s16 x, s16 y, u8 palette, char *text, ...);
90 void    BgPutString(s16 x, s16 y, u8 palette, char *text);
91 void    BgPutStringN(s16 x, s16 y, u8 palette, char *text, u32 num);
92 void    BgPutChar(s16 x, s16 y, u8 palette, char c);
93 void    BgClear(void);
94 
95 // --- For sub LCD
96 void    BgPrintfSub(s16 x, s16 y, u8 palette, char *text, ...);
97 void    BgPutStringSub(s16 x, s16 y, u8 palette, char *text);
98 void    BgPutStringNSub(s16 x, s16 y, u8 palette, char *text, u32 num);
99 void    BgPutCharSub(s16 x, s16 y, u8 palette, char c);
100 void    BgClearSub(void);
101 
102 // --- V-blank process
103 void    BgScrSetVblank(void);
104 
105 // --- Message print
106 void    BgSetMessage(u8 palette, char *message, ...);
107 void    BgSetMessageSub(u8 palette, char *message, ...);
108 void    BgSetMessageLogSub(u8 palette, char *text);
109 
110 // --- Get screen buffer
111 u16    *BgGetScreenBuf(void);
112 u16    *BgGetScreenBufSub(void);
113 
114 #endif /*       _DISPFUNC_H_    */
115