donut-decomp/asm/os/OSStateFlags.s
2022-10-17 09:03:07 +01:00

181 lines
7.9 KiB
ArmAsm

.include "macros.inc"
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
.global __OSWriteStateFlags
__OSWriteStateFlags:
/* 80027030 00022E70 94 21 FF 60 */ stwu r1, -0xa0(r1)
/* 80027034 00022E74 7C 08 02 A6 */ mflr r0
/* 80027038 00022E78 7C 64 1B 78 */ mr r4, r3
/* 8002703C 00022E7C 38 A0 00 20 */ li r5, 0x20
/* 80027040 00022E80 90 01 00 A4 */ stw r0, 0xa4(r1)
/* 80027044 00022E84 93 E1 00 9C */ stw r31, 0x9c(r1)
/* 80027048 00022E88 93 C1 00 98 */ stw r30, 0x98(r1)
/* 8002704C 00022E8C 3F C0 80 4A */ lis r30, StateFlags@ha
/* 80027050 00022E90 38 7E A1 80 */ addi r3, r30, StateFlags@l
/* 80027054 00022E94 4B FD CF AD */ bl memcpy
/* 80027058 00022E98 3B FE A1 80 */ addi r31, r30, -0x5e80
/* 8002705C 00022E9C 3C 60 80 43 */ lis r3, "@709_8042F950"@ha
/* 80027060 00022EA0 80 DF 00 04 */ lwz r6, 0x4(r31)
/* 80027064 00022EA4 38 63 F9 50 */ addi r3, r3, "@709_8042F950"@l
/* 80027068 00022EA8 80 1F 00 08 */ lwz r0, 0x8(r31)
/* 8002706C 00022EAC 38 81 00 08 */ addi r4, r1, 0x8
/* 80027070 00022EB0 38 A0 00 02 */ li r5, 0x2
/* 80027074 00022EB4 7C C6 02 14 */ add r6, r6, r0
/* 80027078 00022EB8 80 1F 00 0C */ lwz r0, 0xc(r31)
/* 8002707C 00022EBC 7C C6 02 14 */ add r6, r6, r0
/* 80027080 00022EC0 80 1F 00 10 */ lwz r0, 0x10(r31)
/* 80027084 00022EC4 7C C6 02 14 */ add r6, r6, r0
/* 80027088 00022EC8 80 1F 00 14 */ lwz r0, 0x14(r31)
/* 8002708C 00022ECC 7C C6 02 14 */ add r6, r6, r0
/* 80027090 00022ED0 80 1F 00 18 */ lwz r0, 0x18(r31)
/* 80027094 00022ED4 7C C6 02 14 */ add r6, r6, r0
/* 80027098 00022ED8 80 1F 00 1C */ lwz r0, 0x1c(r31)
/* 8002709C 00022EDC 7C C6 02 14 */ add r6, r6, r0
/* 800270A0 00022EE0 90 DE A1 80 */ stw r6, -0x5e80(r30)
/* 800270A4 00022EE4 48 02 23 0D */ bl NANDOpen
/* 800270A8 00022EE8 2C 03 00 00 */ cmpwi r3, 0x0
/* 800270AC 00022EEC 40 82 00 44 */ bne lbl_800270F0
/* 800270B0 00022EF0 7F E4 FB 78 */ mr r4, r31
/* 800270B4 00022EF4 38 61 00 08 */ addi r3, r1, 0x8
/* 800270B8 00022EF8 38 A0 00 20 */ li r5, 0x20
/* 800270BC 00022EFC 48 02 13 45 */ bl NANDWrite
/* 800270C0 00022F00 28 03 00 20 */ cmplwi r3, 0x20
/* 800270C4 00022F04 41 82 00 14 */ beq lbl_800270D8
/* 800270C8 00022F08 38 61 00 08 */ addi r3, r1, 0x8
/* 800270CC 00022F0C 48 02 25 85 */ bl NANDClose
/* 800270D0 00022F10 38 60 00 00 */ li r3, 0x0
/* 800270D4 00022F14 48 00 00 28 */ b lbl_800270FC
.global lbl_800270D8
lbl_800270D8:
/* 800270D8 00022F18 38 61 00 08 */ addi r3, r1, 0x8
/* 800270DC 00022F1C 48 02 25 75 */ bl NANDClose
/* 800270E0 00022F20 2C 03 00 00 */ cmpwi r3, 0x0
/* 800270E4 00022F24 41 82 00 14 */ beq lbl_800270F8
/* 800270E8 00022F28 38 60 00 00 */ li r3, 0x0
/* 800270EC 00022F2C 48 00 00 10 */ b lbl_800270FC
.global lbl_800270F0
lbl_800270F0:
/* 800270F0 00022F30 38 60 00 00 */ li r3, 0x0
/* 800270F4 00022F34 48 00 00 08 */ b lbl_800270FC
.global lbl_800270F8
lbl_800270F8:
/* 800270F8 00022F38 38 60 00 01 */ li r3, 0x1
.global lbl_800270FC
lbl_800270FC:
/* 800270FC 00022F3C 80 01 00 A4 */ lwz r0, 0xa4(r1)
/* 80027100 00022F40 83 E1 00 9C */ lwz r31, 0x9c(r1)
/* 80027104 00022F44 83 C1 00 98 */ lwz r30, 0x98(r1)
/* 80027108 00022F48 7C 08 03 A6 */ mtlr r0
/* 8002710C 00022F4C 38 21 00 A0 */ addi r1, r1, 0xa0
/* 80027110 00022F50 4E 80 00 20 */ blr
/* 80027114 00022F54 00 00 00 00 */ .4byte 0x00000000
/* 80027118 00022F58 00 00 00 00 */ .4byte 0x00000000
/* 8002711C 00022F5C 00 00 00 00 */ .4byte 0x00000000
.global __OSReadStateFlags
__OSReadStateFlags:
/* 80027120 00022F60 94 21 FF 50 */ stwu r1, -0xb0(r1)
/* 80027124 00022F64 7C 08 02 A6 */ mflr r0
/* 80027128 00022F68 38 A0 00 01 */ li r5, 0x1
/* 8002712C 00022F6C 90 01 00 B4 */ stw r0, 0xb4(r1)
/* 80027130 00022F70 38 81 00 08 */ addi r4, r1, 0x8
/* 80027134 00022F74 93 E1 00 AC */ stw r31, 0xac(r1)
/* 80027138 00022F78 93 C1 00 A8 */ stw r30, 0xa8(r1)
/* 8002713C 00022F7C 93 A1 00 A4 */ stw r29, 0xa4(r1)
/* 80027140 00022F80 3F A0 80 43 */ lis r29, "@709_8042F950"@ha
/* 80027144 00022F84 93 81 00 A0 */ stw r28, 0xa0(r1)
/* 80027148 00022F88 7C 7C 1B 78 */ mr r28, r3
/* 8002714C 00022F8C 38 7D F9 50 */ addi r3, r29, "@709_8042F950"@l
/* 80027150 00022F90 48 02 22 61 */ bl NANDOpen
/* 80027154 00022F94 2C 03 00 00 */ cmpwi r3, 0x0
/* 80027158 00022F98 40 82 00 4C */ bne lbl_800271A4
/* 8002715C 00022F9C 3F C0 80 4A */ lis r30, StateFlags@ha
/* 80027160 00022FA0 38 61 00 08 */ addi r3, r1, 0x8
/* 80027164 00022FA4 38 9E A1 80 */ addi r4, r30, StateFlags@l
/* 80027168 00022FA8 38 A0 00 20 */ li r5, 0x20
/* 8002716C 00022FAC 48 02 11 A5 */ bl NANDRead
/* 80027170 00022FB0 7C 7F 1B 78 */ mr r31, r3
/* 80027174 00022FB4 38 61 00 08 */ addi r3, r1, 0x8
/* 80027178 00022FB8 48 02 24 D9 */ bl NANDClose
/* 8002717C 00022FBC 28 1F 00 20 */ cmplwi r31, 0x20
/* 80027180 00022FC0 41 82 00 3C */ beq lbl_800271BC
/* 80027184 00022FC4 38 7D F9 50 */ addi r3, r29, -0x6b0
/* 80027188 00022FC8 48 02 0F 79 */ bl NANDDelete
/* 8002718C 00022FCC 7F 83 E3 78 */ mr r3, r28
/* 80027190 00022FD0 38 80 00 00 */ li r4, 0x0
/* 80027194 00022FD4 38 A0 00 20 */ li r5, 0x20
/* 80027198 00022FD8 4B FD D1 B9 */ bl memset
/* 8002719C 00022FDC 38 60 00 00 */ li r3, 0x0
/* 800271A0 00022FE0 48 00 00 88 */ b lbl_80027228
.global lbl_800271A4
lbl_800271A4:
/* 800271A4 00022FE4 7F 83 E3 78 */ mr r3, r28
/* 800271A8 00022FE8 38 80 00 00 */ li r4, 0x0
/* 800271AC 00022FEC 38 A0 00 20 */ li r5, 0x20
/* 800271B0 00022FF0 4B FD D1 A1 */ bl memset
/* 800271B4 00022FF4 38 60 00 00 */ li r3, 0x0
/* 800271B8 00022FF8 48 00 00 70 */ b lbl_80027228
.global lbl_800271BC
lbl_800271BC:
/* 800271BC 00022FFC 38 9E A1 80 */ addi r4, r30, -0x5e80
/* 800271C0 00023000 80 1E A1 80 */ lwz r0, -0x5e80(r30)
/* 800271C4 00023004 80 A4 00 04 */ lwz r5, 0x4(r4)
/* 800271C8 00023008 80 64 00 08 */ lwz r3, 0x8(r4)
/* 800271CC 0002300C 7C A5 1A 14 */ add r5, r5, r3
/* 800271D0 00023010 80 64 00 0C */ lwz r3, 0xc(r4)
/* 800271D4 00023014 7C A5 1A 14 */ add r5, r5, r3
/* 800271D8 00023018 80 64 00 10 */ lwz r3, 0x10(r4)
/* 800271DC 0002301C 7C A5 1A 14 */ add r5, r5, r3
/* 800271E0 00023020 80 64 00 14 */ lwz r3, 0x14(r4)
/* 800271E4 00023024 7C A5 1A 14 */ add r5, r5, r3
/* 800271E8 00023028 80 64 00 18 */ lwz r3, 0x18(r4)
/* 800271EC 0002302C 7C A5 1A 14 */ add r5, r5, r3
/* 800271F0 00023030 80 64 00 1C */ lwz r3, 0x1c(r4)
/* 800271F4 00023034 7C A5 1A 14 */ add r5, r5, r3
/* 800271F8 00023038 7C 00 28 40 */ cmplw r0, r5
/* 800271FC 0002303C 41 82 00 1C */ beq lbl_80027218
/* 80027200 00023040 7F 83 E3 78 */ mr r3, r28
/* 80027204 00023044 38 80 00 00 */ li r4, 0x0
/* 80027208 00023048 38 A0 00 20 */ li r5, 0x20
/* 8002720C 0002304C 4B FD D1 45 */ bl memset
/* 80027210 00023050 38 60 00 00 */ li r3, 0x0
/* 80027214 00023054 48 00 00 14 */ b lbl_80027228
.global lbl_80027218
lbl_80027218:
/* 80027218 00023058 7F 83 E3 78 */ mr r3, r28
/* 8002721C 0002305C 38 A0 00 20 */ li r5, 0x20
/* 80027220 00023060 4B FD CD E1 */ bl memcpy
/* 80027224 00023064 38 60 00 01 */ li r3, 0x1
.global lbl_80027228
lbl_80027228:
/* 80027228 00023068 80 01 00 B4 */ lwz r0, 0xb4(r1)
/* 8002722C 0002306C 83 E1 00 AC */ lwz r31, 0xac(r1)
/* 80027230 00023070 83 C1 00 A8 */ lwz r30, 0xa8(r1)
/* 80027234 00023074 83 A1 00 A4 */ lwz r29, 0xa4(r1)
/* 80027238 00023078 83 81 00 A0 */ lwz r28, 0xa0(r1)
/* 8002723C 0002307C 7C 08 03 A6 */ mtlr r0
/* 80027240 00023080 38 21 00 B0 */ addi r1, r1, 0xb0
/* 80027244 00023084 4E 80 00 20 */ blr
/* 80027248 00023088 00 00 00 00 */ .4byte 0x00000000
/* 8002724C 0002308C 00 00 00 00 */ .4byte 0x00000000
.include "macros.inc"
.section .data, "wa" # 0x80421040 - 0x80496700 ; 0x000756C0
.global "@709_8042F950"
"@709_8042F950":
.4byte 0x2F746974
.4byte 0x6C652F30
.4byte 0x30303030
.4byte 0x3030312F
.4byte 0x30303030
.4byte 0x30303032
.4byte 0x2F646174
.4byte 0x612F7374
.4byte 0x6174652E
.4byte 0x64617400
.include "macros.inc"
.section .bss, "", @nobits # 0x80496700 - 0x80556420 ; 0x000BFD20
.global StateFlags
StateFlags:
.skip 0x20