1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (c) 2006 Dave Chapman
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 ****************************************************************************/
25 .section .icode,"ax",%progbits
28 /* void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf)
30 next_dst=&lcd_framebuffer[YOFS*LCD_WIDTH+XOFS+ScreenHeight-1];
31 for( y=ScreenHeight; y>0; y-- ) {
33 for( x=ScreenWidth; x>0; x-- ) {
34 *dst = palette[*(vbuf++)];
41 #if (LCD_WIDTH >= 288) && (LCD_HEIGHT >= 224)
44 stmdb sp!, {r4-r11, lr}
47 add r3, r3, #24 @ 5720 = (2*(YOFS*LCD_WIDTH+XOFS+ScreenHeight-4))
49 mov lr, #288 @ y = 288
51 loop_y: mov r2, r3 @ r2 = next_dst
52 sub r3, r3, #8 @ next_dst-=4
54 mov ip, #224 @ x = 224
56 /* store 2 input bytes from the next four lines in r7-r10 */
58 ldrh r8, [r1, #224] @ r8 = vbuf[224]
59 ldrh r7, [r1] @ r7 = vbuf[0]
61 ldrh r10, [r1, #224] @ r10 = vbuf[224*3]
62 ldrh r9, [r1], #2 @ r9 = vbuf[224*2] ; vbuf += 2;
66 /* Convert high bytes of r7-r10 into palette entries in r5 and r6 */
69 ldrh r6, [r6, r0] @ r6 = palette[hi(r7]]
73 ldrh r11, [r11, r0] @ r11 = palette[hi(r8]]
75 orr r6, r11, r6, lsl #16 @ r6 = palette[hi(r8]]
76 @ | (palette[hi(r7)] << 16)
80 ldrh r5, [r5, r0] @ r5 = palette[hi(r9]]
84 ldrh r11, [r11, r0] @ r11 = palette[hi(r10)]]
86 orr r5, r11, r5, lsl #16 @ r5 = palette[hi(r10]]
87 @ | (palette[hi(r9)] << 16)
89 /* Convert low bytes of r7-r10 into palette entries in r7 and r8 */
98 orr r8, r8, r7, lsl #16
108 orr r7, r10, r9, lsl #16
110 /* Now write the 8 pixels to the screen */
112 add r2, r2, #(LCD_WIDTH*2)-8 @ dst += LCD_WIDTH
115 add r2, r2, #(LCD_WIDTH*2)-8 @ dst += LCD_WIDTH
118 subs ip, ip, #2 @ x-=2
122 add r1, r1, #224*3 @ vbuf += 224*3
123 subs lr, lr, #4 @ y-=4
124 ldmpc cond=eq, regs=r4-r11