This source file includes following definitions.
- filewritetask
- sub_FFAA5F08_my
1
2
3
4 #include "lolevel.h"
5 #include "platform.h"
6
7 typedef struct {
8 unsigned int address;
9 unsigned int length;
10 } cam_ptp_data_chunk;
11
12 #define MAX_CHUNKS_FOR_FWT 3
13
14
15
16
17
18
19
20 typedef struct
21 {
22 int unkn1[5];
23 cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_FWT];
24 char name[32];
25 } fwt_data_struct;
26 #define CAM_HAS_COMPLETEFILEWRITE_REPLACEMENT 1
27
28 #include "../../../generic/filewrite.c"
29
30
31
32 void __attribute__((naked,noinline)) filewritetask() {
33 asm volatile (
34 " STMFD SP!, {R4,LR} \n"
35 " SUB SP, SP, #4 \n"
36 " MOV R4, SP \n"
37 " B loc_FFAA61F0 \n"
38
39 "loc_FFAA61B0:\n"
40 " CMP R2, #5 \n"
41 " LDRLS PC, [PC, R2, LSL#2] \n"
42 " B loc_FFAA61F0 \n"
43 " .long loc_FFAA61D4 \n"
44 " .long loc_FFAA61DC \n"
45 " .long loc_FFAA61E4 \n"
46 " .long loc_FFAA61E4 \n"
47 " .long loc_FFAA61E4 \n"
48 " .long loc_FFAA61EC \n"
49
50 "loc_FFAA61D4:\n"
51 " BL sub_FFAA5DE0 \n"
52 " B loc_FFAA61F0 \n"
53
54 "loc_FFAA61DC:\n"
55 " BL sub_FFAA5F08_my \n"
56 " B loc_FFAA61F0 \n"
57
58 "loc_FFAA61E4:\n"
59 " BL sub_FFAA5FE4 \n"
60 " B loc_FFAA61F0 \n"
61
62 "loc_FFAA61EC:\n"
63 " BL sub_FFAA60DC \n"
64 " BL fwt_after_close\n"
65
66 "loc_FFAA61F0:\n"
67 " LDR R3, =0x74A58 \n"
68 " MOV R1, R4 \n"
69 " LDR R0, [R3] \n"
70 " MOV R2, #0 \n"
71 " BL sub_FFB40944 /*_ReceiveMessageQueue*/ \n"
72 " CMP R0, #0 \n"
73 " BNE loc_FFAA622C \n"
74 " LDR R0, [SP] \n"
75 " LDR R3, [R0] \n"
76 " CMP R3, #1 \n"
77 " SUB R2, R3, #2 \n"
78 " BNE loc_FFAA61B0 \n"
79 " LDR R3, =0x74A50 \n"
80 " LDR R0, [R3] \n"
81 " BL _GiveSemaphore \n"
82
83 "loc_FFAA622C:\n"
84 " BL _ExitTask \n"
85 " ADD SP, SP, #4 \n"
86 " LDMFD SP!, {R4,PC} \n"
87 );
88 }
89
90
91
92 void __attribute__((naked,noinline)) sub_FFAA5F08_my() {
93 asm volatile (
94 " STMFD SP!, {R4,R5,LR} \n"
95 " MOV R5, R0 \n"
96 " ADD R4, R5, #0x2C \n"
97 " MOV R0, R4 \n"
98 " BL sub_FFAAE5F4 \n"
99 " MOV R1, #0 \n"
100 " BL sub_FFAB143C \n"
101 " LDR R0, [R5, #0xC] \n"
102 " BL sub_FFAB2070 \n"
103 " MOV R2, #0x1B4 \n"
104 " LDR R1, [R5, #8] \n"
105 " ADD R2, R2, #2 \n"
106 " LDR R3, [R5, #0xC] \n"
107
108
109
110
111
112 " STMFD SP!, {R1-R12,LR}\n"
113 " MOV R0, R5\n"
114 " BL filewrite_main_hook\n"
115 " BL filewrite_file_complete\n"
116 " CMP R0, #0\n"
117 " LDRNE R0, =loc_mynull\n"
118 " LDMFD SP!, {R1-R12,LR}\n"
119 " MOVEQ R0, R4\n"
120
121
122 " BL sub_FFAA5E74 \n"
123 " LDR R3, =0x74A48 \n"
124 " MOV R12, R0 \n"
125 " CMN R12, #1 \n"
126 " MOV R1, R4 \n"
127 " MOV R2, #0x20 \n"
128 " MOV R0, R4 \n"
129 " STR R12, [R3] \n"
130 " BNE loc_FFAA5F90 \n"
131 " BL sub_FFAAE5F4 \n"
132 " BL sub_FFAB14A4 \n"
133 " LDR R3, =0x74B68 \n"
134 " LDR R3, [R3] \n"
135 " MOV R0, #0x8000001 \n"
136 " CMP R3, #0 \n"
137 " ADD R0, R0, #0x1200000 \n"
138 " LDMEQFD SP!, {R4,R5,PC} \n"
139 " MOV LR, PC \n"
140 " MOV PC, R3 \n"
141 " LDMFD SP!, {R4,R5,PC} \n"
142
143 "loc_FFAA5F90:\n"
144 " LDR R0, =0x74B48 \n"
145 " BL _memcpy \n"
146 " MOV R0, #4 \n"
147 " MOV R1, R5 \n"
148 " LDMFD SP!, {R4,R5,LR} \n"
149 " B sub_FFAA5CF0 \n"
150
151 "loc_mynull:\n"
152 ".asciz \"/null\" \n"
153
154 );
155 }