Index: include/histogram.h
===================================================================
--- include/histogram.h	(Revision 727)
+++ 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 727)
+++ 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,
@@ -477,6 +477,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 727)
+++ 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 727)
+++ include/lolevel.h	(Arbeitskopie)
@@ -42,12 +42,17 @@
 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); 
 extern void _taskResume(int taskId);
 extern int _errnoOfTaskGet(int tid);
 extern long _IsStrobeChargeCompleted();
+extern int _ExpTimeInMicroseconds(int TvInApex);
 
 long _SetEventFlag(void *flag, long what);
 long _CheckAnyEventFlag(void *flag, long mask, long *res);
@@ -152,6 +157,7 @@
 extern void capt_seq_task();
 extern void movie_record_task();
 extern void init_file_modules_task();
+extern void _task_ExpDrvTask();
 
 void kbd_fetch_data(long *dst);
 
Index: include/camera.h
===================================================================
--- include/camera.h	(Revision 727)
+++ include/camera.h	(Arbeitskopie)
@@ -58,6 +58,7 @@
     #define CAM_SENSOR_BITS_PER_PIXEL   10  // Bits per pixel. 10 is standard, 12 is supported except for curves
     #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
     #define CAM_BLACK_LEVEL             31
+    #define CAM_HAS_EXTENDED_TV_LENGTH 0
 //----------------------------------------------------------
 // Overridden values for each camera
 //----------------------------------------------------------
@@ -242,6 +243,9 @@
     #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
     #define DNG_EXT_FROM ".DPS"
 
+    #undef CAM_HAS_EXTENDED_TV_LENGTH
+    #define CAM_HAS_EXTENDED_TV_LENGTH            1
+
 //----------------------------------------------------------
 #elif defined (CAMERA_a540)
     #define CAM_PROPSET                 1
@@ -391,6 +395,8 @@
     #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
 
     #define DNG_EXT_FROM ".DPS"
+    #undef CAM_HAS_EXTENDED_TV_LENGTH
+    #define CAM_HAS_EXTENDED_TV_LENGTH 1
 
 //----------------------------------------------------------
 #elif defined (CAMERA_a590)
@@ -677,6 +683,9 @@
 
     #define DNG_EXT_FROM ".DPS"
 
+    #undef CAM_HAS_EXTENDED_TV_LENGTH
+    #define CAM_HAS_EXTENDED_TV_LENGTH            1
+
 //----------------------------------------------------------
 #elif defined (CAMERA_a720)
     #define CAM_PROPSET                 2
@@ -1277,6 +1286,9 @@
 
 //----------------------------------------------------------
 #elif defined (CAMERA_ixus950_sd850)
+
+    #undef CAM_HAS_EXTENDED_TV_LENGTH
+    #define CAM_HAS_EXTENDED_TV_LENGTH 1
     #define CAM_PROPSET                 2
 
     #define CAM_RAW_ROWPIX              3336   // for new 8 MP
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 727)
+++ 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/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/a720/sub/100c/stubs_auto.S
===================================================================
--- platform/a720/sub/100c/stubs_auto.S	(Revision 727)
+++ 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/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/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/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/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/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/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/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/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/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/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/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 727)
+++ 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 727)
+++ 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/capt_seq.c
===================================================================
--- platform/a710/sub/100a/capt_seq.c	(Revision 727)
+++ platform/a710/sub/100a/capt_seq.c	(Arbeitskopie)
@@ -238,3 +238,500 @@
 	);
 }
 
+/*************************************************************/
+void __attribute__((naked,noinline)) _task_ExpDrvTask(){
+ asm volatile(
+                 "STMFD   SP!, {R4-R8,LR}\n"
+                 "SUB     SP, SP, #0x20\n"
+                 "ADD     R7, SP, #4\n"
+                 "B       loc_FFD05950\n"
+ "loc_FFD054A4:\n"
+                 "CMP     R2, #0x22\n"
+                 "BNE     loc_FFD054BC\n"
+                 "LDR     R0, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "B       loc_FFD05520\n"
+ "loc_FFD054BC:\n"
+                 "CMP     R2, #0x1D\n"
+                 "BNE     loc_FFD054D0\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_FFD05364\n"
+                 "B       loc_FFD05510\n"
+ "loc_FFD054D0:\n"
+                 "CMP     R2, #0x1E\n"
+                 "BNE     loc_FFD054E4\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_FFD053C0\n"
+                 "B       loc_FFD05510\n"
+ "loc_FFD054E4:\n"
+                 "SUB     R3, R2, #0x1F\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_FFD054FC\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_FFD0541C\n"
+                 "B       loc_FFD05510\n"
+ "loc_FFD054FC:\n"
+                 "CMP     R2, #0x21\n"
+                 "BNE     loc_FFD0552C\n"
+                 "BL      sub_FFCA4380\n"
+                 "BL      sub_FFCA7474\n"
+                 "BL      sub_FFCA66AC\n"
+ "loc_FFD05510:\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "LDR     R0, [R3,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x88]\n"
+ "loc_FFD05520:\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_FFD00F00\n"
+                 "B       loc_FFD05950\n"
+ "loc_FFD0552C:\n"
+                 "CMP     R2, #0xD\n"
+                 "MOV     R8, #1\n"
+                 "BNE     loc_FFD0559C\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "ADD     R1, R1, R1,LSL#1\n"
+                 "ADD     R1, R12, R1,LSL#2\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "SUB     R1, R1, #8\n"
+                 "MOV     R2, #0xC\n"
+                 "MOV     R0, R6\n"
+                 "BL      _memcpy\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_FFD039DC\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "LDR     R1, [R3,#0x7C]\n"
+                 "LDR     R2, [R3,#0x8C]\n"
+                 "ADD     R0, R3, #4\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x88]\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_FFD03CAC\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "ADD     R0, R3, #4\n"
+                 "LDR     R1, [R3,#0x7C]\n"
+                 "LDR     R2, [R3,#0x94]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x90]\n"
+                 "B       loc_FFD058EC\n"
+ "loc_FFD0559C:\n"
+                 "SUB     R3, R2, #0xE\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_FFD05658\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "ADD     R5, SP, #8\n"
+                 "MOV     R0, R12\n"
+                 "MOV     R1, R6\n"
+                 "MOV     R2, R5\n"
+                 "BL      sub_FFD03DA0\n"
+                 "MOV     R4, R0\n"
+                 "CMP     R4, #5\n"
+                 "CMPNE   R4, #1\n"
+                 "BNE     loc_FFD055F0\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "MOV     R0, R5\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "MOV     R2, R4\n"
+                 "LDR     R3, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "B       loc_FFD05628\n"
+ "loc_FFD055F0:\n"
+                 "CMP     R4, #6\n"
+                 "CMPNE   R4, #2\n"
+                 "BNE     loc_FFD05638\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "MOV     R0, R5\n"
+                 "MOV     R1, R8\n"
+                 "MOV     R2, R4\n"
+                 "LDR     R3, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "MOV     R1, R6\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "MOV     R2, R5\n"
+                 "BL      sub_FFD04FD0\n"
+ "loc_FFD05628:\n"
+                 "MOV     R1, R4\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_FFD052F8\n"
+                 "B       loc_FFD058EC\n"
+ "loc_FFD05638:\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "MOV     R2, R4\n"
+                 "ADD     R0, R12, #4\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "LDR     R3, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "B       loc_FFD058EC\n"
+ "loc_FFD05658:\n"
+                 "SUB     R3, R2, #0x19\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_FFD056B0\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "ADD     R1, R1, R1,LSL#1\n"
+                 "ADD     R1, R12, R1,LSL#2\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "SUB     R1, R1, #8\n"
+                 "MOV     R2, #0xC\n"
+                 "MOV     R0, R6\n"
+                 "BL      _memcpy\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_FFD02DD4\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "ADD     R0, R3, #4\n"
+                 "LDR     R1, [R3,#0x7C]\n"
+                 "LDR     R2, [R3,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x88]\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_FFD031B0\n"
+                 "B       loc_FFD058EC\n"
+ "loc_FFD056B0:\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "ADD     R1, R12, #4\n"
+                 "MOV     R2, #0xC\n"
+                 "MOV     R0, R6\n"
+                 "BL      memcpy\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "LDR     R3, [R12]\n"
+                 "MOV     R2, R12\n"
+                 "CMP     R3, #0x1C\n"
+                 "LDRLS   PC, [PC,R3,LSL#2]\n"
+                 "B       loc_FFD058D8\n"
+                 ".long loc_FFD05750\n"
+                 ".long loc_FFD0575C\n"
+                 ".long loc_FFD05768\n"
+                 ".long loc_FFD05768\n"
+                 ".long loc_FFD05750\n"
+                 ".long loc_FFD0575C\n"
+                 ".long loc_FFD05768\n"
+                 ".long loc_FFD05768\n"
+                 ".long loc_FFD0578C\n"
+                 ".long loc_FFD0578C\n"
+                 ".long loc_FFD058AC\n"
+                 ".long loc_FFD058B8\n"
+                 ".long loc_FFD058C8\n"
+                 ".long loc_FFD058D8\n"
+                 ".long loc_FFD058D8\n"
+                 ".long loc_FFD058D8\n"
+                 ".long loc_FFD05774\n"
+                 ".long loc_FFD05780\n"
+                 ".long loc_FFD0579C\n"
+                 ".long loc_FFD057A8\n"
+                 ".long loc_FFD057E0\n"
+                 ".long loc_FFD05818\n"
+                 ".long loc_FFD05850\n"
+                 ".long loc_FFD05888\n"
+                 ".long loc_FFD05888\n"
+                 ".long loc_FFD058D8\n"
+                 ".long loc_FFD058D8\n"
+                 ".long loc_FFD05894\n"
+                 ".long loc_FFD058A0\n"
+ "loc_FFD05750:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFD017B0\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD0575C:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFD01A54\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD05768:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFD01CC8\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD05774:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFD01FC4\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD05780:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFD02228\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD0578C:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFD02424_my\n"  //---------->
+                 "MOV     R8, #0\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD0579C:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFD02580\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD057A8:\n"
+                 "LDRH    R1, [R2,#4]\n"
+                 "LDR     R3, =0x4D750\n"
+                 "STRH    R1, [SP,#0x14]\n"
+                 "LDRH    R1, [R3,#6]\n"
+                 "STRH    R1, [SP,#0x1A]\n"
+                 "LDRH    R1, [R3,#2]\n"
+                 "STRH    R1, [SP,#0x16]\n"
+                 "LDRH    R3, [R3,#4]\n"
+                 "STRH    R3, [SP,#0x18]\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#0xC]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "BL      sub_FFD0287C\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD057E0:\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#4]\n"
+                 "LDR     R3, =0x4D750\n"
+                 "STRH    R2, [SP,#0x14]\n"
+                 "LDRH    R2, [R3,#8]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "LDRH    R1, [R3,#2]\n"
+                 "STRH    R1, [SP,#0x16]\n"
+                 "LDRH    R2, [R3,#4]\n"
+                 "STRH    R2, [SP,#0x18]\n"
+                 "LDRH    R3, [R3,#6]\n"
+                 "STRH    R3, [SP,#0x1A]\n"
+                 "BL      sub_FFD029A4\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD05818:\n"
+                 "LDR     R3, =0x4D750\n"
+                 "LDRH    R1, [R3]\n"
+                 "STRH    R1, [SP,#0x14]\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#6]\n"
+                 "STRH    R2, [SP,#0x16]\n"
+                 "LDRH    R2, [R3,#8]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "LDRH    R1, [R3,#4]\n"
+                 "STRH    R1, [SP,#0x18]\n"
+                 "LDRH    R3, [R3,#6]\n"
+                 "STRH    R3, [SP,#0x1A]\n"
+                 "BL      sub_FFD02A68\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD05850:\n"
+                 "LDR     R3, =0x4D750\n"
+                 "LDRH    R1, [R3,#6]\n"
+                 "STRH    R1, [SP,#0x1A]\n"
+                 "LDRH    R1, [R3]\n"
+                 "STRH    R1, [SP,#0x14]\n"
+                 "LDRH    R1, [R3,#2]\n"
+                 "STRH    R1, [SP,#0x16]\n"
+                 "LDRH    R3, [R3,#4]\n"
+                 "STRH    R3, [SP,#0x18]\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#0xC]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "BL      sub_FFD02B20\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD05888:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFD02BD0\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD05894:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFD03300\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD058A0:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFD034FC\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD058AC:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFD036B8\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD058B8:\n"
+                 "MOV     R0, R2\n"
+                 "MOV     R1, #0\n"
+                 "BL      sub_FFD0389C\n"
+                 "B       loc_FFD058D4\n"
+ "loc_FFD058C8:\n"
+                 "MOV     R0, R2\n"
+                 "MOV     R1, #1\n"
+                 "BL      sub_FFD0389C\n"
+ "loc_FFD058D4:\n"
+                 "LDR     R12, [SP,#4]\n"
+ "loc_FFD058D8:\n"
+                 "ADD     R0, R12, #4\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "LDR     R2, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+ "loc_FFD058EC:\n"
+                 "CMP     R8, #1\n"
+                 "BNE     loc_FFD05914\n"
+                 "LDR     R1, [SP,#4]\n"
+                 "LDR     R3, [R1,#0x7C]\n"
+                 "ADD     R3, R3, R3,LSL#1\n"
+                 "ADD     R1, R1, R3,LSL#2\n"
+                 "MOV     R0, R6\n"
+                 "SUB     R1, R1, #8\n"
+                 "BL      sub_FFD01514\n"
+                 "B       loc_FFD05948\n"
+ "loc_FFD05914:\n"
+                 "MOV     R4, #1\n"
+                 "MOV     R0, R4\n"
+                 "MOV     R1, R4\n"
+                 "MOV     R2, R4\n"
+                 "MOV     R3, R4\n"
+                 "STR     R4, [SP]\n"
+                 "BL      sub_FFD01468\n"
+                 "MOV     R0, R4\n"
+                 "MOV     R1, R0\n"
+                 "MOV     R2, R0\n"
+                 "MOV     R3, R0\n"
+                 "STR     R4, [SP]\n"
+                 "BL      sub_FFD015EC\n"
+ "loc_FFD05948:\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_FFD00F00\n"
+ "loc_FFD05950:\n"
+                 "LDR     R3, =0x4D748\n"
+                 "MOV     R2, #0\n"
+                 "LDR     R0, [R3]\n"
+                 "MOV     R1, R7\n"
+                 "BL      sub_FFC10920\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "LDR     R2, [R12]\n"
+                 "CMP     R2, #0x23\n"
+                 "BNE     loc_FFD054A4\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_FFD00F00\n"
+                 "LDR     R3, =0x4D744\n"
+                 "MOV     R1, #1\n"
+                 "LDR     R0, [R3]\n"
+                 "BL      sub_FFC10208\n"
+                 "BL      _ExitTask\n"
+                 "ADD     SP, SP, #0x20\n"
+                 "LDMFD   SP!, {R4-R8,PC}\n"
+ );
+}
+
+                                        		
+void __attribute__((naked,noinline)) sub_FFD02424_my(){
+ asm volatile(
+                 "STMFD   SP!, {R4-R6,LR}\n"
+                 "LDR     R3, =0x4D744\n"
+                 "MOV     R4, R0\n"
+                 "MOV     R1, #0x3E\n"
+                 "LDR     R0, [R3]\n"
+                 "BL      sub_FFC103A4\n"
+                 "MOV     R1, #0\n"
+                 "LDRSH   R0, [R4,#4]\n"
+                 "BL      sub_FFD01034\n"
+                 "MOV     R6, R0\n"
+                 "LDRSH   R0, [R4,#6]\n"
+                 "BL      sub_FFD011A8\n"
+                 "LDRSH   R0, [R4,#8]\n"
+                 "BL      sub_FFD01244\n"
+                 "LDRSH   R0, [R4,#0xA]\n"
+                 "BL      sub_FFD012E0\n"
+                 "LDRSH   R0, [R4,#0xC]\n"
+                 "BL      sub_FFD0137C\n"
+                 "LDR     R3, [R4]\n"
+                 "CMP     R3, #9\n"
+                 "MOV     R5, R0\n"
+                 "MOVEQ   R5, #0\n"
+                 "MOVEQ   R6, R5\n"
+                 "CMP     R6, #1\n"
+                 "BNE     loc_FFD024A8\n"
+                 "MOV     R2, #2\n"
+                 "LDRSH   R0, [R4,#4]\n"
+                 "LDR     R1, =0xFFD00F54\n"
+                 "BL      sub_FFE993F8\n"
+                 "LDR     R2, =0x4D784\n"
+                 "MOV     R3, #0\n"
+                 "STR     R3, [R2]\n"
+                 "B       loc_FFD024AC\n"
+ "loc_FFD024A8:\n"
+                 "BL      sub_FFD01418\n"
+ "loc_FFD024AC:\n"
+                 "STRH    R0, [R4,#4]\n"
+                 "CMP     R5, #1\n"
+                 "BNE     loc_FFD024CC\n"
+                 "LDRSH   R0, [R4,#0xC]\n"
+                 "LDR     R1, =0xFFD01018\n"
+                 "MOV     R2, #0x20\n"
+                 "BL      sub_FFD01750\n"
+                 "B       loc_FFD024D0\n"
+ "loc_FFD024CC:\n"
+                 "BL      sub_FFD01458\n"
+ "loc_FFD024D0:\n"
+                 "STRH    R0, [R4,#0xC]\n"
+                 "LDRSH   R0, [R4,#6]\n"
+                 "BL      sub_FFCA4008_my\n"  // ------------->
+                 "LDRSH   R0, [R4,#8]\n"
+                 "MOV     R1, #1\n"
+                 "BL      sub_FFCA626C\n"
+                 "ADD     R0, R4, #8\n"
+                 "MOV     R1, #0\n"
+                 "BL      sub_FFCA632C\n"
+                 "LDRSH   R0, [R4,#0xE]\n"
+                 "BL      sub_FFCEEF80\n"
+                 "CMP     R6, #1\n"
+                 "BNE     loc_FFD02534\n"
+                 "LDR     R3, =0x4D744\n"
+                 "MOV     R2, #0xBB0\n"
+                 "LDR     R0, [R3]\n"
+                 "MOV     R1, #2\n"
+                 "ADD     R2, R2, #8\n"
+                 "BL      sub_FFC101F8\n"
+                 "TST     R0, #1\n"
+                 "BEQ     loc_FFD02534\n"
+                 "MOV     R1, #0x440\n"
+                 "LDR     R0, =0xFFD00EAC\n"
+                 "ADD     R1, R1, #0xB\n"
+                 "BL      sub_FFC03CF8\n"
+ "loc_FFD02534:\n"
+                 "CMP     R5, #1\n"
+                 "LDMNEFD SP!, {R4-R6,PC}\n"
+                 "LDR     R3, =0x4D744\n"
+                 "MOV     R2, #0xBB0\n"
+                 "LDR     R0, [R3]\n"
+                 "MOV     R1, #0x20\n"
+                 "ADD     R2, R2, #8\n"
+                 "BL      sub_FFC101F8\n"
+                 "TST     R0, #1\n"
+                 "LDMEQFD SP!, {R4-R6,PC}\n"
+                 "LDR     R0, =0xFFD00EAC\n"
+                 "MOV     R1, #0x450\n"
+                 "LDMFD   SP!, {R4-R6,LR}\n"
+                 "B       sub_FFC03CF8\n"
+ );
+}
+
+void __attribute__((naked,noinline)) sub_FFCA4008_my(){
+ asm volatile(
+                 "STMFD   SP!, {R4,LR}\n"
+                 "LDR     R3, =0x52E0\n"
+                 "LDR     R2, [R3]\n"
+                 "MOV     R1, #0x150\n"
+                 "MOV     R3, R0,LSL#16\n"
+                 "CMP     R2, #1\n"
+                 "ADD     R1, R1, #1\n"
+                 "LDR     R0, =0xFFCA3844\n"
+                 "MOV     R4, R3,ASR#16\n"
+                 "BEQ     loc_FFCA4034\n"
+                 "BL      sub_FFC03CF8\n"
+ "loc_FFCA4034:\n"
+                 "MOV     R1, #0x154\n"
+                 "CMN     R4, #0xC00\n"
+                 "LDR     R3, =0x3F066\n"
+                 "LDR     R0, =0xFFCA3844\n"
+                 "ADD     R1, R1, #3\n"
+                 "LDREQSH R4, [R3]\n"
+                 "LDRNE   R3, =0x3F066\n"
+                 "CMN     R4, #0xC00\n"
+                 "STRH    R4, [R3]\n"
+                 "BNE     loc_FFCA4060\n"
+                 "BL      sub_FFC03CF8\n"
+ "loc_FFCA4060:\n"
+                 "MOV     R0, R4\n"
+                 "BL      ExpTimeInMicroseconds\n"  //---------->
+                 "MOV     R4, R0\n"
+                 "BL      sub_FFCD020C\n"
+                 "MOV     R0, R4\n"
+                 "BL      sub_FFCA33D0\n"
+                 "TST     R0, #1\n"
+                 "MOV     R1, #0x15C\n"
+                 "LDR     R0, =0xFFCA3844\n"
+                 "LDMEQFD SP!, {R4,PC}\n"
+                 "LDMFD   SP!, {R4,LR}\n"
+                 "B       sub_FFC03CF8\n"
+ );
+}
Index: platform/a710/sub/100a/stubs_entry_2.S
===================================================================
--- platform/a710/sub/100a/stubs_entry_2.S	(Revision 727)
+++ platform/a710/sub/100a/stubs_entry_2.S	(Arbeitskopie)
@@ -49,3 +49,4 @@
 NHSTUB(SetAE_ShutterSpeed, 0xFFEB9144)
 NHSTUB(DoAFLock, 0xffd58dbc)
 NHSTUB(UnlockAF, 0xffd58e08)
+NHSTUB(ExpTimeInMicroseconds, 0xFFCA5104)
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/capt_seq.c
===================================================================
--- platform/a530/sub/100a/capt_seq.c	(Revision 727)
+++ platform/a530/sub/100a/capt_seq.c	(Arbeitskopie)
@@ -227,3 +227,412 @@
 
 	);
 }
+
+/***************************************************************************/
+
+void __attribute__((naked,noinline)) _task_ExpDrvTask(){
+ asm volatile(
+                 "STMFD   SP!, {R4-R8,LR}\n"
+                 "SUB     SP, SP, #0x14\n"
+                 "MOV     R7, SP\n"
+                 "B       loc_FFCE3DD0\n"
+ "loc_FFCE39E4:\n"
+                 "CMP     R2, #0x1F\n"
+                 "BNE     loc_FFCE39FC\n"
+                 "LDR     R0, [R12,#0x50]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x4C]\n"
+                 "B       loc_FFCE3A5C\n"
+ "loc_FFCE39FC:\n"
+                 "CMP     R2, #0x1A\n"
+                 "BNE     loc_FFCE3A10\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_FFCE3904\n"
+                 "B       loc_FFCE3A4C\n"
+ "loc_FFCE3A10:\n"
+                 "CMP     R2, #0x1B\n"
+                 "BNE     loc_FFCE3A24\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_FFCE3940\n"
+                 "B       loc_FFCE3A4C\n"
+ "loc_FFCE3A24:\n"
+                 "SUB     R3, R2, #0x1C\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_FFCE3A3C\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_FFCE397C\n"
+                 "B       loc_FFCE3A4C\n"
+ "loc_FFCE3A3C:\n"
+                 "CMP     R2, #0x1E\n"
+                 "BNE     loc_FFCE3A68\n"
+                 "BL      sub_FFC97868\n"
+                 "BL      sub_FFC99658\n"
+ "loc_FFCE3A4C:\n"
+                 "LDR     R3, [SP]\n"
+                 "LDR     R0, [R3,#0x50]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x4C]\n"
+ "loc_FFCE3A5C:\n"
+                 "LDR     R0, [SP]\n"
+                 "BL      sub_FFCE16C4\n"
+                 "B       loc_FFCE3DD0\n"
+ "loc_FFCE3A68:\n"
+                 "CMP     R2, #0xD\n"
+                 "MOV     R8, #1\n"
+                 "BNE     loc_FFCE3AD8\n"
+                 "LDR     R1, [R12,#0x40]\n"
+                 "ADD     R1, R1, R1,LSL#1\n"
+                 "ADD     R1, R12, R1,LSL#1\n"
+                 "ADD     R6, SP, #0xC\n"
+                 "SUB     R1, R1, #2\n"
+                 "MOV     R2, #6\n"
+                 "MOV     R0, R6\n"
+                 "BL      sub_FFEC3588\n"
+                 "LDR     R0, [SP]\n"
+                 "BL      sub_FFCE2B94\n"
+                 "LDR     R3, [SP]\n"
+                 "LDR     R1, [R3,#0x40]\n"
+                 "LDR     R2, [R3,#0x50]\n"
+                 "ADD     R0, R3, #4\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x4C]\n"
+                 "LDR     R0, [SP]\n"
+                 "BL      sub_FFCE2D18\n"
+                 "LDR     R3, [SP]\n"
+                 "ADD     R0, R3, #4\n"
+                 "LDR     R1, [R3,#0x40]\n"
+                 "LDR     R2, [R3,#0x58]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x54]\n"
+                 "B       loc_FFCE3D80\n"
+ "loc_FFCE3AD8:\n"
+                 "SUB     R3, R2, #0xE\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_FFCE3B94\n"
+                 "ADD     R6, SP, #0xC\n"
+                 "ADD     R5, SP, #4\n"
+                 "MOV     R0, R12\n"
+                 "MOV     R1, R6\n"
+                 "MOV     R2, R5\n"
+                 "BL      sub_FFCE2D94\n"
+                 "MOV     R4, R0\n"
+                 "CMP     R4, #5\n"
+                 "CMPNE   R4, #1\n"
+                 "BNE     loc_FFCE3B2C\n"
+                 "LDR     R12, [SP]\n"
+                 "MOV     R0, R5\n"
+                 "LDR     R1, [R12,#0x40]\n"
+                 "MOV     R2, R4\n"
+                 "LDR     R3, [R12,#0x50]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x4C]\n"
+                 "B       loc_FFCE3B64\n"
+ "loc_FFCE3B2C:\n"
+                 "CMP     R4, #6\n"
+                 "CMPNE   R4, #2\n"
+                 "BNE     loc_FFCE3B74\n"
+                 "LDR     R12, [SP]\n"
+                 "MOV     R0, R5\n"
+                 "MOV     R1, R8\n"
+                 "MOV     R2, R4\n"
+                 "LDR     R3, [R12,#0x50]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x4C]\n"
+                 "MOV     R1, R6\n"
+                 "LDR     R0, [SP]\n"
+                 "MOV     R2, R5\n"
+                 "BL      sub_FFCE3740\n"
+ "loc_FFCE3B64:\n"
+                 "MOV     R1, R4\n"
+                 "LDR     R0, [SP]\n"
+                 "BL      sub_FFCE38E4\n"
+                 "B       loc_FFCE3D80\n"
+ "loc_FFCE3B74:\n"
+                 "LDR     R12, [SP]\n"
+                 "MOV     R2, R4\n"
+                 "ADD     R0, R12, #4\n"
+                 "LDR     R1, [R12,#0x40]\n"
+                 "LDR     R3, [R12,#0x50]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x4C]\n"
+                 "B       loc_FFCE3D80\n"
+ "loc_FFCE3B94:\n"
+                 "SUB     R3, R2, #0x17\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_FFCE3BEC\n"
+                 "LDR     R1, [R12,#0x40]\n"
+                 "ADD     R1, R1, R1,LSL#1\n"
+                 "ADD     R1, R12, R1,LSL#1\n"
+                 "ADD     R6, SP, #0xC\n"
+                 "SUB     R1, R1, #2\n"
+                 "MOV     R2, #6\n"
+                 "MOV     R0, R6\n"
+                 "BL      sub_FFEC3588\n"
+                 "LDR     R0, [SP]\n"
+                 "BL      sub_FFCE26C8\n"
+                 "LDR     R3, [SP]\n"
+                 "ADD     R0, R3, #4\n"
+                 "LDR     R1, [R3,#0x40]\n"
+                 "LDR     R2, [R3,#0x50]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x4C]\n"
+                 "LDR     R0, [SP]\n"
+                 "BL      sub_FFCE2898\n"
+                 "B       loc_FFCE3D80\n"
+ "loc_FFCE3BEC:\n"
+                 "ADD     R6, SP, #0xC\n"
+                 "ADD     R1, R12, #4\n"
+                 "MOV     R2, #6\n"
+                 "MOV     R0, R6\n"
+                 "BL      sub_FFEC3588\n"
+                 "LDR     R12, [SP]\n"
+                 "LDR     R3, [R12]\n"
+                 "MOV     R2, R12\n"
+                 "CMP     R3, #0x19\n"
+                 "LDRLS   PC, [PC,R3,LSL#2]\n"
+                 "B       loc_FFCE3D6C\n"
+                 ".long loc_FFCE3C80\n"
+                 ".long loc_FFCE3C8C\n"
+                 ".long loc_FFCE3C98\n"
+                 ".long loc_FFCE3C98\n"
+                 ".long loc_FFCE3C80\n"
+                 ".long loc_FFCE3C8C\n"
+                 ".long loc_FFCE3C98\n"
+                 ".long loc_FFCE3C98\n"
+                 ".long loc_FFCE3CBC\n"
+                 ".long loc_FFCE3CBC\n"
+                 ".long loc_FFCE3D40\n"
+                 ".long loc_FFCE3D4C\n"
+                 ".long loc_FFCE3D5C\n"
+                 ".long loc_FFCE3D6C\n"
+                 ".long loc_FFCE3D6C\n"
+                 ".long loc_FFCE3D6C\n"
+                 ".long loc_FFCE3CA4\n"
+                 ".long loc_FFCE3CB0\n"
+                 ".long loc_FFCE3CCC\n"
+                 ".long loc_FFCE3CD8\n"
+                 ".long loc_FFCE3D00\n"
+                 ".long loc_FFCE3D28\n"
+                 ".long loc_FFCE3D28\n"
+                 ".long loc_FFCE3D6C\n"
+                 ".long loc_FFCE3D6C\n"
+                 ".long loc_FFCE3D34\n"
+ "loc_FFCE3C80:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFCE1C68\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3C8C:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFCE1DA4\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3C98:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFCE1ED4\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3CA4:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFCE20A8\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3CB0:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFCE21B0\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3CBC:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFCE2274_my\n"   //------------->
+                 "MOV     R8, #0\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3CCC:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFCE2334\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3CD8:\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#4]\n"
+                 "LDR     R3, =0x401A4\n"
+                 "STRH    R2, [SP,#0xC]\n"
+                 "LDRH    R1, [R3,#4]\n"
+                 "STRH    R1, [SP,#0x10]\n"
+                 "LDRH    R3, [R3,#2]\n"
+                 "STRH    R3, [SP,#0xE]\n"
+                 "BL      sub_FFCE24BC\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3D00:\n"
+                 "LDR     R3, =0x401A4\n"
+                 "LDRH    R1, [R3]\n"
+                 "STRH    R1, [SP,#0xC]\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#6]\n"
+                 "STRH    R2, [SP,#0xE]\n"
+                 "LDRH    R3, [R3,#4]\n"
+                 "STRH    R3, [SP,#0x10]\n"
+                 "BL      sub_FFCE2550\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3D28:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFCE25D0\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3D34:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFCE2928\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3D40:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_FFCE29FC\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3D4C:\n"
+                 "MOV     R0, R2\n"
+                 "MOV     R1, #0\n"
+                 "BL      sub_FFCE2AE8\n"
+                 "B       loc_FFCE3D68\n"
+ "loc_FFCE3D5C:\n"
+                 "MOV     R0, R2\n"
+                 "MOV     R1, #1\n"
+                 "BL      sub_FFCE2AE8\n"
+ "loc_FFCE3D68:\n"
+                 "LDR     R12, [SP]\n"
+ "loc_FFCE3D6C:\n"
+                 "ADD     R0, R12, #4\n"
+                 "LDR     R1, [R12,#0x40]\n"
+                 "LDR     R2, [R12,#0x50]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x4C]\n"
+ "loc_FFCE3D80:\n"
+                 "CMP     R8, #1\n"
+                 "BNE     loc_FFCE3DA8\n"
+                 "LDR     R1, [SP]\n"
+                 "LDR     R3, [R1,#0x40]\n"
+                 "ADD     R3, R3, R3,LSL#1\n"
+                 "ADD     R1, R1, R3,LSL#1\n"
+                 "MOV     R0, R6\n"
+                 "SUB     R1, R1, #2\n"
+                 "BL      sub_FFCE1AD8\n"
+                 "B       loc_FFCE3DC8\n"
+ "loc_FFCE3DA8:\n"
+                 "MOV     R0, #1\n"
+                 "MOV     R1, R0\n"
+                 "MOV     R2, R0\n"
+                 "BL      sub_FFCE1A7C\n"
+                 "MOV     R0, #1\n"
+                 "MOV     R1, R0\n"
+                 "MOV     R2, R0\n"
+                 "BL      sub_FFCE1B94\n"
+ "loc_FFCE3DC8:\n"
+                 "LDR     R0, [SP]\n"
+                 "BL      sub_FFCE16C4\n"
+ "loc_FFCE3DD0:\n"
+                 "LDR     R3, =0x4019C\n"
+                 "MOV     R2, #0\n"
+                 "LDR     R0, [R3]\n"
+                 "MOV     R1, R7\n"
+                 "BL      sub_FFC100C0\n"
+                 "LDR     R12, [SP]\n"
+                 "LDR     R2, [R12]\n"
+                 "CMP     R2, #0x20\n"
+                 "BNE     loc_FFCE39E4\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_FFCE16C4\n"
+                 "LDR     R3, =0x40198\n"
+                 "MOV     R1, #1\n"
+                 "LDR     R0, [R3]\n"
+                 "BL      sub_FFC0F9A8\n"
+                 "BL      sub_FFC1161C\n"
+                 "ADD     SP, SP, #0x14\n"
+                 "LDMFD   SP!, {R4-R8,PC}\n"
+  );
+}
+
+
+void __attribute__((naked,noinline)) sub_FFCE2274_my(){
+ asm volatile(
+                 "STMFD   SP!, {R4,R5,LR}\n"
+                 "LDR     R3, =0x40198\n"
+                 "MOV     R4, R0\n"
+                 "MOV     R1, #0xE\n"
+                 "LDR     R0, [R3]\n"
+                 "BL      sub_FFC0FB44\n"
+                 "MOV     R1, #0\n"
+                 "LDRSH   R0, [R4,#4]\n"
+                 "BL      sub_FFCE17A0\n"
+                 "MOV     R5, R0\n"
+                 "LDRSH   R0, [R4,#6]\n"
+                 "BL      sub_FFCE1914\n"
+                 "LDRSH   R0, [R4,#8]\n"
+                 "BL      sub_FFCE19B0\n"
+                 "LDR     R3, [R4]\n"
+                 "CMP     R3, #9\n"
+                 "MOVEQ   R5, #0\n"
+                 "CMP     R5, #1\n"
+                 "LDR     R1, =0xFFCE16F8\n"
+                 "MOV     R2, #2\n"
+                 "BNE     loc_FFCE22E0\n"
+                 "LDRSH   R0, [R4,#4]\n"
+                 "BL      sub_FFE6D32C\n"
+                 "LDR     R2, =0x401C4\n"
+                 "MOV     R3, #0\n"
+                 "STR     R3, [R2]\n"
+                 "B       loc_FFCE22E4\n"
+ "loc_FFCE22E0:\n"
+                 "BL      sub_FFCE1A4C\n"
+ "loc_FFCE22E4:\n"
+                 "STRH    R0, [R4,#4]\n"
+                 "LDRSH   R0, [R4,#6]\n"
+                 "BL      sub_FFC974F0_my\n"  //------------>
+                 "LDRSH   R0, [R4,#8]\n"
+                 "MOV     R1, #1\n"
+                 "BL      sub_FFC99218\n"
+                 "MOV     R1, #0\n"
+                 "ADD     R0, R4, #8\n"
+                 "BL      sub_FFC992D8\n"
+                 "CMP     R5, #1\n"
+                 "MOV     R1, #2\n"
+                 "MOV     R2, #0\n"
+                 "LDMNEFD SP!, {R4,R5,PC}\n"
+                 "LDR     R3, =0x40198\n"
+                 "LDR     R0, [R3]\n"
+                 "LDMFD   SP!, {R4,R5,LR}\n"
+                 "B       sub_FFC0F998\n"
+ );
+}
+
+void __attribute__((naked,noinline)) sub_FFC974F0_my(){
+ asm volatile(
+                 "STMFD   SP!, {R4,LR}\n"
+                 "LDR     R3, =0x5334\n"
+                 "LDR     R2, [R3]\n"
+                 "MOV     R1, #0x114\n"
+                 "MOV     R3, R0,LSL#16\n"
+                 "CMP     R2, #1\n"
+                 "ADD     R1, R1, #1\n"
+                 "LDR     R0, =0xFFC96F6C\n"
+                 "MOV     R4, R3,ASR#16\n"
+                 "BEQ     loc_FFC9751C\n"
+                 "BL      sub_FFC03AE8\n"
+ "loc_FFC9751C:\n"
+                 "MOV     R1, #0x118\n"
+                 "CMN     R4, #0xC00\n"
+                 "LDR     R3, =0x32DAE\n"
+                 "LDR     R0, =0xFFC96F6C\n"
+                 "ADD     R1, R1, #3\n"
+                 "LDREQSH R4, [R3]\n"
+                 "LDRNE   R3, =0x32DAE\n"
+                 "CMN     R4, #0xC00\n"
+                 "STRH    R4, [R3]\n"
+                 "BNE     loc_FFC97548\n"
+                 "BL      sub_FFC03AE8\n"
+ "loc_FFC97548:\n"
+                 "MOV     R0, R4\n"
+                 "BL      ExpTimeInMicroseconds\n"
+                 "MOV     R4, R0\n"
+         //      "BL      nullsub_47\n"
+                 "MOV     R0, R4\n"
+                 "BL      sub_FFC96B24\n"
+                 "TST     R0, #1\n"
+                 "MOV     R1, #0x120\n"
+                 "LDR     R0, =0xFFC96F6C\n"
+                 "LDMEQFD SP!, {R4,PC}\n"
+                 "LDMFD   SP!, {R4,LR}\n"
+                 "B       sub_FFC03AE8\n"
+ );
+}
+
Index: platform/a530/sub/100a/stubs_entry_2.S
===================================================================
--- platform/a530/sub/100a/stubs_entry_2.S	(Revision 727)
+++ platform/a530/sub/100a/stubs_entry_2.S	(Arbeitskopie)
@@ -22,3 +22,4 @@
 NHSTUB(SetAE_ShutterSpeed, 0xFFE87778)
 NHSTUB(DoAFLock, 0xffd312e4)
 NHSTUB(UnlockAF, 0xffd31328)
+NHSTUB(ExpTimeInMicroseconds, 0xFFC985EC)
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 727)
+++ 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/capt_seq.c
===================================================================
--- platform/ixus950_sd850/sub/100c/capt_seq.c	(Revision 727)
+++ platform/ixus950_sd850/sub/100c/capt_seq.c	(Arbeitskopie)
@@ -1,6 +1,7 @@
 #include "lolevel.h"
 #include "platform.h"
 #include "core.h"
+#include "math.h"
 
 static long *nrflag = (long*)0xED44;
 
@@ -311,3 +312,736 @@
 	);
 }
 
+
+
+
+
+
+
+/*
+ROM:FF976A78     var_38          = -0x38
+ROM:FF976A78     var_34          = -0x34
+ROM:FF976A78     var_30          = -0x30
+ROM:FF976A78     var_24          = -0x24
+ROM:FF976A78     var_20          = -0x20
+ROM:FF976A78     var_1E          = -0x1E
+ROM:FF976A78     var_1C          = -0x1C
+*/
+void __attribute__((naked,noinline)) _task_ExpDrvTask() {
+ asm volatile(
+                 "STMFD   SP!, {R4-R8,LR}\n" // @ Store Block to Memory
+                 "SUB     SP, SP, #0x20\n" //   @ Rd = Op1 - Op2
+                 "ADD     R7, SP, #0x4\n" //  @ Rd = Op1 + Op2
+                 "B       loc_FF976F88\n" //    @ Branch
+
+
+     "loc_FF976A88:\n" //                           @ CODE XREF: task_ExpDrvTask+530
+                 "CMP     R2, #0x22\n" // @ '"' @ Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF976AA0\n"    //@ Branch
+
+                 "LDR     R0, [R12,#0x8C]\n" //@ Load from Memory
+                 "MOV     LR, PC\n"          //@ Rd = Op2
+                 "LDR     PC, [R12,#0x88]\n" //@ Indirect Jump
+                 "B       loc_FF976B04\n"    //@ Branch
+
+
+
+     "loc_FF976AA0:\n"                           //@ CODE XREF: task_ExpDrvTask+14
+                 "CMP     R2, #0x1D\n"       //@ Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF976AB4\n"    //@ Branch
+
+                 "MOV     R0, R12\n"         //@ Rd = Op2
+                 "BL      sub_FF976948\n"    //@ Branch with Link
+
+                 "B       loc_FF976AF4\n"    //@ Branch
+
+
+
+     "loc_FF976AB4:\n"                           //@ CODE XREF: task_ExpDrvTask+2C
+                 "CMP     R2, #0x1E\n"       //@ Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF976AC8\n"    //@ Branch
+
+                 "MOV     R0, R12\n"         //@ Rd = Op2
+                 "BL      sub_FF9769A4\n"    //@ Branch with Link
+
+                 "B       loc_FF976AF4\n"    //@ Branch
+
+
+
+     "loc_FF976AC8:\n"                           //@ CODE XREF: task_ExpDrvTask+40
+                 "SUB     R3, R2, #0x1F\n"   //@ Rd = Op1 - Op2
+                 "CMP     R3, #1\n"          //@ Set cond. codes on Op1 - Op2
+                 "BHI     loc_FF976AE0\n"    //@ Branch
+
+                 "MOV     R0, R12\n"         //@ Rd = Op2
+                 "BL      sub_FF976A00\n"    //@ Branch with Link
+
+                 "B       loc_FF976AF4\n"    //@ Branch
+
+
+
+     "loc_FF976AE0:\n"                           //@ CODE XREF: task_ExpDrvTask+58
+                 "CMP     R2, #0x21\n"           // @ '!' Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF976B10\n"    //@ Branch
+
+                 "BL      sub_FF93C0BC\n"    //@ Branch with Link
+
+                 "BL      sub_FF93F1F4\n"    //@ Branch with Link
+
+                 "BL      sub_FF93E42C\n"    //@ Branch with Link
+
+
+     "loc_FF976AF4:\n"                           //@ CODE XREF: task_ExpDrvTask+38
+                 "LDR     R3, [SP,#4]\n"     //@ Load from Memory
+                 "LDR     R0, [R3,#0x8C]\n"  //@ Load from Memory
+                 "MOV     LR, PC\n"          //@ Rd = Op2
+                 "LDR     PC, [R3,#0x88]\n"  //@ Indirect Jump
+
+     "loc_FF976B04:\n"                           //@ CODE XREF: task_ExpDrvTask+24
+                 "LDR     R0, [SP,#0x4]\n" //@ Load from Memory
+                 "BL      sub_FF9722A8\n"    //@ Branch with Link
+
+                 "B       loc_FF976F88\n"    //@ Branch
+
+
+     "loc_FF976B10:\n"                           //@ CODE XREF: task_ExpDrvTask+6C
+                 "CMP     R2, #0xD\n"        //@ Set cond. codes on Op1 - Op2
+                 "MOV     R8, #1\n"          //@ Rd = Op2
+                 "BNE     loc_FF976B80\n"    //@ Branch
+
+                 "LDR     R1, [R12,#0x7C]\n" //@ Load from Memory
+                 "ADD     R1, R1, R1,LSL#1\n" //@ Rd = Op1 + Op2
+                 "ADD     R1, R12, R1,LSL#2\n" //@ Rd = Op1 + Op2
+                 "ADD     R6, SP, #0x14\n"   //@ Rd = Op1 + Op2
+                 "SUB     R1, R1, #8\n"      //@ Rd = Op1 - Op2
+                 "MOV     R2, #0xC\n"        //@ Rd = Op2
+                 "MOV     R0, R6\n"          //@ Rd = Op2
+                 "BL      _memcpy\n"          //@ Branch with Link
+
+                 "LDR     R0, [SP,#4]\n" //@ Load from Memory
+                 "BL      sub_FF974F0C\n"    //@ Branch with Link
+
+                 "LDR     R3, [SP,#04]\n" //@ Load from Memory
+                 "LDR     R1, [R3,#0x7C]\n"  //@ Load from Memory
+                 "LDR     R2, [R3,#0x8C]\n"  //@ Load from Memory
+                 "ADD     R0, R3, #4\n"      //@ Rd = Op1 + Op2
+                 "MOV     LR, PC\n"          //@ Rd = Op2
+                 "LDR     PC, [R3,#0x88]\n"  //@ Indirect Jump
+                 "LDR     R0, [SP,#4]\n" //@ Load from Memory
+                 "BL      sub_FF9751D8\n"    //@ Branch with Link
+
+                 "LDR     R3, [SP,#04]\n" //@ Load from Memory
+                 "ADD     R0, R3, #4\n"      //@ Rd = Op1 + Op2
+                 "LDR     R1, [R3,#0x7C]\n"  //@ Load from Memory
+                 "LDR     R2, [R3,#0x94]\n"  //@ Load from Memory
+                 "MOV     LR, PC\n"          //@ Rd = Op2
+                 "LDR     PC, [R3,#0x90]\n"  //@ Indirect Jump
+                 "B       loc_FF976ED0\n"    //@ Branch
+
+
+
+     "loc_FF976B80:\n"                           //@ CODE XREF: task_ExpDrvTask+A0
+                 "SUB     R3, R2, #0xE\n"    //@ Rd = Op1 - Op2
+                 "CMP     R3, #1\n"          //@ Set cond. codes on Op1 - Op2
+                 "BHI     loc_FF976C3C\n"    //@ Branch
+
+                 "ADD     R6, SP, #0x14\n" //@ Rd = Op1 + Op2
+                 "ADD     R5, SP, #0x8\n" //@ Rd = Op1 + Op2
+                 "MOV     R0, R12\n"         //@ Rd = Op2
+                 "MOV     R1, R6\n"          //@ Rd = Op2
+                 "MOV     R2, R5\n"          //@ Rd = Op2
+                 "BL      sub_FF9752C8\n"    //@ Branch with Link
+
+                 "MOV     R4, R0\n"          //@ Rd = Op2
+                 "CMP     R4, #5\n"          //@ Set cond. codes on Op1 - Op2
+                 "CMPNE   R4, #1\n"          //@ Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF976BD4\n"    //@ Branch
+
+                 "LDR     R12, [SP,#0x4]\n" //@ Load from Memory
+                 "MOV     R0, R5\n"          //@ Rd = Op2
+                 "LDR     R1, [R12,#0x7C]\n" //@ Load from Memory
+                 "MOV     R2, R4\n"          //@ Rd = Op2
+                 "LDR     R3, [R12,#0x8C]\n" //@ Load from Memory
+                 "MOV     LR, PC\n"          //@ Rd = Op2
+                 "LDR     PC, [R12,#0x88]\n" //@ Indirect Jump
+                 "B       loc_FF976C0C\n"    //@ Branch
+
+
+
+     "loc_FF976BD4:\n"                           //@ CODE XREF: task_ExpDrvTask+138
+                 "CMP     R4, #6\n"          //@ Set cond. codes on Op1 - Op2
+                 "CMPNE   R4, #2\n"          //@ Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF976C1C\n"    //@ Branch
+
+                 "LDR     R12, [SP,#0x4]\n" //@ Load from Memory
+                 "MOV     R0, R5\n"          //@ Rd = Op2
+                 "MOV     R1, R8\n"          //@ Rd = Op2
+                 "MOV     R2, R4\n"          //@ Rd = Op2
+                 "LDR     R3, [R12,#0x8C]\n" //@ Load from Memory
+                 "MOV     LR, PC\n"          //@ Rd = Op2
+                 "LDR     PC, [R12,#0x88]\n" //@ Indirect Jump
+                 "MOV     R1, R6\n"          //@ Rd = Op2
+                 "LDR     R0, [SP,#0x4]\n" //@ Load from Memory
+                 "MOV     R2, R5\n"          //@ Rd = Op2
+                 "BL      sub_FF976578\n"    //@ Branch with Link
+
+
+     "loc_FF976C0C:\n"                           //@ CODE XREF: task_ExpDrvTask+158
+                 "MOV     R1, R4\n"          //@ Rd = Op2
+                 "LDR     R0, [SP,#04]\n" //@ Load from Memory
+                 "BL      sub_FF9768DC\n"    //@ Branch with Link
+
+                 "B       loc_FF976ED0\n"    //@ Branch
+
+
+     "loc_FF976C1C:\n"                           //@ CODE XREF: task_ExpDrvTask+164
+                 "LDR     R12, [SP,#0x4]\n" //@ Load from Memory
+                 "MOV     R2, R4\n"          //@ Rd = Op2
+                 "ADD     R0, R12, #4\n"     //@ Rd = Op1 + Op2
+                 "LDR     R1, [R12,#0x7C]\n" //@ Load from Memory
+                 "LDR     R3, [R12,#0x8C]\n" //@ Load from Memory
+                 "MOV     LR, PC\n"          //@ Rd = Op2
+                 "LDR     PC, [R12,#0x88]\n" //@ Indirect Jump
+                 "B       loc_FF976ED0\n"    //@ Branch
+
+
+
+     "loc_FF976C3C:\n"                           //@ CODE XREF: task_ExpDrvTask+110
+                 "SUB     R3, R2, #0x19\n"   //@ Rd = Op1 - Op2
+                 "CMP     R3, #1\n"          //@ Set cond. codes on Op1 - Op2
+                 "BHI     loc_FF976C94\n"    //@ Branch
+
+                 "LDR     R1, [R12,#0x7C]\n" //@ Load from Memory
+                 "ADD     R1, R1, R1,LSL#1\n" //@ Rd = Op1 + Op2
+                 "ADD     R1, R12, R1,LSL#2\n" //@ Rd = Op1 + Op2
+                 "ADD     R6, SP, #0x14\n" //@ Rd = Op1 + Op2
+                 "SUB     R1, R1, #8\n"      //@ Rd = Op1 - Op2
+                 "MOV     R2, #0xC\n"        //@ Rd = Op2
+                 "MOV     R0, R6\n"          //@ Rd = Op2
+                 "BL      _memcpy\n"          //@ Branch with Link
+
+                 "LDR     R0, [SP,#0x4]\n" //@ Load from Memory
+                 "BL      sub_FF97430C\n"    //@ Branch with Link
+
+                 "LDR     R3, [SP,#0x4]\n" //@ Load from Memory
+                 "ADD     R0, R3, #4\n"      //@ Rd = Op1 + Op2
+                 "LDR     R1, [R3,#0x7C]\n"  //@ Load from Memory
+                 "LDR     R2, [R3,#0x8C]\n"  //@ Load from Memory
+                 "MOV     LR, PC\n"          //@ Rd = Op2
+                 "LDR     PC, [R3,#0x88]\n"  //@ Indirect Jump
+                 "LDR     R0, [SP,#0x4]\n" //@ Load from Memory
+                 "BL      sub_FF97462C\n"    //@ Branch with Link
+
+                 "B       loc_FF976ED0\n"    //@ Branch
+
+
+
+     "loc_FF976C94:\n"                           //@ CODE XREF: task_ExpDrvTask+1CC
+                 "ADD     R6, SP, #0x14\n" //@ Rd = Op1 + Op2
+                 "ADD     R1, R12, #4\n"     //@ Rd = Op1 + Op2
+                 "MOV     R2, #0xC\n"        //@ Rd = Op2
+                 "MOV     R0, R6\n"          //@ Rd = Op2
+                 "BL      _memcpy\n"          //@ Branch with Link
+
+                 "LDR     R12, [SP,#0x4]\n" //@ Load from Memory
+                 "LDR     R3, [R12]\n"       //@ Load from Memory
+                 "MOV     R2, R12\n"         //@ Rd = Op2
+                 "CMP     R3, #0x1C\n"       //@ Set cond. codes on Op1 - Op2
+                 "LDRLS   PC, [PC,R3,LSL#2]\n" //@ Indirect Jump
+
+                 "B       loc_FF976EBC\n"    //@ Branch
+
+
+                 ".long loc_FF976D34\n"
+                 ".long loc_FF976D40\n"
+                 ".long loc_FF976D4C\n"
+                 ".long loc_FF976D4C\n"
+                 ".long loc_FF976D34\n"
+                 ".long loc_FF976D40\n"
+                 ".long loc_FF976D4C\n"
+                 ".long loc_FF976D4C\n"
+                 ".long loc_FF976D70\n"
+                 ".long loc_FF976D70\n"
+                 ".long loc_FF976E90\n"
+                 ".long loc_FF976E9C\n"
+                 ".long loc_FF976EAC\n"
+                 ".long loc_FF976EBC\n"
+                 ".long loc_FF976EBC\n"
+                 ".long loc_FF976EBC\n"
+                 ".long loc_FF976D58\n"
+                 ".long loc_FF976D64\n"
+                 ".long loc_FF976D80\n"
+                 ".long loc_FF976D8C\n"
+                 ".long loc_FF976DC4\n"
+                 ".long loc_FF976DFC\n"
+                 ".long loc_FF976E34\n"
+                 ".long loc_FF976E6C\n"
+                 ".long loc_FF976E6C\n"
+                 ".long loc_FF976EBC\n"
+                 ".long loc_FF976EBC\n"
+                 ".long loc_FF976E78\n"
+                 ".long loc_FF976E84\n"
+
+
+     "loc_FF976D34:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "BL      sub_FF972C08\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976D40:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "BL      sub_FF972EAC\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976D4C:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "BL      sub_FF973120\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976D58:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "BL      sub_FF97341C\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976D64:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "BL      sub_FF973684\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976D70:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+//                 "BL      sub_FF973980\n"    //@ Branch with Link
+                 "BL      sub_FF973980_my\n"    //@ Branch with Link this is the place where the function lies where ewvar also creates its own version of, so we just do the same here
+
+                 "MOV     R8, #0\n"          //@ Rd = Op2
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976D80:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "BL      sub_FF973AE0\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+
+     "loc_FF976D8C:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "LDRH    R1, [R2,#4]\n"     //@ Load from Memory
+//                 "LDR     R3, =0x2E4A8\n"  //@ Load from Memory
+                 "LDR     R3, =0x2E4A8\n"  //@ Load from Memory
+                 "STRH    R1, [SP,#0x14]\n" //@ Store to Memory
+                 "LDRH    R1, [R3,#6]\n"     //@ Load from Memory
+                 "STRH    R1, [SP,#0x1A]\n" //@ Store to Memory
+                 "LDRH    R1, [R3,#2]\n"     //@ Load from Memory
+                 "STRH    R1, [SP,#0x16]\n" //@ Store to Memory
+                 "LDRH    R3, [R3,#4]\n"     //@ Load from Memory
+                 "STRH    R3, [SP,#0x18]\n" //@ Store to Memory
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "LDRH    R2, [R2,#0xC]\n"   //@ Load from Memory
+                 "STRH    R2, [SP,#0x1C]\n" //@ Store to Memory
+                 "BL      sub_FF973DDC\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+
+     "loc_FF976DC4:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "LDRH    R2, [R2,#4]\n"     //@ Load from Memory
+                 "LDR     R3, =0x2E4A8\n"  //@ Load from Memory
+                 "STRH    R2, [SP,#0x14]\n" //@ Store to Memory
+                 "LDRH    R2, [R3,#8]\n"     //@ Load from Memory
+                 "STRH    R2, [SP,#0x1C]\n" //@ Store to Memory
+                 "LDRH    R1, [R3,#2]\n"     //@ Load from Memory
+                 "STRH    R1, [SP,#0x16]\n" //@ Store to Memory
+                 "LDRH    R2, [R3,#4]\n"     //@ Load from Memory
+                 "STRH    R2, [SP,#0x18]\n" //@ Store to Memory
+                 "LDRH    R3, [R3,#6]\n"     //@ Load from Memory
+                 "STRH    R3, [SP,#0x1A]\n" //@ Store to Memory
+                 "BL      sub_FF973F04\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+
+     "loc_FF976DFC:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "LDR     R3, =0x2E4A8\n"  //@ Load from Memory
+                 "LDRH    R1, [R3]\n"        //@ Load from Memory
+                 "STRH    R1, [SP,#0x14]\n" //@ Store to Memory
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "LDRH    R2, [R2,#6]\n"     //@ Load from Memory
+                 "STRH    R2, [SP,#0x16]\n" //@ Store to Memory
+                 "LDRH    R2, [R3,#8]\n"     //@ Load from Memory
+                 "STRH    R2, [SP,#0x1C]\n" //@ Store to Memory
+                 "LDRH    R1, [R3,#4]\n"     //@ Load from Memory
+                 "STRH    R1, [SP,#0x18]\n" //@ Store to Memory
+                 "LDRH    R3, [R3,#6]\n"     //@ Load from Memory
+                 "STRH    R3, [SP,#0x1A]\n" //@ Store to Memory
+                 "BL      sub_FF973FC8\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+
+     "loc_FF976E34:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "LDR     R3, =0x2E4A8\n"  //@ Load from Memory
+                 "LDRH    R1, [R3,#6]\n"     //@ Load from Memory
+                 "STRH    R1, [SP,#0x1A]\n" //@ Store to Memory
+                 "LDRH    R1, [R3]\n"        //@ Load from Memory
+                 "STRH    R1, [SP,#0x14]\n" //@ Store to Memory
+                 "LDRH    R1, [R3,#2]\n"     //@ Load from Memory
+                 "STRH    R1, [SP,#0x16]\n" //@ Store to Memory
+                 "LDRH    R3, [R3,#4]\n"     //@ Load from Memory
+                 "STRH    R3, [SP,#0x18]\n" //@ Store to Memory
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "LDRH    R2, [R2,#0xC]\n"   //@ Load from Memory
+                 "STRH    R2, [SP,#0x1C]\n" //@ Store to Memory
+                 "BL      sub_FF974080\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976E6C:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "BL      sub_FF974130\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976E78:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "BL      sub_FF974778\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976E84:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "BL      sub_FF974A24\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976E90:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "BL      sub_FF974BE0\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976E9C:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "MOV     R1, #0\n"          //@ Rd = Op2
+                 "BL      sub_FF974DC8\n"    //@ Branch with Link
+
+                 "B       loc_FF976EB8\n"    //@ Branch
+
+     "loc_FF976EAC:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "MOV     R0, R2\n"          //@ Rd = Op2
+                 "MOV     R1, #1\n"          //@ Rd = Op2
+                 "BL      sub_FF974DC8\n"    //@ Branch with Link
+
+
+     "loc_FF976EB8:\n"                           //@ CODE XREF: task_ExpDrvTask+2C4
+                 "LDR     R12, [SP,#0x4]\n" //@ Load from Memory
+
+     "loc_FF976EBC:\n"                           //@ CODE XREF: task_ExpDrvTask+240
+                 "ADD     R0, R12, #4\n"     //@ Rd = Op1 + Op2
+                 "LDR     R1, [R12,#0x7C]\n" //@ Load from Memory
+                 "LDR     R2, [R12,#0x8C]\n" //@ Load from Memory
+                 "MOV     LR, PC\n"          //@ Rd = Op2
+                 "LDR     PC, [R12,#0x88]\n" //@ Indirect Jump
+
+     "loc_FF976ED0:\n"                           //@ CODE XREF: task_ExpDrvTask+104
+                 "CMP     R8, #1\n"          //@ Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF976EF8\n"    //@ Branch
+
+                 "LDR     R1, [SP,#0x4]\n" //@ Load from Memory
+                 "LDR     R3, [R1,#0x7C]\n"  //@ Load from Memory
+                 "ADD     R3, R3, R3,LSL#1\n" //@ Rd = Op1 + Op2
+                 "ADD     R1, R1, R3,LSL#2\n" //@ Rd = Op1 + Op2
+                 "MOV     R0, R6\n"          //@ Rd = Op2
+                 "SUB     R1, R1, #8\n"      //@ Rd = Op1 - Op2
+                 "BL      sub_FF9728C0\n"    //@ Branch with Link
+
+                 "B       loc_FF976F74\n"    //@ Branch
+
+
+     "loc_FF976EF8:\n"                           //@ CODE XREF: task_ExpDrvTask+45C
+                 "LDR     R3, [SP,#0x4]\n" //@ Load from Memory
+                 "LDR     R2, [R3]\n"        //@ Load from Memory
+                 "CMP     R2, #9\n"          //@ Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF976F40\n"    //@ Branch
+
+                 "MOV     R4, #0\n"          //@ Rd = Op2
+                 "MOV     R1, #1\n"          //@ Rd = Op2
+                 "MOV     R2, R1\n"          //@ Rd = Op2
+                 "MOV     R3, R1\n"          //@ Rd = Op2
+                 "MOV     R0, R4\n"          //@ Rd = Op2
+                 "STR     R4, [SP]\n" //@ Store to Memory
+                 "BL      sub_FF972804\n"    //@ Branch with Link
+
+                 "MOV     R1, #1\n"          //@ Rd = Op2
+                 "MOV     R0, R4\n"          //@ Rd = Op2
+                 "MOV     R2, R1\n"          //@ Rd = Op2
+                 "MOV     R3, R1\n"          //@ Rd = Op2
+                 "STR     R4, [SP]\n" //@ Store to Memory
+                 "BL      sub_FF972A5C\n"    //@ Branch with Link
+
+                 "B       loc_FF976F74\n"    //@ Branch
+
+
+     "loc_FF976F40:\n"                           //@ CODE XREF: task_ExpDrvTask+48C
+                 "MOV     R4, #1\n"          //@ Rd = Op2
+                 "MOV     R0, R4\n"          //@ Rd = Op2
+                 "MOV     R1, R4\n"          //@ Rd = Op2
+                 "MOV     R2, R4\n"          //@ Rd = Op2
+                 "MOV     R3, R4\n"          //@ Rd = Op2
+                 "STR     R4, [SP]\n" //@ Store to Memory
+                 "BL      sub_FF972804\n"    //@ Branch with Link
+
+                 "MOV     R0, R4\n"          //@ Rd = Op2
+                 "MOV     R1, R0\n"          //@ Rd = Op2
+                 "MOV     R2, R0\n"          //@ Rd = Op2
+                 "MOV     R3, R0\n"          //@ Rd = Op2
+                 "STR     R4, [SP]\n" //@ Store to Memory
+                 "BL      sub_FF972A5C\n"    //@ Branch with Link
+
+
+     "loc_FF976F74:\n"                           //@ CODE XREF: task_ExpDrvTask+47C
+                 "LDR     R2, =0x2E4F4\n"  //@ Load from Memory
+                 "MOV     R3, #0\n"          //@ Rd = Op2
+                 "LDR     R0, [SP,#0x4]\n" //@ Load from Memory
+                 "STR     R3, [R2]\n"        //@ Store to Memory
+                 "BL      sub_FF9722A8\n"    //@ Branch with Link
+
+
+     "loc_FF976F88:\n"                           //@ CODE XREF: task_ExpDrvTask+C
+                 "LDR     R3, =0x2E49C\n"  //@ Load from Memory
+                 "MOV     R2, #0\n"          //@ Rd = Op2
+                 "LDR     R0, [R3]\n"        //@ Load from Memory
+                 "MOV     R1, R7\n"          //@ Rd = Op2
+//                 "BL      ReceiveMessageQueue\n" //@ Branch with Link
+                 "BL      sub_FFB223A8\n" //@ Branch with Link
+
+                 "LDR     R12, [SP,#0x4]\n" //@ Load from Memory
+                 "LDR     R2, [R12]\n"       //@ Load from Memory
+                 "CMP     R2, #0x23\n" //  @ '#'  Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF976A88\n"    //@ Branch
+
+                 "MOV     R0, R12\n"         //@ Rd = Op2
+                 "BL      sub_FF9722A8\n"    //@ Branch with Link
+
+                 "LDR     R3, =0x2E498\n"  //@ Load from Memory
+                 "MOV     R1, #1\n"          //@ Rd = Op2
+                 "LDR     R0, [R3]\n"        //@ Load from Memory
+//                 "BL      SetEventFlag\n"    //@ Branch with Link
+                 "BL      sub_FFB21C90\n"    //@ Branch with Link
+
+                 "BL      _ExitTask\n"       //@ Branch with Link
+
+                 "ADD     SP, SP, #0x20\n"   //@ Rd = Op1 + Op2
+                 "LDMFD   SP!, {R4-R8,PC}\n" //@ Load Block from Memory
+
+//		 "RET\n"                     //@ Return from Subroutine
+		 );
+}
+
+void __attribute__((naked,noinline)) sub_FF973980_my() {
+    asm volatile(
+
+     "sub_FF973980:\n"                           //@ CODE XREF: task_ExpDrvTask+2FC
+                 "STMFD   SP!, {R4-R6,LR}\n" //@ Store Block to Memory
+                 "LDR     R3, =0x2E498\n"  //@ Load from Memory
+                 "MOV     R4, R0\n"          //@ Rd = Op2
+                 "MOV     R1, #0x3E\n"   // @ '>' Rd = Op2
+                 "LDR     R0, [R3]\n"        //@ Load from Memory
+//                 "BL      ClearEventFlag\n"  //@ Branch with Link
+                 "BL      sub_FFB21E2C\n"  //@ Branch with Link
+
+                 "MOV     R1, #0\n"          //@ Rd = Op2
+                 "LDRSH   R0, [R4,#4]\n"     //@ Load from Memory
+                 "BL      sub_FF9723DC\n"    //@ Branch with Link
+
+                 "MOV     R6, R0\n"          //@ Rd = Op2
+                 "LDRSH   R0, [R4,#6]\n"     //@ Load from Memory
+                 "BL      sub_FF972544\n"    //@ Branch with Link
+
+                 "LDRSH   R0, [R4,#8]\n"     //@ Load from Memory
+                 "BL      sub_FF9725E0\n"    //@ Branch with Link
+
+                 "LDRSH   R0, [R4,#0xA]\n"   //@ Load from Memory
+                 "BL      sub_FF97267C\n"    //@ Branch with Link
+
+                 "LDRSH   R0, [R4,#0xC]\n"   //@ Load from Memory
+                 "BL      sub_FF972718\n"    //@ Branch with Link
+
+                 "LDR     R3, [R4]\n"        //@ Load from Memory
+                 "CMP     R3, #9\n"          //@ Set cond. codes on Op1 - Op2
+                 "MOV     R5, R0\n"          //@ Rd = Op2
+                 "MOVEQ   R5, #0\n"          //@ Rd = Op2
+                 "MOVEQ   R6, R5\n"          //@ Rd = Op2
+                 "CMP     R6, #1\n"          //@ Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF973A04\n"    //@ Branch
+
+                 "MOV     R2, #2\n"          //@ Rd = Op2
+                 "LDRSH   R0, [R4,#4]\n"     //@ Load from Memory
+//                 "LDR     R1, =loc_FF9722FC\n" //@ Load from Memory
+                 "LDR     R1, =0xFF9722FC\n" //@ Load from Memory
+                 "BL      sub_FFAE28F8\n"    //@ Branch with Link
+
+                 "LDR     R2, =0x2E4E8\n"  //@ Load from Memory
+                 "MOV     R3, #0\n"          //@ Rd = Op2
+                 "STR     R3, [R2]\n"        //@ Store to Memory
+                 "B       loc_FF973A08\n"    //@ Branch
+
+
+     "loc_FF973A04:\n"                           //@ CODE XREF: sub_FF973980+60
+                 "BL      sub_FF9727B4\n"    //@ Branch with Link
+
+
+     "loc_FF973A08:\n"                           //@ CODE XREF: sub_FF973980+80
+                 "STRH    R0, [R4,#4]\n"     //@ Store to Memory
+                 "CMP     R5, #1\n"          //@ Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF973A28\n"    //@ Branch
+
+                 "LDRSH   R0, [R4,#0xC]\n"   //@ Load from Memory
+//                 "LDR     R1, =loc_FF9723C0\n" //@ Load from Memory
+                 "LDR     R1, =0xFF9723C0\n" //@ Load from Memory
+                 "MOV     R2, #0x20\n" //  @ ' ' @ Rd = Op2
+                 "BL      sub_FF972BA8\n"    //@ Branch with Link
+
+                 "B       loc_FF973A2C\n"    //@ Branch
+
+     "loc_FF973A28:\n"                           //@ CODE XREF: sub_FF973980+90
+                 "BL      sub_FF9727F4\n"    //@ Branch with Link
+
+     "loc_FF973A2C:\n"                           //@ CODE XREF: sub_FF973980+A4
+                 "STRH    R0, [R4,#0xC]\n"   //@ Store to Memory
+                 "LDRSH   R0, [R4,#6]\n"     //@ Load from Memory
+                 "BL      sub_FF93BD38_my\n"    //@ Branch with Link // again an ewvar copy of a function which we also are going to replace
+
+                 "LDRSH   R0, [R4,#8]\n"     //@ Load from Memory
+                 "MOV     R1, #1\n"          //@ Rd = Op2
+                 "BL      sub_FF93DFEC\n"    //@ Branch with Link
+
+                 "ADD     R0, R4, #8\n"      //@ Rd = Op1 + Op2
+                 "MOV     R1, #0\n"          //@ Rd = Op2
+                 "BL      sub_FF93E0AC\n"    //@ Branch with Link
+
+                 "LDRSH   R0, [R4,#0xE]\n"   //@ Load from Memory
+                 "BL      sub_FF9605D0\n"    //@ Branch with Link
+
+                 "CMP     R6, #1\n"          //@ Set cond. codes on Op1 - Op2
+                 "BNE     loc_FF973A90\n"    //@ Branch
+
+                 "LDR     R3, =0x2E498\n"  //@ Load from Memory
+                 "MOV     R2, #0xBB0\n"      //@ Rd = Op2
+                 "LDR     R0, [R3]\n"        //@ Load from Memory
+                 "MOV     R1, #2\n"          //@ Rd = Op2
+                 "ADD     R2, R2, #8\n"      //@ Rd = Op1 + Op2
+//                 "BL      unknown_libname_854\n" //@ "Canon A-Series Firmware"
+                 "BL      sub_FFB21C80\n" //@ "Canon A-Series Firmware"
+
+                 "TST     R0, #1\n"          //@ Set cond. codes on Op1 & Op2
+                 "BEQ     loc_FF973A90\n"    //@ Branch
+
+                 "MOV     R1, #0x500\n"      //@ Rd = Op2
+//                 "LDR     R0, =aExpdrv_c\n"  //@ Load from Memory
+                 "LDR     R0, =0xFF972254\n"  //@ Load from Memory => string "ExpDrv.c"
+                 "ADD     R1, R1, #8\n"      //@ Rd = Op1 + Op2
+//                 "BL      DebugAssert\n"     //@ Branch with Link
+                 "BL      sub_FFB2F4F0\n"     //@ Branch with Link
+
+
+     "loc_FF973A90:\n"                           //@ CODE XREF: sub_FF973980+DC
+                 "CMP     R5, #1\n"          //@ Set cond. codes on Op1 - Op2
+                 "LDMNEFD SP!, {R4-R6,PC}\n" //@ Load Block from Memory
+                 "LDR     R3, =0x2E498\n"  //@ Load from Memory
+                 "MOV     R2, #0xBB0\n"      //@ Rd = Op2
+                 "LDR     R0, [R3]\n"        //@ Load from Memory
+                 "MOV     R1, #0x20\n"       // @ ' '\n" //@ Rd = Op2
+                 "ADD     R2, R2, #8\n"      //@ Rd = Op1 + Op2
+//                 "BL      unknown_libname_854\n" //@ "Canon A-Series Firmware"
+                 "BL      sub_FFB21C80\n" //@ "Canon A-Series Firmware"
+
+                 "TST     R0, #1\n"          //@ Set cond. codes on Op1 & Op2
+                 "LDMEQFD SP!, {R4-R6,PC}\n" //@ Load Block from Memory
+                 "MOV     R1, #0x500\n"      //@ Rd = Op2
+//                 "LDR     R0, =aExpdrv_c\n"  //@ Load from Memory
+                 "LDR     R0, =0xFF972254\n"  //@ Load from Memory
+                 "ADD     R1, R1, #0xD\n"    //@ Rd = Op1 + Op2
+                 "LDMFD   SP!, {R4-R6,LR}\n" //@ Load Block from Memory
+//                 "B       DebugAssert\n"     //@ Branch
+                 "B       sub_FFB2F4F0\n"     //@ Branch with Link
+
+	    );
+}
+
+void __attribute__((naked,noinline)) sub_FF93BD38_my(){
+asm volatile(
+
+
+     "sub_FF93BD38:\n"                           //@ CODE XREF: sub_FF93D684+Cp
+                 "STMFD   SP!, {R4,LR}\n"    //@ Store Block to Memory
+//                 "LDR     R3, =unk_6544\n"   //@ Load from Memory
+                 "LDR     R3, =0x6544\n"   //@ Load from Memory
+                 "LDR     R2, [R3]\n"        //@ Load from Memory
+                 "MOV     R1, #0x168\n"      //@ Rd = Op2
+                 "MOV     R3, R0,LSL#16\n"   //@ Rd = Op2
+                 "CMP     R2, #1\n"          //@ Set cond. codes on Op1 - Op2
+                 "ADD     R1, R1, #3\n"      //@ Rd = Op1 + Op2
+//                 "LDR     R0, =aShutter_c\n" //@ Load from Memory => string "Shutter.c"
+                 "LDR     R0, =0xFF93B554\n" //@ Load from Memory
+                 "MOV     R4, R3,ASR#16\n"   //@ Rd = Op2
+                 "BEQ     loc_FF93BD64\n"    //@ Branch
+
+  //               "BL      DebugAssert\n"     //@ Branch with Link
+                 "BL      sub_FFB2F4F0\n"     //@ Branch with Link
+
+
+     "loc_FF93BD64:\n"                           //@ CODE XREF: sub_FF93BD38+24j
+                 "MOV     R1, #0x170\n"      //@ Rd = Op2
+                 "CMN     R4, #0xC00\n"      //@ Set cond. codes on Op1 + Op2
+//                 "LDR     R3, =unk_15036\n"  //@ Load from Memory
+                 "LDR     R3, =0x15036\n"  //@ Load from Memory
+  //               "LDR     R0, =aShutter_c\n" //@ Load from Memory
+                 "LDR     R0, =0xFF93B554\n" //@ Load from Memory
+                 "ADD     R1, R1, #1\n"      //@ Rd = Op1 + Op2
+                 "LDREQSH R4, [R3]\n"        //@ Load from Memory
+                 "LDRNE   R3, =0x15036\n"  //@ Load from Memory
+                 "CMN     R4, #0xC00\n"      //@ Set cond. codes on Op1 + Op2
+                 "STRH    R4, [R3]\n"        //@ Store to Memory
+                 "BNE     loc_FF93BD90\n"    //@ Branch
+
+//                 "BL      DebugAssert\n"     //@ Branch with Link
+                 "BL      sub_FFB2F4F0\n"     //@ Branch with Link
+
+
+     "loc_FF93BD90:\n"                           //@ CODE XREF: sub_FF93BD38+50j
+                 "MOV     R0, R4\n"          //@ Rd = Op2
+//                 "BL      sub_FF93CE88\n"    //@ Branch with Link
+                 "BL      ExpTimeInMicroseconds\n"    //@ Branch with Link => yet another function we need to make our way through to get to our own version
+
+                 "MOV     R4, R0\n"          //@ Rd = Op2
+//                 "BL      nullsub_118\n"     //@ Branch with Link
+                 "BL      sub_FF9C2BB0\n"     //@ Branch with Link
+
+                 "MOV     R0, R4\n"          //@ Rd = Op2
+                 "BL      sub_FF9DE41C\n"    //@ Branch with Link
+
+                 "MOV     R1, #0x174\n"      //@ Rd = Op2
+                 "TST     R0, #1\n"          //@ Set cond. codes on Op1 & Op2
+                 "ADD     R1, R1, #2\n"      //@ Rd = Op1 + Op2
+//                 "LDR     R0, =aShutter_c\n" //@ Load from Memory
+                 "LDR     R0, =0xFF93B554\n" //@ Load from Memory
+                 "LDMEQFD SP!, {R4,PC}\n"    //@ Load Block from Memory
+                 "LDMFD   SP!, {R4,LR}\n"    //@ Load Block from Memory
+    //             "B       DebugAssert\n"     //@ Branch
+                 "B       sub_FFB2F4F0\n"     //@ Branch with Link
+	);
+}
+/*
+int sub_FF93CE88_my( int TvInApex){
+  if( TvInApex < -576) 
+  {
+      return 1000000.0*pow(2.0, -TvInApex/96.0);
+  }
+  else return _ExpTimeInMicroseconds(TvInApex);
+}
+*/
Index: platform/ixus950_sd850/sub/100c/stubs_entry_2.S
===================================================================
--- platform/ixus950_sd850/sub/100c/stubs_entry_2.S	(Revision 727)
+++ platform/ixus950_sd850/sub/100c/stubs_entry_2.S	(Arbeitskopie)
@@ -57,8 +57,13 @@
 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)
 NHSTUB(UnlockAF, 0xffb09280)
+NHSTUB(ExpTimeInMicroseconds,0xFF93CE88);
Index: platform/ixus950_sd850/sub/100c/stubs_auto.S
===================================================================
--- platform/ixus950_sd850/sub/100c/stubs_auto.S	(Revision 727)
+++ platform/ixus950_sd850/sub/100c/stubs_auto.S	(Arbeitskopie)
@@ -35,6 +35,54 @@
 STUB(FF932E10)
 STUB(FF935BD0)
 STUB(FF939F8C)
+STUB(FF93BD38)
+STUB(FF93C0BC)
+STUB(FF93CE88)
+STUB(FF93DFEC)
+STUB(FF93E0AC)
+STUB(FF93E42C)
+STUB(FF93F1F4)
+STUB(FF9605D0)
+STUB(FF9722A8)
+STUB(FF9723DC)
+STUB(FF972544)
+STUB(FF9725E0)
+STUB(FF97267C)
+STUB(FF972718)
+STUB(FF9727B4)
+STUB(FF9727F4)
+STUB(FF972804)
+STUB(FF9728C0)
+STUB(FF972A5C)
+STUB(FF972BA8)
+STUB(FF972C08)
+STUB(FF972EAC)
+STUB(FF973120)
+STUB(FF97341C)
+STUB(FF973684)
+STUB(FF973980)
+STUB(FF973AE0)
+STUB(FF973DDC)
+STUB(FF973F04)
+STUB(FF973FC8)
+STUB(FF974080)
+STUB(FF974130)
+STUB(FF97430C)
+STUB(FF97462C)
+STUB(FF974778)
+STUB(FF974A24)
+STUB(FF974BE0)
+STUB(FF974DC8)
+STUB(FF974F0C)
+STUB(FF9751D8)
+STUB(FF9752C8)
+STUB(FF976578)
+STUB(FF9768DC)
+STUB(FF976948)
+STUB(FF9769A4)
+STUB(FF976A00)
+STUB(FF9C2BB0)
+STUB(FF9DE41C)
 STUB(FFA4226C)
 STUB(FFA42780)
 STUB(FFA71658)
@@ -51,6 +99,7 @@
 STUB(FFAA20C8)
 STUB(FFAA2294)
 STUB(FFAB5944)
+STUB(FFAE28F8)
 STUB(FFAF185C)
 STUB(FFAF1CA4)
 STUB(FFB01550)
@@ -92,6 +141,7 @@
 STUB(FFB11440)
 STUB(FFB115D4)
 STUB(FFB17EE8)
+STUB(FFB21C80)
 STUB(FFB21C90)
 STUB(FFB21E2C)
 STUB(FFB223A8)
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 727)
+++ 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 727)
+++ platform/generic/wrappers.c	(Arbeitskopie)
@@ -2,6 +2,7 @@
 #include "lolevel.h"
 #include "platform.h"
 #include "conf.h"
+#include "math.h"
 
 #if CAM_DRYOS
 #define _U	0x01	/* upper */
@@ -792,6 +793,63 @@
  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"
+	".pool\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(
@@ -923,3 +981,14 @@
  _iosDevDelete(drv_struct);
 #endif
 }
+
+#if defined(CAM_HAS_EXTENDED_TV_LENGTH) && (CAM_HAS_EXTENDED_TV_LENGTH == 1)
+int  ExpTimeInMicroseconds(int apex_tv){
+ if (apex_tv<-576)
+ {
+     // for my ixus950is it is very important that this is pow() and not __pow() !
+     return 1000000.0*pow(2.0, -apex_tv/96.0);
+ }
+ else return _ExpTimeInMicroseconds(apex_tv);
+}
+#endif
Index: platform/generic/main.c
===================================================================
--- platform/generic/main.c	(Revision 727)
+++ platform/generic/main.c	(Arbeitskopie)
@@ -119,6 +119,12 @@
 	  #endif
 	}
 
+#if defined(CAM_HAS_EXTENDED_TV_LENGTH) && (CAM_HAS_EXTENDED_TV_LENGTH == 1)
+	if (my_ncmp(name, "tExpDrvTas",10) == 0){
+	    *entry = (long)_task_ExpDrvTask;
+	}
+#endif
+
 	core_hook_task_create(pNewTcb);
     }
 }
Index: platform/generic/shooting.c
===================================================================
--- platform/generic/shooting.c	(Revision 727)
+++ platform/generic/shooting.c	(Arbeitskopie)
@@ -37,7 +37,19 @@
 static const short koef[] = {0, 1,10,100,1000};
 static const float shutter_koef[] = {0, 0.00001, 0.0001,0.001,0.01,0.1,1,10,100,1000};
 static const char * expo_shift[] = { "Off", "1/3Ev","2/3Ev", "1Ev", "1 1/3Ev", "1 2/3Ev", "2Ev", "2 1/3Ev", "2 2/3Ev", "3Ev", "3 1/3Ev", "3 2/3Ev", "4Ev"};
-static const char* tv_override[]={"64","50.8", "40.3", "32", "25.4","20","16", "12.7", "10","8", "6.3","5","4","3.2", "2.5","2", "1.6", "1.3", "1", "0.8", "0.6", "0.5", "0.4", "0.3", "1/4", "1/5", "1/6", "1/8", "1/10", "1/13", "1/15", "1/20", "1/25", "1/30", "1/40", "1/50", "1/60", "1/80", "1/100", "1/125", "1/160", "1/200", "1/250", "1/320", "1/400", "1/500", "1/640","1/800", "1/1000", "1/1250", "1/1600","1/2000","1/2500","1/3200","1/4000", "1/5000", "1/6400", "1/8000", "1/10000", "1/12500", "1/16000", "1/20000", "1/25000", "1/32000", "1/40000", "1/50000", "1/64000","1/80000", "1/100k"};
+const char* tv_override[]={
+#if defined(CAM_HAS_EXTENDED_TV_LENGTH) && (CAM_HAS_EXTENDED_TV_LENGTH==1)
+    // add very long time exposures as approximately powers of 2, adding 15 exposures
+    "2048","1625","1290","1024","812","645","512","406","322","256","203","161","128","101","80",
+#endif
+    "64","50.8", "40.3", "32", "25.4","20","16", "12.7", "10","8", "6.3","5","4","3.2", "2.5","2", "1.6", "1.3", "1", "0.8", "0.6", "0.5", "0.4", "0.3", "1/4", "1/5", "1/6", "1/8", "1/10", "1/13", "1/15", "1/20", "1/25", "1/30", "1/40", "1/50", "1/60", "1/80", "1/100", "1/125", "1/160", "1/200", "1/250", "1/320", "1/400", "1/500", "1/640","1/800", "1/1000", "1/1250", "1/1600","1/2000","1/2500","1/3200","1/4000", "1/5000", "1/6400", "1/8000", "1/10000", "1/12500", "1/16000", "1/20000", "1/25000", "1/32000", "1/40000", "1/50000", "1/64000","1/80000", "1/100k"};
+const int tv_override_amount = sizeof(tv_override)/sizeof(tv_override[0]);
+
+#if defined(CAM_HAS_EXTENDED_TV_LENGTH) && (CAM_HAS_EXTENDED_TV_LENGTH==1)
+const int tv_override_zero_shift = 18+15;
+#else
+const int tv_override_zero_shift = 18;
+#endif
 static const char * expo_type[] = { "+/-", "-","+"};
 
 static PHOTO_PARAM photo_param_put_off;
@@ -110,7 +122,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 +135,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 +174,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 +576,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 +832,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 +992,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 +1034,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));
 }
 
@@ -1220,7 +1232,8 @@
    else if (((conf.tv_enum_type) || (conf.tv_override_value)) && (conf.tv_override_koef) && !(conf.override_disable==1))
    { 
    if (conf.tv_enum_type) 
-     shooting_set_tv96_direct(32*(conf.tv_override_value-18),SET_NOW);
+//     shooting_set_tv96_direct(32*(conf.tv_override_value-18),SET_NOW);
+     shooting_set_tv96_direct(32*(conf.tv_override_value-(tv_override_zero_shift)),SET_NOW);
    else   
     shooting_set_tv96_direct(shooting_get_tv96_from_shutter_speed(shooting_get_shutter_speed_override_value()), SET_NOW); 
    }
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/capt_seq.c
===================================================================
--- platform/a570/sub/101a/capt_seq.c	(Revision 727)
+++ platform/a570/sub/101a/capt_seq.c	(Arbeitskopie)
@@ -227,3 +227,527 @@
  );
 }
 
+/*************************************************************/
+void __attribute__((naked,noinline)) _task_ExpDrvTask(){
+ asm volatile(
+                 "STMFD   SP!, {R4-R8,LR}\n"
+                 "SUB     SP, SP, #0x20\n"
+                 "ADD     R7, SP, #4\n"
+                 "B       loc_ffd246dc\n"
+ "loc_ffd241dc:\n"
+                 "CMP     R2, #0x22\n"
+                 "BNE     loc_ffd241f4\n"
+                 "LDR     R0, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "B       loc_ffd24258\n"
+ "loc_ffd241f4:\n"
+                 "CMP     R2, #0x1D\n"
+                 "BNE     loc_ffd24208\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_ffd2409c\n"
+                 "B       loc_ffd24248\n" 
+ "loc_ffd24208:\n"
+                 "CMP     R2, #0x1E\n"
+                 "BNE     loc_ffd2421c\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_ffd240f8\n"
+                 "B       loc_ffd24248\n"
+ "loc_ffd2421c:\n"
+                 "SUB     R3, R2, #0x1F\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_ffd24234\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_ffd24154\n"
+                 "B       loc_ffd24248\n"
+ "loc_ffd24234:\n"
+                 "CMP     R2, #0x21\n"
+                 "BNE     loc_ffd24264\n"
+                 "BL      sub_ffcea234\n"
+                 "BL      sub_ffced36c\n"
+                 "BL      sub_ffcec5a4\n"
+ "loc_ffd24248:\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "LDR     R0, [R3,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x88]\n"
+ "loc_ffd24258:\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd1f8d4\n"
+                 "B       loc_ffd246dc\n"
+ "loc_ffd24264:\n"
+                 "CMP     R2, #0xD\n"
+                 "MOV     R8, #1\n"
+                 "BNE     loc_ffd242d4\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "ADD     R1, R1, R1,LSL#1\n"
+                 "ADD     R1, R12, R1,LSL#2\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "SUB     R1, R1, #8\n"
+                 "MOV     R2, #0xC\n"
+                 "MOV     R0, R6\n"
+                 "BL      _memcpy\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd224ac\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "LDR     R1, [R3,#0x7C]\n"
+                 "LDR     R2, [R3,#0x8C]\n"
+                 "ADD     R0, R3, #4\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x88]\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd22778\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "ADD     R0, R3, #4\n"
+                 "LDR     R1, [R3,#0x7C]\n"
+                 "LDR     R2, [R3,#0x94]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x90]\n"
+                 "B       loc_ffd24624\n"
+ "loc_ffd242d4:\n"
+                 "SUB     R3, R2, #0xE\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_ffd24390\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "ADD     R5, SP, #8\n"
+                 "MOV     R0, R12\n"
+                 "MOV     R1, R6\n"
+                 "MOV     R2, R5\n"
+                 "BL      sub_ffd22868\n"
+                 "MOV     R4, R0\n"
+                 "CMP     R4, #5\n"
+                 "CMPNE   R4, #1\n"
+                 "BNE     loc_ffd24328\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "MOV     R0, R5\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "MOV     R2, R4\n"
+                 "LDR     R3, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "B       loc_ffd24360\n"
+ "loc_ffd24328:\n"
+                 "CMP     R4, #6\n"
+                 "CMPNE   R4, #2\n"
+                 "BNE     loc_ffd24370\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "MOV     R0, R5\n"
+                 "MOV     R1, R8\n"
+                 "MOV     R2, R4\n"
+                 "LDR     R3, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "MOV     R1, R6\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "MOV     R2, R5\n"
+                 "BL      sub_ffd23cfc\n"
+ "loc_ffd24360:\n"
+                 "MOV     R1, R4\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd24030\n"
+                 "B       loc_ffd24624\n"
+ "loc_ffd24370:\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "MOV     R2, R4\n"
+                 "ADD     R0, R12, #4\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "LDR     R3, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "B       loc_ffd24624\n"
+ "loc_ffd24390:\n"
+                 "SUB     R3, R2, #0x19\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_ffd243e8\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "ADD     R1, R1, R1,LSL#1\n"
+                 "ADD     R1, R12, R1,LSL#2\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "SUB     R1, R1, #8\n"
+                 "MOV     R2, #0xC\n"
+                 "MOV     R0, R6\n"
+                 "BL      _memcpy\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd218a0\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "ADD     R0, R3, #4\n"
+                 "LDR     R1, [R3,#0x7C]\n"
+                 "LDR     R2, [R3,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x88]\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd21c7c\n"
+                 "B       loc_ffd24624\n"
+ "loc_ffd243e8:\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "ADD     R1, R12, #4\n"
+                 "MOV     R2, #0xC\n"
+                 "MOV     R0, R6\n"
+                 "BL      memcpy\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "LDR     R3, [R12]\n"
+                 "MOV     R2, R12\n"
+                 "CMP     R3, #0x1C\n"
+                 "LDRLS   PC, [PC,R3,LSL#2]\n"
+                 "B       loc_ffd24610\n"
+                 ".long loc_ffd24488\n"
+                 ".long loc_ffd24494\n"
+                 ".long loc_ffd244a0\n"
+                 ".long loc_ffd244a0\n"
+                 ".long loc_ffd24488\n"
+                 ".long loc_ffd24494\n"
+                 ".long loc_ffd244a0\n"
+                 ".long loc_ffd244a0\n"
+                 ".long loc_ffd244c4\n"
+                 ".long loc_ffd244c4\n"
+                 ".long loc_ffd245e4\n"
+                 ".long loc_ffd245f0\n"
+                 ".long loc_ffd24600\n"
+                 ".long loc_ffd24610\n"
+                 ".long loc_ffd24610\n"
+                 ".long loc_ffd24610\n"
+                 ".long loc_ffd244ac\n"
+                 ".long loc_ffd244b8\n"
+                 ".long loc_ffd244d4\n"
+                 ".long loc_ffd244e0\n"
+                 ".long loc_ffd24518\n"
+                 ".long loc_ffd24550\n"
+                 ".long loc_ffd24588\n"
+                 ".long loc_ffd245c0\n"
+                 ".long loc_ffd245c0\n"
+                 ".long loc_ffd24610\n"
+                 ".long loc_ffd24610\n"
+                 ".long loc_ffd245cc\n"
+                 ".long loc_ffd245d8\n"
+ "loc_ffd24488:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd20278\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd24494:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd2051c\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd244a0:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd20790\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd244ac:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd20a8c\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd244b8:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd20cf4\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd244c4:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd20ef4_my\n"  //---------->                 
+                 "MOV     R8, #0\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd244d4:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd21054\n"
+                 "B       loc_ffd2460c\n"
+                 
+                 
+ "loc_ffd244e0:\n"
+                 "LDRH    R1, [R2,#4]\n"
+                 "LDR     R3, =0x2AFE0\n"
+                 "STRH    R1, [SP,#0x14]\n"
+                 "LDRH    R1, [R3,#6]\n"
+                 "STRH    R1, [SP,#0x1A]\n"
+                 "LDRH    R1, [R3,#2]\n"
+                 "STRH    R1, [SP,#0x16]\n"
+                 "LDRH    R3, [R3,#4]\n"
+                 "STRH    R3, [SP,#0x18]\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#0xC]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "BL      sub_ffd2134c\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd24518:\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#4]\n"
+                 "LDR     R3, =0x2AFE0\n"
+                 "STRH    R2, [SP,#0x14]\n"
+                 "LDRH    R2, [R3,#8]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "LDRH    R1, [R3,#2]\n"
+                 "STRH    R1, [SP,#0x16]\n"
+                 "LDRH    R2, [R3,#4]\n"
+                 "STRH    R2, [SP,#0x18]\n"
+                 "LDRH    R3, [R3,#6]\n"
+                 "STRH    R3, [SP,#0x1A]\n"
+                 "BL      sub_ffd21474\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd24550:\n"
+                 "LDR     R3, =0x2AFE0\n"
+                 "LDRH    R1, [R3]\n"
+                 "STRH    R1, [SP,#0x14]\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#6]\n"
+                 "STRH    R2, [SP,#0x16]\n"
+                 "LDRH    R2, [R3,#8]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "LDRH    R1, [R3,#4]\n"
+                 "STRH    R1, [SP,#0x18]\n"
+                 "LDRH    R3, [R3,#6]\n"
+                 "STRH    R3, [SP,#0x1A]\n"
+                 "BL      sub_ffd21538\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd24588:\n"
+                 "LDR     R3, =0x2AFE0\n"
+                 "LDRH    R1, [R3,#6]\n"
+                 "STRH    R1, [SP,#0x1A]\n"
+                 "LDRH    R1, [R3]\n"
+                 "STRH    R1, [SP,#0x14]\n"
+                 "LDRH    R1, [R3,#2]\n"
+                 "STRH    R1, [SP,#0x16]\n"
+                 "LDRH    R3, [R3,#4]\n"
+                 "STRH    R3, [SP,#0x18]\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#0xC]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "BL      sub_ffd215f0\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd245c0:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd216a0\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd245cc:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd21dc8\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd245d8:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd21fc4\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd245e4:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd22180\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd245f0:\n"
+                 "MOV     R0, R2\n"
+                 "MOV     R1, #0\n"
+                 "BL      sub_ffd22368\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd24600:\n"
+                 "MOV     R0, R2\n"
+                 "MOV     R1, #1\n"
+                 "BL      sub_ffd22368\n"
+ "loc_ffd2460c:\n"
+                 "LDR     R12, [SP,#4]\n"
+ "loc_ffd24610:\n"
+                 "ADD     R0, R12, #4\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "LDR     R2, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+ "loc_ffd24624:\n"
+                 "CMP     R8, #1\n"
+                 "BNE     loc_ffd2464c\n"
+                 "LDR     R1, [SP,#4]\n"
+                 "LDR     R3, [R1,#0x7C]\n"
+                 "ADD     R3, R3, R3,LSL#1\n"
+                 "ADD     R1, R1, R3,LSL#2\n"
+                 "MOV     R0, R6\n"
+                 "SUB     R1, R1, #8\n"
+                 "BL      sub_ffd1ff30\n"
+                 "B       loc_ffd246c8\n"
+ "loc_ffd2464c:\n"
+                 "LDR    R3, [SP,#4]\n"
+                 "LDR    R2, [R3]\n"
+                 "CMP    R2, #9\n"
+                 "BNE    loc_ffd24694\n"
+                 "MOV    R4, #0\n"
+                 "MOV    R1, #1\n"
+                 "MOV    R2, R1\n"
+                 "MOV    R3, R1\n"
+                 "MOV    R0, R4\n"
+                 "STR    R4, [SP]\n"
+                 "BL     sub_ffd1fe74\n"
+                 "MOV    R1, #1\n"
+                 "MOV    R0, R4\n"
+                 "MOV    R2, R1\n"
+                 "MOV    R3, R1\n"
+                 "STR    R4, [SP]\n"
+                 "BL     sub_ffd200cc\n"
+                 "B      loc_ffd246c8\n"
+ "loc_ffd24694:\n"
+                 "MOV    R4, #1\n"
+                 "MOV    R0, R4\n"
+                 "MOV    R1, R4\n"
+                 "MOV    R2, R4\n"
+                 "MOV    R3, R4\n"
+                 "STR    R4, [SP]\n"
+                 "BL     sub_ffd1fe74\n"
+                 "MOV    R0, R4\n"
+                 "MOV    R1, R0\n"
+                 "MOV    R2, R0\n"
+                 "MOV    R3, R0\n"
+                 "STR    R4, [SP]\n"
+                 "BL     sub_ffd200cc\n"
+
+ "loc_ffd246c8:\n"
+                 "LDR    R2, =0x2B030\n"
+                 "MOV    R3, #0\n"
+                 "LDR    R0, [SP,#4]\n"
+                 "STR    R3, [R2]\n"
+                 "BL     sub_ffd1f8d4\n"
+
+ "loc_ffd246dc:\n"
+                 "LDR     R3, =0x2AFD4\n"
+                 "MOV     R2, #0\n"
+                 "LDR     R0, [R3]\n"
+                 "MOV     R1, R7\n"
+                 "BL      sub_ffebd6e4\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "LDR     R2, [R12]\n"
+                 "CMP     R2, #0x23\n"
+                 "BNE     loc_ffd241dc\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_ffd1f8d4\n"
+                 "LDR     R3, =0x2AFD0\n"
+                 "MOV     R1, #1\n"
+                 "LDR     R0, [R3]\n"
+                 "BL      sub_ffebcfcc\n"
+                 "BL      sub_ffebeca8\n" // ExitTask
+                 "ADD     SP, SP, #0x20\n"
+                 "LDMFD   SP!, {R4-R8,PC}\n"
+ );
+}
+
+void __attribute__((naked,noinline)) sub_ffd20ef4_my(){
+ asm volatile(
+                 "STMFD   SP!, {R4-R6,LR}\n"
+                 "LDR     R3, =0x2AFD0\n"
+                 "MOV     R4, R0\n"
+                 "MOV     R1, #0x3E\n"
+                 "LDR     R0, [R3]\n"
+                 "BL      sub_ffebd168\n"
+                 "MOV     R1, #0\n"
+                 "LDRSH   R0, [R4,#4]\n"
+                 "BL      sub_ffd1fa08\n"
+                 "MOV     R6, R0\n"
+                 "LDRSH   R0, [R4,#6]\n"
+                 "BL      sub_ffd1fbb4\n"
+                 "LDRSH   R0, [R4,#8]\n"
+                 "BL      sub_ffd1fc50\n"
+                 "LDRSH   R0, [R4,#0xA]\n"
+                 "BL      sub_ffd1fcec\n"
+                 "LDRSH   R0, [R4,#0xC]\n"
+                 "BL      sub_ffd1fd88\n"
+                 "LDR     R3, [R4]\n"
+                 "CMP     R3, #9\n"
+                 "MOV     R5, R0\n"
+                 "MOVEQ   R5, #0\n"
+                 "MOVEQ   R6, R5\n"
+                 "CMP     R6, #1\n"
+                 "BNE     loc_ffd20f78\n"
+                 "MOV     R2, #2\n"
+                 "LDRSH   R0, [R4,#4]\n"
+                 "LDR     R1, =0xFFD1F928\n"
+                 "BL      sub_ffe7827c\n"
+                 "LDR     R2, =0x2B020\n"
+                 "MOV     R3, #0\n"
+                 "STR     R3, [R2]\n"
+                 "B       loc_ffd20f7c\n"
+ "loc_ffd20f78:\n"
+                 "BL      sub_ffd1fe24\n"
+ "loc_ffd20f7c:\n"
+                 "STRH    R0, [R4,#4]\n"
+                 "CMP     R5, #1\n"
+                 "BNE     loc_ffd20f9c\n"
+                 "LDRSH   R0, [R4,#0xC]\n"
+                 "LDR     R1, =0xFFD1F9EC\n"
+                 "MOV     R2, #0x20\n"
+                 "BL      sub_ffd20218\n"
+                 "B       loc_ffd20fa0\n"
+ "loc_ffd20f9c:\n"
+                 "BL      sub_ffd1fe64\n"
+ "loc_ffd20fa0:\n"
+                 "STRH    R0, [R4,#0xC]\n"
+                 "LDRSH   R0, [R4,#6]\n"
+                 "BL      sub_ffce9eb0_my\n"  // ------------->
+                 "LDRSH   R0, [R4,#8]\n"
+                 "MOV     R1, #1\n"
+                 "BL      sub_ffcec164\n"
+                 "ADD     R0, R4, #8\n"
+                 "MOV     R1, #0\n"
+                 "BL      sub_ffcec224\n"
+                 "LDRSH   R0, [R4,#0xE]\n"
+                 "BL      sub_ffd0e5d4\n"
+                 "CMP     R6, #1\n"
+                 "BNE     loc_ffd21004\n"
+                 "LDR     R3, =0x2AFD0\n"
+                 "MOV     R2, #0xBB0\n"
+                 "LDR     R0, [R3]\n"
+                 "MOV     R1, #2\n"
+                 "ADD     R2, R2, #8\n"
+                 "BL      sub_ffebcf48\n"
+                 "TST     R0, #1\n"
+                 "BEQ     loc_ffd21004\n"
+                 "MOV     R1, #0x4a0\n"
+                 "LDR     R0, =0xFFD1F880\n"
+                 "ADD     R1, R1, #3\n"
+                 "BL      sub_ffeca824\n"
+ "loc_ffd21004:\n"
+                 "CMP     R5, #1\n"
+                 "LDMNEFD SP!, {R4-R6,PC}\n"
+                 "LDR     R3, =0x2AFD0\n"
+                 "MOV     R2, #0xBB0\n"
+                 "LDR     R0, [R3]\n"
+                 "MOV     R1, #0x20\n"
+                 "ADD     R2, R2, #8\n"
+                 "BL      sub_ffebcfbc\n"
+                 "TST     R0, #1\n"
+                 "LDMEQFD SP!, {R4-R6,PC}\n"
+                 "MOV     R1, #0x4A0\n"
+                 "LDR     R0, =0xFFD1F880\n"
+                 "ADD     R1, R1, #8\n"
+                 "LDMFD   SP!, {R4-R6,LR}\n"
+                 "B       sub_ffeca824\n"
+ );
+}
+
+void __attribute__((naked,noinline)) sub_ffce9eb0_my(){
+ asm volatile(
+                 "STMFD   SP!, {R4,LR}\n"
+                 "LDR     R3, =0x59FC\n"
+                 "LDR     R2, [R3]\n"
+                 "MOV     R1, #0x168\n"
+                 "MOV     R3, R0,LSL#16\n"
+                 "CMP     R2, #1\n"
+                 "ADD     R1, R1, #3\n"
+                 "LDR     R0, =0xFFCE96CC\n"
+                 "MOV     R4, R3,ASR#16\n"
+                 "BEQ     loc_FFCE9EDC\n"
+                 "BL      sub_ffeca824\n"
+ "loc_FFCE9EDC:\n"
+                 "MOV     R1, #0x170\n"
+                 "CMN     R4, #0xC00\n"
+                 "LDR     R3, =0x11B4E\n"
+                 "LDR     R0, =0xFFCE96CC\n"
+                 "ADD     R1, R1, #1\n"
+                 "LDREQSH R4, [R3]\n"
+                 "LDRNE   R3, =0x11B4E\n"
+                 "CMN     R4, #0xC00\n"
+                 "STRH    R4, [R3]\n"
+                 "BNE     loc_FFCE9F08\n"
+                 "BL      sub_ffeca824\n"
+ "loc_FFCE9F08:\n"
+                 "MOV     R0, R4\n"
+                 "BL      ExpTimeInMicroseconds\n"  //---------->
+                 "MOV     R4, R0\n"
+                 "BL      sub_FFD764E0\n"
+                 "MOV     R0, R4\n"
+                 "BL      sub_ffd8d97c\n"
+                 "MOV     R1, #0x174\n"
+                 "TST     R0, #1\n"
+                 "ADD     R1, R1, #2\n"
+                 "LDR     R0, =0xFFCE96CC\n"
+                 "LDMEQFD SP!, {R4,PC}\n"
+                 "LDMFD   SP!, {R4,LR}\n"
+                 "B       sub_ffeca824\n"
+ );
+}
Index: platform/a570/sub/101a/stubs_entry_2.S
===================================================================
--- platform/a570/sub/101a/stubs_entry_2.S	(Revision 727)
+++ platform/a570/sub/101a/stubs_entry_2.S	(Arbeitskopie)
@@ -30,3 +30,4 @@
 NHSTUB(SetAE_ShutterSpeed, 0xFFE0B780)
 NHSTUB(DoAFLock, 0xffea4c50)
 NHSTUB(UnlockAF, 0xffea4cd0)
+NHSTUB(ExpTimeInMicroseconds, 0xffceb000)
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/capt_seq.c
===================================================================
--- platform/a570/sub/100e/capt_seq.c	(Revision 727)
+++ platform/a570/sub/100e/capt_seq.c	(Arbeitskopie)
@@ -302,3 +302,527 @@
 	);
 }
 
+/*************************************************************/
+void __attribute__((naked,noinline)) _task_ExpDrvTask(){
+ asm volatile(
+                 "STMFD   SP!, {R4-R8,LR}\n"
+                 "SUB     SP, SP, #0x20\n"
+                 "ADD     R7, SP, #4\n"
+                 "B       loc_ffd246dc\n"
+ "loc_ffd241dc:\n"
+                 "CMP     R2, #0x22\n"
+                 "BNE     loc_ffd241f4\n"
+                 "LDR     R0, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "B       loc_ffd24258\n"
+ "loc_ffd241f4:\n"
+                 "CMP     R2, #0x1D\n"
+                 "BNE     loc_ffd24208\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_ffd2409c\n"
+                 "B       loc_ffd24248\n" 
+ "loc_ffd24208:\n"
+                 "CMP     R2, #0x1E\n"
+                 "BNE     loc_ffd2421c\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_ffd240f8\n"
+                 "B       loc_ffd24248\n"
+ "loc_ffd2421c:\n"
+                 "SUB     R3, R2, #0x1F\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_ffd24234\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_ffd24154\n"
+                 "B       loc_ffd24248\n"
+ "loc_ffd24234:\n"
+                 "CMP     R2, #0x21\n"
+                 "BNE     loc_ffd24264\n"
+                 "BL      sub_ffcea234\n"
+                 "BL      sub_ffced36c\n"
+                 "BL      sub_ffcec5a4\n"
+ "loc_ffd24248:\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "LDR     R0, [R3,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x88]\n"
+ "loc_ffd24258:\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd1f8d4\n"
+                 "B       loc_ffd246dc\n"
+ "loc_ffd24264:\n"
+                 "CMP     R2, #0xD\n"
+                 "MOV     R8, #1\n"
+                 "BNE     loc_ffd242d4\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "ADD     R1, R1, R1,LSL#1\n"
+                 "ADD     R1, R12, R1,LSL#2\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "SUB     R1, R1, #8\n"
+                 "MOV     R2, #0xC\n"
+                 "MOV     R0, R6\n"
+                 "BL      _memcpy\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd224ac\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "LDR     R1, [R3,#0x7C]\n"
+                 "LDR     R2, [R3,#0x8C]\n"
+                 "ADD     R0, R3, #4\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x88]\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd22778\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "ADD     R0, R3, #4\n"
+                 "LDR     R1, [R3,#0x7C]\n"
+                 "LDR     R2, [R3,#0x94]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x90]\n"
+                 "B       loc_ffd24624\n"
+ "loc_ffd242d4:\n"
+                 "SUB     R3, R2, #0xE\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_ffd24390\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "ADD     R5, SP, #8\n"
+                 "MOV     R0, R12\n"
+                 "MOV     R1, R6\n"
+                 "MOV     R2, R5\n"
+                 "BL      sub_ffd22868\n"
+                 "MOV     R4, R0\n"
+                 "CMP     R4, #5\n"
+                 "CMPNE   R4, #1\n"
+                 "BNE     loc_ffd24328\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "MOV     R0, R5\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "MOV     R2, R4\n"
+                 "LDR     R3, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "B       loc_ffd24360\n"
+ "loc_ffd24328:\n"
+                 "CMP     R4, #6\n"
+                 "CMPNE   R4, #2\n"
+                 "BNE     loc_ffd24370\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "MOV     R0, R5\n"
+                 "MOV     R1, R8\n"
+                 "MOV     R2, R4\n"
+                 "LDR     R3, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "MOV     R1, R6\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "MOV     R2, R5\n"
+                 "BL      sub_ffd23cfc\n"
+ "loc_ffd24360:\n"
+                 "MOV     R1, R4\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd24030\n"
+                 "B       loc_ffd24624\n"
+ "loc_ffd24370:\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "MOV     R2, R4\n"
+                 "ADD     R0, R12, #4\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "LDR     R3, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+                 "B       loc_ffd24624\n"
+ "loc_ffd24390:\n"
+                 "SUB     R3, R2, #0x19\n"
+                 "CMP     R3, #1\n"
+                 "BHI     loc_ffd243e8\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "ADD     R1, R1, R1,LSL#1\n"
+                 "ADD     R1, R12, R1,LSL#2\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "SUB     R1, R1, #8\n"
+                 "MOV     R2, #0xC\n"
+                 "MOV     R0, R6\n"
+                 "BL      _memcpy\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd218a0\n"
+                 "LDR     R3, [SP,#4]\n"
+                 "ADD     R0, R3, #4\n"
+                 "LDR     R1, [R3,#0x7C]\n"
+                 "LDR     R2, [R3,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R3,#0x88]\n"
+                 "LDR     R0, [SP,#4]\n"
+                 "BL      sub_ffd21c7c\n"
+                 "B       loc_ffd24624\n"
+ "loc_ffd243e8:\n"
+                 "ADD     R6, SP, #0x14\n"
+                 "ADD     R1, R12, #4\n"
+                 "MOV     R2, #0xC\n"
+                 "MOV     R0, R6\n"
+                 "BL      memcpy\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "LDR     R3, [R12]\n"
+                 "MOV     R2, R12\n"
+                 "CMP     R3, #0x1C\n"
+                 "LDRLS   PC, [PC,R3,LSL#2]\n"
+                 "B       loc_ffd24610\n"
+                 ".long loc_ffd24488\n"
+                 ".long loc_ffd24494\n"
+                 ".long loc_ffd244a0\n"
+                 ".long loc_ffd244a0\n"
+                 ".long loc_ffd24488\n"
+                 ".long loc_ffd24494\n"
+                 ".long loc_ffd244a0\n"
+                 ".long loc_ffd244a0\n"
+                 ".long loc_ffd244c4\n"
+                 ".long loc_ffd244c4\n"
+                 ".long loc_ffd245e4\n"
+                 ".long loc_ffd245f0\n"
+                 ".long loc_ffd24600\n"
+                 ".long loc_ffd24610\n"
+                 ".long loc_ffd24610\n"
+                 ".long loc_ffd24610\n"
+                 ".long loc_ffd244ac\n"
+                 ".long loc_ffd244b8\n"
+                 ".long loc_ffd244d4\n"
+                 ".long loc_ffd244e0\n"
+                 ".long loc_ffd24518\n"
+                 ".long loc_ffd24550\n"
+                 ".long loc_ffd24588\n"
+                 ".long loc_ffd245c0\n"
+                 ".long loc_ffd245c0\n"
+                 ".long loc_ffd24610\n"
+                 ".long loc_ffd24610\n"
+                 ".long loc_ffd245cc\n"
+                 ".long loc_ffd245d8\n"
+ "loc_ffd24488:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd20278\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd24494:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd2051c\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd244a0:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd20790\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd244ac:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd20a8c\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd244b8:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd20cf4\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd244c4:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd20ef4_my\n"  //---------->                 
+                 "MOV     R8, #0\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd244d4:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd21054\n"
+                 "B       loc_ffd2460c\n"
+                 
+                 
+ "loc_ffd244e0:\n"
+                 "LDRH    R1, [R2,#4]\n"
+                 "LDR     R3, =0x2AFE0\n"
+                 "STRH    R1, [SP,#0x14]\n"
+                 "LDRH    R1, [R3,#6]\n"
+                 "STRH    R1, [SP,#0x1A]\n"
+                 "LDRH    R1, [R3,#2]\n"
+                 "STRH    R1, [SP,#0x16]\n"
+                 "LDRH    R3, [R3,#4]\n"
+                 "STRH    R3, [SP,#0x18]\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#0xC]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "BL      sub_ffd2134c\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd24518:\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#4]\n"
+                 "LDR     R3, =0x2AFE0\n"
+                 "STRH    R2, [SP,#0x14]\n"
+                 "LDRH    R2, [R3,#8]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "LDRH    R1, [R3,#2]\n"
+                 "STRH    R1, [SP,#0x16]\n"
+                 "LDRH    R2, [R3,#4]\n"
+                 "STRH    R2, [SP,#0x18]\n"
+                 "LDRH    R3, [R3,#6]\n"
+                 "STRH    R3, [SP,#0x1A]\n"
+                 "BL      sub_ffd21474\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd24550:\n"
+                 "LDR     R3, =0x2AFE0\n"
+                 "LDRH    R1, [R3]\n"
+                 "STRH    R1, [SP,#0x14]\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#6]\n"
+                 "STRH    R2, [SP,#0x16]\n"
+                 "LDRH    R2, [R3,#8]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "LDRH    R1, [R3,#4]\n"
+                 "STRH    R1, [SP,#0x18]\n"
+                 "LDRH    R3, [R3,#6]\n"
+                 "STRH    R3, [SP,#0x1A]\n"
+                 "BL      sub_ffd21538\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd24588:\n"
+                 "LDR     R3, =0x2AFE0\n"
+                 "LDRH    R1, [R3,#6]\n"
+                 "STRH    R1, [SP,#0x1A]\n"
+                 "LDRH    R1, [R3]\n"
+                 "STRH    R1, [SP,#0x14]\n"
+                 "LDRH    R1, [R3,#2]\n"
+                 "STRH    R1, [SP,#0x16]\n"
+                 "LDRH    R3, [R3,#4]\n"
+                 "STRH    R3, [SP,#0x18]\n"
+                 "MOV     R0, R2\n"
+                 "LDRH    R2, [R2,#0xC]\n"
+                 "STRH    R2, [SP,#0x1C]\n"
+                 "BL      sub_ffd215f0\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd245c0:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd216a0\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd245cc:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd21dc8\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd245d8:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd21fc4\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd245e4:\n"
+                 "MOV     R0, R2\n"
+                 "BL      sub_ffd22180\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd245f0:\n"
+                 "MOV     R0, R2\n"
+                 "MOV     R1, #0\n"
+                 "BL      sub_ffd22368\n"
+                 "B       loc_ffd2460c\n"
+ "loc_ffd24600:\n"
+                 "MOV     R0, R2\n"
+                 "MOV     R1, #1\n"
+                 "BL      sub_ffd22368\n"
+ "loc_ffd2460c:\n"
+                 "LDR     R12, [SP,#4]\n"
+ "loc_ffd24610:\n"
+                 "ADD     R0, R12, #4\n"
+                 "LDR     R1, [R12,#0x7C]\n"
+                 "LDR     R2, [R12,#0x8C]\n"
+                 "MOV     LR, PC\n"
+                 "LDR     PC, [R12,#0x88]\n"
+ "loc_ffd24624:\n"
+                 "CMP     R8, #1\n"
+                 "BNE     loc_ffd2464c\n"
+                 "LDR     R1, [SP,#4]\n"
+                 "LDR     R3, [R1,#0x7C]\n"
+                 "ADD     R3, R3, R3,LSL#1\n"
+                 "ADD     R1, R1, R3,LSL#2\n"
+                 "MOV     R0, R6\n"
+                 "SUB     R1, R1, #8\n"
+                 "BL      sub_ffd1ff30\n"
+                 "B       loc_ffd246c8\n"
+ "loc_ffd2464c:\n"
+                 "LDR    R3, [SP,#4]\n"
+                 "LDR    R2, [R3]\n"
+                 "CMP    R2, #9\n"
+                 "BNE    loc_ffd24694\n"
+                 "MOV    R4, #0\n"
+                 "MOV    R1, #1\n"
+                 "MOV    R2, R1\n"
+                 "MOV    R3, R1\n"
+                 "MOV    R0, R4\n"
+                 "STR    R4, [SP]\n"
+                 "BL     sub_ffd1fe74\n"
+                 "MOV    R1, #1\n"
+                 "MOV    R0, R4\n"
+                 "MOV    R2, R1\n"
+                 "MOV    R3, R1\n"
+                 "STR    R4, [SP]\n"
+                 "BL     sub_ffd200cc\n"
+                 "B      loc_ffd246c8\n"
+ "loc_ffd24694:\n"
+                 "MOV    R4, #1\n"
+                 "MOV    R0, R4\n"
+                 "MOV    R1, R4\n"
+                 "MOV    R2, R4\n"
+                 "MOV    R3, R4\n"
+                 "STR    R4, [SP]\n"
+                 "BL     sub_ffd1fe74\n"
+                 "MOV    R0, R4\n"
+                 "MOV    R1, R0\n"
+                 "MOV    R2, R0\n"
+                 "MOV    R3, R0\n"
+                 "STR    R4, [SP]\n"
+                 "BL     sub_ffd200cc\n"
+
+ "loc_ffd246c8:\n"
+                 "LDR    R2, =0x2B030\n"
+                 "MOV    R3, #0\n"
+                 "LDR    R0, [SP,#4]\n"
+                 "STR    R3, [R2]\n"
+                 "BL     sub_ffd1f8d4\n"
+
+ "loc_ffd246dc:\n"
+                 "LDR     R3, =0x2AFD4\n"
+                 "MOV     R2, #0\n"
+                 "LDR     R0, [R3]\n"
+                 "MOV     R1, R7\n"
+                 "BL      sub_ffebd670\n"
+                 "LDR     R12, [SP,#4]\n"
+                 "LDR     R2, [R12]\n"
+                 "CMP     R2, #0x23\n"
+                 "BNE     loc_ffd241dc\n"
+                 "MOV     R0, R12\n"
+                 "BL      sub_ffd1f8d4\n"
+                 "LDR     R3, =0x2AFD0\n"
+                 "MOV     R1, #1\n"
+                 "LDR     R0, [R3]\n"
+                 "BL      sub_ffebcf58\n"
+                 "BL      sub_ffebec34\n" // ExitTask
+                 "ADD     SP, SP, #0x20\n"
+                 "LDMFD   SP!, {R4-R8,PC}\n"
+ );
+}
+
+void __attribute__((naked,noinline)) sub_ffd20ef4_my(){
+ asm volatile(
+                 "STMFD   SP!, {R4-R6,LR}\n"
+                 "LDR     R3, =0x2AFD0\n"
+                 "MOV     R4, R0\n"
+                 "MOV     R1, #0x3E\n"
+                 "LDR     R0, [R3]\n"
+                 "BL      sub_ffebd0f4\n"
+                 "MOV     R1, #0\n"
+                 "LDRSH   R0, [R4,#4]\n"
+                 "BL      sub_ffd1fa08\n"
+                 "MOV     R6, R0\n"
+                 "LDRSH   R0, [R4,#6]\n"
+                 "BL      sub_ffd1fbb4\n"
+                 "LDRSH   R0, [R4,#8]\n"
+                 "BL      sub_ffd1fc50\n"
+                 "LDRSH   R0, [R4,#0xA]\n"
+                 "BL      sub_ffd1fcec\n"
+                 "LDRSH   R0, [R4,#0xC]\n"
+                 "BL      sub_ffd1fd88\n"
+                 "LDR     R3, [R4]\n"
+                 "CMP     R3, #9\n"
+                 "MOV     R5, R0\n"
+                 "MOVEQ   R5, #0\n"
+                 "MOVEQ   R6, R5\n"
+                 "CMP     R6, #1\n"
+                 "BNE     loc_ffd20f78\n"
+                 "MOV     R2, #2\n"
+                 "LDRSH   R0, [R4,#4]\n"
+                 "LDR     R1, =0xFFD1F928\n"
+                 "BL      sub_ffe78208\n"
+                 "LDR     R2, =0x2B020\n"
+                 "MOV     R3, #0\n"
+                 "STR     R3, [R2]\n"
+                 "B       loc_ffd20f7c\n"
+ "loc_ffd20f78:\n"
+                 "BL      sub_ffd1fe24\n"
+ "loc_ffd20f7c:\n"
+                 "STRH    R0, [R4,#4]\n"
+                 "CMP     R5, #1\n"
+                 "BNE     loc_ffd20f9c\n"
+                 "LDRSH   R0, [R4,#0xC]\n"
+                 "LDR     R1, =0xFFD1F9EC\n"
+                 "MOV     R2, #0x20\n"
+                 "BL      sub_ffd20218\n"
+                 "B       loc_ffd20fa0\n"
+ "loc_ffd20f9c:\n"
+                 "BL      sub_ffd1fe64\n"
+ "loc_ffd20fa0:\n"
+                 "STRH    R0, [R4,#0xC]\n"
+                 "LDRSH   R0, [R4,#6]\n"
+                 "BL      sub_ffce9eb0_my\n"  // ------------->
+                 "LDRSH   R0, [R4,#8]\n"
+                 "MOV     R1, #1\n"
+                 "BL      sub_ffcec164\n"
+                 "ADD     R0, R4, #8\n"
+                 "MOV     R1, #0\n"
+                 "BL      sub_ffcec224\n"
+                 "LDRSH   R0, [R4,#0xE]\n"
+                 "BL      sub_ffd0e5d4\n"
+                 "CMP     R6, #1\n"
+                 "BNE     loc_ffd21004\n"
+                 "LDR     R3, =0x2AFD0\n"
+                 "MOV     R2, #0xBB0\n"
+                 "LDR     R0, [R3]\n"
+                 "MOV     R1, #2\n"
+                 "ADD     R2, R2, #8\n"
+                 "BL      sub_ffebcf48\n"
+                 "TST     R0, #1\n"
+                 "BEQ     loc_ffd21004\n"
+                 "MOV     R1, #0x4a0\n"
+                 "LDR     R0, =0xFFD1F880\n"
+                 "ADD     R1, R1, #3\n"
+                 "BL      sub_ffeca7b0\n"
+ "loc_ffd21004:\n"
+                 "CMP     R5, #1\n"
+                 "LDMNEFD SP!, {R4-R6,PC}\n"
+                 "LDR     R3, =0x2AFD0\n"
+                 "MOV     R2, #0xBB0\n"
+                 "LDR     R0, [R3]\n"
+                 "MOV     R1, #0x20\n"
+                 "ADD     R2, R2, #8\n"
+                 "BL      sub_ffebcf48\n"
+                 "TST     R0, #1\n"
+                 "LDMEQFD SP!, {R4-R6,PC}\n"
+                 "MOV     R1, #0x4A0\n"
+                 "LDR     R0, =0xFFD1F880\n"
+                 "ADD     R1, R1, #8\n"
+                 "LDMFD   SP!, {R4-R6,LR}\n"
+                 "B       sub_ffeca7b0\n"
+ );
+}
+
+void __attribute__((naked,noinline)) sub_ffce9eb0_my(){
+ asm volatile(
+                 "STMFD   SP!, {R4,LR}\n"
+                 "LDR     R3, =0x59FC\n"
+                 "LDR     R2, [R3]\n"
+                 "MOV     R1, #0x168\n"
+                 "MOV     R3, R0,LSL#16\n"
+                 "CMP     R2, #1\n"
+                 "ADD     R1, R1, #3\n"
+                 "LDR     R0, =0xFFCE96CC\n"
+                 "MOV     R4, R3,ASR#16\n"
+                 "BEQ     loc_FFCE9EDC\n"
+                 "BL      sub_ffeca7b0\n"
+ "loc_FFCE9EDC:\n"
+                 "MOV     R1, #0x170\n"
+                 "CMN     R4, #0xC00\n"
+                 "LDR     R3, =0x11B4E\n"
+                 "LDR     R0, =0xFFCE96CC\n"
+                 "ADD     R1, R1, #1\n"
+                 "LDREQSH R4, [R3]\n"
+                 "LDRNE   R3, =0x11B4E\n"
+                 "CMN     R4, #0xC00\n"
+                 "STRH    R4, [R3]\n"
+                 "BNE     loc_FFCE9F08\n"
+                 "BL      sub_ffeca7b0\n"
+ "loc_FFCE9F08:\n"
+                 "MOV     R0, R4\n"
+                 "BL      ExpTimeInMicroseconds\n"  //---------->
+                 "MOV     R4, R0\n"
+                 "BL      sub_FFD764E0\n"
+                 "MOV     R0, R4\n"
+                 "BL      sub_FFD8D908\n"
+                 "MOV     R1, #0x174\n"
+                 "TST     R0, #1\n"
+                 "ADD     R1, R1, #2\n"
+                 "LDR     R0, =0xFFCE96CC\n"
+                 "LDMEQFD SP!, {R4,PC}\n"
+                 "LDMFD   SP!, {R4,LR}\n"
+                 "B       sub_ffeca7b0\n"
+ );
+}
Index: platform/a570/sub/100e/stubs_entry_2.S
===================================================================
--- platform/a570/sub/100e/stubs_entry_2.S	(Revision 727)
+++ platform/a570/sub/100e/stubs_entry_2.S	(Arbeitskopie)
@@ -30,3 +30,4 @@
 NHSTUB(SetAE_ShutterSpeed, 0xFFE0B70C)
 NHSTUB(DoAFLock, 0xffea4bdc)
 NHSTUB(UnlockAF, 0xffea4c5c)
+NHSTUB(ExpTimeInMicroseconds, 0xffceb000)
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 727)
+++ makefile.inc	(Arbeitskopie)
@@ -1,7 +1,7 @@
 VER=CHDK
 
-PLATFORM=s3is
-PLATFORMSUB=100a
+#PLATFORM=s3is
+#PLATFORMSUB=100a
 
 #PLATFORM=a620
 #PLATFORMSUB=100f
@@ -114,8 +114,8 @@
 #PLATFORM=ixus80_sd1100
 #PLATFORMSUB=101a
 
-#PLATFORM=ixus950_sd850
-#PLATFORMSUB=100c
+PLATFORM=ixus950_sd850
+PLATFORMSUB=100c
 
 #PLATFORM=ixus55_sd450
 #PLATFORMSUB=100b
@@ -368,5 +368,5 @@
 	done
 
 ifdef SILENT
-.SILENT:
+
 endif
Index: core/gui_sokoban.c
===================================================================
--- core/gui_sokoban.c	(Revision 727)
+++ 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 727)
+++ 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/dng.c
===================================================================
--- core/dng.c	(Revision 727)
+++ 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/raw_merge.c
===================================================================
--- core/raw_merge.c	(Revision 727)
+++ core/raw_merge.c	(Arbeitskopie)
@@ -56,10 +56,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)) &&
@@ -216,7 +216,7 @@
     return;
 
   stat(filename,&st);
-  if (st.st_size!=hook_raw_size())
+  if ((long)st.st_size!=hook_raw_size())
     return;
 
   started();
Index: core/gui_lang.c
===================================================================
--- core/gui_lang.c	(Revision 727)
+++ 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/conf.c
===================================================================
--- core/conf.c	(Revision 727)
+++ 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.h
===================================================================
--- core/gui_lang.h	(Revision 727)
+++ 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 727)
+++ 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;
Index: core/edgeoverlay.c
===================================================================
--- core/edgeoverlay.c	(Revision 727)
+++ 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 727)
+++ 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 727)
+++ 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
@@ -113,6 +113,11 @@
 // forward declarations
 //-------------------------------------------------------------------
 extern void dump_memory();
+// both from platform/generic/shooting.c
+extern const char* tv_override[];
+extern const int tv_override_amount;
+extern const int tv_override_zero_shift;
+	     
 
 static void gui_draw_osd();
 
@@ -156,6 +161,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 +428,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
@@ -993,7 +1001,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)
@@ -1008,7 +1016,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];
@@ -1025,7 +1033,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))
@@ -1044,7 +1052,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];
@@ -1057,7 +1065,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);
@@ -1072,7 +1080,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];
@@ -1085,7 +1093,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) {
@@ -1104,7 +1112,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) {
@@ -1169,7 +1177,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];
@@ -1183,7 +1191,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];
@@ -1196,7 +1204,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];
@@ -1209,7 +1217,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];
@@ -1222,7 +1230,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];
@@ -1235,7 +1243,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];
@@ -1247,7 +1255,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];
@@ -1259,7 +1267,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];
@@ -1273,7 +1281,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];
@@ -1286,7 +1294,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];
@@ -1298,7 +1306,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];
@@ -1310,7 +1318,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];
@@ -1322,7 +1330,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];
@@ -1334,7 +1342,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];
@@ -1346,7 +1354,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];
@@ -1358,7 +1366,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];
@@ -1370,7 +1378,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];
@@ -1382,7 +1390,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];
@@ -1394,7 +1402,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];
@@ -1406,7 +1414,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];
@@ -1463,7 +1471,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];
@@ -1473,7 +1481,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];
 }
@@ -1486,7 +1494,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];
@@ -1513,7 +1521,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]; 
@@ -1525,7 +1533,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]; 
@@ -1537,7 +1545,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]; 
@@ -1549,7 +1557,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]; 
@@ -1561,7 +1569,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]; 
@@ -1581,7 +1589,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,17 +1597,23 @@
 }
 
 const char* gui_tv_override_value_enum(int change, int arg) {
-    static const char* modes[]={"64","50.8", "40.3", "32", "25.4","20","16", "12.7", "10","8", "6.3","5","4","3.2", "2.5","2", "1.6", "1.3", "1", "0.8", "0.6", "0.5", "0.4", "0.3", "1/4", "1/5", "1/6", "1/8", "1/10", "1/13", "1/15", "1/20", "1/25", "1/30", "1/40", "1/50", "1/60", "1/80", "1/100", "1/125", "1/160", "1/200", "1/250", "1/320", "1/400", "1/500", "1/640","1/800", "1/1000", "1/1250", "1/1600","1/2000","1/2500","1/3200","1/4000", "1/5000", "1/6400", "1/8000", "1/10000", "1/12500", "1/16000", "1/20000", "1/25000", "1/32000", "1/40000", "1/50000", "1/64000","1/80000", "1/100k"};
+	/*
+    static const char* modes[]={
+    // add very long time exposures as approximately powers of 2, adding 15 exposures
+    "2048","1625","1290","1024","812","645","512","406","322","256","203","161","128","101","80",
+		"64","50.8", "40.3", "32", "25.4","20","16", "12.7", "10","8", "6.3","5","4","3.2", "2.5","2", "1.6", "1.3", "1", "0.8", "0.6", "0.5", "0.4", "0.3", "1/4", "1/5", "1/6", "1/8", "1/10", "1/13", "1/15", "1/20", "1/25", "1/30", "1/40", "1/50", "1/60", "1/80", "1/100", "1/125", "1/160", "1/200", "1/250", "1/320", "1/400", "1/500", "1/640","1/800", "1/1000", "1/1250", "1/1600","1/2000","1/2500","1/3200","1/4000", "1/5000", "1/6400", "1/8000", "1/10000", "1/12500", "1/16000", "1/20000", "1/25000", "1/32000", "1/40000", "1/50000", "1/64000","1/80000", "1/100k"};
+		*/
     static char *buf;
 
+	// XXX This array above is redundant with platform/generic/shooting.c, this should be avoided!
     conf.tv_override_value+=change;
     if (conf.tv_enum_type) {
        if (conf.tv_override_value<0) {
-          conf.tv_override_value=sizeof(modes)/sizeof(modes[0])-1;
+          conf.tv_override_value=tv_override_amount-1;
         }
-       else if (conf.tv_override_value>=(sizeof(modes)/sizeof(modes[0])))
+       else if ((unsigned)conf.tv_override_value>=(tv_override_amount))
          conf.tv_override_value=0;
-       return modes[conf.tv_override_value]; 
+       return tv_override[conf.tv_override_value]; 
      }
      else 
       {
@@ -1620,12 +1634,12 @@
     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;	
 	  if (conf.tv_enum_type)  
-	     conf.tv_override_value=18; 
+	     conf.tv_override_value=tv_override_zero_shift;
 	  else conf.tv_override_value=1; 
       }
     return modes[conf.tv_enum_type]; 
@@ -1638,7 +1652,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]; 
@@ -1662,7 +1676,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]; 
@@ -1761,7 +1775,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];
@@ -1772,7 +1786,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; 
         } 
@@ -1781,7 +1795,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]; 
@@ -1793,7 +1807,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]); 
@@ -1801,7 +1815,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];
@@ -1826,7 +1840,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);
 }
@@ -1896,7 +1910,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]; 
@@ -1908,7 +1922,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]; 
@@ -1973,7 +1987,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;
@@ -2750,7 +2764,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++){
@@ -2964,7 +2979,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);
@@ -2993,7 +3008,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);
               }
@@ -3285,7 +3300,7 @@
 	char buf[64];
 	int i;
 	int p;
-	int c;
+	int c = 0;
 
 
 	if( initialized )
@@ -3325,4 +3340,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 727)
+++ 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 727)
+++ 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 727)
+++ 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 727)
+++ 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 727)
+++ 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_osd.c
===================================================================
--- core/gui_osd.c	(Revision 727)
+++ core/gui_osd.c	(Arbeitskopie)
@@ -13,6 +13,7 @@
 #include "gui_space.h"
 #include "gui_grid.h"
 #include "gui_osd.h"
+#include "math.h"
 
 //-------------------------------------------------------------------
 typedef struct {
@@ -49,7 +50,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 +125,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 +338,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_grid.c
===================================================================
--- core/gui_grid.c	(Revision 727)
+++ 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_fselect.c
===================================================================
--- core/gui_fselect.c	(Revision 727)
+++ 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_batt.c
===================================================================
--- core/gui_batt.c	(Revision 727)
+++ 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 727)
+++ core/luascript.c	(Arbeitskopie)
@@ -229,7 +229,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_mastermind.c
===================================================================
--- core/gui_mastermind.c	(Revision 727)
+++ core/gui_mastermind.c	(Arbeitskopie)
@@ -100,8 +100,8 @@
 	colors[1]=0x55;
 	colors[2]=0x22;
 	colors[3]=0x66;
-	colors[4]=0x88;
-	colors[5]=0xD2;
+	colors[4]=0x99;
+	colors[5]=0x2F;
 	curr_color[0]=0;
 	curr_color[1]=0;
 	curr_color[2]=0;
Index: core/gui_mbox.c
===================================================================
--- core/gui_mbox.c	(Revision 727)
+++ 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 727)
+++ 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 727)
+++ 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;
@@ -106,6 +122,7 @@
 #ifdef OPT_EDGEOVERLAY
     mkdir("A/CHDK/EDGE");
 #endif
+
     auto_started = 0;
 
     if (conf.script_startup==1) script_autostart();				// remote autostart
@@ -133,6 +150,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 727)
+++ 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 727)
+++ version.inc	(Arbeitskopie)
@@ -1 +1 @@
-BUILD_NUMBER := 0.9.7
+BUILD_NUMBER := 0.9.7-p0
Index: tools/packfi2/makefile.inc.new
===================================================================
--- tools/packfi2/makefile.inc.new	(Revision 0)
+++ tools/packfi2/makefile.inc.new	(Revision 0)
@@ -0,0 +1,27 @@
+
+
+OBJS:=fi2enc.o aes128.o compress.o deflate.o crc32.o zutil.o adler32.o trees.o
+OBJS:=$(call subdirize,$(OBJS))
+
+
+%.o: %.c
+	@echo $< \-\> $@
+	$(HOSTCC) $(HOSTCFLAGS) -DPLATFORMOS_$(PLATFORMOS) -c -o $@ $<
+
+.dep/%.d: %.c .dep
+	$(HOSTCC) $(HOSTCFLAGS) -MM $< > $@.$$$$; \
+	    sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
+	    rm -f $@.$$$$
+
+fi2enc$(EXE): $(OBJS)
+	@echo $< \-\> $@
+	$(HOSTCC) $(HOSTCFLAGS) -o $@ $^
+
+clean:
+	rm -f fi2enc$(EXE) $(OBJS)
+
+distclean: clean
+
+include $(topdir)bottom.inc
+
+# vim: filetype=make
Index: tools/makefile.inc.new
===================================================================
--- tools/makefile.inc.new	(Revision 0)
+++ tools/makefile.inc.new	(Revision 0)
@@ -0,0 +1,59 @@
+
+LOCAL_SUBDIRS := packfi2
+LOCAL_SUBDIRS:=$(call subdirize,$(LOCAL_SUBDIRS) )
+$(foreach subdir,$(LOCAL_SUBDIRS),$(eval include $(subdir)/makefile.inc.new) )
+
+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)/loader-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: 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/makefile_resetcode.inc.new
===================================================================
--- loader/makefile_resetcode.inc.new	(Revision 0)
+++ loader/makefile_resetcode.inc.new	(Revision 0)
@@ -0,0 +1,32 @@
+
+# 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)
+
+ASM_OBJS:=entry.o
+C_OBJS:=main.o
+C_OBJS:=$(call subdirize, $(C_OBJS) )
+ASM_OBJS:=$(call subdirize, $(ASM_OBJS) )
+OBJS:=$(ASM_OBJS) $(C_OBJS)
+
+$(eval $(call compile-asm-targets, $(ASM_OBJS),,))
+$(eval $(call compile-targets, $(C_OBJS),,))
+
+$(eval $(call gen-rule, $(subdir)/resetcode-main.bin, $(subdir)/main.elf, \
+	$(OBJDUMP) -z -d $(subdir)/main.elf > $(subdir)/main.dump; \
+	$(OBJCOPY) -O binary $(subdir)/main.elf $(subdir)/resetcode-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)/resetcode-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)/resetcode-main.bin $(subdir)/main.elf $(subdir)/main.dump $(subdir)/main.elf.syms ))
+
+# 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/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/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/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/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/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/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/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 727)
+++ 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/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), $(RESET_FILE) $(CORE_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)/loader-main.elf > $(subdir)/loader-main.dump; \
+	$(OBJCOPY) -O binary $(subdir)/loader-main.elf $(subdir)/loader-main.bin ))
+
+$(eval $(call gen-rule, loader-main.elf, $(OBJS), \
+	$(SILENCE)$(CC) $(CFLAGS) -o $(subdir)/loader-main.elf $(OBJS) $(LDLIBS) $(LDFLAGS) $(LOADER_LDOPTS); \
+	( $(NM) $(subdir)/loader-main.elf | grep ' U ' > $(subdir)/loader-main.elf.syms ) && exit 1 || exit 0 ) )
+
+$(eval $(call gen-rule, $(PLATFORM)-loader-clean, resetcode-$(PLATFORM)-loader-clean, rm -f $(OBJS) $(subdir)/*.$(DEPSUFFIX) $(subdir)/loader-main.bin $(subdir)/loader-main.elf $(subdir)/loader-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: 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 727)
+++ 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 727)
+++ 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: 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
   + *

