Index: /trunk/platform/a495/kbd.c
===================================================================
--- /trunk/platform/a495/kbd.c	(revision 1198)
+++ /trunk/platform/a495/kbd.c	(revision 1198)
@@ -0,0 +1,381 @@
+#include "lolevel.h"
+#include "platform.h"
+#include "core.h"
+#include "conf.h"
+#include "keyboard.h"
+
+typedef struct {
+    short grp;
+    short hackkey;
+    long canonkey;
+} KeyMap;
+
+
+static long kbd_new_state[3];
+static long kbd_prev_state[3];
+static long kbd_mod_state[3];
+
+static long last_kbd_key = 0;
+static int usb_power=0;
+static int remote_key, remote_count;
+static int shoot_counter=0;
+extern void _platformsub_kbd_fetch_data(long*);
+
+#define DELAY_TIMEOUT 10000
+
+#define KEYS_MASK0 (0x00020000)
+#define KEYS_MASK1 (0x00000000)
+#define KEYS_MASK2 (0x017001f4)
+
+#define SD_READONLY_FLAG (0x40000)
+#define USB_MASK (0x80000)
+#define USB_REG 2
+
+
+static KeyMap keymap[] = {
+    /* tiny bug: key order matters. see kbd_get_pressed_key()
+    * for example
+    */
+
+    //{ 0, KEY_DISPLAY  , 0x00020000 }, // Playback
+    { 0, KEY_PRINT      , 0x00020000 }, // Playback
+
+    { 2, KEY_SHOOT_FULL , 0x00000030 }, // ? 0x00000010(KEY_SHOOT_HALF) + 0x00000030 (KEY_SHOOT_FULL)
+    { 2, KEY_SHOOT_HALF , 0x00000010 },
+    
+    { 2, KEY_UP         , 0x00100000 },
+    { 2, KEY_DOWN       , 0x00200000 },
+    { 2, KEY_LEFT       , 0x00400000 },
+    { 2, KEY_RIGHT      , 0x00000004 },
+    { 2, KEY_SET        , 0x00000100 },
+    { 2, KEY_ZOOM_IN    , 0x00000080 },
+    { 2, KEY_ZOOM_OUT   , 0x00000040 },
+    { 2, KEY_MENU       , 0x01000000 },
+    { 0, 0, 0 }
+};
+
+
+long __attribute__((naked)) wrap_kbd_p1_f() ;
+
+void wait_until_remote_button_is_released(void) {
+    int count1;
+    int count2;
+    int tick,tick2,tick3;
+    int nSW;
+    int prev_usb_power,cur_usb_power;
+    static int nMode;
+
+    asm volatile ("STMFD SP!, {R0-R11,LR}\n");   // store R0-R11 and LR in stack
+
+    //debug_led(1);
+    tick = get_tick_count();
+    tick2 = tick;
+    static long usb_physw[3];
+    if (conf.synch_enable && conf.ricoh_ca1_mode && conf.remote_enable && (!shooting_get_drive_mode()|| (shooting_get_drive_mode()==1) || ((shooting_get_drive_mode()==2) && state_shooting_progress != SHOOTING_PROGRESS_PROCESSING)))
+    //if (conf.synch_enable && conf.ricoh_ca1_mode && conf.remote_enable && (!shooting_get_drive_mode()|| ((shooting_get_drive_mode()==2) && state_shooting_progress != SHOOTING_PROGRESS_PROCESSING)))   // synch mode enable so wait for USB to disconnect
+    {
+        // ------ add by Masuji SUTO (start) --------------
+        nMode = 0;
+        usb_physw[2] = 0;   // makes sure USB bit is cleared.
+        _kbd_read_keys_r2(usb_physw);
+        if((usb_physw[2] & USB_MASK)==USB_MASK) nMode=1;
+        // ------ add by Masuji SUTO (end)   --------------
+        if(conf.ricoh_ca1_mode && conf.remote_enable) {
+            if(shooting_get_drive_mode() == 1 && state_shooting_progress == SHOOTING_PROGRESS_PROCESSING) {   //continuous-shooting mode
+                if(conf.bracket_type>2) {
+                    if(shoot_counter<2) shutter_int=3;
+                    shoot_counter--;
+                } else {
+                    prev_usb_power=0;
+                    nSW = 0;
+                    do {
+                        usb_physw[2] = 0;   // makes sure USB bit is cleared.
+                        _kbd_read_keys_r2(usb_physw);
+                        cur_usb_power = (usb_physw[2] & USB_MASK)==USB_MASK;
+                        if(cur_usb_power) {
+                            if(!prev_usb_power) {
+                                tick2 = get_tick_count();
+                                prev_usb_power=cur_usb_power;
+                            } else {
+                                if((int)get_tick_count()-tick2>1000) {debug_led(0);}
+                            }
+                        } else {
+                            if(prev_usb_power) {
+                                tick3 = (int)get_tick_count()-tick2;
+                                if(nSW==10) {
+                                    if(tick3>50) shutter_int=1;
+                                        nSW=20;
+                                }
+                                if(nSW==0 && tick3>0) {
+                                    if(tick3<50) {
+                                    nSW=10;
+                                    } else {
+                                        if(tick3>1000) shutter_int=1;
+                                            nSW=20;
+                                    }
+                                }
+                                prev_usb_power=cur_usb_power;
+                            }
+                        }
+                        if((int)get_tick_count()-tick >= DELAY_TIMEOUT) { nSW=20;shutter_int=2; }
+                    }
+                    while(nSW<20);
+                }
+            }   // continuous-shooting mode
+            else {   //nomal mode
+                shoot_counter=0;
+                if(conf.bracket_type>2) {
+                    shoot_counter=(conf.bracket_type-2)*2;
+                }
+                do {
+                    usb_physw[2] = 0;    // makes sure USB bit is cleared.
+                    _kbd_read_keys_r2(usb_physw);
+                }
+                //while(((usb_physw[2] & USB_MASK)==USB_MASK) && ((int)get_tick_count()-tick < DELAY_TIMEOUT));
+                while (((((usb_physw[2] & USB_MASK)!=USB_MASK) && (nMode==0)) || (((usb_physw[2] & USB_MASK)==USB_MASK) && (nMode==1))) && ((int)get_tick_count()-tick < DELAY_TIMEOUT));
+            }
+        } else {
+            do {
+                usb_physw[2] = 0;   // makes sure USB bit is cleared.
+               _kbd_read_keys_r2(usb_physw);
+            }
+           while ((usb_physw[2]&USB_MASK) && ((int)get_tick_count()-tick < DELAY_TIMEOUT));
+        }
+    }
+
+    if (conf.synch_delay_enable && conf.synch_delay_value>0) {   // if delay is switched on and greater than 0
+        for (count1=0;count1<conf.synch_delay_value+(conf.synch_delay_coarse_value*1000);count1++) {   // wait delay_value * 0.1ms
+            for (count2=0;count2<1400;count2++) {   // delay approx. 0.1ms
+            }
+        }
+    }
+
+    //debug_led(0);
+    asm volatile ("LDMFD SP!, {R0-R11,LR}\n");   // restore R0-R11 and LR from stack
+}
+
+
+
+
+static void __attribute__((noinline)) mykbd_task_proceed()
+{
+	while (physw_run){
+		_SleepTask(10);
+		
+		if (wrap_kbd_p1_f() == 1){ // autorepeat ?
+			_kbd_p2_f();
+		}
+	}
+}
+
+void __attribute__((naked,noinline)) mykbd_task()
+{
+	mykbd_task_proceed();
+	_ExitTask();
+}
+
+
+long __attribute__((naked,noinline)) wrap_kbd_p1_f()
+{
+	asm volatile(
+			"STMFD   SP!, {R1-R5,LR}\n"
+			"MOV     R4, #0\n"
+			//"BL      _kbd_read_keys\n"       // replaces kbd_fetch_data()
+			"BL      my_kbd_read_keys\n"     // +
+			"B       _kbd_p1_f_cont\n"       // continue
+	);
+	
+	return 0; // shut up the compiler
+}
+
+
+void my_kbd_read_keys()
+{
+	// If script are running, replace PRINT button with DISPLAY
+	if (state_kbd_script_run) {
+		int i;
+		for (i=0; keymap[i].hackkey; i++) {
+			if (keymap[i].hackkey == KEY_PRINT) {
+				keymap[i].hackkey = KEY_DISPLAY;
+				break;
+			}
+		}
+	} else {
+		int i;
+		for (i=0; keymap[i].hackkey; i++) {
+			if (keymap[i].hackkey == KEY_DISPLAY) {
+				keymap[i].hackkey = KEY_PRINT;
+				break;
+			}
+		}
+	}
+	
+	kbd_prev_state[0] = kbd_new_state[0];
+	//kbd_prev_state[1] = kbd_new_state[1];
+	kbd_prev_state[2] = kbd_new_state[2];
+	
+	asm volatile(
+        "BL      _kbd_read_keys\n"
+	);
+	
+	//_platformsub_kbd_fetch_data(kbd_new_state);
+	kbd_new_state[0] = physw_status[0];
+	kbd_new_state[1] = physw_status[1];
+	kbd_new_state[2] = physw_status[2];
+	
+	if (kbd_process() == 0){
+		// leave it alone...
+	} else {
+        // override keys
+        physw_status[0] = (kbd_new_state[0] | KEYS_MASK0) & (~KEYS_MASK0 | kbd_mod_state[0]);
+        //physw_status[1] = (kbd_new_state[1] | KEYS_MASK1) & (~KEYS_MASK1 | kbd_mod_state[1]);
+        physw_status[2] = (kbd_new_state[2] | KEYS_MASK2) & (~KEYS_MASK2 | kbd_mod_state[2]);
+	}
+	
+	//_kbd_read_keys_r2(physw_status);
+
+	remote_key = (physw_status[2] & USB_MASK) == USB_MASK;
+	if (remote_key)
+		remote_count += 1;
+	else if (remote_count) {
+		usb_power = remote_count;
+		remote_count = 0;
+	}
+	
+	if (conf.remote_enable) {
+		physw_status[2] = physw_status[2] & ~(SD_READONLY_FLAG | USB_MASK);
+	} else {
+		physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG;
+	}
+}
+
+
+
+/****************/
+
+void kbd_key_press(long key)
+{
+	int i;
+	for (i=0;keymap[i].hackkey;i++){
+		if (keymap[i].hackkey == key){
+			kbd_mod_state[keymap[i].grp] &= ~keymap[i].canonkey;
+			return;
+		}
+	}
+}
+
+void kbd_key_release(long key)
+{
+	int i;
+	for (i=0;keymap[i].hackkey;i++){
+		if (keymap[i].hackkey == key){
+			kbd_mod_state[keymap[i].grp] |= keymap[i].canonkey;
+			return;
+		}
+	}
+}
+
+void kbd_key_release_all()
+{
+	kbd_mod_state[0] |= KEYS_MASK0;
+	kbd_mod_state[1] |= KEYS_MASK1;
+	kbd_mod_state[2] |= KEYS_MASK2 & ~0x01700000;
+}
+
+long kbd_is_key_pressed(long key)
+{
+	int i;
+	for (i=0;keymap[i].hackkey;i++){
+		if (keymap[i].hackkey == key){
+			switch (keymap[i].hackkey) {
+			case KEY_UP: case KEY_DOWN: case KEY_LEFT: case KEY_MENU:
+				return ((kbd_new_state[keymap[i].grp] & keymap[i].canonkey) == 0) ? 0:1;
+			default:
+				return ((kbd_new_state[keymap[i].grp] & keymap[i].canonkey) == 0) ? 1:0;
+			}
+		}
+	}
+	return 0;
+}
+
+long kbd_is_key_clicked(long key)
+{
+	int i;
+	for (i=0;keymap[i].hackkey;i++){
+		if (keymap[i].hackkey == key){
+			return ((kbd_prev_state[keymap[i].grp] & keymap[i].canonkey) != 0) &&
+				   ((kbd_new_state[keymap[i].grp] & keymap[i].canonkey) == 0);
+		}
+	}
+	return 0;
+}
+
+long kbd_get_pressed_key()
+{
+	int i;
+	for (i=0;keymap[i].hackkey;i++){
+		if (kbd_is_key_pressed(keymap[i].hackkey)) {
+			return keymap[i].hackkey;
+		}
+	}
+	return 0;
+}
+
+long kbd_get_clicked_key()
+{
+	int i;
+	for (i=0;keymap[i].hackkey;i++){
+		if (((kbd_prev_state[keymap[i].grp] & keymap[i].canonkey) != 0) &&
+			((kbd_new_state[keymap[i].grp] & keymap[i].canonkey) == 0)) {
+			return keymap[i].hackkey;
+		}
+	}
+	return 0;
+}
+
+
+void kbd_reset_autoclicked_key() {
+	last_kbd_key = 0;
+}
+
+long kbd_get_autoclicked_key() {
+	static long last_kbd_time = 0, press_count = 0;
+	register long key, t;
+	
+	key=kbd_get_clicked_key();
+	if (key) {
+		last_kbd_key = key;
+		press_count = 0;
+		last_kbd_time = get_tick_count();
+		return key;
+	} else {
+		if (last_kbd_key && kbd_is_key_pressed(last_kbd_key)) {
+			t = get_tick_count();
+			if (t-last_kbd_time>((press_count)?175:500)) {
+				++press_count;
+				last_kbd_time = t;
+				return last_kbd_key;
+			} else {
+				return 0;
+			}
+		} else {
+			last_kbd_key = 0;
+			return 0;
+		}
+	}
+}
+
+
+int get_usb_power(int edge)
+{
+	int x;
+
+	if (edge) return remote_key;
+	x = usb_power;
+	usb_power = 0;
+	return x;
+}
+
+long kbd_use_zoom_as_mf() {
+	return 0;
+}
Index: /trunk/platform/a495/platform_camera.h
===================================================================
--- /trunk/platform/a495/platform_camera.h	(revision 1198)
+++ /trunk/platform/a495/platform_camera.h	(revision 1198)
@@ -0,0 +1,82 @@
+// Camera - a495 - platform_camera.h
+
+// This file contains the various settings values specific to the a495 camera.
+// This file is referenced via the 'include/camera.h' file and should not be loaded directly.
+
+// If adding a new settings value put a suitable default in 'include/camera.h',
+// along with documentation on what the setting does and how to determine the correct value.
+// If the setting should not have a default value then add it in 'include/camera.h'
+// using the '#undef' directive along with appropriate documentation.
+
+// Override any default values with your camera specific values in this file. Try and avoid
+// having override values that are the same as the default value.
+
+// When overriding a setting value there are two cases:
+// 1. If removing the value, because it does not apply to your camera, use the '#undef' directive.
+// 2. If changing the value it is best to use an '#undef' directive to remove the default value
+//    followed by a '#define' to set the new value.
+
+// When porting CHDK to a new camera, check the documentation in 'include/camera.h'
+// for information on each setting. If the default values are correct for your camera then
+// don't override them again in here.
+
+    #define CAM_PROPSET                     3
+    #define CAM_DRYOS                       1
+    #define CAM_DRYOS_2_3_R39               1
+
+    #define CAM_RAW_ROWPIX                  3720
+    #define CAM_RAW_ROWS                    2772
+
+    #undef  CAM_USE_ZOOM_FOR_MF
+    #undef  CAM_HAS_ERASE_BUTTON
+    #undef  CAM_HAS_IRIS_DIAPHRAGM
+    #define CAM_SHOW_OSD_IN_SHOOT_MENU      1
+    #define CAM_HAS_ND_FILTER               1
+    #undef  CAM_HAS_MANUAL_FOCUS
+    #undef  CAM_HAS_USER_TV_MODES
+    #undef  CAM_HAS_IS
+    #define CAM_MULTIPART                   1
+    #undef  CAM_VIDEO_CONTROL
+    #define CAM_REAR_CURTAIN                1
+    #undef  DEFAULT_RAW_EXT
+    #define DEFAULT_RAW_EXT                 2   // use .CR2
+    #define CAM_EXT_TV_RANGE                1
+    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
+    #define CAM_CAN_MUTE_MICROPHONE         1
+    #define CAM_EV_IN_VIDEO                 1
+
+    #undef CAM_BITMAP_PALETTE
+    #define CAM_BITMAP_PALETTE              8
+
+    // pattern
+    #define cam_CFAPattern                  0x02010100 // Red  Green  Green  Blue
+    // color
+
+    #define CAM_COLORMATRIX1                               \
+      827547, 1000000, -290458, 1000000, -126086, 1000000, \
+     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
+      5181,   1000000, 48183,   1000000, 245014,  1000000
+
+    #define cam_CalibrationIlluminant1      1   // Daylight
+    // cropping
+    #define CAM_JPEG_WIDTH                  3648
+    #define CAM_JPEG_HEIGHT                 2736
+    #define CAM_ACTIVE_AREA_X1              6
+    #define CAM_ACTIVE_AREA_Y1              12
+    #define CAM_ACTIVE_AREA_X2              3690
+    #define CAM_ACTIVE_AREA_Y2              2772
+
+    // camera name
+    #define PARAM_CAMERA_NAME               4   // parameter number for GetParameterData to get camera name
+    #undef  CAM_SENSOR_BITS_PER_PIXEL
+    #undef  CAM_WHITE_LEVEL
+    #undef  CAM_BLACK_LEVEL
+    #define CAM_SENSOR_BITS_PER_PIXEL       12
+    #define CAM_WHITE_LEVEL                 ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
+    #define CAM_BLACK_LEVEL                 127
+
+	#define CAM_STARTUP_CRASH_FILE_OPEN_FIX    1     // enable workaround for camera crash at startup when opening the conf / font files
+                                                    // see http://chdk.setepontos.com/index.php?topic=6179.0
+
+    #define CAM_DATE_FOLDER_NAMING          0x100 //Value found in the last function, which is called in GetImageFolder. (first compare)
+//----------------------------------------------------------
Index: /trunk/platform/a495/wrappers.c
===================================================================
--- /trunk/platform/a495/wrappers.c	(revision 1198)
+++ /trunk/platform/a495/wrappers.c	(revision 1198)
@@ -0,0 +1,16 @@
+#include "../generic/wrappers.c"
+
+long lens_get_focus_pos()
+{
+    return _GetFocusLensSubjectDistance();
+}
+
+long lens_get_focus_pos_from_lens()
+{
+    return _GetFocusLensSubjectDistanceFromLens(); 
+}
+
+long lens_get_target_distance()
+{
+    return _GetCurrentTargetDistance();
+}
Index: /trunk/platform/a495/main.c
===================================================================
--- /trunk/platform/a495/main.c	(revision 1198)
+++ /trunk/platform/a495/main.c	(revision 1198)
@@ -0,0 +1,63 @@
+#include "lolevel.h"
+#include "platform.h"
+#include "core.h"
+#include "keyboard.h"
+
+
+extern long link_bss_start;
+extern long link_bss_end;
+extern void boot();
+
+
+void startup()
+{
+    long *bss = &link_bss_start;
+    long *ptr;
+
+    // sanity check
+    if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)){
+        started();
+        shutdown();
+    }
+
+    // initialize .bss senment
+    while (bss<&link_bss_end)
+        *bss++ = 0;
+
+    boot();
+}
+
+// TODO: Check focal length table
+static const int fl_tbl[] = {6600, 8060, 9840, 12050, 14800, 17550, 21600};
+#define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0]))
+#define CF_EFL 56481L
+
+const int zoom_points = NUM_FL;
+
+int get_effective_focal_length(int zp) {
+    return (CF_EFL*get_focal_length(zp))/10000;
+}
+
+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 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 return fl_tbl[zp]*10/fl_tbl[0];
+}
+
+// TODO: is battery v min/max ok?
+long get_vbatt_min()
+{
+    return 2300;
+}
+
+long get_vbatt_max()
+{
+    return 2550;
+}
+
Index: /trunk/platform/a495/notes.txt
===================================================================
--- /trunk/platform/a495/notes.txt	(revision 1198)
+++ /trunk/platform/a495/notes.txt	(revision 1198)
@@ -0,0 +1,8 @@
+- press "mode" key shortly for enter/exit <alt mode>, press "mode" key longer for original function
+- press playback (>) key in CHDK menus as disp/erase button
+- Map KEY_PRINT to KEY_PLAYBACK when running script and change back when script isn't running
+- for manual focus using zoom lever when half press shoot button
+
+TODO:
+
+- lua lib os/io not full working
Index: /trunk/platform/a495/lib.c
===================================================================
--- /trunk/platform/a495/lib.c	(revision 1198)
+++ /trunk/platform/a495/lib.c	(revision 1198)
@@ -0,0 +1,77 @@
+#include "platform.h"
+#include "lolevel.h"
+
+// only two LEDs in A495:
+#define LED_PR 0xC0220088  // green LED
+#define LED_AF 0xC0220080  // orange AF LED
+
+
+void shutdown()
+{
+    volatile long *p = (void*)LED_PR;    // Green LED
+
+    asm(
+        "MRS     R1, CPSR\n"
+        "AND     R0, R1, #0x80\n"
+        "ORR     R1, R1, #0x80\n"
+        "MSR     CPSR_cf, R1\n"
+        :::"r1","r0");
+
+    *p = 0x44;  // power off.
+
+    while(1);
+}
+
+
+void debug_led(int state)
+{
+    *(int*)LED_PR=state ? 0x46 : 0x44;
+}
+
+void camera_set_led(int led, int state, int bright) {
+    long val = state ? 0x46 : 0x44;
+    switch ( led )
+    {
+    default:
+        *(int*)LED_PR = val;
+    }
+}
+
+void vid_bitmap_refresh() {
+    extern int enabled_refresh_physical_screen;
+    extern int full_screen_refresh;
+
+    // asm1989: i've tried refreshphysical screen (screen unlock) and that caused the canon and
+    // function menu to not display at all. This seems to work and is called in a similar
+    // way in other places where original OSD should be refreshed.
+    extern void _LockAndRefresh();   // wrapper function for screen lock
+    extern void _UnlockAndRefresh();   // wrapper function for screen unlock
+
+    _LockAndRefresh();
+
+    enabled_refresh_physical_screen=1;
+    full_screen_refresh=3;   // found in ScreenUnlock underneath a CameraLog.c call
+
+    _UnlockAndRefresh();
+}
+
+// Near "PropertyTableManagerCore.c" ROM:FFD2ED94
+int get_flash_params_count(void){
+    return 0x74; 
+}
+
+
+/*void vid_turn_off_updates()
+{
+    extern void _LockAndRefresh();   // wrapper function for screen lock
+
+    _LockAndRefresh();
+}
+
+void vid_turn_on_updates()
+{
+    extern void _UnlockAndRefresh();   // wrapper function for screen unlock
+
+    //_RefreshPhysicalScreen(1);
+    _UnlockAndRefresh();
+}*/
Index: /trunk/platform/a495/sub/100d/capt_seq.c
===================================================================
--- /trunk/platform/a495/sub/100d/capt_seq.c	(revision 1198)
+++ /trunk/platform/a495/sub/100d/capt_seq.c	(revision 1198)
@@ -0,0 +1,887 @@
+#include "lolevel.h"
+#include "platform.h"
+#include "core.h"
+#include "conf.h"
+
+static long *nrflag = (long*)0x5828;	// ??? ROM:FFD10EE0 "ShutterSoundTask"
+
+#include "../../../generic/capt_seq.c"
+
+// ROM:FFC59274 task_CaptSeqTask()
+
+void __attribute__((naked,noinline)) capt_seq_task() {
+	asm volatile (
+"	STMFD	SP!, {R3-R7,LR} \n"                
+"	LDR	R7, =0x33324 \n"                     
+"	LDR	R6, =0x26C0 \n"                      
+"loc_FFC59230:\n"
+"	LDR	R0, [R6, #4] \n"                     
+"	MOV	R2, #0 \n"                           
+"	MOV	R1, SP \n"                           
+"	BL	sub_FFC28AA0 \n"                      
+"	TST	R0, #1 \n"                           
+"	BEQ	loc_FFC5925C \n"                     
+"	LDR	R1, =0x5B4 \n"                       
+"	LDR	R0, =0xFFC58E30 \n"                  
+"	BL	sub_FFC0F680 \n"                      
+"	BL	sub_FFC0F438 \n"                      
+"	LDMFD	SP!, {R3-R7,PC} \n"                
+"loc_FFC5925C:\n"
+"	LDR	R0, [SP] \n"                         
+"	LDR	R1, [R0] \n"                         
+"	CMP	R1, #0x1D \n"                        
+"	ADDLS	PC, PC, R1, LSL #2 \n"             
+"	B	loc_FFC5946C \n"                       
+"	B	loc_FFC592E8 \n"                       
+"	B	loc_FFC592F0 \n"                       
+"	B	loc_FFC59318 \n"                       
+"	B	loc_FFC5932C \n"                       
+"	B	loc_FFC59324 \n"                       
+"	B	loc_FFC59334 \n"                       
+"	B	loc_FFC5933C \n"                       
+"	B	loc_FFC59348 \n"                       
+"	B	loc_FFC593A0 \n"                       
+"	B	loc_FFC5932C \n"                       
+"	B	loc_FFC593A8 \n"                       
+"	B	loc_FFC593B4 \n"                       
+"	B	loc_FFC593BC \n"                       
+"	B	loc_FFC593C4 \n"                       
+"	B	loc_FFC593CC \n"                       
+"	B	loc_FFC593D4 \n"                       
+"	B	loc_FFC593DC \n"                       
+"	B	loc_FFC593E4 \n"                       
+"	B	loc_FFC593F0 \n"                       
+"	B	loc_FFC593F8 \n"                       
+"	B	loc_FFC59400 \n"                       
+"	B	loc_FFC59408 \n"                       
+"	B	loc_FFC59410 \n"                       
+"	B	loc_FFC5941C \n"                       
+"	B	loc_FFC59424 \n"                       
+"	B	loc_FFC5942C \n"                       
+"	B	loc_FFC59434 \n"                       
+"	B	loc_FFC5943C \n"                       
+"	B	loc_FFC59448 \n"                       
+"	B	loc_FFC59478 \n"                       
+"loc_FFC592E8:\n"
+"	BL	sub_FFC59B04 \n"              
+"	BL      shooting_expo_param_override\n"      // +        
+"	B	loc_FFC59340 \n"                       
+"loc_FFC592F0:\n"
+"	MOV	R0, #0xC \n"                         
+"	BL	sub_FFC5D7E0 \n"                      
+"	TST	R0, #1 \n"                           
+"	LDR	R0, [SP] \n"                         
+"	MOVNE	R1, #1 \n"                         
+"	LDRNE	R2, [R0, #0xC] \n"                 
+"	MOVNE	R0, #1 \n"                         
+"	BNE	loc_FFC59398 \n"                     
+"	BL	sub_FFC59598_my\n"  //--------->                    
+"	B	loc_FFC59478 \n"                       
+"loc_FFC59318:\n"
+"	MOV	R0, #1 \n"                           
+"	BL	sub_FFC59D8C \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC59324:\n"
+"	BL	sub_FFC59770 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC5932C:\n"
+"	BL	sub_FFC59AE4 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC59334:\n"
+"	BL	sub_FFC59AEC \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC5933C:\n"
+"	BL	sub_FFC59C9C \n"                      
+"loc_FFC59340:\n"
+"	BL	sub_FFC5753C \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC59348:\n"
+"	LDR	R4, [R0, #0xC] \n"                   
+"	BL	sub_FFC59AF4 \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD0FDE0 \n"                      
+"	TST	R0, #1 \n"                           
+"	MOV	R5, R0 \n"                           
+"	BNE	loc_FFC59388 \n"                     
+"	BL	sub_FFC696BC \n"                      
+"	STR	R0, [R4, #0x18] \n"                  
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD10D54 \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD110F4 \n"                      
+"	MOV	R5, R0 \n"                           
+"	LDR	R0, [R4, #0x18] \n"                  
+"	BL	sub_FFC698F4 \n"                      
+"loc_FFC59388:\n"
+"	BL	sub_FFC59AE4 \n"                      
+"	MOV	R2, R4 \n"                           
+"	MOV	R1, #9 \n"                           
+"	MOV	R0, R5 \n"                           
+"loc_FFC59398:\n"
+"	BL	sub_FFC57934 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC593A0:\n"
+"	BL	sub_FFC59D04 \n"                      
+"	B	loc_FFC59340 \n"                       
+"loc_FFC593A8:\n"
+"	LDR	R0, [R7, #0x4C] \n"                  
+"	BL	sub_FFC5A0A8 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC593B4:\n"
+"	BL	sub_FFC5A358 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC593BC:\n"
+"	BL	sub_FFC5A3EC \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC593C4:\n"
+"	BL	sub_FFD1000C \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC593CC:\n"
+"	BL	sub_FFD10204 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC593D4:\n"
+"	BL	sub_FFD10298 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC593DC:\n"
+"	BL	sub_FFD10358 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC593E4:\n"
+"	MOV	R0, #0 \n"                           
+"	BL	sub_FFD10550 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC593F0:\n"
+"	BL	sub_FFD106A0 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC593F8:\n"
+"	BL	sub_FFD10730 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC59400:\n"
+"	BL	sub_FFD107F0 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC59408:\n"
+"	BL	sub_FFC59EE8 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC59410:\n"
+"	BL	sub_FFC59F24 \n"                      
+"	BL	sub_FFC26C78 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC5941C:\n"
+"	BL	sub_FFD10424 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC59424:\n"
+"	BL	sub_FFD10468 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC5942C:\n"
+"	BL	sub_FFC5C020 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC59434:\n"
+"	BL	sub_FFC5C0A0 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC5943C:\n"
+"	BL	sub_FFC5C0FC \n"                      
+"	BL	sub_FFC5C0BC \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC59448:\n"
+"	LDRH	R0, [R7, #0x8C] \n"                 
+"	CMP	R0, #4 \n"                           
+"	LDRNEH	R0, [R7] \n"                      
+"	SUBNE	R12, R0, #0x8200 \n"               
+"	SUBNES	R12, R12, #0x2A \n"               
+"	BNE	loc_FFC59478 \n"                     
+"	BL	sub_FFC5C0A0 \n"                      
+"	BL	sub_FFC5C440 \n"                      
+"	B	loc_FFC59478 \n"                       
+"loc_FFC5946C:\n"
+"	LDR	R1, =0x70B \n"                       
+"	LDR	R0, =0xFFC58E30 \n"                  
+"	BL	sub_FFC0F680 \n"                      
+"loc_FFC59478:\n"
+"	LDR	R0, [SP] \n"                         
+"	LDR	R1, [R0, #4] \n"                     
+"	LDR	R0, [R6] \n"                         
+"	BL	sub_FFC28810 \n"                      
+"	LDR	R4, [SP] \n"                         
+"	LDR	R0, [R4, #8] \n"                     
+"	CMP	R0, #0 \n"                           
+"	LDREQ	R1, =0x132 \n"                     
+"	LDREQ	R0, =0xFFC58E30 \n"                
+"	BLEQ	sub_FFC0F680 \n"                    
+"	MOV	R0, #0 \n"                           
+"	STR	R0, [R4, #8] \n"                     
+"	B	loc_FFC59230 \n"                       
+	);
+} 
+
+
+void __attribute__((naked,noinline)) sub_FFC59598_my(){ // 
+	asm volatile(
+"	STMFD	SP!, {R3-R5,LR} \n"                
+"	LDR	R4, [R0, #0xC] \n"                   
+"	LDR	R0, [R4, #8] \n"                     
+"	ORR	R0, R0, #1 \n"                       
+"	STR	R0, [R4, #8] \n"                     
+"	BL	sub_FFC59AF4 \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFC59E9C \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD0FA4C \n"                      
+"	CMP	R0, #0 \n"                           
+"	MOV	R0, R4 \n"                           
+"	BEQ	loc_FFC595E8 \n"                     
+"	BL	sub_FFD0FAD8 \n"                      
+"	TST	R0, #1 \n"                           
+"	MOVNE	R2, R4 \n"                         
+"	LDMNEFD	SP!, {R3-R5,LR} \n"              
+"	MOVNE	R1, #1 \n"                         
+"	BNE	sub_FFC57934 \n"                     
+"	B	loc_FFC595EC \n"                       
+"loc_FFC595E8:\n"
+"	BL	sub_FFD0FA9C \n"                      
+"loc_FFC595EC:\n"
+"	MOV	R0, #0 \n"                           
+"	STR	R0, [SP] \n"                         
+"	LDR	R0, =0x33324 \n"                     
+"	MOV	R2, #2 \n"                           
+"	LDRH	R0, [R0, #0x8A] \n"                 
+"	MOV	R1, SP \n"                           
+"	CMP	R0, #3 \n"                           
+"	LDRNE	R0, [R4, #0xC] \n"                 
+"	CMPNE	R0, #1 \n"                         
+"	MOVHI	R0, #1 \n"                         
+"	STRHI	R0, [SP] \n"                       
+"	LDR	R0, =0x127 \n"                       
+"	BL	sub_FFC693FC \n"                      
+"	BL	sub_FFD2F660 \n"                      
+"	BL	sub_FFC696BC \n"                      
+"	STR	R0, [R4, #0x18] \n"                  
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD10D54 \n"                      
+"	BL	sub_FFD11770 \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD10E1C_my\n"			//---------->                    
+"	MOV	R5, R0 \n"   
+"	BL  capt_seq_hook_raw_here\n"	// +                        
+"	BL	sub_FFC5C0A0 \n"                      
+"	BL	sub_FFC5C0E8 \n"                      
+"	BL	sub_FFC5C128 \n"                      
+"	MOV	R2, R4 \n"                           
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, R5 \n"                           
+"	BL	sub_FFC57934 \n"                      
+"	BL	sub_FFD110A8 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRNE	R0, [R4, #8] \n"                   
+"	ORRNE	R0, R0, #0x2000 \n"                
+"	STRNE	R0, [R4, #8] \n"                   
+"	LDMFD	SP!, {R3-R5,PC} \n"                
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFD10E1C_my(  ) { 
+asm volatile (
+"	STMFD	SP!, {R0-R8,LR} \n"                
+"	MOV	R4, R0 \n"                           
+"	BL	sub_FFD11904 \n"                      
+"	MVN	R1, #0 \n"                           
+"	BL	sub_FFC28844 \n"                      
+"	LDR	R5, =0x5828 \n"                      
+"	LDR	R0, [R5, #0xC] \n"                   
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFD10E6C \n"                     
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, #0 \n"                           
+"	BL	sub_FFC0F4B4 \n"                      
+"	STR	R0, [R5, #0xC] \n"                   
+"	MOV	R3, #0 \n"                           
+"	STR	R3, [SP] \n"                         
+"	LDR	R3, =0xFFD108E0 \n"                  
+"	LDR	R0, =0xFFD11078 \n"                  
+"	MOV	R2, #0x400 \n"                       
+"	MOV	R1, #0x17 \n"                        
+"	BL	sub_FFC0F480 \n"                      
+"loc_FFD10E6C:\n"
+"	MOV	R2, #4 \n"                           
+"	ADD	R1, SP, #8 \n"                       
+"	MOV	R0, #0x8A \n"                        
+"	BL	sub_FFC6952C \n"                      
+"	TST	R0, #1 \n"                           
+"	LDRNE	R1, =0x3BA \n"                     
+"	LDRNE	R0, =0xFFD10B0C \n"                
+"	BLNE	sub_FFC0F680 \n"                    
+"	LDR	R6, =0x333E0 \n"                     
+"	LDR	R7, =0x33324 \n"                     
+"	LDR	R3, [R6] \n"                         
+"	LDRSH	R2, [R6, #0xC] \n"                 
+"	LDRSH	R1, [R6, #0xE] \n"                 
+"	LDR	R0, [R7, #0x80] \n"                  
+"	BL	sub_FFCE5C8C \n"                      
+"	BL	sub_FFC455A8 \n"                      
+"	LDR	R3, =0x5830 \n"                      
+"	STRH	R0, [R4, #0xA4] \n"                 
+"	SUB	R2, R3, #4 \n"                       
+"	STRD	R2, [SP] \n"                        
+"	MOV	R1, R0 \n"                           
+"	LDRH	R0, [R7, #0x54] \n"                 
+"	LDRSH	R2, [R6, #0xC] \n"                 
+"	SUB	R3, R3, #8 \n"  
+"	BL      sub_FFD11F70\n"
+"	BL      wait_until_remote_button_is_released\n"     // +
+"	BL      capt_seq_hook_set_nr\n"                     // +
+"	B       sub_FFD10ED0\n"                             // continue function in firmware
+	);
+}
+
+/*************************************************************/
+
+// ROM:FFC91654 task_ExpDrvTask
+void __attribute__((naked,noinline)) exp_drv_task(){
+	asm volatile(
+"	STMFD	SP!, {R4-R8,LR} \n"                
+"	SUB	SP, SP, #0x20 \n"                    
+"	LDR	R8, =0xBB8 \n"                       
+"	LDR	R7, =0x38CC \n"                      
+"	LDR	R5, =0x3C714 \n"                     
+"	MOV	R0, #0 \n"                           
+"	ADD	R6, SP, #0x10 \n"                    
+"	STR	R0, [SP, #0xC] \n"                   
+"loc_FFC91624:\n"
+"	LDR	R0, [R7, #0x20] \n"                  
+"	MOV	R2, #0 \n"                           
+"	ADD	R1, SP, #0x1C \n"                    
+"	BL	sub_FFC28AA0 \n"                      
+"	LDR	R0, [SP, #0xC] \n"                   
+"	CMP	R0, #1 \n"                           
+"	BNE	loc_FFC91670 \n"                     
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R0, [R0] \n"                         
+"	CMP	R0, #0x13 \n"                        
+"	CMPNE	R0, #0x14 \n"                      
+"	CMPNE	R0, #0x15 \n"                      
+"	CMPNE	R0, #0x16 \n"                      
+"	BEQ	loc_FFC917D4 \n"                     
+"	CMP	R0, #0x28 \n"                        
+"	BEQ	loc_FFC9175C \n"                     
+"	ADD	R1, SP, #0xC \n"                     
+"	MOV	R0, #0 \n"                           
+"	BL	sub_FFC915B4 \n"                      
+"loc_FFC91670:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R1, [R0] \n"                         
+"	CMP	R1, #0x2E \n"                        
+"	BNE	loc_FFC916A0 \n"                     
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	BL	sub_FFC9290C \n"                      
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R1, #1 \n"                           
+"	BL	sub_FFC28810 \n"                      
+"	BL	sub_FFC0F438 \n"                      
+"	ADD	SP, SP, #0x20 \n"                    
+"	LDMFD	SP!, {R4-R8,PC} \n"                
+"loc_FFC916A0:\n"
+"	CMP	R1, #0x2D \n"                        
+"	BNE	loc_FFC916BC \n"                     
+"	LDR	R2, [R0, #0x8C]! \n"                 
+"	LDR	R1, [R0, #4] \n"                     
+"	MOV	R0, R1 \n"                           
+"	BLX	R2 \n"                               
+"	B	loc_FFC91BFC \n"                       
+"loc_FFC916BC:\n"
+"	CMP	R1, #0x26 \n"                        
+"	BNE	loc_FFC9170C \n"                     
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R1, #0x80 \n"                        
+"	BL	sub_FFC28844 \n"                      
+"	LDR	R0, =0xFFC8DD80 \n"                  
+"	MOV	R1, #0x80 \n"                        
+"	BL	sub_FFD0850C \n"                      
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R2, R8 \n"                           
+"	MOV	R1, #0x80 \n"                        
+"	BL	sub_FFC28750 \n"                      
+"	TST	R0, #1 \n"                           
+"	LDRNE	R1, =0xE5F \n"                     
+"	BNE	loc_FFC917C8 \n"                     
+"loc_FFC916F8:\n"
+"	LDR	R1, [SP, #0x1C] \n"                  
+"	LDR	R0, [R1, #0x90] \n"                  
+"	LDR	R1, [R1, #0x8C] \n"                  
+"	BLX	R1 \n"                               
+"	B	loc_FFC91BFC \n"                       
+"loc_FFC9170C:\n"
+"	CMP	R1, #0x27 \n"                        
+"	BNE	loc_FFC91754 \n"                     
+"	ADD	R1, SP, #0xC \n"                     
+"	BL	sub_FFC915B4 \n"                      
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R1, #0x100 \n"                       
+"	BL	sub_FFC28844 \n"                      
+"	LDR	R0, =0xFFC8DD90 \n"                  
+"	MOV	R1, #0x100 \n"                       
+"	BL	sub_FFD08794 \n"                      
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R2, R8 \n"                           
+"	MOV	R1, #0x100 \n"                       
+"	BL	sub_FFC28750 \n"                      
+"	TST	R0, #1 \n"                           
+"	BEQ	loc_FFC916F8 \n"                     
+"	LDR	R1, =0xE69 \n"                       
+"	B	loc_FFC917C8 \n"                       
+"loc_FFC91754:\n"
+"	CMP	R1, #0x28 \n"                        
+"	BNE	loc_FFC9176C \n"                     
+"loc_FFC9175C:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	ADD	R1, SP, #0xC \n"                     
+"	BL	sub_FFC915B4 \n"                      
+"	B	loc_FFC916F8 \n"                       
+"loc_FFC9176C:\n"
+"	CMP	R1, #0x2B \n"                        
+"	BNE	loc_FFC91784 \n"                     
+"	BL	sub_FFC8118C \n"                      
+"	BL	sub_FFC81DB4 \n"                      
+"	BL	sub_FFC81904 \n"                      
+"	B	loc_FFC916F8 \n"                       
+"loc_FFC91784:\n"
+"	CMP	R1, #0x2C \n"                        
+"	BNE	loc_FFC917D4 \n"                     
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R1, #4 \n"                           
+"	BL	sub_FFC28844 \n"                      
+"	LDR	R1, =0xFFC8DDB0 \n"                  
+"	LDR	R0, =0xFFFFF400 \n"                  
+"	MOV	R2, #4 \n"                           
+"	BL	sub_FFC80C08 \n"                      
+"	BL	sub_FFC80E90 \n"                      
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R2, R8 \n"                           
+"	MOV	R1, #4 \n"                           
+"	BL	sub_FFC2866C \n"                      
+"	TST	R0, #1 \n"                           
+"	BEQ	loc_FFC916F8 \n"                     
+"	LDR	R1, =0xE91 \n"                       
+"loc_FFC917C8:\n"
+"	LDR	R0, =0xFFC8E3F0 \n"                  
+"	BL	sub_FFC0F680 \n"                      
+"	B	loc_FFC916F8 \n"                       
+"loc_FFC917D4:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	MOV	R4, #1 \n"                           
+"	LDR	R1, [R0] \n"                         
+"	CMP	R1, #0x11 \n"                        
+"	CMPNE	R1, #0x12 \n"                      
+"	BNE	loc_FFC91844 \n"                     
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	ADD	R1, R1, R1, LSL #1 \n"               
+"	ADD	R1, R0, R1, LSL #2 \n"               
+"	SUB	R1, R1, #8 \n"                       
+"	LDMIA	R1, {R2-R4} \n"                    
+"	STMIA	R6, {R2-R4} \n"                   
+"	BL	sub_FFC8FF40 \n"                      
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	LDR	R3, [R0, #0x8C] \n"                  
+"	LDR	R2, [R0, #0x90] \n"                  
+"	ADD	R0, R0, #4 \n"                       
+"	BLX	R3 \n"                               
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	BL	sub_FFC92CD4 \n"                      
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	LDR	R3, [R0, #0x94] \n"                  
+"	LDR	R2, [R0, #0x98] \n"                  
+"	ADD	R0, R0, #4 \n"                       
+"	BLX	R3 \n"                               
+"	B	loc_FFC91B3C \n"                       
+"loc_FFC91844:\n"
+"	CMP	R1, #0x13 \n"                        
+"	CMPNE	R1, #0x14 \n"                      
+"	CMPNE	R1, #0x15 \n"                      
+"	CMPNE	R1, #0x16 \n"                      
+"	BNE	loc_FFC918FC \n"                     
+"	ADD	R3, SP, #0xC \n"                     
+"	MOV	R2, SP \n"                           
+"	ADD	R1, SP, #0x10 \n"                    
+"	BL	sub_FFC9021C \n"                      
+"	CMP	R0, #1 \n"                           
+"	MOV	R4, R0 \n"                           
+"	CMPNE	R4, #5 \n"                         
+"	BNE	loc_FFC91898 \n"                     
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	MOV	R2, R4 \n"                           
+"	LDR	R1, [R0, #0x7C]! \n"                 
+"	LDR	R12, [R0, #0x10]! \n"                
+"	LDR	R3, [R0, #4] \n"                     
+"	MOV	R0, SP \n"                           
+"	BLX	R12 \n"                              
+"	B	loc_FFC918D0 \n"                       
+"loc_FFC91898:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	CMP	R4, #2 \n"                           
+"	LDR	R3, [R0, #0x90] \n"                  
+"	CMPNE	R4, #6 \n"                         
+"	BNE	loc_FFC918E4 \n"                     
+"	LDR	R12, [R0, #0x8C] \n"                 
+"	MOV	R0, SP \n"                           
+"	MOV	R2, R4 \n"                           
+"	MOV	R1, #1 \n"                           
+"	BLX	R12 \n"                              
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	MOV	R2, SP \n"                           
+"	ADD	R1, SP, #0x10 \n"                    
+"	BL	sub_FFC912BC \n"                      
+"loc_FFC918D0:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R2, [SP, #0xC] \n"                   
+"	MOV	R1, R4 \n"                           
+"	BL	sub_FFC91554 \n"                      
+"	B	loc_FFC91B3C \n"                       
+"loc_FFC918E4:\n"
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	LDR	R12, [R0, #0x8C] \n"                 
+"	ADD	R0, R0, #4 \n"                       
+"	MOV	R2, R4 \n"                           
+"	BLX	R12 \n"                              
+"	B	loc_FFC91B3C \n"                       
+"loc_FFC918FC:\n"
+"	CMP	R1, #0x22 \n"                        
+"	CMPNE	R1, #0x23 \n"                      
+"	BNE	loc_FFC91948 \n"                     
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	ADD	R1, R1, R1, LSL #1 \n"               
+"	ADD	R1, R0, R1, LSL #2 \n"               
+"	SUB	R1, R1, #8 \n"                       
+"	LDMIA	R1, {R2-R4} \n"                    
+"	STMIA	R6, {R2-R4} \n"                    
+"	BL	sub_FFC8F490 \n"                      
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	LDR	R3, [R0, #0x8C] \n"                  
+"	LDR	R2, [R0, #0x90] \n"                  
+"	ADD	R0, R0, #4 \n"                       
+"	BLX	R3 \n"                               
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	BL	sub_FFC8F784 \n"                      
+"	B	loc_FFC91B3C \n"                       
+"loc_FFC91948:\n"
+"	ADD	R1, R0, #4 \n"                       
+"	LDMIA	R1, {R2,R3,R12} \n"                
+"	STMIA	R6, {R2,R3,R12} \n"                
+"	LDR	R1, [R0] \n"                         
+"	CMP	R1, #0x25 \n"                        
+"	ADDLS	PC, PC, R1, LSL #2 \n"             
+"	B	loc_FFC91B1C \n"                       
+"	B	loc_FFC919FC \n"                       
+"	B	loc_FFC919FC \n"                       
+"	B	loc_FFC91A04 \n"                       
+"	B	loc_FFC91A0C \n"                       
+"	B	loc_FFC91A0C \n"                       
+"	B	loc_FFC91A0C \n"                       
+"	B	loc_FFC919FC \n"                       
+"	B	loc_FFC91A04 \n"                       
+"	B	loc_FFC91A0C \n"                       
+"	B	loc_FFC91A0C \n"                       
+"	B	loc_FFC91A24 \n"                       
+"	B	loc_FFC91A24 \n"                       
+"	B	loc_FFC91B10 \n"                       
+"	B	loc_FFC91B18 \n"                       
+"	B	loc_FFC91B18 \n"                       
+"	B	loc_FFC91B18 \n"                       
+"	B	loc_FFC91B18 \n"                       
+"	B	loc_FFC91B1C \n"                       
+"	B	loc_FFC91B1C \n"                       
+"	B	loc_FFC91B1C \n"                       
+"	B	loc_FFC91B1C \n"                       
+"	B	loc_FFC91B1C \n"                       
+"	B	loc_FFC91B1C \n"                       
+"	B	loc_FFC91A14 \n"                       
+"	B	loc_FFC91A1C \n"                       
+"	B	loc_FFC91A1C \n"                       
+"	B	loc_FFC91A30 \n"                       
+"	B	loc_FFC91A30 \n"                       
+"	B	loc_FFC91A38 \n"                       
+"	B	loc_FFC91A68 \n"                       
+"	B	loc_FFC91A98 \n"                       
+"	B	loc_FFC91AC8 \n"                       
+"	B	loc_FFC91AF8 \n"                       
+"	B	loc_FFC91AF8 \n"                       
+"	B	loc_FFC91B1C \n"                       
+"	B	loc_FFC91B1C \n"                       
+"	B	loc_FFC91B00 \n"                       
+"	B	loc_FFC91B08 \n"                       
+"loc_FFC919FC:\n"
+"	BL	sub_FFC8E298 \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91A04:\n"
+"	BL	sub_FFC8E51C \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91A0C:\n"
+"	BL	sub_FFC8E724 \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91A14:\n"
+"	BL	sub_FFC8E99C \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91A1C:\n"
+"	BL	sub_FFC8EB94 \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91A24:\n"
+"	BL	sub_FFC8EE50_my\n"		//---------->                   
+"	MOV	R4, #0 \n"                           
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91A30:\n"
+"	BL	sub_FFC8EF90 \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91A38:\n"
+"	LDRH	R1, [R0, #4] \n"                    
+"	STRH	R1, [SP, #0x10] \n"                 
+"	LDRH	R1, [R5, #2] \n"                    
+"	STRH	R1, [SP, #0x12] \n"                 
+"	LDRH	R1, [R5, #4] \n"                    
+"	STRH	R1, [SP, #0x14] \n"                 
+"	LDRH	R1, [R5, #6] \n"                    
+"	STRH	R1, [SP, #0x16] \n"                 
+"	LDRH	R1, [R0, #0xC] \n"                  
+"	STRH	R1, [SP, #0x18] \n"                 
+"	BL	sub_FFC92980 \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91A68:\n"
+"	LDRH	R1, [R0, #4] \n"                    
+"	STRH	R1, [SP, #0x10] \n"                 
+"	LDRH	R1, [R5, #2] \n"                    
+"	STRH	R1, [SP, #0x12] \n"                 
+"	LDRH	R1, [R5, #4] \n"                    
+"	STRH	R1, [SP, #0x14] \n"                 
+"	LDRH	R1, [R5, #6] \n"                    
+"	STRH	R1, [SP, #0x16] \n"                 
+"	LDRH	R1, [R5, #8] \n"                    
+"	STRH	R1, [SP, #0x18] \n"                 
+"	BL	sub_FFC92AEC \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91A98:\n"
+"	LDRH	R1, [R5] \n"                        
+"	STRH	R1, [SP, #0x10] \n"                 
+"	LDRH	R1, [R0, #6] \n"                    
+"	STRH	R1, [SP, #0x12] \n"                 
+"	LDRH	R1, [R5, #4] \n"                    
+"	STRH	R1, [SP, #0x14] \n"                 
+"	LDRH	R1, [R5, #6] \n"                    
+"	STRH	R1, [SP, #0x16] \n"                 
+"	LDRH	R1, [R5, #8] \n"                    
+"	STRH	R1, [SP, #0x18] \n"                 
+"	BL	sub_FFC92B98 \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91AC8:\n"
+"	LDRH	R1, [R5] \n"                        
+"	STRH	R1, [SP, #0x10] \n"                 
+"	LDRH	R1, [R5, #2] \n"                    
+"	STRH	R1, [SP, #0x12] \n"                 
+"	LDRH	R1, [R5, #4] \n"                    
+"	STRH	R1, [SP, #0x14] \n"                 
+"	LDRH	R1, [R5, #6] \n"                    
+"	STRH	R1, [SP, #0x16] \n"                 
+"	LDRH	R1, [R0, #0xC] \n"                  
+"	STRH	R1, [SP, #0x18] \n"                 
+"	BL	sub_FFC92C38 \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91AF8:\n"
+"	BL	sub_FFC8F2E8 \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91B00:\n"
+"	BL	sub_FFC8F888 \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91B08:\n"
+"	BL	sub_FFC8FAC4 \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91B10:\n"
+"	BL	sub_FFC8FC40 \n"                      
+"	B	loc_FFC91B1C \n"                       
+"loc_FFC91B18:\n"
+"	BL	sub_FFC8FDDC \n"                      
+"loc_FFC91B1C:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	LDR	R3, [R0, #0x8C] \n"                  
+"	LDR	R2, [R0, #0x90] \n"                  
+"	ADD	R0, R0, #4 \n"                       
+"	BLX	R3 \n"                               
+"	CMP	R4, #1 \n"                           
+"	BNE	loc_FFC91B84 \n"                     
+"loc_FFC91B3C:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	MOV	R2, #0xC \n"                         
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	ADD	R1, R1, R1, LSL #1 \n"               
+"	ADD	R0, R0, R1, LSL #2 \n"               
+"	SUB	R4, R0, #8 \n"                       
+"	LDR	R0, =0x3C714 \n"                     
+"	ADD	R1, SP, #0x10 \n"                    
+"	BL	sub_FFE80E10 \n"                      
+"	LDR	R0, =0x3C720 \n"                     
+"	MOV	R2, #0xC \n"                         
+"	ADD	R1, SP, #0x10 \n"                    
+"	BL	sub_FFE80E10 \n"                      
+"	LDR	R0, =0x3C72C \n"                     
+"	MOV	R2, #0xC \n"                         
+"	MOV	R1, R4 \n"                           
+"	BL	sub_FFE80E10 \n"                      
+"	B	loc_FFC91BFC \n"                       
+"loc_FFC91B84:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R0, [R0] \n"                         
+"	CMP	R0, #0xB \n"                         
+"	BNE	loc_FFC91BCC \n"                     
+"	MOV	R3, #0 \n"                           
+"	STR	R3, [SP] \n"                         
+"	MOV	R3, #1 \n"                           
+"	MOV	R2, #1 \n"                           
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, #0 \n"                           
+"	BL	sub_FFC8E0A0 \n"                      
+"	MOV	R3, #0 \n"                           
+"	STR	R3, [SP] \n"                         
+"	MOV	R3, #1 \n"                           
+"	MOV	R2, #1 \n"                           
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, #0 \n"                           
+"	B	loc_FFC91BF8 \n"                       
+"loc_FFC91BCC:\n"
+"	MOV	R3, #1 \n"                           
+"	MOV	R2, #1 \n"                           
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, #1 \n"                           
+"	STR	R3, [SP] \n"                         
+"	BL	sub_FFC8E0A0 \n"                      
+"	MOV	R3, #1 \n"                           
+"	MOV	R2, #1 \n"                           
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, #1 \n"                           
+"	STR	R3, [SP] \n"                         
+"loc_FFC91BF8:\n"
+"	BL	sub_FFC8E1E0 \n"                      
+"loc_FFC91BFC:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	BL	sub_FFC9290C \n"                      
+"	B	loc_FFC91624 \n" 
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFC8EE50_my(){ // 
+	asm volatile(
+"	STMFD	SP!, {R4-R8,LR} \n"                
+"	LDR	R7, =0x38CC \n"                      
+"	MOV	R4, R0 \n"                           
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R1, #0x3E \n"                        
+"	BL	sub_FFC28844 \n"                      
+"	LDRSH	R0, [R4, #4] \n"                   
+"	MOV	R2, #0 \n"                           
+"	MOV	R1, #0 \n"                           
+"	BL	sub_FFC8DE04 \n"                      
+"	MOV	R6, R0 \n"                           
+"	LDRSH	R0, [R4, #6] \n"                   
+"	BL	sub_FFC8DF14 \n"                      
+"	LDRSH	R0, [R4, #8] \n"                   
+"	BL	sub_FFC8DF6C \n"                      
+"	LDRSH	R0, [R4, #0xA] \n"                 
+"	BL	sub_FFC8DFC4 \n"                      
+"	LDRSH	R0, [R4, #0xC] \n"                 
+"	MOV	R1, #0 \n"                           
+"	BL	sub_FFC8E01C \n"                      
+"	MOV	R5, R0 \n"                           
+"	LDR	R0, [R4] \n"                         
+"	LDR	R8, =0x3C72C \n"                     
+"	CMP	R0, #0xB \n"                         
+"	MOVEQ	R6, #0 \n"                         
+"	MOVEQ	R5, #0 \n"                         
+"	BEQ	loc_FFC8EEE4 \n"                     
+"	CMP	R6, #1 \n"                           
+"	BNE	loc_FFC8EEE4 \n"                     
+"	LDRSH	R0, [R4, #4] \n"                   
+"	LDR	R1, =0xFFC8DD70 \n"                  
+"	MOV	R2, #2 \n"                           
+"	BL	sub_FFD08660 \n"                      
+"	STRH	R0, [R4, #4] \n"                    
+"	MOV	R0, #0 \n"                           
+"	STR	R0, [R7, #0x28] \n"                  
+"	B	loc_FFC8EEEC \n"                       
+"loc_FFC8EEE4:\n"
+"	LDRH	R0, [R8] \n"                        
+"	STRH	R0, [R4, #4] \n"                    
+"loc_FFC8EEEC:\n"
+"	CMP	R5, #1 \n"                           
+"	LDRNEH	R0, [R8, #8] \n"                  
+"	BNE	loc_FFC8EF08 \n"                     
+"	LDRSH	R0, [R4, #0xC] \n"                 
+"	LDR	R1, =0xFFC8DDF4 \n"                  
+"	MOV	R2, #0x20 \n"                        
+"	BL	sub_FFC9293C \n"                      
+"loc_FFC8EF08:\n"
+"	STRH	R0, [R4, #0xC] \n"                  
+"	LDRSH	R0, [R4, #6] \n"                   
+"	BL	sub_FFC80EFC_my\n"		//----------->                     
+"	LDRSH	R0, [R4, #8] \n"                   
+"	MOV	R1, #1 \n"                           
+"	BL	sub_FFC8164C \n"                      
+"	MOV	R1, #0 \n"                           
+"	ADD	R0, R4, #8 \n"                       
+"	BL	sub_FFC816D4 \n"                      
+"	LDRSH	R0, [R4, #0xE] \n"                 
+"	BL	sub_FFC890FC \n"                      
+"	LDR	R4, =0xBB8 \n"                       
+"	CMP	R6, #1 \n"                           
+"	BNE	loc_FFC8EF60 \n"                     
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R2, R4 \n"                           
+"	MOV	R1, #2 \n"                           
+"	BL	sub_FFC28750 \n"                      
+"	TST	R0, #1 \n"                           
+"	LDRNE	R1, =0x5A3 \n"                     
+"	LDRNE	R0, =0xFFC8E3F0 \n"                
+"	BLNE	sub_FFC0F680 \n"                    
+"loc_FFC8EF60:\n"
+"	CMP	R5, #1 \n"                           
+"	LDMNEFD	SP!, {R4-R8,PC} \n"              
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R2, R4 \n"                           
+"	MOV	R1, #0x20 \n"                        
+"	BL	sub_FFC28750 \n"                      
+"	TST	R0, #1 \n"                           
+"	LDRNE	R1, =0x5A8 \n"                     
+"	LDRNE	R0, =0xFFC8E3F0 \n"                
+"	LDMNEFD	SP!, {R4-R8,LR} \n"              
+"	BNE	sub_FFC0F680 \n"                     
+"	LDMFD	SP!, {R4-R8,PC} \n"       
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFC80EFC_my(){ // 
+	asm volatile(
+	"	STMFD	SP!, {R4-R6,LR} \n"                
+"	LDR	R5, =0x35C0 \n"                      
+"	MOV	R4, R0 \n"                           
+"	LDR	R0, [R5, #4] \n"                     
+"	CMP	R0, #1 \n"                           
+"	LDRNE	R1, =0x146 \n"                     
+"	LDRNE	R0, =0xFFC80D00 \n"                
+"	BLNE	sub_FFC0F680 \n"                    
+"	CMN	R4, #0xC00 \n"                       
+"	LDREQSH	R4, [R5, #2] \n"                 
+"	CMN	R4, #0xC00 \n"                       
+"	MOVEQ	R1, #0x14C \n"                     
+"	LDREQ	R0, =0xFFC80D00 \n"                
+"	STRH	R4, [R5, #2] \n"                    
+"	BLEQ	sub_FFC0F680 \n"                    
+"	MOV	R0, R4 \n"                           
+//"	BL	sub_FFD7D848 \n" 			// -                     
+"	BL      apex2us\n"				// +
+"	MOV	R4, R0 \n"                           
+//"	BL	sub_FFCB3A60 \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFCB80F0 \n"                      
+"	TST	R0, #1 \n"                           
+"	LDRNE	R1, =0x151 \n"                     
+"	LDMNEFD	SP!, {R4-R6,LR} \n"              
+"	LDRNE	R0, =0xFFC80D00 \n"                
+"	BNE	sub_FFC0F680 \n"                     
+"	LDMFD	SP!, {R4-R6,PC} \n"                
+	);
+}
Index: /trunk/platform/a495/sub/100d/stubs_entry.S
===================================================================
--- /trunk/platform/a495/sub/100d/stubs_entry.S	(revision 1198)
+++ /trunk/platform/a495/sub/100d/stubs_entry.S	(revision 1198)
@@ -0,0 +1,181 @@
+// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!
+#include "stubs_asm.h"
+
+// Best match: 94%
+NSTUB(AllocateMemory, 0xffdfd168)
+NSTUB(AllocateUncacheableMemory, 0xffc292d8)
+// Best match: 96%
+NSTUB(Close, 0xffc26108)
+NSTUB(CreateTask, 0xffc0f1a8)
+NSTUB(DeleteFile_Fut, 0xffc25a80)
+// ERROR: EnterToCompensationEVF is not found!
+NSTUB(ExecuteEventProcedure, 0xffc65820)
+// ERROR: ExitFromCompensationEVF is not found!
+NSTUB(ExitTask, 0xffc0f438)
+NSTUB(Fclose_Fut, 0xffc25bfc)
+NSTUB(Feof_Fut, 0xffc25de8)
+NSTUB(Fflush_Fut, 0xffc25e24)
+NSTUB(Fgets_Fut, 0xffc25d50)
+NSTUB(Fopen_Fut, 0xffc25bbc)
+NSTUB(Fread_Fut, 0xffc25ca8)
+// Best match: 94%
+NSTUB(FreeMemory, 0xffdfd160)
+// Best match: 91%
+NSTUB(FreeUncacheableMemory, 0xffc29318)
+NSTUB(Fseek_Fut, 0xffc25d9c)
+NSTUB(Fwrite_Fut, 0xffc25cfc)
+// ERROR: GetBatteryTemperature is not found!
+// ERROR: GetCCDTemperature is not found!
+// Best match: 93%
+NSTUB(GetCurrentAvValue, 0xffd08810)
+// Best match: 66%
+NSTUB(GetDrive_ClusterSize, 0xffc512c0)
+// ERROR: GetDrive_FreeClusters is not found!
+// Best match: 60%
+NSTUB(GetDrive_TotalClusters, 0xffc512f4)
+// Best match: 64%
+NSTUB(GetFocusLensSubjectDistance, 0xffd07b08)
+// Best match: 77%
+NSTUB(GetFocusLensSubjectDistanceFromLens, 0xffd07f60)
+NSTUB(GetMemInfo, 0xffc0a7f8)
+// ERROR: GetOpticalTemperature is not found!
+// Best match: 96%
+NSTUB(GetParameterData, 0xffd2f1b0)
+// Best match: 72%
+NSTUB(GetPropertyCase, 0xffc6952c)
+NSTUB(GetSystemTime, 0xffdfd1c0)
+// Best match: 74%
+NSTUB(GetZoomLensCurrentPoint, 0xffd09cd0)
+// Best match: 59%
+NSTUB(GetZoomLensCurrentPosition, 0xffd0a6d8)
+// Best match: 58%
+NSTUB(IsStrobeChargeCompleted, 0xffca7260)
+NSTUB(LocalTime, 0xffc63530)
+// Best match: 93%
+NSTUB(LockMainPower, 0xffc6ce40)
+// ERROR: Lseek is not found!
+// Best match: 92%
+NSTUB(MakeDirectory_Fut, 0xffc25af4)
+// Best match: 57%
+NSTUB(MoveFocusLensToDistance, 0xffe53454)
+// Best match: 58%
+NSTUB(MoveZoomLensWithPoint, 0xffdfae40)
+// Best match: 62%
+NSTUB(NewTaskShell, 0xffc68f38)
+// Best match: 69%
+NSTUB(Open, 0xffc4e5dc)
+// Best match: 85%
+NSTUB(PB2Rec, 0xffc6fa94)
+// ERROR: PT_PlaySound is not found!
+// Best match: 86%
+NSTUB(PostLogicalEventForNotPowerType, 0xffc6c670)
+// Best match: 92%
+NSTUB(PostLogicalEventToUI, 0xffc6c6bc)
+NSTUB(Read, 0xffc0b308)
+// ERROR: ReadFastDir is not found!
+// Best match: 72%
+NSTUB(Rec2PB, 0xffc6fad4)
+// ERROR: RefreshPhysicalScreen is not found!
+// ERROR: Remove is not found!
+// Best match: 53%
+NSTUB(RenameFile_Fut, 0xffc25bb8)
+// ALT: NSTUB(RenameFile_Fut, 0xffcf357c) // 8/7
+// ALT: NSTUB(RenameFile_Fut, 0xffcf35cc) // 8/7
+NSTUB(Restart, 0xffc2aab0)
+// Best match: 93%
+NSTUB(SetAutoShutdownTime, 0xffc6ceb4)
+// Best match: 81%
+NSTUB(SetCurrentCaptureModeType, 0xffc731ec)
+// Best match: 55%
+NSTUB(SetFileTimeStamp, 0xffcfbbb0)
+// Best match: 64%
+NSTUB(SetLogicalEventActive, 0xffc6cbb8)
+// Best match: 96%
+NSTUB(SetParameterData, 0xffd2f120)
+// Best match: 72%
+NSTUB(SetPropertyCase, 0xffc693fc)
+// Best match: 92%
+NSTUB(SleepTask, 0xffc2915c)
+// Best match: 60%
+NSTUB(TakeSemaphore, 0xffc0f034)
+// ERROR: TurnOffBackLight is not found!
+// ERROR: TurnOnBackLight is not found!
+// ERROR: UIFS_WriteFirmInfoToFile is not found!
+// Best match: 93%
+NSTUB(UnlockMainPower, 0xffc6cd94)
+// Best match: 96%
+NSTUB(UpdateMBROnFlash, 0xffc51140)
+// Best match: 85%
+NSTUB(VbattGet, 0xffc22be4)
+NSTUB(Write, 0xffc26198)
+NSTUB(_log, 0xffe82328)
+NSTUB(_log10, 0xffe8126c)
+NSTUB(_pow, 0xffe813dc)
+NSTUB(_sqrt, 0xffe83690)
+NSTUB(add_ptp_handler, 0xffdbeb54)
+NSTUB(close, 0xffc0b120)
+// Best match: 71%
+NSTUB(closedir, 0xffdebc38)
+// Best match: 71%
+NSTUB(closefastdir, 0xffdebc38)
+// Best match: 91%
+NSTUB(free, 0xffc04160)
+// Best match: 60%
+NSTUB(kbd_p1_f, 0xffc23ba4)
+// Best match: 58%
+NSTUB(kbd_p1_f_cont, 0xffc23bb0)
+// Best match: 86%
+NSTUB(kbd_p2_f, 0xffc2345c)
+// Best match: 51%
+NSTUB(kbd_pwr_off, 0xffc435e4)
+// ERROR: kbd_pwr_on is not found!
+// ERROR: kbd_read_keys is not found!
+// Best match: 73%
+NSTUB(kbd_read_keys_r2, 0xffc42fec)
+// ALT: NSTUB(kbd_read_keys_r2, 0xffc42fd0) // 16/6
+// Best match: 68%
+NSTUB(lseek, 0xffc26230)
+NSTUB(malloc, 0xffc04104)
+NSTUB(memcmp, 0xffc11318)
+NSTUB(memcpy, 0xffc2e860)
+NSTUB(memset, 0xffd7c880)
+// Best match: 74%
+NSTUB(mkdir, 0xffc265a4)
+NSTUB(mktime_ext, 0xffc7cd6c)
+NSTUB(open, 0xffc0b070)
+// Best match: 81%
+NSTUB(opendir, 0xffdebaa0)
+// ERROR: openfastdir is not found!
+// ERROR: qsort is not found!
+// Best match: 95%
+NSTUB(rand, 0xffc11420)
+NSTUB(read, 0xffc0b308)
+// ERROR: readfastdir is not found!
+// Best match: 82%
+NSTUB(reboot_fw_update, 0xffded468)
+// ERROR: rename is not found!
+// Best match: 93%
+NSTUB(set_control_event, 0xffc6c8d8)
+// Best match: 95%
+NSTUB(srand, 0xffc11414)
+NSTUB(stat, 0xffc2626c)
+// Best match: 61%
+NSTUB(strcat, 0xffc03f60)
+// Best match: 56%
+NSTUB(strchr, 0xffc03fe8)
+NSTUB(strcmp, 0xffc112d4)
+NSTUB(strcpy, 0xffc112bc)
+NSTUB(strftime, 0xffc7c774)
+NSTUB(strlen, 0xffc04034)
+NSTUB(strncmp, 0xffc03f9c)
+// Best match: 73%
+NSTUB(strncpy, 0xffc03f60)
+// Best match: 71%
+NSTUB(strrchr, 0xffc2e838)
+// ALT: NSTUB(strrchr, 0xffc7c53c) // 18/8
+// Best match: 96%
+NSTUB(strtol, 0xffc2eb40)
+NSTUB(strtolx, 0xffc2e944)
+NSTUB(time, 0xffc633e4)
+NSTUB(vsprintf, 0xffc11280)
+NSTUB(write, 0xffc0b368)
Index: /trunk/platform/a495/sub/100d/stubs_entry_2.S
===================================================================
--- /trunk/platform/a495/sub/100d/stubs_entry_2.S	(revision 1198)
+++ /trunk/platform/a495/sub/100d/stubs_entry_2.S	(revision 1198)
@@ -0,0 +1,59 @@
+// Note : This file generated by CHDK-PT.
+#include "stubs_asm.h"
+
+
+NHSTUB(EnterToCompensationEVF, 0xffc27604)   
+NHSTUB(ExitFromCompensationEVF, 0xffc27648)   
+NHSTUB(lseek, 0xffc26224)   
+NHSTUB(GetZoomLensCurrentPosition, 0xffdf520c)   
+NHSTUB(RenameFile_Fut, 0xffc259ec)   
+NHSTUB(SetFileTimeStamp, 0xffc263a4)   
+NHSTUB(UpdateMBROnFlash, 0xffc51140)   
+NHSTUB(closedir, 0xffdeba50)   
+NHSTUB(closefastdir, 0xffdeba50)   
+NHSTUB(kbd_read_keys_r2, 0xffc23b58)   
+NHSTUB(strcat, 0xffc7c528)   
+NHSTUB(strrchr, 0xffc0400c)   
+NHSTUB(RefreshPhysicalScreen, 0xffd7b34c)   
+NHSTUB(Lseek, 0xffc26224)   
+NHSTUB(GetCCDTemperature, 0xffc455a8)   
+NHSTUB(GetOpticalTemperature, 0xffc45694)   
+NHSTUB(GetDrive_FreeClusters, 0xffc51320)   
+NHSTUB(PT_PlaySound, 0xffc5f3b0)   
+NHSTUB(openfastdir, 0xffdebaa0)   
+NHSTUB(ReadFastDir, 0xffdebbf4)   
+NHSTUB(readfastdir, 0xffdebbf4)   
+NHSTUB(Remove, 0xffc2613c)   
+NHSTUB(TurnOnBackLight, 0xffc77f34)   
+NHSTUB(TurnOffBackLight, 0xffc77f4c)   
+NHSTUB(UIFS_WriteFirmInfoToFile, 0xffd1f924)   
+NHSTUB(kbd_read_keys, 0xffc23b2c)   
+NHSTUB(rename, 0xffc261e4)   
+NHSTUB(DoAFLock, 0xffc27554)   
+NHSTUB(UnlockAF, 0xffc2758c)   
+NHSTUB(MakeAFScan, 0xffd0f1fc)   
+NHSTUB(ExpCtrlTool_StartContiAE, 0xffc34ce4)   
+NHSTUB(ExpCtrlTool_StopContiAE, 0xffc34dbc)   
+NHSTUB(apex2us, 0xffd7d848)   
+NHSTUB(SetScriptMode, 0xffc00f70)   
+NHSTUB(platformsub_kbd_fetch_data, 0xffc435cc)   
+NHSTUB(SetAE_ShutterSpeed, 0xffe55be4)   
+NHSTUB(UnsetZoomForMovie, 0xffd3589c)   
+NHSTUB(LEDDrive, 0xffc42bc4)   
+NHSTUB(qsort, 0xffe3c190)   
+NHSTUB(UnlockAndRefresh, 0xffd7c53c)   
+NHSTUB(LockAndRefresh, 0xffd7c4f8)   
+NHSTUB(GetBatteryTemperature, 0xffc00b20)   
+NHSTUB(TurnOffMic, 0xffc43c28)   
+NHSTUB(TurnOnMic, 0xffc43c54)   
+NHSTUB(PutInNdFilter, 0xFFDFACA4)   
+NHSTUB(PutOutNdFilter, 0xFFDFACC8)   
+NHSTUB(SetZoomActuatorSpeedPercent, 0xffc00b20)   
+NHSTUB(WriteSDCard,  0xffcfcb1c )  // 0xffcfc938
+NHSTUB(GetImageFolder, 0xffcf1428)   
+NHSTUB(Mount_FileSystem, 0xffc00b20)   
+NHSTUB(Unmount_FileSystem, 0xffc00b20)   
+NHSTUB(rewinddir, 0xffc00b20)   
+NHSTUB(kbd_pwr_on, 0xffc00b20)   
+NHSTUB(kbd_pwr_off, 0xffc00b20)   
+
Index: /trunk/platform/a495/sub/100d/boot.c
===================================================================
--- /trunk/platform/a495/sub/100d/boot.c	(revision 1198)
+++ /trunk/platform/a495/sub/100d/boot.c	(revision 1198)
@@ -0,0 +1,628 @@
+#include "lolevel.h"
+#include "platform.h"
+#include "core.h"
+#include "dryos31.h"
+
+#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
+
+const char * const new_sa = &_end;
+
+void taskHook(context_t **context) {
+	task_t *tcb=(task_t*)((char*)context-offsetof(task_t, context));
+
+	if(!_strcmp(tcb->name, "PhySw"))           tcb->entry = (void*)mykbd_task; 
+	if(!_strcmp(tcb->name, "CaptSeqTask"))     tcb->entry = (void*)capt_seq_task; 
+	if(!_strcmp(tcb->name, "InitFileModules")) tcb->entry = (void*)init_file_modules_task;
+	if(!_strcmp(tcb->name, "MovieRecord"))     tcb->entry = (void*)movie_record_task;
+	if(!_strcmp(tcb->name, "ExpDrvTask"))      tcb->entry = (void*)exp_drv_task;
+}
+
+void CreateTask_spytask() {
+	_CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
+};
+
+
+void __attribute__((naked,noinline)) boot() {
+	asm volatile (
+			/*// LED Test
+			"LDR     R1, =0xC0220088\n"	// Green LED
+			"MOV     R0, #0x46\n"			// Power on LED
+			"STR     R0, [R1]\n"
+			// End LED Test*/
+			
+"	LDR	R1, =0xC0410000 \n"                  
+"	MOV	R0, #0 \n"                           
+"	STR	R0, [R1] \n"                         
+"	MOV	R1, #0x78 \n"                        
+"	MCR	p15, 0, R1, c1, c0 \n"               
+"	MOV	R1, #0 \n"                           
+"	MCR	p15, 0, R1, c7, c10, 4 \n"           
+"	MCR	p15, 0, R1, c7, c5 \n"               
+"	MCR	p15, 0, R1, c7, c6 \n"               
+"	MOV	R0, #0x3D \n"                        
+"	MCR	p15, 0, R0, c6, c0 \n"               
+"	MOV	R0, #0xC000002F \n"                  
+"	MCR	p15, 0, R0, c6, c1 \n"               
+"	MOV	R0, #0x31 \n"                        
+"	MCR	p15, 0, R0, c6, c2 \n"               
+"	LDR	R0, =0x10000031 \n"                  
+"	MCR	p15, 0, R0, c6, c3 \n"               
+"	MOV	R0, #0x40000017 \n"                  
+"	MCR	p15, 0, R0, c6, c4 \n"               
+"	LDR	R0, =0xFFC0002B \n"                  
+"	MCR	p15, 0, R0, c6, c5 \n"               
+"	MOV	R0, #0x34 \n"                        
+"	MCR	p15, 0, R0, c2, c0 \n"               
+"	MOV	R0, #0x34 \n"                        
+"	MCR	p15, 0, R0, c2, c0, 1 \n"            
+"	MOV	R0, #0x34 \n"                        
+"	MCR	p15, 0, R0, c3, c0 \n"               
+"	LDR	R0, =0x3333330 \n"                   
+"	MCR	p15, 0, R0, c5, c0, 2 \n"            
+"	LDR	R0, =0x3333330 \n"                   
+"	MCR	p15, 0, R0, c5, c0, 3 \n"            
+"	MRC	p15, 0, R0, c1, c0 \n"               
+"	ORR	R0, R0, #0x1000 \n"                  
+"	ORR	R0, R0, #4 \n"                       
+"	ORR	R0, R0, #1 \n"                       
+"	MCR	p15, 0, R0, c1, c0 \n"               
+"	MOV	R1, #0x40000006 \n"                  
+"	MCR	p15, 0, R1, c9, c1 \n"               
+"	MOV	R1, #6 \n"                           
+"	MCR	p15, 0, R1, c9, c1, 1 \n"            
+"	MRC	p15, 0, R1, c1, c0 \n"               
+"	ORR	R1, R1, #0x50000 \n"                 
+"	MCR	p15, 0, R1, c1, c0 \n"               
+"	LDR	R2, =0xC0200000 \n"                  
+"	MOV	R1, #1 \n"                           
+"	STR	R1, [R2, #0x10C] \n"                 
+"	MOV	R1, #0xFF \n"                        
+"	STR	R1, [R2, #0xC] \n"                   
+"	STR	R1, [R2, #0x1C] \n"                  
+"	STR	R1, [R2, #0x2C] \n"                  
+"	STR	R1, [R2, #0x3C] \n"                  
+"	STR	R1, [R2, #0x4C] \n"                  
+"	STR	R1, [R2, #0x5C] \n"                  
+"	STR	R1, [R2, #0x6C] \n"                  
+"	STR	R1, [R2, #0x7C] \n"                  
+"	STR	R1, [R2, #0x8C] \n"                  
+"	STR	R1, [R2, #0x9C] \n"                  
+"	STR	R1, [R2, #0xAC] \n"                  
+"	STR	R1, [R2, #0xBC] \n"                  
+"	STR	R1, [R2, #0xCC] \n"                  
+"	STR	R1, [R2, #0xDC] \n"                  
+"	STR	R1, [R2, #0xEC] \n"                  
+"	STR	R1, [R2, #0xFC] \n"                  
+"	LDR	R1, =0xC0400008 \n"                  
+"	LDR	R2, =0x430005 \n"                    
+"	STR	R2, [R1] \n"                         
+"	MOV	R1, #1 \n"                           
+"	LDR	R2, =0xC0243100 \n"                  
+"	STR	R2, [R1] \n"                         
+"	LDR	R2, =0xC0242010 \n"                  
+"	LDR	R1, [R2] \n"                         
+"	ORR	R1, R1, #1 \n"                       
+"	STR	R1, [R2] \n"                         
+"	LDR	R0, =0xFFEEB7F8 \n"                  
+"	LDR	R1, =0x1900 \n"                      
+"	LDR	R3, =0xABA4 \n"                      
+"loc_FFC0013C:\n"
+"	CMP	R1, R3 \n"                           
+"	LDRCC	R2, [R0], #4 \n"                   
+"	STRCC	R2, [R1], #4 \n"                   
+"	BCC	loc_FFC0013C \n"                     
+"	LDR	R1, =0x128E90 \n"                    
+"	MOV	R2, #0 \n"                           
+"loc_FFC00154:\n"
+"	CMP	R3, R1 \n"                           
+"	STRCC	R2, [R3], #4 \n"                   
+"	BCC	loc_FFC00154 \n"                     
+"	B	sub_FFC00358_my\n"  //--------->             
+	);
+};
+
+
+void __attribute__((naked,noinline)) sub_FFC00358_my() {
+	*(int*)0x1934=(int)taskHook;	// ?
+	*(int*)0x1938=(int)taskHook;	// ?
+
+	// "correct power on" is to start in record mode if the power button is held down, on cameras that can start with play or power button. Otherwise CHDK always starts in play mode.
+	*(int*)(0x20F8)= (*(int*)0xC022005C) & 1 ? 0x4000000 : 0x2000000; // replacement of sub_FFC42F30 for correct power-on.
+	
+asm volatile (
+"	LDR	R0, =0xFFC003D0 \n"                  
+"	MOV	R1, #0 \n"                           
+"	LDR	R3, =0xFFC00408 \n"                  
+"loc_FFC00364:\n"
+"	CMP	R0, R3 \n"                           
+"	LDRCC	R2, [R0], #4 \n"                   
+"	STRCC	R2, [R1], #4 \n"                   
+"	BCC	loc_FFC00364 \n"                     
+"	LDR	R0, =0xFFC00408 \n"                  
+"	MOV	R1, #0x4B0 \n"                       
+"	LDR	R3, =0xFFC0061C \n"                  
+"loc_FFC00380:\n"
+"	CMP	R0, R3 \n"                           
+"	LDRCC	R2, [R0], #4 \n"                   
+"	STRCC	R2, [R1], #4 \n"                   
+"	BCC	loc_FFC00380 \n"                     
+"	MOV	R0, #0xD2 \n"                        
+"	MSR	CPSR_cxsf, R0 \n"                    
+"	MOV	SP, #0x1000 \n"                      
+"	MOV	R0, #0xD3 \n"                        
+"	MSR	CPSR_cxsf, R0 \n"                    
+"	MOV	SP, #0x1000 \n"                      
+"	LDR	R0, =0x6C4 \n"                       
+"	LDR	R2, =0xEEEEEEEE \n"                  
+"	MOV	R3, #0x1000 \n"                      
+"loc_FFC003B4:\n"
+"	CMP	R0, R3 \n"                           
+"	STRCC	R2, [R0], #4 \n"                   
+"	BCC	loc_FFC003B4 \n"                     
+"	BL	sub_FFC0119C_my\n" //-------->               
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFC0119C_my() {
+	asm volatile (
+	"	STR	LR, [SP, #-4]! \n"                   
+"	SUB	SP, SP, #0x74 \n"                    
+"	MOV	R0, SP \n"                           
+"	MOV	R1, #0x74 \n"                        
+"	BL	sub_FFE8106C \n"                      
+"	MOV	R0, #0x53000 \n"                     
+"	STR	R0, [SP, #4] \n"                     
+// "	LDR	R0, =0x128E90 \n"                    
+"	LDR     R0, =new_sa\n"				// +
+"	LDR     R0, [R0]\n"				// +
+"	LDR	R2, =0x279C00 \n"                    
+"	LDR	R1, =0x2724A8 \n"                    
+"	STR	R0, [SP, #8] \n"                     
+"	SUB	R0, R1, R0 \n"                       
+"	ADD	R3, SP, #0xC \n"                     
+"	STR	R2, [SP] \n"                         
+"	STMIA	R3, {R0-R2} \n"                    
+"	MOV	R0, #0x22 \n"                        
+"	STR	R0, [SP, #0x18] \n"                  
+"	MOV	R0, #0x68 \n"                        
+"	STR	R0, [SP, #0x1C] \n"                  
+"	LDR	R0, =0x19B \n"                       
+"	LDR	R1, =sub_FFC05E5C_my\n"	//--------->        
+"	STR	R0, [SP, #0x20] \n"                  
+"	MOV	R0, #0x96 \n"                        
+"	STR	R0, [SP, #0x24] \n"                  
+"	MOV	R0, #0x78 \n"                        
+"	STR	R0, [SP, #0x28] \n"                  
+"	MOV	R0, #0x64 \n"                        
+"	STR	R0, [SP, #0x2C] \n"                  
+"	MOV	R0, #0 \n"                           
+"	STR	R0, [SP, #0x30] \n"                  
+"	STR	R0, [SP, #0x34] \n"                  
+"	MOV	R0, #0x10 \n"                        
+"	STR	R0, [SP, #0x5C] \n"                  
+"	MOV	R0, #0x800 \n"                       
+"	STR	R0, [SP, #0x60] \n"                  
+"	MOV	R0, #0xA0 \n"                        
+"	STR	R0, [SP, #0x64] \n"                  
+"	MOV	R0, #0x280 \n"                       
+"	STR	R0, [SP, #0x68] \n"                  
+"	MOV	R0, SP \n"                           
+"	MOV	R2, #0 \n"                           
+"	BL	sub_FFC03408 \n"                      
+"	ADD	SP, SP, #0x74 \n"                    
+"	LDR	PC, [SP], #4 \n"       
+	);
+}
+
+
+void __attribute__((naked,noinline)) sub_FFC05E5C_my() {
+	asm volatile (
+"	STMFD	SP!, {R4,LR} \n"                   
+"	BL	sub_FFC00B24 \n"                      
+"	BL	sub_FFC0A8D0 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05F70 \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	BL	sub_FFC05A98 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05F78 \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	LDR	R0, =0xFFC05F88 \n"                  
+"	BL	sub_FFC05B80 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05F90 \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	LDR	R0, =0xFFC05F88 \n"                  
+"	BL	sub_FFC03BF4 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05FA4 \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	BL	sub_FFC0A2C8 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05FB0 \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	BL	sub_FFC01680 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05FBC \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	LDMFD	SP!, {R4,LR} \n"                   
+"B       taskcreate_Startup_my\n" //-------->  
+	);
+};
+
+
+void __attribute__((naked,noinline)) taskcreate_Startup_my() {
+	asm volatile (
+"	STMFD	SP!, {R3,LR} \n"                   
+//"	BL	sub_FFC238D0 \n"                      
+"	BL	sub_FFC2ABA4 \n"                      
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFC10690 \n"                     
+"	BL	sub_FFC250BC \n"                      
+"	CMP	R0, #0 \n"                           
+"	BEQ	loc_FFC10690 \n"                     
+"	BL	sub_FFC238CC \n"                      
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFC10690 \n"                     
+"	LDR	R1, =0xC0220000 \n"                  
+"	MOV	R0, #0x44 \n"                        
+"	STR	R0, [R1, #0x20] \n"                  
+"loc_FFC1068C:\n"
+"	B	loc_FFC1068C \n"                       
+"loc_FFC10690:\n"
+//"	BL	sub_FFC238D8 \n"      			// removed for correct power-on on 'on/off' button.                
+//"	BL	sub_FFC238D4 \n"                      
+"	BL	sub_FFC28FD4 \n"                      
+"	LDR	R1, =0x2CE000 \n"                    
+"	MOV	R0, #0 \n"                           
+"	BL	sub_FFC2921C \n"                      
+"	BL	sub_FFC291C8 \n"                      
+"	MOV	R3, #0 \n"                           
+"	STR	R3, [SP] \n"                         
+"	LDR	R3, =task_Startup_my\n"	//-------->               
+"	MOV	R2, #0 \n"                           
+"	MOV	R1, #0x19 \n"                        
+"	LDR	R0, =0xFFC106D8 \n"                  
+"	BL	sub_FFC0F1A8 \n"                      
+"	MOV	R0, #0 \n"                           
+"	LDMFD	SP!, {R12,PC} \n"                  
+
+	);
+}
+
+void __attribute__((naked,noinline)) task_Startup_my() {
+	asm volatile (
+"	STMFD	SP!, {R4,LR} \n"                   
+"	BL	sub_FFC06278 \n"                      
+"	BL	sub_FFC249CC \n"                      
+"	BL	sub_FFC2326C \n"                      
+//"	BL	sub_FFC2ABE4 \n"                      
+"	BL	sub_FFC2ADD0 \n"                      
+//"	BL	sub_FFC2AC78 \n"                      
+"	BL	sub_FFC2AF6C \n"                      
+"	BL	sub_FFC2AE00 \n"                      
+"	BL	sub_FFC2846C \n"                      
+"	BL	sub_FFC2AF70 \n"                      
+"	BL      CreateTask_spytask\n"	// +
+//  "BL      sub_FFC237C0\n"		// original taskcreate_PhySw
+"	BL      taskcreate_PhySw_my\n"	// +                      
+"	BL	sub_FFC26CF8 \n"                      
+"	BL	sub_FFC2AF88 \n"                      
+//"	BL	sub_FFC22354 \n"                      
+"	BL	sub_FFC22D48 \n"                      
+"	BL	sub_FFC2A97C \n"                      
+"	BL	sub_FFC23220 \n"                      
+"	BL	sub_FFC22CE8 \n"                      
+"	BL	sub_FFC2B9B4 \n"                      
+"	BL	sub_FFC22CC0 \n"                      
+"	LDMFD	SP!, {R4,LR} \n"                   
+"	B	sub_FFC06128 \n"                       
+
+	);
+}
+
+// ROM:FFC237C0 taskcreate_PhySw
+void __attribute__((naked,noinline)) taskcreate_PhySw_my() {
+	asm volatile(
+"	STMFD	SP!, {R3-R5,LR} \n"                
+"	LDR	R4, =0x1BE4 \n"                      
+"	LDR	R0, [R4, #0x10] \n"                  
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFC237F4 \n"                     
+"	MOV	R3, #0 \n"                           
+"	STR	R3, [SP] \n"                         
+"	LDR	R3, =mykbd_task\n"		// Changed                  
+//"	MOV	R2, #0x800 \n"  
+"	MOV     R2, #0x2000\n"			// + stack size for new task_PhySw so we don't have to do stack switch
+"	B       sub_FFC237E4\n"    // Continue code
+"loc_FFC237F4:\n"
+"	B       sub_FFC237F4\n"    // Continue code
+
+	);
+}
+/*******************************************************************/
+
+// ROM:FFC705AC task_InitFileModules
+void __attribute__((naked,noinline)) init_file_modules_task() {
+	asm volatile(
+"	STMFD	SP!, {R4-R6,LR} \n"                
+"	BL	sub_FFC69DF8 \n"                      
+"	LDR	R5, =0x5006 \n"                      
+"	MOVS	R4, R0 \n"                          
+"	MOVNE	R1, #0 \n"                         
+"	MOVNE	R0, R5 \n"                         
+"	BLNE	sub_FFC6C6BC \n"                    
+"	BL	sub_FFC69E24_my\n"			//------------->                    
+"	BL      core_spytask_can_start\n"	// + set "it's safe to start" flag for spytask
+"	CMP	R4, #0 \n"                           
+"	MOVEQ	R0, R5 \n"                         
+"	LDMEQFD	SP!, {R4-R6,LR} \n"              
+"	MOVEQ	R1, #0 \n"                         
+"	BEQ	sub_FFC6C6BC \n"                     
+"	LDMFD	SP!, {R4-R6,PC} \n" 
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFC69E24_my() {
+	asm volatile(
+"	STMFD	SP!, {R4,LR} \n"                   
+"	MOV	R0, #3 \n"                           
+"	BL	sub_FFC50E94_my\n"			//---------->                   
+//"	BL	sub_FFCFA168 \n"                      
+"	LDR	R4, =0x2A30 \n"                      
+"	LDR	R0, [R4, #4] \n"                     
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFC69E5C \n"                     
+"	BL	sub_FFC500DC \n"                      
+"	BL	sub_FFCF0738 \n"                      
+"	BL	sub_FFC500DC \n"                      
+"	BL	sub_FFC4CB54 \n"                      
+"	BL	sub_FFC4FFDC \n"                      
+"	BL	sub_FFCF07CC \n"                      
+"loc_FFC69E5C:\n"
+"	MOV	R0, #1 \n"                           
+"	STR	R0, [R4] \n"                         
+"	LDMFD	SP!, {R4,PC} \n"  
+	);
+}
+
+
+void __attribute__((naked,noinline)) sub_FFC50E94_my() {
+		asm volatile(
+"	STMFD	SP!, {R4-R8,LR} \n"                
+"	MOV	R8, R0 \n"                           
+"	BL	sub_FFC50E14 \n"                      
+"	LDR	R1, =0x32350 \n"                     
+"	MOV	R6, R0 \n"                           
+"	ADD	R4, R1, R0, LSL #7 \n"               
+"	LDR	R0, [R4, #0x6C] \n"                  
+"	CMP	R0, #4 \n"                           
+"	LDREQ	R1, =0x817 \n"                     
+"	LDREQ	R0, =0xFFC50954 \n"                
+"	BLEQ	sub_FFC0F680 \n"                    
+"	MOV	R1, R8 \n"                           
+"	MOV	R0, R6 \n"                           
+"	BL	sub_FFC506CC \n"                      
+"	LDR	R0, [R4, #0x38] \n"                  
+"	BL	sub_FFC51534 \n"                      
+"	CMP	R0, #0 \n"                           
+"	STREQ	R0, [R4, #0x6C] \n"                
+"	MOV	R0, R6 \n"                           
+"	BL	sub_FFC5075C \n"                      
+"	MOV	R0, R6 \n"                           
+"	BL	sub_FFC50ABC_my\n"		//--------->                  
+"	MOV	R5, R0 \n"                           
+"	MOV	R0, R6 \n"                           
+"	BL	sub_FFC50CEC \n"                      
+"	LDR	R6, [R4, #0x3C] \n"                  
+"	AND	R7, R5, R0 \n"                       
+"	CMP	R6, #0 \n"                           
+"	LDR	R1, [R4, #0x38] \n"                  
+"	MOVEQ	R0, #0x80000001 \n"                
+"	MOV	R5, #0 \n"                           
+"	BEQ	loc_FFC50F44 \n"                     
+"	MOV	R0, R1 \n"                           
+"	BL	sub_FFC50244 \n"                      
+"	CMP	R0, #0 \n"                           
+"	MOVNE	R5, #4 \n"                         
+"	CMP	R6, #5 \n"                           
+"	ORRNE	R0, R5, #1 \n"                     
+"	BICEQ	R0, R5, #1 \n"                     
+"	CMP	R7, #0 \n"                           
+"	BICEQ	R0, R0, #2 \n"                     
+"	ORREQ	R0, R0, #0x80000000 \n"            
+"	BICNE	R0, R0, #0x80000000 \n"            
+"	ORRNE	R0, R0, #2 \n"                     
+"loc_FFC50F44:\n"
+"	CMP	R8, #7 \n"                           
+"	STR	R0, [R4, #0x40] \n"                  
+"	LDMNEFD	SP!, {R4-R8,PC} \n"              
+"	MOV	R0, R8 \n"                           
+"	BL	sub_FFC50E64 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDMEQFD	SP!, {R4-R8,LR} \n"              
+"	LDREQ	R0, =0xFFC50F90 \n"                
+"	BEQ	sub_FFC01780 \n"                     
+"	LDMFD	SP!, {R4-R8,PC} \n"         
+		);
+}
+
+void __attribute__((naked,noinline)) sub_FFC50ABC_my() {
+	asm volatile(
+"	STMFD	SP!, {R4-R6,LR} \n"                
+"	MOV	R5, R0 \n"                           
+"	LDR	R0, =0x32350 \n"                     
+"	ADD	R4, R0, R5, LSL #7 \n"               
+"	LDR	R0, [R4, #0x6C] \n"                  
+"	TST	R0, #2 \n"                           
+"	MOVNE	R0, #1 \n"                         
+"	LDMNEFD	SP!, {R4-R6,PC} \n"              
+"	LDR	R0, [R4, #0x38] \n"                  
+"	MOV	R1, R5 \n"                           
+"	BL	sub_FFC507DC_my\n"  //--------->                     
+"	CMP	R0, #0 \n"                           
+"	LDRNE	R0, [R4, #0x38] \n"                
+"	MOVNE	R1, R5 \n"                         
+"	BLNE	sub_FFC50978 \n"                    
+"	LDR	R2, =0x323D0 \n"                     
+"	ADD	R1, R5, R5, LSL #4 \n"               
+"	LDR	R1, [R2, R1, LSL #2] \n"             
+"	CMP	R1, #4 \n"                           
+"	BEQ	loc_FFC50B1C \n"                     
+"	CMP	R0, #0 \n"                           
+"	LDMEQFD	SP!, {R4-R6,PC} \n"              
+"	MOV	R0, R5 \n"                           
+"	BL	sub_FFC502D4 \n"                      
+"loc_FFC50B1C:\n"
+"	CMP	R0, #0 \n"                           
+"	LDRNE	R1, [R4, #0x6C] \n"                
+"	ORRNE	R1, R1, #2 \n"                     
+"	STRNE	R1, [R4, #0x6C] \n"                
+"	LDMFD	SP!, {R4-R6,PC} \n"   
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFC507DC_my() {
+asm volatile(
+"	STMFD	SP!, {R4-R10,LR} \n"               
+"	MOV	R9, R0 \n"                           
+"	LDR	R0, =0x32350 \n"                     
+"	MOV	R8, #0 \n"                           
+"	ADD	R5, R0, R1, LSL #7 \n"               
+"	LDR	R0, [R5, #0x3C] \n"                  
+"	MOV	R7, #0 \n"                           
+"	CMP	R0, #7 \n"                           
+"	MOV	R6, #0 \n"                           
+"	ADDLS	PC, PC, R0, LSL #2 \n"             
+"	B	loc_FFC50934 \n"                       
+"	B	loc_FFC50840 \n"                       
+"	B	loc_FFC50828 \n"                       
+"	B	loc_FFC50828 \n"                       
+"	B	loc_FFC50828 \n"                       
+"	B	loc_FFC50828 \n"                       
+"	B	loc_FFC5092C \n"                       
+"	B	loc_FFC50828 \n"                       
+"	B	loc_FFC50828 \n"                       
+"loc_FFC50828:\n"
+"	MOV	R2, #0 \n"                           
+"	MOV	R1, #0x200 \n"                       
+"	MOV	R0, #2 \n"                           
+"	BL	sub_FFC64024 \n"                      
+"	MOVS	R4, R0 \n"                          
+"	BNE	loc_FFC50848 \n"                     
+"loc_FFC50840:\n"
+"	MOV	R0, #0 \n"                           
+"	LDMFD	SP!, {R4-R10,PC} \n"               
+"loc_FFC50848:\n"
+"	LDR	R12, [R5, #0x50] \n"                 
+"	MOV	R3, R4 \n"                           
+"	MOV	R2, #1 \n"                           
+"	MOV	R1, #0 \n"                           
+"	MOV	R0, R9 \n"                           
+"	BLX	R12 \n"                              
+"	CMP	R0, #1 \n"                           
+"	BNE	loc_FFC50874 \n"                     
+"	MOV	R0, #2 \n"                           
+"	BL	sub_FFC64170 \n"                      
+"	B	loc_FFC50840 \n"                       
+"loc_FFC50874:\n"
+"	LDR	R1, [R5, #0x64] \n"                  
+"	MOV	R0, R9 \n"                           
+"	BLX	R1 \n"                               
+
+			"MOV   R1, R4\n"           // + pointer to MBR in R1
+			"BL    mbr_read_dryos\n"   // + total sectors count in R0 before and after call
+
+			// Start of DataGhost's FAT32 autodetection code
+			// Policy: If there is a partition which has type W95 FAT32, use the first one of those for image storage
+			// According to the code below, we can use R1, R2, R3 and R12.
+			// LR wasn't really used anywhere but for storing a part of the partition signature. This is the only thing
+			// that won't work with an offset, but since we can load from LR+offset into LR, we can use this to do that :)
+			"MOV     R12, R4\n"                    // Copy the MBR start address so we have something to work with
+			"MOV     LR, R4\n"                     // Save old offset for MBR signature
+			"MOV     R1, #1\n"                     // Note the current partition number
+			"B       dg_sd_fat32_enter\n"          // We actually need to check the first partition as well, no increments yet!
+"dg_sd_fat32:\n"
+			"CMP     R1, #4\n"                     // Did we already see the 4th partition?
+			"BEQ     dg_sd_fat32_end\n"            // Yes, break. We didn't find anything, so don't change anything.
+			"ADD     R12, R12, #0x10\n"            // Second partition
+			"ADD     R1, R1, #1\n"                 // Second partition for the loop
+"dg_sd_fat32_enter:\n"
+			"LDRB    R2, [R12, #0x1BE]\n"          // Partition status
+			"LDRB    R3, [R12, #0x1C2]\n"          // Partition type (FAT32 = 0xB)
+			"CMP     R3, #0xB\n"                   // Is this a FAT32 partition?
+			"CMPNE   R3, #0xC\n"                   // Not 0xB, is it 0xC (FAT32 LBA) then?
+			"BNE     dg_sd_fat32\n"                // No, it isn't. Loop again.
+			"CMP     R2, #0x00\n"                  // It is, check the validity of the partition type
+			"CMPNE   R2, #0x80\n"
+			"BNE     dg_sd_fat32\n"                // Invalid, go to next partition
+			// This partition is valid, it's the first one, bingo!
+			"MOV     R4, R12\n"                    // Move the new MBR offset for the partition detection.
+
+"dg_sd_fat32_end:\n"
+			// End of DataGhost's FAT32 autodetection code
+
+"	LDRB	R1, [R4, #0x1C9] \n"                
+"	LDRB	R3, [R4, #0x1C8] \n"                
+"	LDRB	R12, [R4, #0x1CC] \n"               
+"	MOV	R1, R1, LSL #0x18 \n"                
+"	ORR	R1, R1, R3, LSL #0x10 \n"            
+"	LDRB	R3, [R4, #0x1C7] \n"                
+"	LDRB	R2, [R4, #0x1BE] \n"                
+//"	LDRB	LR, [R4, #0x1FF] \n"                
+"	ORR	R1, R1, R3, LSL #8 \n"               
+"	LDRB	R3, [R4, #0x1C6] \n"                
+"	CMP	R2, #0 \n"                           
+"	CMPNE	R2, #0x80 \n"                      
+"	ORR	R1, R1, R3 \n"                       
+"	LDRB	R3, [R4, #0x1CD] \n"                
+"	MOV	R3, R3, LSL #0x18 \n"                
+"	ORR	R3, R3, R12, LSL #0x10 \n"           
+"	LDRB	R12, [R4, #0x1CB] \n"               
+"	ORR	R3, R3, R12, LSL #8 \n"              
+"	LDRB	R12, [R4, #0x1CA] \n"               
+"	ORR	R3, R3, R12 \n"                      
+//"	LDRB	R12, [R4, #0x1FE] \n"               
+"	LDRB    R12, [LR,#0x1FE]\n"           // + First MBR signature byte (0x55), LR is original offset.
+"	LDRB    LR, [LR,#0x1FF]\n"            // + Last MBR signature byte (0xAA), LR is original offset.
+"	BNE	loc_FFC50900 \n"                     
+"	CMP	R0, R1 \n"                           
+"	BCC	loc_FFC50900 \n"                     
+"	ADD	R2, R1, R3 \n"                       
+"	CMP	R2, R0 \n"                           
+"	CMPLS	R12, #0x55 \n"                     
+"	CMPEQ	LR, #0xAA \n"                      
+"	MOVEQ	R7, R1 \n"                         
+"	MOVEQ	R6, R3 \n"                         
+"	MOVEQ	R4, #1 \n"                         
+"	BEQ	loc_FFC50904 \n"                     
+"loc_FFC50900:\n"
+"	MOV	R4, R8 \n"                           
+"loc_FFC50904:\n"
+"	MOV	R0, #2 \n"                           
+"	BL	sub_FFC64170 \n"                      
+"	CMP	R4, #0 \n"                           
+"	BNE	loc_FFC50940 \n"                     
+"	LDR	R1, [R5, #0x64] \n"                  
+"	MOV	R7, #0 \n"                           
+"	MOV	R0, R9 \n"                           
+"	BLX	R1 \n"                               
+"	MOV	R6, R0 \n"                           
+"	B	loc_FFC50940 \n"                       
+"loc_FFC5092C:\n"
+"	MOV	R6, #0x40 \n"                        
+"	B	loc_FFC50940 \n"                       
+"loc_FFC50934:\n"
+"	LDR	R1, =0x572 \n"                       
+"	LDR	R0, =0xFFC50954 \n"                  
+"	BL	sub_FFC0F680 \n"                      
+"loc_FFC50940:\n"
+"	STR	R7, [R5, #0x44]! \n"                 
+"	STMIB	R5, {R6,R8} \n"                    
+"	MOV	R0, #1 \n"                           
+"	LDMFD	SP!, {R4-R10,PC} \n"  
+	);
+}
+
+
+
Index: /trunk/platform/a495/sub/100d/stubs_min.S
===================================================================
--- /trunk/platform/a495/sub/100d/stubs_min.S	(revision 1198)
+++ /trunk/platform/a495/sub/100d/stubs_min.S	(revision 1198)
@@ -0,0 +1,17 @@
+#include "stubs_asm.h"
+
+DEF(physw_status, 0x2E7F4)							// ok, Search "GpioStatus "
+DEF(physw_run, 0x1BE4 + 0x0C)						// ROM:FFC2378C
+DEF(FlashParamsTable,0xFFECF894)					// ROM:FFE0AA80
+DEF(zoom_busy, 0x5410 + 0x14)
+DEF(focus_busy, 0x532C + 8)
+DEF(canon_menu_active, 0x2A38 + 4)					// Ok ROM:FFC6A11C
+DEF(canon_shoot_menu_active, 0x36FC0)				// ?? Found on ROM:FFC77758 taskcreate_DSITask
+DEF(recreview_hold, 0x6308 + 2)						// ROM:FFD34410 
+DEF(zoom_status, 0x9628)							// "TerminateDeliverToZoomController"
+DEF(movie_status, 0x5468 + 0x38)					// Unknown
+DEF(enabled_refresh_physical_screen, 0x73AC+0x20)	// ROM:FFD7C7B4
+DEF(playrec_mode, 0x2794+0x4)						// ROM:FFC27ACC "MenuIn" ROM:FFC5D8F4
+DEF(levent_table, 0xFFEA2D14)						// Ok
+DEF(some_flag_for_af_scan, 0x5848)					// Correct? ROM:FFD0F9DC
+DEF(full_screen_refresh, 0x7370)					// ROM:FFD7A9FC, called by RefreshPhysicalScreen()
Index: /trunk/platform/a495/sub/100d/makefile.inc
===================================================================
--- /trunk/platform/a495/sub/100d/makefile.inc	(revision 1198)
+++ /trunk/platform/a495/sub/100d/makefile.inc	(revision 1198)
@@ -0,0 +1,27 @@
+#PLATFORMID=0x31EF
+PLATFORMID=12783
+
+PLATFORMOS=dryos
+
+# address where wif or diskboot code will be loaded by camera, ROM:FFC00134
+MEMBASEADDR=0x1900
+
+# size of memory region for CHDK
+RESTARTSTART=0x50000
+
+# ROM:FFC0014C
+MEMISOSTART=0x128E90
+
+# Base address 0xFFC00000 for A
+ROMBASEADDR=0xFFC00000
+
+
+PLFLAGS=-DMEMBASEADDR=$(MEMBASEADDR) -DMEMISOSTART=$(MEMISOSTART) -DMEMISOSIZE=$(MEMISOSIZE)
+PLFLAGS+=-DRESTARTSTART=$(RESTARTSTART)
+
+# type of diskboot encoding: undefined = none; 1 = original; 2 = sx200, d10; 3 = ixus200...
+# Dancing Bits
+NEED_ENCODED_DISKBOOT=4
+
+# FIR (requires correct keys in platform/fi2.inc)
+KEYSYS=d4a
Index: /trunk/platform/a495/sub/100d/stubs_asm.h
===================================================================
--- /trunk/platform/a495/sub/100d/stubs_asm.h	(revision 1198)
+++ /trunk/platform/a495/sub/100d/stubs_asm.h	(revision 1198)
@@ -0,0 +1,20 @@
+    .text
+
+#define DEF(n,a) \
+    .globl n; n = a
+
+#define NSTUB(name, addr)\
+    .globl _##name ;\
+    .weak _##name ;\
+    _##name: ;\
+	ldr  pc, = ## addr
+
+#define NHSTUB(name, addr)\
+    .globl _##name ;\
+    _##name: ;\
+	ldr  pc, = ## addr
+
+#define STUB(addr)\
+    .globl sub_ ## addr ;\
+    sub_ ## addr: ;\
+	ldr  pc, =0x ## addr
Index: /trunk/platform/a495/sub/100d/lib.c
===================================================================
--- /trunk/platform/a495/sub/100d/lib.c	(revision 1198)
+++ /trunk/platform/a495/sub/100d/lib.c	(revision 1198)
@@ -0,0 +1,53 @@
+#include "platform.h"
+#include "lolevel.h"
+
+char *hook_raw_image_addr()
+{
+	return (char*) 0x10E52420; // Ok, ROM:FFCE9A44
+}
+
+long hook_raw_size()
+{
+	return 0xEC04F0;           // "CRAW BUFF SIZE"
+}
+
+// Live picture buffer (shoot not pressed)
+void *vid_get_viewport_live_fb()
+{
+	return (void*)0;
+    /*void **fb=(void **)0x3E80;  // ?
+    unsigned char buff = *((unsigned char*)0x3CF0); // sub_FFC87F0C
+    if (buff == 0) buff = 2;  else buff--;    
+    return fb[buff];*/
+}
+
+// OSD buffer
+void *vid_get_bitmap_fb()
+{
+	return (void*)0x10361000; // "BmpDDev.c", 0xFFCD1DD4
+}
+
+// Live picture buffer (shoot half-pressed)
+void *vid_get_viewport_fb()
+{
+	return (void*)0x10648CC0;  // "VRAM Address" sub_FFCA6830
+}
+
+void *vid_get_viewport_fb_d()
+{
+	return (void*)(*(int*)(0x2540+0x54)); // sub_FFC528C0 / sub_FFC53554?
+}
+
+long vid_get_bitmap_screen_width() { return 360; }
+long vid_get_bitmap_screen_height() { return 240; }
+
+long vid_get_viewport_height() { return 240; }
+
+long vid_get_bitmap_buffer_width() { return 360; }
+long vid_get_bitmap_buffer_height() { return 240; }
+
+char *camera_jpeg_count_str()
+{
+	return (char*)0x7486C;  // "9999"
+}
+
Index: /trunk/platform/a495/sub/100d/movie_rec.c
===================================================================
--- /trunk/platform/a495/sub/100d/movie_rec.c	(revision 1198)
+++ /trunk/platform/a495/sub/100d/movie_rec.c	(revision 1198)
@@ -0,0 +1,327 @@
+#include "conf.h"
+
+int *video_quality = &conf.video_quality;
+int *video_mode    = &conf.video_mode;
+
+long def_table[24]={0x2000, 0x38D, 0x788, 0x5800, 0x9C5, 0x14B8, 0x10000, 0x1C6A, 0x3C45, 0x8000, 0xE35, 0x1E23,
+           0x1CCD, -0x2E1, -0x579, 0x4F33, -0x7EB, -0xF0C, 0xE666, -0x170A, -0x2BC6, 0x7333, -0xB85, -0x15E3};
+
+long table[24];
+
+void change_video_tables(int a, int b){
+ int i;
+ for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b; 
+}
+
+long CompressionRateTable[]={0x60, 0x5D, 0x5A, 0x57, 0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 9, 7, 6, 5, 4, 3, 2, 1};
+
+
+
+
+void __attribute__((naked,noinline)) movie_record_task(){ 
+	asm volatile(
+"	STMFD	SP!, {R2-R8,LR} \n"                
+"	LDR	R8, =0x346 \n"                       
+"	LDR	R7, =0x2710 \n"                      
+"	LDR	R4, =0x5468 \n"                      
+"	MOV	R6, #0 \n"                           
+"	MOV	R5, #1 \n"                           
+"loc_FFD0C994:\n"
+"	LDR	R0, [R4, #0x18] \n"                  
+"	MOV	R2, #0 \n"                           
+"	ADD	R1, SP, #4 \n"                       
+"	BL	sub_FFC28AA0 \n"                      
+"	LDR	R0, [R4, #0x20] \n"                  
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFD0CA64 \n"                     
+"	LDR	R0, [SP, #4] \n"                     
+"	LDR	R1, [R0] \n"                         
+"	SUB	R1, R1, #2 \n"                       
+"	CMP	R1, #9 \n"                           
+"	ADDLS	PC, PC, R1, LSL #2 \n"             
+"	B	loc_FFD0CA64 \n"                       
+"	B	loc_FFD0CA18 \n"                       
+"	B	loc_FFD0CA38 \n"                       
+"	B	loc_FFD0CA48 \n"                       
+"	B	loc_FFD0CA50 \n"                       
+"	B	loc_FFD0CA20 \n"                       
+"	B	loc_FFD0CA58 \n"                       
+"	B	loc_FFD0CA28 \n"                       
+"	B	loc_FFD0CA64 \n"                       
+"	B	loc_FFD0CA60 \n"                       
+"	B	loc_FFD0C9F0 \n"                       
+"loc_FFD0C9F0:\n"
+"	LDR	R0, =0xFFD0C688 \n"                  
+"	STR	R6, [R4, #0x34] \n"                  
+"	STR	R0, [R4, #0xA8] \n"                  
+"	LDR	R0, =0xFFD0C118 \n"                  
+"	LDR	R2, =0xFFD0C034 \n"                  
+"	LDR	R1, =0x6EB90 \n"                     
+"	STR	R6, [R4, #0x24] \n"                  
+"	BL	sub_FFCB6618 \n"                      
+"	STR	R5, [R4, #0x38] \n"                  
+"	B	loc_FFD0CA64 \n"                       
+"loc_FFD0CA18:\n"
+"	BL      unlock_optical_zoom\n"		//  +
+"	BL	sub_FFD0C780 \n"                      
+"	B	loc_FFD0CA64 \n"                       
+"loc_FFD0CA20:\n"
+"	BL	sub_FFD0C488_my\n"			//---------->                      
+"	B	loc_FFD0CA64 \n"                       
+"loc_FFD0CA28:\n"
+"	LDR	R1, [R0, #0x10] \n"                  
+"	LDR	R0, [R0, #4] \n"                     
+"	BL	sub_FFDF8CF0 \n"                      
+"	B	loc_FFD0CA64 \n"                       
+"loc_FFD0CA38:\n"
+"	LDR	R0, [R4, #0x38] \n"                  
+"	CMP	R0, #5 \n"                           
+"	STRNE	R5, [R4, #0x28] \n"                
+"	B	loc_FFD0CA64 \n"                       
+"loc_FFD0CA48:\n"
+"	BL	sub_FFD0C2A0 \n"                      
+"	B	loc_FFD0CA64 \n"                       
+"loc_FFD0CA50:\n"
+"	BL	sub_FFD0C164 \n"                      
+"	B	loc_FFD0CA64 \n"                       
+"loc_FFD0CA58:\n"
+"	BL	sub_FFD0BFC0 \n"                      
+"	B	loc_FFD0CA64 \n"                       
+"loc_FFD0CA60:\n"
+"	BL	sub_FFD0CBCC \n"                      
+"loc_FFD0CA64:\n"
+"	LDR	R1, [SP, #4] \n"                     
+"	LDR	R3, =0xFFD0BE50 \n"                  
+"	STR	R6, [R1] \n"                         
+"	STR	R8, [SP] \n"                         
+"	LDR	R0, [R4, #0x1C] \n"                  
+"	MOV	R2, R7 \n"                           
+"	BL	sub_FFC0F5C0 \n"                      
+"	B	loc_FFD0C994 \n"                 
+	);
+}
+
+
+void __attribute__((naked,noinline)) sub_FFD0C488_my(){ 
+	asm volatile(
+"	STMFD	SP!, {R4-R8,LR} \n"                
+"	SUB	SP, SP, #0x40 \n"                    
+"	MOV	R6, #0 \n"                           
+"	LDR	R5, =0x5468 \n"                      
+"	MOV	R4, R0 \n"                           
+"	STR	R6, [SP, #0x30] \n"                  
+"	STR	R6, [SP, #0x28] \n"                  
+"	LDR	R0, [R5, #0x38] \n"                  
+"	MOV	R8, #4 \n"                           
+"	CMP	R0, #3 \n"                           
+"	STREQ	R8, [R5, #0x38] \n"                
+"	LDR	R0, [R5, #0xA8] \n"                  
+"	BLX	R0 \n"                               
+"	LDR	R0, [R5, #0x38] \n"                  
+"	CMP	R0, #4 \n"                           
+"	BNE	loc_FFD0C560 \n"                     
+"	ADD	R3, SP, #0x28 \n"                    
+"	ADD	R2, SP, #0x2C \n"                    
+"	ADD	R1, SP, #0x30 \n"                    
+"	ADD	R0, SP, #0x34 \n"                    
+"	BL	sub_FFDF8E84 \n"                      
+"	CMP	R0, #0 \n"                           
+"	MOV	R7, #1 \n"                           
+"	BNE	loc_FFD0C504 \n"                     
+"	LDR	R1, [R5, #0x28] \n"                  
+"	CMP	R1, #1 \n"                           
+"	BNE	loc_FFD0C568 \n"                     
+"	LDR	R1, [R5, #0x60] \n"                  
+"	LDR	R2, [R5, #0x3C] \n"                  
+"	CMP	R1, R2 \n"                           
+"	BCC	loc_FFD0C568 \n"                     
+"loc_FFD0C504:\n"
+"	CMP	R0, #0x80000001 \n"                  
+"	STREQ	R8, [R5, #0x64] \n"                
+"	BEQ	loc_FFD0C53C \n"                     
+"	CMP	R0, #0x80000003 \n"                  
+"	STREQ	R7, [R5, #0x64] \n"                
+"	BEQ	loc_FFD0C53C \n"                     
+"	CMP	R0, #0x80000005 \n"                  
+"	MOVEQ	R0, #2 \n"                         
+"	BEQ	loc_FFD0C538 \n"                     
+"	CMP	R0, #0x80000007 \n"                  
+"	STRNE	R6, [R5, #0x64] \n"                
+"	BNE	loc_FFD0C53C \n"                     
+"	MOV	R0, #3 \n"                           
+"loc_FFD0C538:\n"
+"	STR	R0, [R5, #0x64] \n"                  
+"loc_FFD0C53C:\n"
+"	LDR	R0, =0x6EBC0 \n"                     
+"	LDR	R0, [R0, #8] \n"                     
+"	CMP	R0, #0 \n"                           
+"	BEQ	loc_FFD0C554 \n"                     
+"	BL	sub_FFC445C4 \n"                      
+"	B	loc_FFD0C558 \n"                       
+"loc_FFD0C554:\n"
+"	BL	sub_FFD0BFC0 \n"                      
+"loc_FFD0C558:\n"
+"	MOV	R0, #5 \n"                           
+"	STR	R0, [R5, #0x38] \n"                  
+"loc_FFD0C560:\n"
+"	ADD	SP, SP, #0x40 \n"                    
+"	LDMFD	SP!, {R4-R8,PC} \n"                
+"loc_FFD0C568:\n"
+"	LDR	LR, [SP, #0x30] \n"                  
+"	CMP	LR, #0 \n"                           
+"	BEQ	loc_FFD0C630 \n"                     
+"	STR	R7, [R5, #0x2C] \n"                  
+"	LDR	R0, [R5, #0x7C] \n"                  
+"	LDR	R1, [R4, #0x14] \n"                  
+"	LDR	R2, [R4, #0x18] \n"                  
+"	LDR	R12, [R4, #0xC] \n"                  
+"	ADD	R3, SP, #0x38 \n"                    
+"	ADD	R8, SP, #0x14 \n"                    
+"	STMIA	R8, {R0-R3} \n"                    
+"	LDR	R3, [R5, #0x68] \n"                  
+"	ADD	R2, SP, #0x3C \n"                    
+"	ADD	R8, SP, #8 \n"                       
+"	LDRD	R0, [SP, #0x28] \n"                 
+"	STMIA	R8, {R0,R2,R3} \n"                 
+"	STR	R1, [SP, #4] \n"                     
+"	STR	LR, [SP] \n"                         
+"	LDMIB	R4, {R0,R1} \n"                    
+"	LDR	R3, [SP, #0x34] \n"                  
+"	MOV	R2, R12 \n"                          
+"	BL	sub_FFDCE504 \n"                      
+"	LDR	R0, [R5, #0x10] \n"                  
+"	LDR	R1, [R5, #0x58] \n"                  
+"	BL	sub_FFC0F034 \n"                      
+"	CMP	R0, #9 \n"                           
+"	BNE	loc_FFD0C5E4 \n"                     
+"	BL	sub_FFDF9470 \n"                      
+"	MOV	R0, #0x90000 \n"                     
+"	STR	R7, [R5, #0x38] \n"                  
+"	B	loc_FFD0C5FC \n"                       
+"loc_FFD0C5E4:\n"
+"	LDR	R0, [SP, #0x38] \n"                  
+"	CMP	R0, #0 \n"                           
+"	BEQ	loc_FFD0C604 \n"                     
+"	BL	sub_FFDF9470 \n"                      
+"	MOV	R0, #0xA0000 \n"                     
+"	STR	R7, [R5, #0x38] \n"                  
+"loc_FFD0C5FC:\n"
+"	BL	sub_FFC6D0E0 \n"                      
+"	B	loc_FFD0C560 \n"                       
+"loc_FFD0C604:\n"
+"	BL	sub_FFDCE5C8 \n"                      
+"	LDR	R0, [SP, #0x34] \n"                  
+"	LDR	R1, [SP, #0x3C] \n"                  
+"	BL	sub_FFDF9218 \n"                      
+"	LDR	R0, [R5, #0x5C] \n"                  
+"	LDR	R1, =0x54E4 \n"                      
+"	ADD	R0, R0, #1 \n"                       
+"	STR	R0, [R5, #0x5C] \n"                  
+"	LDR	R0, [SP, #0x3C] \n"                  
+"	MOV	R2, #0 \n"                           
+"	BL	sub_FFDF703C_my\n"  //---------->                  
+"loc_FFD0C630:\n"
+"	LDR	R0, [R5, #0x60] \n"                  
+"	ADD	R0, R0, #1 \n"                       
+"	STR	R0, [R5, #0x60] \n"                  
+"	LDR	R1, [R5, #0x4C] \n"                  
+"	MUL	R0, R1, R0 \n"                       
+"	LDR	R1, [R5, #0x48] \n"                  
+"	BL	sub_FFE8291C \n"                      
+"	MOV	R4, R0 \n"                           
+"	BL	sub_FFDF94A8 \n"                      
+"	LDR	R1, [R5, #0x80] \n"                  
+"	CMP	R1, R4 \n"                           
+"	BNE	loc_FFD0C66C \n"                     
+"	LDR	R0, [R5, #0x30] \n"                  
+"	CMP	R0, #1 \n"                           
+"	BNE	loc_FFD0C680 \n"                     
+"loc_FFD0C66C:\n"
+"	LDR	R1, [R5, #0x8C] \n"                  
+"	MOV	R0, R4 \n"                           
+"	BLX	R1 \n"                               
+"	STR	R4, [R5, #0x80] \n"                  
+"	STR	R6, [R5, #0x30] \n"                  
+"loc_FFD0C680:\n"
+"	STR	R6, [R5, #0x2C] \n"                  
+"	B	loc_FFD0C560 \n"                       
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFDF703C_my(){ 
+	asm volatile(
+"	STMFD	SP!, {R4-R8,LR} \n"                
+"	LDR	R4, =0x8940 \n"                      
+"	LDR	LR, [R4] \n"                         
+"	LDR	R2, [R4, #8] \n"                     
+"	CMP	LR, #0 \n"                           
+"	LDRNE	R3, [R4, #0xC] \n"                 
+"	MOV	R5, R2 \n"                           
+"	CMPNE	R3, #1 \n"                         
+"	MOVEQ	R2, #0 \n"                         
+"	STREQ	R0, [R4] \n"                       
+"	STREQ	R2, [R4, #0xC] \n"                 
+"	BEQ	loc_FFDF7108 \n"                     
+"	LDR	R3, [R4, #4] \n"                     
+"	LDR	R7, =0xFFEC3508 \n"                  
+"	ADD	R12, R3, R3, LSL #1 \n"              
+"	LDR	R3, [R7, R12, LSL #2] \n"            
+"	ADD	R6, R7, #0x30 \n"                    
+"	LDR	R8, [R6, R12, LSL #2] \n"            
+"	SUB	R3, LR, R3 \n"                       
+"	CMP	R3, #0 \n"                           
+"	SUB	LR, LR, R8 \n"                       
+"	BLE	loc_FFDF70C4 \n"                     
+"	ADD	R12, R7, R12, LSL #2 \n"             
+"	LDR	LR, [R12, #4] \n"                    
+"	CMP	LR, R3 \n"                           
+"	ADDGE	R2, R2, #1 \n"                     
+"	BGE	loc_FFDF70B8 \n"                     
+"	LDR	R12, [R12, #8] \n"                   
+"	CMP	R12, R3 \n"                          
+"	ADDLT	R2, R2, #3 \n"                     
+"	ADDGE	R2, R2, #2 \n"                     
+"loc_FFDF70B8:\n"
+//"	CMP	R2, #0x17 \n"                        
+//"	MOVGE	R2, #0x16 \n" 
+"	CMP     R2, #0x1A\n"   // +
+"	MOVGE   R2, #0x19\n"   // +                     
+"	B	loc_FFDF70F8 \n"                       
+"loc_FFDF70C4:\n"
+"	CMP	LR, #0 \n"                           
+"	BGE	loc_FFDF70F8 \n"                     
+"	ADD	R3, R6, R12, LSL #2 \n"              
+"	LDR	R12, [R3, #4] \n"                    
+"	CMP	R12, LR \n"                          
+"	SUBLE	R2, R2, #1 \n"                     
+"	BLE	loc_FFDF70F0 \n"                     
+"	LDR	R3, [R3, #8] \n"                     
+"	CMP	R3, LR \n"                           
+"	SUBGT	R2, R2, #3 \n"                     
+"	SUBLE	R2, R2, #2 \n"                     
+"loc_FFDF70F0:\n"
+"	CMP	R2, #0 \n"                           
+"	MOVLT	R2, #0 \n"                         
+"loc_FFDF70F8:\n"
+"	CMP	R2, R5 \n"                           
+"	STRNE	R2, [R4, #8] \n"                   
+"	MOVNE	R2, #1 \n"                         
+"	STRNE	R2, [R4, #0xC] \n"                 
+"loc_FFDF7108:\n"
+"	LDR	R2,=CompressionRateTable\n"               
+"	LDR	R3, [R4, #8] \n"                     
+"	LDR	R2, [R2, R3, LSL #2] \n"             
+
+"	LDR     R3, =video_mode\n"      // +
+"	LDR     R3, [R3]\n"             // +
+"	LDR     R3, [R3]\n"             // +
+"	CMP     R3, #1\n"               // +
+"	LDREQ   R3, =video_quality\n"   // +     
+"	LDREQ   R3, [R3]\n"             // +     
+"	LDREQ   R2, [R3]\n"             // +  
+
+"	STR	R2, [R1] \n"                         
+"	STR	R0, [R4] \n"                         
+"	LDMFD	SP!, {R4-R8,PC} \n"                          
+	);
+}
Index: /trunk/platform/a495/sub/100d/stubs_auto.S
===================================================================
--- /trunk/platform/a495/sub/100d/stubs_auto.S	(revision 1198)
+++ /trunk/platform/a495/sub/100d/stubs_auto.S	(revision 1198)
@@ -0,0 +1,207 @@
+/* THIS FILE IS GENERATED */
+/* DO NOT EDIT THIS FILE! */
+
+#include "stubs_asm.h"
+
+STUB(FFC00358)
+STUB(FFC00B24)
+STUB(FFC0119C)
+STUB(FFC01680)
+STUB(FFC01780)
+STUB(FFC03408)
+STUB(FFC03BF4)
+STUB(FFC05A98)
+STUB(FFC05B80)
+STUB(FFC05F50)
+STUB(FFC06128)
+STUB(FFC06278)
+STUB(FFC0A2C8)
+STUB(FFC0A8D0)
+STUB(FFC0F034)
+STUB(FFC0F1A8)
+STUB(FFC0F438)
+STUB(FFC0F480)
+STUB(FFC0F4B4)
+STUB(FFC0F5C0)
+STUB(FFC0F680)
+STUB(FFC22354)
+STUB(FFC22CC0)
+STUB(FFC22CE8)
+STUB(FFC22D48)
+STUB(FFC23220)
+STUB(FFC2326C)
+STUB(FFC237C0)
+STUB(FFC237E4)
+STUB(FFC237F4)
+STUB(FFC238CC)
+STUB(FFC238D0)
+STUB(FFC238D4)
+STUB(FFC238D8)
+STUB(FFC249CC)
+STUB(FFC250BC)
+STUB(FFC26C78)
+STUB(FFC26CF8)
+STUB(FFC2846C)
+STUB(FFC2866C)
+STUB(FFC28750)
+STUB(FFC28810)
+STUB(FFC28844)
+STUB(FFC28AA0)
+STUB(FFC28FD4)
+STUB(FFC291C8)
+STUB(FFC2921C)
+STUB(FFC2A97C)
+STUB(FFC2ABA4)
+STUB(FFC2ABE4)
+STUB(FFC2AC78)
+STUB(FFC2ADD0)
+STUB(FFC2AE00)
+STUB(FFC2AF6C)
+STUB(FFC2AF70)
+STUB(FFC2AF88)
+STUB(FFC2B9B4)
+STUB(FFC445C4)
+STUB(FFC455A8)
+STUB(FFC4CB54)
+STUB(FFC4FFDC)
+STUB(FFC500DC)
+STUB(FFC50244)
+STUB(FFC502D4)
+STUB(FFC506CC)
+STUB(FFC5075C)
+STUB(FFC507DC)
+STUB(FFC50978)
+STUB(FFC50ABC)
+STUB(FFC50CEC)
+STUB(FFC50E14)
+STUB(FFC50E64)
+STUB(FFC50E94)
+STUB(FFC51534)
+STUB(FFC5753C)
+STUB(FFC57934)
+STUB(FFC59598)
+STUB(FFC59770)
+STUB(FFC59AE4)
+STUB(FFC59AEC)
+STUB(FFC59AF4)
+STUB(FFC59B04)
+STUB(FFC59C9C)
+STUB(FFC59D04)
+STUB(FFC59D8C)
+STUB(FFC59E9C)
+STUB(FFC59EE8)
+STUB(FFC59F24)
+STUB(FFC5A0A8)
+STUB(FFC5A358)
+STUB(FFC5A3EC)
+STUB(FFC5C020)
+STUB(FFC5C0A0)
+STUB(FFC5C0BC)
+STUB(FFC5C0E8)
+STUB(FFC5C0FC)
+STUB(FFC5C128)
+STUB(FFC5C440)
+STUB(FFC5D7E0)
+STUB(FFC64024)
+STUB(FFC64170)
+STUB(FFC693FC)
+STUB(FFC6952C)
+STUB(FFC696BC)
+STUB(FFC698F4)
+STUB(FFC69DF8)
+STUB(FFC69E24)
+STUB(FFC6C6BC)
+STUB(FFC6D0E0)
+STUB(FFC80C08)
+STUB(FFC80E90)
+STUB(FFC80EFC)
+STUB(FFC8118C)
+STUB(FFC8164C)
+STUB(FFC816D4)
+STUB(FFC81904)
+STUB(FFC81DB4)
+STUB(FFC890FC)
+STUB(FFC8DE04)
+STUB(FFC8DF14)
+STUB(FFC8DF6C)
+STUB(FFC8DFC4)
+STUB(FFC8E01C)
+STUB(FFC8E0A0)
+STUB(FFC8E1E0)
+STUB(FFC8E298)
+STUB(FFC8E51C)
+STUB(FFC8E724)
+STUB(FFC8E99C)
+STUB(FFC8EB94)
+STUB(FFC8EE50)
+STUB(FFC8EF90)
+STUB(FFC8F2E8)
+STUB(FFC8F490)
+STUB(FFC8F784)
+STUB(FFC8F888)
+STUB(FFC8FAC4)
+STUB(FFC8FC40)
+STUB(FFC8FDDC)
+STUB(FFC8FF40)
+STUB(FFC9021C)
+STUB(FFC912BC)
+STUB(FFC91554)
+STUB(FFC915B4)
+STUB(FFC9290C)
+STUB(FFC9293C)
+STUB(FFC92980)
+STUB(FFC92AEC)
+STUB(FFC92B98)
+STUB(FFC92C38)
+STUB(FFC92CD4)
+STUB(FFCB3A60)
+STUB(FFCB6618)
+STUB(FFCB80F0)
+STUB(FFCE5C8C)
+STUB(FFCF0738)
+STUB(FFCF07CC)
+STUB(FFCFA168)
+STUB(FFD0850C)
+STUB(FFD08660)
+STUB(FFD08794)
+STUB(FFD0BFC0)
+STUB(FFD0C164)
+STUB(FFD0C2A0)
+STUB(FFD0C488)
+STUB(FFD0C780)
+STUB(FFD0CBCC)
+STUB(FFD0FA4C)
+STUB(FFD0FA9C)
+STUB(FFD0FAD8)
+STUB(FFD0FDE0)
+STUB(FFD1000C)
+STUB(FFD10204)
+STUB(FFD10298)
+STUB(FFD10358)
+STUB(FFD10424)
+STUB(FFD10468)
+STUB(FFD10550)
+STUB(FFD106A0)
+STUB(FFD10730)
+STUB(FFD107F0)
+STUB(FFD10D54)
+STUB(FFD10E1C)
+STUB(FFD10ED0)
+STUB(FFD110A8)
+STUB(FFD110F4)
+STUB(FFD11770)
+STUB(FFD11904)
+STUB(FFD11F70)
+STUB(FFD2F660)
+STUB(FFD7D848)
+STUB(FFDCE504)
+STUB(FFDCE5C8)
+STUB(FFDF703C)
+STUB(FFDF8CF0)
+STUB(FFDF8E84)
+STUB(FFDF9218)
+STUB(FFDF9470)
+STUB(FFDF94A8)
+STUB(FFE80E10)
+STUB(FFE8106C)
+STUB(FFE8291C)
Index: /trunk/platform/a495/sub/100d/Makefile
===================================================================
--- /trunk/platform/a495/sub/100d/Makefile	(revision 1198)
+++ /trunk/platform/a495/sub/100d/Makefile	(revision 1198)
@@ -0,0 +1,6 @@
+topdir=../../../../
+
+OBJS=boot.o stubs_min.o stubs_auto.o stubs_entry.o lib.o stubs_entry_2.o capt_seq.o movie_rec.o
+STUBS_AUTO_DEPS=boot.c capt_seq.c movie_rec.c
+
+include  $(topdir)platform/makefile_sub.inc
Index: /trunk/platform/a495/sub/100e/capt_seq.c
===================================================================
--- /trunk/platform/a495/sub/100e/capt_seq.c	(revision 1198)
+++ /trunk/platform/a495/sub/100e/capt_seq.c	(revision 1198)
@@ -0,0 +1,895 @@
+#include "lolevel.h"
+#include "platform.h"
+#include "core.h"
+#include "conf.h"
+
+static long *nrflag = (long*)0x5828;	// ??? ROM:FFD10EE0 "ShutterSoundTask"
+
+#include "../../../generic/capt_seq.c"
+
+//** capt_seq_task  @ 0xFFC59274 
+
+void __attribute__((naked,noinline)) capt_seq_task() {
+	asm volatile (
+"	STMFD	SP!, {R3-R7,LR} \n"                
+"	LDR	R7, =0x33324 \n"                     
+"	LDR	R6, =0x26C0 \n"                      
+"loc_FFC59280:\n"
+"	LDR	R0, [R6, #4] \n"                     
+"	MOV	R2, #0 \n"                           
+"	MOV	R1, SP \n"                           
+"	BL	sub_FFC28AA0 \n"                      
+"	TST	R0, #1 \n"                           
+"	BEQ	loc_FFC592AC \n"                     
+"	LDR	R1, =0x5B4 \n"                       
+"	LDR	R0, =0xFFC58E80 \n"                  
+"	BL	sub_FFC0F680 \n"                      
+"	BL	sub_FFC0F438 \n"                      
+"	LDMFD	SP!, {R3-R7,PC} \n"                
+"loc_FFC592AC:\n"
+"	LDR	R0, [SP] \n"                         
+"	LDR	R1, [R0] \n"                         
+"	CMP	R1, #0x1D \n"                        
+"	ADDLS	PC, PC, R1, LSL #2 \n"             
+"	B	loc_FFC594BC \n"                       
+"	B	loc_FFC59338 \n"                       
+"	B	loc_FFC59340 \n"                       
+"	B	loc_FFC59368 \n"                       
+"	B	loc_FFC5937C \n"                       
+"	B	loc_FFC59374 \n"                       
+"	B	loc_FFC59384 \n"                       
+"	B	loc_FFC5938C \n"                       
+"	B	loc_FFC59398 \n"                       
+"	B	loc_FFC593F0 \n"                       
+"	B	loc_FFC5937C \n"                       
+"	B	loc_FFC593F8 \n"                       
+"	B	loc_FFC59404 \n"                       
+"	B	loc_FFC5940C \n"                       
+"	B	loc_FFC59414 \n"                       
+"	B	loc_FFC5941C \n"                       
+"	B	loc_FFC59424 \n"                       
+"	B	loc_FFC5942C \n"                       
+"	B	loc_FFC59434 \n"                       
+"	B	loc_FFC59440 \n"                       
+"	B	loc_FFC59448 \n"                       
+"	B	loc_FFC59450 \n"                       
+"	B	loc_FFC59458 \n"                       
+"	B	loc_FFC59460 \n"                       
+"	B	loc_FFC5946C \n"                       
+"	B	loc_FFC59474 \n"                       
+"	B	loc_FFC5947C \n"                       
+"	B	loc_FFC59484 \n"                       
+"	B	loc_FFC5948C \n"                       
+"	B	loc_FFC59498 \n"                       
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59338:\n"
+"	BL	sub_FFC59B54 \n"  
+"	BL      shooting_expo_param_override\n"      // +                    
+"	B	loc_FFC59390 \n"                       
+"loc_FFC59340:\n"
+"	MOV	R0, #0xC \n"                         
+"	BL	sub_FFC5D830 \n"                      
+"	TST	R0, #1 \n"                           
+"	LDR	R0, [SP] \n"                         
+"	MOVNE	R1, #1 \n"                         
+"	LDRNE	R2, [R0, #0xC] \n"                 
+"	MOVNE	R0, #1 \n"                         
+"	BNE	loc_FFC593E8 \n"                     
+"	BL	sub_FFC595E8_my \n"  //--------->                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59368:\n"
+"	MOV	R0, #1 \n"                           
+"	BL	sub_FFC59DDC \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59374:\n"
+"	BL	sub_FFC597C0 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC5937C:\n"
+"	BL	sub_FFC59B34 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59384:\n"
+"	BL	sub_FFC59B3C \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC5938C:\n"
+"	BL	sub_FFC59CEC \n"                      
+"loc_FFC59390:\n"
+"	BL	sub_FFC5758C \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59398:\n"
+"	LDR	R4, [R0, #0xC] \n"                   
+"	BL	sub_FFC59B44 \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD0FE90 \n"                      
+"	TST	R0, #1 \n"                           
+"	MOV	R5, R0 \n"                           
+"	BNE	loc_FFC593D8 \n"                     
+"	BL	sub_FFC6970C \n"                      
+"	STR	R0, [R4, #0x18] \n"                  
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD10E04 \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD111A4 \n"                      
+"	MOV	R5, R0 \n"                           
+"	LDR	R0, [R4, #0x18] \n"                  
+"	BL	sub_FFC69944 \n"                      
+"loc_FFC593D8:\n"
+"	BL	sub_FFC59B34 \n"                      
+"	MOV	R2, R4 \n"                           
+"	MOV	R1, #9 \n"                           
+"	MOV	R0, R5 \n"                           
+"loc_FFC593E8:\n"
+"	BL	sub_FFC57984 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC593F0:\n"
+"	BL	sub_FFC59D54 \n"                      
+"	B	loc_FFC59390 \n"                       
+"loc_FFC593F8:\n"
+"	LDR	R0, [R7, #0x4C] \n"                  
+"	BL	sub_FFC5A0F8 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59404:\n"
+"	BL	sub_FFC5A3A8 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC5940C:\n"
+"	BL	sub_FFC5A43C \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59414:\n"
+"	BL	sub_FFD100BC \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC5941C:\n"
+"	BL	sub_FFD102B4 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59424:\n"
+"	BL	sub_FFD10348 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC5942C:\n"
+"	BL	sub_FFD10408 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59434:\n"
+"	MOV	R0, #0 \n"                           
+"	BL	sub_FFD10600 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59440:\n"
+"	BL	sub_FFD10750 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59448:\n"
+"	BL	sub_FFD107E0 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59450:\n"
+"	BL	sub_FFD108A0 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59458:\n"
+"	BL	sub_FFC59F38 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59460:\n"
+"	BL	sub_FFC59F74 \n"                      
+"	BL	sub_FFC26C78 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC5946C:\n"
+"	BL	sub_FFD104D4 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59474:\n"
+"	BL	sub_FFD10518 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC5947C:\n"
+"	BL	sub_FFC5C070 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59484:\n"
+"	BL	sub_FFC5C0F0 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC5948C:\n"
+"	BL	sub_FFC5C14C \n"                      
+"	BL	sub_FFC5C10C \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC59498:\n"
+"	LDRH	R0, [R7, #0x8C] \n"                 
+"	CMP	R0, #4 \n"                           
+"	LDRNEH	R0, [R7] \n"                      
+"	SUBNE	R12, R0, #0x8200 \n"               
+"	SUBNES	R12, R12, #0x2A \n"               
+"	BNE	loc_FFC594C8 \n"                     
+"	BL	sub_FFC5C0F0 \n"                      
+"	BL	sub_FFC5C490 \n"                      
+"	B	loc_FFC594C8 \n"                       
+"loc_FFC594BC:\n"
+"	LDR	R1, =0x70B \n"                       
+"	LDR	R0, =0xFFC58E80 \n"                  
+"	BL	sub_FFC0F680 \n"                      
+"loc_FFC594C8:\n"
+"	LDR	R0, [SP] \n"                         
+"	LDR	R1, [R0, #4] \n"                     
+"	LDR	R0, [R6] \n"                         
+"	BL	sub_FFC28810 \n"                      
+"	LDR	R4, [SP] \n"                         
+"	LDR	R0, [R4, #8] \n"                     
+"	CMP	R0, #0 \n"                           
+"	LDREQ	R1, =0x132 \n"                     
+"	LDREQ	R0, =0xFFC58E80 \n"                
+"	BLEQ	sub_FFC0F680 \n"                    
+"	MOV	R0, #0 \n"                           
+"	STR	R0, [R4, #8] \n"                     
+"	B	loc_FFC59280 \n"    
+	);
+} 
+
+//** sub_FFC595E8_my  @ 0xFFC595E8 
+
+void __attribute__((naked,noinline)) sub_FFC595E8_my(){ // 
+	asm volatile(
+"	STMFD	SP!, {R3-R5,LR} \n"                
+"	LDR	R4, [R0, #0xC] \n"                   
+"	LDR	R0, [R4, #8] \n"                     
+"	ORR	R0, R0, #1 \n"                       
+"	STR	R0, [R4, #8] \n"                     
+"	BL	sub_FFC59B44 \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFC59EEC \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD0FAFC \n"                      
+"	CMP	R0, #0 \n"                           
+"	MOV	R0, R4 \n"                           
+"	BEQ	loc_FFC59638 \n"                     
+"	BL	sub_FFD0FB88 \n"                      
+"	TST	R0, #1 \n"                           
+"	MOVNE	R2, R4 \n"                         
+"	LDMNEFD	SP!, {R3-R5,LR} \n"              
+"	MOVNE	R1, #1 \n"                         
+"	BNE	sub_FFC57984 \n"                     
+"	B	loc_FFC5963C \n"                       
+"loc_FFC59638:\n"
+"	BL	sub_FFD0FB4C \n"                      
+"loc_FFC5963C:\n"
+"	MOV	R0, #0 \n"                           
+"	STR	R0, [SP] \n"                         
+"	LDR	R0, =0x33324 \n"                     
+"	MOV	R2, #2 \n"                           
+"	LDRH	R0, [R0, #0x8A] \n"                 
+"	MOV	R1, SP \n"                           
+"	CMP	R0, #3 \n"                           
+"	LDRNE	R0, [R4, #0xC] \n"                 
+"	CMPNE	R0, #1 \n"                         
+"	MOVHI	R0, #1 \n"                         
+"	STRHI	R0, [SP] \n"                       
+"	LDR	R0, =0x127 \n"                       
+"	BL	sub_FFC6944C \n"                      
+"	BL	sub_FFD2F710 \n"                      
+"	BL	sub_FFC6970C \n"                      
+"	STR	R0, [R4, #0x18] \n"                  
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD10E04 \n"                      
+"	BL	sub_FFD11820 \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFD10ECC_my \n"             //---------->                      
+"	MOV	R5, R0 \n"   
+"	BL      capt_seq_hook_raw_here\n"      // +                        
+"	BL	sub_FFC5C0F0 \n"                      
+"	BL	sub_FFC5C138 \n"                      
+"	BL	sub_FFC5C178 \n"                      
+"	MOV	R2, R4 \n"                           
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, R5 \n"                           
+"	BL	sub_FFC57984 \n"                      
+"	BL	sub_FFD11158 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRNE	R0, [R4, #8] \n"                   
+"	ORRNE	R0, R0, #0x2000 \n"                
+"	STRNE	R0, [R4, #8] \n"                   
+"	LDMFD	SP!, {R3-R5,PC} \n"                         
+	);
+}
+
+
+//** sub_FFD10ECC_my  @ 0xFFD10ECC 
+
+void __attribute__((naked,noinline)) sub_FFD10ECC_my(){ // 
+	asm volatile(
+"	STMFD	SP!, {R0-R8,LR} \n"                
+"	MOV	R4, R0 \n"                           
+"	BL	sub_FFD119B4 \n"                      
+"	MOV     R1, #0xFFFFFFFF\n"	// "  MVN	R1, #0 \n"                           
+"	BL	sub_FFC28844 \n"                      
+"	LDR	R5, =0x5828 \n"                      
+"	LDR	R0, [R5, #0xC] \n"                   
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFD10F1C \n"                     
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, #0 \n"                           
+"	BL	sub_FFC0F4B4 \n"                      
+"	STR	R0, [R5, #0xC] \n"                   
+"	MOV	R3, #0 \n"                           
+"	STR	R3, [SP] \n"                         
+"	LDR	R3, =0xFFD10990 \n"                  
+"	LDR	R0, =0xFFD11128 \n"                  
+"	MOV	R2, #0x400 \n"                       
+"	MOV	R1, #0x17 \n"                        
+"	BL	sub_FFC0F480 \n"                      
+"loc_FFD10F1C:\n"
+"	MOV	R2, #4 \n"                           
+"	ADD	R1, SP, #8 \n"                       
+"	MOV	R0, #0x8A \n"                        
+"	BL	sub_FFC6957C \n"                      
+"	TST	R0, #1 \n"                           
+"	LDRNE	R1, =0x3BA \n"                     
+"	LDRNE	R0, =0xFFD10BBC \n"                
+"	BLNE	sub_FFC0F680 \n"                    
+"	LDR	R6, =0x333E0 \n"                     
+"	LDR	R7, =0x33324 \n"                     
+"	LDR	R3, [R6] \n"                         
+"	LDRSH	R2, [R6, #0xC] \n"                 
+"	LDRSH	R1, [R6, #0xE] \n"                 
+"	LDR	R0, [R7, #0x80] \n"                  
+//"	BL	sub_FFCE5CDC \n"                      
+"	BL	sub_FFC455A8 \n"                      
+"	LDR	R3, =0x5830 \n"                      
+"	STRH	R0, [R4, #0xA4] \n"                 
+"	SUB	R2, R3, #4 \n"                       
+"	STRD	R2, [SP] \n"                        
+"	MOV	R1, R0 \n"                           
+"	LDRH	R0, [R7, #0x54] \n"                 
+"	LDRSH	R2, [R6, #0xC] \n"                 
+"	SUB	R3, R3, #8 \n"                       
+"	BL	sub_FFD12020 \n" 
+"	BL      wait_until_remote_button_is_released\n"     // +
+"	BL      capt_seq_hook_set_nr\n"                     // +
+"	B       sub_FFD10F80\n"                             // continue function in firmware     
+	);
+}
+
+
+//** exp_drv_task  @ 0xFFC91654 
+
+void __attribute__((naked,noinline)) exp_drv_task(){
+	asm volatile(
+"	STMFD	SP!, {R4-R8,LR} \n"                
+"	SUB	SP, SP, #0x20 \n"                    
+"	LDR	R8, =0xBB8 \n"                       
+"	LDR	R7, =0x38CC \n"                      
+"	LDR	R5, =0x3C714 \n"                     
+"	MOV	R0, #0 \n"                           
+"	ADD	R6, SP, #0x10 \n"                    
+"	STR	R0, [SP, #0xC] \n"
+"loc_FFC91674:\n"                  
+"	LDR	R0, [R7, #0x20] \n"                  
+"	MOV	R2, #0 \n"                           
+"	ADD	R1, SP, #0x1C \n"                    
+"	BL	sub_FFC28AA0 \n"                      
+"	LDR	R0, [SP, #0xC] \n"                   
+"	CMP	R0, #1 \n"                           
+"	BNE	loc_FFC916C0 \n"                     
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R0, [R0] \n"                         
+"	CMP	R0, #0x13 \n"                        
+"	CMPNE	R0, #0x14 \n"                      
+"	CMPNE	R0, #0x15 \n"                      
+"	CMPNE	R0, #0x16 \n"                      
+"	BEQ	loc_FFC91824 \n"                     
+"	CMP	R0, #0x28 \n"                        
+"	BEQ	loc_FFC917AC \n"                     
+"	ADD	R1, SP, #0xC \n"                     
+"	MOV	R0, #0 \n"                           
+"	BL	sub_FFC91604 \n"                      
+"loc_FFC916C0:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R1, [R0] \n"                         
+"	CMP	R1, #0x2E \n"                        
+"	BNE	loc_FFC916F0 \n"                     
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	BL	sub_FFC9295C \n"                      
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R1, #1 \n"                           
+"	BL	sub_FFC28810 \n"                      
+"	BL	sub_FFC0F438 \n"                      
+"	ADD	SP, SP, #0x20 \n"                    
+"	LDMFD	SP!, {R4-R8,PC} \n"                
+"loc_FFC916F0:\n"
+"	CMP	R1, #0x2D \n"                        
+"	BNE	loc_FFC9170C \n"                     
+"	LDR	R2, [R0, #0x8C]! \n"                 
+"	LDR	R1, [R0, #4] \n"                     
+"	MOV	R0, R1 \n"                           
+"	BLX	R2 \n"                               
+"	B	loc_FFC91C4C \n"                       
+"loc_FFC9170C:\n"
+"	CMP	R1, #0x26 \n"                        
+"	BNE	loc_FFC9175C \n"                     
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R1, #0x80 \n"                        
+"	BL	sub_FFC28844 \n"                      
+"	LDR	R0, =0xFFC8DDD0 \n"                  
+"	MOV	R1, #0x80 \n"                        
+"	BL	sub_FFD085BC \n"                      
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R2, R8 \n"                           
+"	MOV	R1, #0x80 \n"                        
+"	BL	sub_FFC28750 \n"                      
+"	TST	R0, #1 \n"                           
+"	LDRNE	R1, =0xE5F \n"                     
+"	BNE	loc_FFC91818 \n"                     
+"loc_FFC91748:\n"
+"	LDR	R1, [SP, #0x1C] \n"                  
+"	LDR	R0, [R1, #0x90] \n"                  
+"	LDR	R1, [R1, #0x8C] \n"                  
+"	BLX	R1 \n"                               
+"	B	loc_FFC91C4C \n"                       
+"loc_FFC9175C:\n"
+"	CMP	R1, #0x27 \n"                        
+"	BNE	loc_FFC917A4 \n"                     
+"	ADD	R1, SP, #0xC \n"                     
+"	BL	sub_FFC91604 \n"                      
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R1, #0x100 \n"                       
+"	BL	sub_FFC28844 \n"                      
+"	LDR	R0, =0xFFC8DDE0 \n"                  
+"	MOV	R1, #0x100 \n"                       
+"	BL	sub_FFD08844 \n"                      
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R2, R8 \n"                           
+"	MOV	R1, #0x100 \n"                       
+"	BL	sub_FFC28750 \n"                      
+"	TST	R0, #1 \n"                           
+"	BEQ	loc_FFC91748 \n"                  
+"	LDR	R1, =0xE69 \n"                       
+"	B	loc_FFC91818 \n"                 
+"loc_FFC917A4:\n"
+"	CMP	R1, #0x28 \n"                        
+"	BNE	loc_FFC917BC \n"                     
+"loc_FFC917AC:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	ADD	R1, SP, #0xC \n"                     
+"	BL	sub_FFC91604 \n"                      
+"	B	loc_FFC91748 \n"                       
+"loc_FFC917BC:\n"
+"	CMP	R1, #0x2B \n"                        
+"	BNE	loc_FFC917D4 \n"                     
+"	BL	sub_FFC811DC \n"                      
+"	BL	sub_FFC81E04 \n"                      
+"	BL	sub_FFC81954 \n"                      
+"	B	loc_FFC91748 \n"                       
+"loc_FFC917D4:\n"
+"	CMP	R1, #0x2C \n"                        
+"	BNE	loc_FFC91824 \n"                     
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R1, #4 \n"                           
+"	BL	sub_FFC28844 \n"                      
+"	LDR	R1, =0xFFC8DE00 \n"                  
+"	LDR	R0, =0xFFFFF400 \n"                  
+"	MOV	R2, #4 \n"                           
+"	BL	sub_FFC80C58 \n"                      
+"	BL	sub_FFC80EE0 \n"                      
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R2, R8 \n"                           
+"	MOV	R1, #4 \n"                           
+"	BL	sub_FFC2866C \n"                      
+"	TST	R0, #1 \n"                           
+"	BEQ	loc_FFC91748 \n"                     
+"	LDR	R1, =0xE91 \n"                       
+"loc_FFC91818:\n"
+"	LDR	R0, =0xFFC8E440 \n"                  
+"	BL	sub_FFC0F680 \n"                      
+"	B	loc_FFC91748 \n"                       
+"loc_FFC91824:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	MOV	R4, #1 \n"                           
+"	LDR	R1, [R0] \n"                         
+"	CMP	R1, #0x11 \n"                        
+"	CMPNE	R1, #0x12 \n"                      
+"	BNE	loc_FFC91894 \n"                     
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	ADD	R1, R1, R1, LSL #1 \n"               
+"	ADD	R1, R0, R1, LSL #2 \n"               
+"	SUB	R1, R1, #8 \n"                       
+"	LDMIA	R1, {R2-R4} \n"                    
+"	STMIA	R6, {R2-R4} \n"                    
+"	BL	sub_FFC8FF90 \n"                      
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	LDR	R3, [R0, #0x8C] \n"                  
+"	LDR	R2, [R0, #0x90] \n"                  
+"	ADD	R0, R0, #4 \n"                       
+"	BLX	R3 \n"                               
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	BL	sub_FFC92D24 \n"                      
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	LDR	R3, [R0, #0x94] \n"                  
+"	LDR	R2, [R0, #0x98] \n"                  
+"	ADD	R0, R0, #4 \n"                       
+"	BLX	R3 \n"                               
+"	B	loc_FFC91B8C \n"                       
+"loc_FFC91894:\n"
+"	CMP	R1, #0x13 \n"                        
+"	CMPNE	R1, #0x14 \n"                      
+"	CMPNE	R1, #0x15 \n"                      
+"	CMPNE	R1, #0x16 \n"                      
+"	BNE	loc_FFC9194C \n"                     
+"	ADD	R3, SP, #0xC \n"                     
+"	MOV	R2, SP \n"                           
+"	ADD	R1, SP, #0x10 \n"                    
+"	BL	sub_FFC9026C \n"                      
+"	CMP	R0, #1 \n"                           
+"	MOV	R4, R0 \n"                           
+"	CMPNE	R4, #5 \n"                         
+"	BNE loc_FFC918E8 \n"            
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	MOV	R2, R4 \n"                           
+"	LDR	R1, [R0, #0x7C]! \n"                 
+"	LDR	R12, [R0, #0x10]! \n"                
+"	LDR	R3, [R0, #4] \n"                     
+"	MOV	R0, SP \n"                           
+"	BLX	R12 \n"                              
+"	B	loc_FFC91920 \n"                       
+"loc_FFC918E8:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	CMP	R4, #2 \n"                           
+"	LDR	R3, [R0, #0x90] \n"                  
+"	CMPNE	R4, #6 \n"                         
+"	BNE	loc_FFC91934 \n"                     
+"	LDR	R12, [R0, #0x8C] \n"                 
+"	MOV	R0, SP \n"                           
+"	MOV	R2, R4 \n"                           
+"	MOV	R1, #1 \n"                           
+"	BLX	R12 \n"                              
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	MOV	R2, SP \n"                           
+"	ADD	R1, SP, #0x10 \n"                    
+"	BL	sub_FFC9130C \n"                      
+"loc_FFC91920:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R2, [SP, #0xC] \n"                   
+"	MOV	R1, R4 \n"                           
+"	BL	sub_FFC915A4 \n"                      
+"	B	loc_FFC91B8C \n"                       
+"loc_FFC91934:\n"
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	LDR	R12, [R0, #0x8C] \n"                 
+"	ADD	R0, R0, #4 \n"                       
+"	MOV	R2, R4 \n"                           
+"	BLX	R12 \n"                              
+"	B	loc_FFC91B8C \n"                       
+"loc_FFC9194C:\n"
+"	CMP	R1, #0x22 \n"                        
+"	CMPNE	R1, #0x23 \n"                      
+"	BNE	loc_FFC91998 \n"                     
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	ADD	R1, R1, R1, LSL #1 \n"               
+"	ADD	R1, R0, R1, LSL #2 \n"               
+"	SUB	R1, R1, #8 \n"                       
+"	LDMIA	R1, {R2-R4} \n"                    
+"	STMIA	R6, {R2-R4} \n"                    
+"	BL	sub_FFC8F4E0 \n"                      
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	LDR	R3, [R0, #0x8C] \n"                  
+"	LDR	R2, [R0, #0x90] \n"                  
+"	ADD	R0, R0, #4 \n"                       
+"	BLX	R3 \n"                               
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	BL	sub_FFC8F7D4 \n"                      
+"	B	loc_FFC91B8C \n"                       
+"loc_FFC91998:\n"
+"	ADD	R1, R0, #4 \n"                       
+"	LDMIA	R1, {R2,R3,R12} \n"                
+"	STMIA	R6, {R2,R3,R12} \n"                
+"	LDR	R1, [R0] \n"                         
+"	CMP	R1, #0x25 \n"                        
+"	ADDLS	PC, PC, R1, LSL #2 \n"             
+"	B	loc_FFC91B6C \n"                       
+"	B	loc_FFC91A4C \n"                       
+"	B	loc_FFC91A4C \n"                       
+"	B	loc_FFC91A54 \n"                       
+"	B	loc_FFC91A5C \n"                       
+"	B	loc_FFC91A5C \n"                       
+"	B	loc_FFC91A5C \n"                       
+"	B	loc_FFC91A4C \n"                       
+"	B	loc_FFC91A54 \n"                       
+"	B	loc_FFC91A5C \n"                       
+"	B	loc_FFC91A5C \n"                       
+"	B	loc_FFC91A74 \n"                       
+"	B	loc_FFC91A74 \n"                       
+"	B	loc_FFC91B60 \n"                       
+"	B	loc_FFC91B68 \n"                       
+"	B	loc_FFC91B68 \n"                       
+"	B	loc_FFC91B68 \n"                       
+"	B	loc_FFC91B68 \n"                       
+"	B	loc_FFC91B6C \n"                       
+"	B	loc_FFC91B6C \n"                       
+"	B	loc_FFC91B6C \n"                       
+"	B	loc_FFC91B6C \n"                       
+"	B	loc_FFC91B6C \n"                       
+"	B	loc_FFC91B6C \n"                       
+"	B	loc_FFC91A64 \n"                       
+"	B	loc_FFC91A6C \n"                       
+"	B	loc_FFC91A6C \n"                       
+"	B	loc_FFC91A80 \n"                       
+"	B	loc_FFC91A80 \n"                       
+"	B	loc_FFC91A88 \n"                       
+"	B	loc_FFC91AB8 \n"                       
+"	B	loc_FFC91AE8 \n"                       
+"	B	loc_FFC91B18 \n"                       
+"	B	loc_FFC91B48 \n"                       
+"	B	loc_FFC91B48 \n"                       
+"	B	loc_FFC91B6C \n"                       
+"	B	loc_FFC91B6C \n"                       
+"	B	loc_FFC91B50 \n"                       
+"	B	loc_FFC91B58 \n"                       
+"loc_FFC91A4C:\n"
+"	BL	sub_FFC8E2E8 \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91A54:\n"
+"	BL	sub_FFC8E56C \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91A5C:\n"
+"	BL	sub_FFC8E774 \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91A64:\n"
+"	BL	sub_FFC8E9EC \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91A6C:\n"
+"	BL	sub_FFC8EBE4 \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91A74:\n"
+"	BL	sub_FFC8EEA0_my \n"  //---------->                      
+"	MOV	R4, #0 \n"                           
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91A80:\n"
+"	BL	sub_FFC8EFE0 \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91A88:\n"
+"	LDRH	R1, [R0, #4] \n"                    
+"	STRH	R1, [SP, #0x10] \n"                 
+"	LDRH	R1, [R5, #2] \n"                    
+"	STRH	R1, [SP, #0x12] \n"                 
+"	LDRH	R1, [R5, #4] \n"                    
+"	STRH	R1, [SP, #0x14] \n"                 
+"	LDRH	R1, [R5, #6] \n"                    
+"	STRH	R1, [SP, #0x16] \n"                 
+"	LDRH	R1, [R0, #0xC] \n"                  
+"	STRH	R1, [SP, #0x18] \n"                 
+"	BL	sub_FFC929D0 \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91AB8:\n"
+"	LDRH	R1, [R0, #4] \n"                    
+"	STRH	R1, [SP, #0x10] \n"                 
+"	LDRH	R1, [R5, #2] \n"                    
+"	STRH	R1, [SP, #0x12] \n"                 
+"	LDRH	R1, [R5, #4] \n"                    
+"	STRH	R1, [SP, #0x14] \n"                 
+"	LDRH	R1, [R5, #6] \n"                    
+"	STRH	R1, [SP, #0x16] \n"                 
+"	LDRH	R1, [R5, #8] \n"                    
+"	STRH	R1, [SP, #0x18] \n"                 
+"	BL	sub_FFC92B3C \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91AE8:\n"
+"	LDRH	R1, [R5] \n"                        
+"	STRH	R1, [SP, #0x10] \n"                 
+"	LDRH	R1, [R0, #6] \n"                    
+"	STRH	R1, [SP, #0x12] \n"                 
+"	LDRH	R1, [R5, #4] \n"                    
+"	STRH	R1, [SP, #0x14] \n"                 
+"	LDRH	R1, [R5, #6] \n"                    
+"	STRH	R1, [SP, #0x16] \n"                 
+"	LDRH	R1, [R5, #8] \n"                    
+"	STRH	R1, [SP, #0x18] \n"                 
+"	BL	sub_FFC92BE8 \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91B18:\n"
+"	LDRH	R1, [R5] \n"                        
+"	STRH	R1, [SP, #0x10] \n"                 
+"	LDRH	R1, [R5, #2] \n"                    
+"	STRH	R1, [SP, #0x12] \n"                 
+"	LDRH	R1, [R5, #4] \n"                    
+"	STRH	R1, [SP, #0x14] \n"                 
+"	LDRH	R1, [R5, #6] \n"                    
+"	STRH	R1, [SP, #0x16] \n"                 
+"	LDRH	R1, [R0, #0xC] \n"                  
+"	STRH	R1, [SP, #0x18] \n"                 
+"	BL	sub_FFC92C88 \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91B48:\n"
+"	BL	sub_FFC8F338 \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91B50:\n"
+"	BL	sub_FFC8F8D8 \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91B58:\n"
+"	BL	sub_FFC8FB14 \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91B60:\n"
+"	BL	sub_FFC8FC90 \n"                      
+"	B	loc_FFC91B6C \n"                       
+"loc_FFC91B68:\n"
+"	BL	sub_FFC8FE2C \n"                      
+"loc_FFC91B6C:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	LDR	R3, [R0, #0x8C] \n"                  
+"	LDR	R2, [R0, #0x90] \n"                  
+"	ADD	R0, R0, #4 \n"                       
+"	BLX	R3 \n"                               
+"	CMP	R4, #1 \n"                           
+"	BNE	loc_FFC91BD4 \n"                     
+"loc_FFC91B8C:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	MOV	R2, #0xC \n"                         
+"	LDR	R1, [R0, #0x7C] \n"                  
+"	ADD	R1, R1, R1, LSL #1 \n"               
+"	ADD	R0, R0, R1, LSL #2 \n"               
+"	SUB	R4, R0, #8 \n"                       
+"	LDR	R0, =0x3C714 \n"                     
+"	ADD	R1, SP, #0x10 \n"                    
+"	BL	sub_FFE80ED0 \n"                      
+"	LDR	R0, =0x3C720 \n"                     
+"	MOV	R2, #0xC \n"                         
+"	ADD	R1, SP, #0x10 \n"                    
+"	BL	sub_FFE80ED0 \n"                      
+"	LDR	R0, =0x3C72C \n"                     
+"	MOV	R2, #0xC \n"                         
+"	MOV	R1, R4 \n"                           
+"	BL	sub_FFE80ED0 \n"                      
+"	B	loc_FFC91C4C \n"                       
+"loc_FFC91BD4:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	LDR	R0, [R0] \n"                         
+"	CMP	R0, #0xB \n"                         
+"	BNE	loc_FFC91C1C \n"                     
+"	MOV	R3, #0 \n"                           
+"	STR	R3, [SP] \n"                         
+"	MOV	R3, #1 \n"                           
+"	MOV	R2, #1 \n"                           
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, #0 \n"                           
+"	BL	sub_FFC8E0F0 \n"                      
+"	MOV	R3, #0 \n"                           
+"	STR	R3, [SP] \n"                         
+"	MOV	R3, #1 \n"                           
+"	MOV	R2, #1 \n"
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, #0 \n"                           
+"	B	loc_FFC91C48 \n"                       
+"loc_FFC91C1C:\n"
+"	MOV	R3, #1 \n"                           
+"	MOV	R2, #1 \n"                           
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, #1 \n"                           
+"	STR	R3, [SP] \n"                         
+"	BL	sub_FFC8E0F0 \n"                      
+"	MOV	R3, #1 \n"                           
+"	MOV	R2, #1 \n"                           
+"	MOV	R1, #1 \n"                           
+"	MOV	R0, #1 \n"                           
+"	STR	R3, [SP] \n"                         
+"loc_FFC91C48:\n"
+"	BL	sub_FFC8E230 \n"                      
+"loc_FFC91C4C:\n"
+"	LDR	R0, [SP, #0x1C] \n"                  
+"	BL	sub_FFC9295C \n"                      
+"	B	loc_FFC91674 \n"  
+	);
+}
+
+//** sub_FFC8EEA0_my  @ 0xFFC8EEA0 
+
+void __attribute__((naked,noinline)) sub_FFC8EEA0_my(){ // 
+	asm volatile(
+"	STMFD	SP!, {R4-R8,LR} \n"                
+"	LDR	R7, =0x38CC \n"                      
+"	MOV	R4, R0 \n"                           
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R1, #0x3E \n"                        
+"	BL	sub_FFC28844 \n"                      
+"	LDRSH	R0, [R4, #4] \n"                   
+"	MOV	R2, #0 \n"                           
+"	MOV	R1, #0 \n"                           
+"	BL	sub_FFC8DE54 \n"                      
+"	MOV	R6, R0 \n"                           
+"	LDRSH	R0, [R4, #6] \n"                   
+"	BL	sub_FFC8DF64 \n"                      
+"	LDRSH	R0, [R4, #8] \n"                   
+"	BL	sub_FFC8DFBC \n"                      
+"	LDRSH	R0, [R4, #0xA] \n"                 
+"	BL	sub_FFC8E014 \n"                      
+"	LDRSH	R0, [R4, #0xC] \n"                 
+"	MOV	R1, #0 \n"                           
+"	BL	sub_FFC8E06C \n"                      
+"	MOV	R5, R0 \n"                           
+"	LDR	R0, [R4] \n"                         
+"	LDR	R8, =0x3C72C \n"                     
+"	CMP	R0, #0xB \n"                         
+"	MOVEQ	R6, #0 \n"                         
+"	MOVEQ	R5, #0 \n"                         
+"	BEQ	loc_FFC8EF34 \n"                     
+"	CMP	R6, #1 \n"                           
+"	BNE	loc_FFC8EF34 \n"                     
+"	LDRSH	R0, [R4, #4] \n"                   
+"	LDR	R1, =0xFFC8DDC0 \n"                  
+"	MOV	R2, #2 \n"                           
+"	BL	sub_FFD08710 \n"                      
+"	STRH	R0, [R4, #4] \n"                    
+"	MOV	R0, #0 \n"                           
+"	STR	R0, [R7, #0x28] \n"                  
+"	B	loc_FFC8EF3C \n"                       
+"loc_FFC8EF34:\n"
+"	LDRH	R0, [R8] \n"                        
+"	STRH	R0, [R4, #4] \n"                    
+"loc_FFC8EF3C:\n"
+"	CMP	R5, #1 \n"                           
+"	LDRNEH	R0, [R8, #8] \n"                  
+"	BNE	loc_FFC8EF58 \n"                     
+"	LDRSH	R0, [R4, #0xC] \n"                 
+"	LDR	R1, =0xFFC8DE44 \n"                  
+"	MOV	R2, #0x20 \n"                        
+"	BL	sub_FFC9298C \n"                      
+"loc_FFC8EF58:\n"
+"	STRH	R0, [R4, #0xC] \n"                  
+"	LDRSH	R0, [R4, #6] \n"                   
+"	BL	sub_FFC80F4C_my \n"   //----------->                     
+"	LDRSH	R0, [R4, #8] \n"                   
+"	MOV	R1, #1 \n"                           
+"	BL	sub_FFC8169C \n"                      
+"	MOV	R1, #0 \n"                           
+"	ADD	R0, R4, #8 \n"                       
+"	BL	sub_FFC81724 \n"                      
+"	LDRSH	R0, [R4, #0xE] \n"                 
+"	BL	sub_FFC8914C \n"                      
+"	LDR	R4, =0xBB8 \n"                       
+"	CMP	R6, #1 \n"                           
+"	BNE	loc_FFC8EFB0 \n"                     
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R2, R4 \n"                           
+"	MOV	R1, #2 \n"                           
+"	BL	sub_FFC28750 \n"                      
+"	TST	R0, #1 \n"                           
+"	LDRNE	R1, =0x5A3 \n"                     
+"	LDRNE	R0, =0xFFC8E440 \n"                
+"	BLNE	sub_FFC0F680 \n"                    
+"loc_FFC8EFB0:\n"
+"	CMP	R5, #1 \n"                           
+"	LDMNEFD	SP!, {R4-R8,PC} \n"              
+"	LDR	R0, [R7, #0x1C] \n"                  
+"	MOV	R2, R4 \n"                           
+"	MOV	R1, #0x20 \n"                        
+"	BL	sub_FFC28750 \n"                      
+"	TST	R0, #1 \n"                           
+"	LDRNE	R1, =0x5A8 \n"                     
+"	LDRNE	R0, =0xFFC8E440 \n"                
+"	LDMNEFD	SP!, {R4-R8,LR} \n"              
+"	BNE	sub_FFC0F680 \n"                     
+"	LDMFD	SP!, {R4-R8,PC} \n"      
+	);
+}
+
+//** sub_FFC80F4C_my  @ 0xFFC80F4C 
+
+void __attribute__((naked,noinline)) sub_FFC80F4C_my(){ // 
+	asm volatile(
+"	STMFD	SP!, {R4-R6,LR} \n"                
+"	LDR	R5, =0x35C0 \n"                      
+"	MOV	R4, R0 \n"                           
+"	LDR	R0, [R5, #4] \n"                     
+"	CMP	R0, #1 \n"                           
+"	LDRNE	R1, =0x146 \n"                     
+"	LDRNE	R0, =0xFFC80D50 \n"                
+"	BLNE	sub_FFC0F680 \n"                    
+"	CMN	R4, #0xC00 \n"                       
+"	LDREQSH	R4, [R5, #2] \n"                 
+"	CMN	R4, #0xC00 \n"                       
+"	MOVEQ	R1, #0x14C \n"                     
+"	LDREQ	R0, =0xFFC80D50 \n"                
+"	STRH	R4, [R5, #2] \n"                    
+"	BLEQ	sub_FFC0F680 \n"                    
+"	MOV	R0, R4 \n"                           
+//"	BL	sub_FFD7D8F8 \n"		   // -
+"	BL      apex2us\n"             // +
+"	MOV	R4, R0 \n"                           
+//"	BL	sub_FFCB3AB0 \n"                      
+"	MOV	R0, R4 \n"                           
+"	BL	sub_FFCB8140 \n"                      
+"	TST	R0, #1 \n"                           
+"	LDRNE	R1, =0x151 \n"                     
+"	LDMNEFD	SP!, {R4-R6,LR} \n"              
+"	LDRNE	R0, =0xFFC80D50 \n"                
+"	BNE	sub_FFC0F680 \n"                     
+"	LDMFD	SP!, {R4-R6,PC} \n"             
+	);
+}
Index: /trunk/platform/a495/sub/100e/stubs_entry.S
===================================================================
--- /trunk/platform/a495/sub/100e/stubs_entry.S	(revision 1198)
+++ /trunk/platform/a495/sub/100e/stubs_entry.S	(revision 1198)
@@ -0,0 +1,181 @@
+// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!
+#include "stubs_asm.h"
+
+// Best match: 94%
+NSTUB(AllocateMemory, 0xffdfd218)
+NSTUB(AllocateUncacheableMemory, 0xffc292d8)
+// Best match: 96%
+NSTUB(Close, 0xffc26108)
+NSTUB(CreateTask, 0xffc0f1a8)
+NSTUB(DeleteFile_Fut, 0xffc25a80)
+// ERROR: EnterToCompensationEVF is not found!
+NSTUB(ExecuteEventProcedure, 0xffc65870)
+// ERROR: ExitFromCompensationEVF is not found!
+NSTUB(ExitTask, 0xffc0f438)
+NSTUB(Fclose_Fut, 0xffc25bfc)
+NSTUB(Feof_Fut, 0xffc25de8)
+NSTUB(Fflush_Fut, 0xffc25e24)
+NSTUB(Fgets_Fut, 0xffc25d50)
+NSTUB(Fopen_Fut, 0xffc25bbc)
+NSTUB(Fread_Fut, 0xffc25ca8)
+// Best match: 94%
+NSTUB(FreeMemory, 0xffdfd210)
+// Best match: 91%
+NSTUB(FreeUncacheableMemory, 0xffc29318)
+NSTUB(Fseek_Fut, 0xffc25d9c)
+NSTUB(Fwrite_Fut, 0xffc25cfc)
+// ERROR: GetBatteryTemperature is not found!
+// ERROR: GetCCDTemperature is not found!
+// Best match: 93%
+NSTUB(GetCurrentAvValue, 0xffd088c0)
+// Best match: 66%
+NSTUB(GetDrive_ClusterSize, 0xffc512c0)
+// ERROR: GetDrive_FreeClusters is not found!
+// Best match: 60%
+NSTUB(GetDrive_TotalClusters, 0xffc512f4)
+// Best match: 64%
+NSTUB(GetFocusLensSubjectDistance, 0xffd07bb8)
+// Best match: 77%
+NSTUB(GetFocusLensSubjectDistanceFromLens, 0xffd08010)
+NSTUB(GetMemInfo, 0xffc0a7f8)
+// ERROR: GetOpticalTemperature is not found!
+// Best match: 96%
+NSTUB(GetParameterData, 0xffd2f260)
+// Best match: 72%
+NSTUB(GetPropertyCase, 0xffc6957c)
+NSTUB(GetSystemTime, 0xffdfd270)
+// Best match: 74%
+NSTUB(GetZoomLensCurrentPoint, 0xffd09d80)
+// Best match: 59%
+NSTUB(GetZoomLensCurrentPosition, 0xffd0a788)
+// Best match: 58%
+NSTUB(IsStrobeChargeCompleted, 0xffca72b0)
+NSTUB(LocalTime, 0xffc63580)
+// Best match: 93%
+NSTUB(LockMainPower, 0xffc6ce90)
+// ERROR: Lseek is not found!
+// Best match: 92%
+NSTUB(MakeDirectory_Fut, 0xffc25af4)
+// Best match: 57%
+NSTUB(MoveFocusLensToDistance, 0xffe53504)
+// Best match: 58%
+NSTUB(MoveZoomLensWithPoint, 0xffdfaef0)
+// Best match: 62%
+NSTUB(NewTaskShell, 0xffc68f88)
+// Best match: 69%
+NSTUB(Open, 0xffc4e5dc)
+// Best match: 85%
+NSTUB(PB2Rec, 0xffc6fae4)
+// ERROR: PT_PlaySound is not found!
+// Best match: 86%
+NSTUB(PostLogicalEventForNotPowerType, 0xffc6c6c0)
+// Best match: 92%
+NSTUB(PostLogicalEventToUI, 0xffc6c70c)
+NSTUB(Read, 0xffc0b308)
+// ERROR: ReadFastDir is not found!
+// Best match: 72%
+NSTUB(Rec2PB, 0xffc6fb24)
+// ERROR: RefreshPhysicalScreen is not found!
+// ERROR: Remove is not found!
+// Best match: 53%
+NSTUB(RenameFile_Fut, 0xffc25bb8)
+// ALT: NSTUB(RenameFile_Fut, 0xffcf35cc) // 8/7
+// ALT: NSTUB(RenameFile_Fut, 0xffcf361c) // 8/7
+NSTUB(Restart, 0xffc2aab0)
+// Best match: 93%
+NSTUB(SetAutoShutdownTime, 0xffc6cf04)
+// Best match: 81%
+NSTUB(SetCurrentCaptureModeType, 0xffc7323c)
+// Best match: 55%
+NSTUB(SetFileTimeStamp, 0xffcfbc00)
+// Best match: 64%
+NSTUB(SetLogicalEventActive, 0xffc6cc08)
+// Best match: 96%
+NSTUB(SetParameterData, 0xffd2f1d0)
+// Best match: 72%
+NSTUB(SetPropertyCase, 0xffc6944c)
+// Best match: 92%
+NSTUB(SleepTask, 0xffc2915c)
+// Best match: 60%
+NSTUB(TakeSemaphore, 0xffc0f034)
+// ERROR: TurnOffBackLight is not found!
+// ERROR: TurnOnBackLight is not found!
+// ERROR: UIFS_WriteFirmInfoToFile is not found!
+// Best match: 93%
+NSTUB(UnlockMainPower, 0xffc6cde4)
+// Best match: 96%
+NSTUB(UpdateMBROnFlash, 0xffc51140)
+// Best match: 85%
+NSTUB(VbattGet, 0xffc22be4)
+NSTUB(Write, 0xffc26198)
+NSTUB(_log, 0xffe823e8)
+NSTUB(_log10, 0xffe8132c)
+NSTUB(_pow, 0xffe8149c)
+NSTUB(_sqrt, 0xffe83750)
+NSTUB(add_ptp_handler, 0xffdbec04)
+NSTUB(close, 0xffc0b120)
+// Best match: 71%
+NSTUB(closedir, 0xffdebce8)
+// Best match: 71%
+NSTUB(closefastdir, 0xffdebce8)
+// Best match: 91%
+NSTUB(free, 0xffc04160)
+// Best match: 60%
+NSTUB(kbd_p1_f, 0xffc23ba4)
+// Best match: 58%
+NSTUB(kbd_p1_f_cont, 0xffc23bb0)
+// Best match: 86%
+NSTUB(kbd_p2_f, 0xffc2345c)
+// Best match: 51%
+NSTUB(kbd_pwr_off, 0xffc435e4)
+// ERROR: kbd_pwr_on is not found!
+// ERROR: kbd_read_keys is not found!
+// Best match: 73%
+NSTUB(kbd_read_keys_r2, 0xffc42fec)
+// ALT: NSTUB(kbd_read_keys_r2, 0xffc42fd0) // 16/6
+// Best match: 68%
+NSTUB(lseek, 0xffc26230)
+NSTUB(malloc, 0xffc04104)
+NSTUB(memcmp, 0xffc11318)
+NSTUB(memcpy, 0xffc2e860)
+NSTUB(memset, 0xffd7c930)
+// Best match: 74%
+NSTUB(mkdir, 0xffc265a4)
+NSTUB(mktime_ext, 0xffc7cdbc)
+NSTUB(open, 0xffc0b070)
+// Best match: 81%
+NSTUB(opendir, 0xffdebb50)
+// ERROR: openfastdir is not found!
+// ERROR: qsort is not found!
+// Best match: 95%
+NSTUB(rand, 0xffc11420)
+NSTUB(read, 0xffc0b308)
+// ERROR: readfastdir is not found!
+// Best match: 82%
+NSTUB(reboot_fw_update, 0xffded518)
+// ERROR: rename is not found!
+// Best match: 93%
+NSTUB(set_control_event, 0xffc6c928)
+// Best match: 95%
+NSTUB(srand, 0xffc11414)
+NSTUB(stat, 0xffc2626c)
+// Best match: 61%
+NSTUB(strcat, 0xffc03f60)
+// Best match: 56%
+NSTUB(strchr, 0xffc03fe8)
+NSTUB(strcmp, 0xffc112d4)
+NSTUB(strcpy, 0xffc112bc)
+NSTUB(strftime, 0xffc7c7c4)
+NSTUB(strlen, 0xffc04034)
+NSTUB(strncmp, 0xffc03f9c)
+// Best match: 73%
+NSTUB(strncpy, 0xffc03f60)
+// Best match: 71%
+NSTUB(strrchr, 0xffc2e838)
+// ALT: NSTUB(strrchr, 0xffc7c58c) // 18/8
+// Best match: 96%
+NSTUB(strtol, 0xffc2eb40)
+NSTUB(strtolx, 0xffc2e944)
+NSTUB(time, 0xffc63434)
+NSTUB(vsprintf, 0xffc11280)
+NSTUB(write, 0xffc0b368)
Index: /trunk/platform/a495/sub/100e/stubs_entry_2.S
===================================================================
--- /trunk/platform/a495/sub/100e/stubs_entry_2.S	(revision 1198)
+++ /trunk/platform/a495/sub/100e/stubs_entry_2.S	(revision 1198)
@@ -0,0 +1,59 @@
+// Note : This file generated by CHDK-PT.
+#include "stubs_asm.h"
+
+
+NHSTUB(EnterToCompensationEVF, 0xffc27604)   
+NHSTUB(ExitFromCompensationEVF, 0xffc27648)   
+NHSTUB(lseek, 0xffc26224)   
+NHSTUB(GetZoomLensCurrentPosition, 0xffdf52bc)   
+NHSTUB(RenameFile_Fut, 0xffc259ec)   
+NHSTUB(SetFileTimeStamp, 0xffc263a4)   
+NHSTUB(UpdateMBROnFlash, 0xffc51140)   
+NHSTUB(closedir, 0xffdebb00)   
+NHSTUB(closefastdir, 0xffdebb00)   
+NHSTUB(kbd_p1_f_cont, 0xffc23bb0)      
+NHSTUB(kbd_read_keys_r2, 0xffc23b58)   
+NHSTUB(strcat, 0xffc7c578)   
+NHSTUB(strrchr, 0xffc0400c)     
+NHSTUB(RefreshPhysicalScreen, 0xffd7b3fc)   
+NHSTUB(Lseek, 0xffc26224)   
+NHSTUB(GetCCDTemperature, 0xffc455a8)   
+NHSTUB(GetOpticalTemperature, 0xffc45694)   
+NHSTUB(GetDrive_FreeClusters, 0xffc51320)   
+NHSTUB(PT_PlaySound, 0xffc5f400)   
+NHSTUB(openfastdir, 0xffdebb50)   
+NHSTUB(ReadFastDir, 0xffdebca4)   
+NHSTUB(readfastdir, 0xffdebca4)   
+NHSTUB(Remove, 0xffc2613c)   
+NHSTUB(TurnOnBackLight, 0xffc77f84)   
+NHSTUB(TurnOffBackLight, 0xffc77f9c)   
+NHSTUB(UIFS_WriteFirmInfoToFile, 0xffd1f9d4)   
+NHSTUB(kbd_read_keys, 0xffc23b2c)   
+NHSTUB(rename, 0xffc261e4)   
+NHSTUB(DoAFLock, 0xffc27554)   
+NHSTUB(UnlockAF, 0xffc2758c)   
+NHSTUB(MakeAFScan, 0xffd0f2ac)   
+NHSTUB(ExpCtrlTool_StartContiAE, 0xffc34ce4)   
+NHSTUB(ExpCtrlTool_StopContiAE, 0xffc34dbc)   
+NHSTUB(apex2us, 0xffd7d8f8)   
+NHSTUB(SetScriptMode, 0xffc00f70)   
+NHSTUB(platformsub_kbd_fetch_data, 0xffc435cc)   
+NHSTUB(SetAE_ShutterSpeed, 0xffe55c94)   
+NHSTUB(UnsetZoomForMovie, 0xffd3594c)   
+NHSTUB(LEDDrive, 0xffc42bc4)   
+NHSTUB(qsort, 0xffe3c240)   
+NHSTUB(UnlockAndRefresh, 0xffd7c5ec)   
+NHSTUB(LockAndRefresh, 0xffd7c5a8)   
+NHSTUB(GetBatteryTemperature, 0xffc00b20)   
+NHSTUB(TurnOffMic, 0xffc43c28)   
+NHSTUB(TurnOnMic, 0xffc43c54)   
+NHSTUB(PutInNdFilter, 0xFFDFAD54)   
+NHSTUB(PutOutNdFilter, 0xFFDFAD78)   
+NHSTUB(SetZoomActuatorSpeedPercent, 0xffc00b20)   
+NHSTUB(WriteSDCard, 0xffcfcbcc)	// 0xffcfc9e8) 
+NHSTUB(GetImageFolder, 0xffcf1478)   
+NHSTUB(Mount_FileSystem, 0xffc00b20)   
+NHSTUB(Unmount_FileSystem, 0xffc00b20)   
+NHSTUB(rewinddir, 0xffc00b20)   
+NHSTUB(kbd_pwr_on, 0xffc00b20)   
+NHSTUB(kbd_pwr_off, 0xffc00b20)   
Index: /trunk/platform/a495/sub/100e/boot.c
===================================================================
--- /trunk/platform/a495/sub/100e/boot.c	(revision 1198)
+++ /trunk/platform/a495/sub/100e/boot.c	(revision 1198)
@@ -0,0 +1,651 @@
+#include "lolevel.h"
+#include "platform.h"
+#include "core.h"
+#include "dryos31.h"
+
+#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
+
+const char * const new_sa = &_end;
+
+void taskHook(context_t **context) {
+
+	task_t *tcb=(task_t*)((char*)context-offsetof(task_t, context));
+
+	if(!_strcmp(tcb->name, "PhySw"))           tcb->entry = (void*)mykbd_task; 
+	if(!_strcmp(tcb->name, "CaptSeqTask"))     tcb->entry = (void*)capt_seq_task; 
+	if(!_strcmp(tcb->name, "InitFileModules")) tcb->entry = (void*)init_file_modules_task;
+	if(!_strcmp(tcb->name, "MovieRecord"))     tcb->entry = (void*)movie_record_task;
+	if(!_strcmp(tcb->name, "ExpDrvTask"))      tcb->entry = (void*)exp_drv_task;
+}
+
+void CreateTask_spytask() {
+	_CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
+};
+
+//** boot  @ 0xFFC0000C 
+
+void __attribute__((naked,noinline)) boot() {
+	asm volatile (
+			/*// LED Test
+			"LDR     R1, =0xC0220088\n"	// Green LED
+			"MOV     R0, #0x46\n"			// Power on LED
+			"STR     R0, [R1]\n"
+			// End LED Test*/
+
+"	LDR	R1, =0xC0410000 \n"                  
+"	MOV	R0, #0 \n"                           
+"	STR	R0, [R1] \n"                         
+"	MOV	R1, #0x78 \n"                        
+"	MCR	p15, 0, R1, c1, c0 \n"               
+"	MOV	R1, #0 \n"                           
+"	MCR	p15, 0, R1, c7, c10, 4 \n"           
+"	MCR	p15, 0, R1, c7, c5 \n"               
+"	MCR	p15, 0, R1, c7, c6 \n"               
+"	MOV	R0, #0x3D \n"                        
+"	MCR	p15, 0, R0, c6, c0 \n"               
+"	MOV	R0, #0xC000002F \n"                  
+"	MCR	p15, 0, R0, c6, c1 \n"               
+"	MOV	R0, #0x31 \n"                        
+"	MCR	p15, 0, R0, c6, c2 \n"               
+"	LDR	R0, =0x10000031 \n"                  
+"	MCR	p15, 0, R0, c6, c3 \n"               
+"	MOV	R0, #0x40000017 \n"                  
+"	MCR	p15, 0, R0, c6, c4 \n"               
+"	LDR	R0, =0xFFC0002B \n"                  
+"	MCR	p15, 0, R0, c6, c5 \n"               
+"	MOV	R0, #0x34 \n"                        
+"	MCR	p15, 0, R0, c2, c0 \n"               
+"	MOV	R0, #0x34 \n"                        
+"	MCR	p15, 0, R0, c2, c0, 1 \n"            
+"	MOV	R0, #0x34 \n"                        
+"	MCR	p15, 0, R0, c3, c0 \n"               
+"	LDR	R0, =0x3333330 \n"                   
+"	MCR	p15, 0, R0, c5, c0, 2 \n"            
+"	LDR	R0, =0x3333330 \n"                   
+"	MCR	p15, 0, R0, c5, c0, 3 \n"            
+"	MRC	p15, 0, R0, c1, c0 \n"               
+"	ORR	R0, R0, #0x1000 \n"                  
+"	ORR	R0, R0, #4 \n"                       
+"	ORR	R0, R0, #1 \n"                       
+"	MCR	p15, 0, R0, c1, c0 \n"               
+"	MOV	R1, #0x40000006 \n"                  
+"	MCR	p15, 0, R1, c9, c1 \n"               
+"	MOV	R1, #6 \n"                           
+"	MCR	p15, 0, R1, c9, c1, 1 \n"            
+"	MRC	p15, 0, R1, c1, c0 \n"               
+"	ORR	R1, R1, #0x50000 \n"                 
+"	MCR	p15, 0, R1, c1, c0 \n"               
+"	LDR	R2, =0xC0200000 \n"                  
+"	MOV	R1, #1 \n"                           
+"	STR	R1, [R2, #0x10C] \n"                 
+"	MOV	R1, #0xFF \n"                        
+"	STR	R1, [R2, #0xC] \n"                   
+"	STR	R1, [R2, #0x1C] \n"                  
+"	STR	R1, [R2, #0x2C] \n"                  
+"	STR	R1, [R2, #0x3C] \n"                  
+"	STR	R1, [R2, #0x4C] \n"                  
+"	STR	R1, [R2, #0x5C] \n"                  
+"	STR	R1, [R2, #0x6C] \n"                  
+"	STR	R1, [R2, #0x7C] \n"                  
+"	STR	R1, [R2, #0x8C] \n"                  
+"	STR	R1, [R2, #0x9C] \n"                  
+"	STR	R1, [R2, #0xAC] \n"                  
+"	STR	R1, [R2, #0xBC] \n"                  
+"	STR	R1, [R2, #0xCC] \n"                  
+"	STR	R1, [R2, #0xDC] \n"                  
+"	STR	R1, [R2, #0xEC] \n"                  
+"	STR	R1, [R2, #0xFC] \n"                  
+"	LDR	R1, =0xC0400008 \n"                  
+"	LDR	R2, =0x430005 \n"                    
+"	STR	R2, [R1] \n"                         
+"	MOV	R1, #1 \n"                           
+"	LDR	R2, =0xC0243100 \n"                  
+"	STR	R2, [R1] \n"                         
+"	LDR	R2, =0xC0242010 \n"                  
+"	LDR	R1, [R2] \n"                         
+"	ORR	R1, R1, #1 \n"                       
+"	STR	R1, [R2] \n"                         
+"	LDR	R0, =0xFFEEB8B8 \n"                  
+"	LDR	R1, =0x1900 \n"                      
+"	LDR	R3, =0xABA4 \n"                      
+"loc_FFC0013C:\n"
+"	CMP	R1, R3 \n"                           
+"	LDRCC	R2, [R0], #4 \n"                   
+"	STRCC	R2, [R1], #4 \n"                   
+"	BCC	loc_FFC0013C \n"                     
+"	LDR	R1, =0x128E90 \n"                    
+"	MOV	R2, #0 \n"                           
+"loc_FFC00154:\n"
+"	CMP	R3, R1 \n"                           
+"	STRCC	R2, [R3], #4 \n"                   
+"	BCC	loc_FFC00154 \n"                     
+"	B	sub_FFC00358_my \n"  //--------->    
+	);
+};
+
+//** sub_FFC00358_my  @ 0xFFC00358 
+
+void __attribute__((naked,noinline)) sub_FFC00358_my() {
+	*(int*)0x1934=(int)taskHook;
+	*(int*)0x1938=(int)taskHook;
+
+	// "correct power on" is to start in record mode if the power button is held down, on cameras that can start with play or power button. Otherwise CHDK always starts in play mode.
+	*(int*)(0x20F8)= (*(int*)0xC022005C) & 1 ? 0x4000000 : 0x2000000; // replacement of sub_FFC42F30 for correct power-on.
+	
+asm volatile (
+"	LDR	R0, =0xFFC003D0 \n"                  
+"	MOV	R1, #0 \n"                           
+"	LDR	R3, =0xFFC00408 \n"                  
+"loc_FFC00364:\n"
+"	CMP	R0, R3 \n"                           
+"	LDRCC	R2, [R0], #4 \n"                   
+"	STRCC	R2, [R1], #4 \n"                   
+"	BCC	loc_FFC00364 \n"                     
+"	LDR	R0, =0xFFC00408 \n"                  
+"	MOV	R1, #0x4B0 \n"                       
+"	LDR	R3, =0xFFC0061C \n"                  
+"loc_FFC00380:\n"
+"	CMP	R0, R3 \n"                           
+"	LDRCC	R2, [R0], #4 \n"                   
+"	STRCC	R2, [R1], #4 \n"                   
+"	BCC	loc_FFC00380 \n"                     
+"	MOV	R0, #0xD2 \n"                        
+"	MSR	CPSR_cxsf, R0 \n"                    
+"	MOV	SP, #0x1000 \n"                      
+"	MOV	R0, #0xD3 \n"                        
+"	MSR	CPSR_cxsf, R0 \n"                    
+"	MOV	SP, #0x1000 \n"                      
+"	LDR	R0, =0x6C4 \n"                       
+"	LDR	R2, =0xEEEEEEEE \n"                  
+"	MOV	R3, #0x1000 \n"                      
+"loc_FFC003B4:\n"
+"	CMP	R0, R3 \n"                           
+"	STRCC	R2, [R0], #4 \n"                   
+"	BCC	loc_FFC003B4 \n"                     
+"	BL	sub_FFC0119C_my \n"  //-------->      
+	);
+}
+
+//** sub_FFC0119C_my  @ 0xFFC0119C 
+
+void __attribute__((naked,noinline)) sub_FFC0119C_my() {
+	asm volatile (
+"	STR	LR, [SP, #-4]! \n"                   
+"	SUB	SP, SP, #0x74 \n"                    
+"	MOV	R0, SP \n"                           
+"	MOV	R1, #0x74 \n"                        
+"	BL	sub_FFE8112C \n"                      
+"	MOV	R0, #0x53000 \n"                     
+"	STR	R0, [SP, #4] \n"                     
+//"	LDR	R0, =0x128E90 \n"         // -
+"	LDR     R0, =new_sa\n"        // +
+"	LDR     R0, [R0]\n"           // +                
+"	LDR	R2, =0x279C00 \n"                    
+"	LDR	R1, =0x2724A8 \n"                    
+"	STR	R0, [SP, #8] \n"                     
+"	SUB	R0, R1, R0 \n"                       
+"	ADD	R3, SP, #0xC \n"                     
+"	STR	R2, [SP] \n"                         
+"	STMIA	R3, {R0-R2} \n"                    
+"	MOV	R0, #0x22 \n"                        
+"	STR	R0, [SP, #0x18] \n"                  
+"	MOV	R0, #0x68 \n"                        
+"	STR	R0, [SP, #0x1C] \n"                  
+"	LDR	R0, =0x19B \n"                       
+"	LDR	R1, =sub_FFC05E5C_my \n"  //--------->
+"	STR	R0, [SP, #0x20] \n"                  
+"	MOV	R0, #0x96 \n"                        
+"	STR	R0, [SP, #0x24] \n"                  
+"	MOV	R0, #0x78 \n"                        
+"	STR	R0, [SP, #0x28] \n"                  
+"	MOV	R0, #0x64 \n"                        
+"	STR	R0, [SP, #0x2C] \n"                  
+"	MOV	R0, #0 \n"                           
+"	STR	R0, [SP, #0x30] \n"                  
+"	STR	R0, [SP, #0x34] \n"                  
+"	MOV	R0, #0x10 \n"                        
+"	STR	R0, [SP, #0x5C] \n"                  
+"	MOV	R0, #0x800 \n"                       
+"	STR	R0, [SP, #0x60] \n"                  
+"	MOV	R0, #0xA0 \n"                        
+"	STR	R0, [SP, #0x64] \n"                  
+"	MOV	R0, #0x280 \n"                       
+"	STR	R0, [SP, #0x68] \n"                  
+"	MOV	R0, SP \n"                           
+"	MOV	R2, #0 \n"                           
+"	BL	sub_FFC03408 \n"                      
+"	ADD	SP, SP, #0x74 \n"                    
+"	LDR	PC, [SP], #4 \n"        
+	);
+}
+
+//** sub_FFC05E5C_my  @ 0xFFC05E5C 
+
+void __attribute__((naked,noinline)) sub_FFC05E5C_my() {
+	asm volatile (
+"	STMFD	SP!, {R4,LR} \n"                   
+"	BL	sub_FFC00B24 \n"                      
+"	BL	sub_FFC0A8D0 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05F70 \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	BL	sub_FFC05A98 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05F78 \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	LDR	R0, =0xFFC05F88 \n"                  
+"	BL	sub_FFC05B80 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05F90 \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	LDR	R0, =0xFFC05F88 \n"                  
+"	BL	sub_FFC03BF4 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05FA4 \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	BL	sub_FFC0A2C8 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05FB0 \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	BL	sub_FFC01680 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDRLT	R0, =0xFFC05FBC \n"                
+"	BLLT	sub_FFC05F50 \n"                    
+"	LDMFD	SP!, {R4,LR} \n"                   
+"	B	 taskcreate_Startup_my\n" //-------->
+	);
+};
+
+//** taskcreate_Startup_my  @ 0xFFC10654 
+
+void __attribute__((naked,noinline)) taskcreate_Startup_my() {
+	asm volatile (
+"	STMFD	SP!, {R3,LR} \n"                   
+//"	BL	sub_FFC238D0 \n"                      
+"	BL	sub_FFC2ABA4 \n"                      
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFC10690 \n"                     
+"	BL	sub_FFC250BC \n"                      
+"	CMP	R0, #0 \n"                           
+"	BEQ	loc_FFC10690 \n"  
+
+
+
+
+                   
+"	BL	sub_FFC238CC \n"                      
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFC10690 \n"                     
+"	LDR	R1, =0xC0220000 \n"                  
+"	MOV	R0, #0x44 \n"                        
+"	STR	R0, [R1, #0x20] \n"                  
+"loc_FFC1068C:\n"
+"	B	loc_FFC1068C \n"                       
+"loc_FFC10690:\n"
+//"	BL	sub_FFC238D8 \n"          // removed for correct power-on on 'on/off' button.                  
+//"	BL	sub_FFC238D4 \n"                      
+"	BL	sub_FFC28FD4 \n"                      
+"	LDR	R1, =0x2CE000 \n"                    
+"	MOV	R0, #0 \n"                           
+"	BL	sub_FFC2921C \n"                      
+"	BL	sub_FFC291C8 \n"                      
+"	MOV	R3, #0 \n"                           
+"	STR	R3, [SP] \n"                         
+"	LDR	R3, =task_Startup_my\n"  //-------->                  
+"	MOV	R2, #0 \n"                           
+"	MOV	R1, #0x19 \n"                        
+"	LDR	R0, =0xFFC106D8 \n"                  
+"	BL	sub_FFC0F1A8 \n"                      
+"	MOV	R0, #0 \n"                           
+"	LDMFD	SP!, {R12,PC} \n"           
+	);
+}
+
+//** task_Startup_my  @ 0xFFC105F8 
+
+void __attribute__((naked,noinline)) task_Startup_my() {
+	asm volatile (
+"	STMFD	SP!, {R4,LR} \n"                   
+"	BL	sub_FFC06278 \n"                      
+"	BL	sub_FFC249CC \n"                      
+"	BL	sub_FFC2326C \n"                      
+//"	BL	sub_FFC2ABE4 \n"                      
+"	BL	sub_FFC2ADD0 \n"                      
+//"	BL	sub_FFC2AC78 \n"     // - start diskboot.bin                     
+"	BL	sub_FFC2AF6C \n"                      
+"	BL	sub_FFC2AE00 \n"                      
+"	BL	sub_FFC2846C \n"                      
+"	BL	sub_FFC2AF70 \n" 
+"	BL  CreateTask_spytask\n"    // +                    
+//"	BL	sub_FFC237C0 \n"		// original taskcreate_PhySw                      
+"	BL  taskcreate_PhySw_my\n"	// +
+"	BL	sub_FFC26CF8 \n"                      
+"	BL	sub_FFC2AF88 \n"                      
+//"	BL	sub_FFC22354 \n"                      
+"	BL	sub_FFC22D48 \n"                      
+"	BL	sub_FFC2A97C \n"                      
+"	BL	sub_FFC23220 \n"                      
+"	BL	sub_FFC22CE8 \n"                      
+"	BL	sub_FFC2B9B4 \n"                      
+"	BL	sub_FFC22CC0 \n"                      
+"	LDMFD	SP!, {R4,LR} \n"                   
+"	B	sub_FFC06128 \n" 
+	);
+}
+
+//** taskcreate_PhySw_my  @ 0xFFC237C0 
+
+void __attribute__((naked,noinline)) taskcreate_PhySw_my(  ) { 
+asm volatile (
+"	STMFD	SP!, {R3-R5,LR} \n"  
+"	LDR	R4, =0x1BE4 \n"                      
+"	LDR	R0, [R4, #0x10] \n"                  
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFC237F4 \n"                     
+"	MOV	R3, #0 \n"                           
+"	STR	R3, [SP] \n"                         
+//"	LDR	R3, =0xFFC2378C \n"  
+"	LDR     R3, =mykbd_task\n"		// Changed                
+//"	MOV	R2, #0x800 \n"    
+"	MOV	R2, #0x2000 \n"			// + stack size for new task_PhySw so we don't have to do stack switch                
+"	B  sub_FFC237E4\n"    // Continue code
+"loc_FFC237F4:\n"
+"	B  sub_FFC237F4\n"    // Continue code 
+	);
+}
+
+
+//** init_file_modules_task  @ 0xFFC705AC 
+
+void __attribute__((naked,noinline)) init_file_modules_task() {
+	asm volatile(
+"	STMFD	SP!, {R4-R6,LR} \n"                
+"	BL	sub_FFC69E48 \n"                      
+"	LDR	R5, =0x5006 \n"                      
+"	MOVS	R4, R0 \n"                          
+"	MOVNE	R1, #0 \n"                         
+"	MOVNE	R0, R5 \n"                         
+"	BLNE	sub_FFC6C70C \n"                    
+"	BL	sub_FFC69E74_my \n"             //------------->       
+"	BL      core_spytask_can_start\n"      // + set "it's safe to start" flag for spytask
+"	CMP	R4, #0 \n"                           
+"	MOVEQ	R0, R5 \n"                         
+"	LDMEQFD	SP!, {R4-R6,LR} \n"              
+"	MOVEQ	R1, #0 \n"                         
+"	BEQ	sub_FFC6C70C \n"                     
+"	LDMFD	SP!, {R4-R6,PC} \n"   
+	);
+}
+
+//** sub_FFC69E74_my  @ 0xFFC69E74 
+
+void __attribute__((naked,noinline)) sub_FFC69E74_my() {
+	asm volatile(
+"	STMFD	SP!, {R4,LR} \n"                   
+"	MOV	R0, #3 \n"                           
+"	BL	sub_FFC50E94_my \n"     //---------->                     
+//"	BL	sub_FFCFA1B8 \n"                      
+"	LDR	R4, =0x2A30 \n"                      
+"	LDR	R0, [R4, #4] \n"                     
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFC69EAC \n"                     
+"	BL	sub_FFC500DC \n"                      
+"	BL	sub_FFCF0788 \n"                      
+"	BL	sub_FFC500DC \n"                      
+"	BL	sub_FFC4CB54 \n"                      
+"	BL	sub_FFC4FFDC \n"                      
+"	BL	sub_FFCF081C \n"                      
+"loc_FFC69EAC:\n"
+"	MOV	R0, #1 \n"                           
+"	STR	R0, [R4] \n"                         
+"	LDMFD	SP!, {R4,PC} \n"  
+	);
+}
+
+//** sub_FFC50E94_my  @ 0xFFC50E94 
+
+void __attribute__((naked,noinline)) sub_FFC50E94_my(  ) { 
+		asm volatile(
+"	STMFD	SP!, {R4-R8,LR} \n"                
+"	MOV	R8, R0 \n"                           
+"	BL	sub_FFC50E14 \n"                      
+"	LDR	R1, =0x32350 \n"                     
+"	MOV	R6, R0 \n"                           
+"	ADD	R4, R1, R0, LSL #7 \n"               
+"	LDR	R0, [R4, #0x6C] \n"                  
+"	CMP	R0, #4 \n"                           
+"	LDREQ	R1, =0x817 \n"                     
+"	LDREQ	R0, =0xFFC50954 \n"                
+"	BLEQ	sub_FFC0F680 \n"                    
+"	MOV	R1, R8 \n"                           
+"	MOV	R0, R6 \n"                           
+"	BL	sub_FFC506CC \n"                      
+"	LDR	R0, [R4, #0x38] \n"                  
+"	BL	sub_FFC51534 \n"                      
+"	CMP	R0, #0 \n"                           
+"	STREQ	R0, [R4, #0x6C] \n"                
+"	MOV	R0, R6 \n"                           
+"	BL	sub_FFC5075C \n"                      
+"	MOV	R0, R6 \n"                           
+"	BL	sub_FFC50ABC_my \n"  //--------->                      
+"	MOV	R5, R0 \n"                           
+"	MOV	R0, R6 \n"                           
+"	BL	sub_FFC50CEC \n"                      
+"	LDR	R6, [R4, #0x3C] \n"                  
+"	AND	R7, R5, R0 \n"                       
+"	CMP	R6, #0 \n"                           
+"	LDR	R1, [R4, #0x38] \n"                  
+"	MOVEQ	R0, #0x80000001 \n"                
+"	MOV	R5, #0 \n"                           
+"	BEQ	loc_FFC50F44 \n"                     
+"	MOV	R0, R1 \n"                           
+"	BL	sub_FFC50244 \n"                      
+"	CMP	R0, #0 \n"                           
+"	MOVNE	R5, #4 \n"                         
+"	CMP	R6, #5 \n"                           
+"	ORRNE	R0, R5, #1 \n"                     
+"	BICEQ	R0, R5, #1 \n"                     
+"	CMP	R7, #0 \n"                           
+"	BICEQ	R0, R0, #2 \n"                     
+"	ORREQ	R0, R0, #0x80000000 \n"            
+"	BICNE	R0, R0, #0x80000000 \n"            
+"	ORRNE	R0, R0, #2 \n"                     
+"loc_FFC50F44:\n"
+"	CMP	R8, #7 \n"                           
+"	STR	R0, [R4, #0x40] \n"                  
+"	LDMNEFD	SP!, {R4-R8,PC} \n"              
+"	MOV	R0, R8 \n"                           
+"	BL	sub_FFC50E64 \n"                      
+"	CMP	R0, #0 \n"                           
+"	LDMEQFD	SP!, {R4-R8,LR} \n"              
+"	LDREQ	R0, =0xFFC50F90 \n"                
+"	BEQ	sub_FFC01780 \n"                     
+"	LDMFD	SP!, {R4-R8,PC} \n"       
+		);
+}
+
+
+//** sub_FFC50ABC_my  @ 0xFFC50ABC
+
+void __attribute__((naked,noinline)) sub_FFC50ABC_my() {
+	asm volatile(
+"	STMFD	SP!, {R4-R6,LR} \n"                
+"	MOV	R5, R0 \n"                           
+"	LDR	R0, =0x32350 \n"                     
+"	ADD	R4, R0, R5, LSL #7 \n"               
+"	LDR	R0, [R4, #0x6C] \n"                  
+"	TST	R0, #2 \n"                           
+"	MOVNE	R0, #1 \n"                         
+"	LDMNEFD	SP!, {R4-R6,PC} \n"              
+"	LDR	R0, [R4, #0x38] \n"                  
+"	MOV	R1, R5 \n"                           
+"	BL	sub_FFC507DC_my \n"  //--------->                      
+"	CMP	R0, #0 \n"                           
+"	LDRNE	R0, [R4, #0x38] \n"                
+"	MOVNE	R1, R5 \n"                         
+"	BLNE	sub_FFC50978 \n"                    
+"	LDR	R2, =0x323D0 \n"                     
+"	ADD	R1, R5, R5, LSL #4 \n"               
+"	LDR	R1, [R2, R1, LSL #2] \n"             
+"	CMP	R1, #4 \n"                           
+"	BEQ	loc_FFC50B1C \n"                     
+"	CMP	R0, #0 \n"                           
+"	LDMEQFD	SP!, {R4-R6,PC} \n"              
+"	MOV	R0, R5 \n"                           
+"	BL	sub_FFC502D4 \n"                      
+"loc_FFC50B1C:\n"
+"	CMP	R0, #0 \n"                           
+"	LDRNE	R1, [R4, #0x6C] \n"                
+"	ORRNE	R1, R1, #2 \n"                     
+"	STRNE	R1, [R4, #0x6C] \n"                
+"	LDMFD	SP!, {R4-R6,PC} \n"      
+	);
+}
+
+//** sub_FFC507DC_my  @ 0xFFC507DC 
+
+void __attribute__((naked,noinline)) sub_FFC507DC_my() {
+asm volatile(
+"	STMFD	SP!, {R4-R10,LR} \n"               
+"	MOV	R9, R0 \n"                           
+"	LDR	R0, =0x32350 \n"                     
+"	MOV	R8, #0 \n"                           
+"	ADD	R5, R0, R1, LSL #7 \n"               
+"	LDR	R0, [R5, #0x3C] \n"                  
+"	MOV	R7, #0 \n"                           
+"	CMP	R0, #7 \n"                           
+"	MOV	R6, #0 \n"                           
+"	ADDLS	PC, PC, R0, LSL #2 \n"             
+"	B	loc_FFC50934 \n"                       
+"	B	loc_FFC50840 \n"                       
+"	B	loc_FFC50828 \n"                       
+"	B	loc_FFC50828 \n"                       
+"	B	loc_FFC50828 \n"                       
+"	B	loc_FFC50828 \n"                       
+"	B	loc_FFC5092C \n"                       
+"	B	loc_FFC50828 \n"                       
+"	B	loc_FFC50828 \n"                       
+"loc_FFC50828:\n"
+"	MOV	R2, #0 \n"                           
+"	MOV	R1, #0x200 \n"                       
+"	MOV	R0, #2 \n"                           
+"	BL	sub_FFC64074 \n"                      
+"	MOVS	R4, R0 \n"                          
+"	BNE	loc_FFC50848 \n"                     
+"loc_FFC50840:\n"
+"	MOV	R0, #0 \n"                           
+"	LDMFD	SP!, {R4-R10,PC} \n"               
+"loc_FFC50848:\n"
+"	LDR	R12, [R5, #0x50] \n"                 
+"	MOV	R3, R4 \n"                           
+"	MOV	R2, #1 \n"                           
+"	MOV	R1, #0 \n"                           
+"	MOV	R0, R9 \n"                           
+"	BLX	R12 \n"                              
+"	CMP	R0, #1 \n"                           
+"	BNE	loc_FFC50874 \n"                     
+"	MOV	R0, #2 \n"                           
+"	BL	sub_FFC641C0 \n"                      
+"	B	loc_FFC50840 \n"                       
+"loc_FFC50874:\n"
+"	LDR	R1, [R5, #0x64] \n"                  
+"	MOV	R0, R9 \n"     
+"	BLX	R1 \n"    
+
+		 "MOV   R1, R4\n"           // + pointer to MBR in R1
+		 "BL    mbr_read_dryos\n"   // + total sectors count in R0 before and after call
+
+          // Start of DataGhost's FAT32 autodetection code
+          // Policy: If there is a partition which has type W95 FAT32, use the first one of those for image storage
+          // According to the code below, we can use R1, R2, R3 and R12.
+          // LR wasn't really used anywhere but for storing a part of the partition signature. This is the only thing
+          // that won't work with an offset, but since we can load from LR+offset into LR, we can use this to do that :)
+          "MOV     R12, R4\n"                    // Copy the MBR start address so we have something to work with
+          "MOV     LR, R4\n"                     // Save old offset for MBR signature
+          "MOV     R1, #1\n"                     // Note the current partition number
+          "B       dg_sd_fat32_enter\n"          // We actually need to check the first partition as well, no increments yet!
+     "dg_sd_fat32:\n"
+          "CMP     R1, #4\n"                     // Did we already see the 4th partition?
+          "BEQ     dg_sd_fat32_end\n"            // Yes, break. We didn't find anything, so don't change anything.
+          "ADD     R12, R12, #0x10\n"            // Second partition
+          "ADD     R1, R1, #1\n"                 // Second partition for the loop
+     "dg_sd_fat32_enter:\n"
+          "LDRB    R2, [R12, #0x1BE]\n"          // Partition status
+          "LDRB    R3, [R12, #0x1C2]\n"          // Partition type (FAT32 = 0xB)
+          "CMP     R3, #0xB\n"                   // Is this a FAT32 partition?
+          "CMPNE   R3, #0xC\n"                   // Not 0xB, is it 0xC (FAT32 LBA) then?
+          "BNE     dg_sd_fat32\n"                // No, it isn't. Loop again.
+          "CMP     R2, #0x00\n"                  // It is, check the validity of the partition type
+          "CMPNE   R2, #0x80\n"
+          "BNE     dg_sd_fat32\n"                // Invalid, go to next partition
+                                                 // This partition is valid, it's the first one, bingo!
+          "MOV     R4, R12\n"                    // Move the new MBR offset for the partition detection.
+          
+     "dg_sd_fat32_end:\n"
+          // End of DataGhost's FAT32 autodetection code
+
+                           
+"	LDRB	R1, [R4, #0x1C9] \n"                
+"	LDRB	R3, [R4, #0x1C8] \n"                
+"	LDRB	R12, [R4, #0x1CC] \n"               
+"	MOV	R1, R1, LSL #0x18 \n"                
+"	ORR	R1, R1, R3, LSL #0x10 \n"            
+"	LDRB	R3, [R4, #0x1C7] \n"                
+"	LDRB	R2, [R4, #0x1BE] \n"                
+//"	LDRB	LR, [R4, #0x1FF] \n"     // -               
+"	ORR	R1, R1, R3, LSL #8 \n"               
+"	LDRB	R3, [R4, #0x1C6] \n"                
+"	CMP	R2, #0 \n"                           
+"	CMPNE	R2, #0x80 \n"                      
+"	ORR	R1, R1, R3 \n"                       
+"	LDRB	R3, [R4, #0x1CD] \n"                
+"	MOV	R3, R3, LSL #0x18 \n"                
+"	ORR	R3, R3, R12, LSL #0x10 \n"           
+"	LDRB	R12, [R4, #0x1CB] \n"               
+"	ORR	R3, R3, R12, LSL #8 \n"              
+"	LDRB	R12, [R4, #0x1CA] \n"               
+"	ORR	R3, R3, R12 \n"                      
+//"	LDRB	R12, [R4, #0x1FE] \n"         // - 
+"	LDRB    R12, [LR,#0x1FE]\n"           // + First MBR signature byte (0x55), LR is original offset.
+"	LDRB    LR, [LR,#0x1FF]\n"            // + Last MBR signature byte (0xAA), LR is original offset.          
+"	BNE	loc_FFC50900 \n"                     
+"	CMP	R0, R1 \n"                           
+"	BCC	loc_FFC50900 \n"                     
+"	ADD	R2, R1, R3 \n"                       
+"	CMP	R2, R0 \n"                           
+"	CMPLS	R12, #0x55 \n"                     
+"	CMPEQ	LR, #0xAA \n"                      
+"	MOVEQ	R7, R1 \n"                         
+"	MOVEQ	R6, R3 \n"                         
+"	MOVEQ	R4, #1 \n"                         
+"	BEQ	loc_FFC50904 \n"                     
+"loc_FFC50900:\n"
+"	MOV	R4, R8 \n"                           
+"loc_FFC50904:\n"
+"	MOV	R0, #2 \n"                           
+"	BL	sub_FFC641C0 \n"                      
+"	CMP	R4, #0 \n"                           
+"	BNE	loc_FFC50940 \n"                     
+"	LDR	R1, [R5, #0x64] \n"                  
+"	MOV	R7, #0 \n"                           
+"	MOV	R0, R9 \n"                           
+"	BLX	R1 \n"                               
+"	MOV	R6, R0 \n"                           
+"	B	loc_FFC50940 \n"                       
+"loc_FFC5092C:\n"
+"	MOV	R6, #0x40 \n"                        
+"	B	loc_FFC50940 \n"                       
+"loc_FFC50934:\n"
+"	LDR	R1, =0x572 \n"                       
+"	LDR	R0, =0xFFC50954 \n"                  
+"	BL	sub_FFC0F680 \n"                      
+"loc_FFC50940:\n"
+"	STR	R7, [R5, #0x44]! \n"                 
+"	STMIB	R5, {R6,R8} \n"                    
+"	MOV	R0, #1 \n"                           
+"	LDMFD	SP!, {R4-R10,PC} \n"          
+	);
+}
+
+
+
Index: /trunk/platform/a495/sub/100e/stubs_min.S
===================================================================
--- /trunk/platform/a495/sub/100e/stubs_min.S	(revision 1198)
+++ /trunk/platform/a495/sub/100e/stubs_min.S	(revision 1198)
@@ -0,0 +1,17 @@
+#include "stubs_asm.h"
+
+DEF(physw_status, 0x2E7F4)							// ok, Search "GpioStatus "
+DEF(physw_run, 0x1BE4 + 0x0C)						// ROM:FFC2378C
+DEF(FlashParamsTable,0xFFECF894)					// ROM:FFE0AA80
+DEF(zoom_busy, 0x5410 + 0x14)
+DEF(focus_busy, 0x532C + 8)
+DEF(canon_menu_active, 0x2A38 + 4)					// Ok ROM:FFC6A11C
+DEF(canon_shoot_menu_active, 0x36FC0)				// ?? Found on ROM:FFC77758 taskcreate_DSITask
+DEF(recreview_hold, 0x6308 + 2)						// ROM:FFD34410 
+DEF(zoom_status, 0x9628)							// "TerminateDeliverToZoomController"
+DEF(movie_status, 0x5468 + 0x38)					// Unknown
+DEF(enabled_refresh_physical_screen, 0x73AC+0x20)	// ROM:FFD7C7B4
+DEF(playrec_mode, 0x2794+0x4)						// ROM:FFC27ACC "MenuIn" ROM:FFC5D8F4
+DEF(levent_table, 0xFFEA2D14)						// Ok
+DEF(some_flag_for_af_scan, 0x5848)					// Correct? ROM:FFD0F9DC
+DEF(full_screen_refresh, 0x7370)					// ROM:FFD7A9FC, called by RefreshPhysicalScreen()
Index: /trunk/platform/a495/sub/100e/makefile.inc
===================================================================
--- /trunk/platform/a495/sub/100e/makefile.inc	(revision 1198)
+++ /trunk/platform/a495/sub/100e/makefile.inc	(revision 1198)
@@ -0,0 +1,27 @@
+#PLATFORMID=0x31EF
+PLATFORMID=12783
+
+PLATFORMOS=dryos
+
+# address where wif or diskboot code will be loaded by camera, ROM:FFC00134
+MEMBASEADDR=0x1900
+
+# size of memory region for CHDK
+RESTARTSTART=0x50000
+
+# ROM:FFC0014C
+MEMISOSTART=0x128E90
+
+# Base address 0xFFC00000 for A
+ROMBASEADDR=0xFFC00000
+
+
+PLFLAGS=-DMEMBASEADDR=$(MEMBASEADDR) -DMEMISOSTART=$(MEMISOSTART) -DMEMISOSIZE=$(MEMISOSIZE)
+PLFLAGS+=-DRESTARTSTART=$(RESTARTSTART)
+
+# type of diskboot encoding: undefined = none; 1 = original; 2 = sx200, d10; 3 = ixus200...
+# Dancing Bits
+NEED_ENCODED_DISKBOOT=4
+
+# FIR (requires correct keys in platform/fi2.inc)
+KEYSYS=d4a
Index: /trunk/platform/a495/sub/100e/stubs_asm.h
===================================================================
--- /trunk/platform/a495/sub/100e/stubs_asm.h	(revision 1198)
+++ /trunk/platform/a495/sub/100e/stubs_asm.h	(revision 1198)
@@ -0,0 +1,20 @@
+    .text
+
+#define DEF(n,a) \
+    .globl n; n = a
+
+#define NSTUB(name, addr)\
+    .globl _##name ;\
+    .weak _##name ;\
+    _##name: ;\
+	ldr  pc, = ## addr
+
+#define NHSTUB(name, addr)\
+    .globl _##name ;\
+    _##name: ;\
+	ldr  pc, = ## addr
+
+#define STUB(addr)\
+    .globl sub_ ## addr ;\
+    sub_ ## addr: ;\
+	ldr  pc, =0x ## addr
Index: /trunk/platform/a495/sub/100e/lib.c
===================================================================
--- /trunk/platform/a495/sub/100e/lib.c	(revision 1198)
+++ /trunk/platform/a495/sub/100e/lib.c	(revision 1198)
@@ -0,0 +1,53 @@
+#include "platform.h"
+#include "lolevel.h"
+
+char *hook_raw_image_addr()
+{
+	return (char*) 0x10E52420; // Ok, ROM:FFCE9A44
+}
+
+long hook_raw_size()
+{
+	return 0xEC04F0;           // "CRAW BUFF SIZE"
+}
+
+// Live picture buffer (shoot not pressed)
+void *vid_get_viewport_live_fb()
+{
+	return (void*)0;
+    /*void **fb=(void **)0x3E80;  // ?
+    unsigned char buff = *((unsigned char*)0x3CF0); // sub_FFC87F0C
+    if (buff == 0) buff = 2;  else buff--;    
+    return fb[buff];*/
+}
+
+// OSD buffer
+void *vid_get_bitmap_fb()
+{
+	return (void*)0x10361000; // "BmpDDev.c", 0xFFCD1DD4
+}
+
+// Live picture buffer (shoot half-pressed)
+void *vid_get_viewport_fb()
+{
+	return (void*)0x10648CC0;  // "VRAM Address" sub_FFCA6830
+}
+
+void *vid_get_viewport_fb_d()
+{
+	return (void*)(*(int*)(0x2540+0x54)); // sub_FFC528C0 / sub_FFC53554?
+}
+
+long vid_get_bitmap_screen_width() { return 360; }
+long vid_get_bitmap_screen_height() { return 240; }
+
+long vid_get_viewport_height() { return 240; }
+
+long vid_get_bitmap_buffer_width() { return 360; }
+long vid_get_bitmap_buffer_height() { return 240; }
+
+char *camera_jpeg_count_str()
+{
+	return (char*)0x7486C;  // ROM:FFD72194 "9999"
+}
+
Index: /trunk/platform/a495/sub/100e/movie_rec.c
===================================================================
--- /trunk/platform/a495/sub/100e/movie_rec.c	(revision 1198)
+++ /trunk/platform/a495/sub/100e/movie_rec.c	(revision 1198)
@@ -0,0 +1,327 @@
+#include "conf.h"
+
+int *video_quality = &conf.video_quality;
+int *video_mode    = &conf.video_mode;
+
+long def_table[24]={0x2000, 0x38D, 0x788, 0x5800, 0x9C5, 0x14B8, 0x10000, 0x1C6A, 0x3C45, 0x8000, 0xE35, 0x1E23,
+           0x1CCD, -0x2E1, -0x579, 0x4F33, -0x7EB, -0xF0C, 0xE666, -0x170A, -0x2BC6, 0x7333, -0xB85, -0x15E3};
+
+long table[24];
+
+void change_video_tables(int a, int b){
+ int i;
+ for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b; 
+}
+
+long CompressionRateTable[]={0x60, 0x5D, 0x5A, 0x57, 0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 9, 7, 6, 5, 4, 3, 2, 1};
+
+//** movie_record_task  @ 0xFFD0CA2C 
+
+void __attribute__((naked,noinline)) movie_record_task(){ 
+	asm volatile(
+"	STMFD	SP!, {R2-R8,LR} \n"                
+"	LDR	R8, =0x346 \n"                       
+"	LDR	R7, =0x2710 \n"                      
+"	LDR	R4, =0x5468 \n"                      
+"	MOV	R6, #0 \n"                           
+"	MOV	R5, #1 \n"                           
+"loc_FFD0CA44:\n"
+"	LDR	R0, [R4, #0x18] \n"                  
+"	MOV	R2, #0 \n"                           
+"	ADD	R1, SP, #4 \n"                       
+"	BL	sub_FFC28AA0 \n"                      
+"	LDR	R0, [R4, #0x20] \n"                  
+"	CMP	R0, #0 \n"                           
+"	BNE	loc_FFD0CB14 \n"                     
+"	LDR	R0, [SP, #4] \n"                     
+"	LDR	R1, [R0] \n"                         
+"	SUB	R1, R1, #2 \n"                       
+"	CMP	R1, #9 \n"                           
+"	ADDLS	PC, PC, R1, LSL #2 \n"             
+"	B	loc_FFD0CB14 \n"                       
+"	B	loc_FFD0CAC8 \n"                       
+"	B	loc_FFD0CAE8 \n"                       
+"	B	loc_FFD0CAF8 \n"                       
+"	B	loc_FFD0CB00 \n"                       
+"	B	loc_FFD0CAD0 \n"                       
+"	B	loc_FFD0CB08 \n"                       
+"	B	loc_FFD0CAD8 \n"                       
+"	B	loc_FFD0CB14 \n"                       
+"	B	loc_FFD0CB10 \n"                       
+"	B	loc_FFD0CAA0 \n"                       
+"loc_FFD0CAA0:\n"
+"	LDR	R0, =0xFFD0C738 \n"                  
+"	STR	R6, [R4, #0x34] \n"                  
+"	STR	R0, [R4, #0xA8] \n"                  
+"	LDR	R0, =0xFFD0C1C8 \n"                  
+"	LDR	R2, =0xFFD0C0E4 \n"                  
+"	LDR	R1, =0x6EB90 \n"                     
+"	STR	R6, [R4, #0x24] \n"                  
+"	BL	sub_FFCB6668 \n"                      
+"	STR	R5, [R4, #0x38] \n"                  
+"	B	loc_FFD0CB14 \n"                       
+"loc_FFD0CAC8:\n"
+"	BL      unlock_optical_zoom\n"		//  +
+"	BL	sub_FFD0C830 \n"                      
+"	B	loc_FFD0CB14 \n"                       
+"loc_FFD0CAD0:\n"
+"	BL	sub_FFD0C538_my \n"  			//---------->                     
+"	B	loc_FFD0CB14 \n"                       
+"loc_FFD0CAD8:\n"
+"	LDR	R1, [R0, #0x10] \n"                  
+"	LDR	R0, [R0, #4] \n"                     
+"	BL	sub_FFDF8DA0 \n"                      
+"	B	loc_FFD0CB14 \n"                       
+"loc_FFD0CAE8:\n"
+"	LDR	R0, [R4, #0x38] \n"                  
+"	CMP	R0, #5 \n"                           
+"	STRNE	R5, [R4, #0x28] \n"                
+"	B	loc_FFD0CB14 \n"                       
+"loc_FFD0CAF8:\n"
+"	BL	sub_FFD0C350 \n"                      
+"	B	loc_FFD0CB14 \n"                       
+"loc_FFD0CB00:\n"
+"	BL	sub_FFD0C214 \n"                      
+"	B	loc_FFD0CB14 \n"                       
+"loc_FFD0CB08:\n"
+"	BL	sub_FFD0C070 \n"                      
+"	B	loc_FFD0CB14 \n"                       
+"loc_FFD0CB10:\n"
+"	BL	sub_FFD0CC7C \n"                      
+"loc_FFD0CB14:\n"
+"	LDR	R1, [SP, #4] \n"                     
+"	LDR	R3, =0xFFD0BF00 \n"                  
+"	STR	R6, [R1] \n"                         
+"	STR	R8, [SP] \n"                         
+"	LDR	R0, [R4, #0x1C] \n"                  
+"	MOV	R2, R7 \n"                           
+"	BL	sub_FFC0F5C0 \n"                      
+"	B	loc_FFD0CA44 \n"           
+	);
+}
+
+
+
+void __attribute__((naked,noinline)) sub_FFD0C538_my(){ 
+	asm volatile(
+"	STMFD	SP!, {R4-R8,LR} \n"                
+"	SUB	SP, SP, #0x40 \n"                    
+"	MOV	R6, #0 \n"                           
+"	LDR	R5, =0x5468 \n"                      
+"	MOV	R4, R0 \n"                           
+"	STR	R6, [SP, #0x30] \n"                  
+"	STR	R6, [SP, #0x28] \n"                  
+"	LDR	R0, [R5, #0x38] \n"                  
+"	MOV	R8, #4 \n"                           
+"	CMP	R0, #3 \n"                           
+"	STREQ	R8, [R5, #0x38] \n"                
+"	LDR	R0, [R5, #0xA8] \n"                  
+"	BLX	R0 \n"                               
+"	LDR	R0, [R5, #0x38] \n"                  
+"	CMP	R0, #4 \n"                           
+"	BNE	loc_FFD0C610 \n"                     
+"	ADD	R3, SP, #0x28 \n"                    
+"	ADD	R2, SP, #0x2C \n"                    
+"	ADD	R1, SP, #0x30 \n"                    
+"	ADD	R0, SP, #0x34 \n"                    
+"	BL	sub_FFDF8F34 \n"                      
+"	CMP	R0, #0 \n"                           
+"	MOV	R7, #1 \n"                           
+"	BNE	loc_FFD0C5B4 \n"                     
+"	LDR	R1, [R5, #0x28] \n"                  
+"	CMP	R1, #1 \n"                           
+"	BNE	loc_FFD0C618 \n"                     
+"	LDR	R1, [R5, #0x60] \n"                  
+"	LDR	R2, [R5, #0x3C] \n"                  
+"	CMP	R1, R2 \n"                           
+"	BCC	loc_FFD0C618 \n"                     
+"loc_FFD0C5B4:\n"
+"	CMP	R0, #0x80000001 \n"                  
+"	STREQ	R8, [R5, #0x64] \n"                
+"	BEQ	loc_FFD0C5EC \n"                     
+"	CMP	R0, #0x80000003 \n"                  
+"	STREQ	R7, [R5, #0x64] \n"                
+"	BEQ	loc_FFD0C5EC \n"                     
+"	CMP	R0, #0x80000005 \n"                  
+"	MOVEQ	R0, #2 \n"                         
+"	BEQ	loc_FFD0C5E8 \n"                     
+"	CMP	R0, #0x80000007 \n"                  
+"	STRNE	R6, [R5, #0x64] \n"                
+"	BNE	loc_FFD0C5EC \n"                     
+"	MOV	R0, #3 \n"                           
+"loc_FFD0C5E8:\n"
+"	STR	R0, [R5, #0x64] \n"                  
+"loc_FFD0C5EC:\n"
+"	LDR	R0, =0x6EBC0 \n"                     
+"	LDR	R0, [R0, #8] \n"                     
+"	CMP	R0, #0 \n"                           
+"	BEQ	loc_FFD0C604 \n"                     
+"	BL	sub_FFC445C4 \n"                      
+"	B	loc_FFD0C608 \n"                       
+"loc_FFD0C604:\n"
+"	BL	sub_FFD0C070 \n"                      
+"loc_FFD0C608:\n"
+"	MOV	R0, #5 \n"                           
+"	STR	R0, [R5, #0x38] \n"                  
+"loc_FFD0C610:\n"
+"	ADD	SP, SP, #0x40 \n"                    
+"	LDMFD	SP!, {R4-R8,PC} \n"                
+"loc_FFD0C618:\n"
+"	LDR	LR, [SP, #0x30] \n"                  
+"	CMP	LR, #0 \n"                           
+"	BEQ	loc_FFD0C6E0 \n"                     
+"	STR	R7, [R5, #0x2C] \n"                  
+"	LDR	R0, [R5, #0x7C] \n"                  
+"	LDR	R1, [R4, #0x14] \n"                  
+"	LDR	R2, [R4, #0x18] \n"                  
+"	LDR	R12, [R4, #0xC] \n"                  
+"	ADD	R3, SP, #0x38 \n"                    
+"	ADD	R8, SP, #0x14 \n"                    
+"	STMIA	R8, {R0-R3} \n"                    
+"	LDR	R3, [R5, #0x68] \n"                  
+"	ADD	R2, SP, #0x3C \n"                    
+"	ADD	R8, SP, #8 \n"                       
+"	LDRD	R0, [SP, #0x28] \n"                 
+"	STMIA	R8, {R0,R2,R3} \n"                 
+"	STR	R1, [SP, #4] \n"                     
+"	STR	LR, [SP] \n"                         
+"	LDMIB	R4, {R0,R1} \n"                    
+"	LDR	R3, [SP, #0x34] \n"                  
+"	MOV	R2, R12 \n"                          
+"	BL	sub_FFDCE5B4 \n"                      
+"	LDR	R0, [R5, #0x10] \n"                  
+"	LDR	R1, [R5, #0x58] \n"                  
+"	BL	sub_FFC0F034 \n"                      
+"	CMP	R0, #9 \n"                           
+"	BNE	loc_FFD0C694 \n"                     
+"	BL	sub_FFDF9520 \n"                      
+"	MOV	R0, #0x90000 \n"                     
+"	STR	R7, [R5, #0x38] \n"                  
+"	B	loc_FFD0C6AC \n"                       
+"loc_FFD0C694:\n"
+"	LDR	R0, [SP, #0x38] \n"                  
+"	CMP	R0, #0 \n"                           
+"	BEQ	loc_FFD0C6B4 \n"                     
+"	BL	sub_FFDF9520 \n"                      
+"	MOV	R0, #0xA0000 \n"                     
+"	STR	R7, [R5, #0x38] \n"                  
+"loc_FFD0C6AC:\n"
+"	BL	sub_FFC6D130 \n"                      
+"	B	loc_FFD0C610 \n"                       
+"loc_FFD0C6B4:\n"
+"	BL	sub_FFDCE678 \n"                      
+"	LDR	R0, [SP, #0x34] \n"                  
+"	LDR	R1, [SP, #0x3C] \n"                  
+"	BL	sub_FFDF92C8 \n"                      
+"	LDR	R0, [R5, #0x5C] \n"                  
+"	LDR	R1, =0x54E4 \n"                      
+"	ADD	R0, R0, #1 \n"                       
+"	STR	R0, [R5, #0x5C] \n"                  
+"	LDR	R0, [SP, #0x3C] \n"                  
+"	MOV	R2, #0 \n"                           
+"	BL	sub_FFDF70EC_my \n"  //---------->                      
+"loc_FFD0C6E0:\n"
+"	LDR	R0, [R5, #0x60] \n"                  
+"	ADD	R0, R0, #1 \n"                       
+"	STR	R0, [R5, #0x60] \n"                  
+"	LDR	R1, [R5, #0x4C] \n"                  
+"	MUL	R0, R1, R0 \n"                       
+"	LDR	R1, [R5, #0x48] \n"                  
+"	BL	sub_FFE829DC \n"                      
+"	MOV	R4, R0 \n"                           
+"	BL	sub_FFDF9558 \n"                      
+"	LDR	R1, [R5, #0x80] \n"                  
+"	CMP	R1, R4 \n"                           
+"	BNE	loc_FFD0C71C \n"                     
+"	LDR	R0, [R5, #0x30] \n"                  
+"	CMP	R0, #1 \n"                           
+"	BNE	loc_FFD0C730 \n"                     
+"loc_FFD0C71C:\n"
+"	LDR	R1, [R5, #0x8C] \n"                  
+"	MOV	R0, R4 \n"                           
+"	BLX	R1 \n"                               
+"	STR	R4, [R5, #0x80] \n"                  
+"	STR	R6, [R5, #0x30] \n"                  
+"loc_FFD0C730:\n"
+"	STR	R6, [R5, #0x2C] \n"                  
+"	B	loc_FFD0C610 \n"     
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFDF70EC_my(){ 
+	asm volatile(
+"	STMFD	SP!, {R4-R8,LR} \n"                
+"	LDR	R4, =0x8940 \n"                      
+"	LDR	LR, [R4] \n"                         
+"	LDR	R2, [R4, #8] \n"                     
+"	CMP	LR, #0 \n"                           
+"	LDRNE	R3, [R4, #0xC] \n"                 
+"	MOV	R5, R2 \n"                           
+"	CMPNE	R3, #1 \n"                         
+"	MOVEQ	R2, #0 \n"                         
+"	STREQ	R0, [R4] \n"                       
+"	STREQ	R2, [R4, #0xC] \n"                 
+"	BEQ	loc_FFDF71B8 \n"                     
+"	LDR	R3, [R4, #4] \n"                     
+"	LDR	R7,  =table \n"                  
+"	ADD	R12, R3, R3, LSL #1 \n"              
+"	LDR	R3, [R7, R12, LSL #2] \n"            
+"	ADD	R6, R7, #0x30 \n"                    
+"	LDR	R8, [R6, R12, LSL #2] \n"            
+"	SUB	R3, LR, R3 \n"                       
+"	CMP	R3, #0 \n"                           
+"	SUB	LR, LR, R8 \n"                       
+"	BLE	loc_FFDF7174 \n"                     
+"	ADD	R12, R7, R12, LSL #2 \n"             
+"	LDR	LR, [R12, #4] \n"                    
+"	CMP	LR, R3 \n"                           
+"	ADDGE	R2, R2, #1 \n"                     
+"	BGE	loc_FFDF7168 \n"                     
+"	LDR	R12, [R12, #8] \n"                   
+"	CMP	R12, R3 \n"                          
+"	ADDLT	R2, R2, #3 \n"                     
+"	ADDGE	R2, R2, #2 \n"                     
+"loc_FFDF7168:\n"
+//"	CMP	R2, #0x17 \n"      // -                        
+//"	MOVGE	R2, #0x16 \n"  // -  
+"	CMP     R2, #0x1A\n"   // +
+"	MOVGE   R2, #0x19\n"   // +  
+"	B	loc_FFDF71A8 \n"                       
+"loc_FFDF7174:\n"
+"	CMP	LR, #0 \n"                           
+"	BGE	loc_FFDF71A8 \n"                     
+"	ADD	R3, R6, R12, LSL #2 \n"              
+"	LDR	R12, [R3, #4] \n"                    
+"	CMP	R12, LR \n"                          
+"	SUBLE	R2, R2, #1 \n"                     
+"	BLE	loc_FFDF71A0 \n"                     
+"	LDR	R3, [R3, #8] \n"                     
+"	CMP	R3, LR \n"                           
+"	SUBGT	R2, R2, #3 \n"                     
+"	SUBLE	R2, R2, #2 \n"                     
+"loc_FFDF71A0:\n"
+"	CMP	R2, #0 \n"                           
+"	MOVLT	R2, #0 \n"                         
+"loc_FFDF71A8:\n"
+"	CMP	R2, R5 \n"                           
+"	STRNE	R2, [R4, #8] \n"                   
+"	MOVNE	R2, #1 \n"                         
+"	STRNE	R2, [R4, #0xC] \n"                 
+"loc_FFDF71B8:\n"
+"	LDR	R2, =CompressionRateTable \n"                  
+"	LDR	R3, [R4, #8] \n"                     
+"	LDR	R2, [R2, R3, LSL #2] \n"             
+
+"LDR     R3, =video_mode\n"      // +
+"LDR     R3, [R3]\n"             // +
+"LDR     R3, [R3]\n"             // +
+"CMP     R3, #1\n"               // +
+"LDREQ   R3, =video_quality\n"   // +     
+"LDREQ   R3, [R3]\n"             // +     
+"LDREQ   R2, [R3]\n"             // +  
+
+"	STR	R2, [R1] \n"                         
+"	STR	R0, [R4] \n"                         
+"	LDMFD	SP!, {R4-R8,PC} \n"          
+	);
+}
Index: /trunk/platform/a495/sub/100e/stubs_auto.S
===================================================================
--- /trunk/platform/a495/sub/100e/stubs_auto.S	(revision 1198)
+++ /trunk/platform/a495/sub/100e/stubs_auto.S	(revision 1198)
@@ -0,0 +1,207 @@
+/* THIS FILE IS GENERATED */
+/* DO NOT EDIT THIS FILE! */
+
+#include "stubs_asm.h"
+
+STUB(FFC00358)
+STUB(FFC00B24)
+STUB(FFC0119C)
+STUB(FFC01680)
+STUB(FFC01780)
+STUB(FFC03408)
+STUB(FFC03BF4)
+STUB(FFC05A98)
+STUB(FFC05B80)
+STUB(FFC05F50)
+STUB(FFC06128)
+STUB(FFC06278)
+STUB(FFC0A2C8)
+STUB(FFC0A8D0)
+STUB(FFC0F034)
+STUB(FFC0F1A8)
+STUB(FFC0F438)
+STUB(FFC0F480)
+STUB(FFC0F4B4)
+STUB(FFC0F5C0)
+STUB(FFC0F680)
+STUB(FFC22354)
+STUB(FFC22CC0)
+STUB(FFC22CE8)
+STUB(FFC22D48)
+STUB(FFC23220)
+STUB(FFC2326C)
+STUB(FFC237C0)
+STUB(FFC237E4)
+STUB(FFC237F4)
+STUB(FFC238CC)
+STUB(FFC238D0)
+STUB(FFC238D4)
+STUB(FFC238D8)
+STUB(FFC249CC)
+STUB(FFC250BC)
+STUB(FFC26C78)
+STUB(FFC26CF8)
+STUB(FFC2846C)
+STUB(FFC2866C)
+STUB(FFC28750)
+STUB(FFC28810)
+STUB(FFC28844)
+STUB(FFC28AA0)
+STUB(FFC28FD4)
+STUB(FFC291C8)
+STUB(FFC2921C)
+STUB(FFC2A97C)
+STUB(FFC2ABA4)
+STUB(FFC2ABE4)
+STUB(FFC2AC78)
+STUB(FFC2ADD0)
+STUB(FFC2AE00)
+STUB(FFC2AF6C)
+STUB(FFC2AF70)
+STUB(FFC2AF88)
+STUB(FFC2B9B4)
+STUB(FFC445C4)
+STUB(FFC455A8)
+STUB(FFC4CB54)
+STUB(FFC4FFDC)
+STUB(FFC500DC)
+STUB(FFC50244)
+STUB(FFC502D4)
+STUB(FFC506CC)
+STUB(FFC5075C)
+STUB(FFC507DC)
+STUB(FFC50978)
+STUB(FFC50ABC)
+STUB(FFC50CEC)
+STUB(FFC50E14)
+STUB(FFC50E64)
+STUB(FFC50E94)
+STUB(FFC51534)
+STUB(FFC5758C)
+STUB(FFC57984)
+STUB(FFC595E8)
+STUB(FFC597C0)
+STUB(FFC59B34)
+STUB(FFC59B3C)
+STUB(FFC59B44)
+STUB(FFC59B54)
+STUB(FFC59CEC)
+STUB(FFC59D54)
+STUB(FFC59DDC)
+STUB(FFC59EEC)
+STUB(FFC59F38)
+STUB(FFC59F74)
+STUB(FFC5A0F8)
+STUB(FFC5A3A8)
+STUB(FFC5A43C)
+STUB(FFC5C070)
+STUB(FFC5C0F0)
+STUB(FFC5C10C)
+STUB(FFC5C138)
+STUB(FFC5C14C)
+STUB(FFC5C178)
+STUB(FFC5C490)
+STUB(FFC5D830)
+STUB(FFC64074)
+STUB(FFC641C0)
+STUB(FFC6944C)
+STUB(FFC6957C)
+STUB(FFC6970C)
+STUB(FFC69944)
+STUB(FFC69E48)
+STUB(FFC69E74)
+STUB(FFC6C70C)
+STUB(FFC6D130)
+STUB(FFC80C58)
+STUB(FFC80EE0)
+STUB(FFC80F4C)
+STUB(FFC811DC)
+STUB(FFC8169C)
+STUB(FFC81724)
+STUB(FFC81954)
+STUB(FFC81E04)
+STUB(FFC8914C)
+STUB(FFC8DE54)
+STUB(FFC8DF64)
+STUB(FFC8DFBC)
+STUB(FFC8E014)
+STUB(FFC8E06C)
+STUB(FFC8E0F0)
+STUB(FFC8E230)
+STUB(FFC8E2E8)
+STUB(FFC8E56C)
+STUB(FFC8E774)
+STUB(FFC8E9EC)
+STUB(FFC8EBE4)
+STUB(FFC8EEA0)
+STUB(FFC8EFE0)
+STUB(FFC8F338)
+STUB(FFC8F4E0)
+STUB(FFC8F7D4)
+STUB(FFC8F8D8)
+STUB(FFC8FB14)
+STUB(FFC8FC90)
+STUB(FFC8FE2C)
+STUB(FFC8FF90)
+STUB(FFC9026C)
+STUB(FFC9130C)
+STUB(FFC915A4)
+STUB(FFC91604)
+STUB(FFC9295C)
+STUB(FFC9298C)
+STUB(FFC929D0)
+STUB(FFC92B3C)
+STUB(FFC92BE8)
+STUB(FFC92C88)
+STUB(FFC92D24)
+STUB(FFCB3AB0)
+STUB(FFCB6668)
+STUB(FFCB8140)
+STUB(FFCE5CDC)
+STUB(FFCF0788)
+STUB(FFCF081C)
+STUB(FFCFA1B8)
+STUB(FFD085BC)
+STUB(FFD08710)
+STUB(FFD08844)
+STUB(FFD0C070)
+STUB(FFD0C214)
+STUB(FFD0C350)
+STUB(FFD0C538)
+STUB(FFD0C830)
+STUB(FFD0CC7C)
+STUB(FFD0FAFC)
+STUB(FFD0FB4C)
+STUB(FFD0FB88)
+STUB(FFD0FE90)
+STUB(FFD100BC)
+STUB(FFD102B4)
+STUB(FFD10348)
+STUB(FFD10408)
+STUB(FFD104D4)
+STUB(FFD10518)
+STUB(FFD10600)
+STUB(FFD10750)
+STUB(FFD107E0)
+STUB(FFD108A0)
+STUB(FFD10E04)
+STUB(FFD10ECC)
+STUB(FFD10F80)
+STUB(FFD11158)
+STUB(FFD111A4)
+STUB(FFD11820)
+STUB(FFD119B4)
+STUB(FFD12020)
+STUB(FFD2F710)
+STUB(FFD7D8F8)
+STUB(FFDCE5B4)
+STUB(FFDCE678)
+STUB(FFDF70EC)
+STUB(FFDF8DA0)
+STUB(FFDF8F34)
+STUB(FFDF92C8)
+STUB(FFDF9520)
+STUB(FFDF9558)
+STUB(FFE80ED0)
+STUB(FFE8112C)
+STUB(FFE829DC)
Index: /trunk/platform/a495/sub/100e/Makefile
===================================================================
--- /trunk/platform/a495/sub/100e/Makefile	(revision 1198)
+++ /trunk/platform/a495/sub/100e/Makefile	(revision 1198)
@@ -0,0 +1,6 @@
+topdir=../../../../
+
+OBJS=boot.o stubs_min.o stubs_auto.o stubs_entry.o lib.o stubs_entry_2.o capt_seq.o movie_rec.o
+STUBS_AUTO_DEPS=boot.c capt_seq.c movie_rec.c
+
+include  $(topdir)platform/makefile_sub.inc
Index: /trunk/platform/a495/sub/100f/capt_seq.c
===================================================================
--- /trunk/platform/a495/sub/100f/capt_seq.c	(revision 1198)
+++ /trunk/platform/a495/sub/100f/capt_seq.c	(revision 1198)
@@ -0,0 +1,891 @@
+#include "lolevel.h"
+#include "platform.h"
+#include "core.h"
+#include "conf.h"
+
+static long *nrflag = (long*)0x5828;	// ??? ROM:FFD10EE0 "ShutterSoundTask"
+
+#include "../../../generic/capt_seq.c"
+
+// ROM:FFC59274 task_CaptSeqTask()
+
+void __attribute__((naked,noinline)) capt_seq_task() {
+	asm volatile (
+			"STMFD   SP!, {R3-R7,LR}\n"
+			"LDR     R7, =0x33324\n"
+			"LDR     R6, =0x26C0\n"
+"loc_FFC59280:\n"
+			"LDR     R0, [R6,#4]\n"
+			"MOV     R2, #0\n"
+			"MOV     R1, SP\n"
+			"BL      sub_FFC28AA0\n"
+			"TST     R0, #1\n"
+			"BEQ     loc_FFC592AC\n"
+			"LDR     R1, =0x5B4\n"
+			"LDR     R0, =0xFFC58E80\n"
+			"BL      sub_FFC0F680\n"
+			"BL      sub_FFC0F438\n"
+			"LDMFD   SP!, {R3-R7,PC}\n"
+"loc_FFC592AC:\n"
+			"LDR     R0, [SP]\n"
+			"LDR     R1, [R0]\n"
+			"CMP     R1, #0x1D\n"
+			"ADDLS   PC, PC, R1,LSL#2\n"
+			"B       loc_FFC594BC\n"
+			"B       loc_FFC59338\n"
+			"B       loc_FFC59340\n"
+			"B       loc_FFC59368\n"
+			"B       loc_FFC5937C\n"
+			"B       loc_FFC59374\n"
+			"B       loc_FFC59384\n"
+			"B       loc_FFC5938C\n"
+			"B       loc_FFC59398\n"
+			"B       loc_FFC593F0\n"
+			"B       loc_FFC5937C\n"
+			"B       loc_FFC593F8\n"
+			"B       loc_FFC59404\n"
+			"B       loc_FFC5940C\n"
+			"B       loc_FFC59414\n"
+			"B       loc_FFC5941C\n"
+			"B       loc_FFC59424\n"
+			"B       loc_FFC5942C\n"
+			"B       loc_FFC59434\n"
+			"B       loc_FFC59440\n"
+			"B       loc_FFC59448\n"
+			"B       loc_FFC59450\n"
+			"B       loc_FFC59458\n"
+			"B       loc_FFC59460\n"
+			"B       loc_FFC5946C\n"
+			"B       loc_FFC59474\n"
+			"B       loc_FFC5947C\n"
+			"B       loc_FFC59484\n"
+			"B       loc_FFC5948C\n"
+			"B       loc_FFC59498\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59338:\n"
+			"BL      sub_FFC59B54\n"
+			"BL      shooting_expo_param_override\n"      // +
+			"B       loc_FFC59390\n"
+"loc_FFC59340:\n"
+			"MOV     R0, #0xC\n"
+			"BL      sub_FFC5D830\n"
+			"TST     R0, #1\n"
+			"LDR     R0, [SP]\n"
+			"MOVNE   R1, #1\n"
+			"LDRNE   R2, [R0,#0xC]\n"
+			"MOVNE   R0, #1\n"
+			"BNE     loc_FFC593E8\n"
+			"BL      sub_FFC595E8_my\n"  //--------->
+			"B       loc_FFC594C8\n"
+"loc_FFC59368:\n"
+			"MOV     R0, #1\n"
+			"BL      sub_FFC59DDC\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59374:\n"
+			"BL      sub_FFC597C0\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC5937C:\n"
+			"BL      sub_FFC59B34\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59384:\n"
+			"BL      sub_FFC59B3C\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC5938C:\n"
+			"BL      sub_FFC59CEC\n"
+"loc_FFC59390:\n"
+			"BL      sub_FFC5758C\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59398:\n"
+			"LDR     R4, [R0,#0xC]\n"
+			"BL      sub_FFC59B44\n"
+			"MOV     R0, R4\n"
+			"BL      sub_FFD0FE90\n"
+			"TST     R0, #1\n"
+			"MOV     R5, R0\n"
+			"BNE     loc_FFC593D8\n"
+			"BL      sub_FFC6970C\n"
+			"STR     R0, [R4,#0x18]\n"
+			"MOV     R0, R4\n"
+			"BL      sub_FFD10E04\n"
+			"MOV     R0, R4\n"
+			"BL      sub_FFD111A4\n"
+			"MOV     R5, R0\n"
+			"LDR     R0, [R4,#0x18]\n"
+			"BL      sub_FFC69944\n"
+"loc_FFC593D8:\n"
+			"BL      sub_FFC59B34\n"
+			"MOV     R2, R4\n"
+			"MOV     R1, #9\n"
+			"MOV     R0, R5\n"
+"loc_FFC593E8:\n"
+			"BL      sub_FFC57984\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC593F0:\n"
+			"BL      sub_FFC59D54\n"
+			"B       loc_FFC59390\n"
+"loc_FFC593F8:\n"
+			"LDR     R0, [R7,#0x4C]\n"
+			"BL      sub_FFC5A0F8\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59404:\n"
+			"BL      sub_FFC5A3A8\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC5940C:\n"
+			"BL      sub_FFC5A43C\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59414:\n"
+			"BL      sub_FFD100BC\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC5941C:\n"
+			"BL      sub_FFD102B4\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59424:\n"
+			"BL      sub_FFD10348\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC5942C:\n"
+			"BL      sub_FFD10408\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59434:\n"
+			"MOV     R0, #0\n"
+			"BL      sub_FFD10600\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59440:\n"
+			"BL      sub_FFD10750\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59448:\n"
+			"BL      sub_FFD107E0\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59450:\n"
+			"BL      sub_FFD108A0\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59458:\n"
+			"BL      sub_FFC59F38\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59460:\n"
+			"BL      sub_FFC59F74\n"
+			"BL      sub_FFC26C78\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC5946C:\n"
+			"BL      sub_FFD104D4\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59474:\n"
+			"BL      sub_FFD10518\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC5947C:\n"
+			"BL      sub_FFC5C070\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59484:\n"
+			"BL      sub_FFC5C0F0\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC5948C:\n"
+			"BL      sub_FFC5C14C\n"
+			"BL      sub_FFC5C10C\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC59498:\n"
+			"LDRH    R0, [R7,#0x8C]\n"
+			"CMP     R0, #4\n"
+			"LDRNEH  R0, [R7]\n"
+			"SUBNE   R12, R0, #0x8200\n"
+			"SUBNES  R12, R12, #0x2A\n"
+			"BNE     loc_FFC594C8\n"
+			"BL      sub_FFC5C0F0\n"
+			"BL      sub_FFC5C490\n"
+			"B       loc_FFC594C8\n"
+"loc_FFC594BC:\n"
+			"LDR     R1, =0x70B\n"
+			"LDR     R0, =0xFFC58E80\n"
+			"BL      sub_FFC0F680\n"
+"loc_FFC594C8:\n"
+			"LDR     R0, [SP]\n"
+			"LDR     R1, [R0,#4]\n"
+			"LDR     R0, [R6]\n"
+			"BL      sub_FFC28810\n"
+			"LDR     R4, [SP]\n"
+			"LDR     R0, [R4,#8]\n"
+			"CMP     R0, #0\n"
+			"LDREQ   R1, =0x132\n"
+			"LDREQ   R0, =0xFFC58E80\n"
+			"BLEQ    sub_FFC0F680\n"
+			"MOV     R0, #0\n"
+			"STR     R0, [R4,#8]\n"
+			"B       loc_FFC59280\n"
+	);
+} 
+
+
+
+void __attribute__((naked,noinline)) sub_FFC595E8_my(){ // 
+	asm volatile(
+			"STMFD   SP!, {R3-R5,LR}\n"
+			"LDR     R4, [R0,#0xC]\n"
+			"LDR     R0, [R4,#8]\n"
+			"ORR     R0, R0, #1\n"
+			"STR     R0, [R4,#8]\n"
+			"BL      sub_FFC59B44\n"
+			"MOV     R0, R4\n"
+			"BL      sub_FFC59EEC\n"
+			"MOV     R0, R4\n"
+			"BL      sub_FFD0FAFC\n"
+			"CMP     R0, #0\n"
+			"MOV     R0, R4\n"
+			"BEQ     loc_FFC59638\n"
+			"BL      sub_FFD0FB88\n"
+			"TST     R0, #1\n"
+			"MOVNE   R2, R4\n"
+			"LDMNEFD SP!, {R3-R5,LR}\n"
+			"MOVNE   R1, #1\n"
+			"BNE     sub_FFC57984\n"
+			"B       loc_FFC5963C\n"
+"loc_FFC59638:\n"
+			"BL      sub_FFD0FB4C\n"
+"loc_FFC5963C:\n"
+			"MOV     R0, #0\n"
+			"STR     R0, [SP]\n"
+			"LDR     R0, =0x33324\n"
+			"MOV     R2, #2\n"
+			"LDRH    R0, [R0,#0x8A]\n"
+			"MOV     R1, SP\n"
+			"CMP     R0, #3\n"
+			"LDRNE   R0, [R4,#0xC]\n"
+			"CMPNE   R0, #1\n"
+			"MOVHI   R0, #1\n"
+			"STRHI   R0, [SP]\n"
+			"LDR     R0, =0x127\n"
+			"BL      sub_FFC6944C\n"
+			"BL      sub_FFD2F710\n"
+			"BL      sub_FFC6970C\n"
+			"STR     R0, [R4,#0x18]\n"
+			"MOV     R0, R4\n"
+			"BL      sub_FFD10E04\n"
+			"BL      sub_FFD11820\n"
+			"MOV     R0, R4\n"
+			"BL      sub_FFD10ECC_my\n"			//---------->
+			"MOV     R5, R0\n"
+			"BL      capt_seq_hook_raw_here\n"	// +
+			"BL      sub_FFC5C0F0\n"
+			"BL      sub_FFC5C138\n"
+			"BL      sub_FFC5C178\n"
+			"MOV     R2, R4\n"
+			"MOV     R1, #1\n"
+			"MOV     R0, R5\n"
+			"BL      sub_FFC57984\n"
+			"BL      sub_FFD11158\n"
+			"CMP     R0, #0\n"
+			"LDRNE   R0, [R4,#8]\n"
+			"ORRNE   R0, R0, #0x2000\n"
+			"STRNE   R0, [R4,#8]\n"
+			"LDMFD   SP!, {R3-R5,PC}\n"
+	);
+}
+
+
+
+
+void __attribute__((naked,noinline)) sub_FFD10ECC_my(){ // 
+	asm volatile(
+			"STMFD   SP!, {R0-R8,LR}\n"
+			"MOV     R4, R0\n"
+			"BL      sub_FFD119B4\n"
+			"MOV     R1, #0xFFFFFFFF\n"
+			"BL      sub_FFC28844\n"
+			"LDR     R5, =0x5828\n"
+			"LDR     R0, [R5,#0xC]\n"
+			"CMP     R0, #0\n"
+			"BNE     loc_FFD10F1C\n"
+			"MOV     R1, #1\n"
+			"MOV     R0, #0\n"
+			"BL      sub_FFC0F4B4\n"
+			"STR     R0, [R5,#0xC]\n"
+			"MOV     R3, #0\n"
+			"STR     R3, [SP]\n"
+			"LDR     R3, =0xFFD10990\n"
+			"LDR     R0, =0xFFD11128\n"
+			"MOV     R2, #0x400\n"
+			"MOV     R1, #0x17\n"
+			"BL      sub_FFC0F480\n"
+"loc_FFD10F1C:\n"
+			"MOV     R2, #4\n"
+			"ADD     R1, SP, #8\n"
+			"MOV     R0, #0x8A\n"
+			"BL      sub_FFC6957C\n"
+			"TST     R0, #1\n"
+			"LDRNE   R1, =0x3BA\n"
+			"LDRNE   R0, =0xFFD10BBC\n"
+			"BLNE    sub_FFC0F680\n"
+			"LDR     R6, =0x333E0\n"
+			"LDR     R7, =0x33324\n"
+			"LDR     R3, [R6]\n"
+			"LDRSH   R2, [R6,#0xC]\n"
+			"LDRSH   R1, [R6,#0xE]\n"
+			"LDR     R0, [R7,#0x80]\n"
+		//	"BL      nullsub_56\n"
+			"BL      sub_FFC455A8\n"
+			"LDR     R3, =0x5830\n"
+			"STRH    R0, [R4,#0xA4]\n"
+			"SUB     R2, R3, #4\n"
+			"STRD    R2, [SP]\n"
+			"MOV     R1, R0\n"
+			"LDRH    R0, [R7,#0x54]\n"
+			"LDRSH   R2, [R6,#0xC]\n"
+			"SUB     R3, R3, #8\n"
+			"BL      sub_FFD12020\n"
+			"BL      wait_until_remote_button_is_released\n"     // +
+			"BL      capt_seq_hook_set_nr\n"                     // +
+			"B       sub_FFD10F80\n"                             // continue function in firmware
+	);
+}
+
+/*************************************************************/
+
+// ROM:FFC91654 task_ExpDrvTask
+void __attribute__((naked,noinline)) exp_drv_task(){
+	asm volatile(
+			"STMFD   SP!, {R4-R8,LR}\n"
+			"SUB     SP, SP, #0x20\n"
+			"LDR     R8, =0xBB8\n"
+			"LDR     R7, =0x38CC\n"
+			"LDR     R5, =0x3C714\n"
+			"MOV     R0, #0\n"
+			"ADD     R6, SP, #0x10\n"
+			"STR     R0, [SP,#0xC]\n"
+"loc_FFC91674:\n"
+			"LDR     R0, [R7,#0x20]\n"
+			"MOV     R2, #0\n"
+			"ADD     R1, SP, #0x1C\n"
+			"BL      sub_FFC28AA0\n"
+			"LDR     R0, [SP,#0xC]\n"
+			"CMP     R0, #1\n"
+			"BNE     loc_FFC916C0\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"LDR     R0, [R0]\n"
+			"CMP     R0, #0x13\n"
+			"CMPNE   R0, #0x14\n"
+			"CMPNE   R0, #0x15\n"
+			"CMPNE   R0, #0x16\n"
+			"BEQ     loc_FFC91824\n"
+			"CMP     R0, #0x28\n"
+			"BEQ     loc_FFC917AC\n"
+			"ADD     R1, SP, #0xC\n"
+			"MOV     R0, #0\n"
+			"BL      sub_FFC91604\n"
+"loc_FFC916C0:\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"LDR     R1, [R0]\n"
+			"CMP     R1, #0x2E\n"
+			"BNE     loc_FFC916F0\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"BL      sub_FFC9295C\n"
+			"LDR     R0, [R7,#0x1C]\n"
+			"MOV     R1, #1\n"
+			"BL      sub_FFC28810\n"
+			"BL      sub_FFC0F438\n"
+			"ADD     SP, SP, #0x20\n"
+			"LDMFD   SP!, {R4-R8,PC}\n"
+"loc_FFC916F0:\n"
+			"CMP     R1, #0x2D\n"
+			"BNE     loc_FFC9170C\n"
+			"LDR     R2, [R0,#0x8C]!\n"
+			"LDR     R1, [R0,#4]\n"
+			"MOV     R0, R1\n"
+			"BLX     R2\n"
+			"B       loc_FFC91C4C\n"
+"loc_FFC9170C:\n"
+			"CMP     R1, #0x26\n"
+			"BNE     loc_FFC9175C\n"
+			"LDR     R0, [R7,#0x1C]\n"
+			"MOV     R1, #0x80\n"
+			"BL      sub_FFC28844\n"
+			"LDR     R0, =0xFFC8DDD0\n"
+			"MOV     R1, #0x80\n"
+			"BL      sub_FFD085BC\n"
+			"LDR     R0, [R7,#0x1C]\n"
+			"MOV     R2, R8\n"
+			"MOV     R1, #0x80\n"
+			"BL      sub_FFC28750\n"
+			"TST     R0, #1\n"
+			"LDRNE   R1, =0xE5F\n"
+			"BNE     loc_FFC91818\n"
+"loc_FFC91748:\n"
+			"LDR     R1, [SP,#0x1C]\n"
+			"LDR     R0, [R1,#0x90]\n"
+			"LDR     R1, [R1,#0x8C]\n"
+			"BLX     R1\n"
+			"B       loc_FFC91C4C\n"
+"loc_FFC9175C:\n"
+			"CMP     R1, #0x27\n"
+			"BNE     loc_FFC917A4\n"
+			"ADD     R1, SP, #0xC\n"
+			"BL      sub_FFC91604\n"
+			"LDR     R0, [R7,#0x1C]\n"
+			"MOV     R1, #0x100\n"
+			"BL      sub_FFC28844\n"
+			"LDR     R0, =0xFFC8DDE0\n"
+			"MOV     R1, #0x100\n"
+			"BL      sub_FFD08844\n"
+			"LDR     R0, [R7,#0x1C]\n"
+			"MOV     R2, R8\n"
+			"MOV     R1, #0x100\n"
+			"BL      sub_FFC28750\n"
+			"TST     R0, #1\n"
+			"BEQ     loc_FFC91748\n"
+			"LDR     R1, =0xE69\n"
+			"B       loc_FFC91818\n"
+"loc_FFC917A4:\n"
+			"CMP     R1, #0x28\n"
+			"BNE     loc_FFC917BC\n"
+"loc_FFC917AC:\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"ADD     R1, SP, #0xC\n"
+			"BL      sub_FFC91604\n"
+			"B       loc_FFC91748\n"
+"loc_FFC917BC:\n"
+			"CMP     R1, #0x2B\n"
+			"BNE     loc_FFC917D4\n"
+			"BL      sub_FFC811DC\n"
+			"BL      sub_FFC81E04\n"
+			"BL      sub_FFC81954\n"
+			"B       loc_FFC91748\n"
+"loc_FFC917D4:\n"
+			"CMP     R1, #0x2C\n"
+			"BNE     loc_FFC91824\n"
+			"LDR     R0, [R7,#0x1C]\n"
+			"MOV     R1, #4\n"
+			"BL      sub_FFC28844\n"
+			"LDR     R1, =0xFFC8DE00\n"
+			"LDR     R0, =0xFFFFF400\n"
+			"MOV     R2, #4\n"
+			"BL      sub_FFC80C58\n"
+			"BL      sub_FFC80EE0\n"
+			"LDR     R0, [R7,#0x1C]\n"
+			"MOV     R2, R8\n"
+			"MOV     R1, #4\n"
+			"BL      sub_FFC2866C\n"
+			"TST     R0, #1\n"
+			"BEQ     loc_FFC91748\n"
+			"LDR     R1, =0xE91\n"
+"loc_FFC91818:\n"
+			"LDR     R0, =0xFFC8E440\n"
+			"BL      sub_FFC0F680\n"
+			"B       loc_FFC91748\n"
+"loc_FFC91824:\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"MOV     R4, #1\n"
+			"LDR     R1, [R0]\n"
+			"CMP     R1, #0x11\n"
+			"CMPNE   R1, #0x12\n"
+			"BNE     loc_FFC91894\n"     // fix 2011Jun01 - was "BNE sub_FFC91894\n"
+			"LDR     R1, [R0,#0x7C]\n"
+			"ADD     R1, R1, R1,LSL#1\n"
+			"ADD     R1, R0, R1,LSL#2\n"
+			"SUB     R1, R1, #8\n"
+			"LDMIA   R1, {R2-R4}\n"
+			"STMIA   R6, {R2-R4}\n"
+			"BL      sub_FFC8FF90\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"LDR     R1, [R0,#0x7C]\n"
+			"LDR     R3, [R0,#0x8C]\n"
+			"LDR     R2, [R0,#0x90]\n"
+			"ADD     R0, R0, #4\n"
+			"BLX     R3\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"BL      sub_FFC92D24\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"LDR     R1, [R0,#0x7C]\n"
+			"LDR     R3, [R0,#0x94]\n"
+			"LDR     R2, [R0,#0x98]\n"
+			"ADD     R0, R0, #4\n"
+			"BLX     R3\n"
+			"B       loc_FFC91B8C\n"
+"loc_FFC91894:\n"
+			"CMP     R1, #0x13\n"
+			"CMPNE   R1, #0x14\n"
+			"CMPNE   R1, #0x15\n"
+			"CMPNE   R1, #0x16\n"
+			"BNE     loc_FFC9194C\n"
+			"ADD     R3, SP, #0xC\n"
+			"MOV     R2, SP\n"
+			"ADD     R1, SP, #0x10\n"
+			"BL      sub_FFC9026C\n"
+			"CMP     R0, #1\n"
+			"MOV     R4, R0\n"
+			"CMPNE   R4, #5\n"
+			"BNE     loc_FFC918E8\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"MOV     R2, R4\n"
+			"LDR     R1, [R0,#0x7C]!\n"
+			"LDR     R12, [R0,#0x10]!\n"
+			"LDR     R3, [R0,#4]\n"
+			"MOV     R0, SP\n"
+			"BLX     R12\n"
+			"B       loc_FFC91920\n"
+"loc_FFC918E8:\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"CMP     R4, #2\n"
+			"LDR     R3, [R0,#0x90]\n"
+			"CMPNE   R4, #6\n"
+			"BNE     loc_FFC91934\n"
+			"LDR     R12, [R0,#0x8C]\n"
+			"MOV     R0, SP\n"
+			"MOV     R2, R4\n"
+			"MOV     R1, #1\n"
+			"BLX     R12\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"MOV     R2, SP\n"
+			"ADD     R1, SP, #0x10\n"
+			"BL      sub_FFC9130C\n"
+"loc_FFC91920:\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"LDR     R2, [SP,#0xC]\n"
+			"MOV     R1, R4\n"
+			"BL      sub_FFC915A4\n"
+			"B       loc_FFC91B8C\n"
+"loc_FFC91934:\n"
+			"LDR     R1, [R0,#0x7C]\n"
+			"LDR     R12, [R0,#0x8C]\n"
+			"ADD     R0, R0, #4\n"
+			"MOV     R2, R4\n"
+			"BLX     R12\n"
+			"B       loc_FFC91B8C\n"
+"loc_FFC9194C:\n"
+			"CMP     R1, #0x22\n"
+			"CMPNE   R1, #0x23\n"
+			"BNE     loc_FFC91998\n"
+			"LDR     R1, [R0,#0x7C]\n"
+			"ADD     R1, R1, R1,LSL#1\n"
+			"ADD     R1, R0, R1,LSL#2\n"
+			"SUB     R1, R1, #8\n"
+			"LDMIA   R1, {R2-R4}\n"
+			"STMIA   R6, {R2-R4}\n"
+			"BL      sub_FFC8F4E0\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"LDR     R1, [R0,#0x7C]\n"
+			"LDR     R3, [R0,#0x8C]\n"
+			"LDR     R2, [R0,#0x90]\n"
+			"ADD     R0, R0, #4\n"
+			"BLX     R3\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"BL      sub_FFC8F7D4\n"
+			"B       loc_FFC91B8C\n"
+"loc_FFC91998:\n"
+			"ADD     R1, R0, #4\n"
+			"LDMIA   R1, {R2,R3,R12}\n"
+			"STMIA   R6, {R2,R3,R12}\n"
+			"LDR     R1, [R0]\n"
+			"CMP     R1, #0x25\n"
+			"ADDLS   PC, PC, R1,LSL#2\n"
+			"B       loc_FFC91B6C\n"
+			"B       loc_FFC91A4C\n"
+			"B       loc_FFC91A4C\n"
+			"B       loc_FFC91A54\n"
+			"B       loc_FFC91A5C\n"
+			"B       loc_FFC91A5C\n"
+			"B       loc_FFC91A5C\n"
+			"B       loc_FFC91A4C\n"
+			"B       loc_FFC91A54\n"
+			"B       loc_FFC91A5C\n"
+			"B       loc_FFC91A5C\n"
+			"B       loc_FFC91A74\n"
+			"B       loc_FFC91A74\n"
+			"B       loc_FFC91B60\n"
+			"B       loc_FFC91B68\n"
+			"B       loc_FFC91B68\n"
+			"B       loc_FFC91B68\n"
+			"B       loc_FFC91B68\n"
+			"B       loc_FFC91B6C\n"
+			"B       loc_FFC91B6C\n"
+			"B       loc_FFC91B6C\n"
+			"B       loc_FFC91B6C\n"
+			"B       loc_FFC91B6C\n"
+			"B       loc_FFC91B6C\n"
+			"B       loc_FFC91A64\n"
+			"B       loc_FFC91A6C\n"
+			"B       loc_FFC91A6C\n"
+			"B       loc_FFC91A80\n"
+			"B       loc_FFC91A80\n"
+			"B       loc_FFC91A88\n"
+			"B       loc_FFC91AB8\n"
+			"B       loc_FFC91AE8\n"
+			"B       loc_FFC91B18\n"
+			"B       loc_FFC91B48\n"
+			"B       loc_FFC91B48\n"
+			"B       loc_FFC91B6C\n"
+			"B       loc_FFC91B6C\n"
+			"B       loc_FFC91B50\n"
+			"B       loc_FFC91B58\n"
+"loc_FFC91A4C:\n"
+			"BL      sub_FFC8E2E8\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91A54:\n"
+			"BL      sub_FFC8E56C\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91A5C:\n"
+			"BL      sub_FFC8E774\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91A64:\n"
+			"BL      sub_FFC8E9EC\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91A6C:\n"
+			"BL      sub_FFC8EBE4\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91A74:\n"
+			"BL      sub_FFC8EEA0_my\n"		//---------->
+			"MOV     R4, #0\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91A80:\n"
+			"BL      sub_FFC8EFE0\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91A88:\n"
+			"LDRH    R1, [R0,#4]\n"
+			"STRH    R1, [SP,#0x10]\n"
+			"LDRH    R1, [R5,#2]\n"
+			"STRH    R1, [SP,#0x12]\n"
+			"LDRH    R1, [R5,#4]\n"
+			"STRH    R1, [SP,#0x14]\n"
+			"LDRH    R1, [R5,#6]\n"
+			"STRH    R1, [SP,#0x16]\n"
+			"LDRH    R1, [R0,#0xC]\n"
+			"STRH    R1, [SP,#0x18]\n"
+			"BL      sub_FFC929D0\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91AB8:\n"
+			"LDRH    R1, [R0,#4]\n"
+			"STRH    R1, [SP,#0x10]\n"
+			"LDRH    R1, [R5,#2]\n"
+			"STRH    R1, [SP,#0x12]\n"
+			"LDRH    R1, [R5,#4]\n"
+			"STRH    R1, [SP,#0x14]\n"
+			"LDRH    R1, [R5,#6]\n"
+			"STRH    R1, [SP,#0x16]\n"
+			"LDRH    R1, [R5,#8]\n"
+			"STRH    R1, [SP,#0x18]\n"
+			"BL      sub_FFC92B3C\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91AE8:\n"
+			"LDRH    R1, [R5]\n"
+			"STRH    R1, [SP,#0x10]\n"
+			"LDRH    R1, [R0,#6]\n"
+			"STRH    R1, [SP,#0x12]\n"
+			"LDRH    R1, [R5,#4]\n"
+			"STRH    R1, [SP,#0x14]\n"
+			"LDRH    R1, [R5,#6]\n"
+			"STRH    R1, [SP,#0x16]\n"
+			"LDRH    R1, [R5,#8]\n"
+			"STRH    R1, [SP,#0x18]\n"
+			"BL      sub_FFC92BE8\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91B18:\n"
+			"LDRH    R1, [R5]\n"
+			"STRH    R1, [SP,#0x10]\n"
+			"LDRH    R1, [R5,#2]\n"
+			"STRH    R1, [SP,#0x12]\n"
+			"LDRH    R1, [R5,#4]\n"
+			"STRH    R1, [SP,#0x14]\n"
+			"LDRH    R1, [R5,#6]\n"
+			"STRH    R1, [SP,#0x16]\n"
+			"LDRH    R1, [R0,#0xC]\n"
+			"STRH    R1, [SP,#0x18]\n"
+			"BL      sub_FFC92C88\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91B48:\n"
+			"BL      sub_FFC8F338\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91B50:\n"
+			"BL      sub_FFC8F8D8\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91B58:\n"
+			"BL      sub_FFC8FB14\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91B60:\n"
+			"BL      sub_FFC8FC90\n"
+			"B       loc_FFC91B6C\n"
+"loc_FFC91B68:\n"
+			"BL      sub_FFC8FE2C\n"
+"loc_FFC91B6C:\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"LDR     R1, [R0,#0x7C]\n"
+			"LDR     R3, [R0,#0x8C]\n"
+			"LDR     R2, [R0,#0x90]\n"
+			"ADD     R0, R0, #4\n"
+			"BLX     R3\n"
+			"CMP     R4, #1\n"
+			"BNE     loc_FFC91BD4\n"
+"loc_FFC91B8C:\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"MOV     R2, #0xC\n"
+			"LDR     R1, [R0,#0x7C]\n"
+			"ADD     R1, R1, R1,LSL#1\n"
+			"ADD     R0, R0, R1,LSL#2\n"
+			"SUB     R4, R0, #8\n"
+			"LDR     R0, =0x3C714\n"
+			"ADD     R1, SP, #0x10\n"
+			"BL      sub_FFE80E24\n"
+			"LDR     R0, =0x3C720\n"
+			"MOV     R2, #0xC\n"
+			"ADD     R1, SP, #0x10\n"
+			"BL      sub_FFE80E24\n"
+			"LDR     R0, =0x3C72C\n"
+			"MOV     R2, #0xC\n"
+			"MOV     R1, R4\n"
+			"BL      sub_FFE80E24\n"
+			"B       loc_FFC91C4C\n"
+"loc_FFC91BD4:\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"LDR     R0, [R0]\n"
+			"CMP     R0, #0xB\n"
+			"BNE     loc_FFC91C1C\n"
+			"MOV     R3, #0\n"
+			"STR     R3, [SP]\n"
+			"MOV     R3, #1\n"
+			"MOV     R2, #1\n"
+			"MOV     R1, #1\n"
+			"MOV     R0, #0\n"
+			"BL      sub_FFC8E0F0\n"
+			"MOV     R3, #0\n"
+			"STR     R3, [SP]\n"
+			"MOV     R3, #1\n"
+			"MOV     R2, #1\n"
+			"MOV     R1, #1\n"
+			"MOV     R0, #0\n"
+			"B       loc_FFC91C48\n"
+"loc_FFC91C1C:\n"
+			"MOV     R3, #1\n"
+			"MOV     R2, #1\n"
+			"MOV     R1, #1\n"
+			"MOV     R0, #1\n"
+			"STR     R3, [SP]\n"
+			"BL      sub_FFC8E0F0\n"
+			"MOV     R3, #1\n"
+			"MOV     R2, #1\n"
+			"MOV     R1, #1\n"
+			"MOV     R0, #1\n"
+			"STR     R3, [SP]\n"
+"loc_FFC91C48:\n"
+			"BL      sub_FFC8E230\n"
+"loc_FFC91C4C:\n"
+			"LDR     R0, [SP,#0x1C]\n"
+			"BL      sub_FFC9295C\n"
+			"B       loc_FFC91674\n"
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFC8EEA0_my(){ // 
+	asm volatile(
+		 "STMFD   SP!, {R4-R8,LR}\n"
+		"LDR     R7, =0x38CC\n"
+		"MOV     R4, R0\n"
+		"LDR     R0, [R7,#0x1C]\n"
+		"MOV     R1, #0x3E\n"
+		"BL      sub_FFC28844\n"
+		"LDRSH   R0, [R4,#4]\n"
+		"MOV     R2, #0\n"
+		"MOV     R1, #0\n"
+		"BL      sub_FFC8DE54\n"
+		"MOV     R6, R0\n"
+		"LDRSH   R0, [R4,#6]\n"
+		"BL      sub_FFC8DF64\n"
+		"LDRSH   R0, [R4,#8]\n"
+		"BL      sub_FFC8DFBC\n"
+		"LDRSH   R0, [R4,#0xA]\n"
+		"BL      sub_FFC8E014\n"
+		"LDRSH   R0, [R4,#0xC]\n"
+		"MOV     R1, #0\n"
+		"BL      sub_FFC8E06C\n"
+		"MOV     R5, R0\n"
+		"LDR     R0, [R4]\n"
+		"LDR     R8, =0x3C72C\n"
+		"CMP     R0, #0xB\n"
+		"MOVEQ   R6, #0\n"
+		"MOVEQ   R5, #0\n"
+		"BEQ     loc_FFC8EF34\n"
+		"CMP     R6, #1\n"
+		"BNE     loc_FFC8EF34\n"
+		"LDRSH   R0, [R4,#4]\n"
+		"LDR     R1, =0xFFC8DDC0\n"
+		"MOV     R2, #2\n"
+		"BL      sub_FFD08710\n"
+		"STRH    R0, [R4,#4]\n"
+		"MOV     R0, #0\n"
+		"STR     R0, [R7,#0x28]\n"
+		"B       loc_FFC8EF3C\n"
+"loc_FFC8EF34:\n"
+		"LDRH    R0, [R8]\n"
+		"STRH    R0, [R4,#4]\n"
+"loc_FFC8EF3C:\n"
+		"CMP     R5, #1\n"
+		"LDRNEH  R0, [R8,#8]\n"
+		"BNE     loc_FFC8EF58\n"
+		"LDRSH   R0, [R4,#0xC]\n"
+		"LDR     R1, =0xFFC8DE44\n"
+		"MOV     R2, #0x20\n"
+		"BL      sub_FFC9298C\n"
+"loc_FFC8EF58:\n"
+		"STRH    R0, [R4,#0xC]\n"
+		"LDRSH   R0, [R4,#6]\n"
+		"BL      sub_FFC80F4C_my\n"		//----------->
+		"LDRSH   R0, [R4,#8]\n"
+		"MOV     R1, #1\n"
+		"BL      sub_FFC8169C\n"
+		"MOV     R1, #0\n"
+		"ADD     R0, R4, #8\n"
+		"BL      sub_FFC81724\n"
+		"LDRSH   R0, [R4,#0xE]\n"
+		"BL      sub_FFC8914C\n"
+		"LDR     R4, =0xBB8\n"
+		"CMP     R6, #1\n"
+		"BNE     loc_FFC8EFB0\n"
+		"LDR     R0, [R7,#0x1C]\n"
+		"MOV     R2, R4\n"
+		"MOV     R1, #2\n"
+		"BL      sub_FFC28750\n"
+		"TST     R0, #1\n"
+		"LDRNE   R1, =0x5A3\n"
+		"LDRNE   R0, =0xFFC8E440\n"
+		"BLNE    sub_FFC0F680\n"
+"loc_FFC8EFB0:\n"
+		"CMP     R5, #1\n"
+		"LDMNEFD SP!, {R4-R8,PC}\n"
+		"LDR     R0, [R7,#0x1C]\n"
+		"MOV     R2, R4\n"
+		"MOV     R1, #0x20\n"
+		"BL      sub_FFC28750\n"
+		"TST     R0, #1\n"
+		"LDRNE   R1, =0x5A8\n"
+		"LDRNE   R0, =0xFFC8E440\n"
+		"LDMNEFD SP!, {R4-R8,LR}\n"
+		"BNE     sub_FFC0F680\n"
+		"LDMFD   SP!, {R4-R8,PC}\n"
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFC80F4C_my(){ // 
+	asm volatile(
+			"STMFD   SP!, {R4-R6,LR}\n"
+			"LDR     R5, =0x35C0\n"
+			"MOV     R4, R0\n"
+			"LDR     R0, [R5,#4]\n"
+			"CMP     R0, #1\n"
+			"LDRNE   R1, =0x146\n"
+			"LDRNE   R0, =0xFFC80D50\n"
+			"BLNE    sub_FFC0F680\n"
+			"CMN     R4, #0xC00\n"
+			"LDREQSH R4, [R5,#2]\n"
+			"CMN     R4, #0xC00\n"
+			"MOVEQ   R1, #0x14C\n"
+			"LDREQ   R0, =0xFFC80D50\n"
+			"STRH    R4, [R5,#2]\n"
+			"BLEQ    sub_FFC0F680\n"
+			"MOV     R0, R4\n"
+		//  "BL      _sub_FFD7D8F8\n"		// -
+			"BL      apex2us\n"				// +
+			"MOV     R4, R0\n"
+		//	"BL      nullsub_39\n"
+			"MOV     R0, R4\n"
+			"BL      sub_FFCB8140\n"
+			"TST     R0, #1\n"
+			"LDRNE   R1, =0x151\n"
+			"LDMNEFD SP!, {R4-R6,LR}\n"
+			"LDRNE   R0, =0xFFC80D50\n"
+			"BNE     sub_FFC0F680\n"
+			"LDMFD   SP!, {R4-R6,PC}\n"
+	);
+}
Index: /trunk/platform/a495/sub/100f/stubs_entry.S
===================================================================
--- /trunk/platform/a495/sub/100f/stubs_entry.S	(revision 1198)
+++ /trunk/platform/a495/sub/100f/stubs_entry.S	(revision 1198)
@@ -0,0 +1,181 @@
+// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!
+#include "stubs_asm.h"
+
+// Best match: 94%
+NSTUB(AllocateMemory, 0xffdfd16c)
+NSTUB(AllocateUncacheableMemory, 0xffc292d8)
+// Best match: 96%
+NSTUB(Close, 0xffc26108)
+NSTUB(CreateTask, 0xffc0f1a8)
+NSTUB(DeleteFile_Fut, 0xffc25a80)
+// ERROR: EnterToCompensationEVF is not found!
+NSTUB(ExecuteEventProcedure, 0xffc65870)
+// ERROR: ExitFromCompensationEVF is not found!
+NSTUB(ExitTask, 0xffc0f438)
+NSTUB(Fclose_Fut, 0xffc25bfc)
+NSTUB(Feof_Fut, 0xffc25de8)
+NSTUB(Fflush_Fut, 0xffc25e24)
+NSTUB(Fgets_Fut, 0xffc25d50)
+NSTUB(Fopen_Fut, 0xffc25bbc)
+NSTUB(Fread_Fut, 0xffc25ca8)
+// Best match: 94%
+NSTUB(FreeMemory, 0xffdfd164)
+// Best match: 91%
+NSTUB(FreeUncacheableMemory, 0xffc29318)
+NSTUB(Fseek_Fut, 0xffc25d9c)
+NSTUB(Fwrite_Fut, 0xffc25cfc)
+// ERROR: GetBatteryTemperature is not found!
+// ERROR: GetCCDTemperature is not found!
+// Best match: 93%
+NSTUB(GetCurrentAvValue, 0xffd088c0)
+// Best match: 66%
+NSTUB(GetDrive_ClusterSize, 0xffc512c0)
+// ERROR: GetDrive_FreeClusters is not found!
+// Best match: 60%
+NSTUB(GetDrive_TotalClusters, 0xffc512f4)
+// Best match: 64%
+NSTUB(GetFocusLensSubjectDistance, 0xffd07bb8)
+// Best match: 77%
+NSTUB(GetFocusLensSubjectDistanceFromLens, 0xffd08010)
+NSTUB(GetMemInfo, 0xffc0a7f8)
+// ERROR: GetOpticalTemperature is not found!
+// Best match: 96%
+NSTUB(GetParameterData, 0xffd2f260)
+// Best match: 72%
+NSTUB(GetPropertyCase, 0xffc6957c)
+NSTUB(GetSystemTime, 0xffdfd1c4)
+// Best match: 74%
+NSTUB(GetZoomLensCurrentPoint, 0xffd09d80)
+// Best match: 59%
+NSTUB(GetZoomLensCurrentPosition, 0xffd0a788)
+// Best match: 58%
+NSTUB(IsStrobeChargeCompleted, 0xffca72b0)
+NSTUB(LocalTime, 0xffc63580)
+// Best match: 93%
+NSTUB(LockMainPower, 0xffc6ce90)
+// ERROR: Lseek is not found!
+// Best match: 92%
+NSTUB(MakeDirectory_Fut, 0xffc25af4)
+// Best match: 57%
+NSTUB(MoveFocusLensToDistance, 0xffe53458)
+// Best match: 58%
+NSTUB(MoveZoomLensWithPoint, 0xffdfae44)
+// Best match: 62%
+NSTUB(NewTaskShell, 0xffc68f88)
+// Best match: 69%
+NSTUB(Open, 0xffc4e5dc)
+// Best match: 85%
+NSTUB(PB2Rec, 0xffc6fae4)
+// ERROR: PT_PlaySound is not found!
+// Best match: 86%
+NSTUB(PostLogicalEventForNotPowerType, 0xffc6c6c0)
+// Best match: 92%
+NSTUB(PostLogicalEventToUI, 0xffc6c70c)
+NSTUB(Read, 0xffc0b308)
+// ERROR: ReadFastDir is not found!
+// Best match: 72%
+NSTUB(Rec2PB, 0xffc6fb24)
+// ERROR: RefreshPhysicalScreen is not found!
+// ERROR: Remove is not found!
+// Best match: 53%
+NSTUB(RenameFile_Fut, 0xffc25bb8)
+// ALT: NSTUB(RenameFile_Fut, 0xffcf35cc) // 8/7
+// ALT: NSTUB(RenameFile_Fut, 0xffcf361c) // 8/7
+NSTUB(Restart, 0xffc2aab0)
+// Best match: 93%
+NSTUB(SetAutoShutdownTime, 0xffc6cf04)
+// Best match: 81%
+NSTUB(SetCurrentCaptureModeType, 0xffc7323c)
+// Best match: 55%
+NSTUB(SetFileTimeStamp, 0xffcfbc00)
+// Best match: 64%
+NSTUB(SetLogicalEventActive, 0xffc6cc08)
+// Best match: 96%
+NSTUB(SetParameterData, 0xffd2f1d0)
+// Best match: 72%
+NSTUB(SetPropertyCase, 0xffc6944c)
+// Best match: 92%
+NSTUB(SleepTask, 0xffc2915c)
+// Best match: 60%
+NSTUB(TakeSemaphore, 0xffc0f034)
+// ERROR: TurnOffBackLight is not found!
+// ERROR: TurnOnBackLight is not found!
+// ERROR: UIFS_WriteFirmInfoToFile is not found!
+// Best match: 93%
+NSTUB(UnlockMainPower, 0xffc6cde4)
+// Best match: 96%
+NSTUB(UpdateMBROnFlash, 0xffc51140)
+// Best match: 85%
+NSTUB(VbattGet, 0xffc22be4)
+NSTUB(Write, 0xffc26198)
+NSTUB(_log, 0xffe8233c)
+NSTUB(_log10, 0xffe81280)
+NSTUB(_pow, 0xffe813f0)
+NSTUB(_sqrt, 0xffe836a4)
+NSTUB(add_ptp_handler, 0xffdbeb58)
+NSTUB(close, 0xffc0b120)
+// Best match: 71%
+NSTUB(closedir, 0xffdebc3c)
+// Best match: 71%
+NSTUB(closefastdir, 0xffdebc3c)
+// Best match: 91%
+NSTUB(free, 0xffc04160)
+// Best match: 60%
+NSTUB(kbd_p1_f, 0xffc23ba4)
+// Best match: 58%
+NSTUB(kbd_p1_f_cont, 0xffc23bb0)
+// Best match: 86%
+NSTUB(kbd_p2_f, 0xffc2345c)
+// Best match: 51%
+NSTUB(kbd_pwr_off, 0xffc435e4)
+// ERROR: kbd_pwr_on is not found!
+// ERROR: kbd_read_keys is not found!
+// Best match: 73%
+NSTUB(kbd_read_keys_r2, 0xffc42fec)
+// ALT: NSTUB(kbd_read_keys_r2, 0xffc42fd0) // 16/6
+// Best match: 68%
+NSTUB(lseek, 0xffc26230)
+NSTUB(malloc, 0xffc04104)
+NSTUB(memcmp, 0xffc11318)
+NSTUB(memcpy, 0xffc2e860)
+NSTUB(memset, 0xffd7c930)
+// Best match: 74%
+NSTUB(mkdir, 0xffc265a4)
+NSTUB(mktime_ext, 0xffc7cdbc)
+NSTUB(open, 0xffc0b070)
+// Best match: 81%
+NSTUB(opendir, 0xffdebaa4)
+// ERROR: openfastdir is not found!
+// ERROR: qsort is not found!
+// Best match: 95%
+NSTUB(rand, 0xffc11420)
+NSTUB(read, 0xffc0b308)
+// ERROR: readfastdir is not found!
+// Best match: 82%
+NSTUB(reboot_fw_update, 0xffded46c)
+// ERROR: rename is not found!
+// Best match: 93%
+NSTUB(set_control_event, 0xffc6c928)
+// Best match: 95%
+NSTUB(srand, 0xffc11414)
+NSTUB(stat, 0xffc2626c)
+// Best match: 61%
+NSTUB(strcat, 0xffc03f60)
+// Best match: 56%
+NSTUB(strchr, 0xffc03fe8)
+NSTUB(strcmp, 0xffc112d4)
+NSTUB(strcpy, 0xffc112bc)
+NSTUB(strftime, 0xffc7c7c4)
+NSTUB(strlen, 0xffc04034)
+NSTUB(strncmp, 0xffc03f9c)
+// Best match: 73%
+NSTUB(strncpy, 0xffc03f60)
+// Best match: 71%
+NSTUB(strrchr, 0xffc2e838)
+// ALT: NSTUB(strrchr, 0xffc7c58c) // 18/8
+// Best match: 96%
+NSTUB(strtol, 0xffc2eb40)
+NSTUB(strtolx, 0xffc2e944)
+NSTUB(time, 0xffc63434)
+NSTUB(vsprintf, 0xffc11280)
+NSTUB(write, 0xffc0b368)
Index: /trunk/platform/a495/sub/100f/stubs_entry_2.S
===================================================================
--- /trunk/platform/a495/sub/100f/stubs_entry_2.S	(revision 1198)
+++ /trunk/platform/a495/sub/100f/stubs_entry_2.S	(revision 1198)
@@ -0,0 +1,68 @@
+#include "stubs_asm.h"
+
+// Not found automatically
+NHSTUB(EnterToCompensationEVF, 0xFFC27604)		// "ExpOn"
+NHSTUB(ExitFromCompensationEVF, 0xFFC27648)		// "ExpOff"
+
+// found automatically with errors
+NHSTUB(lseek, 0xFFC26224)						// Same as LSeek
+NHSTUB(GetZoomLensCurrentPosition, 0xFFDF5210)
+NHSTUB(RenameFile_Fut, 0xFFC259EC)				// Maybe ok, Find 0x9400013
+NHSTUB(SetFileTimeStamp, 0xFFC263A4)			// Maybe ok, Find 0x12CEA600
+NHSTUB(UpdateMBROnFlash, 0xFFC51140)
+NHSTUB(closedir, 0xFFDEBA54)
+NHSTUB(closefastdir, 0xFFDEBA54)				// Same as closedir
+NHSTUB(kbd_read_keys_r2, 0xFFC23B58)
+NHSTUB(strcat, 0xFFC7C578)
+NHSTUB(strrchr, 0xFFC0400C)
+
+// Found manually
+NHSTUB(RefreshPhysicalScreen, 0xFFD7B3FC)		// 0xFFD7B3FC/0xFFD7B460?
+NHSTUB(Lseek, 0xFFC26224)						// Same as lseek
+NHSTUB(GetCCDTemperature, 0xFFC455A8)			// Not tested, but maybe OK
+NHSTUB(GetOpticalTemperature, 0xFFC45694)		// Not tested, but maybe OK
+NHSTUB(GetDrive_FreeClusters, 0xFFC51320)		// Not tested, but maybe OK
+NHSTUB(PT_PlaySound, 0xFFC5F400)				// Tested, ok
+NHSTUB(openfastdir, 0xFFDEBAA4)
+NHSTUB(ReadFastDir, 0xFFDEBBF8)
+NHSTUB(readfastdir, 0xFFDEBBF8)
+NHSTUB(Remove, 0xFFC2613C)
+NHSTUB(TurnOnBackLight, 0xFFC77F84)
+NHSTUB(TurnOffBackLight, 0xFFC77F9C)
+NHSTUB(UIFS_WriteFirmInfoToFile, 0xFFD1F9D4)
+NHSTUB(kbd_read_keys, 0xFFC23B2C)
+NHSTUB(rename, 0xFFC261E4)
+NHSTUB(DoAFLock, 0xFFC27554)
+NHSTUB(UnlockAF, 0xFFC2758C)
+NHSTUB(MakeAFScan, 0xFFD0F2AC)					// Ok
+NHSTUB(ExpCtrlTool_StartContiAE, 0xFFC34CE4)	// "StartContiAE"
+NHSTUB(ExpCtrlTool_StopContiAE, 0xFFC34DBC)		// "StopContiAE"
+NHSTUB(apex2us, 0xFFD7D8F8)						// Untested, for extra long exposure
+NHSTUB(SetScriptMode, 0xFFC00F70)				// Ok
+NHSTUB(platformsub_kbd_fetch_data, 0xFFC435CC)
+NHSTUB(SetAE_ShutterSpeed, 0xFFE55BE8)			// Untested
+NHSTUB(UnsetZoomForMovie, 0xFFD3594C)
+NHSTUB(LEDDrive, 0xFFC42BC4)					// Untested
+NHSTUB(qsort, 0xFFE3C194)						// Untested
+
+// video buffer stuff
+NHSTUB(UnlockAndRefresh, 0xFFD7C5EC)			// "Window.c"
+NHSTUB(LockAndRefresh, 0xFFD7C5A8)				// "Window.c"
+
+// null subs, Not yet found
+NHSTUB(GetBatteryTemperature, 0xFFC00B20)		// 0xFFC4561C crashed
+NHSTUB(TurnOffMic, 0xFFC43C28)					// Doesn't work
+NHSTUB(TurnOnMic, 0xFFC43C54)					// Doesn't work
+
+NHSTUB(PutInNdFilter, 0xFFDFACA8)						// fixed
+NHSTUB(PutOutNdFilter, 0xFFDFACCC)					// fixed
+NHSTUB(SetZoomActuatorSpeedPercent, 0xFFC00B20)
+NHSTUB(WriteSDCard, 0xffcfcbcc)  // 0xFFCFC9E8)		// fixed
+NHSTUB(GetImageFolder, 0xFFCF1478)	// function before 'GetCameraObjectTmpPath ERROR' string
+
+// --- Those aren't used or don't exist in DryOS (like A720 and other)
+NHSTUB(Mount_FileSystem, 0xFFC00B20)                 // nullsub_1
+NHSTUB(Unmount_FileSystem, 0xFFC00B20)               // nullsub_1
+NHSTUB(rewinddir, 0xFFC00B20)                        // nullsub_1
+NHSTUB(kbd_pwr_on, 0xFFC00B20)
+NHSTUB(kbd_pwr_off, 0xFFC00B20)
Index: /trunk/platform/a495/sub/100f/boot.c
===================================================================
--- /trunk/platform/a495/sub/100f/boot.c	(revision 1198)
+++ /trunk/platform/a495/sub/100f/boot.c	(revision 1198)
@@ -0,0 +1,634 @@
+#include "lolevel.h"
+#include "platform.h"
+#include "core.h"
+#include "dryos31.h"
+
+#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
+
+const char * const new_sa = &_end;
+
+void taskHook(context_t **context) {
+	task_t *tcb=(task_t*)((char*)context-offsetof(task_t, context));
+
+	if(!_strcmp(tcb->name, "PhySw"))           tcb->entry = (void*)mykbd_task; 
+	if(!_strcmp(tcb->name, "CaptSeqTask"))     tcb->entry = (void*)capt_seq_task; 
+	if(!_strcmp(tcb->name, "InitFileModules")) tcb->entry = (void*)init_file_modules_task;
+	if(!_strcmp(tcb->name, "MovieRecord"))     tcb->entry = (void*)movie_record_task;
+	if(!_strcmp(tcb->name, "ExpDrvTask"))      tcb->entry = (void*)exp_drv_task;
+}
+
+void CreateTask_spytask() {
+	_CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
+};
+
+
+void __attribute__((naked,noinline)) boot() {
+	asm volatile (
+			/*// LED Test
+			"LDR     R1, =0xC0220088\n"	// Green LED
+			"MOV     R0, #0x46\n"			// Power on LED
+			"STR     R0, [R1]\n"
+			// End LED Test*/
+
+			"LDR     R1, =0xC0410000\n"
+			"MOV     R0, #0\n"
+			"STR     R0, [R1]\n"
+			"MOV     R1, #0x78\n"
+			"MCR     p15, 0, R1,c1,c0\n"
+			"MOV     R1, #0\n"
+			"MCR     p15, 0, R1,c7,c10, 4\n"
+			"MCR     p15, 0, R1,c7,c5\n"
+			"MCR     p15, 0, R1,c7,c6\n"
+			"MOV     R0, #0x3D\n"
+			"MCR     p15, 0, R0,c6,c0\n"
+			"MOV     R0, #0xC000002F\n"
+			"MCR     p15, 0, R0,c6,c1\n"
+			"MOV     R0, #0x31\n"
+			"MCR     p15, 0, R0,c6,c2\n"
+			"LDR     R0, =0x10000031\n"
+			"MCR     p15, 0, R0,c6,c3\n"
+			"MOV     R0, #0x40000017\n"
+			"MCR     p15, 0, R0,c6,c4\n"
+			"LDR     R0, =0xFFC0002B\n"
+			"MCR     p15, 0, R0,c6,c5\n"
+			"MOV     R0, #0x34\n"
+			"MCR     p15, 0, R0,c2,c0\n"
+			"MOV     R0, #0x34\n"
+			"MCR     p15, 0, R0,c2,c0, 1\n"
+			"MOV     R0, #0x34\n"
+			"MCR     p15, 0, R0,c3,c0\n"
+			"LDR     R0, =0x3333330\n"
+			"MCR     p15, 0, R0,c5,c0, 2\n"
+			"LDR     R0, =0x3333330\n"
+			"MCR     p15, 0, R0,c5,c0, 3\n"
+			"MRC     p15, 0, R0,c1,c0\n"
+			"ORR     R0, R0, #0x1000\n"
+			"ORR     R0, R0, #4\n"
+			"ORR     R0, R0, #1\n"
+			"MCR     p15, 0, R0,c1,c0\n"
+			"MOV     R1, #0x40000006\n"
+			"MCR     p15, 0, R1,c9,c1\n"
+			"MOV     R1, #6\n"
+			"MCR     p15, 0, R1,c9,c1, 1\n"
+			"MRC     p15, 0, R1,c1,c0\n"
+			"ORR     R1, R1, #0x50000\n"
+			"MCR     p15, 0, R1,c1,c0\n"
+			"LDR     R2, =0xC0200000\n"
+			"MOV     R1, #1\n"
+			"STR     R1, [R2,#0x10C]\n"
+			"MOV     R1, #0xFF\n"
+			"STR     R1, [R2,#0xC]\n"
+			"STR     R1, [R2,#0x1C]\n"
+			"STR     R1, [R2,#0x2C]\n"
+			"STR     R1, [R2,#0x3C]\n"
+			"STR     R1, [R2,#0x4C]\n"
+			"STR     R1, [R2,#0x5C]\n"
+			"STR     R1, [R2,#0x6C]\n"
+			"STR     R1, [R2,#0x7C]\n"
+			"STR     R1, [R2,#0x8C]\n"
+			"STR     R1, [R2,#0x9C]\n"
+			"STR     R1, [R2,#0xAC]\n"
+			"STR     R1, [R2,#0xBC]\n"
+			"STR     R1, [R2,#0xCC]\n"
+			"STR     R1, [R2,#0xDC]\n"
+			"STR     R1, [R2,#0xEC]\n"
+			"STR     R1, [R2,#0xFC]\n"
+			"LDR     R1, =0xC0400008\n"
+			"LDR     R2, =0x430005\n"
+			"STR     R2, [R1]\n"
+			"MOV     R1, #1\n"
+			"LDR     R2, =0xC0243100\n"
+			"STR     R2, [R1]\n"
+			"LDR     R2, =0xC0242010\n"
+			"LDR     R1, [R2]\n"
+			"ORR     R1, R1, #1\n"
+			"STR     R1, [R2]\n"
+			"LDR     R0, =0xFFEEB810\n"
+			"LDR     R1, =0x1900\n"
+			"LDR     R3, =0xABA4\n"
+"loc_FFC0013C:\n"
+			"CMP     R1, R3\n"
+			"LDRCC   R2, [R0],#4\n"
+			"STRCC   R2, [R1],#4\n"
+			"BCC     loc_FFC0013C\n"
+			"LDR     R1, =0x128E90\n"
+			"MOV     R2, #0\n"
+"loc_FFC00154:\n"
+			"CMP     R3, R1\n"
+			"STRCC   R2, [R3],#4\n"
+			"BCC     loc_FFC00154\n"
+			"B       sub_FFC00358_my\n"  //--------->
+	);
+};
+
+
+void __attribute__((naked,noinline)) sub_FFC00358_my() {
+	*(int*)0x1934=(int)taskHook;	// ?
+	*(int*)0x1938=(int)taskHook;	// ?
+
+	// "correct power on" is to start in record mode if the power button is held down, on cameras that can start with play or power button. Otherwise CHDK always starts in play mode.
+	*(int*)(0x20F8)= (*(int*)0xC022005C) & 1 ? 0x4000000 : 0x2000000; // replacement of sub_FFC42F30 for correct power-on.
+	
+asm volatile (
+			"LDR     R0, =0xFFC003D0\n"
+			"MOV     R1, #0\n"
+			"LDR     R3, =0xFFC00408\n"
+"loc_FFC00364:\n"
+			"CMP     R0, R3\n"
+			"LDRCC   R2, [R0],#4\n"
+			"STRCC   R2, [R1],#4\n"
+			"BCC     loc_FFC00364\n"
+			"LDR     R0, =0xFFC00408\n"
+			"MOV     R1, #0x4B0\n"
+			"LDR     R3, =0xFFC0061C\n"
+"loc_FFC00380:\n"
+			"CMP     R0, R3\n"
+			"LDRCC   R2, [R0],#4\n"
+			"STRCC   R2, [R1],#4\n"
+			"BCC     loc_FFC00380\n"
+			"MOV     R0, #0xD2\n"
+			"MSR     CPSR_cxsf, R0\n"
+			"MOV     SP, #0x1000\n"
+			"MOV     R0, #0xD3\n"
+			"MSR     CPSR_cxsf, R0\n"
+			"MOV     SP, #0x1000\n"
+			"LDR     R0, =0x6C4\n"
+			"LDR     R2, =0xEEEEEEEE\n"
+			"MOV     R3, #0x1000\n"
+"loc_FFC003B4:\n"
+			"CMP     R0, R3\n"
+			"STRCC   R2, [R0],#4\n"
+			"BCC     loc_FFC003B4\n"
+			"BL      sub_FFC0119C_my\n" //-------->
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFC0119C_my() {
+	asm volatile (
+			"STR     LR, [SP,#-4]!\n"
+			"SUB     SP, SP, #0x74\n"
+			"MOV     R0, SP\n"
+			"MOV     R1, #0x74\n"
+			"BL      sub_FFE81080\n"
+			"MOV     R0, #0x53000\n"
+			"STR     R0, [SP,#4]\n"
+			//    "LDR     R0, =0x128E90\n"			// -
+			"LDR     R0, =new_sa\n"				// +
+			"LDR     R0, [R0]\n"				// +
+			"LDR     R2, =0x279C00\n"
+			"LDR     R1, =0x2724A8\n"
+			"STR     R0, [SP,#8]\n"
+			"SUB     R0, R1, R0\n"
+			"ADD     R3, SP, #0xC\n"
+			"STR     R2, [SP]\n"
+			"STMIA   R3, {R0-R2}\n"
+			"MOV     R0, #0x22\n"
+			"STR     R0, [SP,#0x18]\n"
+			"MOV     R0, #0x68\n"
+			"STR     R0, [SP,#0x1C]\n"
+			"LDR     R0, =0x19B\n"
+			"LDR     R1, =sub_FFC05E5C_my\n"	//--------->
+			"STR     R0, [SP,#0x20]\n"
+			"MOV     R0, #0x96\n"
+			"STR     R0, [SP,#0x24]\n"
+			"MOV     R0, #0x78\n"
+			"STR     R0, [SP,#0x28]\n"
+			"MOV     R0, #0x64\n"
+			"STR     R0, [SP,#0x2C]\n"
+			"MOV     R0, #0\n"
+			"STR     R0, [SP,#0x30]\n"
+			"STR     R0, [SP,#0x34]\n"
+			"MOV     R0, #0x10\n"
+			"STR     R0, [SP,#0x5C]\n"
+			"MOV     R0, #0x800\n"
+			"STR     R0, [SP,#0x60]\n"
+			"MOV     R0, #0xA0\n"
+			"STR     R0, [SP,#0x64]\n"
+			"MOV     R0, #0x280\n"
+			"STR     R0, [SP,#0x68]\n"
+			"MOV     R0, SP\n"
+			"MOV     R2, #0\n"
+			"BL      sub_FFC03408\n"
+			"ADD     SP, SP, #0x74\n"
+			"LDR     PC, [SP],#4\n"
+	);
+}
+
+
+void __attribute__((naked,noinline)) sub_FFC05E5C_my() {
+	asm volatile (
+			"STMFD   SP!, {R4,LR}\n"
+			"BL      sub_FFC00B24\n"
+			"BL      sub_FFC0A8D0\n"
+			"CMP     R0, #0\n"
+			"LDRLT   R0, =0xFFC05F70\n"
+			"BLLT    sub_FFC05F50\n"
+			"BL      sub_FFC05A98\n"
+			"CMP     R0, #0\n"
+			"LDRLT   R0, =0xFFC05F78\n"
+			"BLLT    sub_FFC05F50\n"
+			"LDR     R0, =0xFFC05F88\n"
+			"BL      sub_FFC05B80\n"
+			"CMP     R0, #0\n"
+			"LDRLT   R0, =0xFFC05F90\n"
+			"BLLT    sub_FFC05F50\n"
+			"LDR     R0, =0xFFC05F88\n"
+			"BL      sub_FFC03BF4\n"
+			"CMP     R0, #0\n"
+			"LDRLT   R0, =0xFFC05FA4\n"
+			"BLLT    sub_FFC05F50\n"
+			"BL      sub_FFC0A2C8\n"
+			"CMP     R0, #0\n"
+			"LDRLT   R0, =0xFFC05FB0\n"
+			"BLLT    sub_FFC05F50\n"
+			"BL      sub_FFC01680\n"
+			"CMP     R0, #0\n"
+			"LDRLT   R0, =0xFFC05FBC\n"
+			"BLLT    sub_FFC05F50\n"
+			"LDMFD   SP!, {R4,LR}\n"
+			"B       taskcreate_Startup_my\n" //-------->
+	);
+};
+
+
+void __attribute__((naked,noinline)) taskcreate_Startup_my() {
+	asm volatile (
+			"STMFD   SP!, {R3,LR}\n"
+			//  "BL      j_nullsub_192\n"
+			"BL      sub_FFC2ABA4\n"
+			"CMP     R0, #0\n"
+			"BNE     loc_FFC10690\n"
+			"BL      sub_FFC250BC\n"
+			"CMP     R0, #0\n"
+			"BEQ     loc_FFC10690\n"
+			"BL      sub_FFC238CC\n"
+			"CMP     R0, #0\n"
+			"BNE     loc_FFC10690\n"
+			"LDR     R1, =0xC0220000\n"
+			"MOV     R0, #0x44\n"
+			"STR     R0, [R1,#0x20]\n"
+"loc_FFC1068C:\n"
+			"B       loc_FFC1068C\n"
+"loc_FFC10690:\n"
+			//  "BL      sub_FFC238D8\n"			// removed for correct power-on on 'on/off' button.
+			//  "BL      j_nullsub_193\n"
+			"BL      sub_FFC28FD4\n"
+			"LDR     R1, =0x2CE000\n"
+			"MOV     R0, #0\n"
+			"BL      sub_FFC2921C\n"
+			"BL      sub_FFC291C8\n"
+			"MOV     R3, #0\n"
+			"STR     R3, [SP]\n"
+			"LDR     R3, =task_Startup_my\n"	//-------->
+			"MOV     R2, #0\n"
+			"MOV     R1, #0x19\n"
+			"LDR     R0, =0xFFC106D8\n"
+			"BL      sub_FFC0F1A8\n"
+			"MOV     R0, #0\n"
+			"LDMFD   SP!, {R12,PC}\n"
+	);
+}
+
+void __attribute__((naked,noinline)) task_Startup_my() {
+	asm volatile (
+			"STMFD   SP!, {R4,LR}\n"
+			"BL      sub_FFC06278\n"
+			"BL      sub_FFC249CC\n"
+			"BL      sub_FFC2326C\n"
+			//  "BL      j_nullsub_196\n"
+			"BL      sub_FFC2ADD0\n"
+			//  "BL      sub_FFC2AC78\n"		// - start diskboot.bin
+			"BL      sub_FFC2AF6C\n"
+			"BL      sub_FFC2AE00\n"
+			"BL      sub_FFC2846C\n"
+			"BL      sub_FFC2AF70\n"
+			"BL      CreateTask_spytask\n"	// +
+			//  "BL      sub_FFC237C0\n"		// original taskcreate_PhySw
+			"BL      taskcreate_PhySw_my\n"	// +
+			"BL      sub_FFC26CF8\n"
+			"BL      sub_FFC2AF88\n"
+			//  "BL      nullsub_173\n"
+			"BL      sub_FFC22D48\n"
+			"BL      sub_FFC2A97C\n"
+			"BL      sub_FFC23220\n"
+			"BL      sub_FFC22CE8\n"
+			"BL      sub_FFC2B9B4\n"
+			"BL      sub_FFC22CC0\n"
+			"LDMFD   SP!, {R4,LR}\n"
+			"B       sub_FFC06128\n"
+	);
+}
+
+// ROM:FFC237C0 taskcreate_PhySw
+void __attribute__((naked,noinline)) taskcreate_PhySw_my() {
+	asm volatile(
+			"STMFD   SP!, {R3-R5,LR}\n"
+			"LDR     R4, =0x1BE4\n"
+			"LDR     R0, [R4,#0x10]\n"
+			"CMP     R0, #0\n"
+			"BNE     loc_FFC237F4\n"
+			"MOV     R3, #0\n"
+			"STR     R3, [SP]\n"
+			"LDR     R3, =mykbd_task\n"		// Changed
+			//  "MOV     R2, #0x800\n"
+			"MOV     R2, #0x2000\n"			// + stack size for new task_PhySw so we don't have to do stack switch
+			"B       sub_FFC237E4\n"    // Continue code
+"loc_FFC237F4:\n"
+			"B       sub_FFC237F4\n"    // Continue code
+	);
+}
+/*******************************************************************/
+
+// ROM:FFC705AC task_InitFileModules
+void __attribute__((naked,noinline)) init_file_modules_task() {
+	asm volatile(
+			"STMFD   SP!, {R4-R6,LR}\n"
+			"BL      sub_FFC69E48\n"
+			"LDR     R5, =0x5006\n"
+			"MOVS    R4, R0\n"
+			"MOVNE   R1, #0\n"
+			"MOVNE   R0, R5\n"
+			"BLNE    sub_FFC6C70C\n"
+			"BL      sub_FFC69E74_my\n"			//------------->
+			"BL      core_spytask_can_start\n"	// + set "it's safe to start" flag for spytask
+			"CMP     R4, #0\n"
+			"MOVEQ   R0, R5\n"
+			"LDMEQFD SP!, {R4-R6,LR}\n"
+			"MOVEQ   R1, #0\n"
+			"BEQ     sub_FFC6C70C\n"
+			"LDMFD   SP!, {R4-R6,PC}\n"
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFC69E74_my() {
+	asm volatile(
+			"STMFD   SP!, {R4,LR}\n"
+			"MOV     R0, #3\n"
+			"BL      sub_FFC50E94_my\n"			//---------->
+			//  "BL      nullsub_67\n"
+			"LDR     R4, =0x2A30\n"
+			"LDR     R0, [R4,#4]\n"
+			"CMP     R0, #0\n"
+			"BNE     loc_FFC69EAC\n"
+			"BL      sub_FFC500DC\n"
+			"BL      sub_FFCF0788\n"
+			"BL      sub_FFC500DC\n"
+			"BL      sub_FFC4CB54\n"
+			"BL      sub_FFC4FFDC\n"
+			"BL      sub_FFCF081C\n"
+"loc_FFC69EAC:\n"
+			"MOV     R0, #1\n"
+			"STR     R0, [R4]\n"
+			"LDMFD   SP!, {R4,PC}\n"
+	);
+}
+
+
+void __attribute__((naked,noinline)) sub_FFC50E94_my() {
+		asm volatile(
+		"STMFD   SP!, {R4-R8,LR}\n"
+		"MOV     R8, R0\n"
+		"BL      sub_FFC50E14\n"
+		"LDR     R1, =0x32350\n"
+		"MOV     R6, R0\n"
+		"ADD     R4, R1, R0,LSL#7\n"
+		"LDR     R0, [R4,#0x6C]\n"
+		"CMP     R0, #4\n"
+		"LDREQ   R1, =0x817\n"
+		"LDREQ   R0, =0xFFC50954\n"
+		"BLEQ    sub_FFC0F680\n"
+		"MOV     R1, R8\n"
+		"MOV     R0, R6\n"
+		"BL      sub_FFC506CC\n"
+		"LDR     R0, [R4,#0x38]\n"
+		"BL      sub_FFC51534\n"
+		"CMP     R0, #0\n"
+		"STREQ   R0, [R4,#0x6C]\n"
+		"MOV     R0, R6\n"
+		"BL      sub_FFC5075C\n"
+		"MOV     R0, R6\n"
+		"BL      sub_FFC50ABC_my\n"		//--------->
+		"MOV     R5, R0\n"
+		"MOV     R0, R6\n"
+		"BL      sub_FFC50CEC\n"
+		"LDR     R6, [R4,#0x3C]\n"
+		"AND     R7, R5, R0\n"
+		"CMP     R6, #0\n"
+		"LDR     R1, [R4,#0x38]\n"
+		"MOVEQ   R0, #0x80000001\n"
+		"MOV     R5, #0\n"
+		"BEQ     loc_FFC50F44\n"
+		"MOV     R0, R1\n"
+		"BL      sub_FFC50244\n"
+		"CMP     R0, #0\n"
+		"MOVNE   R5, #4\n"
+		"CMP     R6, #5\n"
+		"ORRNE   R0, R5, #1\n"
+		"BICEQ   R0, R5, #1\n"
+		"CMP     R7, #0\n"
+		"BICEQ   R0, R0, #2\n"
+		"ORREQ   R0, R0, #0x80000000\n"
+		"BICNE   R0, R0, #0x80000000\n"
+		"ORRNE   R0, R0, #2\n"
+"loc_FFC50F44:\n"
+		"CMP     R8, #7\n"
+		"STR     R0, [R4,#0x40]\n"
+		"LDMNEFD SP!, {R4-R8,PC}\n"
+		"MOV     R0, R8\n"
+		"BL      sub_FFC50E64\n"
+		"CMP     R0, #0\n"
+		"LDMEQFD SP!, {R4-R8,LR}\n"
+		"LDREQ   R0, =0xFFC50F90\n"
+		"BEQ     sub_FFC01780\n"
+		"LDMFD   SP!, {R4-R8,PC}\n"
+		);
+}
+
+void __attribute__((naked,noinline)) sub_FFC50ABC_my() {
+	asm volatile(
+			"STMFD   SP!, {R4-R6,LR}\n"
+			"MOV     R5, R0\n"
+			"LDR     R0, =0x32350\n"
+			"ADD     R4, R0, R5,LSL#7\n"
+			"LDR     R0, [R4,#0x6C]\n"
+			"TST     R0, #2\n"
+			"MOVNE   R0, #1\n"
+			"LDMNEFD SP!, {R4-R6,PC}\n"
+			"LDR     R0, [R4,#0x38]\n"
+			"MOV     R1, R5\n"
+			"BL      sub_FFC507DC_my\n"  //--------->
+			"CMP     R0, #0\n"
+			"LDRNE   R0, [R4,#0x38]\n"
+			"MOVNE   R1, R5\n"
+			"BLNE    sub_FFC50978\n"
+			"LDR     R2, =0x323D0\n"
+			"ADD     R1, R5, R5,LSL#4\n"
+			"LDR     R1, [R2,R1,LSL#2]\n"
+			"CMP     R1, #4\n"
+			"BEQ     loc_FFC50B1C\n"
+			"CMP     R0, #0\n"
+			"LDMEQFD SP!, {R4-R6,PC}\n"
+			"MOV     R0, R5\n"
+			"BL      sub_FFC502D4\n"
+"loc_FFC50B1C:\n"
+			"CMP     R0, #0\n"
+			"LDRNE   R1, [R4,#0x6C]\n"
+			"ORRNE   R1, R1, #2\n"
+			"STRNE   R1, [R4,#0x6C]\n"
+			"LDMFD   SP!, {R4-R6,PC}\n"
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFC507DC_my() {
+asm volatile(
+			"STMFD   SP!, {R4-R10,LR}\n"
+			"MOV     R9, R0\n"
+			"LDR     R0, =0x32350\n"
+			"MOV     R8, #0\n"
+			"ADD     R5, R0, R1,LSL#7\n"
+			"LDR     R0, [R5,#0x3C]\n"
+			"MOV     R7, #0\n"
+			"CMP     R0, #7\n"
+			"MOV     R6, #0\n"
+			"ADDLS   PC, PC, R0,LSL#2\n"
+			"B       loc_FFC50934\n"
+"loc_FFC50808:\n"
+			"B       loc_FFC50840\n"
+"loc_FFC5080C:\n"
+			"B       loc_FFC50828\n"
+"loc_FFC50810:\n"
+			"B       loc_FFC50828\n"
+"loc_FFC50814:\n"
+			"B       loc_FFC50828\n"
+"loc_FFC50818:\n"
+			"B       loc_FFC50828\n"
+"loc_FFC5081C:\n"
+			"B       loc_FFC5092C\n"
+"loc_FFC50820:\n"
+			"B       loc_FFC50828\n"
+"loc_FFC50824:\n"
+			"B       loc_FFC50828\n"
+"loc_FFC50828:\n"
+			"MOV     R2, #0\n"
+			"MOV     R1, #0x200\n"
+			"MOV     R0, #2\n"
+			"BL      sub_FFC64074\n"
+			"MOVS    R4, R0\n"
+			"BNE     loc_FFC50848\n"
+"loc_FFC50840:\n"
+			"MOV     R0, #0\n"
+			"LDMFD   SP!, {R4-R10,PC}\n"
+"loc_FFC50848:\n"
+			"LDR     R12, [R5,#0x50]\n"
+			"MOV     R3, R4\n"
+			"MOV     R2, #1\n"
+			"MOV     R1, #0\n"
+			"MOV     R0, R9\n"
+			"BLX     R12\n"
+			"CMP     R0, #1\n"
+			"BNE     loc_FFC50874\n"
+			"MOV     R0, #2\n"
+			"BL      sub_FFC641C0\n"
+			"B       loc_FFC50840\n"
+"loc_FFC50874:\n"
+			"LDR     R1, [R5,#0x64]\n"
+			"MOV     R0, R9\n"
+			"BLX     R1\n"
+
+			"MOV   R1, R4\n"           // + pointer to MBR in R1
+			"BL    mbr_read_dryos\n"   // + total sectors count in R0 before and after call
+
+			// Start of DataGhost's FAT32 autodetection code
+			// Policy: If there is a partition which has type W95 FAT32, use the first one of those for image storage
+			// According to the code below, we can use R1, R2, R3 and R12.
+			// LR wasn't really used anywhere but for storing a part of the partition signature. This is the only thing
+			// that won't work with an offset, but since we can load from LR+offset into LR, we can use this to do that :)
+			"MOV     R12, R4\n"                    // Copy the MBR start address so we have something to work with
+			"MOV     LR, R4\n"                     // Save old offset for MBR signature
+			"MOV     R1, #1\n"                     // Note the current partition number
+			"B       dg_sd_fat32_enter\n"          // We actually need to check the first partition as well, no increments yet!
+"dg_sd_fat32:\n"
+			"CMP     R1, #4\n"                     // Did we already see the 4th partition?
+			"BEQ     dg_sd_fat32_end\n"            // Yes, break. We didn't find anything, so don't change anything.
+			"ADD     R12, R12, #0x10\n"            // Second partition
+			"ADD     R1, R1, #1\n"                 // Second partition for the loop
+"dg_sd_fat32_enter:\n"
+			"LDRB    R2, [R12, #0x1BE]\n"          // Partition status
+			"LDRB    R3, [R12, #0x1C2]\n"          // Partition type (FAT32 = 0xB)
+			"CMP     R3, #0xB\n"                   // Is this a FAT32 partition?
+			"CMPNE   R3, #0xC\n"                   // Not 0xB, is it 0xC (FAT32 LBA) then?
+			"BNE     dg_sd_fat32\n"                // No, it isn't. Loop again.
+			"CMP     R2, #0x00\n"                  // It is, check the validity of the partition type
+			"CMPNE   R2, #0x80\n"
+			"BNE     dg_sd_fat32\n"                // Invalid, go to next partition
+			// This partition is valid, it's the first one, bingo!
+			"MOV     R4, R12\n"                    // Move the new MBR offset for the partition detection.
+
+"dg_sd_fat32_end:\n"
+			// End of DataGhost's FAT32 autodetection code
+
+
+			"LDRB    R1, [R4,#0x1C9]\n"
+			"LDRB    R3, [R4,#0x1C8]\n"
+			"LDRB    R12, [R4,#0x1CC]\n"
+			"MOV     R1, R1,LSL#24\n"
+			"ORR     R1, R1, R3,LSL#16\n"
+			"LDRB    R3, [R4,#0x1C7]\n"
+			"LDRB    R2, [R4,#0x1BE]\n"
+			//   "LDRB    LR, [R4,#0x1FF]\n"     // -
+			"ORR     R1, R1, R3,LSL#8\n"
+			"LDRB    R3, [R4,#0x1C6]\n"
+			"CMP     R2, #0\n"
+			"CMPNE   R2, #0x80\n"
+			"ORR     R1, R1, R3\n"
+			"LDRB    R3, [R4,#0x1CD]\n"
+			"MOV     R3, R3,LSL#24\n"
+			"ORR     R3, R3, R12,LSL#16\n"
+			"LDRB    R12, [R4,#0x1CB]\n"
+			"ORR     R3, R3, R12,LSL#8\n"
+			"LDRB    R12, [R4,#0x1CA]\n"
+			"ORR     R3, R3, R12\n"
+			//   "LDRB    R12, [R4,#0x1FE]\n"     // -
+			"LDRB    R12, [LR,#0x1FE]\n"           // + First MBR signature byte (0x55), LR is original offset.
+			"LDRB    LR, [LR,#0x1FF]\n"            // + Last MBR signature byte (0xAA), LR is original offset.
+			"BNE     loc_FFC50900\n"
+			"CMP     R0, R1\n"
+			"BCC     loc_FFC50900\n"
+			"ADD     R2, R1, R3\n"
+			"CMP     R2, R0\n"
+			"CMPLS   R12, #0x55\n"
+			"CMPEQ   LR, #0xAA\n"
+			"MOVEQ   R7, R1\n"
+			"MOVEQ   R6, R3\n"
+			"MOVEQ   R4, #1\n"
+			"BEQ     loc_FFC50904\n"
+"loc_FFC50900:\n"
+			"MOV     R4, R8\n"
+"loc_FFC50904:\n"
+			"MOV     R0, #2\n"
+			"BL      sub_FFC641C0\n"
+			"CMP     R4, #0\n"
+			"BNE     loc_FFC50940\n"
+			"LDR     R1, [R5,#0x64]\n"
+			"MOV     R7, #0\n"
+			"MOV     R0, R9\n"
+			"BLX     R1\n"
+			"MOV     R6, R0\n"
+			"B       loc_FFC50940\n"
+"loc_FFC5092C:\n"
+			"MOV     R6, #0x40\n"
+			"B       loc_FFC50940\n"
+"loc_FFC50934:\n"
+			"LDR     R1, =0x572\n"
+			"LDR     R0, =0xFFC50954\n"
+			"BL      sub_FFC0F680\n"
+"loc_FFC50940:\n"
+			"STR     R7, [R5,#0x44]!\n"
+			"STMIB   R5, {R6,R8}\n"
+			"MOV     R0, #1\n"
+			"LDMFD   SP!, {R4-R10,PC}\n"
+	);
+}
+
+
+
Index: /trunk/platform/a495/sub/100f/stubs_min.S
===================================================================
--- /trunk/platform/a495/sub/100f/stubs_min.S	(revision 1198)
+++ /trunk/platform/a495/sub/100f/stubs_min.S	(revision 1198)
@@ -0,0 +1,17 @@
+#include "stubs_asm.h"
+
+DEF(physw_status, 0x2E7F4)							// ok, Search "GpioStatus "
+DEF(physw_run, 0x1BE4 + 0x0C)						// ROM:FFC2378C
+DEF(FlashParamsTable,0xFFECF894)					// ROM:FFE0AA80
+DEF(zoom_busy, 0x5410 + 0x14)
+DEF(focus_busy, 0x532C + 8)
+DEF(canon_menu_active, 0x2A38 + 4)					// Ok ROM:FFC6A11C
+DEF(canon_shoot_menu_active, 0x36FC0)				// ?? Found on ROM:FFC77758 taskcreate_DSITask
+DEF(recreview_hold, 0x6308 + 2)						// ROM:FFD34410 
+DEF(zoom_status, 0x9628)							// "TerminateDeliverToZoomController"
+DEF(movie_status, 0x5468 + 0x38)					// Unknown
+DEF(enabled_refresh_physical_screen, 0x73AC+0x20)	// ROM:FFD7C7B4
+DEF(playrec_mode, 0x2794+0x4)						// ROM:FFC27ACC "MenuIn" ROM:FFC5D8F4
+DEF(levent_table, 0xFFEA2D14)						// Ok
+DEF(some_flag_for_af_scan, 0x5848)					// Correct? ROM:FFD0F9DC
+DEF(full_screen_refresh, 0x7370)					// ROM:FFD7A9FC, called by RefreshPhysicalScreen()
Index: /trunk/platform/a495/sub/100f/makefile.inc
===================================================================
--- /trunk/platform/a495/sub/100f/makefile.inc	(revision 1198)
+++ /trunk/platform/a495/sub/100f/makefile.inc	(revision 1198)
@@ -0,0 +1,27 @@
+#PLATFORMID=0x31EF
+PLATFORMID=12783
+
+PLATFORMOS=dryos
+
+# address where wif or diskboot code will be loaded by camera, ROM:FFC00134
+MEMBASEADDR=0x1900
+
+# size of memory region for CHDK
+RESTARTSTART=0x50000
+
+# ROM:FFC0014C
+MEMISOSTART=0x128E90
+
+# Base address 0xFFC00000 for A
+ROMBASEADDR=0xFFC00000
+
+
+PLFLAGS=-DMEMBASEADDR=$(MEMBASEADDR) -DMEMISOSTART=$(MEMISOSTART) -DMEMISOSIZE=$(MEMISOSIZE)
+PLFLAGS+=-DRESTARTSTART=$(RESTARTSTART)
+
+# type of diskboot encoding: undefined = none; 1 = original; 2 = sx200, d10; 3 = ixus200...
+# Dancing Bits
+NEED_ENCODED_DISKBOOT=4
+
+# FIR (requires correct keys in platform/fi2.inc)
+KEYSYS=d4a
Index: /trunk/platform/a495/sub/100f/stubs_asm.h
===================================================================
--- /trunk/platform/a495/sub/100f/stubs_asm.h	(revision 1198)
+++ /trunk/platform/a495/sub/100f/stubs_asm.h	(revision 1198)
@@ -0,0 +1,20 @@
+    .text
+
+#define DEF(n,a) \
+    .globl n; n = a
+
+#define NSTUB(name, addr)\
+    .globl _##name ;\
+    .weak _##name ;\
+    _##name: ;\
+	ldr  pc, = ## addr
+
+#define NHSTUB(name, addr)\
+    .globl _##name ;\
+    _##name: ;\
+	ldr  pc, = ## addr
+
+#define STUB(addr)\
+    .globl sub_ ## addr ;\
+    sub_ ## addr: ;\
+	ldr  pc, =0x ## addr
Index: /trunk/platform/a495/sub/100f/lib.c
===================================================================
--- /trunk/platform/a495/sub/100f/lib.c	(revision 1198)
+++ /trunk/platform/a495/sub/100f/lib.c	(revision 1198)
@@ -0,0 +1,53 @@
+#include "platform.h"
+#include "lolevel.h"
+
+char *hook_raw_image_addr()
+{
+	return (char*) 0x10E52420; // Ok, ROM:FFCE9A44
+}
+
+long hook_raw_size()
+{
+	return 0xEC04F0;           // "CRAW BUFF SIZE"
+}
+
+// Live picture buffer (shoot not pressed)
+void *vid_get_viewport_live_fb()
+{
+	return (void*)0;
+    /*void **fb=(void **)0x3E80;  // ?
+    unsigned char buff = *((unsigned char*)0x3CF0); // sub_FFC87F0C
+    if (buff == 0) buff = 2;  else buff--;    
+    return fb[buff];*/
+}
+
+// OSD buffer
+void *vid_get_bitmap_fb()
+{
+	return (void*)0x10361000; // "BmpDDev.c", 0xFFCD1DD4
+}
+
+// Live picture buffer (shoot half-pressed)
+void *vid_get_viewport_fb()
+{
+	return (void*)0x10648CC0;  // "VRAM Address" sub_FFCA6830
+}
+
+void *vid_get_viewport_fb_d()
+{
+	return (void*)(*(int*)(0x2540+0x54)); // sub_FFC528C0 / sub_FFC53554?
+}
+
+long vid_get_bitmap_screen_width() { return 360; }
+long vid_get_bitmap_screen_height() { return 240; }
+
+long vid_get_viewport_height() { return 240; }
+
+long vid_get_bitmap_buffer_width() { return 360; }
+long vid_get_bitmap_buffer_height() { return 240; }
+
+char *camera_jpeg_count_str()
+{
+	return (char*)0x7486C;  // "9999"
+}
+
Index: /trunk/platform/a495/sub/100f/movie_rec.c
===================================================================
--- /trunk/platform/a495/sub/100f/movie_rec.c	(revision 1198)
+++ /trunk/platform/a495/sub/100f/movie_rec.c	(revision 1198)
@@ -0,0 +1,327 @@
+#include "conf.h"
+
+int *video_quality = &conf.video_quality;
+int *video_mode    = &conf.video_mode;
+
+long def_table[24]={0x2000, 0x38D, 0x788, 0x5800, 0x9C5, 0x14B8, 0x10000, 0x1C6A, 0x3C45, 0x8000, 0xE35, 0x1E23,
+           0x1CCD, -0x2E1, -0x579, 0x4F33, -0x7EB, -0xF0C, 0xE666, -0x170A, -0x2BC6, 0x7333, -0xB85, -0x15E3};
+
+long table[24];
+
+void change_video_tables(int a, int b){
+ int i;
+ for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b; 
+}
+
+long CompressionRateTable[]={0x60, 0x5D, 0x5A, 0x57, 0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 9, 7, 6, 5, 4, 3, 2, 1};
+
+
+
+
+void __attribute__((naked,noinline)) movie_record_task(){ 
+	asm volatile(
+			"STMFD   SP!, {R2-R8,LR}\n"
+			"LDR     R8, =0x346\n"
+			"LDR     R7, =0x2710\n"
+			"LDR     R4, =0x5468\n"
+			"MOV     R6, #0\n"
+			"MOV     R5, #1\n"
+"loc_FFD0CA44:\n"
+			"LDR     R0, [R4,#0x18]\n"
+			"MOV     R2, #0\n"
+			"ADD     R1, SP, #4\n"
+			"BL      sub_FFC28AA0\n"
+			"LDR     R0, [R4,#0x20]\n"
+			"CMP     R0, #0\n"
+			"BNE     loc_FFD0CB14\n"
+			"LDR     R0, [SP,#4]\n"
+			"LDR     R1, [R0]\n"
+			"SUB     R1, R1, #2\n"
+			"CMP     R1, #9\n"
+			"ADDLS   PC, PC, R1,LSL#2\n"
+			"B       loc_FFD0CB14\n"
+			"B       loc_FFD0CAC8\n"
+			"B       loc_FFD0CAE8\n"
+			"B       loc_FFD0CAF8\n"
+			"B       loc_FFD0CB00\n"
+			"B       loc_FFD0CAD0\n"
+			"B       loc_FFD0CB08\n"
+			"B       loc_FFD0CAD8\n"
+			"B       loc_FFD0CB14\n"
+			"B       loc_FFD0CB10\n"
+			"B       loc_FFD0CAA0\n"
+"loc_FFD0CAA0:\n"
+			"LDR     R0, =0xFFD0C688\n"
+			"STR     R6, [R4,#0x34]\n"
+			"STR     R0, [R4,#0xA8]\n"
+			"LDR     R0, =0xFFD0C1C8\n"
+			"LDR     R2, =0xFFD0C0E4\n"
+			"LDR     R1, =0x6EB90\n"
+			"STR     R6, [R4,#0x24]\n"
+			"BL      sub_FFCB6668\n"
+			"STR     R5, [R4,#0x38]\n"
+			"B       loc_FFD0CB14\n"
+"loc_FFD0CAC8:\n"
+			"BL      unlock_optical_zoom\n"		//  +
+			"BL      sub_FFD0C830\n"
+			"B       loc_FFD0CB14\n"
+"loc_FFD0CAD0:\n"
+			"BL      sub_FFD0C538_my\n"			//---------->
+			"B       loc_FFD0CB14\n"
+"loc_FFD0CAD8:\n"
+			"LDR     R1, [R0,#0x10]\n"
+			"LDR     R0, [R0,#4]\n"
+			"BL      sub_FFDF8CF4\n"
+			"B       loc_FFD0CB14\n"
+"loc_FFD0CAE8:\n"
+			"LDR     R0, [R4,#0x38]\n"
+			"CMP     R0, #5\n"
+			"STRNE   R5, [R4,#0x28]\n"
+			"B       loc_FFD0CB14\n"
+"loc_FFD0CAF8:\n"
+			"BL      sub_FFD0C350\n"
+			"B       loc_FFD0CB14\n"
+"loc_FFD0CB00:\n"
+			"BL      sub_FFD0C214\n"
+			"B       loc_FFD0CB14\n"
+"loc_FFD0CB08:\n"
+			"BL      sub_FFD0C070\n"
+			"B       loc_FFD0CB14\n"
+"loc_FFD0CB10:\n"
+			"BL      sub_FFD0CC7C\n"
+"loc_FFD0CB14:\n"
+			"LDR     R1, [SP,#4]\n"
+			"LDR     R3, =0xFFD0BE50\n"
+			"STR     R6, [R1]\n"
+			"STR     R8, [SP]\n"
+			"LDR     R0, [R4,#0x1C]\n"
+			"MOV     R2, R7\n"
+			"BL      sub_FFC0F5C0\n"
+			"B       loc_FFD0CA44\n"
+	);
+}
+
+
+void __attribute__((naked,noinline)) sub_FFD0C538_my(){ 
+	asm volatile(
+			"STMFD   SP!, {R4-R8,LR}\n"
+			"SUB     SP, SP, #0x40\n"
+			"MOV     R6, #0\n"
+			"LDR     R5, =0x5468\n"
+			"MOV     R4, R0\n"
+			"STR     R6, [SP,#0x30]\n"
+			"STR     R6, [SP,#0x28]\n"
+			"LDR     R0, [R5,#0x38]\n"
+			"MOV     R8, #4\n"
+			"CMP     R0, #3\n"
+			"STREQ   R8, [R5,#0x38]\n"
+			"LDR     R0, [R5,#0xA8]\n"
+			"BLX     R0\n"
+			"LDR     R0, [R5,#0x38]\n"
+			"CMP     R0, #4\n"
+			"BNE     loc_FFD0C610\n"
+			"ADD     R3, SP, #0x28\n"
+			"ADD     R2, SP, #0x2C\n"
+			"ADD     R1, SP, #0x30\n"
+			"ADD     R0, SP, #0x34\n"
+			"BL      sub_FFDF8E88\n"
+			"CMP     R0, #0\n"
+			"MOV     R7, #1\n"
+			"BNE     loc_FFD0C5B4\n"
+			"LDR     R1, [R5,#0x28]\n"
+			"CMP     R1, #1\n"
+			"BNE     loc_FFD0C618\n"
+			"LDR     R1, [R5,#0x60]\n"
+			"LDR     R2, [R5,#0x3C]\n"
+			"CMP     R1, R2\n"
+			"BCC     loc_FFD0C618\n"
+"loc_FFD0C5B4:\n"
+			"CMP     R0, #0x80000001\n"
+			"STREQ   R8, [R5,#0x64]\n"
+			"BEQ     loc_FFD0C5EC\n"
+			"CMP     R0, #0x80000003\n"
+			"STREQ   R7, [R5,#0x64]\n"
+			"BEQ     loc_FFD0C5EC\n"
+			"CMP     R0, #0x80000005\n"
+			"MOVEQ   R0, #2\n"
+			"BEQ     loc_FFD0C5E8\n"
+			"CMP     R0, #0x80000007\n"
+			"STRNE   R6, [R5,#0x64]\n"
+			"BNE     loc_FFD0C5EC\n"
+			"MOV     R0, #3\n"
+"loc_FFD0C5E8:\n"
+			"STR     R0, [R5,#0x64]\n"
+"loc_FFD0C5EC:\n"
+			"LDR     R0, =0x6EBC0\n"
+			"LDR     R0, [R0,#8]\n"
+			"CMP     R0, #0\n"
+			"BEQ     loc_FFD0C604\n"
+			"BL      sub_FFC445C4\n"
+			"B       loc_FFD0C608\n"
+"loc_FFD0C604:\n"
+			"BL      sub_FFD0C070\n"
+"loc_FFD0C608:\n"
+			"MOV     R0, #5\n"
+			"STR     R0, [R5,#0x38]\n"
+"loc_FFD0C610:\n"
+			"ADD     SP, SP, #0x40\n"
+			"LDMFD   SP!, {R4-R8,PC}\n"
+"loc_FFD0C618:\n"
+			"LDR     LR, [SP,#0x30]\n"
+			"CMP     LR, #0\n"
+			"BEQ     loc_FFD0C6E0\n"
+			"STR     R7, [R5,#0x2C]\n"
+			"LDR     R0, [R5,#0x7C]\n"
+			"LDR     R1, [R4,#0x14]\n"
+			"LDR     R2, [R4,#0x18]\n"
+			"LDR     R12, [R4,#0xC]\n"
+			"ADD     R3, SP, #0x38\n"
+			"ADD     R8, SP, #0x14\n"
+			"STMIA   R8, {R0-R3}\n"
+			"LDR     R3, [R5,#0x68]\n"
+			"ADD     R2, SP, #0x3C\n"
+			"ADD     R8, SP, #8\n"
+			"LDRD    R0, [SP,#0x28]\n"
+			"STMIA   R8, {R0,R2,R3}\n"
+			"STR     R1, [SP,#4]\n"
+			"STR     LR, [SP]\n"
+			"LDMIB   R4, {R0,R1}\n"
+			"LDR     R3, [SP,#0x34]\n"
+			"MOV     R2, R12\n"
+			"BL      sub_FFDCE508\n"
+			"LDR     R0, [R5,#0x10]\n"
+			"LDR     R1, [R5,#0x58]\n"
+			"BL      sub_FFC0F034\n"
+			"CMP     R0, #9\n"
+			"BNE     loc_FFD0C694\n"
+			"BL      sub_FFDF9474\n"
+			"MOV     R0, #0x90000\n"
+			"STR     R7, [R5,#0x38]\n"
+			"B       loc_FFD0C6AC\n"
+"loc_FFD0C694:\n"
+			"LDR     R0, [SP,#0x38]\n"
+			"CMP     R0, #0\n"
+			"BEQ     loc_FFD0C6B4\n"
+			"BL      sub_FFDF9474\n"
+			"MOV     R0, #0xA0000\n"
+			"STR     R7, [R5,#0x38]\n"
+"loc_FFD0C6AC:\n"
+			"BL      sub_FFC6D130\n"
+			"B       loc_FFD0C610\n"
+"loc_FFD0C6B4:\n"
+			"BL      sub_FFDCE5CC\n"
+			"LDR     R0, [SP,#0x34]\n"
+			"LDR     R1, [SP,#0x3C]\n"
+			"BL      sub_FFDF921C\n"
+			"LDR     R0, [R5,#0x5C]\n"
+			"LDR     R1, =0x54E4\n"
+			"ADD     R0, R0, #1\n"
+			"STR     R0, [R5,#0x5C]\n"
+			"LDR     R0, [SP,#0x3C]\n"
+			"MOV     R2, #0\n"
+			"BL      sub_FFDF7040_my\n"  //---------->
+"loc_FFD0C6E0:\n"
+			"LDR     R0, [R5,#0x60]\n"
+			"ADD     R0, R0, #1\n"
+			"STR     R0, [R5,#0x60]\n"
+			"LDR     R1, [R5,#0x4C]\n"
+			"MUL     R0, R1, R0\n"
+			"LDR     R1, [R5,#0x48]\n"
+			"BL      sub_FFE82930\n"
+			"MOV     R4, R0\n"
+			"BL      sub_FFDF94AC\n"
+			"LDR     R1, [R5,#0x80]\n"
+			"CMP     R1, R4\n"
+			"BNE     loc_FFD0C71C\n"
+			"LDR     R0, [R5,#0x30]\n"
+			"CMP     R0, #1\n"
+			"BNE     loc_FFD0C730\n"
+"loc_FFD0C71C:\n"
+			"LDR     R1, [R5,#0x8C]\n"
+			"MOV     R0, R4\n"
+			"BLX     R1\n"
+			"STR     R4, [R5,#0x80]\n"
+			"STR     R6, [R5,#0x30]\n"
+"loc_FFD0C730:\n"
+			"STR     R6, [R5,#0x2C]\n"
+			"B       loc_FFD0C610\n"
+	);
+}
+
+void __attribute__((naked,noinline)) sub_FFDF7040_my(){ 
+	asm volatile(
+			"STMFD   SP!, {R4-R8,LR}\n"
+			"LDR     R4, =0x8940\n"
+			"LDR     LR, [R4]\n"
+			"LDR     R2, [R4,#8]\n"
+			"CMP     LR, #0\n"
+			"LDRNE   R3, [R4,#0xC]\n"
+			"MOV     R5, R2\n"
+			"CMPNE   R3, #1\n"
+			"MOVEQ   R2, #0\n"
+			"STREQ   R0, [R4]\n"
+			"STREQ   R2, [R4,#0xC]\n"
+			"BEQ     loc_FFDF710C\n"
+			"LDR     R3, [R4,#4]\n"
+			"LDR     R7, =table\n"
+			"ADD     R12, R3, R3,LSL#1\n"
+			"LDR     R3, [R7,R12,LSL#2]\n"
+			"ADD     R6, R7, #0x30\n"
+			"LDR     R8, [R6,R12,LSL#2]\n"
+			"SUB     R3, LR, R3\n"
+			"CMP     R3, #0\n"
+			"SUB     LR, LR, R8\n"
+			"BLE     loc_FFDF70C8\n"
+			"ADD     R12, R7, R12,LSL#2\n"
+			"LDR     LR, [R12,#4]\n"
+			"CMP     LR, R3\n"
+			"ADDGE   R2, R2, #1\n"
+			"BGE     loc_FFDF70BC\n"
+			"LDR     R12, [R12,#8]\n"
+			"CMP     R12, R3\n"
+			"ADDLT   R2, R2, #3\n"
+			"ADDGE   R2, R2, #2\n"
+"loc_FFDF70BC:\n"
+		//  "CMP     R2, #0x17\n"   // -
+		//  "MOVGE   R2, #0x16\n"   // -
+			"CMP     R2, #0x1A\n"   // +
+			"MOVGE   R2, #0x19\n"   // +
+			"B       loc_FFDF70FC\n"
+"loc_FFDF70C8:\n"
+			"CMP     LR, #0\n"
+			"BGE     loc_FFDF70FC\n"
+			"ADD     R3, R6, R12,LSL#2\n"
+			"LDR     R12, [R3,#4]\n"
+			"CMP     R12, LR\n"
+			"SUBLE   R2, R2, #1\n"
+			"BLE     loc_FFDF70F4\n"
+			"LDR     R3, [R3,#8]\n"
+			"CMP     R3, LR\n"
+			"SUBGT   R2, R2, #3\n"
+			"SUBLE   R2, R2, #2\n"
+"loc_FFDF70F4:\n"
+			"CMP     R2, #0\n"
+			"MOVLT   R2, #0\n"
+"loc_FFDF70FC:\n"
+			"CMP     R2, R5\n"
+			"STRNE   R2, [R4,#8]\n"
+			"MOVNE   R2, #1\n"
+			"STRNE   R2, [R4,#0xC]\n"
+"loc_FFDF710C:\n"
+			"LDR     R2, =CompressionRateTable\n"
+			"LDR     R3, [R4,#8]\n"
+			"LDR     R2, [R2,R3,LSL#2]\n"
+
+			"LDR     R3, =video_mode\n"      // +
+			"LDR     R3, [R3]\n"             // +
+			"LDR     R3, [R3]\n"             // +
+			"CMP     R3, #1\n"               // +
+			"LDREQ   R3, =video_quality\n"   // +     
+			"LDREQ   R3, [R3]\n"             // +     
+			"LDREQ   R2, [R3]\n"             // +  
+
+			"STR     R2, [R1]\n"
+			"STR     R0, [R4]\n"
+			"LDMFD   SP!, {R4-R8,PC}\n"
+	);
+}
Index: /trunk/platform/a495/sub/100f/stubs_auto.S
===================================================================
--- /trunk/platform/a495/sub/100f/stubs_auto.S	(revision 1198)
+++ /trunk/platform/a495/sub/100f/stubs_auto.S	(revision 1198)
@@ -0,0 +1,200 @@
+/* THIS FILE IS GENERATED */
+/* DO NOT EDIT THIS FILE! */
+
+#include "stubs_asm.h"
+
+STUB(FFC00358)
+STUB(FFC00B24)
+STUB(FFC0119C)
+STUB(FFC01680)
+STUB(FFC01780)
+STUB(FFC03408)
+STUB(FFC03BF4)
+STUB(FFC05A98)
+STUB(FFC05B80)
+STUB(FFC05F50)
+STUB(FFC06128)
+STUB(FFC06278)
+STUB(FFC0A2C8)
+STUB(FFC0A8D0)
+STUB(FFC0F034)
+STUB(FFC0F1A8)
+STUB(FFC0F438)
+STUB(FFC0F480)
+STUB(FFC0F4B4)
+STUB(FFC0F5C0)
+STUB(FFC0F680)
+STUB(FFC22CC0)
+STUB(FFC22CE8)
+STUB(FFC22D48)
+STUB(FFC23220)
+STUB(FFC2326C)
+STUB(FFC237C0)
+STUB(FFC237E4)
+STUB(FFC237F4)
+STUB(FFC238CC)
+STUB(FFC238D8)
+STUB(FFC249CC)
+STUB(FFC250BC)
+STUB(FFC26C78)
+STUB(FFC26CF8)
+STUB(FFC2846C)
+STUB(FFC2866C)
+STUB(FFC28750)
+STUB(FFC28810)
+STUB(FFC28844)
+STUB(FFC28AA0)
+STUB(FFC28FD4)
+STUB(FFC291C8)
+STUB(FFC2921C)
+STUB(FFC2A97C)
+STUB(FFC2ABA4)
+STUB(FFC2AC78)
+STUB(FFC2ADD0)
+STUB(FFC2AE00)
+STUB(FFC2AF6C)
+STUB(FFC2AF70)
+STUB(FFC2AF88)
+STUB(FFC2B9B4)
+STUB(FFC445C4)
+STUB(FFC455A8)
+STUB(FFC4CB54)
+STUB(FFC4FFDC)
+STUB(FFC500DC)
+STUB(FFC50244)
+STUB(FFC502D4)
+STUB(FFC506CC)
+STUB(FFC5075C)
+STUB(FFC507DC)
+STUB(FFC50978)
+STUB(FFC50ABC)
+STUB(FFC50CEC)
+STUB(FFC50E14)
+STUB(FFC50E64)
+STUB(FFC50E94)
+STUB(FFC51534)
+STUB(FFC5758C)
+STUB(FFC57984)
+STUB(FFC595E8)
+STUB(FFC597C0)
+STUB(FFC59B34)
+STUB(FFC59B3C)
+STUB(FFC59B44)
+STUB(FFC59B54)
+STUB(FFC59CEC)
+STUB(FFC59D54)
+STUB(FFC59DDC)
+STUB(FFC59EEC)
+STUB(FFC59F38)
+STUB(FFC59F74)
+STUB(FFC5A0F8)
+STUB(FFC5A3A8)
+STUB(FFC5A43C)
+STUB(FFC5C070)
+STUB(FFC5C0F0)
+STUB(FFC5C10C)
+STUB(FFC5C138)
+STUB(FFC5C14C)
+STUB(FFC5C178)
+STUB(FFC5C490)
+STUB(FFC5D830)
+STUB(FFC64074)
+STUB(FFC641C0)
+STUB(FFC6944C)
+STUB(FFC6957C)
+STUB(FFC6970C)
+STUB(FFC69944)
+STUB(FFC69E48)
+STUB(FFC69E74)
+STUB(FFC6C70C)
+STUB(FFC6D130)
+STUB(FFC80C58)
+STUB(FFC80EE0)
+STUB(FFC80F4C)
+STUB(FFC811DC)
+STUB(FFC8169C)
+STUB(FFC81724)
+STUB(FFC81954)
+STUB(FFC81E04)
+STUB(FFC8914C)
+STUB(FFC8DE54)
+STUB(FFC8DF64)
+STUB(FFC8DFBC)
+STUB(FFC8E014)
+STUB(FFC8E06C)
+STUB(FFC8E0F0)
+STUB(FFC8E230)
+STUB(FFC8E2E8)
+STUB(FFC8E56C)
+STUB(FFC8E774)
+STUB(FFC8E9EC)
+STUB(FFC8EBE4)
+STUB(FFC8EEA0)
+STUB(FFC8EFE0)
+STUB(FFC8F338)
+STUB(FFC8F4E0)
+STUB(FFC8F7D4)
+STUB(FFC8F8D8)
+STUB(FFC8FB14)
+STUB(FFC8FC90)
+STUB(FFC8FE2C)
+STUB(FFC8FF90)
+STUB(FFC9026C)
+STUB(FFC9130C)
+STUB(FFC915A4)
+STUB(FFC91604)
+STUB(FFC91894)
+STUB(FFC9295C)
+STUB(FFC9298C)
+STUB(FFC929D0)
+STUB(FFC92B3C)
+STUB(FFC92BE8)
+STUB(FFC92C88)
+STUB(FFC92D24)
+STUB(FFCB6668)
+STUB(FFCB8140)
+STUB(FFCF0788)
+STUB(FFCF081C)
+STUB(FFD085BC)
+STUB(FFD08710)
+STUB(FFD08844)
+STUB(FFD0C070)
+STUB(FFD0C214)
+STUB(FFD0C350)
+STUB(FFD0C538)
+STUB(FFD0C830)
+STUB(FFD0CC7C)
+STUB(FFD0FAFC)
+STUB(FFD0FB4C)
+STUB(FFD0FB88)
+STUB(FFD0FE90)
+STUB(FFD100BC)
+STUB(FFD102B4)
+STUB(FFD10348)
+STUB(FFD10408)
+STUB(FFD104D4)
+STUB(FFD10518)
+STUB(FFD10600)
+STUB(FFD10750)
+STUB(FFD107E0)
+STUB(FFD108A0)
+STUB(FFD10E04)
+STUB(FFD10ECC)
+STUB(FFD10F80)
+STUB(FFD11158)
+STUB(FFD111A4)
+STUB(FFD11820)
+STUB(FFD119B4)
+STUB(FFD12020)
+STUB(FFD2F710)
+STUB(FFDCE508)
+STUB(FFDCE5CC)
+STUB(FFDF7040)
+STUB(FFDF8CF4)
+STUB(FFDF8E88)
+STUB(FFDF921C)
+STUB(FFDF9474)
+STUB(FFDF94AC)
+STUB(FFE80E24)
+STUB(FFE81080)
+STUB(FFE82930)
Index: /trunk/platform/a495/sub/100f/Makefile
===================================================================
--- /trunk/platform/a495/sub/100f/Makefile	(revision 1198)
+++ /trunk/platform/a495/sub/100f/Makefile	(revision 1198)
@@ -0,0 +1,6 @@
+topdir=../../../../
+
+OBJS=boot.o stubs_min.o stubs_auto.o stubs_entry.o lib.o stubs_entry_2.o capt_seq.o movie_rec.o
+STUBS_AUTO_DEPS=boot.c capt_seq.c movie_rec.c
+
+include  $(topdir)platform/makefile_sub.inc
Index: /trunk/platform/a495/sub/Makefile
===================================================================
--- /trunk/platform/a495/sub/Makefile	(revision 1198)
+++ /trunk/platform/a495/sub/Makefile	(revision 1198)
@@ -0,0 +1,8 @@
+topdir=../../../
+include $(topdir)makefile.inc
+
+SUBDIRS=$(PLATFORMSUB)
+
+all: all-recursive
+
+clean: clean-recursive
Index: /trunk/platform/a495/shooting.c
===================================================================
--- /trunk/platform/a495/shooting.c	(revision 1198)
+++ /trunk/platform/a495/shooting.c	(revision 1198)
@@ -0,0 +1,131 @@
+#define PARAM_FILE_COUNTER      0x3A
+#define PARAM_EXPOSURE_COUNTER  0x02
+
+#include "platform.h"
+
+const ApertureSize aperture_sizes_table[] = {
+    {  9, 294, "2.8" },
+    { 10, 320, "3.2" },
+    { 11, 352, "3.5" },
+    { 12, 384, "4.0" },
+    { 13, 416, "4.5" },
+    { 14, 448, "5.0" },
+    { 15, 480, "5.6" },
+    { 16, 512, "6.3" },
+    { 17, 544, "7.1" },
+    { 18, 576, "8.0" },
+};
+
+const ShutterSpeed shutter_speeds_table[] = {
+    { -12, -384, "15", 15000000 },
+    { -11, -352, "13", 13000000 },
+    { -10, -320, "10", 10000000 },
+    {  -9, -288, "8",   8000000 },
+    {  -8, -256, "6",   6000000 },
+    {  -7, -224, "5",   5000000 },
+    {  -6, -192, "4",   4000000 },
+    {  -5, -160, "3.2", 3200000 },
+    {  -4, -128, "2.5", 2500000 },
+    {  -3,  -96, "2",   2000000 },
+    {  -2,  -64, "1.6", 1600000 },
+    {  -1,  -32, "1.3", 1300000 },
+    {   0,    0, "1",   1000000 },
+    {   1,   32, "0.8",  800000 },
+    {   2,   64, "0.6",  600000 },
+    {   3,   96, "0.5",  500000 },
+    {   4,  128, "0.4",  400000 },
+    {   5,  160, "0.3",  300000 },
+    {   6,  192, "1/4",  250000 },
+    {   7,  224, "1/5",  200000 },
+    {   8,  256, "1/6",  166667 },
+    {   9,  288, "1/8",  125000 },
+    {  10,  320, "1/10", 100000 },
+    {  11,  352, "1/13",  76923 },
+    {  12,  384, "1/15",  66667 },
+    {  13,  416, "1/20",  50000 },
+    {  14,  448, "1/25",  40000 },
+    {  15,  480, "1/30",  33333 },
+    {  16,  512, "1/40",  25000 },
+    {  17,  544, "1/50",  20000 },
+    {  18,  576, "1/60",  16667 },
+    {  19,  608, "1/80",  12500 },
+    {  20,  640, "1/100", 10000 },
+    {  21,  672, "1/125",  8000 },
+    {  22,  704, "1/160",  6250 },
+    {  23,  736, "1/200",  5000 },
+    {  24,  768, "1/250",  4000 },
+    {  25,  800, "1/320",  3125 },
+    {  26,  832, "1/400",  2500 },
+    {  27,  864, "1/500",  2000 },
+    {  28,  896, "1/640",  1563 },
+    {  29,  928, "1/800",  1250 },
+    {  30,  960, "1/1000", 1000 },
+    {  31,  992, "1/1250",  800 },
+    {  32, 1024, "1/1600",  625 },
+    {  33, 1056, "1/2000",  500 },
+    {  34, 1088, "1/2500",  400 },
+    {  35, 1120, "1/3200",  313 },
+};
+
+const ISOTable iso_table[] = {
+    {  0,    0, "Auto", -1},
+    {  1,   80,   "80", -1},
+    {  2,  100,  "100", -1},
+    {  3,  200,  "200", -1},
+    {  4,  400,  "400", -1},
+    {  5,  800,  "800", -1},
+    {  6, 1600, "1600", -1},
+};          
+
+static const CapturemodeMap modemap[] = {
+    { MODE_AUTO,               32768  },
+    { MODE_P,                  32772  },
+
+    { MODE_VIDEO_STD,          2598   }, 
+
+    { MODE_SCN_PORTRAIT,       16397  },
+    { MODE_SCN_NIGHT_SCENE,    16395  },
+    { MODE_SCN_KIDS_PETS,      16400  },
+    { MODE_SCN_INDOOR,         16401  },
+    { MODE_SCN_SUNSET,         16402  },
+    { MODE_SCN_FIREWORK,       16406  },
+    { MODE_SCN_LONG_SHUTTER,   16390  },
+    { MODE_SCN_BEACH,          16405  },
+    { MODE_SCN_AQUARIUM,       16408  },
+    { MODE_SCN_FOLIAGE,        16403  },
+    { MODE_SCN_SNOW,           16404  },
+    { MODE_SUPER_MACRO,        16905  },
+ };
+
+#include "../generic/shooting.c"
+
+long get_file_next_counter() {
+    return get_file_counter();
+}
+
+long get_target_file_num() {
+    long n;
+
+    n = get_file_next_counter();
+    n = (n>>4)&0x3FFF;
+    return n;
+}
+
+#if defined(CAM_DATE_FOLDER_NAMING)
+void get_target_dir_name(char *out) {
+    extern void _GetImageFolder(char*,int,int,int);
+    out[0] = 'A';
+    _GetImageFolder(out+1,get_file_next_counter(),CAM_DATE_FOLDER_NAMING,time(NULL));
+    out[15] = '\0';
+}
+#else
+long get_target_dir_num() {
+    long n;
+
+    n = get_file_next_counter();
+    n = (n>>18)&0x3FF;
+    return n;
+}
+#endif
+
+int circle_of_confusion = 5;
Index: /trunk/platform/a495/Makefile
===================================================================
--- /trunk/platform/a495/Makefile	(revision 1198)
+++ /trunk/platform/a495/Makefile	(revision 1198)
@@ -0,0 +1,25 @@
+curdir=./
+topdir=../../
+
+include $(topdir)makefile.inc
+
+CFLAGS+=-DLOW_LEVEL
+
+SUBDIRS=sub
+
+all: all-recursive libplatform.a
+
+OBJS=main.o lib.o wrappers.o kbd.o shooting.o
+# stubs_init.o
+
+kbd.o: kbd.c
+lib.o: lib.c
+main.o: main.c
+shooting.o: shooting.c ../generic/shooting.c
+wrappers.o: wrappers.c ../generic/wrappers.c
+
+libplatform.a: $(OBJS)
+
+clean: clean-recursive
+	rm -f $(OBJS) libplatform.a
+
Index: /trunk/makefile.inc
===================================================================
--- /trunk/makefile.inc	(revision 1197)
+++ /trunk/makefile.inc	(revision 1198)
@@ -235,4 +235,13 @@
 #PLATFORM=a470
 #PLATFORMSUB=101b
+
+#PLATFORM=a495
+#PLATFORMSUB=100d
+
+#PLATFORM=a495
+#PLATFORMSUB=100e
+
+#PLATFORM=a495
+#PLATFORMSUB=100f
 
 #PLATFORM=ixus980_sd990
Index: /trunk/core/kbd.c
===================================================================
--- /trunk/core/kbd.c	(revision 1197)
+++ /trunk/core/kbd.c	(revision 1198)
@@ -41,5 +41,5 @@
 #endif
 
-#if defined(CAMERA_a450) || defined(CAMERA_ixus50_sd400) || defined(CAMERA_ixusizoom_sd30) || defined(CAMERA_ixus40_sd300) || defined(CAMERA_ixus55_sd450) || defined(CAMERA_ixus60_sd600) || defined(CAMERA_ixus65_sd630) || defined(CAMERA_ixus70_sd1000) || defined(CAMERA_ixus700_sd500) || defined(CAMERA_ixus750_sd550) || defined(CAMERA_ixus850_sd800) || defined(CAMERA_ixus900_sd900) || defined(CAMERA_ixus75_sd750) || defined(CAMERA_a470) || defined(CAMERA_ixus90_sd790) || defined(CAMERA_ixus100_sd780) || defined(CAMERA_ixus120_sd940) || defined(CAMERA_a480) || defined(CAMERA_d10) || defined(CAMERA_ixus85_sd770) || defined(CAMERA_ixus95_sd1200) || defined(CAMERA_a580) || defined(CAMERA_ixus300_sd4000)
+#if defined(CAMERA_a450) || defined(CAMERA_ixus50_sd400) || defined(CAMERA_ixusizoom_sd30) || defined(CAMERA_ixus40_sd300) || defined(CAMERA_ixus55_sd450) || defined(CAMERA_ixus60_sd600) || defined(CAMERA_ixus65_sd630) || defined(CAMERA_ixus70_sd1000) || defined(CAMERA_ixus700_sd500) || defined(CAMERA_ixus750_sd550) || defined(CAMERA_ixus850_sd800) || defined(CAMERA_ixus900_sd900) || defined(CAMERA_ixus75_sd750) || defined(CAMERA_a470) || defined(CAMERA_ixus90_sd790) || defined(CAMERA_ixus100_sd780) || defined(CAMERA_ixus120_sd940) || defined(CAMERA_a480) || defined(CAMERA_a495) || defined(CAMERA_d10) || defined(CAMERA_ixus85_sd770) || defined(CAMERA_ixus95_sd1200) || defined(CAMERA_a580)
 #define ZSTEP_TABLE_SIZE 7
 static int nTxtbl[]={0,1,2,3,4,5,6};    // remote zoom steps (we need a distinct number of steps, even if the camera zooms smoothly)
Index: /trunk/loader/a495/blobs.S
===================================================================
--- /trunk/loader/a495/blobs.S	(revision 1198)
+++ /trunk/loader/a495/blobs.S	(revision 1198)
@@ -0,0 +1,28 @@
+    .globl blob_copy_and_reset, blob_copy_and_reset_size
+    .globl blob_chdk_core, blob_chdk_core_size
+
+
+    .section .blob_copy_and_reset
+blob_copy_and_reset_start:
+    .incbin RESET_FILE
+blob_copy_and_reset_end:
+
+
+
+    .section .blob_chdk_core
+blob_chdk_core_start:
+    .incbin CORE_FILE
+blob_chdk_core_end:
+
+
+    .text
+blob_chdk_core_size:
+    .long blob_chdk_core_end - blob_chdk_core_start
+blob_chdk_core:
+    .long blob_chdk_core_start
+
+
+blob_copy_and_reset_size:
+    .long blob_copy_and_reset_end - blob_copy_and_reset_start
+blob_copy_and_reset:
+    .long blob_copy_and_reset_start
Index: /trunk/loader/a495/entry.S
===================================================================
--- /trunk/loader/a495/entry.S	(revision 1198)
+++ /trunk/loader/a495/entry.S	(revision 1198)
@@ -0,0 +1,19 @@
+    .section .entry
+
+// ROM:FFFF1070, Turn OFF SD Card power
+// to support autostart
+	LDR     R3, =0xC022007C
+	MOV     R2, #0x44
+	STR     R2, [R3]
+	
+// looks like idle cycle is required for proper shutdown
+	MOV     R3, #0x8000
+1:
+	SUB	    R3, R3, #1
+	CMP	    R3, #0
+	BNE	    1b
+
+// ordinary startup...
+	MOV     SP, #0x1900
+	MOV     R11, #0
+	B	    my_restart
Index: /trunk/loader/a495/main.c
===================================================================
--- /trunk/loader/a495/main.c	(revision 1198)
+++ /trunk/loader/a495/main.c	(revision 1198)
@@ -0,0 +1,62 @@
+static void __attribute__((noreturn)) shutdown();
+static void __attribute__((noreturn)) panic(int cnt);
+
+extern long *blob_chdk_core;
+extern long *blob_copy_and_reset;
+extern long blob_chdk_core_size;
+extern long blob_copy_and_reset_size;
+
+
+void __attribute__((noreturn)) my_restart() 
+{
+    void __attribute__((noreturn)) (*copy_and_restart)(char *dst, char *src, long length);
+    int i;
+
+    for (i=0; i<(blob_copy_and_reset_size/sizeof(long)); i++){
+	    ((long*)(RESTARTSTART))[i] = blob_copy_and_reset[i];
+    }
+
+    copy_and_restart = (void*)RESTARTSTART;
+    copy_and_restart((void*)MEMISOSTART, (char*)blob_chdk_core, blob_chdk_core_size);
+}
+
+//#define LED_PR 0xC0220080 // AF LED
+#define LED_PR 0xC0220088 // Green LED
+
+static void __attribute__((noreturn)) shutdown()
+{
+    volatile long *p = (void*)LED_PR;       // turned off later, so assumed to be power
+        
+    asm(
+         "MRS     R1, CPSR\n"
+         "AND     R0, R1, #0x80\n"
+         "ORR     R1, R1, #0x80\n"
+         "MSR     CPSR_cf, R1\n"
+         :::"r1","r0");
+        
+    *p = 0x44;  // led off.
+
+    while(1);
+}
+
+
+static void __attribute__((noreturn)) panic(int cnt)
+{
+	volatile long *p=(void*)LED_PR;
+	int i;
+
+	for(;cnt>0;cnt--){
+		p[0]=0x46;
+
+		for(i=0;i<0x200000;i++){
+			asm ("nop\n");
+			asm ("nop\n");
+		}
+		p[0]=0x44;
+		for(i=0;i<0x200000;i++){
+			asm ("nop\n");
+			asm ("nop\n");
+		}
+	}
+	shutdown();
+}
Index: /trunk/loader/a495/Makefile
===================================================================
--- /trunk/loader/a495/Makefile	(revision 1198)
+++ /trunk/loader/a495/Makefile	(revision 1198)
@@ -0,0 +1,42 @@
+curdir=./
+topdir=../../
+
+include $(topdir)makefile.inc
+SUBDIRS=resetcode
+
+LDLIBS=
+LDOPTS=-nostdlib -Wl,--allow-shlib-undefined -Wl,--no-define-common,-EL,-T,$(topdir)tools/link-boot.ld
+LDOPTS+=-Wl,-N,-Ttext,$(MEMBASEADDR)
+
+CPPFLAGS+=-I.
+
+CORE_FILE=$(topdir)core/main.bin
+RESET_FILE=$(curdir)resetcode/main.bin
+
+CPPFLAGS+=-DCORE_FILE=\"$(CORE_FILE)\"
+CPPFLAGS+=-DRESET_FILE=\"$(RESET_FILE)\"
+
+all: all-recursive main.bin
+
+OBJS=entry.o main.o blobs.o
+
+main.bin: main.elf
+	@echo $< \-\> $@
+	$(OBJDUMP) -z -d main.elf > main.dump
+	$(OBJCOPY) -O binary main.elf main.bin
+
+main.elf: $(OBJS)
+	@echo \-\> $@
+	$(CC) $(CFLAGS) -o $@ $^   $(LDLIBS) $(LDFLAGS) $(LDOPTS)
+	( $(NM) $@ | grep ' U ' > $@.syms ) && exit 1 || exit 0
+
+clean: clean-recursive
+	rm -f $(OBJS) main.bin main.elf main.dump main.elf.syms
+
+distclean: distclean-recursive
+	rm -f $(OBJS) main.bin main.elf main.dump main.elf.syms
+	rm -f reboot_core.h copy_and_reset.h
+
+blobs.o: $(RESET_FILE) $(CORE_FILE)
+
+include $(topdir)bottom.inc
Index: /trunk/loader/a495/resetcode/entry.S
===================================================================
--- /trunk/loader/a495/resetcode/entry.S	(revision 1198)
+++ /trunk/loader/a495/resetcode/entry.S	(revision 1198)
@@ -0,0 +1,6 @@
+	.section .entry
+
+	MOV     SP, #0x1900
+	MOV     R11, #0
+	B	copy_and_restart
+
Index: /trunk/loader/a495/resetcode/main.c
===================================================================
--- /trunk/loader/a495/resetcode/main.c	(revision 1198)
+++ /trunk/loader/a495/resetcode/main.c	(revision 1198)
@@ -0,0 +1,92 @@
+/*
+ * Operating system has died. Known functions will be killed
+ * after memmove.
+ *
+ * Make sure stack is not used.
+ */
+
+void __attribute__((noreturn)) copy_and_restart(void *dst_void, const void *src_void, long length) {
+	// DEBUG LED STUFF
+	//#define DEBUG_LED (void*)0xC0220088    // Green Led at the backside
+    //#define DEBUG_LED_DELAY 10000000
+    //volatile long *pDebugLed = (void*)DEBUG_LED;
+    //int DebugLedCounter;// DEBUG: blink led
+    //DebugLedCounter = DEBUG_LED_DELAY; *pDebugLed = 0x46;  while (DebugLedCounter--) { asm("nop\n nop\n"); };
+    //DebugLedCounter = DEBUG_LED_DELAY; *pDebugLed = 0x44;  while (DebugLedCounter--) { asm("nop\n nop\n"); };
+
+	{
+		char *dst = dst_void;
+		const char *src = src_void;
+
+		if (src < dst && dst < src + length)
+		{
+			/* Have to copy backwards */
+			src += length;
+			dst += length;
+			while (length--)
+			{
+				*--dst = *--src;
+			}
+		}
+		else
+		{
+			while (length--)
+			{
+			*dst++ = *src++;
+			}
+		}
+	}
+    
+    // ROM:FFC2AAB0 resetcode here:
+    // search for "0x12345678"
+	asm volatile (
+			 "MRS     R0, CPSR\n"
+			 "BIC     R0, R0, #0x3F\n"
+			 "ORR     R0, R0, #0xD3\n"
+			 "MSR     CPSR, R0\n"
+			 "LDR     R1, =0xC0200000\n"
+			 "MOV     R0, #0xFFFFFFFF\n"
+			 "STR     R0, [R1,#0x10C]\n"
+			 "STR     R0, [R1,#0xC]\n"
+			 "STR     R0, [R1,#0x1C]\n"
+			 "STR     R0, [R1,#0x2C]\n"
+			 "STR     R0, [R1,#0x3C]\n"
+			 "STR     R0, [R1,#0x4C]\n"
+			 "STR     R0, [R1,#0x5C]\n"
+			 "STR     R0, [R1,#0x6C]\n"
+			 "STR     R0, [R1,#0x7C]\n"
+			 "STR     R0, [R1,#0x8C]\n"
+			 "STR     R0, [R1,#0x9C]\n"
+			 "STR     R0, [R1,#0xAC]\n"
+			 "STR     R0, [R1,#0xBC]\n"
+			 "STR     R0, [R1,#0xCC]\n"
+			 "STR     R0, [R1,#0xDC]\n"
+			 "STR     R0, [R1,#0xEC]\n"
+			 "CMP     R4, #7\n"
+			 "STR     R0, [R1,#0xFC]\n"
+			 "LDMEQFD SP!, {R4,PC}\n"
+			 "MOV     R0, #0x78\n"
+			 "MCR     p15, 0, R0,c1,c0\n"
+			 "MOV     R0, #0\n"
+			 "MCR     p15, 0, R0,c7,c10, 4\n"
+			 "MCR     p15, 0, R0,c7,c5\n"
+			 "MCR     p15, 0, R0,c7,c6\n"
+			 "MOV     R0, #0x40000006\n"
+			 "MCR     p15, 0, R0,c9,c1\n"
+			 "MCR     p15, 0, R0,c9,c1, 1\n"
+			 "MRC     p15, 0, R0,c1,c0\n"
+			 "ORR     R0, R0, #0x50000\n"
+			 "MCR     p15, 0, R0,c1,c0\n"
+			 "LDR     R0, =0x12345678\n"
+			 "MOV     R1, #0x40000000\n"
+			 "STR     R0, [R1,#0xFFC]\n"
+		//   "LDR     R0, =loc_FFC00000\n"   // -
+			 "MOV     R0, %0\n"              // new jump-vector
+			 "LDMFD   SP!, {R4,LR}\n"
+			 "BX      R0\n"
+
+
+			 : : "r"(dst_void) : "memory","r0","r1","r2","r3","r4");
+
+        while(1);
+}
Index: /trunk/loader/a495/resetcode/Makefile
===================================================================
--- /trunk/loader/a495/resetcode/Makefile	(revision 1198)
+++ /trunk/loader/a495/resetcode/Makefile	(revision 1198)
@@ -0,0 +1,30 @@
+topdir=../../../
+
+include $(topdir)makefile.inc
+
+# 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)
+
+all: main.bin
+
+OBJS=entry.o main.o
+
+main.bin: main.elf
+	@echo $< \-\> $@
+	$(OBJDUMP) -z -d main.elf > main.dump
+	$(OBJCOPY) -O binary main.elf main.bin
+
+main.elf: $(OBJS)
+	@echo \-\> $@
+	$(CC) $(CFLAGS) -o $@ $^   $(LDLIBS) $(LDFLAGS) $(LDOPTS)
+	( $(NM) $@ | grep ' U ' > $@.syms ) && exit 1 || exit 0
+
+clean: clean-recursive
+	rm -f $(OBJS) main.bin main.elf main.dump main.elf.syms
+
+distclean: distclean-recursive
+	rm -f $(OBJS) main.bin main.elf main.dump main.elf.syms
+
+include $(topdir)bottom.inc
Index: /trunk/Makefile
===================================================================
--- /trunk/Makefile	(revision 1197)
+++ /trunk/Makefile	(revision 1198)
@@ -247,4 +247,7 @@
 	$(MAKE) -s --no-print-directory PLATFORM=ixus120_sd940  PLATFORMSUB=103c NO_INC_BUILD=1 firzipsub
 	$(MAKE) -s --no-print-directory PLATFORM=a480  PLATFORMSUB=100b NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a495  PLATFORMSUB=100d NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a495  PLATFORMSUB=100e NO_INC_BUILD=1 firzipsub
+	$(MAKE) -s --no-print-directory PLATFORM=a495  PLATFORMSUB=100f NO_INC_BUILD=1 firzipsub
 	$(MAKE) -s --no-print-directory PLATFORM=s90  PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub
 	$(MAKE) -s --no-print-directory PLATFORM=s90  PLATFORMSUB=101a NO_INC_BUILD=1 firzipsub
@@ -315,4 +318,7 @@
 	mv $(topdir)bin/$(VER)-s95-100i-$(BUILD_NUMBER).zip $(topdir)bin/s95-100i-$(BUILD_NUMBER)_BETA.zip
 	mv $(topdir)bin/$(VER)-ixus750_sd550-100h-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-ixus750_sd550-100h-$(BUILD_NUMBER)_BETA.zip
+	mv $(topdir)bin/$(VER)-a495-100d-$(BUILD_NUMBER).zip $(topdir)bin/a495-100d-$(BUILD_NUMBER)_BETA.zip
+	mv $(topdir)bin/$(VER)-a495-100e-$(BUILD_NUMBER).zip $(topdir)bin/a495-100e-$(BUILD_NUMBER)_BETA.zip
+	mv $(topdir)bin/$(VER)-a495-100f-$(BUILD_NUMBER).zip $(topdir)bin/a495-100f-$(BUILD_NUMBER)_BETA.zip
 	@echo "**** Done Copying duplicate Firmwares"
 	@echo "**** Summary of memisosizes"
@@ -424,4 +430,7 @@
 	$(MAKE) -s --no-print-directory PLATFORM=ixus120_sd940  PLATFORMSUB=103c NO_INC_BUILD=1 firzipsubcomplete
 	$(MAKE) -s --no-print-directory PLATFORM=a480  PLATFORMSUB=100b NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a495  PLATFORMSUB=100d NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a495  PLATFORMSUB=100e NO_INC_BUILD=1 firzipsubcomplete
+	$(MAKE) -s --no-print-directory PLATFORM=a495  PLATFORMSUB=100f NO_INC_BUILD=1 firzipsubcomplete
 	$(MAKE) -s --no-print-directory PLATFORM=s90  PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete
 	$(MAKE) -s --no-print-directory PLATFORM=s90  PLATFORMSUB=101a NO_INC_BUILD=1 firzipsubcomplete
@@ -538,4 +547,10 @@
 	mv $(topdir)bin/ixus750_sd550-100h-$(BUILD_NUMBER).zip $(topdir)bin/ixus750_sd550-100h-$(BUILD_NUMBER)_BETA.zip
 	mv $(topdir)bin/ixus750_sd550-100h-$(BUILD_NUMBER)-full.zip $(topdir)bin/ixus750_sd550-100h-$(BUILD_NUMBER)-full_BETA.zip
+	mv $(topdir)bin/a495-100d-$(BUILD_NUMBER).zip $(topdir)bin/a495-100d-$(BUILD_NUMBER)_BETA.zip
+	mv $(topdir)bin/a495-100e-$(BUILD_NUMBER).zip $(topdir)bin/a495-100e-$(BUILD_NUMBER)_BETA.zip
+	mv $(topdir)bin/a495-100f-$(BUILD_NUMBER).zip $(topdir)bin/a495-100f-$(BUILD_NUMBER)_BETA.zip
+	mv $(topdir)bin/a495-100d-$(BUILD_NUMBER)-full.zip $(topdir)bin/a495-100d-$(BUILD_NUMBER)-full_BETA.zip
+	mv $(topdir)bin/a495-100e-$(BUILD_NUMBER)-full.zip $(topdir)bin/a495-100e-$(BUILD_NUMBER)-full_BETA.zip
+	mv $(topdir)bin/a495-100f-$(BUILD_NUMBER)-full.zip $(topdir)bin/a495-100f-$(BUILD_NUMBER)-full_BETA.zip
 	@echo "**** Done Copying duplicate Firmwares"
 	@echo "**** Summary of memisosizes"
@@ -643,4 +658,7 @@
 	$(MAKE) -s --no-print-directory PLATFORM=ixus120_sd940  PLATFORMSUB=103c NO_INC_BUILD=1 clean
 	$(MAKE) -s --no-print-directory PLATFORM=a480  PLATFORMSUB=100b NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a495  PLATFORMSUB=100d NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a495  PLATFORMSUB=100e NO_INC_BUILD=1 clean
+	$(MAKE) -s --no-print-directory PLATFORM=a495  PLATFORMSUB=100f NO_INC_BUILD=1 clean
 	$(MAKE) -s --no-print-directory PLATFORM=s90  PLATFORMSUB=100c NO_INC_BUILD=1 clean
 	$(MAKE) -s --no-print-directory PLATFORM=s90  PLATFORMSUB=101a NO_INC_BUILD=1 clean
