root/platform/ixus145_elph135/sub/100c/boot.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. CreateTask_spytask
  2. boot
  3. CreateTask_my
  4. sub_FF8203C4_my
  5. sub_FF8228DC_my
  6. sub_FF8248DC_my
  7. sub_FF827C18_my
  8. task_Startup_my
  9. taskcreatePhySw_my
  10. init_file_modules_task
  11. init_required_fw_features

   1 /*
   2  * boot.c - auto-generated by CHDK code_gen.
   3  */
   4 #include "lolevel.h"
   5 #include "platform.h"
   6 #include "core.h"
   7 #include "dryos31.h"
   8 
   9 #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
  10 
  11 const char * const new_sa = &_end;
  12 
  13 /*----------------------------------------------------------------------
  14     CreateTask_spytask
  15 -----------------------------------------------------------------------*/
  16 void CreateTask_spytask()
  17 {
  18     _CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
  19 }
  20 
  21 /*----------------------------------------------------------------------
  22     boot()
  23 
  24     Main entry point for the CHDK code
  25 -----------------------------------------------------------------------*/
  26 
  27 /*************************************************************/
  28 //** boot @ 0xFF82000C - 0xFF82017C, length=93
  29 void __attribute__((naked,noinline)) boot() {
  30 asm volatile (
  31 "    LDR     R1, =0xC0410000 \n"
  32 "    MOV     R0, #0 \n"
  33 "    STR     R0, [R1] \n"
  34 "    MOV     R1, #0x78 \n"
  35 "    MCR     p15, 0, R1, c1, c0 \n"
  36 "    MOV     R1, #0 \n"
  37 "    MCR     p15, 0, R1, c7, c10, 4 \n"
  38 "    MCR     p15, 0, R1, c7, c5 \n"
  39 "    MCR     p15, 0, R1, c7, c6 \n"
  40 "    MOV     R0, #0x3D \n"
  41 "    MCR     p15, 0, R0, c6, c0 \n"
  42 "    MOV     R0, #0xC000002F \n"
  43 "    MCR     p15, 0, R0, c6, c1 \n"
  44 "    MOV     R0, #0x35 \n"
  45 "    MCR     p15, 0, R0, c6, c2 \n"
  46 "    MOV     R0, #0x40000035 \n"
  47 "    MCR     p15, 0, R0, c6, c3 \n"
  48 "    MOV     R0, #0x80000017 \n"
  49 "    MCR     p15, 0, R0, c6, c4 \n"
  50 "    LDR     R0, =0xFF80002D \n"
  51 "    MCR     p15, 0, R0, c6, c5 \n"
  52 "    MOV     R0, #0x34 \n"
  53 "    MCR     p15, 0, R0, c2, c0 \n"
  54 "    MOV     R0, #0x34 \n"
  55 "    MCR     p15, 0, R0, c2, c0, 1 \n"
  56 "    MOV     R0, #0x34 \n"
  57 "    MCR     p15, 0, R0, c3, c0 \n"
  58 "    LDR     R0, =0x3333330 \n"
  59 "    MCR     p15, 0, R0, c5, c0, 2 \n"
  60 "    LDR     R0, =0x3333330 \n"
  61 "    MCR     p15, 0, R0, c5, c0, 3 \n"
  62 "    MRC     p15, 0, R0, c1, c0 \n"
  63 "    ORR     R0, R0, #0x1000 \n"
  64 "    ORR     R0, R0, #4 \n"
  65 "    ORR     R0, R0, #1 \n"
  66 "    MCR     p15, 0, R0, c1, c0 \n"
  67 "    MOV     R1, #0x80000006 \n"
  68 "    MCR     p15, 0, R1, c9, c1 \n"
  69 "    MOV     R1, #6 \n"
  70 "    MCR     p15, 0, R1, c9, c1, 1 \n"
  71 "    MRC     p15, 0, R1, c1, c0 \n"
  72 "    ORR     R1, R1, #0x50000 \n"
  73 "    MCR     p15, 0, R1, c1, c0 \n"
  74 "    LDR     R2, =0xC0200000 \n"
  75 "    MOV     R1, #1 \n"
  76 "    STR     R1, [R2, #0x10C] \n"
  77 "    MVN     R1, #0 \n"
  78 "    STR     R1, [R2, #0xC] \n"
  79 "    STR     R1, [R2, #0x1C] \n"
  80 "    STR     R1, [R2, #0x2C] \n"
  81 "    STR     R1, [R2, #0x3C] \n"
  82 "    STR     R1, [R2, #0x4C] \n"
  83 "    STR     R1, [R2, #0x5C] \n"
  84 "    STR     R1, [R2, #0x6C] \n"
  85 "    STR     R1, [R2, #0x7C] \n"
  86 "    STR     R1, [R2, #0x8C] \n"
  87 "    STR     R1, [R2, #0x9C] \n"
  88 "    STR     R1, [R2, #0xAC] \n"
  89 "    STR     R1, [R2, #0xBC] \n"
  90 "    STR     R1, [R2, #0xCC] \n"
  91 "    STR     R1, [R2, #0xDC] \n"
  92 "    STR     R1, [R2, #0xEC] \n"
  93 "    STR     R1, [R2, #0xFC] \n"
  94 "    LDR     R1, =0xC0400008 \n"
  95 "    LDR     R2, =0x430005 \n"
  96 "    STR     R2, [R1] \n"
  97 "    MOV     R1, #1 \n"
  98 "    LDR     R2, =0xC0243100 \n"
  99 "    STR     R2, [R1] \n"
 100 "    LDR     R2, =0xC0242010 \n"
 101 "    LDR     R1, [R2] \n"
 102 "    ORR     R1, R1, #1 \n"
 103 "    STR     R1, [R2] \n"
 104 "    LDR     R0, =0xFFCDE91C \n"
 105 "    LDR     R1, =0x6B1000 \n"
 106 "    LDR     R3, =0x6C1482 \n"
 107 
 108 "loc_FF82013C:\n"
 109 "    CMP     R1, R3 \n"
 110 "    LDRCC   R2, [R0], #4 \n"
 111 "    STRCC   R2, [R1], #4 \n"
 112 "    BCC     loc_FF82013C \n"
 113 "    LDR     R0, =0xFFCD0D7C \n"
 114 "    LDR     R1, =0x1900 \n"
 115 "    LDR     R3, =0xF4A0 \n"
 116 
 117 "loc_FF820158:\n"
 118 "    CMP     R1, R3 \n"
 119 "    LDRCC   R2, [R0], #4 \n"
 120 "    STRCC   R2, [R1], #4 \n"
 121 "    BCC     loc_FF820158 \n"
 122 "    LDR     R1, =0x181550 \n"
 123 "    MOV     R2, #0 \n"
 124 
 125 "loc_FF820170:\n"
 126 "    CMP     R3, R1 \n"
 127 "    STRCC   R2, [R3], #4 \n"
 128 "    BCC     loc_FF820170 \n"
 129 /* Install task hooks via 0x193x is not possible with this new dryos version
 130    So the below code patches the CreateTask function in RAM to install our
 131    hook -- ERR99
 132 */
 133 // Install CreateTask patch
 134 "    LDR     R0, =patch_CreateTask\n"   // Patch data
 135 "    LDM     R0, {R1,R2}\n"             // Get two patch instructions
 136 "    LDR     R0, =hook_CreateTask\n"    // Address to patch
 137 "    STM     R0, {R1,R2}\n"             // Store patch instructions
 138 
 139 "    B       sub_FF8203C4_my \n"  // --> Patched. Old value = 0xFF8203C4.
 140 
 141 "patch_CreateTask:\n"
 142 "    LDR     PC, [PC,#-0x4]\n"          // Do jump to absolute address CreateTask_my
 143 "    .long   CreateTask_my\n"
 144 );
 145 }
 146 
 147 /*************************************************************/
 148 //** CreateTask_my @ 0x006B562C - 0x006B5630, length=2
 149 void __attribute__((naked,noinline)) CreateTask_my() {
 150 asm volatile (
 151 "    STMFD   SP!, {R0}\n"
 152 //R3 = Pointer to task function to create
 153 
 154 /*** INSTALL capt_seq_task() hook ***/
 155 "    LDR     R0, =task_CaptSeq\n"       // DryOS original code function ptr.
 156 "    CMP     R0, R3\n"                  // is the given taskptr equal to our searched function?
 157 "    LDREQ   R3, =capt_seq_task\n"      // if so replace with our task function base ptr.
 158 "    BEQ     exitHook\n"                // below compares not necessary if this check has found something.
 159 
 160 /*** INSTALL exp_drv_task() hook ***/
 161 "    LDR     R0, =task_ExpDrv\n"
 162 "    CMP     R0, R3\n"
 163 "    LDREQ   R3, =exp_drv_task\n"
 164 "    BEQ     exitHook\n"
 165 
 166 /*** INSTALL filewrite() hook ***/
 167 "    LDR     R0, =task_FileWrite\n"
 168 "    CMP     R0, R3\n"
 169 "    LDREQ   R3, =filewritetask\n"
 170 "    BEQ     exitHook\n"
 171 
 172 /*** INSTALL movie_record_task() hook ***/
 173 /*
 174 "    LDR     R0, =task_MovieRecord\n"
 175 "    CMP     R0, R3\n"
 176 "    LDREQ   R3, =movie_record_task\n"
 177 "    BEQ     exitHook\n"
 178 */
 179 
 180 /*** INSTALL init_file_modules_task() hook ***/
 181 "    LDR     R0, =task_InitFileModules\n"
 182 "    CMP     R0, R3\n"
 183 "    LDREQ   R3, =init_file_modules_task\n"
 184 
 185 "exitHook:\n"
 186 // restore overwritten registers
 187 "    LDMFD   SP!, {R0}\n"
 188 // Execute overwritten instructions from original code, then jump to firmware
 189 "    STMFD   SP!, {R1-R9,LR} \n"
 190 "    MOV     R4, R0 \n"
 191 "    LDR     PC, =0x006B5634 \n"  // Continue in firmware
 192 );
 193 }
 194 
 195 /*************************************************************/
 196 //** sub_FF8203C4_my @ 0xFF8203C4 - 0xFF82042C, length=27
 197 void __attribute__((naked,noinline)) sub_FF8203C4_my() {
 198 
 199     //Replacement of sub_ for correct power-on.
 200     //(short press = playback mode, long press = record mode)
 201     // Similar to ixus160: http://chdk.setepontos.com/index.php?topic=12321.msg123724#msg123724
 202     // look at power-on switch sub_ff8686ac (ff8663d8) => *(0xffba8ce4 + 0x48*8) = 0xC022F48C
 203     // value and pointer from sub_ff868100
 204     *(int*)(0x29D4+0x4) = (*(int*)0xC022F48C)&0x100000 ? 0x200000 : 0x100000;
 205 asm volatile (
 206 "    LDR     R0, =0xFF82043C \n"
 207 "    MOV     R1, #0 \n"
 208 "    LDR     R3, =0xFF820474 \n"
 209 
 210 "loc_FF8203D0:\n"
 211 "    CMP     R0, R3 \n"
 212 "    LDRCC   R2, [R0], #4 \n"
 213 "    STRCC   R2, [R1], #4 \n"
 214 "    BCC     loc_FF8203D0 \n"
 215 "    LDR     R0, =0xFF820474 \n"
 216 "    MOV     R1, #0x1C0 \n"
 217 "    LDR     R3, =0xFF82065C \n"
 218 
 219 "loc_FF8203EC:\n"
 220 "    CMP     R0, R3 \n"
 221 "    LDRCC   R2, [R0], #4 \n"
 222 "    STRCC   R2, [R1], #4 \n"
 223 "    BCC     loc_FF8203EC \n"
 224 "    MOV     R0, #0xD2 \n"
 225 "    MSR     CPSR_cxsf, R0 \n"
 226 "    MOV     SP, #0x1000 \n"
 227 "    MOV     R0, #0xD3 \n"
 228 "    MSR     CPSR_cxsf, R0 \n"
 229 "    MOV     SP, #0x1000 \n"
 230 "    LDR     R0, =0x3A8 \n"
 231 "    LDR     R2, =0xEEEEEEEE \n"
 232 "    MOV     R3, #0x1000 \n"
 233 
 234 "loc_FF820420:\n"
 235 "    CMP     R0, R3 \n"
 236 "    STRCC   R2, [R0], #4 \n"
 237 "    BCC     loc_FF820420 \n"
 238 "    B       sub_FF8228DC_my \n"  // --> Patched. Old value = 0xFF8228DC.
 239 );
 240 }
 241 
 242 /*************************************************************/
 243 //** sub_FF8228DC_my @ 0xFF8228DC - 0xFF822A50, length=94
 244 void __attribute__((naked,noinline)) sub_FF8228DC_my() {
 245 asm volatile (
 246 "    LDR     R0, =0x1A58 \n"
 247 "    STR     LR, [SP, #-4]! \n"
 248 "    SUB     SP, SP, #0x7C \n"
 249 "    MOV     R1, #0x80000 \n"
 250 "    STR     R1, [R0] \n"
 251 "    LDR     R0, =0x40BCE980 \n"
 252 "    LDR     R1, =0x1A5C \n"
 253 "    STR     R0, [R1] \n"
 254 "    LDR     R1, =0x1A60 \n"
 255 "    ADD     R0, R0, #0x2000 \n"
 256 "    STR     R0, [R1] \n"
 257 "    MOV     R1, #0x78 \n"
 258 "    ADD     R0, SP, #4 \n"
 259 "    BL      sub_006BD068 \n"
 260 "    MOV     R0, #0x84000 \n"
 261 "    STR     R0, [SP, #8] \n"
 262 
 263 #if defined(CHDK_NOT_IN_CANON_HEAP) // use original heap offset if CHDK is loaded in high memory
 264 "    LDR     R0, =0x181550 \n"
 265 #else
 266 "    LDR     R0, =new_sa\n"   // otherwise use patched value
 267 "    LDR     R0, [R0]\n"      //
 268 #endif
 269 
 270 "    LDR     R2, =0x5817B0 \n"
 271 "    STR     R0, [SP, #0xC] \n"
 272 "    SUB     R0, R2, R0 \n"
 273 "    STR     R0, [SP, #0x10] \n"
 274 "    MOV     R0, #0x22 \n"
 275 "    STR     R0, [SP, #0x1C] \n"
 276 "    MOV     R0, #0x7C \n"
 277 "    STR     R0, [SP, #0x20] \n"
 278 "    LDR     R1, =0x58A000 \n"
 279 "    LDR     R0, =0x1D3 \n"
 280 "    STR     R1, [SP, #4] \n"
 281 "    STR     R0, [SP, #0x24] \n"
 282 "    MOV     R0, #0x96 \n"
 283 "    STR     R2, [SP, #0x14] \n"
 284 "    STR     R1, [SP, #0x18] \n"
 285 "    STR     R0, [SP, #0x28] \n"
 286 "    STR     R0, [SP, #0x2C] \n"
 287 "    MOV     R0, #0x64 \n"
 288 "    STR     R0, [SP, #0x30] \n"
 289 "    MOV     R0, #0 \n"
 290 "    STR     R0, [SP, #0x34] \n"
 291 "    STR     R0, [SP, #0x38] \n"
 292 "    STR     R0, [SP, #0x3C] \n"
 293 "    MOV     R0, #0x10 \n"
 294 "    STR     R0, [SP, #0x60] \n"
 295 "    MOV     R0, #0x1000 \n"
 296 "    STR     R0, [SP, #0x64] \n"
 297 "    MOV     R0, #0x100 \n"
 298 "    STR     R0, [SP, #0x68] \n"
 299 "    MOV     R0, #0x2000 \n"
 300 "    STR     R0, [SP, #0x6C] \n"
 301 "    LDR     R1, =sub_FF8248DC_my \n"  // --> Patched. Old value = 0xFF8248DC.
 302 "    MOV     R2, #0 \n"
 303 "    ADD     R0, SP, #4 \n"
 304 "    BL      sub_006B1B9C \n"
 305 "    ADD     SP, SP, #0x7C \n"
 306 "    LDR     PC, [SP], #4 \n"
 307 );
 308 }
 309 
 310 /*************************************************************/
 311 //** sub_FF8248DC_my @ 0xFF8248DC - 0xFF824974, length=39
 312 void __attribute__((naked,noinline)) sub_FF8248DC_my() {
 313 asm volatile (
 314 "    STMFD   SP!, {R4,LR} \n"
 315 "    LDR     R4, =0xFF824998 /*'/_term'*/ \n"
 316 "    BL      sub_FF820858 \n"
 317 "    LDR     R1, =0x1A58 \n"
 318 "    LDR     R0, =0x19F0 \n"
 319 "    LDR     R1, [R1] \n"
 320 "    LDR     R0, [R0] \n"
 321 "    ADD     R1, R1, #0x10 \n"
 322 "    CMP     R0, R1 \n"
 323 "    LDRCC   R0, =0xFF8249A8 /*'USER_MEM size checking'*/ \n"
 324 "    BLCC    _err_init_task \n"
 325 "    BL      sub_FF8236A4 \n"
 326 "    CMP     R0, #0 \n"
 327 "    LDRLT   R0, =0xFF8249C0 /*'dmSetup'*/ \n"
 328 "    BLLT    _err_init_task \n"
 329 "    BL      sub_FF8224E8 \n"
 330 "    CMP     R0, #0 \n"
 331 "    LDRLT   R0, =0xFF8249C8 /*'termDriverInit'*/ \n"
 332 "    BLLT    _err_init_task \n"
 333 "    MOV     R0, R4 \n"
 334 "    BL      sub_FF8225D0 \n"
 335 "    CMP     R0, #0 \n"
 336 "    LDRLT   R0, =0xFF8249D8 /*'termDeviceCreate'*/ \n"
 337 "    BLLT    _err_init_task \n"
 338 "    MOV     R0, R4 \n"
 339 "    BL      sub_FF822100 \n"
 340 "    CMP     R0, #0 \n"
 341 "    LDRLT   R0, =0xFF8249EC /*'stdioSetup'*/ \n"
 342 "    BLLT    _err_init_task \n"
 343 "    BL      sub_FF824F44 \n"
 344 "    CMP     R0, #0 \n"
 345 "    LDRLT   R0, =0xFF8249F8 /*'stdlibSetup'*/ \n"
 346 "    BLLT    _err_init_task \n"
 347 "    BL      sub_FF8210A8 \n"
 348 "    CMP     R0, #0 \n"
 349 "    LDRLT   R0, =0xFF824A04 /*'extlib_setup'*/ \n"
 350 "    BLLT    _err_init_task \n"
 351 "    LDMFD   SP!, {R4,LR} \n"
 352 "    B       sub_FF827C18_my \n"  // --> Patched. Old value = 0xFF827C18.
 353 );
 354 }
 355 
 356 /*************************************************************/
 357 //** sub_FF827C18_my @ 0xFF827C18 - 0xFF827C88, length=29
 358 void __attribute__((naked,noinline)) sub_FF827C18_my() {
 359 asm volatile (
 360 "    STMFD   SP!, {R3,LR} \n"
 361 //"  BL      _sub_FF893210 \n"  // --> Nullsub call removed.
 362 "    BL      sub_FF8365C0 \n"
 363 "    CMP     R0, #0 \n"
 364 "    BNE     loc_FF827C3C \n"
 365 "    BL      sub_FF82C900 /*_IsNormalCameraMode_FW*/ \n"
 366 "    CMP     R0, #0 \n"
 367 "    MOVNE   R0, #1 \n"
 368 "    BNE     loc_FF827C40 \n"
 369 
 370 "loc_FF827C3C:\n"
 371 "    MOV     R0, #0 \n"
 372 
 373 "loc_FF827C40:\n"
 374 //"  BL      _sub_FF82BA84 \n"  // See: http://chdk.setepontos.com/index.php?topic=12321.msg121619#msg121619
 375 //"  CMP     R0, #0 \n"
 376 //"  BNE     loc_FF827C54 \n"
 377 //"  BL      _sub_FF82B26C \n"
 378 
 379 "loc_FF827C50:\n"
 380 //"  B       loc_FF827C50 \n"
 381 
 382 "loc_FF827C54:\n"
 383 "    BL      sub_006B8A8C \n"
 384 "    LDR     R1, =0x60E000 \n"
 385 "    MOV     R0, #0 \n"
 386 "    BL      sub_FF836AB8 \n"
 387 "    BL      sub_006B8DD4 \n"
 388 "    MOV     R3, #0 \n"
 389 "    STR     R3, [SP] \n"
 390 "    LDR     R3, =task_Startup_my \n"  // --> Patched. Old value = 0xFF827BB0.
 391 "    MOV     R2, #0 \n"
 392 "    MOV     R1, #0x19 \n"
 393 "    LDR     R0, =0xFF827C94 /*'Startup'*/ \n"
 394 "    BL      _CreateTask \n"
 395 "    MOV     R0, #0 \n"
 396 "    LDMFD   SP!, {R3,PC} \n"
 397 );
 398 }
 399 
 400 /*************************************************************/
 401 //** task_Startup_my @ 0xFF827BB0 - 0xFF827C14, length=26
 402 void __attribute__((naked,noinline)) task_Startup_my() {
 403 asm volatile (
 404 "    STMFD   SP!, {R4,LR} \n"
 405 "    BL      sub_FF822E10 \n"
 406 "    BL      sub_FF82BED8 \n"
 407 "    BL      sub_FF82B218 \n"
 408 //"  BL      _sub_FF8686BC \n"  // --> Nullsub call removed.
 409 "    BL      sub_FF8367FC \n"
 410 //"  BL      _sub_FF8366BC \n"  // load DISKBOOT.BIN
 411 "    BL      sub_FF836954 \n"
 412 "    BL      sub_FF836B8C \n"
 413 //"  BL      _sub_FF836948 \n"  // --> Nullsub call removed.
 414 "    BL      sub_FF836838 \n"
 415 "    BL      sub_FF83288C \n"
 416 "    BL      sub_FF836B94 \n"
 417 "    BL      CreateTask_spytask\n" // added
 418 "    BL      taskcreatePhySw_my \n"  // --> Patched. Old value = 0xFF82B930.
 419 "    BL      init_required_fw_features\n" // added
 420 "    BL      sub_FF830AD4 \n"
 421 "    BL      sub_FF8A9878 \n"
 422 "    BL      sub_FF829008 \n"
 423 "    BL      sub_FF82AD74 \n"
 424 "    BL      sub_FF8363D0 \n"
 425 "    BL      sub_FF82B1CC \n"
 426 "    BL      sub_FF82AD08 \n"
 427 //"  BL      _sub_FF83694C \n"  // --> Nullsub call removed.
 428 "    BL      sub_FF829C98 \n"
 429 "    BL      sub_FF82ACC4 \n"
 430 "    LDMFD   SP!, {R4,LR} \n"
 431 "    B       sub_FF822F38 \n"
 432 );
 433 }
 434 
 435 /*************************************************************/
 436 //** taskcreatePhySw_my @ 0xFF82B930 - 0xFF82B974, length=18
 437 void __attribute__((naked,noinline)) taskcreatePhySw_my() {
 438 asm volatile (
 439 "    STMFD   SP!, {R3-R5,LR} \n"
 440 "    BL      sub_FF835624 \n"
 441 "    BL      sub_FF82C838 /*_IsFactoryMode_FW*/ \n"
 442 "    CMP     R0, #0 \n"
 443 "    BLEQ    sub_FF83558C /*_OpLog.Start_FW*/ \n"
 444 "    LDR     R4, =0x1C94 \n"
 445 "    LDR     R0, [R4, #4] \n"
 446 "    CMP     R0, #0 \n"
 447 "    BNE     loc_FF82B974 \n"
 448 "    MOV     R3, #0 \n"
 449 "    STR     R3, [SP] \n"
 450 "    LDR     R3, =mykbd_task \n"  // --> Patched. Old value = 0xFF82B8FC.
 451 "    MOV     R2, #0x2000 \n"  // --> Patched. Old value = 0x800. stack size for new task_PhySw so we don't have to do stack switch
 452 "    MOV     R1, #0x17 \n"
 453 "    LDR     R0, =0xFF82BBE0 /*'PhySw'*/ \n"
 454 "    BL      sub_006B7B9C /*_CreateTaskStrictly*/ \n"
 455 "    STR     R0, [R4, #4] \n"
 456 
 457 "loc_FF82B974:\n"
 458 "    LDMFD   SP!, {R3-R5,PC} \n"
 459 );
 460 }
 461 
 462 /*************************************************************/
 463 //** init_file_modules_task @ 0xFF857BC8 - 0xFF857BFC, length=14
 464 void __attribute__((naked,noinline)) init_file_modules_task() {
 465 asm volatile (
 466 "    STMFD   SP!, {R4-R6,LR} \n"
 467 "    BL      sub_FF899E38 \n"
 468 "    LDR     R5, =0x5006 \n"
 469 "    MOVS    R4, R0 \n"
 470 "    MOVNE   R1, #0 \n"
 471 "    MOVNE   R0, R5 \n"
 472 "    BLNE    _PostLogicalEventToUI \n"
 473 "    BL      sub_FF899E6C \n"
 474 "    BL      core_spytask_can_start\n"  // CHDK: Set "it's-safe-to-start" flag for spytask
 475 "    CMP     R4, #0 \n"
 476 "    LDMNEFD SP!, {R4-R6,PC} \n"
 477 "    MOV     R0, R5 \n"
 478 "    LDMFD   SP!, {R4-R6,LR} \n"
 479 "    MOV     R1, #0 \n"
 480 "    B       _PostLogicalEventToUI \n"
 481 );
 482 }
 483 
 484 /*
 485     *** TEMPORARY workaround ***
 486     Init stuff to avoid asserts on cameras running DryOS r54+
 487     Execute this only once
 488  */
 489 void init_required_fw_features(void) {
 490     extern void _init_focus_eventflag();
 491     extern void _init_nd_eventflag();
 492     extern void _init_nd_semaphore();
 493     //extern void _init_zoom_semaphore(); // for MoveZoomLensWithPoint
 494 
 495     _init_focus_eventflag();
 496     _init_nd_eventflag();
 497     _init_nd_semaphore();

/* [<][>][^][v][top][bottom][index][help] */