summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/grayscale.c6
-rw-r--r--apps/plugins/lib/gray.h14
-rw-r--r--apps/plugins/lib/gray_blockfuncs.c4
-rw-r--r--apps/plugins/lib/gray_drawbitmap.c5
-rw-r--r--apps/plugins/lib/gray_drawgraymap.c13
-rw-r--r--apps/plugins/lib/gray_getstringsize.c2
-rw-r--r--apps/plugins/lib/gray_pixelfuncs.c2
-rw-r--r--apps/plugins/lib/gray_putsxy.c4
-rw-r--r--apps/plugins/lib/gray_screendump.c2
9 files changed, 27 insertions, 25 deletions
diff --git a/apps/plugins/grayscale.c b/apps/plugins/grayscale.c
index 41122c61e9..2be9cc9c23 100644
--- a/apps/plugins/grayscale.c
+++ b/apps/plugins/grayscale.c
@@ -42,7 +42,7 @@ int main(void)
42 int button, scroll_amount; 42 int button, scroll_amount;
43 bool black_border; 43 bool black_border;
44 44
45 static unsigned char rockbox[] = { 45 static const unsigned char rockbox[] = {
46 /* ........................................... 46 /* ...........................................
47 * .####...###...###..#...#.####...###..#...#. 47 * .####...###...###..#...#.####...###..#...#.
48 * .#...#.#...#.#...#.#..#..#...#.#...#..#.#.. 48 * .#...#.#...#.#...#.#..#..#...#.#...#..#.#..
@@ -59,7 +59,7 @@ int main(void)
59 0x14, 0x22, 0x00 59 0x14, 0x22, 0x00
60 }; 60 };
61 61
62 static unsigned char showing[] = { 62 static const unsigned char showing[] = {
63 /* ....................................... 63 /* .......................................
64 * ..####.#...#..###..#...#.#.#...#..####. 64 * ..####.#...#..###..#...#.#.#...#..####.
65 * .#.....#...#.#...#.#...#.#.##..#.#..... 65 * .#.....#...#.#...#.#...#.#.##..#.#.....
@@ -75,7 +75,7 @@ int main(void)
75 0x10, 0x3E, 0x00, 0x1C, 0x22, 0x22, 0x2A, 0x3A, 0x00 75 0x10, 0x3E, 0x00, 0x1C, 0x22, 0x22, 0x2A, 0x3A, 0x00
76 }; 76 };
77 77
78 static unsigned char grayscale_gray[] = { 78 static const unsigned char grayscale_gray[] = {
79 /* ....................................................... 79 /* .......................................................
80 * ..####.####...###..#...#..####..###...###..#.....#####. 80 * ..####.####...###..#...#..####..###...###..#.....#####.
81 * .#.....#...#.#...#.#...#.#.....#...#.#...#.#.....#..... 81 * .#.....#...#.#...#.#...#.#.....#...#.#...#.#.....#.....
diff --git a/apps/plugins/lib/gray.h b/apps/plugins/lib/gray.h
index c8a9afc390..52d6f6c0df 100644
--- a/apps/plugins/lib/gray.h
+++ b/apps/plugins/lib/gray.h
@@ -362,7 +362,7 @@ void gray_fillrect(int x, int y, int nx, int ny);
362 362
363 This is the only drawing function NOT using the drawinfo. 363 This is the only drawing function NOT using the drawinfo.
364 */ 364 */
365void gray_drawgraymap(unsigned char *src, int x, int y, int nx, int ny, 365void gray_drawgraymap(const unsigned char *src, int x, int y, int nx, int ny,
366 int stride); 366 int stride);
367 367
368/*--------------------------------------------------------------------------- 368/*---------------------------------------------------------------------------
@@ -384,7 +384,7 @@ void gray_drawgraymap(unsigned char *src, int x, int y, int nx, int ny,
384 The <stride> parameter is useful if you want to show only a part of a 384 The <stride> parameter is useful if you want to show only a part of a
385 bitmap. It should always be set to the "row length" of the bitmap. 385 bitmap. It should always be set to the "row length" of the bitmap.
386 */ 386 */
387void gray_drawbitmap(unsigned char *src, int x, int y, int nx, int ny, 387void gray_drawbitmap(const unsigned char *src, int x, int y, int nx, int ny,
388 int stride); 388 int stride);
389 389
390/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 390/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -409,14 +409,14 @@ void gray_setfont(int newfont);
409 This works exactly the same way as the core lcd_getstringsize(), only that 409 This works exactly the same way as the core lcd_getstringsize(), only that
410 it uses the selected font for grayscale. 410 it uses the selected font for grayscale.
411 */ 411 */
412int gray_getstringsize(unsigned char *str, int *w, int *h); 412int gray_getstringsize(const unsigned char *str, int *w, int *h);
413 413
414/*--------------------------------------------------------------------------- 414/*---------------------------------------------------------------------------
415 Display text starting at (x, y) with the current font and drawinfo 415 Display text starting at (x, y) with the current font and drawinfo
416 ---------------------------------------------------------------------------- 416 ----------------------------------------------------------------------------
417 The drawmode is used as described for gray_set_drawmode() 417 The drawmode is used as described for gray_set_drawmode()
418 */ 418 */
419void gray_putsxy(int x, int y, unsigned char *str); 419void gray_putsxy(int x, int y, const unsigned char *str);
420 420
421/*=========================================================================== 421/*===========================================================================
422 Private functions and definitions, for use within the grayscale core only 422 Private functions and definitions, for use within the grayscale core only
@@ -458,9 +458,9 @@ extern _tGraybuf *_graybuf;
458extern short _gray_random_buffer; 458extern short _gray_random_buffer;
459 459
460/* Global function pointers */ 460/* Global function pointers */
461extern void (*_gray_pixelfuncs[4])(int x, int y, unsigned long pattern); 461extern void (* const _gray_pixelfuncs[4])(int x, int y, unsigned long pattern);
462extern void (*_gray_blockfuncs[4])(unsigned char *address, unsigned mask, 462extern void (* const _gray_blockfuncs[4])(unsigned char *address, unsigned mask,
463 unsigned bits); 463 unsigned bits);
464 464
465#endif /* HAVE_LCD_BITMAP */ 465#endif /* HAVE_LCD_BITMAP */
466#endif /* SIMULATOR */ 466#endif /* SIMULATOR */
diff --git a/apps/plugins/lib/gray_blockfuncs.c b/apps/plugins/lib/gray_blockfuncs.c
index 47ff1672a8..5f4f90506f 100644
--- a/apps/plugins/lib/gray_blockfuncs.c
+++ b/apps/plugins/lib/gray_blockfuncs.c
@@ -36,8 +36,8 @@ static void _writeblockfg(unsigned char *address, unsigned mask, unsigned bits);
36static void _writeblockbg(unsigned char *address, unsigned mask, unsigned bits); 36static void _writeblockbg(unsigned char *address, unsigned mask, unsigned bits);
37 37
38/* Block function pointer array */ 38/* Block function pointer array */
39void (*_gray_blockfuncs[4])(unsigned char *address, unsigned mask, 39void (* const _gray_blockfuncs[4])(unsigned char *address, unsigned mask,
40 unsigned bits) = { 40 unsigned bits) = {
41 _invertblock, _writeblockfg, _writeblockbg, _writeblock 41 _invertblock, _writeblockfg, _writeblockbg, _writeblock
42}; 42};
43 43
diff --git a/apps/plugins/lib/gray_drawbitmap.c b/apps/plugins/lib/gray_drawbitmap.c
index 5ddb19568a..376f76d45e 100644
--- a/apps/plugins/lib/gray_drawbitmap.c
+++ b/apps/plugins/lib/gray_drawbitmap.c
@@ -48,12 +48,13 @@
48 The <stride> parameter is useful if you want to show only a part of a 48 The <stride> parameter is useful if you want to show only a part of a
49 bitmap. It should always be set to the "row length" of the bitmap. 49 bitmap. It should always be set to the "row length" of the bitmap.
50 */ 50 */
51void gray_drawbitmap(unsigned char *src, int x, int y, int nx, int ny, 51void gray_drawbitmap(const unsigned char *src, int x, int y, int nx, int ny,
52 int stride) 52 int stride)
53{ 53{
54 int shift; 54 int shift;
55 unsigned bits, mask_top, mask_bottom; 55 unsigned bits, mask_top, mask_bottom;
56 unsigned char *src_col, *dst, *dst_col; 56 const unsigned char *src_col;
57 unsigned char *dst, *dst_col;
57 void (*blockfunc)(unsigned char *address, unsigned mask, unsigned bits); 58 void (*blockfunc)(unsigned char *address, unsigned mask, unsigned bits);
58 59
59 if ((unsigned) x >= (unsigned) _graybuf->width 60 if ((unsigned) x >= (unsigned) _graybuf->width
diff --git a/apps/plugins/lib/gray_drawgraymap.c b/apps/plugins/lib/gray_drawgraymap.c
index dc33446527..c8ee93fef1 100644
--- a/apps/plugins/lib/gray_drawgraymap.c
+++ b/apps/plugins/lib/gray_drawgraymap.c
@@ -30,16 +30,16 @@
30#include "gray.h" 30#include "gray.h"
31 31
32/* Prototypes */ 32/* Prototypes */
33static void _writearray(unsigned char *address, unsigned char *src, int stride, 33static void _writearray(unsigned char *address, const unsigned char *src,
34 unsigned mask); 34 int stride, unsigned mask);
35 35
36/* Write an 8-pixel block, defined by their brightnesses in a graymap. 36/* Write an 8-pixel block, defined by their brightnesses in a graymap.
37 * Address is the byte in the first bitplane, src is the graymap start address, 37 * Address is the byte in the first bitplane, src is the graymap start address,
38 * stride is the increment for the graymap to get to the next pixel, mask 38 * stride is the increment for the graymap to get to the next pixel, mask
39 * determines which pixels of the destination block are changed. For "0" bits, 39 * determines which pixels of the destination block are changed. For "0" bits,
40 * the src address is not incremented! */ 40 * the src address is not incremented! */
41static void _writearray(unsigned char *address, unsigned char *src, int stride, 41static void _writearray(unsigned char *address, const unsigned char *src,
42 unsigned mask) 42 int stride, unsigned mask)
43{ 43{
44 unsigned long pat_stack[8]; 44 unsigned long pat_stack[8];
45 register unsigned char *end_addr; 45 register unsigned char *end_addr;
@@ -217,12 +217,13 @@ asm (
217 217
218 This is the only drawing function NOT using the drawinfo. 218 This is the only drawing function NOT using the drawinfo.
219 */ 219 */
220void gray_drawgraymap(unsigned char *src, int x, int y, int nx, int ny, 220void gray_drawgraymap(const unsigned char *src, int x, int y, int nx, int ny,
221 int stride) 221 int stride)
222{ 222{
223 int shift; 223 int shift;
224 unsigned mask_top, mask_bottom; 224 unsigned mask_top, mask_bottom;
225 unsigned char *src_row, *dst, *dst_row; 225 const unsigned char *src_row;
226 unsigned char *dst, *dst_row;
226 227
227 if ((unsigned) x >= (unsigned) _graybuf->width 228 if ((unsigned) x >= (unsigned) _graybuf->width
228 || (unsigned) y >= (unsigned) _graybuf->height) 229 || (unsigned) y >= (unsigned) _graybuf->height)
diff --git a/apps/plugins/lib/gray_getstringsize.c b/apps/plugins/lib/gray_getstringsize.c
index 977b912247..5b6d3e7c49 100644
--- a/apps/plugins/lib/gray_getstringsize.c
+++ b/apps/plugins/lib/gray_getstringsize.c
@@ -36,7 +36,7 @@
36 This works exactly the same way as the core lcd_getstringsize(), only that 36 This works exactly the same way as the core lcd_getstringsize(), only that
37 it uses the selected font for grayscale. 37 it uses the selected font for grayscale.
38 */ 38 */
39int gray_getstringsize(unsigned char *str, int *w, int *h) 39int gray_getstringsize(const unsigned char *str, int *w, int *h)
40{ 40{
41 int ch; 41 int ch;
42 int width = 0; 42 int width = 0;
diff --git a/apps/plugins/lib/gray_pixelfuncs.c b/apps/plugins/lib/gray_pixelfuncs.c
index cade096405..3cdcccd9a5 100644
--- a/apps/plugins/lib/gray_pixelfuncs.c
+++ b/apps/plugins/lib/gray_pixelfuncs.c
@@ -34,7 +34,7 @@ static void _writepixel(int x, int y, unsigned long pattern);
34static void _invertpixel(int x, int y, unsigned long pattern); 34static void _invertpixel(int x, int y, unsigned long pattern);
35 35
36/* function pointer array */ 36/* function pointer array */
37void (*_gray_pixelfuncs[4])(int x, int y, unsigned long pattern) = { 37void (* const _gray_pixelfuncs[4])(int x, int y, unsigned long pattern) = {
38 _invertpixel, _writepixel, _writepixel, _writepixel 38 _invertpixel, _writepixel, _writepixel, _writepixel
39}; 39};
40 40
diff --git a/apps/plugins/lib/gray_putsxy.c b/apps/plugins/lib/gray_putsxy.c
index 18cf2bac78..51f1ca166a 100644
--- a/apps/plugins/lib/gray_putsxy.c
+++ b/apps/plugins/lib/gray_putsxy.c
@@ -34,7 +34,7 @@
34 ---------------------------------------------------------------------------- 34 ----------------------------------------------------------------------------
35 The drawmode is used as described for gray_set_drawmode() 35 The drawmode is used as described for gray_set_drawmode()
36 */ 36 */
37void gray_putsxy(int x, int y, unsigned char *str) 37void gray_putsxy(int x, int y, const unsigned char *str)
38{ 38{
39 int ch, width; 39 int ch, width;
40 bitmap_t *bits; 40 bitmap_t *bits;
@@ -56,7 +56,7 @@ void gray_putsxy(int x, int y, unsigned char *str)
56 bits = pf->bits + (pf->offset ? pf->offset[ch] 56 bits = pf->bits + (pf->offset ? pf->offset[ch]
57 : MULU16(pf->height, ch)); 57 : MULU16(pf->height, ch));
58 58
59 gray_drawbitmap((unsigned char*) bits, x, y, width, pf->height, 59 gray_drawbitmap((const unsigned char*) bits, x, y, width, pf->height,
60 width); 60 width);
61 x += width; 61 x += width;
62 } 62 }
diff --git a/apps/plugins/lib/gray_screendump.c b/apps/plugins/lib/gray_screendump.c
index 8968007039..fdc88b8547 100644
--- a/apps/plugins/lib/gray_screendump.c
+++ b/apps/plugins/lib/gray_screendump.c
@@ -29,7 +29,7 @@
29#ifdef HAVE_LCD_BITMAP /* and also not for the Player */ 29#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
30#include "gray.h" 30#include "gray.h"
31 31
32static unsigned char bmpheader[] = 32static const unsigned char bmpheader[] =
33{ 33{
34 0x42, 0x4d, 0xba, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 34 0x42, 0x4d, 0xba, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00,
35 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x40, 0x00, 35 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x40, 0x00,