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

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

DEFINITIONS

This source file includes following definitions.
  1. capt_seq_task
  2. sub_FF960FAC_my
  3. exp_drv_task
  4. sub_FF8ABB08_my
  5. sub_FF89A730_my

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

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