More audio stuff (#488)

* Match create_next_audio_frame_task

Required some variable renaming and other changes

* Match synthesis_execute

I'm not entirly sure about the way we have stuff ifdef'd in
 PR/abi.h. I feel like we're doing something slightly wrong there


* Match synthesis_do_one_audio_update

There's something super fucked with the way our ifdef's work in
 abi.h. It is going to demand a lot more attention sometime in the
 future.

* Rename a couple functions

Also had to hack up the ABI file a bit. I'm convinced that we
 don't need nor want to have the EU/Shindou/US split thing the
 SM64 code does. There's probably just the 1 ABI version being
 used and we need to figure out what it looks like

Signed-off-by: Taggerung <tyler.taggerung@email.com>
This commit is contained in:
Tyler McGavran 2023-11-07 22:38:25 -05:00 committed by GitHub
parent f75460cb8b
commit cbe41239d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 217 additions and 1178 deletions

View File

@ -71,8 +71,8 @@ glabel audio_init
/* BCDC4 800BC1C4 0044082B */ sltu $at, $v0, $a0
/* BCDC8 800BC1C8 1420FFFD */ bnez $at, .L800BC1C0
/* BCDCC 800BC1CC A443FFFE */ sh $v1, -0x2($v0)
/* BCDD0 800BC1D0 3C0F803B */ lui $t7, %hi(gAudioUpdatesPerFrame)
/* BCDD4 800BC1D4 25EF70B8 */ addiu $t7, $t7, %lo(gAudioUpdatesPerFrame)
/* BCDD0 800BC1D0 3C0F803B */ lui $t7, %hi(gAudioFrameCount)
/* BCDD4 800BC1D4 25EF70B8 */ addiu $t7, $t7, %lo(gAudioFrameCount)
/* BCDD8 800BC1D8 ADE00000 */ sw $zero, 0x0($t7)
/* BCDDC 800BC1DC 3C01803B */ lui $at, %hi(gAudioTaskIndex)
/* BCDE0 800BC1E0 AC2070C0 */ sw $zero, %lo(gAudioTaskIndex)($at)

View File

@ -110,8 +110,8 @@ glabel audio_init
/* 0BCE30 800BC230 0044082B */ sltu $at, $v0, $a0
/* 0BCE34 800BC234 1420FFFD */ bnez $at, .L800BC22C
/* 0BCE38 800BC238 A443FFFE */ sh $v1, -2($v0)
/* 0BCE3C 800BC23C 3C18803B */ lui $t8, %hi(gAudioUpdatesPerFrame) # $t8, 0x803b
/* 0BCE40 800BC240 271870B8 */ addiu $t8, %lo(gAudioUpdatesPerFrame) # addiu $t8, $t8, 0x70b8
/* 0BCE3C 800BC23C 3C18803B */ lui $t8, %hi(gAudioFrameCount) # $t8, 0x803b
/* 0BCE40 800BC240 271870B8 */ addiu $t8, %lo(gAudioFrameCount) # addiu $t8, $t8, 0x70b8
/* 0BCE44 800BC244 AF000000 */ sw $zero, ($t8)
/* 0BCE48 800BC248 3C01803B */ lui $at, %hi(gAudioTaskIndex) # $at, 0x803b
/* 0BCE4C 800BC24C AC2070C0 */ sw $zero, %lo(gAudioTaskIndex)($at)

View File

@ -1,338 +0,0 @@
glabel create_next_audio_frame_task
/* 0CBF30 800CB330 3C03803B */ lui $v1, %hi(gAudioUpdatesPerFrame) # $v1, 0x803b
/* 0CBF34 800CB334 246370B8 */ addiu $v1, %lo(gAudioUpdatesPerFrame) # addiu $v1, $v1, 0x70b8
/* 0CBF38 800CB338 8C620000 */ lw $v0, ($v1)
/* 0CBF3C 800CB33C 3C18803B */ lui $t8, %hi(gAudioBufferParameters) # $t8, 0x803b
/* 0CBF40 800CB340 27BDFF88 */ addiu $sp, $sp, -0x78
/* 0CBF44 800CB344 244E0001 */ addiu $t6, $v0, 1
/* 0CBF48 800CB348 AC6E0000 */ sw $t6, ($v1)
/* 0CBF4C 800CB34C 8C6F0000 */ lw $t7, ($v1)
/* 0CBF50 800CB350 87187088 */ lh $t8, %lo(gAudioBufferParameters)($t8)
/* 0CBF54 800CB354 AFBE0030 */ sw $fp, 0x30($sp)
/* 0CBF58 800CB358 03A0F025 */ move $fp, $sp
/* 0CBF5C 800CB35C 01F8001A */ div $zero, $t7, $t8
/* 0CBF60 800CB360 0000C810 */ mfhi $t9
/* 0CBF64 800CB364 AFBF0034 */ sw $ra, 0x34($sp)
/* 0CBF68 800CB368 AFB2002C */ sw $s2, 0x2c($sp)
/* 0CBF6C 800CB36C AFB10028 */ sw $s1, 0x28($sp)
/* 0CBF70 800CB370 AFB00024 */ sw $s0, 0x24($sp)
/* 0CBF74 800CB374 17000002 */ bnez $t8, .L800CB380
/* 0CBF78 800CB378 00000000 */ nop
/* 0CBF7C 800CB37C 0007000D */ break 7
.L800CB380:
/* 0CBF80 800CB380 2401FFFF */ li $at, -1
/* 0CBF84 800CB384 17010004 */ bne $t8, $at, .L800CB398
/* 0CBF88 800CB388 3C018000 */ lui $at, 0x8000
/* 0CBF8C 800CB38C 15E10002 */ bne $t7, $at, .L800CB398
/* 0CBF90 800CB390 00000000 */ nop
/* 0CBF94 800CB394 0006000D */ break 6
.L800CB398:
/* 0CBF98 800CB398 3C04800F */ lui $a0, %hi(D_800EA3A8) # $a0, 0x800f
/* 0CBF9C 800CB39C 13200003 */ beqz $t9, .L800CB3AC
/* 0CBFA0 800CB3A0 00003025 */ move $a2, $zero
/* 0CBFA4 800CB3A4 10000114 */ b .L800CB7F8
/* 0CBFA8 800CB3A8 00001025 */ move $v0, $zero
.L800CB3AC:
/* 0CBFAC 800CB3AC 8C84A3A8 */ lw $a0, %lo(D_800EA3A8)($a0)
/* 0CBFB0 800CB3B0 0C033630 */ jal osSendMesg
/* 0CBFB4 800CB3B4 8C650000 */ lw $a1, ($v1)
/* 0CBFB8 800CB3B8 24030003 */ li $v1, 3
/* 0CBFBC 800CB3BC 3C04803B */ lui $a0, %hi(gCurrAiBufferIndex) # $a0, 0x803b
/* 0CBFC0 800CB3C0 248470C4 */ addiu $a0, %lo(gCurrAiBufferIndex) # addiu $a0, $a0, 0x70c4
/* 0CBFC4 800CB3C4 8C8A0000 */ lw $t2, ($a0)
/* 0CBFC8 800CB3C8 3C05803B */ lui $a1, %hi(gAudioTaskIndex) # $a1, 0x803b
/* 0CBFCC 800CB3CC 24A570C0 */ addiu $a1, %lo(gAudioTaskIndex) # addiu $a1, $a1, 0x70c0
/* 0CBFD0 800CB3D0 254B0001 */ addiu $t3, $t2, 1
/* 0CBFD4 800CB3D4 0163001A */ div $zero, $t3, $v1
/* 0CBFD8 800CB3D8 00006810 */ mfhi $t5
/* 0CBFDC 800CB3DC 25AF0001 */ addiu $t7, $t5, 1
/* 0CBFE0 800CB3E0 01606025 */ move $t4, $t3
/* 0CBFE4 800CB3E4 01E3001A */ div $zero, $t7, $v1
/* 0CBFE8 800CB3E8 8CA80000 */ lw $t0, ($a1)
/* 0CBFEC 800CB3EC AC8B0000 */ sw $t3, ($a0)
/* 0CBFF0 800CB3F0 00008010 */ mfhi $s0
/* 0CBFF4 800CB3F4 39090001 */ xori $t1, $t0, 1
/* 0CBFF8 800CB3F8 ACA90000 */ sw $t1, ($a1)
/* 0CBFFC 800CB3FC 14600002 */ bnez $v1, .L800CB408
/* 0CC000 800CB400 00000000 */ nop
/* 0CC004 800CB404 0007000D */ break 7
.L800CB408:
/* 0CC008 800CB408 2401FFFF */ li $at, -1
/* 0CC00C 800CB40C 14610004 */ bne $v1, $at, .L800CB420
/* 0CC010 800CB410 3C018000 */ lui $at, 0x8000
/* 0CC014 800CB414 15810002 */ bne $t4, $at, .L800CB420
/* 0CC018 800CB418 00000000 */ nop
/* 0CC01C 800CB41C 0006000D */ break 6
.L800CB420:
/* 0CC020 800CB420 AC8D0000 */ sw $t5, ($a0)
/* 0CC024 800CB424 01A07025 */ move $t6, $t5
/* 0CC028 800CB428 14600002 */ bnez $v1, .L800CB434
/* 0CC02C 800CB42C 00000000 */ nop
/* 0CC030 800CB430 0007000D */ break 7
.L800CB434:
/* 0CC034 800CB434 2401FFFF */ li $at, -1
/* 0CC038 800CB438 14610004 */ bne $v1, $at, .L800CB44C
/* 0CC03C 800CB43C 3C018000 */ lui $at, 0x8000
/* 0CC040 800CB440 15E10002 */ bne $t7, $at, .L800CB44C
/* 0CC044 800CB444 00000000 */ nop
/* 0CC048 800CB448 0006000D */ break 6
.L800CB44C:
/* 0CC04C 800CB44C 0C034438 */ jal osAiGetLength
/* 0CC050 800CB450 00000000 */ nop
/* 0CC054 800CB454 0002C082 */ srl $t8, $v0, 2
/* 0CC058 800CB458 0010C840 */ sll $t9, $s0, 1
/* 0CC05C 800CB45C 3C03803B */ lui $v1, %hi(gAiBufferLengths) # 0x803b
/* 0CC060 800CB460 AFD80074 */ sw $t8, 0x74($fp)
/* 0CC064 800CB464 00791821 */ addu $v1, $v1, $t9
/* 0CC068 800CB468 8463718C */ lh $v1, %lo(gAiBufferLengths)($v1) # 0x718c($v1)
/* 0CC06C 800CB46C 00104080 */ sll $t0, $s0, 2
/* 0CC070 800CB470 3C04803B */ lui $a0, %hi(gAiBuffers) # 0x803b
/* 0CC074 800CB474 10600004 */ beqz $v1, .L800CB488
/* 0CC078 800CB478 00882021 */ addu $a0, $a0, $t0
/* 0CC07C 800CB47C 8C847180 */ lw $a0, %lo(gAiBuffers)($a0) # 0x7180($a0)
/* 0CC080 800CB480 0C03443C */ jal osAiSetNextBuffer
/* 0CC084 800CB484 00032880 */ sll $a1, $v1, 2
.L800CB488:
/* 0CC088 800CB488 3C02803B */ lui $v0, %hi(gCurrAudioFrameDmaCount) # $v0, 0x803b
/* 0CC08C 800CB48C 8C5170BC */ lw $s1, %lo(gCurrAudioFrameDmaCount)($v0)
/* 0CC090 800CB490 3C12803B */ lui $s2, %hi(gCurrAudioFrameDmaQueue) # $s2, 0x803b
/* 0CC094 800CB494 26526008 */ addiu $s2, %lo(gCurrAudioFrameDmaQueue) # addiu $s2, $s2, 0x6008
/* 0CC098 800CB498 1A20000D */ blez $s1, .L800CB4D0
/* 0CC09C 800CB49C 00008025 */ move $s0, $zero
/* 0CC0A0 800CB4A0 02402025 */ move $a0, $s2
.L800CB4A4:
/* 0CC0A4 800CB4A4 00002825 */ move $a1, $zero
/* 0CC0A8 800CB4A8 0C0335D4 */ jal osRecvMesg
/* 0CC0AC 800CB4AC 00003025 */ move $a2, $zero
/* 0CC0B0 800CB4B0 14400002 */ bnez $v0, .L800CB4BC
/* 0CC0B4 800CB4B4 3C09803B */ lui $t1, %hi(gCurrAudioFrameDmaCount) # $t1, 0x803b
/* 0CC0B8 800CB4B8 2631FFFF */ addiu $s1, $s1, -1
.L800CB4BC:
/* 0CC0BC 800CB4BC 8D2970BC */ lw $t1, %lo(gCurrAudioFrameDmaCount)($t1)
/* 0CC0C0 800CB4C0 26100001 */ addiu $s0, $s0, 1
/* 0CC0C4 800CB4C4 0209082A */ slt $at, $s0, $t1
/* 0CC0C8 800CB4C8 5420FFF6 */ bnel $at, $zero, .L800CB4A4
/* 0CC0CC 800CB4CC 02402025 */ move $a0, $s2
.L800CB4D0:
/* 0CC0D0 800CB4D0 3C12803B */ lui $s2, %hi(gCurrAudioFrameDmaQueue) # $s2, 0x803b
/* 0CC0D4 800CB4D4 1220000A */ beqz $s1, .L800CB500
/* 0CC0D8 800CB4D8 26526008 */ addiu $s2, %lo(gCurrAudioFrameDmaQueue) # addiu $s2, $s2, 0x6008
/* 0CC0DC 800CB4DC 1A200008 */ blez $s1, .L800CB500
/* 0CC0E0 800CB4E0 00008025 */ move $s0, $zero
/* 0CC0E4 800CB4E4 02402025 */ move $a0, $s2
.L800CB4E8:
/* 0CC0E8 800CB4E8 00002825 */ move $a1, $zero
/* 0CC0EC 800CB4EC 0C0335D4 */ jal osRecvMesg
/* 0CC0F0 800CB4F0 24060001 */ li $a2, 1
/* 0CC0F4 800CB4F4 26100001 */ addiu $s0, $s0, 1
/* 0CC0F8 800CB4F8 5611FFFB */ bnel $s0, $s1, .L800CB4E8
/* 0CC0FC 800CB4FC 02402025 */ move $a0, $s2
.L800CB500:
/* 0CC100 800CB500 8E510008 */ lw $s1, 8($s2)
/* 0CC104 800CB504 1220000A */ beqz $s1, .L800CB530
/* 0CC108 800CB508 00000000 */ nop
/* 0CC10C 800CB50C 1A200008 */ blez $s1, .L800CB530
/* 0CC110 800CB510 00008025 */ move $s0, $zero
/* 0CC114 800CB514 02402025 */ move $a0, $s2
.L800CB518:
/* 0CC118 800CB518 00002825 */ move $a1, $zero
/* 0CC11C 800CB51C 0C0335D4 */ jal osRecvMesg
/* 0CC120 800CB520 00003025 */ move $a2, $zero
/* 0CC124 800CB524 26100001 */ addiu $s0, $s0, 1
/* 0CC128 800CB528 5611FFFB */ bnel $s0, $s1, .L800CB518
/* 0CC12C 800CB52C 02402025 */ move $a0, $s2
.L800CB530:
/* 0CC130 800CB530 3C01803B */ lui $at, %hi(gCurrAudioFrameDmaCount) # $at, 0x803b
/* 0CC134 800CB534 0C02EB01 */ jal decrease_sample_dma_ttls
/* 0CC138 800CB538 AC2070BC */ sw $zero, %lo(gCurrAudioFrameDmaCount)($at)
/* 0CC13C 800CB53C 3C04800F */ lui $a0, %hi(D_800EA3B0) # $a0, 0x800f
/* 0CC140 800CB540 8C84A3B0 */ lw $a0, %lo(D_800EA3B0)($a0)
/* 0CC144 800CB544 27C50058 */ addiu $a1, $fp, 0x58
/* 0CC148 800CB548 0C0335D4 */ jal osRecvMesg
/* 0CC14C 800CB54C 00003025 */ move $a2, $zero
/* 0CC150 800CB550 2401FFFF */ li $at, -1
/* 0CC154 800CB554 10410007 */ beq $v0, $at, .L800CB574
/* 0CC158 800CB558 3C10803B */ lui $s0, %hi(gAudioResetStatus) # $s0, 0x803b
/* 0CC15C 800CB55C 8FCA0058 */ lw $t2, 0x58($fp)
/* 0CC160 800CB560 3C01803B */ lui $at, %hi(gAudioResetPresetIdToLoad) # $at, 0x803b
/* 0CC164 800CB564 26100500 */ addiu $s0, %lo(gAudioResetStatus) # addiu $s0, $s0, 0x500
/* 0CC168 800CB568 240B0005 */ li $t3, 5
/* 0CC16C 800CB56C A02A0501 */ sb $t2, %lo(gAudioResetPresetIdToLoad)($at)
/* 0CC170 800CB570 A20B0000 */ sb $t3, ($s0)
.L800CB574:
/* 0CC174 800CB574 3C10803B */ lui $s0, %hi(gAudioResetStatus) # $s0, 0x803b
/* 0CC178 800CB578 26100500 */ addiu $s0, %lo(gAudioResetStatus) # addiu $s0, $s0, 0x500
/* 0CC17C 800CB57C 920C0000 */ lbu $t4, ($s0)
/* 0CC180 800CB580 1180000F */ beqz $t4, .L800CB5C0
/* 0CC184 800CB584 00000000 */ nop
/* 0CC188 800CB588 0C02E803 */ jal audio_shut_down_and_reset_step
/* 0CC18C 800CB58C 00000000 */ nop
/* 0CC190 800CB590 1440000B */ bnez $v0, .L800CB5C0
/* 0CC194 800CB594 00000000 */ nop
/* 0CC198 800CB598 920D0000 */ lbu $t5, ($s0)
/* 0CC19C 800CB59C 3C04800F */ lui $a0, %hi(D_800EA3B4) # $a0, 0x800f
/* 0CC1A0 800CB5A0 3C05803B */ lui $a1, %hi(gAudioResetPresetIdToLoad) # $a1, 0x803b
/* 0CC1A4 800CB5A4 15A00004 */ bnez $t5, .L800CB5B8
/* 0CC1A8 800CB5A8 00003025 */ move $a2, $zero
/* 0CC1AC 800CB5AC 8C84A3B4 */ lw $a0, %lo(D_800EA3B4)($a0)
/* 0CC1B0 800CB5B0 0C033630 */ jal osSendMesg
/* 0CC1B4 800CB5B4 90A50501 */ lbu $a1, %lo(gAudioResetPresetIdToLoad)($a1)
.L800CB5B8:
/* 0CC1B8 800CB5B8 1000008F */ b .L800CB7F8
/* 0CC1BC 800CB5BC 00001025 */ move $v0, $zero
.L800CB5C0:
/* 0CC1C0 800CB5C0 3C02803B */ lui $v0, %hi(gAudioTaskIndex) # $v0, 0x803b
/* 0CC1C4 800CB5C4 8C4270C0 */ lw $v0, %lo(gAudioTaskIndex)($v0)
/* 0CC1C8 800CB5C8 3C0F803B */ lui $t7, %hi(gAudioTasks) # $t7, 0x803b
/* 0CC1CC 800CB5CC 3C12803B */ lui $s2, %hi(gAudioTask) # $s2, 0x803b
/* 0CC1D0 800CB5D0 00027080 */ sll $t6, $v0, 2
/* 0CC1D4 800CB5D4 01C27021 */ addu $t6, $t6, $v0
/* 0CC1D8 800CB5D8 000E7100 */ sll $t6, $t6, 4
/* 0CC1DC 800CB5DC 25EF70D8 */ addiu $t7, %lo(gAudioTasks) # addiu $t7, $t7, 0x70d8
/* 0CC1E0 800CB5E0 265270D4 */ addiu $s2, %lo(gAudioTask) # addiu $s2, $s2, 0x70d4
/* 0CC1E4 800CB5E4 01CFC021 */ addu $t8, $t6, $t7
/* 0CC1E8 800CB5E8 AE580000 */ sw $t8, ($s2)
/* 0CC1EC 800CB5EC 3C08803B */ lui $t0, %hi(gAudioCmdBuffers) # 0x803b
/* 0CC1F0 800CB5F0 3C10803B */ lui $s0, %hi(gCurrAiBufferIndex) # $s0, 0x803b
/* 0CC1F4 800CB5F4 0002C880 */ sll $t9, $v0, 2
/* 0CC1F8 800CB5F8 8E1070C4 */ lw $s0, %lo(gCurrAiBufferIndex)($s0)
/* 0CC1FC 800CB5FC 01194021 */ addu $t0, $t0, $t9
/* 0CC200 800CB600 8D0870C8 */ lw $t0, %lo(gAudioCmdBuffers)($t0) # 0x70c8($t0)
/* 0CC204 800CB604 3C0A803B */ lui $t2, %hi(gAiBuffers) # $t2, 0x803b
/* 0CC208 800CB608 3C01803B */ lui $at, %hi(gAudioCmd) # $at, 0x803b
/* 0CC20C 800CB60C 254A7180 */ addiu $t2, %lo(gAiBuffers) # addiu $t2, $t2, 0x7180
/* 0CC210 800CB610 00104880 */ sll $t1, $s0, 2
/* 0CC214 800CB614 012A3821 */ addu $a3, $t1, $t2
/* 0CC218 800CB618 AC2870D0 */ sw $t0, %lo(gAudioCmd)($at)
/* 0CC21C 800CB61C 8CEB0000 */ lw $t3, ($a3)
/* 0CC220 800CB620 3C05803B */ lui $a1, %hi(gAudioBufferParameters) # $a1, 0x803b
/* 0CC224 800CB624 24A57088 */ addiu $a1, %lo(gAudioBufferParameters) # addiu $a1, $a1, 0x7088
/* 0CC228 800CB628 AFCB0060 */ sw $t3, 0x60($fp)
/* 0CC22C 800CB62C 84AE0006 */ lh $t6, 6($a1)
/* 0CC230 800CB630 8FCF0074 */ lw $t7, 0x74($fp)
/* 0CC234 800CB634 3C0D803B */ lui $t5, %hi(gAiBufferLengths) # $t5, 0x803b
/* 0CC238 800CB638 25AD718C */ addiu $t5, %lo(gAiBufferLengths) # addiu $t5, $t5, 0x718c
/* 0CC23C 800CB63C 01CFC023 */ subu $t8, $t6, $t7
/* 0CC240 800CB640 27190040 */ addiu $t9, $t8, 0x40
/* 0CC244 800CB644 3328FFF0 */ andi $t0, $t9, 0xfff0
/* 0CC248 800CB648 00106040 */ sll $t4, $s0, 1
/* 0CC24C 800CB64C 018D8821 */ addu $s1, $t4, $t5
/* 0CC250 800CB650 25090010 */ addiu $t1, $t0, 0x10
/* 0CC254 800CB654 A6290000 */ sh $t1, ($s1)
/* 0CC258 800CB658 86230000 */ lh $v1, ($s1)
/* 0CC25C 800CB65C 84A4000A */ lh $a0, 0xa($a1)
/* 0CC260 800CB660 00003025 */ move $a2, $zero
/* 0CC264 800CB664 0064082A */ slt $at, $v1, $a0
/* 0CC268 800CB668 50200004 */ beql $at, $zero, .L800CB67C
/* 0CC26C 800CB66C 84A20008 */ lh $v0, 8($a1)
/* 0CC270 800CB670 A6240000 */ sh $a0, ($s1)
/* 0CC274 800CB674 86230000 */ lh $v1, ($s1)
/* 0CC278 800CB678 84A20008 */ lh $v0, 8($a1)
.L800CB67C:
/* 0CC27C 800CB67C 27C50054 */ addiu $a1, $fp, 0x54
/* 0CC280 800CB680 3C04800F */ lui $a0, %hi(D_800EA3AC) # $a0, 0x800f
/* 0CC284 800CB684 0043082A */ slt $at, $v0, $v1
/* 0CC288 800CB688 10200002 */ beqz $at, .L800CB694
/* 0CC28C 800CB68C 00000000 */ nop
/* 0CC290 800CB690 A6220000 */ sh $v0, ($s1)
.L800CB694:
/* 0CC294 800CB694 8C84A3AC */ lw $a0, %lo(D_800EA3AC)($a0)
/* 0CC298 800CB698 0C0335D4 */ jal osRecvMesg
/* 0CC29C 800CB69C AFC70040 */ sw $a3, 0x40($fp)
/* 0CC2A0 800CB6A0 3C10803B */ lui $s0, %hi(gAudioCmd) # $s0, 0x803b
/* 0CC2A4 800CB6A4 2401FFFF */ li $at, -1
/* 0CC2A8 800CB6A8 10410003 */ beq $v0, $at, .L800CB6B8
/* 0CC2AC 800CB6AC 261070D0 */ addiu $s0, %lo(gAudioCmd) # addiu $s0, $s0, 0x70d0
/* 0CC2B0 800CB6B0 0C032F2C */ jal func_800CBCB0
/* 0CC2B4 800CB6B4 8FC40054 */ lw $a0, 0x54($fp)
.L800CB6B8:
/* 0CC2B8 800CB6B8 8E040000 */ lw $a0, ($s0)
/* 0CC2BC 800CB6BC 27C50070 */ addiu $a1, $fp, 0x70
/* 0CC2C0 800CB6C0 8FC60060 */ lw $a2, 0x60($fp)
/* 0CC2C4 800CB6C4 0C02DC3B */ jal func_800B70EC
/* 0CC2C8 800CB6C8 86270000 */ lh $a3, ($s1)
/* 0CC2CC 800CB6CC 0C034468 */ jal osGetCount
/* 0CC2D0 800CB6D0 AE020000 */ sw $v0, ($s0)
/* 0CC2D4 800CB6D4 3C04803B */ lui $a0, %hi(gAudioRandom) # $a0, 0x803b
/* 0CC2D8 800CB6D8 3C07803B */ lui $a3, %hi(gAudioUpdatesPerFrame) # $a3, 0x803b
/* 0CC2DC 800CB6DC 24E770B8 */ addiu $a3, %lo(gAudioUpdatesPerFrame) # addiu $a3, $a3, 0x70b8
/* 0CC2E0 800CB6E0 24847194 */ addiu $a0, %lo(gAudioRandom) # addiu $a0, $a0, 0x7194
/* 0CC2E4 800CB6E4 8C8A0000 */ lw $t2, ($a0)
/* 0CC2E8 800CB6E8 8CEB0000 */ lw $t3, ($a3)
/* 0CC2EC 800CB6EC 8CF80000 */ lw $t8, ($a3)
/* 0CC2F0 800CB6F0 3C10803B */ lui $s0, %hi(gAudioTaskIndex) # $s0, 0x803b
/* 0CC2F4 800CB6F4 014B6021 */ addu $t4, $t2, $t3
/* 0CC2F8 800CB6F8 004C0019 */ multu $v0, $t4
/* 0CC2FC 800CB6FC 331900FF */ andi $t9, $t8, 0xff
/* 0CC300 800CB700 00194040 */ sll $t0, $t9, 1
/* 0CC304 800CB704 3C06800F */ lui $a2, %hi(aspMainDataStart) # $a2, 0x800f
/* 0CC308 800CB708 24C64D00 */ addiu $a2, %lo(aspMainDataStart) # addiu $a2, $a2, 0x4d00
/* 0CC30C 800CB70C 3C05800E */ lui $a1, %hi(rspbootTextStart) # $a1, 0x800e
/* 0CC310 800CB710 24180002 */ li $t8, 2
/* 0CC314 800CB714 3C19800E */ lui $t9, %hi(rspbootTextEnd) # $t9, 0x800e
/* 0CC318 800CB718 24A58F70 */ addiu $a1, %lo(rspbootTextStart) # addiu $a1, $a1, -0x7090
/* 0CC31C 800CB71C 27399040 */ addiu $t9, %lo(rspbootTextEnd) # addiu $t9, $t9, -0x6fc0
/* 0CC320 800CB720 00006812 */ mflo $t5
/* 0CC324 800CB724 AC8D0000 */ sw $t5, ($a0)
/* 0CC328 800CB728 8FCE0040 */ lw $t6, 0x40($fp)
/* 0CC32C 800CB72C 8C8B0000 */ lw $t3, ($a0)
/* 0CC330 800CB730 8E4D0000 */ lw $t5, ($s2)
/* 0CC334 800CB734 8DCF0000 */ lw $t7, ($t6)
/* 0CC338 800CB738 01E84821 */ addu $t1, $t7, $t0
/* 0CC33C 800CB73C 852A0000 */ lh $t2, ($t1)
/* 0CC340 800CB740 3C08800E */ lui $t0, %hi(aspMainTextStart) # $t0, 0x800e
/* 0CC344 800CB744 03257823 */ subu $t7, $t9, $a1
/* 0CC348 800CB748 014B6021 */ addu $t4, $t2, $t3
/* 0CC34C 800CB74C AC8C0000 */ sw $t4, ($a0)
/* 0CC350 800CB750 8E1070C0 */ lw $s0, %lo(gAudioTaskIndex)($s0)
/* 0CC354 800CB754 ADA00040 */ sw $zero, 0x40($t5)
/* 0CC358 800CB758 8E4E0000 */ lw $t6, ($s2)
/* 0CC35C 800CB75C 3C0A800F */ lui $t2, %hi(aspMainDataEnd) # $t2, 0x800f
/* 0CC360 800CB760 254A5000 */ addiu $t2, %lo(aspMainDataEnd) # addiu $t2, $t2, 0x5000
/* 0CC364 800CB764 ADC00044 */ sw $zero, 0x44($t6)
/* 0CC368 800CB768 8E430000 */ lw $v1, ($s2)
/* 0CC36C 800CB76C 01465823 */ subu $t3, $t2, $a2
/* 0CC370 800CB770 000B60C3 */ sra $t4, $t3, 3
/* 0CC374 800CB774 AC780000 */ sw $t8, ($v1)
/* 0CC378 800CB778 2508B830 */ addiu $t0, %lo(aspMainTextStart) # addiu $t0, $t0, -0x47d0
/* 0CC37C 800CB77C 24091000 */ li $t1, 4096
/* 0CC380 800CB780 000C68C0 */ sll $t5, $t4, 3
/* 0CC384 800CB784 3C18803B */ lui $t8, %hi(gAudioCmdBuffers) # 0x803b
/* 0CC388 800CB788 00107080 */ sll $t6, $s0, 2
/* 0CC38C 800CB78C 030EC021 */ addu $t8, $t8, $t6
/* 0CC390 800CB790 AC600004 */ sw $zero, 4($v1)
/* 0CC394 800CB794 AC650008 */ sw $a1, 8($v1)
/* 0CC398 800CB798 AC6F000C */ sw $t7, 0xc($v1)
/* 0CC39C 800CB79C AC680010 */ sw $t0, 0x10($v1)
/* 0CC3A0 800CB7A0 AC660018 */ sw $a2, 0x18($v1)
/* 0CC3A4 800CB7A4 AC690014 */ sw $t1, 0x14($v1)
/* 0CC3A8 800CB7A8 AC6D001C */ sw $t5, 0x1c($v1)
/* 0CC3AC 800CB7AC AC600020 */ sw $zero, 0x20($v1)
/* 0CC3B0 800CB7B0 AC600024 */ sw $zero, 0x24($v1)
/* 0CC3B4 800CB7B4 AC600028 */ sw $zero, 0x28($v1)
/* 0CC3B8 800CB7B8 AC60002C */ sw $zero, 0x2c($v1)
/* 0CC3BC 800CB7BC 8F1870C8 */ lw $t8, %lo(gAudioCmdBuffers)($t8) # 0x70c8($t8)
/* 0CC3C0 800CB7C0 3C08800F */ lui $t0, %hi(D_800EA484) # $t0, 0x800f
/* 0CC3C4 800CB7C4 AC780030 */ sw $t8, 0x30($v1)
/* 0CC3C8 800CB7C8 8FD90070 */ lw $t9, 0x70($fp)
/* 0CC3CC 800CB7CC AC600038 */ sw $zero, 0x38($v1)
/* 0CC3D0 800CB7D0 AC60003C */ sw $zero, 0x3c($v1)
/* 0CC3D4 800CB7D4 001978C0 */ sll $t7, $t9, 3
/* 0CC3D8 800CB7D8 AC6F0034 */ sw $t7, 0x34($v1)
/* 0CC3DC 800CB7DC 8FC90070 */ lw $t1, 0x70($fp)
/* 0CC3E0 800CB7E0 8D08A484 */ lw $t0, %lo(D_800EA484)($t0)
/* 0CC3E4 800CB7E4 0109082A */ slt $at, $t0, $t1
/* 0CC3E8 800CB7E8 10200002 */ beqz $at, .L800CB7F4
/* 0CC3EC 800CB7EC 3C01800F */ lui $at, %hi(D_800EA484) # $at, 0x800f
/* 0CC3F0 800CB7F0 AC29A484 */ sw $t1, %lo(D_800EA484)($at)
.L800CB7F4:
/* 0CC3F4 800CB7F4 8E420000 */ lw $v0, ($s2)
.L800CB7F8:
/* 0CC3F8 800CB7F8 8FDF0034 */ lw $ra, 0x34($fp)
/* 0CC3FC 800CB7FC 03C0E825 */ move $sp, $fp
/* 0CC400 800CB800 8FD00024 */ lw $s0, 0x24($fp)
/* 0CC404 800CB804 8FD10028 */ lw $s1, 0x28($fp)
/* 0CC408 800CB808 8FD2002C */ lw $s2, 0x2c($fp)
/* 0CC40C 800CB80C 8FDE0030 */ lw $fp, 0x30($fp)
/* 0CC410 800CB810 03E00008 */ jr $ra
/* 0CC414 800CB814 27BD0078 */ addiu $sp, $sp, 0x78

View File

@ -1,150 +0,0 @@
glabel func_800B70EC
/* 0B7CEC 800B70EC 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 0B7CF0 800B70F0 AFB5002C */ sw $s5, 0x2c($sp)
/* 0B7CF4 800B70F4 3C15803B */ lui $s5, %hi(gAudioBufferParameters) # $s5, 0x803b
/* 0B7CF8 800B70F8 26B57088 */ addiu $s5, %lo(gAudioBufferParameters) # addiu $s5, $s5, 0x7088
/* 0B7CFC 800B70FC AFB40028 */ sw $s4, 0x28($sp)
/* 0B7D00 800B7100 86B4000C */ lh $s4, 0xc($s5)
/* 0B7D04 800B7104 AFB60030 */ sw $s6, 0x30($sp)
/* 0B7D08 800B7108 AFB1001C */ sw $s1, 0x1c($sp)
/* 0B7D0C 800B710C 00C08825 */ move $s1, $a2
/* 0B7D10 800B7110 00E0B025 */ move $s6, $a3
/* 0B7D14 800B7114 AFBF003C */ sw $ra, 0x3c($sp)
/* 0B7D18 800B7118 AFBE0038 */ sw $fp, 0x38($sp)
/* 0B7D1C 800B711C AFB70034 */ sw $s7, 0x34($sp)
/* 0B7D20 800B7120 AFB30024 */ sw $s3, 0x24($sp)
/* 0B7D24 800B7124 AFB20020 */ sw $s2, 0x20($sp)
/* 0B7D28 800B7128 AFB00018 */ sw $s0, 0x18($sp)
/* 0B7D2C 800B712C AFA40040 */ sw $a0, 0x40($sp)
/* 0B7D30 800B7130 1A800009 */ blez $s4, .L800B7158
/* 0B7D34 800B7134 AFA50044 */ sw $a1, 0x44($sp)
.L800B7138:
/* 0B7D38 800B7138 2690FFFF */ addiu $s0, $s4, -1
/* 0B7D3C 800B713C 0C03044E */ jal process_sequences
/* 0B7D40 800B7140 02002025 */ move $a0, $s0
/* 0B7D44 800B7144 86AE000C */ lh $t6, 0xc($s5)
/* 0B7D48 800B7148 0C02DC0D */ jal synthesis_load_note_subs_eu
/* 0B7D4C 800B714C 01D42023 */ subu $a0, $t6, $s4
/* 0B7D50 800B7150 1E00FFF9 */ bgtz $s0, .L800B7138
/* 0B7D54 800B7154 0200A025 */ move $s4, $s0
.L800B7158:
/* 0B7D58 800B7158 8FAF0040 */ lw $t7, 0x40($sp)
/* 0B7D5C 800B715C 3C180700 */ lui $t8, 0x700
/* 0B7D60 800B7160 0220B825 */ move $s7, $s1
/* 0B7D64 800B7164 ADF80000 */ sw $t8, ($t7)
/* 0B7D68 800B7168 ADE00004 */ sw $zero, 4($t7)
/* 0B7D6C 800B716C 86B4000C */ lh $s4, 0xc($s5)
/* 0B7D70 800B7170 01E01025 */ move $v0, $t7
/* 0B7D74 800B7174 25FE0008 */ addiu $fp, $t7, 8
/* 0B7D78 800B7178 1A80003D */ blez $s4, .L800B7270
.L800B717C:
/* 0B7D7C 800B717C 24010001 */ li $at, 1
/* 0B7D80 800B7180 86B2000C */ lh $s2, 0xc($s5)
/* 0B7D84 800B7184 16810003 */ bne $s4, $at, .L800B7194
/* 0B7D88 800B7188 00008825 */ move $s1, $zero
/* 0B7D8C 800B718C 10000019 */ b .L800B71F4
/* 0B7D90 800B7190 02C09825 */ move $s3, $s6
.L800B7194:
/* 0B7D94 800B7194 02D4001A */ div $zero, $s6, $s4
/* 0B7D98 800B7198 16800002 */ bnez $s4, .L800B71A4
/* 0B7D9C 800B719C 00000000 */ nop
/* 0B7DA0 800B71A0 0007000D */ break 7
.L800B71A4:
/* 0B7DA4 800B71A4 2401FFFF */ li $at, -1
/* 0B7DA8 800B71A8 16810004 */ bne $s4, $at, .L800B71BC
/* 0B7DAC 800B71AC 3C018000 */ lui $at, 0x8000
/* 0B7DB0 800B71B0 16C10002 */ bne $s6, $at, .L800B71BC
/* 0B7DB4 800B71B4 00000000 */ nop
/* 0B7DB8 800B71B8 0006000D */ break 6
.L800B71BC:
/* 0B7DBC 800B71BC 86A30010 */ lh $v1, 0x10($s5)
/* 0B7DC0 800B71C0 00001012 */ mflo $v0
/* 0B7DC4 800B71C4 0043082A */ slt $at, $v0, $v1
/* 0B7DC8 800B71C8 54200004 */ bnel $at, $zero, .L800B71DC
/* 0B7DCC 800B71CC 86A30012 */ lh $v1, 0x12($s5)
/* 0B7DD0 800B71D0 10000008 */ b .L800B71F4
/* 0B7DD4 800B71D4 00609825 */ move $s3, $v1
/* 0B7DD8 800B71D8 86A30012 */ lh $v1, 0x12($s5)
.L800B71DC:
/* 0B7DDC 800B71DC 0062082A */ slt $at, $v1, $v0
/* 0B7DE0 800B71E0 54200004 */ bnel $at, $zero, .L800B71F4
/* 0B7DE4 800B71E4 86B3000E */ lh $s3, 0xe($s5)
/* 0B7DE8 800B71E8 10000002 */ b .L800B71F4
/* 0B7DEC 800B71EC 00609825 */ move $s3, $v1
/* 0B7DF0 800B71F0 86B3000E */ lh $s3, 0xe($s5)
.L800B71F4:
/* 0B7DF4 800B71F4 3C02803B */ lui $v0, %hi(gNumSynthesisReverbs) # $v0, 0x803b
/* 0B7DF8 800B71F8 8042FBC3 */ lb $v0, %lo(gNumSynthesisReverbs)($v0)
/* 0B7DFC 800B71FC 58400012 */ blezl $v0, .L800B7248
/* 0B7E00 800B7200 02E02025 */ move $a0, $s7
/* 0B7E04 800B7204 3C10803B */ lui $s0, %hi(gSynthesisReverbs) # $s0, 0x803b
/* 0B7E08 800B7208 2610F790 */ addiu $s0, %lo(gSynthesisReverbs) # addiu $s0, $s0, -0x870
.L800B720C:
/* 0B7E0C 800B720C 92190001 */ lbu $t9, 1($s0)
/* 0B7E10 800B7210 02602025 */ move $a0, $s3
/* 0B7E14 800B7214 02542823 */ subu $a1, $s2, $s4
/* 0B7E18 800B7218 53200007 */ beql $t9, $zero, .L800B7238
/* 0B7E1C 800B721C 26310001 */ addiu $s1, $s1, 1
/* 0B7E20 800B7220 0C02DAFC */ jal prepare_reverb_ring_buffer
/* 0B7E24 800B7224 02203025 */ move $a2, $s1
/* 0B7E28 800B7228 3C02803B */ lui $v0, %hi(gNumSynthesisReverbs) # $v0, 0x803b
/* 0B7E2C 800B722C 8042FBC3 */ lb $v0, %lo(gNumSynthesisReverbs)($v0)
/* 0B7E30 800B7230 86B2000C */ lh $s2, 0xc($s5)
/* 0B7E34 800B7234 26310001 */ addiu $s1, $s1, 1
.L800B7238:
/* 0B7E38 800B7238 0222082A */ slt $at, $s1, $v0
/* 0B7E3C 800B723C 1420FFF3 */ bnez $at, .L800B720C
/* 0B7E40 800B7240 26100108 */ addiu $s0, $s0, 0x108
/* 0B7E44 800B7244 02E02025 */ move $a0, $s7
.L800B7248:
/* 0B7E48 800B7248 02602825 */ move $a1, $s3
/* 0B7E4C 800B724C 03C03025 */ move $a2, $fp
/* 0B7E50 800B7250 0C02DDD7 */ jal func_800B775C
/* 0B7E54 800B7254 02543823 */ subu $a3, $s2, $s4
/* 0B7E58 800B7258 2694FFFF */ addiu $s4, $s4, -1
/* 0B7E5C 800B725C 00134080 */ sll $t0, $s3, 2
/* 0B7E60 800B7260 0040F025 */ move $fp, $v0
/* 0B7E64 800B7264 02D3B023 */ subu $s6, $s6, $s3
/* 0B7E68 800B7268 1E80FFC4 */ bgtz $s4, .L800B717C
/* 0B7E6C 800B726C 02E8B821 */ addu $s7, $s7, $t0
.L800B7270:
/* 0B7E70 800B7270 3C02803B */ lui $v0, %hi(gNumSynthesisReverbs) # $v0, 0x803b
/* 0B7E74 800B7274 8042FBC3 */ lb $v0, %lo(gNumSynthesisReverbs)($v0)
/* 0B7E78 800B7278 3C09803B */ lui $t1, %hi(gSynthesisReverbs) # 0x803b
/* 0B7E7C 800B727C 2530F790 */ addiu $s0, $t1, %lo(gSynthesisReverbs) # -0x870
/* 0B7E80 800B7280 1840000E */ blez $v0, .L800B72BC
/* 0B7E84 800B7284 00025140 */ sll $t2, $v0, 5
/* 0B7E88 800B7288 01425021 */ addu $t2, $t2, $v0
/* 0B7E8C 800B728C 000A50C0 */ sll $t2, $t2, 3
/* 0B7E90 800B7290 01501821 */ addu $v1, $t2, $s0
.L800B7294:
/* 0B7E94 800B7294 92020002 */ lbu $v0, 2($s0)
/* 0B7E98 800B7298 10400002 */ beqz $v0, .L800B72A4
/* 0B7E9C 800B729C 244BFFFF */ addiu $t3, $v0, -1
/* 0B7EA0 800B72A0 A20B0002 */ sb $t3, 2($s0)
.L800B72A4:
/* 0B7EA4 800B72A4 920C0003 */ lbu $t4, 3($s0)
/* 0B7EA8 800B72A8 26100108 */ addiu $s0, $s0, 0x108
/* 0B7EAC 800B72AC 0203082B */ sltu $at, $s0, $v1
/* 0B7EB0 800B72B0 398D0001 */ xori $t5, $t4, 1
/* 0B7EB4 800B72B4 1420FFF7 */ bnez $at, .L800B7294
/* 0B7EB8 800B72B8 A20DFEFB */ sb $t5, -0x105($s0)
.L800B72BC:
/* 0B7EBC 800B72BC 8FAE0040 */ lw $t6, 0x40($sp)
/* 0B7EC0 800B72C0 8FB90044 */ lw $t9, 0x44($sp)
/* 0B7EC4 800B72C4 03C01025 */ move $v0, $fp
/* 0B7EC8 800B72C8 03CE7823 */ subu $t7, $fp, $t6
/* 0B7ECC 800B72CC 000FC0C3 */ sra $t8, $t7, 3
/* 0B7ED0 800B72D0 AF380000 */ sw $t8, ($t9)
/* 0B7ED4 800B72D4 8FBF003C */ lw $ra, 0x3c($sp)
/* 0B7ED8 800B72D8 8FBE0038 */ lw $fp, 0x38($sp)
/* 0B7EDC 800B72DC 8FB70034 */ lw $s7, 0x34($sp)
/* 0B7EE0 800B72E0 8FB60030 */ lw $s6, 0x30($sp)
/* 0B7EE4 800B72E4 8FB5002C */ lw $s5, 0x2c($sp)
/* 0B7EE8 800B72E8 8FB40028 */ lw $s4, 0x28($sp)
/* 0B7EEC 800B72EC 8FB30024 */ lw $s3, 0x24($sp)
/* 0B7EF0 800B72F0 8FB20020 */ lw $s2, 0x20($sp)
/* 0B7EF4 800B72F4 8FB1001C */ lw $s1, 0x1c($sp)
/* 0B7EF8 800B72F8 8FB00018 */ lw $s0, 0x18($sp)
/* 0B7EFC 800B72FC 03E00008 */ jr $ra
/* 0B7F00 800B7300 27BD0040 */ addiu $sp, $sp, 0x40

View File

@ -1,334 +0,0 @@
glabel func_800B775C
/* 0B835C 800B775C 27BDFF40 */ addiu $sp, $sp, -0xc0
/* 0B8360 800B7760 3C0A803B */ lui $t2, %hi(gNumSynthesisReverbs) # $t2, 0x803b
/* 0B8364 800B7764 254AFBC3 */ addiu $t2, %lo(gNumSynthesisReverbs) # addiu $t2, $t2, -0x43d
/* 0B8368 800B7768 81490000 */ lb $t1, ($t2)
/* 0B836C 800B776C AFB5003C */ sw $s5, 0x3c($sp)
/* 0B8370 800B7770 AFB40038 */ sw $s4, 0x38($sp)
/* 0B8374 800B7774 AFB20030 */ sw $s2, 0x30($sp)
/* 0B8378 800B7778 00C0A025 */ move $s4, $a2
/* 0B837C 800B777C 00E0A825 */ move $s5, $a3
/* 0B8380 800B7780 AFBF004C */ sw $ra, 0x4c($sp)
/* 0B8384 800B7784 AFBE0048 */ sw $fp, 0x48($sp)
/* 0B8388 800B7788 AFB70044 */ sw $s7, 0x44($sp)
/* 0B838C 800B778C AFB60040 */ sw $s6, 0x40($sp)
/* 0B8390 800B7790 AFB30034 */ sw $s3, 0x34($sp)
/* 0B8394 800B7794 AFB1002C */ sw $s1, 0x2c($sp)
/* 0B8398 800B7798 AFB00028 */ sw $s0, 0x28($sp)
/* 0B839C 800B779C AFA400C0 */ sw $a0, 0xc0($sp)
/* 0B83A0 800B77A0 AFA500C4 */ sw $a1, 0xc4($sp)
/* 0B83A4 800B77A4 1520001D */ bnez $t1, .L800B781C
/* 0B83A8 800B77A8 00009025 */ move $s2, $zero
/* 0B83AC 800B77AC 3C04803B */ lui $a0, %hi(gMaxSimultaneousNotes) # $a0, 0x803b
/* 0B83B0 800B77B0 8C8470B0 */ lw $a0, %lo(gMaxSimultaneousNotes)($a0)
/* 0B83B4 800B77B4 00008825 */ move $s1, $zero
/* 0B83B8 800B77B8 18800016 */ blez $a0, .L800B7814
/* 0B83BC 800B77BC 00000000 */ nop
/* 0B83C0 800B77C0 00870019 */ multu $a0, $a3
/* 0B83C4 800B77C4 3C0E803B */ lui $t6, %hi(gNoteSubsEu) # $t6, 0x803b
/* 0B83C8 800B77C8 8DCEFBC4 */ lw $t6, %lo(gNoteSubsEu)($t6)
/* 0B83CC 800B77CC 27A50084 */ addiu $a1, $sp, 0x84
/* 0B83D0 800B77D0 00007812 */ mflo $t7
/* 0B83D4 800B77D4 000FC100 */ sll $t8, $t7, 4
/* 0B83D8 800B77D8 01D81021 */ addu $v0, $t6, $t8
.L800B77DC:
/* 0B83DC 800B77DC 8C590000 */ lw $t9, ($v0)
/* 0B83E0 800B77E0 00B26021 */ addu $t4, $a1, $s2
/* 0B83E4 800B77E4 00195FC2 */ srl $t3, $t9, 0x1f
/* 0B83E8 800B77E8 51600006 */ beql $t3, $zero, .L800B7804
/* 0B83EC 800B77EC 26310001 */ addiu $s1, $s1, 1
/* 0B83F0 800B77F0 26520001 */ addiu $s2, $s2, 1
/* 0B83F4 800B77F4 00126C00 */ sll $t5, $s2, 0x10
/* 0B83F8 800B77F8 000D9403 */ sra $s2, $t5, 0x10
/* 0B83FC 800B77FC A1910000 */ sb $s1, ($t4)
/* 0B8400 800B7800 26310001 */ addiu $s1, $s1, 1
.L800B7804:
/* 0B8404 800B7804 0224082A */ slt $at, $s1, $a0
/* 0B8408 800B7808 1420FFF4 */ bnez $at, .L800B77DC
/* 0B840C 800B780C 24420010 */ addiu $v0, $v0, 0x10
/* 0B8410 800B7810 00008825 */ move $s1, $zero
.L800B7814:
/* 0B8414 800B7814 10000049 */ b .L800B793C
/* 0B8418 800B7818 00009825 */ move $s3, $zero
.L800B781C:
/* 0B841C 800B781C 19200026 */ blez $t1, .L800B78B8
/* 0B8420 800B7820 00009825 */ move $s3, $zero
/* 0B8424 800B7824 3C04803B */ lui $a0, %hi(gMaxSimultaneousNotes) # $a0, 0x803b
/* 0B8428 800B7828 8C8470B0 */ lw $a0, %lo(gMaxSimultaneousNotes)($a0)
/* 0B842C 800B782C 27A50084 */ addiu $a1, $sp, 0x84
.L800B7830:
/* 0B8430 800B7830 1880001A */ blez $a0, .L800B789C
/* 0B8434 800B7834 00008825 */ move $s1, $zero
/* 0B8438 800B7838 00950019 */ multu $a0, $s5
/* 0B843C 800B783C 3C08803B */ lui $t0, %hi(gNoteSubsEu) # $t0, 0x803b
/* 0B8440 800B7840 8D08FBC4 */ lw $t0, %lo(gNoteSubsEu)($t0)
/* 0B8444 800B7844 00001812 */ mflo $v1
/* 0B8448 800B7848 00000000 */ nop
/* 0B844C 800B784C 00000000 */ nop
.L800B7850:
/* 0B8450 800B7850 00037100 */ sll $t6, $v1, 4
/* 0B8454 800B7854 01C81021 */ addu $v0, $t6, $t0
/* 0B8458 800B7858 8C580000 */ lw $t8, ($v0)
/* 0B845C 800B785C 0018CFC2 */ srl $t9, $t8, 0x1f
/* 0B8460 800B7860 5320000B */ beql $t9, $zero, .L800B7890
/* 0B8464 800B7864 26310001 */ addiu $s1, $s1, 1
/* 0B8468 800B7868 904B0001 */ lbu $t3, 1($v0)
/* 0B846C 800B786C 00B26821 */ addu $t5, $a1, $s2
/* 0B8470 800B7870 000B6142 */ srl $t4, $t3, 5
/* 0B8474 800B7874 566C0006 */ bnel $s3, $t4, .L800B7890
/* 0B8478 800B7878 26310001 */ addiu $s1, $s1, 1
/* 0B847C 800B787C 26520001 */ addiu $s2, $s2, 1
/* 0B8480 800B7880 00127C00 */ sll $t7, $s2, 0x10
/* 0B8484 800B7884 000F9403 */ sra $s2, $t7, 0x10
/* 0B8488 800B7888 A1B10000 */ sb $s1, ($t5)
/* 0B848C 800B788C 26310001 */ addiu $s1, $s1, 1
.L800B7890:
/* 0B8490 800B7890 0224082A */ slt $at, $s1, $a0
/* 0B8494 800B7894 1420FFEE */ bnez $at, .L800B7850
/* 0B8498 800B7898 24630001 */ addiu $v1, $v1, 1
.L800B789C:
/* 0B849C 800B789C 26730001 */ addiu $s3, $s3, 1
/* 0B84A0 800B78A0 0013C400 */ sll $t8, $s3, 0x10
/* 0B84A4 800B78A4 00189C03 */ sra $s3, $t8, 0x10
/* 0B84A8 800B78A8 0269082A */ slt $at, $s3, $t1
/* 0B84AC 800B78AC 1420FFE0 */ bnez $at, .L800B7830
/* 0B84B0 800B78B0 00000000 */ nop
/* 0B84B4 800B78B4 00009825 */ move $s3, $zero
.L800B78B8:
/* 0B84B8 800B78B8 3C04803B */ lui $a0, %hi(gMaxSimultaneousNotes) # $a0, 0x803b
/* 0B84BC 800B78BC 8C8470B0 */ lw $a0, %lo(gMaxSimultaneousNotes)($a0)
/* 0B84C0 800B78C0 27A50084 */ addiu $a1, $sp, 0x84
/* 0B84C4 800B78C4 00008825 */ move $s1, $zero
/* 0B84C8 800B78C8 5880001D */ blezl $a0, .L800B7940
/* 0B84CC 800B78CC 02801025 */ move $v0, $s4
/* 0B84D0 800B78D0 00950019 */ multu $a0, $s5
/* 0B84D4 800B78D4 3C08803B */ lui $t0, %hi(gNoteSubsEu) # $t0, 0x803b
/* 0B84D8 800B78D8 8D08FBC4 */ lw $t0, %lo(gNoteSubsEu)($t0)
/* 0B84DC 800B78DC 00001812 */ mflo $v1
/* 0B84E0 800B78E0 00000000 */ nop
/* 0B84E4 800B78E4 00000000 */ nop
.L800B78E8:
/* 0B84E8 800B78E8 00035900 */ sll $t3, $v1, 4
/* 0B84EC 800B78EC 01681021 */ addu $v0, $t3, $t0
/* 0B84F0 800B78F0 8C4C0000 */ lw $t4, ($v0)
/* 0B84F4 800B78F4 000C6FC2 */ srl $t5, $t4, 0x1f
/* 0B84F8 800B78F8 51A0000C */ beql $t5, $zero, .L800B792C
/* 0B84FC 800B78FC 26310001 */ addiu $s1, $s1, 1
/* 0B8500 800B7900 904F0001 */ lbu $t7, 1($v0)
/* 0B8504 800B7904 00B2C021 */ addu $t8, $a1, $s2
/* 0B8508 800B7908 000F7142 */ srl $t6, $t7, 5
/* 0B850C 800B790C 01C9082A */ slt $at, $t6, $t1
/* 0B8510 800B7910 54200006 */ bnel $at, $zero, .L800B792C
/* 0B8514 800B7914 26310001 */ addiu $s1, $s1, 1
/* 0B8518 800B7918 26520001 */ addiu $s2, $s2, 1
/* 0B851C 800B791C 0012CC00 */ sll $t9, $s2, 0x10
/* 0B8520 800B7920 00199403 */ sra $s2, $t9, 0x10
/* 0B8524 800B7924 A3110000 */ sb $s1, ($t8)
/* 0B8528 800B7928 26310001 */ addiu $s1, $s1, 1
.L800B792C:
/* 0B852C 800B792C 0224082A */ slt $at, $s1, $a0
/* 0B8530 800B7930 1420FFED */ bnez $at, .L800B78E8
/* 0B8534 800B7934 24630001 */ addiu $v1, $v1, 1
/* 0B8538 800B7938 00008825 */ move $s1, $zero
.L800B793C:
/* 0B853C 800B793C 02801025 */ move $v0, $s4
.L800B7940:
/* 0B8540 800B7940 3C0C0200 */ lui $t4, (0x02000540 >> 16) # lui $t4, 0x200
/* 0B8544 800B7944 358C0540 */ ori $t4, (0x02000540 & 0xFFFF) # ori $t4, $t4, 0x540
/* 0B8548 800B7948 240D0300 */ li $t5, 768
/* 0B854C 800B794C AC4D0004 */ sw $t5, 4($v0)
/* 0B8550 800B7950 AC4C0000 */ sw $t4, ($v0)
/* 0B8554 800B7954 814F0000 */ lb $t7, ($t2)
/* 0B8558 800B7958 3C1E803B */ lui $fp, %hi(gNotes) # $fp, 0x803b
/* 0B855C 800B795C 26940008 */ addiu $s4, $s4, 8
/* 0B8560 800B7960 19E00055 */ blez $t7, .L800B7AB8
/* 0B8564 800B7964 27DE1508 */ addiu $fp, %lo(gNotes) # addiu $fp, $fp, 0x1508
/* 0B8568 800B7968 3C16803B */ lui $s6, %hi(gNoteSubsEu) # $s6, 0x803b
/* 0B856C 800B796C 26D6FBC4 */ addiu $s6, %lo(gNoteSubsEu) # addiu $s6, $s6, -0x43c
/* 0B8570 800B7970 241700C0 */ li $s7, 192
/* 0B8574 800B7974 00137140 */ sll $t6, $s3, 5
.L800B7978:
/* 0B8578 800B7978 01D37021 */ addu $t6, $t6, $s3
/* 0B857C 800B797C 3C18803B */ lui $t8, %hi(gSynthesisReverbs) # $t8, 0x803b
/* 0B8580 800B7980 2718F790 */ addiu $t8, %lo(gSynthesisReverbs) # addiu $t8, $t8, -0x870
/* 0B8584 800B7984 000E70C0 */ sll $t6, $t6, 3
/* 0B8588 800B7988 01D8C821 */ addu $t9, $t6, $t8
/* 0B858C 800B798C AFB90064 */ sw $t9, 0x64($sp)
/* 0B8590 800B7990 932B0001 */ lbu $t3, 1($t9)
/* 0B8594 800B7994 3C01803B */ lui $at, %hi(gUseReverb) # $at, 0x803b
/* 0B8598 800B7998 02802025 */ move $a0, $s4
/* 0B859C 800B799C 000B6600 */ sll $t4, $t3, 0x18
/* 0B85A0 800B79A0 000C6E03 */ sra $t5, $t4, 0x18
/* 0B85A4 800B79A4 11A0000A */ beqz $t5, .L800B79D0
/* 0B85A8 800B79A8 A02BFBC2 */ sb $t3, %lo(gUseReverb)($at)
/* 0B85AC 800B79AC 00133400 */ sll $a2, $s3, 0x10
/* 0B85B0 800B79B0 00153C00 */ sll $a3, $s5, 0x10
/* 0B85B4 800B79B4 00077403 */ sra $t6, $a3, 0x10
/* 0B85B8 800B79B8 00067C03 */ sra $t7, $a2, 0x10
/* 0B85BC 800B79BC 01E03025 */ move $a2, $t7
/* 0B85C0 800B79C0 01C03825 */ move $a3, $t6
/* 0B85C4 800B79C4 0C02DCC1 */ jal synthesis_resample_and_mix_reverb
/* 0B85C8 800B79C8 8FA500C4 */ lw $a1, 0xc4($sp)
/* 0B85CC 800B79CC 0040A025 */ move $s4, $v0
.L800B79D0:
/* 0B85D0 800B79D0 0232082A */ slt $at, $s1, $s2
/* 0B85D4 800B79D4 10200024 */ beqz $at, .L800B7A68
/* 0B85D8 800B79D8 27B80084 */ addiu $t8, $sp, 0x84
/* 0B85DC 800B79DC 02388021 */ addu $s0, $s1, $t8
.L800B79E0:
/* 0B85E0 800B79E0 3C19803B */ lui $t9, %hi(gMaxSimultaneousNotes) # $t9, 0x803b
/* 0B85E4 800B79E4 8F3970B0 */ lw $t9, %lo(gMaxSimultaneousNotes)($t9)
/* 0B85E8 800B79E8 92030000 */ lbu $v1, ($s0)
/* 0B85EC 800B79EC 8EC80000 */ lw $t0, ($s6)
/* 0B85F0 800B79F0 02B90019 */ multu $s5, $t9
/* 0B85F4 800B79F4 00035900 */ sll $t3, $v1, 4
/* 0B85F8 800B79F8 010B6021 */ addu $t4, $t0, $t3
/* 0B85FC 800B79FC 00602025 */ move $a0, $v1
/* 0B8600 800B7A00 00001012 */ mflo $v0
/* 0B8604 800B7A04 00026900 */ sll $t5, $v0, 4
/* 0B8608 800B7A08 018D7821 */ addu $t7, $t4, $t5
/* 0B860C 800B7A0C 91EE0001 */ lbu $t6, 1($t7)
/* 0B8610 800B7A10 000EC142 */ srl $t8, $t6, 5
/* 0B8614 800B7A14 56780015 */ bnel $s3, $t8, .L800B7A6C
/* 0B8618 800B7A18 8FAE0064 */ lw $t6, 0x64($sp)
/* 0B861C 800B7A1C 00770019 */ multu $v1, $s7
/* 0B8620 800B7A20 8FCD0000 */ lw $t5, ($fp)
/* 0B8624 800B7A24 8FAF00C4 */ lw $t7, 0xc4($sp)
/* 0B8628 800B7A28 0062C821 */ addu $t9, $v1, $v0
/* 0B862C 800B7A2C 00195900 */ sll $t3, $t9, 4
/* 0B8630 800B7A30 01682821 */ addu $a1, $t3, $t0
/* 0B8634 800B7A34 8FA700C0 */ lw $a3, 0xc0($sp)
/* 0B8638 800B7A38 AFB40014 */ sw $s4, 0x14($sp)
/* 0B863C 800B7A3C AFB50018 */ sw $s5, 0x18($sp)
/* 0B8640 800B7A40 AFAF0010 */ sw $t7, 0x10($sp)
/* 0B8644 800B7A44 00006012 */ mflo $t4
/* 0B8648 800B7A48 018D3021 */ addu $a2, $t4, $t5
/* 0B864C 800B7A4C 0C02DF0C */ jal func_800B7C30
/* 0B8650 800B7A50 24C60010 */ addiu $a2, $a2, 0x10
/* 0B8654 800B7A54 26310001 */ addiu $s1, $s1, 1
/* 0B8658 800B7A58 0232082A */ slt $at, $s1, $s2
/* 0B865C 800B7A5C 0040A025 */ move $s4, $v0
/* 0B8660 800B7A60 1420FFDF */ bnez $at, .L800B79E0
/* 0B8664 800B7A64 26100001 */ addiu $s0, $s0, 1
.L800B7A68:
/* 0B8668 800B7A68 8FAE0064 */ lw $t6, 0x64($sp)
.L800B7A6C:
/* 0B866C 800B7A6C 00132C00 */ sll $a1, $s3, 0x10
/* 0B8670 800B7A70 0005CC03 */ sra $t9, $a1, 0x10
/* 0B8674 800B7A74 91D80001 */ lbu $t8, 1($t6)
/* 0B8678 800B7A78 03202825 */ move $a1, $t9
/* 0B867C 800B7A7C 02802025 */ move $a0, $s4
/* 0B8680 800B7A80 13000005 */ beqz $t8, .L800B7A98
/* 0B8684 800B7A84 00153400 */ sll $a2, $s5, 0x10
/* 0B8688 800B7A88 00065C03 */ sra $t3, $a2, 0x10
/* 0B868C 800B7A8C 0C02DD8C */ jal synthesis_load_reverb_samples
/* 0B8690 800B7A90 01603025 */ move $a2, $t3
/* 0B8694 800B7A94 0040A025 */ move $s4, $v0
.L800B7A98:
/* 0B8698 800B7A98 3C0F803B */ lui $t7, %hi(gNumSynthesisReverbs) # $t7, 0x803b
/* 0B869C 800B7A9C 81EFFBC3 */ lb $t7, %lo(gNumSynthesisReverbs)($t7)
/* 0B86A0 800B7AA0 26730001 */ addiu $s3, $s3, 1
/* 0B86A4 800B7AA4 00136400 */ sll $t4, $s3, 0x10
/* 0B86A8 800B7AA8 000C9C03 */ sra $s3, $t4, 0x10
/* 0B86AC 800B7AAC 026F082A */ slt $at, $s3, $t7
/* 0B86B0 800B7AB0 5420FFB1 */ bnel $at, $zero, .L800B7978
/* 0B86B4 800B7AB4 00137140 */ sll $t6, $s3, 5
.L800B7AB8:
/* 0B86B8 800B7AB8 3C16803B */ lui $s6, %hi(gNoteSubsEu) # $s6, 0x803b
/* 0B86BC 800B7ABC 3C1E803B */ lui $fp, %hi(gNotes) # $fp, 0x803b
/* 0B86C0 800B7AC0 0232082A */ slt $at, $s1, $s2
/* 0B86C4 800B7AC4 27DE1508 */ addiu $fp, %lo(gNotes) # addiu $fp, $fp, 0x1508
/* 0B86C8 800B7AC8 26D6FBC4 */ addiu $s6, %lo(gNoteSubsEu) # addiu $s6, $s6, -0x43c
/* 0B86CC 800B7ACC 10200030 */ beqz $at, .L800B7B90
/* 0B86D0 800B7AD0 241700C0 */ li $s7, 192
/* 0B86D4 800B7AD4 27AE0084 */ addiu $t6, $sp, 0x84
/* 0B86D8 800B7AD8 022E8021 */ addu $s0, $s1, $t6
/* 0B86DC 800B7ADC 24130001 */ li $s3, 1
.L800B7AE0:
/* 0B86E0 800B7AE0 3C18803B */ lui $t8, %hi(gMaxSimultaneousNotes) # $t8, 0x803b
/* 0B86E4 800B7AE4 8F1870B0 */ lw $t8, %lo(gMaxSimultaneousNotes)($t8)
/* 0B86E8 800B7AE8 92030000 */ lbu $v1, ($s0)
/* 0B86EC 800B7AEC 8EC80000 */ lw $t0, ($s6)
/* 0B86F0 800B7AF0 02B80019 */ multu $s5, $t8
/* 0B86F4 800B7AF4 0003C900 */ sll $t9, $v1, 4
/* 0B86F8 800B7AF8 01195821 */ addu $t3, $t0, $t9
/* 0B86FC 800B7AFC 3C0F803B */ lui $t7, %hi(gBankLoadStatus) # 0x803b
/* 0B8700 800B7B00 3C011000 */ lui $at, 0x1000
/* 0B8704 800B7B04 00602025 */ move $a0, $v1
/* 0B8708 800B7B08 00001012 */ mflo $v0
/* 0B870C 800B7B0C 00026100 */ sll $t4, $v0, 4
/* 0B8710 800B7B10 016C6821 */ addu $t5, $t3, $t4
/* 0B8714 800B7B14 91A50002 */ lbu $a1, 2($t5)
/* 0B8718 800B7B18 01E57821 */ addu $t7, $t7, $a1
/* 0B871C 800B7B1C 91EF03C0 */ lbu $t7, %lo(gBankLoadStatus)($t7) # 0x3c0($t7)
/* 0B8720 800B7B20 29EE0002 */ slti $t6, $t7, 2
/* 0B8724 800B7B24 39CE0001 */ xori $t6, $t6, 1
/* 0B8728 800B7B28 166E0011 */ bne $s3, $t6, .L800B7B70
/* 0B872C 800B7B2C 00117A00 */ sll $t7, $s1, 8
/* 0B8730 800B7B30 00770019 */ multu $v1, $s7
/* 0B8734 800B7B34 8FCC0000 */ lw $t4, ($fp)
/* 0B8738 800B7B38 8FAD00C4 */ lw $t5, 0xc4($sp)
/* 0B873C 800B7B3C 0062C021 */ addu $t8, $v1, $v0
/* 0B8740 800B7B40 0018C900 */ sll $t9, $t8, 4
/* 0B8744 800B7B44 03282821 */ addu $a1, $t9, $t0
/* 0B8748 800B7B48 8FA700C0 */ lw $a3, 0xc0($sp)
/* 0B874C 800B7B4C AFB40014 */ sw $s4, 0x14($sp)
/* 0B8750 800B7B50 AFB50018 */ sw $s5, 0x18($sp)
/* 0B8754 800B7B54 AFAD0010 */ sw $t5, 0x10($sp)
/* 0B8758 800B7B58 00005812 */ mflo $t3
/* 0B875C 800B7B5C 016C3021 */ addu $a2, $t3, $t4
/* 0B8760 800B7B60 0C02DF0C */ jal func_800B7C30
/* 0B8764 800B7B64 24C60010 */ addiu $a2, $a2, 0x10
/* 0B8768 800B7B68 10000005 */ b .L800B7B80
/* 0B876C 800B7B6C 0040A025 */ move $s4, $v0
.L800B7B70:
/* 0B8770 800B7B70 00AF7021 */ addu $t6, $a1, $t7
/* 0B8774 800B7B74 01C1C021 */ addu $t8, $t6, $at
/* 0B8778 800B7B78 3C01803B */ lui $at, %hi(gAudioErrorFlags) # $at, 0x803b
/* 0B877C 800B7B7C AC387198 */ sw $t8, %lo(gAudioErrorFlags)($at)
.L800B7B80:
/* 0B8780 800B7B80 26310001 */ addiu $s1, $s1, 1
/* 0B8784 800B7B84 0232082A */ slt $at, $s1, $s2
/* 0B8788 800B7B88 1420FFD5 */ bnez $at, .L800B7AE0
/* 0B878C 800B7B8C 26100001 */ addiu $s0, $s0, 1
.L800B7B90:
/* 0B8790 800B7B90 02802025 */ move $a0, $s4
/* 0B8794 800B7B94 3C190800 */ lui $t9, 0x800
/* 0B8798 800B7B98 AC990000 */ sw $t9, ($a0)
/* 0B879C 800B7B9C 8FA300C4 */ lw $v1, 0xc4($sp)
/* 0B87A0 800B7BA0 26940008 */ addiu $s4, $s4, 8
/* 0B87A4 800B7BA4 02802825 */ move $a1, $s4
/* 0B87A8 800B7BA8 00035840 */ sll $t3, $v1, 1
/* 0B87AC 800B7BAC 316CFFFF */ andi $t4, $t3, 0xffff
/* 0B87B0 800B7BB0 000B7040 */ sll $t6, $t3, 1
/* 0B87B4 800B7BB4 AC8C0004 */ sw $t4, 4($a0)
/* 0B87B8 800B7BB8 000EC103 */ sra $t8, $t6, 4
/* 0B87BC 800B7BBC 3C0F0540 */ lui $t7, (0x054006C0 >> 16) # lui $t7, 0x540
/* 0B87C0 800B7BC0 331900FF */ andi $t9, $t8, 0xff
/* 0B87C4 800B7BC4 35EF06C0 */ ori $t7, (0x054006C0 & 0xFFFF) # ori $t7, $t7, 0x6c0
/* 0B87C8 800B7BC8 26940008 */ addiu $s4, $s4, 8
/* 0B87CC 800B7BCC 3C0D0D00 */ lui $t5, 0xd00
/* 0B87D0 800B7BD0 00195C00 */ sll $t3, $t9, 0x10
/* 0B87D4 800B7BD4 3C011500 */ lui $at, 0x1500
/* 0B87D8 800B7BD8 ACAD0000 */ sw $t5, ($a1)
/* 0B87DC 800B7BDC ACAF0004 */ sw $t7, 4($a1)
/* 0B87E0 800B7BE0 01616025 */ or $t4, $t3, $at
/* 0B87E4 800B7BE4 02803025 */ move $a2, $s4
/* 0B87E8 800B7BE8 ACCC0000 */ sw $t4, ($a2)
/* 0B87EC 800B7BEC 8FAD00C0 */ lw $t5, 0xc0($sp)
/* 0B87F0 800B7BF0 3C018000 */ lui $at, 0x8000
/* 0B87F4 800B7BF4 26820008 */ addiu $v0, $s4, 8
/* 0B87F8 800B7BF8 01A17821 */ addu $t7, $t5, $at
/* 0B87FC 800B7BFC ACCF0004 */ sw $t7, 4($a2)
/* 0B8800 800B7C00 8FBF004C */ lw $ra, 0x4c($sp)
/* 0B8804 800B7C04 8FBE0048 */ lw $fp, 0x48($sp)
/* 0B8808 800B7C08 8FB70044 */ lw $s7, 0x44($sp)
/* 0B880C 800B7C0C 8FB60040 */ lw $s6, 0x40($sp)
/* 0B8810 800B7C10 8FB5003C */ lw $s5, 0x3c($sp)
/* 0B8814 800B7C14 8FB40038 */ lw $s4, 0x38($sp)
/* 0B8818 800B7C18 8FB30034 */ lw $s3, 0x34($sp)
/* 0B881C 800B7C1C 8FB20030 */ lw $s2, 0x30($sp)
/* 0B8820 800B7C20 8FB1002C */ lw $s1, 0x2c($sp)
/* 0B8824 800B7C24 8FB00028 */ lw $s0, 0x28($sp)
/* 0B8828 800B7C28 03E00008 */ jr $ra
/* 0B882C 800B7C2C 27BD00C0 */ addiu $sp, $sp, 0xc0

View File

@ -1,4 +1,4 @@
glabel func_800B7C30
glabel synthesis_process_note
/* 0B8830 800B7C30 27BDFEC0 */ addiu $sp, $sp, -0x140
/* 0B8834 800B7C34 3C18803B */ lui $t8, %hi(gNotes) # $t8, 0x803b
/* 0B8838 800B7C38 8F181508 */ lw $t8, %lo(gNotes)($t8)

View File

@ -6,9 +6,9 @@
.section .text, "ax"
# 0x800D8F70 D9B70-D9C40
glabel rspbootTextStart
glabel rspF3DBootStart
.incbin "bin/lib/PR/boot/F3D_boot.bin"
glabel rspbootTextEnd
glabel rspF3DBootEnd
# 0x800D9040 D9C40-DB020
glabel gspF3DEXTextStart
@ -21,9 +21,9 @@ glabel gspF3DLXTextStart
glabel gspF3DLXTextEnd
# 0x800DB830 DC430-DD0A0
glabel aspMainTextStart
glabel rspAspMainStart
.incbin "bin/lib/PR/audio/aspMain.bin"
glabel aspMainTextEnd
glabel rspAspMainEnd
.section .data
@ -35,9 +35,9 @@ glabel gspF3DEXDataEnd
# 0x800F4500 F5100-F5900
glabel gspF3DLXDataStart
.incbin "bin/lib/PR/f3d/F3DLX_data.bin"
glabel gspF3DLXDataEn
glabel gspF3DLXDataEnd
# 0x800F4D00 F5900-F5C00
glabel aspMainDataStart
glabel rspAspMainDataStart
.incbin "bin/lib/PR/audio/aspMain_data.bin"
glabel aspMainDataEnd
glabel rspAspMainDataEnd

View File

@ -56,6 +56,7 @@
#define A_ADDMIXER 4
#define A_RESAMPLE_ZOH 6
#define A_SEGMENT 7
#define A_DMEMMOVE2 16
#define A_DOWNSAMPLE_HALF 17
#define A_ENVSETUP1 18
@ -647,7 +648,7 @@ typedef short ENVMIX_STATE[40];
#undef aSaveBuffer
#undef aMix
#undef aEnvMixer
#undef aInterleave
// #undef aInterleave
// New or modified operations in the new audio microcode below
@ -914,6 +915,7 @@ typedef short ENVMIX_STATE[40];
* The previous version of this function rounded up to the nearest
* multiple of 16 bytes.
*/
/*
#define aInterleave(pkt, o, l, r, c) \
{ \
Acmd *_a = (Acmd *)pkt; \
@ -922,6 +924,7 @@ typedef short ENVMIX_STATE[40];
_SHIFTL((c) >> 4, 16, 8) | _SHIFTL(o, 0, 16); \
_a->words.w1 = _SHIFTL(l, 16, 16) | _SHIFTL(r, 0, 16); \
}
*/
/*
* Linear filter function.

View File

@ -9,10 +9,14 @@
extern u64 rspF3DBootStart[], rspF3DBootEnd[];
// F3D ucode
extern u64 rspF3DStart[], rspF3DEnd[];
extern u64 gspF3DEXTextStart[], gspF3DEXTextEnd[];
extern u64 gspF3DLXTextStart[], gspF3DLXTextEnd[];
// F3D ucode data
extern u64 rspF3DDataStart[], rspF3DDataEnd[];
extern u64 gspF3DEXDataStart[], gspF3DEXDataEnd[];
extern u64 gspF3DLXDataStart[], gspF3DLXDataEnd[];
// aspMain (audio) ucode
extern u64 rspAspMainStart[], rspAspMainEnd[];

View File

@ -49,8 +49,9 @@ s32 gMaxAudioCmds;
s32 gMaxSimultaneousNotes;
s16 gTempoInternalToExternal;
s8 gAudioLibSoundMode;
s32 gAudioUpdatesPerFrame;
s32 gCurrAudioFrameDmaCount; // file split around here?
// If we take SM64 as gospel, these should be in data.c, but that doesn't match
volatile s32 gAudioFrameCount;
s32 gCurrAudioFrameDmaCount;
/**
@ -811,7 +812,7 @@ void audio_init() {
gAiBufferLengths[i] = 0xa0;
}
gAudioTaskIndex = gAudioUpdatesPerFrame = 0;
gAudioTaskIndex = gAudioFrameCount = 0;
gCurrAiBufferIndex = 0;
gAudioLibSoundMode = 0;
gAudioTask = NULL;

View File

@ -81,7 +81,7 @@ extern s32 gMaxAudioCmds;
extern s32 gMaxSimultaneousNotes;
extern s16 gTempoInternalToExternal;
extern s8 gAudioLibSoundMode;
extern s32 gAudioUpdatesPerFrame;
extern volatile s32 gAudioFrameCount;
extern s32 gCurrAudioFrameDmaCount;
#endif // AUDIO_LOAD_H

View File

@ -1,9 +1,13 @@
#include <ultra64.h>
#include <macros.h>
#include <PR/ucode.h>
#include "audio/synthesis.h"
#include "audio/seqplayer.h"
#include "audio/port_eu.h"
#include "audio/load.h"
#include "audio/heap.h"
#include "audio/data.h"
OSMesgQueue D_801937C0;
OSMesgQueue D_801937D8;
@ -42,75 +46,48 @@ s32 D_800EA4A4 = 0;
char port_eu_unused_string7[] = "Undefined Port Command %d\n";
#ifdef MIPS_TO_C
//generated by m2c commit 08138748803d75e73e4a94bb0c619a273754ee9c on Sep-14-2023
u64 *func_800B70EC(u64 *, s32 *, s16 *, s16); /* extern */
extern ? aspMainDataEnd;
extern u64 aspMainDataStart;
extern u64 aspMainTextStart;
struct SPTask *create_next_audio_frame_task(void) {
u32 sp74;
s32 sp70;
s16 *sp60;
void *sp58;
void *sp54;
s16 **sp40;
s16 **temp_a3;
s16 *temp_s1_2;
s16 temp_v1;
s32 temp_hi;
s32 temp_hi_2;
s32 temp_s1;
s32 temp_t3;
u32 samplesRemainingInAI;
s32 writtenCmds;
s32 index;
OSTask_t *task;
s32 var_s0;
s32 var_s0_2;
s32 var_s0_3;
s32 var_s1;
s16 *currAiBuffer;
s32 oldDmaCount;
OSMesg sp58;
OSMesg sp54;
s32 writtenCmdsCopy;
gAudioUpdatesPerFrame += 1;
if (((s32) gAudioUpdatesPerFrame % (s16) gAudioBufferParameters.presetUnk4) != 0) {
gAudioFrameCount++;
if ((gAudioFrameCount % gAudioBufferParameters.presetUnk4) != 0) {
return NULL;
}
osSendMesg(D_800EA3A8, (void *) gAudioUpdatesPerFrame, 0);
temp_t3 = gCurrAiBufferIndex + 1;
temp_hi = temp_t3 % 3;
temp_hi_2 = (s32) (temp_hi + 1) % 3;
gCurrAiBufferIndex = temp_t3;
osSendMesg(D_800EA3A8, (OSMesg) gAudioFrameCount, 0);
gAudioTaskIndex ^= 1;
gCurrAiBufferIndex = temp_hi;
sp74 = osAiGetLength() >> 2;
temp_v1 = gAiBufferLengths[temp_hi_2];
if (temp_v1 != 0) {
osAiSetNextBuffer(gAiBuffers[temp_hi_2], temp_v1 * 4);
gCurrAiBufferIndex++;
gCurrAiBufferIndex %= NUMAIBUFFERS;
index = (gCurrAiBufferIndex + 1) % NUMAIBUFFERS;
samplesRemainingInAI = osAiGetLength() / 4;
if (gAiBufferLengths[index] != 0) {
osAiSetNextBuffer(gAiBuffers[index], gAiBufferLengths[index] * 4);
}
var_s1 = gCurrAudioFrameDmaCount;
var_s0 = 0;
if (var_s1 > 0) {
do {
if (osRecvMesg(&gCurrAudioFrameDmaQueue, NULL, 0) == 0) {
var_s1 -= 1;
}
var_s0 += 1;
} while (var_s0 < gCurrAudioFrameDmaCount);
}
if (var_s1 != 0) {
var_s0_2 = 0;
if (var_s1 > 0) {
do {
osRecvMesg(&gCurrAudioFrameDmaQueue, NULL, 1);
var_s0_2 += 1;
} while (var_s0_2 != var_s1);
oldDmaCount = gCurrAudioFrameDmaCount;
for (var_s0 = 0; var_s0 < gCurrAudioFrameDmaCount; var_s0++) {
if (osRecvMesg(&gCurrAudioFrameDmaQueue, NULL, 0) == 0) {
oldDmaCount -= 1;
}
}
temp_s1 = gCurrAudioFrameDmaQueue.validCount;
if (temp_s1 != 0) {
var_s0_3 = 0;
if (temp_s1 > 0) {
do {
osRecvMesg(&gCurrAudioFrameDmaQueue, NULL, 0);
var_s0_3 += 1;
} while (var_s0_3 != temp_s1);
if (oldDmaCount != 0) {
for (var_s0 = 0; var_s0 < oldDmaCount; var_s0++) {
osRecvMesg(&gCurrAudioFrameDmaQueue, NULL, 1);
}
}
oldDmaCount = gCurrAudioFrameDmaQueue.validCount;
if (oldDmaCount != 0) {
for (var_s0 = 0; var_s0 < oldDmaCount; var_s0++) {
osRecvMesg(&gCurrAudioFrameDmaQueue, NULL, 0);
}
}
gCurrAudioFrameDmaCount = 0;
@ -119,57 +96,62 @@ struct SPTask *create_next_audio_frame_task(void) {
gAudioResetPresetIdToLoad = (u8) sp58;
gAudioResetStatus = 5;
}
if ((gAudioResetStatus != 0) && (audio_shut_down_and_reset_step() == 0)) {
if (gAudioResetStatus == 0) {
osSendMesg(D_800EA3B4, (void *) gAudioResetPresetIdToLoad, 0);
if (gAudioResetStatus != 0) {
if (audio_shut_down_and_reset_step() == 0) {
if (gAudioResetStatus == 0) {
osSendMesg(D_800EA3B4, (OSMesg) gAudioResetPresetIdToLoad, OS_MESG_NOBLOCK);
}
return NULL;
}
return NULL;
}
gAudioTask = &gAudioTasks[gAudioTaskIndex];
temp_a3 = &gAiBuffers[gCurrAiBufferIndex];
gAudioCmd = gAudioCmdBuffers[gAudioTaskIndex];
sp60 = *temp_a3;
temp_s1_2 = &gAiBufferLengths[gCurrAiBufferIndex];
*temp_s1_2 = (((gAudioBufferParameters.samplesPerFrameTarget - sp74) + 0x40) & 0xFFF0) + 0x10;
if (*temp_s1_2 < gAudioBufferParameters.minAiBufferLength) {
*temp_s1_2 = gAudioBufferParameters.minAiBufferLength;
index = gCurrAiBufferIndex;
currAiBuffer = gAiBuffers[index];
gAiBufferLengths[index] = ((gAudioBufferParameters.samplesPerFrameTarget - samplesRemainingInAI + EXTRA_BUFFERED_AI_SAMPLES_TARGET) & ~0xF) + SAMPLES_TO_OVERPRODUCE;
if (gAiBufferLengths[index] < gAudioBufferParameters.minAiBufferLength) {
gAiBufferLengths[index] = gAudioBufferParameters.minAiBufferLength;
}
if (gAudioBufferParameters.maxAiBufferLength < *temp_s1_2) {
*temp_s1_2 = gAudioBufferParameters.maxAiBufferLength;
if (gAudioBufferParameters.maxAiBufferLength < gAiBufferLengths[index]) {
gAiBufferLengths[index] = gAudioBufferParameters.maxAiBufferLength;
}
sp40 = temp_a3;
if (osRecvMesg(D_800EA3AC, &sp54, 0) != -1) {
func_800CBCB0((u32) sp54);
}
gAudioCmd = func_800B70EC(gAudioCmd, &sp70, sp60, *temp_s1_2);
gAudioRandom = osGetCount() * (gAudioRandom + gAudioUpdatesPerFrame);
gAudioRandom += (*sp40)[gAudioUpdatesPerFrame & 0xFF];
gAudioCmd = synthesis_execute((Acmd *) gAudioCmd, &writtenCmds, currAiBuffer, gAiBufferLengths[index]);
gAudioRandom = osGetCount() * (gAudioRandom + gAudioFrameCount);
gAudioRandom = gAudioRandom + gAiBuffers[index][gAudioFrameCount & 0xFF];
index = gAudioTaskIndex;
gAudioTask->msgqueue = NULL;
// wtf?
writtenCmdsCopy += 0;
gAudioTask->msg = NULL;
gAudioTask->task.t.type = 2;
gAudioTask->task.t.flags = 0;
gAudioTask->task.t.ucode_boot = rspbootTextStart;
gAudioTask->task.t.ucode_boot_size = rspbootTextEnd - rspbootTextStart;
gAudioTask->task.t.ucode = &aspMainTextStart;
gAudioTask->task.t.ucode_data = &aspMainDataStart;
gAudioTask->task.t.ucode_size = 0x00001000;
gAudioTask->task.t.ucode_data_size = ((s32) (&aspMainDataEnd - &aspMainDataStart) >> 3) * 8;
gAudioTask->task.t.dram_stack = NULL;
gAudioTask->task.t.dram_stack_size = 0;
gAudioTask->task.t.output_buff = NULL;
gAudioTask->task.t.output_buff_size = NULL;
gAudioTask->task.t.data_ptr = gAudioCmdBuffers[gAudioTaskIndex];
gAudioTask->task.t.yield_data_ptr = NULL;
gAudioTask->task.t.yield_data_size = 0;
gAudioTask->task.t.data_size = sp70 * 8;
if (D_800EA484 < sp70) {
D_800EA484 = sp70;
task = &gAudioTask->task.t;
task->type = M_AUDTASK;
task->flags = 0;
task->ucode_boot = rspF3DBootStart;
task->ucode_boot_size = (u8*) rspF3DBootEnd - (u8*) rspF3DBootStart;
task->ucode = rspAspMainStart;
task->ucode_data = rspAspMainDataStart;
task->ucode_size = 0x00001000;
task->ucode_data_size = (rspAspMainDataEnd - rspAspMainDataStart) * sizeof(u64);
task->dram_stack = NULL;
task->dram_stack_size = 0;
task->output_buff = NULL;
task->output_buff_size = NULL;
task->data_ptr = gAudioCmdBuffers[index];
task->data_size = writtenCmds * sizeof(u64);
task->yield_data_ptr = NULL;
task->yield_data_size = 0;
writtenCmdsCopy = writtenCmds;
if (D_800EA484 < writtenCmds) {
D_800EA484 = writtenCmdsCopy;
}
return gAudioTask;
}
#else
GLOBAL_ASM("asm/non_matchings/audio/port_eu/create_next_audio_frame_task.s")
#endif
void eu_process_audio_cmd(struct EuAudioCmd *cmd) {
s32 i;

View File

@ -3,6 +3,9 @@
#include "audio/internal.h"
#define SAMPLES_TO_OVERPRODUCE 0x10
#define EXTRA_BUFFERED_AI_SAMPLES_TARGET 0x40
void eu_process_audio_cmd(struct EuAudioCmd*);
void seq_player_fade_to_zero_volume(s32 arg0, s32 fadeOutTime);
void func_800CBA64(s32 playerIndex, s32 fadeInTime);

View File

@ -37,6 +37,7 @@ void sequence_channel_set_volume(struct SequenceChannel *seqChannel, u8 volume);
void seq_channel_layer_process_script(struct SequenceChannelLayer *layer);
void sequence_player_process_sequence(struct SequencePlayer*);
void sequence_channel_process_script(struct SequenceChannel*);
void process_sequences(s32);
void init_sequence_player(u32 player);
void init_sequence_players(void);

View File

@ -2,7 +2,7 @@
#include <macros.h>
#include "audio/synthesis.h"
#include "audio/heap.h"
//#include "audio/data.h"
#include "audio/data.h"
#include "audio/load.h"
//#include "audio/seqplayer.h"
#include "audio/internal.h"
@ -28,8 +28,6 @@ struct VolumeChange {
u16 targetRight;
};
u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateIndex);
u64 *synthesis_process_note(struct Note *note, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s16 *aiBuf, s32 bufLen, u64 *cmd);
u64 *process_envelope(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, u32 flags);
struct SynthesisReverb gSynthesisReverbs[4];
@ -153,94 +151,49 @@ void synthesis_load_note_subs_eu(s32 updateIndex) {
}
}
#ifdef MIPS_TO_C
//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Aug-14-2023
Acmd *func_800B775C(s16 *, s32, Acmd *, s32); /* extern */
? process_sequences(s16); /* extern */
Acmd *synthesis_execute(Acmd *acmd, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) {
s32 i, j;
u32 *aiBufPtr;
Acmd *cmd = acmd;
s32 chunkLen;
void *func_800B70EC(Acmd *acmd, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) {
Acmd *temp_v0;
Acmd *var_fp;
s16 *var_s7;
s16 temp_s0;
s16 temp_s2;
s16 var_s4;
s16 var_s4_2;
s32 temp_lo;
s32 var_s1;
s32 var_s3;
s32 var_s6;
struct SynthesisReverb *var_s0;
struct SynthesisReverb *var_s0_2;
u8 temp_t4;
u8 temp_v0_2;
var_s4 = gAudioBufferParameters.updatesPerFrame;
var_s6 = bufLen;
if (var_s4 > 0) {
do {
temp_s0 = var_s4 - 1;
process_sequences(temp_s0);
synthesis_load_note_subs_eu(gAudioBufferParameters.updatesPerFrame - var_s4);
var_s4 = temp_s0;
} while (temp_s0 > 0);
for (i = gAudioBufferParameters.updatesPerFrame; i > 0; i--) {
process_sequences(i - 1);
synthesis_load_note_subs_eu(gAudioBufferParameters.updatesPerFrame - i);
}
var_s7 = aiBuf;
acmd->words.w0 = 0x07000000;
acmd->words.w1 = 0;
var_s4_2 = gAudioBufferParameters.updatesPerFrame;
var_fp = acmd + 8;
if (var_s4_2 > 0) {
do {
temp_s2 = gAudioBufferParameters.updatesPerFrame;
var_s1 = 0;
if (var_s4_2 == 1) {
var_s3 = var_s6;
aSegment(cmd++, 0, 0);
aiBufPtr = aiBuf;
for (i = gAudioBufferParameters.updatesPerFrame; i > 0; i--) {
if (i == 1) {
chunkLen = bufLen;
} else {
if (bufLen / i >= gAudioBufferParameters.samplesPerUpdateMax) {
chunkLen = gAudioBufferParameters.samplesPerUpdateMax;
} else if (bufLen / i <= gAudioBufferParameters.samplesPerUpdateMin) {
chunkLen = gAudioBufferParameters.samplesPerUpdateMin;
} else {
temp_lo = var_s6 / var_s4_2;
if (temp_lo >= gAudioBufferParameters.samplesPerUpdateMax) {
var_s3 = (s32) gAudioBufferParameters.samplesPerUpdateMax;
} else if (gAudioBufferParameters.samplesPerUpdateMin >= temp_lo) {
var_s3 = (s32) gAudioBufferParameters.samplesPerUpdateMin;
} else {
var_s3 = (s32) gAudioBufferParameters.samplesPerUpdate;
}
chunkLen = gAudioBufferParameters.samplesPerUpdate;
}
if (gNumSynthesisReverbs > 0) {
var_s0 = gSynthesisReverbs;
do {
if (var_s0->useReverb != 0) {
prepare_reverb_ring_buffer(var_s3, temp_s2 - var_s4_2, var_s1);
}
var_s1 += 1;
var_s0 += 0x108;
} while (var_s1 < gNumSynthesisReverbs);
}
for (j = 0; j < gNumSynthesisReverbs; j++) {
if (gSynthesisReverbs[j].useReverb != 0) {
prepare_reverb_ring_buffer(chunkLen, gAudioBufferParameters.updatesPerFrame - i, j);
}
temp_v0 = func_800B775C(var_s7, var_s3, var_fp, temp_s2 - var_s4_2);
var_s4_2 -= 1;
var_fp = temp_v0;
var_s6 -= var_s3;
var_s7 += var_s3 * 4;
} while (var_s4_2 > 0);
}
cmd = synthesis_do_one_audio_update((s16 *) aiBufPtr, chunkLen, cmd, gAudioBufferParameters.updatesPerFrame - i);
bufLen -= chunkLen;
aiBufPtr += chunkLen;
}
var_s0_2 = gSynthesisReverbs;
if (gNumSynthesisReverbs > 0) {
do {
temp_v0_2 = var_s0_2->framesLeftToIgnore;
if (temp_v0_2 != 0) {
var_s0_2->framesLeftToIgnore = temp_v0_2 - 1;
}
temp_t4 = var_s0_2->curFrame;
var_s0_2 += 0x108;
var_s0_2->unk-105 = (s8) (temp_t4 ^ 1);
} while ((u32) var_s0_2 < (u32) &gSynthesisReverbs[gNumSynthesisReverbs]);
for (j = 0; j < gNumSynthesisReverbs; j++) {
if (gSynthesisReverbs[j].framesLeftToIgnore != 0) {
gSynthesisReverbs[j].framesLeftToIgnore--;
}
gSynthesisReverbs[j].curFrame ^= 1;
}
*writtenCmds = (s32) (var_fp - acmd) >> 3;
return var_fp;
*writtenCmds = cmd - acmd;
return cmd;
}
#else
GLOBAL_ASM("asm/non_matchings/audio/synthesis/func_800B70EC.s")
#endif
Acmd *synthesis_resample_and_mix_reverb(Acmd *acmd, s32 bufLen, s16 reverbIndex, s16 updateIndex) {
struct ReverbRingBufferItem *item;
@ -277,7 +230,7 @@ Acmd *synthesis_resample_and_mix_reverb(Acmd *acmd, s32 bufLen, s16 reverbIndex,
return acmd;
}
Acmd *synthesis_load_reverb_samples(Acmd *acmd, s16 reverbIndex, s16 updateIndex) {
Acmd *synthesis_save_reverb_samples(Acmd *acmd, s16 reverbIndex, s16 updateIndex) {
struct ReverbRingBufferItem *item;
item = &gSynthesisReverbs[reverbIndex].items[gSynthesisReverbs[reverbIndex].curFrame][updateIndex];
@ -298,165 +251,82 @@ Acmd *synthesis_load_reverb_samples(Acmd *acmd, s16 reverbIndex, s16 updateIndex
return acmd;
}
#ifdef MIPS_TO_C
//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Aug-14-2023
Acmd *func_800B7C30(u8, struct NoteSubEu *, struct NoteSynthesisState *, s16 *, s32, Acmd *, s32); /* extern */
extern u8 gUseReverb;
Acmd *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, Acmd *acmd, s32 updateIndex) {
struct NoteSubEu *noteSubEu;
u8 noteIndices[56];
s32 temp;
s32 i;
s16 j;
s16 notePos = 0;
Acmd *func_800B775C(s16 *aiBuf, s32 bufLen, Acmd *acmd, s32 updateIndex) {
? sp84;
struct SynthesisReverb *sp64;
Acmd *temp_s4;
Acmd *temp_s4_2;
Acmd *var_s4;
s16 var_s2;
s16 var_s3;
s32 temp_lo;
s32 temp_lo_2;
s32 temp_t3_2;
s32 var_v1;
s32 var_v1_2;
s8 *temp_t4;
s8 *temp_t5;
s8 *temp_t8;
s8 var_s1;
s8 var_s1_2;
struct NoteSubEu *temp_v0;
struct NoteSubEu *temp_v0_2;
struct NoteSubEu *var_v0;
struct SynthesisReverb *temp_t9;
u8 *var_s0;
u8 *var_s0_2;
u8 temp_a1;
u8 temp_t3;
u8 temp_v1;
u8 temp_v1_2;
var_s2 = 0;
if (gNumSynthesisReverbs == 0) {
var_s1 = 0;
if (gMaxSimultaneousNotes > 0) {
var_v0 = &gNoteSubsEu[gMaxSimultaneousNotes * updateIndex];
do {
temp_t4 = &sp84 + var_s2;
if (((u32) *var_v0 >> 0x1F) != 0) {
var_s2 += 1;
*temp_t4 = var_s1;
}
var_s1 += 1;
var_v0 += 0x10;
} while (var_s1 < gMaxSimultaneousNotes);
var_s1 = 0;
for (i = 0; i < gMaxSimultaneousNotes; i++) {
if (gNoteSubsEu[gMaxSimultaneousNotes * updateIndex + i].enabled) {
noteIndices[notePos++] = i;
}
}
var_s3 = 0;
} else {
var_s3 = 0;
if (gNumSynthesisReverbs > 0) {
do {
var_s1_2 = 0;
if (gMaxSimultaneousNotes > 0) {
var_v1 = gMaxSimultaneousNotes * updateIndex;
do {
temp_v0 = &gNoteSubsEu[var_v1];
if (((u32) temp_v0->unk0 >> 0x1F) != 0) {
temp_t5 = &sp84 + var_s2;
if (var_s3 == ((u8) temp_v0->unk1 >> 5)) {
var_s2 += 1;
*temp_t5 = var_s1_2;
}
}
var_s1_2 += 1;
var_v1 += 1;
} while (var_s1_2 < gMaxSimultaneousNotes);
for (j = 0; j < gNumSynthesisReverbs; j++) {
for (i = 0; i < gMaxSimultaneousNotes; i++) {
noteSubEu = &gNoteSubsEu[gMaxSimultaneousNotes * updateIndex + i];
if (noteSubEu->enabled && j == noteSubEu->reverbIndex) {
noteIndices[notePos++] = i;
}
var_s3 += 1;
} while (var_s3 < gNumSynthesisReverbs);
var_s3 = 0;
}
}
var_s1 = 0;
if (gMaxSimultaneousNotes > 0) {
var_v1_2 = gMaxSimultaneousNotes * updateIndex;
do {
temp_v0_2 = &gNoteSubsEu[var_v1_2];
if (((u32) temp_v0_2->unk0 >> 0x1F) != 0) {
temp_t8 = &sp84 + var_s2;
if ((s32) ((u8) temp_v0_2->unk1 >> 5) >= gNumSynthesisReverbs) {
var_s2 += 1;
*temp_t8 = var_s1;
}
}
var_s1 += 1;
var_v1_2 += 1;
} while (var_s1 < gMaxSimultaneousNotes);
var_s1 = 0;
for (i = 0; i < gMaxSimultaneousNotes; i++) {
noteSubEu = &gNoteSubsEu[gMaxSimultaneousNotes * updateIndex + i];
if (noteSubEu->enabled && noteSubEu->reverbIndex >= gNumSynthesisReverbs) {
noteIndices[notePos++] = i;
}
}
}
acmd->words.w1 = 0x00000300;
acmd->words.w0 = 0x02000540;
var_s4 = acmd + 8;
if (gNumSynthesisReverbs > 0) {
do {
temp_t9 = &gSynthesisReverbs[var_s3];
sp64 = temp_t9;
temp_t3 = temp_t9->useReverb;
gUseReverb = temp_t3;
if ((s8) temp_t3 != 0) {
var_s4 = synthesis_resample_and_mix_reverb(var_s4, bufLen, var_s3, (s16) updateIndex);
}
if (var_s1 < var_s2) {
var_s0 = var_s1 + &sp84;
loop_31:
temp_v1 = *var_s0;
temp_lo = updateIndex * gMaxSimultaneousNotes;
if (var_s3 == ((u8) (&gNoteSubsEu[temp_v1])[temp_lo].unk1 >> 5)) {
var_s1 += 1;
var_s4 = func_800B7C30(temp_v1, &gNoteSubsEu[temp_v1 + temp_lo], &gNotes[temp_v1].synthesisState, aiBuf, bufLen, var_s4, updateIndex);
var_s0 += 1;
if (var_s1 < var_s2) {
goto loop_31;
}
}
}
if (sp64->useReverb != 0) {
var_s4 = synthesis_load_reverb_samples(var_s4, var_s3, (s16) updateIndex);
}
var_s3 += 1;
} while (var_s3 < gNumSynthesisReverbs);
}
if (var_s1 < var_s2) {
var_s0_2 = var_s1 + &sp84;
do {
temp_v1_2 = *var_s0_2;
temp_lo_2 = updateIndex * gMaxSimultaneousNotes;
temp_a1 = (&gNoteSubsEu[temp_v1_2])[temp_lo_2].bankId;
if ((((s32) gBankLoadStatus[temp_a1] < 2) ^ 1) == 1) {
var_s4 = func_800B7C30(temp_v1_2, &gNoteSubsEu[temp_v1_2 + temp_lo_2], &gNotes[temp_v1_2].synthesisState, aiBuf, bufLen, var_s4, updateIndex);
aClearBuffer(acmd++, DMEM_ADDR_LEFT_CH, DEFAULT_LEN_2CH);
i = 0;
for (j = 0; j < gNumSynthesisReverbs; j++) {
gUseReverb = gSynthesisReverbs[j].useReverb;
if (gUseReverb != 0) {
acmd = synthesis_resample_and_mix_reverb(acmd, bufLen, j, updateIndex);
}
for (; i < notePos; i++) {
temp = updateIndex * gMaxSimultaneousNotes;
if (j == gNoteSubsEu[temp + noteIndices[i]].reverbIndex) {
acmd = synthesis_process_note(noteIndices[i],
&gNoteSubsEu[temp + noteIndices[i]],
&gNotes[noteIndices[i]].synthesisState,
aiBuf, bufLen, acmd, updateIndex);
continue;
} else {
gAudioErrorFlags = temp_a1 + (var_s1 << 8) + 0x10000000;
break;
}
var_s1 += 1;
var_s0_2 += 1;
} while (var_s1 < var_s2);
}
if (gSynthesisReverbs[j].useReverb != 0) {
acmd = synthesis_save_reverb_samples(acmd, j, updateIndex);
}
}
var_s4->words.w0 = 0x08000000;
temp_s4_2 = var_s4 + 8;
temp_t3_2 = bufLen * 2;
var_s4->words.w1 = temp_t3_2 & 0xFFFF;
temp_s4 = temp_s4_2 + 8;
temp_s4_2->words.w0 = 0x0D000000;
temp_s4_2->words.w1 = 0x054006C0;
temp_s4->words.w0 = ((((s32) (temp_t3_2 * 2) >> 4) & 0xFF) << 0x10) | 0x15000000;
temp_s4->words.w1 = (u32) (aiBuf + 0x80000000);
return temp_s4 + 8;
for (; i < notePos; i++) {
temp = updateIndex * gMaxSimultaneousNotes;
if (IS_BANK_LOAD_COMPLETE(gNoteSubsEu[temp + noteIndices[i]].bankId) == TRUE) {
acmd = synthesis_process_note(noteIndices[i],
&gNoteSubsEu[temp + noteIndices[i]],
&gNotes[noteIndices[i]].synthesisState,
aiBuf, bufLen, acmd, updateIndex);
} else {
gAudioErrorFlags = (gNoteSubsEu[temp + noteIndices[i]].bankId + (i << 8)) + 0x10000000;
}
}
temp = bufLen * 2;
aSetBuffer(acmd++, 0, 0, DMEM_ADDR_TEMP, temp);
aInterleave(acmd++, DMEM_ADDR_LEFT_CH, DMEM_ADDR_RIGHT_CH);
aSaveBuffer(acmd++, DMEM_ADDR_TEMP, VIRTUAL_TO_PHYSICAL2(aiBuf), temp * 2);
return acmd;
}
#else
GLOBAL_ASM("asm/non_matchings/audio/synthesis/func_800B775C.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 08138748803d75e73e4a94bb0c619a273754ee9c on Sep-15-2023
// synthesis_process_notes
Acmd *func_800B7C30(s32 noteIndex, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s16 *aiBuf, s32 bufLen, Acmd *acmd, s32 updateIndex) {
//generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Nov-01-2023
Acmd *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s16 *aiBuf, s32 bufLen, Acmd *acmd, s32 updateIndex) {
void *sp130;
void *sp12C;
s32 *sp128;
@ -796,7 +666,7 @@ block_60:
return var_s2;
}
#else
GLOBAL_ASM("asm/non_matchings/audio/synthesis/func_800B7C30.s")
GLOBAL_ASM("asm/non_matchings/audio/synthesis/synthesis_process_note.s")
#endif
Acmd *load_wave_samples(Acmd *acmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamplesToLoad) {

View File

@ -95,13 +95,15 @@ struct SynthesisReverb {
#define ALIGN(val, amnt) (((val) + (1 << amnt) - 1) & ~((1 << amnt) - 1))
void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex);
u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen);
Acmd *synthesis_load_reverb_ring_buffer(Acmd*, u16, u16, s32, s32);
Acmd *synthesis_save_reverb_ring_buffer(Acmd*, u16, u16, s32, s32);
void func_800B6FB4(s32 updateIndexStart, s32 noteIndex);
void synthesis_load_note_subs_eu(s32 updateIndex);
Acmd *synthesis_execute(Acmd*, s32*, s16*, s32);
Acmd *synthesis_resample_and_mix_reverb(Acmd*, s32, s16, s16);
Acmd *synthesis_load_reverb_samples(Acmd*, s16, s16);
Acmd *synthesis_save_reverb_samples(Acmd*, s16, s16);
Acmd *synthesis_do_one_audio_update(s16*, s32, Acmd*, s32);
Acmd *synthesis_process_note(s32, struct NoteSubEu*, struct NoteSynthesisState*, s16*, s32, Acmd*, s32);
Acmd *load_wave_samples(Acmd *acmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamplesToLoad);
Acmd *final_resample(Acmd *acmd, struct NoteSynthesisState *synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags);
Acmd *func_800B86A0(Acmd *cmd, struct NoteSubEu *note, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, u32 flags);

View File

@ -1,6 +1,7 @@
#define STRANGE_MAIN_HEADER_H
#include <ultra64.h>
#include <PR/os.h>
#include <PR/ucode.h>
#include <macros.h>
#include <functions.h>
#include <types.h>
@ -273,8 +274,8 @@ void create_gfx_task_structure(void) {
gGfxSPTask->msg = (OSMesg) 2;
gGfxSPTask->task.t.type = M_GFXTASK;
gGfxSPTask->task.t.flags = OS_TASK_DP_WAIT;
gGfxSPTask->task.t.ucode_boot = rspbootTextStart;
gGfxSPTask->task.t.ucode_boot_size = ((u8 *) rspbootTextEnd - (u8 *) rspbootTextStart);
gGfxSPTask->task.t.ucode_boot = rspF3DBootStart;
gGfxSPTask->task.t.ucode_boot_size = ((u8 *) rspF3DBootEnd - (u8 *) rspF3DBootStart);
// The split-screen multiplayer racing state uses F3DLX which has a simple subpixel calculation.
// Singleplayer race mode and all other game states use F3DEX.
// http://n64devkit.square7.ch/n64man/ucode/gspF3DEX.htm

View File

@ -231,12 +231,6 @@ extern f32 gCourseTimer;
// end of definition of main.c variables
extern u64 rspbootTextStart[], rspbootTextEnd[];
extern u64 gspF3DEXTextStart[], gspF3DEXTextEnd[];
extern u64 gspF3DLXTextStart[], gspF3DLXTextEnd[];
extern u64 gspF3DEXDataStart[];
extern u64 gspF3DLXDataStart[];
extern u64 gGfxSPTaskOutputBuffer[];
extern u32 gGfxSPTaskOutputBufferSize;