summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2010-04-30 14:13:52 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2010-04-30 14:13:52 +0000
commit88baa4d4c7c14c053998cb302e327920ac118256 (patch)
tree1a2ad9f3d76eb3b44b57c80464f478425dab1fff
parent572ac53359776eb962bd8c76c2d451fcd1f515f6 (diff)
downloadrockbox-88baa4d4c7c14c053998cb302e327920ac118256.tar.gz
rockbox-88baa4d4c7c14c053998cb302e327920ac118256.zip
HD200 - implement blit functions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25767 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/test_scanrate.c3
-rw-r--r--firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S76
-rw-r--r--firmware/target/coldfire/mpio/hd200/lcd-hd200.c60
3 files changed, 120 insertions, 19 deletions
diff --git a/apps/plugins/test_scanrate.c b/apps/plugins/test_scanrate.c
index fb59193272..1aa9febf30 100644
--- a/apps/plugins/test_scanrate.c
+++ b/apps/plugins/test_scanrate.c
@@ -89,6 +89,9 @@ PLUGIN_HEADER
89#define DEFAULT_SCAN_RATE 1500 89#define DEFAULT_SCAN_RATE 1500
90#define HORIZ_SCAN /* LCD controller updates the panel sideways */ 90#define HORIZ_SCAN /* LCD controller updates the panel sideways */
91#define NEED_BOOST 91#define NEED_BOOST
92#elif defined MPIO_HD200
93#define DEFAULT_SCAN_RATE 1460
94#define NEED_BOOST
92#elif defined IAUDIO_M5 95#elif defined IAUDIO_M5
93#define DEFAULT_SCAN_RATE 730 96#define DEFAULT_SCAN_RATE 730
94#elif defined IPOD_1G2G 97#elif defined IPOD_1G2G
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
diff --git a/firmware/target/coldfire/mpio/hd200/lcd-hd200.c b/firmware/target/coldfire/mpio/hd200/lcd-hd200.c
index 8cb9e8e087..f3e9eef03b 100644
--- a/firmware/target/coldfire/mpio/hd200/lcd-hd200.c
+++ b/firmware/target/coldfire/mpio/hd200/lcd-hd200.c
@@ -215,27 +215,49 @@ void lcd_update_rect(int x, int y, int width, int height)
215 215
216} 216}
217 217
218void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases, 218/* Helper function. */
219 int x, int by, int width, int bheight, int stride) 219void lcd_mono_data(const unsigned char *data, int count);
220{
221 (void)values;
222 (void)phases;
223 (void)x;
224 (void)by;
225 (void)width;
226 (void)bheight;
227 (void)stride;
228 /* empty stub */
229}
230 220
221/* Performance function that works with an external buffer
222 note that by and bheight are in 8-pixel units! */
231void lcd_blit_mono(const unsigned char *data, int x, int by, int width, 223void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
232 int bheight, int stride) 224 int bheight, int stride)
233{ 225{
234 (void)data; 226 if (lcd_initialized)
235 (void)x; 227 {
236 (void)by; 228 while (bheight--)
237 (void)width; 229 {
238 (void)bheight; 230 lcd_write_command(LCD_SET_PAGE | (by & 0xf));
239 (void)stride; 231 lcd_write_command_e(LCD_SET_COLUMN | ((x >> 4) & 0xf), x & 0xf);
240 /* empty stub */ 232
233 lcd_mono_data(data, width);
234 data += stride;
235 by++;
236 }
237 }
241} 238}
239
240/* Helper function for lcd_grey_phase_blit(). */
241void lcd_grey_data(unsigned char *values, unsigned char *phases, int count);
242
243/* Performance function that works with an external buffer
244 note that by and bheight are in 8-pixel units! */
245void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
246 int x, int by, int width, int bheight, int stride)
247{
248 if (lcd_initialized)
249 {
250 stride <<= 3; /* 8 pixels per block */
251 while (bheight--)
252 {
253 lcd_write_command(LCD_SET_PAGE | (by & 0xf));
254 lcd_write_command_e(LCD_SET_COLUMN | ((x >> 4) & 0xf), x & 0xf);
255
256 lcd_grey_data(values, phases, width);
257 values += stride;
258 phases += stride;
259 by++;
260 }
261 }
262}
263