mirror of https://github.com/PrimeDecomp/prime.git
205 lines
8.8 KiB
ArmAsm
205 lines
8.8 KiB
ArmAsm
.include "macros.inc"
|
|
|
|
.section .sbss, "wa"
|
|
.balign 8
|
|
|
|
.global lbl_805A9BE8
|
|
lbl_805A9BE8:
|
|
.skip 0x4
|
|
.global lbl_805A9BEC
|
|
lbl_805A9BEC:
|
|
.skip 0x4
|
|
.global lbl_805A9BF0
|
|
lbl_805A9BF0:
|
|
.skip 0x4
|
|
.global lbl_805A9BF4
|
|
lbl_805A9BF4:
|
|
.skip 0xC
|
|
|
|
.section .text, "ax"
|
|
|
|
.global InitializeUART
|
|
InitializeUART:
|
|
/* 803C18F0 003BE850 7C 08 02 A6 */ mflr r0
|
|
/* 803C18F4 003BE854 90 01 00 04 */ stw r0, 4(r1)
|
|
/* 803C18F8 003BE858 94 21 FF F8 */ stwu r1, -8(r1)
|
|
/* 803C18FC 003BE85C 80 6D B0 34 */ lwz r3, lbl_805A9BF4@sda21(r13)
|
|
/* 803C1900 003BE860 3C 03 5A 01 */ addis r0, r3, 0x5a01
|
|
/* 803C1904 003BE864 28 00 00 5A */ cmplwi r0, 0x5a
|
|
/* 803C1908 003BE868 40 82 00 0C */ bne lbl_803C1914
|
|
/* 803C190C 003BE86C 38 60 00 00 */ li r3, 0
|
|
/* 803C1910 003BE870 48 00 00 40 */ b lbl_803C1950
|
|
lbl_803C1914:
|
|
/* 803C1914 003BE874 4B FB BE 09 */ bl OSGetConsoleType
|
|
/* 803C1918 003BE878 54 60 00 C7 */ rlwinm. r0, r3, 0, 3, 3
|
|
/* 803C191C 003BE87C 40 82 00 14 */ bne lbl_803C1930
|
|
/* 803C1920 003BE880 38 00 00 00 */ li r0, 0
|
|
/* 803C1924 003BE884 90 0D B0 30 */ stw r0, lbl_805A9BF0@sda21(r13)
|
|
/* 803C1928 003BE888 38 60 00 02 */ li r3, 2
|
|
/* 803C192C 003BE88C 48 00 00 24 */ b lbl_803C1950
|
|
lbl_803C1930:
|
|
/* 803C1930 003BE890 3C 60 A5 FF */ lis r3, 0xA5FF005A@ha
|
|
/* 803C1934 003BE894 38 03 00 5A */ addi r0, r3, 0xA5FF005A@l
|
|
/* 803C1938 003BE898 38 60 00 00 */ li r3, 0
|
|
/* 803C193C 003BE89C 90 0D B0 30 */ stw r0, lbl_805A9BF0@sda21(r13)
|
|
/* 803C1940 003BE8A0 38 00 00 01 */ li r0, 1
|
|
/* 803C1944 003BE8A4 90 6D B0 28 */ stw r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1948 003BE8A8 38 60 00 00 */ li r3, 0
|
|
/* 803C194C 003BE8AC 90 0D B0 2C */ stw r0, lbl_805A9BEC@sda21(r13)
|
|
lbl_803C1950:
|
|
/* 803C1950 003BE8B0 80 01 00 0C */ lwz r0, 0xc(r1)
|
|
/* 803C1954 003BE8B4 38 21 00 08 */ addi r1, r1, 8
|
|
/* 803C1958 003BE8B8 7C 08 03 A6 */ mtlr r0
|
|
/* 803C195C 003BE8BC 4E 80 00 20 */ blr
|
|
|
|
.global WriteUARTN
|
|
WriteUARTN:
|
|
/* 803C1960 003BE8C0 7C 08 02 A6 */ mflr r0
|
|
/* 803C1964 003BE8C4 90 01 00 04 */ stw r0, 4(r1)
|
|
/* 803C1968 003BE8C8 94 21 FF D0 */ stwu r1, -0x30(r1)
|
|
/* 803C196C 003BE8CC BF 41 00 18 */ stmw r26, 0x18(r1)
|
|
/* 803C1970 003BE8D0 3B C3 00 00 */ addi r30, r3, 0
|
|
/* 803C1974 003BE8D4 3B E4 00 00 */ addi r31, r4, 0
|
|
/* 803C1978 003BE8D8 80 AD B0 30 */ lwz r5, lbl_805A9BF0@sda21(r13)
|
|
/* 803C197C 003BE8DC 3C 05 5A 01 */ addis r0, r5, 0x5a01
|
|
/* 803C1980 003BE8E0 28 00 00 5A */ cmplwi r0, 0x5a
|
|
/* 803C1984 003BE8E4 41 82 00 0C */ beq lbl_803C1990
|
|
/* 803C1988 003BE8E8 38 60 00 02 */ li r3, 2
|
|
/* 803C198C 003BE8EC 48 00 01 C0 */ b lbl_803C1B4C
|
|
lbl_803C1990:
|
|
/* 803C1990 003BE8F0 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1994 003BE8F4 38 A0 00 00 */ li r5, 0
|
|
/* 803C1998 003BE8F8 80 8D B0 2C */ lwz r4, lbl_805A9BEC@sda21(r13)
|
|
/* 803C199C 003BE8FC 4B FF F9 C9 */ bl EXILock
|
|
/* 803C19A0 003BE900 2C 03 00 00 */ cmpwi r3, 0
|
|
/* 803C19A4 003BE904 40 82 00 0C */ bne lbl_803C19B0
|
|
/* 803C19A8 003BE908 38 60 00 00 */ li r3, 0
|
|
/* 803C19AC 003BE90C 48 00 01 A0 */ b lbl_803C1B4C
|
|
lbl_803C19B0:
|
|
/* 803C19B0 003BE910 38 9E 00 00 */ addi r4, r30, 0
|
|
/* 803C19B4 003BE914 38 60 00 0D */ li r3, 0xd
|
|
/* 803C19B8 003BE918 48 00 00 18 */ b lbl_803C19D0
|
|
lbl_803C19BC:
|
|
/* 803C19BC 003BE91C 88 04 00 00 */ lbz r0, 0(r4)
|
|
/* 803C19C0 003BE920 2C 00 00 0A */ cmpwi r0, 0xa
|
|
/* 803C19C4 003BE924 40 82 00 08 */ bne lbl_803C19CC
|
|
/* 803C19C8 003BE928 98 64 00 00 */ stb r3, 0(r4)
|
|
lbl_803C19CC:
|
|
/* 803C19CC 003BE92C 38 84 00 01 */ addi r4, r4, 1
|
|
lbl_803C19D0:
|
|
/* 803C19D0 003BE930 7C 1E 20 50 */ subf r0, r30, r4
|
|
/* 803C19D4 003BE934 7C 00 F8 40 */ cmplw r0, r31
|
|
/* 803C19D8 003BE938 41 80 FF E4 */ blt lbl_803C19BC
|
|
/* 803C19DC 003BE93C 3C 00 A0 01 */ lis r0, 0xa001
|
|
/* 803C19E0 003BE940 90 01 00 14 */ stw r0, 0x14(r1)
|
|
/* 803C19E4 003BE944 3B 40 00 00 */ li r26, 0
|
|
/* 803C19E8 003BE948 3F A0 20 01 */ lis r29, 0x2001
|
|
/* 803C19EC 003BE94C 48 00 01 4C */ b lbl_803C1B38
|
|
lbl_803C19F0:
|
|
/* 803C19F0 003BE950 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C19F4 003BE954 38 A0 00 03 */ li r5, 3
|
|
/* 803C19F8 003BE958 80 8D B0 2C */ lwz r4, lbl_805A9BEC@sda21(r13)
|
|
/* 803C19FC 003BE95C 4B FF F2 61 */ bl EXISelect
|
|
/* 803C1A00 003BE960 2C 03 00 00 */ cmpwi r3, 0
|
|
/* 803C1A04 003BE964 40 82 00 0C */ bne lbl_803C1A10
|
|
/* 803C1A08 003BE968 38 00 FF FF */ li r0, -1
|
|
/* 803C1A0C 003BE96C 48 00 00 5C */ b lbl_803C1A68
|
|
lbl_803C1A10:
|
|
/* 803C1A10 003BE970 93 A1 00 10 */ stw r29, 0x10(r1)
|
|
/* 803C1A14 003BE974 38 81 00 10 */ addi r4, r1, 0x10
|
|
/* 803C1A18 003BE978 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1A1C 003BE97C 38 A0 00 04 */ li r5, 4
|
|
/* 803C1A20 003BE980 38 C0 00 01 */ li r6, 1
|
|
/* 803C1A24 003BE984 38 E0 00 00 */ li r7, 0
|
|
/* 803C1A28 003BE988 4B FF E6 E1 */ bl EXIImm
|
|
/* 803C1A2C 003BE98C 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1A30 003BE990 4B FF EA C1 */ bl EXISync
|
|
/* 803C1A34 003BE994 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1A38 003BE998 38 81 00 10 */ addi r4, r1, 0x10
|
|
/* 803C1A3C 003BE99C 38 A0 00 01 */ li r5, 1
|
|
/* 803C1A40 003BE9A0 38 C0 00 00 */ li r6, 0
|
|
/* 803C1A44 003BE9A4 38 E0 00 00 */ li r7, 0
|
|
/* 803C1A48 003BE9A8 4B FF E6 C1 */ bl EXIImm
|
|
/* 803C1A4C 003BE9AC 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1A50 003BE9B0 4B FF EA A1 */ bl EXISync
|
|
/* 803C1A54 003BE9B4 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1A58 003BE9B8 4B FF F3 31 */ bl EXIDeselect
|
|
/* 803C1A5C 003BE9BC 80 01 00 10 */ lwz r0, 0x10(r1)
|
|
/* 803C1A60 003BE9C0 54 00 46 3E */ srwi r0, r0, 0x18
|
|
/* 803C1A64 003BE9C4 20 00 00 10 */ subfic r0, r0, 0x10
|
|
lbl_803C1A68:
|
|
/* 803C1A68 003BE9C8 2C 00 00 00 */ cmpwi r0, 0
|
|
/* 803C1A6C 003BE9CC 7C 1B 03 78 */ mr r27, r0
|
|
/* 803C1A70 003BE9D0 40 80 00 0C */ bge lbl_803C1A7C
|
|
/* 803C1A74 003BE9D4 3B 40 00 03 */ li r26, 3
|
|
/* 803C1A78 003BE9D8 48 00 00 C8 */ b lbl_803C1B40
|
|
lbl_803C1A7C:
|
|
/* 803C1A7C 003BE9DC 2C 00 00 0C */ cmpwi r0, 0xc
|
|
/* 803C1A80 003BE9E0 40 80 00 0C */ bge lbl_803C1A8C
|
|
/* 803C1A84 003BE9E4 7C 00 F8 40 */ cmplw r0, r31
|
|
/* 803C1A88 003BE9E8 41 80 00 B0 */ blt lbl_803C1B38
|
|
lbl_803C1A8C:
|
|
/* 803C1A8C 003BE9EC 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1A90 003BE9F0 38 A0 00 03 */ li r5, 3
|
|
/* 803C1A94 003BE9F4 80 8D B0 2C */ lwz r4, lbl_805A9BEC@sda21(r13)
|
|
/* 803C1A98 003BE9F8 4B FF F1 C5 */ bl EXISelect
|
|
/* 803C1A9C 003BE9FC 2C 03 00 00 */ cmpwi r3, 0
|
|
/* 803C1AA0 003BEA00 40 82 00 0C */ bne lbl_803C1AAC
|
|
/* 803C1AA4 003BEA04 3B 40 00 03 */ li r26, 3
|
|
/* 803C1AA8 003BEA08 48 00 00 98 */ b lbl_803C1B40
|
|
lbl_803C1AAC:
|
|
/* 803C1AAC 003BEA0C 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1AB0 003BEA10 38 81 00 14 */ addi r4, r1, 0x14
|
|
/* 803C1AB4 003BEA14 38 A0 00 04 */ li r5, 4
|
|
/* 803C1AB8 003BEA18 38 C0 00 01 */ li r6, 1
|
|
/* 803C1ABC 003BEA1C 38 E0 00 00 */ li r7, 0
|
|
/* 803C1AC0 003BEA20 4B FF E6 49 */ bl EXIImm
|
|
/* 803C1AC4 003BEA24 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1AC8 003BEA28 4B FF EA 29 */ bl EXISync
|
|
/* 803C1ACC 003BEA2C 48 00 00 54 */ b lbl_803C1B20
|
|
lbl_803C1AD0:
|
|
/* 803C1AD0 003BEA30 2C 1B 00 04 */ cmpwi r27, 4
|
|
/* 803C1AD4 003BEA34 40 80 00 0C */ bge lbl_803C1AE0
|
|
/* 803C1AD8 003BEA38 7C 1B F8 40 */ cmplw r27, r31
|
|
/* 803C1ADC 003BEA3C 41 80 00 54 */ blt lbl_803C1B30
|
|
lbl_803C1AE0:
|
|
/* 803C1AE0 003BEA40 28 1F 00 04 */ cmplwi r31, 4
|
|
/* 803C1AE4 003BEA44 40 80 00 0C */ bge lbl_803C1AF0
|
|
/* 803C1AE8 003BEA48 7F FC FB 78 */ mr r28, r31
|
|
/* 803C1AEC 003BEA4C 48 00 00 08 */ b lbl_803C1AF4
|
|
lbl_803C1AF0:
|
|
/* 803C1AF0 003BEA50 3B 80 00 04 */ li r28, 4
|
|
lbl_803C1AF4:
|
|
/* 803C1AF4 003BEA54 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1AF8 003BEA58 7F 85 E3 78 */ mr r5, r28
|
|
/* 803C1AFC 003BEA5C 38 9E 00 00 */ addi r4, r30, 0
|
|
/* 803C1B00 003BEA60 38 C0 00 01 */ li r6, 1
|
|
/* 803C1B04 003BEA64 38 E0 00 00 */ li r7, 0
|
|
/* 803C1B08 003BEA68 4B FF E6 01 */ bl EXIImm
|
|
/* 803C1B0C 003BEA6C 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1B10 003BEA70 7F DE E2 14 */ add r30, r30, r28
|
|
/* 803C1B14 003BEA74 7F FC F8 50 */ subf r31, r28, r31
|
|
/* 803C1B18 003BEA78 7F 7C D8 50 */ subf r27, r28, r27
|
|
/* 803C1B1C 003BEA7C 4B FF E9 D5 */ bl EXISync
|
|
lbl_803C1B20:
|
|
/* 803C1B20 003BEA80 2C 1B 00 00 */ cmpwi r27, 0
|
|
/* 803C1B24 003BEA84 41 82 00 0C */ beq lbl_803C1B30
|
|
/* 803C1B28 003BEA88 28 1F 00 00 */ cmplwi r31, 0
|
|
/* 803C1B2C 003BEA8C 40 82 FF A4 */ bne lbl_803C1AD0
|
|
lbl_803C1B30:
|
|
/* 803C1B30 003BEA90 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1B34 003BEA94 4B FF F2 55 */ bl EXIDeselect
|
|
lbl_803C1B38:
|
|
/* 803C1B38 003BEA98 28 1F 00 00 */ cmplwi r31, 0
|
|
/* 803C1B3C 003BEA9C 40 82 FE B4 */ bne lbl_803C19F0
|
|
lbl_803C1B40:
|
|
/* 803C1B40 003BEAA0 80 6D B0 28 */ lwz r3, lbl_805A9BE8@sda21(r13)
|
|
/* 803C1B44 003BEAA4 4B FF F9 15 */ bl EXIUnlock
|
|
/* 803C1B48 003BEAA8 7F 43 D3 78 */ mr r3, r26
|
|
lbl_803C1B4C:
|
|
/* 803C1B4C 003BEAAC BB 41 00 18 */ lmw r26, 0x18(r1)
|
|
/* 803C1B50 003BEAB0 80 01 00 34 */ lwz r0, 0x34(r1)
|
|
/* 803C1B54 003BEAB4 38 21 00 30 */ addi r1, r1, 0x30
|
|
/* 803C1B58 003BEAB8 7C 08 03 A6 */ mtlr r0
|
|
/* 803C1B5C 003BEABC 4E 80 00 20 */ blr
|