prime/asm/Dolphin/card/CARDDir.s

177 lines
8.3 KiB
ArmAsm

.include "macros.inc"
.section .text, "ax"
.global __CARDGetDirBlock
__CARDGetDirBlock:
/* 803BA970 003B78D0 80 63 00 84 */ lwz r3, 0x84(r3)
/* 803BA974 003B78D4 4E 80 00 20 */ blr
WriteCallback:
/* 803BA978 003B78D8 7C 08 02 A6 */ mflr r0
/* 803BA97C 003B78DC 90 01 00 04 */ stw r0, 4(r1)
/* 803BA980 003B78E0 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 803BA984 003B78E4 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 803BA988 003B78E8 93 C1 00 18 */ stw r30, 0x18(r1)
/* 803BA98C 003B78EC 7C 9E 23 79 */ or. r30, r4, r4
/* 803BA990 003B78F0 93 A1 00 14 */ stw r29, 0x14(r1)
/* 803BA994 003B78F4 3B A3 00 00 */ addi r29, r3, 0
/* 803BA998 003B78F8 1C BD 01 10 */ mulli r5, r29, 0x110
/* 803BA99C 003B78FC 3C 60 80 57 */ lis r3, __CARDBlock@ha
/* 803BA9A0 003B7900 38 03 9A 58 */ addi r0, r3, __CARDBlock@l
/* 803BA9A4 003B7904 7F E0 2A 14 */ add r31, r0, r5
/* 803BA9A8 003B7908 41 80 00 44 */ blt lbl_803BA9EC
/* 803BA9AC 003B790C 80 7F 00 80 */ lwz r3, 0x80(r31)
/* 803BA9B0 003B7910 80 1F 00 84 */ lwz r0, 0x84(r31)
/* 803BA9B4 003B7914 38 83 20 00 */ addi r4, r3, 0x2000
/* 803BA9B8 003B7918 7C 00 20 40 */ cmplw r0, r4
/* 803BA9BC 003B791C 38 03 40 00 */ addi r0, r3, 0x4000
/* 803BA9C0 003B7920 40 82 00 18 */ bne lbl_803BA9D8
/* 803BA9C4 003B7924 90 1F 00 84 */ stw r0, 0x84(r31)
/* 803BA9C8 003B7928 7C 03 03 78 */ mr r3, r0
/* 803BA9CC 003B792C 38 A0 20 00 */ li r5, 0x2000
/* 803BA9D0 003B7930 4B C4 8A C1 */ bl memcpy
/* 803BA9D4 003B7934 48 00 00 18 */ b lbl_803BA9EC
lbl_803BA9D8:
/* 803BA9D8 003B7938 90 9F 00 84 */ stw r4, 0x84(r31)
/* 803BA9DC 003B793C 38 64 00 00 */ addi r3, r4, 0
/* 803BA9E0 003B7940 7C 04 03 78 */ mr r4, r0
/* 803BA9E4 003B7944 38 A0 20 00 */ li r5, 0x2000
/* 803BA9E8 003B7948 4B C4 8A A9 */ bl memcpy
lbl_803BA9EC:
/* 803BA9EC 003B794C 80 1F 00 D0 */ lwz r0, 0xd0(r31)
/* 803BA9F0 003B7950 28 00 00 00 */ cmplwi r0, 0
/* 803BA9F4 003B7954 40 82 00 10 */ bne lbl_803BAA04
/* 803BA9F8 003B7958 38 7F 00 00 */ addi r3, r31, 0
/* 803BA9FC 003B795C 38 9E 00 00 */ addi r4, r30, 0
/* 803BAA00 003B7960 4B FF E4 59 */ bl __CARDPutControlBlock
lbl_803BAA04:
/* 803BAA04 003B7964 80 1F 00 D8 */ lwz r0, 0xd8(r31)
/* 803BAA08 003B7968 28 00 00 00 */ cmplwi r0, 0
/* 803BAA0C 003B796C 7C 0C 03 78 */ mr r12, r0
/* 803BAA10 003B7970 41 82 00 1C */ beq lbl_803BAA2C
/* 803BAA14 003B7974 38 00 00 00 */ li r0, 0
/* 803BAA18 003B7978 7D 88 03 A6 */ mtlr r12
/* 803BAA1C 003B797C 90 1F 00 D8 */ stw r0, 0xd8(r31)
/* 803BAA20 003B7980 38 7D 00 00 */ addi r3, r29, 0
/* 803BAA24 003B7984 38 9E 00 00 */ addi r4, r30, 0
/* 803BAA28 003B7988 4E 80 00 21 */ blrl
lbl_803BAA2C:
/* 803BAA2C 003B798C 80 01 00 24 */ lwz r0, 0x24(r1)
/* 803BAA30 003B7990 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 803BAA34 003B7994 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 803BAA38 003B7998 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 803BAA3C 003B799C 38 21 00 20 */ addi r1, r1, 0x20
/* 803BAA40 003B79A0 7C 08 03 A6 */ mtlr r0
/* 803BAA44 003B79A4 4E 80 00 20 */ blr
.global EraseCallback
EraseCallback:
/* 803BAA48 003B79A8 7C 08 02 A6 */ mflr r0
/* 803BAA4C 003B79AC 90 01 00 04 */ stw r0, 4(r1)
/* 803BAA50 003B79B0 94 21 FF D8 */ stwu r1, -0x28(r1)
/* 803BAA54 003B79B4 93 E1 00 24 */ stw r31, 0x24(r1)
/* 803BAA58 003B79B8 3B E3 00 00 */ addi r31, r3, 0
/* 803BAA5C 003B79BC 3C 60 80 57 */ lis r3, __CARDBlock@ha
/* 803BAA60 003B79C0 93 C1 00 20 */ stw r30, 0x20(r1)
/* 803BAA64 003B79C4 1C BF 01 10 */ mulli r5, r31, 0x110
/* 803BAA68 003B79C8 93 A1 00 1C */ stw r29, 0x1c(r1)
/* 803BAA6C 003B79CC 38 03 9A 58 */ addi r0, r3, __CARDBlock@l
/* 803BAA70 003B79D0 7C 9D 23 79 */ or. r29, r4, r4
/* 803BAA74 003B79D4 7F C0 2A 14 */ add r30, r0, r5
/* 803BAA78 003B79D8 41 80 00 3C */ blt lbl_803BAAB4
/* 803BAA7C 003B79DC 80 BE 00 84 */ lwz r5, 0x84(r30)
/* 803BAA80 003B79E0 3C 60 80 3C */ lis r3, WriteCallback@ha
/* 803BAA84 003B79E4 80 1E 00 80 */ lwz r0, 0x80(r30)
/* 803BAA88 003B79E8 38 E3 A9 78 */ addi r7, r3, WriteCallback@l
/* 803BAA8C 003B79EC 80 7E 00 0C */ lwz r3, 0xc(r30)
/* 803BAA90 003B79F0 7C 00 28 50 */ subf r0, r0, r5
/* 803BAA94 003B79F4 54 00 9B 7E */ srwi r0, r0, 0xd
/* 803BAA98 003B79F8 7C 83 01 D6 */ mullw r4, r3, r0
/* 803BAA9C 003B79FC 38 C5 00 00 */ addi r6, r5, 0
/* 803BAAA0 003B7A00 38 7F 00 00 */ addi r3, r31, 0
/* 803BAAA4 003B7A04 38 A0 20 00 */ li r5, 0x2000
/* 803BAAA8 003B7A08 4B FF FA 61 */ bl __CARDWrite
/* 803BAAAC 003B7A0C 7C 7D 1B 79 */ or. r29, r3, r3
/* 803BAAB0 003B7A10 40 80 00 44 */ bge lbl_803BAAF4
lbl_803BAAB4:
/* 803BAAB4 003B7A14 80 1E 00 D0 */ lwz r0, 0xd0(r30)
/* 803BAAB8 003B7A18 28 00 00 00 */ cmplwi r0, 0
/* 803BAABC 003B7A1C 40 82 00 10 */ bne lbl_803BAACC
/* 803BAAC0 003B7A20 38 7E 00 00 */ addi r3, r30, 0
/* 803BAAC4 003B7A24 38 9D 00 00 */ addi r4, r29, 0
/* 803BAAC8 003B7A28 4B FF E3 91 */ bl __CARDPutControlBlock
lbl_803BAACC:
/* 803BAACC 003B7A2C 80 1E 00 D8 */ lwz r0, 0xd8(r30)
/* 803BAAD0 003B7A30 28 00 00 00 */ cmplwi r0, 0
/* 803BAAD4 003B7A34 7C 0C 03 78 */ mr r12, r0
/* 803BAAD8 003B7A38 41 82 00 1C */ beq lbl_803BAAF4
/* 803BAADC 003B7A3C 38 00 00 00 */ li r0, 0
/* 803BAAE0 003B7A40 7D 88 03 A6 */ mtlr r12
/* 803BAAE4 003B7A44 90 1E 00 D8 */ stw r0, 0xd8(r30)
/* 803BAAE8 003B7A48 38 7F 00 00 */ addi r3, r31, 0
/* 803BAAEC 003B7A4C 38 9D 00 00 */ addi r4, r29, 0
/* 803BAAF0 003B7A50 4E 80 00 21 */ blrl
lbl_803BAAF4:
/* 803BAAF4 003B7A54 80 01 00 2C */ lwz r0, 0x2c(r1)
/* 803BAAF8 003B7A58 83 E1 00 24 */ lwz r31, 0x24(r1)
/* 803BAAFC 003B7A5C 83 C1 00 20 */ lwz r30, 0x20(r1)
/* 803BAB00 003B7A60 83 A1 00 1C */ lwz r29, 0x1c(r1)
/* 803BAB04 003B7A64 38 21 00 28 */ addi r1, r1, 0x28
/* 803BAB08 003B7A68 7C 08 03 A6 */ mtlr r0
/* 803BAB0C 003B7A6C 4E 80 00 20 */ blr
.global __CARDUpdateDir
__CARDUpdateDir:
/* 803BAB10 003B7A70 7C 08 02 A6 */ mflr r0
/* 803BAB14 003B7A74 90 01 00 04 */ stw r0, 4(r1)
/* 803BAB18 003B7A78 94 21 FF D8 */ stwu r1, -0x28(r1)
/* 803BAB1C 003B7A7C 93 E1 00 24 */ stw r31, 0x24(r1)
/* 803BAB20 003B7A80 93 C1 00 20 */ stw r30, 0x20(r1)
/* 803BAB24 003B7A84 93 A1 00 1C */ stw r29, 0x1c(r1)
/* 803BAB28 003B7A88 3B A4 00 00 */ addi r29, r4, 0
/* 803BAB2C 003B7A8C 93 81 00 18 */ stw r28, 0x18(r1)
/* 803BAB30 003B7A90 3B 83 00 00 */ addi r28, r3, 0
/* 803BAB34 003B7A94 1C BC 01 10 */ mulli r5, r28, 0x110
/* 803BAB38 003B7A98 3C 60 80 57 */ lis r3, __CARDBlock@ha
/* 803BAB3C 003B7A9C 38 03 9A 58 */ addi r0, r3, __CARDBlock@l
/* 803BAB40 003B7AA0 7F C0 2A 14 */ add r30, r0, r5
/* 803BAB44 003B7AA4 80 1E 00 00 */ lwz r0, 0(r30)
/* 803BAB48 003B7AA8 2C 00 00 00 */ cmpwi r0, 0
/* 803BAB4C 003B7AAC 40 82 00 0C */ bne lbl_803BAB58
/* 803BAB50 003B7AB0 38 60 FF FD */ li r3, -3
/* 803BAB54 003B7AB4 48 00 00 60 */ b lbl_803BABB4
lbl_803BAB58:
/* 803BAB58 003B7AB8 83 FE 00 84 */ lwz r31, 0x84(r30)
/* 803BAB5C 003B7ABC 38 80 1F FC */ li r4, 0x1ffc
/* 803BAB60 003B7AC0 A8 BF 1F FA */ lha r5, 0x1ffa(r31)
/* 803BAB64 003B7AC4 38 DF 1F C0 */ addi r6, r31, 0x1fc0
/* 803BAB68 003B7AC8 38 7F 00 00 */ addi r3, r31, 0
/* 803BAB6C 003B7ACC 38 05 00 01 */ addi r0, r5, 1
/* 803BAB70 003B7AD0 B0 1F 1F FA */ sth r0, 0x1ffa(r31)
/* 803BAB74 003B7AD4 38 A6 00 3C */ addi r5, r6, 0x3c
/* 803BAB78 003B7AD8 38 C6 00 3E */ addi r6, r6, 0x3e
/* 803BAB7C 003B7ADC 48 00 00 59 */ bl __CARDCheckSum
/* 803BAB80 003B7AE0 38 7F 00 00 */ addi r3, r31, 0
/* 803BAB84 003B7AE4 38 80 20 00 */ li r4, 0x2000
/* 803BAB88 003B7AE8 4B FC 3F 59 */ bl DCStoreRange
/* 803BAB8C 003B7AEC 93 BE 00 D8 */ stw r29, 0xd8(r30)
/* 803BAB90 003B7AF0 3C 60 80 3C */ lis r3, EraseCallback@ha
/* 803BAB94 003B7AF4 38 A3 AA 48 */ addi r5, r3, EraseCallback@l
/* 803BAB98 003B7AF8 80 1E 00 80 */ lwz r0, 0x80(r30)
/* 803BAB9C 003B7AFC 7F 83 E3 78 */ mr r3, r28
/* 803BABA0 003B7B00 80 9E 00 0C */ lwz r4, 0xc(r30)
/* 803BABA4 003B7B04 7C 00 F8 50 */ subf r0, r0, r31
/* 803BABA8 003B7B08 54 00 9B 7E */ srwi r0, r0, 0xd
/* 803BABAC 003B7B0C 7C 84 01 D6 */ mullw r4, r4, r0
/* 803BABB0 003B7B10 4B FF E0 25 */ bl __CARDEraseSector
lbl_803BABB4:
/* 803BABB4 003B7B14 80 01 00 2C */ lwz r0, 0x2c(r1)
/* 803BABB8 003B7B18 83 E1 00 24 */ lwz r31, 0x24(r1)
/* 803BABBC 003B7B1C 83 C1 00 20 */ lwz r30, 0x20(r1)
/* 803BABC0 003B7B20 83 A1 00 1C */ lwz r29, 0x1c(r1)
/* 803BABC4 003B7B24 83 81 00 18 */ lwz r28, 0x18(r1)
/* 803BABC8 003B7B28 38 21 00 28 */ addi r1, r1, 0x28
/* 803BABCC 003B7B2C 7C 08 03 A6 */ mtlr r0
/* 803BABD0 003B7B30 4E 80 00 20 */ blr