-
Notifications
You must be signed in to change notification settings - Fork 0
/
text.i
114 lines (76 loc) · 2.63 KB
/
text.i
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# 1 "text.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "text.c"
# 1 "myLib.h" 1
typedef unsigned short u16;
# 27 "myLib.h"
extern unsigned short *videoBuffer;
# 47 "myLib.h"
void setPixel3(int col, int row, unsigned short color);
void drawRect3(int col, int row, int width, int height, volatile unsigned short color);
void fillScreen3(volatile unsigned short color);
void drawImage3(int col, int row, int width, int height, const unsigned short *image);
void drawFullscreenImage3(const unsigned short *image);
void setPixel4(int col, int row, unsigned char colorIndex);
void drawRect4(int col, int row, int width, int height, volatile unsigned char colorIndex);
void fillScreen4(volatile unsigned char colorIndex);
void drawImage4(int col, int row, int width, int height, const unsigned short *image);
void drawFullscreenImage4(const unsigned short *image);
void waitForVBlank();
void flipPage();
# 83 "myLib.h"
extern unsigned short oldButtons;
extern unsigned short buttons;
# 94 "myLib.h"
typedef volatile struct {
volatile const void *src;
volatile void *dst;
unsigned int cnt;
} DMA;
extern DMA *dma;
# 134 "myLib.h"
void DMANow(int channel, volatile const void *src, volatile void *dst, unsigned int cnt);
int collision(int colA, int rowA, int widthA, int heightA, int colB, int rowB, int widthB, int heightB);
# 2 "text.c" 2
# 1 "text.h" 1
void drawChar3(int col, int row, char ch, unsigned short color);
void drawString3(int col, int row, char *str, unsigned short color);
void drawChar4(int col, int row, char ch, unsigned char colorIndex);
void drawString4(int col, int row, char *str, unsigned char colorIndex);
# 3 "text.c" 2
# 1 "font.h" 1
extern const unsigned char fontdata_6x8[12288];
# 4 "text.c" 2
void drawChar3(int col, int row, char ch, unsigned short color) {
for (int r = 0; r < 8; r++) {
for (int c = 0; c < 6; c++) {
if (fontdata_6x8[48*ch + ((r)*(6)+(c))]) {
setPixel3(col+c, row+r, color);
}
}
}
}
void drawChar4(int col, int row, char ch, unsigned char colorIndex) {
for (int r = 0; r < 8; r++) {
for (int c = 0; c < 6; c++) {
if (fontdata_6x8[48*ch + ((r)*(6)+(c))]) {
setPixel4(col+c, row+r, colorIndex);
}
}
}
}
void drawString3(int col, int row, char *str, unsigned short color) {
while(*str != '\0') {
drawChar3(col, row, *str, color);
col += 6;
str++;
}
}
void drawString4(int col, int row, char *str, unsigned char colorIndex) {
while(*str != '\0') {
drawChar4(col, row, *str, colorIndex);
col += 6;
str++;
}
}