summaryrefslogtreecommitdiff
path: root/apps/plugins/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib')
-rw-r--r--apps/plugins/lib/gray_core.c5
-rw-r--r--apps/plugins/lib/gray_draw.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/apps/plugins/lib/gray_core.c b/apps/plugins/lib/gray_core.c
index f08189dbc2..e65a7f259e 100644
--- a/apps/plugins/lib/gray_core.c
+++ b/apps/plugins/lib/gray_core.c
@@ -690,9 +690,8 @@ void gray_update_rect(int x, int y, int width, int height)
"ldr r2, [%[bpat], r0, lsl #2] \n" /* r2 = bitpattern[byte]; */
- "add r0, %[rnd], %[rnd], lsl #3 \n" /* multiply by 75 */
- "add %[rnd], %[rnd], %[rnd], lsl #1 \n"
- "add %[rnd], %[rnd], r0, lsl #3 \n"
+ "add %[rnd], %[rnd], %[rnd], lsl #2 \n" /* multiply by 75 */
+ "rsb %[rnd], %[rnd], %[rnd], lsl #4 \n"
"add %[rnd], %[rnd], #74 \n" /* add another 74 */
/* Since the lower bits are not very random: get bits 8..15 (need max. 5) */
"and r1, %[rmsk], %[rnd], lsr #8 \n" /* ..and mask out unneeded bits */
diff --git a/apps/plugins/lib/gray_draw.c b/apps/plugins/lib/gray_draw.c
index 7df3e13c56..9406664ea2 100644
--- a/apps/plugins/lib/gray_draw.c
+++ b/apps/plugins/lib/gray_draw.c
@@ -898,9 +898,8 @@ static void _writearray(unsigned char *address, const unsigned char *src,
"ldrb r0, [%[trns], r0] \n" /* idxtable into pattern index */
"ldr r2, [%[bpat], r0, lsl #2] \n" /* r2 = bitpattern[byte]; */
- "add r0, %[rnd], %[rnd], lsl #3 \n" /* multiply by 75 */
- "add %[rnd], %[rnd], %[rnd], lsl #1 \n"
- "add %[rnd], %[rnd], r0, lsl #3 \n"
+ "add %[rnd], %[rnd], %[rnd], lsl #2 \n" /* multiply by 75 */
+ "rsb %[rnd], %[rnd], %[rnd], lsl #4 \n"
"add %[rnd], %[rnd], #74 \n" /* add another 74 */
/* Since the lower bits are not very random: get bits 8..15 (need max. 5) */
"and r1, %[rmsk], %[rnd], lsr #8 \n" /* ..and mask out unneeded bits */