root/platform/a2300/sub/100e/capt_seq.c

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

DEFINITIONS

This source file includes following definitions.
  1. capt_seq_task
  2. sub_FF960F08_my
  3. exp_drv_task
  4. sub_FF8ABA6C_my
  5. sub_FF89A730_my

   1 #include "lolevel.h"
   2 #include "platform.h"
   3 #include "core.h"
   4 #include "conf.h"
   5 
   6 static long *nrflag = (long*)(0x8748+0x00);  // Found @ ff9df408 & ff9df468
   7 #define NR_AUTO (0)                          // have to explictly reset value back to 0 to enable auto
   8 
   9 #define PAUSE_FOR_FILE_COUNTER 150           // Enable delay in capt_seq_hook_raw_here to ensure file counter is updated
  10 #include "../../../generic/capt_seq.c"
  11 
  12 //** capt_seq_task  @ 0xFF86F0F0 
  13 
  14 void __attribute__((naked,noinline)) capt_seq_task(  ) { 
  15 asm volatile (
  16       "STMFD   SP!, {R3-R9,LR} \n"
  17       "LDR     R4, =0x36C2C \n"
  18       "LDR     R7, =0x2AEC \n"
  19       "MOV     R6, #0 \n"
  20 "loc_FF86F100:\n"
  21       "LDR     R0, [R7, #4] \n"
  22       "MOV     R2, #0 \n"
  23       "MOV     R1, SP \n"
  24       "BL      sub_003F7218 \n" // RAM
  25       "TST     R0, #1 \n"
  26       "BEQ     loc_FF86F12C \n"
  27       "LDR     R1, =0x493 \n"
  28       "LDR     R0, =0xFF86EC5C \n" // "SsShootTask.c"
  29       "BL      _DebugAssert \n"
  30       "BL      _ExitTask \n"
  31       "LDMFD   SP!, {R3-R9,PC} \n"
  32 "loc_FF86F12C:\n"
  33       "LDR     R0, [SP] \n"
  34       "LDR     R1, [R0] \n"
  35       "CMP     R1, #0x20 \n"
  36       "ADDCC   PC, PC, R1, LSL #2 \n"
  37       "B       loc_FF86F394 \n"
  38       "B       loc_FF86F1C0 \n"
  39       "B       loc_FF86F1D8 \n"
  40       "B       loc_FF86F248 \n"
  41       "B       loc_FF86F25C \n"
  42       "B       loc_FF86F254 \n"
  43       "B       loc_FF86F268 \n"
  44       "B       loc_FF86F270 \n"
  45       "B       loc_FF86F278 \n"
  46       "B       loc_FF86F294 \n"
  47       "B       loc_FF86F2C0 \n"
  48       "B       loc_FF86F2A0 \n"
  49       "B       loc_FF86F2AC \n"
  50       "B       loc_FF86F2B4 \n"
  51       "B       loc_FF86F2C8 \n"
  52       "B       loc_FF86F2D0 \n"
  53       "B       loc_FF86F2D8 \n"
  54       "B       loc_FF86F2E0 \n"
  55       "B       loc_FF86F2E8 \n"
  56       "B       loc_FF86F2F4 \n"
  57       "B       loc_FF86F2FC \n"
  58       "B       loc_FF86F304 \n"
  59       "B       loc_FF86F30C \n"
  60       "B       loc_FF86F314 \n"
  61       "B       loc_FF86F320 \n"
  62       "B       loc_FF86F328 \n"
  63       "B       loc_FF86F330 \n"
  64       "B       loc_FF86F338 \n"
  65       "B       loc_FF86F340 \n"
  66       "B       loc_FF86F34C \n"
  67       "B       loc_FF86F354 \n"
  68       "B       loc_FF86F360 \n"
  69       "B       loc_FF86F3A0 \n"
  70 "loc_FF86F1C0:\n"
  71       "BL      shooting_expo_iso_override \n" // added
  72       "BL      sub_FF86F900 \n"
  73       "BL      shooting_expo_param_override \n" // added
  74       "BL      sub_FF86CF58 \n"
  75 //      "LDR     R0, [R4, #0x28] \n"
  76 //      "CMP     R0, #0 \n"
  77 //      "BLNE    sub_FF961044 \n" // above 3 lines removed - redundant with added lines below
  78       "MOV     R0, #0 \n" // patch added
  79       "STR     R0, [R4,#0x28] \n" //fixes overrides behavior at short shutter press
  80       "B       loc_FF86F3A0 \n"
  81 "loc_FF86F1D8:\n"
  82       "LDR     R5, [R0, #0x10] \n"
  83       "LDR     R0, [R4, #0x28] \n"
  84       "CMP     R0, #0 \n"
  85       "BNE     loc_FF86F220 \n"
  86       "LDR     R0, [R4, #0x8C] \n"
  87       "TST     R0, #0x30 \n"
  88       "BLNE    sub_FF870AA4 \n"
  89       "BL      sub_FF870784 \n"
  90       "MOV     R1, R5 \n"
  91       "BL      sub_FF8707DC \n"
  92       "LDR     R0, =0x10F \n"
  93       "MOV     R2, #4 \n"
  94       "ADD     R1, R5, #0x24 \n"
  95       "BL      _SetPropertyCase \n"
  96       "MOV     R2, #4 \n"
  97       "ADD     R1, R5, #0x28 \n"
  98       "MOV     R0, #0x2C \n"
  99       "BL      _SetPropertyCase \n"
 100 "loc_FF86F220:\n"
 101       "MOV     R0, R5 \n"
 102 //      "BL      sub_FF960F08 \n"  //original
 103       "BL      sub_FF960F08_my \n" //patched
 104       "BL      capt_seq_hook_raw_here \n" // patch
 105       "MOV     R8, R0 \n"
 106       "MOV     R2, R5 \n"
 107       "MOV     R1, #1 \n"
 108       "BL      sub_FF86D408 \n"
 109       "TST     R8, #1 \n"
 110       "MOVEQ   R0, R5 \n"
 111       "BLEQ    sub_FF9608FC \n"
 112       "B       loc_FF86F3A0 \n"
 113 "loc_FF86F248:\n"
 114       "MOV     R0, #1 \n"
 115       "BL      sub_FF86FBD0 \n"
 116       "B       loc_FF86F3A0 \n"
 117 "loc_FF86F254:\n"
 118       "BL      sub_FF86F568 \n"
 119       "B       loc_FF86F260 \n"
 120 "loc_FF86F25C:\n"
 121       "BL      sub_FF86F8E0 \n"
 122 "loc_FF86F260:\n"
 123       "STR     R6, [R4, #0x28] \n"
 124       "B       loc_FF86F3A0 \n"
 125 "loc_FF86F268:\n"
 126       "BL      sub_FF86F8E8 \n"
 127       "B       loc_FF86F3A0 \n"
 128 "loc_FF86F270:\n"
 129       "BL      sub_FF86FAB8 \n"
 130       "B       loc_FF86F298 \n"
 131 "loc_FF86F278:\n"
 132       "LDR     R5, [R0, #0x10] \n"
 133       "MOV     R0, R5 \n"
 134       "BL      sub_FF9610DC \n"
 135       "MOV     R2, R5 \n"
 136       "MOV     R1, #9 \n"
 137       "BL      sub_FF86D408 \n"
 138       "B       loc_FF86F3A0 \n"
 139 "loc_FF86F294:\n"
 140       "BL      sub_FF86FB38 \n"
 141 "loc_FF86F298:\n"
 142       "BL      sub_FF86CF58 \n"
 143       "B       loc_FF86F3A0 \n"
 144 "loc_FF86F2A0:\n"
 145       "LDR     R0, [R4, #0x58] \n"
 146       "BL      sub_FF86FFA8 \n"
 147       "B       loc_FF86F3A0 \n"
 148 "loc_FF86F2AC:\n"
 149       "BL      sub_FF870340 \n"
 150       "B       loc_FF86F3A0 \n"
 151 "loc_FF86F2B4:\n"
 152       "MOV     R0, #0 \n"
 153       "BL      sub_FF8703A4 \n"
 154       "B       loc_FF86F3A0 \n"
 155 "loc_FF86F2C0:\n"
 156       "BL      sub_FF86F8E0 \n"
 157       "B       loc_FF86F3A0 \n"
 158 "loc_FF86F2C8:\n"
 159       "BL      sub_FF95FCA8 \n"
 160       "B       loc_FF86F3A0 \n"
 161 "loc_FF86F2D0:\n"
 162       "BL      sub_FF95FF08 \n"
 163       "B       loc_FF86F3A0 \n"
 164 "loc_FF86F2D8:\n"
 165       "BL      sub_FF95FFC0 \n"
 166       "B       loc_FF86F3A0 \n"
 167 "loc_FF86F2E0:\n"
 168       "BL      sub_FF960094 \n"
 169       "B       loc_FF86F3A0 \n"
 170 "loc_FF86F2E8:\n"
 171       "MOV     R0, #0 \n"
 172       "BL      sub_FF9602F4 \n"
 173       "B       loc_FF86F3A0 \n"
 174 "loc_FF86F2F4:\n"
 175       "BL      sub_FF960464 \n"
 176       "B       loc_FF86F3A0 \n"
 177 "loc_FF86F2FC:\n"
 178       "BL      sub_FF9604F8 \n"
 179       "B       loc_FF86F3A0 \n"
 180 "loc_FF86F304:\n"
 181       "BL      sub_FF9605B4 \n"
 182       "B       loc_FF86F3A0 \n"
 183 "loc_FF86F30C:\n"
 184       "BL      sub_FF86FD44 \n"
 185       "B       loc_FF86F3A0 \n"
 186 "loc_FF86F314:\n"
 187       "BL      sub_FF86FDB0 \n"
 188       "BL      sub_FF832410 \n"
 189       "B       loc_FF86F3A0 \n"
 190 "loc_FF86F320:\n"
 191       "BL      sub_FF960164 \n"
 192       "B       loc_FF86F3A0 \n"
 193 "loc_FF86F328:\n"
 194       "BL      sub_FF9601A4 \n"
 195       "B       loc_FF86F3A0 \n"
 196 "loc_FF86F330:\n"
 197       "BL      sub_FF871C80 \n"
 198       "B       loc_FF86F3A0 \n"
 199 "loc_FF86F338:\n"
 200       "BL      sub_FF871CF4 \n"
 201       "B       loc_FF86F3A0 \n"
 202 "loc_FF86F340:\n"
 203       "LDR     R0, [R0, #0xC] \n"
 204       "BL      sub_FF9606DC \n"
 205       "B       loc_FF86F3A0 \n"
 206 "loc_FF86F34C:\n"
 207       "BL      sub_FF96074C \n"
 208       "B       loc_FF86F3A0 \n"
 209 "loc_FF86F354:\n"
 210       "BL      sub_FF871D5C \n"
 211       "BL      sub_FF871D14 \n"
 212       "B       loc_FF86F3A0 \n"
 213 "loc_FF86F360:\n"
 214       "MOV     R0, #1 \n"
 215       "BL      sub_FF9617F8 \n"
 216       "MOV     R0, #1 \n"
 217       "BL      sub_FF961920 \n"
 218       "LDRH    R0, [R4, #0x9C] \n"
 219       "CMP     R0, #4 \n"
 220       "LDRNEH  R0, [R4] \n"
 221       "SUBNE   R1, R0, #0x8200 \n"
 222       "SUBNES  R1, R1, #0x2E \n"
 223       "BNE     loc_FF86F3A0 \n"
 224       "BL      sub_FF871CF4 \n"
 225       "BL      sub_FF8721B8 \n"
 226       "B       loc_FF86F3A0 \n"
 227 "loc_FF86F394:\n"
 228       "LDR     R1, =0x5F4 \n"
 229       "LDR     R0, =0xFF86EC5C \n" // "SsShootTask.c"
 230       "BL      _DebugAssert \n"
 231 "loc_FF86F3A0:\n"
 232       "LDR     R0, [SP] \n"
 233       "LDR     R1, [R0, #4] \n"
 234       "LDR     R0, [R7] \n"
 235       "BL      sub_003FAC6C \n" // RAM
 236       "LDR     R5, [SP] \n"
 237       "LDR     R0, [R5, #8] \n"
 238       "CMP     R0, #0 \n"
 239       "LDREQ   R1, =0x117 \n"
 240       "LDREQ   R0, =0xFF86EC5C \n" // "SsShootTask.c"
 241       "BLEQ    _DebugAssert \n"
 242       "STR     R6, [R5, #8] \n"
 243       "B       loc_FF86F100 \n"
 244         );
 245 }
 246 
 247 //**  sub_FF960F08_my  @ 0xFF960F08
 248 
 249 void __attribute__((naked,noinline)) sub_FF960F08_my() {
 250 asm volatile (
 251       "STMFD   SP!, {R3-R7,LR} \n"
 252       "LDR     R4, =0x36C2C \n"
 253       "MOV     R6, R0 \n"
 254       "LDR     R0, [R4, #0x28] \n"
 255       "MOV     R5, #0 \n"
 256       "CMP     R0, #0 \n"
 257       "BNE     loc_FF960F38 \n"
 258       "MOV     R0, #0xC \n"
 259       "BL      sub_FF87373C \n"
 260       "TST     R0, #1 \n"
 261       "MOVNE   R0, #1 \n"
 262       "BNE     loc_FF961040 \n"
 263 "loc_FF960F38:\n"
 264       "BL      sub_FF86F8F0 \n"
 265       "LDR     R0, [R4, #0x28] \n"
 266       "CMP     R0, #0 \n"
 267       "BNE     loc_FF96102C \n"
 268       "MOV     R0, R6 \n"
 269       "BL      sub_FF96083C \n"
 270       "TST     R0, #1 \n"
 271       "BNE     loc_FF961040 \n"
 272       "LDR     R0, [R4, #0x8C] \n"
 273       "AND     R0, R0, #0x40 \n"
 274       "CMP     R0, #0 \n"
 275       "LDRNEH  R0, [R4, #0x9A] \n"
 276       "CMPNE   R0, #3 \n"
 277       "LDRNE   R0, [R6, #8] \n"
 278       "CMPNE   R0, #1 \n"
 279       "BLS     loc_FF960F94 \n"
 280       "BL      sub_FF961AE0 \n"
 281       "MOV     R3, #0xC0 \n"
 282       "STR     R3, [SP] \n"
 283       "LDR     R2, =0x3A98 \n"
 284       "LDR     R3, =0xFF961164 \n" //SsCaptureSeq.c
 285       "MOV     R1, #0x8000 \n"
 286       "BL      sub_FF8739A4 \n"
 287 "loc_FF960F94:\n"
 288       "MOV     R0, R6 \n"
 289       "BL      sub_FF960B48 \n"
 290       "BL      sub_FF9615D8 \n"
 291 
 292       "BL      wait_until_remote_button_is_released\n"  //before shoot XXX
 293       "BL      capt_seq_hook_set_nr\n"
 294 
 295       "LDR     R0, [R4, #0x8C] \n"
 296       "TST     R0, #0x40 \n"
 297       "BEQ     loc_FF961008 \n"
 298       "LDR     R0, =0x181 \n"
 299       "MOV     R2, #4 \n"
 300       "MOV     R1, SP \n"
 301       "BL      _GetPropertyCase \n"
 302       "TST     R0, #1 \n"
 303       "MOVNE   R1, #0xD4 \n"
 304       "LDRNE   R0, =0xFF961164 \n"  // SsCaptureSeq.c
 305       "BLNE    _DebugAssert \n"
 306       "LDR     R0, [SP] \n"
 307       "CMP     R0, #0 \n"
 308       "BNE     loc_FF960FE8 \n"
 309       "BL      sub_FF961AE0 \n"
 310       "MOV     R1, #0x8000 \n"
 311       "BL      sub_003FAC6C \n" //RAM
 312       "B       loc_FF961008 \n"
 313 "loc_FF960FE8:\n"
 314       "BL      sub_FF961AE0 \n"
 315       "MOV     R1, #0x8000 \n"
 316       "BL      sub_003FACA0 \n" //RAM
 317       "LDR     R2, =0xFF960EF4 \n"
 318       "LDR     R0, [SP] \n"
 319       "MOV     R3, #0x8000 \n"
 320       "ADD     R1, R2, #0 \n"
 321       "BL      sub_FF8346B0 \n"
 322 "loc_FF961008:\n"
 323       "LDR     R0, [R4, #0x8C] \n"
 324       "TST     R0, #0x10 \n"
 325       "MOV     R0, R6 \n"
 326       "BEQ     loc_FF961020 \n"
 327       "BL      sub_FFA6EF04 \n"
 328       "B       loc_FF961024 \n"
 329 "loc_FF961020:\n"
 330       "BL      sub_FFA6EB60 \n"
 331 "loc_FF961024:\n"
 332       "MOV     R5, R0 \n"
 333       "B       loc_FF96103C \n"
 334 "loc_FF96102C:\n"
 335       "LDR     R0, =0x6784 \n"
 336       "LDR     R0, [R0] \n"
 337       "CMP     R0, #0 \n"
 338       "MOVNE   R5, #0x1D \n"
 339 "loc_FF96103C:\n"
 340       "MOV     R0, R5 \n"
 341 "loc_FF961040:\n"
 342       "LDMFD   SP!, {R3-R7,PC} \n"
 343         );
 344 }
 345 
 346 //** exp_drv_task  @ 0xFF8AEDF4 
 347 
 348 void __attribute__((naked,noinline)) exp_drv_task(  ) { 
 349 asm volatile (
 350       "STMFD   SP!, {R4-R9,LR} \n"
 351       "SUB     SP, SP, #0x2C \n"
 352       "LDR     R6, =0x3DA0 \n"
 353       "LDR     R7, =0xBB8 \n"
 354       "LDR     R4, =0x55E1C \n"
 355       "MOV     R0, #0 \n"
 356       "ADD     R5, SP, #0x1C \n"
 357       "STR     R0, [SP, #0xC] \n"
 358 "loc_FF8AEE14:\n"
 359       "LDR     R0, [R6, #0x20] \n"
 360       "MOV     R2, #0 \n"
 361       "ADD     R1, SP, #0x28 \n"
 362       "BL      sub_003F7218 \n" //RAM
 363       "LDR     R0, [SP, #0xC] \n"
 364       "CMP     R0, #1 \n"
 365       "BNE     loc_FF8AEE60 \n"
 366       "LDR     R0, [SP, #0x28] \n"
 367       "LDR     R0, [R0] \n"
 368       "CMP     R0, #0x14 \n"
 369       "CMPNE   R0, #0x15 \n"
 370       "CMPNE   R0, #0x16 \n"
 371       "CMPNE   R0, #0x17 \n"
 372       "BEQ     loc_FF8AEFC0 \n"
 373       "CMP     R0, #0x2A \n"
 374       "BEQ     loc_FF8AEF48 \n"
 375       "ADD     R1, SP, #0xC \n"
 376       "MOV     R0, #0 \n"
 377       "BL      sub_FF8AEDA4 \n"
 378 "loc_FF8AEE60:\n"
 379       "LDR     R0, [SP, #0x28] \n"
 380       "LDR     R1, [R0] \n"
 381       "CMP     R1, #0x30 \n"
 382       "BNE     loc_FF8AEE8C \n"
 383       "BL      sub_FF8B01D0 \n"
 384       "LDR     R0, [R6, #0x1C] \n"
 385       "MOV     R1, #1 \n"
 386       "BL      sub_003FAC6C \n" //RAM
 387       "BL      _ExitTask \n"
 388       "ADD     SP, SP, #0x2C \n"
 389       "LDMFD   SP!, {R4-R9,PC} \n"
 390 "loc_FF8AEE8C:\n"
 391       "CMP     R1, #0x2F \n"
 392       "BNE     loc_FF8AEEA8 \n"
 393       "LDR     R2, [R0, #0x8C]! \n"
 394       "LDR     R1, [R0, #4] \n"
 395       "MOV     R0, R1 \n"
 396       "BLX     R2 \n"
 397       "B       loc_FF8AF47C \n"
 398 "loc_FF8AEEA8:\n"
 399       "CMP     R1, #0x28 \n"
 400       "BNE     loc_FF8AEEF8 \n"
 401       "LDR     R0, [R6, #0x1C] \n"
 402       "MOV     R1, #0x80 \n"
 403       "BL      sub_003FACA0 \n" //RAM
 404       "LDR     R0, =0xFF8AA710 \n"
 405       "MOV     R1, #0x80 \n"
 406       "BL      sub_FF954ED0 \n"
 407       "LDR     R0, [R6, #0x1C] \n"
 408       "MOV     R2, R7 \n"
 409       "MOV     R1, #0x80 \n"
 410       "BL      sub_003FABAC \n" //RAM
 411       "TST     R0, #1 \n"
 412       "LDRNE   R1, =0x1599 \n"
 413       "BNE     loc_FF8AEFB4 \n"
 414 "loc_FF8AEEE4:\n"
 415       "LDR     R1, [SP, #0x28] \n"
 416       "LDR     R0, [R1, #0x90] \n"
 417       "LDR     R1, [R1, #0x8C] \n"
 418       "BLX     R1 \n"
 419       "B       loc_FF8AF47C \n"
 420 "loc_FF8AEEF8:\n"
 421       "CMP     R1, #0x29 \n"
 422       "BNE     loc_FF8AEF40 \n"
 423       "ADD     R1, SP, #0xC \n"
 424       "BL      sub_FF8AEDA4 \n"
 425       "LDR     R0, [R6, #0x1C] \n"
 426       "MOV     R1, #0x100 \n"
 427       "BL      sub_003FACA0 \n" //RAM
 428       "LDR     R0, =0xFF8AA720 \n"
 429       "MOV     R1, #0x100 \n"
 430       "BL      sub_FF955070 \n"
 431       "LDR     R0, [R6, #0x1C] \n"
 432       "MOV     R2, R7 \n"
 433       "MOV     R1, #0x100 \n"
 434       "BL      sub_003FABAC \n" //RAM
 435       "TST     R0, #1 \n"
 436       "BEQ     loc_FF8AEEE4 \n"
 437       "LDR     R1, =0x15A3 \n"
 438       "B       loc_FF8AEFB4 \n"
 439 "loc_FF8AEF40:\n"
 440       "CMP     R1, #0x2A \n"
 441       "BNE     loc_FF8AEF58 \n"
 442 "loc_FF8AEF48:\n"
 443       "LDR     R0, [SP, #0x28] \n"
 444       "ADD     R1, SP, #0xC \n"
 445       "BL      sub_FF8AEDA4 \n"
 446       "B       loc_FF8AEEE4 \n"
 447 "loc_FF8AEF58:\n"
 448       "CMP     R1, #0x2D \n"
 449       "BNE     loc_FF8AEF70 \n"
 450       "BL      sub_FF89A9E4 \n"
 451       "BL      sub_FF89B6CC \n"
 452       "BL      sub_FF89B234 \n"
 453       "B       loc_FF8AEEE4 \n"
 454 "loc_FF8AEF70:\n"
 455       "CMP     R1, #0x2E \n"
 456       "BNE     loc_FF8AEFC0 \n"
 457       "LDR     R0, [R6, #0x1C] \n"
 458       "MOV     R1, #4 \n"
 459       "BL      sub_003FACA0 \n" //RAM
 460       "LDR     R1, =0xFF8AA740 \n"
 461       "LDR     R0, =0xFFFFF400 \n"
 462       "MOV     R2, #4 \n"
 463       "BL      sub_FF89A434 \n"
 464       "BL      sub_FF89A6C4 \n"
 465       "LDR     R0, [R6, #0x1C] \n"
 466       "MOV     R2, R7 \n"
 467       "MOV     R1, #4 \n"
 468       "BL      sub_003FAAC8 \n" //RAM
 469       "TST     R0, #1 \n"
 470       "BEQ     loc_FF8AEEE4 \n"
 471       "LDR     R1, =0x15CB \n"
 472 "loc_FF8AEFB4:\n"
 473       "LDR     R0, =0xFF8AAE34 \n" // "ExpDrv.c"
 474       "BL      _DebugAssert \n"
 475       "B       loc_FF8AEEE4 \n"
 476 "loc_FF8AEFC0:\n"
 477       "LDR     R0, [SP, #0x28] \n"
 478       "MOV     R8, #1 \n"
 479       "LDR     R1, [R0] \n"
 480       "CMP     R1, #0x12 \n"
 481       "CMPNE   R1, #0x13 \n"
 482       "BNE     loc_FF8AF028 \n"
 483       "LDR     R1, [R0, #0x7C] \n"
 484       "ADD     R1, R1, R1, LSL #1 \n"
 485       "ADD     R1, R0, R1, LSL #2 \n"
 486       "SUB     R1, R1, #8 \n"
 487       "LDMIA   R1, {R2,R3,R9} \n"
 488       "STMIA   R5, {R2,R3,R9} \n"
 489       "BL      sub_FF8AD348 \n"
 490       "LDR     R0, [SP, #0x28] \n"
 491       "LDR     R1, [R0, #0x7C] \n"
 492       "LDR     R3, [R0, #0x8C] \n"
 493       "LDR     R2, [R0, #0x90] \n"
 494       "ADD     R0, R0, #4 \n"
 495       "BLX     R3 \n"
 496       "LDR     R0, [SP, #0x28] \n"
 497       "BL      sub_FF8B05D4 \n"
 498       "LDR     R0, [SP, #0x28] \n"
 499       "LDR     R1, [R0, #0x7C] \n"
 500       "LDR     R2, [R0, #0x98] \n"
 501       "LDR     R3, [R0, #0x94] \n"
 502       "B       loc_FF8AF340 \n"
 503 "loc_FF8AF028:\n"
 504       "CMP     R1, #0x14 \n"
 505       "CMPNE   R1, #0x15 \n"
 506       "CMPNE   R1, #0x16 \n"
 507       "CMPNE   R1, #0x17 \n"
 508       "BNE     loc_FF8AF0E0 \n"
 509       "ADD     R3, SP, #0xC \n"
 510       "MOV     R2, SP \n"
 511       "ADD     R1, SP, #0x1C \n"
 512       "BL      sub_FF8AD5A8 \n"
 513       "CMP     R0, #1 \n"
 514       "MOV     R9, R0 \n"
 515       "CMPNE   R9, #5 \n"
 516       "BNE     loc_FF8AF07C \n"
 517       "LDR     R0, [SP, #0x28] \n"
 518       "MOV     R2, R9 \n"
 519       "LDR     R1, [R0, #0x7C]! \n"
 520       "LDR     R12, [R0, #0x10]! \n"
 521       "LDR     R3, [R0, #4] \n"
 522       "MOV     R0, SP \n"
 523       "BLX     R12 \n"
 524       "B       loc_FF8AF0B4 \n"
 525 "loc_FF8AF07C:\n"
 526       "LDR     R0, [SP, #0x28] \n"
 527       "CMP     R9, #2 \n"
 528       "LDR     R3, [R0, #0x90] \n"
 529       "CMPNE   R9, #6 \n"
 530       "BNE     loc_FF8AF0C8 \n"
 531       "LDR     R12, [R0, #0x8C] \n"
 532       "MOV     R2, R9 \n"
 533       "MOV     R1, #1 \n"
 534       "MOV     R0, SP \n"
 535       "BLX     R12 \n"
 536       "LDR     R0, [SP, #0x28] \n"
 537       "MOV     R2, SP \n"
 538       "ADD     R1, SP, #0x1C \n"
 539       "BL      sub_FF8AEA90 \n"
 540 "loc_FF8AF0B4:\n"
 541       "LDR     R0, [SP, #0x28] \n"
 542       "LDR     R2, [SP, #0xC] \n"
 543       "MOV     R1, R9 \n"
 544       "BL      sub_FF8AECE0 \n"
 545       "B       loc_FF8AF348 \n"
 546 "loc_FF8AF0C8:\n"
 547       "LDR     R1, [R0, #0x7C] \n"
 548       "LDR     R12, [R0, #0x8C] \n"
 549       "MOV     R2, R9 \n"
 550       "ADD     R0, R0, #4 \n"
 551       "BLX     R12 \n"
 552       "B       loc_FF8AF348 \n"
 553 "loc_FF8AF0E0:\n"
 554       "CMP     R1, #0x24 \n"
 555       "CMPNE   R1, #0x25 \n"
 556       "BNE     loc_FF8AF12C \n"
 557       "LDR     R1, [R0, #0x7C] \n"
 558       "ADD     R1, R1, R1, LSL #1 \n"
 559       "ADD     R1, R0, R1, LSL #2 \n"
 560       "SUB     R1, R1, #8 \n"
 561       "LDMIA   R1, {R2,R3,R9} \n"
 562       "STMIA   R5, {R2,R3,R9} \n"
 563       "BL      sub_FF8AC334 \n"
 564       "LDR     R0, [SP, #0x28] \n"
 565       "LDR     R1, [R0, #0x7C] \n"
 566       "LDR     R3, [R0, #0x8C] \n"
 567       "LDR     R2, [R0, #0x90] \n"
 568       "ADD     R0, R0, #4 \n"
 569       "BLX     R3 \n"
 570       "LDR     R0, [SP, #0x28] \n"
 571       "BL      sub_FF8AC774 \n"
 572       "B       loc_FF8AF348 \n"
 573 "loc_FF8AF12C:\n"
 574       "ADD     R1, R0, #4 \n"
 575       "LDMIA   R1, {R2,R3,R9} \n"
 576       "STMIA   R5, {R2,R3,R9} \n"
 577       "LDR     R1, [R0] \n"
 578       "CMP     R1, #0x28 \n"
 579       "ADDCC   PC, PC, R1, LSL #2 \n"
 580       "B       loc_FF8AF330 \n"
 581       "B       loc_FF8AF1E8 \n" //(01)
 582       "B       loc_FF8AF1E8 \n" //(02)
 583       "B       loc_FF8AF1F0 \n" //(03)
 584       "B       loc_FF8AF1F8 \n" //(04)
 585       "B       loc_FF8AF1F8 \n" //(05)
 586       "B       loc_FF8AF1F8 \n" //(06)
 587       "B       loc_FF8AF1E8 \n" //(07)
 588       "B       loc_FF8AF1F0 \n" //(08)
 589       "B       loc_FF8AF1F8 \n" //(09)
 590       "B       loc_FF8AF1F8 \n" //(10)
 591       "B       loc_FF8AF210 \n" //(11)
 592       "B       loc_FF8AF210 \n" //(12)
 593       "B       loc_FF8AF31C \n" //(13)
 594       "B       loc_FF8AF324 \n" //(14)
 595       "B       loc_FF8AF324 \n" //(15)
 596       "B       loc_FF8AF324 \n" //(16)
 597       "B       loc_FF8AF324 \n" //(17)
 598       "B       loc_FF8AF32C \n" //(18)
 599       "B       loc_FF8AF330 \n" //(19)
 600       "B       loc_FF8AF330 \n" //(20)
 601       "B       loc_FF8AF330 \n" //(21)
 602       "B       loc_FF8AF330 \n" //(22)
 603       "B       loc_FF8AF330 \n" //(23)
 604       "B       loc_FF8AF330 \n" //(24)
 605       "B       loc_FF8AF200 \n" //(25)
 606       "B       loc_FF8AF208 \n" //(26)
 607       "B       loc_FF8AF208 \n" //(27)
 608       "B       loc_FF8AF208 \n" //(28)
 609       "B       loc_FF8AF21C \n" //(29)
 610       "B       loc_FF8AF21C \n" //(30)
 611       "B       loc_FF8AF224 \n" //(31)
 612       "B       loc_FF8AF25C \n" //(32)
 613       "B       loc_FF8AF294 \n" //(33)
 614       "B       loc_FF8AF2CC \n" //(34)
 615       "B       loc_FF8AF304 \n" //(35)
 616       "B       loc_FF8AF304 \n" //(36)
 617       "B       loc_FF8AF330 \n" //(37)
 618       "B       loc_FF8AF330 \n" //(38)
 619       "B       loc_FF8AF30C \n" //(39)
 620       "B       loc_FF8AF314 \n" //(40)
 621 "loc_FF8AF1E8:\n" // jump table entries 01-02,07
 622       "BL      sub_FF8AACB8 \n"
 623       "B       loc_FF8AF330 \n"
 624 "loc_FF8AF1F0:\n"// jump table entry 03
 625       "BL      sub_FF8AAF5C \n"
 626       "B       loc_FF8AF330 \n"
 627 "loc_FF8AF1F8:\n" // jump table entries 04-06,09-10
 628       "BL      sub_FF8AB184 \n"
 629       "B       loc_FF8AF330 \n"
 630 "loc_FF8AF200:\n" // jump table entries 25
 631       "BL      sub_FF8AB4A8 \n"
 632       "B       loc_FF8AF330 \n"
 633 "loc_FF8AF208:\n" // jump table entries 26-27
 634       "BL      sub_FF8AB6C0 \n"
 635       "B       loc_FF8AF330 \n"
 636 "loc_FF8AF210:\n" // jump table entries 11,12
 637 //      "BL      sub_FF8ABA6C \n" //original
 638       "BL      sub_FF8ABA6C_my \n" //patched
 639       "MOV     R8, #0 \n"
 640       "B       loc_FF8AF330 \n"
 641 "loc_FF8AF21C:\n" // jump table entries 29,30
 642       "BL      sub_FF8ABBAC \n"
 643       "B       loc_FF8AF330 \n"
 644 "loc_FF8AF224:\n" // jump table entry 31
 645       "LDRH    R1, [R0, #4] \n"
 646       "STRH    R1, [SP, #0x1C] \n"
 647       "LDRH    R1, [R4, #2] \n"
 648       "STRH    R1, [SP, #0x1E] \n"
 649       "LDRH    R1, [R4, #4] \n"
 650       "STRH    R1, [SP, #0x20] \n"
 651       "LDRH    R1, [R4, #6] \n"
 652       "STRH    R1, [SP, #0x22] \n"
 653       "LDRH    R1, [R0, #0xC] \n"
 654       "STRH    R1, [SP, #0x24] \n"
 655       "LDRH    R1, [R4, #0xA] \n"
 656       "STRH    R1, [SP, #0x26] \n"
 657       "BL      sub_FF8B0264 \n"
 658       "B       loc_FF8AF330 \n"
 659 "loc_FF8AF25C:\n" // jump table entry 32
 660       "LDRH    R1, [R0, #4] \n"
 661       "STRH    R1, [SP, #0x1C] \n"
 662       "LDRH    R1, [R4, #2] \n"
 663       "STRH    R1, [SP, #0x1E] \n"
 664       "LDRH    R1, [R4, #4] \n"
 665       "STRH    R1, [SP, #0x20] \n"
 666       "LDRH    R1, [R4, #6] \n"
 667       "STRH    R1, [SP, #0x22] \n"
 668       "LDRH    R1, [R4, #8] \n"
 669       "STRH    R1, [SP, #0x24] \n"
 670       "LDRH    R1, [R4, #0xA] \n"
 671       "STRH    R1, [SP, #0x26] \n"
 672       "BL      sub_FF8B03D4 \n"
 673       "B       loc_FF8AF330 \n"
 674 "loc_FF8AF294:\n" // jump table entry 33
 675       "LDRH    R1, [R4] \n"
 676       "STRH    R1, [SP, #0x1C] \n"
 677       "LDRH    R1, [R0, #6] \n"
 678       "STRH    R1, [SP, #0x1E] \n"
 679       "LDRH    R1, [R4, #4] \n"
 680       "STRH    R1, [SP, #0x20] \n"
 681       "LDRH    R1, [R4, #6] \n"
 682       "STRH    R1, [SP, #0x22] \n"
 683       "LDRH    R1, [R4, #8] \n"
 684       "STRH    R1, [SP, #0x24] \n"
 685       "LDRH    R1, [R4, #0xA] \n"
 686       "STRH    R1, [SP, #0x26] \n"
 687       "BL      sub_FF8B0488 \n"
 688       "B       loc_FF8AF330 \n"
 689 "loc_FF8AF2CC:\n" // jump table entry 34
 690       "LDRH    R1, [R4] \n"
 691       "STRH    R1, [SP, #0x1C] \n"
 692       "LDRH    R1, [R4, #2] \n"
 693       "STRH    R1, [SP, #0x1E] \n"
 694       "LDRH    R1, [R4, #4] \n"
 695       "STRH    R1, [SP, #0x20] \n"
 696       "LDRH    R1, [R4, #6] \n"
 697       "STRH    R1, [SP, #0x22] \n"
 698       "LDRH    R1, [R0, #0xC] \n"
 699       "STRH    R1, [SP, #0x24] \n"
 700       "LDRH    R1, [R4, #0xA] \n"
 701       "STRH    R1, [SP, #0x26] \n"
 702       "BL      sub_FF8B0530 \n"
 703       "B       loc_FF8AF330 \n"
 704 "loc_FF8AF304:\n" // jump table entries 35-36
 705       "BL      sub_FF8AC0E8 \n"
 706       "B       loc_FF8AF330 \n"
 707 "loc_FF8AF30C:\n" // jump table entry 39
 708       "BL      sub_FF8AC878 \n"
 709       "B       loc_FF8AF330 \n"
 710 "loc_FF8AF314:\n" // jump table entry 40
 711       "BL      sub_FF8ACB5C \n"
 712       "B       loc_FF8AF330 \n"
 713 "loc_FF8AF31C:\n" // jump table entry 13
 714       "BL      sub_FF8ACE1C \n"
 715       "B       loc_FF8AF330 \n"
 716 "loc_FF8AF324:\n"  // jump table entries 14-17
 717       "BL      sub_FF8ACFD8 \n"
 718       "B       loc_FF8AF330 \n"
 719 "loc_FF8AF32C:\n" // jump table entry 18
 720       "BL      sub_FF8AD140 \n"
 721 "loc_FF8AF330:\n" // jump table default entry
 722       "LDR     R0, [SP, #0x28] \n"
 723       "LDR     R1, [R0, #0x7C] \n"
 724       "LDR     R2, [R0, #0x90] \n"
 725       "LDR     R3, [R0, #0x8C] \n"
 726 "loc_FF8AF340:\n"
 727       "ADD     R0, R0, #4 \n"
 728       "BLX     R3 \n"
 729 "loc_FF8AF348:\n"
 730       "LDR     R0, [SP, #0x28] \n"
 731       "LDR     R0, [R0] \n"
 732       "CMP     R0, #0x10 \n"
 733       "BEQ     loc_FF8AF380 \n"
 734       "BGT     loc_FF8AF370 \n"
 735       "CMP     R0, #1 \n"
 736       "CMPNE   R0, #4 \n"
 737       "CMPNE   R0, #0xE \n"
 738       "BNE     loc_FF8AF3B4 \n"
 739       "B       loc_FF8AF380 \n"
 740 "loc_FF8AF370:\n"
 741       "CMP     R0, #0x13 \n"
 742       "CMPNE   R0, #0x17 \n"
 743       "CMPNE   R0, #0x1A \n"
 744       "BNE     loc_FF8AF3B4 \n"
 745 "loc_FF8AF380:\n"
 746       "LDRSH   R0, [R4] \n"
 747       "CMN     R0, #0xC00 \n"
 748       "LDRNESH R1, [R4, #8] \n"
 749       "CMNNE   R1, #0xC00 \n"
 750       "STRNEH  R0, [SP, #0x1C] \n"
 751       "STRNEH  R1, [SP, #0x24] \n"
 752       "BNE     loc_FF8AF3B4 \n"
 753       "ADD     R0, SP, #0x10 \n"
 754       "BL      sub_FF8B07E4 \n"
 755       "LDRH    R0, [SP, #0x10] \n"
 756       "STRH    R0, [SP, #0x1C] \n"
 757       "LDRH    R0, [SP, #0x18] \n"
 758       "STRH    R0, [SP, #0x24] \n"
 759 "loc_FF8AF3B4:\n"
 760       "LDR     R0, [SP, #0x28] \n"
 761       "CMP     R8, #1 \n"
 762       "BNE     loc_FF8AF404 \n"
 763       "LDR     R1, [R0, #0x7C] \n"
 764       "MOV     R2, #0xC \n"
 765       "ADD     R1, R1, R1, LSL #1 \n"
 766       "ADD     R0, R0, R1, LSL #2 \n"
 767       "SUB     R8, R0, #8 \n"
 768       "LDR     R0, =0x55E1C \n"
 769       "ADD     R1, SP, #0x1C \n"
 770       "BL      sub_003FC17C \n"
 771       "LDR     R0, =0x55E28 \n"
 772       "MOV     R2, #0xC \n"
 773       "ADD     R1, SP, #0x1C \n"
 774       "BL      sub_003FC17C \n"
 775       "LDR     R0, =0x55E34 \n"
 776       "MOV     R2, #0xC \n"
 777       "MOV     R1, R8 \n"
 778       "BL      sub_003FC17C \n"
 779       "B       loc_FF8AF47C \n"
 780 "loc_FF8AF404:\n"
 781       "LDR     R0, [R0] \n"
 782       "MOV     R3, #1 \n"
 783       "CMP     R0, #0xB \n"
 784       "BNE     loc_FF8AF448 \n"
 785       "MOV     R2, #0 \n"
 786       "STRD    R2, [SP] \n"
 787       "MOV     R2, R3 \n"
 788       "MOV     R1, R3 \n"
 789       "MOV     R0, #0 \n"
 790       "BL      sub_FF8AAA98 \n"
 791       "MOV     R3, #1 \n"
 792       "MOV     R2, #0 \n"
 793       "STRD    R2, [SP] \n"
 794       "MOV     R2, R3 \n"
 795       "MOV     R1, R3 \n"
 796       "MOV     R0, #0 \n"
 797       "B       loc_FF8AF478 \n"
 798 "loc_FF8AF448:\n"
 799       "MOV     R2, #1 \n"
 800       "STRD    R2, [SP] \n"
 801       "MOV     R3, R2 \n"
 802       "MOV     R1, R2 \n"
 803       "MOV     R0, R2 \n"
 804       "BL      sub_FF8AAA98 \n"
 805       "MOV     R3, #1 \n"
 806       "MOV     R2, R3 \n"
 807       "MOV     R1, R3 \n"
 808       "MOV     R0, R3 \n"
 809       "STR     R3, [SP] \n"
 810       "STR     R3, [SP, #4] \n"
 811 "loc_FF8AF478:\n"
 812       "BL      sub_FF8AAC04 \n"
 813 "loc_FF8AF47C:\n"
 814       "LDR     R0, [SP, #0x28] \n"
 815       "BL      sub_FF8B01D0 \n"
 816       "B       loc_FF8AEE14 \n"
 817         );
 818 }
 819 //** sub_FF8ABA6C_my  @ 0xFF8ABA6C
 820 
 821 void __attribute__((naked,noinline)) sub_FF8ABA6C_my() {
 822 asm volatile (
 823       "STMFD   SP!, {R4-R8,LR} \n"
 824       "LDR     R7, =0x3DA0 \n"
 825       "MOV     R4, R0 \n"
 826       "LDR     R0, [R7, #0x1C] \n"
 827       "MOV     R1, #0x3E \n"
 828       "BL      sub_003FACA0 \n"
 829       "MOV     R2, #0 \n"
 830       "LDRSH   R0, [R4, #4] \n"
 831       "MOV     R1, R2 \n"
 832       "BL      sub_FF8AA7A0 \n"
 833       "MOV     R6, R0 \n"
 834       "LDRSH   R0, [R4, #6] \n"
 835       "BL      sub_FF8AA8F0 \n"
 836       "LDRSH   R0, [R4, #8] \n"
 837       "BL      sub_FF8AA948 \n"
 838       "LDRSH   R0, [R4, #0xA] \n"
 839       "BL      sub_FF8AA9A0 \n"
 840       "LDRSH   R0, [R4, #0xC] \n"
 841       "MOV     R1, #0 \n"
 842       "BL      sub_FF8AA9F8 \n"
 843       "MOV     R5, R0 \n"
 844       "LDR     R0, [R4] \n"
 845       "LDR     R8, =0x55E34 \n"
 846       "CMP     R0, #0xB \n"
 847       "MOVEQ   R6, #0 \n"
 848       "MOVEQ   R5, R6 \n"
 849       "BEQ     loc_FF8ABB00 \n"
 850       "CMP     R6, #1 \n"
 851       "BNE     loc_FF8ABB00 \n"
 852       "LDRSH   R0, [R4, #4] \n"
 853       "LDR     R1, =0xFF8AA700 \n"
 854       "MOV     R2, #2 \n"
 855       "BL      sub_FF954F54 \n"
 856       "STRH    R0, [R4, #4] \n"
 857       "MOV     R0, #0 \n"
 858       "STR     R0, [R7, #0x28] \n"
 859       "B       loc_FF8ABB08 \n"
 860 "loc_FF8ABB00:\n"
 861       "LDRH    R0, [R8] \n"
 862       "STRH    R0, [R4, #4] \n"
 863 "loc_FF8ABB08:\n"
 864       "CMP     R5, #1 \n"
 865       "LDRNEH  R0, [R8, #8] \n"
 866       "BNE     loc_FF8ABB24 \n"
 867       "LDRSH   R0, [R4, #0xC] \n"
 868       "LDR     R1, =0xFF8AA784 \n"
 869       "MOV     R2, #0x20 \n"
 870       "BL      sub_FF8B0220 \n"
 871 "loc_FF8ABB24:\n"
 872       "STRH    R0, [R4, #0xC] \n"
 873       "LDRSH   R0, [R4, #6] \n"
 874 //      "BL      sub_FF89A730 \n" // original
 875       "BL      sub_FF89A730_my \n" //patched
 876       "B sub_FF8ABB30 \n" // continue in firmware
 877         );
 878 }
 879 
 880 //** sub_FF89A730_my  @ 0xFF89A730 
 881 
 882 void __attribute__((naked,noinline)) sub_FF89A730_my() {
 883 asm volatile (
 884       "STMFD   SP!, {R4-R6,LR} \n"
 885       "LDR     R5, =0x39F0 \n"
 886       "MOV     R4, R0 \n"
 887       "LDR     R0, [R5, #4] \n"
 888       "CMP     R0, #1 \n"
 889       "LDRNE   R1, =0x14D \n"
 890       "LDRNE   R0, =0xFF89A568 \n" //  ; "Shutter.c"
 891       "BLNE    _DebugAssert \n"
 892       "CMN     R4, #0xC00 \n"
 893       "LDREQSH R4, [R5, #2] \n"
 894       "CMN     R4, #0xC00 \n"
 895       "LDREQ   R1, =0x153 \n"
 896       "LDREQ   R0, =0xFF89A568 \n" //  ; "Shutter.c"
 897       "STRH    R4, [R5, #2] \n"
 898       "BLEQ    _DebugAssert \n"
 899       "MOV     R0, R4 \n"
 900 //      "BL      _apex2us \n"   //original _apex2us
 901       "BL      apex2us \n"   //patched function
 902       "MOV     R4, R0 \n"
 903       "BL      sub_FF8E9AB0 \n"
 904       "MOV     R0, R4 \n"
 905       "BL      sub_FF8F22B8 \n"
 906       "TST     R0, #1 \n"
 907       "LDMEQFD SP!, {R4-R6,PC} \n"
 908       "LDMFD   SP!, {R4-R6,LR} \n"
 909       "MOV     R1, #0x158 \n"
 910       "LDR     R0, =0xFF89A568 \n" //  ; "Shutter.c"
 911       "B       _DebugAssert \n"
 912         );
 913 }

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