Decompile __n_CSPHandleMIDIMsg

This commit is contained in:
Ryan Dwyer 2021-10-16 22:44:03 +10:00
parent 4cb759a4c2
commit 2c213df8fa
21 changed files with 746 additions and 5233 deletions

View File

@ -680,13 +680,13 @@ typedef struct {
u8 unk24;
u8 attackVolume;
u8 decayVolume;
u8 unk27;
s8 unk27;
u8 tremType;
u8 tremRate;
u8 tremDepth;
u8 tremDelay;
u8 vibType;
u8 ribRate;
u8 vibRate;
u8 vibDepth;
u8 vibDelay;
u8 unk30;
@ -753,7 +753,7 @@ typedef struct {
} ALSeqpConfig;
typedef ALMicroTime (*ALOscInit)(void **oscState,f32 *initVal, u8 oscType,
u8 oscRate, u8 oscDepth, u8 oscDelay);
u8 oscRate, u8 oscDepth, u8 oscDelay, u8 unk07);
typedef ALMicroTime (*ALOscUpdate)(void *oscState, f32 *updateVal);
typedef void (*ALOscStop)(void *oscState);

View File

@ -86,7 +86,7 @@ void n_alSynSetPriority( N_ALVoice *voice, s16 priority);
void n_alSynSetVol( N_ALVoice *v, s16 volume, ALMicroTime t);
void n_alSynStartVoice(N_ALVoice *v, ALWaveTable *table);
void n_alSynStartVoiceParams(N_ALVoice *v, ALWaveTable *w,f32 pitch, s16 vol,
ALPan pan, u8 fxmix, ALMicroTime t);
ALPan pan, u8 fxmix, ALMicroTime t, f32 arg7, s32 arg8, s32 arg9);
void n_alSynStopVoice( N_ALVoice *v);
void n_alSynNew(ALSynConfig *c);
@ -174,6 +174,13 @@ ALMicroTime n_alEvtqNextEvent(ALEventQueue *evtq, N_ALEvent *evt);
void n_alEvtqPostEvent(ALEventQueue *evtq, N_ALEvent *evt, ALMicroTime delta, s32 arg3);
void n_alEvtqFlushType(ALEventQueue *evtq, s16 type);
struct oscstate {
u32 unk00;
u8 unk04;
u32 unk08;
f32 unk0c;
f32 unk10;
};
typedef struct N_ALVoiceState_s {
struct N_ALVoiceState_s *next;/* MUST be first */
@ -191,8 +198,8 @@ typedef struct N_ALVoiceState_s {
u8 tremelo; /* current value of the tremelo */
u8 flags; /* bit 0 tremelo flag
bit 1 vibrato flag */
u32 unk38;
u32 unk3c;
void *oscState;
struct oscstate *oscState2;
} N_ALVoiceState;
typedef struct {
@ -250,7 +257,7 @@ typedef struct {
ALOscStop stopOsc;
f32 unk7c;
f32 unk80;
s32 unk84;
void *queue;
u8 unk88;
u8 unk89;
} N_ALCSPlayer;

View File

@ -4,7 +4,7 @@
#include "data.h"
#include "types.h"
u32 func0002fc60(void);
f32 func0002fc60(u8 arg0);
u32 func000301a4(void);
u32 func000301e4(void);
u32 func00030690(void);

View File

@ -5,6 +5,6 @@
#include "types.h"
void func00034f0c(N_ALCSPlayer *seqp, u8 channel);
u32 func00034fb8(void);
void func00034fb8(N_ALCSPlayer *seqp, u8 channel);
#endif

View File

@ -4,6 +4,4 @@
#include "data.h"
#include "types.h"
u32 func00039fe0(void);
#endif

View File

@ -4,7 +4,6 @@
#include "data.h"
#include "types.h"
u32 func0003c9e0(void);
u32 func0003cbb4(void);
#endif

View File

@ -5,7 +5,7 @@
#include "types.h"
u32 n_alSynAddSndPlayer(void);
u32 func0003c9e0(void);
u32 n_alSynAllocVoice(void);
u32 func0003cbb4(void);
#endif

View File

@ -4,6 +4,4 @@
#include "data.h"
#include "types.h"
u32 func0003cdc0(void);
#endif

View File

@ -4,6 +4,6 @@
#include "data.h"
#include "types.h"
u32 func0003e730(void);
void func0003e730(N_ALVoice *v, u8 channel);
#endif

View File

@ -31,7 +31,7 @@ void snd0000fe20(void);
void snd0000fe50(void);
void sndTick(void);
bool sndIsDisabled(void);
u32 snd0001036c(void);
void snd0001036c(u8 arg0);
void sndAdjust(struct audiohandle **handle, s32 arg1, s32 arg2, s32 speakerweight, s16 soundnum, f32 arg5, s32 arg6, s32 arg7, s32 arg8);
struct audiohandle *snd00010718(struct audiohandle **handle, s32 arg1, s32 arg2, s32 arg3, s32 arg4, f32 arg5, s32 arg6, s32 arg7, s32 arg8);
struct audiohandle *sndStart(s32 arg0, s16 sound, struct audiohandle **handle, s32 arg3, s32 arg4, f32 arg5, s32 arg6, s32 arg7);

View File

@ -7058,6 +7058,10 @@ struct var8009c340 {
u8 surround;
u8 mono;
u8 headphone;
u8 unk03;
u8 unk04[2];
u8 unk06[2];
u8 unk08[4];
};
struct var80095210 {

View File

@ -371,7 +371,7 @@ glabel var700546b8
/* 300e4: c7a6002c */ lwc1 $f6,0x2c($sp)
/* 300e8: 4600320d */ trunc.w.s $f8,$f6
/* 300ec: 44044000 */ mfc1 $a0,$f8
/* 300f0: 0c00e7f8 */ jal func00039fe0
/* 300f0: 0c00e7f8 */ jal alCents2Ratio
/* 300f4: 00000000 */ nop
/* 300f8: 8fae0034 */ lw $t6,0x34($sp)
/* 300fc: e5c00000 */ swc1 $f0,0x0($t6)
@ -553,7 +553,7 @@ glabel var700546b8
/* 300e4: c7a6002c */ lwc1 $f6,0x2c($sp)
/* 300e8: 4600320d */ trunc.w.s $f8,$f6
/* 300ec: 44044000 */ mfc1 $a0,$f8
/* 300f0: 0c00e7f8 */ jal func00039fe0
/* 300f0: 0c00e7f8 */ jal alCents2Ratio
/* 300f4: 00000000 */ nop
/* 300f8: 8fae0034 */ lw $t6,0x34($sp)
/* 300fc: e5c00000 */ swc1 $f0,0x0($t6)
@ -952,7 +952,7 @@ glabel var700546f4
/* 2fef0: c7300010 */ lwc1 $f16,0x10($t9)
/* 2fef4: 4600818d */ trunc.w.s $f6,$f16
/* 2fef8: 44043000 */ mfc1 $a0,$f6
/* 2fefc: 0c00e638 */ jal func00039fe0
/* 2fefc: 0c00e638 */ jal alCents2Ratio
/* 2ff00: 00000000 */ nop
/* 2ff04: 8fa90024 */ lw $t1,0x24($sp)
/* 2ff08: 10000008 */ b .PF0002ff2c
@ -1307,7 +1307,7 @@ glabel var700546f4
/* 305f0: c7300010 */ lwc1 $f16,0x10($t9)
/* 305f4: 4600818d */ trunc.w.s $f6,$f16
/* 305f8: 44043000 */ mfc1 $a0,$f6
/* 305fc: 0c00e7f8 */ jal func00039fe0
/* 305fc: 0c00e7f8 */ jal alCents2Ratio
/* 30600: 00000000 */ nop
/* 30604: 8fa90024 */ lw $t1,0x24($sp)
/* 30608: 10000008 */ b .L0003062c
@ -1714,7 +1714,7 @@ glabel var70054724
/* 30b7c: c7b00020 */ lwc1 $f16,0x20($sp)
/* 30b80: 4600848d */ trunc.w.s $f18,$f16
/* 30b84: 44049000 */ mfc1 $a0,$f18
/* 30b88: 0c00e7f8 */ jal func00039fe0
/* 30b88: 0c00e7f8 */ jal alCents2Ratio
/* 30b8c: 00000000 */ nop
/* 30b90: 8fa8002c */ lw $t0,0x2c($sp)
/* 30b94: 10000007 */ b .L00030bb4

View File

@ -776,7 +776,7 @@ glabel var7005477c
.L00031d64:
/* 31d64: 8fa40060 */ lw $a0,0x60($sp)
/* 31d68: 27a500b0 */ addiu $a1,$sp,0xb0
/* 31d6c: 0c00f278 */ jal func0003c9e0
/* 31d6c: 0c00f278 */ jal n_alSynAllocVoice
/* 31d70: 2484000c */ addiu $a0,$a0,0xc
/* 31d74: afa20064 */ sw $v0,0x64($sp)
.L00031d78:
@ -1145,7 +1145,7 @@ glabel var7005477c
/* 322b0: afa90010 */ sw $t1,0x10($sp)
/* 322b4: afae0014 */ sw $t6,0x14($sp)
/* 322b8: afab0024 */ sw $t3,0x24($sp)
/* 322bc: 0c00f370 */ jal func0003cdc0
/* 322bc: 0c00f370 */ jal n_alSynStartVoiceParams
/* 322c0: e7b2001c */ swc1 $f18,0x1c($sp)
/* 322c4: 8fac0060 */ lw $t4,0x60($sp)
/* 322c8: 240d0001 */ addiu $t5,$zero,0x1
@ -2287,7 +2287,7 @@ glabel var7005477c
.NB000334a4:
/* 334a4: 8fa40060 */ lw $a0,0x60($sp)
/* 334a8: 27a500b0 */ addiu $a1,$sp,0xb0
/* 334ac: 0c00f76c */ jal func0003c9e0
/* 334ac: 0c00f76c */ jal n_alSynAllocVoice
/* 334b0: 2484000c */ addiu $a0,$a0,0xc
/* 334b4: afa20064 */ sw $v0,0x64($sp)
.NB000334b8:
@ -2594,7 +2594,7 @@ glabel var7005477c
/* 33908: afb80010 */ sw $t8,0x10($sp)
/* 3390c: afad0014 */ sw $t5,0x14($sp)
/* 33910: afaa0024 */ sw $t2,0x24($sp)
/* 33914: 0c00f864 */ jal func0003cdc0
/* 33914: 0c00f864 */ jal n_alSynStartVoiceParams
/* 33918: e7b0001c */ swc1 $f16,0x1c($sp)
/* 3391c: 8fa90060 */ lw $t1,0x60($sp)
/* 33920: 24080001 */ addiu $t0,$zero,0x1
@ -3536,7 +3536,7 @@ glabel func00033100
/* 3310c: 8fae0030 */ lw $t6,0x30($sp)
/* 33110: 8dcf0008 */ lw $t7,0x8($t6)
/* 33114: 8df80004 */ lw $t8,0x4($t7)
/* 33118: 0c00e7f8 */ jal func00039fe0
/* 33118: 0c00e7f8 */ jal alCents2Ratio
/* 3311c: 83040005 */ lb $a0,0x5($t8)
/* 33120: 8fb90030 */ lw $t9,0x30($sp)
/* 33124: c724002c */ lwc1 $f4,0x2c($t9)
@ -3841,7 +3841,7 @@ glabel func00033390
/* 33550: 000420c0 */ sll $a0,$a0,0x3
/* 33554: 00812021 */ addu $a0,$a0,$at
/* 33558: 00042080 */ sll $a0,$a0,0x2
/* 3355c: 0c00e7f8 */ jal func00039fe0
/* 3355c: 0c00e7f8 */ jal alCents2Ratio
/* 33560: 2484e890 */ addiu $a0,$a0,-6000
/* 33564: 8faa0024 */ lw $t2,0x24($sp)
/* 33568: 1000000e */ b .L000335a4
@ -3856,7 +3856,7 @@ glabel func00033390
/* 33588: 01cc7021 */ addu $t6,$t6,$t4
/* 3358c: 000e7080 */ sll $t6,$t6,0x2
/* 33590: 01cd2021 */ addu $a0,$t6,$t5
/* 33594: 0c00e7f8 */ jal func00039fe0
/* 33594: 0c00e7f8 */ jal alCents2Ratio
/* 33598: 2484e890 */ addiu $a0,$a0,-6000
/* 3359c: 8faf0024 */ lw $t7,0x24($sp)
/* 335a0: e5e00028 */ swc1 $f0,0x28($t7)

View File

@ -9,7 +9,7 @@ const u32 var70054a80[] = {0x3f8012ef};
const u32 var70054a84[] = {0x3f7fda28};
GLOBAL_ASM(
glabel func00039fe0
glabel alCents2Ratio
/* 39fe0: 27bdfff8 */ addiu $sp,$sp,-8
/* 39fe4: 3c013f80 */ lui $at,0x3f80
/* 39fe8: 44812000 */ mtc1 $at,$f4

View File

@ -50,9 +50,9 @@ glabel var70054a90
/* 3a17c: 240e0170 */ addiu $t6,$zero,0x170
/* 3a180: a7ae0072 */ sh $t6,0x72($sp)
/* 3a184: 8faf0088 */ lw $t7,0x88($sp)
/* 3a188: 3c19800a */ lui $t9,%hi(var8009c344)
/* 3a188: 3c19800a */ lui $t9,%hi(var8009c340+0x4)
/* 3a18c: 032fc821 */ addu $t9,$t9,$t7
/* 3a190: 9339c344 */ lbu $t9,%lo(var8009c344)($t9)
/* 3a190: 9339c344 */ lbu $t9,%lo(var8009c340+0x4)($t9)
/* 3a194: 1720001d */ bnez $t9,.L0003a20c
/* 3a198: 00000000 */ nop
/* 3a19c: 8fb8007c */ lw $t8,0x7c($sp)
@ -94,9 +94,9 @@ glabel var70054a90
/* 3a228: afae0010 */ sw $t6,0x10($sp)
/* 3a22c: afa2007c */ sw $v0,0x7c($sp)
/* 3a230: 8faf0088 */ lw $t7,0x88($sp)
/* 3a234: 3c19800a */ lui $t9,%hi(var8009c344)
/* 3a234: 3c19800a */ lui $t9,%hi(var8009c340+0x4)
/* 3a238: 032fc821 */ addu $t9,$t9,$t7
/* 3a23c: 9339c344 */ lbu $t9,%lo(var8009c344)($t9)
/* 3a23c: 9339c344 */ lbu $t9,%lo(var8009c340+0x4)($t9)
/* 3a240: 1320000a */ beqz $t9,.L0003a26c
/* 3a244: 00000000 */ nop
/* 3a248: 8fb80078 */ lw $t8,0x78($sp)
@ -110,10 +110,10 @@ glabel var70054a90
/* 3a268: afa2007c */ sw $v0,0x7c($sp)
.L0003a26c:
/* 3a26c: 8fa90088 */ lw $t1,0x88($sp)
/* 3a270: 3c0a800a */ lui $t2,%hi(var8009c344)
/* 3a270: 3c0a800a */ lui $t2,%hi(var8009c340+0x4)
/* 3a274: afa00054 */ sw $zero,0x54($sp)
/* 3a278: 01495021 */ addu $t2,$t2,$t1
/* 3a27c: 914ac344 */ lbu $t2,%lo(var8009c344)($t2)
/* 3a27c: 914ac344 */ lbu $t2,%lo(var8009c340+0x4)($t2)
.L0003a280:
/* 3a280: 8fab007c */ lw $t3,0x7c($sp)
/* 3a284: 256c0008 */ addiu $t4,$t3,0x8
@ -167,14 +167,14 @@ glabel var70054a90
/* 3a340: 016e7821 */ addu $t7,$t3,$t6
/* 3a344: afaf0064 */ sw $t7,0x64($sp)
/* 3a348: 8fb90088 */ lw $t9,0x88($sp)
/* 3a34c: 3c18800a */ lui $t8,%hi(var8009c344+0x2)
/* 3a34c: 3c18800a */ lui $t8,%hi(var8009c340+0x6)
/* 3a350: 0319c021 */ addu $t8,$t8,$t9
/* 3a354: 9318c346 */ lbu $t8,%lo(var8009c344+0x2)($t8)
/* 3a354: 9318c346 */ lbu $t8,%lo(var8009c340+0x6)($t8)
/* 3a358: 1300000e */ beqz $t8,.L0003a394
/* 3a35c: 00000000 */ nop
/* 3a360: 3c08800a */ lui $t0,%hi(var8009c344)
/* 3a360: 3c08800a */ lui $t0,%hi(var8009c340+0x4)
/* 3a364: 01194021 */ addu $t0,$t0,$t9
/* 3a368: 9108c344 */ lbu $t0,%lo(var8009c344)($t0)
/* 3a368: 9108c344 */ lbu $t0,%lo(var8009c340+0x4)($t0)
/* 3a36c: 11000009 */ beqz $t0,.L0003a394
/* 3a370: 00000000 */ nop
/* 3a374: 8fa9005c */ lw $t1,0x5c($sp)
@ -319,9 +319,9 @@ glabel var70054a90
/* 3a584: 13200062 */ beqz $t9,.L0003a710
/* 3a588: 00000000 */ nop
/* 3a58c: 8fa80088 */ lw $t0,0x88($sp)
/* 3a590: 3c0c800a */ lui $t4,%hi(var8009c344)
/* 3a590: 3c0c800a */ lui $t4,%hi(var8009c340+0x4)
/* 3a594: 01886021 */ addu $t4,$t4,$t0
/* 3a598: 918cc344 */ lbu $t4,%lo(var8009c344)($t4)
/* 3a598: 918cc344 */ lbu $t4,%lo(var8009c340+0x4)($t4)
/* 3a59c: 11800016 */ beqz $t4,.L0003a5f8
/* 3a5a0: 00000000 */ nop
/* 3a5a4: 8fad007c */ lw $t5,0x7c($sp)
@ -443,9 +443,9 @@ glabel var70054a90
/* 3a75c: 00000000 */ nop
.L0003a760:
/* 3a760: 8fa80088 */ lw $t0,0x88($sp)
/* 3a764: 3c19800a */ lui $t9,%hi(var8009c344)
/* 3a764: 3c19800a */ lui $t9,%hi(var8009c340+0x4)
/* 3a768: 0328c821 */ addu $t9,$t9,$t0
/* 3a76c: 9339c344 */ lbu $t9,%lo(var8009c344)($t9)
/* 3a76c: 9339c344 */ lbu $t9,%lo(var8009c340+0x4)($t9)
/* 3a770: 13200035 */ beqz $t9,.L0003a848
/* 3a774: 00000000 */ nop
/* 3a778: 8fac0054 */ lw $t4,0x54($sp)
@ -463,9 +463,9 @@ glabel var70054a90
/* 3a7a8: afaa0014 */ sw $t2,0x14($sp)
/* 3a7ac: afa2007c */ sw $v0,0x7c($sp)
/* 3a7b0: 8fae0088 */ lw $t6,0x88($sp)
/* 3a7b4: 3c18800a */ lui $t8,%hi(var8009c344+0x2)
/* 3a7b4: 3c18800a */ lui $t8,%hi(var8009c340+0x6)
/* 3a7b8: 030ec021 */ addu $t8,$t8,$t6
/* 3a7bc: 9318c346 */ lbu $t8,%lo(var8009c344+0x2)($t8)
/* 3a7bc: 9318c346 */ lbu $t8,%lo(var8009c340+0x6)($t8)
/* 3a7c0: 13000011 */ beqz $t8,.L0003a808
/* 3a7c4: 00000000 */ nop
/* 3a7c8: 8faf007c */ lw $t7,0x7c($sp)
@ -549,10 +549,10 @@ glabel var70054a90
/* 3a8f4: ad2f0028 */ sw $t7,0x28($t1)
.L0003a8f8:
/* 3a8f8: 8fb90088 */ lw $t9,0x88($sp)
/* 3a8fc: 3c0c800a */ lui $t4,%hi(var8009c344)
/* 3a8fc: 3c0c800a */ lui $t4,%hi(var8009c340+0x4)
/* 3a900: 8faa0054 */ lw $t2,0x54($sp)
/* 3a904: 01996021 */ addu $t4,$t4,$t9
/* 3a908: 918cc344 */ lbu $t4,%lo(var8009c344)($t4)
/* 3a908: 918cc344 */ lbu $t4,%lo(var8009c340+0x4)($t4)
/* 3a90c: 254d0001 */ addiu $t5,$t2,0x1
/* 3a910: afad0054 */ sw $t5,0x54($sp)
/* 3a914: 018d082b */ sltu $at,$t4,$t5

View File

@ -7,7 +7,7 @@
#include "types.h"
GLOBAL_ASM(
glabel func0003c9e0
glabel n_alSynAllocVoice
/* 3c9e0: 27bdffd8 */ addiu $sp,$sp,-40
/* 3c9e4: afbf0014 */ sw $ra,0x14($sp)
/* 3c9e8: afa40028 */ sw $a0,0x28($sp)

View File

@ -6,7 +6,7 @@
#include "types.h"
GLOBAL_ASM(
glabel func0003cdc0
glabel n_alSynStartVoiceParams
/* 3cdc0: 27bdffe0 */ addiu $sp,$sp,-32
/* 3cdc4: afbf0014 */ sw $ra,0x14($sp)
/* 3cdc8: afa40020 */ sw $a0,0x20($sp)

View File

@ -49,15 +49,15 @@ glabel n_alMainBusPull
/* 44c50: 00000000 */ nop
/* 44c54: afa20044 */ sw $v0,0x44($sp)
/* 44c58: 8faf0040 */ lw $t7,0x40($sp)
/* 44c5c: 3c18800a */ lui $t8,%hi(var8009c344)
/* 44c5c: 3c18800a */ lui $t8,%hi(var8009c340+0x4)
/* 44c60: 030fc021 */ addu $t8,$t8,$t7
/* 44c64: 9318c344 */ lbu $t8,%lo(var8009c344)($t8)
/* 44c64: 9318c344 */ lbu $t8,%lo(var8009c340+0x4)($t8)
/* 44c68: 13000023 */ beqz $t8,.L00044cf8
/* 44c6c: 00000000 */ nop
/* 44c70: 8fa80040 */ lw $t0,0x40($sp)
/* 44c74: 3c09800a */ lui $t1,%hi(var8009c344+0x2)
/* 44c74: 3c09800a */ lui $t1,%hi(var8009c340+0x6)
/* 44c78: 01284821 */ addu $t1,$t1,$t0
/* 44c7c: 9129c346 */ lbu $t1,%lo(var8009c344+0x2)($t1)
/* 44c7c: 9129c346 */ lbu $t1,%lo(var8009c340+0x6)($t1)
/* 44c80: 1120000f */ beqz $t1,.L00044cc0
/* 44c84: 00000000 */ nop
/* 44c88: 8faa0044 */ lw $t2,0x44($sp)
@ -92,9 +92,9 @@ glabel n_alMainBusPull
/* 44cf4: 00000000 */ nop
.L00044cf8:
/* 44cf8: 8fac0040 */ lw $t4,0x40($sp)
/* 44cfc: 3c0d800a */ lui $t5,%hi(var8009c344+0x2)
/* 44cfc: 3c0d800a */ lui $t5,%hi(var8009c340+0x6)
/* 44d00: 01ac6821 */ addu $t5,$t5,$t4
/* 44d04: 91adc346 */ lbu $t5,%lo(var8009c344+0x2)($t5)
/* 44d04: 91adc346 */ lbu $t5,%lo(var8009c340+0x6)($t5)
/* 44d08: 11a0000f */ beqz $t5,.L00044d48
/* 44d0c: 00000000 */ nop
/* 44d10: 8fae0044 */ lw $t6,0x44($sp)

File diff suppressed because it is too large Load Diff

View File

@ -316,7 +316,7 @@ ALMicroTime __n_vsDelta(N_ALVoiceState *vs, ALMicroTime t)
}
}
ALPan __vsPan(N_ALVoiceState *vs, N_ALSeqPlayer *seqp)
ALPan __n_vsPan(N_ALVoiceState *vs, N_ALSeqPlayer *seqp)
{
s32 tmp;
@ -413,7 +413,7 @@ void __n_setInstChanState(N_ALSeqPlayer *seqp, ALInstrument *inst, s32 chan)
seqp->chanState[chan].tremDepth = inst->tremDepth;
seqp->chanState[chan].tremDelay = inst->tremDelay;
seqp->chanState[chan].vibType = inst->vibType;
seqp->chanState[chan].ribRate = inst->vibRate;
seqp->chanState[chan].vibRate = inst->vibRate;
seqp->chanState[chan].vibDepth = inst->vibDepth;
seqp->chanState[chan].vibDelay = inst->vibDelay;

View File

@ -17,9 +17,6 @@
#include "types.h"
struct var8009c340 var8009c340;
u8 var8009c344[2];
u8 var8009c346[2];
u8 var8009c348[4];
void speakersSetMode(u8 mode)
{
@ -49,35 +46,35 @@ void speakersSetMode(u8 mode)
void speaker00034104(s32 index, s32 arg1)
{
if (arg1 == 0) {
arg1 = var8009c348[index];
arg1 = var8009c340.unk08[index];
}
var8009c344[index] = 0;
var8009c346[index] = 0;
var8009c340.unk04[index] = 0;
var8009c340.unk06[index] = 0;
switch (arg1) {
case 2:
if (var8009c340.surround) {
var8009c346[index] = 1;
var8009c340.unk06[index] = 1;
}
break;
case 3:
if (var8009c340.surround) {
var8009c344[index] = 1;
var8009c340.unk04[index] = 1;
}
break;
case 4:
if (!var8009c340.mono) {
var8009c344[index] = 1;
var8009c340.unk04[index] = 1;
}
break;
case 5:
if (!var8009c340.mono) {
var8009c344[index] = 1;
var8009c346[index] = 1;
var8009c340.unk04[index] = 1;
var8009c340.unk06[index] = 1;
}
break;
}
var8009c348[index] = arg1;
var8009c340.unk08[index] = arg1;
}