00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00065 #ifndef CONSOLE_H
00066 #define CONSOLE_H
00067
00068
00069
00070
00071 #include <nds/ndstypes.h>
00072 #include <nds/arm9/background.h>
00073
00074 #ifdef __cplusplus
00075 extern "C" {
00076 #endif
00077
00078 typedef bool(* ConsolePrint)(void* con, char c);
00079
00080
00081 typedef struct ConsoleFont
00082 {
00083 u16* gfx;
00084 u16* pal;
00085 u16 numColors;
00087 u8 bpp;
00089 u16 asciiOffset;
00090 u16 numChars;
00091 bool convertSingleColor;
00092 }ConsoleFont;
00093
00136 typedef struct PrintConsole
00137 {
00138 ConsoleFont font;
00139
00140 u16* fontBgMap;
00141 u16* fontBgGfx;
00143 u8 mapBase;
00144 u8 gfxBase;
00146 u8 bgLayer;
00147 int bgId;
00149 int cursorX;
00150 int cursorY;
00152 int prevCursorX;
00153 int prevCursorY;
00155 int consoleWidth;
00156 int consoleHeight;
00158 int windowX;
00159 int windowY;
00160 int windowWidth;
00161 int windowHeight;
00163 int tabSize;
00165 u16 fontCharOffset;
00168 u16 fontCurPal;
00170 ConsolePrint PrintChar;
00172 bool consoleInitialised;
00173 bool loadGraphics;
00176 }PrintConsole;
00177
00182 typedef enum
00183 {
00184 DebugDevice_NULL = 0x0,
00185 DebugDevice_NOCASH = 0x1,
00186 DebugDevice_CONSOLE = 0x02
00187 }DebugDevice;
00188
00195 void consoleSetFont(PrintConsole* console, ConsoleFont* font);
00196
00207 void consoleSetWindow(PrintConsole* console, int x, int y, int width, int height);
00208
00213 PrintConsole* consoleGetDefault(void);
00214
00219 void consoleSelect(PrintConsole* console);
00220
00233 PrintConsole* consoleInit(PrintConsole* console, int layer, BgType type, BgSize size, int mapBase, int tileBase, bool mainDisplay, bool loadGraphics);
00234
00241 PrintConsole* consoleDemoInit(void);
00242
00246 void consoleClear(void);
00247
00252 void consoleDebugInit(DebugDevice device);
00253
00254 #ifdef __cplusplus
00255 }
00256 #endif
00257
00258 #endif