X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FDraw_amips.s;h=29aa7db844928bea4e51ee16c739b89a5b3d078f;hb=e5fa9817777032758511868c8aaa9ff780786c3f;hp=c05391ce93e4789e7a1d7e7c93a3d118cb217121;hpb=21395e3878e72c394e094127a7b917ea17632103;p=picodrive.git diff --git a/Pico/Draw_amips.s b/Pico/Draw_amips.s index c05391c..29aa7db 100644 --- a/Pico/Draw_amips.s +++ b/Pico/Draw_amips.s @@ -45,6 +45,43 @@ amips_clut_loop: nop +.global amips_clut_6bit + +amips_clut_6bit: + srl $a3, 2 + li $t4, 0 + li $t5, 0 + li $t6, 0 + li $t7, 0 +amips_clut_loop6: + lbu $t0, 0($a1) # tried lw here, no improvement noticed + lbu $t1, 1($a1) + lbu $t2, 2($a1) + lbu $t3, 3($a1) + ins $t4, $t0, 1, 6 + ins $t5, $t1, 1, 6 + ins $t6, $t2, 1, 6 + ins $t7, $t3, 1, 6 + addu $t0, $t4, $a2 + addu $t1, $t5, $a2 + addu $t2, $t6, $a2 + addu $t3, $t7, $a2 + lhu $t0, 0($t0) + lhu $t1, 0($t1) + lhu $t2, 0($t2) + lhu $t3, 0($t3) + ins $t0, $t1, 16, 16 # ins rt, rs, pos, size - Insert size bits starting + ins $t2, $t3, 16, 16 # from the LSB of rs into rt starting at position pos + sw $t0, 0($a0) + sw $t2, 4($a0) + addiu $a0, 8 + addiu $a3, -1 + bnez $a3, amips_clut_loop6 + addiu $a1, 4 + jr $ra + nop + + # $a0 - pd, $a1 - tile word, $a2 - pal # ext rt, rs, pos, size // Extract size bits from position pos in rs and store in rt