diff --git a/src/game/game_176d70.c b/src/game/game_176d70.c index de9513234..b3ca4b510 100644 --- a/src/game/game_176d70.c +++ b/src/game/game_176d70.c @@ -7545,7 +7545,7 @@ glabel menuhandler0017dc84 /* f17defc: 0062082b */ sltu $at,$v1,$v0 /* f17df00: 50200018 */ beqzl $at,.L0f17df64 /* f17df04: 00001025 */ or $v0,$zero,$zero -/* f17df08: 0fc63088 */ jal func0f18c220 +/* f17df08: 0fc63088 */ jal mpGetTrackAudioId /* f17df0c: 00602025 */ or $a0,$v1,$zero /* f17df10: 0fc5b647 */ jal func0f16d91c /* f17df14: 00402025 */ or $a0,$v0,$zero diff --git a/src/game/game_187770.c b/src/game/game_187770.c index ff94f9750..0dbc28ff9 100644 --- a/src/game/game_187770.c +++ b/src/game/game_187770.c @@ -5660,24 +5660,12 @@ glabel func0f18c200 /* f18c21c: 00000000 */ sll $zero,$zero,0x0 ); -GLOBAL_ASM( -glabel func0f18c220 -/* f18c220: 27bdffe8 */ addiu $sp,$sp,-24 -/* f18c224: afbf0014 */ sw $ra,0x14($sp) -/* f18c228: 0fc63065 */ jal mpGetUnlockedTrackNum -/* f18c22c: 00000000 */ sll $zero,$zero,0x0 -/* f18c230: 00027080 */ sll $t6,$v0,0x2 -/* f18c234: 01c27023 */ subu $t6,$t6,$v0 -/* f18c238: 000e7040 */ sll $t6,$t6,0x1 -/* f18c23c: 3c028008 */ lui $v0,0x8008 -/* f18c240: 004e1021 */ addu $v0,$v0,$t6 -/* f18c244: 94427a70 */ lhu $v0,0x7a70($v0) -/* f18c248: 8fbf0014 */ lw $ra,0x14($sp) -/* f18c24c: 27bd0018 */ addiu $sp,$sp,0x18 -/* f18c250: 00027a42 */ srl $t7,$v0,0x9 -/* f18c254: 03e00008 */ jr $ra -/* f18c258: 01e01025 */ or $v0,$t7,$zero -); +s32 mpGetTrackAudioId(s32 tracknum) +{ + tracknum = mpGetUnlockedTrackNum(tracknum); + + return g_MpTracks[tracknum].audioid; +} char *mpGetTrackName(s32 tracknum) { diff --git a/src/include/game/game_187770.h b/src/include/game/game_187770.h index 52d2ac642..0ced9831b 100644 --- a/src/include/game/game_187770.h +++ b/src/include/game/game_187770.h @@ -66,7 +66,7 @@ u32 func0f18c0c0(void); u32 func0f18c138(void); s32 mpGetUnlockedTrackNum(s32 tracknum); u32 func0f18c200(void); -u32 func0f18c220(void); +s32 mpGetTrackAudioId(s32 tracknum); char *mpGetTrackName(s32 tracknum); void mpSetUsingMultipleTunes(bool enable); bool mpGetUsingMultipleTunes(void); diff --git a/src/include/types.h b/src/include/types.h index 4c35f4131..e89dfa568 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -2881,8 +2881,8 @@ struct bodynum { }; struct mptrack { - u8 audioid; - u8 duration; + u16 audioid : 7; + u16 duration : 9; s16 name; s16 unlockcategory; }; diff --git a/src/setup/setup_020df0.c b/src/setup/setup_020df0.c index d7a3fbc85..c27b172ff 100644 --- a/src/setup/setup_020df0.c +++ b/src/setup/setup_020df0.c @@ -12171,48 +12171,48 @@ u32 var80087a6c = 0x0000002c; // 2da90 struct mptrack g_MpTracks[] = { // Audio ID, duration, name, unlock category - /*0x00*/ { 0x74, 160, 0x587c, -1 }, - /*0x01*/ { 0x76, 170, 0x587d, -1 }, - /*0x02*/ { 0x7a, 170, 0x587e, -1 }, - /*0x03*/ { 0x7c, 180, 0x587f, -1 }, - /*0x04*/ { 0x7e, 200, 0x5880, -1 }, - /*0x05*/ { 0x80, 197, 0x5881, -1 }, - /*0x06*/ { 0x1a, 120, 0x5882, -1 }, - /*0x07*/ { 0x12, 120, 0x5883, 0 }, - /*0x08*/ { 0x20, 120, 0x5884, 0 }, - /*0x09*/ { 0x24, 120, 0x5885, 1 }, - /*0x0a*/ { 0x26, 120, 0x5886, 1 }, - /*0x0b*/ { 0x04, 120, 0x5887, 2 }, - /*0x0c*/ { 0x22, 120, 0x5888, 2 }, - /*0x0d*/ { 0x18, 120, 0x5889, 3 }, - /*0x0e*/ { 0x4e, 120, 0x588a, 3 }, - /*0x0f*/ { 0x1c, 120, 0x588b, 4 }, - /*0x10*/ { 0x50, 120, 0x588c, 4 }, - /*0x11*/ { 0x1e, 120, 0x588d, 5 }, - /*0x12*/ { 0x52, 120, 0x588e, 5 }, - /*0x13*/ { 0x28, 120, 0x588f, 6 }, - /*0x14*/ { 0x54, 120, 0x5890, 6 }, - /*0x15*/ { 0x2c, 120, 0x5891, 7 }, - /*0x16*/ { 0x64, 120, 0x5892, 7 }, - /*0x17*/ { 0x0c, 120, 0x5893, 8 }, - /*0x18*/ { 0x66, 120, 0x5894, 8 }, - /*0x19*/ { 0x2e, 120, 0x5895, 9 }, - /*0x1a*/ { 0x68, 120, 0x5896, 9 }, - /*0x1b*/ { 0x30, 120, 0x5897, 10 }, - /*0x1c*/ { 0x6a, 120, 0x5898, 10 }, - /*0x1d*/ { 0x3a, 120, 0x5899, 11 }, - /*0x1e*/ { 0x3c, 120, 0x589a, 11 }, - /*0x1f*/ { 0x38, 120, 0x589b, 12 }, - /*0x20*/ { 0x6c, 120, 0x589c, 12 }, - /*0x21*/ { 0x0e, 120, 0x589d, 13 }, - /*0x22*/ { 0x6e, 120, 0x589e, 13 }, - /*0x23*/ { 0x08, 120, 0x589f, 14 }, - /*0x24*/ { 0x48, 120, 0x58a0, 14 }, - /*0x25*/ { 0x3e, 120, 0x58a1, 15 }, - /*0x26*/ { 0x40, 120, 0x58a2, 15 }, - /*0x27*/ { 0x42, 120, 0x58a3, 16 }, - /*0x28*/ { 0x70, 120, 0x58a4, 16 }, - /*0x29*/ { 0xb0, 120, 0x58a5, 16 }, + /*0x00*/ { 0x3a, 160, 0x587c, -1 }, + /*0x01*/ { 0x3b, 170, 0x587d, -1 }, + /*0x02*/ { 0x3d, 170, 0x587e, -1 }, + /*0x03*/ { 0x3e, 180, 0x587f, -1 }, + /*0x04*/ { 0x3f, 200, 0x5880, -1 }, + /*0x05*/ { 0x40, 197, 0x5881, -1 }, + /*0x06*/ { 0x0d, 120, 0x5882, -1 }, + /*0x07*/ { 0x09, 120, 0x5883, 0 }, + /*0x08*/ { 0x10, 120, 0x5884, 0 }, + /*0x09*/ { 0x12, 120, 0x5885, 1 }, + /*0x0a*/ { 0x13, 120, 0x5886, 1 }, + /*0x0b*/ { 0x02, 120, 0x5887, 2 }, + /*0x0c*/ { 0x11, 120, 0x5888, 2 }, + /*0x0d*/ { 0x0c, 120, 0x5889, 3 }, + /*0x0e*/ { 0x27, 120, 0x588a, 3 }, + /*0x0f*/ { 0x0e, 120, 0x588b, 4 }, + /*0x10*/ { 0x28, 120, 0x588c, 4 }, + /*0x11*/ { 0x0f, 120, 0x588d, 5 }, + /*0x12*/ { 0x29, 120, 0x588e, 5 }, + /*0x13*/ { 0x14, 120, 0x588f, 6 }, + /*0x14*/ { 0x2a, 120, 0x5890, 6 }, + /*0x15*/ { 0x16, 120, 0x5891, 7 }, + /*0x16*/ { 0x32, 120, 0x5892, 7 }, + /*0x17*/ { 0x06, 120, 0x5893, 8 }, + /*0x18*/ { 0x33, 120, 0x5894, 8 }, + /*0x19*/ { 0x17, 120, 0x5895, 9 }, + /*0x1a*/ { 0x34, 120, 0x5896, 9 }, + /*0x1b*/ { 0x18, 120, 0x5897, 10 }, + /*0x1c*/ { 0x35, 120, 0x5898, 10 }, + /*0x1d*/ { 0x1d, 120, 0x5899, 11 }, + /*0x1e*/ { 0x1e, 120, 0x589a, 11 }, + /*0x1f*/ { 0x1c, 120, 0x589b, 12 }, + /*0x20*/ { 0x36, 120, 0x589c, 12 }, + /*0x21*/ { 0x07, 120, 0x589d, 13 }, + /*0x22*/ { 0x37, 120, 0x589e, 13 }, + /*0x23*/ { 0x04, 120, 0x589f, 14 }, + /*0x24*/ { 0x24, 120, 0x58a0, 14 }, + /*0x25*/ { 0x1f, 120, 0x58a1, 15 }, + /*0x26*/ { 0x20, 120, 0x58a2, 15 }, + /*0x27*/ { 0x21, 120, 0x58a3, 16 }, + /*0x28*/ { 0x38, 120, 0x58a4, 16 }, + /*0x29*/ { 0x58, 120, 0x58a5, 16 }, }; // 2db8c