From a01422c54be29cf721a442053fd5a70686c8841e Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Tue, 18 May 2010 12:46:53 +0000 Subject: plugins: changes for targets with small plugin buffer (Clipv1) - only enable overlays for targets with very small plugin buffer (<= 0x10000 bytes, i.e. archos) - change the condition for rockboy to reflect exactly why it can be built or not - Some plugins need a large plugin buffer, only enable them if the buffer is big enough (sizes measured on Clipv1) - disable MIDI if we have 2MB (or less), we won't be able to load the instruments in the audio buffer - remove unusable lua overlay loader - sokoban code is bigger on clipv1 than on SH, assume it code is 20kB on anything but SH so it builds with buffer smaller than 192kB - reduce the Clipv1 plugin buffer size from 288kB to 96kb, disabling zxbox, chessbox, and fft zxbox and chessbox have overlays which run on archos, we just need to enable them on other targets. We'll also be able to run rockboy. fft won't run as it needs a large plugin buffer for greylib git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26141 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/sokoban.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'apps/plugins/sokoban.c') 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 */ -- cgit v1.2.3