summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/imageviewer')
-rw-r--r--apps/plugins/imageviewer/imageviewer_button.h27
-rw-r--r--apps/plugins/imageviewer/jpeg/jpeg_decoder.c18
2 files changed, 3 insertions, 42 deletions
diff --git a/apps/plugins/imageviewer/imageviewer_button.h b/apps/plugins/imageviewer/imageviewer_button.h
index dfdd39ffa4..46813d5e69 100644
--- a/apps/plugins/imageviewer/imageviewer_button.h
+++ b/apps/plugins/imageviewer/imageviewer_button.h
@@ -25,31 +25,8 @@
25#include "plugin.h" 25#include "plugin.h"
26 26
27/* variable button definitions */ 27/* variable button definitions */
28#if CONFIG_KEYPAD == RECORDER_PAD 28#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
29#define IMGVIEW_ZOOM_IN BUTTON_PLAY 29 (CONFIG_KEYPAD == IRIVER_H300_PAD)
30#define IMGVIEW_ZOOM_OUT BUTTON_ON
31#define IMGVIEW_UP BUTTON_UP
32#define IMGVIEW_DOWN BUTTON_DOWN
33#define IMGVIEW_LEFT BUTTON_LEFT
34#define IMGVIEW_RIGHT BUTTON_RIGHT
35#define IMGVIEW_NEXT BUTTON_F3
36#define IMGVIEW_PREVIOUS BUTTON_F2
37#define IMGVIEW_MENU BUTTON_OFF
38
39#elif CONFIG_KEYPAD == ONDIO_PAD
40#define IMGVIEW_ZOOM_PRE BUTTON_MENU
41#define IMGVIEW_ZOOM_IN (BUTTON_MENU | BUTTON_REL)
42#define IMGVIEW_ZOOM_OUT (BUTTON_MENU | BUTTON_DOWN)
43#define IMGVIEW_UP BUTTON_UP
44#define IMGVIEW_DOWN BUTTON_DOWN
45#define IMGVIEW_LEFT BUTTON_LEFT
46#define IMGVIEW_RIGHT BUTTON_RIGHT
47#define IMGVIEW_NEXT (BUTTON_MENU | BUTTON_RIGHT)
48#define IMGVIEW_PREVIOUS (BUTTON_MENU | BUTTON_LEFT)
49#define IMGVIEW_MENU BUTTON_OFF
50
51#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
52 (CONFIG_KEYPAD == IRIVER_H300_PAD)
53#define IMGVIEW_ZOOM_IN BUTTON_SELECT 30#define IMGVIEW_ZOOM_IN BUTTON_SELECT
54#define IMGVIEW_ZOOM_OUT BUTTON_MODE 31#define IMGVIEW_ZOOM_OUT BUTTON_MODE
55#define IMGVIEW_UP BUTTON_UP 32#define IMGVIEW_UP BUTTON_UP
diff --git a/apps/plugins/imageviewer/jpeg/jpeg_decoder.c b/apps/plugins/imageviewer/jpeg/jpeg_decoder.c
index 342b59c6a4..b014fa0ed1 100644
--- a/apps/plugins/imageviewer/jpeg/jpeg_decoder.c
+++ b/apps/plugins/imageviewer/jpeg/jpeg_decoder.c
@@ -39,23 +39,7 @@
39 39
40INLINE unsigned range_limit(int value) 40INLINE unsigned range_limit(int value)
41{ 41{
42#if CONFIG_CPU == SH7034 42#if defined(CPU_COLDFIRE)
43 unsigned tmp;
44 asm ( /* Note: Uses knowledge that only low byte of result is used */
45 "mov #-128,%[t] \n"
46 "sub %[t],%[v] \n" /* value -= -128; equals value += 128; */
47 "extu.b %[v],%[t] \n"
48 "cmp/eq %[v],%[t] \n" /* low byte == whole number ? */
49 "bt 1f \n" /* yes: no overflow */
50 "cmp/pz %[v] \n" /* overflow: positive? */
51 "subc %[v],%[v] \n" /* %[r] now either 0 or 0xffffffff */
52 "1: \n"
53 : /* outputs */
54 [v]"+r"(value),
55 [t]"=&r"(tmp)
56 );
57 return value;
58#elif defined(CPU_COLDFIRE)
59 asm ( /* Note: Uses knowledge that only the low byte of the result is used */ 43 asm ( /* Note: Uses knowledge that only the low byte of the result is used */
60 "add.l #128,%[v] \n" /* value += 128; */ 44 "add.l #128,%[v] \n" /* value += 128; */
61 "cmp.l #255,%[v] \n" /* overflow? */ 45 "cmp.l #255,%[v] \n" /* overflow? */