mirror of
https://github.com/n64decomp/mk64
synced 2026-08-17 12:59:29 -04:00
Migrate audio/port_eu data (#370)
* All work done in audio * Migrate audio/port_eu data * Refereshed m2c * Got the bss segment matching too Signed-off-by: Taggerung <tyler.taggerung@email.com>
This commit is contained in:
+271
-322
@@ -287,8 +287,7 @@ u16 m64_read_compressed_u16(struct M64ScriptState *state) {
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c
|
||||
struct Note *alloc_note(struct SequenceChannelLayer *); /* extern */
|
||||
//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Aug-14-2023
|
||||
extern s16 D_803B70B4;
|
||||
|
||||
void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
@@ -760,10 +759,7 @@ void sequence_channel_set_volume(struct SequenceChannel *seqChannel, u8 volume)
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c
|
||||
? seq_channel_layer_process_script(struct SequenceChannelLayer *); /* extern */
|
||||
extern s32 gAlBankSets;
|
||||
|
||||
//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Aug-14-2023
|
||||
void func_800BFD90(struct SequenceChannel *seqChannel) {
|
||||
u8 sp55;
|
||||
s16 sp52;
|
||||
@@ -780,9 +776,7 @@ void func_800BFD90(struct SequenceChannel *seqChannel) {
|
||||
s32 temp_s0_5;
|
||||
s32 temp_t3;
|
||||
s32 temp_v0_2;
|
||||
s32 temp_v1_3;
|
||||
s32 temp_v1_5;
|
||||
s32 temp_v1_9;
|
||||
s32 temp_v1_7;
|
||||
s32 var_s0;
|
||||
s32 var_s0_2;
|
||||
s8 var_s3;
|
||||
@@ -792,18 +786,18 @@ void func_800BFD90(struct SequenceChannel *seqChannel) {
|
||||
struct SequenceChannel *var_s1_2;
|
||||
struct SequenceChannelLayer *temp_a0;
|
||||
struct SequenceChannelLayer *temp_a0_5;
|
||||
struct SequenceChannelLayer *temp_v1_8;
|
||||
struct SequenceChannelLayer *temp_v1_6;
|
||||
struct SequencePlayer *temp_s4;
|
||||
u16 temp_a3;
|
||||
u16 temp_a3_2;
|
||||
u16 temp_t5;
|
||||
u16 temp_v1;
|
||||
u16 temp_v1_4;
|
||||
u16 temp_v1_3;
|
||||
u16 var_v0;
|
||||
u32 temp_t6;
|
||||
u32 temp_v0;
|
||||
u8 *temp_v0_6;
|
||||
u8 *temp_v1_7;
|
||||
u8 *temp_v1_5;
|
||||
u8 temp_a0_2;
|
||||
u8 temp_a0_3;
|
||||
u8 temp_s0_3;
|
||||
@@ -813,9 +807,9 @@ void func_800BFD90(struct SequenceChannel *seqChannel) {
|
||||
u8 temp_v0_5;
|
||||
u8 temp_v0_7;
|
||||
void *temp_v0_3;
|
||||
void *temp_v1_10;
|
||||
void *temp_v1_2;
|
||||
void *temp_v1_6;
|
||||
void *temp_v1_4;
|
||||
void *temp_v1_8;
|
||||
|
||||
temp_v0 = seqChannel->unk0;
|
||||
if ((temp_v0 >> 0x1F) != 0) {
|
||||
@@ -932,9 +926,8 @@ loop_12:
|
||||
}
|
||||
goto loop_12;
|
||||
case 0xEB: /* switch 3 */
|
||||
temp_v1_3 = gAlBankSets;
|
||||
temp_a3 = *(temp_v1_3 + (temp_s4->seqId * 2));
|
||||
temp_s0_3 = *(((temp_a3 + *(temp_a3 + temp_v1_3)) - m64_read_u8(temp_s1)) + temp_v1_3);
|
||||
temp_a3 = *(gAlBankSets + (temp_s4->seqId * 2));
|
||||
temp_s0_3 = gAlBankSets[(temp_a3 + gAlBankSets[temp_a3]) - m64_read_u8(temp_s1)];
|
||||
if (get_bank_or_seq(1, 2, (s32) temp_s0_3) != NULL) {
|
||||
seqChannel->bankId = temp_s0_3;
|
||||
}
|
||||
@@ -992,9 +985,9 @@ loop_12:
|
||||
seqChannel->vibratoExtentChangeDelay = 0;
|
||||
goto loop_12;
|
||||
case 0xD7: /* switch 3 */
|
||||
temp_v1_4 = m64_read_u8(temp_s1) << 5;
|
||||
seqChannel->vibratoRateTarget = temp_v1_4;
|
||||
seqChannel->vibratoRateStart = temp_v1_4;
|
||||
temp_v1_3 = m64_read_u8(temp_s1) << 5;
|
||||
seqChannel->vibratoRateTarget = temp_v1_3;
|
||||
seqChannel->vibratoRateStart = temp_v1_3;
|
||||
seqChannel->vibratoRateChangeDelay = 0;
|
||||
goto loop_12;
|
||||
case 0xE2: /* switch 3 */
|
||||
@@ -1014,9 +1007,8 @@ loop_12:
|
||||
seqChannel->reverbVol = m64_read_u8(temp_s1);
|
||||
goto loop_12;
|
||||
case 0xC6: /* switch 3 */
|
||||
temp_v1_5 = gAlBankSets;
|
||||
temp_a3_2 = *(temp_v1_5 + (temp_s4->seqId * 2));
|
||||
temp_s0_4 = *(((temp_a3_2 + *(temp_a3_2 + temp_v1_5)) - m64_read_u8(temp_s1)) + temp_v1_5);
|
||||
temp_a3_2 = *(gAlBankSets + (temp_s4->seqId * 2));
|
||||
temp_s0_4 = gAlBankSets[(temp_a3_2 + gAlBankSets[temp_a3_2]) - m64_read_u8(temp_s1)];
|
||||
if (get_bank_or_seq(1, 2, (s32) temp_s0_4) != NULL) {
|
||||
seqChannel->bankId = temp_s0_4;
|
||||
}
|
||||
@@ -1059,25 +1051,25 @@ loop_12:
|
||||
case 0xE4: /* switch 3 */
|
||||
if (var_s3 != -1) {
|
||||
temp_s1->stack[temp_s1->depth] = temp_s1->pc;
|
||||
temp_v1_6 = seqChannel->dynTable + (var_s3 * 2);
|
||||
temp_v1_4 = seqChannel->dynTable + (var_s3 * 2);
|
||||
temp_s1->depth += 1;
|
||||
temp_s1->pc = &temp_s4->seqData[(temp_v1_6->unk1 + (temp_v1_6->unk0 << 8)) & 0xFFFF];
|
||||
temp_s1->pc = &temp_s4->seqData[(temp_v1_4->unk1 + (temp_v1_4->unk0 << 8)) & 0xFFFF];
|
||||
}
|
||||
goto loop_12;
|
||||
case 0xE6: /* switch 3 */
|
||||
seqChannel->bookOffset = m64_read_u8(temp_s1);
|
||||
goto loop_12;
|
||||
case 0xE7: /* switch 3 */
|
||||
temp_v1_7 = &temp_s4->seqData[m64_read_s16(temp_s1) & 0xFFFF];
|
||||
seqChannel->muteBehavior = *temp_v1_7;
|
||||
seqChannel->noteAllocPolicy = temp_v1_7[7].unk-6;
|
||||
seqChannel->notePriority = temp_v1_7[7].unk-5;
|
||||
seqChannel->transposition = (s16) temp_v1_7[7].unk-4;
|
||||
seqChannel->newPan = temp_v1_7[7].unk-3;
|
||||
seqChannel->panChannelWeight = temp_v1_7[7].unk-2;
|
||||
seqChannel->reverbVol = temp_v1_7[7].unk-1;
|
||||
temp_v1_5 = &temp_s4->seqData[m64_read_s16(temp_s1) & 0xFFFF];
|
||||
seqChannel->muteBehavior = *temp_v1_5;
|
||||
seqChannel->noteAllocPolicy = temp_v1_5[7].unk-6;
|
||||
seqChannel->notePriority = temp_v1_5[7].unk-5;
|
||||
seqChannel->transposition = (s16) temp_v1_5[7].unk-4;
|
||||
seqChannel->newPan = temp_v1_5[7].unk-3;
|
||||
seqChannel->panChannelWeight = temp_v1_5[7].unk-2;
|
||||
seqChannel->reverbVol = temp_v1_5[7].unk-1;
|
||||
seqChannel->changes.as_u8 |= 0x20;
|
||||
seqChannel->reverbIndex = temp_v1_7[7];
|
||||
seqChannel->reverbIndex = temp_v1_5[7];
|
||||
goto loop_12;
|
||||
case 0xE8: /* switch 3 */
|
||||
seqChannel->muteBehavior = m64_read_u8(temp_s1);
|
||||
@@ -1112,9 +1104,9 @@ loop_12:
|
||||
temp_t0 = temp_a0_4 & 0xFF;
|
||||
switch (temp_t6) { /* switch 2 */
|
||||
case 0x0: /* switch 2 */
|
||||
temp_v1_8 = seqChannel->layers[temp_a0_4 & 0xFF];
|
||||
if (temp_v1_8 != NULL) {
|
||||
var_s3 = (s8) ((u32) (*temp_v1_8 * 2) >> 0x1F);
|
||||
temp_v1_6 = seqChannel->layers[temp_a0_4 & 0xFF];
|
||||
if (temp_v1_6 != NULL) {
|
||||
var_s3 = (s8) ((u32) (*temp_v1_6 * 2) >> 0x1F);
|
||||
} else {
|
||||
var_s3 = -1;
|
||||
}
|
||||
@@ -1123,10 +1115,10 @@ loop_12:
|
||||
seqChannel->soundScriptIO[temp_a0_4 & 0xFF] = var_s3;
|
||||
goto loop_12;
|
||||
case 0x80: /* switch 2 */
|
||||
temp_v1_9 = temp_a0_4 & 0xFF;
|
||||
var_s3 = seqChannel->soundScriptIO[temp_v1_9];
|
||||
if (temp_v1_9 < 4) {
|
||||
seqChannel->soundScriptIO[temp_v1_9] = -1;
|
||||
temp_v1_7 = temp_a0_4 & 0xFF;
|
||||
var_s3 = seqChannel->soundScriptIO[temp_v1_7];
|
||||
if (temp_v1_7 < 4) {
|
||||
seqChannel->soundScriptIO[temp_v1_7] = -1;
|
||||
}
|
||||
goto loop_12;
|
||||
case 0x50: /* switch 2 */
|
||||
@@ -1152,8 +1144,8 @@ loop_12:
|
||||
temp_a1_2 = temp_s0 & 0xF;
|
||||
sp34 = temp_a1_2;
|
||||
if (seq_channel_set_layer(seqChannel, temp_a1_2) != -1) {
|
||||
temp_v1_10 = seqChannel->dynTable + (var_s3 * 2);
|
||||
seqChannel->layers[sp34]->scriptState.pc = &temp_s4->seqData[(temp_v1_10->unk1 + (temp_v1_10->unk0 << 8)) & 0xFFFF];
|
||||
temp_v1_8 = seqChannel->dynTable + (var_s3 * 2);
|
||||
seqChannel->layers[sp34]->scriptState.pc = &temp_s4->seqData[(temp_v1_8->unk1 + (temp_v1_8->unk0 << 8)) & 0xFFFF];
|
||||
}
|
||||
}
|
||||
goto loop_12;
|
||||
@@ -1193,357 +1185,320 @@ GLOBAL_ASM("asm/non_matchings/audio/seqplayer/func_800BFD90.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
|
||||
void audio_dma_partial_copy_async(void *, void *, void *, void *, void *); /* extern */
|
||||
void func_800BB584(u8, void *, void *); /* extern */
|
||||
void note_pool_clear(void *); /* extern */
|
||||
void note_pool_fill(void *, s8); /* extern */
|
||||
void sequence_player_init_channels(void *, s32); /* extern */
|
||||
void sequence_player_disable_channels(void *, s32); /* extern */
|
||||
void sequence_channel_enable(void *, s32, s32); /* extern */
|
||||
void sequence_player_disable(void *, u8, s32); /* extern */
|
||||
void func_800BFD90(s32); /* extern */
|
||||
s32 osRecvMesg(void *, ?, ?); /* extern */
|
||||
extern u8 gBankLoadStatus;
|
||||
extern ? gSeqLoadStatus;
|
||||
extern ? gSequenceChannelNone;
|
||||
//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Aug-14-2023
|
||||
? func_800BB584(u8, u8 **, s32 *); /* extern */
|
||||
? func_800BFD90(s32); /* extern */
|
||||
extern s16 D_803B70B4;
|
||||
|
||||
void func_800C08CC(void *arg0) {
|
||||
void *sp38;
|
||||
void func_800C08CC(struct SequencePlayer *arg0) {
|
||||
struct NotePool *sp38;
|
||||
s32 sp34;
|
||||
void *sp30;
|
||||
f32 temp_f16;
|
||||
s16 temp_v1_3;
|
||||
s16 temp_v1_5;
|
||||
s32 temp_a0_6;
|
||||
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_13;
|
||||
s32 temp_v0_3;
|
||||
s32 temp_v0_5;
|
||||
s32 temp_v0_7;
|
||||
s32 temp_v1_4;
|
||||
s32 temp_v1_8;
|
||||
s8 temp_v0_12;
|
||||
s8 temp_v0_6;
|
||||
s8 temp_v0_9;
|
||||
u16 temp_a0_2;
|
||||
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_v0_10;
|
||||
u16 temp_v0_11;
|
||||
u16 temp_v1_7;
|
||||
u16 temp_v1_5;
|
||||
u16 var_v0_2;
|
||||
u32 temp_v0;
|
||||
u8 **temp_a1;
|
||||
u8 *temp_v0_2;
|
||||
u8 *temp_v0_3;
|
||||
u8 *temp_v0_4;
|
||||
u8 *temp_v1;
|
||||
u8 *temp_v1_2;
|
||||
u8 temp_a0;
|
||||
u8 *temp_v1_6;
|
||||
u8 *var_v0;
|
||||
u8 temp_a0_2;
|
||||
u8 temp_a0_3;
|
||||
u8 temp_a0_4;
|
||||
u8 temp_a1_2;
|
||||
u8 temp_s2_2;
|
||||
u8 temp_t9;
|
||||
u8 temp_v1_6;
|
||||
void *temp_a0_5;
|
||||
void *temp_a1;
|
||||
void *temp_a2;
|
||||
void *temp_s0;
|
||||
void *temp_s0_2;
|
||||
void *temp_v0_8;
|
||||
u8 phi_a0;
|
||||
u8 *phi_v0;
|
||||
s32 phi_s3;
|
||||
s16 phi_v0_2;
|
||||
void *phi_v1;
|
||||
s32 phi_v0_3;
|
||||
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;
|
||||
|
||||
temp_v0 = arg0->unk0;
|
||||
if ((temp_v0 >> 0x1F) != 0) {
|
||||
if (((temp_v0 * 0x10) >> 0x1F) == 1) {
|
||||
temp_s0 = arg0 + 0x108;
|
||||
if (osRecvMesg(temp_s0, 0, 0) != -1) {
|
||||
temp_a1 = arg0 + 0x13C;
|
||||
temp_a2 = arg0 + 0x144;
|
||||
if (arg0->unk144 == 0) {
|
||||
arg0->unk0 = arg0->unk0 & 0xFFF7;
|
||||
func_800BB584(arg0->unk6, temp_a1, temp_a2);
|
||||
temp_v0_2 = arg0->unk6 + &gBankLoadStatus;
|
||||
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;
|
||||
return;
|
||||
}
|
||||
/* Duplicate return node #110. Try simplifying control flow for better match */
|
||||
return;
|
||||
} else {
|
||||
audio_dma_partial_copy_async(&arg0->bankDmaCurrDevAddr, temp_a1, temp_a2, temp_s0, &arg0->bankDmaIoMesg);
|
||||
}
|
||||
audio_dma_partial_copy_async(arg0 + 0x140, temp_a1, temp_a2, temp_s0, arg0 + 0x124);
|
||||
return;
|
||||
}
|
||||
/* Duplicate return node #110. Try simplifying control flow for better match */
|
||||
return;
|
||||
}
|
||||
if (((temp_v0 * 8) >> 0x1F) == 1) {
|
||||
if (osRecvMesg(arg0 + 0xD4, 0, 0) != -1) {
|
||||
arg0->unk0 = arg0->unk0 & 0xFFEF;
|
||||
temp_v1 = arg0->unk4 + &gSeqLoadStatus;
|
||||
} 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;
|
||||
}
|
||||
/* Duplicate return node #110. Try simplifying control flow for better match */
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
block_11:
|
||||
temp_v1_2 = arg0->unk4 + &gSeqLoadStatus;
|
||||
temp_a1_2 = *temp_v1_2;
|
||||
if ((temp_a1_2 < 2) || (temp_v0_3 = arg0->unk5 + &gBankLoadStatus, temp_a0 = *temp_v0_3, phi_a0 = temp_a0, phi_v0 = temp_v0_3, ((temp_a0 < 2) != 0))) {
|
||||
sequence_player_disable(arg0, temp_a1_2, 5);
|
||||
return;
|
||||
}
|
||||
if (temp_a1_2 != 5) {
|
||||
*temp_v1_2 = 2;
|
||||
temp_v0_4 = arg0->unk5 + &gBankLoadStatus;
|
||||
phi_a0 = *temp_v0_4;
|
||||
phi_v0 = temp_v0_4;
|
||||
}
|
||||
if (phi_a0 != 5) {
|
||||
*phi_v0 = 2;
|
||||
}
|
||||
if (((arg0->unk0 * 4) >= 0) || ((arg0->unk3 & 0x80) == 0)) {
|
||||
temp_t2 = arg0->unkA + arg0->unk8;
|
||||
arg0->unkA = temp_t2;
|
||||
temp_v1_3 = D_803B70B4;
|
||||
temp_v0_5 = temp_t2 & 0xFFFF;
|
||||
if (temp_v0_5 >= temp_v1_3) {
|
||||
temp_a0_2 = arg0->unkE;
|
||||
arg0->unkA = temp_v0_5 - temp_v1_3;
|
||||
if (temp_a0_2 >= 2) {
|
||||
arg0->unkE = temp_a0_2 - 1;
|
||||
} else {
|
||||
temp_s0_2 = arg0 + 0x70;
|
||||
arg0->unk0 = arg0->unk0 | 4;
|
||||
phi_s3 = sp58;
|
||||
loop_24:
|
||||
temp_v0_6 = m64_read_u8(temp_s0_2);
|
||||
temp_s2 = temp_v0_6 & 0xFF;
|
||||
if (temp_v0_6 == 0xFF) {
|
||||
temp_a0_3 = temp_s0_2->unk18;
|
||||
if (temp_a0_3 == 0) {
|
||||
sequence_player_disable(arg0);
|
||||
} else {
|
||||
temp_t9 = (temp_a0_3 - 1) & 0xFF;
|
||||
temp_s0_2->unk18 = temp_t9;
|
||||
temp_s0_2->unk0 = (temp_s0_2 + (temp_t9 * 4))->unk4;
|
||||
goto block_28;
|
||||
}
|
||||
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;
|
||||
}
|
||||
if (temp_a1_2 != 5) {
|
||||
*temp_v1_2 = 2;
|
||||
var_v0 = &gBankLoadStatus[arg0->defaultBank[0]];
|
||||
var_a0 = *var_v0;
|
||||
}
|
||||
if (var_a0 != 5) {
|
||||
*var_v0 = 2;
|
||||
}
|
||||
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 >= D_803B70B4) {
|
||||
temp_a0 = arg0->delay;
|
||||
arg0->tempoAcc = temp_v0_3 - D_803B70B4;
|
||||
if ((s32) temp_a0 >= 2) {
|
||||
arg0->delay = temp_a0 - 1;
|
||||
} else {
|
||||
block_28:
|
||||
temp_v1_4 = temp_v0_6 & 0xFF;
|
||||
temp_v0_7 = temp_v1_4 & 0xF0;
|
||||
if (temp_v1_4 == 0xFD) {
|
||||
arg0->unkE = m64_read_compressed_u16(temp_s0_2);
|
||||
} else if (temp_v1_4 == 0xFE) {
|
||||
arg0->unkE = 1;
|
||||
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;
|
||||
}
|
||||
} else {
|
||||
if (temp_v1_4 >= 0xC0) {
|
||||
switch (temp_v1_4) { /* switch 1 */
|
||||
case 0xFC: /* switch 1 */
|
||||
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 + (temp_s0_2->unk18 * 4))->unk4 = temp_s0_2->unk0;
|
||||
temp_s0_2->unk18 = temp_s0_2->unk18 + 1;
|
||||
temp_s0_2->unk0 = arg0->unk14 + temp_t2_2;
|
||||
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 1 */
|
||||
(temp_s0_2 + temp_s0_2->unk18)->unk14 = m64_read_u8(temp_s0_2);
|
||||
(temp_s0_2 + (temp_s0_2->unk18 * 4))->unk4 = temp_s0_2->unk0;
|
||||
temp_s0_2->unk18 = temp_s0_2->unk18 + 1;
|
||||
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 1 */
|
||||
temp_v0_8 = temp_s0_2 + temp_s0_2->unk18;
|
||||
temp_v0_8->unk13 = temp_v0_8->unk13 - 1;
|
||||
temp_a0_4 = temp_s0_2->unk18;
|
||||
if ((temp_s0_2 + temp_a0_4)->unk13 != 0) {
|
||||
temp_s0_2->unk0 = *(temp_s0_2 + (temp_a0_4 * 4));
|
||||
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->unk18 = temp_a0_4 - 1;
|
||||
temp_s0_2->depth = temp_a0_3 - 1;
|
||||
}
|
||||
break;
|
||||
case 0xF5: /* switch 1 */
|
||||
case 0xF9: /* switch 1 */
|
||||
case 0xFA: /* switch 1 */
|
||||
case 0xFB: /* switch 1 */
|
||||
if (((temp_s2 != 0xFA) || (phi_s3 == 0)) && ((temp_s2 != 0xF9) || (phi_s3 < 0)) && ((temp_s2 != 0xF5) || (phi_s3 >= 0))) {
|
||||
temp_s0_2->unk0 = arg0->unk14 + (m64_read_s16(temp_s0_2) & 0xFFFF);
|
||||
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 1 */
|
||||
case 0xF3: /* switch 1 */
|
||||
case 0xF4: /* switch 1 */
|
||||
if (((temp_s2 != 0xF3) || (phi_s3 == 0)) && ((temp_s2 != 0xF2) || (phi_s3 < 0))) {
|
||||
temp_s0_2->unk0 = temp_s0_2->unk0 + m64_read_u8(temp_s0_2);
|
||||
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 1 */
|
||||
temp_a0_5 = arg0 + 0x94;
|
||||
sp38 = temp_a0_5;
|
||||
note_pool_clear(temp_a0_5);
|
||||
note_pool_fill(temp_a0_5, m64_read_u8(temp_s0_2));
|
||||
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 1 */
|
||||
note_pool_clear(arg0 + 0x94);
|
||||
case 0xF0: /* switch 3 */
|
||||
note_pool_clear(&arg0->notePool);
|
||||
break;
|
||||
case 0xDF: /* switch 1 */
|
||||
arg0->unkC = 0;
|
||||
case 0xDF: /* switch 3 */
|
||||
arg0->transposition = 0;
|
||||
/* fallthrough */
|
||||
case 0xDE: /* switch 1 */
|
||||
arg0->unkC = arg0->unkC + m64_read_u8(temp_s0_2);
|
||||
case 0xDE: /* switch 3 */
|
||||
arg0->transposition += m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
case 0xDC: /* switch 1 */
|
||||
case 0xDD: /* switch 1 */
|
||||
case 0xDC: /* switch 3 */
|
||||
case 0xDD: /* switch 3 */
|
||||
temp_v0_9 = m64_read_u8(temp_s0_2);
|
||||
if (temp_s2 == 0xDD) {
|
||||
arg0->unk8 = (temp_v0_9 & 0xFF) * 0x30;
|
||||
arg0->tempo = (temp_v0_9 & 0xFF) * 0x30;
|
||||
} else {
|
||||
arg0->unk8 = arg0->unk8 + (temp_v0_9 * 0x30);
|
||||
arg0->tempo += (s8) temp_v0_9 * 0x30;
|
||||
}
|
||||
temp_v1_5 = D_803B70B4;
|
||||
temp_v0_10 = arg0->unk8;
|
||||
phi_v0_2 = temp_v0_10;
|
||||
if (temp_v1_5 < temp_v0_10) {
|
||||
arg0->unk8 = temp_v1_5;
|
||||
phi_v0_2 = temp_v1_5 & 0xFFFF;
|
||||
var_v0_2 = arg0->tempo;
|
||||
if (D_803B70B4 < (s32) var_v0_2) {
|
||||
arg0->tempo = (u16) D_803B70B4;
|
||||
var_v0_2 = D_803B70B4 & 0xFFFF;
|
||||
}
|
||||
if (phi_v0_2 <= 0) {
|
||||
arg0->unk8 = 1;
|
||||
if ((s16) var_v0_2 <= 0) {
|
||||
arg0->tempo = 1;
|
||||
}
|
||||
break;
|
||||
case 0xDA: /* switch 1 */
|
||||
case 0xDA: /* switch 3 */
|
||||
temp_s2_2 = m64_read_u8(temp_s0_2) & 0xFF;
|
||||
temp_v0_11 = m64_read_s16(temp_s0_2);
|
||||
if ((temp_s2_2 != 0) && (temp_s2_2 != 1)) {
|
||||
if (temp_s2_2 != 2) {
|
||||
|
||||
} else {
|
||||
temp_f16 = temp_v0_11 & 0xFFFF;
|
||||
arg0->unk10 = temp_v0_11;
|
||||
arg0->unk1 = temp_s2_2;
|
||||
arg0->unk1C = (0.0f - arg0->unk18) / temp_f16;
|
||||
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;
|
||||
}
|
||||
} else if (arg0->unk1 != 2) {
|
||||
arg0->unk12 = temp_v0_11;
|
||||
arg0->unk1 = 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 1 */
|
||||
temp_v0_12 = m64_read_u8(temp_s0_2);
|
||||
temp_v1_6 = arg0->unk1;
|
||||
if (temp_v1_6 != 0) {
|
||||
if (temp_v1_6 != 1) {
|
||||
if (temp_v1_6 != 2) {
|
||||
|
||||
}
|
||||
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->unk1 = 0;
|
||||
arg0->unk18 = 0.0f;
|
||||
goto block_76;
|
||||
}
|
||||
} else {
|
||||
block_76:
|
||||
temp_v1_7 = arg0->unk12;
|
||||
arg0->unk10 = temp_v1_7;
|
||||
if (temp_v1_7 != 0) {
|
||||
arg0->unk1C = ((temp_v0_12 / 127.0f) - arg0->unk18) / (temp_v1_7 & 0xFFFF);
|
||||
} else {
|
||||
arg0->unk18 = temp_v0_12 / 127.0f;
|
||||
arg0->fadeVolume = (f32) temp_v0_11 / 127.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0xD9: /* switch 1 */
|
||||
arg0->unk28 = m64_read_u8(temp_s0_2) / 127.0f;
|
||||
case 0xD9: /* switch 3 */
|
||||
arg0->fadeVolumeScale = (f32) m64_read_u8(temp_s0_2) / 127.0f;
|
||||
break;
|
||||
case 0xD7: /* switch 1 */
|
||||
case 0xD7: /* switch 3 */
|
||||
sequence_player_init_channels(arg0, m64_read_s16(temp_s0_2) & 0xFFFF);
|
||||
break;
|
||||
case 0xD6: /* switch 1 */
|
||||
case 0xD6: /* switch 3 */
|
||||
sequence_player_disable_channels(arg0, m64_read_s16(temp_s0_2) & 0xFFFF);
|
||||
break;
|
||||
case 0xD5: /* switch 1 */
|
||||
arg0->unk24 = m64_read_u8(temp_s0_2) / 127.0f;
|
||||
case 0xD5: /* switch 3 */
|
||||
arg0->muteVolumeScale = (f32) m64_read_u8(temp_s0_2) / 127.0f;
|
||||
break;
|
||||
case 0xD4: /* switch 1 */
|
||||
arg0->unk0 = arg0->unk0 | 0x20;
|
||||
case 0xD4: /* switch 3 */
|
||||
arg0->unk0 = (s8) ((u8) arg0->unk0 | 0x20);
|
||||
break;
|
||||
case 0xD3: /* switch 1 */
|
||||
arg0->unk3 = m64_read_u8(temp_s0_2);
|
||||
case 0xD3: /* switch 3 */
|
||||
arg0->muteBehavior = m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
case 0xD1: /* switch 1 */
|
||||
case 0xD2: /* switch 1 */
|
||||
temp_v1_8 = arg0->unk14 + (m64_read_s16(temp_s0_2) & 0xFFFF);
|
||||
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->unk8C = temp_v1_8;
|
||||
arg0->shortNoteVelocityTable = temp_v1_6;
|
||||
} else {
|
||||
arg0->unk90 = temp_v1_8;
|
||||
arg0->shortNoteDurationTable = temp_v1_6;
|
||||
}
|
||||
break;
|
||||
case 0xD0: /* switch 1 */
|
||||
arg0->unk2 = m64_read_u8(temp_s0_2);
|
||||
case 0xD0: /* switch 3 */
|
||||
arg0->noteAllocPolicy = m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
case 0xCC: /* switch 1 */
|
||||
phi_s3 = m64_read_u8(temp_s0_2);
|
||||
case 0xCC: /* switch 3 */
|
||||
var_s3 = m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
case 0xC9: /* switch 1 */
|
||||
phi_s3 &= m64_read_u8(temp_s0_2);
|
||||
case 0xC9: /* switch 3 */
|
||||
var_s3 &= m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
case 0xC8: /* switch 1 */
|
||||
phi_s3 -= m64_read_u8(temp_s0_2);
|
||||
case 0xC8: /* switch 3 */
|
||||
var_s3 -= m64_read_u8(temp_s0_2);
|
||||
break;
|
||||
}
|
||||
} else if (temp_v0_7 >= 0x11) {
|
||||
if (temp_v0_7 >= 0x21) {
|
||||
switch (temp_v0_7) { /* switch 2 */
|
||||
case 0x50: /* switch 2 */
|
||||
phi_s3 -= arg0->unk7;
|
||||
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 0x70: /* switch 2 */
|
||||
arg0->unk7 = phi_s3;
|
||||
case 0x50: /* switch 6 */
|
||||
var_s3 -= arg0->seqVariationEu[0];
|
||||
break;
|
||||
case 0x80: /* switch 2 */
|
||||
phi_s3 = arg0->unk7;
|
||||
case 0x70: /* switch 6 */
|
||||
arg0->seqVariationEu[0] = (s8) var_s3;
|
||||
break;
|
||||
case 0x90: /* switch 2 */
|
||||
sequence_channel_enable(arg0, temp_s2 & 0xF, arg0->unk14 + (m64_read_s16(temp_s0_2) & 0xFFFF));
|
||||
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;
|
||||
}
|
||||
} else if (temp_v0_7 != 0x20) {
|
||||
|
||||
break;
|
||||
}
|
||||
} else if (temp_v0_7 != 0) {
|
||||
if (temp_v0_7 != 0x10) {
|
||||
|
||||
}
|
||||
} else {
|
||||
phi_s3 = (*(arg0 + ((temp_v1_4 & 0xF) * 4))->unk30 * 2) >> 0x1F;
|
||||
goto loop_24;
|
||||
}
|
||||
goto loop_24;
|
||||
}
|
||||
}
|
||||
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;
|
||||
func_800BFD90((s32) temp_a0_5);
|
||||
}
|
||||
var_v0_3 += 4;
|
||||
var_v1 += 4;
|
||||
} while (var_v0_3 != 0x00000040);
|
||||
}
|
||||
phi_v1 = arg0;
|
||||
phi_v0_3 = 0;
|
||||
do {
|
||||
temp_a0_6 = phi_v1->unk30;
|
||||
if ((&gSequenceChannelNone != temp_a0_6) == 1) {
|
||||
sp34 = phi_v0_3;
|
||||
sp30 = phi_v1;
|
||||
func_800BFD90(temp_a0_6);
|
||||
}
|
||||
temp_v0_13 = phi_v0_3 + 4;
|
||||
phi_v1 += 4;
|
||||
phi_v0_3 = temp_v0_13;
|
||||
} while (temp_v0_13 != 0x40);
|
||||
}
|
||||
}
|
||||
/* Duplicate return node #110. Try simplifying control flow for better match */
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -1551,26 +1506,20 @@ GLOBAL_ASM("asm/non_matchings/audio/seqplayer/func_800C08CC.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
void process_notes(); // extern
|
||||
void sequence_player_process_sound(u32 *); // extern
|
||||
void func_800C08CC(u32 *); // extern
|
||||
extern u32 gSequencePlayers;
|
||||
extern ? gSequenceChannels;
|
||||
//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Aug-14-2023
|
||||
? func_800C08CC(struct SequencePlayer *); /* extern */
|
||||
|
||||
void func_800C1138(s32 arg0) {
|
||||
u32 *temp_s0;
|
||||
u32 *phi_s0;
|
||||
struct SequencePlayer *var_s0;
|
||||
|
||||
phi_s0 = &gSequencePlayers;
|
||||
var_s0 = gSequencePlayers;
|
||||
do {
|
||||
if ((*phi_s0 >> 0x1F) == 1) {
|
||||
func_800C08CC(phi_s0);
|
||||
sequence_player_process_sound(phi_s0);
|
||||
if (((u32) *var_s0 >> 0x1F) == 1) {
|
||||
func_800C08CC(var_s0);
|
||||
sequence_player_process_sound(var_s0);
|
||||
}
|
||||
temp_s0 = phi_s0 + 0x148;
|
||||
phi_s0 = temp_s0;
|
||||
} while (temp_s0 != &gSequenceChannels);
|
||||
var_s0 += 0x148;
|
||||
} while (var_s0 != gSequenceChannels);
|
||||
process_notes();
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user