aboutsummaryrefslogtreecommitdiff
path: root/frontend/blit320.s
diff options
context:
space:
mode:
authornotaz2011-10-27 00:27:28 +0300
committernotaz2011-10-30 23:48:08 +0200
commit02ee7e24fce76dfc6e37d6b85921ec82f97464bc (patch)
tree058cf55bf0872a495d4c9cca6734ec366f9497f9 /frontend/blit320.s
parent4f55097de04a34ddcc83647f3b1f69570d7f1e36 (diff)
downloadpcsx_rearmed-02ee7e24fce76dfc6e37d6b85921ec82f97464bc.tar.gz
pcsx_rearmed-02ee7e24fce76dfc6e37d6b85921ec82f97464bc.tar.bz2
pcsx_rearmed-02ee7e24fce76dfc6e37d6b85921ec82f97464bc.zip
frontend/pollux: add scaling
16bpp only for now.
Diffstat (limited to 'frontend/blit320.s')
-rw-r--r--frontend/blit320.s87
1 files changed, 87 insertions, 0 deletions
diff --git a/frontend/blit320.s b/frontend/blit320.s
new file mode 100644
index 0000000..201fdea
--- /dev/null
+++ b/frontend/blit320.s
@@ -0,0 +1,87 @@
+/*
+ * (C) GraÅžvydas "notaz" Ignotas, 2011
+ *
+ * This work is licensed under the terms of any of these licenses
+ * (at your option):
+ * - GNU GPL, version 2 or later.
+ * - GNU LGPL, version 2.1 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ * This code tries to make better use of pollux/arm926 store buffer
+ * by fusing words instead of using strhs.
+ */
+
+.text
+.align 2
+
+.macro lhw_str rl rt
+ lsl \rl, #16
+ lsr \rl, #16
+ orr \rl, \rt, lsl #16
+ str \rl, [r0], #4
+.endm
+
+.global blit320_640
+blit320_640:
+ stmfd sp!, {r4-r8,lr}
+ mov r12, #40
+0:
+ ldmia r1!, {r2-r8,lr}
+ lhw_str r2, r3
+ lhw_str r4, r5
+ lhw_str r6, r7
+ subs r12, #1
+ lhw_str r8, lr
+ bgt 0b
+ ldmfd sp!, {r4-r8,pc}
+
+
+.global blit320_512
+blit320_512:
+ stmfd sp!, {r4-r8,lr}
+ mov r12, #32
+0:
+ ldmia r1!, {r2-r8,lr}
+ lsl r2, #16
+ lsr r2, #16
+ orr r2, r3, lsl #16
+ str r2, [r0], #4 @ 0,2
+ lsr r4, #16
+ lsr r3, #16
+ orr r3, r4, lsl #16
+ str r3, [r0], #4 @ 3,5
+ lsr r5, #16
+ orr r5, r6, lsl #16
+ str r5, [r0], #4 @ 7,8
+ lsr r8, #16
+ lsr lr, #16
+ str r7, [r0], #4 @ 10,11
+ orr r8, lr, lsl #16
+ subs r12, #1
+ str r8, [r0], #4 @ 13,15
+ bgt 0b
+ ldmfd sp!, {r4-r8,pc}
+
+
+.macro unaligned_str rl rt
+ lsr \rl, #16
+ orr \rl, \rt, lsl #16
+ str \rl, [r0], #4
+.endm
+
+.global blit320_368
+blit320_368:
+ stmfd sp!, {r4-r8,lr}
+ mov r12, #23
+0:
+ ldmia r1!, {r2-r8,lr}
+ unaligned_str r2, r3 @ 1,2
+ unaligned_str r3, r4 @ 3,4
+ unaligned_str r4, r5 @ 5,6
+ subs r12, #1
+ stmia r0!, {r6-r8,lr} @ 8-15
+ bgt 0b
+ ldmfd sp!, {r4-r8,pc}
+
+
+@ vim:filetype=armasm