summaryrefslogtreecommitdiff
path: root/asm/SDK/DWC/dwc_common/dwc_error.s
blob: 9663fe01a35c75292695cbf5bfc9cca73353bd36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.include "macros.inc"

.section .text, "ax"  # 0x80006980 - 0x803E1E60

.global DWC_GetLastError
DWC_GetLastError:
/* 8031C48C 003180EC  2C 03 00 00 */	cmpwi r3, 0
/* 8031C490 003180F0  41 82 00 0C */	beq lbl_8031C49C
/* 8031C494 003180F4  80 0D B0 14 */	lwz r0, lbl_806402D4-_SDA_BASE_(r13)
/* 8031C498 003180F8  90 03 00 00 */	stw r0, 0(r3)
lbl_8031C49C:
/* 8031C49C 003180FC  80 6D B0 10 */	lwz r3, lbl_806402D0-_SDA_BASE_(r13)
/* 8031C4A0 00318100  4E 80 00 20 */	blr

.global DWC_GetLastErrorEx
DWC_GetLastErrorEx:
/* 8031C4A4 00318104  2C 03 00 00 */	cmpwi r3, 0
/* 8031C4A8 00318108  41 82 00 0C */	beq lbl_8031C4B4
/* 8031C4AC 0031810C  80 0D B0 14 */	lwz r0, lbl_806402D4-_SDA_BASE_(r13)
/* 8031C4B0 00318110  90 03 00 00 */	stw r0, 0(r3)
lbl_8031C4B4:
/* 8031C4B4 00318114  2C 04 00 00 */	cmpwi r4, 0
/* 8031C4B8 00318118  41 82 00 90 */	beq lbl_8031C548
/* 8031C4BC 0031811C  80 0D B0 10 */	lwz r0, lbl_806402D0-_SDA_BASE_(r13)
/* 8031C4C0 00318120  28 00 00 11 */	cmplwi r0, 0x11
/* 8031C4C4 00318124  41 81 00 7C */	bgt lbl_8031C540
/* 8031C4C8 00318128  3C 60 80 44 */	lis r3, lbl_804466D0@ha
/* 8031C4CC 0031812C  54 00 10 3A */	slwi r0, r0, 2
/* 8031C4D0 00318130  38 63 66 D0 */	addi r3, r3, lbl_804466D0@l
/* 8031C4D4 00318134  7C 63 00 2E */	lwzx r3, r3, r0
/* 8031C4D8 00318138  7C 69 03 A6 */	mtctr r3
/* 8031C4DC 0031813C  4E 80 04 20 */	bctr
/* 8031C4E0 00318140  38 00 00 06 */	li r0, 6
/* 8031C4E4 00318144  90 04 00 00 */	stw r0, 0(r4)
/* 8031C4E8 00318148  48 00 00 60 */	b lbl_8031C548
/* 8031C4EC 0031814C  38 00 00 03 */	li r0, 3
/* 8031C4F0 00318150  90 04 00 00 */	stw r0, 0(r4)
/* 8031C4F4 00318154  48 00 00 54 */	b lbl_8031C548
/* 8031C4F8 00318158  38 00 00 04 */	li r0, 4
/* 8031C4FC 0031815C  90 04 00 00 */	stw r0, 0(r4)
/* 8031C500 00318160  48 00 00 48 */	b lbl_8031C548
/* 8031C504 00318164  38 00 00 01 */	li r0, 1
/* 8031C508 00318168  90 04 00 00 */	stw r0, 0(r4)
/* 8031C50C 0031816C  48 00 00 3C */	b lbl_8031C548
/* 8031C510 00318170  38 00 00 07 */	li r0, 7
/* 8031C514 00318174  90 04 00 00 */	stw r0, 0(r4)
/* 8031C518 00318178  48 00 00 30 */	b lbl_8031C548
/* 8031C51C 0031817C  38 00 00 05 */	li r0, 5
/* 8031C520 00318180  90 04 00 00 */	stw r0, 0(r4)
/* 8031C524 00318184  48 00 00 24 */	b lbl_8031C548
/* 8031C528 00318188  38 00 00 06 */	li r0, 6
/* 8031C52C 0031818C  90 04 00 00 */	stw r0, 0(r4)
/* 8031C530 00318190  48 00 00 18 */	b lbl_8031C548
/* 8031C534 00318194  38 00 00 02 */	li r0, 2
/* 8031C538 00318198  90 04 00 00 */	stw r0, 0(r4)
/* 8031C53C 0031819C  48 00 00 0C */	b lbl_8031C548
lbl_8031C540:
/* 8031C540 003181A0  38 00 00 00 */	li r0, 0
/* 8031C544 003181A4  90 04 00 00 */	stw r0, 0(r4)
lbl_8031C548:
/* 8031C548 003181A8  80 6D B0 10 */	lwz r3, lbl_806402D0-_SDA_BASE_(r13)
/* 8031C54C 003181AC  4E 80 00 20 */	blr

.global DWC_ClearError
DWC_ClearError:
/* 8031C550 003181B0  80 0D B0 10 */	lwz r0, lbl_806402D0-_SDA_BASE_(r13)
/* 8031C554 003181B4  2C 00 00 09 */	cmpwi r0, 9
/* 8031C558 003181B8  4D 82 00 20 */	beqlr
/* 8031C55C 003181BC  38 00 00 00 */	li r0, 0
/* 8031C560 003181C0  90 0D B0 10 */	stw r0, lbl_806402D0-_SDA_BASE_(r13)
/* 8031C564 003181C4  90 0D B0 14 */	stw r0, lbl_806402D4-_SDA_BASE_(r13)
/* 8031C568 003181C8  4E 80 00 20 */	blr

.global DWCi_IsError
DWCi_IsError:
/* 8031C56C 003181CC  80 6D B0 10 */	lwz r3, lbl_806402D0-_SDA_BASE_(r13)
/* 8031C570 003181D0  7C 03 00 D0 */	neg r0, r3
/* 8031C574 003181D4  7C 00 1B 78 */	or r0, r0, r3
/* 8031C578 003181D8  54 03 0F FE */	srwi r3, r0, 0x1f
/* 8031C57C 003181DC  4E 80 00 20 */	blr

.global DWCi_SetError
DWCi_SetError:
/* 8031C580 003181E0  80 0D B0 10 */	lwz r0, lbl_806402D0-_SDA_BASE_(r13)
/* 8031C584 003181E4  2C 00 00 09 */	cmpwi r0, 9
/* 8031C588 003181E8  4D 82 00 20 */	beqlr
/* 8031C58C 003181EC  90 6D B0 10 */	stw r3, lbl_806402D0-_SDA_BASE_(r13)
/* 8031C590 003181F0  90 8D B0 14 */	stw r4, lbl_806402D4-_SDA_BASE_(r13)
/* 8031C594 003181F4  4E 80 00 20 */	blr