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

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

DEFINITIONS

This source file includes following definitions.
  1. capt_seq_task
  2. sub_FF960D4C_my
  3. exp_drv_task
  4. sub_FF8AB54C_my
  5. sub_FF89A150_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*)(0x8744+0x00);  // Found @ ff9df57c & ff9df5dc
   8 #define NR_AUTO (0)                          // have to explictly reset value back to 0 to enable auto
   9 
  10 #define PAUSE_FOR_FILE_COUNTER 250           // 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  @ 0xFF86ECA8 
  14 
  15 void __attribute__((naked,noinline)) capt_seq_task(  ) { 
  16 asm volatile (
  17       "STMFD   SP!, {R3-R7,LR} \n"
  18       "LDR     R5, =0x36C34 \n"
  19       "LDR     R6, =0x2ACC \n"
  20 "loc_FF86ECB4:\n"
  21       "MOV     R2, #0 \n"
  22       "LDR     R0, [R6, #4] \n"
  23       "MOV     R1, SP \n"
  24       "BL      sub_003F7218 \n" // RAM
  25       "TST     R0, #1 \n"
  26       "BEQ     loc_FF86ECE0 \n"
  27       "LDR     R1, =0x493 \n"
  28       "LDR     R0, =0xFF86E814 \n" // **"SsShootTask.c"
  29       "BL      _DebugAssert \n"
  30       "BL      _ExitTask \n"
  31       "LDMFD   SP!, {R3-R7,PC} \n"
  32 "loc_FF86ECE0:\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_FF86EF20 \n"
  38       "B       loc_FF86ED74 \n"
  39       "B       loc_FF86ED7C \n"
  40       "B       loc_FF86EDE0 \n"
  41       "B       loc_FF86EDF4 \n"
  42       "B       loc_FF86EDEC \n"
  43       "B       loc_FF86EDFC \n"
  44       "B       loc_FF86EE04 \n"
  45       "B       loc_FF86EE10 \n"
  46       "B       loc_FF86EE2C \n"
  47       "B       loc_FF86EDF4 \n"
  48       "B       loc_FF86EE34 \n"
  49       "B       loc_FF86EE40 \n"
  50       "B       loc_FF86EE48 \n"
  51       "B       loc_FF86EE54 \n"
  52       "B       loc_FF86EE5C \n"
  53       "B       loc_FF86EE64 \n"
  54       "B       loc_FF86EE6C \n"
  55       "B       loc_FF86EE74 \n"
  56       "B       loc_FF86EE80 \n"
  57       "B       loc_FF86EE88 \n"
  58       "B       loc_FF86EE90 \n"
  59       "B       loc_FF86EE98 \n"
  60       "B       loc_FF86EEA0 \n"
  61       "B       loc_FF86EEAC \n"
  62       "B       loc_FF86EEB4 \n"
  63       "B       loc_FF86EEBC \n"
  64       "B       loc_FF86EEC4 \n"
  65       "B       loc_FF86EECC \n"
  66       "B       loc_FF86EED8 \n"
  67       "B       loc_FF86EEE0 \n"
  68       "B       loc_FF86EEEC \n"
  69       "B       loc_FF86EF2C \n"
  70 "loc_FF86ED74:\n"  // jump table entry 0
  71       "BL               shooting_expo_iso_override\n"   // added
  72       "BL      sub_FF86F50C \n"
  73       "BL      shooting_expo_param_override\n"      // added
  74       "B       loc_FF86EE08 \n"
  75 "loc_FF86ED7C:\n" // jump table entry 1
  76       "LDR     R4, [R0, #0x10] \n"
  77       "LDR     R0, [R5, #0x84] \n"
  78       "TST     R0, #0x30 \n"
  79       "BLNE    sub_FF87066C \n"
  80       "BL      sub_FF87034C \n"
  81       "MOV     R1, R4 \n"
  82       "BL      sub_FF8703A4 \n"
  83       "LDR     R0, =0x10F \n"
  84       "MOV     R2, #4 \n"
  85       "ADD     R1, R4, #0x24 \n"
  86       "BL      sub_FF87E744 \n"
  87       "MOV     R2, #4 \n"
  88       "ADD     R1, R4, #0x28 \n"
  89       "MOV     R0, #0x2C \n"
  90       "BL      sub_FF87E744 \n"
  91       "MOV     R0, R4 \n"
  92 //      "BL      sub_FF960D4C \n" //original
  93       "BL      sub_FF960D4C_my \n" //patched
  94       "BL      capt_seq_hook_raw_here \n" // patch
  95       "MOV     R7, R0 \n"
  96       "MOV     R2, R4 \n"
  97       "MOV     R1, #1 \n"
  98       "BL      sub_FF86D0F8 \n"
  99       "TST     R7, #1 \n"
 100       "MOVEQ   R0, R4 \n"
 101       "BLEQ    sub_FF960754 \n"
 102       "B       loc_FF86EF2C \n"
 103 "loc_FF86EDE0:\n" // jump table entry 2
 104       "MOV     R0, #1 \n"
 105       "BL      sub_FF86F7D0 \n"
 106       "B       loc_FF86EF2C \n"
 107 "loc_FF86EDEC:\n"
 108       "BL      sub_FF86F154 \n"
 109       "B       loc_FF86EF2C \n"
 110 "loc_FF86EDF4:\n"
 111       "BL      sub_FF86F4EC \n"
 112       "B       loc_FF86EF2C \n"
 113 "loc_FF86EDFC:\n"
 114       "BL      sub_FF86F4F4 \n"
 115       "B       loc_FF86EF2C \n"
 116 "loc_FF86EE04:\n"
 117       "BL      sub_FF86F6B8 \n"
 118 "loc_FF86EE08:\n"
 119       "BL      sub_FF86CC78 \n"
 120       "B       loc_FF86EF2C \n"
 121 "loc_FF86EE10:\n"
 122       "LDR     R4, [R0, #0x10] \n"
 123       "MOV     R0, R4 \n"
 124       "BL      sub_FF960E50 \n"
 125       "MOV     R2, R4 \n"
 126       "MOV     R1, #9 \n"
 127       "BL      sub_FF86D0F8 \n"
 128       "B       loc_FF86EF2C \n"
 129 "loc_FF86EE2C:\n"
 130       "BL      sub_FF86F738 \n"
 131       "B       loc_FF86EE08 \n"
 132 "loc_FF86EE34:\n"
 133       "LDR     R0, [R5, #0x50] \n"
 134       "BL      sub_FF86FB70 \n"
 135       "B       loc_FF86EF2C \n"
 136 "loc_FF86EE40:\n"
 137       "BL      sub_FF86FF08 \n"
 138       "B       loc_FF86EF2C \n"
 139 "loc_FF86EE48:\n"
 140       "MOV     R0, #0 \n"
 141       "BL      sub_FF86FF6C \n"
 142       "B       loc_FF86EF2C \n"
 143 "loc_FF86EE54:\n"
 144       "BL      sub_FF95FB24 \n"
 145       "B       loc_FF86EF2C \n"
 146 "loc_FF86EE5C:\n"
 147       "BL      sub_FF95FD84 \n"
 148       "B       loc_FF86EF2C \n"
 149 "loc_FF86EE64:\n"
 150       "BL      sub_FF95FE3C \n"
 151       "B       loc_FF86EF2C \n"
 152 "loc_FF86EE6C:\n"
 153       "BL      sub_FF95FF10 \n"
 154       "B       loc_FF86EF2C \n"
 155 "loc_FF86EE74:\n"
 156       "MOV     R0, #0 \n"
 157       "BL      sub_FF960170 \n"
 158       "B       loc_FF86EF2C \n"
 159 "loc_FF86EE80:\n"
 160       "BL      sub_FF9602E0 \n"
 161       "B       loc_FF86EF2C \n"
 162 "loc_FF86EE88:\n"
 163       "BL      sub_FF960374 \n"
 164       "B       loc_FF86EF2C \n"
 165 "loc_FF86EE90:\n"
 166       "BL      sub_FF96042C \n"
 167       "B       loc_FF86EF2C \n"
 168 "loc_FF86EE98:\n"
 169       "BL      sub_FF86F94C \n"
 170       "B       loc_FF86EF2C \n"
 171 "loc_FF86EEA0:\n"
 172       "BL      sub_FF86F978 \n"
 173       "BL      sub_FF830FB0 \n"
 174       "B       loc_FF86EF2C \n"
 175 "loc_FF86EEAC:\n"
 176       "BL      sub_FF95FFE0 \n"
 177       "B       loc_FF86EF2C \n"
 178 "loc_FF86EEB4:\n"
 179       "BL      sub_FF960020 \n"
 180       "B       loc_FF86EF2C \n"
 181 "loc_FF86EEBC:\n"
 182       "BL      sub_FF871844 \n"
 183       "B       loc_FF86EF2C \n"
 184 "loc_FF86EEC4:\n"
 185       "BL      sub_FF8718B8 \n"
 186       "B       loc_FF86EF2C \n"
 187 "loc_FF86EECC:\n"
 188       "LDR     R0, [R0, #0xC] \n"
 189       "BL      sub_FF960544 \n"
 190       "B       loc_FF86EF2C \n"
 191 "loc_FF86EED8:\n"
 192       "BL      sub_FF9605B4 \n"
 193       "B       loc_FF86EF2C \n"
 194 "loc_FF86EEE0:\n"
 195       "BL      sub_FF871920 \n"
 196       "BL      sub_FF8718D8 \n"
 197       "B       loc_FF86EF2C \n"
 198 "loc_FF86EEEC:\n"
 199       "MOV     R0, #1 \n"
 200       "BL      sub_FF961568 \n"
 201       "MOV     R0, #1 \n"
 202       "BL      sub_FF961690 \n"
 203       "LDRH    R0, [R5, #0x94] \n"
 204       "CMP     R0, #4 \n"
 205       "LDRNEH  R0, [R5] \n"
 206       "SUBNE   R1, R0, #0x8200 \n"
 207       "SUBNES  R1, R1, #0x2E \n"
 208       "BNE     loc_FF86EF2C \n"
 209       "BL      sub_FF8718B8 \n"
 210       "BL      sub_FF871D7C \n"
 211       "B       loc_FF86EF2C \n"
 212 "loc_FF86EF20:\n"
 213       "LDR     R1, =0x5F4 \n"
 214       "LDR     R0, =0xFF86E814 \n" // *"SsShootTask.c"
 215       "BL      _DebugAssert \n"
 216 "loc_FF86EF2C:\n"
 217       "LDR     R0, [SP] \n"
 218       "LDR     R1, [R0, #4] \n"
 219       "LDR     R0, [R6] \n"
 220       "BL      sub_003FAC6C \n" // RAM
 221       "LDR     R4, [SP] \n"
 222       "LDR     R0, [R4, #8] \n"
 223       "CMP     R0, #0 \n"
 224       "LDREQ   R1, =0x117 \n"
 225       "LDREQ   R0, =0xFF86E814 \n" // *"SsShootTask.c"
 226       "BLEQ    _DebugAssert \n"
 227       "MOV     R0, #0 \n"
 228       "STR     R0, [R4, #8] \n"
 229       "B       loc_FF86ECB4 \n"
 230         );
 231 }
 232 
 233 //** sub_FF960D4C_my  @ 0xFF960D4C 
 234 
 235 void __attribute__((naked,noinline)) sub_FF960D4C_my() {
 236 asm volatile (
 237       "STMFD   SP!, {R3-R5,LR} \n"
 238       "MOV     R5, R0 \n"
 239       "MOV     R0, #0xC \n"
 240       "BL      sub_FF873300 \n"
 241       "TST     R0, #1 \n"
 242       "MOVNE   R0, #1 \n"
 243       "BNE     sub_FF960E4C \n"   //loc_ to sub_
 244       "BL      sub_FF86F4FC \n"
 245       "MOV     R0, R5 \n"
 246       "BL      sub_FF9606A4 \n"
 247       "TST     R0, #1 \n"
 248       "BNE     sub_FF960E4C \n"   //loc_ to sub_
 249       "LDR     R4, =0x36C34 \n"
 250       "LDR     R0, [R4, #0x84] \n"
 251       "AND     R0, R0, #0x40 \n"
 252       "CMP     R0, #0 \n"
 253       "LDRNEH  R0, [R4, #0x92] \n"
 254       "CMPNE   R0, #3 \n"
 255       "LDRNE   R0, [R5, #8] \n"
 256       "CMPNE   R0, #1 \n"
 257       "BLS     loc_FF960DBC \n"
 258       "BL      sub_FF961850 \n"
 259       "MOV     R3, #0xC0 \n"
 260       "STR     R3, [SP] \n"
 261       "LDR     R2, =0x3A98 \n"
 262       "LDR     R3, =0xFF960EDC \n" //SsCaptureSeq.c
 263       "MOV     R1, #0x8000 \n"
 264       "BL      sub_FF873568 \n"
 265 "loc_FF960DBC:\n"
 266       "MOV     R0, R5 \n"
 267       "BL      sub_FF96098C \n"
 268       "BL      sub_FF961348 \n"
 269       
 270       "BL      wait_until_remote_button_is_released \n"  //before shoot XXX
 271       "BL      capt_seq_hook_set_nr \n"
 272 
 273       "LDR     R0, [R4, #0x84] \n"
 274       "TST     R0, #0x40 \n"
 275       "BEQ     sub_FF960E30 \n" //from loc_ to sub_ 
 276       "LDR     R0, =0x181 \n"
 277       "MOV     R2, #4 \n"
 278       "MOV     R1, SP \n"
 279       "BL      _GetPropertyCase \n"
 280       "TST     R0, #1 \n"
 281       "MOVNE   R1, #0xD4 \n"
 282       "LDRNE   R0, =0xFF960EDC \n" //SsCaptureSeq.c
 283       "BLNE    _DebugAssert \n" //RAM
 284       "LDR     R0, [SP] \n"
 285       "CMP     R0, #0 \n"
 286       "BNE     loc_FF960E10 \n"
 287       "BL      sub_FF961850 \n"
 288       "MOV     R1, #0x8000 \n"
 289       "BL      sub_003FAC6C \n" //RAM
 290       "B       sub_FF960E30 \n" // from loc_ to sub_
 291 "loc_FF960E10:\n"
 292       "BL      sub_FF961850 \n"
 293       "MOV     R1, #0x8000 \n"
 294       "BL      sub_003FACA0 \n" //RAM
 295       "LDR     R2, =0xFF960D38 \n"
 296       "LDR     R0, [SP] \n"
 297       "MOV     R3, #0x8000 \n"
 298       "ADD     R1, R2, #0 \n"
 299       "BL      sub_FF833200 \n"
 300 "loc_FF960E30:\n"
 301       "LDR     R0, [R4, #0x84] \n"
 302       "TST     R0, #0x10 \n"
 303       "MOV     R0, R5 \n"
 304       "LDMEQFD SP!, {R3-R5,LR} \n"
 305         );
 306 }
 307 
 308 //** exp_drv_task  @ 0xFF8AE8D4 
 309 
 310 void __attribute__((naked,noinline)) exp_drv_task(  ) { 
 311 asm volatile (
 312       "STMFD   SP!, {R4-R9,LR} \n"
 313       "SUB     SP, SP, #0x2C \n"
 314       "LDR     R6, =0x3D78 \n"
 315       "LDR     R7, =0xBB8 \n"
 316       "LDR     R4, =0x55E1C \n"
 317       "MOV     R0, #0 \n"
 318       "ADD     R5, SP, #0x1C \n"
 319       "STR     R0, [SP, #0xC] \n"
 320 "loc_FF8AE8F4:\n"
 321       "LDR     R0, [R6, #0x20] \n"
 322       "MOV     R2, #0 \n"
 323       "ADD     R1, SP, #0x28 \n"
 324       "BL      sub_003F7218 \n" //RAM
 325       "LDR     R0, [SP, #0xC] \n"
 326       "CMP     R0, #1 \n"
 327       "BNE     loc_FF8AE940 \n"
 328       "LDR     R0, [SP, #0x28] \n"
 329       "LDR     R0, [R0] \n"
 330       "CMP     R0, #0x14 \n"
 331       "CMPNE   R0, #0x15 \n"
 332       "CMPNE   R0, #0x16 \n"
 333       "CMPNE   R0, #0x17 \n"
 334       "BEQ     loc_FF8AEAA0 \n"
 335       "CMP     R0, #0x2A \n"
 336       "BEQ     loc_FF8AEA28 \n"
 337       "ADD     R1, SP, #0xC \n"
 338       "MOV     R0, #0 \n"
 339       "BL      sub_FF8AE884 \n"
 340 "loc_FF8AE940:\n"
 341       "LDR     R0, [SP, #0x28] \n"
 342       "LDR     R1, [R0] \n"
 343       "CMP     R1, #0x30 \n"
 344       "BNE     loc_FF8AE96C \n"
 345       "BL      sub_FF8AFCB0 \n"
 346       "LDR     R0, [R6, #0x1C] \n"
 347       "MOV     R1, #1 \n"
 348       "BL      sub_003FAC6C \n" //RAM
 349       "BL      _ExitTask \n"
 350       "ADD     SP, SP, #0x2C \n"
 351       "LDMFD   SP!, {R4-R9,PC} \n"
 352 "loc_FF8AE96C:\n"
 353       "CMP     R1, #0x2F \n"
 354       "BNE     loc_FF8AE988 \n"
 355       "LDR     R2, [R0, #0x8C]! \n"
 356       "LDR     R1, [R0, #4] \n"
 357       "MOV     R0, R1 \n"
 358       "BLX     R2 \n"
 359       "B       loc_FF8AEF5C \n"
 360 "loc_FF8AE988:\n"
 361       "CMP     R1, #0x28 \n"
 362       "BNE     loc_FF8AE9D8 \n"
 363       "LDR     R0, [R6, #0x1C] \n"
 364       "MOV     R1, #0x80 \n"
 365       "BL      sub_003FACA0 \n" //RAM
 366       "LDR     R0, =0xFF8AA1F0 \n"
 367       "MOV     R1, #0x80 \n"
 368       "BL      sub_FF954E04 \n"
 369       "LDR     R0, [R6, #0x1C] \n"
 370       "MOV     R2, R7 \n"
 371       "MOV     R1, #0x80 \n"
 372       "BL      sub_003FABAC \n"
 373       "TST     R0, #1 \n"
 374       "LDRNE   R1, =0x1599 \n"
 375       "BNE     loc_FF8AEA94 \n"
 376 "loc_FF8AE9C4:\n"
 377       "LDR     R1, [SP, #0x28] \n"
 378       "LDR     R0, [R1, #0x90] \n"
 379       "LDR     R1, [R1, #0x8C] \n"
 380       "BLX     R1 \n"
 381       "B       loc_FF8AEF5C \n"
 382 "loc_FF8AE9D8:\n"
 383       "CMP     R1, #0x29 \n"
 384       "BNE     loc_FF8AEA20 \n"
 385       "ADD     R1, SP, #0xC \n"
 386       "BL      sub_FF8AE884 \n"
 387       "LDR     R0, [R6, #0x1C] \n"
 388       "MOV     R1, #0x100 \n"
 389       "BL      sub_003FACA0 \n"
 390       "LDR     R0, =0xFF8AA200 \n"
 391       "MOV     R1, #0x100 \n"
 392       "BL      sub_FF954FA4 \n"
 393       "LDR     R0, [R6, #0x1C] \n"
 394       "MOV     R2, R7 \n"
 395       "MOV     R1, #0x100 \n"
 396       "BL      sub_003FABAC \n"
 397       "TST     R0, #1 \n"
 398       "BEQ     loc_FF8AE9C4 \n"
 399       "LDR     R1, =0x15A3 \n"
 400       "B       loc_FF8AEA94 \n"
 401 "loc_FF8AEA20:\n"
 402       "CMP     R1, #0x2A \n"
 403       "BNE     loc_FF8AEA38 \n"
 404 "loc_FF8AEA28:\n"
 405       "LDR     R0, [SP, #0x28] \n"
 406       "ADD     R1, SP, #0xC \n"
 407       "BL      sub_FF8AE884 \n"
 408       "B       loc_FF8AE9C4 \n"
 409 "loc_FF8AEA38:\n"
 410       "CMP     R1, #0x2D \n"
 411       "BNE     loc_FF8AEA50 \n"
 412       "BL      sub_FF89A404 \n"
 413       "BL      sub_FF89B0EC \n"
 414       "BL      sub_FF89AC54 \n"
 415       "B       loc_FF8AE9C4 \n"
 416 "loc_FF8AEA50:\n"
 417       "CMP     R1, #0x2E \n"
 418       "BNE     loc_FF8AEAA0 \n"
 419       "LDR     R0, [R6, #0x1C] \n"
 420       "MOV     R1, #4 \n"
 421       "BL      sub_003FACA0 \n" //RAM
 422       "LDR     R1, =0xFF8AA220 \n"
 423       "LDR     R0, =0xFFFFF400 \n"
 424       "MOV     R2, #4 \n"
 425       "BL      sub_FF899E54 \n"
 426       "BL      sub_FF89A0E4 \n"
 427       "LDR     R0, [R6, #0x1C] \n"
 428       "MOV     R2, R7 \n"
 429       "MOV     R1, #4 \n"
 430       "BL      sub_003FAAC8 \n" //RAM
 431       "TST     R0, #1 \n"
 432       "BEQ     loc_FF8AE9C4 \n"
 433       "LDR     R1, =0x15CB \n"
 434 "loc_FF8AEA94:\n"
 435       "LDR     R0, =0xFF8AA914 \n" // **"ExpDrv.c"
 436       "BL      _DebugAssert \n"
 437       "B       loc_FF8AE9C4 \n"
 438 "loc_FF8AEAA0:\n"
 439       "LDR     R0, [SP, #0x28] \n"
 440       "MOV     R8, #1 \n"
 441       "LDR     R1, [R0] \n"
 442       "CMP     R1, #0x12 \n"
 443       "CMPNE   R1, #0x13 \n"
 444       "BNE     loc_FF8AEB08 \n"
 445       "LDR     R1, [R0, #0x7C] \n"
 446       "ADD     R1, R1, R1, LSL #1 \n"
 447       "ADD     R1, R0, R1, LSL #2 \n"
 448       "SUB     R1, R1, #8 \n"
 449       "LDMIA   R1, {R2,R3,R9} \n"
 450       "STMIA   R5, {R2,R3,R9} \n"
 451       "BL      sub_FF8ACE28 \n"
 452       "LDR     R0, [SP, #0x28] \n"
 453       "LDR     R1, [R0, #0x7C] \n"
 454       "LDR     R3, [R0, #0x8C] \n"
 455       "LDR     R2, [R0, #0x90] \n"
 456       "ADD     R0, R0, #4 \n"
 457       "BLX     R3 \n"
 458       "LDR     R0, [SP, #0x28] \n"
 459       "BL      sub_FF8B00B4 \n"
 460       "LDR     R0, [SP, #0x28] \n"
 461       "LDR     R1, [R0, #0x7C] \n"
 462       "LDR     R2, [R0, #0x98] \n"
 463       "LDR     R3, [R0, #0x94] \n"
 464       "B       loc_FF8AEE20 \n"
 465 "loc_FF8AEB08:\n"
 466       "CMP     R1, #0x14 \n"
 467       "CMPNE   R1, #0x15 \n"
 468       "CMPNE   R1, #0x16 \n"
 469       "CMPNE   R1, #0x17 \n"
 470       "BNE     loc_FF8AEBC0 \n"
 471       "ADD     R3, SP, #0xC \n"
 472       "MOV     R2, SP \n"
 473       "ADD     R1, SP, #0x1C \n"
 474       "BL      sub_FF8AD088 \n"
 475       "CMP     R0, #1 \n"
 476       "MOV     R9, R0 \n"
 477       "CMPNE   R9, #5 \n"
 478       "BNE     loc_FF8AEB5C \n"
 479       "LDR     R0, [SP, #0x28] \n"
 480       "MOV     R2, R9 \n"
 481       "LDR     R1, [R0, #0x7C]! \n"
 482       "LDR     R12, [R0, #0x10]! \n"
 483       "LDR     R3, [R0, #4] \n"
 484       "MOV     R0, SP \n"
 485       "BLX     R12 \n"
 486       "B       loc_FF8AEB94 \n"
 487 "loc_FF8AEB5C:\n"
 488       "LDR     R0, [SP, #0x28] \n"
 489       "CMP     R9, #2 \n"
 490       "LDR     R3, [R0, #0x90] \n"
 491       "CMPNE   R9, #6 \n"
 492       "BNE     loc_FF8AEBA8 \n"
 493       "LDR     R12, [R0, #0x8C] \n"
 494       "MOV     R2, R9 \n"
 495       "MOV     R1, #1 \n"
 496       "MOV     R0, SP \n"
 497       "BLX     R12 \n"
 498       "LDR     R0, [SP, #0x28] \n"
 499       "MOV     R2, SP \n"
 500       "ADD     R1, SP, #0x1C \n"
 501       "BL      sub_FF8AE570 \n"
 502 "loc_FF8AEB94:\n"
 503       "LDR     R0, [SP, #0x28] \n"
 504       "LDR     R2, [SP, #0xC] \n"
 505       "MOV     R1, R9 \n"
 506       "BL      sub_FF8AE7C0 \n"
 507       "B       loc_FF8AEE28 \n"
 508 "loc_FF8AEBA8:\n"
 509       "LDR     R1, [R0, #0x7C] \n"
 510       "LDR     R12, [R0, #0x8C] \n"
 511       "MOV     R2, R9 \n"
 512       "ADD     R0, R0, #4 \n"
 513       "BLX     R12 \n"
 514       "B       loc_FF8AEE28 \n"
 515 "loc_FF8AEBC0:\n"
 516       "CMP     R1, #0x24 \n"
 517       "CMPNE   R1, #0x25 \n"
 518       "BNE     loc_FF8AEC0C \n"
 519       "LDR     R1, [R0, #0x7C] \n"
 520       "ADD     R1, R1, R1, LSL #1 \n"
 521       "ADD     R1, R0, R1, LSL #2 \n"
 522       "SUB     R1, R1, #8 \n"
 523       "LDMIA   R1, {R2,R3,R9} \n"
 524       "STMIA   R5, {R2,R3,R9} \n"
 525       "BL      sub_FF8ABE14 \n"
 526       "LDR     R0, [SP, #0x28] \n"
 527       "LDR     R1, [R0, #0x7C] \n"
 528       "LDR     R3, [R0, #0x8C] \n"
 529       "LDR     R2, [R0, #0x90] \n"
 530       "ADD     R0, R0, #4 \n"
 531       "BLX     R3 \n"
 532       "LDR     R0, [SP, #0x28] \n"
 533       "BL      sub_FF8AC254 \n"
 534       "B       loc_FF8AEE28 \n"
 535 "loc_FF8AEC0C:\n"
 536       "ADD     R1, R0, #4 \n"
 537       "LDMIA   R1, {R2,R3,R9} \n"
 538       "STMIA   R5, {R2,R3,R9} \n"
 539       "LDR     R1, [R0] \n"
 540       "CMP     R1, #0x28 \n"
 541       "ADDCC   PC, PC, R1, LSL #2 \n"
 542       "B       loc_FF8AEE10 \n"
 543       "B       loc_FF8AECC8 \n"
 544       "B       loc_FF8AECC8 \n"
 545       "B       loc_FF8AECD0 \n"
 546       "B       loc_FF8AECD8 \n"
 547       "B       loc_FF8AECD8 \n"
 548       "B       loc_FF8AECD8 \n"
 549       "B       loc_FF8AECC8 \n"
 550       "B       loc_FF8AECD0 \n"
 551       "B       loc_FF8AECD8 \n"
 552       "B       loc_FF8AECD8 \n"
 553       "B       loc_FF8AECF0 \n"
 554       "B       loc_FF8AECF0 \n"
 555       "B       loc_FF8AEDFC \n"
 556       "B       loc_FF8AEE04 \n"
 557       "B       loc_FF8AEE04 \n"
 558       "B       loc_FF8AEE04 \n"
 559       "B       loc_FF8AEE04 \n"
 560       "B       loc_FF8AEE0C \n"
 561       "B       loc_FF8AEE10 \n"
 562       "B       loc_FF8AEE10 \n"
 563       "B       loc_FF8AEE10 \n"
 564       "B       loc_FF8AEE10 \n"
 565       "B       loc_FF8AEE10 \n"
 566       "B       loc_FF8AEE10 \n"
 567       "B       loc_FF8AECE0 \n"
 568       "B       loc_FF8AECE8 \n"
 569       "B       loc_FF8AECE8 \n"
 570       "B       loc_FF8AECE8 \n"
 571       "B       loc_FF8AECFC \n"
 572       "B       loc_FF8AECFC \n"
 573       "B       loc_FF8AED04 \n"
 574       "B       loc_FF8AED3C \n"
 575       "B       loc_FF8AED74 \n"
 576       "B       loc_FF8AEDAC \n"
 577       "B       loc_FF8AEDE4 \n"
 578       "B       loc_FF8AEDE4 \n"
 579       "B       loc_FF8AEE10 \n"
 580       "B       loc_FF8AEE10 \n"
 581       "B       loc_FF8AEDEC \n"
 582       "B       loc_FF8AEDF4 \n"
 583 "loc_FF8AECC8:\n"
 584       "BL      sub_FF8AA798 \n"
 585       "B       loc_FF8AEE10 \n"
 586 "loc_FF8AECD0:\n"
 587       "BL      sub_FF8AAA3C \n"
 588       "B       loc_FF8AEE10 \n"
 589 "loc_FF8AECD8:\n"
 590       "BL      sub_FF8AAC64 \n"
 591       "B       loc_FF8AEE10 \n"
 592 "loc_FF8AECE0:\n"
 593       "BL      sub_FF8AAF88 \n"
 594       "B       loc_FF8AEE10 \n"
 595 "loc_FF8AECE8:\n"
 596       "BL      sub_FF8AB1A0 \n"
 597       "B       loc_FF8AEE10 \n"
 598 "loc_FF8AECF0:\n"
 599 //      "BL      sub_FF8AB54C \n" //original
 600       "BL      sub_FF8AB54C_my \n" //patched
 601       "MOV     R8, #0 \n"
 602       "B       loc_FF8AEE10 \n"
 603 "loc_FF8AECFC:\n"
 604       "BL      sub_FF8AB68C \n"
 605       "B       loc_FF8AEE10 \n"
 606 "loc_FF8AED04:\n"
 607       "LDRH    R1, [R0, #4] \n"
 608       "STRH    R1, [SP, #0x1C] \n"
 609       "LDRH    R1, [R4, #2] \n"
 610       "STRH    R1, [SP, #0x1E] \n"
 611       "LDRH    R1, [R4, #4] \n"
 612       "STRH    R1, [SP, #0x20] \n"
 613       "LDRH    R1, [R4, #6] \n"
 614       "STRH    R1, [SP, #0x22] \n"
 615       "LDRH    R1, [R0, #0xC] \n"
 616       "STRH    R1, [SP, #0x24] \n"
 617       "LDRH    R1, [R4, #0xA] \n"
 618       "STRH    R1, [SP, #0x26] \n"
 619       "BL      sub_FF8AFD44 \n"
 620       "B       loc_FF8AEE10 \n"
 621 "loc_FF8AED3C:\n"
 622       "LDRH    R1, [R0, #4] \n"
 623       "STRH    R1, [SP, #0x1C] \n"
 624       "LDRH    R1, [R4, #2] \n"
 625       "STRH    R1, [SP, #0x1E] \n"
 626       "LDRH    R1, [R4, #4] \n"
 627       "STRH    R1, [SP, #0x20] \n"
 628       "LDRH    R1, [R4, #6] \n"
 629       "STRH    R1, [SP, #0x22] \n"
 630       "LDRH    R1, [R4, #8] \n"
 631       "STRH    R1, [SP, #0x24] \n"
 632       "LDRH    R1, [R4, #0xA] \n"
 633       "STRH    R1, [SP, #0x26] \n"
 634       "BL      sub_FF8AFEB4 \n"
 635       "B       loc_FF8AEE10 \n"
 636 "loc_FF8AED74:\n"
 637       "LDRH    R1, [R4] \n"
 638       "STRH    R1, [SP, #0x1C] \n"
 639       "LDRH    R1, [R0, #6] \n"
 640       "STRH    R1, [SP, #0x1E] \n"
 641       "LDRH    R1, [R4, #4] \n"
 642       "STRH    R1, [SP, #0x20] \n"
 643       "LDRH    R1, [R4, #6] \n"
 644       "STRH    R1, [SP, #0x22] \n"
 645       "LDRH    R1, [R4, #8] \n"
 646       "STRH    R1, [SP, #0x24] \n"
 647       "LDRH    R1, [R4, #0xA] \n"
 648       "STRH    R1, [SP, #0x26] \n"
 649       "BL      sub_FF8AFF68 \n"
 650       "B       loc_FF8AEE10 \n"
 651 "loc_FF8AEDAC:\n"
 652       "LDRH    R1, [R4] \n"
 653       "STRH    R1, [SP, #0x1C] \n"
 654       "LDRH    R1, [R4, #2] \n"
 655       "STRH    R1, [SP, #0x1E] \n"
 656       "LDRH    R1, [R4, #4] \n"
 657       "STRH    R1, [SP, #0x20] \n"
 658       "LDRH    R1, [R4, #6] \n"
 659       "STRH    R1, [SP, #0x22] \n"
 660       "LDRH    R1, [R0, #0xC] \n"
 661       "STRH    R1, [SP, #0x24] \n"
 662       "LDRH    R1, [R4, #0xA] \n"
 663       "STRH    R1, [SP, #0x26] \n"
 664       "BL      sub_FF8B0010 \n"
 665       "B       loc_FF8AEE10 \n"
 666 "loc_FF8AEDE4:\n"
 667       "BL      sub_FF8ABBC8 \n"
 668       "B       loc_FF8AEE10 \n"
 669 "loc_FF8AEDEC:\n"
 670       "BL      sub_FF8AC358 \n"
 671       "B       loc_FF8AEE10 \n"
 672 "loc_FF8AEDF4:\n"
 673       "BL      sub_FF8AC63C \n"
 674       "B       loc_FF8AEE10 \n"
 675 "loc_FF8AEDFC:\n"
 676       "BL      sub_FF8AC8FC \n"
 677       "B       loc_FF8AEE10 \n"
 678 "loc_FF8AEE04:\n"
 679       "BL      sub_FF8ACAB8 \n"
 680       "B       loc_FF8AEE10 \n"
 681 "loc_FF8AEE0C:\n"
 682       "BL      sub_FF8ACC20 \n"
 683 "loc_FF8AEE10:\n"
 684       "LDR     R0, [SP, #0x28] \n"
 685       "LDR     R1, [R0, #0x7C] \n"
 686       "LDR     R2, [R0, #0x90] \n"
 687       "LDR     R3, [R0, #0x8C] \n"
 688 "loc_FF8AEE20:\n"
 689       "ADD     R0, R0, #4 \n"
 690       "BLX     R3 \n"
 691 "loc_FF8AEE28:\n"
 692       "LDR     R0, [SP, #0x28] \n"
 693       "LDR     R0, [R0] \n"
 694       "CMP     R0, #0x10 \n"
 695       "BEQ     loc_FF8AEE60 \n"
 696       "BGT     loc_FF8AEE50 \n"
 697       "CMP     R0, #1 \n"
 698       "CMPNE   R0, #4 \n"
 699       "CMPNE   R0, #0xE \n"
 700       "BNE     loc_FF8AEE94 \n"
 701       "B       loc_FF8AEE60 \n"
 702 "loc_FF8AEE50:\n"
 703       "CMP     R0, #0x13 \n"
 704       "CMPNE   R0, #0x17 \n"
 705       "CMPNE   R0, #0x1A \n"
 706       "BNE     loc_FF8AEE94 \n"
 707 "loc_FF8AEE60:\n"
 708       "LDRSH   R0, [R4] \n"
 709       "CMN     R0, #0xC00 \n"
 710       "LDRNESH R1, [R4, #8] \n"
 711       "CMNNE   R1, #0xC00 \n"
 712       "STRNEH  R0, [SP, #0x1C] \n"
 713       "STRNEH  R1, [SP, #0x24] \n"
 714       "BNE     loc_FF8AEE94 \n"
 715       "ADD     R0, SP, #0x10 \n"
 716       "BL      sub_FF8B02C4 \n"
 717       "LDRH    R0, [SP, #0x10] \n"
 718       "STRH    R0, [SP, #0x1C] \n"
 719       "LDRH    R0, [SP, #0x18] \n"
 720       "STRH    R0, [SP, #0x24] \n"
 721 "loc_FF8AEE94:\n"
 722       "LDR     R0, [SP, #0x28] \n"
 723       "CMP     R8, #1 \n"
 724       "BNE     loc_FF8AEEE4 \n"
 725       "LDR     R1, [R0, #0x7C] \n"
 726       "MOV     R2, #0xC \n"
 727       "ADD     R1, R1, R1, LSL #1 \n"
 728       "ADD     R0, R0, R1, LSL #2 \n"
 729       "SUB     R8, R0, #8 \n"
 730       "LDR     R0, =0x55E1C \n"
 731       "ADD     R1, SP, #0x1C \n"
 732       "BL      sub_003FC17C \n"
 733       "LDR     R0, =0x55E28 \n"
 734       "MOV     R2, #0xC \n"
 735       "ADD     R1, SP, #0x1C \n"
 736       "BL      sub_003FC17C \n"
 737       "LDR     R0, =0x55E34 \n"
 738       "MOV     R2, #0xC \n"
 739       "MOV     R1, R8 \n"
 740       "BL      sub_003FC17C \n"
 741       "B       loc_FF8AEF5C \n"
 742 "loc_FF8AEEE4:\n"
 743       "LDR     R0, [R0] \n"
 744       "MOV     R3, #1 \n"
 745       "CMP     R0, #0xB \n"
 746       "BNE     loc_FF8AEF28 \n"
 747       "MOV     R2, #0 \n"
 748       "STRD    R2, [SP] \n"
 749       "MOV     R2, R3 \n"
 750       "MOV     R1, R3 \n"
 751       "MOV     R0, #0 \n"
 752       "BL      sub_FF8AA578 \n"
 753       "MOV     R3, #1 \n"
 754       "MOV     R2, #0 \n"
 755       "STRD    R2, [SP] \n"
 756       "MOV     R2, R3 \n"
 757       "MOV     R1, R3 \n"
 758       "MOV     R0, #0 \n"
 759       "B       loc_FF8AEF58 \n"
 760 "loc_FF8AEF28:\n"
 761       "MOV     R2, #1 \n"
 762       "STRD    R2, [SP] \n"
 763       "MOV     R3, R2 \n"
 764       "MOV     R1, R2 \n"
 765       "MOV     R0, R2 \n"
 766       "BL      sub_FF8AA578 \n"
 767       "MOV     R3, #1 \n"
 768       "MOV     R2, R3 \n"
 769       "MOV     R1, R3 \n"
 770       "MOV     R0, R3 \n"
 771       "STR     R3, [SP] \n"
 772       "STR     R3, [SP, #4] \n"
 773 "loc_FF8AEF58:\n"
 774       "BL      sub_FF8AA6E4 \n"
 775 "loc_FF8AEF5C:\n"
 776       "LDR     R0, [SP, #0x28] \n"
 777       "BL      sub_FF8AFCB0 \n"
 778       "B       loc_FF8AE8F4 \n"
 779         );
 780 }
 781 
 782 //** sub_FF8AB54C_my  @ 0xFF8AB54C
 783 
 784 void __attribute__((naked,noinline)) sub_FF8AB54C_my(  ) { 
 785 asm volatile (
 786       "STMFD   SP!, {R4-R8,LR} \n"
 787       "LDR     R7, =0x3D78 \n"
 788       "MOV     R4, R0 \n"
 789       "LDR     R0, [R7, #0x1C] \n"
 790       "MOV     R1, #0x3E \n"
 791       "BL      sub_003FACA0 \n" // RAM
 792       "MOV     R2, #0 \n"
 793       "LDRSH   R0, [R4, #4] \n"
 794       "MOV     R1, R2 \n"
 795       "BL      sub_FF8AA280 \n"
 796       "MOV     R6, R0 \n"
 797       "LDRSH   R0, [R4, #6] \n"
 798       "BL      sub_FF8AA3D0 \n"
 799       "LDRSH   R0, [R4, #8] \n"
 800       "BL      sub_FF8AA428 \n"
 801       "LDRSH   R0, [R4, #0xA] \n"
 802       "BL      sub_FF8AA480 \n"
 803       "LDRSH   R0, [R4, #0xC] \n"
 804       "MOV     R1, #0 \n"
 805       "BL      sub_FF8AA4D8 \n"
 806       "MOV     R5, R0 \n"
 807       "LDR     R0, [R4] \n"
 808       "LDR     R8, =0x55E34 \n"
 809       "CMP     R0, #0xB \n"
 810       "MOVEQ   R6, #0 \n"
 811       "MOVEQ   R5, R6 \n"
 812       "BEQ     loc_FF8AB5E0 \n"
 813       "CMP     R6, #1 \n"
 814       "BNE     loc_FF8AB5E0 \n"
 815       "LDRSH   R0, [R4, #4] \n"
 816       "LDR     R1, =0xFF8AA1E0 \n"
 817       "MOV     R2, #2 \n"
 818       "BL      sub_FF954E88 \n"
 819       "STRH    R0, [R4, #4] \n"
 820       "MOV     R0, #0 \n"
 821       "STR     R0, [R7, #0x28] \n"
 822       "B       loc_FF8AB5E8 \n"
 823 "loc_FF8AB5E0:\n"
 824       "LDRH    R0, [R8] \n"
 825       "STRH    R0, [R4, #4] \n"
 826 "loc_FF8AB5E8:\n"
 827       "CMP     R5, #1 \n"
 828       "LDRNEH  R0, [R8, #8] \n"
 829       "BNE     loc_FF8AB604 \n"
 830       "LDRSH   R0, [R4, #0xC] \n"
 831       "LDR     R1, =0xFF8AA264 \n"
 832       "MOV     R2, #0x20 \n"
 833       "BL      sub_FF8AFD00 \n"
 834 "loc_FF8AB604:\n"
 835       "STRH    R0, [R4, #0xC] \n"
 836       "LDRSH   R0, [R4, #6] \n"
 837 //      "BL      sub_FF89A150 \n" //original
 838       "BL      sub_FF89A150_my \n" //patched
 839       "B       sub_FF8AB610 \n" // continue in firmware
 840         );
 841 }
 842 
 843 //** sub_FF89A150_my  @ 0xFF89A150 
 844 
 845 void __attribute__((naked,noinline)) sub_FF89A150_my() { 
 846 asm volatile (
 847       "STMFD   SP!, {R4-R6,LR} \n"
 848       "LDR     R5, =0x39C8 \n"
 849       "MOV     R4, R0 \n"
 850       "LDR     R0, [R5, #4] \n"
 851       "CMP     R0, #1 \n"
 852       "LDRNE   R1, =0x14D \n"
 853       "LDRNE   R0, =0xFF899F88 \n" //  ; "Shutter.c"
 854       "BLNE    _DebugAssert \n"
 855       "CMN     R4, #0xC00 \n"
 856       "LDREQSH R4, [R5, #2] \n"
 857       "CMN     R4, #0xC00 \n"
 858       "LDREQ   R1, =0x153 \n"
 859       "LDREQ   R0, =0xFF899F88 \n" //  ; "Shutter.c"
 860       "STRH    R4, [R5, #2] \n"
 861       "BLEQ    _DebugAssert \n" //RAM
 862       "MOV     R0, R4 \n"
 863 //      "BL      sub_FF9D8E90 \n"
 864       "BL      apex2us \n"   //patch
 865       "MOV     R4, R0 \n"
 866       "BL      sub_FF8E9590 \n"
 867       "MOV     R0, R4 \n"
 868       "BL      sub_FF8F1D98 \n"
 869       "TST     R0, #1 \n"
 870       "LDMEQFD SP!, {R4-R6,PC} \n"
 871       "LDMFD   SP!, {R4-R6,LR} \n"
 872       "MOV     R1, #0x158 \n"
 873       "LDR     R0, =0xFF899F88 \n" // ; "Shutter.c"
 874       "B       _DebugAssert \n"
 875         );
 876 }

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