1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 7afd973..dadc8b5 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -1,6 +1,9 @@
 /* plugins common to all models */
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 chessclock.c
+#endif
 credits.c
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 cube.c
 dict.c
 jackpot.c
@@ -8,27 +11,36 @@ keybox.c
 logo.c
 lrcplayer.c
 mosaique.c
+#endif
 properties.c
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 random_folder_advance_config.c
 rockblox.c
+#endif
 search.c
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 settings_dumper.c
 snow.c
+#endif
 sort.c
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 stats.c
 #ifdef HAVE_TOUCHSCREEN
 stopwatch.lua
 #else
 stopwatch.c
 #endif
+#endif
 theme_remove.c
 vbrfix.c
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 md5sum.c
 dice.c
 disktidy.c
 flipit.c
 shopper.c
 resistor.c
+#endif


 #ifdef USB_ENABLE_HID
@@ -48,8 +60,10 @@ lamp.c
 pitch_detector.c
 #endif

+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 mp3_encoder.c
 wav2wv.c
+#endif
 #endif /* CONFIG_CODEC */


@@ -79,7 +93,9 @@ rockboy.c
 zxbox.c
 chessbox.c
 goban.c
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 pictureflow.c
+#endif

 #endif /* PLUGIN_BUFFER_SIZE <= 0x20000 && HAVE_LCD_BITMAP */

@@ -135,13 +151,16 @@ wavrecord.c


 #if CONFIG_CODEC == SWCODEC || !defined(SIMULATOR) /* Not for hwcodec sims */
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 metronome.c
 #endif
+#endif



 #ifdef HAVE_LCD_BITMAP             /* Not for the Archos Player */

+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 boomshine.lua
 rockblox1d.c
 brickmania.c
@@ -176,15 +195,20 @@ starfield.c
 vu_meter.c
 wormlet.c

+
 /* Plugins needing the grayscale lib on low-depth LCDs */
 fire.c
 plasma.c
+#endif

 #ifdef HAVE_LCD_COLOR
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 clix.c
 codebuster.c
 #endif
+#endif

+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 #if (LCD_WIDTH > 112) && (LCD_HEIGHT > 64)
 fireworks.c
 #endif
@@ -194,6 +218,7 @@ rockpaint.c
 #endif

 rocklife.c
+#endif

 #endif /* HAVE_LCD_BITMAP */

@@ -206,12 +231,16 @@ nim.c

 #if LCD_DEPTH > 1                  /* non-mono bitmap targets */

+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 matrix.c
+#endif

 #if (LCD_WIDTH > 138)
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 invadrox.c
 superdom.c
 #endif
+#endif

 #endif /* LCD_DEPTH > 1 */

diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
index c497c49..52c9810 100644
--- a/apps/plugins/SUBDIRS
+++ b/apps/plugins/SUBDIRS
@@ -1,6 +1,8 @@
 /* For all targets */
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 shortcuts
 text_viewer
+#endif

 /* For various targets... */

@@ -12,6 +14,7 @@ clock
 /* For all targets with a bitmap display */
 #ifdef HAVE_LCD_BITMAP

+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 #if    (CONFIG_KEYPAD != ONDIO_PAD) /* not enough buttons */ \
     && (CONFIG_KEYPAD != SANSA_M200_PAD) /* not enough buttons */ \
     && (LCD_PIXELFORMAT != HORIZONTAL_PACKING) /* TODO */ \
@@ -20,7 +23,9 @@ clock
                                    (LCD_HEIGHT == 128) && (LCD_DEPTH == 2))
 rockboy
 #endif
+#endif

+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 #ifdef HAVE_TAGCACHE
 pictureflow
 #endif
@@ -46,10 +51,12 @@ frotz
 zxbox
 #endif
 #endif
+#endif /* (CONFIG_PLATFORM & PLATFORM_HOSTED) */

 #endif /* HAVE_LCD_BITMAP */

 /* For all big enough colour screens, iriver H1x0 and iAudio M5 */
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 #if defined(HAVE_LCD_COLOR) && LCD_HEIGHT > 96\
  || defined(IRIVER_H100_SERIES) || defined(IAUDIO_M5)
 pacbox
@@ -60,12 +67,15 @@ pacbox
     && (MEMORYSIZE > 2 && !defined(RB_PROFILE))
 doom
 #endif
+#endif          /* (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0 */

 /* For all the swcodec targets */
 #if CONFIG_CODEC == SWCODEC

 #if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 midi
+#endif
 mikmod
 #endif

@@ -79,12 +89,16 @@ pdbox
 #endif

 #if !defined(RB_PROFILE) && MEMORYSIZE > 2  /* mpegplayer allocates at least 2MB of RAM */
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 mpegplayer
 #endif
+#endif

 #endif /* CONFIG_CODEC == SWCODEC */

 /* Lua needs at least 160 KB to work in */
 #if PLUGIN_BUFFER_SIZE >= 0x80000
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) == 0
 lua
 #endif
+#endif
diff --git a/apps/plugins/lib/simple_viewer.c b/apps/plugins/lib/simple_viewer.c
index 16cbcb3..ece7d34 100644
--- a/apps/plugins/lib/simple_viewer.c
+++ b/apps/plugins/lib/simple_viewer.c
@@ -48,8 +48,13 @@ static bool isbrchr(const unsigned char *str, int len)
     while(*p)
     {
         int n = rb->utf8seek(p, 1);
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)         /* DIRTY HACK, need to find real cause */
+        if (len == n && !strncmp(p, str, len))
+            return true;
+#else
         if (len == n && !rb->strncmp(p, str, len))
             return true;
+#endif
         p += n;
     }
     return false;
diff --git a/tools/configure b/tools/configure
index 6be8f61..b46a2e3 100755
--- a/tools/configure
+++ b/tools/configure
@@ -2879,7 +2879,7 @@ fi
     bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
     bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
     appextra="recorder:gui:radio"
-    plugins=""
+    plugins="yes"
     swcodec="yes"
     # architecture, manufacturer and model for the target-tree build
     t_cpu="hosted"