summaryrefslogtreecommitdiff
path: root/apps/plugins/pacbox/pacbox_cf.S
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pacbox/pacbox_cf.S')
-rw-r--r--apps/plugins/pacbox/pacbox_cf.S155
1 files changed, 155 insertions, 0 deletions
diff --git a/apps/plugins/pacbox/pacbox_cf.S b/apps/plugins/pacbox/pacbox_cf.S
new file mode 100644
index 0000000000..7dc6140b44
--- /dev/null
+++ b/apps/plugins/pacbox/pacbox_cf.S
@@ -0,0 +1,155 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (c) 2006 Fredrik Ohrn
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "pacbox.h"
21
22 .section .text
23 .align 2
24 .global blit_display
25
26/*
27
28 0.75 scaling - display 3 out of 4 pixels = 216x168
29 Skipping pixel #2 out of 4 seems to give the most legible display
30
31void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf)
32{
33 next_dst=&lcd_framebuffer[YOFS*LCD_WIDTH+XOFS+((ScreenHeight*3)/4)-1];
34 for (y=ScreenHeight-1;y >= 0; y--) {
35 if ((y & 3) != 1) {
36 dst = (next_dst--);
37 for (x=0;x<ScreenWidth;x++) {
38 if ((x & 3) == 1) { vbuf++; }
39 else {
40 *dst = palette[*(vbuf++)];
41 dst+=LCD_WIDTH;
42 }
43 }
44 } else {
45 vbuf+=ScreenWidth;
46 }
47 }
48}
49*/
50
51/* FIXME: ScreenWidth & ScreenHeight are defined in arcade.h, but all
52 hell breaks loose if you include it... */
53
54#define ScreenWidth 224
55#define ScreenHeight 288
56
57#define SHRUNK_WIDTH ((ScreenWidth/4)*3)
58#define SHRUNK_HEIGHT ((ScreenHeight/4)*3)
59
60blit_display:
61 lea -28(%sp), %sp
62 movem.l %d2-%d6/%a2, (%sp)
63
64 move.l 32(%sp), %a0 // lcd_framebuffer
65 move.l 36(%sp), %a2 // vbuf
66
67 lea palette, %a1
68
69 lea.l ((YOFS * LCD_WIDTH + XOFS + SHRUNK_HEIGHT) * 2)(%a0), %a0
70
71 move.l #(ScreenHeight / 4), %d0
72 move.l #(ScreenWidth / 4), %d1
73 moveq.l #0, %d2
74
75y_loop:
76 move.l %d1, %d5
77x_loop1:
78 move.l (%a2)+, %d3
79
80 move.b %d3, %d2
81 move.w (%a1, %d2.l * 2), %d6
82 move.w %d6, (2 * LCD_WIDTH * 2)(%a0)
83
84 lsr.l #8, %d3
85 move.b %d3, %d2
86 move.w (%a1, %d2.l * 2), %d6
87 move.w %d6, (1 * LCD_WIDTH * 2)(%a0)
88
89 swap.w %d3
90 move.b %d3, %d2
91 move.w (%a1, %d2.l * 2), (%a0)
92
93 lea.l 3 * LCD_WIDTH * 2(%a0), %a0
94
95 subq.l #1, %d5
96 bne.s x_loop1
97
98 suba.l #(LCD_WIDTH * SHRUNK_WIDTH + 1) * 2, %a0
99 lea.l ScreenWidth(%a2), %a2 // Skip 1 line
100
101 move.l %d1, %d5
102x_loop2:
103 move.l (%a2)+, %d3
104
105 move.b %d3, %d2
106 move.w (%a1, %d2.l * 2), %d6
107 move.w %d6, 2 * LCD_WIDTH * 2(%a0)
108
109 lsr.l #8, %d3
110 move.b %d3, %d2
111 move.w (%a1, %d2.l * 2), %d6
112 move.w %d6, 1 * LCD_WIDTH * 2(%a0)
113
114 swap.w %d3
115 move.b %d3, %d2
116 move.w (%a1, %d2.l * 2), (%a0)
117
118 lea.l 3 * LCD_WIDTH * 2(%a0), %a0
119
120 subq.l #1, %d5
121 bne.s x_loop2
122
123 suba.l #(LCD_WIDTH * SHRUNK_WIDTH + 1) * 2, %a0
124
125 move.l %d1, %d5
126x_loop3:
127 move.l (%a2)+, %d3
128
129 move.b %d3, %d2
130 move.w (%a1, %d2.l * 2), %d6
131 move.w %d6, 2 * LCD_WIDTH * 2(%a0)
132
133 lsr.l #8, %d3
134 move.b %d3, %d2
135 move.w (%a1, %d2.l * 2), %d6
136 move.w %d6, 1 * LCD_WIDTH * 2(%a0)
137
138 swap.w %d3
139 move.b %d3, %d2
140 move.w (%a1, %d2.l * 2), (%a0)
141
142 lea.l 3 * LCD_WIDTH * 2(%a0), %a0
143
144 subq.l #1, %d5
145 bne.s x_loop3
146
147 suba.l #(LCD_WIDTH * SHRUNK_WIDTH + 1) * 2, %a0
148
149 subq.l #1, %d0
150 bne y_loop
151
152 movem.l (%sp), %d2-%d6/%a2
153 lea.l 28(%sp), %sp
154 rts
155