diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/jpeg.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c index 4a20da1a55..d574bdada8 100644 --- a/apps/plugins/jpeg.c +++ b/apps/plugins/jpeg.c | |||
@@ -172,6 +172,16 @@ INLINE unsigned range_limit(int value) | |||
172 | [v]"+r"(value) | 172 | [v]"+r"(value) |
173 | ); | 173 | ); |
174 | return value; | 174 | return value; |
175 | #elif defined(CPU_ARM) | ||
176 | asm ( | ||
177 | "adds %[v], %[v], #128\n" /* value += 128 */ | ||
178 | "movmi %[v], #0 \n" /* clip to 0 if negative result */ | ||
179 | "cmp %[v], #255 \n" /* did we exceed 255? */ | ||
180 | "movgt %[v], #255 \n" /* yes, clip to limit */ | ||
181 | : | ||
182 | [v]"+r"(value) | ||
183 | ); | ||
184 | return value; | ||
175 | #else | 185 | #else |
176 | value += 128; | 186 | value += 128; |
177 | 187 | ||
@@ -2062,8 +2072,8 @@ int scroll_bmp(struct t_disp* pdisp) | |||
2062 | switch(button) | 2072 | switch(button) |
2063 | { | 2073 | { |
2064 | case JPEG_LEFT: | 2074 | case JPEG_LEFT: |
2065 | if (!(ds < ds_max) && entries > 0 && jpg.x_size <= MAX_X_SIZE) | 2075 | if (!(ds < ds_max) && entries > 0 && jpg.x_size <= MAX_X_SIZE) |
2066 | return change_filename(DIR_PREV); | 2076 | return change_filename(DIR_PREV); |
2067 | case JPEG_LEFT | BUTTON_REPEAT: | 2077 | case JPEG_LEFT | BUTTON_REPEAT: |
2068 | move = MIN(HSCROLL, pdisp->x); | 2078 | move = MIN(HSCROLL, pdisp->x); |
2069 | if (move > 0) | 2079 | if (move > 0) |