source: trunk/platform/ixus980_sd990/sub/101b/capt_seq.c @ 923

Revision 923, 15.4 KB checked in by reyalp, 3 years ago (diff)

fix intermittent raw bug for ixus980_sd990

  • Property svn:eol-style set to native
Line 
1#include "lolevel.h"
2#include "platform.h"
3#include "core.h"
4#include "conf.h"
5
6static long *nrflag = (long*)0x93C8; // see below
7
8#include "../../../generic/capt_seq.c"
9
10void __attribute__((naked,noinline)) sub_FF93DDF4_my() {
11        asm volatile (
12"                 STMFD   SP!, {R1-R7,LR}\n"
13"                 MOV     R4, R0\n"
14"                 BL      sub_FF93EA40\n" // SsShootEvent.c:60\n"
15"                 MVN     R1, #0\n"
16"                 BL      sub_FF86E0B8\n"
17"                 MOV     R2, #4\n"
18"                 ADD     R1, SP, #4\n"
19"                 MOV     R0, #0x8A\n"
20"                 BL      sub_FF876358\n" // PT_GetPropertyCaseString_0 ; LOCATION: PropertyCase.c:0\n"
21"                 TST     R0, #1\n"
22"                 LDRNE   R1, =0x373\n"
23"                 LDRNE   R0, =0xFF93DDC0\n" // "SsCaptureSeq.c"
24"                 BLNE    sub_FF81B1CC\n" // DebugAssert\n"
25"                 LDR     R7, =0x1B2C8\n"
26"                 LDR     R6, =0x1B208\n"
27"                 LDRSH   R1, [R7,#0xE]\n"
28"                 LDR     R0, [R6,#0x88]\n"
29"                 BL      sub_FF9016DC\n"
30"                 BL      sub_FF84CDCC\n" // GetCCDTemperature ; LOCATION: Thermometer.c:250\n"
31"                 LDR     R3, =0x93CC\n"
32"                 STRH    R0, [R4,#0x94]\n"
33"                 STR     R3, [SP]\n"
34"                 MOV     R1, R0\n"
35"                 LDRH    R0, [R6,#0x5C]\n"
36"                 LDRSH   R2, [R7,#0xC]\n"
37"                 SUB     R3, R3, #4\n"
38"                 BL      sub_FF93F038\n" // NRTable.c:219\n"
39"                 BL      wait_until_remote_button_is_released\n"
40"                 BL      capt_seq_hook_set_nr\n"
41"                 B       sub_FF93DE60\n" // -> continue function in firmware
42    );
43}
44
45void __attribute__((naked,noinline)) sub_FF8662E0_my() {
46        asm volatile (
47"                STMFD   SP!, {R4-R6,LR}\n"
48"                LDR     R4, [R0,#0xC]\n"
49"                LDR     R6, =0x1B208\n"
50"                LDR     R0, [R4,#8]\n"
51"                MOV     R5, #0\n"
52"                ORR     R0, R0, #1\n"
53"                STR     R0, [R4,#8]\n"
54"                LDR     R0, [R6,#0x24]\n"
55"                CMP     R0, #0\n"
56"                MOVEQ   R0, #2\n"
57"                BLEQ    sub_FF86004C\n"
58"                BL      sub_FF866800\n"
59"                LDR     R0, [R6,#0x24]\n"
60"                CMP     R0, #0\n"
61"                BNE     loc_FF866390\n" // _<
62"                MOV     R0, #0\n"
63"                BL      sub_FF93E8DC\n"
64"                MOV     R0, R4\n"
65"                BL      sub_FF866B50\n"
66"                MOV     R0, R4\n"
67"                BL      sub_FF93C9A4\n"
68"                CMP     R0, #0\n"
69"                BEQ     loc_FF866360\n"
70"                BL      sub_FF93E91C\n"
71"                MOV     R0, R4\n"
72"                BL      sub_FF93CA88\n" // SsPrePreSeq.c:0
73"                TST     R0, #1\n"
74"                MOVNE   R2, R4\n"
75"                LDMNEFD SP!, {R4-R6,LR}\n"
76"                MOVNE   R1, #1\n"
77"                BNE     sub_FF8643C4\n" // SsShootCtrl.c:0
78"                B       loc_FF86636C\n"
79"loc_FF866360:\n"
80"                MOV     R0, R4\n"
81"                BL      sub_FF93CA24\n"
82"                BL      sub_FF93E91C\n"
83"loc_FF86636C:\n"
84"                MOV     R0, R4\n"
85"                BL      sub_FF8659AC\n"
86"                MOV     R0, R4\n"
87"                BL      sub_FF93DCB0\n" // SsCaptureSeq.c:1
88"                BL      sub_FF93E76C\n" // SsShootLib.c:32768
89"                MOV     R0, R4\n"
90"                BL      sub_FF93DDF4_my\n" // SsCaptureSeq.c:0 nr setup
91"                MOV     R5, R0\n"
92"                B       loc_FF8663A0\n"
93"loc_FF866390:\n"
94"                LDR     R0, =0x54EC\n"
95"                LDR     R0, [R0,#4]\n"
96"                CMP     R0, #0\n"
97"                MOVNE   R5, #0x1D\n"
98"loc_FF8663A0:\n"
99"                BL      capt_seq_hook_raw_here\n" 
100"                BL      sub_FF8686F0\n"
101"                BL      sub_FF868738\n"
102"                BL      sub_FF868778\n"
103"                MOV     R2, R4\n"
104"                MOV     R1, #1\n"
105"                MOV     R0, R5\n"
106"                BL      sub_FF8643C4\n" // SsShootCtrl.c:0
107"                BL      sub_FF93E04C\n"
108"                CMP     R0, #0\n"
109"                LDRNE   R0, [R4,#8]\n"
110"                ORRNE   R0, R0, #0x2000\n"
111"                STRNE   R0, [R4,#8]\n"
112"                LDMFD   SP!, {R4-R6,PC}\n"
113    );
114}
115
116void __attribute__((naked,noinline)) task_CaptSeqTask_my() {
117        asm volatile (
118"                STMFD   SP!, {R3-R9,LR}\n"
119"                LDR     R6, =0x54EC\n"
120"                LDR     R4, =0x1B208\n"
121"                MOV     R9, #1\n"
122"                MOV     R7, #0\n"
123"loc_FF865F20:\n"
124"                LDR     R0, [R6,#0xC]\n"
125"                MOV     R2, #0\n"
126"                MOV     R1, SP\n"
127"                BL      sub_FF82746C\n" //  KerQueue.c
128"                TST     R0, #1\n"
129"                BEQ     loc_FF865F4C\n"
130"                LDR     R1, =0x539\n"
131"                LDR     R0, =0xFF865A28\n" // "SsShootTask.c"
132"                BL      sub_FF81B1CC\n" // DebugAssert
133"                BL      sub_FF81B184\n" // ExitTask
134"                LDMFD   SP!, {R3-R9,PC}\n"
135"loc_FF865F4C:\n"
136"                LDR     R0, [SP]\n"
137"                LDR     R1, [R0]\n"
138"                CMP     R1, #0x20\n"
139"                ADDLS   PC, PC, R1,LSL#2\n"
140"                B       loc_FF8661BC\n"
141"                B       loc_FF865FE4\n"
142"                B       loc_FF866048\n"
143"                B       loc_FF866050\n"
144"                B       loc_FF866068\n"
145"                B       loc_FF86605C\n"
146"                B       loc_FF866070\n"
147"                B       loc_FF866078\n"
148"                B       loc_FF866080\n"
149"                B       loc_FF8660D8\n"
150"                B       loc_FF866100\n"
151"                B       loc_FF8660E4\n"
152"                B       loc_FF8660F0\n"
153"                B       loc_FF8660F8\n"
154"                B       loc_FF866108\n"
155"                B       loc_FF866110\n"
156"                B       loc_FF866118\n"
157"                B       loc_FF866120\n"
158"                B       loc_FF866128\n"
159"                B       loc_FF866130\n"
160"                B       loc_FF866138\n"
161"                B       loc_FF866140\n"
162"                B       loc_FF866148\n"
163"                B       loc_FF866150\n"
164"                B       loc_FF866158\n"
165"                B       loc_FF866164\n"
166"                B       loc_FF86616C\n"
167"                B       loc_FF866178\n"
168"                B       loc_FF866180\n"
169"                B       loc_FF866188\n"
170"                B       loc_FF866190\n"
171"                B       loc_FF866198\n"
172"                B       loc_FF8661A4\n"
173"                B       loc_FF8661C8\n"
174"loc_FF865FE4:\n"
175// jumptable FF865F58 entry 0: halfpress in shoot mode, or full press if quick
176"                BL      sub_FF866810\n" // SsPrepareSeq_c
177//"                BL      shooting_expo_param_override\n"  // +
178"    STMFD   SP!, {R1-R12,LR}\n"
179"    BL      captseq_hack_override_active\n" // returns 1 if tv or sv override in effect
180"    LDMFD   SP!, {R1-R12,LR}\n"
181"    STR     R0,[SP,#-4]!\n" // push return value
182"    BL      shooting_expo_param_override\n" // saves all regs
183"                BL      sub_FF863F08\n"
184"    LDR     R0,[SP],#4\n" // pop override hack
185"    CMP     R0, #1\n"
186"    MOVEQ   R0, #0\n"
187"    STREQ   R0, [R4,#0x24]\n"  // fixes overrides behavior at short shutter press
188//"                BL      sub_FF863F08\n"
189/*
190 //  this code added to avoid some incorrect behavior if overrides are used.
191 //  but it can cause some unexpected side effects. In this case, remove this code!
192
193                 "LDR     R0, =ovr_disable\n"
194                 "LDR     R0, [R0]\n"
195                 "LDR     R0, [R0]\n"
196                 "CMP     R0, #1\n"
197                 "BEQ     locA\n"
198                 "MOV     R0, #0\n"
199                 "STR     R0, [R4,#0x24]\n"  // fixes overrides  behavior at short shutter press
200//               "STR     R0, [R4,#0x1C]\n" 
201                 "B       loc_FF8661C8\n"
202"locA:\n"
203       
204 //  end of my code
205*/
206"                LDR     R0, [R4,#0x24]\n"
207"                CMP     R0, #0\n"
208"                BEQ     loc_FF8661C8\n" // -> jt 32, loop
209"                BL      sub_FF865700\n"
210"                MOV     R5, R0\n"
211"                LDR     R0, [R4,#0x24]\n"
212"                CMP     R0, #0\n"
213"                BEQ     loc_FF86602C\n"
214"                MOV     R0, #0xC\n"
215"                BL      sub_FF869DCC\n"
216"                TST     R0, #1\n"
217"                STRNE   R9, [R6,#4]\n"
218"                LDRNE   R0, [R5,#8]\n"
219"                ORRNE   R0, R0, #0x40000000\n"
220"                STRNE   R0, [R5,#8]\n"
221"                BNE     loc_FF8661C8\n" // -> jt 32, loop
222"loc_FF86602C:\n"
223"                MOV     R0, R5\n"
224"                BL      sub_FF8659AC\n"
225"                MOV     R0, R5\n"
226"                BL      sub_FF93DDF4\n" // nr setup, hook here too ?
227"                TST     R0, #1\n"
228"                STRNE   R9, [R6,#4]\n"
229"                B       loc_FF8661C8\n" // -> jt 32, loop
230"loc_FF866048:\n"
231// jumptable FF865F58 entry 1: called 1+ sec after entry 0, i.e. shooting near complete
232"                BL      sub_FF8662E0_my\n"
233"                B       loc_FF866060\n" // -> middle of jt 4
234"loc_FF866050:\n"
235// jumptable FF865F58 entry 2
236"                MOV     R0, #1\n"
237"                BL      sub_FF866A28\n"
238"                B       loc_FF8661C8\n" // jt 32, loop
239"loc_FF86605C:\n"
240// jumptable FF865F58 entry 4 // called in shooting, after first call to 32
241"                BL      sub_FF866474\n"
242"loc_FF866060:\n"
243"                STR     R7, [R4,#0x24]\n"
244"                B       loc_FF8661C8\n" // jt 32, loop
245"loc_FF866068:\n"
246// jumptable FF865F58 entry 3: last call after shot, also called switching from play->shoot
247"                BL      sub_FF8667F0\n"
248"                B       loc_FF866060\n" // -> middle of jt 4
249"loc_FF866070:\n"
250// jumptable FF865F58 entry 5
251"                BL      sub_FF8667F8\n"
252"                B       loc_FF8661C8\n"
253"loc_FF866078:\n"
254// jumptable FF865F58 entry 6
255"                BL      sub_FF866948\n"
256"                B       loc_FF8660DC\n" // -> middle of jt 8
257"loc_FF866080:\n"
258// jumptable FF865F58 entry 7
259"                LDR     R5, [R0,#0xC]\n"
260"                BL      sub_FF866800\n"
261"                MOV     R0, R5\n"
262"                BL      sub_FF93CD94\n"
263"                TST     R0, #1\n"
264"                MOV     R8, R0\n"
265"                BNE     loc_FF8660C0\n"
266"                BL      sub_FF8764E8\n"
267"                STR     R0, [R5,#0x18]\n"
268"                MOV     R0, R5\n"
269"                BL      sub_FF93DCB0\n"
270"                MOV     R0, R5\n"
271"                BL      sub_FF93E0BC\n"
272"                MOV     R8, R0\n"
273"                LDR     R0, [R5,#0x18]\n"
274"                BL      sub_FF8766FC\n"
275"loc_FF8660C0:\n"
276"                BL      sub_FF8667F0\n"
277"                MOV     R2, R5\n"
278"                MOV     R1, #9\n"
279"                MOV     R0, R8\n"
280"                BL      sub_FF8643C4\n"
281"                B       loc_FF8661C8\n"
282"loc_FF8660D8:\n"
283// jumptable FF865F58 entry 8: movie mode half press ?
284"                BL      sub_FF8669A8\n"
285"loc_FF8660DC:\n"
286"                BL      sub_FF863F08\n"
287"                B       loc_FF8661C8\n"
288"loc_FF8660E4:\n"
289// jumptable FF865F58 entry 10
290"                LDR     R0, [R4,#0x54]\n"
291"                BL      sub_FF866DBC\n"
292"                B       loc_FF8661C8\n"
293"loc_FF8660F0:\n"
294// jumptable FF865F58 entry 11
295"                BL      sub_FF86706C\n"
296"                B       loc_FF8661C8\n"
297"loc_FF8660F8:\n"
298// jumptable FF865F58 entry 12
299"                BL      sub_FF8670FC\n"
300"                B       loc_FF8661C8\n"
301"loc_FF866100:\n"
302// jumptable FF865F58 entry 9
303"                BL      sub_FF8667F0\n"
304"                B       loc_FF8661C8\n"
305"loc_FF866108:\n"
306// jumptable FF865F58 entry 13
307"                BL      sub_FF93CFC0\n"
308"                B       loc_FF8661C8\n"
309"loc_FF866110:\n"
310// jumptable FF865F58 entry 14
311"                BL      sub_FF93D1A8\n"
312"                B       loc_FF8661C8\n"
313"loc_FF866118:\n"
314// jumptable FF865F58 entry 15
315"                BL      sub_FF93D238\n"
316"                B       loc_FF8661C8\n"
317"loc_FF866120:\n"
318// jumptable FF865F58 entry 16
319"                BL      sub_FF93D2EC\n"
320"                B       loc_FF8661C8\n"
321"loc_FF866128:\n"
322// jumptable FF865F58 entry 17
323"                BL      sub_FF93D4EC\n"
324"                B       loc_FF8661C8\n"
325"loc_FF866130:\n"
326// jumptable FF865F58 entry 18
327"                BL      sub_FF93D544\n"
328"                B       loc_FF8661C8\n"
329"loc_FF866138:\n"
330// jumptable FF865F58 entry 19
331"                MOV     R0, #0\n"
332"                B       loc_FF86615C\n"
333"loc_FF866140:\n"
334// jumptable FF865F58 entry 20
335"                BL      sub_FF93D704\n"
336"                B       loc_FF8661C8\n"
337"loc_FF866148:\n"
338// jumptable FF865F58 entry 21: focus mode to mf
339"                BL      sub_FF93D794\n"
340"                B       loc_FF8661C8\n"
341"loc_FF866150:\n"
342// jumptable FF865F58 entry 22: halfpress to shoot, focus mode change except MF
343"                BL      sub_FF93D854\n"
344"                B       loc_FF8661C8\n"
345"loc_FF866158:\n"
346// jumptable FF865F58 entry 23
347"                MOV     R0, #1\n"
348"loc_FF86615C:\n"
349"                BL      sub_FF93D5CC\n"
350"                B       loc_FF8661C8\n"
351"loc_FF866164:\n"
352// jumptable FF865F58 entry 24
353"                BL      sub_FF866BA8\n"
354"                B       loc_FF8661C8\n"
355"loc_FF86616C:\n"
356// jumptable FF865F58 entry 25
357"                BL      sub_FF866C48\n"
358"                BL      sub_FF8249F4\n"
359"                B       loc_FF8661C8\n"
360"loc_FF866178:\n"
361// jumptable FF865F58 entry 26
362"                BL      sub_FF93D3A8\n"
363"                B       loc_FF8661C8\n"
364"loc_FF866180:\n"
365// jumptable FF865F58 entry 27: iso change
366"                BL      sub_FF93D414\n"
367"                B       loc_FF8661C8\n"
368"loc_FF866188:\n"
369// jumptable FF865F58 entry 28
370"                BL      sub_FF868688\n"
371"                B       loc_FF8661C8\n"
372"loc_FF866190:\n"
373// jumptable FF865F58 entry 29
374"                BL      sub_FF8686F0\n"
375"                B       loc_FF8661C8\n"
376"loc_FF866198:\n"
377// jumptable FF865F58 entry 30: in shoot, after jt 4
378"                BL      sub_FF86874C\n"
379"                BL      sub_FF86870C\n"
380"                B       loc_FF8661C8\n"
381"loc_FF8661A4:\n"
382// jumptable FF865F58 entry 31
383"                MOV     R0, #1\n"
384"                BL      sub_FF93E8DC\n"
385"                LDRH    R0, [R4,#0x8C]\n"
386"                CMP     R0, #3\n"
387"                BLNE    sub_FF868948\n"
388"                B       loc_FF8661C8\n"
389"loc_FF8661BC:\n"
390// jumptable FF865F58 default entry
391"                LDR     R1, =0x65E\n"
392"                LDR     R0, =0xFF865A28\n" // "SsShootTask.c"
393"                BL      sub_FF81B1CC\n" // DebugAssert
394"loc_FF8661C8:\n"
395// jumptable FF865F58 entry 32: Most continue here
396// also called explicitly in shoot after 1 and 30, and on pb -> shoot 2x
397"                LDR     R0, [SP]\n"
398"                LDR     R1, [R0,#4]\n"
399"                LDR     R0, [R6,#8]\n"
400"                BL      sub_FF86E084\n"
401"                LDR     R5, [SP]\n"
402"                LDR     R0, [R5,#8]\n"
403"                CMP     R0, #0\n"
404"                LDREQ   R1, =0x11D\n"
405"                LDREQ   R0, =0xFF865A28\n" // "SsShootTask.c"
406"                BLEQ    sub_FF81B1CC\n" // DebugAssert
407"                STR     R7, [R5,#8]\n"
408"                B       loc_FF865F20\n" // -> main loop
409    );
410}
411
Note: See TracBrowser for help on using the repository browser.