root/platform/ixus160_elph160/sub/100a/boot.c

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

DEFINITIONS

This source file includes following definitions.
  1. CreateTask_spytask
  2. boot
  3. CreateTask_low_my
  4. sub_FF8203C4_my
  5. sub_FF8228D4_my
  6. sub_FF8246FC_my
  7. sub_FF8285C0_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, =0xFFCF60B4 \n"
 105 "    LDR     R1, =0x6B1000 \n"
 106 "    LDR     R3, =0x6BE8DA \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, =0xFFCE7FC8 \n"
 114 "    LDR     R1, =0x1900 \n"
 115 "    LDR     R3, =0xF9EC \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, =0x185CB0 \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 /* CreateTask is located in ROM, patching the lower level CreateTask_low function instead
 130  * Note: task function is the first argument
 131  */
 132 // Install CreateTask_low patch
 133 "    LDR     R0, =patch_CreateTask_low\n"   // Patch data
 134 "    LDM     R0, {R1,R2}\n"             // Get two patch instructions
 135 "    LDR     R0, =hook_CreateTask_low\n"    // Address to patch
 136 "    STM     R0, {R1,R2}\n"             // Store patch instructions
 137 
 138 "    B       sub_FF8203C4_my \n"  // --> Patched. Old value = 0xFF8203C4.
 139 
 140 "patch_CreateTask_low:\n"
 141 "    LDR     PC, [PC,#-0x4]\n"          // Do jump to absolute address CreateTask_my
 142 "    .long   CreateTask_low_my\n"
 143 );
 144 }
 145 
 146 /*************************************************************/
 147 //** CreateTask_low_my @ 0x006B15A4 - 0x006B15A8, length=2
 148 void __attribute__((naked,noinline)) CreateTask_low_my() {
 149 asm volatile (
 150 " STMFD SP!, {R1}\n"
 151 //R0 = Pointer to task function to create
 152 
 153 /*** INSTALL capt_seq_task() hook ***/
 154 "    LDR     R1, =task_CaptSeq\n"       // DryOS original code function ptr.
 155 "    CMP     R1, R0\n"                  // is the given taskptr equal to our searched function?
 156 "    LDREQ   R0, =capt_seq_task\n"      // if so replace with our task function base ptr.
 157 "    BEQ exitHook\n"                    // below compares not necessary if this check has found something.
 158 
 159 /*** INSTALL exp_drv_task() hook ***/
 160 "    LDR     R1, =task_ExpDrv\n"
 161 "    CMP     R1, R0\n"
 162 "    LDREQ   R0, =exp_drv_task\n"
 163 "    BEQ exitHook\n"
 164 
 165 /*** INSTALL filewrite() hook ***/
 166 "    LDR     R1, =task_FileWrite\n"
 167 "    CMP     R1, R0\n"
 168 "    LDREQ   R0, =filewritetask\n"
 169 "    BEQ exitHook\n"
 170 
 171 /*** INSTALL movie_record_task() hook ***/
 172 "    LDR     R1, =task_MovieRecord\n"
 173 "    CMP     R1, R0\n"
 174 "    LDREQ   R0, =movie_record_task\n"
 175 "    BEQ exitHook\n"
 176 
 177 /*** INSTALL init_file_modules_task() hook ***/
 178 "   LDR     R1, =task_InitFileModules\n"
 179 "   CMP     R1, R0\n"
 180 "   LDREQ   R0, =init_file_modules_task\n"
 181 
 182 "exitHook:\n"
 183 // restore overwritten registers
 184 "    LDMFD SP!, {R1}\n"
 185 // Execute overwritten instructions from original code, then jump to firmware
 186 "    STMFD   SP!, {R4-R8,LR} \n"
 187 "    CMP     R3, #0 \n"
 188 "    LDR     PC, =0x006B15AC \n"  // Continue in firmware
 189 );
 190 }
 191 
 192 /*************************************************************/
 193 //** sub_FF8203C4_my @ 0xFF8203C4 - 0xFF82042C, length=27
 194 void __attribute__((naked,noinline)) sub_FF8203C4_my() {
 195 
 196    // Replacement of sub_ for correct power-on.
 197    // (short press = playback mode, long press = record mode)
 198    // See http://chdk.setepontos.com/index.php?topic=12321.msg123724#msg123724
 199    // look at power-on switch sub_FF86B8C4
 200    // value and pointer from sub_FF86B2E8
 201    *(int*)(0x2A04 + 4) = (*(int*)0xC022F484)&0x20000 ? 0x400000 : 0x200000;
 202 
 203 asm volatile (
 204 "    LDR     R0, =0xFF82043C \n"
 205 "    MOV     R1, #0 \n"
 206 "    LDR     R3, =0xFF820474 \n"
 207 
 208 "loc_FF8203D0:\n"
 209 "    CMP     R0, R3 \n"
 210 "    LDRCC   R2, [R0], #4 \n"
 211 "    STRCC   R2, [R1], #4 \n"
 212 "    BCC     loc_FF8203D0 \n"
 213 "    LDR     R0, =0xFF820474 \n"
 214 "    MOV     R1, #0x1C0 \n"
 215 "    LDR     R3, =0xFF82065C \n"
 216 
 217 "loc_FF8203EC:\n"
 218 "    CMP     R0, R3 \n"
 219 "    LDRCC   R2, [R0], #4 \n"
 220 "    STRCC   R2, [R1], #4 \n"
 221 "    BCC     loc_FF8203EC \n"
 222 "    MOV     R0, #0xD2 \n"
 223 "    MSR     CPSR_cxsf, R0 \n"
 224 "    MOV     SP, #0x1000 \n"
 225 "    MOV     R0, #0xD3 \n"
 226 "    MSR     CPSR_cxsf, R0 \n"
 227 "    MOV     SP, #0x1000 \n"
 228 "    LDR     R0, =0x3A8 \n"
 229 "    LDR     R2, =0xEEEEEEEE \n"
 230 "    MOV     R3, #0x1000 \n"
 231 
 232 "loc_FF820420:\n"
 233 "    CMP     R0, R3 \n"
 234 "    STRCC   R2, [R0], #4 \n"
 235 "    BCC     loc_FF820420 \n"
 236 "    B       sub_FF8228D4_my \n"  // --> Patched. Old value = 0xFF8228D4.
 237 );
 238 }
 239 
 240 /*************************************************************/
 241 //** sub_FF8228D4_my @ 0xFF8228D4 - 0xFF8229D8, length=66
 242 void __attribute__((naked,noinline)) sub_FF8228D4_my() {
 243 asm volatile (
 244 "    LDR     R0, =0x1A5C \n"
 245 "    STR     LR, [SP, #-4]! \n"
 246 "    SUB     SP, SP, #0x7C \n"
 247 "    MOV     R1, #0x80000 \n"
 248 "    STR     R1, [R0] \n"
 249 "    LDR     R0, =0x40BEE980 \n"
 250 "    LDR     R1, =0x1A60 \n"
 251 "    STR     R0, [R1] \n"
 252 "    LDR     R1, =0x1A64 \n"
 253 "    ADD     R0, R0, #0x2000 \n"
 254 "    STR     R0, [R1] \n"
 255 "    MOV     R1, #0x78 \n"
 256 "    ADD     R0, SP, #4 \n"
 257 "    BL      sub_006BAAF4 \n"
 258 "    MOV     R0, #0x84000 \n"
 259 "    STR     R0, [SP, #8] \n"
 260 
 261 #if defined(CHDK_NOT_IN_CANON_HEAP) // use original heap offset if CHDK is loaded in high memory
 262 "    LDR     R0, =0x185CB0 \n"
 263 #else
 264 "    LDR     R0, =new_sa\n"   // otherwise use patched value
 265 "    LDR     R0, [R0]\n"      //
 266 #endif
 267 
 268 "    LDR     R2, =0x5817B0 \n"
 269 "    STR     R0, [SP, #0xC] \n"
 270 "    SUB     R0, R2, R0 \n"
 271 "    STR     R0, [SP, #0x10] \n"
 272 "    MOV     R0, #0x22 \n"
 273 "    STR     R0, [SP, #0x1C] \n"
 274 "    MOV     R0, #0x7C \n"
 275 "    STR     R0, [SP, #0x20] \n"
 276 "    LDR     R1, =0x58A000 \n"
 277 "    LDR     R0, =0x1D3 \n"
 278 "    STR     R1, [SP, #4] \n"
 279 "    STR     R0, [SP, #0x24] \n"
 280 "    MOV     R0, #0x96 \n"
 281 "    STR     R2, [SP, #0x14] \n"
 282 "    STR     R1, [SP, #0x18] \n"
 283 "    STR     R0, [SP, #0x28] \n"
 284 "    STR     R0, [SP, #0x2C] \n"
 285 "    MOV     R0, #0x64 \n"
 286 "    STR     R0, [SP, #0x30] \n"
 287 "    MOV     R0, #0 \n"
 288 "    STR     R0, [SP, #0x34] \n"
 289 "    STR     R0, [SP, #0x38] \n"
 290 "    STR     R0, [SP, #0x3C] \n"
 291 "    MOV     R0, #0x10 \n"
 292 "    STR     R0, [SP, #0x60] \n"
 293 "    MOV     R0, #0x1000 \n"
 294 "    STR     R0, [SP, #0x64] \n"
 295 "    MOV     R0, #0x100 \n"
 296 "    STR     R0, [SP, #0x68] \n"
 297 "    MOV     R0, #0x2000 \n"
 298 "    STR     R0, [SP, #0x6C] \n"
 299 "    LDR     R1, =sub_FF8246FC_my \n"  // --> Patched. Old value = 0xFF8246FC.
 300 "    MOV     R2, #0 \n"
 301 "    ADD     R0, SP, #4 \n"
 302 "    BL      sub_006B1BC8 \n"
 303 "    ADD     SP, SP, #0x7C \n"
 304 "    LDR     PC, [SP], #4 \n"
 305 );
 306 }
 307 
 308 /*************************************************************/
 309 //** sub_FF8246FC_my @ 0xFF8246FC - 0xFF824794, length=39
 310 void __attribute__((naked,noinline)) sub_FF8246FC_my() {
 311 asm volatile (
 312 "    STMFD   SP!, {R4,LR} \n"
 313 "    LDR     R4, =0xFF8247B8 /*'/_term'*/ \n"
 314 "    BL      sub_FF820858 \n"
 315 "    LDR     R1, =0x1A5C \n"
 316 "    LDR     R0, =0x19F0 \n"
 317 "    LDR     R1, [R1] \n"
 318 "    LDR     R0, [R0] \n"
 319 "    ADD     R1, R1, #0x10 \n"
 320 "    CMP     R0, R1 \n"
 321 "    LDRCC   R0, =0xFF8247C8 /*'USER_MEM size checking'*/ \n"
 322 "    BLCC    _err_init_task \n"
 323 "    BL      sub_FF8234D8 \n"
 324 "    CMP     R0, #0 \n"
 325 "    LDRLT   R0, =0xFF8247E0 /*'dmSetup'*/ \n"
 326 "    BLLT    _err_init_task \n"
 327 "    BL      sub_FF8224E8 \n"
 328 "    CMP     R0, #0 \n"
 329 "    LDRLT   R0, =0xFF8247E8 /*'termDriverInit'*/ \n"
 330 "    BLLT    _err_init_task \n"
 331 "    MOV     R0, R4 \n"
 332 "    BL      sub_FF8225C8 \n"
 333 "    CMP     R0, #0 \n"
 334 "    LDRLT   R0, =0xFF8247F8 /*'termDeviceCreate'*/ \n"
 335 "    BLLT    _err_init_task \n"
 336 "    MOV     R0, R4 \n"
 337 "    BL      sub_FF822100 \n"
 338 "    CMP     R0, #0 \n"
 339 "    LDRLT   R0, =0xFF82480C /*'stdioSetup'*/ \n"
 340 "    BLLT    _err_init_task \n"
 341 "    BL      sub_FF82534C \n"
 342 "    CMP     R0, #0 \n"
 343 "    LDRLT   R0, =0xFF824818 /*'stdlibSetup'*/ \n"
 344 "    BLLT    _err_init_task \n"
 345 "    BL      sub_FF8210A8 \n"
 346 "    CMP     R0, #0 \n"
 347 "    LDRLT   R0, =0xFF824824 /*'extlib_setup'*/ \n"
 348 "    BLLT    _err_init_task \n"
 349 "    LDMFD   SP!, {R4,LR} \n"
 350 "    B       sub_FF8285C0_my \n"  // --> Patched. Old value = 0xFF8285C0.
 351 );
 352 }
 353 
 354 /*************************************************************/
 355 //** sub_FF8285C0_my @ 0xFF8285C0 - 0xFF828630, length=29
 356 void __attribute__((naked,noinline)) sub_FF8285C0_my() {
 357 asm volatile (
 358 "    STMFD   SP!, {R3,LR} \n"
 359 //"  BL      _sub_FF896A88 \n"  // --> Nullsub call removed.
 360 "    BL      sub_FF838500 \n"
 361 "    CMP     R0, #0 \n"
 362 "    BNE     loc_FF8285E4 \n"
 363 "    BL      sub_FF82E810 /*_IsNormalCameraMode_FW*/ \n"
 364 "    CMP     R0, #0 \n"
 365 "    MOVNE   R0, #1 \n"
 366 "    BNE     loc_FF8285E8 \n"
 367 
 368 "loc_FF8285E4:\n"
 369 "    MOV     R0, #0 \n"
 370 
 371 "loc_FF8285E8:\n"
 372 //"  BL      _sub_FF82D94C \n"  // See: http://chdk.setepontos.com/index.php?topic=12321.msg121619#msg121619
 373 //"  CMP     R0, #0 \n"
 374 //"  BNE     loc_FF8285FC \n"
 375 //"  BL      _sub_FF82D134 \n"
 376 
 377 "loc_FF8285F8:\n"
 378 //"  B       loc_FF8285F8 \n"
 379 
 380 "loc_FF8285FC:\n"
 381 "    BL      sub_FF82A464 \n"
 382 "    LDR     R1, =0x60E000 \n"
 383 "    MOV     R0, #0 \n"
 384 "    BL      sub_FF838A0C \n"
 385 "    BL      sub_FF82A7AC \n"
 386 "    MOV     R3, #0 \n"
 387 "    STR     R3, [SP] \n"
 388 "    LDR     R3, =task_Startup_my \n"  // --> Patched. Old value = 0xFF828558.
 389 "    MOV     R2, #0 \n"
 390 "    MOV     R1, #0x19 \n"
 391 "    LDR     R0, =0xFF82863C /*'Startup'*/ \n"
 392 "    BL      _CreateTask \n"
 393 "    MOV     R0, #0 \n"
 394 "    LDMFD   SP!, {R3,PC} \n"
 395 );
 396 }
 397 
 398 /*************************************************************/
 399 //** task_Startup_my @ 0xFF828558 - 0xFF8285BC, length=26
 400 void __attribute__((naked,noinline)) task_Startup_my() {
 401 asm volatile (
 402 "    STMFD   SP!, {R4,LR} \n"
 403 "    BL      sub_FF822C7C \n"
 404 "    BL      sub_FF82DDCC \n"
 405 "    BL      sub_FF82D0E0 \n"
 406 //"  BL      _sub_FF86B8D4 \n"  // --> Nullsub call removed.
 407 "    BL      sub_FF83873C \n"
 408 //"  BL      _sub_FF8385FC \n"  // load DISKBOOT.BIN
 409 "    BL      sub_FF838898 \n"
 410 "    BL      sub_FF838AE0 \n"
 411 //"  BL      _sub_FF83888C \n"  // --> Nullsub call removed.
 412 "    BL      sub_FF838778 \n"
 413 "    BL      sub_FF834724 \n"
 414 "    BL      sub_FF838AE8 \n"
 415 "    BL      CreateTask_spytask\n" // added
 416 "    BL      taskcreatePhySw_my \n"  // --> Patched. Old value = 0xFF82D7F8.
 417 "    BL      init_required_fw_features\n" // added
 418 "    BL      sub_FF8328DC \n"
 419 "    BL      sub_FF8AD8A8 \n"
 420 "    BL      sub_FF82AFE0 \n"
 421 "    BL      sub_FF82CC3C \n"
 422 "    BL      sub_FF83830C \n"
 423 "    BL      sub_FF82D094 \n"
 424 "    BL      sub_FF82CBD0 \n"
 425 //"  BL      _sub_FF838890 \n"  // --> Nullsub call removed.
 426 "    BL      sub_FF82BCF0 \n"
 427 "    BL      sub_FF82CB8C \n"
 428 "    LDMFD   SP!, {R4,LR} \n"
 429 "    B       sub_FF822DCC \n"
 430 );
 431 }
 432 
 433 /*************************************************************/
 434 //** taskcreatePhySw_my @ 0xFF82D7F8 - 0xFF82D83C, length=18
 435 void __attribute__((naked,noinline)) taskcreatePhySw_my() {
 436 asm volatile (
 437 "    STMFD   SP!, {R3-R5,LR} \n"
 438 "    BL      sub_FF83755C \n"
 439 "    BL      sub_FF82E748 /*_IsFactoryMode_FW*/ \n"
 440 "    CMP     R0, #0 \n"
 441 "    BLEQ    sub_FF8374C4 /*_OpLog.Start_FW*/ \n"
 442 "    LDR     R4, =0x1C94 \n"
 443 "    LDR     R0, [R4, #4] \n"
 444 "    CMP     R0, #0 \n"
 445 "    BNE     loc_FF82D83C \n"
 446 "    MOV     R3, #0 \n"
 447 "    STR     R3, [SP] \n"
 448 "    LDR     R3, =mykbd_task \n"  // --> Patched. Old value = 0xFF82D7C4.
 449 "    MOV     R2, #0x2000 \n"  // --> Patched. Old value = 0x800. stack size for new task_PhySw so we don't have to do stack switch
 450 "    MOV     R1, #0x17 \n"
 451 "    LDR     R0, =0xFF82DAA8 /*'PhySw'*/ \n"
 452 "    BL      sub_FF82661C /*_CreateTaskStrictly*/ \n"
 453 "    STR     R0, [R4, #4] \n"
 454 
 455 "loc_FF82D83C:\n"
 456 "    LDMFD   SP!, {R3-R5,PC} \n"
 457 );
 458 }
 459 
 460 /*************************************************************/
 461 //** init_file_modules_task @ 0xFF85AB10 - 0xFF85AB44, length=14
 462 void __attribute__((naked,noinline)) init_file_modules_task() {
 463 asm volatile (
 464 "    STMFD   SP!, {R4-R6,LR} \n"
 465 "    BL      sub_FF89D768 \n"
 466 "    LDR     R5, =0x5006 \n"
 467 "    MOVS    R4, R0 \n"
 468 "    MOVNE   R1, #0 \n"
 469 "    MOVNE   R0, R5 \n"
 470 "    BLNE    _PostLogicalEventToUI \n"
 471 "    BL      sub_FF89D798 \n"
 472 "    BL      core_spytask_can_start\n"  // CHDK: Set "it's-safe-to-start" flag for spytask
 473 "    CMP     R4, #0 \n"
 474 "    LDMNEFD SP!, {R4-R6,PC} \n"
 475 "    MOV     R0, R5 \n"
 476 "    LDMFD   SP!, {R4-R6,LR} \n"
 477 "    MOV     R1, #0 \n"
 478 "    B       _PostLogicalEventToUI \n"
 479 );
 480 }
 481 
 482 /*
 483     *** TEMPORARY workaround ***
 484     Init stuff to avoid asserts on cameras running DryOS r54+
 485     Execute this only once
 486  */
 487 void init_required_fw_features(void) {
 488     extern void _init_focus_eventflag();
 489     extern void _init_nd_eventflag();
 490     extern void _init_nd_semaphore();
 491     //extern void _init_zoom_semaphore(); // for MoveZoomLensWithPoint
 492 
 493     _init_focus_eventflag();
 494     _init_nd_eventflag();
 495     _init_nd_semaphore();

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