summaryrefslogtreecommitdiff
path: root/asm/TRK_MINNOW_DOLPHIN/nubinit.s
blob: 38c1598ba65a0a1f582122db16eaeeb87deace99 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
.include "macros.inc"

.section .text, "ax"  # 0x80005600 - 0x8036FBA0
.global TRKInitializeNub
TRKInitializeNub:
/* 80087EC4 00084E04  7C 08 02 A6 */	mflr r0
/* 80087EC8 00084E08  90 01 00 04 */	stw r0, 4(r1)
/* 80087ECC 00084E0C  94 21 FF F0 */	stwu r1, -0x10(r1)
/* 80087ED0 00084E10  93 E1 00 0C */	stw r31, 0xc(r1)
/* 80087ED4 00084E14  93 C1 00 08 */	stw r30, 8(r1)
/* 80087ED8 00084E18  48 00 01 0D */	bl TRKInitializeEndian
/* 80087EDC 00084E1C  7C 7E 1B 79 */	or. r30, r3, r3
/* 80087EE0 00084E20  40 82 00 08 */	bne lbl_80087EE8
/* 80087EE4 00084E24  48 00 0B AD */	bl usr_put_initialize
lbl_80087EE8:
/* 80087EE8 00084E28  2C 1E 00 00 */	cmpwi r30, 0
/* 80087EEC 00084E2C  40 82 00 0C */	bne lbl_80087EF8
/* 80087EF0 00084E30  4B FF FD 79 */	bl TRKInitializeEventQueue
/* 80087EF4 00084E34  7C 7E 1B 78 */	mr r30, r3
lbl_80087EF8:
/* 80087EF8 00084E38  2C 1E 00 00 */	cmpwi r30, 0
/* 80087EFC 00084E3C  40 82 00 0C */	bne lbl_80087F08
/* 80087F00 00084E40  48 00 01 89 */	bl TRKInitializeMessageBuffers
/* 80087F04 00084E44  7C 7E 1B 78 */	mr r30, r3
lbl_80087F08:
/* 80087F08 00084E48  2C 1E 00 00 */	cmpwi r30, 0
/* 80087F0C 00084E4C  40 82 00 0C */	bne lbl_80087F18
/* 80087F10 00084E50  48 00 0B 85 */	bl TRKInitializeDispatcher
/* 80087F14 00084E54  7C 7E 1B 78 */	mr r30, r3
lbl_80087F18:
/* 80087F18 00084E58  2C 1E 00 00 */	cmpwi r30, 0
/* 80087F1C 00084E5C  40 82 00 40 */	bne lbl_80087F5C
/* 80087F20 00084E60  3C 60 80 3F */	lis r3, gTRKInputPendingPtr@ha
/* 80087F24 00084E64  3B E3 AA D4 */	addi r31, r3, gTRKInputPendingPtr@l
/* 80087F28 00084E68  3C 60 00 01 */	lis r3, 0x0000E100@ha
/* 80087F2C 00084E6C  38 DF 00 00 */	addi r6, r31, 0
/* 80087F30 00084E70  38 63 E1 00 */	addi r3, r3, 0x0000E100@l
/* 80087F34 00084E74  38 80 00 01 */	li r4, 1
/* 80087F38 00084E78  38 A0 00 00 */	li r5, 0
/* 80087F3C 00084E7C  48 00 42 85 */	bl TRKInitializeIntDrivenUART
/* 80087F40 00084E80  7C 60 1B 78 */	mr r0, r3
/* 80087F44 00084E84  80 7F 00 00 */	lwz r3, 0(r31)
/* 80087F48 00084E88  7C 1F 03 78 */	mr r31, r0
/* 80087F4C 00084E8C  48 00 3A B9 */	bl TRKTargetSetInputPendingPtr
/* 80087F50 00084E90  2C 1F 00 00 */	cmpwi r31, 0
/* 80087F54 00084E94  41 82 00 08 */	beq lbl_80087F5C
/* 80087F58 00084E98  7F FE FB 78 */	mr r30, r31
lbl_80087F5C:
/* 80087F5C 00084E9C  2C 1E 00 00 */	cmpwi r30, 0
/* 80087F60 00084EA0  40 82 00 0C */	bne lbl_80087F6C
/* 80087F64 00084EA4  48 00 0B 01 */	bl TRKInitializeSerialHandler
/* 80087F68 00084EA8  7C 7E 1B 78 */	mr r30, r3
lbl_80087F6C:
/* 80087F6C 00084EAC  2C 1E 00 00 */	cmpwi r30, 0
/* 80087F70 00084EB0  40 82 00 0C */	bne lbl_80087F7C
/* 80087F74 00084EB4  48 00 3C 91 */	bl TRKInitializeTarget
/* 80087F78 00084EB8  7C 7E 1B 78 */	mr r30, r3
lbl_80087F7C:
/* 80087F7C 00084EBC  7F C3 F3 78 */	mr r3, r30
/* 80087F80 00084EC0  83 E1 00 0C */	lwz r31, 0xc(r1)
/* 80087F84 00084EC4  83 C1 00 08 */	lwz r30, 8(r1)
/* 80087F88 00084EC8  38 21 00 10 */	addi r1, r1, 0x10
/* 80087F8C 00084ECC  80 01 00 04 */	lwz r0, 4(r1)
/* 80087F90 00084ED0  7C 08 03 A6 */	mtlr r0
/* 80087F94 00084ED4  4E 80 00 20 */	blr 

.global TRKTerminateNub
TRKTerminateNub:
/* 80087F98 00084ED8  7C 08 02 A6 */	mflr r0
/* 80087F9C 00084EDC  90 01 00 04 */	stw r0, 4(r1)
/* 80087FA0 00084EE0  94 21 FF F8 */	stwu r1, -8(r1)
/* 80087FA4 00084EE4  48 00 0A E5 */	bl TRKTerminateSerialHandler
/* 80087FA8 00084EE8  38 60 00 00 */	li r3, 0
/* 80087FAC 00084EEC  38 21 00 08 */	addi r1, r1, 8
/* 80087FB0 00084EF0  80 01 00 04 */	lwz r0, 4(r1)
/* 80087FB4 00084EF4  7C 08 03 A6 */	mtlr r0
/* 80087FB8 00084EF8  4E 80 00 20 */	blr 

.global TRKNubWelcome
TRKNubWelcome:
/* 80087FBC 00084EFC  7C 08 02 A6 */	mflr r0
/* 80087FC0 00084F00  3C 60 80 37 */	lis r3, "@40"@ha
/* 80087FC4 00084F04  90 01 00 04 */	stw r0, 4(r1)
/* 80087FC8 00084F08  38 63 21 F0 */	addi r3, r3, "@40"@l
/* 80087FCC 00084F0C  94 21 FF F8 */	stwu r1, -8(r1)
/* 80087FD0 00084F10  48 00 43 79 */	bl TRK_board_display
/* 80087FD4 00084F14  38 21 00 08 */	addi r1, r1, 8
/* 80087FD8 00084F18  80 01 00 04 */	lwz r0, 4(r1)
/* 80087FDC 00084F1C  7C 08 03 A6 */	mtlr r0
/* 80087FE0 00084F20  4E 80 00 20 */	blr 

.global TRKInitializeEndian
TRKInitializeEndian:
/* 80087FE4 00084F24  3C 60 80 3F */	lis r3, gTRKBigEndian@ha
/* 80087FE8 00084F28  94 21 FF F0 */	stwu r1, -0x10(r1)
/* 80087FEC 00084F2C  38 A3 91 08 */	addi r5, r3, gTRKBigEndian@l
/* 80087FF0 00084F30  38 C0 00 01 */	li r6, 1
/* 80087FF4 00084F34  90 C5 00 00 */	stw r6, 0(r5)
/* 80087FF8 00084F38  38 00 00 12 */	li r0, 0x12
/* 80087FFC 00084F3C  38 60 00 34 */	li r3, 0x34
/* 80088000 00084F40  98 01 00 08 */	stb r0, 8(r1)
/* 80088004 00084F44  38 80 00 56 */	li r4, 0x56
/* 80088008 00084F48  38 00 00 78 */	li r0, 0x78
/* 8008800C 00084F4C  98 61 00 09 */	stb r3, 9(r1)
/* 80088010 00084F50  38 60 00 00 */	li r3, 0
/* 80088014 00084F54  98 81 00 0A */	stb r4, 0xa(r1)
/* 80088018 00084F58  98 01 00 0B */	stb r0, 0xb(r1)
/* 8008801C 00084F5C  80 81 00 08 */	lwz r4, 8(r1)
/* 80088020 00084F60  3C 04 ED CC */	addis r0, r4, 0xedcc
/* 80088024 00084F64  28 00 56 78 */	cmplwi r0, 0x5678
/* 80088028 00084F68  40 82 00 0C */	bne lbl_80088034
/* 8008802C 00084F6C  90 C5 00 00 */	stw r6, 0(r5)
/* 80088030 00084F70  48 00 00 20 */	b lbl_80088050
lbl_80088034:
/* 80088034 00084F74  3C 04 87 AA */	addis r0, r4, 0x87aa
/* 80088038 00084F78  28 00 34 12 */	cmplwi r0, 0x3412
/* 8008803C 00084F7C  40 82 00 10 */	bne lbl_8008804C
/* 80088040 00084F80  38 00 00 00 */	li r0, 0
/* 80088044 00084F84  90 05 00 00 */	stw r0, 0(r5)
/* 80088048 00084F88  48 00 00 08 */	b lbl_80088050
lbl_8008804C:
/* 8008804C 00084F8C  38 60 00 01 */	li r3, 1
lbl_80088050:
/* 80088050 00084F90  38 21 00 10 */	addi r1, r1, 0x10
/* 80088054 00084F94  4E 80 00 20 */	blr 

.section .rodata, "a"  # 0x8036FFA0 - 0x803A8380
.balign 8
"@40":
	.asciz "MetroTRK for Dolphin v0.8"
.balign 8

.section .bss, "wa"  # 0x803E6000 - 0x80408AC0
.global gTRKBigEndian
gTRKBigEndian:
	.skip 0x8