sms wip: random tweaks, refactoring (palette, sound stuff, etc)
[picodrive.git] / platform / common / arm_utils.s
index b93b99f..fd13cac 100644 (file)
@@ -13,7 +13,6 @@
 @ to      00000000 rrr00000 ggg00000 bbb00000 ...\r
 \r
 @ lr =  0x00e000e0, out: r3=lower_pix, r2=higher_pix; trashes rin\r
-@ if sh==2, r8=0x00404040 (sh!=0 destroys flags!)\r
 .macro convRGB32_2 rin sh=0\r
     and     r2,  lr, \rin, lsr #4 @ blue\r
     and     r3,  \rin, lr\r
 .endif\r
 \r
     orr     r2,  r2,   r2,  lsr #3\r
+.if \sh == 1\r
+    str     r2, [r0, #0x40*2*4]\r
+.endif\r
     str     r2, [r0], #4\r
 .endm\r
 \r
 \r
-.global vidConvCpyRGB32 @ void *to, void *from, int pixels\r
+.global bgr444_to_rgb32 @ void *to, void *from\r
 \r
-vidConvCpyRGB32:\r
+bgr444_to_rgb32:\r
     stmfd   sp!, {r4-r7,lr}\r
 \r
-    mov     r12, r2, lsr #3 @ repeats\r
+    mov     r12, #0x40>>3 @ repeats\r
     mov     lr, #0x00e00000\r
     orr     lr, lr, #0x00e0\r
 \r
@@ -80,19 +82,18 @@ vidConvCpyRGB32:
     convRGB32_2 r5\r
     convRGB32_2 r6\r
     convRGB32_2 r7\r
-\r
     bgt     .loopRGB32\r
 \r
-    ldmfd   sp!, {r4-r7,lr}\r
-    bx      lr\r
+    ldmfd   sp!, {r4-r7,pc}\r
 \r
 \r
-.global vidConvCpyRGB32sh @ void *to, void *from, int pixels\r
+.global bgr444_to_rgb32_sh @ void *to, void *from\r
 \r
-vidConvCpyRGB32sh:\r
+bgr444_to_rgb32_sh:\r
     stmfd   sp!, {r4-r7,lr}\r
 \r
-    mov     r12, r2, lsr #3 @ repeats\r
+    mov     r12, #0x40>>3 @ repeats\r
+    add     r0, r0, #0x40*4\r
     mov     lr, #0x00e00000\r
     orr     lr, lr, #0x00e0\r
 \r
@@ -104,21 +105,10 @@ vidConvCpyRGB32sh:
     convRGB32_2 r5, 1\r
     convRGB32_2 r6, 1\r
     convRGB32_2 r7, 1\r
-\r
     bgt     .loopRGB32sh\r
 \r
-    ldmfd   sp!, {r4-r7,lr}\r
-    bx      lr\r
-\r
-\r
-.global vidConvCpyRGB32hi @ void *to, void *from, int pixels\r
-\r
-vidConvCpyRGB32hi:\r
-    stmfd   sp!, {r4-r7,lr}\r
-\r
-    mov     r12, r2, lsr #3 @ repeats\r
-    mov     lr, #0x00e00000\r
-    orr     lr, lr, #0x00e0\r
+    mov     r12, #0x40>>3 @ repeats\r
+    sub     r1, r1, #0x40*2\r
 \r
 .loopRGB32hi:\r
      ldmia    r1!, {r4-r7}\r