donut-decomp/asm/libnw4r_snd/snd_WaveFile.s

190 lines
9.1 KiB
ArmAsm
Raw Permalink Normal View History

2022-10-16 16:05:58 +00:00
.include "macros.inc"
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
2022-10-16 16:31:36 +00:00
.global __ct__Q44nw4r3snd6detail14WaveFileReaderFPCQ54nw4r3snd6detail8WaveFile10FileHeader
__ct__Q44nw4r3snd6detail14WaveFileReaderFPCQ54nw4r3snd6detail8WaveFile10FileHeader:
2022-10-16 16:05:58 +00:00
/* 8011D270 001190B0 80 04 00 10 */ lwz r0, 0x10(r4)
/* 8011D274 001190B4 38 A0 00 00 */ li r5, 0x0
/* 8011D278 001190B8 90 A3 00 00 */ stw r5, 0x0(r3)
/* 8011D27C 001190BC 7C 80 22 15 */ add. r4, r0, r4
/* 8011D280 001190C0 4D 82 00 20 */ beqlr
/* 8011D284 001190C4 38 04 00 08 */ addi r0, r4, 0x8
/* 8011D288 001190C8 90 03 00 00 */ stw r0, 0x0(r3)
/* 8011D28C 001190CC 4E 80 00 20 */ blr
2022-10-16 16:31:36 +00:00
.global ReadWaveInfo__Q44nw4r3snd6detail14WaveFileReaderCFPQ44nw4r3snd6detail8WaveInfoPCv
ReadWaveInfo__Q44nw4r3snd6detail14WaveFileReaderCFPQ44nw4r3snd6detail8WaveInfoPCv:
2022-10-16 16:05:58 +00:00
/* 8011D290 001190D0 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 8011D294 001190D4 7C 08 02 A6 */ mflr r0
/* 8011D298 001190D8 90 01 00 24 */ stw r0, 0x24(r1)
/* 8011D29C 001190DC 39 61 00 20 */ addi r11, r1, 0x20
/* 8011D2A0 001190E0 4B EE A0 9D */ bl lbl_8000733C
/* 8011D2A4 001190E4 80 C3 00 00 */ lwz r6, 0x0(r3)
/* 8011D2A8 001190E8 7C 7B 1B 78 */ mr r27, r3
/* 8011D2AC 001190EC 7C 9D 23 78 */ mr r29, r4
/* 8011D2B0 001190F0 7C BC 2B 78 */ mr r28, r5
/* 8011D2B4 001190F4 88 06 00 00 */ lbz r0, 0x0(r6)
/* 8011D2B8 001190F8 2C 00 00 02 */ cmpwi r0, 0x2
/* 8011D2BC 001190FC 41 82 00 18 */ beq lbl_8011D2D4
/* 8011D2C0 00119100 2C 00 00 01 */ cmpwi r0, 0x1
/* 8011D2C4 00119104 41 82 00 18 */ beq lbl_8011D2DC
/* 8011D2C8 00119108 2C 00 00 00 */ cmpwi r0, 0x0
/* 8011D2CC 0011910C 41 82 00 18 */ beq lbl_8011D2E4
/* 8011D2D0 00119110 48 00 00 1C */ b lbl_8011D2EC
.global lbl_8011D2D4
lbl_8011D2D4:
/* 8011D2D4 00119114 3B C0 00 03 */ li r30, 0x3
/* 8011D2D8 00119118 48 00 00 18 */ b lbl_8011D2F0
.global lbl_8011D2DC
lbl_8011D2DC:
/* 8011D2DC 0011911C 3B C0 00 01 */ li r30, 0x1
/* 8011D2E0 00119120 48 00 00 10 */ b lbl_8011D2F0
.global lbl_8011D2E4
lbl_8011D2E4:
/* 8011D2E4 00119124 3B C0 00 02 */ li r30, 0x2
/* 8011D2E8 00119128 48 00 00 08 */ b lbl_8011D2F0
.global lbl_8011D2EC
lbl_8011D2EC:
/* 8011D2EC 0011912C 3B C0 00 03 */ li r30, 0x3
.global lbl_8011D2F0
lbl_8011D2F0:
/* 8011D2F0 00119130 93 C4 00 00 */ stw r30, 0x0(r4)
/* 8011D2F4 00119134 7F C5 F3 78 */ mr r5, r30
/* 8011D2F8 00119138 80 C3 00 00 */ lwz r6, 0x0(r3)
/* 8011D2FC 0011913C 88 06 00 02 */ lbz r0, 0x2(r6)
/* 8011D300 00119140 90 04 00 08 */ stw r0, 0x8(r4)
/* 8011D304 00119144 80 E3 00 00 */ lwz r7, 0x0(r3)
/* 8011D308 00119148 88 C7 00 03 */ lbz r6, 0x3(r7)
/* 8011D30C 0011914C A0 07 00 04 */ lhz r0, 0x4(r7)
/* 8011D310 00119150 54 C6 80 1E */ slwi r6, r6, 16
/* 8011D314 00119154 7C 06 02 14 */ add r0, r6, r0
/* 8011D318 00119158 90 04 00 0C */ stw r0, 0xc(r4)
/* 8011D31C 0011915C 80 C3 00 00 */ lwz r6, 0x0(r3)
/* 8011D320 00119160 38 60 00 00 */ li r3, 0x0
/* 8011D324 00119164 88 C6 00 01 */ lbz r6, 0x1(r6)
/* 8011D328 00119168 7C 06 00 D0 */ neg r0, r6
/* 8011D32C 0011916C 7C 00 33 78 */ or r0, r0, r6
/* 8011D330 00119170 54 00 0F FE */ srwi r0, r0, 31
/* 8011D334 00119174 98 04 00 04 */ stb r0, 0x4(r4)
/* 8011D338 00119178 80 9B 00 00 */ lwz r4, 0x0(r27)
/* 8011D33C 0011917C 80 84 00 08 */ lwz r4, 0x8(r4)
2022-10-16 16:31:36 +00:00
/* 8011D340 00119180 4B FE 48 01 */ bl GetSampleByDspAddress__Q44nw4r3snd6detail7AxVoiceFPCvUlQ34nw4r3snd12SampleFormat
2022-10-16 16:05:58 +00:00
/* 8011D344 00119184 90 7D 00 10 */ stw r3, 0x10(r29)
/* 8011D348 00119188 7F C5 F3 78 */ mr r5, r30
/* 8011D34C 0011918C 38 60 00 00 */ li r3, 0x0
/* 8011D350 00119190 80 9B 00 00 */ lwz r4, 0x0(r27)
/* 8011D354 00119194 80 84 00 0C */ lwz r4, 0xc(r4)
2022-10-16 16:31:36 +00:00
/* 8011D358 00119198 4B FE 47 E9 */ bl GetSampleByDspAddress__Q44nw4r3snd6detail7AxVoiceFPCvUlQ34nw4r3snd12SampleFormat
2022-10-16 16:05:58 +00:00
/* 8011D35C 0011919C 38 03 00 01 */ addi r0, r3, 0x1
/* 8011D360 001191A0 90 1D 00 14 */ stw r0, 0x14(r29)
/* 8011D364 001191A4 3B FD 00 18 */ addi r31, r29, 0x18
/* 8011D368 001191A8 3B A0 00 00 */ li r29, 0x0
/* 8011D36C 001191AC 80 7B 00 00 */ lwz r3, 0x0(r27)
/* 8011D370 001191B0 80 03 00 10 */ lwz r0, 0x10(r3)
/* 8011D374 001191B4 7F C0 1A 14 */ add r30, r0, r3
/* 8011D378 001191B8 48 00 00 B8 */ b lbl_8011D430
.global lbl_8011D37C
lbl_8011D37C:
/* 8011D37C 001191BC 2C 1D 00 02 */ cmpwi r29, 0x2
/* 8011D380 001191C0 40 80 00 A4 */ bge lbl_8011D424
/* 8011D384 001191C4 80 1E 00 00 */ lwz r0, 0x0(r30)
/* 8011D388 001191C8 7C 80 1A 14 */ add r4, r0, r3
/* 8011D38C 001191CC 80 04 00 04 */ lwz r0, 0x4(r4)
/* 8011D390 001191D0 2C 00 00 00 */ cmpwi r0, 0x0
/* 8011D394 001191D4 41 82 00 80 */ beq lbl_8011D414
/* 8011D398 001191D8 7C A0 1A 14 */ add r5, r0, r3
/* 8011D39C 001191DC 80 05 00 04 */ lwz r0, 0x4(r5)
/* 8011D3A0 001191E0 80 65 00 00 */ lwz r3, 0x0(r5)
/* 8011D3A4 001191E4 90 7F 00 04 */ stw r3, 0x4(r31)
/* 8011D3A8 001191E8 90 1F 00 08 */ stw r0, 0x8(r31)
/* 8011D3AC 001191EC 80 05 00 0C */ lwz r0, 0xc(r5)
/* 8011D3B0 001191F0 80 65 00 08 */ lwz r3, 0x8(r5)
/* 8011D3B4 001191F4 90 7F 00 0C */ stw r3, 0xc(r31)
/* 8011D3B8 001191F8 90 1F 00 10 */ stw r0, 0x10(r31)
/* 8011D3BC 001191FC 80 05 00 14 */ lwz r0, 0x14(r5)
/* 8011D3C0 00119200 80 65 00 10 */ lwz r3, 0x10(r5)
/* 8011D3C4 00119204 90 7F 00 14 */ stw r3, 0x14(r31)
/* 8011D3C8 00119208 90 1F 00 18 */ stw r0, 0x18(r31)
/* 8011D3CC 0011920C 80 05 00 1C */ lwz r0, 0x1c(r5)
/* 8011D3D0 00119210 80 65 00 18 */ lwz r3, 0x18(r5)
/* 8011D3D4 00119214 90 7F 00 1C */ stw r3, 0x1c(r31)
/* 8011D3D8 00119218 90 1F 00 20 */ stw r0, 0x20(r31)
/* 8011D3DC 0011921C A0 05 00 20 */ lhz r0, 0x20(r5)
/* 8011D3E0 00119220 B0 1F 00 24 */ sth r0, 0x24(r31)
/* 8011D3E4 00119224 A0 05 00 22 */ lhz r0, 0x22(r5)
/* 8011D3E8 00119228 B0 1F 00 26 */ sth r0, 0x26(r31)
/* 8011D3EC 0011922C A0 05 00 24 */ lhz r0, 0x24(r5)
/* 8011D3F0 00119230 B0 1F 00 28 */ sth r0, 0x28(r31)
/* 8011D3F4 00119234 A0 05 00 26 */ lhz r0, 0x26(r5)
/* 8011D3F8 00119238 B0 1F 00 2A */ sth r0, 0x2a(r31)
/* 8011D3FC 0011923C A0 05 00 28 */ lhz r0, 0x28(r5)
/* 8011D400 00119240 B0 1F 00 2C */ sth r0, 0x2c(r31)
/* 8011D404 00119244 A0 05 00 2A */ lhz r0, 0x2a(r5)
/* 8011D408 00119248 B0 1F 00 2E */ sth r0, 0x2e(r31)
/* 8011D40C 0011924C A0 05 00 2C */ lhz r0, 0x2c(r5)
/* 8011D410 00119250 B0 1F 00 30 */ sth r0, 0x30(r31)
.global lbl_8011D414
lbl_8011D414:
/* 8011D414 00119254 7F 63 DB 78 */ mr r3, r27
/* 8011D418 00119258 7F 85 E3 78 */ mr r5, r28
2022-10-16 16:31:36 +00:00
/* 8011D41C 0011925C 48 00 00 45 */ bl GetWaveDataAddress__Q44nw4r3snd6detail14WaveFileReaderCFPCQ54nw4r3snd6detail8WaveFile15WaveChannelInfoPCv
2022-10-16 16:05:58 +00:00
/* 8011D420 00119260 90 7F 00 00 */ stw r3, 0x0(r31)
.global lbl_8011D424
lbl_8011D424:
/* 8011D424 00119264 3B FF 00 34 */ addi r31, r31, 0x34
/* 8011D428 00119268 3B DE 00 04 */ addi r30, r30, 0x4
/* 8011D42C 0011926C 3B BD 00 01 */ addi r29, r29, 0x1
.global lbl_8011D430
lbl_8011D430:
/* 8011D430 00119270 80 7B 00 00 */ lwz r3, 0x0(r27)
/* 8011D434 00119274 88 03 00 02 */ lbz r0, 0x2(r3)
/* 8011D438 00119278 7C 1D 00 00 */ cmpw r29, r0
/* 8011D43C 0011927C 41 80 FF 40 */ blt lbl_8011D37C
/* 8011D440 00119280 39 61 00 20 */ addi r11, r1, 0x20
/* 8011D444 00119284 38 60 00 01 */ li r3, 0x1
/* 8011D448 00119288 4B EE 9F 41 */ bl lbl_80007388
/* 8011D44C 0011928C 80 01 00 24 */ lwz r0, 0x24(r1)
/* 8011D450 00119290 7C 08 03 A6 */ mtlr r0
/* 8011D454 00119294 38 21 00 20 */ addi r1, r1, 0x20
/* 8011D458 00119298 4E 80 00 20 */ blr
/* 8011D45C 0011929C 00 00 00 00 */ .4byte 0x00000000
2022-10-16 16:31:36 +00:00
.global GetWaveDataAddress__Q44nw4r3snd6detail14WaveFileReaderCFPCQ54nw4r3snd6detail8WaveFile15WaveChannelInfoPCv
GetWaveDataAddress__Q44nw4r3snd6detail14WaveFileReaderCFPCQ54nw4r3snd6detail8WaveFile15WaveChannelInfoPCv:
2022-10-16 16:05:58 +00:00
/* 8011D460 001192A0 2C 05 00 00 */ cmpwi r5, 0x0
/* 8011D464 001192A4 7C A0 00 34 */ cntlzw r0, r5
/* 8011D468 001192A8 54 06 D9 7E */ srwi r6, r0, 5
/* 8011D46C 001192AC 40 82 00 08 */ bne lbl_8011D474
/* 8011D470 001192B0 80 A3 00 00 */ lwz r5, 0x0(r3)
.global lbl_8011D474
lbl_8011D474:
/* 8011D474 001192B4 80 63 00 00 */ lwz r3, 0x0(r3)
/* 8011D478 001192B8 88 03 00 06 */ lbz r0, 0x6(r3)
/* 8011D47C 001192BC 2C 00 00 00 */ cmpwi r0, 0x0
/* 8011D480 001192C0 41 82 00 10 */ beq lbl_8011D490
/* 8011D484 001192C4 2C 00 00 01 */ cmpwi r0, 0x1
/* 8011D488 001192C8 41 82 00 20 */ beq lbl_8011D4A8
/* 8011D48C 001192CC 48 00 00 24 */ b lbl_8011D4B0
.global lbl_8011D490
lbl_8011D490:
/* 8011D490 001192D0 80 03 00 14 */ lwz r0, 0x14(r3)
/* 8011D494 001192D4 2C 06 00 00 */ cmpwi r6, 0x0
/* 8011D498 001192D8 7C 60 2A 14 */ add r3, r0, r5
/* 8011D49C 001192DC 41 82 00 1C */ beq lbl_8011D4B8
/* 8011D4A0 001192E0 38 63 00 08 */ addi r3, r3, 0x8
/* 8011D4A4 001192E4 48 00 00 14 */ b lbl_8011D4B8
.global lbl_8011D4A8
lbl_8011D4A8:
/* 8011D4A8 001192E8 80 63 00 14 */ lwz r3, 0x14(r3)
/* 8011D4AC 001192EC 48 00 00 0C */ b lbl_8011D4B8
.global lbl_8011D4B0
lbl_8011D4B0:
/* 8011D4B0 001192F0 38 60 00 00 */ li r3, 0x0
/* 8011D4B4 001192F4 4E 80 00 20 */ blr
.global lbl_8011D4B8
lbl_8011D4B8:
/* 8011D4B8 001192F8 80 04 00 00 */ lwz r0, 0x0(r4)
/* 8011D4BC 001192FC 7C 60 1A 14 */ add r3, r0, r3
/* 8011D4C0 00119300 4E 80 00 20 */ blr
/* 8011D4C4 00119304 00 00 00 00 */ .4byte 0x00000000
/* 8011D4C8 00119308 00 00 00 00 */ .4byte 0x00000000
/* 8011D4CC 0011930C 00 00 00 00 */ .4byte 0x00000000