From b3358bd1a21a76f7e6c779f065249e9807e5df75 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Wed, 15 Mar 2006 01:27:13 +0000 Subject: Patch #4829 from Fredrik Öhrn - Coldfire assembler blit_display() function for H300 and move the palette data into IRAM. Each of these gives about a 1fps speed improvement. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9038 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/pacbox/SOURCES | 2 + apps/plugins/pacbox/arcade.c | 14 ++-- apps/plugins/pacbox/pacbox_cf.S | 155 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 166 insertions(+), 5 deletions(-) create mode 100644 apps/plugins/pacbox/pacbox_cf.S diff --git a/apps/plugins/pacbox/SOURCES b/apps/plugins/pacbox/SOURCES index 3d6145ddce..c457f5b2ce 100644 --- a/apps/plugins/pacbox/SOURCES +++ b/apps/plugins/pacbox/SOURCES @@ -4,6 +4,8 @@ hardware.c z80.c #if (CONFIG_CPU == PP5020) && (LCD_WIDTH >= 288) && (LCD_HEIGHT >= 224) pacbox_arm.S +#elif defined(IRIVER_H300_SERIES) && !defined(SIMULATOR) +pacbox_cf.S #else pacbox_lcd.c #endif diff --git a/apps/plugins/pacbox/arcade.c b/apps/plugins/pacbox/arcade.c index dc3ea0c9ba..625ff6e8f1 100644 --- a/apps/plugins/pacbox/arcade.c +++ b/apps/plugins/pacbox/arcade.c @@ -87,9 +87,15 @@ enum { FlipXY = 0x03 }; -fb_data palette[256]; /* Color palette */ -int vchar_to_x_[1024]; -int vchar_to_y_[1024]; +/* Putting this in IRAM actually slows down the iPods, but is good for + the Coldfire +*/ +#ifdef CPU_COLDFIRE +fb_data palette[256] IBSS_ATTR; /* Color palette */ +#else +fb_data palette[256]; /* Color palette */ +#endif + void init_PacmanMachine(int dip) { @@ -129,8 +135,6 @@ void init_PacmanMachine(int dip) x = 27 - ((i-0x40) >> 5); y = 2 + ((i-0x40) & 0x1F); } - vchar_to_x_[i] = x; - vchar_to_y_[i] = y; if( (y >= 0) && (y < 36) && (x >= 0) && (x < 28) ) vchar_to_i_[i] = y*28 + x; else 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 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (c) 2006 Fredrik Ohrn + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "pacbox.h" + + .section .text + .align 2 + .global blit_display + +/* + + 0.75 scaling - display 3 out of 4 pixels = 216x168 + Skipping pixel #2 out of 4 seems to give the most legible display + +void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf) +{ + next_dst=&lcd_framebuffer[YOFS*LCD_WIDTH+XOFS+((ScreenHeight*3)/4)-1]; + for (y=ScreenHeight-1;y >= 0; y--) { + if ((y & 3) != 1) { + dst = (next_dst--); + for (x=0;x