1 | /** |
---|
2 | * @file conio.h |
---|
3 | * |
---|
4 | * This file contains the GBA conio I/O package. |
---|
5 | */ |
---|
6 | /* |
---|
7 | * RTEMS GBA BSP |
---|
8 | * |
---|
9 | * Copyright (c) 2004 Markku Puro <markku.puro@kopteri.net> |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.com/license/LICENSE. |
---|
14 | * |
---|
15 | * $Id$ |
---|
16 | */ |
---|
17 | |
---|
18 | #ifndef _CONIO_H |
---|
19 | #define _CONIO_H |
---|
20 | |
---|
21 | #ifdef __cplusplus |
---|
22 | extern "C" { |
---|
23 | #endif |
---|
24 | |
---|
25 | /*---------------------------------------------------------------------------* |
---|
26 | * Includes * |
---|
27 | *---------------------------------------------------------------------------*/ |
---|
28 | #include <gba.h> |
---|
29 | |
---|
30 | /*---------------------------------------------------------------------------* |
---|
31 | * Defines * |
---|
32 | *---------------------------------------------------------------------------*/ |
---|
33 | #define ASCII_BEL 0x07 /**< bell */ |
---|
34 | #define ASCII_BS 0x08 /**< backspace */ |
---|
35 | #define ASCII_TAB 0x09 /**< horizontal tab */ |
---|
36 | #define ASCII_LF 0x0A /**< line feed */ |
---|
37 | #define ASCII_CR 0x0D /**< carriage return */ |
---|
38 | #define ASCII_XON 0x11 /**< control-Q */ |
---|
39 | #define ASCII_XOFF 0x13 /**< control-S */ |
---|
40 | #define ASCII_ESC 0x1B /**< escape */ |
---|
41 | |
---|
42 | |
---|
43 | enum TEXT_MODES |
---|
44 | { |
---|
45 | CO60 = 0, /**< 60x26 (3x5 font) */ |
---|
46 | MAXMODES |
---|
47 | }; |
---|
48 | |
---|
49 | enum COLORS |
---|
50 | { |
---|
51 | BLACK, |
---|
52 | BLUE, |
---|
53 | GREEN, |
---|
54 | CYAN, |
---|
55 | RED, |
---|
56 | MAGENTA, |
---|
57 | BROWN, |
---|
58 | LIGHTGRAY, |
---|
59 | DARKGRAY, |
---|
60 | LIGHTBLUE, |
---|
61 | LIGHTGREEN, |
---|
62 | LIGHTCYAN, |
---|
63 | LIGHTRED, |
---|
64 | LIGHTMAGENTA, |
---|
65 | YELLOW, |
---|
66 | WHITE, |
---|
67 | MAXCOLORS |
---|
68 | }; |
---|
69 | |
---|
70 | #define DEF_TEXTCOLOR BLACK |
---|
71 | #define DEF_TEXTBACKGROUND WHITE |
---|
72 | |
---|
73 | /*---------------------------------------------------------------------------* |
---|
74 | * Prototypes * |
---|
75 | *---------------------------------------------------------------------------*/ |
---|
76 | void gba_textmode(int _mode); |
---|
77 | void gba_clrscr(void); |
---|
78 | void gba_textattr(int _attr); |
---|
79 | void gba_textbackground(int _color); |
---|
80 | void gba_textcolor(int _color); |
---|
81 | void gba_putch(char _c); |
---|
82 | void gba_puts(const char *_str); |
---|
83 | int gba_printf(const char *_format, ...); |
---|
84 | void gba_gotoxy(int _x, int _y); |
---|
85 | int gba_getch(void); |
---|
86 | |
---|
87 | |
---|
88 | #ifdef __cplusplus |
---|
89 | } |
---|
90 | #endif |
---|
91 | |
---|
92 | #endif /* _CONIO_H */ |
---|