root/platform/a2600/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_FF810380_my
  5. sub_FF811100_my
  6. sub_FF8141B8_my
  7. sub_FF81A1FC_my
  8. sub_FF82ABF8_my
  9. task_Startup_my
  10. taskcreatePhySw_my
  11. init_file_modules_task

   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 extern void task_CaptSeq();
  14 extern void task_InitFileModules();
  15 extern void task_MovieRecord();
  16 extern void task_ExpDrv();
  17 extern void task_FileWrite();
  18 
  19 /*----------------------------------------------------------------------
  20     CreateTask_spytask
  21 -----------------------------------------------------------------------*/
  22 void CreateTask_spytask()
  23 {
  24     _CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
  25 }
  26 
  27 
  28 /*----------------------------------------------------------------------
  29     boot()
  30 
  31     Main entry point for the CHDK code
  32 -----------------------------------------------------------------------*/
  33 
  34 /*************************************************************/
  35 //** boot @ 0xFF81000C - 0xFF810170, length=90
  36 void __attribute__((naked,noinline)) boot() {
  37 asm volatile (
  38 "    LDR     R1, =0xC0410000 \n"
  39 "    MOV     R0, #0 \n"
  40 "    STR     R0, [R1] \n"
  41 "    MOV     R1, #0x78 \n"
  42 "    MCR     p15, 0, R1, c1, c0 \n"
  43 "    MOV     R1, #0 \n"
  44 "    MCR     p15, 0, R1, c7, c10, 4 \n"
  45 "    MCR     p15, 0, R1, c7, c5 \n"
  46 "    MCR     p15, 0, R1, c7, c6 \n"
  47 "    MOV     R0, #0x3D \n"
  48 "    MCR     p15, 0, R0, c6, c0 \n"
  49 "    MOV     R0, #0xC000002F \n"
  50 "    MCR     p15, 0, R0, c6, c1 \n"
  51 "    MOV     R0, #0x33 \n"
  52 "    MCR     p15, 0, R0, c6, c2 \n"
  53 "    MOV     R0, #0x40000033 \n"
  54 "    MCR     p15, 0, R0, c6, c3 \n"
  55 "    MOV     R0, #0x80000017 \n"
  56 "    MCR     p15, 0, R0, c6, c4 \n"
  57 "    LDR     R0, =0xFF80002D \n"
  58 "    MCR     p15, 0, R0, c6, c5 \n"
  59 "    MOV     R0, #0x34 \n"
  60 "    MCR     p15, 0, R0, c2, c0 \n"
  61 "    MOV     R0, #0x34 \n"
  62 "    MCR     p15, 0, R0, c2, c0, 1 \n"
  63 "    MOV     R0, #0x34 \n"
  64 "    MCR     p15, 0, R0, c3, c0 \n"
  65 "    LDR     R0, =0x3333330 \n"
  66 "    MCR     p15, 0, R0, c5, c0, 2 \n"
  67 "    LDR     R0, =0x3333330 \n"
  68 "    MCR     p15, 0, R0, c5, c0, 3 \n"
  69 "    MRC     p15, 0, R0, c1, c0 \n"
  70 "    ORR     R0, R0, #0x1000 \n"
  71 "    ORR     R0, R0, #4 \n"
  72 "    ORR     R0, R0, #1 \n"
  73 "    MCR     p15, 0, R0, c1, c0 \n"
  74 "    MOV     R1, #0x80000006 \n"
  75 "    MCR     p15, 0, R1, c9, c1 \n"
  76 "    MOV     R1, #6 \n"
  77 "    MCR     p15, 0, R1, c9, c1, 1 \n"
  78 "    MRC     p15, 0, R1, c1, c0 \n"
  79 "    ORR     R1, R1, #0x50000 \n"
  80 "    MCR     p15, 0, R1, c1, c0 \n"
  81 "    LDR     R2, =0xC0200000 \n"
  82 "    MOV     R1, #1 \n"
  83 "    STR     R1, [R2, #0x10C] \n"
  84 "    MOV     R1, #0xFF \n"
  85 "    STR     R1, [R2, #0xC] \n"
  86 "    STR     R1, [R2, #0x1C] \n"
  87 "    STR     R1, [R2, #0x2C] \n"
  88 "    STR     R1, [R2, #0x3C] \n"
  89 "    STR     R1, [R2, #0x4C] \n"
  90 "    STR     R1, [R2, #0x5C] \n"
  91 "    STR     R1, [R2, #0x6C] \n"
  92 "    STR     R1, [R2, #0x7C] \n"
  93 "    STR     R1, [R2, #0x8C] \n"
  94 "    STR     R1, [R2, #0x9C] \n"
  95 "    STR     R1, [R2, #0xAC] \n"
  96 "    STR     R1, [R2, #0xBC] \n"
  97 "    STR     R1, [R2, #0xCC] \n"
  98 "    STR     R1, [R2, #0xDC] \n"
  99 "    STR     R1, [R2, #0xEC] \n"
 100 "    STR     R1, [R2, #0xFC] \n"
 101 "    LDR     R1, =0xC0400008 \n"
 102 "    LDR     R2, =0x430005 \n"
 103 "    STR     R2, [R1] \n"
 104 "    LDR     R2, =0xC0242010 \n"
 105 "    LDR     R1, [R2] \n"
 106 "    ORR     R1, R1, #1 \n"
 107 "    STR     R1, [R2] \n"
 108 "    LDR     R0, =0xFFC56F78 \n"
 109 "    LDR     R1, =0x3F1000 \n"
 110 "    LDR     R3, =0x40099C \n"
 111 
 112 "loc_FF810130:\n"
 113 "    CMP     R1, R3 \n"
 114 "    LDRCC   R2, [R0], #4 \n"
 115 "    STRCC   R2, [R1], #4 \n"
 116 "    BCC     loc_FF810130 \n"
 117 "    LDR     R0, =0xFFC4A1B0 \n"
 118 "    LDR     R1, =0x1900 \n"
 119 "    LDR     R3, =0xE6C8 \n"
 120 
 121 "loc_FF81014C:\n"
 122 "    CMP     R1, R3 \n"
 123 "    LDRCC   R2, [R0], #4 \n"
 124 "    STRCC   R2, [R1], #4 \n"
 125 "    BCC     loc_FF81014C \n"
 126 "    LDR     R1, =0x15AFE8 \n"
 127 "    MOV     R2, #0 \n"
 128 
 129 "loc_FF810164:\n"
 130 "    CMP     R3, R1 \n"
 131 "    STRCC   R2, [R3], #4 \n"
 132 "    BCC     loc_FF810164 \n"
 133 /* Install task hooks via 0x193x is not possible with this new dryos version
 134    So the below code patches the CreateTask function in RAM to install our
 135    hook -- ERR99
 136 */
 137 // Install CreateTask patch
 138 "    LDR     R0, =patch_CreateTask\n"   // Patch data
 139 "    LDM     R0, {R1,R2}\n"             // Get two patch instructions
 140 "    LDR     R0, =hook_CreateTask\n"    // Address to patch
 141 "    STM     R0, {R1,R2}\n"             // Store patch instructions
 142 
 143 "    B       sub_FF810380_my \n"  // --> Patched. Old value = 0xFF810380.
 144 
 145 "patch_CreateTask:\n"
 146 "    LDR     PC, [PC,#-0x4]\n"          // Do jump to absolute address CreateTask_my
 147 "    .long   CreateTask_my\n"
 148 );
 149 }
 150 
 151 /*************************************************************/
 152 //** CreateTask_my @ 0x003F68B0 - 0x003F68B4, length=2
 153 void __attribute__((naked,noinline)) CreateTask_my() {
 154 asm volatile (
 155 "    STMFD   SP!, {R0}\n"
 156 //R3 = Pointer to task function to create
 157 
 158 /*** INSTALL capt_seq_task() hook ***/
 159 "    LDR     R0, =task_CaptSeq\n"       // DryOS original code function ptr.
 160 "    CMP     R0, R3\n"                  // is the given taskptr equal to our searched function?
 161 "    LDREQ   R3, =capt_seq_task\n"      // if so replace with our task function base ptr.
 162 "    BEQ     exitHook\n"                // below compares not necessary if this check has found something.
 163 
 164 /*** INSTALL exp_drv_task() hook ***/
 165 "    LDR     R0, =task_ExpDrv\n"
 166 "    CMP     R0, R3\n"
 167 "    LDREQ   R3, =exp_drv_task\n"
 168 "    BEQ     exitHook\n"
 169 
 170 /*** INSTALL filewrite() hook ***/
 171 "    LDR     R0, =task_FileWrite\n"
 172 "    CMP     R0, R3\n"
 173 "    LDREQ   R3, =filewritetask\n"
 174 "    BEQ     exitHook\n"
 175 
 176 /*** INSTALL movie_record_task() hook ***/
 177 "    LDR     R0, =task_MovieRecord\n"
 178 "    CMP     R0, R3\n"
 179 "    LDREQ   R3, =movie_record_task\n"
 180 "    BEQ     exitHook\n"
 181 
 182 /*** INSTALL init_file_modules_task() hook ***/
 183 "    LDR     R0, =task_InitFileModules\n"
 184 "    CMP     R0, R3\n"
 185 "    LDREQ   R3, =init_file_modules_task\n"
 186 
 187 "exitHook:\n"
 188 // restore overwritten registers
 189 "    LDMFD   SP!, {R0}\n"
 190 // Execute overwritten instructions from original code, then jump to firmware
 191 "    STMFD   SP!, {R1-R9,LR} \n"
 192 "    MOV     R4, R0 \n"
 193 "    LDR     PC, =0x003F68B8 \n"  // Continue in firmware
 194 );
 195 }
 196 
 197 /*************************************************************/
 198 //** sub_FF810380_my @ 0xFF810380 - 0xFF8103E8, length=27
 199 void __attribute__((naked,noinline)) sub_FF810380_my() {
 200 
 201     // look at power-on switch sub_FF82ABF8
 202     // value and pointer from sub_FF861AF0
 203     //(short press = playback mode, long press = record mode)
 204     *(int*)(0x2914+0x4) = (*(int*)0xC0220100) & 1 ? 0x200000 : 0x100000;
 205 
 206 asm volatile (
 207 "    LDR     R0, =0xFF8103F8 \n"
 208 "    MOV     R1, #0 \n"
 209 "    LDR     R3, =0xFF810430 \n"
 210 
 211 "loc_FF81038C:\n"
 212 "    CMP     R0, R3 \n"
 213 "    LDRCC   R2, [R0], #4 \n"
 214 "    STRCC   R2, [R1], #4 \n"
 215 "    BCC     loc_FF81038C \n"
 216 "    LDR     R0, =0xFF810430 \n"
 217 "    MOV     R1, #0x1B0 \n"
 218 "    LDR     R3, =0xFF810618 \n"
 219 
 220 "loc_FF8103A8:\n"
 221 "    CMP     R0, R3 \n"
 222 "    LDRCC   R2, [R0], #4 \n"
 223 "    STRCC   R2, [R1], #4 \n"
 224 "    BCC     loc_FF8103A8 \n"
 225 "    MOV     R0, #0xD2 \n"
 226 "    MSR     CPSR_cxsf, R0 \n"
 227 "    MOV     SP, #0x1000 \n"
 228 "    MOV     R0, #0xD3 \n"
 229 "    MSR     CPSR_cxsf, R0 \n"
 230 "    MOV     SP, #0x1000 \n"
 231 "    LDR     R0, =0x398 \n"
 232 "    LDR     R2, =0xEEEEEEEE \n"
 233 "    MOV     R3, #0x1000 \n"
 234 
 235 "loc_FF8103DC:\n"
 236 "    CMP     R0, R3 \n"
 237 "    STRCC   R2, [R0], #4 \n"
 238 "    BCC     loc_FF8103DC \n"
 239 "    BL      sub_FF811100_my \n"  // --> Patched. Old value = 0xFF811100.
 240 );
 241 }
 242 
 243 /*************************************************************/
 244 //** sub_FF811100_my @ 0xFF811100 - 0xFF8111AC, length=44
 245 void __attribute__((naked,noinline)) sub_FF811100_my() {
 246 asm volatile (
 247 "    STR     LR, [SP, #-4]! \n"
 248 "    SUB     SP, SP, #0x74 \n"
 249 "    MOV     R1, #0x74 \n"
 250 "    MOV     R0, SP \n"
 251 "    BL      sub_003FC81C \n"
 252 "    MOV     R0, #0x57000 \n"
 253 "    STR     R0, [SP, #4] \n"
 254 
 255 #if defined(CHDK_NOT_IN_CANON_HEAP) // use original heap offset if CHDK is loaded in high memory
 256 "    LDR     R0, =0x15AFE8 \n"
 257 #else
 258 "    LDR     R0, =new_sa\n"   // otherwise use patched value
 259 "    LDR     R0, [R0]\n"      //
 260 #endif
 261 
 262 "    LDR     R2, =0x2ED440 \n"
 263 "    STR     R0, [SP, #8] \n"
 264 "    SUB     R0, R2, R0 \n"
 265 "    STR     R0, [SP, #0xC] \n"
 266 "    MOV     R0, #0x22 \n"
 267 "    STR     R0, [SP, #0x18] \n"
 268 "    MOV     R0, #0x7C \n"
 269 "    STR     R0, [SP, #0x1C] \n"
 270 "    LDR     R1, =0x2F5C00 \n"
 271 "    LDR     R0, =0x1CD \n"
 272 "    STR     R1, [SP] \n"
 273 "    STR     R0, [SP, #0x20] \n"
 274 "    MOV     R0, #0x96 \n"
 275 "    STR     R2, [SP, #0x10] \n"
 276 "    STR     R1, [SP, #0x14] \n"
 277 "    STR     R0, [SP, #0x24] \n"
 278 "    STR     R0, [SP, #0x28] \n"
 279 "    MOV     R0, #0x64 \n"
 280 "    STR     R0, [SP, #0x2C] \n"
 281 "    MOV     R0, #0 \n"
 282 "    STR     R0, [SP, #0x30] \n"
 283 "    STR     R0, [SP, #0x34] \n"
 284 "    MOV     R0, #0x10 \n"
 285 "    STR     R0, [SP, #0x5C] \n"
 286 "    MOV     R0, #0x800 \n"
 287 "    STR     R0, [SP, #0x60] \n"
 288 "    MOV     R0, #0xA0 \n"
 289 "    STR     R0, [SP, #0x64] \n"
 290 "    MOV     R0, #0x280 \n"
 291 "    STR     R0, [SP, #0x68] \n"
 292 "    LDR     R1, =sub_FF8141B8_my \n"  // --> Patched. Old value = 0xFF8141B8.
 293 "    MOV     R2, #0 \n"
 294 "    MOV     R0, SP \n"
 295 "    BL      sub_003F27E8 \n"
 296 "    ADD     SP, SP, #0x74 \n"
 297 "    LDR     PC, [SP], #4 \n"
 298 );
 299 }
 300 
 301 /*************************************************************/
 302 //** sub_FF8141B8_my @ 0xFF8141B8 - 0xFF81422C, length=30
 303 void __attribute__((naked,noinline)) sub_FF8141B8_my() {
 304 asm volatile (
 305 "    STMFD   SP!, {R4,LR} \n"
 306 "    BL      sub_FF810ADC \n"
 307 "    BL      sub_FF8150A4 \n"
 308 "    CMP     R0, #0 \n"
 309 "    LDRLT   R0, =0xFF8142CC /*'dmSetup'*/ \n"
 310 "    BLLT    _err_init_task \n"
 311 "    BL      sub_FF813DF0 \n"
 312 "    CMP     R0, #0 \n"
 313 "    LDRLT   R0, =0xFF8142D4 /*'termDriverInit'*/ \n"
 314 "    BLLT    _err_init_task \n"
 315 "    LDR     R0, =0xFF8142E4 /*'/_term'*/ \n"
 316 "    BL      sub_FF813ED8 \n"
 317 "    CMP     R0, #0 \n"
 318 "    LDRLT   R0, =0xFF8142EC /*'termDeviceCreate'*/ \n"
 319 "    BLLT    _err_init_task \n"
 320 "    LDR     R0, =0xFF8142E4 /*'/_term'*/ \n"
 321 "    BL      sub_FF8128F8 \n"
 322 "    CMP     R0, #0 \n"
 323 "    LDRLT   R0, =0xFF814300 /*'stdioSetup'*/ \n"
 324 "    BLLT    _err_init_task \n"
 325 "    BL      sub_FF814A40 \n"
 326 "    CMP     R0, #0 \n"
 327 "    LDRLT   R0, =0xFF81430C /*'stdlibSetup'*/ \n"
 328 "    BLLT    _err_init_task \n"
 329 "    BL      sub_FF8115F0 \n"
 330 "    CMP     R0, #0 \n"
 331 "    LDRLT   R0, =0xFF814318 /*'armlib_setup'*/ \n"
 332 "    BLLT    _err_init_task \n"
 333 "    LDMFD   SP!, {R4,LR} \n"
 334 "    B       sub_FF81A1FC_my \n"  // --> Patched. Old value = 0xFF81A1FC.
 335 );
 336 }
 337 
 338 /*************************************************************/
 339 //** sub_FF81A1FC_my @ 0xFF81A1FC - 0xFF81A26C, length=29
 340 void __attribute__((naked,noinline)) sub_FF81A1FC_my() {
 341 asm volatile (
 342 "    STMFD   SP!, {R3,LR} \n"
 343 //"  BL      _sub_FF8301B4 \n"  // --> Nullsub call removed.
 344 "    BL      sub_FF8314F8 \n"
 345 "    CMP     R0, #0 \n"
 346 "    BNE     loc_FF81A220 \n"
 347 "    BL      sub_FF82C75C /*_IsNormalCameraMode_FW*/ \n"
 348 "    CMP     R0, #0 \n"
 349 "    MOVNE   R0, #1 \n"
 350 "    BNE     loc_FF81A224 \n"
 351 
 352 "loc_FF81A220:\n"
 353 "    MOV     R0, #0 \n"
 354 
 355 "loc_FF81A224:\n"
 356 "    BL      sub_FF82ABF8_my \n"  // --> Patched. Old value = 0xFF82ABF8.
 357 "    CMP     R0, #0 \n"
 358 "    BNE     loc_FF81A238 \n"
 359 "    BL      sub_FF82A4E0 \n"
 360 
 361 "loc_FF81A234:\n"
 362 "    B       loc_FF81A234 \n"
 363 
 364 "loc_FF81A238:\n"
 365 "    BL      sub_003F79E0 \n"
 366 "    LDR     R1, =0x34E000 \n"
 367 "    MOV     R0, #0 \n"
 368 "    BL      sub_FF831A50 \n"
 369 "    BL      sub_003F7BF8 \n"
 370 "    MOV     R3, #0 \n"
 371 "    STR     R3, [SP] \n"
 372 "    LDR     R3, =task_Startup_my \n"  // --> Patched. Old value = 0xFF81A194.
 373 "    MOV     R2, #0 \n"
 374 "    MOV     R1, #0x19 \n"
 375 "    LDR     R0, =0xFF81A278 /*'Startup'*/ \n"
 376 "    BL      _CreateTask \n"
 377 "    MOV     R0, #0 \n"
 378 "    LDMFD   SP!, {R3,PC} \n"
 379 );
 380 }
 381 
 382 /*************************************************************/
 383 //** sub_FF82ABF8_my @ 0xFF82ABF8 - 0xFF82AC5C, length=26
 384 void __attribute__((naked,noinline)) sub_FF82ABF8_my() {
 385 asm volatile (
 386 "    STMFD   SP!, {R2-R8,LR} \n"
 387 "    MOV     R6, #0 \n"
 388 "    MOV     R8, R0 \n"
 389 "    MOV     R7, R6 \n"
 390 //"  BL      _sub_FF861AE8 \n"  // --> Nullsub call removed.
 391 "    LDR     R0, =0xC0220100 \n"
 392 "    BL      sub_FF85FF18 \n"
 393 "    MOV     R4, #1 \n"
 394 "    BIC     R5, R4, R0 \n"
 395 "    LDR     R0, =0xC0220104 \n"
 396 "    BL      sub_FF85FF18 \n"
 397 "    CMP     R8, #0 \n"
 398 "    BIC     R4, R4, R0 \n"
 399 "    BEQ     loc_FF82AC38 \n"
 400 "    ORRS    R0, R5, R4 \n"
 401 "    BEQ     loc_FF82AC5C \n"
 402 
 403 "loc_FF82AC38:\n"
 404 "    BL      sub_FF8314F8 \n"
 405 "    MOV     R2, R0 \n"
 406 "    MOV     R3, #0 \n"
 407 "    MOV     R1, R4 \n"
 408 "    MOV     R0, R5 \n"
 409 "    STRD    R6, [SP] \n"
 410 //"  BL      _sub_FF861AF0 \n"  // Disable StartUpChecks
 411 //"  BL      _sub_FF861AEC \n"  // --> Nullsub call removed.
 412 "    MOV     R0, #1 \n"
 413 
 414 "loc_FF82AC5C:\n"
 415 "    LDMFD   SP!, {R2-R8,PC} \n"
 416 );
 417 }
 418 
 419 /*************************************************************/
 420 //** task_Startup_my @ 0xFF81A194 - 0xFF81A1F8, length=26
 421 void __attribute__((naked,noinline)) task_Startup_my() {
 422 asm volatile (
 423 "    STMFD   SP!, {R4,LR} \n"
 424 "    BL      sub_FF8147F8 \n"
 425 "    BL      sub_FF82BD80 \n"
 426 "    BL      sub_FF82A48C \n"
 427 //"  BL      _sub_FF862084 \n"  // --> Nullsub call removed.
 428 "    BL      sub_FF83176C \n"
 429 //"  BL      _sub_FF8315F4 \n"  // load DISKBOOT.BIN
 430 "    BL      sub_FF8318EC \n"
 431 "    BL      sub_FF8320C8 \n"
 432 "    BL      sub_FF8318B0 \n"
 433 "    BL      sub_FF8317A8 \n"
 434 "    BL      sub_FF8300EC \n"
 435 "    BL      sub_FF8320D0 \n"
 436 "    BL      CreateTask_spytask\n" // added
 437 "    BL      taskcreatePhySw_my \n"  // --> Patched. Old value = 0xFF82AA9C.
 438 "    BL      sub_FF82E534 \n"
 439 "    BL      sub_FF89F254 \n"
 440 "    BL      sub_FF82836C \n"
 441 "    BL      sub_FF829E04 \n"
 442 "    BL      sub_FF831328 \n"
 443 "    BL      sub_FF82A440 \n"
 444 "    BL      sub_FF829DA0 \n"
 445 "    BL      sub_FF850F20 \n"
 446 "    BL      sub_FF828F48 \n"
 447 "    BL      sub_FF829D64 \n"
 448 "    LDMFD   SP!, {R4,LR} \n"
 449 "    B       sub_FF814918 \n"
 450 );
 451 }
 452 
 453 /*************************************************************/
 454 //** taskcreatePhySw_my @ 0xFF82AA9C - 0xFF82AAEC, length=21
 455 void __attribute__((naked,noinline)) taskcreatePhySw_my() {
 456 asm volatile (
 457 "    STMFD   SP!, {R3-R5,LR} \n"
 458 "    LDR     R4, =0x1C90 \n"
 459 "    LDR     R0, [R4, #4] \n"
 460 "    CMP     R0, #0 \n"
 461 "    BNE     loc_FF82AAD0 \n"
 462 "    MOV     R3, #0 \n"
 463 "    STR     R3, [SP] \n"
 464 "    LDR     R3, =mykbd_task \n"  // --> Patched. Old value = 0xFF82AA68.
 465 "    MOV     R2, #0x2000 \n"  // --> Patched. Old value = 0x800. stack size for new task_PhySw so we don't have to do stack switch
 466 "    MOV     R1, #0x17 \n"
 467 "    LDR     R0, =0xFF82AD54 /*'PhySw'*/ \n"
 468 "    BL      sub_003F7C50 /*_CreateTaskStrictly*/ \n"
 469 "    STR     R0, [R4, #4] \n"
 470 
 471 "loc_FF82AAD0:\n"
 472 "    BL      sub_FF88DF3C \n"
 473 "    BL      sub_FF82C6AC /*_IsFactoryMode_FW*/ \n"
 474 "    CMP     R0, #0 \n"
 475 "    BNE     loc_FF82AAEC \n"
 476 "    LDR     R1, =0x32770 \n"
 477 "    MOV     R0, #0 \n"
 478 "    BL      sub_FF88DEA8 /*_OpLog.Start_FW*/ \n"
 479 
 480 "loc_FF82AAEC:\n"
 481 "    LDMFD   SP!, {R3-R5,PC} \n"
 482 );
 483 }
 484 
 485 /*************************************************************/
 486 //** init_file_modules_task @ 0xFF853908 - 0xFF85393C, length=14
 487 void __attribute__((naked,noinline)) init_file_modules_task() {
 488 asm volatile (
 489 "    STMFD   SP!, {R4-R6,LR} \n"
 490 "    BL      sub_FF89082C \n"
 491 "    LDR     R5, =0x5006 \n"
 492 "    MOVS    R4, R0 \n"
 493 "    MOVNE   R1, #0 \n"
 494 "    MOVNE   R0, R5 \n"
 495 "    BLNE    _PostLogicalEventToUI \n"
 496 "    BL      sub_FF890860 \n"
 497 "    BL      core_spytask_can_start\n"  // CHDK: Set "it's-safe-to-start" flag for spytask
 498 "    CMP     R4, #0 \n"
 499 "    LDMNEFD SP!, {R4-R6,PC} \n"
 500 "    MOV     R0, R5 \n"
 501 "    LDMFD   SP!, {R4-R6,LR} \n"
 502 "    MOV     R1, #0 \n"
 503 "    B       _PostLogicalEventToUI \n"
 504 );
 505 }

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