donut-decomp/asm/nand/NANDLogging.s
2022-10-17 09:22:20 +01:00

519 lines
23 KiB
ArmAsm

.include "macros.inc"
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
.global reserveFileDescriptor
reserveFileDescriptor:
/* 8004AAE0 00046920 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8004AAE4 00046924 7C 08 02 A6 */ mflr r0
/* 8004AAE8 00046928 90 01 00 14 */ stw r0, 0x14(r1)
/* 8004AAEC 0004692C 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8004AAF0 00046930 4B FD 6D 31 */ bl OSDisableInterrupts
/* 8004AAF4 00046934 80 0D 82 50 */ lwz r0, s_fd@sda21(r13)
/* 8004AAF8 00046938 2C 00 FF 01 */ cmpwi r0, -0xff
/* 8004AAFC 0004693C 40 82 00 14 */ bne lbl_8004AB10
/* 8004AB00 00046940 38 00 FF 02 */ li r0, -0xfe
/* 8004AB04 00046944 90 0D 82 50 */ stw r0, s_fd@sda21(r13)
/* 8004AB08 00046948 3B E0 00 00 */ li r31, 0x0
/* 8004AB0C 0004694C 48 00 00 08 */ b lbl_8004AB14
.global lbl_8004AB10
lbl_8004AB10:
/* 8004AB10 00046950 3B E0 00 01 */ li r31, 0x1
.global lbl_8004AB14
lbl_8004AB14:
/* 8004AB14 00046954 4B FD 6D 4D */ bl OSRestoreInterrupts
/* 8004AB18 00046958 7F E0 00 34 */ cntlzw r0, r31
/* 8004AB1C 0004695C 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8004AB20 00046960 54 03 D9 7E */ srwi r3, r0, 5
/* 8004AB24 00046964 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8004AB28 00046968 7C 08 03 A6 */ mtlr r0
/* 8004AB2C 0004696C 38 21 00 10 */ addi r1, r1, 0x10
/* 8004AB30 00046970 4E 80 00 20 */ blr
/* 8004AB34 00046974 00 00 00 00 */ .4byte 0x00000000
/* 8004AB38 00046978 00 00 00 00 */ .4byte 0x00000000
/* 8004AB3C 0004697C 00 00 00 00 */ .4byte 0x00000000
.global NANDLoggingAddMessageAsync
NANDLoggingAddMessageAsync:
/* 8004AB40 00046980 94 21 FF 70 */ stwu r1, -0x90(r1)
/* 8004AB44 00046984 7C 08 02 A6 */ mflr r0
/* 8004AB48 00046988 90 01 00 94 */ stw r0, 0x94(r1)
/* 8004AB4C 0004698C 93 E1 00 8C */ stw r31, 0x8c(r1)
/* 8004AB50 00046990 7C BF 2B 78 */ mr r31, r5
/* 8004AB54 00046994 93 C1 00 88 */ stw r30, 0x88(r1)
/* 8004AB58 00046998 7C 9E 23 78 */ mr r30, r4
/* 8004AB5C 0004699C 93 A1 00 84 */ stw r29, 0x84(r1)
/* 8004AB60 000469A0 7C 7D 1B 78 */ mr r29, r3
/* 8004AB64 000469A4 40 86 00 24 */ bne cr1, lbl_8004AB88
/* 8004AB68 000469A8 D8 21 00 28 */ stfd f1, 0x28(r1)
/* 8004AB6C 000469AC D8 41 00 30 */ stfd f2, 0x30(r1)
/* 8004AB70 000469B0 D8 61 00 38 */ stfd f3, 0x38(r1)
/* 8004AB74 000469B4 D8 81 00 40 */ stfd f4, 0x40(r1)
/* 8004AB78 000469B8 D8 A1 00 48 */ stfd f5, 0x48(r1)
/* 8004AB7C 000469BC D8 C1 00 50 */ stfd f6, 0x50(r1)
/* 8004AB80 000469C0 D8 E1 00 58 */ stfd f7, 0x58(r1)
/* 8004AB84 000469C4 D9 01 00 60 */ stfd f8, 0x60(r1)
.global lbl_8004AB88
lbl_8004AB88:
/* 8004AB88 000469C8 90 61 00 08 */ stw r3, 0x8(r1)
/* 8004AB8C 000469CC 90 81 00 0C */ stw r4, 0xc(r1)
/* 8004AB90 000469D0 90 A1 00 10 */ stw r5, 0x10(r1)
/* 8004AB94 000469D4 90 C1 00 14 */ stw r6, 0x14(r1)
/* 8004AB98 000469D8 90 E1 00 18 */ stw r7, 0x18(r1)
/* 8004AB9C 000469DC 91 01 00 1C */ stw r8, 0x1c(r1)
/* 8004ABA0 000469E0 91 21 00 20 */ stw r9, 0x20(r1)
/* 8004ABA4 000469E4 91 41 00 24 */ stw r10, 0x24(r1)
/* 8004ABA8 000469E8 4B FF FF 39 */ bl reserveFileDescriptor
/* 8004ABAC 000469EC 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004ABB0 000469F0 40 82 00 0C */ bne lbl_8004ABBC
/* 8004ABB4 000469F4 38 60 00 00 */ li r3, 0x0
/* 8004ABB8 000469F8 48 00 00 84 */ b lbl_8004AC3C
.global lbl_8004ABBC
lbl_8004ABBC:
/* 8004ABBC 000469FC 38 81 00 98 */ addi r4, r1, 0x98
/* 8004ABC0 00046A00 38 01 00 08 */ addi r0, r1, 0x8
/* 8004ABC4 00046A04 3C A0 03 00 */ lis r5, 0x300
/* 8004ABC8 00046A08 3C 60 80 4B */ lis r3, s_message@ha
/* 8004ABCC 00046A0C 90 A1 00 68 */ stw r5, 0x68(r1)
/* 8004ABD0 00046A10 38 C1 00 68 */ addi r6, r1, 0x68
/* 8004ABD4 00046A14 7F E5 FB 78 */ mr r5, r31
/* 8004ABD8 00046A18 38 63 58 80 */ addi r3, r3, s_message@l
/* 8004ABDC 00046A1C 90 81 00 6C */ stw r4, 0x6c(r1)
/* 8004ABE0 00046A20 38 80 01 00 */ li r4, 0x100
/* 8004ABE4 00046A24 90 01 00 70 */ stw r0, 0x70(r1)
/* 8004ABE8 00046A28 4B FC 29 D5 */ bl vsnprintf
/* 8004ABEC 00046A2C 2C 1E FF 8B */ cmpwi r30, -0x75
/* 8004ABF0 00046A30 38 00 00 01 */ li r0, 0x1
/* 8004ABF4 00046A34 93 AD E8 C8 */ stw r29, s_callback@sda21(r13)
/* 8004ABF8 00046A38 90 0D E8 CC */ stw r0, s_stage@sda21(r13)
/* 8004ABFC 00046A3C 41 82 00 0C */ beq lbl_8004AC08
/* 8004AC00 00046A40 2C 1E FF F7 */ cmpwi r30, -0x9
/* 8004AC04 00046A44 40 82 00 08 */ bne lbl_8004AC0C
.global lbl_8004AC08
lbl_8004AC08:
/* 8004AC08 00046A48 93 CD 82 54 */ stw r30, s_err@sda21(r13)
.global lbl_8004AC0C
lbl_8004AC0C:
/* 8004AC0C 00046A4C 3C 60 80 43 */ lis r3, "@1150"@ha
/* 8004AC10 00046A50 3C A0 80 05 */ lis r5, asyncRoutine@ha
/* 8004AC14 00046A54 38 63 65 80 */ addi r3, r3, "@1150"@l
/* 8004AC18 00046A58 38 80 00 03 */ li r4, 0x3
/* 8004AC1C 00046A5C 38 A5 AC 60 */ addi r5, r5, asyncRoutine@l
/* 8004AC20 00046A60 38 C0 00 00 */ li r6, 0x0
/* 8004AC24 00046A64 48 00 71 7D */ bl ISFS_OpenAsync
/* 8004AC28 00046A68 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004AC2C 00046A6C 40 82 00 0C */ bne lbl_8004AC38
/* 8004AC30 00046A70 38 60 00 01 */ li r3, 0x1
/* 8004AC34 00046A74 48 00 00 08 */ b lbl_8004AC3C
.global lbl_8004AC38
lbl_8004AC38:
/* 8004AC38 00046A78 38 60 00 00 */ li r3, 0x0
.global lbl_8004AC3C
lbl_8004AC3C:
/* 8004AC3C 00046A7C 80 01 00 94 */ lwz r0, 0x94(r1)
/* 8004AC40 00046A80 83 E1 00 8C */ lwz r31, 0x8c(r1)
/* 8004AC44 00046A84 83 C1 00 88 */ lwz r30, 0x88(r1)
/* 8004AC48 00046A88 83 A1 00 84 */ lwz r29, 0x84(r1)
/* 8004AC4C 00046A8C 7C 08 03 A6 */ mtlr r0
/* 8004AC50 00046A90 38 21 00 90 */ addi r1, r1, 0x90
/* 8004AC54 00046A94 4E 80 00 20 */ blr
/* 8004AC58 00046A98 00 00 00 00 */ .4byte 0x00000000
/* 8004AC5C 00046A9C 00 00 00 00 */ .4byte 0x00000000
.global asyncRoutine
asyncRoutine:
/* 8004AC60 00046AA0 94 21 FF 70 */ stwu r1, -0x90(r1)
/* 8004AC64 00046AA4 7C 08 02 A6 */ mflr r0
/* 8004AC68 00046AA8 90 01 00 94 */ stw r0, 0x94(r1)
/* 8004AC6C 00046AAC 93 E1 00 8C */ stw r31, 0x8c(r1)
/* 8004AC70 00046AB0 3F E0 80 4B */ lis r31, s_message@ha
/* 8004AC74 00046AB4 3B FF 58 80 */ addi r31, r31, s_message@l
/* 8004AC78 00046AB8 93 C1 00 88 */ stw r30, 0x88(r1)
/* 8004AC7C 00046ABC 7C 7E 1B 78 */ mr r30, r3
/* 8004AC80 00046AC0 80 8D E8 CC */ lwz r4, s_stage@sda21(r13)
/* 8004AC84 00046AC4 38 04 00 01 */ addi r0, r4, 0x1
/* 8004AC88 00046AC8 90 0D E8 CC */ stw r0, s_stage@sda21(r13)
/* 8004AC8C 00046ACC 2C 00 00 02 */ cmpwi r0, 0x2
/* 8004AC90 00046AD0 40 82 00 70 */ bne lbl_8004AD00
/* 8004AC94 00046AD4 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004AC98 00046AD8 41 80 00 48 */ blt lbl_8004ACE0
/* 8004AC9C 00046ADC 3C C0 80 05 */ lis r6, asyncRoutine@ha
/* 8004ACA0 00046AE0 90 6D 82 50 */ stw r3, s_fd@sda21(r13)
/* 8004ACA4 00046AE4 38 C6 AC 60 */ addi r6, r6, asyncRoutine@l
/* 8004ACA8 00046AE8 38 80 00 00 */ li r4, 0x0
/* 8004ACAC 00046AEC 38 A0 00 00 */ li r5, 0x0
/* 8004ACB0 00046AF0 38 E0 00 00 */ li r7, 0x0
/* 8004ACB4 00046AF4 48 00 72 8D */ bl ISFS_SeekAsync
/* 8004ACB8 00046AF8 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004ACBC 00046AFC 41 82 04 50 */ beq lbl_8004B10C
/* 8004ACC0 00046B00 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004ACC4 00046B04 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004ACC8 00046B08 41 82 04 44 */ beq lbl_8004B10C
/* 8004ACCC 00046B0C 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004ACD0 00046B10 38 60 00 00 */ li r3, 0x0
/* 8004ACD4 00046B14 7D 89 03 A6 */ mtctr r12
/* 8004ACD8 00046B18 4E 80 04 21 */ bctrl
/* 8004ACDC 00046B1C 48 00 04 30 */ b lbl_8004B10C
.global lbl_8004ACE0
lbl_8004ACE0:
/* 8004ACE0 00046B20 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004ACE4 00046B24 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004ACE8 00046B28 41 82 04 24 */ beq lbl_8004B10C
/* 8004ACEC 00046B2C 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004ACF0 00046B30 38 60 00 00 */ li r3, 0x0
/* 8004ACF4 00046B34 7D 89 03 A6 */ mtctr r12
/* 8004ACF8 00046B38 4E 80 04 21 */ bctrl
/* 8004ACFC 00046B3C 48 00 04 10 */ b lbl_8004B10C
.global lbl_8004AD00
lbl_8004AD00:
/* 8004AD00 00046B40 2C 00 00 03 */ cmpwi r0, 0x3
/* 8004AD04 00046B44 40 82 00 70 */ bne lbl_8004AD74
/* 8004AD08 00046B48 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004AD0C 00046B4C 40 82 00 48 */ bne lbl_8004AD54
/* 8004AD10 00046B50 3C C0 80 05 */ lis r6, asyncRoutine@ha
/* 8004AD14 00046B54 80 6D 82 50 */ lwz r3, s_fd@sda21(r13)
/* 8004AD18 00046B58 38 9F 01 00 */ addi r4, r31, 0x100
/* 8004AD1C 00046B5C 38 A0 01 00 */ li r5, 0x100
/* 8004AD20 00046B60 38 C6 AC 60 */ addi r6, r6, asyncRoutine@l
/* 8004AD24 00046B64 38 E0 00 00 */ li r7, 0x0
/* 8004AD28 00046B68 48 00 72 C9 */ bl ISFS_ReadAsync
/* 8004AD2C 00046B6C 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004AD30 00046B70 41 82 03 DC */ beq lbl_8004B10C
/* 8004AD34 00046B74 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004AD38 00046B78 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004AD3C 00046B7C 41 82 03 D0 */ beq lbl_8004B10C
/* 8004AD40 00046B80 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004AD44 00046B84 38 60 00 00 */ li r3, 0x0
/* 8004AD48 00046B88 7D 89 03 A6 */ mtctr r12
/* 8004AD4C 00046B8C 4E 80 04 21 */ bctrl
/* 8004AD50 00046B90 48 00 03 BC */ b lbl_8004B10C
.global lbl_8004AD54
lbl_8004AD54:
/* 8004AD54 00046B94 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004AD58 00046B98 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004AD5C 00046B9C 41 82 03 B0 */ beq lbl_8004B10C
/* 8004AD60 00046BA0 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004AD64 00046BA4 38 60 00 00 */ li r3, 0x0
/* 8004AD68 00046BA8 7D 89 03 A6 */ mtctr r12
/* 8004AD6C 00046BAC 4E 80 04 21 */ bctrl
/* 8004AD70 00046BB0 48 00 03 9C */ b lbl_8004B10C
.global lbl_8004AD74
lbl_8004AD74:
/* 8004AD74 00046BB4 2C 00 00 04 */ cmpwi r0, 0x4
/* 8004AD78 00046BB8 40 82 00 70 */ bne lbl_8004ADE8
/* 8004AD7C 00046BBC 2C 03 01 00 */ cmpwi r3, 0x100
/* 8004AD80 00046BC0 40 82 00 48 */ bne lbl_8004ADC8
/* 8004AD84 00046BC4 3C C0 80 05 */ lis r6, asyncRoutine@ha
/* 8004AD88 00046BC8 80 6D 82 50 */ lwz r3, s_fd@sda21(r13)
/* 8004AD8C 00046BCC 38 C6 AC 60 */ addi r6, r6, asyncRoutine@l
/* 8004AD90 00046BD0 38 80 00 00 */ li r4, 0x0
/* 8004AD94 00046BD4 38 A0 00 00 */ li r5, 0x0
/* 8004AD98 00046BD8 38 E0 00 00 */ li r7, 0x0
/* 8004AD9C 00046BDC 48 00 71 A5 */ bl ISFS_SeekAsync
/* 8004ADA0 00046BE0 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004ADA4 00046BE4 41 82 03 68 */ beq lbl_8004B10C
/* 8004ADA8 00046BE8 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004ADAC 00046BEC 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004ADB0 00046BF0 41 82 03 5C */ beq lbl_8004B10C
/* 8004ADB4 00046BF4 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004ADB8 00046BF8 38 60 00 00 */ li r3, 0x0
/* 8004ADBC 00046BFC 7D 89 03 A6 */ mtctr r12
/* 8004ADC0 00046C00 4E 80 04 21 */ bctrl
/* 8004ADC4 00046C04 48 00 03 48 */ b lbl_8004B10C
.global lbl_8004ADC8
lbl_8004ADC8:
/* 8004ADC8 00046C08 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004ADCC 00046C0C 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004ADD0 00046C10 41 82 03 3C */ beq lbl_8004B10C
/* 8004ADD4 00046C14 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004ADD8 00046C18 38 60 00 00 */ li r3, 0x0
/* 8004ADDC 00046C1C 7D 89 03 A6 */ mtctr r12
/* 8004ADE0 00046C20 4E 80 04 21 */ bctrl
/* 8004ADE4 00046C24 48 00 03 28 */ b lbl_8004B10C
.global lbl_8004ADE8
lbl_8004ADE8:
/* 8004ADE8 00046C28 2C 00 00 05 */ cmpwi r0, 0x5
/* 8004ADEC 00046C2C 40 82 01 60 */ bne lbl_8004AF4C
/* 8004ADF0 00046C30 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004ADF4 00046C34 40 82 01 38 */ bne lbl_8004AF2C
/* 8004ADF8 00046C38 38 7F 01 00 */ addi r3, r31, 0x100
/* 8004ADFC 00046C3C 38 00 00 00 */ li r0, 0x0
/* 8004AE00 00046C40 98 03 00 FF */ stb r0, 0xff(r3)
/* 8004AE04 00046C44 4B FC 33 45 */ bl atoi
/* 8004AE08 00046C48 7C 7E 1B 78 */ mr r30, r3
/* 8004AE0C 00046C4C 38 7F 02 00 */ addi r3, r31, 0x200
/* 8004AE10 00046C50 38 80 00 20 */ li r4, 0x20
/* 8004AE14 00046C54 38 A0 00 FE */ li r5, 0xfe
/* 8004AE18 00046C58 4B FB 95 39 */ bl memset
/* 8004AE1C 00046C5C 4B FD AD 25 */ bl OSGetTime
/* 8004AE20 00046C60 38 A1 00 58 */ addi r5, r1, 0x58
/* 8004AE24 00046C64 4B FD AE 1D */ bl OSTicksToCalendarTime
/* 8004AE28 00046C68 4B FF FA D9 */ bl nandGetHomeDir
/* 8004AE2C 00046C6C 7C 64 1B 78 */ mr r4, r3
/* 8004AE30 00046C70 38 61 00 18 */ addi r3, r1, 0x18
/* 8004AE34 00046C74 38 84 00 07 */ addi r4, r4, 0x7
/* 8004AE38 00046C78 38 A0 00 11 */ li r5, 0x11
/* 8004AE3C 00046C7C 4B FC 2C 45 */ bl strncpy
/* 8004AE40 00046C80 3C 60 82 08 */ lis r3, 0x82082083@ha
/* 8004AE44 00046C84 38 A0 00 2D */ li r5, 0x2d
/* 8004AE48 00046C88 38 03 20 83 */ addi r0, r3, 0x82082083@l
/* 8004AE4C 00046C8C 38 80 00 00 */ li r4, 0x0
/* 8004AE50 00046C90 7C 00 F0 96 */ mulhw r0, r0, r30
/* 8004AE54 00046C94 98 A1 00 20 */ stb r5, 0x20(r1)
/* 8004AE58 00046C98 80 61 00 5C */ lwz r3, 0x5c(r1)
/* 8004AE5C 00046C9C 3C A0 80 43 */ lis r5, "@1155"@ha
/* 8004AE60 00046CA0 98 81 00 29 */ stb r4, 0x29(r1)
/* 8004AE64 00046CA4 38 81 00 18 */ addi r4, r1, 0x18
/* 8004AE68 00046CA8 90 61 00 08 */ stw r3, 0x8(r1)
/* 8004AE6C 00046CAC 7C 00 F2 14 */ add r0, r0, r30
/* 8004AE70 00046CB0 7C 00 2E 70 */ srawi r0, r0, 5
/* 8004AE74 00046CB4 38 DF 00 00 */ addi r6, r31, 0x0
/* 8004AE78 00046CB8 80 E1 00 58 */ lwz r7, 0x58(r1)
/* 8004AE7C 00046CBC 54 03 0F FE */ srwi r3, r0, 31
/* 8004AE80 00046CC0 7C 00 1A 14 */ add r0, r0, r3
/* 8004AE84 00046CC4 90 E1 00 0C */ stw r7, 0xc(r1)
/* 8004AE88 00046CC8 1C 00 00 3F */ mulli r0, r0, 0x3f
/* 8004AE8C 00046CCC 38 7F 02 00 */ addi r3, r31, 0x200
/* 8004AE90 00046CD0 90 81 00 10 */ stw r4, 0x10(r1)
/* 8004AE94 00046CD4 38 A5 65 9C */ addi r5, r5, "@1155"@l
/* 8004AE98 00046CD8 38 80 01 00 */ li r4, 0x100
/* 8004AE9C 00046CDC 90 C1 00 14 */ stw r6, 0x14(r1)
/* 8004AEA0 00046CE0 7C C0 F0 50 */ subf r6, r0, r30
/* 8004AEA4 00046CE4 81 01 00 68 */ lwz r8, 0x68(r1)
/* 8004AEA8 00046CE8 38 C6 00 01 */ addi r6, r6, 0x1
/* 8004AEAC 00046CEC 80 E1 00 6C */ lwz r7, 0x6c(r1)
/* 8004AEB0 00046CF0 81 21 00 64 */ lwz r9, 0x64(r1)
/* 8004AEB4 00046CF4 39 08 00 01 */ addi r8, r8, 0x1
/* 8004AEB8 00046CF8 81 41 00 60 */ lwz r10, 0x60(r1)
/* 8004AEBC 00046CFC 4C C6 31 82 */ crclr 4*cr1+eq
/* 8004AEC0 00046D00 4B FC 28 09 */ bl snprintf
/* 8004AEC4 00046D04 2C 03 01 00 */ cmpwi r3, 0x100
/* 8004AEC8 00046D08 40 80 00 10 */ bge lbl_8004AED8
/* 8004AECC 00046D0C 38 9F 02 00 */ addi r4, r31, 0x200
/* 8004AED0 00046D10 38 00 00 20 */ li r0, 0x20
/* 8004AED4 00046D14 7C 04 19 AE */ stbx r0, r4, r3
.global lbl_8004AED8
lbl_8004AED8:
/* 8004AED8 00046D18 38 9F 02 00 */ addi r4, r31, 0x200
/* 8004AEDC 00046D1C 38 60 00 0D */ li r3, 0xd
/* 8004AEE0 00046D20 38 00 00 0A */ li r0, 0xa
/* 8004AEE4 00046D24 3C C0 80 05 */ lis r6, asyncRoutine@ha
/* 8004AEE8 00046D28 98 64 00 FE */ stb r3, 0xfe(r4)
/* 8004AEEC 00046D2C 38 C6 AC 60 */ addi r6, r6, asyncRoutine@l
/* 8004AEF0 00046D30 80 6D 82 50 */ lwz r3, s_fd@sda21(r13)
/* 8004AEF4 00046D34 38 A0 01 00 */ li r5, 0x100
/* 8004AEF8 00046D38 98 04 00 FF */ stb r0, 0xff(r4)
/* 8004AEFC 00046D3C 38 E0 00 00 */ li r7, 0x0
/* 8004AF00 00046D40 48 00 71 C1 */ bl ISFS_WriteAsync
/* 8004AF04 00046D44 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004AF08 00046D48 41 82 02 04 */ beq lbl_8004B10C
/* 8004AF0C 00046D4C 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004AF10 00046D50 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004AF14 00046D54 41 82 01 F8 */ beq lbl_8004B10C
/* 8004AF18 00046D58 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004AF1C 00046D5C 38 60 00 00 */ li r3, 0x0
/* 8004AF20 00046D60 7D 89 03 A6 */ mtctr r12
/* 8004AF24 00046D64 4E 80 04 21 */ bctrl
/* 8004AF28 00046D68 48 00 01 E4 */ b lbl_8004B10C
.global lbl_8004AF2C
lbl_8004AF2C:
/* 8004AF2C 00046D6C 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004AF30 00046D70 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004AF34 00046D74 41 82 01 D8 */ beq lbl_8004B10C
/* 8004AF38 00046D78 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004AF3C 00046D7C 38 60 00 00 */ li r3, 0x0
/* 8004AF40 00046D80 7D 89 03 A6 */ mtctr r12
/* 8004AF44 00046D84 4E 80 04 21 */ bctrl
/* 8004AF48 00046D88 48 00 01 C4 */ b lbl_8004B10C
.global lbl_8004AF4C
lbl_8004AF4C:
/* 8004AF4C 00046D8C 2C 00 00 06 */ cmpwi r0, 0x6
/* 8004AF50 00046D90 40 82 00 7C */ bne lbl_8004AFCC
/* 8004AF54 00046D94 2C 03 01 00 */ cmpwi r3, 0x100
/* 8004AF58 00046D98 40 82 00 54 */ bne lbl_8004AFAC
/* 8004AF5C 00046D9C 38 7F 01 00 */ addi r3, r31, 0x100
/* 8004AF60 00046DA0 4B FC 31 E9 */ bl atoi
/* 8004AF64 00046DA4 7C 60 1B 78 */ mr r0, r3
/* 8004AF68 00046DA8 3C C0 80 05 */ lis r6, asyncRoutine@ha
/* 8004AF6C 00046DAC 80 6D 82 50 */ lwz r3, s_fd@sda21(r13)
/* 8004AF70 00046DB0 54 04 40 2E */ slwi r4, r0, 8
/* 8004AF74 00046DB4 38 C6 AC 60 */ addi r6, r6, asyncRoutine@l
/* 8004AF78 00046DB8 38 A0 00 00 */ li r5, 0x0
/* 8004AF7C 00046DBC 38 E0 00 00 */ li r7, 0x0
/* 8004AF80 00046DC0 48 00 6F C1 */ bl ISFS_SeekAsync
/* 8004AF84 00046DC4 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004AF88 00046DC8 41 82 01 84 */ beq lbl_8004B10C
/* 8004AF8C 00046DCC 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004AF90 00046DD0 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004AF94 00046DD4 41 82 01 78 */ beq lbl_8004B10C
/* 8004AF98 00046DD8 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004AF9C 00046DDC 38 60 00 00 */ li r3, 0x0
/* 8004AFA0 00046DE0 7D 89 03 A6 */ mtctr r12
/* 8004AFA4 00046DE4 4E 80 04 21 */ bctrl
/* 8004AFA8 00046DE8 48 00 01 64 */ b lbl_8004B10C
.global lbl_8004AFAC
lbl_8004AFAC:
/* 8004AFAC 00046DEC 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004AFB0 00046DF0 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004AFB4 00046DF4 41 82 01 58 */ beq lbl_8004B10C
/* 8004AFB8 00046DF8 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004AFBC 00046DFC 38 60 00 00 */ li r3, 0x0
/* 8004AFC0 00046E00 7D 89 03 A6 */ mtctr r12
/* 8004AFC4 00046E04 4E 80 04 21 */ bctrl
/* 8004AFC8 00046E08 48 00 01 44 */ b lbl_8004B10C
.global lbl_8004AFCC
lbl_8004AFCC:
/* 8004AFCC 00046E0C 2C 00 00 07 */ cmpwi r0, 0x7
/* 8004AFD0 00046E10 40 82 00 7C */ bne lbl_8004B04C
/* 8004AFD4 00046E14 38 7F 01 00 */ addi r3, r31, 0x100
/* 8004AFD8 00046E18 4B FC 31 71 */ bl atoi
/* 8004AFDC 00046E1C 54 60 40 2E */ slwi r0, r3, 8
/* 8004AFE0 00046E20 7C 1E 00 00 */ cmpw r30, r0
/* 8004AFE4 00046E24 40 82 00 48 */ bne lbl_8004B02C
/* 8004AFE8 00046E28 3C C0 80 05 */ lis r6, asyncRoutine@ha
/* 8004AFEC 00046E2C 80 6D 82 50 */ lwz r3, s_fd@sda21(r13)
/* 8004AFF0 00046E30 38 9F 02 00 */ addi r4, r31, 0x200
/* 8004AFF4 00046E34 38 A0 01 00 */ li r5, 0x100
/* 8004AFF8 00046E38 38 C6 AC 60 */ addi r6, r6, asyncRoutine@l
/* 8004AFFC 00046E3C 38 E0 00 00 */ li r7, 0x0
/* 8004B000 00046E40 48 00 70 C1 */ bl ISFS_WriteAsync
/* 8004B004 00046E44 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004B008 00046E48 41 82 01 04 */ beq lbl_8004B10C
/* 8004B00C 00046E4C 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004B010 00046E50 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004B014 00046E54 41 82 00 F8 */ beq lbl_8004B10C
/* 8004B018 00046E58 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004B01C 00046E5C 38 60 00 00 */ li r3, 0x0
/* 8004B020 00046E60 7D 89 03 A6 */ mtctr r12
/* 8004B024 00046E64 4E 80 04 21 */ bctrl
/* 8004B028 00046E68 48 00 00 E4 */ b lbl_8004B10C
.global lbl_8004B02C
lbl_8004B02C:
/* 8004B02C 00046E6C 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004B030 00046E70 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004B034 00046E74 41 82 00 D8 */ beq lbl_8004B10C
/* 8004B038 00046E78 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004B03C 00046E7C 38 60 00 00 */ li r3, 0x0
/* 8004B040 00046E80 7D 89 03 A6 */ mtctr r12
/* 8004B044 00046E84 4E 80 04 21 */ bctrl
/* 8004B048 00046E88 48 00 00 C4 */ b lbl_8004B10C
.global lbl_8004B04C
lbl_8004B04C:
/* 8004B04C 00046E8C 2C 00 00 08 */ cmpwi r0, 0x8
/* 8004B050 00046E90 40 82 00 68 */ bne lbl_8004B0B8
/* 8004B054 00046E94 2C 03 01 00 */ cmpwi r3, 0x100
/* 8004B058 00046E98 40 82 00 40 */ bne lbl_8004B098
/* 8004B05C 00046E9C 3C 80 80 05 */ lis r4, asyncRoutine@ha
/* 8004B060 00046EA0 80 6D 82 50 */ lwz r3, s_fd@sda21(r13)
/* 8004B064 00046EA4 38 84 AC 60 */ addi r4, r4, asyncRoutine@l
/* 8004B068 00046EA8 38 A0 00 00 */ li r5, 0x0
/* 8004B06C 00046EAC 48 00 71 15 */ bl ISFS_CloseAsync
/* 8004B070 00046EB0 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004B074 00046EB4 41 82 00 98 */ beq lbl_8004B10C
/* 8004B078 00046EB8 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004B07C 00046EBC 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004B080 00046EC0 41 82 00 8C */ beq lbl_8004B10C
/* 8004B084 00046EC4 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004B088 00046EC8 38 60 00 00 */ li r3, 0x0
/* 8004B08C 00046ECC 7D 89 03 A6 */ mtctr r12
/* 8004B090 00046ED0 4E 80 04 21 */ bctrl
/* 8004B094 00046ED4 48 00 00 78 */ b lbl_8004B10C
.global lbl_8004B098
lbl_8004B098:
/* 8004B098 00046ED8 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004B09C 00046EDC 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004B0A0 00046EE0 41 82 00 6C */ beq lbl_8004B10C
/* 8004B0A4 00046EE4 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004B0A8 00046EE8 38 60 00 00 */ li r3, 0x0
/* 8004B0AC 00046EEC 7D 89 03 A6 */ mtctr r12
/* 8004B0B0 00046EF0 4E 80 04 21 */ bctrl
/* 8004B0B4 00046EF4 48 00 00 58 */ b lbl_8004B10C
.global lbl_8004B0B8
lbl_8004B0B8:
/* 8004B0B8 00046EF8 2C 00 00 09 */ cmpwi r0, 0x9
/* 8004B0BC 00046EFC 40 82 00 50 */ bne lbl_8004B10C
/* 8004B0C0 00046F00 2C 03 00 00 */ cmpwi r3, 0x0
/* 8004B0C4 00046F04 40 82 00 2C */ bne lbl_8004B0F0
/* 8004B0C8 00046F08 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004B0CC 00046F0C 38 00 FF 01 */ li r0, -0xff
/* 8004B0D0 00046F10 90 0D 82 50 */ stw r0, s_fd@sda21(r13)
/* 8004B0D4 00046F14 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004B0D8 00046F18 41 82 00 34 */ beq lbl_8004B10C
/* 8004B0DC 00046F1C 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004B0E0 00046F20 38 60 00 01 */ li r3, 0x1
/* 8004B0E4 00046F24 7D 89 03 A6 */ mtctr r12
/* 8004B0E8 00046F28 4E 80 04 21 */ bctrl
/* 8004B0EC 00046F2C 48 00 00 20 */ b lbl_8004B10C
.global lbl_8004B0F0
lbl_8004B0F0:
/* 8004B0F0 00046F30 81 8D E8 C8 */ lwz r12, s_callback@sda21(r13)
/* 8004B0F4 00046F34 2C 0C 00 00 */ cmpwi r12, 0x0
/* 8004B0F8 00046F38 41 82 00 14 */ beq lbl_8004B10C
/* 8004B0FC 00046F3C 80 8D 82 54 */ lwz r4, s_err@sda21(r13)
/* 8004B100 00046F40 38 60 00 00 */ li r3, 0x0
/* 8004B104 00046F44 7D 89 03 A6 */ mtctr r12
/* 8004B108 00046F48 4E 80 04 21 */ bctrl
.global lbl_8004B10C
lbl_8004B10C:
/* 8004B10C 00046F4C 80 01 00 94 */ lwz r0, 0x94(r1)
/* 8004B110 00046F50 83 E1 00 8C */ lwz r31, 0x8c(r1)
/* 8004B114 00046F54 83 C1 00 88 */ lwz r30, 0x88(r1)
/* 8004B118 00046F58 7C 08 03 A6 */ mtlr r0
/* 8004B11C 00046F5C 38 21 00 90 */ addi r1, r1, 0x90
/* 8004B120 00046F60 4E 80 00 20 */ blr
/* 8004B124 00046F64 00 00 00 00 */ .4byte 0x00000000
/* 8004B128 00046F68 00 00 00 00 */ .4byte 0x00000000
/* 8004B12C 00046F6C 00 00 00 00 */ .4byte 0x00000000
.include "macros.inc"
.section .data, "wa" # 0x80421040 - 0x80496700 ; 0x000756C0
.global "@1150"
"@1150":
.4byte 0x2F736861
.4byte 0x72656432
.4byte 0x2F746573
.4byte 0x74322F6E
.4byte 0x616E6465
.4byte 0x72722E6C
.4byte 0x6F670000
.global "@1155"
"@1155":
.4byte 0x25642025
.4byte 0x3034642F
.4byte 0x25303264
.4byte 0x2F253032
.4byte 0x64202530
.4byte 0x32643A25
.4byte 0x3032643A
.4byte 0x25303264
.4byte 0x20257320
.4byte 0x25730000
.4byte 0
.include "macros.inc"
.section .bss, "", @nobits # 0x80496700 - 0x80556420 ; 0x000BFD20
.global s_message
s_message:
.skip 0x300
.include "macros.inc"
.section .sdata, "wa" # 0x80556420 - 0x8055C6E0 ; 0x000062C0
.global s_fd
s_fd:
.4byte 0xFFFFFF01
.global s_err
s_err:
.4byte 0xFFFFFF8B
.include "macros.inc"
.section .sbss, "", @nobits # 0x8055C6E0 - 0x8055DF80 ; 0x000018A0
.global s_callback
s_callback:
.skip 0x4
.global s_stage
s_stage:
.skip 0x4