4 # convert chunky line to planar
8 # r6 = (SCREENWIDTH+31)>>5 (# cells to convert per line per plane)
12 ppc_c2p_line
: addi r1,r1,-36
13 stswi r13,r1,0 # save registers
16 mtctr r6 # ctr = number of loops
18 lhz r6,0(r5) # bm_BytesPerRow
19 mullw r3,r3,r6 # offset in BitPlane of line
21 addi r5,r5,12 # bm_Planes[1]
25 c2p_loop
: lswi r13,r4,0 # next 8 longs
27 rlwimi r0,r13,0,0,0 # A7
28 rlwimi r0,r13,7,1,1 # B7
29 rlwimi r0,r13,14,2,2 # C7
30 rlwimi r0,r13,21,3,3 # D7
31 rlwimi r0,r14,28,4,4 # E7
32 rlwimi r0,r14,3,5,5 # F7
33 rlwimi r0,r14,10,6,6 # G7
34 rlwimi r0,r14,17,7,7 # H7
35 rlwimi r0,r15,24,8,8 # I7
36 rlwimi r0,r15,31,9,9 # J7
37 rlwimi r0,r15,6,10,10 # K7
38 rlwimi r0,r15,13,11,11 # L7
39 rlwimi r0,r16,20,12,12 # M7
40 rlwimi r0,r16,27,13,13 # N7
41 rlwimi r0,r16,2,14,14 # O7
42 rlwimi r0,r16,9,15,15 # P7
43 rlwimi r0,r17,16,16,16 # Q7
44 rlwimi r0,r17,23,17,17 # R7
45 rlwimi r0,r17,30,18,18 # S7
46 rlwimi r0,r17,5,19,19 # T7
47 rlwimi r0,r18,12,20,20 # U7
48 rlwimi r0,r18,19,21,21 # V7
49 rlwimi r0,r18,26,22,22 # W7
50 rlwimi r0,r18,1,23,23 # X7
51 rlwimi r0,r19,8,24,24 # Y7
52 rlwimi r0,r19,15,25,25 # Z7
53 rlwimi r0,r19,22,26,26 # a7
54 rlwimi r0,r19,29,27,27 # b7
55 rlwimi r0,r20,4,28,28 # c7
56 rlwimi r0,r20,11,29,29 # d7
57 rlwimi r0,r20,18,30,30 # e7
58 rlwimi r0,r20,25,31,31 # f7
59 stwx r0,r12,r3 # store to BP8+offset
61 rlwimi r21,r13,1,0,0 # A6
62 rlwimi r21,r13,8,1,1 # B6
63 rlwimi r21,r13,15,2,2 # C6
64 rlwimi r21,r13,22,3,3 # D6
65 rlwimi r21,r14,29,4,4 # E6
66 rlwimi r21,r14,4,5,5 # F6
67 rlwimi r21,r14,11,6,6 # G6
68 rlwimi r21,r14,18,7,7 # H6
69 rlwimi r21,r15,25,8,8 # I6
70 rlwimi r21,r15,0,9,9 # J6
71 rlwimi r21,r15,7,10,10 # K6
72 rlwimi r21,r15,14,11,11 # L6
73 rlwimi r21,r16,21,12,12 # M6
74 rlwimi r21,r16,28,13,13 # N6
75 rlwimi r21,r16,3,14,14 # O6
76 rlwimi r21,r16,10,15,15 # P6
77 rlwimi r21,r17,17,16,16 # Q6
78 rlwimi r21,r17,24,17,17 # R6
79 rlwimi r21,r17,31,18,18 # S6
80 rlwimi r21,r17,6,19,19 # T6
81 rlwimi r21,r18,13,20,20 # U6
82 rlwimi r21,r18,20,21,21 # V6
83 rlwimi r21,r18,27,22,22 # W6
84 rlwimi r21,r18,2,23,23 # X6
85 rlwimi r21,r19,9,24,24 # Y6
86 rlwimi r21,r19,16,25,25 # Z6
87 rlwimi r21,r19,23,26,26 # a6
88 rlwimi r21,r19,30,27,27 # b6
89 rlwimi r21,r20,5,28,28 # c6
90 rlwimi r21,r20,12,29,29 # d6
91 rlwimi r21,r20,19,30,30 # e6
92 rlwimi r21,r20,26,31,31 # f6
93 stwx r21,r11,r3 # store to BP7+offset
95 rlwimi r0,r13,2,0,0 # A5
96 rlwimi r0,r13,9,1,1 # B5
97 rlwimi r0,r13,16,2,2 # C5
98 rlwimi r0,r13,23,3,3 # D5
99 rlwimi r0,r14,30,4,4 # E5
100 rlwimi r0,r14,5,5,5 # F5
101 rlwimi r0,r14,12,6,6 # G5
102 rlwimi r0,r14,19,7,7 # H5
103 rlwimi r0,r15,26,8,8 # I5
104 rlwimi r0,r15,1,9,9 # J5
105 rlwimi r0,r15,8,10,10 # K5
106 rlwimi r0,r15,15,11,11 # L5
107 rlwimi r0,r16,22,12,12 # M5
108 rlwimi r0,r16,29,13,13 # N5
109 rlwimi r0,r16,4,14,14 # O5
110 rlwimi r0,r16,11,15,15 # P5
111 rlwimi r0,r17,18,16,16 # Q5
112 rlwimi r0,r17,25,17,17 # R5
113 rlwimi r0,r17,0,18,18 # S5
114 rlwimi r0,r17,7,19,19 # T5
115 rlwimi r0,r18,14,20,20 # U5
116 rlwimi r0,r18,21,21,21 # V5
117 rlwimi r0,r18,28,22,22 # W5
118 rlwimi r0,r18,3,23,23 # X5
119 rlwimi r0,r19,10,24,24 # Y5
120 rlwimi r0,r19,17,25,25 # Z5
121 rlwimi r0,r19,24,26,26 # a5
122 rlwimi r0,r19,31,27,27 # b5
123 rlwimi r0,r20,6,28,28 # c5
124 rlwimi r0,r20,13,29,29 # d5
125 rlwimi r0,r20,20,30,30 # e5
126 rlwimi r0,r20,27,31,31 # f5
127 stwx r0,r10,r3 # store to BP6+offset
129 rlwimi r21,r13,3,0,0 # A4
130 rlwimi r21,r13,10,1,1 # B4
131 rlwimi r21,r13,17,2,2 # C4
132 rlwimi r21,r13,24,3,3 # D4
133 rlwimi r21,r14,31,4,4 # E4
134 rlwimi r21,r14,6,5,5 # F4
135 rlwimi r21,r14,13,6,6 # G4
136 rlwimi r21,r14,20,7,7 # H4
137 rlwimi r21,r15,27,8,8 # I4
138 rlwimi r21,r15,2,9,9 # J4
139 rlwimi r21,r15,9,10,10 # K4
140 rlwimi r21,r15,16,11,11 # L4
141 rlwimi r21,r16,23,12,12 # M4
142 rlwimi r21,r16,30,13,13 # N4
143 rlwimi r21,r16,5,14,14 # O4
144 rlwimi r21,r16,12,15,15 # P4
145 rlwimi r21,r17,19,16,16 # Q4
146 rlwimi r21,r17,26,17,17 # R4
147 rlwimi r21,r17,1,18,18 # S4
148 rlwimi r21,r17,8,19,19 # T4
149 rlwimi r21,r18,15,20,20 # U4
150 rlwimi r21,r18,22,21,21 # V4
151 rlwimi r21,r18,29,22,22 # W4
152 rlwimi r21,r18,4,23,23 # X4
153 rlwimi r21,r19,11,24,24 # Y4
154 rlwimi r21,r19,18,25,25 # Z4
155 rlwimi r21,r19,25,26,26 # a4
156 rlwimi r21,r19,0,27,27 # b4
157 rlwimi r21,r20,7,28,28 # c4
158 rlwimi r21,r20,14,29,29 # d4
159 rlwimi r21,r20,21,30,30 # e4
160 rlwimi r21,r20,28,31,31 # f4
161 stwx r21,r9,r3 # store to BP5+offset
163 rlwimi r0,r13,4,0,0 # A3
164 rlwimi r0,r13,11,1,1 # B3
165 rlwimi r0,r13,18,2,2 # C3
166 rlwimi r0,r13,25,3,3 # D3
167 rlwimi r0,r14,0,4,4 # E3
168 rlwimi r0,r14,7,5,5 # F3
169 rlwimi r0,r14,14,6,6 # G3
170 rlwimi r0,r14,21,7,7 # H3
171 rlwimi r0,r15,28,8,8 # I3
172 rlwimi r0,r15,3,9,9 # J3
173 rlwimi r0,r15,10,10,10 # K3
174 rlwimi r0,r15,17,11,11 # L3
175 rlwimi r0,r16,24,12,12 # M3
176 rlwimi r0,r16,31,13,13 # N3
177 rlwimi r0,r16,6,14,14 # O3
178 rlwimi r0,r16,13,15,15 # P3
179 rlwimi r0,r17,20,16,16 # Q3
180 rlwimi r0,r17,27,17,17 # R3
181 rlwimi r0,r17,2,18,18 # S3
182 rlwimi r0,r17,9,19,19 # T3
183 rlwimi r0,r18,16,20,20 # U3
184 rlwimi r0,r18,23,21,21 # V3
185 rlwimi r0,r18,30,22,22 # W3
186 rlwimi r0,r18,5,23,23 # X3
187 rlwimi r0,r19,12,24,24 # Y3
188 rlwimi r0,r19,19,25,25 # Z3
189 rlwimi r0,r19,26,26,26 # a3
190 rlwimi r0,r19,1,27,27 # b3
191 rlwimi r0,r20,8,28,28 # c3
192 rlwimi r0,r20,15,29,29 # d3
193 rlwimi r0,r20,22,30,30 # e3
194 rlwimi r0,r20,29,31,31 # f3
195 stwx r0,r8,r3 # store to BP4+offset
197 rlwimi r21,r13,5,0,0 # A2
198 rlwimi r21,r13,12,1,1 # B2
199 rlwimi r21,r13,19,2,2 # C2
200 rlwimi r21,r13,26,3,3 # D2
201 rlwimi r21,r14,1,4,4 # E2
202 rlwimi r21,r14,8,5,5 # F2
203 rlwimi r21,r14,15,6,6 # G2
204 rlwimi r21,r14,22,7,7 # H2
205 rlwimi r21,r15,29,8,8 # I2
206 rlwimi r21,r15,4,9,9 # J2
207 rlwimi r21,r15,11,10,10 # K2
208 rlwimi r21,r15,18,11,11 # L2
209 rlwimi r21,r16,25,12,12 # M2
210 rlwimi r21,r16,0,13,13 # N2
211 rlwimi r21,r16,7,14,14 # O2
212 rlwimi r21,r16,14,15,15 # P2
213 rlwimi r21,r17,21,16,16 # Q2
214 rlwimi r21,r17,28,17,17 # R2
215 rlwimi r21,r17,3,18,18 # S2
216 rlwimi r21,r17,10,19,19 # T2
217 rlwimi r21,r18,17,20,20 # U2
218 rlwimi r21,r18,24,21,21 # V2
219 rlwimi r21,r18,31,22,22 # W2
220 rlwimi r21,r18,6,23,23 # X2
221 rlwimi r21,r19,13,24,24 # Y2
222 rlwimi r21,r19,20,25,25 # Z2
223 rlwimi r21,r19,27,26,26 # a2
224 rlwimi r21,r19,2,27,27 # b2
225 rlwimi r21,r20,9,28,28 # c2
226 rlwimi r21,r20,16,29,29 # d2
227 rlwimi r21,r20,23,30,30 # e2
228 rlwimi r21,r20,30,31,31 # f2
229 stwx r21,r7,r3 # store to BP3+offset
231 rlwimi r0,r13,6,0,0 # A1
232 rlwimi r0,r13,13,1,1 # B1
233 rlwimi r0,r13,20,2,2 # C1
234 rlwimi r0,r13,27,3,3 # D1
235 rlwimi r0,r14,2,4,4 # E1
236 rlwimi r0,r14,9,5,5 # F1
237 rlwimi r0,r14,16,6,6 # G1
238 rlwimi r0,r14,23,7,7 # H1
239 rlwimi r0,r15,30,8,8 # I1
240 rlwimi r0,r15,5,9,9 # J1
241 rlwimi r0,r15,12,10,10 # K1
242 rlwimi r0,r15,19,11,11 # L1
243 rlwimi r0,r16,26,12,12 # M1
244 rlwimi r0,r16,1,13,13 # N1
245 rlwimi r0,r16,8,14,14 # O1
246 rlwimi r0,r16,15,15,15 # P1
247 rlwimi r0,r17,22,16,16 # Q1
248 rlwimi r0,r17,29,17,17 # R1
249 rlwimi r0,r17,4,18,18 # S1
250 rlwimi r0,r17,11,19,19 # T1
251 rlwimi r0,r18,18,20,20 # U1
252 rlwimi r0,r18,25,21,21 # V1
253 rlwimi r0,r18,0,22,22 # W1
254 rlwimi r0,r18,7,23,23 # X1
255 rlwimi r0,r19,14,24,24 # Y1
256 rlwimi r0,r19,21,25,25 # Z1
257 rlwimi r0,r19,28,26,26 # a1
258 rlwimi r0,r19,3,27,27 # b1
259 rlwimi r0,r20,10,28,28 # c1
260 rlwimi r0,r20,17,29,29 # d1
261 rlwimi r0,r20,24,30,30 # e1
262 rlwimi r0,r20,31,31,31 # f1
263 stwx r0,r6,r3 # store to BP2+offset
265 rlwimi r21,r13,7,0,0 # A0
266 rlwimi r21,r13,14,1,1 # B0
267 rlwimi r21,r13,21,2,2 # C0
268 rlwimi r21,r13,28,3,3 # D0
269 rlwimi r21,r14,3,4,4 # E0
270 rlwimi r21,r14,10,5,5 # F0
271 rlwimi r21,r14,17,6,6 # G0
272 rlwimi r21,r14,24,7,7 # H0
273 rlwimi r21,r15,31,8,8 # I0
274 rlwimi r21,r15,6,9,9 # J0
275 rlwimi r21,r15,13,10,10 # K0
276 rlwimi r21,r15,20,11,11 # L0
277 rlwimi r21,r16,27,12,12 # M0
278 rlwimi r21,r16,2,13,13 # N0
279 rlwimi r21,r16,9,14,14 # O0
280 rlwimi r21,r16,16,15,15 # P0
281 rlwimi r21,r17,23,16,16 # Q0
282 rlwimi r21,r17,30,17,17 # r21
283 rlwimi r21,r17,5,18,18 # S0
284 rlwimi r21,r17,12,19,19 # T0
285 rlwimi r21,r18,19,20,20 # U0
286 rlwimi r21,r18,26,21,21 # V0
287 rlwimi r21,r18,1,22,22 # W0
288 rlwimi r21,r18,8,23,23 # X0
289 rlwimi r21,r19,15,24,24 # Y0
290 rlwimi r21,r19,22,25,25 # Z0
291 rlwimi r21,r19,29,26,26 # a0
292 rlwimi r21,r19,4,27,27 # b0
293 rlwimi r21,r20,11,28,28 # c0
294 rlwimi r21,r20,18,29,29 # d0
295 rlwimi r21,r20,25,30,30 # e0
296 rlwimi r21,r20,0,31,31 # f0
297 stwx r21,r5,r3 # store to BP1+offset
301 bdnz c2p_loop
# decrement ctr, branch non-zero
303 lswi r13,r1,0 # restore registers