Index: include/histogram.h
===================================================================
--- include/histogram.h	(Revision 701)
+++ include/histogram.h	(Arbeitskopie)
@@ -27,7 +27,7 @@
 extern void histogram_set_main(unsigned int main);
 
 extern unsigned char histogram[5][HISTO_WIDTH];
-extern long exposition_thresh;
+extern unsigned long exposition_thresh;
 extern long under_exposed;
 extern long over_exposed;
 extern long histo_magnification;
Index: include/platform.h
===================================================================
--- include/platform.h	(Revision 701)
+++ include/platform.h	(Arbeitskopie)
@@ -6,11 +6,11 @@
 #define SSID_INVALID (-32767)
 #define ASID_INVALID (-32767)
 
-#define MODE_MASK               0x0300
-#define MODE_REC                0x0100
-#define MODE_PLAY               0x0200
+#define MODE_MASK               0x0300u
+#define MODE_REC                0x0100u
+#define MODE_PLAY               0x0200u
 
-#define MODE_SHOOTING_MASK      0x00FF
+#define MODE_SHOOTING_MASK      0x00FFu
 
 enum {
 MODE_AUTO               =1,
@@ -476,6 +476,7 @@
 void set_ev_video(int); 
 //dng related
 void reverse_bytes_order(char* start, int count); 
+void reverse_bytes_order_target(char* start, int count, char* dest);
 void save_ext_for_dng(void);
 void change_ext_to_dng(void);
 void change_ext_to_default(void);
Index: include/conf.h
===================================================================
--- include/conf.h	(Revision 701)
+++ include/conf.h	(Arbeitskopie)
@@ -312,8 +312,8 @@
 
 // reyalp: putting these in conf, since the conf values are lookups for them
 // prefixes and extentions available for raw images (index with conf.raw_prefix etc)
-#define NUM_IMG_PREFIXES 3 // IMG_ CRW_ SND_ (could add ETC_ SDR_ AUT_ MVI_ MRK_)
-#define NUM_IMG_EXTS 5 // .JPG .CRW .CR2 .THM .WAV (could add .AVI .MRK)
+#define NUM_IMG_PREFIXES 9 // see conf.c for the list
+#define NUM_IMG_EXTS 8 // see conf.c for the list
 extern const char* img_prefixes[NUM_IMG_PREFIXES];
 extern const char* img_exts[NUM_IMG_EXTS];
 // ugh, but various things need it
Index: include/lolevel.h
===================================================================
--- include/lolevel.h	(Revision 701)
+++ include/lolevel.h	(Arbeitskopie)
@@ -42,6 +42,10 @@
 extern void _SleepTask(long msec);
 extern void __attribute__((noreturn)) _ExitTask();
 extern int _taskNameToId(char* taskName); // VxWorks only, task's name first letter must be 't', maximum 10 chars total 
+// for getting and setting environment variables. Those somehow seem to
+// influence time based functions, but this is mainly for playing around
+extern char* _getenv(const char* name); 
+extern int _putenv(char* string);
 extern const char *_taskName(int taskID); // VxWorks only for now
 extern int _taskIdListGet(int *idlist,int max); // VxWorks only for now
 extern void _taskSuspend(int taskId); 
Index: platform/g9/sub/100d/makefile.inc.new
===================================================================
--- platform/g9/sub/100d/makefile.inc.new	(Revision 0)
+++ platform/g9/sub/100d/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/g9/sub/100g/makefile.inc.new
===================================================================
--- platform/g9/sub/100g/makefile.inc.new	(Revision 0)
+++ platform/g9/sub/100g/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/g9/makefile.inc.new
===================================================================
--- platform/g9/makefile.inc.new	(Revision 0)
+++ platform/g9/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/s2is/sub/100e/makefile.inc.new
===================================================================
--- platform/s2is/sub/100e/makefile.inc.new	(Revision 0)
+++ platform/s2is/sub/100e/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/s2is/sub/100f/makefile.inc.new
===================================================================
--- platform/s2is/sub/100f/makefile.inc.new	(Revision 0)
+++ platform/s2is/sub/100f/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/s2is/sub/100g/makefile.inc.new
===================================================================
--- platform/s2is/sub/100g/makefile.inc.new	(Revision 0)
+++ platform/s2is/sub/100g/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/s2is/makefile.inc.new
===================================================================
--- platform/s2is/makefile.inc.new	(Revision 0)
+++ platform/s2is/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/s3is/sub/100a/makefile.inc.new
===================================================================
--- platform/s3is/sub/100a/makefile.inc.new	(Revision 0)
+++ platform/s3is/sub/100a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/s3is/makefile.inc.new
===================================================================
--- platform/s3is/makefile.inc.new	(Revision 0)
+++ platform/s3is/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus65_sd630/sub/100a/makefile.inc.new
===================================================================
--- platform/ixus65_sd630/sub/100a/makefile.inc.new	(Revision 0)
+++ platform/ixus65_sd630/sub/100a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus65_sd630/makefile.inc.new
===================================================================
--- platform/ixus65_sd630/makefile.inc.new	(Revision 0)
+++ platform/ixus65_sd630/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/s5is/sub/101a/makefile.inc.new
===================================================================
--- platform/s5is/sub/101a/makefile.inc.new	(Revision 0)
+++ platform/s5is/sub/101a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o  lib.o movie_rec.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/s5is/sub/101b/makefile.inc.new
===================================================================
--- platform/s5is/sub/101b/makefile.inc.new	(Revision 0)
+++ platform/s5is/sub/101b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o lib.o movie_rec.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/s5is/makefile.inc.new
===================================================================
--- platform/s5is/makefile.inc.new	(Revision 0)
+++ platform/s5is/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus70_sd1000/sub/100c/makefile.inc.new
===================================================================
--- platform/ixus70_sd1000/sub/100c/makefile.inc.new	(Revision 0)
+++ platform/ixus70_sd1000/sub/100c/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus70_sd1000/sub/101b/makefile.inc.new
===================================================================
--- platform/ixus70_sd1000/sub/101b/makefile.inc.new	(Revision 0)
+++ platform/ixus70_sd1000/sub/101b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus70_sd1000/sub/102a/makefile.inc.new
===================================================================
--- platform/ixus70_sd1000/sub/102a/makefile.inc.new	(Revision 0)
+++ platform/ixus70_sd1000/sub/102a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c 
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus70_sd1000/makefile.inc.new
===================================================================
--- platform/ixus70_sd1000/makefile.inc.new	(Revision 0)
+++ platform/ixus70_sd1000/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus80_sd1100/sub/101a/makefile.inc.new
===================================================================
--- platform/ixus80_sd1100/sub/101a/makefile.inc.new	(Revision 0)
+++ platform/ixus80_sd1100/sub/101a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o lib.o debug.o ../../leds.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c debug.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus80_sd1100/sub/100c/makefile.inc.new
===================================================================
--- platform/ixus80_sd1100/sub/100c/makefile.inc.new	(Revision 0)
+++ platform/ixus80_sd1100/sub/100c/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o debug.o ../../leds.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c debug.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus80_sd1100/makefile.inc.new
===================================================================
--- platform/ixus80_sd1100/makefile.inc.new	(Revision 0)
+++ platform/ixus80_sd1100/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixusW_sd430/sub/110a/makefile.inc.new
===================================================================
--- platform/ixusW_sd430/sub/110a/makefile.inc.new	(Revision 0)
+++ platform/ixusW_sd430/sub/110a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixusW_sd430/makefile.inc.new
===================================================================
--- platform/ixusW_sd430/makefile.inc.new	(Revision 0)
+++ platform/ixusW_sd430/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus850_sd800/sub/100e/makefile.inc.new
===================================================================
--- platform/ixus850_sd800/sub/100e/makefile.inc.new	(Revision 0)
+++ platform/ixus850_sd800/sub/100e/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus850_sd800/makefile.inc.new
===================================================================
--- platform/ixus850_sd800/makefile.inc.new	(Revision 0)
+++ platform/ixus850_sd800/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus40_sd300/sub/100j/stubs_auto.S
===================================================================
--- platform/ixus40_sd300/sub/100j/stubs_auto.S	(Revision 701)
+++ platform/ixus40_sd300/sub/100j/stubs_auto.S	(Arbeitskopie)
@@ -21,6 +21,7 @@
 STUB(FF814C10)
 STUB(FF81FF3C)
 STUB(FF821B20)
+STUB(ff821cb4)
 STUB(FF822320)
 STUB(FF822738)
 STUB(FF822F5C)
@@ -55,10 +56,9 @@
 STUB(FF9553E4)
 STUB(FF9554BC)
 STUB(FFA449B4)
+STUB(ffaaa210)
 STUB(FFAB7D4C)
 STUB(FFAB83DC)
-STUB(ff821cb4)
-STUB(ffaaa210)
 STUB(ffabdc74)
 STUB(ffabe140)
 STUB(ffac039c)
Index: platform/ixus40_sd300/sub/100j/makefile.inc.new
===================================================================
--- platform/ixus40_sd300/sub/100j/makefile.inc.new	(Revision 0)
+++ platform/ixus40_sd300/sub/100j/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus40_sd300/sub/100k/makefile.inc.new
===================================================================
--- platform/ixus40_sd300/sub/100k/makefile.inc.new	(Revision 0)
+++ platform/ixus40_sd300/sub/100k/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus40_sd300/makefile.inc.new
===================================================================
--- platform/ixus40_sd300/makefile.inc.new	(Revision 0)
+++ platform/ixus40_sd300/makefile.inc.new	(Revision 0)
@@ -0,0 +1,5 @@
+
+EXTRA_ASM_OBJS := stubs_auto.o
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a700/sub/100b/makefile.inc.new
===================================================================
--- platform/a700/sub/100b/makefile.inc.new	(Revision 0)
+++ platform/a700/sub/100b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a700/makefile.inc.new
===================================================================
--- platform/a700/makefile.inc.new	(Revision 0)
+++ platform/a700/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a620/sub/100f/makefile.inc.new
===================================================================
--- platform/a620/sub/100f/makefile.inc.new	(Revision 0)
+++ platform/a620/sub/100f/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a620/makefile.inc.new
===================================================================
--- platform/a620/makefile.inc.new	(Revision 0)
+++ platform/a620/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a720/sub/100c/stubs_auto.S
===================================================================
--- platform/a720/sub/100c/stubs_auto.S	(Revision 701)
+++ platform/a720/sub/100c/stubs_auto.S	(Arbeitskopie)
@@ -8,10 +8,13 @@
 STUB(FFC00FB8)
 STUB(FFC014D0)
 STUB(FFC02D70)
+STUB(FFc0357C)
 STUB(FFC049E0)
+STUB(FFc04ACC)
 STUB(FFC04EB0)
 STUB(FFC05088)
 STUB(FFC051CC)
+STUB(FFc095A0)
 STUB(FFC09A18)
 STUB(FFC0BA5C)
 STUB(FFC0BBC0)
@@ -378,6 +381,3 @@
 STUB(FFD621F8)
 STUB(FFE3B620)
 STUB(FFE3CED0)
-STUB(FFc0357C)
-STUB(FFc04ACC)
-STUB(FFc095A0)
Index: platform/a720/sub/100c/makefile.inc.new
===================================================================
--- platform/a720/sub/100c/makefile.inc.new	(Revision 0)
+++ platform/a720/sub/100c/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a720/makefile.inc.new
===================================================================
--- platform/a720/makefile.inc.new	(Revision 0)
+++ platform/a720/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a540/sub/100b/makefile.inc.new
===================================================================
--- platform/a540/sub/100b/makefile.inc.new	(Revision 0)
+++ platform/a540/sub/100b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a540/makefile.inc.new
===================================================================
--- platform/a540/makefile.inc.new	(Revision 0)
+++ platform/a540/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/s80/sub/100g/makefile.inc.new
===================================================================
--- platform/s80/sub/100g/makefile.inc.new	(Revision 0)
+++ platform/s80/sub/100g/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/s80/makefile.inc.new
===================================================================
--- platform/s80/makefile.inc.new	(Revision 0)
+++ platform/s80/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus60_sd600/sub/100a/makefile.inc.new
===================================================================
--- platform/ixus60_sd600/sub/100a/makefile.inc.new	(Revision 0)
+++ platform/ixus60_sd600/sub/100a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o  lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus60_sd600/sub/100d/makefile.inc.new
===================================================================
--- platform/ixus60_sd600/sub/100d/makefile.inc.new	(Revision 0)
+++ platform/ixus60_sd600/sub/100d/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o  lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus60_sd600/makefile.inc.new
===================================================================
--- platform/ixus60_sd600/makefile.inc.new	(Revision 0)
+++ platform/ixus60_sd600/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a640/sub/100b/makefile.inc.new
===================================================================
--- platform/a640/sub/100b/makefile.inc.new	(Revision 0)
+++ platform/a640/sub/100b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a640/makefile.inc.new
===================================================================
--- platform/a640/makefile.inc.new	(Revision 0)
+++ platform/a640/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a460/sub/100d/makefile.inc.new
===================================================================
--- platform/a460/sub/100d/makefile.inc.new	(Revision 0)
+++ platform/a460/sub/100d/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a460/makefile.inc.new
===================================================================
--- platform/a460/makefile.inc.new	(Revision 0)
+++ platform/a460/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus960_sd950/sub/100d/makefile.inc.new
===================================================================
--- platform/ixus960_sd950/sub/100d/makefile.inc.new	(Revision 0)
+++ platform/ixus960_sd950/sub/100d/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus960_sd950/makefile.inc.new
===================================================================
--- platform/ixus960_sd950/makefile.inc.new	(Revision 0)
+++ platform/ixus960_sd950/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus860_sd870/sub/100c/makefile.inc.new
===================================================================
--- platform/ixus860_sd870/sub/100c/makefile.inc.new	(Revision 0)
+++ platform/ixus860_sd870/sub/100c/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o touch_wheel.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c touch_wheel.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus860_sd870/makefile.inc.new
===================================================================
--- platform/ixus860_sd870/makefile.inc.new	(Revision 0)
+++ platform/ixus860_sd870/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a560/sub/100a/makefile.inc.new
===================================================================
--- platform/a560/sub/100a/makefile.inc.new	(Revision 0)
+++ platform/a560/sub/100a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a560/makefile.inc.new
===================================================================
--- platform/a560/makefile.inc.new	(Revision 0)
+++ platform/a560/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/tx1/sub/101b/makefile.inc.new
===================================================================
--- platform/tx1/sub/101b/makefile.inc.new	(Revision 0)
+++ platform/tx1/sub/101b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/tx1/sub/100g/makefile.inc.new
===================================================================
--- platform/tx1/sub/100g/makefile.inc.new	(Revision 0)
+++ platform/tx1/sub/100g/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/tx1/makefile.inc.new
===================================================================
--- platform/tx1/makefile.inc.new	(Revision 0)
+++ platform/tx1/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus55_sd450/sub/100b/makefile.inc.new
===================================================================
--- platform/ixus55_sd450/sub/100b/makefile.inc.new	(Revision 0)
+++ platform/ixus55_sd450/sub/100b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus55_sd450/sub/100c/makefile.inc.new
===================================================================
--- platform/ixus55_sd450/sub/100c/makefile.inc.new	(Revision 0)
+++ platform/ixus55_sd450/sub/100c/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus55_sd450/sub/100d/makefile.inc.new
===================================================================
--- platform/ixus55_sd450/sub/100d/makefile.inc.new	(Revision 0)
+++ platform/ixus55_sd450/sub/100d/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus55_sd450/makefile.inc.new
===================================================================
--- platform/ixus55_sd450/makefile.inc.new	(Revision 0)
+++ platform/ixus55_sd450/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/makefile_sub.inc.new
===================================================================
--- platform/makefile_sub.inc.new	(Revision 0)
+++ platform/makefile_sub.inc.new	(Revision 0)
@@ -0,0 +1,78 @@
+# This file is included from */sub/*/makefile.inc.new
+
+
+
+LOCAL_CFLAGS:=-DLOW_LEVEL
+
+sub-platform-all: $(subdir)/libplatformsub.a
+
+TARGET_PRIMARY = PRIMARY.BIN
+
+#OBJS= should be defined in */sub/*/Makefile
+
+
+$(eval $(call gen-rule, sub-platform-distclean, clean, rm -f $(subdir)/stubs_entry.S $(subdir)/stubs_auto.S; rm -rf $(subdir)/.dep ))
+
+OBJS:=$(call subdirize,$(ASM_OBJS) $(C_OBJS) )
+$(eval $(call gen-rule, sub-platform-clean, $(PLATFORM)-platform-clean, rm -f $(OBJS) $(subdir)/libplatformsub.a $(subdir)/stubs_entry.S.err $(subdir)/stubs_not_found_names.err ))
+ASM_OBJS:=$(call subdirize,$(ASM_OBJS))
+C_OBJS:=$(call subdirize,$(C_OBJS))
+
+STUBS_AUTO_DEPS:=$(call subdirize , $(STUBS_AUTO_DEPS) )
+
+$(eval $(call ar-targets, libplatformsub.a, $(OBJS), ))
+
+$(eval $(call compile-asm-targets, $(ASM_OBJS) ) )
+$(eval $(call compile-targets, $(C_OBJS), $(LOCAL_CFLAGS) ) )
+
+ifeq ($(OSTYPE),Windows)
+$(eval $(call gen-rule, $(subdir)/stubs_auto.S, $(STUBS_AUTO_DEPS), \
+	cat $(STUBS_AUTO_DEPS) | \						
+	    grep -E 'B[[:alpha:]]*[[:space:]]+sub_[0-9A-Fa-f]' | \
+	    sed 's/.*[[:space:]]sub_\\([0-9A-Fa-f]*\\).*/\\1/' | \
+	    $(SORT) | uniq | \
+	    awk 'BEGIN {print "/* THIS FILE IS GENERATED */\n/* DO NOT EDIT THIS FILE! */\n\n#include \"stubs_asm.h\"\n"} \
+	        {printf("STUB(%s)\n",$$$$1)}' > $(subdir)/stubs_auto.S	
+	    ) )
+else							
+$(eval $(call gen-rule, $(subdir)/stubs_auto.S, $(STUBS_AUTO_DEPS), \
+	cat $(STUBS_AUTO_DEPS) | \
+	    grep -E 'B[[:alpha:]]*[[:space:]]+sub_[0-9A-Fa-f]' | \
+	    sed 's/.*[[:space:]]sub_\([0-9A-Fa-f]*\).*/\1/' | \
+	    $(SORT) | uniq | \
+	    awk 'BEGIN {print "/* THIS FILE IS GENERATED */\n/* DO NOT EDIT THIS FILE! */\n\n#include \"stubs_asm.h\"\n"} \
+	        {printf("STUB(%s)\n",$$$$1)}' > $(subdir)/stubs_auto.S \
+	    ))
+endif
+
+define extract-stubs-entry
+	rm -f stubs_entry.S.err
+	if [ -s $(TARGET_PRIMARY) ] ; then \
+	  $(topdir)tools/finsig $(TARGET_PRIMARY) $(ROMBASEADDR) > stubs_entry.S ; \
+	else \
+	  echo CAUTION! \'stubs_entry.S\' is not uptated due to target firmware binary not found! ; \
+	  touch stubs_entry.S ; \
+	fi ; \
+	if [ "X`grep 'ERROR' stubs_entry.S`" != "X" ] ; then \
+	  grep "ERROR" stubs_entry.S | $(ESED) "s/\/\/ ERROR: ([^ ]+) is not found.*/\1/" | $(SORT) | uniq > stubs_nf.names ; \
+	  grep -E "NH?STUB" stubs_entry_2.S | $(ESED) "s/ *NH?STUB\( *([^ ,]+).*/\1/" | $(SORT) | uniq > stubs_mn.names ; \
+	  comm -23 stubs_nf.names stubs_mn.names > stubs_not_found_names.err ; \
+	  rm -f stubs_nf.names stubs_mn.names ; \
+	  if [ -s stubs_not_found_names.err ] ; then \
+	    echo ERROR! There are unresolved addresses in \'stubs_entry.S\' \($(PLATFORM)-$(PLATFORMSUB)\) for the following names: ; \
+	    cat stubs_not_found_names.err ; \
+	    echo Please, add them into \'stubs_entry_2.S\' manually! ; \
+	    mv stubs_entry.S stubs_entry.S.err ; \
+	    exit 1 ; \
+	  fi ; \
+	  rm -f stubs_not_found_names.err ; \
+	fi
+endef
+
+$(eval $(call gen-rule, $(subdir)/stubs_entry.S, $(TARGET_PRIMARY) $(topdir)tools/signatures_$(PLATFORMOS).h $(topdir)tools/finsig$(EXE), \
+	$(extract-stubs-entry) ) )
+
+$(TARGET_PRIMARY):
+	touch $(TARGET_PRIMARY)
+
+# vim: ft=make
Index: platform/ixus75_sd750/sub/100b/makefile.inc.new
===================================================================
--- platform/ixus75_sd750/sub/100b/makefile.inc.new	(Revision 0)
+++ platform/ixus75_sd750/sub/100b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus75_sd750/sub/101a/makefile.inc.new
===================================================================
--- platform/ixus75_sd750/sub/101a/makefile.inc.new	(Revision 0)
+++ platform/ixus75_sd750/sub/101a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c 
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus75_sd750/sub/102a/makefile.inc.new
===================================================================
--- platform/ixus75_sd750/sub/102a/makefile.inc.new	(Revision 0)
+++ platform/ixus75_sd750/sub/102a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus75_sd750/makefile.inc.new
===================================================================
--- platform/ixus75_sd750/makefile.inc.new	(Revision 0)
+++ platform/ixus75_sd750/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus700_sd500/sub/101a/makefile.inc.new
===================================================================
--- platform/ixus700_sd500/sub/101a/makefile.inc.new	(Revision 0)
+++ platform/ixus700_sd500/sub/101a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus700_sd500/sub/101b/makefile.inc.new
===================================================================
--- platform/ixus700_sd500/sub/101b/makefile.inc.new	(Revision 0)
+++ platform/ixus700_sd500/sub/101b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus700_sd500/makefile.inc.new
===================================================================
--- platform/ixus700_sd500/makefile.inc.new	(Revision 0)
+++ platform/ixus700_sd500/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus800_sd700/sub/100b/makefile.inc.new
===================================================================
--- platform/ixus800_sd700/sub/100b/makefile.inc.new	(Revision 0)
+++ platform/ixus800_sd700/sub/100b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus800_sd700/sub/101b/makefile.inc.new
===================================================================
--- platform/ixus800_sd700/sub/101b/makefile.inc.new	(Revision 0)
+++ platform/ixus800_sd700/sub/101b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus800_sd700/makefile.inc.new
===================================================================
--- platform/ixus800_sd700/makefile.inc.new	(Revision 0)
+++ platform/ixus800_sd700/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixusizoom_sd30/sub/100g/makefile.inc.new
===================================================================
--- platform/ixusizoom_sd30/sub/100g/makefile.inc.new	(Revision 0)
+++ platform/ixusizoom_sd30/sub/100g/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixusizoom_sd30/makefile.inc.new
===================================================================
--- platform/ixusizoom_sd30/makefile.inc.new	(Revision 0)
+++ platform/ixusizoom_sd30/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus750_sd550/sub/100f/makefile.inc.new
===================================================================
--- platform/ixus750_sd550/sub/100f/makefile.inc.new	(Revision 0)
+++ platform/ixus750_sd550/sub/100f/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus750_sd550/sub/100g/makefile.inc.new
===================================================================
--- platform/ixus750_sd550/sub/100g/makefile.inc.new	(Revision 0)
+++ platform/ixus750_sd550/sub/100g/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus750_sd550/makefile.inc.new
===================================================================
--- platform/ixus750_sd550/makefile.inc.new	(Revision 0)
+++ platform/ixus750_sd550/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a610/sub/100e/makefile.inc.new
===================================================================
--- platform/a610/sub/100e/makefile.inc.new	(Revision 0)
+++ platform/a610/sub/100e/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a610/sub/100f/makefile.inc.new
===================================================================
--- platform/a610/sub/100f/makefile.inc.new	(Revision 0)
+++ platform/a610/sub/100f/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a610/makefile.inc.new
===================================================================
--- platform/a610/makefile.inc.new	(Revision 0)
+++ platform/a610/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus50_sd400/sub/101a/makefile.inc.new
===================================================================
--- platform/ixus50_sd400/sub/101a/makefile.inc.new	(Revision 0)
+++ platform/ixus50_sd400/sub/101a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus50_sd400/sub/101b/makefile.inc.new
===================================================================
--- platform/ixus50_sd400/sub/101b/makefile.inc.new	(Revision 0)
+++ platform/ixus50_sd400/sub/101b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus50_sd400/makefile.inc.new
===================================================================
--- platform/ixus50_sd400/makefile.inc.new	(Revision 0)
+++ platform/ixus50_sd400/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/sx100is/sub/100b/boot.c
===================================================================
--- platform/sx100is/sub/100b/boot.c	(Revision 701)
+++ platform/sx100is/sub/100b/boot.c	(Arbeitskopie)
@@ -101,6 +101,7 @@
 		 "BCC	loc_FFC00200\n"
 
 		 "BL	sub_FFC00FB8_my\n"				// <----------
+		 ".pool\n" // needed for gcc 4.x
 	);
 } //#fe
 
@@ -156,6 +157,7 @@
 		 "BL	sub_FFC02D70\n"
 		 "ADD	SP, SP,	#0x74\n"
 		 "LDR	PC, [SP],#4\n"
+		 ".pool\n" // needed for gcc 4.x
 	);
 }; //#fe
 
Index: platform/sx100is/sub/100b/makefile.inc.new
===================================================================
--- platform/sx100is/sub/100b/makefile.inc.new	(Revision 0)
+++ platform/sx100is/sub/100b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/sx100is/sub/100c/boot.c
===================================================================
--- platform/sx100is/sub/100c/boot.c	(Revision 701)
+++ platform/sx100is/sub/100c/boot.c	(Arbeitskopie)
@@ -101,6 +101,7 @@
 		 "BCC	loc_FFC00200\n"
 
 		 "BL	sub_FFC00FB8_my\n"				// <----------
+		 ".pool\n"
 	);
 } //#fe
 
@@ -156,6 +157,7 @@
 		 "BL	sub_FFC02D70\n"
 		 "ADD	SP, SP,	#0x74\n"
 		 "LDR	PC, [SP],#4\n"
+		 ".pool\n"
 	);
 }; //#fe
 
Index: platform/sx100is/sub/100c/makefile.inc.new
===================================================================
--- platform/sx100is/sub/100c/makefile.inc.new	(Revision 0)
+++ platform/sx100is/sub/100c/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/sx100is/makefile.inc.new
===================================================================
--- platform/sx100is/makefile.inc.new	(Revision 0)
+++ platform/sx100is/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a710/sub/100a/makefile.inc.new
===================================================================
--- platform/a710/sub/100a/makefile.inc.new	(Revision 0)
+++ platform/a710/sub/100a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a710/makefile.inc.new
===================================================================
--- platform/a710/makefile.inc.new	(Revision 0)
+++ platform/a710/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a530/sub/100a/makefile.inc.new
===================================================================
--- platform/a530/sub/100a/makefile.inc.new	(Revision 0)
+++ platform/a530/sub/100a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a530/makefile.inc.new
===================================================================
--- platform/a530/makefile.inc.new	(Revision 0)
+++ platform/a530/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a450/sub/100d/makefile.inc.new
===================================================================
--- platform/a450/sub/100d/makefile.inc.new	(Revision 0)
+++ platform/a450/sub/100d/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a450/makefile.inc.new
===================================================================
--- platform/a450/makefile.inc.new	(Revision 0)
+++ platform/a450/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/ixus950_sd850/main.c
===================================================================
--- platform/ixus950_sd850/main.c	(Revision 701)
+++ platform/ixus950_sd850/main.c	(Arbeitskopie)
@@ -25,13 +25,13 @@
 
 int get_focal_length(int zp) {
     if (zp<0) return fl_tbl[0];
-    else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1];
+    else if (zp>(int)NUM_FL-1) return fl_tbl[NUM_FL-1];
     else return fl_tbl[zp];
 }
 
 int get_zoom_x(int zp) {
     if (zp<1) return 10;
-    else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0];
+    else if (zp>(int)NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0];
     else return fl_tbl[zp]*10/fl_tbl[0];
 }
 
@@ -68,7 +68,8 @@
 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0]))
 
 int mode_get() {
-    int mode, i, t=0xFF;
+    unsigned i;
+    int mode, t=0xFF;
 
     mode  = (physw_status[2] & 0x1000)?MODE_REC:MODE_PLAY;    
     _GetPropertyCase(49, &t, 4);
Index: platform/ixus950_sd850/sub/100c/stubs_entry_2.S
===================================================================
--- platform/ixus950_sd850/sub/100c/stubs_entry_2.S	(Revision 701)
+++ platform/ixus950_sd850/sub/100c/stubs_entry_2.S	(Arbeitskopie)
@@ -57,7 +57,11 @@
 NHSTUB(GetOpticalTemperature, 0xFFA3D3E0)
 NHSTUB(PT_PlaySound, 0xFFB1A0A4)
 NHSTUB(taskNameToId, 0xFF935A64)
-
+// those are mainly to play around with them for me and to figure out how time
+// related functions work on my cam
+NHSTUB(getenv,0xFF9263C0)
+NHSTUB(putenv,0xFF92641C)
+NSTUB(localtime_r, 0xff924788)
 //NHSTUB(EnterToCompensationEVF, 0xFFFFFFFF) // Stub not found. When found, remove dummy function from lib.c.
 //NHSTUB(ExitFromCompensationEVF, 0xFFFFFFFF) // Stub not found. When found, remove dummy function from lib.c.
 NHSTUB(DoAFLock, 0xffb09200)
Index: platform/ixus950_sd850/sub/100c/makefile.inc.new
===================================================================
--- platform/ixus950_sd850/sub/100c/makefile.inc.new	(Revision 0)
+++ platform/ixus950_sd850/sub/100c/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/ixus950_sd850/shooting.c
===================================================================
--- platform/ixus950_sd850/shooting.c	(Revision 701)
+++ platform/ixus950_sd850/shooting.c	(Arbeitskopie)
@@ -118,7 +118,7 @@
 char* shooting_get_tv_str()
 {
     short int tvv;
-    long i;
+    unsigned i;
 //    _GetPropertyCase(69, &tvv, sizeof(tvv));
 //    _GetPropertyCase(262, &tvv, sizeof(tvv));
     _GetPropertyCase(PROPCASE_TV, &tvv, sizeof(tvv));	// 262 for DiGiC III
@@ -132,7 +132,7 @@
 char* shooting_get_av_str()
 {
     short int avv;
-    long i;
+    unsigned i;
 //    _GetPropertyCase(68, &avv, sizeof(avv));
 //    _GetPropertyCase(23, &avv, sizeof(avv));
     _GetPropertyCase(PROPCASE_AV, &avv, sizeof(avv));	// 23 for DiGiC III
@@ -146,7 +146,7 @@
 char* shooting_get_iso_str()
 {
     short int isov;
-    long i;
+    unsigned i;
     _GetPropertyCase(PROPCASE_ISO_MODE, &isov, sizeof(isov));
     for (i=0;i<ISO_SIZE;i++){
    if (iso_table[i].prop_id == isov)
Index: platform/ixus950_sd850/makefile.inc.new
===================================================================
--- platform/ixus950_sd850/makefile.inc.new	(Revision 0)
+++ platform/ixus950_sd850/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a630/sub/100c/makefile.inc.new
===================================================================
--- platform/a630/sub/100c/makefile.inc.new	(Revision 0)
+++ platform/a630/sub/100c/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a630/makefile.inc.new
===================================================================
--- platform/a630/makefile.inc.new	(Revision 0)
+++ platform/a630/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/makefile_generic.inc.new
===================================================================
--- platform/makefile_generic.inc.new	(Revision 0)
+++ platform/makefile_generic.inc.new	(Revision 0)
@@ -0,0 +1,25 @@
+
+
+LOCAL_CFLAGS:=-DLOW_LEVEL
+
+SUBDIRS=sub
+
+C_OBJS := main.o lib.o wrappers.o kbd.o shooting.o $(EXTRA_C_OBJS)
+ASM_OBJS := $(EXTRA_ASM_OBJS)
+OBJS := $(C_OBJS) $(ASM_OBJS)
+
+# stubs_init.o
+OBJS := $(call subdirize,$(OBJS) )
+C_OBJS := $(call subdirize,$(C_OBJS) )
+ASM_OBJS := $(call subdirize,$(ASM_OBJS) )
+
+$(eval $(call compile-targets, $(C_OBJS), $(LOCAL_CFLAGS) ) )
+$(eval $(call compile-asm-targets, $(ASM_OBJS), $(LOCAL_CFLAGS) ) )
+
+$(eval $(call ar-targets, libplatform.a, $(OBJS), ))
+
+$(eval $(call gen-rule, $(PLATFORM)-platform-clean,, rm -f $(OBJS) $(subdir)/*.$(DEPSUFFIX) $(subdir)/sub/$(PLATFORMSUB)/*.$(DEPSUFFIX) $(subdir)/libplatform.a ))
+
+$(PLATFORM)-platform-distclean: $(PLATFORM)-platform-clean
+
+# vim: ft=make
Index: platform/a550/sub/100c/makefile.inc.new
===================================================================
--- platform/a550/sub/100c/makefile.inc.new	(Revision 0)
+++ platform/a550/sub/100c/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a550/makefile.inc.new
===================================================================
--- platform/a550/makefile.inc.new	(Revision 0)
+++ platform/a550/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a650/sub/100d/makefile.inc.new
===================================================================
--- platform/a650/sub/100d/makefile.inc.new	(Revision 0)
+++ platform/a650/sub/100d/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a650/makefile.inc.new
===================================================================
--- platform/a650/makefile.inc.new	(Revision 0)
+++ platform/a650/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/generic/wrappers.c
===================================================================
--- platform/generic/wrappers.c	(Revision 701)
+++ platform/generic/wrappers.c	(Arbeitskopie)
@@ -792,6 +792,62 @@
  return 0;
 }
 
+void reverse_bytes_order_target(char* start, int count, char* dest) {
+// note, we will go to count rounded up to the nearest 32
+asm volatile(
+	"ldr	r3, =0xFF00FF\n"	// r3 = mask
+	"add	r1, r0, r1\n"		// r1 = start + count
+"LOOPB:\n"
+	"ldm	r0, {R4-R11}\n"		// load 8 words
+	
+	// out = ((in>>8) & 0xFF00FF) | ((in&0xFF00FF) << 8);
+	"mov	r12, r4, lsr #8\n"	// r12 = in >> 8
+	"and	r12, r12, r3\n"		// r12 &= 0xFF00FF
+	"and	r4, r4, r3\n"		// r4 = in & 0xFF00FF
+	"orr	r4, r12, r4, asl #8\n" // out = r12 | (r4 << 8)
+
+	"mov	r12, r5, lsr #8\n"
+	"and	r12, r12, r3\n"
+	"and	r5, r5, r3\n"
+	"orr	r5, r12, r5, asl #8\n"
+
+	"mov	r12, r6, lsr #8\n"
+	"and	r12, r12, r3\n"
+	"and	r6, r6, r3\n"
+	"orr	r6, r12, r6, asl #8\n"
+
+	"mov	r12, r7, lsr #8\n"
+	"and	r12, r12, r3\n"
+	"and	r7, r7, r3\n"
+	"orr	r7, r12, r7, asl #8\n"
+
+	"mov	r12, r8, lsr #8\n"
+	"and	r12, r12, r3\n"
+	"and	r8, r8, r3\n"
+	"orr	r8, r12, r8, asl #8\n"
+
+	"mov	r12, r9, lsr #8\n"
+	"and	r12, r12, r3\n"
+	"and	r9, r9, r3\n"
+	"orr	r9, r12, r9, asl #8\n"
+
+	"mov	r12, r10, lsr #8\n"
+	"and	r12, r12, r3\n"
+	"and	r10, r10, r3\n"
+	"orr	r10, r12, r10, asl #8\n"
+
+	"mov	r12, r11, lsr #8\n"
+	"and	r12, r12, r3\n"
+	"and	r11, r11, r3\n"
+	"orr	r11, r12, r11, asl #8\n"
+
+	"stmia	r2!, {r4-r11}\n"	// store and increment
+
+	"cmp	r0, r1\n"
+	"bcc	LOOPB\n"
+	:::"r0","r1","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12"
+ );
+}
 void reverse_bytes_order(char* start, int count){
 // note, we will go to count rounded up to the nearest 32
 asm volatile(
Index: platform/generic/shooting.c
===================================================================
--- platform/generic/shooting.c	(Revision 701)
+++ platform/generic/shooting.c	(Arbeitskopie)
@@ -110,7 +110,7 @@
 const ShutterSpeed *shooting_get_tv_line()
 {
     short tvv;
-    long i;
+    unsigned i;
     _GetPropertyCase(PROPCASE_USER_TV, &tvv, sizeof(tvv));
     for (i=0;i<SS_SIZE;i++){
 	   if (shutter_speeds_table[i].prop_id == tvv)
@@ -123,7 +123,7 @@
 {
 #if CAM_HAS_USER_TV_MODES
 if ((mode_get()&MODE_MASK) != MODE_PLAY){
-    long i;
+    unsigned i;
 //    if ((v<SSID_MIN) || (v>SSID_MAX))
 //	return;
  for (i=0;i<SS_SIZE;i++){
@@ -162,7 +162,7 @@
 int shooting_get_iso_mode()
 {
     short isov;
-    long i;
+    unsigned i;
     _GetPropertyCase(PROPCASE_ISO_MODE, &isov, sizeof(isov));
     for (i=0;i<ISO_SIZE;i++){
 			if (iso_table[i].prop_id == isov)
@@ -564,7 +564,7 @@
 
 void shooting_set_tv96(short v, short is_now)
 {
- long i;
+    unsigned i;
 //    if ((v<SSID_MIN) || (v>SSID_MAX))
 //	return;
 if ((mode_get()&MODE_MASK) != MODE_PLAY){
@@ -820,7 +820,7 @@
 
 void shooting_set_iso_mode(int v)
 {
- long i;
+ unsigned i;
  for (i=0;i<ISO_SIZE;i++){
 	if (iso_table[i].id == v){
 	    short vv = iso_table[i].prop_id;
@@ -980,7 +980,7 @@
 
 void shooting_video_bitrate_change(int v){
  int m[]={1,2,3,4,5,6,7,8,10,12};  // m[v]/4 = bitrate*1x
- if (v>=(sizeof(m)/sizeof(m[0]))) v=(sizeof(m)/sizeof(m[0]))-1;
+ if ((unsigned)v>=(sizeof(m)/sizeof(m[0]))) v=(sizeof(m)/sizeof(m[0]))-1;
 #if CAM_CHDK_HAS_EXT_VIDEO_MENU
  change_video_tables(m[v],4);
 #endif
@@ -1022,7 +1022,7 @@
 
 short shooting_get_av96_override_value()
 {
-  if (conf.av_override_value<=AS_SIZE)	return (short) aperture_sizes_table[conf.av_override_value-1].prop_id;
+  if ((unsigned)conf.av_override_value<=AS_SIZE)	return (short) aperture_sizes_table[conf.av_override_value-1].prop_id;
   else return (short) (AV96_MAX+32*(conf.av_override_value-AS_SIZE));
 }
 
Index: platform/generic/makefile.inc.new
===================================================================
--- platform/generic/makefile.inc.new	(Revision 0)
+++ platform/generic/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/a570/sub/101a/makefile.inc.new
===================================================================
--- platform/a570/sub/101a/makefile.inc.new	(Revision 0)
+++ platform/a570/sub/101a/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a570/sub/100e/makefile.inc.new
===================================================================
--- platform/a570/sub/100e/makefile.inc.new	(Revision 0)
+++ platform/a570/sub/100e/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a570/makefile.inc.new
===================================================================
--- platform/a570/makefile.inc.new	(Revision 0)
+++ platform/a570/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/g7/sub/100e/makefile.inc.new
===================================================================
--- platform/g7/sub/100e/makefile.inc.new	(Revision 0)
+++ platform/g7/sub/100e/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/g7/sub/100g/makefile.inc.new
===================================================================
--- platform/g7/sub/100g/makefile.inc.new	(Revision 0)
+++ platform/g7/sub/100g/makefile.inc.new	(Revision 0)
@@ -0,0 +1,7 @@
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/g7/sub/100i/makefile.inc.new
===================================================================
--- platform/g7/sub/100i/makefile.inc.new	(Revision 0)
+++ platform/g7/sub/100i/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/g7/sub/100j/makefile.inc.new
===================================================================
--- platform/g7/sub/100j/makefile.inc.new	(Revision 0)
+++ platform/g7/sub/100j/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o mount.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c mount.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/g7/makefile.inc.new
===================================================================
--- platform/g7/makefile.inc.new	(Revision 0)
+++ platform/g7/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: platform/makefile.inc.new
===================================================================
--- platform/makefile.inc.new	(Revision 0)
+++ platform/makefile.inc.new	(Revision 0)
@@ -0,0 +1,13 @@
+
+LOCAL_SUBDIRS := $(PLATFORM)
+LOCAL_SUBSUBDIRS := $(subdir)/$(PLATFORM)/sub/$(PLATFORMSUB)
+
+$(eval $(call gen-rule, platform-clean, $(foreach lsub,$(LOCAL_SUBDIRS),sub-platform-clean), ))
+
+$(eval $(call gen-rule, platform-distclean, $(foreach lsub,$(LOCAL_SUBDIRS),sub-platform-distclean), ))
+LOCAL_SUBDIRS:=$(call subdirize,$(LOCAL_SUBDIRS) )
+
+$(foreach subdir,$(LOCAL_SUBDIRS),$(eval include $(subdir)/makefile.inc.new) )
+$(foreach subdir,$(LOCAL_SUBSUBDIRS),$(eval include $(subdir)/makefile.inc.new) )
+
+# vim: ft=make
Index: platform/a590/sub/101b/makefile.inc.new
===================================================================
--- platform/a590/sub/101b/makefile.inc.new	(Revision 0)
+++ platform/a590/sub/101b/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a590/sub/100e/makefile.inc.new
===================================================================
--- platform/a590/sub/100e/makefile.inc.new	(Revision 0)
+++ platform/a590/sub/100e/makefile.inc.new	(Revision 0)
@@ -0,0 +1,11 @@
+
+
+ASM_OBJS:= stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o 
+C_OBJS:= boot.o capt_seq.o movie_rec.o lib.o
+
+
+STUBS_AUTO_DEPS:=boot.c capt_seq.c movie_rec.c
+
+
+include $(subdir)/../../../makefile_sub.inc.new
+# vim: ft=make
Index: platform/a590/makefile.inc.new
===================================================================
--- platform/a590/makefile.inc.new	(Revision 0)
+++ platform/a590/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/platform/makefile_generic.inc.new
+
+# vim: ft=make
Index: makefile.inc
===================================================================
--- makefile.inc	(Revision 701)
+++ makefile.inc	(Arbeitskopie)
@@ -368,5 +368,5 @@
 	done
 
 ifdef SILENT
-.SILENT:
+
 endif
Index: core/gui_sokoban.c
===================================================================
--- core/gui_sokoban.c	(Revision 701)
+++ core/gui_sokoban.c	(Arbeitskopie)
@@ -214,7 +214,7 @@
 
 //-------------------------------------------------------------------
 static void sokoban_next_level() {
-    if (++conf.sokoban_level >= num_levels) conf.sokoban_level = 0;
+    if ((unsigned)(++conf.sokoban_level) >= num_levels) conf.sokoban_level = 0;
     sokoban_set_level(conf.sokoban_level);
     need_redraw = 1;
 }
@@ -313,7 +313,7 @@
     if(!num_levels) {
         return 0;
     }
-    else if(conf.sokoban_level >= num_levels) {
+    else if((unsigned)conf.sokoban_level >= num_levels) {
         conf.sokoban_level = 0;
     }
     cell_size = screen_height/FIELD_HEIGHT;
Index: core/script.c
===================================================================
--- core/script.c	(Revision 701)
+++ core/script.c	(Arbeitskopie)
@@ -82,7 +82,7 @@
 //-------------------------------------------------------------------
 static void process_title(const char *title) {
     register const char *ptr = title;
-    register int i=0;
+    register unsigned int i=0;
 
     while (ptr[0]==' ' || ptr[0]=='\t') ++ptr; // whitespaces
     while (i<(sizeof(script_title)-1) && ptr[i] && ptr[i]!='\r' && ptr[i]!='\n') {
@@ -95,7 +95,7 @@
 //-------------------------------------------------------------------
 static int process_param(const char *param, int update) {
     register const char *ptr = param;
-    register int n, i=0;
+    register unsigned int n, i=0;
 
     while (ptr[0]==' ' || ptr[0]=='\t') ++ptr; // whitespaces
     if (ptr[0] && (ptr[0]>='a' && ptr[0]<='a'+SCRIPT_NUM_PARAMS) && (ptr[1]==' ' || ptr[1]=='\t')) {
Index: core/raw_merge.c
===================================================================
--- core/raw_merge.c	(Revision 701)
+++ core/raw_merge.c	(Arbeitskopie)
@@ -48,10 +48,10 @@
 
     struct stat st;
 
-    if (stat((char *)from,&st) != 0 || st.st_size!=hook_raw_size()) 
+    if (stat((char *)from,&st) != 0 || (long)st.st_size!=hook_raw_size()) 
         return 0;
 
-    if (stat((char *)sub,&st) != 0 || st.st_size!=hook_raw_size()) 
+    if (stat((char *)sub,&st) != 0 || (long)st.st_size!=hook_raw_size()) 
         return 0;
 
      if( (baccum=malloc(RAW_ROWLEN)) &&
@@ -171,7 +171,7 @@
     return;
 
   stat(filename,&st);
-  if (st.st_size!=hook_raw_size())
+  if ((long)st.st_size!=hook_raw_size())
     return;
 
   started();
Index: core/dng.c
===================================================================
--- core/dng.c	(Revision 701)
+++ core/dng.c	(Arbeitskopie)
@@ -383,6 +383,17 @@
  cam_AsShotNeutral[1]=wb[1];
  cam_AsShotNeutral[3]=wb[0];
  cam_AsShotNeutral[5]=wb[2];
+
+	FILE *cfd;
+
+	cfd = fopen("A/CHDK/propdump","wb");
+	const char* start = (const char*)0x2cb148;
+	start += 0x580;
+	int len = 32*280; // space for all of them?
+	fwrite(start,len,1,cfd);
+	fclose(cfd);
+
+
  return &data;
 }
 
Index: core/conf.c
===================================================================
--- core/conf.c	(Revision 701)
+++ core/conf.c	(Arbeitskopie)
@@ -52,8 +52,8 @@
 
 // reyalp: putting these in conf, since the conf values are lookups for them
 // prefixes and extentions available for raw images (index with conf.raw_prefix etc)
-const char* img_prefixes[NUM_IMG_PREFIXES]={ "IMG_", "CRW_", "SND_" /*, "AUT_", "ETC_","SDR_", "MVI_", "MRK_"*/};
-const char* img_exts[NUM_IMG_EXTS]={ ".JPG", ".CRW", ".CR2", ".THM", ".WAV"/*, ".AVI", ".MRK"*/};
+const char* img_prefixes[NUM_IMG_PREFIXES]={ "IMG_", "CRW_", "SND_", "crw_" , "AUT_", "ETC_","SDR_", "MVI_", "MRK_"};
+const char* img_exts[NUM_IMG_EXTS]={ ".JPG", ".CRW", ".CR2", ".THM", ".WAV", ".AVI", ".MRK", ".DNG" };
 // ugh
 const char *video_bitrate_strings[VIDEO_BITRATE_STEPS]={ "0.25x", "0.5x","0.75x", "1x", "1.25x", "1.5x", "1.75x", "2x", "2.5x", "3x"};
 
@@ -508,7 +508,7 @@
 
 //-------------------------------------------------------------------
 void conf_load_defaults() {
-    register int i;
+    register unsigned int i;
 
     for (i=0; i<CONF_NUM; ++i) {
         switch (conf_info[i].type) {
@@ -528,7 +528,7 @@
 //-------------------------------------------------------------------
 void conf_save() {
     static const long t=CONF_MAGICK_VALUE;
-    register int i;
+    register unsigned int i;
     int fd;
     char *buf=umalloc(sizeof(t)+CONF_NUM*(sizeof(conf_info[0].id)+sizeof(conf_info[0].size))+sizeof(conf));
     char *p=buf;
@@ -554,7 +554,8 @@
 
 //-------------------------------------------------------------------
 void conf_restore() {
-    int fd, rcnt, i;
+    unsigned rcnt, i;
+    int fd;
     unsigned short id, size;
     char *buf;
     int offs;
@@ -597,7 +598,7 @@
 
         for (i=0; i<CONF_NUM; ++i) {
             if (conf_info[i].id==id && conf_info[i].size==size) {
-                if (offs + size <= rcnt) {
+                if ((unsigned)(offs + size) <= rcnt) {
                    memcpy(conf_info[i].var, buf+offs, size);
                    if (conf_info[i].func) {
                        conf_info[i].func();
Index: core/gui_lang.c
===================================================================
--- core/gui_lang.c	(Revision 701)
+++ core/gui_lang.c	(Arbeitskopie)
@@ -546,7 +546,6 @@
 "425 \"RAW buffer cached\"\n"
 "426 \"Cannot load CHDK/badpixel.bin\\nPlease run \\nCHDK/SCRIPTS/TEST/badpixel.lua\"\n"
 "427 \"Show saving time\"\n"
-
 "428 \"Connect 4\"\n"
 "429 \"Opponent:\"\n"
 "430 \"Human\"\n"
@@ -575,6 +574,9 @@
 "452 \"Restart Camera...\"\n"
 "453 \"Force manual flash\"\n"
 
+"451 \"Property Compare/Dump\"\n"
+"452 \"Params Compare/Dump\"\n"
+
 ;
 
 //-------------------------------------------------------------------
Index: core/gui_lang.h
===================================================================
--- core/gui_lang.h	(Revision 701)
+++ core/gui_lang.h	(Arbeitskopie)
@@ -563,9 +563,11 @@
 #define LANG_MENU_RESET_FILES         451
 #define LANG_MENU_RESTART_CAMERA         452
 #define LANG_MENU_FLASH_MANUAL_OVERRIDE        453
+#define LANG_XXX_PROPCOMPARE		454
+#define LANG_XXX_PARAMCOMPARE		455
 //-------------------------------------------------------------------
 
-#define GUI_LANG_ITEMS                  453
+#define GUI_LANG_ITEMS                  455
 
 //-------------------------------------------------------------------
 extern void gui_lang_init();
Index: core/gui_space.c
===================================================================
--- core/gui_space.c	(Revision 701)
+++ core/gui_space.c	(Arbeitskopie)
@@ -18,7 +18,7 @@
 }
 
 static void gui_space_draw_spacebar_horizontal () {
-    coord x;
+    int x;
     color cl = conf.space_color;
     int perc = get_space_perc(),height = 2;
     float size = 0;
@@ -26,7 +26,7 @@
     cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
+    cl = (GetFreeCardSpaceKb()/1024<=(unsigned)conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 2){
     cl = conf.space_color;
@@ -71,7 +71,7 @@
 
 
 static void gui_space_draw_spacebar_vertical () {
-    coord y;
+    int y;
     color cl = conf.space_color;
     int perc = get_space_perc(), width = 2;
     float size = 0;
@@ -79,7 +79,7 @@
     cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
+    cl = (GetFreeCardSpaceKb()/1024<=(unsigned)conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 2){
     cl = conf.space_color;
@@ -126,14 +126,14 @@
 }
 
 static void gui_space_draw_icon () {
-    coord x;
+    int x;
     color cl = conf.space_color;
     int perc = get_space_perc();
     if (conf.space_warn_type == 0){
     cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
+    cl = (GetFreeCardSpaceKb()/1024<=(unsigned)conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 2){
     cl = conf.space_color;
@@ -182,7 +182,7 @@
     cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
+    cl = (GetFreeCardSpaceKb()/1024<=(unsigned)conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 2){
     cl = conf.space_color;
@@ -200,7 +200,7 @@
     cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
+    cl = (GetFreeCardSpaceKb()/1024<=(unsigned)conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 2){
     cl = conf.space_color;
Index: core/edgeoverlay.c
===================================================================
--- core/edgeoverlay.c	(Revision 701)
+++ core/edgeoverlay.c	(Arbeitskopie)
@@ -178,7 +178,7 @@
 
 	static int shotTaken = 0;
 	static int imgmem = 0;
-	static int ymin = 0;
+	static unsigned int ymin = 0;
 	static int thresh;
 	thresh = conf.edge_overlay_thresh; //40
 	static int xoffset = 0;
@@ -187,7 +187,8 @@
 	static char strbuf[7] = "Frozen";
 	static unsigned char *img;
 	int i, hi, c;
-	int x, y, h, v, ymax, y1, x1, y2;
+	unsigned ymax, x, y, y1, x1;
+	int h, v, y2;
 	const char * ptrh1;
 	const char * ptrh2;
 	const char * ptrv1;
Index: core/gui_read.c
===================================================================
--- core/gui_read.c	(Revision 701)
+++ core/gui_read.c	(Arbeitskopie)
@@ -19,7 +19,7 @@
 #define READ_BUFFER_SIZE  100
 static char buffer[READ_BUFFER_SIZE+1];
 static long last_time;
-static int xx, yy;
+static unsigned int xx, yy;
 static int pause;
 
 //-------------------------------------------------------------------
@@ -83,7 +83,7 @@
 
 //-------------------------------------------------------------------
 static int read_fit_next_char(int ch) {
-    return (xx+rbf_char_width(ch) < x+w);
+    return ((unsigned)(xx+rbf_char_width(ch)) < x+w);
 }
 
 //-------------------------------------------------------------------
@@ -142,7 +142,7 @@
                                         ll+=rbf_char_width(buffer[ii]);
                                     }
                                 }
-                                if (xx+ll>=x+w && ll<w) {
+                                if (xx+ll>=x+w && (unsigned)ll<w) {
                                     read_goto_next_line();
                                     continue;
                                 }
Index: core/gui.c
===================================================================
--- core/gui.c	(Revision 701)
+++ core/gui.c	(Arbeitskopie)
@@ -46,7 +46,7 @@
 //-------------------------------------------------------------------
 
 #define OPTIONS_AUTOSAVE
-#define SPLASH_TIME               20
+#define SPLASH_TIME               5 // XXX A configure option for this would be great
 
 int script_params_has_changed=0;
 //shortcuts
@@ -156,6 +156,7 @@
 static void gui_menuproc_edge_free(int arg);
 #ifdef OPT_DEBUGGING
 void gui_compare_props(int arg);
+void gui_compare_params(int arg);
 #endif
 #ifndef OPTIONS_AUTOSAVE
 static void gui_menuproc_save(int arg);
@@ -422,6 +423,8 @@
     {0x2a,LANG_MENU_MAIN_DEBUG,              MENUITEM_SUBMENU,   (int*)&debug_submenu },
 #endif
     {0x86,LANG_MENU_REMOTE_PARAM,            MENUITEM_SUBMENU,   (int*)&remote_submenu },
+    {0x80,LANG_XXX_PROPCOMPARE,        MENUITEM_PROC,    (int*)gui_compare_props},
+    {0x80,LANG_XXX_PARAMCOMPARE,        MENUITEM_PROC,   (int*)gui_compare_params},
 #if defined (DNG_EXT_FROM)
     {0x71,LANG_MENU_DNG_VIA_USB,        MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.dng_usb_ext , (int)cb_change_dng_usb_ext},
 #endif
@@ -991,7 +994,7 @@
     conf.curve_enable+=change;
     if (conf.curve_enable<0)
         conf.curve_enable=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.curve_enable>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.curve_enable>=(sizeof(modes)/sizeof(modes[0])))
         conf.curve_enable=0;
 
 	if(change)
@@ -1006,7 +1009,7 @@
     conf.script_startup+=change;
     if (conf.script_startup<0)
         conf.script_startup=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.script_startup>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.script_startup>=(sizeof(modes)/sizeof(modes[0])))
         conf.script_startup=0;
 
     return modes[conf.script_startup];
@@ -1023,7 +1026,7 @@
         conf.script_param_set += change;
         if (conf.script_param_set < 0)
             conf.script_param_set = (sizeof(modes)/sizeof(modes[0]))-1;
-        else if (conf.script_param_set >= (sizeof(modes)/sizeof(modes[0])))
+        else if ((unsigned)conf.script_param_set >= (sizeof(modes)/sizeof(modes[0])))
             conf.script_param_set=0;
 
         if (!load_params_values(conf.script_file, 1, 0))
@@ -1042,7 +1045,7 @@
     conf.override_disable+=change;
     if (conf.override_disable<0)
         conf.override_disable=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.override_disable>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.override_disable>=(sizeof(modes)/sizeof(modes[0])))
         conf.override_disable=0;
 
     return modes[conf.override_disable];
@@ -1055,7 +1058,7 @@
     conf.histo_mode+=change;
     if (conf.histo_mode<0)
         conf.histo_mode=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.histo_mode>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.histo_mode>=(sizeof(modes)/sizeof(modes[0])))
         conf.histo_mode=0;
 
     histogram_set_mode(conf.histo_mode);
@@ -1070,7 +1073,7 @@
     conf.show_temp+=change;
     if (conf.show_temp<0)
         conf.show_temp=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.show_temp>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.show_temp>=(sizeof(modes)/sizeof(modes[0])))
         conf.show_temp=0;
 
     return modes[conf.show_temp];
@@ -1083,7 +1086,7 @@
     conf.histo_layout+=change;
     if (conf.histo_layout<0)
         conf.histo_layout=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.histo_layout>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.histo_layout>=(sizeof(modes)/sizeof(modes[0])))
         conf.histo_layout=0;
 
     if (conf.histo_layout==OSD_HISTO_LAYOUT_Y || conf.histo_layout==OSD_HISTO_LAYOUT_Y_argb) {
@@ -1102,7 +1105,7 @@
     conf.font_cp+=change;
     if (conf.font_cp<0)
         conf.font_cp=(sizeof(fonts)/sizeof(fonts[0]))-1;
-    else if (conf.font_cp>=(sizeof(fonts)/sizeof(fonts[0])))
+    else if ((unsigned)conf.font_cp>=(sizeof(fonts)/sizeof(fonts[0])))
         conf.font_cp=0;
 
     if (change != 0) {
@@ -1167,7 +1170,7 @@
     conf.raw_nr+=change;
     if (conf.raw_nr<0)
         conf.raw_nr=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.raw_nr>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.raw_nr>=(sizeof(modes)/sizeof(modes[0])))
         conf.raw_nr=0;
 
     return modes[conf.raw_nr];
@@ -1181,7 +1184,7 @@
     conf.reader_codepage+=change;
     if (conf.reader_codepage<0)
         conf.reader_codepage=(sizeof(cps)/sizeof(cps[0]))-1;
-    else if (conf.reader_codepage>=(sizeof(cps)/sizeof(cps[0])))
+    else if ((unsigned)conf.reader_codepage>=(sizeof(cps)/sizeof(cps[0])))
         conf.reader_codepage=0;
 
     return cps[conf.reader_codepage];
@@ -1194,7 +1197,7 @@
     conf.autoiso_shutter+=change;
     if (conf.autoiso_shutter<0)
         conf.autoiso_shutter=(sizeof(shutter)/sizeof(shutter[0]))-1;
-    else if (conf.autoiso_shutter>=(sizeof(shutter)/sizeof(shutter[0])))
+    else if ((unsigned)conf.autoiso_shutter>=(sizeof(shutter)/sizeof(shutter[0])))
         conf.autoiso_shutter=0;
 
     return shutter[conf.autoiso_shutter];
@@ -1207,7 +1210,7 @@
     conf.zebra_mode+=change;
     if (conf.zebra_mode<0)
         conf.zebra_mode=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.zebra_mode>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.zebra_mode>=(sizeof(modes)/sizeof(modes[0])))
         conf.zebra_mode=0;
 
     return modes[conf.zebra_mode];
@@ -1220,7 +1223,7 @@
     conf.zebra_draw_osd+=change;
     if (conf.zebra_draw_osd<0)
         conf.zebra_draw_osd=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.zebra_draw_osd>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.zebra_draw_osd>=(sizeof(modes)/sizeof(modes[0])))
         conf.zebra_draw_osd=0;
 
     return modes[conf.zebra_draw_osd];
@@ -1233,7 +1236,7 @@
     conf.zoom_value+=change;
     if (conf.zoom_value<0)
         conf.zoom_value=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.zoom_value>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.zoom_value>=(sizeof(modes)/sizeof(modes[0])))
         conf.zoom_value=0;
 
     return modes[conf.zoom_value];
@@ -1245,7 +1248,7 @@
     conf.show_values+=change;
     if (conf.show_values<0)
         conf.show_values=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.show_values>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.show_values>=(sizeof(modes)/sizeof(modes[0])))
         conf.show_values=0;
 
     return modes[conf.show_values];
@@ -1257,7 +1260,7 @@
     conf.nd_filter_state+=change;
     if (conf.nd_filter_state<0)
         conf.nd_filter_state=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.nd_filter_state>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.nd_filter_state>=(sizeof(modes)/sizeof(modes[0])))
         conf.nd_filter_state=0;
 
     return modes[conf.nd_filter_state];
@@ -1271,7 +1274,7 @@
     conf.show_dof+=change;
     if (conf.show_dof<0)
         conf.show_dof=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.show_dof>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.show_dof>=(sizeof(modes)/sizeof(modes[0])))
         conf.show_dof=0;
 
     return modes[conf.show_dof];
@@ -1284,7 +1287,7 @@
     conf.show_histo+=change;
     if (conf.show_histo<0)
         conf.show_histo=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.show_histo>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.show_histo>=(sizeof(modes)/sizeof(modes[0])))
         conf.show_histo=0;
 
     return modes[conf.show_histo];
@@ -1296,7 +1299,7 @@
     conf.show_clock+=change;
     if (conf.show_clock<0)
         conf.show_clock=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.show_clock>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.show_clock>=(sizeof(modes)/sizeof(modes[0])))
         conf.show_clock=0;
 
     return modes[conf.show_clock];
@@ -1308,7 +1311,7 @@
     conf.hide_osd+=change;
     if (conf.hide_osd<0)
         conf.hide_osd=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.hide_osd>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.hide_osd>=(sizeof(modes)/sizeof(modes[0])))
         conf.hide_osd=0;
 
     return modes[conf.hide_osd];
@@ -1320,7 +1323,7 @@
     conf.clock_format+=change;
     if (conf.clock_format<0)
         conf.clock_format=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.clock_format>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.clock_format>=(sizeof(modes)/sizeof(modes[0])))
         conf.clock_format=0;
 
     return modes[conf.clock_format];
@@ -1332,7 +1335,7 @@
     conf.clock_indicator+=change;
     if (conf.clock_indicator<0)
         conf.clock_indicator=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.clock_indicator>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.clock_indicator>=(sizeof(modes)/sizeof(modes[0])))
         conf.clock_indicator=0;
 
     return modes[conf.clock_indicator];
@@ -1344,7 +1347,7 @@
     conf.clock_halfpress+=change;
     if (conf.clock_halfpress<0)
         conf.clock_halfpress=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.clock_halfpress>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.clock_halfpress>=(sizeof(modes)/sizeof(modes[0])))
         conf.clock_halfpress=0;
 
     return modes[conf.clock_halfpress];
@@ -1356,7 +1359,7 @@
     conf.space_bar_show+=change;
     if (conf.space_bar_show<0)
         conf.space_bar_show=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.space_bar_show>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.space_bar_show>=(sizeof(modes)/sizeof(modes[0])))
         conf.space_bar_show=0;
 
     return modes[conf.space_bar_show];
@@ -1368,7 +1371,7 @@
     conf.space_bar_size+=change;
     if (conf.space_bar_size<0)
         conf.space_bar_size=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.space_bar_size>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.space_bar_size>=(sizeof(modes)/sizeof(modes[0])))
         conf.space_bar_size=0;
 
     return modes[conf.space_bar_size];
@@ -1380,7 +1383,7 @@
     conf.space_bar_width+=change;
     if (conf.space_bar_width<0)
         conf.space_bar_width=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.space_bar_width>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.space_bar_width>=(sizeof(modes)/sizeof(modes[0])))
         conf.space_bar_width=0;
 
     return modes[conf.space_bar_width];
@@ -1392,7 +1395,7 @@
     conf.space_warn_type+=change;
     if (conf.space_warn_type<0)
         conf.space_warn_type=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.space_warn_type>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.space_warn_type>=(sizeof(modes)/sizeof(modes[0])))
         conf.space_warn_type=0;
 
     return modes[conf.space_warn_type];
@@ -1404,7 +1407,7 @@
      conf.show_movie_time+=change;
      if (conf.show_movie_time<0)
          conf.show_movie_time=(sizeof(modes)/sizeof(modes[0]))-1;
-     else if (conf.show_movie_time>=(sizeof(modes)/sizeof(modes[0])))
+     else if ((unsigned)conf.show_movie_time>=(sizeof(modes)/sizeof(modes[0])))
          conf.show_movie_time=0;
  
      return modes[conf.show_movie_time];
@@ -1458,7 +1461,7 @@
     conf.alt_prevent_shutdown+=change;
     if (conf.alt_prevent_shutdown<0)
         conf.alt_prevent_shutdown=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.alt_prevent_shutdown>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.alt_prevent_shutdown>=(sizeof(modes)/sizeof(modes[0])))
         conf.alt_prevent_shutdown=0;
 
     return modes[conf.alt_prevent_shutdown];
@@ -1468,7 +1471,7 @@
     conf.fast_ev_step+=change;
     if (conf.fast_ev_step<0)
         conf.fast_ev_step=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.fast_ev_step>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.fast_ev_step>=(sizeof(modes)/sizeof(modes[0])))
         conf.fast_ev_step=0;
     return modes[conf.fast_ev_step];
 }
@@ -1478,7 +1481,7 @@
     conf.video_mode+=change;
     if (conf.video_mode<0)
         conf.video_mode=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.video_mode>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.video_mode>=(sizeof(modes)/sizeof(modes[0])))
         conf.video_mode=0;
 
     return modes[conf.video_mode];
@@ -1505,7 +1508,7 @@
     conf.tv_bracket_value+=change;
     if (conf.tv_bracket_value<0)
         conf.tv_bracket_value=sizeof(modes)/sizeof(modes[0])-1;
-    else if (conf.tv_bracket_value>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.tv_bracket_value>=(sizeof(modes)/sizeof(modes[0])))
         conf.tv_bracket_value=0;
 
     return modes[conf.tv_bracket_value]; 
@@ -1517,7 +1520,7 @@
     conf.av_bracket_value+=change;
     if (conf.av_bracket_value<0)
         conf.av_bracket_value=sizeof(modes)/sizeof(modes[0])-1;
-    else if (conf.av_bracket_value>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.av_bracket_value>=(sizeof(modes)/sizeof(modes[0])))
         conf.av_bracket_value=0;
 
     return modes[conf.av_bracket_value]; 
@@ -1529,7 +1532,7 @@
     conf.subj_dist_bracket_koef+=change;
     if (conf.subj_dist_bracket_koef<0)
         conf.subj_dist_bracket_koef=sizeof(modes)/sizeof(modes[0])-1;
-    else if (conf.subj_dist_bracket_koef>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.subj_dist_bracket_koef>=(sizeof(modes)/sizeof(modes[0])))
         conf.subj_dist_bracket_koef=0;
     
     return modes[conf.subj_dist_bracket_koef]; 
@@ -1541,7 +1544,7 @@
     conf.iso_bracket_koef+=change;
     if (conf.iso_bracket_koef<0)
         conf.iso_bracket_koef=sizeof(modes)/sizeof(modes[0])-1;
-    else if (conf.iso_bracket_koef>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.iso_bracket_koef>=(sizeof(modes)/sizeof(modes[0])))
         conf.iso_bracket_koef=0;
     
     return modes[conf.iso_bracket_koef]; 
@@ -1553,7 +1556,7 @@
     conf.bracket_type+=change;
     if (conf.bracket_type<0)
         conf.bracket_type=0;
-    else if (conf.bracket_type>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.bracket_type>=(sizeof(modes)/sizeof(modes[0])))
         conf.bracket_type=sizeof(modes)/sizeof(modes[0])-1;
 
     return modes[conf.bracket_type]; 
@@ -1573,7 +1576,7 @@
    else {
     if (conf.tv_override_koef<0)
         conf.tv_override_koef=sizeof(modes)/sizeof(modes[0])-1;
-    else if (conf.tv_override_koef>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.tv_override_koef>=(sizeof(modes)/sizeof(modes[0])))
         conf.tv_override_koef=0;
     }
     
@@ -1589,7 +1592,7 @@
        if (conf.tv_override_value<0) {
           conf.tv_override_value=sizeof(modes)/sizeof(modes[0])-1;
         }
-       else if (conf.tv_override_value>=(sizeof(modes)/sizeof(modes[0])))
+       else if ((unsigned)conf.tv_override_value>=(sizeof(modes)/sizeof(modes[0])))
          conf.tv_override_value=0;
        return modes[conf.tv_override_value]; 
      }
@@ -1612,7 +1615,7 @@
     conf.tv_enum_type+=change;
     if (conf.tv_enum_type<0)
         conf.tv_enum_type=sizeof(modes)/sizeof(modes[0])-1;
-    else if (conf.tv_enum_type>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.tv_enum_type>=(sizeof(modes)/sizeof(modes[0])))
         conf.tv_enum_type=0;
     if (change) {
       conf.tv_override_koef=6;	
@@ -1630,7 +1633,7 @@
     conf.iso_override_koef+=change;
     if (conf.iso_override_koef<0)
         conf.iso_override_koef=0;
-    else if (conf.iso_override_koef>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.iso_override_koef>=(sizeof(modes)/sizeof(modes[0])))
         conf.iso_override_koef=sizeof(modes)/sizeof(modes[0])-1;
     
     return modes[conf.iso_override_koef]; 
@@ -1654,7 +1657,7 @@
 
     conf.subj_dist_override_koef+=change;
     if (conf.subj_dist_override_koef<0) conf.subj_dist_override_koef=0;
-    else if (conf.subj_dist_override_koef>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.subj_dist_override_koef>=(sizeof(modes)/sizeof(modes[0])))
         conf.subj_dist_override_koef=sizeof(modes)/sizeof(modes[0])-1;
     
     return modes[conf.subj_dist_override_koef]; 
@@ -1753,7 +1756,7 @@
     conf.user_menu_enable+=change;
     if (conf.user_menu_enable<0)
         conf.user_menu_enable=(sizeof(modes)/sizeof(modes[0]))-1;
-    else if (conf.user_menu_enable>=(sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.user_menu_enable>=(sizeof(modes)/sizeof(modes[0])))
         conf.user_menu_enable=0;
 
     return modes[conf.user_menu_enable];
@@ -1764,7 +1767,7 @@
     static const int keys[]={0, KEY_SHOOT_HALF, KEY_SET }; 
     int i; 
  
-    for (i=0; i<sizeof(names)/sizeof(names[0]); ++i) { 
+    for (i=0; (unsigned)i<sizeof(names)/sizeof(names[0]); ++i) { 
         if (conf.video_af_key==keys[i]) { 
             break; 
         } 
@@ -1773,7 +1776,7 @@
     i+=change; 
     if (i<0) 
         i=(sizeof(names)/sizeof(names[0]))-1; 
-    else if (i>=(sizeof(names)/sizeof(names[0]))) 
+    else if ((unsigned)i>=(sizeof(names)/sizeof(names[0]))) 
         i=0; 
  
     conf.video_af_key = keys[i]; 
@@ -1785,7 +1788,7 @@
     conf.bad_pixel_removal+=change; 
     if (conf.bad_pixel_removal<0) 
         conf.bad_pixel_removal=(sizeof(modes)/sizeof(modes[0]))-1; 
-    else if (conf.bad_pixel_removal>=(sizeof(modes)/sizeof(modes[0]))) 
+    else if ((unsigned)conf.bad_pixel_removal>=(sizeof(modes)/sizeof(modes[0]))) 
         conf.bad_pixel_removal=0; 
  
     return lang_str(modes[conf.bad_pixel_removal]); 
@@ -1793,7 +1796,7 @@
  
 //-------------------------------------------------------------------
 void gui_update_script_submenu() {
-    register int p=0, i;
+    register unsigned int p=0, i;
 
     for (i=0; i<sizeof(script_submenu_items_top)/sizeof(script_submenu_items_top[0]); ++p, ++i) {
         script_submenu_items[p]=script_submenu_items_top[i];
@@ -1818,7 +1821,7 @@
  struct stat st;
  if (!filename) return;
  stat((char*)filename,&st);
- if (st.st_size!=hook_raw_size()) return;
+ if ((long)st.st_size!=hook_raw_size()) return;
  gui_mbox_init((int)"", LANG_RAW_DEVELOP_MESSAGE, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL);
  raw_prepare_develop((char*)filename);
 }
@@ -1888,7 +1891,7 @@
     conf.debug_shortcut_action += change;
     if (conf.debug_shortcut_action < 0) 
         conf.debug_shortcut_action = sizeof(modes)/sizeof(modes[0])-1;
-    else if (conf.debug_shortcut_action >= (sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.debug_shortcut_action >= (sizeof(modes)/sizeof(modes[0])))
         conf.debug_shortcut_action = 0;
     
     return modes[conf.debug_shortcut_action]; 
@@ -1900,7 +1903,7 @@
     conf.debug_display += change;
     if (conf.debug_display < 0) 
         conf.debug_display=sizeof(modes)/sizeof(modes[0])-1;
-    else if (conf.debug_display >= (sizeof(modes)/sizeof(modes[0])))
+    else if ((unsigned)conf.debug_display >= (sizeof(modes)/sizeof(modes[0])))
         conf.debug_display = 0;
     
     return modes[conf.debug_display]; 
@@ -1965,7 +1968,7 @@
 static volatile enum Gui_Mode gui_mode;
 static volatile int gui_restore;
 static volatile int gui_in_redraw;
-static int gui_splash, gui_splash_mode;
+static unsigned int gui_splash, gui_splash_mode;
 static char osd_buf[32];
 #ifdef OPTIONS_AUTOSAVE
 static Conf old_conf;
@@ -2744,7 +2747,8 @@
 
    {
 	static char sbuf[100];
-    int r,i, p, len;
+	unsigned len;
+    int r,i, p;
     if (conf.debug_display == DEBUG_DISPLAY_PROPS){
 
 	for (i=0;i<10;i++){
@@ -2958,7 +2962,7 @@
         "CHDK Firmware '" HDK_VERSION " " BUILD_NUMBER "'" , 
         "Build: " __DATE__ " " __TIME__ ,
         "Camera: " PLATFORM " - " PLATFORMSUB };
-    int i, l;
+	unsigned i, l;
     color cl = MAKE_COLOR(COLOR_RED, COLOR_WHITE);
 
     gui_splash_mode = (mode_get()&MODE_MASK);
@@ -2987,7 +2991,7 @@
       for(pos=0; pos<logo_size; pos++){
           char data = logo[pos];
           color c = color_lookup[(data>>5) & 0x07];
-          for(i=0; i<(data&0x1F)+1; i++){
+          for(i=0; i<(data&0x1FU)+1; i++){
               if (c!=0x00){
                   draw_pixel(offset_x+mx,offset_y+my,c);
               }
@@ -3279,7 +3283,7 @@
 	char buf[64];
 	int i;
 	int p;
-	int c;
+	int c = 0;
 
 
 	if( initialized )
@@ -3319,4 +3323,189 @@
 	initialized = 1;
 }
 
+#define NUM_params 256
+#define BLACKLIST_FILENAME "A/CHDK/DATA/BLACKLIST.PAR"
+static signed char *blacklist = 0;
+int shooting_get_param( int id )
+{
+	int r = 0;
+	int s = sizeof(r);
+	if( blacklist )
+	{
+		if( id < 0 || id >= NUM_params )
+		{
+			s = 0;
+		}
+		else
+		{
+			s = blacklist[id];
+		}
+	}
+	if( s )
+	{
+		get_parameter_data(id,&r,s);
+	}
+	return r;
+}
+
+void write_blacklist_file( const signed char* bl )
+{
+	int fd;
+	fd = open(BLACKLIST_FILENAME, O_RDWR|O_CREAT|O_TRUNC, 0777);
+	write(fd,bl,NUM_params);
+	close(fd);
+}
+
+void gui_compare_params(int arg)
+{
+	static int initialized = 0;
+	static int *params = 0;
+	char buf[64];
+	int i;
+	int p;
+	int c;
+	int fd;
+	int test = 0;
+
+	if( 0 == blacklist )
+	{ 
+		blacklist = malloc(NUM_params);
+		// blacklist creation/loading of next step wasn't done yet, lets have a look if...
+		// the file exists at all
+		struct stat s;
+		s.st_size = 0;
+
+		stat(BLACKLIST_FILENAME,&s);
+		if( s.st_size < NUM_params )
+		{ // either from another compile or broken in another way or not there or... well whatever
+			for(i = 0; i < NUM_params; ++i )
+			{ // initialize all to -8 meaning: not yet tested
+				blacklist[i] = -8;
+			}
+		}
+		else
+		{
+			// open and read the file
+			fd = open(BLACKLIST_FILENAME, O_RDONLY,0);
+			read(fd,blacklist,NUM_params);
+			close(fd);
+		}
+		/*
+		 * The following entries are possible with the said meaning in the
+		 * blacklist file:
+		 * -8 : This param has not yet been tested, you should do this
+		 * -4 : The last test was tried with reading 4 bytes and failed. Action to be taken: write 2
+		 * -2 : The last test was tried with reading 4 bytes and failed. Action to be taken: write 1
+		 * -1 : The last test was tried with reading 4 bytes and failed. Action to be taken: write 0
+		 *  0 : Not a single byte can ever be read from this location
+		 *  1 : Only ever read 1 byte from the location
+		 *  2 : Only ever read 2 bytes from the location
+		 *  4 : It is save to read 4 bytes from this location
+		 */
+		i = 0;
+		// skip all entries that have been tested already
+		while( i < NUM_params )
+		{
+			switch(blacklist[i])
+			{
+				case -8:
+					sprintf(buf,"Testing param %d read 1",i);
+					draw_string(16,16,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW));
+					// need to test, so... note in the array
+					blacklist[i] = -1;
+					write_blacklist_file(blacklist);
+					get_parameter_data(i,&test,1);
+
+					sprintf(buf,"Testing param %d read 2",i);
+					draw_string(16,16,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW));
+					// no crash? try more!
+					blacklist[i] = -2;
+					write_blacklist_file(blacklist);
+					get_parameter_data(i,&test,2);
+
+					sprintf(buf,"Testing param %d read 4",i);
+					draw_string(16,16,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW));
+					// no crash? try more!
+					blacklist[i] = -4;
+					write_blacklist_file(blacklist);
+					get_parameter_data(i,&test,4);
+
+					sprintf(buf,"Testing param %d was successfull up to 4",i);
+					draw_string(16,16,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW));
+					// still no crash? wow, nice
+					blacklist[i] = 4;
+					write_blacklist_file(blacklist);
+					break;
+				case -4: // last test failed, record this
+					blacklist[i] = 2;
+					break;
+				case -2: // last test failed, record this
+					blacklist[i] = 1;
+					break;
+				case -1: // last test failed, record this
+					blacklist[i] = 0;
+					break;
+				case 0:
+				case 1:
+				case 2:
+				case 4:
+				default:
+					// this one is safe...
+					break;
+			}
+			// advance to the next...
+			++i;
+		}
+		// we went here without any crashes, that means the blacklist is
+		// complete now
+		write_blacklist_file(blacklist);
+	}
+	if( 0 == params )
+	{
+		params = malloc(NUM_params * sizeof(int));
+	}
+
+	if( initialized )
+	{ // we have previous data set! do a comparison
+		c = 0;
+		for( i = 0; i < NUM_params; ++i )
+		{
+			p = shooting_get_param(i);
+			if( params[i] != p )
+			{
+				++c;
+				sprintf(buf,"%4d is %8d was %8d",i,p,params[i]);
+				draw_string(16,16*c,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW));
+			}
+			params[i] = p;
+			if( c == 12 )
+			{
+				++c;
+				sprintf(buf,"%s","Waiting 10 Seconds");
+				draw_string(16,16*c,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW));
+				msleep(10000);
+				c = 0;
+			}
+		}
+		++c;
+		sprintf(buf,"%s","Waiting 10 Seconds");
+		draw_string(16,16*c,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW));
+		msleep(10000);
+	}
+	else
+	{
+		// no previous data was set so we save the data initially
+		for( i = 0; i < NUM_params; ++i )
+		{
+#if 0
+			sprintf(buf,"About to read %d",i);
+			draw_string(16,16,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW));
+			msleep(1000);
 #endif
+			params[i] = shooting_get_param(i);
+		}
+	}
+	initialized = 1;
+}
+#endif
+// vim: tabstop=4 shiftwidth=4
Index: core/gui_mpopup.c
===================================================================
--- core/gui_mpopup.c	(Revision 701)
+++ core/gui_mpopup.c	(Arbeitskopie)
@@ -41,7 +41,7 @@
 
 //-------------------------------------------------------------------
 void gui_mpopup_init(const unsigned int flags, void (*on_select)(unsigned int actn)) {
-    int i;
+    unsigned int i;
 
     mpopup_actions_num = 0;
     for (i=0; i<ACTIONSNUM && mpopup_actions_num<MAX_ACTIONS; ++i) {
Index: core/gui_debug.c
===================================================================
--- core/gui_debug.c	(Revision 701)
+++ core/gui_debug.c	(Arbeitskopie)
@@ -12,9 +12,11 @@
 static void *addr;
 static char debug_to_draw;
 static char debug_cont_update;
+static char debug_auto_update;
 static char buf[32];
 static long dummy=0;
 static unsigned int step;
+static unsigned int step_pos;
 
 //-------------------------------------------------------------------
 #define SCREEN_COLOR            0xF7
@@ -24,47 +26,90 @@
     addr = st_addr;
     debug_to_draw = 1;
     debug_cont_update = 1;
+    debug_auto_update = 1;
     step = 4;
+    step_pos = 0;
     gui_set_mode(GUI_MODE_DEBUG);
 }
 
+// just a quick hack, a real memory layout manager would be cool
+int address_safe( void* addr, int len )
+{
+    char* pa = addr;
+    if (!(addr < (void*)0x2000000 || addr > (void*)0xFFC00000))
+    { // in a bad zone...
+	return 0;
+    }
+    if( len && !address_safe(pa+len,0 ) )
+    {
+	return 0;
+    }
+    return 1;
+}
 //-------------------------------------------------------------------
-static void gui_debug_draw_values(const coord y, void* addr) {
+static void gui_debug_draw_values(const coord y, char* addr) {
     int i;
+    int col = COLOR_WHITE;
 
-    if (!(addr<(void*)0x2000000 || addr>(void*)0xFFC00000)) { addr = &dummy; };
+    if( ! debug_auto_update )
+    {
+	return;
+    }
+    if (!address_safe(addr,0))
+    {
+        addr = (char*)&dummy; 
+	col = COLOR_RED;
+    }
 
     sprintf(buf, "0x%08X (%10u)", *((unsigned int*)addr), *((unsigned int*)addr));
-    draw_txt_string(10, y, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
+    draw_txt_string(10, y, buf, MAKE_COLOR(COLOR_BLACK, col));
 
+
     sprintf(buf, "0x%04X (%5hu)", *((unsigned short*)addr), *((unsigned short*)addr));
-    draw_txt_string(10, y+1, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
+    draw_txt_string(10, y+1, buf, MAKE_COLOR(COLOR_BLACK, col));
 
-    sprintf(buf, "0x%02X (%3hu)", *((unsigned char*)addr), *((unsigned char*)addr));
-    draw_txt_string(10, y+2, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
+    sprintf(buf, "0x%04X (%5hu)", *((unsigned short*)(addr+2)), *((unsigned short*)(addr+2)));
+    draw_txt_string(25, y+1, buf, MAKE_COLOR(COLOR_BLACK, col));
 
-//    sprintf(buf, "0x%lf", *((double*)addr));
-//    draw_txt_string(10, y+3, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
 
-    for (i=0; i<30; ++i) {
-        if (*((char*)(addr+i))) buf[i]=*((char*)(addr+i));
-        else break;
+    for(i=0; i < 4; ++i )
+    {
+	sprintf(buf, "x%02X(%3hu)", *((unsigned char*)(addr+i)), *((unsigned char*)(addr+i)));
+	draw_txt_string(10 + i*8, y+2, buf, MAKE_COLOR(COLOR_BLACK, col));
     }
-    while (i<30) {
-        buf[i++]=' ';
+
+#ifdef DEBUG_SHOW_DOUBLE
+    if( address_safe(addr,sizeof(double) ) )
+    {
+	sprintf(buf, "%f", *((double*)addr));
+	draw_txt_string(10, y+3, buf, MAKE_COLOR(COLOR_BLACK, col));
     }
-    buf[i]=0;
-    draw_txt_string(10, y+4, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
+#endif
+
+    for (i=0; i<31; ++i) {
+        if ( addr[i])
+	{
+	    buf[i] = addr[i];
+	}
+	else
+	{
+	    buf[i] = '.';
+	}
+    }
+    buf[31]=0;
+    draw_txt_string(10, y+4, buf, MAKE_COLOR(COLOR_BLACK, col));
 }
 
 //-------------------------------------------------------------------
 void gui_debug_draw() {
+    unsigned sinv = 9 - step_pos;
     switch (debug_to_draw) {
         case 1:
             draw_filled_rect(0, 0, screen_width-1, screen_height-1, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR));
             draw_txt_string(1, 0, "Address:", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
-            draw_txt_string(22, 0, "Incr:", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
-            draw_txt_string(39,0,  "Auto:", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
+            draw_txt_string(21, 0, "Incr:", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
+            draw_txt_string(38,0,  "A:", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
+            draw_txt_string(42,0,  "U:", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
             draw_txt_string(1, 1, "Values:",  MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
             draw_txt_string(2, 2, "DWORD  :", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
             draw_txt_string(2, 3, "WORD   :", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
@@ -75,20 +120,39 @@
             draw_txt_string(2, 8, "DWORD  :", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
             draw_txt_string(2, 9, "WORD   :", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
             draw_txt_string(2, 10, "BYTE   :", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
+            draw_txt_string(2, 12, "STRING :", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
+#ifdef DEBUG_SHOW_DOUBLE
+            draw_txt_string(2, 5, "DOUBLE :", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
             draw_txt_string(2, 11, "DOUBLE :", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
-            draw_txt_string(2, 12, "STRING :", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
+#endif
 
-            debug_to_draw = 2;
+	    debug_to_draw = 2;
             break;
         case 2:
             sprintf(buf, "0x%08X", addr);
+	    buf[sinv] = 0;
             draw_txt_string(10, 0, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
+
+            sprintf(buf, "0x%08X", addr);
+	    buf[sinv+1] = 0;
+            draw_txt_string(10+sinv, 0, buf+sinv, MAKE_COLOR(COLOR_BLACK, COLOR_GREEN));
+
+            sprintf(buf, "0x%08X", addr);
+            draw_txt_string(10+sinv+1, 0, buf+sinv+1, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
+
             sprintf(buf, "0x%08X", step);
-            draw_txt_string(28, 0, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
+            draw_txt_string(27, 0, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
+
+            sprintf(buf,"%0d",debug_auto_update);
+            draw_txt_string(40, 0, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
+
             sprintf(buf,"%0d",debug_cont_update);
             draw_txt_string(44, 0, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
             gui_debug_draw_values(2, addr);
-            gui_debug_draw_values(8, *((void**)addr));
+	    if ((addr<(void*)0x2000000 || addr>(void*)0xFFC00000))
+	    {
+		gui_debug_draw_values(8, *((void**)addr));
+	    }
             
             conf.mem_view_addr_init = (long)addr;
 
@@ -104,6 +168,11 @@
 void gui_debug_kbd_process() {
     switch (kbd_get_autoclicked_key()) {
     case KEY_DOWN:
+	debug_auto_update = !debug_auto_update;
+	if( debug_auto_update )
+	{
+	    debug_to_draw = 2;
+	}
         break;
     case KEY_UP:
 				debug_cont_update = !debug_cont_update;
@@ -118,6 +187,8 @@
         debug_to_draw = 2;
         break;
     case KEY_DISPLAY:
+	step_pos++;
+	step_pos %= 8;
         switch (step) {
             case 0x00000004: step = 0x00000010; break;
             case 0x10000000: step = 0x00000004; break;
@@ -127,17 +198,17 @@
         break;
     case KEY_ZOOM_IN: // reduce step
         switch (step) {
-            case 0x00000010: step = 0x0000004; break;
+            case 0x00000010: step = 0x0000004; step_pos = 0; break;
             case 0x00000004: break;
-            default: step>>=4; break;
+            default: step>>=4; step_pos--; break;
         }
 				debug_to_draw = 2;
 				break;
 		case KEY_ZOOM_OUT: // increase step
         switch (step) {
-            case 0x00000004: step = 0x00000010; break;
+            case 0x00000004: step = 0x00000010; step_pos = 1; break;
             case 0x10000000: break;
-            default: step<<=4; break;
+            default: step<<=4; step_pos++; break;
         }
 				debug_to_draw = 2;
 				break;
Index: core/makefile.inc.new
===================================================================
--- core/makefile.inc.new	(Revision 0)
+++ core/makefile.inc.new	(Revision 0)
@@ -0,0 +1,97 @@
+
+LOCAL_CFLAGS:=$(CTHUMB)
+
+# warning: library order matters!
+CORE_LDLIBS:= -lgcc
+CORE_LDOPTS=-nostdlib -Wl,--allow-shlib-undefined -Wl,-T,$(TOPDIR)/tools/link-boot.ld
+CORE_LDOPTS+=-Wl,-N,-Ttext,$(MEMISOSTART)
+
+OPT_OBJS:=
+ifdef OPT_GAME_REVERSI
+LOCAL_CFLAGS +=-DOPT_GAME_REVERSI
+OPT_OBJS+=gui_reversi.o
+endif
+ifdef OPT_GAME_SOKOBAN
+LOCAL_CFLAGS+=-DOPT_GAME_SOKOBAN
+OPT_OBJS+=gui_sokoban.o
+endif
+ifdef OPT_GAME_CONNECT4
+LOCAL_CFLAGS+=-DOPT_GAME_CONNECT4
+OPT_OBJS+=gui_4wins.o
+endif
+ifdef OPT_GAME_MASTERMIND
+LOCAL_CFLAGS+=-DOPT_GAME_MASTERMIND
+OPT_OBJS+=gui_mastermind.o
+endif
+ifdef OPT_CURVES
+LOCAL_CFLAGS+=-DOPT_CURVES
+OPT_OBJS+=curves.o
+endif
+ifdef OPT_TEXTREADER
+LOCAL_CFLAGS+=-DOPT_TEXTREADER
+OPT_OBJS+=gui_read.o 
+endif
+ifdef OPT_CALENDAR
+LOCAL_CFLAGS+=-DOPT_CALENDAR
+OPT_OBJS+=gui_calendar.o 
+endif
+ifdef OPT_DEBUGGING
+LOCAL_CFLAGS+=-DOPT_DEBUGGING
+OPT_OBJS+=gui_debug.o gui_bench.o 
+endif
+ifdef OPT_EDGEOVERLAY
+CFLAGS+=-DOPT_EDGEOVERLAY
+OPT_OBJS+=edgeoverlay.o 
+endif
+C_OBJS:= main.o gui_draw.o gui_menu.o gui_palette.o gui_mbox.o \
+     gui_fselect.o gui.o kbd.o conf.o \
+     histogram.o gui_batt.o gui_space.o gui_osd.o script.o raw.o \
+     gui_lang.o gui_mpopup.o gui_grid.o motion_detector.o raw_merge.o \
+     luascript.o shot_histogram.o dng.o $(OPT_OBJS)
+N_OBJS:= nothumb.o
+
+ASM_OBJS:=entry.o
+
+OBJS := $(call subdirize,$(ASM_OBJS) $(C_OBJS) $(N_OBJS) )
+N_OBJS:=$(call subdirize, $(N_OBJS) )
+C_OBJS:=$(call subdirize, $(C_OBJS) )
+ASM_OBJS:=$(call subdirize, $(ASM_OBJS) )
+
+MAIN_LIBS := \
+	$(TOPDIR)/platform/$(PLATFORM)/libplatform.a \
+	$(TOPDIR)/platform/$(PLATFORM)/sub/$(PLATFORMSUB)/libplatformsub.a \
+	$(TOPDIR)/lib/font/libfont.a \
+	$(TOPDIR)/lib/math/libmath.a \
+	$(TOPDIR)/lib/ubasic/libubasic.a \
+	$(TOPDIR)/lib/lang/liblang.a \
+	$(TOPDIR)/lib/lua/liblua.a
+
+core/nothumb.o:: core/nothumb.c
+	@echo $< \-\> $@
+	$(CC) $(CFLAGS) -marm -nostdinc -c -o $@ $<
+
+$(eval $(call compile-targets,$(C_OBJS),$(LOCAL_CFLAGS)))
+$(eval $(call compile-asm-targets,$(ASM_OBJS),$(LOCAL_CFLAGS)))
+
+$(eval $(call gen-rule, $(subdir)/main.bin, $(OBJS) $(subdir)/main.elf,  \
+	$(OBJDUMP) -z -d $(subdir)/main.elf > $(subdir)/main.dump; \
+	$(OBJCOPY) -O binary $(subdir)/main.elf $(subdir)/main.bin ))
+
+define postprocess-main-elf
+	( $(NM) $(subdir)/main.elf | grep ' U ' > $(subdir)/main.elf.syms ) && exit 1 || exit 0;
+	$(SIZE) $(subdir)/main.elf | tee $(TOPDIR)/size.txt;
+	$(SIZLENCE)printf " %s-%s (%s, #%s): MEMISOSIZE used: 0x%s\n" \
+	$(PLATFORM) $(PLATFORMSUB) $(PLATFORMOS) $(PLATFORMID) \
+	`cut -f5 $(TOPDIR)/size.txt | tail -1` >> $(TOPDIR)/bin/caminfo.txt;
+endef
+
+$(eval $(call gen-rule, $(subdir)/main.elf, $(OBJS) $(MAIN_LIBS), \
+    $(CC) $(CFLAGS) $(LOCAL_CFLAGS) -o $$@ --start-group $$^  $(CORE_LDLIBS) --end-group $(LDFLAGS) $(CORE_LDOPTS) || exit 1; \
+    $(call postprocess-main-elf) \
+    ))
+
+$(eval $(call gen-rule, core-clean,, rm -f $(OBJS) $(subdir)/*.$(DEPSUFFIX) $(subdir)/main.bin $(subdir)/main.elf $(subdir)/main.dump $(subdir)/main.elf.syms ))
+
+$(eval $(call gen-rule, core-distclean, core-clean, rm -f $(OBJS:.o=.d) ))
+
+# vim: filetype=make
Index: core/kbd.c
===================================================================
--- core/kbd.c	(Revision 701)
+++ core/kbd.c	(Arbeitskopie)
@@ -562,7 +562,7 @@
 // ------ modif by Masuji SUTO (start) --------------
 
 unsigned int mmode;
-unsigned int nCrzpos,i;
+int nCrzpos,i;
 unsigned int drmode = 0;
 
    if(conf.ricoh_ca1_mode && conf.remote_enable)
@@ -1344,7 +1344,7 @@
 
 int keyid_by_name (const char *n)
 {
-    int i;
+    unsigned i;
     for (i=0;i<sizeof(keynames)/sizeof(keynames[0]);i++)
 	if (strcmp(keynames[i].keyname,n) == 0)
 	    return keynames[i].keyid;
Index: core/gui_draw.c
===================================================================
--- core/gui_draw.c	(Revision 701)
+++ core/gui_draw.c	(Arbeitskopie)
@@ -71,7 +71,7 @@
      int error = 0;
      int y = y1;
      int ystep = (y1 < y2)?1:-1;
-     int x;
+     coord x;
      for (x=x1; x<=x2; ++x) {
          if (steep) draw_pixel(y, x, cl);
          else draw_pixel(x, y, cl);
@@ -298,7 +298,8 @@
 
 //-------------------------------------------------------------------
 void draw_ellipse(coord xc, coord yc, unsigned int a, unsigned int b, color cl) {
-    int x = 0, y = b;
+    unsigned int x = 0;
+    int y = b;
     long a2 = (long)a*a, b2 = (long)b*b;
     long crit1 = -((a2>>2) + (a&1) + b2);
     long crit2 = -((b2>>2) + (b&1) + a2);
@@ -315,7 +316,7 @@
             draw_pixel(xc+x, yc-y, cl);
             draw_pixel(xc-x, yc+y, cl);
         }
-        if (t + b2*x <= crit1 || t + a2*y <= crit3)
+        if ((long)(t + b2*x) <= crit1 || (long)(t + a2*y) <= crit3)
             ++x, dxt += d2xt, t += dxt;
         else if (t - a2*y > crit2)
             --y, dyt += d2yt, t += dyt;
@@ -328,7 +329,8 @@
 
 //-------------------------------------------------------------------
 void draw_filled_ellipse(coord xc, coord yc, unsigned int a, unsigned int b, color cl) {
-    int x = 0, y = b;
+    unsigned int x = 0;
+    int y = b;
     int rx = x, ry = y;
     unsigned int width = 1;
     unsigned int height = 1;
@@ -346,10 +348,10 @@
         draw_filled_rect(xc-a, yc, (a<<1)+1, 1, cl_fill);
     } else {
         while (y>=0 && x<=a) {
-            if (t + b2*x <= crit1 || t + a2*y <= crit3) {
+            if ((long)(t + b2*x) <= crit1 || (long)(t + a2*y) <= crit3) {
                 if (height == 1)
                     ; /* draw nothing */
-                else if (ry*2+1 > (height-1)*2) {
+                else if ((unsigned)(ry*2+1) > (height-1)*2) {
                     draw_filled_rect(xc-rx, yc-ry, xc-rx+width-1, yc-ry+(height-1)-1, cl_fill);
                     draw_filled_rect(xc-rx, yc+ry+1, xc-rx+width-1, yc+ry+1+(1-height)-1, cl_fill);
                     ry -= height-1;
@@ -369,7 +371,7 @@
                 height++;
             }
             else {
-                if (ry*2+1 > height*2) {
+                if ((unsigned)(ry*2+1) > height*2) {
                     draw_filled_rect(xc-rx, yc-ry, xc-rx+width-1, yc-ry+height-1, cl_fill);
                     draw_filled_rect(xc-rx, yc+ry+1, xc-rx+width-1, yc+ry+1-height-1, cl_fill);
                 }
@@ -385,7 +387,7 @@
             }
         }
 
-        if (ry > height) {
+        if ((unsigned)ry > height) {
             draw_filled_rect(xc-rx, yc-ry, xc-rx+width-1, yc-ry+height-1, cl_fill);
             draw_filled_rect(xc-rx, yc+ry+1, xc-rx+width-1, yc+ry+1-height-1, cl_fill);
         }
Index: core/gui_menu.c
===================================================================
--- core/gui_menu.c	(Revision 701)
+++ core/gui_menu.c	(Arbeitskopie)
@@ -31,7 +31,7 @@
 static int          gui_menu_top_item;
 static int          gui_menu_redraw;
 
-static int          count;
+static unsigned     count;
 static coord        x, y, w, num_lines;
 static int          len_bool, len_int, len_enum, len_space, len_br1, len_br2, cl_rect;
 static int          int_incr, incr_modified;
@@ -107,7 +107,7 @@
 				mod_user_menu(curr_menu->menu[gui_menu_curr_item],&gui_menu_curr_item, 1);
 			}
 			else {
-				int x;
+				unsigned int x;
 				/*
 				 * Remove entry from menu
 				 */
@@ -174,10 +174,12 @@
             for (j=0;j<c;++j){
             do {
                 if (curr_menu->menu[gui_menu_curr_item+1].text) {
-                    int i;
+                    unsigned int i;
                     for (i=0; i<num_lines-1 && curr_menu->menu[gui_menu_top_item+i].text; ++i);
-                    if (i==num_lines-1 && curr_menu->menu[gui_menu_top_item+i].text 
-                        && gui_menu_top_item+i-1==gui_menu_curr_item && curr_menu->menu[gui_menu_top_item+i+1].text)
+                    if (   i==num_lines-1 
+			&& curr_menu->menu[gui_menu_top_item+i].text 
+                        && (int)(gui_menu_top_item+i-1) == gui_menu_curr_item 
+			&& curr_menu->menu[gui_menu_top_item+i+1].text )
                         ++gui_menu_top_item;
                     ++gui_menu_curr_item;
                 } else {
@@ -485,7 +487,7 @@
 		if( (conf.user_menu_enable == 3)  && (curr_menu->title == LANG_MENU_USER_MENU)) {
 			mod_user_menu(curr_menu->menu[gui_menu_curr_item],&gui_menu_curr_item, 3);
 			gui_menu_redraw=1;
-			if(gui_menu_curr_item > gui_menu_top_item + num_lines -2) {
+			if(gui_menu_curr_item > (int)(gui_menu_top_item + num_lines -2) ) {
 				if((gui_menu_curr_item < USER_MENU_ITEMS) && curr_menu->menu[gui_menu_curr_item +1].text)
 					gui_menu_top_item++;
 			}
@@ -565,7 +567,8 @@
 //-------------------------------------------------------------------
 void gui_menu_draw() {
     static char tbuf[64];
-    int imenu, i, j, yy, xx, symbol_width;
+    unsigned i;
+    int imenu, j, yy, xx, symbol_width;
     color cl, cl_symbol;
     const char *ch = "";
 
Index: core/gui_fselect.c
===================================================================
--- core/gui_fselect.c	(Revision 701)
+++ core/gui_fselect.c	(Arbeitskopie)
@@ -116,7 +116,7 @@
     struct dirent *de;
     static struct stat   st;
     struct fitem  **ptr = &head, *prev = NULL;
-    int    i;
+    unsigned int    i;
 
     gui_fselect_free_data();
 
@@ -239,7 +239,8 @@
 
 //-------------------------------------------------------------------
 void gui_fselect_draw() {
-    int i, j, off_name_x, off_size_x, off_time_x, off_body_x, off_body_y;
+    unsigned i;
+    int j, off_name_x, off_size_x, off_time_x, off_body_x, off_body_y;
     struct fitem  *ptr;
     char buf[100];
     struct tm *time;
@@ -808,7 +809,7 @@
     for (ptr=head; ptr; ptr=ptr->next) {
         if (ptr->marked && ptr->attr != 0xFF && 
             !(ptr->attr & DOS_ATTR_DIRECTORY) &&
-            ptr->size == hook_raw_size() &&
+            (long)ptr->size == hook_raw_size() &&
             (strcmp(ptr->name,selected->name)) != 0) {
             sprintf(raw_subtract_from,"%s/%s",current_dir,ptr->name);
             sprintf(raw_subtract_dest,"%s/%s%s",current_dir,img_prefixes[conf.sub_batch_prefix],ptr->name+4);
@@ -831,7 +832,7 @@
     int i;
     char *p = buf + sprintf(buf,"%s %s\n",selected->name,lang_str(LANG_FSELECT_SUB_FROM));
     for (ptr=head, i=0; ptr; ptr=ptr->next) {
-        if (ptr->marked && ptr->attr != 0xFF && !(ptr->attr & DOS_ATTR_DIRECTORY) && ptr->size == hook_raw_size()) {
+        if (ptr->marked && ptr->attr != 0xFF && !(ptr->attr & DOS_ATTR_DIRECTORY) && (long)ptr->size == hook_raw_size()) {
             if ( i < MAX_SUB_NAMES ) {
                 sprintf(p, "%s\n",ptr->name);
                 // keep a pointer to the one before the end, so we can stick ...and more on
@@ -1011,7 +1012,7 @@
                      (selected->name[0] == 'D' && selected->name[1] == 'C' && selected->name[2] == 'I' && selected->name[3] == 'M') ||//If item is DCIM folder
                      (selected->name[3] == 'C'))//If item is a DCIM sub folder
                     i |= MPOPUP_PURGE;//Display PURGE RAW function in popup menu
-                if(selected->size == hook_raw_size())
+                if((long)selected->size == hook_raw_size())
                     i |= MPOPUP_RAW_DEVELOP;
 #if DNG_SUPPORT
                 if((fselect_marked_count()>1)||(selected->size > hook_raw_size()))
Index: core/gui_grid.c
===================================================================
--- core/gui_grid.c	(Revision 701)
+++ core/gui_grid.c	(Arbeitskopie)
@@ -52,7 +52,7 @@
 //-------------------------------------------------------------------
 static void process_title(const char *title) {
     register const char *ptr = title;
-    register int i=0;
+    register unsigned int i=0;
 
     while (ptr[0]==' ' || ptr[0]=='\t') ++ptr; // whitespaces
     while (i<(sizeof(grid_title)-1) && ptr[i] && ptr[i]!='\r' && ptr[i]!='\n') {
@@ -63,10 +63,10 @@
 }
 
 //-------------------------------------------------------------------
-static void process_element(const char *str, int n, grid_elem_type type) {
+static void process_element(const char *str, unsigned int n, grid_elem_type type) {
     register const char *ptr = str;
     char *nptr;
-    register int i;
+    register unsigned int i;
     long nums[6];
     struct gline  *gptr;
 
Index: core/gui_osd.c
===================================================================
--- core/gui_osd.c	(Revision 701)
+++ core/gui_osd.c	(Arbeitskopie)
@@ -49,7 +49,7 @@
 static char osd_buf3[10];
 static char osd_buf4[10];
 
-static int step;
+static unsigned step;
 
 // Width (in pixels) of half-shoot Canon OSD area of the screen buffer, for restore during 
 // Zebra draw, to limit RAM usage of zebra. Only these border areas are stored in RAM.
@@ -124,7 +124,7 @@
         break;
     case KEY_RIGHT:
         if (osd[curr_item].pos->x < screen_width-osd[curr_item].size.x) {
-            osd[curr_item].pos->x+=(screen_width-osd[curr_item].size.x-osd[curr_item].pos->x>step)?step:screen_width-osd[curr_item].size.x-osd[curr_item].pos->x;
+            osd[curr_item].pos->x+=(screen_width-osd[curr_item].size.x-osd[curr_item].pos->x > step)?step:screen_width-osd[curr_item].size.x-osd[curr_item].pos->x;
             osd_to_draw = 1;
         } else
             osd[curr_item].pos->x = screen_width-osd[curr_item].size.x;
@@ -337,7 +337,8 @@
 
 //-------------------------------------------------------------------
 int gui_osd_draw_zebra(int show) {
-    unsigned int v, s, x, y, f, over;
+    int y, over;
+    unsigned int v, s, x, f;
     color cl_under=conf.zebra_color>>8, cl_over=conf.zebra_color&0xFF;
     static int need_restore=0;
     int viewport_height;
Index: core/gui_batt.c
===================================================================
--- core/gui_batt.c	(Revision 701)
+++ core/gui_batt.c	(Arbeitskopie)
@@ -27,7 +27,7 @@
 
 //-------------------------------------------------------------------
 unsigned long get_batt_perc() {
-    unsigned long v;
+    long v;
 
     v = get_batt_average();
     if (v>conf.batt_volts_max) v=conf.batt_volts_max;
@@ -37,7 +37,7 @@
 
 //-------------------------------------------------------------------
 static void gui_batt_draw_icon () {
-    coord x;
+    int x;
     int perc = get_batt_perc();
     color cl = (perc<=10)?conf.osd_color_warn:(conf.batt_icon_color&0xFF);
 
Index: core/luascript.c
===================================================================
--- core/luascript.c	(Revision 701)
+++ core/luascript.c	(Arbeitskopie)
@@ -217,7 +217,7 @@
   unsigned id = luaL_checknumber( L, 1 );
   unsigned val;
 
-  if (id >= get_flash_params_count()) {
+  if (id >= (unsigned)get_flash_params_count()) {
     // return nil
     return 0;
   }
Index: core/gui_mbox.c
===================================================================
--- core/gui_mbox.c	(Revision 701)
+++ core/gui_mbox.c	(Arbeitskopie)
@@ -38,7 +38,7 @@
 
 //-------------------------------------------------------------------
 void gui_mbox_init(int title, int msg, const unsigned int flags, void (*on_select)(unsigned int btn)) {
-    int i;
+    unsigned int i;
 
     mbox_buttons_num = 0;
     for (i=0; i<BUTTONSNUM && mbox_buttons_num<MAX_BUTTONS; ++i) {
Index: core/gui_calendar.c
===================================================================
--- core/gui_calendar.c	(Revision 701)
+++ core/gui_calendar.c	(Arbeitskopie)
@@ -123,7 +123,7 @@
 
 //-------------------------------------------------------------------
 void gui_calendar_draw() {
-    int x, y;
+    unsigned int x, y;
     static char str[32];
     int w, d, i;
     unsigned long t;
@@ -152,7 +152,7 @@
         y += FONT_HEIGHT+4+4;
 
         y += FONT_HEIGHT+4;
-        for (x=0; x<w; ++x) {
+        for (x=0; x<(unsigned)w; ++x) {
             draw_string(cal_x+x*FONT_WIDTH*4, y, "    ", (x<5)?CALENDAR_COLOR:WEEKEND_COLOR);
         }
         
Index: core/main.c
===================================================================
--- core/main.c	(Revision 701)
+++ core/main.c	(Arbeitskopie)
@@ -68,6 +68,22 @@
         spytask_can_start = 1;
 }
 
+#include "gui.h"
+#include "gui_draw.h"
+
+void brain_dump() 
+{
+    char buf[64];
+    static const int p = 20;
+    static const long a = 4;
+    static int v = 0;
+
+    get_parameter_data(p,&v,a);
+
+    sprintf(buf,"param %d is %d",p,v);
+    draw_string(16,0,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW));
+}
+
 void core_spytask()
 {
     int cnt = 1;
@@ -105,6 +121,7 @@
 #ifdef OPT_EDGEOVERLAY
     mkdir("A/CHDK/EDGE");
 #endif
+
     auto_started = 0;
 
     if (conf.script_startup==1) script_autostart();				// remote autostart
@@ -132,6 +149,8 @@
 #endif
 	}
 
+//	brain_dump();
+
 	if ((state_shooting_progress == SHOOTING_PROGRESS_PROCESSING) && (!shooting_in_progress())) {
 	    state_shooting_progress = SHOOTING_PROGRESS_DONE;
             if (raw_need_postprocess) raw_postprocess();
Index: core/histogram.c
===================================================================
--- core/histogram.c	(Revision 701)
+++ core/histogram.c	(Arbeitskopie)
@@ -17,7 +17,7 @@
 
 
 unsigned char histogram[5][HISTO_WIDTH];                    // RGBYG
-long exposition_thresh;
+unsigned long exposition_thresh;
 long under_exposed;
 long over_exposed;
 long histo_magnification;
Index: version.inc
===================================================================
--- version.inc	(Revision 701)
+++ version.inc	(Arbeitskopie)
@@ -1 +1 @@
-BUILD_NUMBER := 0.9.5
+BUILD_NUMBER := 0.9.5-p0
Index: tools/makefile.inc.new
===================================================================
--- tools/makefile.inc.new	(Revision 0)
+++ tools/makefile.inc.new	(Revision 0)
@@ -0,0 +1,56 @@
+
+
+OBJS:=pakwif.o finsig.o gensig.o dumpchk.o dancingbits.o
+OBJS:=$(call subdirize,$(OBJS))
+
+$(eval $(call compile-host-targets, $(OBJS), -DPLATFORMOS_$(PLATFORMOS) ) )
+
+$(eval $(call gen-rule, $(subdir)/pakwif$(EXE), $(subdir)/pakwif.o, $(HOSTCC) $(HOSTCFLAGS) -o $$@ $$^ ))
+$(eval $(call gen-rule, $(subdir)/finsig$(EXE), $(subdir)/finsig.o, $(HOSTCC) $(HOSTCFLAGS) -o $$@ $$^ ))
+$(eval $(call gen-rule, $(subdir)/gensig$(EXE), $(subdir)/gensig.o, $(HOSTCC) $(HOSTCFLAGS) -o $$@ $$^ ))
+$(eval $(call gen-rule, $(subdir)/dancingbits$(EXE), $(subdir)/dancingbits.o, $(HOSTCC) $(HOSTCFLAGS) -o $$@ $$^ ))
+$(eval $(call gen-rule, $(subdir)/dumpchk$(EXE), $(subdir)/dumpchk.o, $(HOSTCC) $(HOSTCFLAGS) -o $$@ $$^ ))
+
+$(eval $(call gen-rule,tools-clean,,rm -f $(subdir)/*.HOST.d ))
+$(eval $(call gen-rule,tools-distclean, tools-clean ,rm -f $(subdir)/*.HOST.d $(subdir)/pakwif$(EXE) $(subdir)/finsig$(EXE) $(subdir)/gensig$(EXE) $(OBJS)))
+#	if [ -s sig_ref_vxworks_1.bin ] && [ -s sig_ref_vxworks_2.bin ] && [ -s sig_ref_vxworks_3.bin ] ; then \
+#	  rm -f signatures_vxworks.h ; \
+#	fi
+#	if [ -s sig_ref_dryos_1.bin ] ; then \
+#	  rm -f signatures_dryos.h ; \
+#	fi
+
+#	rm -f signatures.h
+
+
+tools/signatures_vxworks.h: tools/gensig$(EXE) tools/gensigs.sh tools/sig_ref_vxworks_1.txt tools/sig_ref_vxworks_1.bin tools/sig_ref_vxworks_2.txt tools/sig_ref_vxworks_2.bin tools/sig_ref_vxworks_3.txt tools/sig_ref_vxworks_3.bin
+	@echo \-\> $@
+	if [ -s tools/sig_ref_vxworks_1.bin ] && [ -s tools/sig_ref_vxworks_2.bin ] && [ -s tools/sig_ref_vxworks_3.bin ] ; then \
+	  $(SH) tools/gensigs.sh $(SORT) vxworks "1 2 3" > tools/signatures_vxworks.h ; \
+	else \
+	  echo CAUTION! \'signatures_vxworks.h\' is not uptated due to \'sig_ref_vxworks_1.bin\` or \'sig_ref_vxworks_2.bin\` or \'sig_ref_vxworks_3.bin\` is empty! ; \
+	  touch tools/signatures_vxworks.h ; \
+	fi
+
+tools/signatures_dryos.h: tools/gensig$(EXE) tools/gensigs.sh tools/sig_ref_dryos_1.txt tools/sig_ref_dryos_1.bin
+	@echo \-\> $@
+	if [ -s tools/sig_ref_dryos_1.bin ] ; then \
+	  $(SH) tools/gensigs.sh $(SORT) dryos "1" > tools/signatures_dryos.h ; \
+	else \
+	  echo CAUTION! \'signatures_dryos.h\' is not uptated due to \'sig_ref_dryos_1.bin\` is empty! ; \
+	  touch tools/signatures_dryos.h ; \
+	fi
+
+tools/sig_ref_vxworks_1.bin:
+	touch tools/sig_ref_vxworks_1.bin
+
+tools/sig_ref_vxworks_2.bin:
+	touch tools/sig_ref_vxworks_2.bin
+
+tools/sig_ref_vxworks_3.bin:
+	touch tools/sig_ref_vxworks_3.bin
+
+tools/sig_ref_dryos_1.bin:
+	touch tools/sig_ref_dryos_1.bin
+
+# vim: filetype=make
Index: Makefile.new
===================================================================
--- Makefile.new	(Revision 0)
+++ Makefile.new	(Revision 0)
@@ -0,0 +1,811 @@
+# This is an entirely new set of makefiles, completely independent from the
+# usual ones. The primary goal is to have proper (partly auto-generated during
+# compile, without a separate make depend step) dependencies. It uses a
+# completely different philosophy of generating the rules, so you need a pretty
+# new make version (3.81 or higher). The advantage is that now you should be
+# able to do a make -j N for quite big Ns (as much as you have cores + 2
+# recommended) to massively speed up your builds.
+
+#PLATFORM=s3is
+#PLATFORMSUB=100a
+
+#PLATFORM=a610
+#PLATFORMSUB=100e
+
+#PLATFORM=a620
+#PLATFORMSUB=100f
+
+#PLATFORM=ixus40_sd300
+#PLATFORMSUB=100k
+
+#PLATFORM=ixus40_sd300
+#PLATFORMSUB=100j
+
+#PLATFORM=sx100is
+#PLATFORMSUB=100c
+
+#PLATFORM=sx100is
+#PLATFORMSUB=100b
+
+#PLATFORM=ixus50_sd400
+#PLATFORMSUB=101a
+
+#PLATFORM=ixus50_sd400
+#PLATFORMSUB=101b
+
+#PLATFORM=ixus750_sd550
+#PLATFORMSUB=100f
+
+#PLATFORM=ixus750_sd550
+#PLATFORMSUB=100g
+
+#PLATFORM=a640
+#PLATFORMSUB=100b
+
+#PLATFORM=a700
+#PLATFORMSUB=100b
+
+#PLATFORM=a710
+#PLATFORMSUB=100a
+
+#PLATFORM=s2is
+#PLATFORMSUB=100e
+
+#PLATFORM=s2is
+#PLATFORMSUB=100f
+
+#PLATFORM=s2is
+#PLATFORMSUB=100g
+
+#PLATFORM=g7
+#PLATFORMSUB=100e
+
+#PLATFORM=g7
+#PLATFORMSUB=100g
+
+#PLATFORM=g7
+#PLATFORMSUB=100i
+
+#PLATFORM=g7
+#PLATFORMSUB=100j
+
+#PLATFORM=g9
+#PLATFORMSUB=100d
+
+#PLATFORM=g9
+#PLATFORMSUB=100g
+
+#PLATFORM=a530
+#PLATFORMSUB=100a
+
+#PLATFORM=a540
+#PLATFORMSUB=100b
+
+#PLATFORM=a560
+#PLATFORMSUB=100a
+
+#PLATFORM=a570
+#PLATFORMSUB=100a
+
+#PLATFORM=a570
+#PLATFORMSUB=100e
+
+#PLATFORM=a610
+#PLATFORMSUB=100e
+
+#PLATFORM=a610
+#PLATFORMSUB=100f
+
+#PLATFORM=ixus700_sd500
+#PLATFORMSUB=101a
+
+#PLATFORM=ixus700_sd500
+#PLATFORMSUB=101b
+
+#PLATFORM=ixus800_sd700
+#PLATFORMSUB=100b
+
+#PLATFORM=ixus800_sd700
+#PLATFORMSUB=101b
+
+#PLATFORM=a720
+#PLATFORMSUB=100c
+
+#PLATFORM=ixus850_sd800
+#PLATFORMSUB=100e
+
+#PLATFORM=ixus860_sd870
+#PLATFORMSUB=100c
+
+#PLATFORM=ixus80_sd1100
+#PLATFORMSUB=100c
+
+#PLATFORM=ixus80_sd1100
+#PLATFORMSUB=101a
+
+PLATFORM=ixus950_sd850
+PLATFORMSUB=100c
+
+#PLATFORM=ixus55_sd450
+#PLATFORMSUB=100b
+
+#PLATFORM=ixus55_sd450
+#PLATFORMSUB=100c
+
+#PLATFORM=ixus55_sd450
+#PLATFORMSUB=100d
+
+#PLATFORM=ixus60_sd600
+#PLATFORMSUB=100a
+
+#PLATFORM=ixus60_sd600
+#PLATFORMSUB=100d
+
+#PLATFORM=ixus70_sd1000
+#PLATFORMSUB=100c
+
+#PLATFORM=ixus70_sd1000
+#PLATFORMSUB=101b
+
+#PLATFORM=ixus70_sd1000
+#PLATFORMSUB=102a
+
+#PLATFORM=a650
+#PLATFORMSUB=100d
+
+#PLATFORM=a450
+#PLATFORMSUB=100d
+
+#PLATFORM=a460
+#PLATFORMSUB=100d
+
+#PLATFORM=a550
+#PLATFORMSUB=100c
+
+#PLATFORM=a590
+#PLATFORMSUB=100e
+
+#PLATFORM=a590
+#PLATFORMSUB=101b
+
+#PLATFORM=a630
+#PLATFORMSUB=100c
+
+#PLATFORM=s5is
+#PLATFORMSUB=101a
+
+#PLATFORM=s5is
+#PLATFORMSUB=101b
+
+#PLATFORM=ixus65_sd630
+#PLATFORMSUB=100a
+
+#PLATFORM=tx1
+#PLATFORMSUB=100g
+
+#PLATFORM=tx1
+#PLATFORMSUB=101b
+
+#PLATFORM=ixus960_sd950
+#PLATFORM=100d
+
+#PLATFORM=ixus75_sd750
+#PLATFORMSUB=100b
+
+#PLATFORM=ixus75_sd750
+#PLATFORMSUB=101a
+
+#PLATFORM=ixus75_sd750
+#PLATFORMSUB=102a
+
+#PLATFORM=ixusizoom_sd30
+#PLATFORMSUB=100g
+
+TOPDIR:=.
+SRCDIR:=.
+BINDIR:=$(TOPDIR)/bin
+
+VER=CHDK
+
+# build time optional components
+OPT_LUA_IOLIB=1
+OPT_LUA_OSLIB=1
+#OPT_LUA_STRLIB=1
+OPT_GAME_REVERSI=1
+OPT_GAME_SOKOBAN=1
+
+MEMISOSIZE="(&_end-&_start)"
+include $(TOPDIR)/version.inc
+include $(TOPDIR)/buildconf.inc
+include $(TOPDIR)/platform/$(PLATFORM)/sub/$(PLATFORMSUB)/makefile.inc
+
+NOZERO100K=TRUE
+
+##########################################################################
+##########################################################################
+##########################################################################
+
+ESED = sed -r
+
+# keep sort order consistent
+export LC_ALL=C
+
+ifndef OSTYPE
+  HOSTPLATFORM:=$(patsubst MINGW%,MINGW,$(shell uname -s))
+  ifeq ($(HOSTPLATFORM),MINGW)
+    OSTYPE = Windows
+    EXE = .exe
+    SH = sh
+    DEVNULL = NUL
+    SORT = $(dir $(shell which uniq.exe | sed s/\\\\/\\\//g))/sort.exe
+  else
+    ifeq ($(HOSTPLATFORM),Linux)
+      OSTYPE = Linux
+      EXE =
+      SH =
+      DEVNULL = /dev/null
+      SORT = sort
+    else
+      ifeq ($(HOSTPLATFORM),Darwin)
+        OSTYPE = Darwin
+        EXE =
+        SH =
+        DEVNULL = /dev/null
+        SORT = sort
+        ESED = sed -E
+      else
+        OSTYPE = Other
+        EXE =
+        SH =
+        DEVNULL = /dev/null
+        SORT = sort
+      endif
+    endif
+  endif
+else
+  EXE =
+  SH =
+  DEVNULL = /dev/null
+  SORT = sort
+endif
+
+##########################################################################
+##########################################################################
+##########################################################################
+
+HOSTCC=gcc
+HOSTCFLAGS=-g -O2 -Wall
+HOSTAR=ar
+
+PAKWIF=$(TOPDIR)/tools/pakwif$(EXE)
+PAKFI2=$(TOPDIR)/tools/packfi2/fi2enc$(EXE)
+ENCODE_DISKBOOT=$(TOPDIR)/tools/dancingbits$(EXE)
+
+##########################################################################
+
+CC=arm-elf-gcc
+OBJCOPY=arm-elf-objcopy
+OBJDUMP=arm-elf-objdump
+STRIP=arm-elf-strip
+NM=arm-elf-nm
+AR=arm-elf-ar
+RANLIB=arm-elf-ranlib
+SIZE=arm-elf-size
+
+# -msoft-float is used per default but object files are marked as hard-float
+CFLAGS:=-fno-inline -fno-strict-aliasing -Wall -Os -Wextra -fdiagnostics-show-option -Wno-missing-field-initializers
+# enable only for when you want to hunt warnings
+#CFLAGS:=-fno-inline -fno-strict-aliasing -Wall -Os -Wextra -Werror -fdiagnostics-show-option -Wno-missing-field-initializers
+# flags for gcc v4
+CFLAGS+=-mtune=arm946e-s
+# for gcc v3, we use to allow use of strd etc
+# CFLAGS+=-march=armv5te
+
+CTHUMB:=-mthumb
+CFLAGS+=-mthumb-interwork
+CFLAGS+=-I$(TOPDIR)/include $(PLFLAGS) $(CPPFLAGS)
+CFLAGS+=-DPLATFORM=\"$(PLATFORM)\" -DPLATFORMSUB=\"$(PLATFORMSUB)\" -DPLATFORMID=$(PLATFORMID) -DHDK_VERSION=\"$(VER)\" -DBUILD_NUMBER=\"$(BUILD_NUMBER)\" -DCAMERA_$(PLATFORM)=1
+CFLAGS+=-Wall -Wno-unused -Wno-format
+LDFLAGS:=-L$(TOPDIR)/lib/math -L$(TOPDIR)/lib/font
+LDFLAGS+=-L$(TOPDIR)/lib/libc -L$(TOPDIR)/lib/ubasic
+LDFLAGS+=-L$(TOPDIR)/platform/$(PLATFORM) -L$(TOPDIR)/platform/$(PLATFORM)/sub/$(PLATFORMSUB)
+
+ifdef OPT_DEBUGGING
+CFLAGS+=-DOPT_DEBUGGING
+endif
+##########################################################################
+
+#ifndef NO_INC_BUILD
+#BUILD_NUMBER := $(shell expr $(BUILD_NUMBER) + 1)
+#endif
+
+ifdef VERBOSE
+    ECHOTARGET:=&> /dev/null
+    SILENCE:=
+else
+    ECHOTARGET:=
+    SILENCE:=@
+endif
+
+SUBDIRS=tools lib platform core loader
+SUBRULES := all clean distclean
+
+default: all
+
+DEPFLAGS:=-MD -MF
+DEPSUFFIX:=$(PLATFORM)_$(PLATFORMSUB).d
+define single-compile-targets
+-include $(1).$(DEPSUFFIX)
+$(1): $(1:.o=.c) $(3)
+	@echo $$< \-\> $$@
+	$(CC) $(CFLAGS) $(2) $(DEPFLAGS) $(1).$(DEPSUFFIX) -nostdinc -o $$@ -c $$<
+endef
+
+define compile-targets
+$(foreach target,$(1),$(eval $(call single-compile-targets,$(target),$(2),$(3) ) ) )
+endef
+
+define single-compile-host-targets
+-include $(1).HOST.d
+$(1): $(1:.o=.c) $(3)
+	@echo $$< \-\> $$@
+	$(HOSTCC) $(HOSTCFLAGS) $(2) $(DEPFLAGS) $(1).HOST.d -o $$@ -c $$<
+endef
+
+define compile-host-targets
+$(foreach target,$(1),$(eval $(call single-compile-host-targets,$(target),$(2),$(3) ) ) )
+endef
+
+define single-compile-asm-targets
+-include $(1).$(PLATFORM)_$(PLATFORMSUB).d
+$(1): $(1:.o=.S) $(3)
+	@echo $$< \-\> $$@
+	$(CC) $(CFLAGS) $(2) $(DEPFLAGS) $(1).$(DEPSUFFIX) -nostdinc -o $$@ -c $$<
+endef
+
+define compile-asm-targets
+$(foreach target,$(1),$(eval $(call single-compile-asm-targets,$(target),$(2),$(3) ) ) )
+endef
+
+# use this helper function if you want to have immedeate evaluation of your
+# variables (usually for $(OBJS) you want) instead of evaluation only at the
+# point the rule is executed. As a nice side-effect this also prints whats going on, rule-wise
+define gen-rule
+$(1):: $(2)
+	@echo Executing commands for rule $(1): prerequisites \[$(strip $(2))\] already done
+	$(SILENCE)$(3)
+endef
+
+define ar-targets
+$(subdir)/$(strip $(1)): $(2)
+	@echo creating $(1) from $(2)
+	$(SILENCE)$(AR) rcs $(subdir)/$(strip $(1)) $(2)
+endef
+
+# rules for debugging, need to be tweaked each time
+#%.o: %.S
+#	if [ -n "$(echo $@ $< | grep \/)" ]; then echo $@ $< FAIL, PLEASE FIX RULE!; exit 1; fi
+#
+#%.o: %.c
+#	if [ -n "$(echo $@ $< | grep \/)" ]; then echo $@ $< FAIL, PLEASE FIX RULE!; exit 1; fi
+
+.dep/%.d: %.c .dep
+	$(CC) $(CFLAGS) -M $< > $@.$$$$; \
+	    sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
+	    rm -f $@.$$$$
+
+.dep/%.d: %.S .dep
+	$(CC) $(CFLAGS) -M $< > $@.$$$$; \
+	    sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
+	    rm -f $@.$$$$
+
+all: fir $(PAKWIF) tools/gensig tools/finsig $(PAKFI2) $(ENCODE_DISKBOOT)
+
+
+clean: clean-recursive
+
+distclean: distclean-recursive
+
+.dep:
+	mkdir .dep
+
+.PHONY: $(SUBDIRS)
+
+define subdirize
+$(foreach f,$(1),$(subdir)/$(f))
+endef
+
+SAVEDSUBDIRS:=$(SUBDIRS) # the includes sometimes overwrite SUBDIRS
+# be carefull to leave the varname subdir it is used in the included makefiles
+#$(foreach subdir,$(SUBDIRS),$(info "include $(subdir)/makefile.inc.new") )
+$(foreach subdir,$(SUBDIRS),$(eval include $(subdir)/makefile.inc.new) )
+SUBDIRS:=$(SAVEDSUBDIRS)
+VPATH:=$(TOPDIR)
+
+#$(strip $(1))-recursive: $(foreach subdir,$(SUBDIRS),$(info "Generating $(strip $(1))-recursive: $(subdir)-$(strip $(1))"))
+define subdir-recursive-rule
+$(eval $(call gen-rule, $(strip $(1))-recursive, $(foreach subdir,$(SUBDIRS),$(subdir)-$(strip $(1))),))
+endef
+
+$(foreach subrule,$(SUBRULES),$(eval $(call subdir-recursive-rule,$(strip $(subrule) ) ) ) )
+
+MAKE:=$(MAKE) -f Makefile.new
+
+$(BINDIR):
+	@echo mkdir -p $@ $(ECHOTARGET)
+	$(SILENCE)mkdir -p $@
+
+
+
+fir: version firsub
+
+firsub: $(BINDIR) $(TOPDIR)/loader/$(PLATFORM)/main.bin $(PAKWIF) $(ENCODE_DISKBOOT)
+	$(SILENCE)mkdir -p $(TOPDIR)/bin
+	$(SILENCE)cp $(TOPDIR)/loader/$(PLATFORM)/main.bin $(TOPDIR)/bin/main.bin
+ifndef NOZERO100K
+ifeq ($(OSTYPE),Windows)
+	zero | dd bs=1k count=100 >> $(TOPDIR)/bin/main.bin 2> $(DEVNULL)
+else
+	dd if=/dev/zero bs=1k count=100 >> $(TOPDIR)/bin/main.bin 2> $(DEVNULL)
+endif
+endif
+ifdef PLATFORMOS
+  ifeq ($(PLATFORMOS),vxworks)
+	@echo \-\> $(PLATFORM)-$(PLATFORMSUB).FIR
+	$(PAKWIF) $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB).FIR \
+	     $(TOPDIR)/bin/main.bin\
+	    $(PLATFORMID) 0x01000101
+  endif
+  ifeq ($(PLATFORMOS),dryos)
+ifdef OPT_FI2
+	#@echo \-\> $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB).FI2
+	$(PAKFI2) $(TOPDIR)//bin/main.bin -p $(PLATFORMID) -key $(FI2KEY) -iv $(FI2IV)  $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB).FI2
+endif
+  endif
+endif
+ifdef NEED_ENCODED_DISKBOOT
+	@echo dance \-\> DISKBOOT.BIN
+	$(ENCODE_DISKBOOT) $(TOPDIR)/bin/main.bin $(TOPDIR)/bin/DISKBOOT.BIN
+	rm $(TOPDIR)/bin/main.bin
+else
+	mv $(TOPDIR)/bin/main.bin $(TOPDIR)/bin/DISKBOOT.BIN
+endif
+	@echo "**** Firmware creation completed successfully"
+
+upload: fir
+	@echo Uploading...
+	cp $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB).FIR $(TOPDIR)/bin/PS.FIR
+	/home/vitalyb/Projects/ch/libptp2-1.1.0/src/ptpcam -u -m 0xbf01 --filename $(TOPDIR)/bin/PS.FIR
+
+infoline:
+	@echo "**** BUILDING CHDK-$(VER), #$(BUILD_NUMBER) FOR $(PLATFORM)-$(PLATFORMSUB)"
+
+version: FORCE
+	@echo "**** Build: $(BUILD_NUMBER)"
+	@echo "BUILD_NUMBER := $(BUILD_NUMBER)" > version.inc
+
+FORCE:
+
+firzip: clean
+	$(MAKE) version
+	$(MAKE) firsub
+
+firzipsub: infoline firzip
+	@echo \-\> $(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip
+	rm -f $(TOPDIR)/bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip
+	LANG=C echo -e "CHDK-$(VER) for $(PLATFORM) fw:$(PLATFORMSUB) build:$(BUILD_NUMBER) date:`date -R`" | \
+	    zip -9jz $(TOPDIR)/bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip $(TOPDIR)/bin/DISKBOOT.BIN > $(DEVNULL)
+ifdef PLATFORMOS
+  ifeq ($(PLATFORMOS),vxworks)
+	cp $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB).FIR $(TOPDIR)/bin/PS.FIR
+	zip -9j $(TOPDIR)/bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip $(TOPDIR)/bin/PS.FIR > $(DEVNULL)
+	rm -f $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB).FIR
+	rm -f $(TOPDIR)/bin/PS.FIR
+  endif
+  ifeq ($(PLATFORMOS),dryos)
+  ifdef OPT_FI2
+	#cp $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB).FI2 $(TOPDIR)/bin/PS.FI2
+	zip -9jc $(TOPDIR)/bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip $(TOPDIR)/bin/PS.FI2 > $(DEVNULL)
+	rm -f $(TOPDIR)/bin/PS.FI2
+  endif
+  endif
+endif
+	rm -f $(TOPDIR)/bin/DISKBOOT.BIN
+
+firzipsubcomplete: clean
+	$(MAKE) -s --no-print-directory infoline
+	$(MAKE) -s --no-print-directory firsub
+	@echo \-\> $(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip
+	rm -f $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip
+	@echo \-\> $(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip
+	rm -f $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip
+	LANG=C echo -e "CHDK-$(VER) for $(PLATFORM) fw:$(PLATFORMSUB) build:$(BUILD_NUMBER) date:`date -R`" | \
+	zip -9jz $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/bin/DISKBOOT.BIN > $(DEVNULL)
+	LANG=C echo -e "CHDK-$(VER) for $(PLATFORM) fw:$(PLATFORMSUB) build:$(BUILD_NUMBER) date:`date -R`" | \
+	zip -9jz $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip $(TOPDIR)/bin/DISKBOOT.BIN > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/SYMBOLS/*  > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/BOOKS/*  > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/CURVES/*  > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/FONTS/*  > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/GAMES/*   > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/GRIDS/* > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/LANG/*   > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/LUALIB/*   > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/LUALIB/GEN/*   > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/SCRIPTS/*  > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/SCRIPTS/examples/* 	 > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/SCRIPTS/TEST/* 	 > $(DEVNULL)
+	zip -9 $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/CHDK/syscurves.CVF 	 > $(DEVNULL)
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/doc/changelog.txt  > $(DEVNULL)
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip $(TOPDIR)/doc/changelog.txt  > $(DEVNULL)
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/tools/vers.req  > $(DEVNULL)
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/tools/vers.req  > $(DEVNULL)
+	cat $(TOPDIR)/doc/1_intro.txt $(TOPDIR)/platform/$(PLATFORM)/notes.txt $(TOPDIR)/doc/2_installation.txt $(TOPDIR)/doc/3_faq.txt $(TOPDIR)/doc/4_urls.txt $(TOPDIR)/doc/5_gpl.txt > $(TOPDIR)/doc/readme.txt
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/doc/readme.txt  > $(DEVNULL)
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip $(TOPDIR)/doc/readme.txt  > $(DEVNULL)
+
+ifdef PLATFORMOS
+  ifeq ($(PLATFORMOS),vxworks)
+	cp $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB).FIR $(TOPDIR)/bin/PS.FIR
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/bin/PS.FIR > $(DEVNULL)
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip $(TOPDIR)/bin/PS.FIR > $(DEVNULL)
+  endif
+  ifeq ($(PLATFORMOS),dryos)
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/doc/readme.txt  > $(DEVNULL)
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip $(TOPDIR)/doc/readme.txt  > $(DEVNULL)
+ifdef OPT_FI2
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full.zip $(TOPDIR)/bin/PS.FI2 > $(DEVNULL)
+	zip -9j $(TOPDIR)/bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER).zip $(TOPDIR)/bin/PS.FI2 > $(DEVNULL)
+	rm -f $(TOPDIR)/bin/PS.FI2
+endif
+  endif
+endif
+	rm -f $(TOPDIR)/bin/DISKBOOT.BIN
+
+
+batch-zip: version
+	$(MAKE) -s --no-print-directory PLATFORM=a610 PLATFORMSUB=100e NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a610 PLATFORMSUB=100f NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a620 PLATFORMSUB=100f NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a630 PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a640 PLATFORMSUB=100b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a700 PLATFORMSUB=100b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a710 PLATFORMSUB=100a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=s2is PLATFORMSUB=100e NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=s2is PLATFORMSUB=100f NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=s2is PLATFORMSUB=100g NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=s3is PLATFORMSUB=100a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100e NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100g NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100i NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100j NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=g9   PLATFORMSUB=100d NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=g9   PLATFORMSUB=100g NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a530 PLATFORMSUB=100a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a540 PLATFORMSUB=100b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a560 PLATFORMSUB=100a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a570 PLATFORMSUB=100e NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a570 PLATFORMSUB=101a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a590 PLATFORMSUB=100e NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a590 PLATFORMSUB=101b NO_INC_BUILD=1 firzipsub
+	#$(MAKE) -s --no-print-directory PLATFORM=s80  PLATFORMSUB=100g NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus700_sd500   PLATFORMSUB=101a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus700_sd500   PLATFORMSUB=101b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus800_sd700   PLATFORMSUB=101b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus800_sd700   PLATFORMSUB=100b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus850_sd800   PLATFORMSUB=100e NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus860_sd870   PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus950_sd850   PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub	
+	$(MAKE) -s --no-print-directory PLATFORM=ixus40_sd300    PLATFORMSUB=100k NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus40_sd300    PLATFORMSUB=100j NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus50_sd400    PLATFORMSUB=101a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus50_sd400    PLATFORMSUB=101b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus55_sd450    PLATFORMSUB=100b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus55_sd450    PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus55_sd450    PLATFORMSUB=100d NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus65_sd630    PLATFORMSUB=100a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus70_sd1000   PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus70_sd1000   PLATFORMSUB=101b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus70_sd1000   PLATFORMSUB=102a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus75_sd750   PLATFORMSUB=100b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus75_sd750   PLATFORMSUB=101a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus75_sd750   PLATFORMSUB=102a NO_INC_BUILD=1 firzipsub
+	#$(MAKE) -s --no-print-directory PLATFORM=ixusW_sd430     PLATFORMSUB=110a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a720 PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a650 PLATFORMSUB=100d NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a450 PLATFORMSUB=100d NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a460 PLATFORMSUB=100d NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a550 PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=s5is PLATFORMSUB=101a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=s5is PLATFORMSUB=101b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=tx1  PLATFORMSUB=100g NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=tx1  PLATFORMSUB=101b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=sx100is  PLATFORMSUB=100b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=sx100is  PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus750_sd550  PLATFORMSUB=100f NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus750_sd550  PLATFORMSUB=100g NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus60_sd600  PLATFORMSUB=100a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus60_sd600  PLATFORMSUB=100d NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus960_sd950  PLATFORMSUB=100d NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus80_sd1100  PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixus80_sd1100  PLATFORMSUB=101a NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=ixusizoom_sd30  PLATFORMSUB=100g NO_INC_BUILD=1 firzipsub
+	@echo "**** All firmwares created successfully"
+	@echo "**** Copying duplicate Firmwares"
+	cp $(TOPDIR)/bin/$(VER)-a610-100e-$(BUILD_NUMBER).zip $(TOPDIR)/bin/$(VER)-a610-100d-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/$(VER)-s2is-100g-$(BUILD_NUMBER).zip $(TOPDIR)/bin/$(VER)-s2is-100i-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/$(VER)-ixus800_sd700-101b-$(BUILD_NUMBER).zip $(TOPDIR)/bin/$(VER)-ixus800_sd700-101a-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/$(VER)-ixus850_sd800-100e-$(BUILD_NUMBER).zip $(TOPDIR)/bin/$(VER)-ixus850_sd800-100d-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/$(VER)-ixus70_sd1000-101b-$(BUILD_NUMBER).zip $(TOPDIR)/bin/$(VER)-ixus70_sd1000-101a-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/$(VER)-ixus75_sd750-101a-$(BUILD_NUMBER).zip $(TOPDIR)/bin/$(VER)-ixus75_sd750-101b-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/$(VER)-ixus80_sd1100-101a-$(BUILD_NUMBER).zip $(TOPDIR)/bin/$(VER)-ixus80_sd1100-101b-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/$(VER)-g9-100g-$(BUILD_NUMBER).zip $(TOPDIR)/bin/$(VER)-g9-100f-$(BUILD_NUMBER).zip
+	@echo "**** Done Copying duplicate Firmwares"
+	@echo "**** Summary of memisosizes"
+	cat $(TOPDIR)/bin/caminfo.txt
+	rm -f $(TOPDIR)/bin/caminfo.txt   > $(DEVNULL)
+
+batch-zip-complete: version
+	$(MAKE) -s --no-print-directory PLATFORM=a610 PLATFORMSUB=100e NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a610 PLATFORMSUB=100f NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a620 PLATFORMSUB=100f NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a630 PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a640 PLATFORMSUB=100b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a700 PLATFORMSUB=100b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a710 PLATFORMSUB=100a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=s2is PLATFORMSUB=100e NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=s2is PLATFORMSUB=100f NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=s2is PLATFORMSUB=100g NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=s3is PLATFORMSUB=100a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100e NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100g NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100i NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100j NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=g9   PLATFORMSUB=100d NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=g9   PLATFORMSUB=100g NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a530 PLATFORMSUB=100a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a540 PLATFORMSUB=100b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a560 PLATFORMSUB=100a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a570 PLATFORMSUB=100e NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a570 PLATFORMSUB=101a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a590 PLATFORMSUB=100e NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a590 PLATFORMSUB=101b NO_INC_BUILD=1 firzipsubcomplete
+	#$(MAKE) -s --no-print-directory PLATFORM=s80  PLATFORMSUB=100g NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus700_sd500   PLATFORMSUB=101a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus700_sd500   PLATFORMSUB=101b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus800_sd700   PLATFORMSUB=101b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus800_sd700   PLATFORMSUB=100b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus850_sd800   PLATFORMSUB=100e NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus860_sd870   PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus950_sd850   PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete	
+	$(MAKE) -s --no-print-directory PLATFORM=ixus40_sd300    PLATFORMSUB=100k NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus40_sd300    PLATFORMSUB=100j NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus50_sd400    PLATFORMSUB=101a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus50_sd400    PLATFORMSUB=101b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus55_sd450    PLATFORMSUB=100b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus55_sd450    PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus55_sd450    PLATFORMSUB=100d NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus65_sd630    PLATFORMSUB=100a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus70_sd1000   PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus70_sd1000   PLATFORMSUB=101b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus70_sd1000   PLATFORMSUB=102a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus75_sd750   PLATFORMSUB=100b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus75_sd750   PLATFORMSUB=101a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus75_sd750   PLATFORMSUB=102a NO_INC_BUILD=1 firzipsubcomplete
+	#$(MAKE) -s --no-print-directory PLATFORM=ixusW_sd430     PLATFORMSUB=110a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a720 PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a650 PLATFORMSUB=100d NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a450 PLATFORMSUB=100d NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a460 PLATFORMSUB=100d NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a550 PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=s5is PLATFORMSUB=101a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=s5is PLATFORMSUB=101b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=tx1  PLATFORMSUB=100g NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=tx1  PLATFORMSUB=101b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=sx100is  PLATFORMSUB=100b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=sx100is  PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus750_sd550  PLATFORMSUB=100f NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus750_sd550  PLATFORMSUB=100g NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus60_sd600  PLATFORMSUB=100a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus60_sd600  PLATFORMSUB=100d NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus960_sd950  PLATFORMSUB=100d NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus80_sd1100  PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixus80_sd1100  PLATFORMSUB=101a NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=ixusizoom_sd30  PLATFORMSUB=100g NO_INC_BUILD=1 firzipsubcomplete
+	@echo "**** All zipfiles including firmwares and extra stuff created successfully"
+	@echo "**** Copying duplicate Firmwares"
+	cp $(TOPDIR)/bin/a610-100e-$(BUILD_NUMBER)-full.zip $(TOPDIR)/bin/a610-100d-$(BUILD_NUMBER)-full.zip
+	cp $(TOPDIR)/bin/a610-100e-$(BUILD_NUMBER).zip $(TOPDIR)/bin/a610-100d-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/s2is-100g-$(BUILD_NUMBER)-full.zip $(TOPDIR)/bin/s2is-100i-$(BUILD_NUMBER)-full.zip
+	cp $(TOPDIR)/bin/s2is-100g-$(BUILD_NUMBER).zip $(TOPDIR)/bin/s2is-100i-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/ixus800_sd700-101b-$(BUILD_NUMBER)-full.zip $(TOPDIR)/bin/ixus800_sd700-101a-$(BUILD_NUMBER)-full.zip
+	cp $(TOPDIR)/bin/ixus800_sd700-101b-$(BUILD_NUMBER).zip $(TOPDIR)/bin/ixus800_sd700-101a-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/ixus850_sd800-100e-$(BUILD_NUMBER)-full.zip $(TOPDIR)/bin/ixus850_sd800-100d-$(BUILD_NUMBER)-full.zip
+	cp $(TOPDIR)/bin/ixus850_sd800-100e-$(BUILD_NUMBER).zip $(TOPDIR)/bin/ixus850_sd800-100d-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/ixus70_sd1000-101b-$(BUILD_NUMBER)-full.zip $(TOPDIR)/bin/ixus70_sd1000-101a-$(BUILD_NUMBER)-full.zip
+	cp $(TOPDIR)/bin/ixus70_sd1000-101b-$(BUILD_NUMBER).zip $(TOPDIR)/bin/ixus70_sd1000-101a-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/ixus75_sd750-101a-$(BUILD_NUMBER)-full.zip $(TOPDIR)/bin/ixus75_sd750-101b-$(BUILD_NUMBER)-full.zip
+	cp $(TOPDIR)/bin/ixus75_sd750-101a-$(BUILD_NUMBER).zip $(TOPDIR)/bin/ixus75_sd750-101b-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/ixus80_sd1100-101a-$(BUILD_NUMBER)-full.zip $(TOPDIR)/bin/ixus80_sd1100-101b-$(BUILD_NUMBER)-full.zip
+	cp $(TOPDIR)/bin/ixus80_sd1100-101a-$(BUILD_NUMBER).zip $(TOPDIR)/bin/ixus80_sd1100-101b-$(BUILD_NUMBER).zip
+	cp $(TOPDIR)/bin/g9-100g-$(BUILD_NUMBER)-full.zip $(TOPDIR)/bin/g9-100f-$(BUILD_NUMBER)-full.zip
+	cp $(TOPDIR)/bin/g9-100g-$(BUILD_NUMBER).zip $(TOPDIR)/bin/g9-100f-$(BUILD_NUMBER).zip
+	@echo "**** Done Copying duplicate Firmwares"
+	@echo "**** Summary of memisosizes"
+	cat $(TOPDIR)/bin/caminfo.txt
+	rm -f $(TOPDIR)/bin/caminfo.txt   > $(DEVNULL)
+
+
+
+batch-clean:
+	$(MAKE) -s --no-print-directory PLATFORM=a610 PLATFORMSUB=100e NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a610 PLATFORMSUB=100f NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a620 PLATFORMSUB=100f NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a630 PLATFORMSUB=100c NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a640 PLATFORMSUB=100b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a700 PLATFORMSUB=100b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a710 PLATFORMSUB=100a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=s2is PLATFORMSUB=100e NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=s2is PLATFORMSUB=100f NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=s2is PLATFORMSUB=100g NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=s3is PLATFORMSUB=100a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100e NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100g NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100i NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=g7   PLATFORMSUB=100j NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=g9   PLATFORMSUB=100d NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=g9   PLATFORMSUB=100g NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a530 PLATFORMSUB=100a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a540 PLATFORMSUB=100b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a560 PLATFORMSUB=100a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a570 PLATFORMSUB=100e NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a570 PLATFORMSUB=101a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a590 PLATFORMSUB=100e NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a590 PLATFORMSUB=101b NO_INC_BUILD=1 clean
+	#$(MAKE) -s --no-print-directory PLATFORM=s80  PLATFORMSUB=100g NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus700_sd500   PLATFORMSUB=101a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus700_sd500   PLATFORMSUB=101b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus800_sd700   PLATFORMSUB=101b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus800_sd700   PLATFORMSUB=100b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus850_sd800   PLATFORMSUB=100e NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus860_sd870   PLATFORMSUB=100c NO_INC_BUILD=1 clean	
+	$(MAKE) -s --no-print-directory PLATFORM=ixus950_sd850   PLATFORMSUB=100c NO_INC_BUILD=1 clean	
+	$(MAKE) -s --no-print-directory PLATFORM=ixus40_sd300    PLATFORMSUB=100k NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus40_sd300    PLATFORMSUB=100j NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus50_sd400    PLATFORMSUB=101a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus50_sd400    PLATFORMSUB=101b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus55_sd450    PLATFORMSUB=100b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus55_sd450    PLATFORMSUB=100c NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus55_sd450    PLATFORMSUB=100d NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus65_sd630    PLATFORMSUB=100a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus70_sd1000   PLATFORMSUB=100c NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus70_sd1000   PLATFORMSUB=101b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus70_sd1000   PLATFORMSUB=102a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus75_sd750   PLATFORMSUB=100b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus75_sd750   PLATFORMSUB=101a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus75_sd750   PLATFORMSUB=102a NO_INC_BUILD=1 clean
+	#$(MAKE) -s --no-print-directory PLATFORM=ixusW_sd430     PLATFORMSUB=110a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a720 PLATFORMSUB=100c NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a650 PLATFORMSUB=100d NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a450 PLATFORMSUB=100d NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a460 PLATFORMSUB=100d NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a550 PLATFORMSUB=100c NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=s5is PLATFORMSUB=101a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=s5is PLATFORMSUB=101b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=tx1  PLATFORMSUB=100g NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=tx1  PLATFORMSUB=101b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=sx100is  PLATFORMSUB=100b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=sx100is  PLATFORMSUB=100c NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus750_sd550  PLATFORMSUB=100f NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus750_sd550  PLATFORMSUB=100g NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus60_sd600  PLATFORMSUB=100a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus60_sd600  PLATFORMSUB=100d NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus960_sd950  PLATFORMSUB=100d NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus80_sd1100  PLATFORMSUB=100c NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixus80_sd1100  PLATFORMSUB=101a NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=ixusizoom_sd30  PLATFORMSUB=100g NO_INC_BUILD=1 clean	
+
+.PHONY: fir upload
+
+include bottom.inc
+
Index: lib/lang/makefile.inc.new
===================================================================
--- lib/lang/makefile.inc.new	(Revision 0)
+++ lib/lang/makefile.inc.new	(Revision 0)
@@ -0,0 +1,17 @@
+
+LOCAL_CFLAGS:=$(CTHUMB)
+
+OBJS := lang.o
+OBJS := $(call subdirize, $(OBJS) )
+
+$(eval $(call compile-targets,$(OBJS),$(LOCAL_CFLAGS)))
+
+$(eval $(call ar-targets, liblang.a, $(OBJS) ))
+
+$(eval $(call gen-rule, lang-lib-clean,, rm -f $(OBJS) $(subdir)/*.$(DEPSUFFIX) $(subdir)/liblang.a))
+
+lang-lib-distclean: lang-lib-clean
+	rm -f $(OBJS:.o=.d)
+
+# vim: ft=make
+
Index: lib/lua/liolib.c
===================================================================
--- lib/lua/liolib.c	(Revision 701)
+++ lib/lua/liolib.c	(Arbeitskopie)
@@ -497,7 +497,7 @@
     else {
       size_t l;
       const char *s = luaL_checklstring(L, arg, &l);
-      status = status && (fwrite(s, sizeof(char), l, f) == l);
+      status = status && (fwrite(s, sizeof(char), l, f) == (long)l);
     }
   }
   return pushresult(L, status, NULL);
Index: lib/lua/makefile.inc.new
===================================================================
--- lib/lua/makefile.inc.new	(Revision 0)
+++ lib/lua/makefile.inc.new	(Revision 0)
@@ -0,0 +1,46 @@
+
+
+LOCAL_CFLAGS := $(CTHUMB) -DSTDIO_COMPAT_FILE -DFS_USE_FUT
+
+LUA_OPTLIB_OBJS:=
+
+ifdef OPT_LUA_IOLIB
+LOCAL_CFLAGS+=-DOPT_LUA_IOLIB
+LUA_OPTLIB_OBJS+=liolib.o
+endif
+
+ifdef OPT_LUA_OSLIB
+LOCAL_CFLAGS+=-DOPT_LUA_OSLIB
+LUA_OPTLIB_OBJS+=loslib.o
+endif
+
+ifdef OPT_LUA_STRLIB
+LOCAL_CFLAGS+=-DOPT_LUA_STRLIB
+LUA_OPTLIB_OBJS+=lstrlib.o
+endif
+
+ASM_OBJS := setjmp.o
+
+C_OBJS := \
+       lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
+       lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
+       lundump.o lvm.o lzio.o \
+       \
+       lauxlib.o lbaselib.o ldblib.o ltablib.o lmathlib.o \
+	   $(LUA_OPTLIB_OBJS) loadlib.o linit.o
+
+OBJS := $(call subdirize,$(ASM_OBJS) $(C_OBJS) )
+C_OBJS := $(call subdirize,$(C_OBJS) )
+ASM_OBJS := $(call subdirize,$(ASM_OBJS) )
+
+$(eval $(call compile-targets,$(C_OBJS),$(LOCAL_CFLAGS)))
+$(eval $(call compile-asm-targets,$(ASM_OBJS),$(LOCAL_CFLAGS)))
+
+
+$(eval $(call ar-targets, liblua.a, $(OBJS)))
+
+$(eval $(call gen-rule, lua-lib-clean,, rm -f $(OBJS) $(subdir)/*.$(DEPSUFFIX) $(subdir)/liblua.a ))
+
+$(eval $(call gen-rule, lua-lib-distclean, lua-lib-clean, rm -f $(OBJS:.o=.d)))
+
+# vim: filetype=make
Index: lib/font/makefile.inc.new
===================================================================
--- lib/font/makefile.inc.new	(Revision 0)
+++ lib/font/makefile.inc.new	(Revision 0)
@@ -0,0 +1,18 @@
+
+
+LOCAL_CFLAGS:=$(CTHUMB)
+
+OBJS := font_8x16.o rbf_font.o
+OBJS := $(call subdirize, $(OBJS) )
+
+$(eval $(call compile-targets,$(OBJS),$(LOCAL_CFLAGS)))
+
+$(eval $(call ar-targets, libfont.a, $(OBJS)))
+
+# XXX generate the .h deps automatically via -MMD !!
+font_8x16.o: font_8x16.c codepages.h font_8x16_uni.h
+
+$(eval $(call gen-rule,font-lib-clean,,rm -f $(OBJS) $(subdir)/*.$(DEPSUFFIX) $(subdir)/libfont.a))
+$(eval $(call gen-rule,font-lib-distclean,font-lib-clean,rm -rf $(OBJS:.o=.d)))
+
+# vim: ft=make
Index: lib/ubasic/makefile.inc.new
===================================================================
--- lib/ubasic/makefile.inc.new	(Revision 0)
+++ lib/ubasic/makefile.inc.new	(Revision 0)
@@ -0,0 +1,18 @@
+
+LOCAL_CFLAGS:=$(CTHUMB)
+
+OBJS := camera_functions.o tokenizer.o ubasic.o
+OBJS := $(call subdirize, $(OBJS) )
+
+$(eval $(call compile-targets,$(OBJS),$(LOCAL_CFLAGS)))
+
+$(eval $(call ar-targets, libubasic.a, $(OBJS),))
+
+check:
+	gcc -g -Wall -DTEST -DCAMERA_a610 -o ubasic_test$(EXE) *.c
+
+$(eval $(call gen-rule, ubasic-lib-clean,, rm -f $(OBJS) $(subdir)/*.$(DEPSUFFIX) $(subdir)/libubasic.a $(subdir)/ubasic_test$(EXE) ))
+
+$(eval $(call gen-rule, ubasic-lib-distclean, ubasic-lib-clean, rm -f $(OBJS:.o=.d) ))
+
+# vim: ft=make
Index: lib/libc/Makefile
===================================================================
--- lib/libc/Makefile	(Revision 701)
+++ lib/libc/Makefile	(Arbeitskopie)
@@ -1,5 +1,7 @@
 topdir=../../
 
+primary: libc.a
+
 include $(topdir)makefile.inc
 
 CFLAGS+=$(CTHUMB)
Index: lib/libc/makefile.inc.new
===================================================================
--- lib/libc/makefile.inc.new	(Revision 0)
+++ lib/libc/makefile.inc.new	(Revision 0)
@@ -0,0 +1,18 @@
+
+LOCAL_CFLAGS:=$(CTHUMB)
+
+OBJS := issmth.o strncmp.o strtol.o strchr.o \
+    memcmp.o memset.o memmove.o memcpy.o strlen.o \
+    strcmp.o
+
+OBJS := $(call subdirize, $(OBJS) )
+
+$(eval $(call compile-targets,$(OBJS),$(LOCAL_CFLAGS)))
+
+$(eval $(call gen-rule, libc.a, $(OBJS),))
+
+$(eval $(call gen-rule, libc-lib-clean,, rm -f $(OBJS) $(subdir)/*.$(DEPSUFFIX) $(subdir)/libc.a))
+
+$(eval $(call gen-rule, libc-lib-distclean, libc-lib-clean, rm -f $(OBJS:.o=.d)))
+
+# vim: ft=make
Index: lib/math/makefile.inc.new
===================================================================
--- lib/math/makefile.inc.new	(Revision 0)
+++ lib/math/makefile.inc.new	(Revision 0)
@@ -0,0 +1,18 @@
+
+LOCAL_CFLAGS:=$(CTHUMB)
+
+OBJS := d2d.o wrapper.o
+OBJS := $(call subdirize, $(OBJS) )
+
+$(eval $(call compile-targets,$(OBJS),$(LOCAL_CFLAGS)))
+
+$(eval $(call ar-targets, libmath.a, $(OBJS)))
+
+# XXX AUTOGEN!
+d2d.o: d2d.c fdlibm.h
+
+$(eval $(call gen-rule, math-lib-clean,, rm -f $(OBJS) $(subdir)/*.$(DEPSUFFIX) $(subdir)/libmath.a))
+
+$(eval $(call gen-rule, math-lib-distclean, math-lib-clean, rm -f $(OBJS:.o=.d) ))
+
+# vim: ft=make
Index: lib/makefile.inc.new
===================================================================
--- lib/makefile.inc.new	(Revision 0)
+++ lib/makefile.inc.new	(Revision 0)
@@ -0,0 +1,13 @@
+
+LOCAL_SUBDIRS:=font math ubasic lang lua libc
+
+$(eval $(call gen-rule, lib-clean, $(foreach lsub,$(LOCAL_SUBDIRS),$(lsub)-lib-clean),))
+
+$(eval $(call gen-rule, lib-distclean, $(foreach lsub,$(LOCAL_SUBDIRS),$(lsub)-lib-distclean),))
+
+LOCAL_SUBDIRS:=$(call subdirize,$(LOCAL_SUBDIRS) )
+
+$(foreach subdir,$(LOCAL_SUBDIRS),$(eval include $(subdir)/makefile.inc.new) )
+
+
+# vim: filetype=make
Index: loader/g9/resetcode/makefile.inc.new
===================================================================
--- loader/g9/resetcode/makefile.inc.new	(Revision 0)
+++ loader/g9/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/g9/makefile.inc.new
===================================================================
--- loader/g9/makefile.inc.new	(Revision 0)
+++ loader/g9/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/s2is/resetcode/makefile.inc.new
===================================================================
--- loader/s2is/resetcode/makefile.inc.new	(Revision 0)
+++ loader/s2is/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/s2is/makefile.inc.new
===================================================================
--- loader/s2is/makefile.inc.new	(Revision 0)
+++ loader/s2is/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/s3is/resetcode/makefile.inc.new
===================================================================
--- loader/s3is/resetcode/makefile.inc.new	(Revision 0)
+++ loader/s3is/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/s3is/makefile.inc.new
===================================================================
--- loader/s3is/makefile.inc.new	(Revision 0)
+++ loader/s3is/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus65_sd630/resetcode/makefile.inc.new
===================================================================
--- loader/ixus65_sd630/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus65_sd630/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus65_sd630/makefile.inc.new
===================================================================
--- loader/ixus65_sd630/makefile.inc.new	(Revision 0)
+++ loader/ixus65_sd630/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/s5is/resetcode/makefile.inc.new
===================================================================
--- loader/s5is/resetcode/makefile.inc.new	(Revision 0)
+++ loader/s5is/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/s5is/makefile.inc.new
===================================================================
--- loader/s5is/makefile.inc.new	(Revision 0)
+++ loader/s5is/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus70_sd1000/resetcode/makefile.inc.new
===================================================================
--- loader/ixus70_sd1000/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus70_sd1000/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus70_sd1000/makefile.inc.new
===================================================================
--- loader/ixus70_sd1000/makefile.inc.new	(Revision 0)
+++ loader/ixus70_sd1000/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus80_sd1100/resetcode/makefile.inc.new
===================================================================
--- loader/ixus80_sd1100/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus80_sd1100/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus80_sd1100/makefile.inc.new
===================================================================
--- loader/ixus80_sd1100/makefile.inc.new	(Revision 0)
+++ loader/ixus80_sd1100/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixusW_sd430/resetcode/makefile.inc.new
===================================================================
--- loader/ixusW_sd430/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixusW_sd430/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixusW_sd430/makefile.inc.new
===================================================================
--- loader/ixusW_sd430/makefile.inc.new	(Revision 0)
+++ loader/ixusW_sd430/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus850_sd800/resetcode/makefile.inc.new
===================================================================
--- loader/ixus850_sd800/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus850_sd800/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus850_sd800/makefile.inc.new
===================================================================
--- loader/ixus850_sd800/makefile.inc.new	(Revision 0)
+++ loader/ixus850_sd800/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus40_sd300/resetcode/makefile.inc.new
===================================================================
--- loader/ixus40_sd300/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus40_sd300/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus40_sd300/makefile.inc.new
===================================================================
--- loader/ixus40_sd300/makefile.inc.new	(Revision 0)
+++ loader/ixus40_sd300/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a700/resetcode/makefile.inc.new
===================================================================
--- loader/a700/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a700/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a700/makefile.inc.new
===================================================================
--- loader/a700/makefile.inc.new	(Revision 0)
+++ loader/a700/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a620/resetcode/makefile.inc.new
===================================================================
--- loader/a620/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a620/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a620/makefile.inc.new
===================================================================
--- loader/a620/makefile.inc.new	(Revision 0)
+++ loader/a620/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a540/resetcode/makefile.inc.new
===================================================================
--- loader/a540/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a540/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a540/makefile.inc.new
===================================================================
--- loader/a540/makefile.inc.new	(Revision 0)
+++ loader/a540/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a720/resetcode/makefile.inc.new
===================================================================
--- loader/a720/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a720/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a720/makefile.inc.new
===================================================================
--- loader/a720/makefile.inc.new	(Revision 0)
+++ loader/a720/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/s80/resetcode/makefile.inc.new
===================================================================
--- loader/s80/resetcode/makefile.inc.new	(Revision 0)
+++ loader/s80/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/s80/makefile.inc.new
===================================================================
--- loader/s80/makefile.inc.new	(Revision 0)
+++ loader/s80/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus60_sd600/resetcode/makefile.inc.new
===================================================================
--- loader/ixus60_sd600/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus60_sd600/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus60_sd600/makefile.inc.new
===================================================================
--- loader/ixus60_sd600/makefile.inc.new	(Revision 0)
+++ loader/ixus60_sd600/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a460/resetcode/makefile.inc.new
===================================================================
--- loader/a460/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a460/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a460/makefile.inc.new
===================================================================
--- loader/a460/makefile.inc.new	(Revision 0)
+++ loader/a460/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a640/resetcode/makefile.inc.new
===================================================================
--- loader/a640/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a640/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a640/makefile.inc.new
===================================================================
--- loader/a640/makefile.inc.new	(Revision 0)
+++ loader/a640/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/makefile_resetcode.inc.new
===================================================================
--- loader/makefile_resetcode.inc.new	(Revision 0)
+++ loader/makefile_resetcode.inc.new	(Revision 0)
@@ -0,0 +1,30 @@
+
+# warning: library order matters!
+LDLIBS:=
+LDOPTS:=-nostdlib -Wl,--allow-shlib-undefined -Wl,--no-define-common,-EL,-T,$(topdir)tools/link-boot.ld
+LDOPTS+=-Wl,-N,-Ttext,$(RESTARTSTART)
+
+subdir:=$(subdir)/resetcode
+
+ASM_OBJS:=entry.o
+C_OBJS:=main.o
+OBJS:=$(call subdirize, $(ASM_OBJS) $(C_OBJS) )
+
+$(eval $(call compile-asm-targets, $(ASM_OBJS),,))
+$(eval $(call compile-targets, $(C_OBJS),,))
+
+$(eval $(call gen-rule, $(subdir)/main.bin, $(subdir)/main.elf, \
+	$(OBJDUMP) -z -d $(subdir)/main.elf > $(subdir)/main.dump; \
+	$(OBJCOPY) -O binary $(subdir)/main.elf $(subdir)/main.bin ) )
+
+$(eval $(call gen-rule, $(subdir)/main.elf, $(OBJS), \
+	$(CC) $(CFLAGS) -o $(subdir)/main.elf $(OBJS) $(LDLIBS) $(LDFLAGS) $(LDOPTS); \
+	( $(NM) $(subdir)/main.elf | grep ' U ' > $(subdir)/main.elf.syms ) && exit 1 || exit 0 ) )
+
+$(eval $(call gen-rule, resetcode-$(PLATFORM)-loader-clean,, \
+	$(SILENCE)rm -f $(OBJS) $(subdir)/*.$(DEPSUFFIX) $(subdir)/main.bin $(subdir)/main.elf $(subdir)/main.dump $(subdir)/main.elf.syms ) )
+
+$(eval $(call gen-rule, resetcode-$(PLATFORM)-loader-distclean,, \
+	$(SILENCE)rm -f $(OBJS) $(subdir)/main.bin $(subdir)/main.elf $(subdir)/main.dump $(subdir)/main.elf.syms ))
+
+# vim: ft=make
Index: loader/ixus960_sd950/resetcode/makefile.inc.new
===================================================================
--- loader/ixus960_sd950/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus960_sd950/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus960_sd950/makefile.inc.new
===================================================================
--- loader/ixus960_sd950/makefile.inc.new	(Revision 0)
+++ loader/ixus960_sd950/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus860_sd870/resetcode/makefile.inc.new
===================================================================
--- loader/ixus860_sd870/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus860_sd870/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus860_sd870/makefile.inc.new
===================================================================
--- loader/ixus860_sd870/makefile.inc.new	(Revision 0)
+++ loader/ixus860_sd870/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a560/resetcode/makefile.inc.new
===================================================================
--- loader/a560/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a560/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a560/makefile.inc.new
===================================================================
--- loader/a560/makefile.inc.new	(Revision 0)
+++ loader/a560/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/tx1/resetcode/makefile.inc.new
===================================================================
--- loader/tx1/resetcode/makefile.inc.new	(Revision 0)
+++ loader/tx1/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/tx1/makefile.inc.new
===================================================================
--- loader/tx1/makefile.inc.new	(Revision 0)
+++ loader/tx1/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus55_sd450/resetcode/makefile.inc.new
===================================================================
--- loader/ixus55_sd450/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus55_sd450/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus55_sd450/makefile.inc.new
===================================================================
--- loader/ixus55_sd450/makefile.inc.new	(Revision 0)
+++ loader/ixus55_sd450/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus75_sd750/resetcode/makefile.inc.new
===================================================================
--- loader/ixus75_sd750/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus75_sd750/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus75_sd750/makefile.inc.new
===================================================================
--- loader/ixus75_sd750/makefile.inc.new	(Revision 0)
+++ loader/ixus75_sd750/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus700_sd500/resetcode/makefile.inc.new
===================================================================
--- loader/ixus700_sd500/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus700_sd500/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus700_sd500/makefile.inc.new
===================================================================
--- loader/ixus700_sd500/makefile.inc.new	(Revision 0)
+++ loader/ixus700_sd500/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus800_sd700/resetcode/makefile.inc.new
===================================================================
--- loader/ixus800_sd700/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus800_sd700/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus800_sd700/makefile.inc.new
===================================================================
--- loader/ixus800_sd700/makefile.inc.new	(Revision 0)
+++ loader/ixus800_sd700/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixusizoom_sd30/resetcode/makefile.inc.new
===================================================================
--- loader/ixusizoom_sd30/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixusizoom_sd30/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixusizoom_sd30/makefile.inc.new
===================================================================
--- loader/ixusizoom_sd30/makefile.inc.new	(Revision 0)
+++ loader/ixusizoom_sd30/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus750_sd550/resetcode/makefile.inc.new
===================================================================
--- loader/ixus750_sd550/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus750_sd550/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus750_sd550/makefile.inc.new
===================================================================
--- loader/ixus750_sd550/makefile.inc.new	(Revision 0)
+++ loader/ixus750_sd550/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a610/resetcode/makefile.inc.new
===================================================================
--- loader/a610/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a610/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a610/makefile.inc.new
===================================================================
--- loader/a610/makefile.inc.new	(Revision 0)
+++ loader/a610/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/sx100is/resetcode/makefile.inc.new
===================================================================
--- loader/sx100is/resetcode/makefile.inc.new	(Revision 0)
+++ loader/sx100is/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/sx100is/makefile.inc.new
===================================================================
--- loader/sx100is/makefile.inc.new	(Revision 0)
+++ loader/sx100is/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus50_sd400/resetcode/makefile.inc.new
===================================================================
--- loader/ixus50_sd400/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus50_sd400/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus50_sd400/makefile.inc.new
===================================================================
--- loader/ixus50_sd400/makefile.inc.new	(Revision 0)
+++ loader/ixus50_sd400/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a530/resetcode/makefile.inc.new
===================================================================
--- loader/a530/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a530/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a530/makefile.inc.new
===================================================================
--- loader/a530/makefile.inc.new	(Revision 0)
+++ loader/a530/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a710/resetcode/makefile.inc.new
===================================================================
--- loader/a710/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a710/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a710/makefile.inc.new
===================================================================
--- loader/a710/makefile.inc.new	(Revision 0)
+++ loader/a710/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a450/resetcode/makefile.inc.new
===================================================================
--- loader/a450/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a450/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a450/makefile.inc.new
===================================================================
--- loader/a450/makefile.inc.new	(Revision 0)
+++ loader/a450/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/ixus950_sd850/main.c
===================================================================
--- loader/ixus950_sd850/main.c	(Revision 701)
+++ loader/ixus950_sd850/main.c	(Arbeitskopie)
@@ -11,7 +11,7 @@
 void __attribute__((noreturn)) my_restart() 
 {
     void __attribute__((noreturn)) (*copy_and_restart)(char *dst, char *src, long length);
-    int i;
+    unsigned int i;
 
     for (i=0;i<(blob_copy_and_reset_size/sizeof(long));i++){
 	((long*)(RESTARTSTART))[i] = blob_copy_and_reset[i];
Index: loader/ixus950_sd850/resetcode/makefile.inc.new
===================================================================
--- loader/ixus950_sd850/resetcode/makefile.inc.new	(Revision 0)
+++ loader/ixus950_sd850/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/ixus950_sd850/makefile.inc.new
===================================================================
--- loader/ixus950_sd850/makefile.inc.new	(Revision 0)
+++ loader/ixus950_sd850/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a630/resetcode/makefile.inc.new
===================================================================
--- loader/a630/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a630/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a630/makefile.inc.new
===================================================================
--- loader/a630/makefile.inc.new	(Revision 0)
+++ loader/a630/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/makefile_generic.inc.new
===================================================================
--- loader/makefile_generic.inc.new	(Revision 0)
+++ loader/makefile_generic.inc.new	(Revision 0)
@@ -0,0 +1,46 @@
+
+
+
+
+LDLIBS=
+LOADER_LDOPTS:=-nostdlib -Wl,--allow-shlib-undefined -Wl,--no-define-common,-EL,-T,$(TOPDIR)/tools/link-boot.ld
+LOADER_LDOPTS+=-Wl,-N,-Ttext,$(MEMBASEADDR)
+
+LOCAL_CFLAGS:=-I.
+
+CORE_FILE:=$(TOPDIR)/core/main.bin
+RESET_FILE:=$(subdir)/resetcode/main.bin
+
+LOCAL_CFLAGS+=-DCORE_FILE=\"$(CORE_FILE)\"
+LOCAL_CFLAGS+=-DRESET_FILE=\"$(RESET_FILE)\"
+
+$(eval $(call gen-rule, $(subdir)/main.bin, loader-main.bin, ))
+
+ASM_OBJS :=entry.o blobs.o
+C_OBJS := main.o 
+
+ASM_OBJS:=$(call subdirize,$(ASM_OBJS) )
+C_OBJS:=$(call subdirize,$(C_OBJS) )
+
+$(eval $(call compile-asm-targets, $(ASM_OBJS) , $(LOCAL_CFLAGS), $(CORE_FILE) $(RESET_FILE) ) )
+$(eval $(call compile-targets, $(C_OBJS) , $(LOCAL_CFLAGS) ) )
+
+
+OBJS:=$(ASM_OBJS) $(C_OBJS)
+
+$(eval $(call gen-rule, loader-main.bin, loader-main.elf, \
+	$(OBJDUMP) -z -d $(subdir)/main.elf > $(subdir)/main.dump; \
+	$(OBJCOPY) -O binary $(subdir)/main.elf $(subdir)/main.bin ))
+
+$(eval $(call gen-rule, loader-main.elf, $(OBJS), \
+	$(SILENCE)$(CC) $(CFLAGS) -o $(subdir)/main.elf $(OBJS) $(LDLIBS) $(LDFLAGS) $(LOADER_LDOPTS); \
+	( $(NM) $(subdir)/main.elf | grep ' U ' > $(subdir)/main.elf.syms ) && exit 1 || exit 0 ) )
+
+$(eval $(call gen-rule, $(PLATFORM)-loader-clean, resetcode-$(PLATFORM)-loader-clean, rm -f $(OBJS) $(subdir)/*.$(DEPSUFFIX) $(subdir)/main.bin $(subdir)/main.elf $(subdir)/main.dump $(subdir)/main.elf.syms))
+
+$(eval $(call gen-rule, $(PLATFORM)-loader-distclean, resetcode-$(PLATFORM)-loader-distclean loader-clean, rm -f reboot_core.h copy_and_reset.h ))
+
+LOCAL_SUBDIRS:=$(subdir)/resetcode
+$(foreach subdir,$(LOCAL_SUBDIRS),$(eval include $(subdir)/makefile.inc.new) )
+
+# vim: ft=make
Index: loader/a550/resetcode/makefile.inc.new
===================================================================
--- loader/a550/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a550/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a550/makefile.inc.new
===================================================================
--- loader/a550/makefile.inc.new	(Revision 0)
+++ loader/a550/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a650/resetcode/makefile.inc.new
===================================================================
--- loader/a650/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a650/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a650/makefile.inc.new
===================================================================
--- loader/a650/makefile.inc.new	(Revision 0)
+++ loader/a650/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/a570/resetcode/makefile.inc.new
===================================================================
--- loader/a570/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a570/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a570/makefile.inc.new
===================================================================
--- loader/a570/makefile.inc.new	(Revision 0)
+++ loader/a570/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/g7/resetcode/makefile.inc.new
===================================================================
--- loader/g7/resetcode/makefile.inc.new	(Revision 0)
+++ loader/g7/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/g7/makefile.inc.new
===================================================================
--- loader/g7/makefile.inc.new	(Revision 0)
+++ loader/g7/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: loader/makefile.inc.new
===================================================================
--- loader/makefile.inc.new	(Revision 0)
+++ loader/makefile.inc.new	(Revision 0)
@@ -0,0 +1,16 @@
+
+
+
+LOCAL_SUBDIRS:=$(PLATFORM)
+
+$(eval $(call gen-rule, loader-clean, $(foreach lsub,$(LOCAL_SUBDIRS),$(lsub)-loader-clean), ))
+
+$(eval $(call gen-rule, loader-distclean, $(foreach lsub,$(LOCAL_SUBDIRS),$(lsub)-loader-distclean), ))
+
+LOCAL_SUBDIRS:=$(call subdirize,$(LOCAL_SUBDIRS) )
+
+$(foreach subdir,$(LOCAL_SUBDIRS),$(eval include $(subdir)/makefile.inc.new) )
+
+# vim: ft=make
+
+
Index: loader/a590/resetcode/makefile.inc.new
===================================================================
--- loader/a590/resetcode/makefile.inc.new	(Revision 0)
+++ loader/a590/resetcode/makefile.inc.new	(Revision 0)
@@ -0,0 +1,6 @@
+
+# warning: library order matters!
+
+include $(TOPDIR)/loader/makefile_resetcode.inc.new
+
+# vim: ft=make
Index: loader/a590/makefile.inc.new
===================================================================
--- loader/a590/makefile.inc.new	(Revision 0)
+++ loader/a590/makefile.inc.new	(Revision 0)
@@ -0,0 +1,4 @@
+
+include $(TOPDIR)/loader/makefile_generic.inc.new
+
+# vim: ft=make
Index: makenewcam
===================================================================
--- makenewcam	(Revision 0)
+++ makenewcam	(Revision 0)
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+SRCCAM=ixus950_sd850
+SRCSUB=100c
+NEWCAM=$1
+if [[ -z "$NEWCAM" ]]
+then
+  echo "Need cam as parameter"
+  exit 1
+fi
+
+if [[ ! -d "platform/$NEWCAM" ]]
+then
+    echo "Platform dir does not exist"
+    exit 1
+fi
+
+set +x
+cp -i platform/$SRCCAM/makefile.inc.new platform/$NEWCAM/
+for dir in platform/$NEWCAM/sub/*
+do
+    if [[ -d "$dir" ]]
+    then
+	cp -i platform/$SRCCAM/sub/$SRCSUB/makefile.inc.new $dir/
+    fi
+done
+cp -i loader/$SRCCAM/resetcode/makefile.inc.new loader/$NEWCAM/resetcode/
+cp -i loader/$SRCCAM/makefile.inc.new loader/$NEWCAM/

Eigenschaftsänderungen: makenewcam
___________________________________________________________________
Hinzugefügt: svn:executable
   + *

