170 lines
7.9 KiB
ArmAsm
170 lines
7.9 KiB
ArmAsm
.include "macros.inc"
|
|
|
|
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
|
|
.global CircleBufferInitialize
|
|
CircleBufferInitialize:
|
|
/* 800152FC 0001113C 38 00 00 00 */ li r0, 0x0
|
|
/* 80015300 00011140 90 83 00 08 */ stw r4, 0x8(r3)
|
|
/* 80015304 00011144 90 A3 00 0C */ stw r5, 0xc(r3)
|
|
/* 80015308 00011148 90 83 00 00 */ stw r4, 0x0(r3)
|
|
/* 8001530C 0001114C 90 83 00 04 */ stw r4, 0x4(r3)
|
|
/* 80015310 00011150 90 03 00 10 */ stw r0, 0x10(r3)
|
|
/* 80015314 00011154 90 A3 00 14 */ stw r5, 0x14(r3)
|
|
/* 80015318 00011158 38 63 00 18 */ addi r3, r3, 0x18
|
|
/* 8001531C 0001115C 48 00 F1 84 */ b DefaultSwitchThreadCallback
|
|
.global CircleBufferWriteBytes
|
|
CircleBufferWriteBytes:
|
|
/* 80015320 00011160 94 21 FF E0 */ stwu r1, -0x20(r1)
|
|
/* 80015324 00011164 7C 08 02 A6 */ mflr r0
|
|
/* 80015328 00011168 90 01 00 24 */ stw r0, 0x24(r1)
|
|
/* 8001532C 0001116C 93 E1 00 1C */ stw r31, 0x1c(r1)
|
|
/* 80015330 00011170 7C BF 2B 78 */ mr r31, r5
|
|
/* 80015334 00011174 93 C1 00 18 */ stw r30, 0x18(r1)
|
|
/* 80015338 00011178 7C 7E 1B 78 */ mr r30, r3
|
|
/* 8001533C 0001117C 93 A1 00 14 */ stw r29, 0x14(r1)
|
|
/* 80015340 00011180 93 81 00 10 */ stw r28, 0x10(r1)
|
|
/* 80015344 00011184 7C 9C 23 78 */ mr r28, r4
|
|
/* 80015348 00011188 80 03 00 14 */ lwz r0, 0x14(r3)
|
|
/* 8001534C 0001118C 7C 05 00 40 */ cmplw r5, r0
|
|
/* 80015350 00011190 40 81 00 0C */ ble lbl_8001535C
|
|
/* 80015354 00011194 38 60 FF FF */ li r3, -0x1
|
|
/* 80015358 00011198 48 00 00 B0 */ b lbl_80015408
|
|
.global lbl_8001535C
|
|
lbl_8001535C:
|
|
/* 8001535C 0001119C 38 63 00 18 */ addi r3, r3, 0x18
|
|
/* 80015360 000111A0 4B FF FF 65 */ bl MWEnterCriticalSection
|
|
/* 80015364 000111A4 80 7E 00 04 */ lwz r3, 0x4(r30)
|
|
/* 80015368 000111A8 80 9E 00 08 */ lwz r4, 0x8(r30)
|
|
/* 8001536C 000111AC 80 1E 00 0C */ lwz r0, 0xc(r30)
|
|
/* 80015370 000111B0 7C 84 18 50 */ subf r4, r4, r3
|
|
/* 80015374 000111B4 7F A4 00 50 */ subf r29, r4, r0
|
|
/* 80015378 000111B8 7C 1D F8 40 */ cmplw r29, r31
|
|
/* 8001537C 000111BC 41 80 00 20 */ blt lbl_8001539C
|
|
/* 80015380 000111C0 7F 84 E3 78 */ mr r4, r28
|
|
/* 80015384 000111C4 7F E5 FB 78 */ mr r5, r31
|
|
/* 80015388 000111C8 4B FE EC 79 */ bl memcpy
|
|
/* 8001538C 000111CC 80 1E 00 04 */ lwz r0, 0x4(r30)
|
|
/* 80015390 000111D0 7C 00 FA 14 */ add r0, r0, r31
|
|
/* 80015394 000111D4 90 1E 00 04 */ stw r0, 0x4(r30)
|
|
/* 80015398 000111D8 48 00 00 30 */ b lbl_800153C8
|
|
.global lbl_8001539C
|
|
lbl_8001539C:
|
|
/* 8001539C 000111DC 7F 84 E3 78 */ mr r4, r28
|
|
/* 800153A0 000111E0 7F A5 EB 78 */ mr r5, r29
|
|
/* 800153A4 000111E4 4B FE EC 5D */ bl memcpy
|
|
/* 800153A8 000111E8 80 7E 00 08 */ lwz r3, 0x8(r30)
|
|
/* 800153AC 000111EC 7C 9C EA 14 */ add r4, r28, r29
|
|
/* 800153B0 000111F0 7C BD F8 50 */ subf r5, r29, r31
|
|
/* 800153B4 000111F4 4B FE EC 4D */ bl memcpy
|
|
/* 800153B8 000111F8 80 1E 00 08 */ lwz r0, 0x8(r30)
|
|
/* 800153BC 000111FC 7C 00 FA 14 */ add r0, r0, r31
|
|
/* 800153C0 00011200 7C 1D 00 50 */ subf r0, r29, r0
|
|
/* 800153C4 00011204 90 1E 00 04 */ stw r0, 0x4(r30)
|
|
.global lbl_800153C8
|
|
lbl_800153C8:
|
|
/* 800153C8 00011208 80 9E 00 08 */ lwz r4, 0x8(r30)
|
|
/* 800153CC 0001120C 80 1E 00 04 */ lwz r0, 0x4(r30)
|
|
/* 800153D0 00011210 80 7E 00 0C */ lwz r3, 0xc(r30)
|
|
/* 800153D4 00011214 7C 04 00 50 */ subf r0, r4, r0
|
|
/* 800153D8 00011218 7C 03 00 40 */ cmplw r3, r0
|
|
/* 800153DC 0001121C 40 82 00 08 */ bne lbl_800153E4
|
|
/* 800153E0 00011220 90 9E 00 04 */ stw r4, 0x4(r30)
|
|
.global lbl_800153E4
|
|
lbl_800153E4:
|
|
/* 800153E4 00011224 80 9E 00 14 */ lwz r4, 0x14(r30)
|
|
/* 800153E8 00011228 38 7E 00 18 */ addi r3, r30, 0x18
|
|
/* 800153EC 0001122C 80 1E 00 10 */ lwz r0, 0x10(r30)
|
|
/* 800153F0 00011230 7C 9F 20 50 */ subf r4, r31, r4
|
|
/* 800153F4 00011234 90 9E 00 14 */ stw r4, 0x14(r30)
|
|
/* 800153F8 00011238 7C 00 FA 14 */ add r0, r0, r31
|
|
/* 800153FC 0001123C 90 1E 00 10 */ stw r0, 0x10(r30)
|
|
/* 80015400 00011240 4B FF FE F5 */ bl MWExitCriticalSection
|
|
/* 80015404 00011244 38 60 00 00 */ li r3, 0x0
|
|
.global lbl_80015408
|
|
lbl_80015408:
|
|
/* 80015408 00011248 80 01 00 24 */ lwz r0, 0x24(r1)
|
|
/* 8001540C 0001124C 83 E1 00 1C */ lwz r31, 0x1c(r1)
|
|
/* 80015410 00011250 83 C1 00 18 */ lwz r30, 0x18(r1)
|
|
/* 80015414 00011254 83 A1 00 14 */ lwz r29, 0x14(r1)
|
|
/* 80015418 00011258 83 81 00 10 */ lwz r28, 0x10(r1)
|
|
/* 8001541C 0001125C 7C 08 03 A6 */ mtlr r0
|
|
/* 80015420 00011260 38 21 00 20 */ addi r1, r1, 0x20
|
|
/* 80015424 00011264 4E 80 00 20 */ blr
|
|
.global CircleBufferReadBytes
|
|
CircleBufferReadBytes:
|
|
/* 80015428 00011268 94 21 FF E0 */ stwu r1, -0x20(r1)
|
|
/* 8001542C 0001126C 7C 08 02 A6 */ mflr r0
|
|
/* 80015430 00011270 90 01 00 24 */ stw r0, 0x24(r1)
|
|
/* 80015434 00011274 93 E1 00 1C */ stw r31, 0x1c(r1)
|
|
/* 80015438 00011278 7C BF 2B 78 */ mr r31, r5
|
|
/* 8001543C 0001127C 93 C1 00 18 */ stw r30, 0x18(r1)
|
|
/* 80015440 00011280 7C 7E 1B 78 */ mr r30, r3
|
|
/* 80015444 00011284 93 A1 00 14 */ stw r29, 0x14(r1)
|
|
/* 80015448 00011288 93 81 00 10 */ stw r28, 0x10(r1)
|
|
/* 8001544C 0001128C 7C 9C 23 78 */ mr r28, r4
|
|
/* 80015450 00011290 80 03 00 10 */ lwz r0, 0x10(r3)
|
|
/* 80015454 00011294 7C 05 00 40 */ cmplw r5, r0
|
|
/* 80015458 00011298 40 81 00 0C */ ble lbl_80015464
|
|
/* 8001545C 0001129C 38 60 FF FF */ li r3, -0x1
|
|
/* 80015460 000112A0 48 00 00 B0 */ b lbl_80015510
|
|
.global lbl_80015464
|
|
lbl_80015464:
|
|
/* 80015464 000112A4 38 63 00 18 */ addi r3, r3, 0x18
|
|
/* 80015468 000112A8 4B FF FE 5D */ bl MWEnterCriticalSection
|
|
/* 8001546C 000112AC 80 9E 00 00 */ lwz r4, 0x0(r30)
|
|
/* 80015470 000112B0 80 7E 00 08 */ lwz r3, 0x8(r30)
|
|
/* 80015474 000112B4 80 1E 00 0C */ lwz r0, 0xc(r30)
|
|
/* 80015478 000112B8 7C 63 20 50 */ subf r3, r3, r4
|
|
/* 8001547C 000112BC 7F A3 00 50 */ subf r29, r3, r0
|
|
/* 80015480 000112C0 7C 1F E8 40 */ cmplw r31, r29
|
|
/* 80015484 000112C4 40 80 00 20 */ bge lbl_800154A4
|
|
/* 80015488 000112C8 7F 83 E3 78 */ mr r3, r28
|
|
/* 8001548C 000112CC 7F E5 FB 78 */ mr r5, r31
|
|
/* 80015490 000112D0 4B FE EB 71 */ bl memcpy
|
|
/* 80015494 000112D4 80 1E 00 00 */ lwz r0, 0x0(r30)
|
|
/* 80015498 000112D8 7C 00 FA 14 */ add r0, r0, r31
|
|
/* 8001549C 000112DC 90 1E 00 00 */ stw r0, 0x0(r30)
|
|
/* 800154A0 000112E0 48 00 00 30 */ b lbl_800154D0
|
|
.global lbl_800154A4
|
|
lbl_800154A4:
|
|
/* 800154A4 000112E4 7F 83 E3 78 */ mr r3, r28
|
|
/* 800154A8 000112E8 7F A5 EB 78 */ mr r5, r29
|
|
/* 800154AC 000112EC 4B FE EB 55 */ bl memcpy
|
|
/* 800154B0 000112F0 80 9E 00 08 */ lwz r4, 0x8(r30)
|
|
/* 800154B4 000112F4 7C 7C EA 14 */ add r3, r28, r29
|
|
/* 800154B8 000112F8 7C BD F8 50 */ subf r5, r29, r31
|
|
/* 800154BC 000112FC 4B FE EB 45 */ bl memcpy
|
|
/* 800154C0 00011300 80 1E 00 08 */ lwz r0, 0x8(r30)
|
|
/* 800154C4 00011304 7C 00 FA 14 */ add r0, r0, r31
|
|
/* 800154C8 00011308 7C 1D 00 50 */ subf r0, r29, r0
|
|
/* 800154CC 0001130C 90 1E 00 00 */ stw r0, 0x0(r30)
|
|
.global lbl_800154D0
|
|
lbl_800154D0:
|
|
/* 800154D0 00011310 80 9E 00 08 */ lwz r4, 0x8(r30)
|
|
/* 800154D4 00011314 80 1E 00 00 */ lwz r0, 0x0(r30)
|
|
/* 800154D8 00011318 80 7E 00 0C */ lwz r3, 0xc(r30)
|
|
/* 800154DC 0001131C 7C 04 00 50 */ subf r0, r4, r0
|
|
/* 800154E0 00011320 7C 03 00 40 */ cmplw r3, r0
|
|
/* 800154E4 00011324 40 82 00 08 */ bne lbl_800154EC
|
|
/* 800154E8 00011328 90 9E 00 00 */ stw r4, 0x0(r30)
|
|
.global lbl_800154EC
|
|
lbl_800154EC:
|
|
/* 800154EC 0001132C 80 9E 00 14 */ lwz r4, 0x14(r30)
|
|
/* 800154F0 00011330 38 7E 00 18 */ addi r3, r30, 0x18
|
|
/* 800154F4 00011334 80 1E 00 10 */ lwz r0, 0x10(r30)
|
|
/* 800154F8 00011338 7C 84 FA 14 */ add r4, r4, r31
|
|
/* 800154FC 0001133C 90 9E 00 14 */ stw r4, 0x14(r30)
|
|
/* 80015500 00011340 7C 1F 00 50 */ subf r0, r31, r0
|
|
/* 80015504 00011344 90 1E 00 10 */ stw r0, 0x10(r30)
|
|
/* 80015508 00011348 4B FF FD ED */ bl MWExitCriticalSection
|
|
/* 8001550C 0001134C 38 60 00 00 */ li r3, 0x0
|
|
.global lbl_80015510
|
|
lbl_80015510:
|
|
/* 80015510 00011350 80 01 00 24 */ lwz r0, 0x24(r1)
|
|
/* 80015514 00011354 83 E1 00 1C */ lwz r31, 0x1c(r1)
|
|
/* 80015518 00011358 83 C1 00 18 */ lwz r30, 0x18(r1)
|
|
/* 8001551C 0001135C 83 A1 00 14 */ lwz r29, 0x14(r1)
|
|
/* 80015520 00011360 83 81 00 10 */ lwz r28, 0x10(r1)
|
|
/* 80015524 00011364 7C 08 03 A6 */ mtlr r0
|
|
/* 80015528 00011368 38 21 00 20 */ addi r1, r1, 0x20
|
|
/* 8001552C 0001136C 4E 80 00 20 */ blr
|