diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index 8f06522bc3..4e6079ac59 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES @@ -67,22 +67,19 @@ iriverify.c #ifndef SIMULATOR /* those plugins only run on hardware */ -/* Overlay loaders */ +/* Overlays loaders */ +#if PLUGIN_BUFFER_SIZE <= 0x10000 && defined(HAVE_LCD_BITMAP) -#if (MEMORYSIZE <= 8) -chessbox.c -#if CONFIG_KEYPAD == RECORDER_PAD +#if CONFIG_KEYPAD != ONDIO_PAD /* not enough buttons for rockboy */ rockboy.c #endif -zxbox.c -#endif -/* overlay loader for Goban */ -#if (PLUGIN_BUFFER_SIZE < 0x10000) -lua.c +zxbox.c +chessbox.c goban.c pictureflow.c -#endif + +#endif /* PLUGIN_BUFFER_SIZE <= 0x10000 && HAVE_LCD_BITMAP */ #if CONFIG_CODEC != SWCODEC diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS index 2a88e7d1b1..18d9db8ef2 100644 --- a/apps/plugins/SUBDIRS +++ b/apps/plugins/SUBDIRS @@ -7,23 +7,32 @@ shortcuts clock #endif -#if (CONFIG_KEYPAD == RECORDER_PAD) || defined(HAVE_LCD_COLOR) \ - || defined(IRIVER_H100_SERIES) || defined(IAUDIO_M5) /* FIXME */ -rockboy -#endif /* For all targets with a bitmap display */ #ifdef HAVE_LCD_BITMAP +#if (CONFIG_KEYPAD != ONDIO_PAD) /* not enough buttons */ \ + && (LCD_PIXELFORMAT != HORIZONTAL_PACKING) /* TODO */ \ + && (LCD_PIXELFORMAT != VERTICAL_INTERLEAVED) /* TODO */ \ + && (defined(HAVE_LCD_COLOR) || (LCD_HEIGHT == 64) && (LCD_DEPTH == 1) || \ + (LCD_HEIGHT == 128) && (LCD_DEPTH == 2)) \ + && (PLUGIN_BUFFER_SIZE >= 0x60000 /* it needs a lot of RAM */ || \ + PLUGIN_BUFFER_SIZE <= 0x10000) /* but we can use overlays */ +rockboy +#endif + #ifdef HAVE_TAGCACHE pictureflow #endif -#if (CONFIG_CODEC == SWCODEC) +#if CONFIG_CODEC == SWCODEC && PLUGIN_BUFFER_SIZE > 0x20000 fft #endif +#if PLUGIN_BUFFER_SIZE > 0x20000 || PLUGIN_BUFFER_SIZE <= 0x10000 /* overlay */ chessbox +#endif + fractals imageviewer sudoku @@ -36,8 +45,10 @@ frotz #endif #ifndef OLYMPUS_MROBE_500 +#if PLUGIN_BUFFER_SIZE > 0x40000 || PLUGIN_BUFFER_SIZE <= 0x10000 /* overlay */ zxbox #endif +#endif #endif /* HAVE_LCD_BITMAP */ @@ -56,7 +67,9 @@ doom /* For all the swcodec targets */ #if CONFIG_CODEC == SWCODEC +#if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */ midi +#endif /* beatbox */ #if defined(IRIVER_H300_SERIES) || defined(IRIVER_H100_SERIES) @@ -71,6 +84,6 @@ mpegplayer #endif /* CONFIG_CODEC == SWCODEC */ /* Lua needs at least 160 KB to work in */ -#if (PLUGIN_BUFFER_SIZE >= 0x80000) +#if PLUGIN_BUFFER_SIZE >= 0x80000 lua #endif diff --git a/apps/plugins/lua.c b/apps/plugins/lua.c deleted file mode 100644 index a68e5c149a..0000000000 --- a/apps/plugins/lua.c +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * Overlay loader stub plugin for lua - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#include "plugin.h" - -#if PLUGIN_BUFFER_SIZE >= 0x80000 && !defined(SIMULATOR) - -#include "lib/overlay.h" - -PLUGIN_HEADER - -/* this is the plugin entry point */ -enum plugin_status plugin_start(const void* parameter) -{ - return run_overlay(parameter, VIEWERS_DIR "/lua.ovl", "LuaViewer"); -} -#endif diff --git a/apps/plugins/rockboy/sys_rockbox.c b/apps/plugins/rockboy/sys_rockbox.c index fb9a1ea644..bf4c513758 100644 --- a/apps/plugins/rockboy/sys_rockbox.c +++ b/apps/plugins/rockboy/sys_rockbox.c @@ -230,7 +230,7 @@ void vid_update(int scanline) { register int cnt=0; int scanline_remapped; -#if (LCD_HEIGHT == 64) && (LCD_DEPTH == 1) /* Archos */ +#if (LCD_HEIGHT == 64) && (LCD_DEPTH == 1) /* Archos, Clip, m200v4 */ int balance = 0; if (fb.mode==1) scanline-=16; @@ -306,7 +306,7 @@ void vid_update(int scanline) cnt ++; } rb->lcd_update_rect(0, (scanline/2) & ~7, LCD_WIDTH, 8); -#elif (LCD_HEIGHT == 128) && (LCD_DEPTH == 2) /* iriver H1x0 */ +#elif (LCD_HEIGHT == 128) && (LCD_DEPTH == 2) /* iriver H1x0, Samsung YH920 */ if (fb.mode==1) scanline-=16; else if (fb.mode==2) diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index 3a853c81aa..b2721c84e9 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -58,10 +58,19 @@ PLUGIN_HEADER #define COLS (LCD_WIDTH/SOKOBAN_TILESIZE) #endif -/* Use either all but 16k of the plugin buffer for level data +/* size of code+bss */ +#if CONFIG_CPU == SH7034 +#define CODE_SIZE 0x3000 /* 12k */ +#else +#define CODE_SIZE 0x5000 /* 20k */ +#endif + +#define CODE_AND_UNDO_SIZE (CODE_SIZE+0x1000) /* + 4k */ + +/* Use either all but code & undo of the plugin buffer for level data * or 128k, which ever is less */ -#if PLUGIN_BUFFER_SIZE - 0x4000 < 0x20000 -#define MAX_LEVEL_DATA (PLUGIN_BUFFER_SIZE - 0x4000) +#if PLUGIN_BUFFER_SIZE - CODE_AND_UNDO_SIZE < 0x20000 +#define MAX_LEVEL_DATA (PLUGIN_BUFFER_SIZE - CODE_AND_UNDO_SIZE) #else #define MAX_LEVEL_DATA 0x20000 #endif @@ -69,11 +78,11 @@ PLUGIN_HEADER /* Number of levels for which to allocate buffer indexes */ #define MAX_LEVELS MAX_LEVEL_DATA/70 -/* Use 4k plus remaining plugin buffer (-12k for prog) for undo, up to 64k */ -#if PLUGIN_BUFFER_SIZE - MAX_LEVEL_DATA - 0x3000 > 0x10000 +/* Use remaining plugin buffer (- code prog) for undo, up to 64k */ +#if PLUGIN_BUFFER_SIZE - MAX_LEVEL_DATA - CODE_SIZE > 0x10000 #define MAX_UNDOS 0x10000 #else -#define MAX_UNDOS (PLUGIN_BUFFER_SIZE - MAX_LEVEL_DATA - 0x3000) +#define MAX_UNDOS (PLUGIN_BUFFER_SIZE - MAX_LEVEL_DATA - CODE_SIZE) #endif /* Move/push definitions for undo */ diff --git a/firmware/export/config/sansaclip.h b/firmware/export/config/sansaclip.h index c139d91421..5dcdf9eefb 100644 --- a/firmware/export/config/sansaclip.h +++ b/firmware/export/config/sansaclip.h @@ -111,7 +111,7 @@ #define CODEC_SIZE 0x48000 /* in IRAM */ /* The number of bytes reserved for loadable plugins */ -#define PLUGIN_BUFFER_SIZE 0x45000 +#define PLUGIN_BUFFER_SIZE 0x18000 #define AB_REPEAT_ENABLE 1