summaryrefslogtreecommitdiffstats
path: root/apps/plugins/lib/xlcd_scroll.c
blob: 1e6ad071fc9eba304545a7650982082ca0b412cc (plain)
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
/***************************************************************************
*             __________               __   ___.
*   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
*   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
*   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
*   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
*                     \/            \/     \/    \/            \/
* $Id$
*
* Additional LCD routines not present in the rockbox core
* Scrolling functions
*
* Copyright (C) 2005 Jens Arnold
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/

#include "plugin.h"

#ifdef HAVE_LCD_BITMAP
#include "xlcd.h"

#if (LCD_PIXELFORMAT == HORIZONTAL_PACKING) && (LCD_DEPTH < 8)

/* Scroll left */
void xlcd_scroll_left(int count)
{
    int bitcount, oldmode;
    int blockcount, blocklen;

    if ((unsigned) count >= LCD_WIDTH)
        return;
        
#if LCD_DEPTH == 2
    blockcount = count >> 2;
    blocklen = LCD_FBWIDTH - blockcount;
    bitcount = 2 * (count & 3);
#endif

    if (blockcount)
    {
        unsigned char *data = _xlcd_rb->lcd_framebuffer;
        unsigned char *data_end = data + LCD_FBWIDTH*LCD_HEIGHT;

        do
        {
            _xlcd_rb->memmove(data, data + blockcount, blocklen);
            data += LCD_FBWIDTH;
        }
        while (data < data_end);
    }
    if (bitcount)
    {
        int bx, y;
        unsigned char *addr = _xlcd_rb->lcd_framebuffer + blocklen;
#if LCD_DEPTH == 2
        unsigned fill = 0x55 * (~_xlcd_rb->lcd_get_background() & 3);
#endif

        for (y = 0; y < LCD_HEIGHT; y++)
        {
            unsigned char *row_addr = addr;
            unsigned data = fill;

            for (bx = 0; bx < blocklen; bx++)
            {
                --row_addr;
                data = (data >> 8) | (*row_addr << bitcount);
                *row_addr = data;
            }
            addr += LCD_FBWIDTH;
        }
    }
    oldmode = _xlcd_rb->lcd_get_drawmode();
    _xlcd_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
    _xlcd_rb->lcd_fillrect(LCD_WIDTH - count, 0, count, LCD_HEIGHT);
    _xlcd_rb->lcd_set_drawmode(oldmode);
}

/* Scroll right */
void xlcd_scroll_right(int count)
{
    int bitcount, oldmode;
    int blockcount, blocklen;

    if ((unsigned) count >= LCD_WIDTH)
        return;
        
#if LCD_DEPTH == 2
    blockcount = count >> 2;
    blocklen = LCD_FBWIDTH - blockcount;
    bitcount = 2 * (count & 3);
#endif

    if (blockcount)
    {
        unsigned char *data = _xlcd_rb->lcd_framebuffer;
        unsigned char *data_end = data + LCD_FBWIDTH*LCD_HEIGHT;

        do
        {
            _xlcd_rb->memmove(data + blockcount, data, blocklen);
            data += LCD_FBWIDTH;
        }
        while (data < data_end);
    }
    if (bitcount)
    {
        int bx, y;
        unsigned char *addr = _xlcd_rb->lcd_framebuffer + blockcount;
#if LCD_DEPTH == 2
        unsigned fill = 0x55 * (~_xlcd_rb->lcd_get_background() & 3);
#endif

        for (y = 0; y < LCD_HEIGHT; y++)
        {
            unsigned char *row_addr = addr;
            unsigned data = fill;

            for (bx = 0; bx < blocklen; bx++)
            {
                data = (data << 8) | *row_addr;
                *row_addr = data >> bitcount;
                row_addr++;
            }
            addr += LCD_FBWIDTH;
        }
    }
    oldmode = _xlcd_rb->lcd_get_drawmode();
    _xlcd_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
    _xlcd_rb->lcd_fillrect(0, 0, count, LCD_HEIGHT);
    _xlcd_rb->lcd_set_drawmode(oldmode);
}

#else /* LCD_PIXELFORMAT vertical packed or >= 8bit / pixel */

/* Scroll left */
void xlcd_scroll_left(int count)
{
    fb_data *data, *data_end;
    int length, oldmode;

    if ((unsigned)count >= LCD_WIDTH)
        return;

    data = _xlcd_rb->lcd_framebuffer;
#if LCD_DEPTH >= 8
    data_end = data + LCD_WIDTH*LCD_HEIGHT;
#else
    data_end = data + LCD_WIDTH*((LCD_HEIGHT*LCD_DEPTH+7)/8);
#endif
    length = LCD_WIDTH - count;

    do
    {
        _xlcd_rb->memmove(data, data + count, length * sizeof(fb_data));
        data += LCD_WIDTH;
    }
    while (data < data_end);

    oldmode = _xlcd_rb->lcd_get_drawmode();
    _xlcd_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
    _xlcd_rb->lcd_fillrect(length, 0, count, LCD_HEIGHT);
    _xlcd_rb->lcd_set_drawmode(oldmode);
}

/* Scroll right */
void xlcd_scroll_right(int count)
{
    fb_data *data, *data_end;
    int length, oldmode;

    if ((unsigned)count >= LCD_WIDTH)
        return;

    data = _xlcd_rb->lcd_framebuffer;
#if LCD_DEPTH >= 8
    data_end = data + LCD_WIDTH*LCD_HEIGHT;
#else
    data_end = data + LCD_WIDTH*((LCD_HEIGHT*LCD_DEPTH+7)/8);
#endif
    length = LCD_WIDTH - count;

    do
    {
        _xlcd_rb->memmove(data + count, data, length * sizeof(fb_data));
        data += LCD_WIDTH;
    }
    while (data < data_end);

    oldmode = _xlcd_rb->lcd_get_drawmode();
    _xlcd_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
    _xlcd_rb->lcd_fillrect(0, 0, count, LCD_HEIGHT);
    _xlcd_rb->lcd_set_drawmode(oldmode);
}

#endif /* LCD_PIXELFORMAT, LCD_DEPTH */

#if (LCD_PIXELFORMAT == HORIZONTAL_PACKING) || (LCD_DEPTH >= 8)

/* Scroll up */
void xlcd_scroll_up(int count)
{
    int length, oldmode;

    if ((unsigned)count >= LCD_HEIGHT)
        return;

    length = LCD_HEIGHT - count;

    _xlcd_rb->memmove(_xlcd_rb->lcd_framebuffer,
                      _xlcd_rb->lcd_framebuffer + count * LCD_FBWIDTH,
                      length * LCD_FBWIDTH * sizeof(fb_data));

    oldmode = _xlcd_rb->lcd_get_drawmode();
    _xlcd_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
    _xlcd_rb->lcd_fillrect(0, length, LCD_WIDTH, count);
    _xlcd_rb->lcd_set_drawmode(oldmode);
}

/* Scroll down */
void xlcd_scroll_down(int count)
{
    int length, oldmode;

    if ((unsigned)count >= LCD_HEIGHT)
        return;

    length = LCD_HEIGHT - count;

    _xlcd_rb->memmove(_xlcd_rb->lcd_framebuffer + count * LCD_FBWIDTH,
                      _xlcd_rb->lcd_framebuffer,
                      length * LCD_FBWIDTH * sizeof(fb_data));

    oldmode = _xlcd_rb->lcd_get_drawmode();
    _xlcd_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
    _xlcd_rb->lcd_fillrect(0, 0, LCD_WIDTH, count);
    _xlcd_rb->lcd_set_drawmode(oldmode);
}

#else /* LCD_PIXELFORMAT vertical packed */

/* Scroll up */
void xlcd_scroll_up(int count)
{
    int bitcount, oldmode;
    int blockcount, blocklen;

    if ((unsigned) count >= LCD_HEIGHT)
        return;
        
#if LCD_DEPTH == 1
    blockcount = count >> 3;
    blocklen = ((LCD_HEIGHT+7)/8) - blockcount;
    bitcount = count & 7;
#elif LCD_DEPTH == 2
    blockcount = count >> 2;
    blocklen = ((LCD_HEIGHT+3)/4) - blockcount;
    bitcount = 2 * (count & 3);
#endif

    if (blockcount)
    {
        _xlcd_rb->memmove(_xlcd_rb->lcd_framebuffer,
                          _xlcd_rb->lcd_framebuffer + blockcount * LCD_FBWIDTH,
                          blocklen * LCD_FBWIDTH);
    }
    if (bitcount)
    {
#if (CONFIG_CPU == SH7034) && (LCD_DEPTH == 1)
        asm (
            "mov     #0,r4       \n"  /* x = 0 */
            "mova    .su_shifttbl,r0 \n"  /* calculate jump destination for */
            "mov.b   @(r0,%[cnt]),%[cnt] \n"  /* shift amount from table */
            "bra     .su_cloop   \n"  /* skip table */
            "add     r0,%[cnt]   \n"

            ".align  2           \n"
        ".su_shifttbl:           \n"  /* shift jump offset table */
            ".byte   .su_shift0 - .su_shifttbl \n"
            ".byte   .su_shift1 - .su_shifttbl \n"
            ".byte   .su_shift2 - .su_shifttbl \n"
            ".byte   .su_shift3 - .su_shifttbl \n"
            ".byte   .su_shift4 - .su_shifttbl \n"
            ".byte   .su_shift5 - .su_shifttbl \n"
            ".byte   .su_shift6 - .su_shifttbl \n"
            ".byte   .su_shift7 - .su_shifttbl \n"

        ".su_cloop:              \n"  /* repeat for every column */
            "mov     %[addr],r2  \n"  /* get start address */
            "mov     #0,r3       \n"  /* current_row = 0 */
            "mov     #0,r1       \n"  /* fill with zero */

        ".su_iloop:              \n"  /* repeat for all rows */
            "sub     %[wide],r2  \n"  /* address -= width */
            "mov.b   @r2,r0      \n"  /* get data byte */
            "shll8   r1          \n"  /* old data to 2nd byte */
            "extu.b  r0,r0       \n"  /* extend unsigned */
            "or      r1,r0       \n"  /* combine old data */
            "jmp     @%[cnt]     \n"  /* jump into shift "path" */
            "extu.b  r0,r1       \n"  /* store data for next round */

        ".su_shift6:             \n"  /* shift right by 0..7 bits */
            "shll2   r0          \n"
            "bra     .su_shift0  \n"
            "shlr8   r0          \n"
        ".su_shift4:             \n"
            "shlr2   r0          \n"
        ".su_shift2:             \n"
            "bra     .su_shift0  \n"
            "shlr2   r0          \n"
        ".su_shift7:             \n"
            "shlr2   r0          \n"
        ".su_shift5:             \n"
            "shlr2   r0          \n"
        ".su_shift3:             \n"
            "shlr2   r0          \n"
        ".su_shift1:             \n"
            "shlr    r0          \n"
        ".su_shift0:             \n"

            "mov.b   r0,@r2      \n"  /* store data */
            "add     #1,r3       \n"  /* current_row++ */
            "cmp/hi  r3,%[rows]  \n"  /* current_row < bheight - shift ? */
            "bt      .su_iloop   \n"

            "add     #1,%[addr]  \n"  /* start_address++ */
            "add     #1,r4       \n"  /* x++ */
            "cmp/hi  r4,%[wide]  \n"  /* x < width ? */
            "bt      .su_cloop   \n"
            : /* outputs */
            : /* inputs */
            [addr]"r"(_xlcd_rb->lcd_framebuffer + blocklen * LCD_FBWIDTH),
            [wide]"r"(LCD_FBWIDTH),
            [rows]"r"(blocklen),
            [cnt] "r"(bitcount)
            : /* clobbers */
            "r0", "r1", "r2", "r3", "r4"
        );
#elif defined(CPU_COLDFIRE) && (LCD_DEPTH == 2)
        asm (
            "move.l  %[wide],%%d3\n"  /* columns = width */

        ".su_cloop:              \n"  /* repeat for every column */
            "move.l  %[addr],%%a1\n"  /* get start address */
            "move.l  %[rows],%%d2\n"  /* rows = row_count */
            "move.l  %[bkg],%%d1 \n"  /* fill with background */

        ".su_iloop:              \n"  /* repeat for all rows */
            "sub.l   %[wide],%%a1\n"  /* address -= width */

            "clr.l   %%d0        \n"
            "move.b  (%%a1),%%d0 \n"  /* get data byte */
            "lsl.l   #8,%%d1     \n"  /* old data to 2nd byte */
            "or.l    %%d1,%%d0   \n"  /* combine old data */
            "clr.l   %%d1        \n"
            "move.b  %%d0,%%d1   \n"  /* keep data for next round */
            "lsr.l   %[cnt],%%d0 \n"  /* shift right */
            "move.b  %%d0,(%%a1) \n"  /* store data */

            "subq.l  #1,%%d2     \n"  /* rows-- */
            "bne.b   .su_iloop   \n"

            "addq.l  #1,%[addr]  \n"  /* start_address++ */
            "subq.l  #1,%%d3     \n"  /* columns-- */
            "bne.b   .su_cloop   \n"
            : /* outputs */
            : /* inputs */
            [wide]"r"(LCD_FBWIDTH),
            [rows]"r"(blocklen),
            [addr]"a"(_xlcd_rb->lcd_framebuffer + blocklen * LCD_FBWIDTH),
            [cnt] "d"(bitcount),
            [bkg] "d"(0x55 * (~_xlcd_rb->lcd_get_background() & 3))
            : /* clobbers */
            "a1", "d0", "d1", "d2", "d3"
        );
#else /* C version */
        int x, by;
        unsigned char *addr = _xlcd_rb->lcd_framebuffer + blocklen * LCD_FBWIDTH;
#if LCD_DEPTH == 2
        unsigned fill = 0x55 * (~_xlcd_rb->lcd_get_background() & 3);
#endif

        for (x = 0; x < LCD_WIDTH; x++)
        {
            unsigned char *col_addr = addr++;
#if LCD_DEPTH == 1
            unsigned data = 0;
#else
            unsigned data = fill;
#endif
            
            for (by = 0; by < blocklen; by++)
            {
                col_addr -= LCD_FBWIDTH;
                data = (data << 8) | *col_addr;
                *col_addr = data >> bitcount;
            }
        }
#endif /* CPU, LCD_DEPTH */
    }
    oldmode = _xlcd_rb->lcd_get_drawmode();
    _xlcd_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
    _xlcd_rb->lcd_fillrect(0, LCD_HEIGHT - count, LCD_WIDTH, count);
    _xlcd_rb->lcd_set_drawmode(oldmode);
}

/* Scroll up */
void xlcd_scroll_down(int count)
{
    int bitcount, oldmode;
    int blockcount, blocklen;

    if ((unsigned) count >= LCD_HEIGHT)
        return;
        
#if LCD_DEPTH == 1
    blockcount = count >> 3;
    blocklen = ((LCD_HEIGHT+7)/8) - blockcount;
    bitcount = count & 7;
#elif LCD_DEPTH == 2
    blockcount = count >> 2;
    blocklen = ((LCD_HEIGHT+3)/4) - blockcount;
    bitcount = 2 * (count & 3);
#endif

    if (blockcount)
    {
        _xlcd_rb->memmove(_xlcd_rb->lcd_framebuffer + blockcount * LCD_FBWIDTH,
                          _xlcd_rb->lcd_framebuffer,
                          blocklen * LCD_FBWIDTH);
    }
    if (bitcount)
    {
#if (CONFIG_CPU == SH7034) && (LCD_DEPTH == 1)
        asm (
            "mov     #0,r4       \n"  /* x = 0 */
            "mova    .sd_shifttbl,r0 \n"  /* calculate jump destination for */
            "mov.b   @(r0,%[cnt]),%[cnt] \n"  /* shift amount from table */
            "bra     .sd_cloop   \n"  /* skip table */
            "add     r0,%[cnt]   \n"

            ".align  2           \n"
        ".sd_shifttbl:           \n"  /* shift jump offset table */
            ".byte   .sd_shift0 - .sd_shifttbl \n"
            ".byte   .sd_shift1 - .sd_shifttbl \n"
            ".byte   .sd_shift2 - .sd_shifttbl \n"
            ".byte   .sd_shift3 - .sd_shifttbl \n"
            ".byte   .sd_shift4 - .sd_shifttbl \n"
            ".byte   .sd_shift5 - .sd_shifttbl \n"
            ".byte   .sd_shift6 - .sd_shifttbl \n"
            ".byte   .sd_shift7 - .sd_shifttbl \n"

        ".sd_cloop:              \n"  /* repeat for every column */
            "mov     %[addr],r2  \n"  /* get start address */
            "mov     #0,r3       \n"  /* current_row = 0 */
            "mov     #0,r1       \n"  /* fill with zero */

        ".sd_iloop:              \n"  /* repeat for all rows */
            "shlr8   r1          \n"  /* shift right to get residue */
            "mov.b   @r2,r0      \n"  /* get data byte */
            "jmp     @%[cnt]     \n"  /* jump into shift "path" */
            "extu.b  r0,r0       \n"  /* extend unsigned */

        ".sd_shift6:             \n"  /* shift left by 0..7 bits */
            "shll8   r0          \n"
            "bra     .sd_shift0  \n"
            "shlr2   r0          \n"
        ".sd_shift4:             \n"
            "shll2   r0          \n"
        ".sd_shift2:             \n"
            "bra     .sd_shift0  \n"
            "shll2   r0          \n"
        ".sd_shift7:             \n"
            "shll2   r0          \n"
        ".sd_shift5:             \n"
            "shll2   r0          \n"
        ".sd_shift3:             \n"
            "shll2   r0          \n"
        ".sd_shift1:             \n"
            "shll    r0          \n"
        ".sd_shift0:             \n"

            "or      r0,r1       \n"  /* combine with last residue */
            "mov.b   r1,@r2      \n"  /* store data */
            "add     %[wide],r2  \n"  /* address += width */
            "add     #1,r3       \n"  /* current_row++ */
            "cmp/hi  r3,%[rows]  \n"  /* current_row < bheight - shift ? */
            "bt      .sd_iloop   \n"

            "add     #1,%[addr]  \n"  /* start_address++ */
            "add     #1,r4       \n"  /* x++ */
            "cmp/hi  r4,%[wide]  \n"  /* x < width ? */
            "bt      .sd_cloop   \n"
            : /* outputs */
            : /* inputs */
            [addr]"r"(_xlcd_rb->lcd_framebuffer + blockcount * LCD_FBWIDTH),
            [wide]"r"(LCD_WIDTH),
            [rows]"r"(blocklen),
            [cnt] "r"(bitcount)
            : /* clobbers */
            "r0", "r1", "r2", "r3", "r4"
        );
#elif defined(CPU_COLDFIRE) && (LCD_DEPTH == 2)
        asm (
            "move.l  %[wide],%%d3\n"  /* columns = width */

        ".sd_cloop:              \n"  /* repeat for every column */
            "move.l  %[addr],%%a1\n"  /* get start address */
            "move.l  %[rows],%%d2\n"  /* rows = row_count */
            "move.l  %[bkg],%%d1 \n"  /* fill with background */

        ".sd_iloop:              \n"  /* repeat for all rows */
            "lsr.l   #8,%%d1     \n"  /* shift right to get residue */
            "clr.l   %%d0        \n"
            "move.b  (%%a1),%%d0 \n"  /* get data byte */
            "lsl.l   %[cnt],%%d0 \n"
            "or.l    %%d0,%%d1   \n"  /* combine with last residue */
            "move.b  %%d1,(%%a1) \n"  /* store data */

            "add.l   %[wide],%%a1\n"  /* address += width */
            "subq.l  #1,%%d2     \n"  /* rows-- */
            "bne.b   .sd_iloop   \n"

            "lea.l   (1,%[addr]),%[addr] \n"  /* start_address++ */
            "subq.l  #1,%%d3     \n"  /* columns-- */
            "bne.b   .sd_cloop   \n"
            : /* outputs */
            : /* inputs */
            [wide]"r"(LCD_WIDTH),
            [rows]"r"(blocklen),
            [addr]"a"(_xlcd_rb->lcd_framebuffer + blockcount * LCD_FBWIDTH),
            [cnt] "d"(bitcount),
            [bkg] "d"((0x55 * (~_xlcd_rb->lcd_get_background() & 3)) << bitcount)
            : /* clobbers */
            "a1", "d0", "d1", "d2", "d3"
        );
#else /* C version */
        int x, by;
        unsigned char *addr = _xlcd_rb->lcd_framebuffer + blockcount * LCD_FBWIDTH;
#if LCD_DEPTH == 2
        unsigned fill = (0x55 * (~_xlcd_rb->lcd_get_background() & 3)) << bitcount;
#endif

        for (x = 0; x < LCD_WIDTH; x++)
        {
            unsigned char *col_addr = addr++;
#if LCD_DEPTH == 1
            unsigned data = 0;
#else
            unsigned data = fill;
#endif
            
            for (by = 0; by < blocklen; by++)
            {
                data = (data >> 8) | (*col_addr << bitcount);
                *col_addr = data;
                col_addr += LCD_FBWIDTH;
            }
        }
#endif /* CPU, LCD_DEPTH */
    }
    oldmode = _xlcd_rb->lcd_get_drawmode();
    _xlcd_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
    _xlcd_rb->lcd_fillrect(0, 0, LCD_WIDTH, count);
    _xlcd_rb->lcd_set_drawmode(oldmode);
}

#endif /* LCD_PIXELFORMAT, LCD_DEPTH */

#endif /* HAVE_LCD_BITMAP */