Big up for Volca ... slowdown the busy icon
[open-ps2-loader.git] / ee_core / include / padpatterns.h
blobc100876e4f630904ce01dc44f7775595de910470
1 /*
2 Copyright 2009-2010, Ifcaro, jimmikaelkael & Polo
3 Copyright 2006-2008 Polo
4 Licenced under Academic Free License version 3.0
5 Review Open-Ps2-Loader README & LICENSE files for further details.
7 Some parts of the code are taken from HD Project by Polo
8 */
10 #ifndef PADPATTERNS_H
11 #define PADPATTERNS_H
13 #include <tamtypes.h>
15 /*******************************************************
16 * For libpad support
18 * libpad 2.1.1.0
19 * libpad 2.1.3.0
20 * libpad 2.2.0.0
21 * libpad 2.3.0.0
22 * libpad 2.4.1.0
23 * libpad 2.5.0.0
24 * libpad 2.6.0.0
25 * libpad 2.7.0.0
26 * libpad 2.7.1.0
27 * libpad 2.8.0.0
28 * libpad 3.0.0.0
29 * libpad 3.0.1.0
30 * libpad 3.0.2.0
31 * libpad 3.1.0.0
33 static u32 padPortOpenpattern0[] = {
34 0x27bdff50, // addiu sp, sp, $ff50
35 0xffb40050, // sd s4, $0050(sp)
36 0xffb30040, // sd s3, $0040(sp)
37 0x00c0a02d, // daddu s4, a2, zero
38 0xffb20030, // sd s2, $0030(sp)
39 0x0080982d, // daddu s3, a0, zero
40 0xffbf00a0, // sd ra, $00a0(sp)
41 0x00a0902d, // daddu s2, a1, zero
42 0xffbe0090, // sd fp, $0090(sp)
43 0x3282003f, // andi v0, s4, $003f
44 0xffb70080, // sd s7, $0080(sp)
45 0xffb60070, // sd s6, $0070(sp)
46 0xffb50060, // sd s5, $0060(sp)
47 0xffb10020, // sd s1, $0020(sp)
48 0x10400000, // beq v0, zero, $XXXXXXXX
49 0xffb00010, // sd s0, $0010(sp)
50 0x3c020000, // lui v0, $XXXX
51 0x8c430000, // lw v1, $XXXX(v0)
52 0x10600000, // beq v1, zero, $XXXXXXXX
53 0x3c040000, // lui a0, $XXXX
54 0x0280282d, // daddu a1, s4, zero
55 0x0c000000 // jal scePrintf
57 static u32 padPortOpenpattern0_mask[] = {
58 0xffffffff,
59 0xffffffff,
60 0xffffffff,
61 0xffffffff,
62 0xffffffff,
63 0xffffffff,
64 0xffffffff,
65 0xffffffff,
66 0xffffffff,
67 0xffffffff,
68 0xffffffff,
69 0xffffffff,
70 0xffffffff,
71 0xffffffff,
72 0xffff0000,
73 0xffffffff,
74 0xffff0000,
75 0xffff0000,
76 0xffff0000,
77 0xffff0000,
78 0xffffffff,
79 0xfc000000
82 /*******************************************************
83 * For libpad support
85 * libpad 2.1.0.0
87 static u32 padPortOpenpattern1[] = {
88 0x27bdff50, // addiu sp, sp, $ff50
89 0xffb20030, // sd s2, $0030(sp)
90 0xffb40050, // sd s4, $0050(sp)
91 0x00c0902d, // daddu s2, a2, zero
92 0xffb30040, // sd s3, $0040(sp)
93 0x00a0a02d, // daddu s4, a1, zero
94 0xffbf00a0, // sd ra, $00a0(sp)
95 0x0080982d, // daddu s3, a0, zero
96 0xffbe0090, // sd fp, $0090(sp)
97 0x3242003f, // andi v0, s2, $003f
98 0xffb70080, // sd s7, $0080(sp)
99 0xffb60070, // sd s6, $0070(sp)
100 0xffb50060, // sd s5, $0060(sp)
101 0xffb10020, // sd s1, $0020(sp)
102 0x10400000, // beq v0, zero, $XXXXXXXX
103 0xffb00010, // sd s0, $0010(sp)
104 0x3c040000, // lui a0, $XXXX
105 0x0240282d, // daddu a1, s2, zero
106 0x0c000000 // jal kprintf
108 static u32 padPortOpenpattern1_mask[] = {
109 0xffffffff,
110 0xffffffff,
111 0xffffffff,
112 0xffffffff,
113 0xffffffff,
114 0xffffffff,
115 0xffffffff,
116 0xffffffff,
117 0xffffffff,
118 0xffffffff,
119 0xffffffff,
120 0xffffffff,
121 0xffffffff,
122 0xffffffff,
123 0xffff0000,
124 0xffffffff,
125 0xffff0000,
126 0xffffffff,
127 0xfc000000
130 /*******************************************************
131 * For libpad support
133 * libpad 1.6.3.0
134 * libpad 2.0.0.0
136 static u32 padPortOpenpattern2[] = {
137 0x27bdff60, // addiu sp, sp, $ff60
138 0xffb20030, // sd s2, $0030(sp)
139 0xffb70080, // sd s7, $0080(sp)
140 0x00c0902d, // daddu s2, a2, zero
141 0xffb60070, // sd s6, $0070(sp)
142 0x0080b82d, // daddu s7, a0, zero
143 0xffbf0090, // sd ra, $0090(sp)
144 0x00a0b02d, // daddu s6, a1, zero
145 0xffb50060, // sd s5, $0060(sp)
146 0x3242003f, // andi v0, s2, $003f
147 0xffb40050, // sd s4, $0050(sp)
148 0xffb30040, // sd s3, $0040(sp)
149 0xffb10020, // sd s1, $0020(sp)
150 0x10400000, // beq v0, zero, $XXXXXXXX
151 0xffb00010, // sd s0, $0010(sp)
152 0x3c040000, // lui a0, $XXXX
153 0x0240282d, // daddu a1, s2, zero
154 0x0c000000 // jal printf
156 static u32 padPortOpenpattern2_mask[] = {
157 0xffffffff,
158 0xffffffff,
159 0xffffffff,
160 0xffffffff,
161 0xffffffff,
162 0xffffffff,
163 0xffffffff,
164 0xffffffff,
165 0xffffffff,
166 0xffffffff,
167 0xffffffff,
168 0xffffffff,
169 0xffffffff,
170 0xffff0000,
171 0xffffffff,
172 0xffff0000,
173 0xffffffff,
174 0xfc000000
177 /*******************************************************
178 * For libpad support
180 * libpad 1.5.0.0
182 static u32 padPortOpenpattern3[] = {
183 0x27bdff70, // addiu sp, sp, $ff70
184 0xffb20030, // sd s2, $0030(sp)
185 0xffb50060, // sd s5, $0060(sp)
186 0x00c0902d, // daddu s2, a2, zero
187 0xffb40050, // sd s4, $0050(sp)
188 0x0080a82d, // daddu s5, a0, zero
189 0xffbf0080, // sd ra, $0080(sp)
190 0x00a0a02d, // daddu s4, a1, zero
191 0xffb60070, // sd s6, $0070(sp)
192 0x3242000f, // andi v0, s2, $000f
193 0xffb30040, // sd s3, $0040(sp)
194 0xffb10020, // sd s1, $0020(sp)
195 0x10400000, // beq v0, zero, $XXXXXXXX
196 0xffb00010, // sd s0, $0010(sp)
197 0x3c040000, // lui a0, $XXXX
198 0x0c000000 // jal printf
200 static u32 padPortOpenpattern3_mask[] = {
201 0xffffffff,
202 0xffffffff,
203 0xffffffff,
204 0xffffffff,
205 0xffffffff,
206 0xffffffff,
207 0xffffffff,
208 0xffffffff,
209 0xffffffff,
210 0xffffffff,
211 0xffffffff,
212 0xffffffff,
213 0xffff0000,
214 0xffffffff,
215 0xffff0000,
216 0xfc000000
219 /**************************************************************************
220 * For libpad2 support
222 * libpad2 2.7.1.0
223 * libpad2 3.0.0.0
224 * libpad2 3.0.2.0
225 * libpad2 3.1.0.0
227 static u32 pad2CreateSocketpattern0[] = {
228 0x27bdff90, // addiu sp, sp, $ff90
229 0x0080302d, // daddu a2, a0, zero
230 0xffb10040, // sd s1, $0040(sp)
231 0x00a0882d, // daddu s1, a1, zero
232 0xffbf0060, // sd ra, $0060(sp)
233 0xffb20050, // sd s2, $0050(sp)
234 0x3222003f, // andi v0, s1, $003f
235 0x10400000, // beq v0, zero, $XXXXXXXX
236 0xffb00030, // sd s0, $0030(sp)
237 0x3c040000, // lui a0, $XXXX
238 0x0c000000, // jal scePrintf
239 0x24840000, // addiu a0, a0, $XXXX
240 0x10000000, // beq zero, zero, $XXXXXXXX
241 0x2402ffff, // addiu v0, zero, $ffff
242 0x50c00000, // beql a2, zero, $XXXXXXXX
243 0xafa00000, // sw zero, $0000(sp)
244 0x8cc20000, // lw v0, $0000(a2)
245 0x8cc30004, // lw v1, $0004(a2)
246 0x8cc40008, // lw a0, $0008(a2)
247 0x8cc5000c, // lw a1, $000c(a2)
248 0xafa20000, // sw v0, $0000(sp)
249 0xafa30008, // sw v1, $0008(sp)
250 0xafa4000c, // sw a0, $000c(sp)
251 0xafa50010 // sw a1, $0010(sp)
253 static u32 pad2CreateSocketpattern0_mask[] = {
254 0xffffffff,
255 0xffffffff,
256 0xffffffff,
257 0xffffffff,
258 0xffffffff,
259 0xffffffff,
260 0xffffffff,
261 0xffff0000,
262 0xffffffff,
263 0xffff0000,
264 0xfc000000,
265 0xffff0000,
266 0xffff0000,
267 0xffffffff,
268 0xffff0000,
269 0xffffffff,
270 0xffffffff,
271 0xffffffff,
272 0xffffffff,
273 0xffffffff,
274 0xffffffff,
275 0xffffffff,
276 0xffffffff,
277 0xffffffff
280 /**************************************************************************
281 * For libpad2 support
283 * libpad2 2.7.0.0
285 static u32 pad2CreateSocketpattern1[] = {
286 0x27bdff70, // addiu sp, sp, $ff70
287 0x0080302d, // daddu a2, a0, zero
288 0xffb30060, // sd s3, $0060(sp)
289 0x00a0982d, // daddu s3, a1, zero
290 0xffbf0080, // sd ra, $0080(sp)
291 0xffb40070, // sd s4, $0070(sp)
292 0x3262003f, // andi v0, s3, $003f
293 0xffb20050, // sd s2, $0050(sp)
294 0xffb10040, // sd s1, $0040(sp)
295 0x10400000, // beq v0, zero, $XXXXXXXX
296 0xffb00030, // sd s0, $0030(sp)
297 0x3c040000, // lui a0, $XXXX
298 0x0c000000, // jal scePrintf
299 0x24840000, // addiu a0, a0, $XXXX
300 0x10000000, // beq zero, zero, $XXXXXXXX
301 0x2402ffff, // addiu v0, zero, $ffff
302 0x50c00000, // beql a2, zero, $XXXXXXXX
303 0xafa00000, // sw zero, $0000(sp)
304 0x8cc20000, // lw v0, $0000(a2)
305 0x8cc30004, // lw v1, $0004(a2)
306 0x8cc40008, // lw a0, $0008(a2)
307 0x8cc5000c, // lw a1, $000c(a2)
308 0xafa20000, // sw v0, $0000(sp)
309 0xafa30008, // sw v1, $0008(sp)
310 0xafa4000c // sw a0, $000c(sp)
312 static u32 pad2CreateSocketpattern1_mask[] = {
313 0xffffffff,
314 0xffffffff,
315 0xffffffff,
316 0xffffffff,
317 0xffffffff,
318 0xffffffff,
319 0xffffffff,
320 0xffffffff,
321 0xffffffff,
322 0xffff0000,
323 0xffffffff,
324 0xffff0000,
325 0xfc000000,
326 0xffff0000,
327 0xffff0000,
328 0xffffffff,
329 0xffff0000,
330 0xffffffff,
331 0xffffffff,
332 0xffffffff,
333 0xffffffff,
334 0xffffffff,
335 0xffffffff,
336 0xffffffff,
337 0xffffffff
340 /**************************************************************************
341 * For libpad2 support
343 * libpad2 2.5.0.0
345 static u32 pad2CreateSocketpattern2[] = {
346 0x27bdff70, // addiu sp, sp, $ff70
347 0x0080302d, // daddu a2, a0, zero
348 0xffb30060, // sd s3, $0060(sp)
349 0x00a0982d, // daddu s3, a1, zero
350 0xffbf0080, // sd ra, $0080(sp)
351 0xffb40070, // sd s4, $0070(sp)
352 0x3262003f, // andi v0, s3, $003f
353 0xffb20050, // sd s2, $0050(sp)
354 0xffb10040, // sd s1, $0040(sp)
355 0x10400000, // beq v0, zero, $XXXXXXXX
356 0xffb00030, // sd s0, $0030(sp)
357 0x10000000, // beq zero, zero, $XXXXXXXX
358 0x2402ffff, // addiu v0, zero, $ffff
359 0x50c00000, // beql a2, zero, $XXXXXXXX
360 0xafa00000, // sw zero, $0000(sp)
361 0x8cc20000, // lw v0, $0000(a2)
362 0x8cc30004, // lw v1, $0004(a2)
363 0x8cc40008, // lw a0, $0008(a2)
364 0x8cc5000c, // lw a1, $000c(a2)
365 0xafa20000, // sw v0, $0000(sp)
366 0xafa30008, // sw v1, $0008(sp)
367 0xafa4000c, // sw a0, $000c(sp)
368 0xafa50010 // sw a1, $0010(sp)
370 static u32 pad2CreateSocketpattern2_mask[] = {
371 0xffffffff,
372 0xffffffff,
373 0xffffffff,
374 0xffffffff,
375 0xffffffff,
376 0xffffffff,
377 0xffffffff,
378 0xffffffff,
379 0xffffffff,
380 0xffff0000,
381 0xffffffff,
382 0xffff0000,
383 0xffffffff,
384 0xffff0000,
385 0xffffffff,
386 0xffffffff,
387 0xffffffff,
388 0xffffffff,
389 0xffffffff,
390 0xffffffff,
391 0xffffffff,
392 0xffffffff,
393 0xffffffff
396 #endif /* PADPATTERNS */