Decompile sndIsMp3

This commit is contained in:
Ryan Dwyer 2021-03-31 12:14:35 +10:00
parent b29c62c33f
commit 955ba2f301
4 changed files with 17 additions and 22 deletions

View File

@ -3395,7 +3395,7 @@ glabel var7f1ab748
.L0f093f60:
/* f093f60: 358d1000 */ ori $t5,$t4,0x1000
/* f093f64: a60d0030 */ sh $t5,0x30($s0)
/* f093f68: 0c003ee8 */ jal snd0000fba0
/* f093f68: 0c003ee8 */ jal sndIsMp3
/* f093f6c: 87a400ba */ lh $a0,0xba($sp)
/* f093f70: 10400014 */ beqz $v0,.L0f093fc4
/* f093f74: 00000000 */ nop
@ -3830,7 +3830,7 @@ glabel var7f1a5a9cnb
/* f092290: 96180030 */ lhu $t8,0x30($s0)
/* f092294: 37191000 */ ori $t9,$t8,0x1000
/* f092298: a6190030 */ sh $t9,0x30($s0)
/* f09229c: 0c00400e */ jal snd0000fba0
/* f09229c: 0c00400e */ jal sndIsMp3
/* f0922a0: 87a400c2 */ lh $a0,0xc2($sp)
/* f0922a4: 10400008 */ beqz $v0,.NB0f0922c8
/* f0922a8: 00000000 */ sll $zero,$zero,0x0
@ -4072,7 +4072,7 @@ glabel var7f1a5a9cnb
//
// channel->flags |= AUDIOCHANNELFLAG_1000;
//
// if (snd0000fba0(soundnum)) {
// if (sndIsMp3(soundnum)) {
// channel->flags |= AUDIOCHANNELFLAG_0010;
//
// prevpri = osGetThreadPri(0);
@ -5473,7 +5473,7 @@ glabel var7f1ab788
/* f095198: 0fc2535e */ jal func0f094d78
/* f09519c: e7a80010 */ swc1 $f8,0x10($sp)
/* f0951a0: 00408025 */ or $s0,$v0,$zero
/* f0951a4: 0c003ee8 */ jal snd0000fba0
/* f0951a4: 0c003ee8 */ jal sndIsMp3
/* f0951a8: 87a4007a */ lh $a0,0x7a($sp)
/* f0951ac: 3c013f80 */ lui $at,0x3f80
/* f0951b0: 44815000 */ mtc1 $at,$f10

View File

@ -21,7 +21,7 @@ void sndSetSoundMode(s32 mode);
u32 snd0000f49c(void);
void snd0000f67c(struct var80094ed8 *arg0);
void sndInit(void);
bool snd0000fba0(s32 soundnum);
bool sndIsMp3(u16 soundnum);
void snd0000fbc4(s16 arg0);
u32 snd0000fc48(void);
u32 snd0000fd74(void);

View File

@ -3630,7 +3630,7 @@ struct something {
};
union soundnumhack {
s16 packed;
u16 packed;
struct {
u16 isruss : 1;

View File

@ -1799,7 +1799,7 @@ glabel snd0000f49c
/* f4b8: 00047c03 */ sra $t7,$a0,0x10
/* f4bc: 01c08025 */ or $s0,$t6,$zero
/* f4c0: afb10018 */ sw $s1,0x18($sp)
/* f4c4: 0c003ee8 */ jal snd0000fba0
/* f4c4: 0c003ee8 */ jal sndIsMp3
/* f4c8: 01e02025 */ or $a0,$t7,$zero
/* f4cc: 10400003 */ beqz $v0,.L0000f4dc
/* f4d0: 3c088009 */ lui $t0,%hi(var80095210)
@ -1931,7 +1931,7 @@ glabel snd0000f49c
/* f934: 00047c03 */ sra $t7,$a0,0x10
/* f938: 01c08025 */ or $s0,$t6,$zero
/* f93c: afb10018 */ sw $s1,0x18($sp)
/* f940: 0c00400e */ jal snd0000fba0
/* f940: 0c00400e */ jal sndIsMp3
/* f944: 01e02025 */ or $a0,$t7,$zero
/* f948: 10400003 */ beqz $v0,.NB0000f958
/* f94c: 3c08800a */ lui $t0,0x800a
@ -2338,18 +2338,13 @@ const char var70053c10[] = "Snd_Play_Mpeg : SYSTEM IS DISABLED\n";
const char var70053c34[] = "Snd_Play_Mpeg : Lib called -> Adr=%x\n";
const char var70053c5c[] = "Snd_Play_Mpeg : Chunk size -> Adr=%x\n";
GLOBAL_ASM(
glabel snd0000fba0
/* fba0: 27bdfff8 */ addiu $sp,$sp,-8
/* fba4: a7a40004 */ sh $a0,0x4($sp)
/* fba8: 8fa20004 */ lw $v0,0x4($sp)
/* fbac: afa40008 */ sw $a0,0x8($sp)
/* fbb0: 27bd0008 */ addiu $sp,$sp,0x8
/* fbb4: 0002c0c0 */ sll $t8,$v0,0x3
/* fbb8: 0018cf82 */ srl $t9,$t8,0x1e
/* fbbc: 03e00008 */ jr $ra
/* fbc0: 0019102b */ sltu $v0,$zero,$t9
);
bool sndIsMp3(u16 soundnum)
{
union soundnumhack tmp;
tmp.packed = soundnum & 0xffff;
return tmp.bits3.unk04 != 0;
}
GLOBAL_ASM(
glabel snd0000fbc4
@ -4522,7 +4517,7 @@ glabel sndStart
/* 10a0c: a3a5003e */ sb $a1,0x3e($sp)
/* 10a10: a3a8003d */ sb $t0,0x3d($sp)
/* 10a14: a3a9003f */ sb $t1,0x3f($sp)
/* 10a18: 0c003ee8 */ jal snd0000fba0
/* 10a18: 0c003ee8 */ jal sndIsMp3
/* 10a1c: e7a00034 */ swc1 $f0,0x34($sp)
/* 10a20: 8fa3002c */ lw $v1,0x2c($sp)
/* 10a24: 87a40040 */ lh $a0,0x40($sp)
@ -4663,7 +4658,7 @@ glabel sndStart
/* 10de8: a3a5003e */ sb $a1,0x3e($sp)
/* 10dec: a3a8003d */ sb $t0,0x3d($sp)
/* 10df0: a3a9003f */ sb $t1,0x3f($sp)
/* 10df4: 0c00400e */ jal snd0000fba0
/* 10df4: 0c00400e */ jal sndIsMp3
/* 10df8: e7a00034 */ swc1 $f0,0x34($sp)
/* 10dfc: 8fa3002c */ lw $v1,0x2c($sp)
/* 10e00: 87a40040 */ lh $a0,0x40($sp)