diff options
Diffstat (limited to 'apps/plugins/sokoban.c')
-rw-r--r-- | apps/plugins/sokoban.c | 21 |
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 */ |