1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (c) 2006 Fredrik Ohrn
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
28 #if defined(IRIVER_H300_SERIES) && !defined(SIMULATOR)
34 0.75 scaling - display 3 out of 4 pixels = 216x168
35 Skipping pixel #2 out of 4 seems to give the most legible display
37 void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf)
39 next_dst=&lcd_framebuffer[YOFS*LCD_WIDTH+XOFS+((ScreenHeight*3)/4)-1];
40 for (y=ScreenHeight-1;y >= 0; y--) {
43 for (x=0;x<ScreenWidth;x++) {
44 if ((x & 3) == 1) { vbuf++; }
46 *dst = palette[*(vbuf++)];
57 /* FIXME: ScreenWidth & ScreenHeight are defined in arcade.h, but all
58 hell breaks loose if you include it... */
60 #define ScreenWidth 224
61 #define ScreenHeight 288
63 #define SHRUNK_WIDTH ((ScreenWidth/4)*3)
64 #define SHRUNK_HEIGHT ((ScreenHeight/4)*3)
66 #define BD_SAVE (9 * 4)
70 move.w (%a1, %d2.l * 2), %d3
71 move.w %d3, (2 * LCD_WIDTH * 2)(%a0)
75 move.w (%a1, %d2.l * 2), %d3
76 move.w %d3, (1 * LCD_WIDTH * 2)(%a0)
80 move.w (%a1, %d2.l * 2), (%a0)
82 lea.l 3 * LCD_WIDTH * 2(%a0), %a0
88 movem.l (%a2), %d4-%d7 // Read 16 pixels
90 bsr.s process_4_pixels
92 bsr.s process_4_pixels
94 bsr.s process_4_pixels
96 bsr.s process_4_pixels
105 lea -BD_SAVE(%sp), %sp
106 movem.l %d2-%d7/%a2-%a4, (%sp)
108 move.l BD_SAVE + 4(%sp), %a0 // lcd_framebuffer
109 move.l BD_SAVE + 8(%sp), %a2 // vbuf
113 lea.l ((YOFS * LCD_WIDTH + XOFS + SHRUNK_HEIGHT) * 2)(%a0), %a0
115 move.l #(ScreenHeight / 4), %d0
116 move.l #(ScreenWidth / 16), %a3
117 move.l #(LCD_WIDTH * SHRUNK_WIDTH + 1) * 2, %a4
124 lea.l ScreenWidth(%a2), %a2 // Skip 1 line
137 movem.l (%sp), %d2-%d7/%a2-%a4
138 lea.l BD_SAVE(%sp), %sp
141 #endif /* defined(IRIVER_H300_SERIES) && !defined(SIMULATOR) */
144 /* See arcade.c for the C implementation of drawChar */
145 /* Note! This version does not handle flipped screen mode. */
149 #define DC_SAVE (4 * 4)
152 lea -DC_SAVE(%sp), %sp
153 movem.l %d2-%d5, (%sp)
155 movea.l DC_SAVE + 4(%sp), %a0 // buffer
157 move.l DC_SAVE + 16(%sp), %d0 // oy
163 adda.l DC_SAVE + 12(%sp), %a0 // ox
165 move.l DC_SAVE + 20(%sp), %d0 // color
174 movem.l %d2-%d3, (%a0)
186 move.l DC_SAVE + 8(%sp), %d2 // index
198 move.l %d3, %d2 // Pixel 1
203 swap.w %d4 // Pixel 2
208 lsr.l #8, %d3 // Pixel 3
213 swap.w %d4 // Pixel 4
222 move.l %d3, %d2 // Pixel 1
227 swap.w %d4 // Pixel 2
232 lsr.l #8, %d3 // Pixel 3
237 swap.w %d4 // Pixel 4
249 movem.l (%sp), %d2-%d5
250 lea.l DC_SAVE(%sp), %sp