diff options
Diffstat (limited to 'apps/plugins/test_gfx.c')
-rw-r--r-- | apps/plugins/test_gfx.c | 116 |
1 files changed, 57 insertions, 59 deletions
diff --git a/apps/plugins/test_gfx.c b/apps/plugins/test_gfx.c index 0a2e02e43f..3ba8956109 100644 --- a/apps/plugins/test_gfx.c +++ b/apps/plugins/test_gfx.c | |||
@@ -19,16 +19,14 @@ | |||
19 | #include "plugin.h" | 19 | #include "plugin.h" |
20 | #include "lib/grey.h" | 20 | #include "lib/grey.h" |
21 | #include "lib/helper.h" | 21 | #include "lib/helper.h" |
22 | #include "lib/mylcd.h" | ||
22 | 23 | ||
23 | //#define TEST_GREYLIB /* Uncomment for testing greylib instead of core gfx */ | 24 | //#define TEST_GREYLIB /* Uncomment for testing greylib instead of core gfx */ |
24 | 25 | ||
25 | #ifdef TEST_GREYLIB | 26 | #ifdef TEST_GREYLIB |
26 | #define MYLCD(fn) grey_ ## fn | ||
27 | GREY_INFO_STRUCT | 27 | GREY_INFO_STRUCT |
28 | static unsigned char *gbuf; | 28 | static unsigned char *gbuf; |
29 | static size_t gbuf_size = 0; | 29 | static size_t gbuf_size = 0; |
30 | #else | ||
31 | #define MYLCD(fn) rb->lcd_ ## fn | ||
32 | #endif | 30 | #endif |
33 | 31 | ||
34 | #define DURATION (HZ) /* longer duration gives more precise results */ | 32 | #define DURATION (HZ) /* longer duration gives more precise results */ |
@@ -67,45 +65,45 @@ static void time_drawpixel(void) | |||
67 | int count1, count2, count3, count4; | 65 | int count1, count2, count3, count4; |
68 | 66 | ||
69 | /* Test 1: DRMODE_SOLID */ | 67 | /* Test 1: DRMODE_SOLID */ |
70 | MYLCD(set_drawmode)(DRMODE_SOLID); | 68 | mylcd_set_drawmode(DRMODE_SOLID); |
71 | count1 = 0; | 69 | count1 = 0; |
72 | rb->sleep(0); /* sync to tick */ | 70 | rb->sleep(0); /* sync to tick */ |
73 | time_start = *rb->current_tick; | 71 | time_start = *rb->current_tick; |
74 | while((time_end = *rb->current_tick) - time_start < DURATION) | 72 | while((time_end = *rb->current_tick) - time_start < DURATION) |
75 | { | 73 | { |
76 | unsigned rnd = rand_table[count1++ & 0x3ff]; | 74 | unsigned rnd = rand_table[count1++ & 0x3ff]; |
77 | MYLCD(drawpixel)((rnd >> 8) & 0x3f, rnd & 0x3f); | 75 | mylcd_drawpixel((rnd >> 8) & 0x3f, rnd & 0x3f); |
78 | } | 76 | } |
79 | 77 | ||
80 | /* Test 2: DRMODE_FG */ | 78 | /* Test 2: DRMODE_FG */ |
81 | MYLCD(set_drawmode)(DRMODE_FG); | 79 | mylcd_set_drawmode(DRMODE_FG); |
82 | count2 = 0; | 80 | count2 = 0; |
83 | rb->sleep(0); /* sync to tick */ | 81 | rb->sleep(0); /* sync to tick */ |
84 | time_start = *rb->current_tick; | 82 | time_start = *rb->current_tick; |
85 | while((time_end = *rb->current_tick) - time_start < DURATION) | 83 | while((time_end = *rb->current_tick) - time_start < DURATION) |
86 | { | 84 | { |
87 | unsigned rnd = rand_table[count2++ & 0x3ff]; | 85 | unsigned rnd = rand_table[count2++ & 0x3ff]; |
88 | MYLCD(drawpixel)((rnd >> 8) & 0x3f, rnd & 0x3f); | 86 | mylcd_drawpixel((rnd >> 8) & 0x3f, rnd & 0x3f); |
89 | } | 87 | } |
90 | /* Test 3: DRMODE_BG */ | 88 | /* Test 3: DRMODE_BG */ |
91 | MYLCD(set_drawmode)(DRMODE_BG); | 89 | mylcd_set_drawmode(DRMODE_BG); |
92 | count3 = 0; | 90 | count3 = 0; |
93 | rb->sleep(0); /* sync to tick */ | 91 | rb->sleep(0); /* sync to tick */ |
94 | time_start = *rb->current_tick; | 92 | time_start = *rb->current_tick; |
95 | while((time_end = *rb->current_tick) - time_start < DURATION) | 93 | while((time_end = *rb->current_tick) - time_start < DURATION) |
96 | { | 94 | { |
97 | unsigned rnd = rand_table[count3++ & 0x3ff]; | 95 | unsigned rnd = rand_table[count3++ & 0x3ff]; |
98 | MYLCD(drawpixel)((rnd >> 8) & 0x3f, rnd & 0x3f); | 96 | mylcd_drawpixel((rnd >> 8) & 0x3f, rnd & 0x3f); |
99 | } | 97 | } |
100 | /* Test 4: DRMODE_COMPLEMENT */ | 98 | /* Test 4: DRMODE_COMPLEMENT */ |
101 | MYLCD(set_drawmode)(DRMODE_COMPLEMENT); | 99 | mylcd_set_drawmode(DRMODE_COMPLEMENT); |
102 | count4 = 0; | 100 | count4 = 0; |
103 | rb->sleep(0); /* sync to tick */ | 101 | rb->sleep(0); /* sync to tick */ |
104 | time_start = *rb->current_tick; | 102 | time_start = *rb->current_tick; |
105 | while((time_end = *rb->current_tick) - time_start < DURATION) | 103 | while((time_end = *rb->current_tick) - time_start < DURATION) |
106 | { | 104 | { |
107 | unsigned rnd = rand_table[count4++ & 0x3ff]; | 105 | unsigned rnd = rand_table[count4++ & 0x3ff]; |
108 | MYLCD(drawpixel)((rnd >> 8) & 0x3f, rnd & 0x3f); | 106 | mylcd_drawpixel((rnd >> 8) & 0x3f, rnd & 0x3f); |
109 | } | 107 | } |
110 | 108 | ||
111 | rb->fdprintf(log_fd, "lcd_drawpixel (pixels/s): %d/%d/%d/%d\n", | 109 | rb->fdprintf(log_fd, "lcd_drawpixel (pixels/s): %d/%d/%d/%d\n", |
@@ -119,7 +117,7 @@ static void time_drawline(void) | |||
119 | int count1, count2, count3, count4; | 117 | int count1, count2, count3, count4; |
120 | 118 | ||
121 | /* Test 1: DRMODE_SOLID */ | 119 | /* Test 1: DRMODE_SOLID */ |
122 | MYLCD(set_drawmode)(DRMODE_SOLID); | 120 | mylcd_set_drawmode(DRMODE_SOLID); |
123 | count1 = 0; | 121 | count1 = 0; |
124 | rb->sleep(0); /* sync to tick */ | 122 | rb->sleep(0); /* sync to tick */ |
125 | time_start = *rb->current_tick; | 123 | time_start = *rb->current_tick; |
@@ -127,12 +125,12 @@ static void time_drawline(void) | |||
127 | { | 125 | { |
128 | unsigned rnd1 = rand_table[count1++ & 0x3ff]; | 126 | unsigned rnd1 = rand_table[count1++ & 0x3ff]; |
129 | unsigned rnd2 = rand_table[count1++ & 0x3ff]; | 127 | unsigned rnd2 = rand_table[count1++ & 0x3ff]; |
130 | MYLCD(drawline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, | 128 | mylcd_drawline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, |
131 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); | 129 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); |
132 | } | 130 | } |
133 | 131 | ||
134 | /* Test 2: DRMODE_FG */ | 132 | /* Test 2: DRMODE_FG */ |
135 | MYLCD(set_drawmode)(DRMODE_FG); | 133 | mylcd_set_drawmode(DRMODE_FG); |
136 | count2 = 0; | 134 | count2 = 0; |
137 | rb->sleep(0); /* sync to tick */ | 135 | rb->sleep(0); /* sync to tick */ |
138 | time_start = *rb->current_tick; | 136 | time_start = *rb->current_tick; |
@@ -140,11 +138,11 @@ static void time_drawline(void) | |||
140 | { | 138 | { |
141 | unsigned rnd1 = rand_table[count2++ & 0x3ff]; | 139 | unsigned rnd1 = rand_table[count2++ & 0x3ff]; |
142 | unsigned rnd2 = rand_table[count2++ & 0x3ff]; | 140 | unsigned rnd2 = rand_table[count2++ & 0x3ff]; |
143 | MYLCD(drawline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, | 141 | mylcd_drawline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, |
144 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); | 142 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); |
145 | } | 143 | } |
146 | /* Test 3: DRMODE_BG */ | 144 | /* Test 3: DRMODE_BG */ |
147 | MYLCD(set_drawmode)(DRMODE_BG); | 145 | mylcd_set_drawmode(DRMODE_BG); |
148 | count3 = 0; | 146 | count3 = 0; |
149 | rb->sleep(0); /* sync to tick */ | 147 | rb->sleep(0); /* sync to tick */ |
150 | time_start = *rb->current_tick; | 148 | time_start = *rb->current_tick; |
@@ -152,11 +150,11 @@ static void time_drawline(void) | |||
152 | { | 150 | { |
153 | unsigned rnd1 = rand_table[count3++ & 0x3ff]; | 151 | unsigned rnd1 = rand_table[count3++ & 0x3ff]; |
154 | unsigned rnd2 = rand_table[count3++ & 0x3ff]; | 152 | unsigned rnd2 = rand_table[count3++ & 0x3ff]; |
155 | MYLCD(drawline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, | 153 | mylcd_drawline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, |
156 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); | 154 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); |
157 | } | 155 | } |
158 | /* Test 4: DRMODE_COMPLEMENT */ | 156 | /* Test 4: DRMODE_COMPLEMENT */ |
159 | MYLCD(set_drawmode)(DRMODE_COMPLEMENT); | 157 | mylcd_set_drawmode(DRMODE_COMPLEMENT); |
160 | count4 = 0; | 158 | count4 = 0; |
161 | rb->sleep(0); /* sync to tick */ | 159 | rb->sleep(0); /* sync to tick */ |
162 | time_start = *rb->current_tick; | 160 | time_start = *rb->current_tick; |
@@ -164,8 +162,8 @@ static void time_drawline(void) | |||
164 | { | 162 | { |
165 | unsigned rnd1 = rand_table[count4++ & 0x3ff]; | 163 | unsigned rnd1 = rand_table[count4++ & 0x3ff]; |
166 | unsigned rnd2 = rand_table[count4++ & 0x3ff]; | 164 | unsigned rnd2 = rand_table[count4++ & 0x3ff]; |
167 | MYLCD(drawline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, | 165 | mylcd_drawline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, |
168 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); | 166 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); |
169 | } | 167 | } |
170 | 168 | ||
171 | rb->fdprintf(log_fd, "lcd_drawline (lines/s): %d/%d/%d/%d\n", | 169 | rb->fdprintf(log_fd, "lcd_drawline (lines/s): %d/%d/%d/%d\n", |
@@ -179,7 +177,7 @@ static void time_hline(void) | |||
179 | int count1, count2, count3, count4; | 177 | int count1, count2, count3, count4; |
180 | 178 | ||
181 | /* Test 1: DRMODE_SOLID */ | 179 | /* Test 1: DRMODE_SOLID */ |
182 | MYLCD(set_drawmode)(DRMODE_SOLID); | 180 | mylcd_set_drawmode(DRMODE_SOLID); |
183 | count1 = 0; | 181 | count1 = 0; |
184 | rb->sleep(0); /* sync to tick */ | 182 | rb->sleep(0); /* sync to tick */ |
185 | time_start = *rb->current_tick; | 183 | time_start = *rb->current_tick; |
@@ -187,11 +185,11 @@ static void time_hline(void) | |||
187 | { | 185 | { |
188 | unsigned rnd1 = rand_table[count1++ & 0x3ff]; | 186 | unsigned rnd1 = rand_table[count1++ & 0x3ff]; |
189 | unsigned rnd2 = rand_table[count1++ & 0x3ff]; | 187 | unsigned rnd2 = rand_table[count1++ & 0x3ff]; |
190 | MYLCD(hline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); | 188 | mylcd_hline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); |
191 | } | 189 | } |
192 | 190 | ||
193 | /* Test 2: DRMODE_FG */ | 191 | /* Test 2: DRMODE_FG */ |
194 | MYLCD(set_drawmode)(DRMODE_FG); | 192 | mylcd_set_drawmode(DRMODE_FG); |
195 | count2 = 0; | 193 | count2 = 0; |
196 | rb->sleep(0); /* sync to tick */ | 194 | rb->sleep(0); /* sync to tick */ |
197 | time_start = *rb->current_tick; | 195 | time_start = *rb->current_tick; |
@@ -199,10 +197,10 @@ static void time_hline(void) | |||
199 | { | 197 | { |
200 | unsigned rnd1 = rand_table[count2++ & 0x3ff]; | 198 | unsigned rnd1 = rand_table[count2++ & 0x3ff]; |
201 | unsigned rnd2 = rand_table[count2++ & 0x3ff]; | 199 | unsigned rnd2 = rand_table[count2++ & 0x3ff]; |
202 | MYLCD(hline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); | 200 | mylcd_hline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); |
203 | } | 201 | } |
204 | /* Test 3: DRMODE_BG */ | 202 | /* Test 3: DRMODE_BG */ |
205 | MYLCD(set_drawmode)(DRMODE_BG); | 203 | mylcd_set_drawmode(DRMODE_BG); |
206 | count3 = 0; | 204 | count3 = 0; |
207 | rb->sleep(0); /* sync to tick */ | 205 | rb->sleep(0); /* sync to tick */ |
208 | time_start = *rb->current_tick; | 206 | time_start = *rb->current_tick; |
@@ -210,10 +208,10 @@ static void time_hline(void) | |||
210 | { | 208 | { |
211 | unsigned rnd1 = rand_table[count3++ & 0x3ff]; | 209 | unsigned rnd1 = rand_table[count3++ & 0x3ff]; |
212 | unsigned rnd2 = rand_table[count3++ & 0x3ff]; | 210 | unsigned rnd2 = rand_table[count3++ & 0x3ff]; |
213 | MYLCD(hline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); | 211 | mylcd_hline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); |
214 | } | 212 | } |
215 | /* Test 4: DRMODE_COMPLEMENT */ | 213 | /* Test 4: DRMODE_COMPLEMENT */ |
216 | MYLCD(set_drawmode)(DRMODE_COMPLEMENT); | 214 | mylcd_set_drawmode(DRMODE_COMPLEMENT); |
217 | count4 = 0; | 215 | count4 = 0; |
218 | rb->sleep(0); /* sync to tick */ | 216 | rb->sleep(0); /* sync to tick */ |
219 | time_start = *rb->current_tick; | 217 | time_start = *rb->current_tick; |
@@ -221,7 +219,7 @@ static void time_hline(void) | |||
221 | { | 219 | { |
222 | unsigned rnd1 = rand_table[count4++ & 0x3ff]; | 220 | unsigned rnd1 = rand_table[count4++ & 0x3ff]; |
223 | unsigned rnd2 = rand_table[count4++ & 0x3ff]; | 221 | unsigned rnd2 = rand_table[count4++ & 0x3ff]; |
224 | MYLCD(hline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); | 222 | mylcd_hline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); |
225 | } | 223 | } |
226 | 224 | ||
227 | rb->fdprintf(log_fd, "lcd_hline (lines/s): %d/%d/%d/%d\n", | 225 | rb->fdprintf(log_fd, "lcd_hline (lines/s): %d/%d/%d/%d\n", |
@@ -235,7 +233,7 @@ static void time_vline(void) | |||
235 | int count1, count2, count3, count4; | 233 | int count1, count2, count3, count4; |
236 | 234 | ||
237 | /* Test 1: DRMODE_SOLID */ | 235 | /* Test 1: DRMODE_SOLID */ |
238 | MYLCD(set_drawmode)(DRMODE_SOLID); | 236 | mylcd_set_drawmode(DRMODE_SOLID); |
239 | count1 = 0; | 237 | count1 = 0; |
240 | rb->sleep(0); /* sync to tick */ | 238 | rb->sleep(0); /* sync to tick */ |
241 | time_start = *rb->current_tick; | 239 | time_start = *rb->current_tick; |
@@ -243,11 +241,11 @@ static void time_vline(void) | |||
243 | { | 241 | { |
244 | unsigned rnd1 = rand_table[count1++ & 0x3ff]; | 242 | unsigned rnd1 = rand_table[count1++ & 0x3ff]; |
245 | unsigned rnd2 = rand_table[count1++ & 0x3ff]; | 243 | unsigned rnd2 = rand_table[count1++ & 0x3ff]; |
246 | MYLCD(vline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); | 244 | mylcd_vline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); |
247 | } | 245 | } |
248 | 246 | ||
249 | /* Test 2: DRMODE_FG */ | 247 | /* Test 2: DRMODE_FG */ |
250 | MYLCD(set_drawmode)(DRMODE_FG); | 248 | mylcd_set_drawmode(DRMODE_FG); |
251 | count2 = 0; | 249 | count2 = 0; |
252 | rb->sleep(0); /* sync to tick */ | 250 | rb->sleep(0); /* sync to tick */ |
253 | time_start = *rb->current_tick; | 251 | time_start = *rb->current_tick; |
@@ -255,10 +253,10 @@ static void time_vline(void) | |||
255 | { | 253 | { |
256 | unsigned rnd1 = rand_table[count2++ & 0x3ff]; | 254 | unsigned rnd1 = rand_table[count2++ & 0x3ff]; |
257 | unsigned rnd2 = rand_table[count2++ & 0x3ff]; | 255 | unsigned rnd2 = rand_table[count2++ & 0x3ff]; |
258 | MYLCD(vline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); | 256 | mylcd_vline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); |
259 | } | 257 | } |
260 | /* Test 3: DRMODE_BG */ | 258 | /* Test 3: DRMODE_BG */ |
261 | MYLCD(set_drawmode)(DRMODE_BG); | 259 | mylcd_set_drawmode(DRMODE_BG); |
262 | count3 = 0; | 260 | count3 = 0; |
263 | rb->sleep(0); /* sync to tick */ | 261 | rb->sleep(0); /* sync to tick */ |
264 | time_start = *rb->current_tick; | 262 | time_start = *rb->current_tick; |
@@ -266,10 +264,10 @@ static void time_vline(void) | |||
266 | { | 264 | { |
267 | unsigned rnd1 = rand_table[count3++ & 0x3ff]; | 265 | unsigned rnd1 = rand_table[count3++ & 0x3ff]; |
268 | unsigned rnd2 = rand_table[count3++ & 0x3ff]; | 266 | unsigned rnd2 = rand_table[count3++ & 0x3ff]; |
269 | MYLCD(vline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); | 267 | mylcd_vline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); |
270 | } | 268 | } |
271 | /* Test 4: DRMODE_COMPLEMENT */ | 269 | /* Test 4: DRMODE_COMPLEMENT */ |
272 | MYLCD(set_drawmode)(DRMODE_COMPLEMENT); | 270 | mylcd_set_drawmode(DRMODE_COMPLEMENT); |
273 | count4 = 0; | 271 | count4 = 0; |
274 | rb->sleep(0); /* sync to tick */ | 272 | rb->sleep(0); /* sync to tick */ |
275 | time_start = *rb->current_tick; | 273 | time_start = *rb->current_tick; |
@@ -277,7 +275,7 @@ static void time_vline(void) | |||
277 | { | 275 | { |
278 | unsigned rnd1 = rand_table[count4++ & 0x3ff]; | 276 | unsigned rnd1 = rand_table[count4++ & 0x3ff]; |
279 | unsigned rnd2 = rand_table[count4++ & 0x3ff]; | 277 | unsigned rnd2 = rand_table[count4++ & 0x3ff]; |
280 | MYLCD(vline)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); | 278 | mylcd_vline((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, rnd2 & 0x3f); |
281 | } | 279 | } |
282 | 280 | ||
283 | rb->fdprintf(log_fd, "lcd_vline (lines/s): %d/%d/%d/%d\n", | 281 | rb->fdprintf(log_fd, "lcd_vline (lines/s): %d/%d/%d/%d\n", |
@@ -291,7 +289,7 @@ static void time_fillrect(void) | |||
291 | int count1, count2, count3, count4; | 289 | int count1, count2, count3, count4; |
292 | 290 | ||
293 | /* Test 1: DRMODE_SOLID */ | 291 | /* Test 1: DRMODE_SOLID */ |
294 | MYLCD(set_drawmode)(DRMODE_SOLID); | 292 | mylcd_set_drawmode(DRMODE_SOLID); |
295 | count1 = 0; | 293 | count1 = 0; |
296 | rb->sleep(0); /* sync to tick */ | 294 | rb->sleep(0); /* sync to tick */ |
297 | time_start = *rb->current_tick; | 295 | time_start = *rb->current_tick; |
@@ -299,12 +297,12 @@ static void time_fillrect(void) | |||
299 | { | 297 | { |
300 | unsigned rnd1 = rand_table[count1++ & 0x3ff]; | 298 | unsigned rnd1 = rand_table[count1++ & 0x3ff]; |
301 | unsigned rnd2 = rand_table[count1++ & 0x3ff]; | 299 | unsigned rnd2 = rand_table[count1++ & 0x3ff]; |
302 | MYLCD(fillrect)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, | 300 | mylcd_fillrect((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, |
303 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); | 301 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); |
304 | } | 302 | } |
305 | 303 | ||
306 | /* Test 2: DRMODE_FG */ | 304 | /* Test 2: DRMODE_FG */ |
307 | MYLCD(set_drawmode)(DRMODE_FG); | 305 | mylcd_set_drawmode(DRMODE_FG); |
308 | count2 = 0; | 306 | count2 = 0; |
309 | rb->sleep(0); /* sync to tick */ | 307 | rb->sleep(0); /* sync to tick */ |
310 | time_start = *rb->current_tick; | 308 | time_start = *rb->current_tick; |
@@ -312,11 +310,11 @@ static void time_fillrect(void) | |||
312 | { | 310 | { |
313 | unsigned rnd1 = rand_table[count2++ & 0x3ff]; | 311 | unsigned rnd1 = rand_table[count2++ & 0x3ff]; |
314 | unsigned rnd2 = rand_table[count2++ & 0x3ff]; | 312 | unsigned rnd2 = rand_table[count2++ & 0x3ff]; |
315 | MYLCD(fillrect)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, | 313 | mylcd_fillrect((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, |
316 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); | 314 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); |
317 | } | 315 | } |
318 | /* Test 3: DRMODE_BG */ | 316 | /* Test 3: DRMODE_BG */ |
319 | MYLCD(set_drawmode)(DRMODE_BG); | 317 | mylcd_set_drawmode(DRMODE_BG); |
320 | count3 = 0; | 318 | count3 = 0; |
321 | rb->sleep(0); /* sync to tick */ | 319 | rb->sleep(0); /* sync to tick */ |
322 | time_start = *rb->current_tick; | 320 | time_start = *rb->current_tick; |
@@ -324,11 +322,11 @@ static void time_fillrect(void) | |||
324 | { | 322 | { |
325 | unsigned rnd1 = rand_table[count3++ & 0x3ff]; | 323 | unsigned rnd1 = rand_table[count3++ & 0x3ff]; |
326 | unsigned rnd2 = rand_table[count3++ & 0x3ff]; | 324 | unsigned rnd2 = rand_table[count3++ & 0x3ff]; |
327 | MYLCD(fillrect)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, | 325 | mylcd_fillrect((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, |
328 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); | 326 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); |
329 | } | 327 | } |
330 | /* Test 4: DRMODE_COMPLEMENT */ | 328 | /* Test 4: DRMODE_COMPLEMENT */ |
331 | MYLCD(set_drawmode)(DRMODE_COMPLEMENT); | 329 | mylcd_set_drawmode(DRMODE_COMPLEMENT); |
332 | count4 = 0; | 330 | count4 = 0; |
333 | rb->sleep(0); /* sync to tick */ | 331 | rb->sleep(0); /* sync to tick */ |
334 | time_start = *rb->current_tick; | 332 | time_start = *rb->current_tick; |
@@ -336,8 +334,8 @@ static void time_fillrect(void) | |||
336 | { | 334 | { |
337 | unsigned rnd1 = rand_table[count4++ & 0x3ff]; | 335 | unsigned rnd1 = rand_table[count4++ & 0x3ff]; |
338 | unsigned rnd2 = rand_table[count4++ & 0x3ff]; | 336 | unsigned rnd2 = rand_table[count4++ & 0x3ff]; |
339 | MYLCD(fillrect)((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, | 337 | mylcd_fillrect((rnd1 >> 8) & 0x3f, rnd1 & 0x3f, |
340 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); | 338 | (rnd2 >> 8) & 0x3f, rnd2 & 0x3f); |
341 | } | 339 | } |
342 | 340 | ||
343 | rb->fdprintf(log_fd, "lcd_fillrect (rects/s): %d/%d/%d/%d\n", | 341 | rb->fdprintf(log_fd, "lcd_fillrect (rects/s): %d/%d/%d/%d\n", |
@@ -353,45 +351,45 @@ static void time_text(void) /* tests mono_bitmap performance */ | |||
353 | rb->lcd_setfont(FONT_SYSFIXED); | 351 | rb->lcd_setfont(FONT_SYSFIXED); |
354 | 352 | ||
355 | /* Test 1: DRMODE_SOLID */ | 353 | /* Test 1: DRMODE_SOLID */ |
356 | MYLCD(set_drawmode)(DRMODE_SOLID); | 354 | mylcd_set_drawmode(DRMODE_SOLID); |
357 | count1 = 0; | 355 | count1 = 0; |
358 | rb->sleep(0); /* sync to tick */ | 356 | rb->sleep(0); /* sync to tick */ |
359 | time_start = *rb->current_tick; | 357 | time_start = *rb->current_tick; |
360 | while((time_end = *rb->current_tick) - time_start < DURATION) | 358 | while((time_end = *rb->current_tick) - time_start < DURATION) |
361 | { | 359 | { |
362 | unsigned rnd = rand_table[count1++ & 0x3ff]; | 360 | unsigned rnd = rand_table[count1++ & 0x3ff]; |
363 | MYLCD(putsxy)((rnd >> 8) & 0x3f, rnd & 0x3f, "Rockbox!"); | 361 | mylcd_putsxy((rnd >> 8) & 0x3f, rnd & 0x3f, "Rockbox!"); |
364 | } | 362 | } |
365 | 363 | ||
366 | /* Test 2: DRMODE_FG */ | 364 | /* Test 2: DRMODE_FG */ |
367 | MYLCD(set_drawmode)(DRMODE_FG); | 365 | mylcd_set_drawmode(DRMODE_FG); |
368 | count2 = 0; | 366 | count2 = 0; |
369 | rb->sleep(0); /* sync to tick */ | 367 | rb->sleep(0); /* sync to tick */ |
370 | time_start = *rb->current_tick; | 368 | time_start = *rb->current_tick; |
371 | while((time_end = *rb->current_tick) - time_start < DURATION) | 369 | while((time_end = *rb->current_tick) - time_start < DURATION) |
372 | { | 370 | { |
373 | unsigned rnd = rand_table[count2++ & 0x3ff]; | 371 | unsigned rnd = rand_table[count2++ & 0x3ff]; |
374 | MYLCD(putsxy)((rnd >> 8) & 0x3f, rnd & 0x3f, "Rockbox!"); | 372 | mylcd_putsxy((rnd >> 8) & 0x3f, rnd & 0x3f, "Rockbox!"); |
375 | } | 373 | } |
376 | /* Test 3: DRMODE_BG */ | 374 | /* Test 3: DRMODE_BG */ |
377 | MYLCD(set_drawmode)(DRMODE_BG); | 375 | mylcd_set_drawmode(DRMODE_BG); |
378 | count3 = 0; | 376 | count3 = 0; |
379 | rb->sleep(0); /* sync to tick */ | 377 | rb->sleep(0); /* sync to tick */ |
380 | time_start = *rb->current_tick; | 378 | time_start = *rb->current_tick; |
381 | while((time_end = *rb->current_tick) - time_start < DURATION) | 379 | while((time_end = *rb->current_tick) - time_start < DURATION) |
382 | { | 380 | { |
383 | unsigned rnd = rand_table[count3++ & 0x3ff]; | 381 | unsigned rnd = rand_table[count3++ & 0x3ff]; |
384 | MYLCD(putsxy)((rnd >> 8) & 0x3f, rnd & 0x3f, "Rockbox!"); | 382 | mylcd_putsxy((rnd >> 8) & 0x3f, rnd & 0x3f, "Rockbox!"); |
385 | } | 383 | } |
386 | /* Test 4: DRMODE_COMPLEMENT */ | 384 | /* Test 4: DRMODE_COMPLEMENT */ |
387 | MYLCD(set_drawmode)(DRMODE_COMPLEMENT); | 385 | mylcd_set_drawmode(DRMODE_COMPLEMENT); |
388 | count4 = 0; | 386 | count4 = 0; |
389 | rb->sleep(0); /* sync to tick */ | 387 | rb->sleep(0); /* sync to tick */ |
390 | time_start = *rb->current_tick; | 388 | time_start = *rb->current_tick; |
391 | while((time_end = *rb->current_tick) - time_start < DURATION) | 389 | while((time_end = *rb->current_tick) - time_start < DURATION) |
392 | { | 390 | { |
393 | unsigned rnd = rand_table[count4++ & 0x3ff]; | 391 | unsigned rnd = rand_table[count4++ & 0x3ff]; |
394 | MYLCD(putsxy)((rnd >> 8) & 0x3f, rnd & 0x3f, "Rockbox!"); | 392 | mylcd_putsxy((rnd >> 8) & 0x3f, rnd & 0x3f, "Rockbox!"); |
395 | } | 393 | } |
396 | 394 | ||
397 | rb->fdprintf(log_fd, "lcd_putsxy (strings/s): %d/%d/%d/%d\n", | 395 | rb->fdprintf(log_fd, "lcd_putsxy (strings/s): %d/%d/%d/%d\n", |