diff options
Diffstat (limited to 'firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S')
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S b/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S new file mode 100644 index 0000000000..43ae3c5c6b --- /dev/null +++ b/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S | |||
@@ -0,0 +1,115 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Jens Arnold | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include "config.h" | ||
21 | #include "cpu.h" | ||
22 | |||
23 | .text | ||
24 | .align 2 | ||
25 | |||
26 | |||
27 | .global lcd_write_data | ||
28 | .type lcd_write_data,%function | ||
29 | |||
30 | lcd_write_data: | ||
31 | str lr, [sp, #-4]! | ||
32 | ldr lr, =LCD1_BASE | ||
33 | |||
34 | .loop: | ||
35 | ldrb r2, [r0], #1 | ||
36 | 1: | ||
37 | ldr r3, [lr] | ||
38 | tst r3, #LCD1_BUSY_MASK | ||
39 | bne 1b | ||
40 | str r2, [lr, #0x10] | ||
41 | |||
42 | subs r1, r1, #1 | ||
43 | bne .loop | ||
44 | |||
45 | ldr pc, [sp], #4 | ||
46 | .size lcd_write_data,.-lcd_write_data | ||
47 | |||
48 | |||
49 | .global lcd_grey_data | ||
50 | .type lcd_grey_data,%function | ||
51 | |||
52 | /* A high performance function to write grey phase data to the display, | ||
53 | * one or multiple pixels. | ||
54 | * | ||
55 | * Arguments: | ||
56 | * r0 - pixel value data address | ||
57 | * r1 - pixel phase data address | ||
58 | * r2 - pixel block count | ||
59 | * | ||
60 | * Register usage: | ||
61 | * r3/r4 - current block of phases | ||
62 | * r5/r6 - current block of values | ||
63 | * r7 - lcd data accumulator | ||
64 | * r8 - phase signs mask | ||
65 | * lr - lcd bridge address | ||
66 | */ | ||
67 | |||
68 | lcd_grey_data: | ||
69 | stmfd sp!, {r4-r8, lr} | ||
70 | mov r8, #0x80 | ||
71 | orr r8, r8, r8, lsl #8 | ||
72 | orr r8, r8, r8, lsl #16 | ||
73 | ldr lr, =LCD1_BASE | ||
74 | |||
75 | .greyloop: | ||
76 | ldmia r1, {r3-r4} /* Fetch 8 pixel phases */ | ||
77 | ldmia r0!, {r5-r6} /* Fetch 8 pixel values */ | ||
78 | |||
79 | mov r7, #0xff | ||
80 | tst r3, #0x80 | ||
81 | biceq r7, r7, #0x80 | ||
82 | tst r3, #0x8000 | ||
83 | biceq r7, r7, #0x40 | ||
84 | tst r3, #0x800000 | ||
85 | biceq r7, r7, #0x20 | ||
86 | tst r3, #0x80000000 | ||
87 | biceq r7, r7, #0x10 | ||
88 | bic r3, r3, r8 | ||
89 | add r3, r3, r5 | ||
90 | |||
91 | tst r4, #0x80 | ||
92 | biceq r7, r7, #0x08 | ||
93 | tst r4, #0x8000 | ||
94 | biceq r7, r7, #0x04 | ||
95 | tst r4, #0x800000 | ||
96 | biceq r7, r7, #0x02 | ||
97 | tst r4, #0x80000000 | ||
98 | biceq r7, r7, #0x01 | ||
99 | bic r4, r4, r8 | ||
100 | add r4, r4, r6 | ||
101 | |||
102 | stmia r1!, {r3-r4} | ||
103 | |||
104 | 1: | ||
105 | ldr r5, [lr] | ||
106 | tst r5, #LCD1_BUSY_MASK | ||
107 | bne 1b | ||
108 | str r7, [lr, #0x10] | ||
109 | |||
110 | subs r2, r2, #1 | ||
111 | bne .greyloop | ||
112 | |||
113 | ldmfd sp!, {r4-r8, pc} | ||
114 | .size lcd_grey_data,.-lcd_grey_data | ||
115 | |||