summaryrefslogtreecommitdiff
path: root/apps/plugins/sokoban.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-18 12:46:53 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-18 12:46:53 +0000
commita01422c54be29cf721a442053fd5a70686c8841e (patch)
tree7d0203b0420fe60d99063af63fe00c307fb30369 /apps/plugins/sokoban.c
parentdcbd8d74c6f6af7e91c707c33f807f9d9708cf8c (diff)
downloadrockbox-a01422c54be29cf721a442053fd5a70686c8841e.tar.gz
rockbox-a01422c54be29cf721a442053fd5a70686c8841e.zip
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
Diffstat (limited to 'apps/plugins/sokoban.c')
-rw-r--r--apps/plugins/sokoban.c21
1 files changed, 15 insertions, 6 deletions
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
58#define COLS (LCD_WIDTH/SOKOBAN_TILESIZE) 58#define COLS (LCD_WIDTH/SOKOBAN_TILESIZE)
59#endif 59#endif
60 60
61/* Use either all but 16k of the plugin buffer for level data 61/* size of code+bss */
62#if CONFIG_CPU == SH7034
63#define CODE_SIZE 0x3000 /* 12k */
64#else
65#define CODE_SIZE 0x5000 /* 20k */
66#endif
67
68#define CODE_AND_UNDO_SIZE (CODE_SIZE+0x1000) /* + 4k */
69
70/* Use either all but code & undo of the plugin buffer for level data
62 * or 128k, which ever is less */ 71 * or 128k, which ever is less */
63#if PLUGIN_BUFFER_SIZE - 0x4000 < 0x20000 72#if PLUGIN_BUFFER_SIZE - CODE_AND_UNDO_SIZE < 0x20000
64#define MAX_LEVEL_DATA (PLUGIN_BUFFER_SIZE - 0x4000) 73#define MAX_LEVEL_DATA (PLUGIN_BUFFER_SIZE - CODE_AND_UNDO_SIZE)
65#else 74#else
66#define MAX_LEVEL_DATA 0x20000 75#define MAX_LEVEL_DATA 0x20000
67#endif 76#endif
@@ -69,11 +78,11 @@ PLUGIN_HEADER
69/* Number of levels for which to allocate buffer indexes */ 78/* Number of levels for which to allocate buffer indexes */
70#define MAX_LEVELS MAX_LEVEL_DATA/70 79#define MAX_LEVELS MAX_LEVEL_DATA/70
71 80
72/* Use 4k plus remaining plugin buffer (-12k for prog) for undo, up to 64k */ 81/* Use remaining plugin buffer (- code prog) for undo, up to 64k */
73#if PLUGIN_BUFFER_SIZE - MAX_LEVEL_DATA - 0x3000 > 0x10000 82#if PLUGIN_BUFFER_SIZE - MAX_LEVEL_DATA - CODE_SIZE > 0x10000
74#define MAX_UNDOS 0x10000 83#define MAX_UNDOS 0x10000
75#else 84#else
76#define MAX_UNDOS (PLUGIN_BUFFER_SIZE - MAX_LEVEL_DATA - 0x3000) 85#define MAX_UNDOS (PLUGIN_BUFFER_SIZE - MAX_LEVEL_DATA - CODE_SIZE)
77#endif 86#endif
78 87
79/* Move/push definitions for undo */ 88/* Move/push definitions for undo */