lowercasing filenames, part1; makefile adjustments
[libpicofe.git] / pandora / asm_utils.s
1 @ vim:filetype=armasm
2
3
4 .global cache_flush_d_inval_i
5
6 cache_flush_d_inval_i:
7     mov     r2, #0x0  @ must be 0 ???
8     swi     0x9f0002
9     bx      lr
10
11
12 .global clut_line @ void *dest, void *src, unsigned short *pal, int pixels_mask
13
14 clut_line:
15     stmfd   sp!, {r4-r11,lr}
16
17     and     lr, r3, #0xff0000
18     mov     lr, lr, lsr #15        @ mask
19     mov     r3, r3, lsr #3
20     and     r3, r3, #0xff          @ counter
21     add     r11,r0, #800*2
22
23 clut_line_loop:
24     ldmia   r1!, {r10,r12}
25
26     and     r4, lr, r10, lsl #1
27     ldrh    r4, [r2, r4]
28     and     r5, lr, r10, lsr #7
29     ldrh    r5, [r2, r5]
30     orr     r4, r4, r4,  lsl #16
31
32     and     r6, lr, r10, lsr #15
33     ldrh    r6, [r2, r6]
34     orr     r5, r5, r5,  lsl #16
35
36     and     r7, lr, r10, lsr #23
37     ldrh    r7, [r2, r7]
38     orr     r6, r6, r6,  lsl #16
39
40     and     r8, lr, r12, lsl #1
41     ldrh    r8, [r2, r8]
42     orr     r7, r7, r7,  lsl #16
43
44     and     r9, lr, r12, lsr #7
45     ldrh    r9, [r2, r9]
46     orr     r8, r8, r8,  lsl #16
47
48     and     r10,lr, r12, lsr #15
49     ldrh    r10,[r2, r10]
50     orr     r9, r9, r9,  lsl #16
51
52     and     r12,lr, r12, lsr #23
53     ldrh    r12,[r2, r12]
54     orr     r10,r10,r10, lsl #16
55
56     subs    r3, r3, #1
57     orr     r12,r12,r12, lsl #16
58
59     stmia   r0!, {r4-r10,r12}
60     stmia   r11!,{r4-r10,r12}
61     bne     clut_line_loop
62
63     ldmfd   sp!, {r4-r11,pc}
64