diff options
Diffstat (limited to 'apps/plugins/lib')
-rw-r--r-- | apps/plugins/lib/gray.h | 14 | ||||
-rw-r--r-- | apps/plugins/lib/gray_blockfuncs.c | 4 | ||||
-rw-r--r-- | apps/plugins/lib/gray_drawbitmap.c | 5 | ||||
-rw-r--r-- | apps/plugins/lib/gray_drawgraymap.c | 13 | ||||
-rw-r--r-- | apps/plugins/lib/gray_getstringsize.c | 2 | ||||
-rw-r--r-- | apps/plugins/lib/gray_pixelfuncs.c | 2 | ||||
-rw-r--r-- | apps/plugins/lib/gray_putsxy.c | 4 | ||||
-rw-r--r-- | apps/plugins/lib/gray_screendump.c | 2 |
8 files changed, 24 insertions, 22 deletions
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 | */ |
365 | void gray_drawgraymap(unsigned char *src, int x, int y, int nx, int ny, | 365 | void 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 | */ |
387 | void gray_drawbitmap(unsigned char *src, int x, int y, int nx, int ny, | 387 | void 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 | */ |
412 | int gray_getstringsize(unsigned char *str, int *w, int *h); | 412 | int 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 | */ |
419 | void gray_putsxy(int x, int y, unsigned char *str); | 419 | void 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; | |||
458 | extern short _gray_random_buffer; | 458 | extern short _gray_random_buffer; |
459 | 459 | ||
460 | /* Global function pointers */ | 460 | /* Global function pointers */ |
461 | extern void (*_gray_pixelfuncs[4])(int x, int y, unsigned long pattern); | 461 | extern void (* const _gray_pixelfuncs[4])(int x, int y, unsigned long pattern); |
462 | extern void (*_gray_blockfuncs[4])(unsigned char *address, unsigned mask, | 462 | extern 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); | |||
36 | static void _writeblockbg(unsigned char *address, unsigned mask, unsigned bits); | 36 | static void _writeblockbg(unsigned char *address, unsigned mask, unsigned bits); |
37 | 37 | ||
38 | /* Block function pointer array */ | 38 | /* Block function pointer array */ |
39 | void (*_gray_blockfuncs[4])(unsigned char *address, unsigned mask, | 39 | void (* 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 | */ |
51 | void gray_drawbitmap(unsigned char *src, int x, int y, int nx, int ny, | 51 | void 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 */ |
33 | static void _writearray(unsigned char *address, unsigned char *src, int stride, | 33 | static 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! */ |
41 | static void _writearray(unsigned char *address, unsigned char *src, int stride, | 41 | static 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 | */ |
220 | void gray_drawgraymap(unsigned char *src, int x, int y, int nx, int ny, | 220 | void 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 | */ |
39 | int gray_getstringsize(unsigned char *str, int *w, int *h) | 39 | int 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); | |||
34 | static void _invertpixel(int x, int y, unsigned long pattern); | 34 | static void _invertpixel(int x, int y, unsigned long pattern); |
35 | 35 | ||
36 | /* function pointer array */ | 36 | /* function pointer array */ |
37 | void (*_gray_pixelfuncs[4])(int x, int y, unsigned long pattern) = { | 37 | void (* 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 | */ |
37 | void gray_putsxy(int x, int y, unsigned char *str) | 37 | void 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 | ||
32 | static unsigned char bmpheader[] = | 32 | static 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, |