prime/asm/Dolphin/card/CARDRdwr.s

186 lines
8.7 KiB
ArmAsm
Raw Normal View History

2022-04-02 09:50:35 +00:00
.include "macros.inc"
.section .text, "ax"
.global BlockReadCallback
BlockReadCallback:
/* 803BA2EC 003B724C 7C 08 02 A6 */ mflr r0
/* 803BA2F0 003B7250 90 01 00 04 */ stw r0, 4(r1)
/* 803BA2F4 003B7254 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 803BA2F8 003B7258 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 803BA2FC 003B725C 3B E3 00 00 */ addi r31, r3, 0
2022-07-30 09:12:25 +00:00
/* 803BA300 003B7260 3C 60 80 57 */ lis r3, __CARDBlock@ha
2022-04-02 09:50:35 +00:00
/* 803BA304 003B7264 93 C1 00 18 */ stw r30, 0x18(r1)
/* 803BA308 003B7268 1C BF 01 10 */ mulli r5, r31, 0x110
/* 803BA30C 003B726C 93 A1 00 14 */ stw r29, 0x14(r1)
2022-07-30 09:12:25 +00:00
/* 803BA310 003B7270 38 03 9A 58 */ addi r0, r3, __CARDBlock@l
2022-04-02 09:50:35 +00:00
/* 803BA314 003B7274 7C 9D 23 79 */ or. r29, r4, r4
/* 803BA318 003B7278 7F C0 2A 14 */ add r30, r0, r5
/* 803BA31C 003B727C 41 80 00 50 */ blt lbl_803BA36C
/* 803BA320 003B7280 80 7E 00 B8 */ lwz r3, 0xb8(r30)
/* 803BA324 003B7284 38 03 02 00 */ addi r0, r3, 0x200
/* 803BA328 003B7288 90 1E 00 B8 */ stw r0, 0xb8(r30)
/* 803BA32C 003B728C 80 7E 00 B0 */ lwz r3, 0xb0(r30)
/* 803BA330 003B7290 38 03 02 00 */ addi r0, r3, 0x200
/* 803BA334 003B7294 90 1E 00 B0 */ stw r0, 0xb0(r30)
/* 803BA338 003B7298 80 7E 00 B4 */ lwz r3, 0xb4(r30)
/* 803BA33C 003B729C 38 03 02 00 */ addi r0, r3, 0x200
/* 803BA340 003B72A0 90 1E 00 B4 */ stw r0, 0xb4(r30)
/* 803BA344 003B72A4 80 7E 00 AC */ lwz r3, 0xac(r30)
/* 803BA348 003B72A8 34 03 FF FF */ addic. r0, r3, -1
/* 803BA34C 003B72AC 90 1E 00 AC */ stw r0, 0xac(r30)
/* 803BA350 003B72B0 40 81 00 1C */ ble lbl_803BA36C
/* 803BA354 003B72B4 3C 60 80 3C */ lis r3, BlockReadCallback@ha
/* 803BA358 003B72B8 38 83 A2 EC */ addi r4, r3, BlockReadCallback@l
/* 803BA35C 003B72BC 38 7F 00 00 */ addi r3, r31, 0
/* 803BA360 003B72C0 4B FF E6 25 */ bl __CARDReadSegment
/* 803BA364 003B72C4 7C 7D 1B 79 */ or. r29, r3, r3
/* 803BA368 003B72C8 40 80 00 44 */ bge lbl_803BA3AC
lbl_803BA36C:
/* 803BA36C 003B72CC 80 1E 00 D0 */ lwz r0, 0xd0(r30)
/* 803BA370 003B72D0 28 00 00 00 */ cmplwi r0, 0
/* 803BA374 003B72D4 40 82 00 10 */ bne lbl_803BA384
/* 803BA378 003B72D8 38 7E 00 00 */ addi r3, r30, 0
/* 803BA37C 003B72DC 38 9D 00 00 */ addi r4, r29, 0
/* 803BA380 003B72E0 4B FF EA D9 */ bl __CARDPutControlBlock
lbl_803BA384:
/* 803BA384 003B72E4 80 1E 00 D4 */ lwz r0, 0xd4(r30)
/* 803BA388 003B72E8 28 00 00 00 */ cmplwi r0, 0
/* 803BA38C 003B72EC 7C 0C 03 78 */ mr r12, r0
/* 803BA390 003B72F0 41 82 00 1C */ beq lbl_803BA3AC
/* 803BA394 003B72F4 38 00 00 00 */ li r0, 0
/* 803BA398 003B72F8 7D 88 03 A6 */ mtlr r12
/* 803BA39C 003B72FC 90 1E 00 D4 */ stw r0, 0xd4(r30)
/* 803BA3A0 003B7300 38 7F 00 00 */ addi r3, r31, 0
/* 803BA3A4 003B7304 38 9D 00 00 */ addi r4, r29, 0
2022-07-14 05:48:03 +00:00
/* 803BA3A8 003B7308 4E 80 00 21 */ blrl
2022-04-02 09:50:35 +00:00
lbl_803BA3AC:
/* 803BA3AC 003B730C 80 01 00 24 */ lwz r0, 0x24(r1)
/* 803BA3B0 003B7310 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 803BA3B4 003B7314 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 803BA3B8 003B7318 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 803BA3BC 003B731C 38 21 00 20 */ addi r1, r1, 0x20
/* 803BA3C0 003B7320 7C 08 03 A6 */ mtlr r0
2022-07-14 05:48:03 +00:00
/* 803BA3C4 003B7324 4E 80 00 20 */ blr
2022-04-02 09:50:35 +00:00
.global __CARDRead
__CARDRead:
/* 803BA3C8 003B7328 7C 08 02 A6 */ mflr r0
/* 803BA3CC 003B732C 1D 23 01 10 */ mulli r9, r3, 0x110
/* 803BA3D0 003B7330 90 01 00 04 */ stw r0, 4(r1)
2022-07-30 09:12:25 +00:00
/* 803BA3D4 003B7334 3D 00 80 57 */ lis r8, __CARDBlock@ha
2022-04-02 09:50:35 +00:00
/* 803BA3D8 003B7338 94 21 FF F8 */ stwu r1, -8(r1)
2022-07-30 09:12:25 +00:00
/* 803BA3DC 003B733C 38 08 9A 58 */ addi r0, r8, __CARDBlock@l
2022-04-02 09:50:35 +00:00
/* 803BA3E0 003B7340 7D 00 4A 14 */ add r8, r0, r9
/* 803BA3E4 003B7344 80 08 00 00 */ lwz r0, 0(r8)
/* 803BA3E8 003B7348 2C 00 00 00 */ cmpwi r0, 0
/* 803BA3EC 003B734C 40 82 00 0C */ bne lbl_803BA3F8
/* 803BA3F0 003B7350 38 60 FF FD */ li r3, -3
/* 803BA3F4 003B7354 48 00 00 28 */ b lbl_803BA41C
lbl_803BA3F8:
/* 803BA3F8 003B7358 90 E8 00 D4 */ stw r7, 0xd4(r8)
/* 803BA3FC 003B735C 54 A0 BA 7E */ srwi r0, r5, 9
/* 803BA400 003B7360 3C A0 80 3C */ lis r5, BlockReadCallback@ha
/* 803BA404 003B7364 90 08 00 AC */ stw r0, 0xac(r8)
/* 803BA408 003B7368 38 05 A2 EC */ addi r0, r5, BlockReadCallback@l
/* 803BA40C 003B736C 90 88 00 B0 */ stw r4, 0xb0(r8)
/* 803BA410 003B7370 7C 04 03 78 */ mr r4, r0
/* 803BA414 003B7374 90 C8 00 B4 */ stw r6, 0xb4(r8)
/* 803BA418 003B7378 4B FF E5 6D */ bl __CARDReadSegment
lbl_803BA41C:
/* 803BA41C 003B737C 80 01 00 0C */ lwz r0, 0xc(r1)
/* 803BA420 003B7380 38 21 00 08 */ addi r1, r1, 8
/* 803BA424 003B7384 7C 08 03 A6 */ mtlr r0
2022-07-14 05:48:03 +00:00
/* 803BA428 003B7388 4E 80 00 20 */ blr
2022-04-02 09:50:35 +00:00
.global BlockWriteCallback
BlockWriteCallback:
/* 803BA42C 003B738C 7C 08 02 A6 */ mflr r0
/* 803BA430 003B7390 90 01 00 04 */ stw r0, 4(r1)
/* 803BA434 003B7394 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 803BA438 003B7398 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 803BA43C 003B739C 3B E3 00 00 */ addi r31, r3, 0
2022-07-30 09:12:25 +00:00
/* 803BA440 003B73A0 3C 60 80 57 */ lis r3, __CARDBlock@ha
2022-04-02 09:50:35 +00:00
/* 803BA444 003B73A4 93 C1 00 18 */ stw r30, 0x18(r1)
/* 803BA448 003B73A8 1C BF 01 10 */ mulli r5, r31, 0x110
/* 803BA44C 003B73AC 93 A1 00 14 */ stw r29, 0x14(r1)
2022-07-30 09:12:25 +00:00
/* 803BA450 003B73B0 38 03 9A 58 */ addi r0, r3, __CARDBlock@l
2022-04-02 09:50:35 +00:00
/* 803BA454 003B73B4 7C 9D 23 79 */ or. r29, r4, r4
/* 803BA458 003B73B8 7F C0 2A 14 */ add r30, r0, r5
/* 803BA45C 003B73BC 41 80 00 50 */ blt lbl_803BA4AC
/* 803BA460 003B73C0 80 7E 00 B8 */ lwz r3, 0xb8(r30)
/* 803BA464 003B73C4 38 03 00 80 */ addi r0, r3, 0x80
/* 803BA468 003B73C8 90 1E 00 B8 */ stw r0, 0xb8(r30)
/* 803BA46C 003B73CC 80 7E 00 B0 */ lwz r3, 0xb0(r30)
/* 803BA470 003B73D0 38 03 00 80 */ addi r0, r3, 0x80
/* 803BA474 003B73D4 90 1E 00 B0 */ stw r0, 0xb0(r30)
/* 803BA478 003B73D8 80 7E 00 B4 */ lwz r3, 0xb4(r30)
/* 803BA47C 003B73DC 38 03 00 80 */ addi r0, r3, 0x80
/* 803BA480 003B73E0 90 1E 00 B4 */ stw r0, 0xb4(r30)
/* 803BA484 003B73E4 80 7E 00 AC */ lwz r3, 0xac(r30)
/* 803BA488 003B73E8 34 03 FF FF */ addic. r0, r3, -1
/* 803BA48C 003B73EC 90 1E 00 AC */ stw r0, 0xac(r30)
/* 803BA490 003B73F0 40 81 00 1C */ ble lbl_803BA4AC
/* 803BA494 003B73F4 3C 60 80 3C */ lis r3, BlockWriteCallback@ha
/* 803BA498 003B73F8 38 83 A4 2C */ addi r4, r3, BlockWriteCallback@l
/* 803BA49C 003B73FC 38 7F 00 00 */ addi r3, r31, 0
/* 803BA4A0 003B7400 4B FF E6 19 */ bl __CARDWritePage
/* 803BA4A4 003B7404 7C 7D 1B 79 */ or. r29, r3, r3
/* 803BA4A8 003B7408 40 80 00 44 */ bge lbl_803BA4EC
lbl_803BA4AC:
/* 803BA4AC 003B740C 80 1E 00 D0 */ lwz r0, 0xd0(r30)
/* 803BA4B0 003B7410 28 00 00 00 */ cmplwi r0, 0
/* 803BA4B4 003B7414 40 82 00 10 */ bne lbl_803BA4C4
/* 803BA4B8 003B7418 38 7E 00 00 */ addi r3, r30, 0
/* 803BA4BC 003B741C 38 9D 00 00 */ addi r4, r29, 0
/* 803BA4C0 003B7420 4B FF E9 99 */ bl __CARDPutControlBlock
lbl_803BA4C4:
/* 803BA4C4 003B7424 80 1E 00 D4 */ lwz r0, 0xd4(r30)
/* 803BA4C8 003B7428 28 00 00 00 */ cmplwi r0, 0
/* 803BA4CC 003B742C 7C 0C 03 78 */ mr r12, r0
/* 803BA4D0 003B7430 41 82 00 1C */ beq lbl_803BA4EC
/* 803BA4D4 003B7434 38 00 00 00 */ li r0, 0
/* 803BA4D8 003B7438 7D 88 03 A6 */ mtlr r12
/* 803BA4DC 003B743C 90 1E 00 D4 */ stw r0, 0xd4(r30)
/* 803BA4E0 003B7440 38 7F 00 00 */ addi r3, r31, 0
/* 803BA4E4 003B7444 38 9D 00 00 */ addi r4, r29, 0
2022-07-14 05:48:03 +00:00
/* 803BA4E8 003B7448 4E 80 00 21 */ blrl
2022-04-02 09:50:35 +00:00
lbl_803BA4EC:
/* 803BA4EC 003B744C 80 01 00 24 */ lwz r0, 0x24(r1)
/* 803BA4F0 003B7450 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 803BA4F4 003B7454 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 803BA4F8 003B7458 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 803BA4FC 003B745C 38 21 00 20 */ addi r1, r1, 0x20
/* 803BA500 003B7460 7C 08 03 A6 */ mtlr r0
2022-07-14 05:48:03 +00:00
/* 803BA504 003B7464 4E 80 00 20 */ blr
2022-04-02 09:50:35 +00:00
.global __CARDWrite
__CARDWrite:
/* 803BA508 003B7468 7C 08 02 A6 */ mflr r0
/* 803BA50C 003B746C 1D 23 01 10 */ mulli r9, r3, 0x110
/* 803BA510 003B7470 90 01 00 04 */ stw r0, 4(r1)
2022-07-30 09:12:25 +00:00
/* 803BA514 003B7474 3D 00 80 57 */ lis r8, __CARDBlock@ha
2022-04-02 09:50:35 +00:00
/* 803BA518 003B7478 94 21 FF F8 */ stwu r1, -8(r1)
2022-07-30 09:12:25 +00:00
/* 803BA51C 003B747C 38 08 9A 58 */ addi r0, r8, __CARDBlock@l
2022-04-02 09:50:35 +00:00
/* 803BA520 003B7480 7D 00 4A 14 */ add r8, r0, r9
/* 803BA524 003B7484 80 08 00 00 */ lwz r0, 0(r8)
/* 803BA528 003B7488 2C 00 00 00 */ cmpwi r0, 0
/* 803BA52C 003B748C 40 82 00 0C */ bne lbl_803BA538
/* 803BA530 003B7490 38 60 FF FD */ li r3, -3
/* 803BA534 003B7494 48 00 00 28 */ b lbl_803BA55C
lbl_803BA538:
/* 803BA538 003B7498 90 E8 00 D4 */ stw r7, 0xd4(r8)
/* 803BA53C 003B749C 54 A0 C9 FE */ srwi r0, r5, 7
/* 803BA540 003B74A0 3C A0 80 3C */ lis r5, BlockWriteCallback@ha
/* 803BA544 003B74A4 90 08 00 AC */ stw r0, 0xac(r8)
/* 803BA548 003B74A8 38 05 A4 2C */ addi r0, r5, BlockWriteCallback@l
/* 803BA54C 003B74AC 90 88 00 B0 */ stw r4, 0xb0(r8)
/* 803BA550 003B74B0 7C 04 03 78 */ mr r4, r0
/* 803BA554 003B74B4 90 C8 00 B4 */ stw r6, 0xb4(r8)
/* 803BA558 003B74B8 4B FF E5 61 */ bl __CARDWritePage
lbl_803BA55C:
/* 803BA55C 003B74BC 80 01 00 0C */ lwz r0, 0xc(r1)
/* 803BA560 003B74C0 38 21 00 08 */ addi r1, r1, 8
/* 803BA564 003B74C4 7C 08 03 A6 */ mtlr r0
2022-07-14 05:48:03 +00:00
/* 803BA568 003B74C8 4E 80 00 20 */ blr