mirror of
https://github.com/n64decomp/mk64.git
synced 2024-11-30 08:30:58 +00:00
More audio matches (#420)
Signed-off-by: Taggerung <tyler.taggerung@email.com>
This commit is contained in:
parent
4e583c6fd1
commit
8233fa2aab
@ -23,8 +23,8 @@ glabel audio_init
|
||||
/* 0BCCFC 800BC0FC AFB00014 */ sw $s0, 0x14($sp)
|
||||
/* 0BCD00 800BC100 25CEA5DC */ addiu $t6, %lo(gAudioLoadLock) # addiu $t6, $t6, -0x5a24
|
||||
/* 0BCD04 800BC104 ADC00000 */ sw $zero, ($t6)
|
||||
/* 0BCD08 800BC108 3C04800F */ lui $a0, %hi(D_800EA5D0) # $a0, 0x800f
|
||||
/* 0BCD0C 800BC10C 8C84A5D0 */ lw $a0, %lo(D_800EA5D0)($a0)
|
||||
/* 0BCD08 800BC108 3C04800F */ lui $a0, %hi(gAudioHeapSize) # $a0, 0x800f
|
||||
/* 0BCD0C 800BC10C 8C84A5D0 */ lw $a0, %lo(gAudioHeapSize)($a0)
|
||||
/* 0BCD10 800BC110 00001825 */ move $v1, $zero
|
||||
/* 0BCD14 800BC114 3C0A803B */ lui $t2, %hi(D_803B71A0) # $t2, 0x803b
|
||||
/* 0BCD18 800BC118 04810003 */ bgez $a0, .L800BC128
|
||||
@ -100,23 +100,23 @@ glabel audio_init
|
||||
.L800BC210:
|
||||
/* 0BCE10 800BC210 0C032FD2 */ jal func_800CBF48
|
||||
/* 0BCE14 800BC214 00000000 */ nop
|
||||
/* 0BCE18 800BC218 3C02803B */ lui $v0, %hi(D_803B718C) # $v0, 0x803b
|
||||
/* 0BCE18 800BC218 3C02803B */ lui $v0, %hi(gAiBufferLengths) # $v0, 0x803b
|
||||
/* 0BCE1C 800BC21C 3C04803B */ lui $a0, %hi(D_803B7192) # $a0, 0x803b
|
||||
/* 0BCE20 800BC220 24847192 */ addiu $a0, %lo(D_803B7192) # addiu $a0, $a0, 0x7192
|
||||
/* 0BCE24 800BC224 2442718C */ addiu $v0, %lo(D_803B718C) # addiu $v0, $v0, 0x718c
|
||||
/* 0BCE24 800BC224 2442718C */ addiu $v0, %lo(gAiBufferLengths) # addiu $v0, $v0, 0x718c
|
||||
/* 0BCE28 800BC228 240300A0 */ li $v1, 160
|
||||
.L800BC22C:
|
||||
/* 0BCE2C 800BC22C 24420002 */ addiu $v0, $v0, 2
|
||||
/* 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(D_803B70B8) # $t8, 0x803b
|
||||
/* 0BCE40 800BC240 271870B8 */ addiu $t8, %lo(D_803B70B8) # addiu $t8, $t8, 0x70b8
|
||||
/* 0BCE3C 800BC23C 3C18803B */ lui $t8, %hi(gAudioUpdatesPerFrame) # $t8, 0x803b
|
||||
/* 0BCE40 800BC240 271870B8 */ addiu $t8, %lo(gAudioUpdatesPerFrame) # addiu $t8, $t8, 0x70b8
|
||||
/* 0BCE44 800BC244 AF000000 */ sw $zero, ($t8)
|
||||
/* 0BCE48 800BC248 3C01803B */ lui $at, %hi(D_803B70C0) # $at, 0x803b
|
||||
/* 0BCE4C 800BC24C AC2070C0 */ sw $zero, %lo(D_803B70C0)($at)
|
||||
/* 0BCE50 800BC250 3C01803B */ lui $at, %hi(D_803B70C4) # $at, 0x803b
|
||||
/* 0BCE54 800BC254 AC2070C4 */ sw $zero, %lo(D_803B70C4)($at)
|
||||
/* 0BCE48 800BC248 3C01803B */ lui $at, %hi(gAudioTaskIndex) # $at, 0x803b
|
||||
/* 0BCE4C 800BC24C AC2070C0 */ sw $zero, %lo(gAudioTaskIndex)($at)
|
||||
/* 0BCE50 800BC250 3C01803B */ lui $at, %hi(gCurrAiBufferIndex) # $at, 0x803b
|
||||
/* 0BCE54 800BC254 AC2070C4 */ sw $zero, %lo(gCurrAiBufferIndex)($at)
|
||||
/* 0BCE58 800BC258 3C01803B */ lui $at, %hi(gAudioLibSoundMode) # $at, 0x803b
|
||||
/* 0BCE5C 800BC25C A02070B6 */ sb $zero, %lo(gAudioLibSoundMode)($at)
|
||||
/* 0BCE60 800BC260 3C02803B */ lui $v0, %hi(gAudioTasks) # $v0, 0x803b
|
||||
@ -140,14 +140,14 @@ glabel audio_init
|
||||
/* 0BCEA8 800BC2A8 3C01803B */ lui $at, %hi(gCurrAudioFrameDmaCount) # $at, 0x803b
|
||||
/* 0BCEAC 800BC2AC AC2070BC */ sw $zero, %lo(gCurrAudioFrameDmaCount)($at)
|
||||
/* 0BCEB0 800BC2B0 3C01803B */ lui $at, %hi(gSampleDmaNumListItems) # $at, 0x803b
|
||||
/* 0BCEB4 800BC2B4 3C04800F */ lui $a0, %hi(D_800EA5D4) # $a0, 0x800f
|
||||
/* 0BCEB4 800BC2B4 3C04800F */ lui $a0, %hi(gAudioInitPoolSize) # $a0, 0x800f
|
||||
/* 0BCEB8 800BC2B8 AC206E58 */ sw $zero, %lo(gSampleDmaNumListItems)($at)
|
||||
/* 0BCEBC 800BC2BC 0C02E43C */ jal func_800B90F0
|
||||
/* 0BCEC0 800BC2C0 8C84A5D4 */ lw $a0, %lo(D_800EA5D4)($a0)
|
||||
/* 0BCEC0 800BC2C0 8C84A5D4 */ lw $a0, %lo(gAudioInitPoolSize)($a0)
|
||||
/* 0BCEC4 800BC2C4 3C06803B */ lui $a2, %hi(gAiBuffers) # $a2, 0x803b
|
||||
/* 0BCEC8 800BC2C8 3C14803B */ lui $s4, %hi(gAudioInitPool) # $s4, 0x803b
|
||||
/* 0BCECC 800BC2CC 3C11803B */ lui $s1, %hi(D_803B718C) # $s1, 0x803b
|
||||
/* 0BCED0 800BC2D0 2631718C */ addiu $s1, %lo(D_803B718C) # addiu $s1, $s1, 0x718c
|
||||
/* 0BCECC 800BC2CC 3C11803B */ lui $s1, %hi(gAiBufferLengths) # $s1, 0x803b
|
||||
/* 0BCED0 800BC2D0 2631718C */ addiu $s1, %lo(gAiBufferLengths) # addiu $s1, $s1, 0x718c
|
||||
/* 0BCED4 800BC2D4 2694FBD8 */ addiu $s4, %lo(gAudioInitPool) # addiu $s4, $s4, -0x428
|
||||
/* 0BCED8 800BC2D8 24C67180 */ addiu $a2, %lo(gAiBuffers) # addiu $a2, $a2, 0x7180
|
||||
/* 0BCEDC 800BC2DC 24100A00 */ li $s0, 2560
|
||||
|
@ -1,218 +0,0 @@
|
||||
glabel func_800BAD0C
|
||||
/* 0BB90C 800BAD0C 27BDFFB8 */ addiu $sp, $sp, -0x48
|
||||
/* 0BB910 800BAD10 AFB10028 */ sw $s1, 0x28($sp)
|
||||
/* 0BB914 800BAD14 AFB00024 */ sw $s0, 0x24($sp)
|
||||
/* 0BB918 800BAD18 00A08025 */ move $s0, $a1
|
||||
/* 0BB91C 800BAD1C 00808825 */ move $s1, $a0
|
||||
/* 0BB920 800BAD20 AFBF002C */ sw $ra, 0x2c($sp)
|
||||
/* 0BB924 800BAD24 AFA70054 */ sw $a3, 0x54($sp)
|
||||
/* 0BB928 800BAD28 14C00008 */ bnez $a2, .L800BAD4C
|
||||
/* 0BB92C 800BAD2C 00005825 */ move $t3, $zero
|
||||
/* 0BB930 800BAD30 3C05803B */ lui $a1, %hi(sSampleDmaListSize1) # $a1, 0x803b
|
||||
/* 0BB934 800BAD34 8CA56E5C */ lw $a1, %lo(sSampleDmaListSize1)($a1)
|
||||
/* 0BB938 800BAD38 90E20000 */ lbu $v0, ($a3)
|
||||
/* 0BB93C 800BAD3C 00001825 */ move $v1, $zero
|
||||
/* 0BB940 800BAD40 0045082B */ sltu $at, $v0, $a1
|
||||
/* 0BB944 800BAD44 14200055 */ bnez $at, .L800BAE9C
|
||||
/* 0BB948 800BAD48 00026900 */ sll $t5, $v0, 4
|
||||
.L800BAD4C:
|
||||
/* 0BB94C 800BAD4C 3C03803B */ lui $v1, %hi(sSampleDmaListSize1) # $v1, 0x803b
|
||||
/* 0BB950 800BAD50 3C05803B */ lui $a1, %hi(gSampleDmaNumListItems) # $a1, 0x803b
|
||||
/* 0BB954 800BAD54 8CA56E58 */ lw $a1, %lo(gSampleDmaNumListItems)($a1)
|
||||
/* 0BB958 800BAD58 8C636E5C */ lw $v1, %lo(sSampleDmaListSize1)($v1)
|
||||
/* 0BB95C 800BAD5C 3C18803B */ lui $t8, %hi(sSampleDmas) # $t8, 0x803b
|
||||
/* 0BB960 800BAD60 27186758 */ addiu $t8, %lo(sSampleDmas) # addiu $t8, $t8, 0x6758
|
||||
/* 0BB964 800BAD64 0065082B */ sltu $at, $v1, $a1
|
||||
/* 0BB968 800BAD68 10200034 */ beqz $at, .L800BAE3C
|
||||
/* 0BB96C 800BAD6C 00037900 */ sll $t7, $v1, 4
|
||||
/* 0BB970 800BAD70 01F82021 */ addu $a0, $t7, $t8
|
||||
.L800BAD74:
|
||||
/* 0BB974 800BAD74 8C990004 */ lw $t9, 4($a0)
|
||||
/* 0BB978 800BAD78 00804025 */ move $t0, $a0
|
||||
/* 0BB97C 800BAD7C 02391023 */ subu $v0, $s1, $t9
|
||||
/* 0BB980 800BAD80 0442002A */ bltzl $v0, .L800BAE2C
|
||||
/* 0BB984 800BAD84 24630001 */ addiu $v1, $v1, 1
|
||||
/* 0BB988 800BAD88 948D000A */ lhu $t5, 0xa($a0)
|
||||
/* 0BB98C 800BAD8C 01B07023 */ subu $t6, $t5, $s0
|
||||
/* 0BB990 800BAD90 01C2082B */ sltu $at, $t6, $v0
|
||||
/* 0BB994 800BAD94 54200025 */ bnel $at, $zero, .L800BAE2C
|
||||
/* 0BB998 800BAD98 24630001 */ addiu $v1, $v1, 1
|
||||
/* 0BB99C 800BAD9C 908F000E */ lbu $t7, 0xe($a0)
|
||||
/* 0BB9A0 800BADA0 3C09803B */ lui $t1, %hi(sSampleDmaReuseQueueTail2) # $t1, 0x803b
|
||||
/* 0BB9A4 800BADA4 25297069 */ addiu $t1, %lo(sSampleDmaReuseQueueTail2) # addiu $t1, $t1, 0x7069
|
||||
/* 0BB9A8 800BADA8 15E00016 */ bnez $t7, .L800BAE04
|
||||
/* 0BB9AC 800BADAC 3C18803B */ lui $t8, %hi(sSampleDmaReuseQueueHead2) # $t8, 0x803b
|
||||
/* 0BB9B0 800BADB0 91250000 */ lbu $a1, ($t1)
|
||||
/* 0BB9B4 800BADB4 9318706B */ lbu $t8, %lo(sSampleDmaReuseQueueHead2)($t8)
|
||||
/* 0BB9B8 800BADB8 53050013 */ beql $t8, $a1, .L800BAE08
|
||||
/* 0BB9BC 800BADBC 8FB80054 */ lw $t8, 0x54($sp)
|
||||
/* 0BB9C0 800BADC0 9087000D */ lbu $a3, 0xd($a0)
|
||||
/* 0BB9C4 800BADC4 3C0C803B */ lui $t4, %hi(sSampleDmaReuseQueue2) # $t4, 0x803b
|
||||
/* 0BB9C8 800BADC8 258C6F68 */ addiu $t4, %lo(sSampleDmaReuseQueue2) # addiu $t4, $t4, 0x6f68
|
||||
/* 0BB9CC 800BADCC 10A7000B */ beq $a1, $a3, .L800BADFC
|
||||
/* 0BB9D0 800BADD0 01851021 */ addu $v0, $t4, $a1
|
||||
/* 0BB9D4 800BADD4 90590000 */ lbu $t9, ($v0)
|
||||
/* 0BB9D8 800BADD8 01876821 */ addu $t5, $t4, $a3
|
||||
/* 0BB9DC 800BADDC 3C06803B */ lui $a2, %hi(sSampleDmas) # $a2, 0x803b
|
||||
/* 0BB9E0 800BADE0 A1B90000 */ sb $t9, ($t5)
|
||||
/* 0BB9E4 800BADE4 904F0000 */ lbu $t7, ($v0)
|
||||
/* 0BB9E8 800BADE8 908E000D */ lbu $t6, 0xd($a0)
|
||||
/* 0BB9EC 800BADEC 24C66758 */ addiu $a2, %lo(sSampleDmas) # addiu $a2, $a2, 0x6758
|
||||
/* 0BB9F0 800BADF0 000FC100 */ sll $t8, $t7, 4
|
||||
/* 0BB9F4 800BADF4 00D8C821 */ addu $t9, $a2, $t8
|
||||
/* 0BB9F8 800BADF8 A32E000D */ sb $t6, 0xd($t9)
|
||||
.L800BADFC:
|
||||
/* 0BB9FC 800BADFC 24AD0001 */ addiu $t5, $a1, 1
|
||||
/* 0BBA00 800BAE00 A12D0000 */ sb $t5, ($t1)
|
||||
.L800BAE04:
|
||||
/* 0BBA04 800BAE04 8FB80054 */ lw $t8, 0x54($sp)
|
||||
.L800BAE08:
|
||||
/* 0BBA08 800BAE08 240F003C */ li $t7, 60
|
||||
/* 0BBA0C 800BAE0C A08F000E */ sb $t7, 0xe($a0)
|
||||
/* 0BBA10 800BAE10 A3030000 */ sb $v1, ($t8)
|
||||
/* 0BBA14 800BAE14 8C8E0000 */ lw $t6, ($a0)
|
||||
/* 0BBA18 800BAE18 8C8D0004 */ lw $t5, 4($a0)
|
||||
/* 0BBA1C 800BAE1C 01D1C821 */ addu $t9, $t6, $s1
|
||||
/* 0BBA20 800BAE20 1000007E */ b .L800BB01C
|
||||
/* 0BBA24 800BAE24 032D1023 */ subu $v0, $t9, $t5
|
||||
/* 0BBA28 800BAE28 24630001 */ addiu $v1, $v1, 1
|
||||
.L800BAE2C:
|
||||
/* 0BBA2C 800BAE2C 0065082B */ sltu $at, $v1, $a1
|
||||
/* 0BBA30 800BAE30 1420FFD0 */ bnez $at, .L800BAD74
|
||||
/* 0BBA34 800BAE34 24840010 */ addiu $a0, $a0, 0x10
|
||||
/* 0BBA38 800BAE38 AFA80040 */ sw $t0, 0x40($sp)
|
||||
.L800BAE3C:
|
||||
/* 0BBA3C 800BAE3C 3C09803B */ lui $t1, %hi(sSampleDmaReuseQueueTail2) # $t1, 0x803b
|
||||
/* 0BBA40 800BAE40 25297069 */ addiu $t1, %lo(sSampleDmaReuseQueueTail2) # addiu $t1, $t1, 0x7069
|
||||
/* 0BBA44 800BAE44 3C0F803B */ lui $t7, %hi(sSampleDmaReuseQueueHead2) # $t7, 0x803b
|
||||
/* 0BBA48 800BAE48 91EF706B */ lbu $t7, %lo(sSampleDmaReuseQueueHead2)($t7)
|
||||
/* 0BBA4C 800BAE4C 91250000 */ lbu $a1, ($t1)
|
||||
/* 0BBA50 800BAE50 8FA80040 */ lw $t0, 0x40($sp)
|
||||
/* 0BBA54 800BAE54 11E5000E */ beq $t7, $a1, .L800BAE90
|
||||
/* 0BBA58 800BAE58 00000000 */ nop
|
||||
/* 0BBA5C 800BAE5C 10C0000C */ beqz $a2, .L800BAE90
|
||||
/* 0BBA60 800BAE60 3C0C803B */ lui $t4, %hi(sSampleDmaReuseQueue2) # $t4, 0x803b
|
||||
/* 0BBA64 800BAE64 258C6F68 */ addiu $t4, %lo(sSampleDmaReuseQueue2) # addiu $t4, $t4, 0x6f68
|
||||
/* 0BBA68 800BAE68 0185C021 */ addu $t8, $t4, $a1
|
||||
/* 0BBA6C 800BAE6C 930A0000 */ lbu $t2, ($t8)
|
||||
/* 0BBA70 800BAE70 3C06803B */ lui $a2, %hi(sSampleDmas) # $a2, 0x803b
|
||||
/* 0BBA74 800BAE74 24C66758 */ addiu $a2, %lo(sSampleDmas) # addiu $a2, $a2, 0x6758
|
||||
/* 0BBA78 800BAE78 24AE0001 */ addiu $t6, $a1, 1
|
||||
/* 0BBA7C 800BAE7C 000AC900 */ sll $t9, $t2, 4
|
||||
/* 0BBA80 800BAE80 A12E0000 */ sb $t6, ($t1)
|
||||
/* 0BBA84 800BAE84 00D94021 */ addu $t0, $a2, $t9
|
||||
/* 0BBA88 800BAE88 240B0001 */ li $t3, 1
|
||||
/* 0BBA8C 800BAE8C AFAA0030 */ sw $t2, 0x30($sp)
|
||||
.L800BAE90:
|
||||
/* 0BBA90 800BAE90 3C06803B */ lui $a2, %hi(sSampleDmas) # $a2, 0x803b
|
||||
/* 0BBA94 800BAE94 1000002F */ b .L800BAF54
|
||||
/* 0BBA98 800BAE98 24C66758 */ addiu $a2, %lo(sSampleDmas) # addiu $a2, $a2, 0x6758
|
||||
.L800BAE9C:
|
||||
/* 0BBA9C 800BAE9C 3C06803B */ lui $a2, %hi(sSampleDmas) # $a2, 0x803b
|
||||
/* 0BBAA0 800BAEA0 24C66758 */ addiu $a2, %lo(sSampleDmas) # addiu $a2, $a2, 0x6758
|
||||
/* 0BBAA4 800BAEA4 10A0002B */ beqz $a1, .L800BAF54
|
||||
/* 0BBAA8 800BAEA8 00CD4021 */ addu $t0, $a2, $t5
|
||||
.L800BAEAC:
|
||||
/* 0BBAAC 800BAEAC 8D040004 */ lw $a0, 4($t0)
|
||||
/* 0BBAB0 800BAEB0 0003C900 */ sll $t9, $v1, 4
|
||||
/* 0BBAB4 800BAEB4 24630001 */ addiu $v1, $v1, 1
|
||||
/* 0BBAB8 800BAEB8 02241023 */ subu $v0, $s1, $a0
|
||||
/* 0BBABC 800BAEBC 04420023 */ bltzl $v0, .L800BAF4C
|
||||
/* 0BBAC0 800BAEC0 0065082B */ sltu $at, $v1, $a1
|
||||
/* 0BBAC4 800BAEC4 950F000A */ lhu $t7, 0xa($t0)
|
||||
/* 0BBAC8 800BAEC8 01F0C023 */ subu $t8, $t7, $s0
|
||||
/* 0BBACC 800BAECC 0302082B */ sltu $at, $t8, $v0
|
||||
/* 0BBAD0 800BAED0 5420001E */ bnel $at, $zero, .L800BAF4C
|
||||
/* 0BBAD4 800BAED4 0065082B */ sltu $at, $v1, $a1
|
||||
/* 0BBAD8 800BAED8 910E000E */ lbu $t6, 0xe($t0)
|
||||
/* 0BBADC 800BAEDC 3C05803B */ lui $a1, %hi(sSampleDmaReuseQueueTail1) # $a1, 0x803b
|
||||
/* 0BBAE0 800BAEE0 24A57068 */ addiu $a1, %lo(sSampleDmaReuseQueueTail1) # addiu $a1, $a1, 0x7068
|
||||
/* 0BBAE4 800BAEE4 55C00013 */ bnel $t6, $zero, .L800BAF34
|
||||
/* 0BBAE8 800BAEE8 8D0E0000 */ lw $t6, ($t0)
|
||||
/* 0BBAEC 800BAEEC 90A30000 */ lbu $v1, ($a1)
|
||||
/* 0BBAF0 800BAEF0 9104000D */ lbu $a0, 0xd($t0)
|
||||
/* 0BBAF4 800BAEF4 3C07803B */ lui $a3, %hi(sSampleDmaReuseQueue1) # $a3, 0x803b
|
||||
/* 0BBAF8 800BAEF8 24E76E68 */ addiu $a3, %lo(sSampleDmaReuseQueue1) # addiu $a3, $a3, 0x6e68
|
||||
/* 0BBAFC 800BAEFC 10640009 */ beq $v1, $a0, .L800BAF24
|
||||
/* 0BBB00 800BAF00 00E31021 */ addu $v0, $a3, $v1
|
||||
/* 0BBB04 800BAF04 90590000 */ lbu $t9, ($v0)
|
||||
/* 0BBB08 800BAF08 00E46821 */ addu $t5, $a3, $a0
|
||||
/* 0BBB0C 800BAF0C A1B90000 */ sb $t9, ($t5)
|
||||
/* 0BBB10 800BAF10 90580000 */ lbu $t8, ($v0)
|
||||
/* 0BBB14 800BAF14 910F000D */ lbu $t7, 0xd($t0)
|
||||
/* 0BBB18 800BAF18 00187100 */ sll $t6, $t8, 4
|
||||
/* 0BBB1C 800BAF1C 00CEC821 */ addu $t9, $a2, $t6
|
||||
/* 0BBB20 800BAF20 A32F000D */ sb $t7, 0xd($t9)
|
||||
.L800BAF24:
|
||||
/* 0BBB24 800BAF24 246D0001 */ addiu $t5, $v1, 1
|
||||
/* 0BBB28 800BAF28 A0AD0000 */ sb $t5, ($a1)
|
||||
/* 0BBB2C 800BAF2C 8D040004 */ lw $a0, 4($t0)
|
||||
/* 0BBB30 800BAF30 8D0E0000 */ lw $t6, ($t0)
|
||||
.L800BAF34:
|
||||
/* 0BBB34 800BAF34 24180002 */ li $t8, 2
|
||||
/* 0BBB38 800BAF38 A118000E */ sb $t8, 0xe($t0)
|
||||
/* 0BBB3C 800BAF3C 01D17821 */ addu $t7, $t6, $s1
|
||||
/* 0BBB40 800BAF40 10000036 */ b .L800BB01C
|
||||
/* 0BBB44 800BAF44 01E41023 */ subu $v0, $t7, $a0
|
||||
/* 0BBB48 800BAF48 0065082B */ sltu $at, $v1, $a1
|
||||
.L800BAF4C:
|
||||
/* 0BBB4C 800BAF4C 1420FFD7 */ bnez $at, .L800BAEAC
|
||||
/* 0BBB50 800BAF50 00D94021 */ addu $t0, $a2, $t9
|
||||
.L800BAF54:
|
||||
/* 0BBB54 800BAF54 1560000C */ bnez $t3, .L800BAF88
|
||||
/* 0BBB58 800BAF58 8FAA0030 */ lw $t2, 0x30($sp)
|
||||
/* 0BBB5C 800BAF5C 3C05803B */ lui $a1, %hi(sSampleDmaReuseQueueTail1) # $a1, 0x803b
|
||||
/* 0BBB60 800BAF60 24A57068 */ addiu $a1, %lo(sSampleDmaReuseQueueTail1) # addiu $a1, $a1, 0x7068
|
||||
/* 0BBB64 800BAF64 90A30000 */ lbu $v1, ($a1)
|
||||
/* 0BBB68 800BAF68 3C07803B */ lui $a3, %hi(sSampleDmaReuseQueue1) # $a3, 0x803b
|
||||
/* 0BBB6C 800BAF6C 24E76E68 */ addiu $a3, %lo(sSampleDmaReuseQueue1) # addiu $a3, $a3, 0x6e68
|
||||
/* 0BBB70 800BAF70 00E36821 */ addu $t5, $a3, $v1
|
||||
/* 0BBB74 800BAF74 91AA0000 */ lbu $t2, ($t5)
|
||||
/* 0BBB78 800BAF78 24780001 */ addiu $t8, $v1, 1
|
||||
/* 0BBB7C 800BAF7C A0B80000 */ sb $t8, ($a1)
|
||||
/* 0BBB80 800BAF80 000A7100 */ sll $t6, $t2, 4
|
||||
/* 0BBB84 800BAF84 00CE4021 */ addu $t0, $a2, $t6
|
||||
.L800BAF88:
|
||||
/* 0BBB88 800BAF88 9502000A */ lhu $v0, 0xa($t0)
|
||||
/* 0BBB8C 800BAF8C 2401FFF0 */ li $at, -16
|
||||
/* 0BBB90 800BAF90 3C09803B */ lui $t1, %hi(gCurrAudioFrameDmaCount) # $t1, 0x803b
|
||||
/* 0BBB94 800BAF94 240F0002 */ li $t7, 2
|
||||
/* 0BBB98 800BAF98 02218024 */ and $s0, $s1, $at
|
||||
/* 0BBB9C 800BAF9C 252970BC */ addiu $t1, %lo(gCurrAudioFrameDmaCount) # addiu $t1, $t1, 0x70bc
|
||||
/* 0BBBA0 800BAFA0 A10F000E */ sb $t7, 0xe($t0)
|
||||
/* 0BBBA4 800BAFA4 AD100004 */ sw $s0, 4($t0)
|
||||
/* 0BBBA8 800BAFA8 A5020008 */ sh $v0, 8($t0)
|
||||
/* 0BBBAC 800BAFAC 8D230000 */ lw $v1, ($t1)
|
||||
/* 0BBBB0 800BAFB0 8D180000 */ lw $t8, ($t0)
|
||||
/* 0BBBB4 800BAFB4 3C0D803B */ lui $t5, %hi(gCurrAudioFrameDmaIoMesgBufs) # $t5, 0x803b
|
||||
/* 0BBBB8 800BAFB8 0003C880 */ sll $t9, $v1, 2
|
||||
/* 0BBBBC 800BAFBC 3C0E803B */ lui $t6, %hi(gCurrAudioFrameDmaQueue) # $t6, 0x803b
|
||||
/* 0BBBC0 800BAFC0 0323C823 */ subu $t9, $t9, $v1
|
||||
/* 0BBBC4 800BAFC4 0019C8C0 */ sll $t9, $t9, 3
|
||||
/* 0BBBC8 800BAFC8 25CE6008 */ addiu $t6, %lo(gCurrAudioFrameDmaQueue) # addiu $t6, $t6, 0x6008
|
||||
/* 0BBBCC 800BAFCC 25AD6120 */ addiu $t5, %lo(gCurrAudioFrameDmaIoMesgBufs) # addiu $t5, $t5, 0x6120
|
||||
/* 0BBBD0 800BAFD0 246F0001 */ addiu $t7, $v1, 1
|
||||
/* 0BBBD4 800BAFD4 AD2F0000 */ sw $t7, ($t1)
|
||||
/* 0BBBD8 800BAFD8 032D2021 */ addu $a0, $t9, $t5
|
||||
/* 0BBBDC 800BAFDC AFAE0018 */ sw $t6, 0x18($sp)
|
||||
/* 0BBBE0 800BAFE0 AFAA0030 */ sw $t2, 0x30($sp)
|
||||
/* 0BBBE4 800BAFE4 AFA80040 */ sw $t0, 0x40($sp)
|
||||
/* 0BBBE8 800BAFE8 02003825 */ move $a3, $s0
|
||||
/* 0BBBEC 800BAFEC 00002825 */ move $a1, $zero
|
||||
/* 0BBBF0 800BAFF0 00003025 */ move $a2, $zero
|
||||
/* 0BBBF4 800BAFF4 AFA20014 */ sw $v0, 0x14($sp)
|
||||
/* 0BBBF8 800BAFF8 0C03370C */ jal osPiStartDma
|
||||
/* 0BBBFC 800BAFFC AFB80010 */ sw $t8, 0x10($sp)
|
||||
/* 0BBC00 800BB000 8FAA0030 */ lw $t2, 0x30($sp)
|
||||
/* 0BBC04 800BB004 8FB90054 */ lw $t9, 0x54($sp)
|
||||
/* 0BBC08 800BB008 8FA80040 */ lw $t0, 0x40($sp)
|
||||
/* 0BBC0C 800BB00C 02306823 */ subu $t5, $s1, $s0
|
||||
/* 0BBC10 800BB010 A32A0000 */ sb $t2, ($t9)
|
||||
/* 0BBC14 800BB014 8D180000 */ lw $t8, ($t0)
|
||||
/* 0BBC18 800BB018 01B81021 */ addu $v0, $t5, $t8
|
||||
.L800BB01C:
|
||||
/* 0BBC1C 800BB01C 8FBF002C */ lw $ra, 0x2c($sp)
|
||||
/* 0BBC20 800BB020 8FB00024 */ lw $s0, 0x24($sp)
|
||||
/* 0BBC24 800BB024 8FB10028 */ lw $s1, 0x28($sp)
|
||||
/* 0BBC28 800BB028 03E00008 */ jr $ra
|
||||
/* 0BBC2C 800BB02C 27BD0048 */ addiu $sp, $sp, 0x48
|
@ -1,22 +0,0 @@
|
||||
glabel func_800BB43C
|
||||
/* 0BC03C 800BB43C 84830002 */ lh $v1, 2($a0)
|
||||
/* 0BC040 800BB440 00001025 */ move $v0, $zero
|
||||
/* 0BC044 800BB444 00803025 */ move $a2, $a0
|
||||
/* 0BC048 800BB448 1860000C */ blez $v1, .L800BB47C
|
||||
/* 0BC04C 800BB44C 00000000 */ nop
|
||||
.L800BB450:
|
||||
/* 0BC050 800BB450 8CCE0008 */ lw $t6, 8($a2)
|
||||
/* 0BC054 800BB454 24420001 */ addiu $v0, $v0, 1
|
||||
/* 0BC058 800BB458 51C00006 */ beql $t6, $zero, .L800BB474
|
||||
/* 0BC05C 800BB45C 0043082A */ slt $at, $v0, $v1
|
||||
/* 0BC060 800BB460 8CCF0004 */ lw $t7, 4($a2)
|
||||
/* 0BC064 800BB464 01E5C021 */ addu $t8, $t7, $a1
|
||||
/* 0BC068 800BB468 ACD80004 */ sw $t8, 4($a2)
|
||||
/* 0BC06C 800BB46C 84830002 */ lh $v1, 2($a0)
|
||||
/* 0BC070 800BB470 0043082A */ slt $at, $v0, $v1
|
||||
.L800BB474:
|
||||
/* 0BC074 800BB474 1420FFF6 */ bnez $at, .L800BB450
|
||||
/* 0BC078 800BB478 24C60008 */ addiu $a2, $a2, 8
|
||||
.L800BB47C:
|
||||
/* 0BC07C 800BB47C 03E00008 */ jr $ra
|
||||
/* 0BC080 800BB480 00000000 */ nop
|
@ -1,42 +0,0 @@
|
||||
glabel func_800BB584
|
||||
/* 0BC184 800BB584 3C03803B */ lui $v1, %hi(gAlTbl) # $v1, 0x803b
|
||||
/* 0BC188 800BB588 8C637074 */ lw $v1, %lo(gAlTbl)($v1)
|
||||
/* 0BC18C 800BB58C 27BDFFE0 */ addiu $sp, $sp, -0x20
|
||||
/* 0BC190 800BB590 000478C0 */ sll $t7, $a0, 3
|
||||
/* 0BC194 800BB594 AFBF0014 */ sw $ra, 0x14($sp)
|
||||
/* 0BC198 800BB598 AFA40020 */ sw $a0, 0x20($sp)
|
||||
/* 0BC19C 800BB59C 006F1021 */ addu $v0, $v1, $t7
|
||||
/* 0BC1A0 800BB5A0 8C580008 */ lw $t8, 8($v0)
|
||||
/* 0BC1A4 800BB5A4 57000007 */ bnel $t8, $zero, .L800BB5C4
|
||||
/* 0BC1A8 800BB5A8 8C450004 */ lw $a1, 4($v0)
|
||||
/* 0BC1AC 800BB5AC 8C590004 */ lw $t9, 4($v0)
|
||||
/* 0BC1B0 800BB5B0 001940C0 */ sll $t0, $t9, 3
|
||||
/* 0BC1B4 800BB5B4 00684821 */ addu $t1, $v1, $t0
|
||||
/* 0BC1B8 800BB5B8 10000002 */ b .L800BB5C4
|
||||
/* 0BC1BC 800BB5BC 8D250004 */ lw $a1, 4($t1)
|
||||
/* 0BC1C0 800BB5C0 8C450004 */ lw $a1, 4($v0)
|
||||
.L800BB5C4:
|
||||
/* 0BC1C4 800BB5C4 8FA30020 */ lw $v1, 0x20($sp)
|
||||
/* 0BC1C8 800BB5C8 3C0B803B */ lui $t3, %hi(gCtlEntries) # $t3, 0x803b
|
||||
/* 0BC1CC 800BB5CC 8D6B7080 */ lw $t3, %lo(gCtlEntries)($t3)
|
||||
/* 0BC1D0 800BB5D0 00035080 */ sll $t2, $v1, 2
|
||||
/* 0BC1D4 800BB5D4 01435023 */ subu $t2, $t2, $v1
|
||||
/* 0BC1D8 800BB5D8 000A1880 */ sll $v1, $t2, 2
|
||||
/* 0BC1DC 800BB5DC 01631021 */ addu $v0, $t3, $v1
|
||||
/* 0BC1E0 800BB5E0 8C440004 */ lw $a0, 4($v0)
|
||||
/* 0BC1E4 800BB5E4 90460001 */ lbu $a2, 1($v0)
|
||||
/* 0BC1E8 800BB5E8 90470002 */ lbu $a3, 2($v0)
|
||||
/* 0BC1EC 800BB5EC AFA30018 */ sw $v1, 0x18($sp)
|
||||
/* 0BC1F0 800BB5F0 0C02ED89 */ jal patch_audio_bank
|
||||
/* 0BC1F4 800BB5F4 2484FFFC */ addiu $a0, $a0, -4
|
||||
/* 0BC1F8 800BB5F8 3C0C803B */ lui $t4, %hi(gCtlEntries) # $t4, 0x803b
|
||||
/* 0BC1FC 800BB5FC 8FA30018 */ lw $v1, 0x18($sp)
|
||||
/* 0BC200 800BB600 8D8C7080 */ lw $t4, %lo(gCtlEntries)($t4)
|
||||
/* 0BC204 800BB604 01831021 */ addu $v0, $t4, $v1
|
||||
/* 0BC208 800BB608 8C4D0004 */ lw $t5, 4($v0)
|
||||
/* 0BC20C 800BB60C 8DAEFFFC */ lw $t6, -4($t5)
|
||||
/* 0BC210 800BB610 AC4E0008 */ sw $t6, 8($v0)
|
||||
/* 0BC214 800BB614 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
/* 0BC218 800BB618 27BD0020 */ addiu $sp, $sp, 0x20
|
||||
/* 0BC21C 800BB61C 03E00008 */ jr $ra
|
||||
/* 0BC220 800BB620 00000000 */ nop
|
@ -1,6 +1,6 @@
|
||||
glabel create_next_audio_frame_task
|
||||
/* 0CBF30 800CB330 3C03803B */ lui $v1, %hi(D_803B70B8) # $v1, 0x803b
|
||||
/* 0CBF34 800CB334 246370B8 */ addiu $v1, %lo(D_803B70B8) # addiu $v1, $v1, 0x70b8
|
||||
/* 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
|
||||
@ -37,11 +37,11 @@ glabel create_next_audio_frame_task
|
||||
/* 0CBFB0 800CB3B0 0C033630 */ jal osSendMesg
|
||||
/* 0CBFB4 800CB3B4 8C650000 */ lw $a1, ($v1)
|
||||
/* 0CBFB8 800CB3B8 24030003 */ li $v1, 3
|
||||
/* 0CBFBC 800CB3BC 3C04803B */ lui $a0, %hi(D_803B70C4) # $a0, 0x803b
|
||||
/* 0CBFC0 800CB3C0 248470C4 */ addiu $a0, %lo(D_803B70C4) # addiu $a0, $a0, 0x70c4
|
||||
/* 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(D_803B70C0) # $a1, 0x803b
|
||||
/* 0CBFCC 800CB3CC 24A570C0 */ addiu $a1, %lo(D_803B70C0) # addiu $a1, $a1, 0x70c0
|
||||
/* 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
|
||||
@ -81,10 +81,10 @@ glabel create_next_audio_frame_task
|
||||
/* 0CC050 800CB450 00000000 */ nop
|
||||
/* 0CC054 800CB454 0002C082 */ srl $t8, $v0, 2
|
||||
/* 0CC058 800CB458 0010C840 */ sll $t9, $s0, 1
|
||||
/* 0CC05C 800CB45C 3C03803B */ lui $v1, %hi(D_803B718C) # 0x803b
|
||||
/* 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(D_803B718C)($v1) # 0x718c($v1)
|
||||
/* 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
|
||||
@ -181,8 +181,8 @@ glabel create_next_audio_frame_task
|
||||
/* 0CC1B8 800CB5B8 1000008F */ b .L800CB7F8
|
||||
/* 0CC1BC 800CB5BC 00001025 */ move $v0, $zero
|
||||
.L800CB5C0:
|
||||
/* 0CC1C0 800CB5C0 3C02803B */ lui $v0, %hi(D_803B70C0) # $v0, 0x803b
|
||||
/* 0CC1C4 800CB5C4 8C4270C0 */ lw $v0, %lo(D_803B70C0)($v0)
|
||||
/* 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
|
||||
@ -193,9 +193,9 @@ glabel create_next_audio_frame_task
|
||||
/* 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(D_803B70C4) # $s0, 0x803b
|
||||
/* 0CC1F0 800CB5F0 3C10803B */ lui $s0, %hi(gCurrAiBufferIndex) # $s0, 0x803b
|
||||
/* 0CC1F4 800CB5F4 0002C880 */ sll $t9, $v0, 2
|
||||
/* 0CC1F8 800CB5F8 8E1070C4 */ lw $s0, %lo(D_803B70C4)($s0)
|
||||
/* 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
|
||||
@ -210,8 +210,8 @@ glabel create_next_audio_frame_task
|
||||
/* 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(D_803B718C) # $t5, 0x803b
|
||||
/* 0CC238 800CB638 25AD718C */ addiu $t5, %lo(D_803B718C) # addiu $t5, $t5, 0x718c
|
||||
/* 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
|
||||
@ -254,13 +254,13 @@ glabel create_next_audio_frame_task
|
||||
/* 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(D_803B70B8) # $a3, 0x803b
|
||||
/* 0CC2DC 800CB6DC 24E770B8 */ addiu $a3, %lo(D_803B70B8) # addiu $a3, $a3, 0x70b8
|
||||
/* 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(D_803B70C0) # $s0, 0x803b
|
||||
/* 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
|
||||
@ -284,7 +284,7 @@ glabel create_next_audio_frame_task
|
||||
/* 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(D_803B70C0)($s0)
|
||||
/* 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
|
||||
|
@ -1,194 +0,0 @@
|
||||
.section .late_rodata
|
||||
|
||||
glabel jpt_800F39C0
|
||||
.word L800CBE60, L800CBE78, L800CBE90, L800CBEA8
|
||||
.word L800CBEC0, L800CBECC, L800CBF08, L800CBEEC
|
||||
|
||||
.section .text
|
||||
|
||||
glabel func_800CBCB0
|
||||
/* 0CC8B0 800CBCB0 27BDFFB0 */ addiu $sp, $sp, -0x50
|
||||
/* 0CC8B4 800CBCB4 AFB20030 */ sw $s2, 0x30($sp)
|
||||
/* 0CC8B8 800CBCB8 AFB5003C */ sw $s5, 0x3c($sp)
|
||||
/* 0CC8BC 800CBCBC AFB30034 */ sw $s3, 0x34($sp)
|
||||
/* 0CC8C0 800CBCC0 00809025 */ move $s2, $a0
|
||||
/* 0CC8C4 800CBCC4 AFBE0048 */ sw $fp, 0x48($sp)
|
||||
/* 0CC8C8 800CBCC8 AFB70044 */ sw $s7, 0x44($sp)
|
||||
/* 0CC8CC 800CBCCC AFB60040 */ sw $s6, 0x40($sp)
|
||||
/* 0CC8D0 800CBCD0 AFB40038 */ sw $s4, 0x38($sp)
|
||||
/* 0CC8D4 800CBCD4 AFB1002C */ sw $s1, 0x2c($sp)
|
||||
/* 0CC8D8 800CBCD8 00047202 */ srl $t6, $a0, 8
|
||||
/* 0CC8DC 800CBCDC 325800FF */ andi $t8, $s2, 0xff
|
||||
/* 0CC8E0 800CBCE0 3C138019 */ lui $s3, %hi(sAudioCmd) # $s3, 0x8019
|
||||
/* 0CC8E4 800CBCE4 3C15803B */ lui $s5, %hi(gSequencePlayers) # $s5, 0x803b
|
||||
/* 0CC8E8 800CBCE8 03A0F025 */ move $fp, $sp
|
||||
/* 0CC8EC 800CBCEC AFBF004C */ sw $ra, 0x4c($sp)
|
||||
/* 0CC8F0 800CBCF0 AFB00028 */ sw $s0, 0x28($sp)
|
||||
/* 0CC8F4 800CBCF4 31D100FF */ andi $s1, $t6, 0xff
|
||||
/* 0CC8F8 800CBCF8 26B51510 */ addiu $s5, %lo(gSequencePlayers) # addiu $s5, $s5, 0x1510
|
||||
/* 0CC8FC 800CBCFC 26733820 */ addiu $s3, %lo(sAudioCmd) # addiu $s3, $s3, 0x3820
|
||||
/* 0CC900 800CBD00 03009025 */ move $s2, $t8
|
||||
/* 0CC904 800CBD04 241400F0 */ li $s4, 240
|
||||
/* 0CC908 800CBD08 24160148 */ li $s6, 328
|
||||
/* 0CC90C 800CBD0C 24170041 */ li $s7, 65
|
||||
/* 0CC910 800CBD10 12510080 */ beq $s2, $s1, .L800CBF14
|
||||
/* 0CC914 800CBD14 02201025 */ move $v0, $s1
|
||||
.L800CBD18:
|
||||
/* 0CC918 800CBD18 305900FF */ andi $t9, $v0, 0xff
|
||||
/* 0CC91C 800CBD1C 001940C0 */ sll $t0, $t9, 3
|
||||
/* 0CC920 800CBD20 02688021 */ addu $s0, $s3, $t0
|
||||
/* 0CC924 800CBD24 92040000 */ lbu $a0, ($s0)
|
||||
/* 0CC928 800CBD28 26310001 */ addiu $s1, $s1, 1
|
||||
/* 0CC92C 800CBD2C 322900FF */ andi $t1, $s1, 0xff
|
||||
/* 0CC930 800CBD30 308A00F0 */ andi $t2, $a0, 0xf0
|
||||
/* 0CC934 800CBD34 168A0005 */ bne $s4, $t2, .L800CBD4C
|
||||
/* 0CC938 800CBD38 01208825 */ move $s1, $t1
|
||||
/* 0CC93C 800CBD3C 0C032E06 */ jal eu_process_audio_cmd
|
||||
/* 0CC940 800CBD40 02002025 */ move $a0, $s0
|
||||
/* 0CC944 800CBD44 10000071 */ b .L800CBF0C
|
||||
/* 0CC948 800CBD48 02201025 */ move $v0, $s1
|
||||
.L800CBD4C:
|
||||
/* 0CC94C 800CBD4C 92020001 */ lbu $v0, 1($s0)
|
||||
/* 0CC950 800CBD50 28410004 */ slti $at, $v0, 4
|
||||
/* 0CC954 800CBD54 5020006D */ beql $at, $zero, .L800CBF0C
|
||||
/* 0CC958 800CBD58 02201025 */ move $v0, $s1
|
||||
/* 0CC95C 800CBD5C 00560019 */ multu $v0, $s6
|
||||
/* 0CC960 800CBD60 308C0080 */ andi $t4, $a0, 0x80
|
||||
/* 0CC964 800CBD64 308D0040 */ andi $t5, $a0, 0x40
|
||||
/* 0CC968 800CBD68 00005812 */ mflo $t3
|
||||
/* 0CC96C 800CBD6C 02AB1821 */ addu $v1, $s5, $t3
|
||||
/* 0CC970 800CBD70 11800005 */ beqz $t4, .L800CBD88
|
||||
/* 0CC974 800CBD74 00000000 */ nop
|
||||
/* 0CC978 800CBD78 0C032E06 */ jal eu_process_audio_cmd
|
||||
/* 0CC97C 800CBD7C 02002025 */ move $a0, $s0
|
||||
/* 0CC980 800CBD80 10000062 */ b .L800CBF0C
|
||||
/* 0CC984 800CBD84 02201025 */ move $v0, $s1
|
||||
.L800CBD88:
|
||||
/* 0CC988 800CBD88 51A00020 */ beql $t5, $zero, .L800CBE0C
|
||||
/* 0CC98C 800CBD8C 8C6D0000 */ lw $t5, ($v1)
|
||||
/* 0CC990 800CBD90 10970009 */ beq $a0, $s7, .L800CBDB8
|
||||
/* 0CC994 800CBD94 24010046 */ li $at, 70
|
||||
/* 0CC998 800CBD98 10810016 */ beq $a0, $at, .L800CBDF4
|
||||
/* 0CC99C 800CBD9C 24010047 */ li $at, 71
|
||||
/* 0CC9A0 800CBDA0 1081000B */ beq $a0, $at, .L800CBDD0
|
||||
/* 0CC9A4 800CBDA4 24010048 */ li $at, 72
|
||||
/* 0CC9A8 800CBDA8 50810010 */ beql $a0, $at, .L800CBDEC
|
||||
/* 0CC9AC 800CBDAC 82090004 */ lb $t1, 4($s0)
|
||||
/* 0CC9B0 800CBDB0 10000056 */ b .L800CBF0C
|
||||
/* 0CC9B4 800CBDB4 02201025 */ move $v0, $s1
|
||||
.L800CBDB8:
|
||||
/* 0CC9B8 800CBDB8 906F0000 */ lbu $t7, ($v1)
|
||||
/* 0CC9BC 800CBDBC C6040004 */ lwc1 $f4, 4($s0)
|
||||
/* 0CC9C0 800CBDC0 35F80004 */ ori $t8, $t7, 4
|
||||
/* 0CC9C4 800CBDC4 A0780000 */ sb $t8, ($v1)
|
||||
/* 0CC9C8 800CBDC8 1000004F */ b .L800CBF08
|
||||
/* 0CC9CC 800CBDCC E4640028 */ swc1 $f4, 0x28($v1)
|
||||
.L800CBDD0:
|
||||
/* 0CC9D0 800CBDD0 8E190004 */ lw $t9, 4($s0)
|
||||
/* 0CC9D4 800CBDD4 00194080 */ sll $t0, $t9, 2
|
||||
/* 0CC9D8 800CBDD8 01194023 */ subu $t0, $t0, $t9
|
||||
/* 0CC9DC 800CBDDC 00084100 */ sll $t0, $t0, 4
|
||||
/* 0CC9E0 800CBDE0 10000049 */ b .L800CBF08
|
||||
/* 0CC9E4 800CBDE4 A4680008 */ sh $t0, 8($v1)
|
||||
/* 0CC9E8 800CBDE8 82090004 */ lb $t1, 4($s0)
|
||||
.L800CBDEC:
|
||||
/* 0CC9EC 800CBDEC 10000046 */ b .L800CBF08
|
||||
/* 0CC9F0 800CBDF0 A469000C */ sh $t1, 0xc($v1)
|
||||
.L800CBDF4:
|
||||
/* 0CC9F4 800CBDF4 920B0003 */ lbu $t3, 3($s0)
|
||||
/* 0CC9F8 800CBDF8 820A0004 */ lb $t2, 4($s0)
|
||||
/* 0CC9FC 800CBDFC 006B6021 */ addu $t4, $v1, $t3
|
||||
/* 0CCA00 800CBE00 10000041 */ b .L800CBF08
|
||||
/* 0CCA04 800CBE04 A18A0007 */ sb $t2, 7($t4)
|
||||
/* 0CCA08 800CBE08 8C6D0000 */ lw $t5, ($v1)
|
||||
.L800CBE0C:
|
||||
/* 0CCA0C 800CBE0C 000D77C2 */ srl $t6, $t5, 0x1f
|
||||
/* 0CCA10 800CBE10 51C0003E */ beql $t6, $zero, .L800CBF0C
|
||||
/* 0CCA14 800CBE14 02201025 */ move $v0, $s1
|
||||
/* 0CCA18 800CBE18 92050002 */ lbu $a1, 2($s0)
|
||||
/* 0CCA1C 800CBE1C 28A10010 */ slti $at, $a1, 0x10
|
||||
/* 0CCA20 800CBE20 10200039 */ beqz $at, .L800CBF08
|
||||
/* 0CCA24 800CBE24 00057880 */ sll $t7, $a1, 2
|
||||
/* 0CCA28 800CBE28 006FC021 */ addu $t8, $v1, $t7
|
||||
/* 0CCA2C 800CBE2C 8F020030 */ lw $v0, 0x30($t8)
|
||||
/* 0CCA30 800CBE30 3C19803B */ lui $t9, %hi(gSequenceChannelNone) # $t9, 0x803b
|
||||
/* 0CCA34 800CBE34 27395EF0 */ addiu $t9, %lo(gSequenceChannelNone) # addiu $t9, $t9, 0x5ef0
|
||||
/* 0CCA38 800CBE38 10590033 */ beq $v0, $t9, .L800CBF08
|
||||
/* 0CCA3C 800CBE3C 2488FFFF */ addiu $t0, $a0, -1
|
||||
/* 0CCA40 800CBE40 2D010008 */ sltiu $at, $t0, 8
|
||||
/* 0CCA44 800CBE44 10200030 */ beqz $at, .L800CBF08
|
||||
/* 0CCA48 800CBE48 00084080 */ sll $t0, $t0, 2
|
||||
/* 0CCA4C 800CBE4C 3C01800F */ lui $at, %hi(jpt_800F39C0)
|
||||
/* 0CCA50 800CBE50 00280821 */ addu $at, $at, $t0
|
||||
/* 0CCA54 800CBE54 8C2839C0 */ lw $t0, %lo(jpt_800F39C0)($at)
|
||||
/* 0CCA58 800CBE58 01000008 */ jr $t0
|
||||
/* 0CCA5C 800CBE5C 00000000 */ nop
|
||||
glabel L800CBE60
|
||||
/* 0CCA60 800CBE60 904B0001 */ lbu $t3, 1($v0)
|
||||
/* 0CCA64 800CBE64 C6060004 */ lwc1 $f6, 4($s0)
|
||||
/* 0CCA68 800CBE68 356A0040 */ ori $t2, $t3, 0x40
|
||||
/* 0CCA6C 800CBE6C A04A0001 */ sb $t2, 1($v0)
|
||||
/* 0CCA70 800CBE70 10000025 */ b .L800CBF08
|
||||
/* 0CCA74 800CBE74 E4460020 */ swc1 $f6, 0x20($v0)
|
||||
glabel L800CBE78
|
||||
/* 0CCA78 800CBE78 904D0001 */ lbu $t5, 1($v0)
|
||||
/* 0CCA7C 800CBE7C C6080004 */ lwc1 $f8, 4($s0)
|
||||
/* 0CCA80 800CBE80 35AE0040 */ ori $t6, $t5, 0x40
|
||||
/* 0CCA84 800CBE84 A04E0001 */ sb $t6, 1($v0)
|
||||
/* 0CCA88 800CBE88 1000001F */ b .L800CBF08
|
||||
/* 0CCA8C 800CBE8C E4480024 */ swc1 $f8, 0x24($v0)
|
||||
glabel L800CBE90
|
||||
/* 0CCA90 800CBE90 90590001 */ lbu $t9, 1($v0)
|
||||
/* 0CCA94 800CBE94 820F0004 */ lb $t7, 4($s0)
|
||||
/* 0CCA98 800CBE98 37280020 */ ori $t0, $t9, 0x20
|
||||
/* 0CCA9C 800CBE9C A0480001 */ sb $t0, 1($v0)
|
||||
/* 0CCAA0 800CBEA0 10000019 */ b .L800CBF08
|
||||
/* 0CCAA4 800CBEA4 A04F0009 */ sb $t7, 9($v0)
|
||||
glabel L800CBEA8
|
||||
/* 0CCAA8 800CBEA8 904B0001 */ lbu $t3, 1($v0)
|
||||
/* 0CCAAC 800CBEAC C60A0004 */ lwc1 $f10, 4($s0)
|
||||
/* 0CCAB0 800CBEB0 356A0080 */ ori $t2, $t3, 0x80
|
||||
/* 0CCAB4 800CBEB4 A04A0001 */ sb $t2, 1($v0)
|
||||
/* 0CCAB8 800CBEB8 10000013 */ b .L800CBF08
|
||||
/* 0CCABC 800CBEBC E44A0030 */ swc1 $f10, 0x30($v0)
|
||||
glabel L800CBEC0
|
||||
/* 0CCAC0 800CBEC0 820C0004 */ lb $t4, 4($s0)
|
||||
/* 0CCAC4 800CBEC4 10000010 */ b .L800CBF08
|
||||
/* 0CCAC8 800CBEC8 A04C0004 */ sb $t4, 4($v0)
|
||||
glabel L800CBECC
|
||||
/* 0CCACC 800CBECC 92030003 */ lbu $v1, 3($s0)
|
||||
/* 0CCAD0 800CBED0 28610008 */ slti $at, $v1, 8
|
||||
/* 0CCAD4 800CBED4 5020000D */ beql $at, $zero, .L800CBF0C
|
||||
/* 0CCAD8 800CBED8 02201025 */ move $v0, $s1
|
||||
/* 0CCADC 800CBEDC 820D0004 */ lb $t5, 4($s0)
|
||||
/* 0CCAE0 800CBEE0 00437021 */ addu $t6, $v0, $v1
|
||||
/* 0CCAE4 800CBEE4 10000008 */ b .L800CBF08
|
||||
/* 0CCAE8 800CBEE8 A1CD0058 */ sb $t5, 0x58($t6)
|
||||
glabel L800CBEEC
|
||||
/* 0CCAEC 800CBEEC 82180004 */ lb $t8, 4($s0)
|
||||
/* 0CCAF0 800CBEF0 90490000 */ lbu $t1, ($v0)
|
||||
/* 0CCAF4 800CBEF4 0018C900 */ sll $t9, $t8, 4
|
||||
/* 0CCAF8 800CBEF8 33280010 */ andi $t0, $t9, 0x10
|
||||
/* 0CCAFC 800CBEFC 312BFFEF */ andi $t3, $t1, 0xffef
|
||||
/* 0CCB00 800CBF00 010B5025 */ or $t2, $t0, $t3
|
||||
/* 0CCB04 800CBF04 A04A0000 */ sb $t2, ($v0)
|
||||
.L800CBF08:
|
||||
glabel L800CBF08
|
||||
/* 0CCB08 800CBF08 02201025 */ move $v0, $s1
|
||||
.L800CBF0C:
|
||||
/* 0CCB0C 800CBF0C 1651FF82 */ bne $s2, $s1, .L800CBD18
|
||||
/* 0CCB10 800CBF10 A2000000 */ sb $zero, ($s0)
|
||||
.L800CBF14:
|
||||
/* 0CCB14 800CBF14 8FDF004C */ lw $ra, 0x4c($fp)
|
||||
/* 0CCB18 800CBF18 03C0E825 */ move $sp, $fp
|
||||
/* 0CCB1C 800CBF1C 8FD00028 */ lw $s0, 0x28($fp)
|
||||
/* 0CCB20 800CBF20 8FD1002C */ lw $s1, 0x2c($fp)
|
||||
/* 0CCB24 800CBF24 8FD20030 */ lw $s2, 0x30($fp)
|
||||
/* 0CCB28 800CBF28 8FD30034 */ lw $s3, 0x34($fp)
|
||||
/* 0CCB2C 800CBF2C 8FD40038 */ lw $s4, 0x38($fp)
|
||||
/* 0CCB30 800CBF30 8FD5003C */ lw $s5, 0x3c($fp)
|
||||
/* 0CCB34 800CBF34 8FD60040 */ lw $s6, 0x40($fp)
|
||||
/* 0CCB38 800CBF38 8FD70044 */ lw $s7, 0x44($fp)
|
||||
/* 0CCB3C 800CBF3C 8FDE0048 */ lw $fp, 0x48($fp)
|
||||
/* 0CCB40 800CBF40 03E00008 */ jr $ra
|
||||
/* 0CCB44 800CBF44 27BD0050 */ addiu $sp, $sp, 0x50
|
@ -1,654 +0,0 @@
|
||||
.section .late_rodata
|
||||
|
||||
glabel jpt_800F3350
|
||||
.word L800C0FF4, L800C0FE4, L800C0AE8, L800C0AE8
|
||||
.word L800C0FD4, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0FC4, L800C0F98, L800C0F98, L800C0F88
|
||||
.word L800C0F78, L800C0F4C, L800C0F30, L800C0F14
|
||||
.word L800C0AE8, L800C0EE8, L800C0DD4, L800C0E50
|
||||
.word L800C0D50, L800C0D50, L800C0D30, L800C0D2C
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0D1C, L800C0CF4, L800C0CAC, L800C0CAC
|
||||
.word L800C0CAC, L800C0C54, L800C0AE8, L800C0C0C
|
||||
.word L800C0BD4, L800C0C54, L800C0C54, L800C0C54
|
||||
.word L800C0B90, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
|
||||
glabel jpt_800F3430
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C1084, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C1090, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C1098, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C10A0, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8, L800C0AE8, L800C0AE8, L800C0AE8
|
||||
.word L800C0AE8
|
||||
|
||||
.section .text
|
||||
|
||||
glabel sequence_player_process_sequence
|
||||
/* 0C14CC 800C08CC 27BDFFA0 */ addiu $sp, $sp, -0x60
|
||||
/* 0C14D0 800C08D0 AFBF002C */ sw $ra, 0x2c($sp)
|
||||
/* 0C14D4 800C08D4 AFB30028 */ sw $s3, 0x28($sp)
|
||||
/* 0C14D8 800C08D8 AFB20024 */ sw $s2, 0x24($sp)
|
||||
/* 0C14DC 800C08DC AFB10020 */ sw $s1, 0x20($sp)
|
||||
/* 0C14E0 800C08E0 AFB0001C */ sw $s0, 0x1c($sp)
|
||||
/* 0C14E4 800C08E4 8C820000 */ lw $v0, ($a0)
|
||||
/* 0C14E8 800C08E8 00808825 */ move $s1, $a0
|
||||
/* 0C14EC 800C08EC 24010001 */ li $at, 1
|
||||
/* 0C14F0 800C08F0 000277C2 */ srl $t6, $v0, 0x1f
|
||||
/* 0C14F4 800C08F4 11C00209 */ beqz $t6, .L800C111C
|
||||
/* 0C14F8 800C08F8 00027900 */ sll $t7, $v0, 4
|
||||
/* 0C14FC 800C08FC 000FC7C2 */ srl $t8, $t7, 0x1f
|
||||
/* 0C1500 800C0900 17010024 */ bne $t8, $at, .L800C0994
|
||||
/* 0C1504 800C0904 000278C0 */ sll $t7, $v0, 3
|
||||
/* 0C1508 800C0908 24900108 */ addiu $s0, $a0, 0x108
|
||||
/* 0C150C 800C090C 02002025 */ move $a0, $s0
|
||||
/* 0C1510 800C0910 00002825 */ move $a1, $zero
|
||||
/* 0C1514 800C0914 0C0335D4 */ jal osRecvMesg
|
||||
/* 0C1518 800C0918 00003025 */ move $a2, $zero
|
||||
/* 0C151C 800C091C 2401FFFF */ li $at, -1
|
||||
/* 0C1520 800C0920 504101FF */ beql $v0, $at, .L800C1120
|
||||
/* 0C1524 800C0924 8FBF002C */ lw $ra, 0x2c($sp)
|
||||
/* 0C1528 800C0928 8E390144 */ lw $t9, 0x144($s1)
|
||||
/* 0C152C 800C092C 26240140 */ addiu $a0, $s1, 0x140
|
||||
/* 0C1530 800C0930 2625013C */ addiu $a1, $s1, 0x13c
|
||||
/* 0C1534 800C0934 17200011 */ bnez $t9, .L800C097C
|
||||
/* 0C1538 800C0938 26260144 */ addiu $a2, $s1, 0x144
|
||||
/* 0C153C 800C093C 92280000 */ lbu $t0, ($s1)
|
||||
/* 0C1540 800C0940 92240006 */ lbu $a0, 6($s1)
|
||||
/* 0C1544 800C0944 3109FFF7 */ andi $t1, $t0, 0xfff7
|
||||
/* 0C1548 800C0948 0C02ED61 */ jal func_800BB584
|
||||
/* 0C154C 800C094C A2290000 */ sb $t1, ($s1)
|
||||
/* 0C1550 800C0950 922A0006 */ lbu $t2, 6($s1)
|
||||
/* 0C1554 800C0954 3C0B803B */ lui $t3, %hi(gBankLoadStatus) # $t3, 0x803b
|
||||
/* 0C1558 800C0958 256B03C0 */ addiu $t3, %lo(gBankLoadStatus) # addiu $t3, $t3, 0x3c0
|
||||
/* 0C155C 800C095C 014B1021 */ addu $v0, $t2, $t3
|
||||
/* 0C1560 800C0960 904C0000 */ lbu $t4, ($v0)
|
||||
/* 0C1564 800C0964 24060005 */ li $a2, 5
|
||||
/* 0C1568 800C0968 240D0002 */ li $t5, 2
|
||||
/* 0C156C 800C096C 50CC01EC */ beql $a2, $t4, .L800C1120
|
||||
/* 0C1570 800C0970 8FBF002C */ lw $ra, 0x2c($sp)
|
||||
/* 0C1574 800C0974 100001E9 */ b .L800C111C
|
||||
/* 0C1578 800C0978 A04D0000 */ sb $t5, ($v0)
|
||||
.L800C097C:
|
||||
/* 0C157C 800C097C 262E0124 */ addiu $t6, $s1, 0x124
|
||||
/* 0C1580 800C0980 AFAE0010 */ sw $t6, 0x10($sp)
|
||||
/* 0C1584 800C0984 0C02EAD6 */ jal audio_dma_partial_copy_async
|
||||
/* 0C1588 800C0988 02003825 */ move $a3, $s0
|
||||
/* 0C158C 800C098C 100001E4 */ b .L800C1120
|
||||
/* 0C1590 800C0990 8FBF002C */ lw $ra, 0x2c($sp)
|
||||
.L800C0994:
|
||||
/* 0C1594 800C0994 000FC7C2 */ srl $t8, $t7, 0x1f
|
||||
/* 0C1598 800C0998 24010001 */ li $at, 1
|
||||
/* 0C159C 800C099C 17010013 */ bne $t8, $at, .L800C09EC
|
||||
/* 0C15A0 800C09A0 262400D4 */ addiu $a0, $s1, 0xd4
|
||||
/* 0C15A4 800C09A4 00002825 */ move $a1, $zero
|
||||
/* 0C15A8 800C09A8 0C0335D4 */ jal osRecvMesg
|
||||
/* 0C15AC 800C09AC 00003025 */ move $a2, $zero
|
||||
/* 0C15B0 800C09B0 2401FFFF */ li $at, -1
|
||||
/* 0C15B4 800C09B4 104101D9 */ beq $v0, $at, .L800C111C
|
||||
/* 0C15B8 800C09B8 3C0A803B */ lui $t2, %hi(gSeqLoadStatus) # $t2, 0x803b
|
||||
/* 0C15BC 800C09BC 92390000 */ lbu $t9, ($s1)
|
||||
/* 0C15C0 800C09C0 92290004 */ lbu $t1, 4($s1)
|
||||
/* 0C15C4 800C09C4 254A0400 */ addiu $t2, %lo(gSeqLoadStatus) # addiu $t2, $t2, 0x400
|
||||
/* 0C15C8 800C09C8 3328FFEF */ andi $t0, $t9, 0xffef
|
||||
/* 0C15CC 800C09CC A2280000 */ sb $t0, ($s1)
|
||||
/* 0C15D0 800C09D0 012A1821 */ addu $v1, $t1, $t2
|
||||
/* 0C15D4 800C09D4 906B0000 */ lbu $t3, ($v1)
|
||||
/* 0C15D8 800C09D8 24060005 */ li $a2, 5
|
||||
/* 0C15DC 800C09DC 240C0002 */ li $t4, 2
|
||||
/* 0C15E0 800C09E0 50CB0003 */ beql $a2, $t3, .L800C09F0
|
||||
/* 0C15E4 800C09E4 922D0004 */ lbu $t5, 4($s1)
|
||||
/* 0C15E8 800C09E8 A06C0000 */ sb $t4, ($v1)
|
||||
.L800C09EC:
|
||||
/* 0C15EC 800C09EC 922D0004 */ lbu $t5, 4($s1)
|
||||
.L800C09F0:
|
||||
/* 0C15F0 800C09F0 3C0E803B */ lui $t6, %hi(gSeqLoadStatus) # $t6, 0x803b
|
||||
/* 0C15F4 800C09F4 25CE0400 */ addiu $t6, %lo(gSeqLoadStatus) # addiu $t6, $t6, 0x400
|
||||
/* 0C15F8 800C09F8 01AE1821 */ addu $v1, $t5, $t6
|
||||
/* 0C15FC 800C09FC 90650000 */ lbu $a1, ($v1)
|
||||
/* 0C1600 800C0A00 24060005 */ li $a2, 5
|
||||
/* 0C1604 800C0A04 28AF0002 */ slti $t7, $a1, 2
|
||||
/* 0C1608 800C0A08 15E00009 */ bnez $t7, .L800C0A30
|
||||
/* 0C160C 800C0A0C 00000000 */ nop
|
||||
/* 0C1610 800C0A10 92380005 */ lbu $t8, 5($s1)
|
||||
/* 0C1614 800C0A14 3C19803B */ lui $t9, %hi(gBankLoadStatus) # $t9, 0x803b
|
||||
/* 0C1618 800C0A18 273903C0 */ addiu $t9, %lo(gBankLoadStatus) # addiu $t9, $t9, 0x3c0
|
||||
/* 0C161C 800C0A1C 03191021 */ addu $v0, $t8, $t9
|
||||
/* 0C1620 800C0A20 90440000 */ lbu $a0, ($v0)
|
||||
/* 0C1624 800C0A24 28880002 */ slti $t0, $a0, 2
|
||||
/* 0C1628 800C0A28 11000005 */ beqz $t0, .L800C0A40
|
||||
/* 0C162C 800C0A2C 00000000 */ nop
|
||||
.L800C0A30:
|
||||
/* 0C1630 800C0A30 0C02FBCB */ jal sequence_player_disable
|
||||
/* 0C1634 800C0A34 02202025 */ move $a0, $s1
|
||||
/* 0C1638 800C0A38 100001B9 */ b .L800C1120
|
||||
/* 0C163C 800C0A3C 8FBF002C */ lw $ra, 0x2c($sp)
|
||||
.L800C0A40:
|
||||
/* 0C1640 800C0A40 10C50007 */ beq $a2, $a1, .L800C0A60
|
||||
/* 0C1644 800C0A44 24090002 */ li $t1, 2
|
||||
/* 0C1648 800C0A48 A0690000 */ sb $t1, ($v1)
|
||||
/* 0C164C 800C0A4C 922A0005 */ lbu $t2, 5($s1)
|
||||
/* 0C1650 800C0A50 3C0B803B */ lui $t3, %hi(gBankLoadStatus) # $t3, 0x803b
|
||||
/* 0C1654 800C0A54 256B03C0 */ addiu $t3, %lo(gBankLoadStatus) # addiu $t3, $t3, 0x3c0
|
||||
/* 0C1658 800C0A58 014B1021 */ addu $v0, $t2, $t3
|
||||
/* 0C165C 800C0A5C 90440000 */ lbu $a0, ($v0)
|
||||
.L800C0A60:
|
||||
/* 0C1660 800C0A60 10C40002 */ beq $a2, $a0, .L800C0A6C
|
||||
/* 0C1664 800C0A64 240C0002 */ li $t4, 2
|
||||
/* 0C1668 800C0A68 A04C0000 */ sb $t4, ($v0)
|
||||
.L800C0A6C:
|
||||
/* 0C166C 800C0A6C 8E2D0000 */ lw $t5, ($s1)
|
||||
/* 0C1670 800C0A70 000D7880 */ sll $t7, $t5, 2
|
||||
/* 0C1674 800C0A74 05E30006 */ bgezl $t7, .L800C0A90
|
||||
/* 0C1678 800C0A78 9628000A */ lhu $t0, 0xa($s1)
|
||||
/* 0C167C 800C0A7C 92380003 */ lbu $t8, 3($s1)
|
||||
/* 0C1680 800C0A80 33190080 */ andi $t9, $t8, 0x80
|
||||
/* 0C1684 800C0A84 572001A6 */ bnel $t9, $zero, .L800C1120
|
||||
/* 0C1688 800C0A88 8FBF002C */ lw $ra, 0x2c($sp)
|
||||
/* 0C168C 800C0A8C 9628000A */ lhu $t0, 0xa($s1)
|
||||
.L800C0A90:
|
||||
/* 0C1690 800C0A90 96290008 */ lhu $t1, 8($s1)
|
||||
/* 0C1694 800C0A94 3C03803B */ lui $v1, %hi(gTempoInternalToExternal) # $v1, 0x803b
|
||||
/* 0C1698 800C0A98 01095021 */ addu $t2, $t0, $t1
|
||||
/* 0C169C 800C0A9C A62A000A */ sh $t2, 0xa($s1)
|
||||
/* 0C16A0 800C0AA0 846370B4 */ lh $v1, %lo(gTempoInternalToExternal)($v1)
|
||||
/* 0C16A4 800C0AA4 3142FFFF */ andi $v0, $t2, 0xffff
|
||||
/* 0C16A8 800C0AA8 0043082A */ slt $at, $v0, $v1
|
||||
/* 0C16AC 800C0AAC 5420019C */ bnel $at, $zero, .L800C1120
|
||||
/* 0C16B0 800C0AB0 8FBF002C */ lw $ra, 0x2c($sp)
|
||||
/* 0C16B4 800C0AB4 9624000E */ lhu $a0, 0xe($s1)
|
||||
/* 0C16B8 800C0AB8 00436023 */ subu $t4, $v0, $v1
|
||||
/* 0C16BC 800C0ABC A62C000A */ sh $t4, 0xa($s1)
|
||||
/* 0C16C0 800C0AC0 28810002 */ slti $at, $a0, 2
|
||||
/* 0C16C4 800C0AC4 14200003 */ bnez $at, .L800C0AD4
|
||||
/* 0C16C8 800C0AC8 248DFFFF */ addiu $t5, $a0, -1
|
||||
/* 0C16CC 800C0ACC 10000180 */ b .L800C10D0
|
||||
/* 0C16D0 800C0AD0 A62D000E */ sh $t5, 0xe($s1)
|
||||
.L800C0AD4:
|
||||
/* 0C16D4 800C0AD4 922F0000 */ lbu $t7, ($s1)
|
||||
/* 0C16D8 800C0AD8 26300070 */ addiu $s0, $s1, 0x70
|
||||
/* 0C16DC 800C0ADC 35F80004 */ ori $t8, $t7, 4
|
||||
/* 0C16E0 800C0AE0 A2380000 */ sb $t8, ($s1)
|
||||
/* 0C16E4 800C0AE4 8FB30058 */ lw $s3, 0x58($sp)
|
||||
.L800C0AE8:
|
||||
glabel L800C0AE8
|
||||
/* 0C16E8 800C0AE8 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C16EC 800C0AEC 02002025 */ move $a0, $s0
|
||||
/* 0C16F0 800C0AF0 240100FF */ li $at, 255
|
||||
/* 0C16F4 800C0AF4 1441000E */ bne $v0, $at, .L800C0B30
|
||||
/* 0C16F8 800C0AF8 305200FF */ andi $s2, $v0, 0xff
|
||||
/* 0C16FC 800C0AFC 92040018 */ lbu $a0, 0x18($s0)
|
||||
/* 0C1700 800C0B00 14800005 */ bnez $a0, .L800C0B18
|
||||
/* 0C1704 800C0B04 2483FFFF */ addiu $v1, $a0, -1
|
||||
/* 0C1708 800C0B08 0C02FBCB */ jal sequence_player_disable
|
||||
/* 0C170C 800C0B0C 02202025 */ move $a0, $s1
|
||||
/* 0C1710 800C0B10 1000016F */ b .L800C10D0
|
||||
/* 0C1714 800C0B14 00000000 */ nop
|
||||
.L800C0B18:
|
||||
/* 0C1718 800C0B18 307900FF */ andi $t9, $v1, 0xff
|
||||
/* 0C171C 800C0B1C 00194080 */ sll $t0, $t9, 2
|
||||
/* 0C1720 800C0B20 02084821 */ addu $t1, $s0, $t0
|
||||
/* 0C1724 800C0B24 A2190018 */ sb $t9, 0x18($s0)
|
||||
/* 0C1728 800C0B28 8D2A0004 */ lw $t2, 4($t1)
|
||||
/* 0C172C 800C0B2C AE0A0000 */ sw $t2, ($s0)
|
||||
.L800C0B30:
|
||||
/* 0C1730 800C0B30 304300FF */ andi $v1, $v0, 0xff
|
||||
/* 0C1734 800C0B34 240100FD */ li $at, 253
|
||||
/* 0C1738 800C0B38 14610005 */ bne $v1, $at, .L800C0B50
|
||||
/* 0C173C 800C0B3C 306200F0 */ andi $v0, $v1, 0xf0
|
||||
/* 0C1740 800C0B40 0C02FC53 */ jal m64_read_compressed_u16
|
||||
/* 0C1744 800C0B44 02002025 */ move $a0, $s0
|
||||
/* 0C1748 800C0B48 10000161 */ b .L800C10D0
|
||||
/* 0C174C 800C0B4C A622000E */ sh $v0, 0xe($s1)
|
||||
.L800C0B50:
|
||||
/* 0C1750 800C0B50 240100FE */ li $at, 254
|
||||
/* 0C1754 800C0B54 14610004 */ bne $v1, $at, .L800C0B68
|
||||
/* 0C1758 800C0B58 246CFF38 */ addiu $t4, $v1, -0xc8
|
||||
/* 0C175C 800C0B5C 240B0001 */ li $t3, 1
|
||||
/* 0C1760 800C0B60 1000015B */ b .L800C10D0
|
||||
/* 0C1764 800C0B64 A62B000E */ sh $t3, 0xe($s1)
|
||||
.L800C0B68:
|
||||
/* 0C1768 800C0B68 286100C0 */ slti $at, $v1, 0xc0
|
||||
/* 0C176C 800C0B6C 14200125 */ bnez $at, .L800C1004
|
||||
/* 0C1770 800C0B70 2D810038 */ sltiu $at, $t4, 0x38
|
||||
/* 0C1774 800C0B74 1020FFDC */ beqz $at, .L800C0AE8
|
||||
/* 0C1778 800C0B78 000C6080 */ sll $t4, $t4, 2
|
||||
/* 0C177C 800C0B7C 3C01800F */ lui $at, %hi(jpt_800F3350)
|
||||
/* 0C1780 800C0B80 002C0821 */ addu $at, $at, $t4
|
||||
/* 0C1784 800C0B84 8C2C3350 */ lw $t4, %lo(jpt_800F3350)($at)
|
||||
/* 0C1788 800C0B88 01800008 */ jr $t4
|
||||
/* 0C178C 800C0B8C 00000000 */ nop
|
||||
glabel L800C0B90
|
||||
/* 0C1790 800C0B90 0C02FC47 */ jal m64_read_s16
|
||||
/* 0C1794 800C0B94 02002025 */ move $a0, $s0
|
||||
/* 0C1798 800C0B98 920E0018 */ lbu $t6, 0x18($s0)
|
||||
/* 0C179C 800C0B9C 8E0D0000 */ lw $t5, ($s0)
|
||||
/* 0C17A0 800C0BA0 304AFFFF */ andi $t2, $v0, 0xffff
|
||||
/* 0C17A4 800C0BA4 000E7880 */ sll $t7, $t6, 2
|
||||
/* 0C17A8 800C0BA8 020FC021 */ addu $t8, $s0, $t7
|
||||
/* 0C17AC 800C0BAC AF0D0004 */ sw $t5, 4($t8)
|
||||
/* 0C17B0 800C0BB0 92190018 */ lbu $t9, 0x18($s0)
|
||||
/* 0C17B4 800C0BB4 27280001 */ addiu $t0, $t9, 1
|
||||
/* 0C17B8 800C0BB8 A2080018 */ sb $t0, 0x18($s0)
|
||||
/* 0C17BC 800C0BBC 8E290014 */ lw $t1, 0x14($s1)
|
||||
/* 0C17C0 800C0BC0 012A5821 */ addu $t3, $t1, $t2
|
||||
/* 0C17C4 800C0BC4 1000FFC8 */ b .L800C0AE8
|
||||
/* 0C17C8 800C0BC8 AE0B0000 */ sw $t3, ($s0)
|
||||
/* 0C17CC 800C0BCC 1000FFC6 */ b .L800C0AE8
|
||||
/* 0C17D0 800C0BD0 00000000 */ nop
|
||||
glabel L800C0BD4
|
||||
/* 0C17D4 800C0BD4 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C17D8 800C0BD8 02002025 */ move $a0, $s0
|
||||
/* 0C17DC 800C0BDC 920C0018 */ lbu $t4, 0x18($s0)
|
||||
/* 0C17E0 800C0BE0 020C7021 */ addu $t6, $s0, $t4
|
||||
/* 0C17E4 800C0BE4 A1C20014 */ sb $v0, 0x14($t6)
|
||||
/* 0C17E8 800C0BE8 920D0018 */ lbu $t5, 0x18($s0)
|
||||
/* 0C17EC 800C0BEC 8E0F0000 */ lw $t7, ($s0)
|
||||
/* 0C17F0 800C0BF0 000DC080 */ sll $t8, $t5, 2
|
||||
/* 0C17F4 800C0BF4 0218C821 */ addu $t9, $s0, $t8
|
||||
/* 0C17F8 800C0BF8 AF2F0004 */ sw $t7, 4($t9)
|
||||
/* 0C17FC 800C0BFC 92080018 */ lbu $t0, 0x18($s0)
|
||||
/* 0C1800 800C0C00 25090001 */ addiu $t1, $t0, 1
|
||||
/* 0C1804 800C0C04 1000FFB8 */ b .L800C0AE8
|
||||
/* 0C1808 800C0C08 A2090018 */ sb $t1, 0x18($s0)
|
||||
glabel L800C0C0C
|
||||
/* 0C180C 800C0C0C 920A0018 */ lbu $t2, 0x18($s0)
|
||||
/* 0C1810 800C0C10 020A1021 */ addu $v0, $s0, $t2
|
||||
/* 0C1814 800C0C14 904B0013 */ lbu $t3, 0x13($v0)
|
||||
/* 0C1818 800C0C18 256CFFFF */ addiu $t4, $t3, -1
|
||||
/* 0C181C 800C0C1C A04C0013 */ sb $t4, 0x13($v0)
|
||||
/* 0C1820 800C0C20 92040018 */ lbu $a0, 0x18($s0)
|
||||
/* 0C1824 800C0C24 02047021 */ addu $t6, $s0, $a0
|
||||
/* 0C1828 800C0C28 91CD0013 */ lbu $t5, 0x13($t6)
|
||||
/* 0C182C 800C0C2C 00801825 */ move $v1, $a0
|
||||
/* 0C1830 800C0C30 0003C080 */ sll $t8, $v1, 2
|
||||
/* 0C1834 800C0C34 11A00005 */ beqz $t5, .L800C0C4C
|
||||
/* 0C1838 800C0C38 2488FFFF */ addiu $t0, $a0, -1
|
||||
/* 0C183C 800C0C3C 02187821 */ addu $t7, $s0, $t8
|
||||
/* 0C1840 800C0C40 8DF90000 */ lw $t9, ($t7)
|
||||
/* 0C1844 800C0C44 1000FFA8 */ b .L800C0AE8
|
||||
/* 0C1848 800C0C48 AE190000 */ sw $t9, ($s0)
|
||||
.L800C0C4C:
|
||||
/* 0C184C 800C0C4C 1000FFA6 */ b .L800C0AE8
|
||||
/* 0C1850 800C0C50 A2080018 */ sb $t0, 0x18($s0)
|
||||
glabel L800C0C54
|
||||
/* 0C1854 800C0C54 0C02FC47 */ jal m64_read_s16
|
||||
/* 0C1858 800C0C58 02002025 */ move $a0, $s0
|
||||
/* 0C185C 800C0C5C 240100FA */ li $at, 250
|
||||
/* 0C1860 800C0C60 16410003 */ bne $s2, $at, .L800C0C70
|
||||
/* 0C1864 800C0C64 02401825 */ move $v1, $s2
|
||||
/* 0C1868 800C0C68 1660FF9F */ bnez $s3, .L800C0AE8
|
||||
/* 0C186C 800C0C6C 00000000 */ nop
|
||||
.L800C0C70:
|
||||
/* 0C1870 800C0C70 240100F9 */ li $at, 249
|
||||
/* 0C1874 800C0C74 54610004 */ bnel $v1, $at, .L800C0C88
|
||||
/* 0C1878 800C0C78 240100F5 */ li $at, 245
|
||||
/* 0C187C 800C0C7C 0661FF9A */ bgez $s3, .L800C0AE8
|
||||
/* 0C1880 800C0C80 00000000 */ nop
|
||||
/* 0C1884 800C0C84 240100F5 */ li $at, 245
|
||||
.L800C0C88:
|
||||
/* 0C1888 800C0C88 54610004 */ bnel $v1, $at, .L800C0C9C
|
||||
/* 0C188C 800C0C8C 8E290014 */ lw $t1, 0x14($s1)
|
||||
/* 0C1890 800C0C90 0660FF95 */ bltz $s3, .L800C0AE8
|
||||
/* 0C1894 800C0C94 00000000 */ nop
|
||||
/* 0C1898 800C0C98 8E290014 */ lw $t1, 0x14($s1)
|
||||
.L800C0C9C:
|
||||
/* 0C189C 800C0C9C 304AFFFF */ andi $t2, $v0, 0xffff
|
||||
/* 0C18A0 800C0CA0 012A5821 */ addu $t3, $t1, $t2
|
||||
/* 0C18A4 800C0CA4 1000FF90 */ b .L800C0AE8
|
||||
/* 0C18A8 800C0CA8 AE0B0000 */ sw $t3, ($s0)
|
||||
glabel L800C0CAC
|
||||
/* 0C18AC 800C0CAC 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C18B0 800C0CB0 02002025 */ move $a0, $s0
|
||||
/* 0C18B4 800C0CB4 240100F3 */ li $at, 243
|
||||
/* 0C18B8 800C0CB8 16410003 */ bne $s2, $at, .L800C0CC8
|
||||
/* 0C18BC 800C0CBC 02401825 */ move $v1, $s2
|
||||
/* 0C18C0 800C0CC0 1660FF89 */ bnez $s3, .L800C0AE8
|
||||
/* 0C18C4 800C0CC4 00000000 */ nop
|
||||
.L800C0CC8:
|
||||
/* 0C18C8 800C0CC8 240100F2 */ li $at, 242
|
||||
/* 0C18CC 800C0CCC 54610004 */ bnel $v1, $at, .L800C0CE0
|
||||
/* 0C18D0 800C0CD0 8E0C0000 */ lw $t4, ($s0)
|
||||
/* 0C18D4 800C0CD4 0661FF84 */ bgez $s3, .L800C0AE8
|
||||
/* 0C18D8 800C0CD8 00000000 */ nop
|
||||
/* 0C18DC 800C0CDC 8E0C0000 */ lw $t4, ($s0)
|
||||
.L800C0CE0:
|
||||
/* 0C18E0 800C0CE0 00027600 */ sll $t6, $v0, 0x18
|
||||
/* 0C18E4 800C0CE4 000E6E03 */ sra $t5, $t6, 0x18
|
||||
/* 0C18E8 800C0CE8 018DC021 */ addu $t8, $t4, $t5
|
||||
/* 0C18EC 800C0CEC 1000FF7E */ b .L800C0AE8
|
||||
/* 0C18F0 800C0CF0 AE180000 */ sw $t8, ($s0)
|
||||
glabel L800C0CF4
|
||||
/* 0C18F4 800C0CF4 26240094 */ addiu $a0, $s1, 0x94
|
||||
/* 0C18F8 800C0CF8 0C02F506 */ jal note_pool_clear
|
||||
/* 0C18FC 800C0CFC AFA40038 */ sw $a0, 0x38($sp)
|
||||
/* 0C1900 800C0D00 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C1904 800C0D04 02002025 */ move $a0, $s0
|
||||
/* 0C1908 800C0D08 8FA40038 */ lw $a0, 0x38($sp)
|
||||
/* 0C190C 800C0D0C 0C02F55E */ jal note_pool_fill
|
||||
/* 0C1910 800C0D10 00402825 */ move $a1, $v0
|
||||
/* 0C1914 800C0D14 1000FF74 */ b .L800C0AE8
|
||||
/* 0C1918 800C0D18 00000000 */ nop
|
||||
glabel L800C0D1C
|
||||
/* 0C191C 800C0D1C 0C02F506 */ jal note_pool_clear
|
||||
/* 0C1920 800C0D20 26240094 */ addiu $a0, $s1, 0x94
|
||||
/* 0C1924 800C0D24 1000FF70 */ b .L800C0AE8
|
||||
/* 0C1928 800C0D28 00000000 */ nop
|
||||
glabel L800C0D2C
|
||||
/* 0C192C 800C0D2C A620000C */ sh $zero, 0xc($s1)
|
||||
glabel L800C0D30
|
||||
/* 0C1930 800C0D30 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C1934 800C0D34 02002025 */ move $a0, $s0
|
||||
/* 0C1938 800C0D38 862F000C */ lh $t7, 0xc($s1)
|
||||
/* 0C193C 800C0D3C 0002CE00 */ sll $t9, $v0, 0x18
|
||||
/* 0C1940 800C0D40 00194603 */ sra $t0, $t9, 0x18
|
||||
/* 0C1944 800C0D44 01E84821 */ addu $t1, $t7, $t0
|
||||
/* 0C1948 800C0D48 1000FF67 */ b .L800C0AE8
|
||||
/* 0C194C 800C0D4C A629000C */ sh $t1, 0xc($s1)
|
||||
glabel L800C0D50
|
||||
/* 0C1950 800C0D50 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C1954 800C0D54 02002025 */ move $a0, $s0
|
||||
/* 0C1958 800C0D58 240100DD */ li $at, 221
|
||||
/* 0C195C 800C0D5C 16410007 */ bne $s2, $at, .L800C0D7C
|
||||
/* 0C1960 800C0D60 3C03803B */ lui $v1, %hi(gTempoInternalToExternal) # $v1, 0x803b
|
||||
/* 0C1964 800C0D64 304A00FF */ andi $t2, $v0, 0xff
|
||||
/* 0C1968 800C0D68 000A5880 */ sll $t3, $t2, 2
|
||||
/* 0C196C 800C0D6C 016A5823 */ subu $t3, $t3, $t2
|
||||
/* 0C1970 800C0D70 000B5900 */ sll $t3, $t3, 4
|
||||
/* 0C1974 800C0D74 10000009 */ b .L800C0D9C
|
||||
/* 0C1978 800C0D78 A62B0008 */ sh $t3, 8($s1)
|
||||
.L800C0D7C:
|
||||
/* 0C197C 800C0D7C 00026600 */ sll $t4, $v0, 0x18
|
||||
/* 0C1980 800C0D80 000C6E03 */ sra $t5, $t4, 0x18
|
||||
/* 0C1984 800C0D84 962E0008 */ lhu $t6, 8($s1)
|
||||
/* 0C1988 800C0D88 000DC080 */ sll $t8, $t5, 2
|
||||
/* 0C198C 800C0D8C 030DC023 */ subu $t8, $t8, $t5
|
||||
/* 0C1990 800C0D90 0018C100 */ sll $t8, $t8, 4
|
||||
/* 0C1994 800C0D94 01D8C821 */ addu $t9, $t6, $t8
|
||||
/* 0C1998 800C0D98 A6390008 */ sh $t9, 8($s1)
|
||||
.L800C0D9C:
|
||||
/* 0C199C 800C0D9C 846370B4 */ lh $v1, %lo(gTempoInternalToExternal)($v1)
|
||||
/* 0C19A0 800C0DA0 96220008 */ lhu $v0, 8($s1)
|
||||
/* 0C19A4 800C0DA4 24090001 */ li $t1, 1
|
||||
/* 0C19A8 800C0DA8 0062082A */ slt $at, $v1, $v0
|
||||
/* 0C19AC 800C0DAC 50200004 */ beql $at, $zero, .L800C0DC0
|
||||
/* 0C19B0 800C0DB0 00027C00 */ sll $t7, $v0, 0x10
|
||||
/* 0C19B4 800C0DB4 A6230008 */ sh $v1, 8($s1)
|
||||
/* 0C19B8 800C0DB8 3062FFFF */ andi $v0, $v1, 0xffff
|
||||
/* 0C19BC 800C0DBC 00027C00 */ sll $t7, $v0, 0x10
|
||||
.L800C0DC0:
|
||||
/* 0C19C0 800C0DC0 000F4403 */ sra $t0, $t7, 0x10
|
||||
/* 0C19C4 800C0DC4 1D00FF48 */ bgtz $t0, .L800C0AE8
|
||||
/* 0C19C8 800C0DC8 00000000 */ nop
|
||||
/* 0C19CC 800C0DCC 1000FF46 */ b .L800C0AE8
|
||||
/* 0C19D0 800C0DD0 A6290008 */ sh $t1, 8($s1)
|
||||
glabel L800C0DD4
|
||||
/* 0C19D4 800C0DD4 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C19D8 800C0DD8 02002025 */ move $a0, $s0
|
||||
/* 0C19DC 800C0DDC 305200FF */ andi $s2, $v0, 0xff
|
||||
/* 0C19E0 800C0DE0 0C02FC47 */ jal m64_read_s16
|
||||
/* 0C19E4 800C0DE4 02002025 */ move $a0, $s0
|
||||
/* 0C19E8 800C0DE8 12400008 */ beqz $s2, .L800C0E0C
|
||||
/* 0C19EC 800C0DEC 02401825 */ move $v1, $s2
|
||||
/* 0C19F0 800C0DF0 24010001 */ li $at, 1
|
||||
/* 0C19F4 800C0DF4 10610005 */ beq $v1, $at, .L800C0E0C
|
||||
/* 0C19F8 800C0DF8 24010002 */ li $at, 2
|
||||
/* 0C19FC 800C0DFC 1061000A */ beq $v1, $at, .L800C0E28
|
||||
/* 0C1A00 800C0E00 304BFFFF */ andi $t3, $v0, 0xffff
|
||||
/* 0C1A04 800C0E04 1000FF38 */ b .L800C0AE8
|
||||
/* 0C1A08 800C0E08 00000000 */ nop
|
||||
.L800C0E0C:
|
||||
/* 0C1A0C 800C0E0C 922A0001 */ lbu $t2, 1($s1)
|
||||
/* 0C1A10 800C0E10 24010002 */ li $at, 2
|
||||
/* 0C1A14 800C0E14 1141FF34 */ beq $t2, $at, .L800C0AE8
|
||||
/* 0C1A18 800C0E18 00000000 */ nop
|
||||
/* 0C1A1C 800C0E1C A6220012 */ sh $v0, 0x12($s1)
|
||||
/* 0C1A20 800C0E20 1000FF31 */ b .L800C0AE8
|
||||
/* 0C1A24 800C0E24 A2320001 */ sb $s2, 1($s1)
|
||||
.L800C0E28:
|
||||
/* 0C1A28 800C0E28 448B5000 */ mtc1 $t3, $f10
|
||||
/* 0C1A2C 800C0E2C 44802000 */ mtc1 $zero, $f4
|
||||
/* 0C1A30 800C0E30 C6260018 */ lwc1 $f6, 0x18($s1)
|
||||
/* 0C1A34 800C0E34 46805420 */ cvt.s.w $f16, $f10
|
||||
/* 0C1A38 800C0E38 A6220010 */ sh $v0, 0x10($s1)
|
||||
/* 0C1A3C 800C0E3C A2320001 */ sb $s2, 1($s1)
|
||||
/* 0C1A40 800C0E40 46062201 */ sub.s $f8, $f4, $f6
|
||||
/* 0C1A44 800C0E44 46104483 */ div.s $f18, $f8, $f16
|
||||
/* 0C1A48 800C0E48 1000FF27 */ b .L800C0AE8
|
||||
/* 0C1A4C 800C0E4C E632001C */ swc1 $f18, 0x1c($s1)
|
||||
glabel L800C0E50
|
||||
/* 0C1A50 800C0E50 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C1A54 800C0E54 02002025 */ move $a0, $s0
|
||||
/* 0C1A58 800C0E58 92230001 */ lbu $v1, 1($s1)
|
||||
/* 0C1A5C 800C0E5C 24010001 */ li $at, 1
|
||||
/* 0C1A60 800C0E60 5060000B */ beql $v1, $zero, .L800C0E90
|
||||
/* 0C1A64 800C0E64 96230012 */ lhu $v1, 0x12($s1)
|
||||
/* 0C1A68 800C0E68 10610005 */ beq $v1, $at, .L800C0E80
|
||||
/* 0C1A6C 800C0E6C 24010002 */ li $at, 2
|
||||
/* 0C1A70 800C0E70 1061FF1D */ beq $v1, $at, .L800C0AE8
|
||||
/* 0C1A74 800C0E74 00000000 */ nop
|
||||
/* 0C1A78 800C0E78 1000FF1B */ b .L800C0AE8
|
||||
/* 0C1A7C 800C0E7C 00000000 */ nop
|
||||
.L800C0E80:
|
||||
/* 0C1A80 800C0E80 44802000 */ mtc1 $zero, $f4
|
||||
/* 0C1A84 800C0E84 A2200001 */ sb $zero, 1($s1)
|
||||
/* 0C1A88 800C0E88 E6240018 */ swc1 $f4, 0x18($s1)
|
||||
/* 0C1A8C 800C0E8C 96230012 */ lhu $v1, 0x12($s1)
|
||||
.L800C0E90:
|
||||
/* 0C1A90 800C0E90 1060000E */ beqz $v1, .L800C0ECC
|
||||
/* 0C1A94 800C0E94 A6230010 */ sh $v1, 0x10($s1)
|
||||
/* 0C1A98 800C0E98 44823000 */ mtc1 $v0, $f6
|
||||
/* 0C1A9C 800C0E9C 3C0142FE */ li $at, 0x42FE0000 # 127.000000
|
||||
/* 0C1AA0 800C0EA0 44814000 */ mtc1 $at, $f8
|
||||
/* 0C1AA4 800C0EA4 468032A0 */ cvt.s.w $f10, $f6
|
||||
/* 0C1AA8 800C0EA8 306CFFFF */ andi $t4, $v1, 0xffff
|
||||
/* 0C1AAC 800C0EAC 448C3000 */ mtc1 $t4, $f6
|
||||
/* 0C1AB0 800C0EB0 C6320018 */ lwc1 $f18, 0x18($s1)
|
||||
/* 0C1AB4 800C0EB4 46085403 */ div.s $f16, $f10, $f8
|
||||
/* 0C1AB8 800C0EB8 468032A0 */ cvt.s.w $f10, $f6
|
||||
/* 0C1ABC 800C0EBC 46128101 */ sub.s $f4, $f16, $f18
|
||||
/* 0C1AC0 800C0EC0 460A2203 */ div.s $f8, $f4, $f10
|
||||
/* 0C1AC4 800C0EC4 1000FF08 */ b .L800C0AE8
|
||||
/* 0C1AC8 800C0EC8 E628001C */ swc1 $f8, 0x1c($s1)
|
||||
.L800C0ECC:
|
||||
/* 0C1ACC 800C0ECC 44828000 */ mtc1 $v0, $f16
|
||||
/* 0C1AD0 800C0ED0 3C0142FE */ li $at, 0x42FE0000 # 127.000000
|
||||
/* 0C1AD4 800C0ED4 44813000 */ mtc1 $at, $f6
|
||||
/* 0C1AD8 800C0ED8 468084A0 */ cvt.s.w $f18, $f16
|
||||
/* 0C1ADC 800C0EDC 46069103 */ div.s $f4, $f18, $f6
|
||||
/* 0C1AE0 800C0EE0 1000FF01 */ b .L800C0AE8
|
||||
/* 0C1AE4 800C0EE4 E6240018 */ swc1 $f4, 0x18($s1)
|
||||
glabel L800C0EE8
|
||||
/* 0C1AE8 800C0EE8 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C1AEC 800C0EEC 02002025 */ move $a0, $s0
|
||||
/* 0C1AF0 800C0EF0 00026E00 */ sll $t5, $v0, 0x18
|
||||
/* 0C1AF4 800C0EF4 000D7603 */ sra $t6, $t5, 0x18
|
||||
/* 0C1AF8 800C0EF8 448E5000 */ mtc1 $t6, $f10
|
||||
/* 0C1AFC 800C0EFC 3C0142FE */ li $at, 0x42FE0000 # 127.000000
|
||||
/* 0C1B00 800C0F00 44818000 */ mtc1 $at, $f16
|
||||
/* 0C1B04 800C0F04 46805220 */ cvt.s.w $f8, $f10
|
||||
/* 0C1B08 800C0F08 46104483 */ div.s $f18, $f8, $f16
|
||||
/* 0C1B0C 800C0F0C 1000FEF6 */ b .L800C0AE8
|
||||
/* 0C1B10 800C0F10 E6320028 */ swc1 $f18, 0x28($s1)
|
||||
glabel L800C0F14
|
||||
/* 0C1B14 800C0F14 0C02FC47 */ jal m64_read_s16
|
||||
/* 0C1B18 800C0F18 02002025 */ move $a0, $s0
|
||||
/* 0C1B1C 800C0F1C 02202025 */ move $a0, $s1
|
||||
/* 0C1B20 800C0F20 0C02FB23 */ jal sequence_player_init_channels
|
||||
/* 0C1B24 800C0F24 3045FFFF */ andi $a1, $v0, 0xffff
|
||||
/* 0C1B28 800C0F28 1000FEEF */ b .L800C0AE8
|
||||
/* 0C1B2C 800C0F2C 00000000 */ nop
|
||||
glabel L800C0F30
|
||||
/* 0C1B30 800C0F30 0C02FC47 */ jal m64_read_s16
|
||||
/* 0C1B34 800C0F34 02002025 */ move $a0, $s0
|
||||
/* 0C1B38 800C0F38 02202025 */ move $a0, $s1
|
||||
/* 0C1B3C 800C0F3C 0C02FB6E */ jal sequence_player_disable_channels
|
||||
/* 0C1B40 800C0F40 3045FFFF */ andi $a1, $v0, 0xffff
|
||||
/* 0C1B44 800C0F44 1000FEE8 */ b .L800C0AE8
|
||||
/* 0C1B48 800C0F48 00000000 */ nop
|
||||
glabel L800C0F4C
|
||||
/* 0C1B4C 800C0F4C 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C1B50 800C0F50 02002025 */ move $a0, $s0
|
||||
/* 0C1B54 800C0F54 0002C600 */ sll $t8, $v0, 0x18
|
||||
/* 0C1B58 800C0F58 0018CE03 */ sra $t9, $t8, 0x18
|
||||
/* 0C1B5C 800C0F5C 44993000 */ mtc1 $t9, $f6
|
||||
/* 0C1B60 800C0F60 3C0142FE */ li $at, 0x42FE0000 # 127.000000
|
||||
/* 0C1B64 800C0F64 44815000 */ mtc1 $at, $f10
|
||||
/* 0C1B68 800C0F68 46803120 */ cvt.s.w $f4, $f6
|
||||
/* 0C1B6C 800C0F6C 460A2203 */ div.s $f8, $f4, $f10
|
||||
/* 0C1B70 800C0F70 1000FEDD */ b .L800C0AE8
|
||||
/* 0C1B74 800C0F74 E6280024 */ swc1 $f8, 0x24($s1)
|
||||
glabel L800C0F78
|
||||
/* 0C1B78 800C0F78 92280000 */ lbu $t0, ($s1)
|
||||
/* 0C1B7C 800C0F7C 35090020 */ ori $t1, $t0, 0x20
|
||||
/* 0C1B80 800C0F80 1000FED9 */ b .L800C0AE8
|
||||
/* 0C1B84 800C0F84 A2290000 */ sb $t1, ($s1)
|
||||
glabel L800C0F88
|
||||
/* 0C1B88 800C0F88 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C1B8C 800C0F8C 02002025 */ move $a0, $s0
|
||||
/* 0C1B90 800C0F90 1000FED5 */ b .L800C0AE8
|
||||
/* 0C1B94 800C0F94 A2220003 */ sb $v0, 3($s1)
|
||||
glabel L800C0F98
|
||||
/* 0C1B98 800C0F98 0C02FC47 */ jal m64_read_s16
|
||||
/* 0C1B9C 800C0F9C 02002025 */ move $a0, $s0
|
||||
/* 0C1BA0 800C0FA0 8E2A0014 */ lw $t2, 0x14($s1)
|
||||
/* 0C1BA4 800C0FA4 304BFFFF */ andi $t3, $v0, 0xffff
|
||||
/* 0C1BA8 800C0FA8 240100D2 */ li $at, 210
|
||||
/* 0C1BAC 800C0FAC 16410003 */ bne $s2, $at, .L800C0FBC
|
||||
/* 0C1BB0 800C0FB0 014B1821 */ addu $v1, $t2, $t3
|
||||
/* 0C1BB4 800C0FB4 1000FECC */ b .L800C0AE8
|
||||
/* 0C1BB8 800C0FB8 AE23008C */ sw $v1, 0x8c($s1)
|
||||
.L800C0FBC:
|
||||
/* 0C1BBC 800C0FBC 1000FECA */ b .L800C0AE8
|
||||
/* 0C1BC0 800C0FC0 AE230090 */ sw $v1, 0x90($s1)
|
||||
glabel L800C0FC4
|
||||
/* 0C1BC4 800C0FC4 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C1BC8 800C0FC8 02002025 */ move $a0, $s0
|
||||
/* 0C1BCC 800C0FCC 1000FEC6 */ b .L800C0AE8
|
||||
/* 0C1BD0 800C0FD0 A2220002 */ sb $v0, 2($s1)
|
||||
glabel L800C0FD4
|
||||
/* 0C1BD4 800C0FD4 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C1BD8 800C0FD8 02002025 */ move $a0, $s0
|
||||
/* 0C1BDC 800C0FDC 1000FEC2 */ b .L800C0AE8
|
||||
/* 0C1BE0 800C0FE0 00409825 */ move $s3, $v0
|
||||
glabel L800C0FE4
|
||||
/* 0C1BE4 800C0FE4 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C1BE8 800C0FE8 02002025 */ move $a0, $s0
|
||||
/* 0C1BEC 800C0FEC 1000FEBE */ b .L800C0AE8
|
||||
/* 0C1BF0 800C0FF0 02629824 */ and $s3, $s3, $v0
|
||||
glabel L800C0FF4
|
||||
/* 0C1BF4 800C0FF4 0C02FC42 */ jal m64_read_u8
|
||||
/* 0C1BF8 800C0FF8 02002025 */ move $a0, $s0
|
||||
/* 0C1BFC 800C0FFC 1000FEBA */ b .L800C0AE8
|
||||
/* 0C1C00 800C1000 02629823 */ subu $s3, $s3, $v0
|
||||
.L800C1004:
|
||||
/* 0C1C04 800C1004 28410011 */ slti $at, $v0, 0x11
|
||||
/* 0C1C08 800C1008 14200010 */ bnez $at, .L800C104C
|
||||
/* 0C1C0C 800C100C 28410021 */ slti $at, $v0, 0x21
|
||||
/* 0C1C10 800C1010 14200009 */ bnez $at, .L800C1038
|
||||
/* 0C1C14 800C1014 244CFFC0 */ addiu $t4, $v0, -0x40
|
||||
/* 0C1C18 800C1018 2D810061 */ sltiu $at, $t4, 0x61
|
||||
/* 0C1C1C 800C101C 1020FEB2 */ beqz $at, .L800C0AE8
|
||||
/* 0C1C20 800C1020 000C6080 */ sll $t4, $t4, 2
|
||||
/* 0C1C24 800C1024 3C01800F */ lui $at, %hi(jpt_800F3430)
|
||||
/* 0C1C28 800C1028 002C0821 */ addu $at, $at, $t4
|
||||
/* 0C1C2C 800C102C 8C2C3430 */ lw $t4, %lo(jpt_800F3430)($at)
|
||||
/* 0C1C30 800C1030 01800008 */ jr $t4
|
||||
/* 0C1C34 800C1034 00000000 */ nop
|
||||
.L800C1038:
|
||||
/* 0C1C38 800C1038 24010020 */ li $at, 32
|
||||
/* 0C1C3C 800C103C 1041FEAA */ beq $v0, $at, .L800C0AE8
|
||||
/* 0C1C40 800C1040 00000000 */ nop
|
||||
/* 0C1C44 800C1044 1000FEA8 */ b .L800C0AE8
|
||||
/* 0C1C48 800C1048 00000000 */ nop
|
||||
.L800C104C:
|
||||
/* 0C1C4C 800C104C 10400006 */ beqz $v0, .L800C1068
|
||||
/* 0C1C50 800C1050 306E000F */ andi $t6, $v1, 0xf
|
||||
/* 0C1C54 800C1054 24010010 */ li $at, 16
|
||||
/* 0C1C58 800C1058 1041FEA3 */ beq $v0, $at, .L800C0AE8
|
||||
/* 0C1C5C 800C105C 00000000 */ nop
|
||||
/* 0C1C60 800C1060 1000FEA1 */ b .L800C0AE8
|
||||
/* 0C1C64 800C1064 00000000 */ nop
|
||||
.L800C1068:
|
||||
/* 0C1C68 800C1068 000EC080 */ sll $t8, $t6, 2
|
||||
/* 0C1C6C 800C106C 0238C821 */ addu $t9, $s1, $t8
|
||||
/* 0C1C70 800C1070 8F2F0030 */ lw $t7, 0x30($t9)
|
||||
/* 0C1C74 800C1074 8DF30000 */ lw $s3, ($t7)
|
||||
/* 0C1C78 800C1078 00134040 */ sll $t0, $s3, 1
|
||||
/* 0C1C7C 800C107C 1000FE9A */ b .L800C0AE8
|
||||
/* 0C1C80 800C1080 00089FC2 */ srl $s3, $t0, 0x1f
|
||||
glabel L800C1084
|
||||
/* 0C1C84 800C1084 822A0007 */ lb $t2, 7($s1)
|
||||
/* 0C1C88 800C1088 1000FE97 */ b .L800C0AE8
|
||||
/* 0C1C8C 800C108C 026A9823 */ subu $s3, $s3, $t2
|
||||
glabel L800C1090
|
||||
/* 0C1C90 800C1090 1000FE95 */ b .L800C0AE8
|
||||
/* 0C1C94 800C1094 A2330007 */ sb $s3, 7($s1)
|
||||
glabel L800C1098
|
||||
/* 0C1C98 800C1098 1000FE93 */ b .L800C0AE8
|
||||
/* 0C1C9C 800C109C 82330007 */ lb $s3, 7($s1)
|
||||
glabel L800C10A0
|
||||
/* 0C1CA0 800C10A0 0C02FC47 */ jal m64_read_s16
|
||||
/* 0C1CA4 800C10A4 02002025 */ move $a0, $s0
|
||||
/* 0C1CA8 800C10A8 8E2C0014 */ lw $t4, 0x14($s1)
|
||||
/* 0C1CAC 800C10AC 02402825 */ move $a1, $s2
|
||||
/* 0C1CB0 800C10B0 30AB000F */ andi $t3, $a1, 0xf
|
||||
/* 0C1CB4 800C10B4 304DFFFF */ andi $t5, $v0, 0xffff
|
||||
/* 0C1CB8 800C10B8 01602825 */ move $a1, $t3
|
||||
/* 0C1CBC 800C10BC 02202025 */ move $a0, $s1
|
||||
/* 0C1CC0 800C10C0 0C02FBA2 */ jal sequence_channel_enable
|
||||
/* 0C1CC4 800C10C4 018D3021 */ addu $a2, $t4, $t5
|
||||
/* 0C1CC8 800C10C8 1000FE87 */ b .L800C0AE8
|
||||
/* 0C1CCC 800C10CC 00000000 */ nop
|
||||
.L800C10D0:
|
||||
/* 0C1CD0 800C10D0 3C10803B */ lui $s0, %hi(gSequenceChannelNone) # $s0, 0x803b
|
||||
/* 0C1CD4 800C10D4 02201825 */ move $v1, $s1
|
||||
/* 0C1CD8 800C10D8 24110040 */ li $s1, 64
|
||||
/* 0C1CDC 800C10DC 26105EF0 */ addiu $s0, %lo(gSequenceChannelNone) # addiu $s0, $s0, 0x5ef0
|
||||
/* 0C1CE0 800C10E0 00001025 */ move $v0, $zero
|
||||
.L800C10E4:
|
||||
/* 0C1CE4 800C10E4 8C640030 */ lw $a0, 0x30($v1)
|
||||
/* 0C1CE8 800C10E8 24010001 */ li $at, 1
|
||||
/* 0C1CEC 800C10EC 02047026 */ xor $t6, $s0, $a0
|
||||
/* 0C1CF0 800C10F0 000E702B */ sltu $t6, $zero, $t6
|
||||
/* 0C1CF4 800C10F4 55C10007 */ bnel $t6, $at, .L800C1114
|
||||
/* 0C1CF8 800C10F8 24420004 */ addiu $v0, $v0, 4
|
||||
/* 0C1CFC 800C10FC AFA20034 */ sw $v0, 0x34($sp)
|
||||
/* 0C1D00 800C1100 0C02FF64 */ jal sequence_channel_process_script
|
||||
/* 0C1D04 800C1104 AFA30030 */ sw $v1, 0x30($sp)
|
||||
/* 0C1D08 800C1108 8FA20034 */ lw $v0, 0x34($sp)
|
||||
/* 0C1D0C 800C110C 8FA30030 */ lw $v1, 0x30($sp)
|
||||
/* 0C1D10 800C1110 24420004 */ addiu $v0, $v0, 4
|
||||
.L800C1114:
|
||||
/* 0C1D14 800C1114 1451FFF3 */ bne $v0, $s1, .L800C10E4
|
||||
/* 0C1D18 800C1118 24630004 */ addiu $v1, $v1, 4
|
||||
.L800C111C:
|
||||
/* 0C1D1C 800C111C 8FBF002C */ lw $ra, 0x2c($sp)
|
||||
.L800C1120:
|
||||
/* 0C1D20 800C1120 8FB0001C */ lw $s0, 0x1c($sp)
|
||||
/* 0C1D24 800C1124 8FB10020 */ lw $s1, 0x20($sp)
|
||||
/* 0C1D28 800C1128 8FB20024 */ lw $s2, 0x24($sp)
|
||||
/* 0C1D2C 800C112C 8FB30028 */ lw $s3, 0x28($sp)
|
||||
/* 0C1D30 800C1130 03E00008 */ jr $ra
|
||||
/* 0C1D34 800C1134 27BD0060 */ addiu $sp, $sp, 0x60
|
@ -250,7 +250,7 @@ glabel func_800B7C30
|
||||
/* 0B8BCC 800B7FCC 00008012 */ mflo $s0
|
||||
/* 0B8BD0 800B7FD0 2610001F */ addiu $s0, $s0, 0x1f
|
||||
/* 0B8BD4 800B7FD4 02012824 */ and $a1, $s0, $at
|
||||
/* 0B8BD8 800B7FD8 0C02EB43 */ jal func_800BAD0C
|
||||
/* 0B8BD8 800B7FD8 0C02EB43 */ jal dma_sample_data
|
||||
/* 0B8BDC 800B7FDC 00A08025 */ move $s0, $a1
|
||||
/* 0B8BE0 800B7FE0 8FAB011C */ lw $t3, 0x11c($sp)
|
||||
/* 0B8BE4 800B7FE4 8FAC0118 */ lw $t4, 0x118($sp)
|
||||
|
@ -1,50 +0,0 @@
|
||||
.include "macros.inc"
|
||||
|
||||
.section .data
|
||||
|
||||
.balign 4
|
||||
glabel D_800EA4D0
|
||||
.word 0x01284fff
|
||||
|
||||
glabel D_800EA4D4
|
||||
.word 0x01145fff
|
||||
|
||||
glabel gAudioSessionPresets
|
||||
.word 0x000068b0, 0x01180100, D_800EA4D0, 0x7fff0000
|
||||
.word 0x00002a00, 0x00004600, 0x00000000, 0x00005800
|
||||
.word 0x00002800, 0x00000000
|
||||
|
||||
.word 0x000068b0, 0x01140100, D_800EA4D0, 0x7fff0000
|
||||
.word 0x00002a00, 0x00004600, 0x00000000, 0x00005800
|
||||
.word 0x00002800, 0x00000000
|
||||
|
||||
.word 0x000068b0, 0x011c0100, D_800EA4D0, 0x7fff0000
|
||||
.word 0x00002a00, 0x00004600, 0x00000000, 0x00005800
|
||||
.word 0x00002800, 0x00000000
|
||||
|
||||
.word 0x000068b0, 0x011c0100, D_800EA4D0, 0x7fff0000
|
||||
.word 0x00002a00, 0x00004600, 0x00000000, 0x00005800
|
||||
.word 0x00002800, 0x00000000
|
||||
|
||||
.word 0x000068b0, 0x01100100, D_800EA4D0, 0x7fff0000
|
||||
.word 0x00002a00, 0x00004600, 0x00000000, 0x00004800
|
||||
.word 0x00002000, 0x00000000
|
||||
|
||||
.word 0x000068b0, 0x01100100, D_800EA4D4, 0x7fff0000
|
||||
.word 0x00002a00, 0x00004600, 0x00000000, 0x00004800
|
||||
.word 0x00002000, 0x00000000, 0x1c000000
|
||||
|
||||
glabel gTatumsPerBeat
|
||||
.hword 0x0030, 0x0000
|
||||
|
||||
glabel D_800EA5D0
|
||||
.word 0x00048c00
|
||||
|
||||
glabel D_800EA5D4
|
||||
.word 0x00002600
|
||||
|
||||
glabel D_800EA5D8
|
||||
.word 0x00000000
|
||||
|
||||
glabel gAudioLoadLock
|
||||
.word 0x00000000
|
2
mk64.ld
2
mk64.ld
@ -273,7 +273,7 @@ SECTIONS
|
||||
#endif
|
||||
BUILD_DIR/data/data_0DD0A0_2_1_1.o(.data);
|
||||
BUILD_DIR/src/audio/port_eu.o(.data);
|
||||
BUILD_DIR/data/data_0DD0A0_2_1_2.o(.data);
|
||||
BUILD_DIR/src/audio/audio_session_presets.o(.data);
|
||||
BUILD_DIR/src/os/osInitialize.o(.data*);
|
||||
BUILD_DIR/src/os/osCreateViManager.o(.data);
|
||||
BUILD_DIR/src/os/osViTable.o(.data);
|
||||
|
@ -21,3 +21,7 @@ compiler_type = "ido"
|
||||
"a[A-Za-z]+" = "void"
|
||||
"_SHIFT[LR]" = "void"
|
||||
"ALIGN.*" = "int"
|
||||
"aClearBuffer" = "void"
|
||||
"aEnvSetup1" = "void"
|
||||
"aEnvSetup2" = "void"
|
||||
"aEnvMixer" = "void"
|
||||
|
41
src/audio/audio_session_presets.c
Normal file
41
src/audio/audio_session_presets.c
Normal file
@ -0,0 +1,41 @@
|
||||
#ifndef AUDIO_SESSION_PRESETS_H
|
||||
#define AUDIO_SESSION_PRESETS_H
|
||||
|
||||
#include "internal.h"
|
||||
#include "data.h"
|
||||
|
||||
struct ReverbSettingsEU sReverbSettings[] = {
|
||||
{0x01, 0x28, 0x4fff},
|
||||
{0x01, 0x14, 0x5fff},
|
||||
};
|
||||
|
||||
struct AudioSessionSettingsEU gAudioSessionPresets[] = {
|
||||
{ 0x000068b0, 0x01, 0x18, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00002a00, 0x00004600,
|
||||
0x00000000, 0x00005800, 0x00002800, 0x00000000 },
|
||||
|
||||
{ 0x000068b0, 0x01, 0x14, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00002a00, 0x00004600,
|
||||
0x00000000, 0x00005800, 0x00002800, 0x00000000 },
|
||||
|
||||
{ 0x000068b0, 0x01, 0x1c, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00002a00, 0x00004600,
|
||||
0x00000000, 0x00005800, 0x00002800, 0x00000000 },
|
||||
|
||||
{ 0x000068b0, 0x01, 0x1c, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00002a00, 0x00004600,
|
||||
0x00000000, 0x00005800, 0x00002800, 0x00000000 },
|
||||
|
||||
{ 0x000068b0, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00002a00, 0x00004600,
|
||||
0x00000000, 0x00004800, 0x00002000, 0x00000000 },
|
||||
|
||||
{ 0x000068b0, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[1], 0x7fff, 0x0000, 0x00002a00, 0x00004600,
|
||||
0x00000000, 0x00004800, 0x00002000, 0x00000000 },
|
||||
};
|
||||
|
||||
|
||||
|
||||
s8 gUnusedCount800EA5C8 = 0x1c;
|
||||
s16 gTatumsPerBeat = TATUMS_PER_BEAT;
|
||||
s32 gAudioHeapSize = 0x00048c00;
|
||||
s32 gAudioInitPoolSize = 0x00002600;
|
||||
s32 D_800EA5D8 = 0;
|
||||
volatile s32 gAudioLoadLock = 0;
|
||||
|
||||
#endif
|
@ -426,8 +426,8 @@ f32 gDefaultPanVolume[128] = {
|
||||
0.086471f, 0.074143f, 0.061803f, 0.049454f, 0.037097f, 0.024734f, 0.012368f, 0.0f
|
||||
};
|
||||
|
||||
s32 D_803B70C0;
|
||||
s32 D_803B70C4;
|
||||
s32 gAudioTaskIndex;
|
||||
s32 gCurrAiBufferIndex;
|
||||
u64 *gAudioCmdBuffers[2]; // probably wrong
|
||||
u64 *gAudioCmd;
|
||||
struct SPTask *gAudioTask; // gAudioTask?
|
||||
@ -435,8 +435,7 @@ struct SPTask gAudioTasks[2]; // gAudioTasks?
|
||||
f32 D_803B7178;
|
||||
s32 gRefreshRate;
|
||||
s16 *gAiBuffers[3]; // unconfirmed, osAiSetNextBuffer vaddr
|
||||
u32 D_803B718C; // osAiSetNextBuffer nbytes
|
||||
s16 load_bss_pad3;
|
||||
s16 gAiBufferLengths[NUMAIBUFFERS]; // osAiSetNextBuffer nbytes
|
||||
u16 D_803B7192; // unconfirmed
|
||||
u32 gAudioRandom;
|
||||
s32 gAudioErrorFlags;
|
||||
|
@ -39,8 +39,8 @@ extern u32 gAudioRandom;
|
||||
extern s16 gTatumsPerBeat; // D_800EA5CC
|
||||
extern volatile s32 gAudioLoadLock; // D_800EA5DC
|
||||
|
||||
extern s32 D_803B70C0;
|
||||
extern s32 D_803B70C4;
|
||||
extern s32 gAudioTaskIndex;
|
||||
extern s32 gCurrAiBufferIndex;
|
||||
extern u64 *gAudioCmdBuffers[2]; // probably wrong
|
||||
extern u64 *gAudioCmd; // D_803B70D0
|
||||
extern struct SPTask *gAudioTask; // D_803B70D4
|
||||
@ -48,12 +48,20 @@ extern struct SPTask gAudioTasks[2]; // D_803B70D8
|
||||
extern f32 D_803B7178;
|
||||
extern s32 gRefreshRate;
|
||||
extern s16 *gAiBuffers[NUMAIBUFFERS]; // D_803B7180
|
||||
extern u32 D_803B718C; // osAiSetNextBuffer nbytes
|
||||
extern s16 load_bss_pad3;
|
||||
extern s16 gAiBufferLengths[NUMAIBUFFERS]; // osAiSetNextBuffer nbytes
|
||||
extern u16 D_803B7192; // unconfirmed
|
||||
extern u32 gAudioRandom;
|
||||
extern s32 gAudioErrorFlags;
|
||||
extern u32 D_803B71A0[4]; // unconfirmed
|
||||
extern u8 D_803B71B0[4]; // unconfirmed
|
||||
|
||||
extern struct ReverbSettingsEU sReverbSettings[];
|
||||
extern struct AudioSessionSettingsEU gAudioSessionPresets[];
|
||||
extern s8 gUnusedCount800EA5C8;
|
||||
extern s16 gTatumsPerBeat;
|
||||
extern s32 gAudioHeapSize;
|
||||
extern s32 gAudioInitPoolSize;
|
||||
extern s32 D_800EA5D8;
|
||||
extern volatile s32 gAudioLoadLock;
|
||||
|
||||
#endif
|
||||
|
@ -194,7 +194,7 @@ void func_800B90E0(struct SoundAllocPool *pool) {
|
||||
// inspired by sound_init_main_pools in sm64
|
||||
void func_800B90F0(s32 arg0) {
|
||||
sound_alloc_pool_init(&gAudioInitPool, &D_803B71B0, arg0);
|
||||
sound_alloc_pool_init(&gAudioSessionPool, D_803B71B0 + arg0, D_800EA5D0 - arg0);
|
||||
sound_alloc_pool_init(&gAudioSessionPool, D_803B71B0 + arg0, gAudioHeapSize - arg0);
|
||||
}
|
||||
|
||||
// inspired by session_pools_init in sm64
|
||||
|
500
src/audio/load.c
500
src/audio/load.c
@ -5,19 +5,9 @@
|
||||
#include "audio/heap.h"
|
||||
#include "audio/internal.h"
|
||||
#include "audio/playback.h"
|
||||
#include "audio/synthesis.h"
|
||||
|
||||
#define ALIGN16(val) (((val) + 0xF) & ~0xF)
|
||||
struct SharedDma {
|
||||
/*0x0*/ u8 *buffer; // target, points to pre-allocated buffer
|
||||
/*0x4*/ uintptr_t source; // device address
|
||||
/*0x8*/ u16 sizeUnused; // set to bufSize, never read
|
||||
/*0xA*/ u16 bufSize; // size of buffer
|
||||
/*0xC*/ u8 unused2; // set to 0, never read
|
||||
/*0xD*/ u8 reuseIndex; // position in sSampleDmaReuseQueue1/2, if ttl == 0
|
||||
/*0xE*/ u8 ttl; // duration after which the DMA can be discarded
|
||||
}; // size = 0x10
|
||||
|
||||
//struct Note *gNotes; // 0x803B1508
|
||||
|
||||
struct SequencePlayer gSequencePlayers[SEQUENCE_PLAYERS];
|
||||
struct SequenceChannel gSequenceChannels[SEQUENCE_CHANNELS];
|
||||
@ -58,20 +48,9 @@ s32 gMaxAudioCmds;
|
||||
s32 gMaxSimultaneousNotes;
|
||||
s16 gTempoInternalToExternal;
|
||||
s8 gAudioLibSoundMode;
|
||||
s32 D_803B70B8; // According to sm64 this is s8 not s32
|
||||
s32 gAudioUpdatesPerFrame;
|
||||
s32 gCurrAudioFrameDmaCount; // file split around here?
|
||||
|
||||
extern OSMesgQueue D_803B6720;
|
||||
extern OSIoMesg D_803B6740;
|
||||
|
||||
extern OSMesgQueue gCurrAudioFrameDmaQueue; // gCurrAudioFrameDmaQueue
|
||||
extern OSMesg gCurrAudioFrameDmaMesgBufs[AUDIO_FRAME_DMA_QUEUE_SIZE]; // gCurrAudioFrameDmaMesgBufs
|
||||
extern OSIoMesg gCurrAudioFrameDmaIoMesgBufs[AUDIO_FRAME_DMA_QUEUE_SIZE]; // gCurrAudioFrameDmaIoMesgBufs
|
||||
|
||||
extern u32 gSampleDmaNumListItems; // gSampleDmaNumListItems
|
||||
extern u32 sSampleDmaListSize1; // sSampleDmaListSize1
|
||||
extern s32 D_803B6E60; // sUnused80226B40
|
||||
|
||||
|
||||
/**
|
||||
* Given that (almost) all of these are format strings, it is highly likely
|
||||
@ -179,9 +158,7 @@ void decrease_sample_dma_ttls() {
|
||||
D_803B6E60 = 0;
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
// dma_sample_data 3000 score diff
|
||||
void *func_800BAD0C(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
s32 hasDma = FALSE;
|
||||
struct SharedDma *dma;
|
||||
uintptr_t dmaDevAddr;
|
||||
@ -201,10 +178,8 @@ void *func_800BAD0C(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
// Move the DMA out of the reuse queue, by swapping it with the
|
||||
// tail, and then incrementing the tail.
|
||||
if (dma->reuseIndex != sSampleDmaReuseQueueTail2) {
|
||||
sSampleDmaReuseQueue2[dma->reuseIndex] =
|
||||
sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2];
|
||||
sSampleDmas[sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2]].reuseIndex =
|
||||
dma->reuseIndex;
|
||||
sSampleDmaReuseQueue2[dma->reuseIndex] = sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2];
|
||||
sSampleDmas[sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2]].reuseIndex = dma->reuseIndex;
|
||||
}
|
||||
sSampleDmaReuseQueueTail2++;
|
||||
}
|
||||
@ -214,35 +189,35 @@ void *func_800BAD0C(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
}
|
||||
}
|
||||
|
||||
if (sSampleDmaReuseQueueTail2 != sSampleDmaReuseQueueHead2 && arg2 != 0) {
|
||||
if ((sSampleDmaReuseQueueTail2 != sSampleDmaReuseQueueHead2) && (arg2 != 0)) {
|
||||
// Allocate a DMA from reuse queue 2. This queue can be empty, since
|
||||
// TTL 60 is pretty large.
|
||||
dmaIndex = sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2];
|
||||
sSampleDmaReuseQueueTail2++;
|
||||
dma = sSampleDmas + dmaIndex;
|
||||
dmaIndex = sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2++];
|
||||
dma = &sSampleDmas[dmaIndex];
|
||||
hasDma = TRUE;
|
||||
}
|
||||
} else {
|
||||
dma = sSampleDmas;
|
||||
dma += *dmaIndexRef;
|
||||
bufferPos = devAddr - dma->source;
|
||||
if (0 <= bufferPos && (size_t) bufferPos <= dma->bufSize - size) {
|
||||
// We already have DMA for this memory range.
|
||||
if (dma->ttl == 0) {
|
||||
// Move the DMA out of the reuse queue, by swapping it with the
|
||||
// tail, and then incrementing the tail.
|
||||
if (dma->reuseIndex != sSampleDmaReuseQueueTail1) {
|
||||
if (1) {
|
||||
dma = &sSampleDmas[*dmaIndexRef];
|
||||
for (i = 0; i < sSampleDmaListSize1; dma = &sSampleDmas[i++]) {
|
||||
bufferPos = devAddr - dma->source;
|
||||
if (0 <= bufferPos && (size_t) bufferPos <= dma->bufSize - size) {
|
||||
// We already have DMA for this memory range.
|
||||
if (dma->ttl == 0) {
|
||||
// Move the DMA out of the reuse queue, by swapping it with the
|
||||
// tail, and then incrementing the tail.
|
||||
if (dma->reuseIndex != sSampleDmaReuseQueueTail1) {
|
||||
if (1) {
|
||||
}
|
||||
sSampleDmaReuseQueue1[dma->reuseIndex] =
|
||||
sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1];
|
||||
sSampleDmas[sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]].reuseIndex =
|
||||
dma->reuseIndex;
|
||||
}
|
||||
sSampleDmaReuseQueue1[dma->reuseIndex] =
|
||||
sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1];
|
||||
sSampleDmas[sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]].reuseIndex =
|
||||
dma->reuseIndex;
|
||||
sSampleDmaReuseQueueTail1++;
|
||||
}
|
||||
sSampleDmaReuseQueueTail1++;
|
||||
dma->ttl = 2;
|
||||
return dma->buffer + (devAddr - dma->source);
|
||||
}
|
||||
dma->ttl = 2;
|
||||
return dma->buffer + (devAddr - dma->source);
|
||||
}
|
||||
}
|
||||
|
||||
@ -250,7 +225,7 @@ void *func_800BAD0C(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
// Allocate a DMA from reuse queue 1. This queue will hopefully never
|
||||
// be empty, since TTL 2 is so small.
|
||||
dmaIndex = sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1++];
|
||||
dma = sSampleDmas + dmaIndex;
|
||||
dma = &sSampleDmas[dmaIndex];
|
||||
hasDma = TRUE;
|
||||
}
|
||||
|
||||
@ -265,131 +240,6 @@ void *func_800BAD0C(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
return (devAddr - dmaDevAddr) + dma->buffer;
|
||||
}
|
||||
|
||||
extern ? gCurrAudioFrameDmaIoMesgBufs;
|
||||
extern OSMesgQueue gCurrAudioFrameDmaQueue;
|
||||
extern u32 sSampleDmaListSize1;
|
||||
extern ? sSampleDmaReuseQueue1;
|
||||
extern ? sSampleDmaReuseQueue2;
|
||||
extern u8 sSampleDmaReuseQueueHead2;
|
||||
extern u8 sSampleDmaReuseQueueTail1;
|
||||
extern u8 sSampleDmaReuseQueueTail2;
|
||||
extern ? sSampleDmas;
|
||||
|
||||
void *func_800BAD0C(u32 devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
void *sp40;
|
||||
s32 sp30;
|
||||
s32 temp_t9;
|
||||
s32 temp_t9_2;
|
||||
s32 temp_t9_3;
|
||||
s32 temp_v0_2;
|
||||
s32 temp_v0_4;
|
||||
s32 var_t2;
|
||||
s32 var_t3;
|
||||
u16 temp_v0_6;
|
||||
u32 temp_s0;
|
||||
u32 var_v1;
|
||||
u32 var_v1_2;
|
||||
u8 *temp_v0_3;
|
||||
u8 *temp_v0_5;
|
||||
u8 temp_a0;
|
||||
u8 temp_a3;
|
||||
u8 temp_t2;
|
||||
u8 temp_v0;
|
||||
void *temp_t0;
|
||||
void *var_a0;
|
||||
void *var_t0;
|
||||
|
||||
var_t3 = 0;
|
||||
if ((arg2 != 0) || (temp_v0 = *dmaIndexRef, var_v1 = 0, ((temp_v0 < (u32) sSampleDmaListSize1) == 0))) {
|
||||
var_v1_2 = sSampleDmaListSize1;
|
||||
if (var_v1_2 < (u32) gSampleDmaNumListItems) {
|
||||
var_a0 = (var_v1_2 * 0x10) + &sSampleDmas;
|
||||
loop_4:
|
||||
temp_t0 = var_a0;
|
||||
temp_v0_2 = devAddr - var_a0->unk4;
|
||||
if ((temp_v0_2 >= 0) && ((u32) (var_a0->unkA - size) >= (u32) temp_v0_2)) {
|
||||
if ((var_a0->unkE == 0) && (sSampleDmaReuseQueueHead2 != sSampleDmaReuseQueueTail2)) {
|
||||
temp_a3 = var_a0->unkD;
|
||||
temp_v0_3 = &sSampleDmaReuseQueue2 + sSampleDmaReuseQueueTail2;
|
||||
if (sSampleDmaReuseQueueTail2 != temp_a3) {
|
||||
*(&sSampleDmaReuseQueue2 + temp_a3) = *temp_v0_3;
|
||||
(&sSampleDmas + (*temp_v0_3 * 0x10))->unkD = (u8) var_a0->unkD;
|
||||
}
|
||||
sSampleDmaReuseQueueTail2 += 1;
|
||||
}
|
||||
var_a0->unkE = 0x3CU;
|
||||
*dmaIndexRef = (u8) var_v1_2;
|
||||
return (var_a0->unk0 + devAddr) - var_a0->unk4;
|
||||
}
|
||||
var_v1_2 += 1;
|
||||
var_a0 += 0x10;
|
||||
if (var_v1_2 >= (u32) gSampleDmaNumListItems) {
|
||||
sp40 = temp_t0;
|
||||
goto block_14;
|
||||
}
|
||||
goto loop_4;
|
||||
}
|
||||
block_14:
|
||||
var_t0 = sp40;
|
||||
if ((sSampleDmaReuseQueueHead2 != sSampleDmaReuseQueueTail2) && (arg2 != 0)) {
|
||||
temp_t2 = *(&sSampleDmaReuseQueue2 + sSampleDmaReuseQueueTail2);
|
||||
temp_t9 = temp_t2 * 0x10;
|
||||
sSampleDmaReuseQueueTail2 += 1;
|
||||
var_t0 = &sSampleDmas + temp_t9;
|
||||
var_t3 = 1;
|
||||
sp30 = (s32) temp_t2;
|
||||
}
|
||||
goto block_27;
|
||||
}
|
||||
var_t0 = &sSampleDmas + (temp_v0 * 0x10);
|
||||
if (sSampleDmaListSize1 != 0) {
|
||||
loop_19:
|
||||
temp_t9_2 = var_v1 * 0x10;
|
||||
var_v1 += 1;
|
||||
temp_v0_4 = devAddr - var_t0->unk4;
|
||||
if ((temp_v0_4 >= 0) && ((u32) (var_t0->unkA - size) >= (u32) temp_v0_4)) {
|
||||
if (var_t0->unkE == 0) {
|
||||
temp_a0 = var_t0->unkD;
|
||||
temp_v0_5 = &sSampleDmaReuseQueue1 + sSampleDmaReuseQueueTail1;
|
||||
if (sSampleDmaReuseQueueTail1 != temp_a0) {
|
||||
*(&sSampleDmaReuseQueue1 + temp_a0) = *temp_v0_5;
|
||||
(&sSampleDmas + (*temp_v0_5 * 0x10))->unkD = (u8) var_t0->unkD;
|
||||
}
|
||||
sSampleDmaReuseQueueTail1 += 1;
|
||||
}
|
||||
var_t0->unkE = 2U;
|
||||
return (var_t0->unk0 + devAddr) - var_t0->unk4;
|
||||
}
|
||||
var_t0 = &sSampleDmas + temp_t9_2;
|
||||
if (var_v1 >= (u32) sSampleDmaListSize1) {
|
||||
goto block_27;
|
||||
}
|
||||
goto loop_19;
|
||||
}
|
||||
block_27:
|
||||
var_t2 = sp30;
|
||||
if (var_t3 == 0) {
|
||||
var_t2 = (s32) *(&sSampleDmaReuseQueue1 + sSampleDmaReuseQueueTail1);
|
||||
sSampleDmaReuseQueueTail1 += 1;
|
||||
var_t0 = &sSampleDmas + (var_t2 * 0x10);
|
||||
}
|
||||
temp_v0_6 = var_t0->unkA;
|
||||
temp_s0 = devAddr & ~0xF;
|
||||
var_t0->unkE = 2;
|
||||
var_t0->unk4 = temp_s0;
|
||||
var_t0->unk8 = temp_v0_6;
|
||||
temp_t9_3 = gCurrAudioFrameDmaCount * 0x18;
|
||||
gCurrAudioFrameDmaCount += 1;
|
||||
sp30 = var_t2;
|
||||
sp40 = var_t0;
|
||||
osPiStartDma(temp_t9_3 + &gCurrAudioFrameDmaIoMesgBufs, 0, 0, temp_s0, var_t0->unk0, (u32) temp_v0_6, &gCurrAudioFrameDmaQueue);
|
||||
*dmaIndexRef = (u8) var_t2;
|
||||
return (devAddr - temp_s0) + var_t0->unk0;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/audio/load/func_800BAD0C.s")
|
||||
#endif
|
||||
|
||||
// init_sample_dma_buffers
|
||||
void func_800BB030(UNUSED s32 arg0) {
|
||||
s32 i;
|
||||
@ -506,27 +356,20 @@ s32 func_800BB388(s32 bankId, s32 instId, s32 arg2) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Aug-14-2023
|
||||
void func_800BB43C(void *arg0, s32 arg1) {
|
||||
s32 var_v0;
|
||||
void *var_a2;
|
||||
|
||||
var_v0 = 0;
|
||||
var_a2 = arg0;
|
||||
if (arg0->unk2 > 0) {
|
||||
do {
|
||||
var_v0 += 1;
|
||||
if (var_a2->unk8 != 0) {
|
||||
var_a2->unk4 = (s32) (var_a2->unk4 + arg1);
|
||||
}
|
||||
var_a2 += 8;
|
||||
} while (var_v0 < arg0->unk2);
|
||||
// This appears to be a modified version of alSeqFileNew
|
||||
// from src/os/alBankNew.c
|
||||
// Or maybe its patch_seq_file from SM64's load_sh.c?
|
||||
void func_800BB43C(ALSeqFile *f, u8 *base) {
|
||||
#define PATCH(SRC, BASE, TYPE) SRC = (TYPE)((uintptr_t) SRC + (uintptr_t) BASE)
|
||||
int i;
|
||||
u8 *wut = base;
|
||||
for (i = 0; i < f->seqCount; i++) {
|
||||
if (f->seqArray[i].len != 0)
|
||||
PATCH(f->seqArray[i].offset, wut, u8 *);
|
||||
}
|
||||
#undef PATCH
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/audio/load/func_800BB43C.s")
|
||||
#endif
|
||||
|
||||
|
||||
void patch_sound(struct AudioBankSound *sound, u8 *memBase, u8 *offsetBase) {
|
||||
struct AudioBankSample *sample;
|
||||
@ -562,12 +405,8 @@ void patch_sound(struct AudioBankSound *sound, u8 *memBase, u8 *offsetBase) {
|
||||
#undef PATCH
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 08138748803d75e73e4a94bb0c619a273754ee9c on Sep-12-2023
|
||||
// There does not appear to an SM64 counterpart to this function
|
||||
void func_800BB584(s32 bankId) {
|
||||
s32 sp18;
|
||||
struct CtlEntry *temp_v0;
|
||||
struct CtlEntry *temp_v0_2;
|
||||
u8 *var_a1;
|
||||
|
||||
if (gAlTbl->seqArray[bankId].len == 0) {
|
||||
@ -575,15 +414,10 @@ void func_800BB584(s32 bankId) {
|
||||
} else {
|
||||
var_a1 = gAlTbl->seqArray[bankId].offset;
|
||||
}
|
||||
temp_v0 = &gCtlEntries[bankId];
|
||||
sp18 = bankId * 0xC;
|
||||
patch_audio_bank((struct AudioBank *) (temp_v0->instruments - 4), var_a1, (u32) temp_v0->numInstruments, (u32) temp_v0->numDrums);
|
||||
temp_v0_2 = &gCtlEntries[bankId];
|
||||
temp_v0_2->drums = temp_v0_2->instruments->unk-4;
|
||||
// wtf is up with the `gCtlEntries[bankId].instruments - 1` stuff?
|
||||
patch_audio_bank((gCtlEntries[bankId].instruments - 1), var_a1, gCtlEntries[bankId].numInstruments, gCtlEntries[bankId].numDrums);
|
||||
gCtlEntries[bankId].drums = *(gCtlEntries[bankId].instruments - 1);
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/audio/load/func_800BB584.s")
|
||||
#endif
|
||||
|
||||
void patch_audio_bank(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 numDrums) {
|
||||
struct Instrument *instrument;
|
||||
@ -918,89 +752,44 @@ void load_sequence_internal(u32 player, u32 seqId, s32 loadAsync) {
|
||||
seqPlayer->scriptState.pc = sequenceData;
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Aug-14-2023
|
||||
? func_800B90F0(s32); /* extern */
|
||||
? audio_shut_down_and_reset_step(); /* extern */
|
||||
? func_800BB43C(s32 *, ? *); /* extern */
|
||||
extern s8 gAudioResetStatus;
|
||||
extern s8 gAudioResetPresetIdToLoad;
|
||||
extern OSMesgQueue D_803B6720;
|
||||
extern void *D_803B6738;
|
||||
extern s32 *gSeqFileHeader;
|
||||
extern s32 *gAlCtlHeader;
|
||||
extern s32 *gAlTbl;
|
||||
extern s16 gSequenceCount;
|
||||
extern s32 D_803B70B8;
|
||||
extern s32 D_803B70C0;
|
||||
extern s32 D_803B70C4;
|
||||
extern s32 gAudioTask;
|
||||
extern ? gAudioTasks;
|
||||
extern f32 D_803B7178;
|
||||
extern s32 gRefreshRate;
|
||||
extern void *gAiBuffers;
|
||||
extern ? D_803B718C;
|
||||
extern ? D_803B7192;
|
||||
extern ? D_803B71A0;
|
||||
extern ? D_803B71B0;
|
||||
extern ? _audio_banksSegmentRomStart;
|
||||
extern ? _audio_tablesSegmentRomStart;
|
||||
extern ? _instrument_setsSegmentRomStart;
|
||||
extern ? _sequencesSegmentRomStart;
|
||||
extern void *gCurrAudioFrameDmaMesgBufs;
|
||||
extern OSMesgQueue gCurrAudioFrameDmaQueue;
|
||||
extern s32 gSampleDmaNumListItems;
|
||||
static s32 D_800EA5D0 = 0x00048C00;
|
||||
static s32 D_800EA5D4 = 0x00002600;
|
||||
static u32 D_800EA5D8 = 0;
|
||||
static s32 gAudioLoadLock = 0;
|
||||
#ifdef NON_MATCHING
|
||||
//https://decomp.me/scratch/5FBUM
|
||||
// There is some wild bullshit going on in this function
|
||||
// It is an unholy cross between SM64's EU and Shindou
|
||||
// verions of this function, with the for loop towards
|
||||
// the bottom resembling stuff from bank_load_async
|
||||
extern u8 _audio_banksSegmentRomStart;
|
||||
extern u8 _audio_tablesSegmentRomStart;
|
||||
extern u8 _instrument_setsSegmentRomStart;
|
||||
extern u8 _sequencesSegmentRomStart;
|
||||
|
||||
void audio_init(void) {
|
||||
s32 sp8C;
|
||||
s32 sp60;
|
||||
void **sp3C;
|
||||
? *var_v0;
|
||||
? *var_v0_3;
|
||||
s16 temp_s3;
|
||||
s16 temp_t1;
|
||||
s32 *temp_v0;
|
||||
s32 *temp_v0_2;
|
||||
s32 *temp_v0_3;
|
||||
s32 temp_t7;
|
||||
s32 var_s0_2;
|
||||
s32 var_s1;
|
||||
s32 var_v1;
|
||||
s32 var_v1_2;
|
||||
u32 *var_v0_2;
|
||||
u32 temp_a1;
|
||||
u32 temp_a1_2;
|
||||
u32 temp_a1_3;
|
||||
u32 var_s0;
|
||||
u8 *temp_v0_4;
|
||||
void **var_a2;
|
||||
void *temp_t3;
|
||||
void *temp_t7_2;
|
||||
void audio_init() {
|
||||
UNUSED s8 pad[16];
|
||||
s32 i, j, k;
|
||||
UNUSED s32 lim1; // lim1 unused in EU
|
||||
u32 sp60[2];
|
||||
s32 UNUSED lim2, lim3;
|
||||
UNUSED s32 size;
|
||||
UNUSED u64 *ptr64;
|
||||
void *data;
|
||||
UNUSED s32 one = 1;
|
||||
u8 *test;
|
||||
|
||||
gAudioLoadLock = 0;
|
||||
temp_t7 = (s32) D_800EA5D0 / 8;
|
||||
if (temp_t7 > 0) {
|
||||
var_v0 = &D_803B71B0;
|
||||
do {
|
||||
var_v0 += 8;
|
||||
var_v0->unk-4 = 0;
|
||||
var_v0->unk-8 = 0;
|
||||
} while ((u32) var_v0 < (u32) ((temp_t7 * 8) + &D_803B71B0));
|
||||
|
||||
for (i = 0; i < gAudioHeapSize / 8; i++) {
|
||||
((u64 *) D_803B71B0)[i] = 0;
|
||||
}
|
||||
var_v0_2 = &gGfxSPTaskOutputBufferSize;
|
||||
var_s0 = (u32) (&D_803B71A0 - &gGfxSPTaskOutputBufferSize) >> 3;
|
||||
if ((s32) var_s0 >= 0) {
|
||||
do {
|
||||
var_s0 -= 1;
|
||||
var_v0_2->unk4 = 0;
|
||||
var_v0_2->unk0 = 0;
|
||||
var_v0_2 += 8;
|
||||
} while ((s32) var_s0 >= 0);
|
||||
|
||||
#ifdef TARGET_N64
|
||||
// It seems boot.s doesn't clear the .bss area for audio, so do it here.
|
||||
lim3 = ((uintptr_t) &D_803B71A0 - (uintptr_t) &gGfxSPTaskOutputBufferSize) / 8;
|
||||
ptr64 = &gGfxSPTaskOutputBufferSize;
|
||||
for (k = lim3; k >= 0; k--) {
|
||||
*ptr64++ = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (osTvType) { /* irregular */
|
||||
case 0:
|
||||
D_803B7178 = 20.03042f;
|
||||
@ -1010,94 +799,77 @@ void audio_init(void) {
|
||||
D_803B7178 = 16.546f;
|
||||
gRefreshRate = 0x0000003C;
|
||||
break;
|
||||
default:
|
||||
case 1:
|
||||
default:
|
||||
D_803B7178 = 16.713f;
|
||||
gRefreshRate = 0x0000003C;
|
||||
break;
|
||||
}
|
||||
func_800CBF48(&gGfxSPTaskOutputBufferSize);
|
||||
var_v0_3 = &D_803B718C;
|
||||
do {
|
||||
var_v0_3 += 2;
|
||||
var_v0_3->unk-2 = 0x00A0;
|
||||
} while ((u32) var_v0_3 < (u32) &D_803B7192);
|
||||
D_803B70B8 = 0;
|
||||
D_803B70C0 = 0;
|
||||
D_803B70C4 = 0;
|
||||
func_800CBF48();
|
||||
for (i = 0; i < NUMAIBUFFERS; i++) {
|
||||
gAiBufferLengths[i] = 0xa0;
|
||||
}
|
||||
|
||||
gAudioTaskIndex = gAudioUpdatesPerFrame = 0;
|
||||
gCurrAiBufferIndex = 0;
|
||||
gAudioLibSoundMode = 0;
|
||||
gAudioTask = 0;
|
||||
gAudioTasks.unk34 = 0;
|
||||
gAudioTasks.unk84 = 0;
|
||||
gAudioTask = NULL;
|
||||
gAudioTasks[0].task.t.data_size = 0;
|
||||
gAudioTasks[1].task.t.data_size = 0;
|
||||
osCreateMesgQueue(&D_803B6720, &D_803B6738, 1);
|
||||
osCreateMesgQueue(&gCurrAudioFrameDmaQueue, &gCurrAudioFrameDmaMesgBufs, 0x00000040);
|
||||
osCreateMesgQueue(&gCurrAudioFrameDmaQueue, gCurrAudioFrameDmaMesgBufs,
|
||||
ARRAY_COUNT(gCurrAudioFrameDmaMesgBufs));
|
||||
gCurrAudioFrameDmaCount = 0;
|
||||
gSampleDmaNumListItems = 0;
|
||||
func_800B90F0(D_800EA5D4);
|
||||
var_a2 = &gAiBuffers;
|
||||
do {
|
||||
sp3C = var_a2;
|
||||
var_v1 = 0;
|
||||
*var_a2 = soundAlloc(&gAudioInitPool, 0x00000A00U);
|
||||
loop_18:
|
||||
*(*var_a2 + var_v1) = 0;
|
||||
(*var_a2 + var_v1)->unk2 = 0;
|
||||
(*var_a2 + var_v1)->unk4 = 0;
|
||||
temp_t7_2 = *var_a2 + var_v1;
|
||||
var_v1 += 8;
|
||||
temp_t7_2->unk6 = 0;
|
||||
if (var_v1 != 0xA00) {
|
||||
goto loop_18;
|
||||
|
||||
sound_init_main_pools(gAudioInitPoolSize);
|
||||
|
||||
for (i = 0; i < NUMAIBUFFERS; i++) {
|
||||
gAiBuffers[i] = soundAlloc(&gAudioInitPool, AIBUFFER_LEN);
|
||||
|
||||
for (j = 0; j < (s32) (AIBUFFER_LEN / sizeof(s16)); j++) {
|
||||
gAiBuffers[i][j] = 0;
|
||||
}
|
||||
var_a2 += 4;
|
||||
} while ((u32) var_a2 < (u32) &D_803B718C);
|
||||
gAudioResetPresetIdToLoad = 0;
|
||||
gAudioResetStatus = 1;
|
||||
audio_shut_down_and_reset_step();
|
||||
gSeqFileHeader = &sp60;
|
||||
audio_dma_copy_immediate((u32) &_sequencesSegmentRomStart, &sp60, 0x00000010U);
|
||||
temp_t1 = gSeqFileHeader->unk2;
|
||||
temp_a1 = (((temp_t1 & 0xFFFF) * 8) + 0x13) & ~0xF;
|
||||
gSequenceCount = temp_t1;
|
||||
temp_v0 = soundAlloc(&gAudioInitPool, temp_a1);
|
||||
gSeqFileHeader = temp_v0;
|
||||
audio_dma_copy_immediate((u32) &_sequencesSegmentRomStart, temp_v0, temp_a1);
|
||||
func_800BB43C(gSeqFileHeader, &_sequencesSegmentRomStart);
|
||||
gAlCtlHeader = &sp60;
|
||||
audio_dma_copy_immediate((u32) &_audio_banksSegmentRomStart, &sp60, 0x00000010U);
|
||||
temp_s3 = gAlCtlHeader->unk2;
|
||||
temp_a1_2 = ((temp_s3 * 8) + 0x13) & ~0xF;
|
||||
temp_v0_2 = soundAlloc(&gAudioInitPool, temp_a1_2);
|
||||
gAlCtlHeader = temp_v0_2;
|
||||
audio_dma_copy_immediate((u32) &_audio_banksSegmentRomStart, temp_v0_2, temp_a1_2);
|
||||
func_800BB43C(gAlCtlHeader, &_audio_banksSegmentRomStart);
|
||||
gCtlEntries = soundAlloc(&gAudioInitPool, temp_s3 * 0xC);
|
||||
var_v1_2 = 0;
|
||||
if (temp_s3 > 0) {
|
||||
var_s1 = 0;
|
||||
var_s0_2 = 0;
|
||||
do {
|
||||
sp8C = var_v1_2;
|
||||
audio_dma_copy_immediate((gAlCtlHeader + var_s1)->unk4, &sp60, 0x00000010U);
|
||||
(gCtlEntries + var_s0_2)->unk1 = (s8) sp60;
|
||||
var_v1_2 = sp8C + 1;
|
||||
temp_t3 = gCtlEntries + var_s0_2;
|
||||
var_s0_2 += 0xC;
|
||||
var_s1 += 8;
|
||||
temp_t3->unk2 = (s8) sp64;
|
||||
} while (var_v1_2 != temp_s3);
|
||||
}
|
||||
gAlTbl = &sp60;
|
||||
audio_dma_copy_immediate((u32) &_audio_tablesSegmentRomStart, &sp60, 0x00000010U);
|
||||
temp_a1_3 = ((gAlTbl->unk2 * 8) + 0x13) & ~0xF;
|
||||
temp_v0_3 = soundAlloc(&gAudioInitPool, temp_a1_3);
|
||||
gAlTbl = temp_v0_3;
|
||||
audio_dma_copy_immediate((u32) &_audio_tablesSegmentRomStart, temp_v0_3, temp_a1_3);
|
||||
func_800BB43C(gAlTbl, &_audio_tablesSegmentRomStart);
|
||||
temp_v0_4 = soundAlloc(&gAudioInitPool, 0x00000100U);
|
||||
gAlBankSets = temp_v0_4;
|
||||
audio_dma_copy_immediate((u32) &_instrument_setsSegmentRomStart, temp_v0_4, 0x00000100U);
|
||||
sound_alloc_pool_init(&gUnkPool1.pool, soundAlloc(&gAudioInitPool, D_800EA5D8), D_800EA5D8);
|
||||
|
||||
gAudioResetPresetIdToLoad = 0;
|
||||
gAudioResetStatus = one;
|
||||
audio_shut_down_and_reset_step();
|
||||
gSeqFileHeader = (ALSeqFile *) sp60;
|
||||
test = &_sequencesSegmentRomStart;
|
||||
audio_dma_copy_immediate(test, gSeqFileHeader, 0x00000010U);
|
||||
gSequenceCount = gSeqFileHeader->seqCount;
|
||||
size = gSequenceCount * sizeof(ALSeqData) + 4;
|
||||
size = ALIGN16(size);
|
||||
gSeqFileHeader = soundAlloc(&gAudioInitPool, size);
|
||||
audio_dma_copy_immediate(test, gSeqFileHeader, size);
|
||||
func_800BB43C(gSeqFileHeader, test);
|
||||
gAlCtlHeader = (ALSeqFile *) sp60;
|
||||
test = &_audio_banksSegmentRomStart;
|
||||
audio_dma_copy_immediate(test, gAlCtlHeader, 0x00000010U);
|
||||
size = ALIGN16(gAlCtlHeader->seqCount * sizeof(ALSeqData) + 4);
|
||||
gAlCtlHeader = soundAlloc(&gAudioInitPool, size);
|
||||
audio_dma_copy_immediate(test, gAlCtlHeader, size);
|
||||
func_800BB43C(gAlCtlHeader, test);
|
||||
gCtlEntries = soundAlloc(&gAudioInitPool, size * 0xC);
|
||||
for (i = 0; i < size; i++) {
|
||||
audio_dma_copy_immediate(gAlCtlHeader->seqArray[i].offset, sp60, 0x00000010U);
|
||||
if(size) {}
|
||||
if(1) {}
|
||||
gCtlEntries[i].numInstruments = sp60[0];
|
||||
gCtlEntries[i].numDrums = sp60[1];
|
||||
}
|
||||
gAlTbl = (ALSeqFile *) sp60;
|
||||
test = &_audio_tablesSegmentRomStart;
|
||||
audio_dma_copy_immediate(test, gAlTbl, 0x00000010U);
|
||||
size = gAlTbl->seqCount * sizeof(ALSeqData) + 4;
|
||||
size = ALIGN16(size);
|
||||
gAlTbl = soundAlloc(&gAudioInitPool, size);
|
||||
audio_dma_copy_immediate(test, gAlTbl, size);
|
||||
func_800BB43C(gAlTbl, test);
|
||||
gAlBankSets = soundAlloc(&gAudioInitPool, 0x00000100U);
|
||||
audio_dma_copy_immediate((u32) &_instrument_setsSegmentRomStart, gAlBankSets, 0x00000100U);
|
||||
sound_alloc_pool_init(&gUnkPool1.pool, soundAlloc(&gAudioInitPool, (u32) D_800EA5D8), (u32) D_800EA5D8);
|
||||
init_sequence_players();
|
||||
gAudioLoadLock = 0x76557364;
|
||||
}
|
||||
|
@ -11,13 +11,25 @@
|
||||
|
||||
#define IS_SEQUENCE_CHANNEL_VALID(ptr) ((uintptr_t)(ptr) != (uintptr_t)&gSequenceChannelNone)
|
||||
|
||||
struct SharedDma {
|
||||
/*0x0*/ u8 *buffer; // target, points to pre-allocated buffer
|
||||
/*0x4*/ uintptr_t source; // device address
|
||||
/*0x8*/ u16 sizeUnused; // set to bufSize, never read
|
||||
/*0xA*/ u16 bufSize; // size of buffer
|
||||
/*0xC*/ u8 unused2; // set to 0, never read
|
||||
/*0xD*/ u8 reuseIndex; // position in sSampleDmaReuseQueue1/2, if ttl == 0
|
||||
/*0xE*/ u8 ttl; // duration after which the DMA can be discarded
|
||||
}; // size = 0x10
|
||||
|
||||
void audio_dma_copy_immediate(uintptr_t devAddr, void *vAddr, size_t nbytes);
|
||||
void audio_dma_copy_async(uintptr_t, void*, size_t, OSMesgQueue*, OSIoMesg*);
|
||||
void audio_dma_partial_copy_async(uintptr_t*, u8**, ssize_t*, OSMesgQueue*, OSIoMesg*);
|
||||
void decrease_sample_dma_ttls(void);
|
||||
void *dma_sample_data(uintptr_t, u32, s32, u8*);
|
||||
void func_800BB030(s32);
|
||||
s32 func_800BB304(struct AudioBankSample*);
|
||||
s32 func_800BB388(s32 bankId, s32 instId, s32 arg2);
|
||||
void func_800BB43C(ALSeqFile*, u8*);
|
||||
void patch_sound(struct AudioBankSound *sound, u8 *memBase, u8 *offsetBase);
|
||||
void func_800BB584(s32);
|
||||
void patch_audio_bank(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 numDrums);
|
||||
@ -31,27 +43,45 @@ void preload_sequence(u32, u8);
|
||||
void load_sequence(u32, u32, s32);
|
||||
void load_sequence_internal(u32, u32, s32);
|
||||
|
||||
extern u32 D_803B70A8; // sDmaBufSize
|
||||
// This is really data, not a volatile
|
||||
// found in data/data_0DD0A0_2_1_2.s
|
||||
extern volatile s32 D_800EA5DC;
|
||||
|
||||
extern struct Note *gNotes;
|
||||
extern struct SequencePlayer gSequencePlayers[SEQUENCE_PLAYERS];
|
||||
extern struct SequenceChannel gSequenceChannels[SEQUENCE_CHANNELS];
|
||||
extern struct SequenceChannelLayer gSequenceLayers[SEQUENCE_LAYERS];
|
||||
extern struct SequenceChannel gSequenceChannelNone;
|
||||
extern struct AudioListItem gLayerFreeList;
|
||||
extern struct NotePool gNoteFreeLists;
|
||||
extern OSMesgQueue gCurrAudioFrameDmaQueue;
|
||||
extern OSMesg gCurrAudioFrameDmaMesgBufs[AUDIO_FRAME_DMA_QUEUE_SIZE];
|
||||
extern OSIoMesg gCurrAudioFrameDmaIoMesgBufs[AUDIO_FRAME_DMA_QUEUE_SIZE];
|
||||
extern OSMesgQueue D_803B6720;
|
||||
extern OSMesg D_803B6738;
|
||||
|
||||
extern OSIoMesg D_803B6740;
|
||||
extern struct SharedDma sSampleDmas[0x70];
|
||||
extern u32 gSampleDmaNumListItems;
|
||||
extern u32 sSampleDmaListSize1;
|
||||
extern s32 D_803B6E60;
|
||||
extern s32 load_bss_pad;
|
||||
|
||||
extern u8 sSampleDmaReuseQueue1[256];
|
||||
extern u8 sSampleDmaReuseQueue2[256];
|
||||
extern u8 sSampleDmaReuseQueueTail1;
|
||||
extern u8 sSampleDmaReuseQueueTail2;
|
||||
extern u8 sSampleDmaReuseQueueHead1;
|
||||
extern u8 sSampleDmaReuseQueueHead2;
|
||||
|
||||
extern ALSeqFile *gSeqFileHeader;
|
||||
extern ALSeqFile *gAlCtlHeader;
|
||||
extern ALSeqFile *gAlTbl;
|
||||
extern u8 *gAlBankSets;
|
||||
extern ALSeqFile *gSeqFileHeader; // D_803B706C
|
||||
extern ALSeqFile *gAlCtlHeader; // D_803B7070
|
||||
extern ALSeqFile *gAlTbl; // D_803B7074
|
||||
extern u16 gSequenceCount; // D_803B707C
|
||||
extern u16 gSequenceCount;
|
||||
extern struct CtlEntry *gCtlEntries;
|
||||
extern struct AudioBufferParametersEU gAudioBufferParameters;
|
||||
extern u32 D_803B70A8;
|
||||
extern s32 gMaxAudioCmds;
|
||||
extern s32 gMaxSimultaneousNotes;
|
||||
extern s8 gAudioUpdatesPerFrame; // = 4
|
||||
extern s16 gTempoInternalToExternal;
|
||||
extern s8 gAudioLibSoundMode;
|
||||
extern s32 gAudioUpdatesPerFrame;
|
||||
extern s32 gCurrAudioFrameDmaCount;
|
||||
|
||||
#endif // AUDIO_LOAD_H
|
||||
|
@ -43,35 +43,22 @@ s32 D_800EA4A4 = 0;
|
||||
char port_eu_unused_string7[] = "Undefined Port Command %d\n";
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Aug-14-2023
|
||||
s32 func_800B70EC(s32, s32 *, s32, s16); /* extern */
|
||||
s32 audio_shut_down_and_reset_step(); /* extern */
|
||||
? func_800CBCB0(void *); /* extern */
|
||||
extern u8 gAudioResetStatus;
|
||||
extern u8 gAudioResetPresetIdToLoad;
|
||||
extern s32 D_803B70B8;
|
||||
extern s32 D_803B70C0;
|
||||
extern s32 D_803B70C4;
|
||||
extern ? gAudioCmdBuffers;
|
||||
extern s32 gAudioCmd;
|
||||
extern ? gAudioTasks;
|
||||
extern ? gAiBuffers;
|
||||
extern ? D_803B718C;
|
||||
//generated by m2c commit 08138748803d75e73e4a94bb0c619a273754ee9c on Sep-14-2023
|
||||
u64 *func_800B70EC(u64 *, s32 *, s16 *, s16); /* extern */
|
||||
extern ? aspMainDataEnd;
|
||||
extern ? aspMainDataStart;
|
||||
extern ? aspMainTextStart;
|
||||
extern OSMesgQueue gCurrAudioFrameDmaQueue;
|
||||
extern u64 aspMainDataStart;
|
||||
extern u64 aspMainTextStart;
|
||||
|
||||
void *create_next_audio_frame_task(void) {
|
||||
struct SPTask *create_next_audio_frame_task(void) {
|
||||
u32 sp74;
|
||||
s32 sp70;
|
||||
s32 sp60;
|
||||
s16 *sp60;
|
||||
void *sp58;
|
||||
void *sp54;
|
||||
s32 *sp40;
|
||||
s16 **sp40;
|
||||
s16 **temp_a3;
|
||||
s16 *temp_s1_2;
|
||||
s16 temp_v1;
|
||||
s32 *temp_a3;
|
||||
s32 temp_hi;
|
||||
s32 temp_hi_2;
|
||||
s32 temp_s1;
|
||||
@ -81,21 +68,21 @@ void *create_next_audio_frame_task(void) {
|
||||
s32 var_s0_3;
|
||||
s32 var_s1;
|
||||
|
||||
D_803B70B8 += 1;
|
||||
if (((s32) D_803B70B8 % (s16) gAudioBufferParameters.presetUnk4) != 0) {
|
||||
gAudioUpdatesPerFrame += 1;
|
||||
if (((s32) gAudioUpdatesPerFrame % (s16) gAudioBufferParameters.presetUnk4) != 0) {
|
||||
return NULL;
|
||||
}
|
||||
osSendMesg(D_800EA3A8, (void *) D_803B70B8, 0);
|
||||
temp_t3 = D_803B70C4 + 1;
|
||||
osSendMesg(D_800EA3A8, (void *) gAudioUpdatesPerFrame, 0);
|
||||
temp_t3 = gCurrAiBufferIndex + 1;
|
||||
temp_hi = temp_t3 % 3;
|
||||
temp_hi_2 = (s32) (temp_hi + 1) % 3;
|
||||
D_803B70C4 = temp_t3;
|
||||
D_803B70C0 ^= 1;
|
||||
D_803B70C4 = temp_hi;
|
||||
gCurrAiBufferIndex = temp_t3;
|
||||
gAudioTaskIndex ^= 1;
|
||||
gCurrAiBufferIndex = temp_hi;
|
||||
sp74 = osAiGetLength() >> 2;
|
||||
temp_v1 = *(&D_803B718C + (temp_hi_2 * 2));
|
||||
temp_v1 = gAiBufferLengths[temp_hi_2];
|
||||
if (temp_v1 != 0) {
|
||||
osAiSetNextBuffer(*(&gAiBuffers + (temp_hi_2 * 4)), temp_v1 * 4);
|
||||
osAiSetNextBuffer(gAiBuffers[temp_hi_2], temp_v1 * 4);
|
||||
}
|
||||
var_s1 = gCurrAudioFrameDmaCount;
|
||||
var_s0 = 0;
|
||||
@ -138,11 +125,11 @@ void *create_next_audio_frame_task(void) {
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
gAudioTask = (D_803B70C0 * 0x50) + &gAudioTasks;
|
||||
temp_a3 = (D_803B70C4 * 4) + &gAiBuffers;
|
||||
gAudioCmd = *(&gAudioCmdBuffers + (D_803B70C0 * 4));
|
||||
gAudioTask = &gAudioTasks[gAudioTaskIndex];
|
||||
temp_a3 = &gAiBuffers[gCurrAiBufferIndex];
|
||||
gAudioCmd = gAudioCmdBuffers[gAudioTaskIndex];
|
||||
sp60 = *temp_a3;
|
||||
temp_s1_2 = (D_803B70C4 * 2) + &D_803B718C;
|
||||
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;
|
||||
@ -152,29 +139,29 @@ void *create_next_audio_frame_task(void) {
|
||||
}
|
||||
sp40 = temp_a3;
|
||||
if (osRecvMesg(D_800EA3AC, &sp54, 0) != -1) {
|
||||
func_800CBCB0(sp54);
|
||||
func_800CBCB0((u32) sp54);
|
||||
}
|
||||
gAudioCmd = func_800B70EC(gAudioCmd, &sp70, sp60, *temp_s1_2);
|
||||
gAudioRandom = osGetCount() * (gAudioRandom + D_803B70B8);
|
||||
gAudioRandom += *(*sp40 + ((D_803B70B8 & 0xFF) * 2));
|
||||
gAudioTask->unk40 = 0;
|
||||
gAudioTask->unk44 = 0;
|
||||
gAudioTask->unk0 = 2;
|
||||
gAudioTask->unk4 = 0;
|
||||
gAudioTask->unk8 = rspbootTextStart;
|
||||
gAudioTask->unkC = (s32) (rspbootTextEnd - rspbootTextStart);
|
||||
gAudioTask->unk10 = &aspMainTextStart;
|
||||
gAudioTask->unk18 = &aspMainDataStart;
|
||||
gAudioTask->unk14 = 0x00001000;
|
||||
gAudioTask->unk1C = (s32) (((s32) (&aspMainDataEnd - &aspMainDataStart) >> 3) * 8);
|
||||
gAudioTask->unk20 = 0;
|
||||
gAudioTask->unk24 = 0;
|
||||
gAudioTask->unk28 = 0;
|
||||
gAudioTask->unk2C = 0;
|
||||
gAudioTask->unk30 = (s32) *(&gAudioCmdBuffers + (D_803B70C0 * 4));
|
||||
gAudioTask->unk38 = 0;
|
||||
gAudioTask->unk3C = 0;
|
||||
gAudioTask->unk34 = (s32) (sp70 * 8);
|
||||
gAudioRandom = osGetCount() * (gAudioRandom + gAudioUpdatesPerFrame);
|
||||
gAudioRandom += (*sp40)[gAudioUpdatesPerFrame & 0xFF];
|
||||
gAudioTask->msgqueue = NULL;
|
||||
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;
|
||||
}
|
||||
@ -308,100 +295,86 @@ void func_800CBC24(void)
|
||||
D_800EA3A4[0] = D_800EA3A0[0];
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 08138748803d75e73e4a94bb0c619a273754ee9c on Sep-13-2023
|
||||
void func_800CBCB0(u32 arg0) {
|
||||
s32 temp_t8;
|
||||
s32 var_s1;
|
||||
s32 var_v0;
|
||||
struct EuAudioCmd *temp_s0;
|
||||
struct SequenceChannel *temp_v0_2;
|
||||
struct SequencePlayer *temp_v1;
|
||||
u8 temp_a0;
|
||||
u8 temp_a1;
|
||||
u8 temp_v0;
|
||||
u8 temp_v1_2;
|
||||
struct EuAudioCmd *cmd;
|
||||
struct SequencePlayer *seqPlayer;
|
||||
struct SequenceChannel *chan;
|
||||
u8 end = arg0 & 0xff;
|
||||
u8 i = (arg0 >> 8) & 0xff;
|
||||
|
||||
temp_t8 = arg0 & 0xFF;
|
||||
var_s1 = (arg0 >> 8) & 0xFF;
|
||||
var_v0 = var_s1;
|
||||
if (temp_t8 != var_s1) {
|
||||
do {
|
||||
temp_s0 = &D_80193820[var_v0 & 0xFF];
|
||||
temp_a0 = temp_s0->u.s.op;
|
||||
var_s1 = (var_s1 + 1) & 0xFF;
|
||||
if ((temp_a0 & 0xF0) == 0xF0) {
|
||||
eu_process_audio_cmd(temp_s0);
|
||||
} else {
|
||||
temp_v0 = temp_s0->u.s.arg1;
|
||||
if ((s32) temp_v0 < 4) {
|
||||
temp_v1 = &gSequencePlayers[temp_v0];
|
||||
if (temp_a0 & 0x80) {
|
||||
eu_process_audio_cmd(temp_s0);
|
||||
} else if (temp_a0 & 0x40) {
|
||||
switch (temp_a0) { /* switch 1; irregular */
|
||||
case 0x41: /* switch 1 */
|
||||
temp_v1->unk0 = (u8) (temp_v1->unk0 | 4);
|
||||
temp_v1->fadeVolumeScale = (bitwise f32) temp_s0->u2.as_s32;
|
||||
for (;;) {
|
||||
if (i == end) break;
|
||||
cmd = &sAudioCmd[i++ & 0xff];
|
||||
|
||||
if ((cmd->u.s.op & 0xf0) == 0xf0) {
|
||||
eu_process_audio_cmd(cmd);
|
||||
goto why;
|
||||
}
|
||||
|
||||
if (cmd->u.s.arg1 < SEQUENCE_PLAYERS) {
|
||||
seqPlayer = &gSequencePlayers[cmd->u.s.arg1];
|
||||
if ((cmd->u.s.op & 0x80) != 0) {
|
||||
eu_process_audio_cmd(cmd);
|
||||
}
|
||||
else if ((cmd->u.s.op & 0x40) != 0) {
|
||||
switch (cmd->u.s.op) {
|
||||
case 0x41:
|
||||
seqPlayer->fadeVolumeScale = cmd->u2.as_f32;
|
||||
seqPlayer->recalculateVolume = TRUE;
|
||||
break;
|
||||
|
||||
case 0x47:
|
||||
seqPlayer->tempo = cmd->u2.as_s32 * TATUMS_PER_BEAT;
|
||||
break;
|
||||
|
||||
case 0x48:
|
||||
seqPlayer->transposition = cmd->u2.as_s8;
|
||||
break;
|
||||
|
||||
case 0x46:
|
||||
seqPlayer->seqVariationEu[cmd->u.s.arg3] = cmd->u2.as_s8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (seqPlayer->enabled != FALSE && cmd->u.s.arg2 < 0x10) {
|
||||
chan = seqPlayer->channels[cmd->u.s.arg2];
|
||||
if (IS_SEQUENCE_CHANNEL_VALID(chan)) {
|
||||
switch (cmd->u.s.op) {
|
||||
case 1:
|
||||
chan->volumeScale = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.volume = TRUE;
|
||||
break;
|
||||
case 0x47: /* switch 1 */
|
||||
temp_v1->tempo = temp_s0->u2.as_s32 * 0x30;
|
||||
case 2:
|
||||
chan->volume = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.volume = TRUE;
|
||||
break;
|
||||
case 0x48: /* switch 1 */
|
||||
temp_v1->transposition = (s16) (s8) temp_s0->u2.as_u8;
|
||||
case 3:
|
||||
chan->newPan = cmd->u2.as_s8;
|
||||
chan->changes.as_bitfields.pan = TRUE;
|
||||
break;
|
||||
case 0x46: /* switch 1 */
|
||||
temp_v1->seqVariationEu[temp_s0->u.s.arg3] = (s8) temp_s0->u2.as_u8;
|
||||
case 4:
|
||||
chan->freqScale = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.freqScale = TRUE;
|
||||
break;
|
||||
}
|
||||
} else if (((u32) temp_v1->unk0 >> 0x1F) != 0) {
|
||||
temp_a1 = temp_s0->u.s.arg2;
|
||||
if ((s32) temp_a1 < 0x10) {
|
||||
temp_v0_2 = temp_v1->channels[temp_a1];
|
||||
if (temp_v0_2 != &gSequenceChannelNone) {
|
||||
switch (temp_a0) {
|
||||
case 1:
|
||||
temp_v0_2->changes.as_u8 |= 0x40;
|
||||
temp_v0_2->volumeScale = (bitwise f32) temp_s0->u2.as_s32;
|
||||
break;
|
||||
case 2:
|
||||
temp_v0_2->changes.as_u8 |= 0x40;
|
||||
temp_v0_2->volume = (bitwise f32) temp_s0->u2.as_s32;
|
||||
break;
|
||||
case 3:
|
||||
temp_v0_2->changes.as_u8 |= 0x20;
|
||||
temp_v0_2->newPan = (u8) (s8) temp_s0->u2.as_u8;
|
||||
break;
|
||||
case 4:
|
||||
temp_v0_2->changes.as_u8 |= 0x80;
|
||||
temp_v0_2->freqScale = (bitwise f32) temp_s0->u2.as_s32;
|
||||
break;
|
||||
case 5:
|
||||
temp_v0_2->reverbVol = (u8) (s8) temp_s0->u2.as_u8;
|
||||
break;
|
||||
case 6:
|
||||
temp_v1_2 = temp_s0->u.s.arg3;
|
||||
if ((s32) temp_v1_2 < 8) {
|
||||
temp_v0_2->soundScriptIO[temp_v1_2] = (s8) temp_s0->u2.as_u8;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
temp_v0_2->unk0 = (u8) ((((s8) temp_s0->u2.as_u8 * 0x10) & 0x10) | (temp_v0_2->unk0 & 0xFFEF));
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
chan->reverbVol = cmd->u2.as_s8;
|
||||
break;
|
||||
case 6:
|
||||
if (cmd->u.s.arg3 < 8) {
|
||||
chan->soundScriptIO[cmd->u.s.arg3] = cmd->u2.as_s8;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
chan->stopSomething2 = cmd->u2.as_s8;
|
||||
}
|
||||
}
|
||||
}
|
||||
var_v0 = var_s1;
|
||||
temp_s0->u.s.op = 0;
|
||||
} while (temp_t8 != var_s1);
|
||||
}
|
||||
|
||||
why:
|
||||
cmd->u.s.op = 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/audio/port_eu/func_800CBCB0.s")
|
||||
#endif
|
||||
|
||||
void func_800CBF48() {
|
||||
func_800CBAB4();
|
||||
|
@ -11,6 +11,8 @@ void func_800CBB48(s32, s32*);
|
||||
void func_800CBB88(u32, f32);
|
||||
void func_800CBBB8(u32, s32);
|
||||
void func_800CBBE8(u32, s8);
|
||||
void func_800CBC24(void);
|
||||
void func_800CBCB0(u32 arg0);
|
||||
void func_800CBF48(void);
|
||||
|
||||
extern OSMesgQueue D_801937C0;
|
||||
|
@ -1159,326 +1159,341 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Aug-14-2023
|
||||
? func_800BB584(u8, u8 **, s32 *); /* extern */
|
||||
? sequence_channel_process_script(s32); /* extern */
|
||||
extern s16 gTempoInternalToExternal;
|
||||
void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
|
||||
u8 cmd;
|
||||
u8 loBits;
|
||||
u8 temp;
|
||||
s32 value;
|
||||
s32 i;
|
||||
u16 u16v;
|
||||
u8 *seqData;
|
||||
struct M64ScriptState *state;
|
||||
s32 temp32;
|
||||
|
||||
void sequence_player_process_sequence(struct SequencePlayer *arg0) {
|
||||
struct NotePool *sp38;
|
||||
s32 sp34;
|
||||
struct SequencePlayer *sp30;
|
||||
OSMesgQueue *temp_s0;
|
||||
s16 temp_v0_10;
|
||||
s16 temp_v0_7;
|
||||
s32 *temp_a2;
|
||||
s32 temp_s2;
|
||||
s32 temp_t2_2;
|
||||
s32 temp_v0_3;
|
||||
s32 temp_v0_5;
|
||||
s32 temp_v1_3;
|
||||
s32 var_s3;
|
||||
s32 var_v0_3;
|
||||
struct M64ScriptState *temp_s0_2;
|
||||
struct NotePool *temp_a0_4;
|
||||
struct SequenceChannel *temp_a0_5;
|
||||
struct SequencePlayer *var_v1;
|
||||
u16 temp_a0;
|
||||
u16 temp_t2;
|
||||
u16 temp_v1_5;
|
||||
u16 var_v0_2;
|
||||
u32 temp_v0;
|
||||
u8 **temp_a1;
|
||||
u8 *temp_v0_2;
|
||||
u8 *temp_v1;
|
||||
u8 *temp_v1_2;
|
||||
u8 *temp_v1_6;
|
||||
u8 *var_v0;
|
||||
u8 temp_a0_2;
|
||||
u8 temp_a0_3;
|
||||
u8 temp_a1_2;
|
||||
u8 temp_s2_2;
|
||||
u8 temp_t9;
|
||||
u8 temp_v0_11;
|
||||
u8 temp_v0_4;
|
||||
u8 temp_v0_8;
|
||||
u8 temp_v0_9;
|
||||
u8 temp_v1_4;
|
||||
u8 var_a0;
|
||||
void *temp_v0_6;
|
||||
if (seqPlayer->enabled == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
temp_v0 = arg0->unk0;
|
||||
if ((temp_v0 >> 0x1F) != 0) {
|
||||
if (((u32) (temp_v0 * 0x10) >> 0x1F) == 1) {
|
||||
temp_s0 = &arg0->bankDmaMesgQueue;
|
||||
if (osRecvMesg(temp_s0, NULL, 0) != -1) {
|
||||
temp_a1 = &arg0->bankDmaCurrMemAddr;
|
||||
temp_a2 = &arg0->bankDmaRemaining;
|
||||
if (arg0->bankDmaRemaining == 0) {
|
||||
arg0->unk0 = (s8) ((u8) arg0->unk0 & 0xFFF7);
|
||||
func_800BB584(arg0->loadingBankId, temp_a1, temp_a2);
|
||||
temp_v0_2 = &gBankLoadStatus[arg0->loadingBankId];
|
||||
if (*temp_v0_2 != 5) {
|
||||
*temp_v0_2 = 2;
|
||||
}
|
||||
} else {
|
||||
audio_dma_partial_copy_async(&arg0->bankDmaCurrDevAddr, temp_a1, temp_a2, temp_s0, &arg0->bankDmaIoMesg);
|
||||
}
|
||||
}
|
||||
} else if (((u32) (temp_v0 * 8) >> 0x1F) == 1) {
|
||||
if (osRecvMesg(&arg0->seqDmaMesgQueue, NULL, 0) != -1) {
|
||||
arg0->unk0 = (s8) ((u8) arg0->unk0 & 0xFFEF);
|
||||
temp_v1 = &gSeqLoadStatus[arg0->seqId];
|
||||
if (*temp_v1 != 5) {
|
||||
*temp_v1 = 2;
|
||||
}
|
||||
goto block_11;
|
||||
if (seqPlayer->bankDmaInProgress == TRUE) {
|
||||
if (osRecvMesg(&seqPlayer->bankDmaMesgQueue, NULL, 0) == -1) {
|
||||
return;
|
||||
}
|
||||
if (seqPlayer->bankDmaRemaining == 0) {
|
||||
seqPlayer->bankDmaInProgress = FALSE;
|
||||
func_800BB584(seqPlayer->loadingBankId);
|
||||
if (gBankLoadStatus[seqPlayer->loadingBankId] != 5) {
|
||||
gBankLoadStatus[seqPlayer->loadingBankId] = 2;
|
||||
}
|
||||
} else {
|
||||
block_11:
|
||||
temp_v1_2 = &gSeqLoadStatus[arg0->seqId];
|
||||
temp_a1_2 = *temp_v1_2;
|
||||
if (((s32) temp_a1_2 < 2) || (var_v0 = &gBankLoadStatus[arg0->defaultBank[0]], var_a0 = *var_v0, (((s32) var_a0 < 2) != 0))) {
|
||||
sequence_player_disable(arg0);
|
||||
return;
|
||||
audio_dma_partial_copy_async(&seqPlayer->bankDmaCurrDevAddr, &seqPlayer->bankDmaCurrMemAddr,
|
||||
&seqPlayer->bankDmaRemaining, &seqPlayer->bankDmaMesgQueue,
|
||||
&seqPlayer->bankDmaIoMesg);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (seqPlayer->seqDmaInProgress == TRUE) {
|
||||
if (osRecvMesg(&seqPlayer->seqDmaMesgQueue, NULL, 0) == -1) {
|
||||
return;
|
||||
}
|
||||
seqPlayer->seqDmaInProgress = FALSE;
|
||||
if (gSeqLoadStatus[seqPlayer->seqId] != 5) {
|
||||
gSeqLoadStatus[seqPlayer->seqId] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
// If discarded, bail out.
|
||||
temp32 = 2; // I beg your pardon?
|
||||
if (IS_SEQ_LOAD_COMPLETE(seqPlayer->seqId) == FALSE
|
||||
|| (
|
||||
IS_BANK_LOAD_COMPLETE(seqPlayer->defaultBank[0]) == FALSE)) {
|
||||
sequence_player_disable(seqPlayer);
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove possible SOUND_LOAD_STATUS_DISCARDABLE marks.
|
||||
if (gSeqLoadStatus[seqPlayer->seqId] != 5) {
|
||||
gSeqLoadStatus[seqPlayer->seqId] = temp32;
|
||||
}
|
||||
|
||||
if (gBankLoadStatus[seqPlayer->defaultBank[0]] != 5) {
|
||||
gBankLoadStatus[seqPlayer->defaultBank[0]] = temp32;
|
||||
}
|
||||
|
||||
if (seqPlayer->muted && (seqPlayer->muteBehavior & MUTE_BEHAVIOR_STOP_SCRIPT) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if we surpass the number of ticks needed for a tatum, else stop.
|
||||
seqPlayer->tempoAcc += seqPlayer->tempo;
|
||||
if (seqPlayer->tempoAcc < gTempoInternalToExternal) {
|
||||
return;
|
||||
}
|
||||
seqPlayer->tempoAcc -= (u16) gTempoInternalToExternal;
|
||||
|
||||
state = &seqPlayer->scriptState;
|
||||
if (seqPlayer->delay > 1) {
|
||||
seqPlayer->delay--;
|
||||
} else {
|
||||
seqPlayer->recalculateVolume = 1;
|
||||
for (;;) {
|
||||
cmd = m64_read_u8(state);
|
||||
if (cmd == 0xff) { // seq_end
|
||||
if (state->depth == 0) {
|
||||
sequence_player_disable(seqPlayer);
|
||||
break;
|
||||
}
|
||||
state->pc = state->stack[--state->depth];
|
||||
}
|
||||
if (temp_a1_2 != 5) {
|
||||
*temp_v1_2 = 2;
|
||||
var_v0 = &gBankLoadStatus[arg0->defaultBank[0]];
|
||||
var_a0 = *var_v0;
|
||||
|
||||
if (cmd == 0xfd) { // seq_delay
|
||||
seqPlayer->delay = m64_read_compressed_u16(state);
|
||||
break;
|
||||
}
|
||||
if (var_a0 != 5) {
|
||||
*var_v0 = 2;
|
||||
|
||||
if (cmd == 0xfe) { // seq_delay1
|
||||
seqPlayer->delay = 1;
|
||||
break;
|
||||
}
|
||||
if (!(arg0->unk0 & 0x20000000) || !(arg0->muteBehavior & 0x80)) {
|
||||
temp_t2 = arg0->tempoAcc + arg0->tempo;
|
||||
arg0->tempoAcc = temp_t2;
|
||||
temp_v0_3 = temp_t2 & 0xFFFF;
|
||||
if (temp_v0_3 >= gTempoInternalToExternal) {
|
||||
temp_a0 = arg0->delay;
|
||||
arg0->tempoAcc = temp_v0_3 - gTempoInternalToExternal;
|
||||
if ((s32) temp_a0 >= 2) {
|
||||
arg0->delay = temp_a0 - 1;
|
||||
} else {
|
||||
temp_s0_2 = &arg0->scriptState;
|
||||
arg0->unk0 = (s8) ((u8) arg0->unk0 | 4);
|
||||
var_s3 = sp58;
|
||||
loop_24:
|
||||
temp_v0_4 = m64_read_u8(temp_s0_2);
|
||||
temp_s2 = temp_v0_4 & 0xFF;
|
||||
if (temp_v0_4 == 0xFF) {
|
||||
temp_a0_2 = temp_s0_2->depth;
|
||||
if (temp_a0_2 == 0) {
|
||||
sequence_player_disable(arg0);
|
||||
} else {
|
||||
temp_t9 = (temp_a0_2 - 1) & 0xFF;
|
||||
temp_s0_2->depth = temp_t9;
|
||||
temp_s0_2->pc = temp_s0_2->stack[temp_t9];
|
||||
goto block_28;
|
||||
}
|
||||
|
||||
if (cmd >= 0xc0) {
|
||||
switch (cmd) {
|
||||
case 0xff: // seq_end
|
||||
break;
|
||||
|
||||
case 0xfc: // seq_call
|
||||
u16v = m64_read_s16(state);
|
||||
if (0 && state->depth >= 4) {
|
||||
}
|
||||
state->stack[state->depth++] = state->pc;
|
||||
state->pc = seqPlayer->seqData + u16v;
|
||||
break;
|
||||
|
||||
case 0xf8: // seq_loop; loop start, N iterations (or 256 if N = 0)
|
||||
if (0 && state->depth >= 4) {
|
||||
}
|
||||
state->remLoopIters[state->depth] = m64_read_u8(state);
|
||||
state->stack[state->depth++] = state->pc;
|
||||
break;
|
||||
|
||||
case 0xf7: // seq_loopend
|
||||
state->remLoopIters[state->depth - 1]--;
|
||||
if (state->remLoopIters[state->depth - 1] != 0) {
|
||||
state->pc = state->stack[state->depth - 1];
|
||||
} else {
|
||||
block_28:
|
||||
temp_v1_3 = temp_v0_4 & 0xFF;
|
||||
temp_v0_5 = temp_v1_3 & 0xF0;
|
||||
if (temp_v1_3 == 0xFD) {
|
||||
arg0->delay = m64_read_compressed_u16(temp_s0_2);
|
||||
} else if (temp_v1_3 == 0xFE) {
|
||||
arg0->delay = 1;
|
||||
} else {
|
||||
switch (temp_v1_3) { /* switch 3; irregular */
|
||||
case 0xFC: /* switch 3 */
|
||||
temp_t2_2 = m64_read_s16(temp_s0_2) & 0xFFFF;
|
||||
temp_s0_2->stack[temp_s0_2->depth] = temp_s0_2->pc;
|
||||
temp_s0_2->depth += 1;
|
||||
temp_s0_2->pc = &arg0->seqData[temp_t2_2];
|
||||
break;
|
||||
case 0xF8: /* switch 3 */
|
||||
temp_s0_2->remLoopIters[temp_s0_2->depth] = m64_read_u8(temp_s0_2);
|
||||
temp_s0_2->stack[temp_s0_2->depth] = temp_s0_2->pc;
|
||||
temp_s0_2->depth += 1;
|
||||
break;
|
||||
case 0xF7: /* switch 3 */
|
||||
temp_v0_6 = temp_s0_2 + temp_s0_2->depth;
|
||||
temp_v0_6->unk13 = (u8) (temp_v0_6->unk13 - 1);
|
||||
temp_a0_3 = temp_s0_2->depth;
|
||||
if ((temp_s0_2 + temp_a0_3)->unk13 != 0) {
|
||||
temp_s0_2->pc = *(temp_s0_2 + (temp_a0_3 * 4));
|
||||
} else {
|
||||
temp_s0_2->depth = temp_a0_3 - 1;
|
||||
}
|
||||
break;
|
||||
case 0xF5: /* switch 3 */
|
||||
case 0xF9: /* switch 3 */
|
||||
case 0xFA: /* switch 3 */
|
||||
case 0xFB: /* switch 3 */
|
||||
temp_v0_7 = m64_read_s16(temp_s0_2);
|
||||
if (((temp_s2 != 0xFA) || (var_s3 == 0)) && ((temp_s2 != 0xF9) || (var_s3 < 0)) && ((temp_s2 != 0xF5) || (var_s3 >= 0))) {
|
||||
temp_s0_2->pc = &arg0->seqData[temp_v0_7 & 0xFFFF];
|
||||
}
|
||||
break;
|
||||
case 0xF2: /* switch 3 */
|
||||
case 0xF3: /* switch 3 */
|
||||
case 0xF4: /* switch 3 */
|
||||
temp_v0_8 = m64_read_u8(temp_s0_2);
|
||||
if (((temp_s2 != 0xF3) || (var_s3 == 0)) && ((temp_s2 != 0xF2) || (var_s3 < 0))) {
|
||||
temp_s0_2->pc = &temp_s0_2->pc[(s8) temp_v0_8];
|
||||
}
|
||||
break;
|
||||
case 0xF1: /* switch 3 */
|
||||
temp_a0_4 = &arg0->notePool;
|
||||
sp38 = temp_a0_4;
|
||||
note_pool_clear(temp_a0_4);
|
||||
note_pool_fill(temp_a0_4, m64_read_u8(temp_s0_2));
|
||||
break;
|
||||
case 0xF0: /* switch 3 */
|
||||
note_pool_clear(&arg0->notePool);
|
||||
break;
|
||||
case 0xDF: /* switch 3 */
|
||||
arg0->transposition = 0;
|
||||
/* fallthrough */
|
||||
case 0xDE: /* switch 3 */
|
||||
arg0->transposition += m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
case 0xDC: /* switch 3 */
|
||||
case 0xDD: /* switch 3 */
|
||||
temp_v0_9 = m64_read_u8(temp_s0_2);
|
||||
if (temp_s2 == 0xDD) {
|
||||
arg0->tempo = (temp_v0_9 & 0xFF) * 0x30;
|
||||
} else {
|
||||
arg0->tempo += (s8) temp_v0_9 * 0x30;
|
||||
}
|
||||
var_v0_2 = arg0->tempo;
|
||||
if (gTempoInternalToExternal < (s32) var_v0_2) {
|
||||
arg0->tempo = (u16) gTempoInternalToExternal;
|
||||
var_v0_2 = gTempoInternalToExternal & 0xFFFF;
|
||||
}
|
||||
if ((s16) var_v0_2 <= 0) {
|
||||
arg0->tempo = 1;
|
||||
}
|
||||
break;
|
||||
case 0xDA: /* switch 3 */
|
||||
temp_s2_2 = m64_read_u8(temp_s0_2) & 0xFF;
|
||||
temp_v0_10 = m64_read_s16(temp_s0_2);
|
||||
switch (temp_s2_2) { /* switch 4; irregular */
|
||||
case 0: /* switch 4 */
|
||||
case 1: /* switch 4 */
|
||||
if (arg0->state != 2) {
|
||||
arg0->fadeTimerUnkEu = (u16) temp_v0_10;
|
||||
arg0->state = temp_s2_2;
|
||||
}
|
||||
break;
|
||||
case 2: /* switch 4 */
|
||||
arg0->fadeRemainingFrames = (u16) temp_v0_10;
|
||||
arg0->state = temp_s2_2;
|
||||
arg0->fadeVelocity = (0.0f - arg0->fadeVolume) / (f32) (temp_v0_10 & 0xFFFF);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0xDB: /* switch 3 */
|
||||
temp_v0_11 = m64_read_u8(temp_s0_2);
|
||||
temp_v1_4 = arg0->state;
|
||||
switch (temp_v1_4) { /* switch 5; irregular */
|
||||
case 2: /* switch 5 */
|
||||
break;
|
||||
case 1: /* switch 5 */
|
||||
arg0->state = 0;
|
||||
arg0->fadeVolume = 0.0f;
|
||||
/* fallthrough */
|
||||
case 0: /* switch 5 */
|
||||
temp_v1_5 = arg0->fadeTimerUnkEu;
|
||||
arg0->fadeRemainingFrames = temp_v1_5;
|
||||
if (temp_v1_5 != 0) {
|
||||
arg0->fadeVelocity = (((f32) temp_v0_11 / 127.0f) - arg0->fadeVolume) / (f32) (temp_v1_5 & 0xFFFF);
|
||||
} else {
|
||||
arg0->fadeVolume = (f32) temp_v0_11 / 127.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0xD9: /* switch 3 */
|
||||
arg0->fadeVolumeScale = (f32) m64_read_u8(temp_s0_2) / 127.0f;
|
||||
break;
|
||||
case 0xD7: /* switch 3 */
|
||||
sequence_player_init_channels(arg0, m64_read_s16(temp_s0_2) & 0xFFFF);
|
||||
break;
|
||||
case 0xD6: /* switch 3 */
|
||||
sequence_player_disable_channels(arg0, m64_read_s16(temp_s0_2) & 0xFFFF);
|
||||
break;
|
||||
case 0xD5: /* switch 3 */
|
||||
arg0->muteVolumeScale = (f32) m64_read_u8(temp_s0_2) / 127.0f;
|
||||
break;
|
||||
case 0xD4: /* switch 3 */
|
||||
arg0->unk0 = (s8) ((u8) arg0->unk0 | 0x20);
|
||||
break;
|
||||
case 0xD3: /* switch 3 */
|
||||
arg0->muteBehavior = m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
case 0xD1: /* switch 3 */
|
||||
case 0xD2: /* switch 3 */
|
||||
temp_v1_6 = &arg0->seqData[m64_read_s16(temp_s0_2) & 0xFFFF];
|
||||
if (temp_s2 == 0xD2) {
|
||||
arg0->shortNoteVelocityTable = temp_v1_6;
|
||||
} else {
|
||||
arg0->shortNoteDurationTable = temp_v1_6;
|
||||
}
|
||||
break;
|
||||
case 0xD0: /* switch 3 */
|
||||
arg0->noteAllocPolicy = m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
case 0xCC: /* switch 3 */
|
||||
var_s3 = m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
case 0xC9: /* switch 3 */
|
||||
var_s3 &= m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
case 0xC8: /* switch 3 */
|
||||
var_s3 -= m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
default: /* switch 3 */
|
||||
switch (temp_v0_5) { /* switch 6; irregular */
|
||||
case 0x0: /* switch 6 */
|
||||
var_s3 = (s32) ((u32) (*arg0->channels[temp_v1_3 & 0xF] * 2) >> 0x1F);
|
||||
break;
|
||||
case 0x50: /* switch 6 */
|
||||
var_s3 -= arg0->seqVariationEu[0];
|
||||
break;
|
||||
case 0x70: /* switch 6 */
|
||||
arg0->seqVariationEu[0] = (s8) var_s3;
|
||||
break;
|
||||
case 0x80: /* switch 6 */
|
||||
var_s3 = (s32) arg0->seqVariationEu[0];
|
||||
break;
|
||||
case 0x90: /* switch 6 */
|
||||
sequence_channel_enable(arg0, temp_s2 & 0xF, &arg0->seqData[m64_read_s16(temp_s0_2) & 0xFFFF]);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
state->depth--;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xfb: // seq_jump
|
||||
case 0xfa: // seq_beqz; jump if == 0
|
||||
case 0xf9: // seq_bltz; jump if < 0
|
||||
case 0xf5: // seq_bgez; jump if >= 0
|
||||
u16v = m64_read_s16(state);
|
||||
if (cmd == 0xfa && value != 0) {
|
||||
break;
|
||||
}
|
||||
if (cmd == 0xf9 && value >= 0) {
|
||||
break;
|
||||
}
|
||||
if (cmd == 0xf5 && value < 0) {
|
||||
break;
|
||||
}
|
||||
state->pc = seqPlayer->seqData + u16v;
|
||||
break;
|
||||
|
||||
case 0xf4:
|
||||
case 0xf3:
|
||||
case 0xf2:
|
||||
temp = m64_read_u8(state);
|
||||
if (cmd == 0xf3 && value != 0) {
|
||||
break;
|
||||
}
|
||||
if (cmd == 0xf2 && value >= 0) {
|
||||
break;
|
||||
}
|
||||
state->pc += (s8) temp;
|
||||
break;
|
||||
|
||||
case 0xf1: // seq_reservenotes
|
||||
note_pool_clear(&seqPlayer->notePool);
|
||||
note_pool_fill(&seqPlayer->notePool, m64_read_u8(state));
|
||||
break;
|
||||
|
||||
case 0xf0: // seq_unreservenotes
|
||||
note_pool_clear(&seqPlayer->notePool);
|
||||
break;
|
||||
|
||||
case 0xdf: // seq_transpose; set transposition in semitones
|
||||
seqPlayer->transposition = 0;
|
||||
// fallthrough
|
||||
|
||||
case 0xde: // seq_transposerel; add transposition
|
||||
seqPlayer->transposition += (s8) m64_read_u8(state);
|
||||
break;
|
||||
|
||||
case 0xdc:
|
||||
case 0xdd: // seq_settempo (bpm)
|
||||
temp = m64_read_u8(state);
|
||||
if (cmd == 0xdd) {
|
||||
seqPlayer->tempo = temp * TEMPO_SCALE;
|
||||
} else {
|
||||
seqPlayer->tempo += (s8) temp * TEMPO_SCALE;
|
||||
}
|
||||
|
||||
if (seqPlayer->tempo > gTempoInternalToExternal) {
|
||||
seqPlayer->tempo = gTempoInternalToExternal;
|
||||
}
|
||||
|
||||
//if (cmd) {}
|
||||
|
||||
if ((s16) seqPlayer->tempo <= 0) {
|
||||
seqPlayer->tempo = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xda:
|
||||
cmd = m64_read_u8(state);
|
||||
u16v = m64_read_s16(state);
|
||||
switch (cmd) {
|
||||
case SEQUENCE_PLAYER_STATE_0:
|
||||
case SEQUENCE_PLAYER_STATE_FADE_OUT:
|
||||
if (seqPlayer->state != SEQUENCE_PLAYER_STATE_2) {
|
||||
seqPlayer->fadeTimerUnkEu = u16v;
|
||||
seqPlayer->state = cmd;
|
||||
}
|
||||
goto loop_24;
|
||||
}
|
||||
break;
|
||||
case SEQUENCE_PLAYER_STATE_2:
|
||||
seqPlayer->fadeRemainingFrames = u16v;
|
||||
seqPlayer->state = cmd;
|
||||
seqPlayer->fadeVelocity =
|
||||
(0.0f - seqPlayer->fadeVolume) / (s32)(u16v & 0xFFFFu);
|
||||
break;
|
||||
}
|
||||
}
|
||||
var_v1 = arg0;
|
||||
var_v0_3 = 0;
|
||||
do {
|
||||
temp_a0_5 = var_v1->channels[0];
|
||||
if (((s32) &gSequenceChannelNone != (s32) temp_a0_5) == 1) {
|
||||
sp34 = var_v0_3;
|
||||
sp30 = var_v1;
|
||||
sequence_channel_process_script((s32) temp_a0_5);
|
||||
break;
|
||||
|
||||
case 0xdb:
|
||||
temp32 = m64_read_u8(state);
|
||||
switch (seqPlayer->state) {
|
||||
case SEQUENCE_PLAYER_STATE_2:
|
||||
break;
|
||||
case SEQUENCE_PLAYER_STATE_FADE_OUT:
|
||||
seqPlayer->state = SEQUENCE_PLAYER_STATE_0;
|
||||
seqPlayer->fadeVolume = 0.0f;
|
||||
// fallthrough
|
||||
case SEQUENCE_PLAYER_STATE_0:
|
||||
seqPlayer->fadeRemainingFrames = seqPlayer->fadeTimerUnkEu;
|
||||
if (seqPlayer->fadeTimerUnkEu != 0) {
|
||||
seqPlayer->fadeVelocity = (temp32 / 127.0f - seqPlayer->fadeVolume) / FLOAT_CAST(seqPlayer->fadeRemainingFrames);
|
||||
} else {
|
||||
seqPlayer->fadeVolume = temp32 / 127.0f;
|
||||
}
|
||||
}
|
||||
var_v0_3 += 4;
|
||||
var_v1 += 4;
|
||||
} while (var_v0_3 != 0x00000040);
|
||||
break;
|
||||
|
||||
case 0xd9:
|
||||
temp = m64_read_u8(state);
|
||||
seqPlayer->fadeVolumeScale = (s8) temp / 127.0f;
|
||||
break;
|
||||
|
||||
case 0xd7: // seq_initchannels
|
||||
u16v = m64_read_s16(state);
|
||||
sequence_player_init_channels(seqPlayer, u16v);
|
||||
break;
|
||||
|
||||
case 0xd6: // seq_disablechannels
|
||||
u16v = m64_read_s16(state);
|
||||
sequence_player_disable_channels(seqPlayer, u16v);
|
||||
break;
|
||||
|
||||
case 0xd5: // seq_setmutescale
|
||||
temp = m64_read_u8(state);
|
||||
seqPlayer->muteVolumeScale = (f32)(s8) temp / US_FLOAT(127.0);
|
||||
break;
|
||||
|
||||
case 0xd4: // seq_mute
|
||||
seqPlayer->muted = TRUE;
|
||||
break;
|
||||
|
||||
case 0xd3: // seq_setmutebhv
|
||||
seqPlayer->muteBehavior = m64_read_u8(state);
|
||||
break;
|
||||
|
||||
case 0xd2: // seq_setshortnotevelocitytable
|
||||
case 0xd1: // seq_setshortnotedurationtable
|
||||
u16v = m64_read_s16(state);
|
||||
seqData = seqPlayer->seqData + u16v;
|
||||
if (cmd == 0xd2) {
|
||||
seqPlayer->shortNoteVelocityTable = seqData;
|
||||
} else {
|
||||
seqPlayer->shortNoteDurationTable = seqData;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xd0: // seq_setnoteallocationpolicy
|
||||
seqPlayer->noteAllocPolicy = m64_read_u8(state);
|
||||
break;
|
||||
|
||||
case 0xcc: // seq_setval
|
||||
value = m64_read_u8(state);
|
||||
break;
|
||||
|
||||
case 0xc9: // seq_bitand
|
||||
value &= m64_read_u8(state);
|
||||
break;
|
||||
|
||||
case 0xc8: // seq_subtract
|
||||
value = value - m64_read_u8(state);
|
||||
break;
|
||||
|
||||
default:
|
||||
eu_stubbed_printf_1("Group:Undefine upper C0h command (%x)\n", cmd);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
loBits = cmd & 0xf;
|
||||
switch (cmd & 0xf0) {
|
||||
case 0x00: // seq_testchdisabled
|
||||
value = seqPlayer->channels[loBits]->finished;
|
||||
break;
|
||||
case 0x10:
|
||||
break;
|
||||
case 0x20:
|
||||
break;
|
||||
case 0x40:
|
||||
break;
|
||||
case 0x50: // seq_subvariation
|
||||
value -= seqPlayer->seqVariationEu[0];
|
||||
break;
|
||||
case 0x60:
|
||||
break;
|
||||
case 0x70: // seq_setvariation
|
||||
seqPlayer->seqVariationEu[0] = value;
|
||||
break;
|
||||
case 0x80: // seq_getvariation
|
||||
value = seqPlayer->seqVariationEu[0];
|
||||
break;
|
||||
case 0x90: // seq_startchannel
|
||||
u16v = m64_read_s16(state);
|
||||
sequence_channel_enable(seqPlayer, loBits, seqPlayer->seqData + u16v);
|
||||
break;
|
||||
case 0xa0:
|
||||
break;
|
||||
|
||||
default:
|
||||
eu_stubbed_printf_0("Group:Undefined Command\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < CHANNELS_MAX; i++) {
|
||||
if (IS_SEQUENCE_CHANNEL_VALID(seqPlayer->channels[i]) == TRUE) {
|
||||
sequence_channel_process_script(seqPlayer->channels[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/audio/seqplayer/sequence_player_process_sequence.s")
|
||||
#endif
|
||||
|
||||
void process_sequences(s32 iterationsRemaining) {
|
||||
s32 i;
|
||||
|
@ -30,12 +30,12 @@ void init_layer_freelist(void);
|
||||
u8 m64_read_u8(struct M64ScriptState *state);
|
||||
s16 m64_read_s16(struct M64ScriptState *state);
|
||||
u16 m64_read_compressed_u16(struct M64ScriptState *state);
|
||||
void seq_channel_layer_process_script(struct SequenceChannelLayer *layer);
|
||||
u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrument **instOut, struct AdsrSettings *adsr);
|
||||
void sequence_player_process_sequence(struct SequencePlayer*);
|
||||
void process_sequences(s32);
|
||||
void set_instrument(struct SequenceChannel *seqChannel, u8 instId);
|
||||
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 init_sequence_player(u32 player);
|
||||
void init_sequence_players(void);
|
||||
|
@ -459,17 +459,15 @@ GLOBAL_ASM("asm/non_matchings/audio/synthesis/func_800B775C.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Aug-14-2023
|
||||
Acmd *func_800B86A0(Acmd *, struct NoteSubEu *, struct NoteSynthesisState *, s32, s32, s32, u32); /* extern */
|
||||
s32 func_800BAD0C(s32, s32, u32, u8 *); /* extern */
|
||||
|
||||
//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) {
|
||||
void *sp130;
|
||||
void *sp12C;
|
||||
s32 *sp128;
|
||||
s32 sp11C;
|
||||
s32 sp118;
|
||||
u32 sp114;
|
||||
s32 sp114; /* compiler-managed */
|
||||
u16 sp112;
|
||||
s32 spFC;
|
||||
s32 spEC;
|
||||
@ -498,7 +496,6 @@ Acmd *func_800B7C30(s32 noteIndex, struct NoteSubEu *noteSubEu, struct NoteSynth
|
||||
s32 *temp_a2_2;
|
||||
s32 temp_a0;
|
||||
s32 temp_a1_2;
|
||||
s32 temp_a1_3;
|
||||
s32 temp_a2;
|
||||
s32 temp_a2_3;
|
||||
s32 temp_a2_4;
|
||||
@ -508,11 +505,9 @@ Acmd *func_800B7C30(s32 noteIndex, struct NoteSubEu *noteSubEu, struct NoteSynth
|
||||
s32 temp_v0_7;
|
||||
s32 temp_v1;
|
||||
s32 var_a0;
|
||||
s32 var_a0_2;
|
||||
s32 var_a2;
|
||||
s32 var_a3;
|
||||
s32 var_fp;
|
||||
s32 var_s0;
|
||||
s32 var_s0_2;
|
||||
s32 var_s1;
|
||||
s32 var_s3;
|
||||
@ -523,18 +518,21 @@ Acmd *func_800B7C30(s32 noteIndex, struct NoteSubEu *noteSubEu, struct NoteSynth
|
||||
s32 var_t2;
|
||||
s32 var_t3;
|
||||
s32 var_t4;
|
||||
s32 var_v1;
|
||||
u16 temp_t7;
|
||||
u16 temp_v0;
|
||||
u32 temp_a1_3;
|
||||
u32 temp_s0;
|
||||
u32 temp_t7_3;
|
||||
u32 var_s0;
|
||||
u32 var_t5;
|
||||
u32 var_t6;
|
||||
u32 var_v1;
|
||||
u32 var_v1_2;
|
||||
u32 var_v1_3;
|
||||
void *temp_a1;
|
||||
void *temp_t7_2;
|
||||
void *temp_t9;
|
||||
void *var_a0_2;
|
||||
|
||||
sp128 = NULL;
|
||||
sp8C = &gNotes[noteIndex];
|
||||
@ -645,12 +643,12 @@ loop_15:
|
||||
spE4 = var_t5;
|
||||
temp_a1_3 = ((var_t0 * 9) + 0x1F) & ~0xF;
|
||||
var_s0 = temp_a1_3;
|
||||
var_a0_2 = func_800BAD0C((temp_t6 * 9) + spEC, temp_a1_3, sp114, &synthesisState->sampleDmaIndex);
|
||||
var_a0_2 = dma_sample_data((temp_t6 * 9) + spEC, temp_a1_3, sp114, &synthesisState->sampleDmaIndex);
|
||||
}
|
||||
var_t1 = 0x540 - var_s0;
|
||||
var_t2 = var_a0_2 & 0xF;
|
||||
var_t2 = (s32) var_a0_2 & 0xF;
|
||||
var_s2_2->words.w1 = (var_a0_2 - var_t2) + 0x80000000;
|
||||
var_s2_2->words.w0 = (((var_s0 >> 4) & 0xFF) << 0x10) | 0x14000000 | (var_t1 & 0xFFFF);
|
||||
var_s2_2->words.w0 = ((((s32) var_s0 >> 4) & 0xFF) << 0x10) | 0x14000000 | (var_t1 & 0xFFFF);
|
||||
var_s2_2 += 8;
|
||||
} else {
|
||||
var_s1 = 0;
|
||||
@ -795,7 +793,7 @@ block_60:
|
||||
} else if ((noteSubEu->headsetPanLeft != 0) || (var_s0_2 = 0, (synthesisState->prevHeadsetPanLeft != 0))) {
|
||||
var_s0_2 = 2;
|
||||
}
|
||||
temp_v0_8 = func_800B86A0(temp_a0_2, noteSubEu, synthesisState, bufLen, 0, var_s0_2, sp114);
|
||||
temp_v0_8 = func_800B86A0(temp_a0_2, noteSubEu, synthesisState, bufLen, (u16) 0, var_s0_2, sp114);
|
||||
var_s2 = temp_v0_8;
|
||||
if ((u8) noteSubEu->unk0 & 1) {
|
||||
var_s2 = note_apply_headset_pan_effects(temp_v0_8, noteSubEu, synthesisState, temp_a2_4, (s32) sp114, var_s0_2);
|
||||
@ -828,69 +826,86 @@ Acmd *final_resample(Acmd *acmd, struct NoteSynthesisState *synthesisState, s32
|
||||
return acmd;
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c
|
||||
Acmd *func_800B86A0(Acmd *acmd, struct NoteSubEu *note, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, u32 flags) {
|
||||
s32 sp8;
|
||||
s32 sp4;
|
||||
s32 sp0;
|
||||
Acmd *temp_a0;
|
||||
Acmd *temp_a0_2;
|
||||
Acmd *temp_a0_3;
|
||||
Acmd *var_a0;
|
||||
s32 temp_a2;
|
||||
s32 temp_a2_2;
|
||||
s32 temp_a2_3;
|
||||
s32 temp_a2_4;
|
||||
s32 temp_t5;
|
||||
u16 temp_v0;
|
||||
u16 temp_v1;
|
||||
#ifdef NON_MATCHING
|
||||
// I wish I knew what was up with this function
|
||||
// It doesn't quite match either the EU or Shindou versions
|
||||
// of process_envelope.
|
||||
// What's here appears to have the right "shape" based on
|
||||
// the M2C output, but beyond that I can't really tell what's
|
||||
// going on
|
||||
Acmd *func_800B86A0(Acmd *cmd, struct NoteSubEu *note, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, u32 flags) {
|
||||
u16 sourceRight;
|
||||
u16 sourceLeft;
|
||||
u16 targetLeft;
|
||||
u16 targetRight;
|
||||
s32 rampLeft;
|
||||
s32 rampRight;
|
||||
s32 sourceReverbVol;
|
||||
s16 rampReverb;
|
||||
s32 reverbVolDiff = 0;
|
||||
|
||||
temp_v0 = (u16) synthesisState->curVolLeft;
|
||||
temp_t5 = nSamples >> 3;
|
||||
temp_v1 = (u16) synthesisState->curVolRight;
|
||||
sp8 = (s32) (((note->targetVolLeft * 0x10) & 0xFFFF) - temp_v0) / temp_t5;
|
||||
sp0 = (s32) (((note->targetVolRight * 0x10) & 0xFFFF) - temp_v1) / temp_t5;
|
||||
sp4 = (s32) temp_v1;
|
||||
synthesisState->curVolLeft = (temp_v0 + (unkspA * temp_t5)) & 0xFFFF;
|
||||
synthesisState->curVolRight = (temp_v1 + (unksp2 * temp_t5)) & 0xFFFF;
|
||||
if (note->unk0 & 1) {
|
||||
acmd->words.w1 = 0x00000180;
|
||||
acmd->words.w0 = 0x02000200;
|
||||
temp_a0 = acmd + 8;
|
||||
temp_a0->words.w0 = (note->reverbVol << 0x10) | 0x12000000 | ((temp_v0 & 0xFF) << 8) | (temp_v1 & 0xFF);
|
||||
temp_a0->words.w1 = (unkspA << 0x10) | (unksp2 & 0xFFFF);
|
||||
temp_a0_2 = temp_a0 + 8;
|
||||
temp_a0_2->words.w0 = 0x16000000;
|
||||
temp_a0_2->words.w1 = (temp_v0 << 0x10) | (temp_v1 & 0xFFFF);
|
||||
var_a0 = temp_a0_2 + 8;
|
||||
if (headsetPanSettings != 1) {
|
||||
if (headsetPanSettings != 2) {
|
||||
temp_a2 = (s32) note->unk0;
|
||||
var_a0->words.w0 = ((((s32) inBuf >> 4) & 0xFF) << 0x10) | 0x13000000 | ((nSamples & 0xFF) << 8) | ((((u32) (temp_a2 * 0x10) >> 0x1F) & 1) * 2) | (((u32) (temp_a2 << 5) >> 0x1F) & 1);
|
||||
var_a0->words.w1 = 0x546C849C;
|
||||
} else {
|
||||
temp_a2_2 = (s32) note->unk0;
|
||||
var_a0->words.w0 = ((((s32) inBuf >> 4) & 0xFF) << 0x10) | 0x13000000 | ((nSamples & 0xFF) << 8) | ((((u32) (temp_a2_2 * 0x10) >> 0x1F) & 1) * 2) | (((u32) (temp_a2_2 << 5) >> 0x1F) & 1);
|
||||
var_a0->words.w1 = 0x5420849C;
|
||||
}
|
||||
} else {
|
||||
temp_a2_3 = (s32) note->unk0;
|
||||
var_a0->words.w0 = ((((s32) inBuf >> 4) & 0xFF) << 0x10) | 0x13000000 | ((nSamples & 0xFF) << 8) | ((((u32) (temp_a2_3 * 0x10) >> 0x1F) & 1) * 2) | (((u32) (temp_a2_3 << 5) >> 0x1F) & 1);
|
||||
var_a0->words.w1 = 0x206C849C;
|
||||
sourceLeft = synthesisState->curVolLeft;
|
||||
sourceRight = synthesisState->curVolRight;
|
||||
targetLeft = note->targetVolLeft;
|
||||
targetRight = note->targetVolRight;
|
||||
targetLeft <<= 4;
|
||||
targetRight <<= 4;
|
||||
|
||||
rampLeft = (targetLeft - sourceLeft) / (nSamples >> 3);
|
||||
rampRight = (targetRight - sourceRight) / (nSamples >> 3);
|
||||
synthesisState->curVolLeft = sourceLeft + rampLeft * (nSamples >> 3);
|
||||
synthesisState->curVolRight = sourceRight + rampRight * (nSamples >> 3);
|
||||
|
||||
if (note->usesHeadsetPanEffects) {
|
||||
aClearBuffer(cmd++, DMEM_ADDR_NOTE_PAN_TEMP, DEFAULT_LEN_1CH);
|
||||
aEnvSetup1(cmd++, note->reverbVol, (((sourceLeft&0xFF) << 8) | (sourceRight&0xFF)), rampRight, rampLeft);
|
||||
aEnvSetup2(cmd++, sourceLeft, sourceRight);
|
||||
|
||||
switch (headsetPanSettings) {
|
||||
case 1:
|
||||
aEnvMixer(cmd++,
|
||||
inBuf, nSamples,
|
||||
0,
|
||||
note->stereoStrongRight, note->stereoStrongLeft,
|
||||
DMEM_ADDR_NOTE_PAN_TEMP,
|
||||
DMEM_ADDR_RIGHT_CH,
|
||||
DMEM_ADDR_WET_LEFT_CH,
|
||||
DMEM_ADDR_WET_RIGHT_CH);
|
||||
break;
|
||||
case 2:
|
||||
aEnvMixer(cmd++,
|
||||
inBuf, nSamples,
|
||||
0,
|
||||
note->stereoStrongRight, note->stereoStrongLeft,
|
||||
DMEM_ADDR_LEFT_CH,
|
||||
DMEM_ADDR_NOTE_PAN_TEMP,
|
||||
DMEM_ADDR_WET_LEFT_CH,
|
||||
DMEM_ADDR_WET_RIGHT_CH);
|
||||
break;
|
||||
default:
|
||||
aEnvMixer(cmd++,
|
||||
inBuf, nSamples,
|
||||
0,
|
||||
note->stereoStrongRight, note->stereoStrongLeft,
|
||||
DMEM_ADDR_LEFT_CH,
|
||||
DMEM_ADDR_RIGHT_CH,
|
||||
DMEM_ADDR_WET_LEFT_CH,
|
||||
DMEM_ADDR_WET_RIGHT_CH);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
temp_a0_3 = acmd + 8;
|
||||
acmd->words.w0 = (note->reverbVol << 0x10) | 0x12000000 | ((temp_v0 & 0xFF) << 8) | (temp_v1 & 0xFF);
|
||||
acmd->words.w1 = (unkspA << 0x10) | (unksp2 & 0xFFFF);
|
||||
temp_a0_3->words.w0 = 0x16000000;
|
||||
temp_a0_3->words.w1 = (temp_v0 << 0x10) | (temp_v1 & 0xFFFF);
|
||||
temp_a2_4 = (s32) note->unk0;
|
||||
var_a0 = temp_a0_3 + 8;
|
||||
var_a0->words.w0 = ((((s32) inBuf >> 4) & 0xFF) << 0x10) | 0x13000000 | ((nSamples & 0xFF) << 8) | ((((u32) (temp_a2_4 * 0x10) >> 0x1F) & 1) * 2) | (((u32) (temp_a2_4 << 5) >> 0x1F) & 1);
|
||||
var_a0->words.w1 = 0x546C849C;
|
||||
aEnvSetup1(cmd++, note->reverbVol, (((sourceLeft&0xFF) << 8) | (sourceRight&0xFF)), rampLeft, rampRight);
|
||||
aEnvSetup2(cmd++, sourceLeft, sourceRight);
|
||||
aEnvMixer(cmd++,
|
||||
inBuf, nSamples,
|
||||
0,
|
||||
note->stereoStrongRight, note->stereoStrongLeft,
|
||||
DMEM_ADDR_LEFT_CH,
|
||||
DMEM_ADDR_RIGHT_CH,
|
||||
DMEM_ADDR_WET_LEFT_CH,
|
||||
DMEM_ADDR_WET_RIGHT_CH);
|
||||
}
|
||||
return var_a0 + 8;
|
||||
return cmd;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/audio/synthesis/func_800B86A0.s")
|
||||
|
@ -7,6 +7,19 @@
|
||||
#define DEFAULT_LEN_1CH 0x180
|
||||
#define DEFAULT_LEN_2CH 0x300
|
||||
|
||||
#define DMEM_ADDR_TEMP 0x0
|
||||
#define DMEM_ADDR_RESAMPLED 0x20
|
||||
#define DMEM_ADDR_RESAMPLED2 0x1A0
|
||||
#define DMEM_ADDR_UNCOMPRESSED_NOTE 0x180
|
||||
#define DMEM_ADDR_NOTE_PAN_TEMP 0x200
|
||||
#define DMEM_ADDR_STEREO_STRONG_TEMP_DRY 0x200
|
||||
#define DMEM_ADDR_STEREO_STRONG_TEMP_WET 0x340
|
||||
#define DMEM_ADDR_COMPRESSED_ADPCM_DATA 0x3f0
|
||||
#define DMEM_ADDR_LEFT_CH 0x540
|
||||
#define DMEM_ADDR_RIGHT_CH 0x6C0
|
||||
#define DMEM_ADDR_WET_LEFT_CH 0x840
|
||||
#define DMEM_ADDR_WET_RIGHT_CH 0x9C0
|
||||
|
||||
/*
|
||||
Its not clear what values these macros should have. Neither version seem to
|
||||
line up for MK64. Maybe each game has unique values for these? I don't know
|
||||
@ -91,10 +104,12 @@ Acmd *synthesis_resample_and_mix_reverb(Acmd*, s32, s16, s16);
|
||||
Acmd *synthesis_load_reverb_samples(Acmd*, s16, s16);
|
||||
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);
|
||||
Acmd *note_apply_headset_pan_effects(Acmd *acmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *note, s32 bufLen, s32 flags, s32 leftRight);
|
||||
|
||||
extern struct AudioBufferParametersEU gAudioBufferParameters;
|
||||
extern s32 gMaxSimultaneousNotes;
|
||||
// These 2 are almost certainly misnamed and misplaced
|
||||
extern u64 gGfxSPTaskOutputBuffer[0x3F00];
|
||||
extern u32 gGfxSPTaskOutputBufferSize;
|
||||
|
||||
extern struct SynthesisReverb gSynthesisReverbs[4];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user