void blockcpy_or(void *dst, void *src, size_t n, int pat)\r
{\r
unsigned char *pd = dst, *ps = src;\r
- for (; n; n--)\r
- *pd++ = (unsigned char) (*ps++ | pat);\r
+ if (dst > src) {\r
+ for (pd += n, ps += n; n; n--)\r
+ *--pd = (unsigned char) (*--ps | pat);\r
+ } else\r
+ for (; n; n--)\r
+ *pd++ = (unsigned char) (*ps++ | pat);\r
}\r
#define blockcpy memmove\r
#endif\r
{\r
case PDF_8BIT:\r
FinalizeLine = FinalizeLine8bit;\r
- PicoDrawSetInternalBuf(Pico.est.Draw2FB, 328);\r
break;\r
\r
case PDF_RGB555:\r
\r
blockcpy:\r
stmfd sp!, {r4,r5}\r
+ cmp r0, r1\r
+ bhs blockcpyhi\r
+\r
mov r2, r2, lsr #4\r
blockcpy_loop:\r
ldmia r1!, {r3-r5,r12}\r
ldmfd sp!, {r4,r5}\r
bx lr\r
\r
+blockcpyhi:\r
+ add r0, r0, r2\r
+ add r1, r1, r2\r
+ mov r2, r2, lsr #4\r
+blockcpyhi_loop:\r
+ ldmdb r1!, {r3-r5,r12}\r
+ subs r2, r2, #1\r
+ stmdb r0!, {r3-r5,r12}\r
+ bne blockcpyhi_loop\r
+ ldmfd sp!, {r4,r5}\r
+ bx lr\r
+\r
\r
.global blockcpy_or @ void *dst, void *src, size_t n, int pat\r
\r
stmfd sp!, {r4-r6}\r
orr r3, r3, r3, lsl #8\r
orr r3, r3, r3, lsl #16\r
+ cmp r0, r1\r
+ bhs blockcpyhi_or\r
+\r
mov r2, r2, lsr #4\r
blockcpy_loop_or:\r
ldmia r1!, {r4-r6,r12}\r
ldmfd sp!, {r4-r6}\r
bx lr\r
\r
+blockcpyhi_or:\r
+ add r0, r0, r2\r
+ add r1, r1, r2\r
+ mov r2, r2, lsr #4\r
+blockcpyhi_loop_or:\r
+ ldmdb r1!, {r4-r6,r12}\r
+ subs r2, r2, #1\r
+ orr r4, r4, r3\r
+ orr r5, r5, r3\r
+ orr r6, r6, r3\r
+ orr r12,r12,r3\r
+ stmdb r0!, {r4-r6,r12}\r
+ bne blockcpyhi_loop_or\r
+ ldmfd sp!, {r4-r6}\r
+ bx lr\r
+\r
@ vim:filetype=armasm\r