Index: embios/trunk/target/ipodnano2g/lcd.S |
— | — | @@ -26,11 +26,14 @@ |
27 | 27 | .global lcd_init
|
28 | 28 | .type lcd_init, %function
|
29 | 29 | lcd_init:
|
30 | | - mov r1, #0x38000000
|
31 | | - orr r1, r1, #0x400000
|
| 30 | + mov r1, #0x38400000
|
32 | 31 | mov r0, #0x20000000
|
33 | | - orr r0, r0, #0x190000
|
| 32 | + orr r0, r0, #0x590000
|
34 | 33 | str r0, [r1,#0x104]
|
| 34 | + orr r1, r1, #0x200000
|
| 35 | + ldr r0, [r1]
|
| 36 | + orr r0, r0, #0x100
|
| 37 | + str r0, [r1]
|
35 | 38 | mov pc, lr
|
36 | 39 | .size lcd_init, .-lcd_init
|
37 | 40 |
|
— | — | @@ -51,46 +54,46 @@ |
52 | 55 | b lcd_shutdown_done
|
53 | 56 | lcd_shutdown_type2:
|
54 | 57 | mov r0, #0x07
|
55 | | - bl displaylcd_sendlcd2c
|
| 58 | + bl displaylcd_sendlcdc
|
56 | 59 | mov r0, #0x200
|
57 | 60 | orr r0, r0, #0x32
|
58 | | - bl displaylcd_sendlcd2d
|
| 61 | + bl displaylcd_sendlcdd
|
59 | 62 | mov r0, #0x13
|
60 | | - bl displaylcd_sendlcd2c
|
| 63 | + bl displaylcd_sendlcdc
|
61 | 64 | mov r0, #0x1100
|
62 | 65 | orr r0, #0x37
|
63 | | - bl displaylcd_sendlcd2d
|
| 66 | + bl displaylcd_sendlcdd
|
64 | 67 | mov r0, #0x07
|
65 | | - bl displaylcd_sendlcd2c
|
| 68 | + bl displaylcd_sendlcdc
|
66 | 69 | mov r0, #0x200
|
67 | 70 | orr r0, r0, #0x01
|
68 | | - bl displaylcd_sendlcd2d
|
| 71 | + bl displaylcd_sendlcdd
|
69 | 72 | mov r0, #0x13
|
70 | | - bl displaylcd_sendlcd2c
|
| 73 | + bl displaylcd_sendlcdc
|
71 | 74 | mov r0, #0x100
|
72 | 75 | orr r0, #0x37
|
73 | | - bl displaylcd_sendlcd2d
|
| 76 | + bl displaylcd_sendlcdd
|
74 | 77 | mov r0, #0x07
|
75 | | - bl displaylcd_sendlcd2c
|
| 78 | + bl displaylcd_sendlcdc
|
76 | 79 | mov r0, #0x200
|
77 | | - bl displaylcd_sendlcd2d
|
| 80 | + bl displaylcd_sendlcdd
|
78 | 81 | mov r0, #0x10
|
79 | | - bl displaylcd_sendlcd2c
|
| 82 | + bl displaylcd_sendlcdc
|
80 | 83 | mov r0, #0x680
|
81 | | - bl displaylcd_sendlcd2d
|
| 84 | + bl displaylcd_sendlcdd
|
82 | 85 | mov r0, #0x12
|
83 | | - bl displaylcd_sendlcd2c
|
| 86 | + bl displaylcd_sendlcdc
|
84 | 87 | mov r0, #0x160
|
85 | | - bl displaylcd_sendlcd2d
|
| 88 | + bl displaylcd_sendlcdd
|
86 | 89 | mov r0, #0x13
|
87 | | - bl displaylcd_sendlcd2c
|
| 90 | + bl displaylcd_sendlcdc
|
88 | 91 | mov r0, #0x100
|
89 | 92 | orr r0, r0, #0x27
|
90 | | - bl displaylcd_sendlcd2d
|
| 93 | + bl displaylcd_sendlcdd
|
91 | 94 | mov r0, #0x10
|
92 | | - bl displaylcd_sendlcd2c
|
| 95 | + bl displaylcd_sendlcdc
|
93 | 96 | mov r0, #0x600
|
94 | | - bl displaylcd_sendlcd2d
|
| 97 | + bl displaylcd_sendlcdd
|
95 | 98 | lcd_shutdown_done:
|
96 | 99 | ldmfd sp!, {r4, lr}
|
97 | 100 | mov r0, #5120
|
— | — | @@ -129,7 +132,7 @@ |
130 | 133 | .global displaylcd
|
131 | 134 | .type displaylcd, %function
|
132 | 135 | displaylcd:
|
133 | | - stmfd sp!, {r0-r4,lr}
|
| 136 | + stmfd sp!, {r0-r5,lr}
|
134 | 137 | bl displaylcd_sync
|
135 | 138 | bl displaylcd_detectlcd
|
136 | 139 | sub r12, r12, #0x04900000
|
— | — | @@ -136,45 +139,45 @@ |
137 | 140 | cmp r0, #2
|
138 | 141 | bne displaylcd_othertypes
|
139 | 142 | mov r0, #0x50
|
140 | | - bl displaylcd_sendlcd2c
|
| 143 | + bl displaylcd_sendlcdc
|
141 | 144 | ldr r0, [sp]
|
142 | | - bl displaylcd_sendlcd2d
|
| 145 | + bl displaylcd_sendlcdd
|
143 | 146 | mov r0, #0x51
|
144 | | - bl displaylcd_sendlcd2c
|
| 147 | + bl displaylcd_sendlcdc
|
145 | 148 | ldr r0, [sp,#0x04]
|
146 | | - bl displaylcd_sendlcd2d
|
| 149 | + bl displaylcd_sendlcdd
|
147 | 150 | mov r0, #0x52
|
148 | | - bl displaylcd_sendlcd2c
|
| 151 | + bl displaylcd_sendlcdc
|
149 | 152 | ldr r0, [sp,#0x08]
|
150 | | - bl displaylcd_sendlcd2d
|
| 153 | + bl displaylcd_sendlcdd
|
151 | 154 | mov r0, #0x53
|
152 | | - bl displaylcd_sendlcd2c
|
| 155 | + bl displaylcd_sendlcdc
|
153 | 156 | ldr r0, [sp,#0x0c]
|
154 | | - bl displaylcd_sendlcd2d
|
| 157 | + bl displaylcd_sendlcdd
|
155 | 158 | mov r0, #0x20
|
156 | | - bl displaylcd_sendlcd2c
|
| 159 | + bl displaylcd_sendlcdc
|
157 | 160 | ldr r0, [sp]
|
158 | | - bl displaylcd_sendlcd2d
|
| 161 | + bl displaylcd_sendlcdd
|
159 | 162 | mov r0, #0x21
|
160 | | - bl displaylcd_sendlcd2c
|
| 163 | + bl displaylcd_sendlcdc
|
161 | 164 | ldr r0, [sp,#0x08]
|
162 | | - bl displaylcd_sendlcd2d
|
| 165 | + bl displaylcd_sendlcdd
|
163 | 166 | mov r0, #0x22
|
164 | | - bl displaylcd_sendlcd2c
|
| 167 | + bl displaylcd_sendlcdc
|
165 | 168 | b displaylcd_blit
|
166 | 169 | displaylcd_othertypes:
|
167 | 170 | mov r0, #0x2a
|
168 | 171 | bl displaylcd_sendlcdc
|
169 | 172 | ldr r0, [sp]
|
170 | | - bl displaylcd_sendlcd2d
|
| 173 | + bl displaylcd_sendlcdd
|
171 | 174 | ldr r0, [sp,#0x04]
|
172 | | - bl displaylcd_sendlcd2d
|
| 175 | + bl displaylcd_sendlcdd
|
173 | 176 | mov r0, #0x2b
|
174 | 177 | bl displaylcd_sendlcdc
|
175 | 178 | ldr r0, [sp,#0x08]
|
176 | | - bl displaylcd_sendlcd2d
|
| 179 | + bl displaylcd_sendlcdd
|
177 | 180 | ldr r0, [sp,#0x0c]
|
178 | | - bl displaylcd_sendlcd2d
|
| 181 | + bl displaylcd_sendlcdd
|
179 | 182 | mov r0, #0x2c
|
180 | 183 | bl displaylcd_sendlcdc
|
181 | 184 | displaylcd_blit:
|
— | — | @@ -183,56 +186,61 @@ |
184 | 187 | add r1, r1, #1
|
185 | 188 | sub r3, r2
|
186 | 189 | add r3, r3, #1
|
187 | | - mul r2, r1, r3
|
188 | | - ldr r1, [sp,#0x18]
|
| 190 | + mul r5, r1, r3
|
| 191 | + ldr r1, [sp,#0x1c]
|
| 192 | + add r12, r12, #0x40
|
| 193 | +displaylcd_wait:
|
| 194 | + ldr r4, [r12,#-0x24]
|
| 195 | + tst r4, #8
|
| 196 | + bne displaylcd_wait
|
189 | 197 | cmp r1, #-1
|
190 | 198 | bne displaylcd_dma
|
| 199 | + ldr r0, [sp,#0x20]
|
| 200 | + movs r4, r5,lsl#31
|
| 201 | + mov r1, r0
|
| 202 | + stmcsia r12, {r0-r1}
|
| 203 | + mov r2, r0
|
| 204 | + strne r0, [r12]
|
| 205 | + mov r3, r0
|
191 | 206 | displaylcd_pixel:
|
192 | | - ldr r0, [sp,#0x1c]
|
193 | | - bl displaylcd_sendlcd2d
|
194 | | - subs r2, r2, #1
|
| 207 | + ldr r4, [r12,#-0x24]
|
| 208 | + tst r4, #8
|
195 | 209 | bne displaylcd_pixel
|
196 | | - ldmfd sp!, {r0-r4,pc}
|
| 210 | + subs r5, r5, #4
|
| 211 | + stmcsia r12, {r0-r3}
|
| 212 | + bhi displaylcd_pixel
|
| 213 | + ldmfd sp!, {r0-r5,pc}
|
197 | 214 | displaylcd_dma:
|
198 | | - mov r4, #0x38000000
|
199 | | - orr r4, r4, #0x400000
|
| 215 | + movs r4, r5,lsl#31
|
| 216 | + mov r4, #0x38400000
|
| 217 | + ldrcsh r2, [r1], #2
|
200 | 218 | mov r0, #0x20000000
|
201 | | - orr r0, r0, #0x190000
|
| 219 | + ldrcsh r3, [r1], #2
|
| 220 | + orr r0, r0, #0x590000
|
| 221 | + stmcsia r12, {r2-r3}
|
| 222 | + mov r3, r5,lsr#2
|
| 223 | + ldrneh r2, [r1], #2
|
| 224 | + sub r3, r3, #1
|
| 225 | + str r1, [r4,#0x100]
|
202 | 226 | str r0, [r4,#0x104]
|
203 | | - str r1, [r4,#0x100]
|
204 | | - mov r0, r2,lsr#1
|
205 | | - sub r0, r0, #1
|
206 | | - str r0, [r4,#0x108]
|
| 227 | + str r3, [r4,#0x108]
|
| 228 | + strne r2, [r12]
|
207 | 229 | bl clean_dcache
|
208 | 230 | mov r0, #4
|
209 | 231 | str r0, [r4,#0x114]
|
210 | | - ldmfd sp!, {r0-r4,pc}
|
| 232 | + ldmfd sp!, {r0-r5,pc}
|
211 | 233 |
|
212 | | -displaylcd_sendlcd2c:
|
| 234 | +displaylcd_sendlcdc:
|
213 | 235 | ldr r4, [r12,#0x1c]
|
214 | 236 | tst r4, #0x10
|
215 | | - bne displaylcd_sendlcd2c
|
216 | | - mov r4, r0,lsr#8
|
217 | | - str r4, [r12,#0x04]
|
218 | | - and r0, r0, #0xff
|
219 | | -displaylcd_sendlcdc:
|
220 | | - ldrh r4, [r12,#0x1c]
|
221 | | - tst r4, #0x10
|
222 | 237 | bne displaylcd_sendlcdc
|
223 | | - strh r0, [r12,#0x04]
|
| 238 | + str r0, [r12,#0x04]
|
224 | 239 | mov pc, lr
|
225 | | -displaylcd_sendlcd2d:
|
226 | | - ldrh r4, [r12,#0x1c]
|
227 | | - tst r4, #0x10
|
228 | | - bne displaylcd_sendlcd2d
|
229 | | - mov r4, r0,lsr#8
|
230 | | - strh r4, [r12,#0x40]
|
231 | | - and r0, r0, #0xff
|
232 | 240 | displaylcd_sendlcdd:
|
233 | | - ldrh r4, [r12,#0x1c]
|
| 241 | + ldr r4, [r12,#0x1c]
|
234 | 242 | tst r4, #0x10
|
235 | 243 | bne displaylcd_sendlcdd
|
236 | | - strh r0, [r12,#0x40]
|
| 244 | + str r0, [r12,#0x40]
|
237 | 245 | mov pc, lr
|
238 | 246 |
|
239 | 247 | displaylcd_detectlcd:
|
— | — | @@ -260,8 +268,7 @@ |
261 | 269 | displaylcd_sync:
|
262 | 270 | str lr, [sp,#-4]!
|
263 | 271 | displaylcd_sync_wait:
|
264 | | - mov r1, #0x38000000
|
265 | | - orr r1, r1, #0x400000
|
| 272 | + mov r1, #0x38400000
|
266 | 273 | ldr r0, [r1,#0x184]
|
267 | 274 | tst r0, #0x70000
|
268 | 275 | ldreq pc, [sp], #4
|
— | — | @@ -274,8 +281,7 @@ |
275 | 282 | .global displaylcd_busy
|
276 | 283 | .type displaylcd_busy, %function
|
277 | 284 | displaylcd_busy:
|
278 | | - mov r1, #0x38000000
|
279 | | - orr r1, r1, #0x400000
|
| 285 | + mov r1, #0x38400000
|
280 | 286 | ldr r0, [r1,#0x184]
|
281 | 287 | and r0, r0, #0x70000
|
282 | 288 | mov pc, lr
|
— | — | @@ -286,8 +292,7 @@ |
287 | 293 | .global displaylcd_safe
|
288 | 294 | .type displaylcd_safe, %function
|
289 | 295 | displaylcd_safe:
|
290 | | - mov r1, #0x38000000
|
291 | | - orr r1, r1, #0x400000
|
| 296 | + mov r1, #0x38400000
|
292 | 297 | ldr r0, [r1,#0x184]
|
293 | 298 | tst r0, #0x70000
|
294 | 299 | moveq r0, #1
|
— | — | @@ -301,8 +306,7 @@ |
302 | 307 | .type INT_DMA8, %function
|
303 | 308 | INT_DMA8:
|
304 | 309 | str lr, [sp,#-4]!
|
305 | | - mov r1, #0x38000000
|
306 | | - orr r1, r1, #0x400000
|
| 310 | + mov r1, #0x38400000
|
307 | 311 | mov r0, #7
|
308 | 312 | str r0, [r1,#0x114]
|
309 | 313 | bl lcdconsole_callback
|