summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S')
-rw-r--r--firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S76
1 files changed, 76 insertions, 0 deletions
diff --git a/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S b/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S
index add9f694de..9d23d18e2d 100644
--- a/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S
+++ b/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S
@@ -8,6 +8,7 @@
8 * $Id:$ 8 * $Id:$
9 * 9 *
10 * Copyright (C) 2010 Marcin Bukat 10 * Copyright (C) 2010 Marcin Bukat
11 * based on lcd-as-m3.S by Jens Arnold
11 * 12 *
12 * This program is free software; you can redistribute it and/or 13 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License 14 * modify it under the terms of the GNU General Public License
@@ -99,5 +100,80 @@ lcd_write_data:
99 100
100.write_end: 101.write_end:
101 rts 102 rts
103.wd_end:
102 .size lcd_write_data,.wd_end-lcd_write_data 104 .size lcd_write_data,.wd_end-lcd_write_data
103 105
106 .global lcd_mono_data
107 .type lcd_mono_data, @function
108
109lcd_mono_data:
110 move.l (4, %sp), %a0 /* p_bytes */
111 move.l (8, %sp), %d0 /* count */
112 lea.l LCD_BASE_ADDRESS+2, %a1 /* LCD data port address */
113
114.md_loop:
115 move.b (%a0)+, %d1
116 move.w %d1, (%a1) /* byte transfers actually */
117 move.w %d1, (%a1)
118 subq.l #1, %d0
119 bne.s .md_loop
120 rts
121.md_end:
122 .size lcd_mono_data,.md_end-lcd_mono_data
123
124 .global lcd_grey_data
125 .type lcd_grey_data,@function
126
127lcd_grey_data:
128 lea.l (-2*4, %sp), %sp
129 movem.l %a2-%a3, (%sp)
130 movem.l (2*4+4, %sp), %a0-%a2 /* values, phases, length */
131 add.l %a2, %a2
132 lea.l (%a1, %a2.l*4), %a2 /* end address */
133 lea.l LCD_BASE_ADDRESS+2, %a3 /* LCD data port address */
134.ph_loop:
135 clr.l %d1
136 move.l (%a1), %d0 /* fetch 4 pixel phases */
137 bclr.l #31, %d0 /* Z = !(p0 & 0x80); p0 &= ~0x80; */
138 seq.b %d1 /* %d1 = ........................00000000 */
139 lsl.l #1, %d1 /* %d1 = .......................00000000. */
140 bclr.l #23, %d0 /* Z = !(p1 & 0x80); p1 &= ~0x80; */
141 seq.b %d1 /* %d1 = .......................011111111 */
142 lsl.l #1, %d1 /* %d1 = ......................011111111. */
143 bclr.l #15, %d0 /* Z = !(p2 & 0x80); p2 &= ~0x80; */
144 seq.b %d1 /* %d1 = ......................0122222222 */
145 lsl.l #1, %d1 /* %d1 = .....................0122222222. */
146 bclr.l #7, %d0 /* Z = !(p3 & 0x80); p3 &= ~0x80; */
147 seq.b %d1 /* %d1 = .....................01233333333 */
148 lsl.l #1, %d1 /* %d1 = ....................01233333333. */
149 add.l (%a0)+, %d0 /* add 4 pixel values to the phases */
150 move.l %d0, (%a1)+ /* store new phases, advance pointer */
151
152 clr.l %d1
153 move.l (%a1), %d0 /* fetch 4 pixel phases */
154 bclr.l #31, %d0 /* Z = !(p0 & 0x80); p0 &= ~0x80; */
155 seq.b %d1 /* %d1 = ....................012344444444 */
156 lsl.l #1, %d1 /* %d1 = ...................012344444444. */
157 bclr.l #23, %d0 /* Z = !(p1 & 0x80); p1 &= ~0x80; */
158 seq.b %d1 /* %d1 = ...................0123455555555 */
159 lsl.l #1, %d1 /* %d1 = ..................0123455555555. */
160 bclr.l #15, %d0 /* Z = !(p2 & 0x80); p2 &= ~0x80; */
161 seq.b %d1 /* %d1 = ..................01234566666666 */
162 lsl.l #1, %d1 /* %d1 = .................01234566666666. */
163 bclr.l #7, %d0 /* Z = !(p3 & 0x80); p3 &= ~0x80; */
164 seq.b %d1 /* %d1 = .................012345677777777 */
165 lsr.l #7, %d1 /* %d1 = ........................01234567 */
166 add.l (%a0)+, %d0 /* add 4 pixel values to the phases */
167 move.l %d0, (%a1)+ /* store new phases, advance pointer */
168
169 move.w %d1, (%a3) /* transfer to lcd */
170 move.w %d1, (%a3) /* transfer to lcd */
171
172 cmp.l %a2, %a1
173 bls .ph_loop
174
175 movem.l (%sp), %a2-%a3
176 lea.l (2*4, %sp), %sp
177 rts
178.grey_end:
179 .size lcd_grey_data,.grey_end-lcd_grey_data