last audio function and more documentation (#934)

* documented voice

* sfx_player

* sfx

* ambient sounds

* fix

* fix name

* au -> snd
This commit is contained in:
Unnunu 2023-02-06 14:21:55 +03:00 committed by GitHub
parent 713883c750
commit 354ebdfe20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
424 changed files with 3752 additions and 4090 deletions

View File

@ -309,7 +309,7 @@
#define SetTexPanner dead_SetTexPanner
#define func_802D7B10 dead_func_802D7B10
#define Entity_Chest dead_Entity_Chest
#define snd_ambient_80055618 dead_snd_ambient_80055618
#define snd_ambient_mute dead_snd_ambient_mute
#define GetPlayerAnimation dead_GetPlayerAnimation
#define SetPlayerSpeed dead_SetPlayerSpeed
#define SetItemPos dead_SetItemPos

View File

@ -539,9 +539,13 @@ enum SoundIDs {
SOUND_11 = 0x00000011,
SOUND_12 = 0x00000012,
SOUND_14 = 0x00000014,
SOUND_21 = 0x00000021,
SOUND_22 = 0x00000022,
SOUND_23 = 0x00000023,
SOUND_24 = 0x00000024,
SOUND_25 = 0x00000025,
SOUND_26 = 0x00000026,
SOUND_27 = 0x00000027,
SOUND_28 = 0x00000028,
SOUND_29 = 0x00000029,
SOUND_2A = 0x0000002A,
@ -551,6 +555,8 @@ enum SoundIDs {
SOUND_2E = 0x0000002E,
SOUND_2F = 0x0000002F,
SOUND_30 = 0x00000030,
SOUND_33 = 0x00000033,
SOUND_34 = 0x00000034,
SOUND_35 = 0x00000035,
SOUND_36 = 0x00000036,
SOUND_37 = 0x00000037,
@ -566,18 +572,28 @@ enum SoundIDs {
SOUND_JR_TROOPA_SWIM = 0x00000046,
SOUND_BOO_SPOOK = 0x00000047,
SOUND_48 = 0x00000048,
SOUND_4A = 0x0000004A,
SOUND_4C = 0x0000004C,
SOUND_4D = 0x0000004D,
SOUND_4E = 0x0000004E,
SOUND_4F = 0x0000004F,
SOUND_50 = 0x00000050,
SOUND_51 = 0x00000051,
SOUND_52 = 0x00000052,
SOUND_53 = 0x00000053,
SOUND_54 = 0x00000054,
SOUND_55 = 0x00000055,
SOUND_56 = 0x00000056,
SOUND_57 = 0x00000057,
SOUND_58 = 0x00000058,
SOUND_59 = 0x00000059,
SOUND_5A = 0x0000005A,
SOUND_5B = 0x0000005B,
SOUND_5C = 0x0000005C,
SOUND_5D = 0x0000005D,
SOUND_5E = 0x0000005E,
SOUND_5F = 0x0000005F,
SOUND_60 = 0x00000060,
SOUND_61 = 0x00000061,
SOUND_62 = 0x00000062,
SOUND_64 = 0x00000064,
@ -588,6 +604,7 @@ enum SoundIDs {
SOUND_6B = 0x0000006B,
SOUND_6C = 0x0000006C,
SOUND_6D = 0x0000006D,
SOUND_70 = 0x00000070,
SOUND_71 = 0x00000071,
SOUND_72 = 0x00000072,
SOUND_73 = 0x00000073,
@ -606,15 +623,20 @@ enum SoundIDs {
SOUND_8D = 0x0000008D,
SOUND_8E = 0x0000008E,
SOUND_8F = 0x0000008F,
SOUND_91 = 0x00000091,
SOUND_92 = 0x00000092,
SOUND_93 = 0x00000093,
SOUND_94 = 0x00000094,
SOUND_95 = 0x00000095,
SOUND_96 = 0x00000096,
SOUND_97 = 0x00000097,
SOUND_98 = 0x00000098,
SOUND_99 = 0x00000099,
SOUND_9B = 0x0000009B,
SOUND_9D = 0x0000009D,
SOUND_9E = 0x0000009E,
SOUND_9F = 0x0000009F,
SOUND_A0 = 0x000000A0,
SOUND_A1 = 0x000000A1,
SOUND_A2 = 0x000000A2,
SOUND_A3 = 0x000000A3,
@ -627,12 +649,17 @@ enum SoundIDs {
SOUND_AA = 0x000000AA,
SOUND_AB = 0x000000AB,
SOUND_AC = 0x000000AC,
SOUND_AD = 0x000000AD,
SOUND_AE = 0x000000AE,
SOUND_AF = 0x000000AF,
SOUND_B0 = 0x000000B0,
SOUND_B1 = 0x000000B1,
SOUND_B2 = 0x000000B2,
SOUND_B4 = 0x000000B4,
SOUND_BOO_VANISH = 0x000000C1,
SOUND_C2 = 0x000000C2,
SOUND_BOO_APPEAR = 0x000000C3,
SOUND_C4 = 0x000000C4,
SOUND_MENU_OPEN = 0x000000C5,
SOUND_MENU_CLOSE = 0x000000C6,
SOUND_MENU_CHANGE_SELECTION = 0x000000C7,
@ -716,6 +743,7 @@ enum SoundIDs {
SOUND_161 = 0x00000161,
SOUND_162 = 0x00000162,
SOUND_ENTER_PIPE = 0x00000163,
SOUND_164 = 0x00000164,
SOUND_SMASH_GOOMNUT_TREE = 0x00000165,
SOUND_SHAKE_TREE = 0x00000166,
SOUND_167 = 0x00000167,
@ -725,6 +753,8 @@ enum SoundIDs {
SOUND_174 = 0x00000174,
SOUND_175 = 0x00000175,
SOUND_176 = 0x00000176,
SOUND_179 = 0x00000179,
SOUND_17A = 0x0000017A,
SOUND_17B = 0x0000017B,
SOUND_17C = 0x0000017C,
SOUND_17D = 0x0000017D,
@ -738,6 +768,7 @@ enum SoundIDs {
SOUND_186 = 0x00000186,
SOUND_187 = 0x00000187,
SOUND_188 = 0x00000188,
SOUND_189 = 0x00000189,
SOUND_18A = 0x0000018A,
SOUND_18C = 0x0000018C,
SOUND_18D = 0x0000018D,
@ -746,6 +777,10 @@ enum SoundIDs {
SOUND_191 = 0x00000191,
SOUND_193 = 0x00000193,
SOUND_194 = 0x00000194,
SOUND_197 = 0x00000197,
SOUND_198 = 0x00000198,
SOUND_199 = 0x00000199,
SOUND_19A = 0x0000019A,
SOUND_19B = 0x0000019B,
SOUND_19C = 0x0000019C,
SOUND_19D = 0x0000019D,
@ -767,6 +802,9 @@ enum SoundIDs {
SOUND_1AD = 0x000001AD,
SOUND_1AE = 0x000001AE,
SOUND_1AF = 0x000001AF,
SOUND_1B1 = 0x000001B1,
SOUND_1B2 = 0x000001B2,
SOUND_1B3 = 0x000001B3,
SOUND_BASIC_DOOR_OPEN = 0x000001C1,
SOUND_BASIC_DOOR_CLOSE = 0x000001C2,
SOUND_METAL_DOOR_OPEN = 0x000001C3,
@ -779,6 +817,8 @@ enum SoundIDs {
SOUND_METAL_GATE_CLOSE = 0x000001CA,
SOUND_1CB = 0x000001CB,
SOUND_1CC = 0x000001CC,
SOUND_1CD = 0x000001CD,
SOUND_1CE = 0x000001CE,
SOUND_1CF = 0x000001CF,
SOUND_1D0 = 0x000001D0,
SOUND_1D1 = 0x000001D1,
@ -819,6 +859,8 @@ enum SoundIDs {
SOUND_1F5 = 0x000001F5,
SOUND_1F9 = 0x000001F9,
SOUND_1FA = 0x000001FA,
SOUND_1FB = 0x000001FB,
SOUND_1FC = 0x000001FC,
SOUND_1FD = 0x000001FD,
SOUND_1FE = 0x000001FE,
SOUND_1FF = 0x000001FF,
@ -847,6 +889,7 @@ enum SoundIDs {
SOUND_21B = 0x0000021B,
SOUND_21C = 0x0000021C,
SOUND_MENU_ERROR = 0x0000021D,
SOUND_221 = 0x00000221,
SOUND_222 = 0x00000222,
SOUND_223 = 0x00000223,
SOUND_225 = 0x00000225,
@ -858,6 +901,8 @@ enum SoundIDs {
SOUND_22B = 0x0000022B,
SOUND_22C = 0x0000022C,
SOUND_22D = 0x0000022D,
SOUND_22E = 0x0000022E,
SOUND_22F = 0x0000022F,
SOUND_230 = 0x00000230,
SOUND_231 = 0x00000231,
SOUND_233 = 0x00000233,
@ -885,6 +930,11 @@ enum SoundIDs {
SOUND_26A = 0x0000026A,
SOUND_26B = 0x0000026B,
SOUND_26C = 0x0000026C,
SOUND_271 = 0x00000271,
SOUND_273 = 0x00000273,
SOUND_274 = 0x00000274,
SOUND_275 = 0x00000275,
SOUND_276 = 0x00000276,
SOUND_281 = 0x00000281,
SOUND_282 = 0x00000282,
SOUND_283 = 0x00000283,
@ -918,6 +968,7 @@ enum SoundIDs {
SOUND_2A4 = 0x000002A4,
SOUND_2A6 = 0x000002A6,
SOUND_2A7 = 0x000002A7,
SOUND_2A8 = 0x000002A8,
SOUND_2AA = 0x000002AA,
SOUND_UNUSED_2C1 = 0x000002C1,
SOUND_2C4 = 0x000002C4,
@ -963,8 +1014,10 @@ enum SoundIDs {
SOUND_2EF = 0x000002EF,
SOUND_2F0 = 0x000002F0,
SOUND_2F1 = 0x000002F1,
SOUND_2F2 = 0x000002F2,
SOUND_2F3 = 0x000002F3,
SOUND_2F4 = 0x000002F4,
SOUND_2F5 = 0x000002F5,
SOUND_TWEESTER_LAUNCH = 0x000002F6,
SOUND_2F7 = 0x000002F7,
SOUND_2F8 = 0x000002F8,
@ -989,6 +1042,16 @@ enum SoundIDs {
SOUND_311 = 0x00000311,
SOUND_312 = 0x00000312,
SOUND_315 = 0x00000315,
SOUND_316 = 0x00000316,
SOUND_317 = 0x00000317,
SOUND_318 = 0x00000318,
SOUND_319 = 0x00000319,
SOUND_31A = 0x0000031A,
SOUND_31B = 0x0000031B,
SOUND_31C = 0x0000031C,
SOUND_31D = 0x0000031D,
SOUND_31E = 0x0000031E,
SOUND_31F = 0x0000031F,
SOUND_BURROW_SURFACE = 0x00000321,
SOUND_BURROW_DIG = 0x00000322,
SOUND_MOLE_POP = 0x00000323,
@ -998,10 +1061,24 @@ enum SoundIDs {
SOUND_32C = 0x0000032C,
SOUND_32E = 0x0000032E,
SOUND_32F = 0x0000032F,
SOUND_330 = 0x00000330,
SOUND_331 = 0x00000331,
SOUND_332 = 0x00000332,
SOUND_333 = 0x00000333,
SOUND_334 = 0x00000334,
SOUND_335 = 0x00000335,
SOUND_336 = 0x00000336,
SOUND_337 = 0x00000337,
SOUND_338 = 0x00000338,
SOUND_339 = 0x00000339,
SOUND_33A = 0x0000033A,
SOUND_33B = 0x0000033B,
SOUND_33C = 0x0000033C,
SOUND_33D = 0x0000033D,
SOUND_33E = 0x0000033E,
SOUND_33F = 0x0000033F,
SOUND_340 = 0x00000340,
SOUND_341 = 0x00000341,
SOUND_342 = 0x00000342,
SOUND_343 = 0x00000343,
SOUND_344 = 0x00000344,
@ -1033,6 +1110,7 @@ enum SoundIDs {
SOUND_368 = 0x00000368,
SOUND_369 = 0x00000369,
SOUND_36B = 0x0000036B,
SOUND_36C = 0x0000036C,
SOUND_36D = 0x0000036D,
SOUND_36E = 0x0000036E,
SOUND_36F = 0x0000036F,
@ -1059,6 +1137,7 @@ enum SoundIDs {
SOUND_385 = 0x00000385,
SOUND_386 = 0x00000386,
SOUND_387 = 0x00000387,
SOUND_388 = 0x00000388,
SOUND_389 = 0x00000389,
SOUND_38A = 0x0000038A,
SOUND_38B = 0x0000038B,
@ -1066,6 +1145,7 @@ enum SoundIDs {
SOUND_38D = 0x0000038D,
SOUND_38E = 0x0000038E,
SOUND_390 = 0x00000390,
SOUND_391 = 0x00000391,
SOUND_392 = 0x00000392,
SOUND_393 = 0x00000393,
SOUND_394 = 0x00000394,
@ -1078,6 +1158,7 @@ enum SoundIDs {
SOUND_39B = 0x0000039B,
SOUND_39C = 0x0000039C,
SOUND_39D = 0x0000039D,
SOUND_39E = 0x0000039E,
SOUND_39F = 0x0000039F,
SOUND_3A0 = 0x000003A0,
SOUND_3A2 = 0x000003A2,
@ -1100,6 +1181,8 @@ enum SoundIDs {
SOUND_3B3 = 0x000003B3,
SOUND_3B4 = 0x000003B4,
SOUND_3B5 = 0x000003B5,
SOUND_3B6 = 0x000003B6,
SOUND_3B7 = 0x000003B7,
SOUND_3B9 = 0x000003B9,
SOUND_3BB = 0x000003BB,
SOUND_3BC = 0x000003BC,
@ -1155,28 +1238,6 @@ enum SoundIDs {
SOUND_THROW = 0x000003FA,
SOUND_3FB = 0x000003FB,
SOUND_3FC = 0x000003FC,
SOUND_433 = 0x00000433,
SOUND_443 = 0x00000443,
SOUND_453 = 0x00000453,
SOUND_491 = 0x00000491,
SOUND_4A3 = 0x000004A3,
SOUND_4A4 = 0x000004A4,
SOUND_4A5 = 0x000004A5,
SOUND_57C = 0x0000057C,
SOUND_607 = 0x00000607,
SOUND_62A = 0x0000062A,
SOUND_62B = 0x0000062B,
SOUND_648 = 0x00000648,
SOUND_649 = 0x00000649,
SOUND_694 = 0x00000694,
SOUND_6A2 = 0x000006A2,
SOUND_749 = 0x00000749,
SOUND_759 = 0x00000759,
SOUND_76D = 0x0000076D,
SOUND_791 = 0x00000791,
SOUND_7BC = 0x000007BC,
SOUND_7BD = 0x000007BD,
SOUND_B88 = 0x00000B88,
SOUND_2003 = 0x00002003,
SOUND_2004 = 0x00002004,
SOUND_2005 = 0x00002005,
@ -1225,13 +1286,17 @@ enum SoundIDs {
SOUND_2037 = 0x00002037,
SOUND_2038 = 0x00002038,
SOUND_2039 = 0x00002039,
SOUND_203A = 0x0000203A,
SOUND_203B = 0x0000203B,
SOUND_203C = 0x0000203C,
SOUND_203D = 0x0000203D,
SOUND_203E = 0x0000203E,
SOUND_203F = 0x0000203F,
SOUND_2040 = 0x00002040,
SOUND_2041 = 0x00002041,
SOUND_2042 = 0x00002042,
SOUND_2043 = 0x00002043,
SOUND_2044 = 0x00002044,
SOUND_2045 = 0x00002045,
SOUND_2046 = 0x00002046,
SOUND_2047 = 0x00002047,
@ -1270,6 +1335,7 @@ enum SoundIDs {
SOUND_2075 = 0x00002075,
SOUND_BOMB_BLAST = 0x00002076,
SOUND_2078 = 0x00002078,
SOUND_2079 = 0x00002079,
SOUND_207A = 0x0000207A,
SOUND_207B = 0x0000207B,
SOUND_207C = 0x0000207C,
@ -1414,8 +1480,7 @@ enum SoundIDs {
SOUND_212C = 0x0000212C,
SOUND_212D = 0x0000212D,
SOUND_212E = 0x0000212E,
SOUND_8161 = 0x00008161,
// looping sounds
SOUND_80000000 = 0x80000000,
SOUND_80000001 = 0x80000001,
SOUND_80000002 = 0x80000002,
@ -1509,10 +1574,13 @@ enum SoundIDs {
SOUND_8000006A = 0x8000006A,
SOUND_8000006B = 0x8000006B,
SOUND_8000006C = 0x8000006C,
// exit doors
SOUND_DOOR_OPEN = 0x90000000,
SOUND_DOOR_CLOSE = 0x90000001,
// room doors
SOUND_ROOM_DOOR_OPEN = 0xA0000000,
SOUND_ROOM_DOOR_CLOSE = 0xA0000001,
// alternating sounds
SOUND_FIRE_BAR_0 = 0xB0000000,
SOUND_FIRE_BAR_1 = 0xB0000001,
SOUND_FIRE_BAR_2 = 0xB0000002,
@ -1545,12 +1613,6 @@ enum SoundIDs {
SOUND_B0000021 = 0xB0000021,
};
enum SoundInstanceFlags {
SOUND_INSTANCE_FLAG_1 = 0x00000001,
SOUND_INSTANCE_FLAG_2 = 0x00000002,
SOUND_INSTANCE_FLAG_4 = 0x00000004,
};
enum SoundSpatializationFlags {
SOUND_SPACE_MODE_MASK = 0x0000FFFF,
SOUND_SPACE_MODE_0 = 0x00000000,
@ -1575,9 +1637,17 @@ enum SoundType {
};
enum SoundIDBits {
SOUND_ID_10000 = 0x00010000,
SOUND_ID_STOP = 0x00008000,
SOUND_ID_LOWER = 0x000023FF,
SOUND_ID_MID = 0x00000C00,
SOUND_ID_ADJUST = 0x00001000,
SOUND_ID_TRIGGER_MASK = 0x00000C00,
SOUND_ID_TRIGGER_CHANGE_SOUND = 0x00000400,
SOUND_ID_TRIGGER_CHANGE_VOLUME = 0x00000800,
};
enum SoundTriggers {
SOUND_TRIGGER_CHANGE_SOUND = 1,
SOUND_TRIGGER_CHANGE_VOLUME = 2,
};
typedef enum AuResult {
@ -3377,7 +3447,7 @@ enum NpcFlags {
NPC_FLAG_MOTION_BLUR = 0x00100000, ///< Gives motion blur effect as NPC moves. Set by enable_npc_blur
NPC_FLAG_200000 = 0x00200000,
NPC_FLAG_400000 = 0x00400000,
NPC_FLAG_HIDING = 0x00800000,
NPC_FLAG_HIDING = 0x00800000,
NPC_FLAG_1000000 = 0x01000000, // TODO. fails assert in set_npc_sprite
NPC_FLAG_SIMPLIFIED_PHYSICS = 0x02000000,
/// Use simpler, faster physics calculations:
@ -4898,8 +4968,8 @@ enum MapRoomNotifications {
ROOM_UPDATE_ENTER_BEGIN = 0,
ROOM_UPDATE_ENTER_DONE = 1,
ROOM_UPDATE_EXIT_BEGIN = 2,
ROOM_UPDATE_EXIT_END = 3,
// when handling ROOM_UPDATE_ENTER_BEGIN, listener may return this to cancel the door opening. useful for locked doors.
ROOM_UPDATE_EXIT_END = 3,
// when handling ROOM_UPDATE_ENTER_BEGIN, listener may return this to cancel the door opening. useful for locked doors.
ROOM_UPDATE_REQUEST_CANCEL = -1,
// anim move door updates
ROOM_MOVE_DOOR_ENTER_OPEN = 0,

View File

@ -202,6 +202,7 @@ ApiStatus FullyRestoreSP(Evt* script, s32 isInitialCall);
ApiStatus EnablePartner(Evt* script, s32 isInitialCall);
ApiStatus DisablePartner(Evt* script, s32 isInitialCall);
ApiStatus UseEntryHeading(Evt* script, s32 isInitialCall);
ApiStatus func_802D2148(Evt* script, s32 isInitialCall);
ApiStatus UseExitHeading(Evt* script, s32 isInitialCall);
ApiStatus InitVirtualEntityList(Evt* script, s32 isInitialCall);
ApiStatus DisablePulseStone(Evt* script, s32 isInitialCall);

View File

@ -26,11 +26,11 @@ s32 calc_item_check_hit(void) {
return HIT_RESULT_MISS;
}
if (actor->stoneStatus == STATUS_STONE) {
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
return HIT_RESULT_IMMUNE;
}
if ((battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP) && (actorPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP)) {
sfx_play_sound_at_position(SOUND_HIT_NORMAL, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_NORMAL, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
return HIT_RESULT_LANDED_ON_SPIKE;
}
} else {
@ -114,7 +114,7 @@ s32 calc_item_damage_enemy(void) {
}
if (target->stoneStatus == STATUS_STONE) {
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_8024EFE0(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 1);
show_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 0);
@ -156,7 +156,7 @@ s32 calc_item_damage_enemy(void) {
ret = 2;
if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) {
dispatchEvent = EVENT_SCRIPTED_IMMUNE;
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
battleStatus->lastAttackDamage = 0;
} else {
dispatchEvent = EVENT_SCRIPTED_IMMUNE;
@ -183,7 +183,7 @@ s32 calc_item_damage_enemy(void) {
if (targetPart->flags & ACTOR_PART_FLAG_2000) {
dispatch_event_actor(target, dispatchEvent);
func_8024EFE0(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 3);
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
return 2;
}
if (battleStatus->currentAttackElement & DAMAGE_TYPE_2000) {
@ -381,7 +381,7 @@ s32 calc_item_damage_enemy(void) {
ret = 0;
sp1C = TRUE;
gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE | BS_FLAGS1_10 | BS_FLAGS1_8 | BS_FLAGS1_ACTORS_VISIBLE;
sfx_play_sound_at_position(SOUND_231, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_231, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
wasStatusInflicted = TRUE;
gBattleStatus.flags1 |= BS_FLAGS1_40;
} else {
@ -397,7 +397,7 @@ s32 calc_item_damage_enemy(void) {
((gBattleStatus.flags1 & (BS_FLAGS1_40 | BS_FLAGS1_200)) && !(gBattleStatus.flags1 & BS_FLAGS1_80))
) {
if (battleStatus->lastAttackDamage > 0) {
sfx_play_sound_at_position(SOUND_231, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_231, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->lastAttackDamage > 0 || (battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS) && sp1C) {
@ -441,18 +441,18 @@ s32 calc_item_damage_enemy(void) {
if (battleStatus->lastAttackDamage > 0 && !sp18) {
func_80267018(target, 1);
if (isFireDamage) {
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else if (isElectricDamage) {
sfx_play_sound_at_position(SOUND_HIT_SHOCK, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else if (isIceDamage) {
sfx_play_sound_at_position(SOUND_HIT_ICE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_ICE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else {
sfx_play_sound_at_position(SOUND_HIT_NORMAL, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_NORMAL, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
}
if ((battleStatus->lastAttackDamage <= 0 && !wasStatusInflicted) || (targetPart->flags & ACTOR_FLAG_2000)) {
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP) && wasStatusInflicted) {
@ -460,35 +460,35 @@ s32 calc_item_damage_enemy(void) {
script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY) && wasStatusInflicted) {
script = start_script(&DoDizzyHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE) && wasStatusInflicted) {
script = start_script(&DoParalyzeHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_POISON) && wasStatusInflicted) {
script = start_script(&DoPoisonHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_STOP) && wasStatusInflicted) {
script = start_script(&DoStopHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN) && wasStatusInflicted) {
script = start_script(&DoFreezeHit, EVT_PRIORITY_A, 0);
@ -496,7 +496,7 @@ s32 calc_item_damage_enemy(void) {
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
script->varTablePtr[3] = target;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK) && wasStatusInflicted) {
script = start_script(&DoShrinkHit, EVT_PRIORITY_A, 0);
@ -504,10 +504,10 @@ s32 calc_item_damage_enemy(void) {
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
script->varTablePtr[3] = target;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackElement & DAMAGE_TYPE_SMASH) && (target->actorType == ACTOR_TYPE_GOOMNUT_TREE)) {
sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
func_80266ADC(target);

View File

@ -397,7 +397,7 @@ ApiStatus PlaySoundAtActor(Evt* script, s32 isInitialCall) {
}
actor = get_actor(actorID);
sfx_play_sound_at_position(soundID, 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(soundID, SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
return ApiStatus_DONE2;
}
@ -414,7 +414,7 @@ ApiStatus PlaySoundAtPart(Evt* script, s32 isInitialCall) {
}
part = get_actor_part(get_actor(actorID), partIndex);
sfx_play_sound_at_position(soundID, 0, part->currentPos.x, part->currentPos.y, part->currentPos.z);
sfx_play_sound_at_position(soundID, SOUND_SPACE_MODE_0, part->currentPos.x, part->currentPos.y, part->currentPos.z);
return ApiStatus_DONE2;
}
@ -432,7 +432,7 @@ ApiStatus PlayLoopingSoundAtActor(Evt* script, s32 isInitialCall) {
actor = get_actor(actorID);
actor->loopingSoundID[idx] = soundID;
sfx_play_sound_at_position(soundID, 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(soundID, SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
return ApiStatus_DONE2;
}

View File

@ -980,7 +980,7 @@ void btl_state_update_celebration(void) {
if (battleStatus->currentButtonsPressed & BUTTON_A) {
if (!CantLevelUpStat[battleStatus->currentSubmenu]) {
sfx_play_sound(SOUND_MENU_NEXT);
sfx_play_sound(SOUND_749);
sfx_play_sound(SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND);
gBattleSubState = BTL_SUBSTATE_CELEBRATE_LEVEL_UP_UPGRADE;
} else {
sfx_play_sound(SOUND_MENU_ERROR);

View File

@ -202,19 +202,19 @@ s32 calc_player_test_enemy(void) {
{
return HIT_RESULT_MISS;
} else if (target->stoneStatus == STATUS_STONE) {
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
return HIT_RESULT_IMMUNE;
} else if ((battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP) && (part->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP) &&
!player_team_is_ability_active(player, ABILITY_SPIKE_SHIELD))
{
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
return HIT_RESULT_LANDED_ON_SPIKE;
} else if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_JUMP)) &&
(part->eventFlags & ACTOR_EVENT_FLAG_SPIKY_FRONT) &&
(!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_4) &&
!player_team_is_ability_active(player, ABILITY_SPIKE_SHIELD)))
{
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_player_1(1, EVENT_SPIKE_CONTACT);
dispatch_event_actor(target, EVENT_SPIKE_TAUNT);
return HIT_RESULT_TRIGGERED_EXPLODE;
@ -292,7 +292,7 @@ s32 calc_player_damage_enemy(void) {
}
if (target->stoneStatus == STATUS_STONE) {
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_8024EFE0(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 1);
show_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 0);
return (gBattleStatus.flags1 & (BS_FLAGS1_200 | BS_FLAGS1_40)) ? 1 : 0;
@ -306,7 +306,7 @@ s32 calc_player_damage_enemy(void) {
player_team_is_ability_active(player, ABILITY_SPIKE_SHIELD)) {
if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH))) {
if (targetPart->eventFlags & ACTOR_EVENT_FLAG_8000) {
sfx_play_sound_at_position(SOUND_HIT_PLAYER_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_player_1(1, EVENT_BURN_CONTACT);
dispatch_event_actor(target, EVENT_EXPLODE_TRIGGER);
return -1;
@ -314,7 +314,7 @@ s32 calc_player_damage_enemy(void) {
if (targetPart->eventFlags & ACTOR_EVENT_FLAG_FIREY && !(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_10) &&
!(player_team_is_ability_active(player, ABILITY_FIRE_SHIELD)) && !(player_team_is_ability_active(player, ABILITY_ICE_POWER))) {
sfx_play_sound_at_position(SOUND_HIT_PLAYER_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_player_1(1, EVENT_BURN_CONTACT);
dispatch_event_actor(target, EVENT_BURN_TAUNT);
return -1;
@ -323,7 +323,7 @@ s32 calc_player_damage_enemy(void) {
if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE && battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE &&
targetPart->eventFlags & (ACTOR_EVENT_FLAG_400 | ACTOR_EVENT_FLAG_EXPLOSIVE)) {
sfx_play_sound_at_position(SOUND_HIT_PLAYER_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_event_actor(target, EVENT_EXPLODE_TRIGGER);
return (gBattleStatus.flags1 & (BS_FLAGS1_200 | BS_FLAGS1_40)) ? 1 : 0;
}
@ -331,13 +331,13 @@ s32 calc_player_damage_enemy(void) {
if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH)) &&
targetPart->eventFlags & ACTOR_EVENT_FLAG_200000 &&
!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_80) && !(player_team_is_ability_active(player, ABILITY_SPIKE_SHIELD))) {
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_player_1(1, EVENT_SPIKE_CONTACT);
dispatch_event_actor(target, EVENT_SPIKE_TAUNT);
return -1;
}
} else {
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_player_1(1, EVENT_SPIKE_CONTACT);
dispatch_event_actor(target, EVENT_SPIKE_TAUNT);
return -1;
@ -370,22 +370,22 @@ s32 calc_player_damage_enemy(void) {
switch (attackFxType) {
case 1:
sfx_play_sound_at_position(SOUND_372, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_372, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
break;
case 2:
sfx_play_sound_at_position(SOUND_F1, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_F1, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
break;
case 3:
sfx_play_sound_at_position(SOUND_DC, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_DC, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
break;
case 4:
sfx_play_sound_at_position(SOUND_2072, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_2072, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
break;
case 5:
sfx_play_sound_at_position(SOUND_2073, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_2073, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
break;
case 6:
sfx_play_sound_at_position(SOUND_205B, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_205B, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
break;
}
}
@ -561,7 +561,7 @@ s32 calc_player_damage_enemy(void) {
if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) {
dispatchEvent = EVENT_SCRIPTED_IMMUNE;
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else {
dispatchEvent = (target->currentHP <= 0) ? EVENT_DEATH : EVENT_SCRIPTED_IMMUNE;
}
@ -593,12 +593,12 @@ s32 calc_player_damage_enemy(void) {
!(targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED)) || battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT ||
battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_8 || battleStatus->currentAttackElement & DAMAGE_TYPE_ELECTRIC) {
dispatchEvent = (!(gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE)) ? EVENT_SCRIPTED_IMMUNE : EVENT_IMMUNE;
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_event_actor(target, dispatchEvent);
func_8024EFE0(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 3);
return (gBattleStatus.flags1 & (BS_FLAGS1_200 | BS_FLAGS1_40)) ? 1 : 0;
} else {
sfx_play_sound_at_position(SOUND_HIT_PLAYER_SHOCK, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_80251474(player);
dispatch_damage_event_player_1(1, EVENT_SHOCK_HIT);
return -1;
@ -829,7 +829,7 @@ s32 calc_player_damage_enemy(void) {
if (tempBinary && gBattleStatus.flags1 & BS_FLAGS1_40 || gBattleStatus.flags1 & BS_FLAGS1_40) {
if (!(gBattleStatus.flags1 & BS_FLAGS1_80)) {
if (player->actorTypeData1[5]) {
sfx_play_sound_at_position(player->actorTypeData1[5], 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(player->actorTypeData1[5], SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->lastAttackDamage > 0 && (sfx_play_sound(SOUND_231), battleStatus->lastAttackDamage > 0) || // TODO remove sfx_play_sound from conditional
@ -857,19 +857,19 @@ s32 calc_player_damage_enemy(void) {
func_80267018(target, 1);
if (isFireDamage) {
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else if (isElectricDamage) {
sfx_play_sound_at_position(SOUND_HIT_SHOCK, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else if (isIceDamage) {
sfx_play_sound_at_position(SOUND_HIT_ICE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_ICE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else {
sfx_play_sound_at_position(SOUND_HIT_NORMAL, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_NORMAL, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
}
}
if (battleStatus->lastAttackDamage <= 0 && !tempBinary && !sp20 || targetPart->flags & ACTOR_PART_FLAG_2000) {
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP && wasStatusInflicted) {
@ -877,7 +877,7 @@ s32 calc_player_damage_enemy(void) {
evt->varTable[0] = state->goalPos.x;
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY && wasStatusInflicted) {
@ -885,7 +885,7 @@ s32 calc_player_damage_enemy(void) {
evt->varTable[0] = state->goalPos.x;
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE && wasStatusInflicted) {
@ -893,7 +893,7 @@ s32 calc_player_damage_enemy(void) {
evt->varTable[0] = state->goalPos.x;
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_POISON && wasStatusInflicted) {
@ -901,7 +901,7 @@ s32 calc_player_damage_enemy(void) {
evt->varTable[0] = state->goalPos.x;
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_STOP && wasStatusInflicted) {
@ -909,7 +909,7 @@ s32 calc_player_damage_enemy(void) {
evt->varTable[0] = state->goalPos.x;
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN && wasStatusInflicted) {
@ -918,7 +918,7 @@ s32 calc_player_damage_enemy(void) {
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
evt->varTablePtr[3] = target;
sfx_play_sound_at_position(SOUND_HIT_PLAYER_ICE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_ICE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK && wasStatusInflicted) {
@ -927,11 +927,11 @@ s32 calc_player_damage_enemy(void) {
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
evt->varTablePtr[3] = target;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackElement & DAMAGE_TYPE_SMASH && target->actorType == ACTOR_TYPE_GOOMNUT_TREE) {
sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
func_80266ADC(target);
@ -950,7 +950,7 @@ s32 calc_player_damage_enemy(void) {
targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED) &&
!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_ELECTRIC)) &&
!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_8)) {
sfx_play_sound_at_position(SOUND_HIT_PLAYER_SHOCK, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_80251474(player);
dispatch_damage_event_player_1(1, EVENT_SHOCK_HIT);
return -1;
@ -1016,7 +1016,7 @@ s32 dispatch_damage_event_player(s32 damageAmount, s32 event, s32 arg2) {
if (!arg2) {
set_goal_pos_to_part(state, ACTOR_PLAYER, 0);
sfx_play_sound_at_position(SOUND_HIT_NORMAL, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_NORMAL, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
show_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 1);
@ -1108,7 +1108,7 @@ ApiStatus func_80273444(Evt* script, s32 isInitialCall) {
playerState->unk_28 = 180 / playerState->moveTime;
playerState->unk_2C = playerState->goalPos.y;
if (script->functionTemp[1] != 2) {
sfx_play_sound_at_position(SOUND_160, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
}
script->functionTemp[0] = TRUE;
}
@ -1153,7 +1153,7 @@ ApiStatus func_80273444(Evt* script, s32 isInitialCall) {
play_movement_dust_effects(2, player->currentPos.x, player->currentPos.y, player->currentPos.z, player->yaw);
}
if (script->functionTemp[1] != 2) {
sfx_play_sound_at_position(SOUND_SOFT_LAND, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
}
return ApiStatus_DONE1;
@ -1221,7 +1221,7 @@ ApiStatus PlayerFallToGoal(Evt* script, s32 isInitialCall) {
player->currentPos.y = state->goalPos.y;
player->currentPos.z = state->goalPos.z;
play_movement_dust_effects(2, player->currentPos.x, player->currentPos.y, player->currentPos.z, player->yaw);
sfx_play_sound_at_position(SOUND_SOFT_LAND, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
return ApiStatus_DONE1;
}
return ApiStatus_BLOCK;
@ -1267,7 +1267,7 @@ ApiStatus PlayerLandJump(Evt *script, s32 isInitialCall) {
player->currentPos.y = 0.0f;
play_movement_dust_effects(2, player->currentPos.x, player->currentPos.y, player->currentPos.z, player->yaw);
sfx_play_sound_at_position(SOUND_SOFT_LAND, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
return ApiStatus_DONE1;
}
@ -1329,9 +1329,9 @@ ApiStatus PlayerRunToGoal(Evt* script, s32 isInitialCall) {
player->footStepCounter++;
playerState->distance = 0.0f;
if ((player->footStepCounter % 2) != 0) {
sfx_play_sound_at_position(SOUND_STEP_NORMAL1, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_STEP_NORMAL1, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
} else {
sfx_play_sound_at_position(SOUND_STEP_NORMAL2, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_STEP_NORMAL2, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
}
}
@ -1404,9 +1404,9 @@ ApiStatus CancelablePlayerRunToGoal(Evt* script, s32 isInitialCall) {
player->footStepCounter++;
playerState->distance = 0.0f;
if ((player->footStepCounter % 2) != 0) {
sfx_play_sound_at_position(SOUND_STEP_NORMAL1, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_STEP_NORMAL1, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
} else {
sfx_play_sound_at_position(SOUND_STEP_NORMAL2, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_STEP_NORMAL2, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
}
}
@ -1776,7 +1776,7 @@ ApiStatus func_80274A18(Evt* script, s32 isInitialCall) {
playerState->velocity = vel2 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.8 * acc2) + acc2);
}
set_animation(0, 0, playerState->animJumpRise);
sfx_play_sound_at_position(SOUND_160, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
script->functionTemp[0] = 1;
}
@ -1917,7 +1917,7 @@ ApiStatus func_802752AC(Evt* script, s32 isInitialCall) {
playerState->velocity = 0.0f;
playerState->speed += temp / playerState->moveTime;
set_animation(ACTOR_PLAYER, 0, playerState->animJumpRise);
sfx_play_sound_at_position(SOUND_160, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
playerState->unk_24 = 90.0f;
playerState->bounceDivisor = 45.0f;
playerState->unk_28 = 360 / playerState->moveTime;
@ -2021,7 +2021,7 @@ ApiStatus func_802752AC(Evt* script, s32 isInitialCall) {
playerState->unk_24 = clamp_angle(playerState->unk_24);
playerState->moveTime--;
if (playerState->moveTime == 0) {
sfx_play_sound_at_position(SOUND_160, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
set_animation(ACTOR_PLAYER, 0, playerState->animJumpFall);
player->rotationPivotOffset.y = 14;
player->rotation.z -= 66.0f;
@ -2161,8 +2161,8 @@ ApiStatus func_80275F00(Evt* script, s32 isInitialCall) {
playerState->unk_30.z = (playerState->goalPos.z - playerState->currentPos.z) / playerState->moveTime;
playerState->speed += temp / playerState->moveTime;
set_animation(ACTOR_PLAYER, 0, playerState->animJumpFall);
sfx_play_sound_at_position(SOUND_160, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_TORNADO_JUMP, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_TORNADO_JUMP, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
playerState->unk_18.x = 0.0f;
playerState->unk_18.y = 0.0f;
playerState->unk_24 = 90.0f;
@ -2205,8 +2205,8 @@ ApiStatus func_80275F00(Evt* script, s32 isInitialCall) {
playerState->unk_30.z = (playerState->goalPos.z - playerState->currentPos.z) / playerState->moveTime;
playerState->speed += temp / playerState->moveTime;
set_animation(ACTOR_PLAYER, 0, playerState->animJumpRise);
sfx_play_sound_at_position(SOUND_160, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_TORNADO_JUMP, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_TORNADO_JUMP, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
playerState->unk_18.x = 0.0f;
playerState->unk_18.y = 0.0f;
playerState->unk_24 = 90.0f;
@ -2260,7 +2260,7 @@ ApiStatus func_80275F00(Evt* script, s32 isInitialCall) {
playerState->unk_30.z = (playerState->goalPos.z - playerState->currentPos.z) / playerState->moveTime;
playerState->speed += temp / playerState->moveTime;
set_animation(ACTOR_PLAYER, 0, playerState->animJumpRise);
sfx_play_sound_at_position(SOUND_160, 0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
playerState->unk_24 = 90.0f;
playerState->bounceDivisor = 45.0f;
playerState->unk_28 = 360 / playerState->moveTime;

View File

@ -42,60 +42,60 @@ void play_hit_sound(Actor* actor, f32 x, f32 y, f32 z, u32 hitSound) {
switch (hitSound) {
case HIT_SOUND_MISS:
sfx_play_sound_at_position(SOUND_IMMUNE, 0, x, y, z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, x, y, z);
break;
case HIT_SOUND_BONES:
sfx_play_sound_at_position(SOUND_HIT_BONES, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_BONES, SOUND_SPACE_MODE_0, x, y, z);
break;
case HIT_SOUND_NORMAL:
switch (actorClass) {
case ACTOR_CLASS_PLAYER:
sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_PARTNER:
sfx_play_sound_at_position(SOUND_HIT_NORMAL, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_NORMAL, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_ENEMY:
sfx_play_sound_at_position(SOUND_HIT_NORMAL, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_NORMAL, SOUND_SPACE_MODE_0, x, y, z);
break;
}
break;
case HIT_SOUND_FIRE:
switch (actorClass) {
case ACTOR_CLASS_PLAYER:
sfx_play_sound_at_position(SOUND_HIT_PLAYER_FIRE, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_FIRE, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_PARTNER:
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_ENEMY:
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, x, y, z);
break;
}
break;
case HIT_SOUND_ICE:
switch (actorClass) {
case ACTOR_CLASS_PLAYER:
sfx_play_sound_at_position(SOUND_HIT_PLAYER_ICE, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_ICE, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_PARTNER:
sfx_play_sound_at_position(SOUND_HIT_ICE, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_ICE, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_ENEMY:
sfx_play_sound_at_position(SOUND_HIT_ICE, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_ICE, SOUND_SPACE_MODE_0, x, y, z);
break;
}
break;
case HIT_SOUND_SHOCK:
switch (actorClass) {
case ACTOR_CLASS_PLAYER:
sfx_play_sound_at_position(SOUND_HIT_PLAYER_SHOCK, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_SHOCK, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_PARTNER:
sfx_play_sound_at_position(SOUND_HIT_SHOCK, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_ENEMY:
sfx_play_sound_at_position(SOUND_HIT_SHOCK, 0, x, y, z);
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, x, y, z);
break;
}
break;
@ -425,7 +425,7 @@ s32 calc_enemy_damage_target(Actor* attacker) {
if (blocked) {
damage--;
damage -= player_team_is_ability_active(target, ABILITY_DAMAGE_DODGE);
sfx_play_sound_at_position(SOUND_231, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_231, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_802667F0(0, target, state->goalPos.x, state->goalPos.y, state->goalPos.z);
gBattleStatus.flags1 |= BS_FLAGS1_ATK_BLOCKED;
break;
@ -438,7 +438,7 @@ s32 calc_enemy_damage_target(Actor* attacker) {
if (target->koStatus == STATUS_END && !(battleStatus->currentAttackElement & DAMAGE_TYPE_UNBLOCKABLE)) {
if (check_block_input(BUTTON_A)) {
damage = 0;
sfx_play_sound_at_position(SOUND_231, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_231, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_802667F0(0, target, state->goalPos.x, state->goalPos.y, state->goalPos.z);
gBattleStatus.flags1 |= BS_FLAGS1_ATK_BLOCKED;
break;
@ -700,7 +700,7 @@ s32 calc_enemy_damage_target(Actor* attacker) {
func_80267018(target, 1);
if (attacker->actorTypeData1[5] != SOUND_0) {
sfx_play_sound_at_position(attacker->actorTypeData1[5], 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(attacker->actorTypeData1[5], SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (isFire) {
@ -715,7 +715,7 @@ s32 calc_enemy_damage_target(Actor* attacker) {
}
if ((battleStatus->lastAttackDamage <= 0 && !statusInflicted2 && !isEnchanted) || targetPart->flags & ACTOR_PART_FLAG_2000) {
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP) && statusInflicted) {
@ -723,35 +723,35 @@ s32 calc_enemy_damage_target(Actor* attacker) {
script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY) && statusInflicted) {
script = start_script(&DoDizzyHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE) && statusInflicted) {
script = start_script(&DoParalyzeHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_POISON) && statusInflicted) {
script = start_script(&DoPoisonHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_STOP) && statusInflicted) {
script = start_script(&DoStopHit, EVT_PRIORITY_A, 0);
script->varTable[0] = state->goalPos.x;
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN) && statusInflicted) {
script = start_script(&DoFreezeHit, EVT_PRIORITY_A, 0);
@ -759,7 +759,7 @@ s32 calc_enemy_damage_target(Actor* attacker) {
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
script->varTablePtr[3] = target;
sfx_play_sound_at_position(SOUND_HIT_ICE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_ICE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK) && statusInflicted) {
script = start_script(&DoShrinkHit, EVT_PRIORITY_A, 0);
@ -767,11 +767,11 @@ s32 calc_enemy_damage_target(Actor* attacker) {
script->varTable[1] = state->goalPos.y;
script->varTable[2] = state->goalPos.z;
script->varTablePtr[3] = target;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if ((battleStatus->currentAttackElement & DAMAGE_TYPE_SMASH) && target->actorType == ACTOR_TYPE_GOOMNUT_TREE) {
sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
func_80266ADC(target);
@ -785,7 +785,7 @@ s32 calc_enemy_damage_target(Actor* attacker) {
&& !has_enchanted_part(attacker)
) {
// enum mismatch? shock vs explode :raised_eyebrow:
sfx_play_sound_at_position(SOUND_HIT_SHOCK, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_80251474(attacker);
dispatch_damage_event_actor_1(attacker, 1, EVENT_SHOCK_HIT);
return HIT_RESULT_TRIGGERED_EXPLODE;
@ -1068,7 +1068,7 @@ ApiStatus JumpToGoal(Evt* script, s32 isInitialCall) {
set_animation(actor->actorID, (s8) actor->state.jumpPartIndex, actor->state.animJumpRise);
}
if (!(script->functionTemp[3] & 2) && (actor->actorTypeData1[4] != 0)) {
sfx_play_sound_at_position(actor->actorTypeData1[4], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
script->functionTemp[0] = 1;
}
@ -1254,7 +1254,7 @@ ApiStatus JumpToGoalSimple2(Evt* script, s32 isInitialCall) {
state->velocity = ((state->acceleration * state->moveTime) * 0.5f) + (posY / state->moveTime);
state->speed += moveDist / state->moveTime;
if (actor->actorTypeData1[4] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[4], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
script->functionTemp[0] = TRUE;
}
@ -1342,7 +1342,7 @@ ApiStatus JumpWithBounce(Evt* script, s32 isInitialCall) {
actorState->speed += moveDist / actorState->moveTime;
if (actor->actorTypeData1[4] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[4], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
script->functionTemp[0] = TRUE;
}
@ -1479,7 +1479,7 @@ ApiStatus FallToGoal(Evt* script, s32 isInitialCall) {
state->acceleration = (posY / state->moveTime - state->velocity) / (-state->moveTime * 0.5);
if (actor->actorTypeData1[4] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[4], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
script->functionTemp[0] = 1;
}
@ -1561,7 +1561,7 @@ ApiStatus RunToGoal(Evt* script, s32 isInitialCall) {
actorState->distance = ~actor->actorTypeData1b[0]; //TODO optimization?
}
if ((actor->actorTypeData1[0] != 0) && (actor->actorTypeData1[1] == 0)) {
sfx_play_sound_at_position(actor->actorTypeData1[0], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[0], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
script->functionTemp[0] = TRUE;
}
@ -1588,11 +1588,11 @@ ApiStatus RunToGoal(Evt* script, s32 isInitialCall) {
actorState->distance = 0.0f;
if (actor->footStepCounter & 1) {
if (actor->actorTypeData1[0] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[0], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[0], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
} else {
if (actor->actorTypeData1[1] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[1], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[1], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
}
}
@ -1603,11 +1603,11 @@ ApiStatus RunToGoal(Evt* script, s32 isInitialCall) {
actorState->distance = 0.0f;
if (actor->footStepCounter & 1) {
if (actor->actorTypeData1[0] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[0], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[0], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
} else {
if (actor->actorTypeData1[1] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[1], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[1], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
}
}
@ -1780,7 +1780,7 @@ ApiStatus JumpPartTo(Evt* script, s32 isInitialCall) {
movement->moveSpeed += deltaDist / movement->moveTime;
movement->unk_2C = movement->jumpScale * movement->moveTime * 0.5f + posY / movement->moveTime;
if (part->partTypeData[4] != 0) {
sfx_play_sound_at_position(part->partTypeData[4], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[4], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
script->functionTemp[0] = 1;
}
@ -1871,7 +1871,7 @@ ApiStatus FallPartTo(Evt* script, s32 isInitialCall) {
movement->unk_2C = 0.0f;
movement->jumpScale = (posY / movement->moveTime - movement->unk_2C) / (-movement->moveTime * 0.5);
if (part->partTypeData[4] != 0) {
sfx_play_sound_at_position(part->partTypeData[4], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[4], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
script->functionTemp[0] = 1;
}
@ -2005,7 +2005,7 @@ ApiStatus RunPartTo(Evt* script, s32 isInitialCall) {
movement->distance = ~part->actorTypeData2b[0];
}
if (part->partTypeData[0] != 0 && part->partTypeData[1] == 0) {
sfx_play_sound_at_position(part->partTypeData[0], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[0], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
script->functionTemp[0] = 1;
}
@ -2032,11 +2032,11 @@ ApiStatus RunPartTo(Evt* script, s32 isInitialCall) {
movement->distance = 0;
if (actor->footStepCounter % 2 != 0) {
if (part->partTypeData[0] != 0) {
sfx_play_sound_at_position(part->partTypeData[0], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[0], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
} else {
if (part->partTypeData[1] != 0) {
sfx_play_sound_at_position(part->partTypeData[1], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[1], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
}
}
@ -2047,11 +2047,11 @@ ApiStatus RunPartTo(Evt* script, s32 isInitialCall) {
movement->distance = 0;
if (actor->footStepCounter % 2 != 0) {
if (part->partTypeData[0] != 0) {
sfx_play_sound_at_position(part->partTypeData[0], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[0], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
} else {
if (part->partTypeData[1] != 0) {
sfx_play_sound_at_position(part->partTypeData[1], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[1], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
}
}
@ -2141,7 +2141,7 @@ ApiStatus FlyToGoal(Evt* script, s32 isInitialCall) {
actorState->velocity = ~actor->actorTypeData1b[1];
}
if ((actor->actorTypeData1[2] != 0) && (actor->actorTypeData1[3] == 0)) {
sfx_play_sound_at_position(actor->actorTypeData1[2], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[2], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
}
@ -2177,11 +2177,11 @@ ApiStatus FlyToGoal(Evt* script, s32 isInitialCall) {
actorState->velocity = 0.0f;
if (actor->footStepCounter & 1) {
if (actor->actorTypeData1[2] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[2], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[2], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
} else {
if (actor->actorTypeData1[3] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[3], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[3], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
}
}
@ -2192,11 +2192,11 @@ ApiStatus FlyToGoal(Evt* script, s32 isInitialCall) {
actorState->velocity = 0.0f;
if (actor->footStepCounter & 1) {
if (actor->actorTypeData1[2] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[2], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[2], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
} else {
if (actor->actorTypeData1[3] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[3], 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(actor->actorTypeData1[3], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
}
}
@ -2395,7 +2395,7 @@ ApiStatus FlyPartTo(Evt* script, s32 isInitialCall) {
}
if (part->partTypeData[2] != 0 && part->partTypeData[3] == 0) {
sfx_play_sound_at_position(part->partTypeData[2], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[2], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
partMovement->unk_3C = 0;
partMovement->angle = 0.0f;
@ -2433,11 +2433,11 @@ ApiStatus FlyPartTo(Evt* script, s32 isInitialCall) {
partMovement->unk_2C = 0;
if (actor->footStepCounter % 2 != 0) {
if (part->partTypeData[2] != 0) {
sfx_play_sound_at_position(part->partTypeData[2], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[2], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
} else {
if (part->partTypeData[3] != 0) {
sfx_play_sound_at_position(part->partTypeData[3], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[3], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
}
}
@ -2448,11 +2448,11 @@ ApiStatus FlyPartTo(Evt* script, s32 isInitialCall) {
partMovement->unk_2C = 0;
if (actor->footStepCounter % 2 != 0) {
if (part->partTypeData[2] != 0) {
sfx_play_sound_at_position(part->partTypeData[2], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[2], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
} else {
if (part->partTypeData[3] != 0) {
sfx_play_sound_at_position(part->partTypeData[3], 0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
sfx_play_sound_at_position(part->partTypeData[3], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
}
}

View File

@ -77,7 +77,7 @@ s32 calc_partner_test_enemy(void) {
(part->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP) &&
!(target->flags2 & ACTOR_FLAG_HP_OFFSET_BELOW))
{
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
return 4;
}
@ -86,7 +86,7 @@ s32 calc_partner_test_enemy(void) {
!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_4) &&
!player_team_is_ability_active(partner, ABILITY_SPIKE_SHIELD))
{
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT);
dispatch_event_actor(target, EVENT_SPIKE_TAUNT);
return -1;
@ -96,7 +96,7 @@ s32 calc_partner_test_enemy(void) {
(part->eventFlags & ACTOR_EVENT_FLAG_FIREY) &&
!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_10))
{
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_partner_1(1, EVENT_BURN_CONTACT);
dispatch_event_actor(target, EVENT_BURN_TAUNT);
return -1;
@ -108,7 +108,7 @@ s32 calc_partner_test_enemy(void) {
!(target->flags & ACTOR_FLAG_HP_OFFSET_BELOW) &&
!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_1))
{
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT);
dispatch_event_actor(target, EVENT_SPIKE_TAUNT);
return -1;
@ -119,7 +119,7 @@ s32 calc_partner_test_enemy(void) {
!(target->flags & ACTOR_FLAG_HP_OFFSET_BELOW) &&
!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_80))
{
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT);
dispatch_event_actor(target, EVENT_SPIKE_TAUNT);
return -1;
@ -131,7 +131,7 @@ s32 calc_partner_test_enemy(void) {
!(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) &&
!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_8))
{
sfx_play_sound_at_position(SOUND_HIT_SHOCK, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_80251474(partner);
dispatch_damage_event_partner_1(1, EVENT_SHOCK_HIT);
return -1;
@ -141,7 +141,7 @@ s32 calc_partner_test_enemy(void) {
(part->eventFlags & ACTOR_EVENT_FLAG_FIREY) &&
!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_10))
{
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_partner_1(1, EVENT_BURN_CONTACT);
dispatch_event_actor(target, EVENT_BURN_TAUNT);
return -1;
@ -193,7 +193,7 @@ s32 calc_partner_damage_enemy(void) {
if (gBattleStatus.flags1 & BS_FLAGS1_FORCE_HIT_IMMUNE) {
retVal = 2;
dispatchEvent = EVENT_SCRIPTED_IMMUNE;
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else {
if (targetPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY || target->transparentStatus == STATUS_TRANSPARENT ||
targetPart->eventFlags & ACTOR_EVENT_FLAG_800 && !(battleStatus->currentAttackElement & DAMAGE_TYPE_QUAKE)) {
@ -201,7 +201,7 @@ s32 calc_partner_damage_enemy(void) {
}
if (target->stoneStatus == STATUS_STONE) {
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_8024EFE0(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 1);
show_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 0);
return (gBattleStatus.flags1 & (BS_FLAGS1_40 | BS_FLAGS1_200)) ? 1 : 0;
@ -212,7 +212,7 @@ s32 calc_partner_damage_enemy(void) {
}
if (battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP && targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP) {
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT);
dispatch_event_actor(target, EVENT_SPIKE_TAUNT);
return -1;
@ -220,45 +220,45 @@ s32 calc_partner_damage_enemy(void) {
dispatch_event_actor(target, EVENT_EXPLODE_TRIGGER);
if (!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_2)) {
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_partner_1(1, EVENT_BURN_CONTACT);
return -1;
}
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
return (gBattleStatus.flags1 & (BS_FLAGS1_40 | BS_FLAGS1_200)) ? 1 : 0;
} else if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH)) &&
targetPart->eventFlags & ACTOR_EVENT_FLAG_FIREY && !(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_10)) {
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_partner_1(1, EVENT_BURN_CONTACT);
dispatch_event_actor(target, EVENT_BURN_TAUNT);
return -1;
} else if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_JUMP)) &&
targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_FRONT && !(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_4)) {
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT);
dispatch_event_actor(target, EVENT_SPIKE_TAUNT);
return -1;
} else if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE && battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE &&
targetPart->eventFlags & (ACTOR_EVENT_FLAG_400 | ACTOR_EVENT_FLAG_EXPLOSIVE)) {
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_event_actor(target, EVENT_EXPLODE_TRIGGER);
return (gBattleStatus.flags1 & (BS_FLAGS1_40 | BS_FLAGS1_200)) ? 1 : 0;
} else if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) && targetPart->eventFlags & ACTOR_EVENT_FLAG_200000 &&
!(target->flags & ACTOR_FLAG_HP_OFFSET_BELOW) && !(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_80)) {
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT);
dispatch_event_actor(target, EVENT_SPIKE_TAUNT);
return -1;
} else if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) && targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP &&
!(target->flags & ACTOR_FLAG_HP_OFFSET_BELOW) && !(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_1)) {
sfx_play_sound_at_position(SOUND_108, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT);
dispatch_event_actor(target, EVENT_SPIKE_TAUNT);
return -1;
} else if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE && battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE &&
targetPart->eventFlags & (ACTOR_EVENT_FLAG_400 | ACTOR_EVENT_FLAG_EXPLOSIVE)) {
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_event_actor(target, EVENT_EXPLODE_TRIGGER);
return (gBattleStatus.flags1 & (BS_FLAGS1_40 | BS_FLAGS1_200)) ? 1 : 0;
}
@ -267,7 +267,7 @@ s32 calc_partner_damage_enemy(void) {
if (partner->staticStatus != STATUS_STATIC && (target->staticStatus == STATUS_STATIC ||
targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED) && !(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) &&
!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_8)) {
sfx_play_sound_at_position(SOUND_HIT_SHOCK, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_80251474(partner);
dispatch_damage_event_partner_1(1, EVENT_SHOCK_HIT);
return -1;
@ -369,7 +369,7 @@ s32 calc_partner_damage_enemy(void) {
if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) {
retVal = 2;
dispatchEvent = EVENT_SCRIPTED_IMMUNE;
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else {
retVal = 2;
dispatchEvent = (target->currentHP <= 0) ? EVENT_DEATH : EVENT_SCRIPTED_IMMUNE;
@ -402,13 +402,13 @@ s32 calc_partner_damage_enemy(void) {
!(targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED)) || battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT ||
battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_8) {
dispatchEvent = (!(gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE)) ? EVENT_SCRIPTED_IMMUNE : EVENT_IMMUNE;
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_event_actor(target, dispatchEvent);
func_8024EFE0(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 3);
return (gBattleStatus.flags1 & (BS_FLAGS1_40 | BS_FLAGS1_200)) ? 1 : 0;
}
sfx_play_sound_at_position(SOUND_HIT_SHOCK, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_80251474(partner);
dispatch_damage_event_partner_1(1, EVENT_SHOCK_HIT);
return -1;
@ -592,7 +592,7 @@ s32 calc_partner_damage_enemy(void) {
retVal = 0;
tempBinary = TRUE;
gBattleStatus.flags1 |= (BS_FLAGS1_40 | BS_FLAGS1_SP_EVT_ACTIVE | BS_FLAGS1_10 | BS_FLAGS1_8 | BS_FLAGS1_ACTORS_VISIBLE);
sfx_play_sound_at_position(SOUND_231, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_231, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else {
dispatchEvent = EVENT_IMMUNE;
retVal = 2;
@ -634,7 +634,7 @@ s32 calc_partner_damage_enemy(void) {
retVal = 0;
tempBinary = TRUE;
gBattleStatus.flags1 |= (BS_FLAGS1_40 | BS_FLAGS1_SP_EVT_ACTIVE | BS_FLAGS1_10 | BS_FLAGS1_8 | BS_FLAGS1_ACTORS_VISIBLE);
sfx_play_sound_at_position(SOUND_231, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_231, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else {
dispatchEvent = EVENT_IMMUNE;
retVal = 2;
@ -672,7 +672,7 @@ s32 calc_partner_damage_enemy(void) {
if (tempBinary && gBattleStatus.flags1 & (BS_FLAGS1_200 | BS_FLAGS1_40) || gBattleStatus.flags1 & (BS_FLAGS1_200 | BS_FLAGS1_40) &&
!(gBattleStatus.flags1 & BS_FLAGS1_80)) {
if ((battleStatus->lastAttackDamage > 0 &&
((sfx_play_sound_at_position(SOUND_231, 0, state->goalPos.x, state->goalPos.y,
((sfx_play_sound_at_position(SOUND_231, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y,
state->goalPos.z), //TODO remove sfx_play from conditional
battleStatus->lastAttackDamage > 0))) || (battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS && tempBinary)) {
if (gBattleStatus.flags1 & BS_FLAGS1_40) {
@ -690,25 +690,25 @@ s32 calc_partner_damage_enemy(void) {
if (battleStatus->lastAttackDamage > 0) {
if (sp2C == 0) {
if (partner->actorTypeData1[5] != 0) {
sfx_play_sound_at_position(partner->actorTypeData1[5], 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(partner->actorTypeData1[5], SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
func_80267018(target, 1);
if (isFireDamage) {
sfx_play_sound_at_position(SOUND_HIT_FIRE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else if (isElectricDamage) {
sfx_play_sound_at_position(SOUND_HIT_SHOCK, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else if (isIceDamage) {
sfx_play_sound_at_position(SOUND_HIT_ICE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_ICE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
} else {
sfx_play_sound_at_position(SOUND_HIT_NORMAL, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_NORMAL, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
}
}
if (battleStatus->lastAttackDamage <= 0 && !tempBinary && !wasStatusInflicted || targetPart->flags & ACTOR_PART_FLAG_2000) {
sfx_play_sound_at_position(SOUND_IMMUNE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP && wasStatusInflicted) {
@ -716,7 +716,7 @@ s32 calc_partner_damage_enemy(void) {
evt->varTable[0] = state->goalPos.x;
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY && wasStatusInflicted) {
@ -724,7 +724,7 @@ s32 calc_partner_damage_enemy(void) {
evt->varTable[0] = state->goalPos.x;
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE && wasStatusInflicted) {
@ -732,7 +732,7 @@ s32 calc_partner_damage_enemy(void) {
evt->varTable[0] = state->goalPos.x;
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_POISON && wasStatusInflicted) {
@ -740,7 +740,7 @@ s32 calc_partner_damage_enemy(void) {
evt->varTable[0] = state->goalPos.x;
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_STOP && wasStatusInflicted) {
@ -748,7 +748,7 @@ s32 calc_partner_damage_enemy(void) {
evt->varTable[0] = state->goalPos.x;
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN && wasStatusInflicted) {
@ -757,7 +757,7 @@ s32 calc_partner_damage_enemy(void) {
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
evt->varTablePtr[3] = target;
sfx_play_sound_at_position(SOUND_HIT_ICE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_ICE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK && wasStatusInflicted) {
@ -766,11 +766,11 @@ s32 calc_partner_damage_enemy(void) {
evt->varTable[1] = state->goalPos.y;
evt->varTable[2] = state->goalPos.z;
evt->varTablePtr[3] = target;
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
if (battleStatus->currentAttackElement & DAMAGE_TYPE_SMASH && target->actorType == ACTOR_TYPE_GOOMNUT_TREE) {
sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
}
func_80266ADC(target);
@ -788,7 +788,7 @@ s32 calc_partner_damage_enemy(void) {
if (partner->staticStatus != STATUS_STATIC && (target->staticStatus == STATUS_STATIC ||
targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED) && !(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) &&
!(battleStatus->currentAttackEventSuppression & ATTACK_EVENT_FLAG_8)) {
sfx_play_sound_at_position(SOUND_HIT_SHOCK, 0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
func_80251474(partner);
dispatch_damage_event_partner_1(1, EVENT_SHOCK_HIT);
return -1;

View File

@ -532,14 +532,14 @@ s32 ai_check_player_dist(Enemy* enemy, s32 chance, f32 radius, f32 moveSpeed) {
void ai_enemy_play_sound(Npc* npc, s32 soundID, s32 upperSoundFlags) {
Enemy* enemy = get_enemy(npc->npcID);
s32 soundFlags = (upperSoundFlags & 0xFFFF0000) | 2;
s32 soundFlags = (upperSoundFlags & SOUND_SPACE_PARAMS_MASK) | SOUND_SPACE_FULL;
if (upperSoundFlags & 1) {
soundFlags |= 0x10000;
soundFlags |= SOUND_PARAM_MUTE;
}
if (enemy->npcSettings->actionFlags & AI_ACTION_20) {
soundFlags |= 0x20000;
soundFlags |= SOUND_PARAM_CLIP_OFFSCREEN_ANY;
}
sfx_play_sound_at_position(soundID, soundFlags, npc->pos.x, npc->pos.y, npc->pos.z);
@ -593,7 +593,7 @@ void basic_ai_wander(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolum
yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
if (!npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, aiSettings->chaseSpeed, yaw, npc->collisionHeight, npc->collisionRadius)) {
npc->yaw = yaw;
ai_enemy_play_sound(npc, SOUND_2F4, 0x200000);
ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET);
fx_emote(EMOTE_EXCLAMATION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &sp34);
enemy->aiFlags &= ~ENEMY_AI_FLAG_40;
enemy->aiFlags &= ~ENEMY_AI_FLAG_20;
@ -689,7 +689,7 @@ void basic_ai_loiter(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolum
yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
if (!npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, aiSettings->chaseSpeed, yaw, npc->collisionHeight, npc->collisionRadius)) {
npc->yaw = yaw;
ai_enemy_play_sound(npc, SOUND_2F4, 0x200000);
ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET);
fx_emote(EMOTE_EXCLAMATION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp);
if (enemy->npcSettings->actionFlags & AI_ACTION_JUMP_WHEN_SEE_PLAYER) {
script->AI_TEMP_STATE = AI_STATE_ALERT_INIT;

View File

@ -387,7 +387,7 @@ void phys_player_land(void) {
playerStatus->landPos.x = playerStatus->position.x;
playerStatus->landPos.z = playerStatus->position.z;
playerStatus->flags &= ~PS_FLAG_AIRBORNE;
sfx_play_sound_at_player(SOUND_SOFT_LAND, 0);
sfx_play_sound_at_player(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0);
if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
phys_adjust_cam_on_landing();
}
@ -1128,7 +1128,7 @@ void try_player_footstep_sounds(s32 interval) {
soundID = altSoundID;
}
sfx_play_sound_at_player(soundID, 0);
sfx_play_sound_at_player(soundID, SOUND_SPACE_MODE_0);
FootstepSoundSelector ^= 1;
}
}

View File

@ -2322,34 +2322,34 @@ void update_item_entity_collectable(ItemEntity* item) {
item->flags |= ITEM_ENTITY_FLAG_20000000;
} else {
if (IS_BADGE(item->itemID)) {
sfx_play_sound_at_position(SOUND_21B, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_21B, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
} else if (IS_ITEM(item->itemID)) {
sfx_play_sound_at_position(SOUND_21A, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_21A, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
} else {
switch (item->itemID) {
case ITEM_HEART:
sfx_play_sound_at_position(SOUND_214, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_214, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
break;
case ITEM_COIN:
sfx_play_sound_at_position(SOUND_212, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_212, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
break;
case ITEM_KOOPA_FORTRESS_KEY:
sfx_play_sound_at_position(SOUND_212, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_212, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
break;
case ITEM_HEART_PIECE:
sfx_play_sound_at_position(SOUND_214, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_214, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
break;
case ITEM_STAR_POINT:
sfx_play_sound_at_position(SOUND_212, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_212, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
break;
case ITEM_HEART_POINT:
sfx_play_sound_at_position(SOUND_214, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_214, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
break;
case ITEM_STAR_PIECE:
sfx_play_sound_at_position(SOUND_219, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_219, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
break;
case ITEM_FLOWER_POINT:
sfx_play_sound_at_position(SOUND_218, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_218, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
break;
}
}
@ -2390,25 +2390,25 @@ void update_item_entity_collectable(ItemEntity* item) {
case ITEM_HEART:
if (playerData->curHP < playerData->curMaxHP) {
fx_recover(0, playerStatus->position.x, playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, 1);
sfx_play_sound_at_position(SOUND_2056, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_2056, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
}
playerData->curHP++;
if (playerData->curHP > playerData->curMaxHP) {
playerData->curHP = playerData->curMaxHP;
}
sfx_play_sound_at_position(SOUND_213, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_213, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
fx_sparkles(4, playerStatus->position.x, playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, 30.0f);
break;
case ITEM_FLOWER_POINT:
if (playerData->curFP < playerData->curMaxFP) {
fx_recover(1, playerStatus->position.x, playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, 1);
sfx_play_sound_at_position(SOUND_2056, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_2056, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
}
playerData->curFP++;
if (playerData->curFP > playerData->curMaxFP) {
playerData->curFP = playerData->curMaxFP;
}
sfx_play_sound_at_position(SOUND_217, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_217, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
fx_sparkles(4, playerStatus->position.x, playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, 30.0f);
break;
case ITEM_COIN:
@ -2416,7 +2416,7 @@ void update_item_entity_collectable(ItemEntity* item) {
if (playerData->coins > 999) {
playerData->coins = 999;
}
sfx_play_sound_at_position(SOUND_211, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_211, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
playerData->totalCoinsEarned++;
if (playerData->totalCoinsEarned > 99999) {
playerData->totalCoinsEarned = 99999;
@ -2424,19 +2424,19 @@ void update_item_entity_collectable(ItemEntity* item) {
break;
case ITEM_KOOPA_FORTRESS_KEY:
playerData->fortressKeyCount = playerData->fortressKeyCount + 1;
sfx_play_sound_at_position(SOUND_211, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_211, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
break;
case ITEM_STAR_POINT:
playerData->starPoints++;
if (playerData->starPoints > 100) {
playerData->starPoints = 100;
}
sfx_play_sound_at_position(SOUND_211, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_211, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
break;
case ITEM_HEART_POINT:
playerData->curHP = playerData->curMaxHP;
playerData->curFP = playerData->curMaxFP;
sfx_play_sound_at_position(SOUND_213, 0, item->position.x, item->position.y, item->position.z);
sfx_play_sound_at_position(SOUND_213, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z);
break;
}
D_801565A8 = 0;

View File

@ -70,18 +70,18 @@ typedef enum AuPriority {
AU_PRIORITY_MSEQ_MANAGER = 6,
} AuPriority;
enum AuVoiceFlags3D {
AU_VOICE_3D_FLAG_1 = 0x01,
AU_VOICE_3D_FLAG_HANDLED_VOL_CHANGE = 0x02,
AU_VOICE_3D_FLAG_10 = 0x10,
AU_VOICE_3D_FLAG_VOL_CHANGED = 0x20,
enum AuVoiceEnvelopeFlags {
AU_VOICE_ENV_FLAG_STOP = 0x01,
AU_VOICE_ENV_FLAG_HANDLED_VOL_CHANGE = 0x02,
AU_VOICE_ENV_FLAG_KEY_RELEASED = 0x10,
AU_VOICE_ENV_FLAG_VOL_CHANGED = 0x20,
};
enum AuVoiceFlags43 {
AU_VOICE_SYNC_FLAG_ALL = 0x02,
AU_VOICE_SYNC_FLAG_4 = 0x04,
AU_VOICE_SYNC_FLAG_PITCH = 0x08,
AU_VOICE_SYNC_FLAG_10 = 0x10,
enum AuVoiceSyncFlags {
AU_VOICE_SYNC_FLAG_ALL = 0x02,
AU_VOICE_SYNC_FLAG_PARAMS = 0x04,
AU_VOICE_SYNC_FLAG_PITCH = 0x08,
AU_VOICE_SYNC_FLAG_PAN_FXMIX = 0x10,
};
typedef enum AuEffectType {
@ -117,27 +117,146 @@ typedef enum SegmentControlCommands {
} SegmentControlCommands;
typedef enum FxBus {
FX_BUS_0 = 0,
FX_BUS_1 = 1,
FX_BUS_2 = 2,
FX_BUS_3 = 3,
FX_BUS_BGMA_MAIN = 0,
FX_BUS_SOUND = 1,
FX_BUS_BGMB = 2,
FX_BUS_BGMA_AUX = 3,
} FxBus;
typedef union Q32 {
u8 u8[4];
u16 u16[2];
s32 s32;
} Q32;
typedef enum EnvelopeCommand {
ENV_CMD_END_LOOP = 0xFB,
ENV_CMD_START_LOOP = 0xFC,
ENV_CMD_ADD_MULTIPLIER = 0xFD,
ENV_CMD_SET_MULTIPLIER = 0xFE,
ENV_CMD_END = 0xFF,
} EnvelopeCommand;
typedef union Vol32 {
s32 full;
s16 half;
s8 byte;
} Vol32;
enum EnvelopeTimeIntervals {
ENV_TIME_60S = 0,
ENV_TIME_55S = 1,
ENV_TIME_50S = 2,
ENV_TIME_45S = 3,
ENV_TIME_40S = 4,
ENV_TIME_35S = 5,
ENV_TIME_30S = 6,
ENV_TIME_27_5S = 7,
ENV_TIME_25S = 8,
ENV_TIME_22_5S = 9,
ENV_TIME_20S = 10,
ENV_TIME_19S = 11,
ENV_TIME_18S = 12,
ENV_TIME_17S = 13,
ENV_TIME_16S = 14,
ENV_TIME_15S = 15,
ENV_TIME_14S = 16,
ENV_TIME_13S = 17,
ENV_TIME_12S = 18,
ENV_TIME_11S = 19,
ENV_TIME_10S = 20,
ENV_TIME_9S = 21,
ENV_TIME_8S = 22,
ENV_TIME_7S = 23,
ENV_TIME_6S = 24,
ENV_TIME_5S = 25,
ENV_TIME_4_5S = 26,
ENV_TIME_4S = 27,
ENV_TIME_3_5S = 28,
ENV_TIME_3S = 29,
ENV_TIME_2750MS = 30,
ENV_TIME_2500MS = 31,
ENV_TIME_2250MS = 32,
ENV_TIME_2S = 33,
ENV_TIME_1900MS = 34,
ENV_TIME_1800MS = 35,
ENV_TIME_1700MS = 36,
ENV_TIME_1600MS = 37,
ENV_TIME_1500MS = 38,
ENV_TIME_1400MS = 39,
ENV_TIME_1300MS = 40,
ENV_TIME_1200MS = 41,
ENV_TIME_1100MS = 42,
ENV_TIME_1S = 43,
ENV_TIME_950MS = 44,
ENV_TIME_900MS = 45,
ENV_TIME_850MS = 46,
ENV_TIME_800MS = 47,
ENV_TIME_750MS = 48,
ENV_TIME_700MS = 49,
ENV_TIME_650MS = 50,
ENV_TIME_600MS = 51,
ENV_TIME_550MS = 52,
ENV_TIME_500MS = 53,
ENV_TIME_450MS = 54,
ENV_TIME_400MS = 55,
ENV_TIME_375MS = 56,
ENV_TIME_350MS = 57,
ENV_TIME_325MS = 58,
ENV_TIME_300MS = 59,
ENV_TIME_290MS = 60,
ENV_TIME_280MS = 61,
ENV_TIME_270MS = 62,
ENV_TIME_260MS = 63,
ENV_TIME_250MS = 64,
ENV_TIME_240MS = 65,
ENV_TIME_230MS = 66,
ENV_TIME_220MS = 67,
ENV_TIME_210MS = 68,
ENV_TIME_200MS = 69,
ENV_TIME_190MS = 70,
ENV_TIME_180MS = 71,
ENV_TIME_170MS = 72,
ENV_TIME_160MS = 73,
ENV_TIME_150MS = 74,
ENV_TIME_140MS = 75,
ENV_TIME_130MS = 76,
ENV_TIME_120MS = 77,
ENV_TIME_110MS = 78,
ENV_TIME_100MS = 79,
ENV_TIME_16UNITS = 80,
ENV_TIME_14UNITS = 81,
ENV_TIME_12UNITS = 81,
ENV_TIME_11UNITS = 83,
ENV_TIME_10UNITS = 84,
ENV_TIME_9UNITS = 85,
ENV_TIME_8UNITS = 86,
ENV_TIME_7UNITS = 87,
ENV_TIME_6UNITS = 88,
ENV_TIME_5UNITS = 89,
ENV_TIME_4UNITS = 90,
ENV_TIME_3UNITS = 91,
ENV_TIME_2UNITS = 92,
ENV_TIME_1UNITS = 93,
ENV_TIME_0 = 94,
};
enum SoundPlayerState {
SND_PLAYER_STATE_CONTINUE = 0,
SND_PLAYER_STATE_INIT = 1,
};
enum SoundManagerState {
SND_MANAGER_STATE_ENABLED = 0,
SND_MANAGER_STATE_DISABLED = 1,
};
enum SoundInstanceFlags {
SOUND_INSTANCE_FLAG_ACTIVE = 1,
SOUND_INSTANCE_FLAG_POSITION_CHANGED = 2,
};
typedef union AmbVoiceStateInfo {
struct {
u8 playerIndex;
u8 trackIndex;
u8 tune;
u8 released;
};
s32 all;
} AmbVoiceStateInfo;
struct BGMPlayer;
struct AuGlobals;
struct AlUnkVoice;
struct AuVoice;
typedef void (*AuCallback)(void);
@ -153,7 +272,7 @@ typedef union SeqArgs {
u8 cent;
} MasterPitchShift;
struct { // cmd E3
u8 bank;
u8 effectType;
} UnkCmdE3;
struct { // cmd E4
u16 time;
@ -382,7 +501,7 @@ typedef struct AuPVoice {
/* 0x48 */ AuEnvMixer envMixer;
/* 0x74 */ s16 unk_74;
/* 0x76 */ s16 unk_76;
/* 0x78 */ u8 groupID; //?
/* 0x78 */ u8 busId;
/* 0x79 */ u8 index;
/* 0x7A */ u8 unk_7A[2];
} AuPVoice;
@ -411,21 +530,21 @@ typedef struct SoundSFXEntry {
/* 0x9 */ char unk_9[0x1];
} SoundSFXEntry; // size = 0xA
typedef struct AlUnkInstrumentData {
/* 0x00 */ s32* unk_00;
/* 0x04 */ s32* unk_04;
} AlUnkInstrumentData; // size = 0x8
typedef struct EnvelopeData {
/* 0x00 */ u8* cmdListPress;
/* 0x04 */ u8* cmdListRelease;
} EnvelopeData; // size = 0x8
typedef struct InstrumentEffectSub {
/* 0x00 */ u16 unkOffset1;
/* 0x02 */ u16 unkOffset2;
} InstrumentEffectSub; // size = 0x4;
typedef struct EnvelopeOffset {
/* 0x00 */ u16 offsetPress;
/* 0x02 */ u16 offsetRelease;
} EnvelopeOffset; // size = 0x4;
typedef struct InstrumentEffect {
typedef struct EnvelopePreset {
/* 0x00 */ u8 count;
/* 0x01 */ char unk_01[3];
/* 0x04 */ InstrumentEffectSub unk_04[1]; // variable size
} InstrumentEffect;
/* 0x04 */ EnvelopeOffset offsets[1]; // variable size
} EnvelopePreset;
// partially ALWaveTable?
typedef struct Instrument {
@ -438,7 +557,10 @@ typedef struct Instrument {
/* 0x18 */ u16* predictor;
/* 0x1C */ u16 dc_bookSize;
/* 0x1E */ u16 keyBase;
/* 0x20 */ f32 pitchRatio;
/* 0x20 */ union {
f32 pitchRatio;
s32 outputRate;
};
/* 0x24 */ u8 type;
/* 0x25 */ u8 unk_25;
/* 0x26 */ s8 unk_26;
@ -447,7 +569,7 @@ typedef struct Instrument {
/* 0x29 */ s8 unk_29;
/* 0x2A */ s8 unk_2A;
/* 0x2B */ s8 unk_2B;
/* 0x2C */ InstrumentEffect* unkOffset;
/* 0x2C */ EnvelopePreset* envelopes;
} Instrument; // size = 0x30;
typedef Instrument* InstrumentGroup[16];
@ -474,45 +596,38 @@ typedef struct SoundPlayChange {
typedef struct SoundPlayer {
/* 0x00 */ AuFilePos sefDataReadPos;
/* 0x04 */ char pad4[0xC];
/* 0x10 */ AlUnkInstrumentData unk_10;
/* 0x18 */ s32* unk_18;
/* 0x10 */ EnvelopeData envelope;
/* 0x18 */ u8* envelopCustomPressProfile;
/* 0x1C */ Instrument* sfxInstrumentRef;
/* 0x20 */ Instrument sfxInstrument;
/* 0x50 */ AuFilePos sefReadStart;
/* 0x54 */ SoundPlayChange changed;
/* 0x58 */ f32 pitchRatio;
/* 0x5C */ s16 sfxVolume;
/* 0x5E */ s16 unk_5E;
/* 0x5E */ s16 alternativeVolume;
/* 0x60 */ SoundLerp tuneLerp;
/* 0x6C */ SoundLerp volumeLerp;
/* 0x78 */ u8 locatorB;
/* 0x79 */ u8 locatorC;
/* 0x7A */ u8 locatorD;
/* 0x7B */ u8 unk_7B;
/* 0x7C */ u8 unk_7C;
/* 0x7D */ u8 unk_7D;
/* 0x7E */ u8 unk_7E;
/* 0x7F */ u8 unk_7F;
/* 0x80 */ AuFilePos unk_80;
/* 0x84 */ s8 unk_84;
/* 0x85 */ u8 soundC00;
/* 0x78 */ u8 cmdList_mode2[8];
/* 0x80 */ AuFilePos alternativeDataPos;
/* 0x84 */ s8 alternativeType;
/* 0x85 */ u8 triggers;
/* 0x86 */ char unk_86[0x2];
/* 0x88 */ s8* loopStartPos;
/* 0x8C */ u8 loopIterCount;
/* 0x8D */ char unk_8D;
/* 0x8E */ u16 delay;
/* 0x90 */ u16 playLength;
/* 0x92 */ s16 unk_92;
/* 0x94 */ s8 unk_94;
/* 0x92 */ s16 coarseTune;
/* 0x94 */ s8 fineTune;
/* 0x95 */ char unk_05;
/* 0x96 */ u16 currentSoundID;
/* 0x98 */ u8 unk_98;
/* 0x99 */ u8 unk_99;
/* 0x98 */ u8 priority;
/* 0x99 */ u8 exclusiveID;
/* 0x9A */ u8 sfxParamsFlags;
/* 0x9B */ u8 sfxPan;
/* 0x9C */ u8 reverb;
/* 0x9D */ u8 instrumentIndex; // ?
/* 0x9E */ u8 unk_9E;
/* 0x9E */ u8 envelopePreset;
/* 0x9F */ u8 playVelocity;
/* 0xA0 */ u8 unk_A0;
/* 0xA1 */ u8 randomPitch;
@ -521,7 +636,7 @@ typedef struct SoundPlayer {
/* 0xA4 */ s16 masterPitchShift;
/* 0xA6 */ s16 masterVolume;
/* 0xA8 */ u8 masterPan;
/* 0xA8 */ u8 unk_A9;
/* 0xA8 */ u8 state;
/* 0xA9 */ char unk_AA[0x2];
} SoundPlayer; // size = 0xAC
@ -537,39 +652,37 @@ typedef struct SoundManager90 {
};
} SoundManager90; // size = 4
typedef struct SoundManagerA0 {
/* 0x0 */ u16 unk_00;
/* 0x2 */ u16 unk_02;
/* 0x4 */ u16 unk_04;
} SoundManagerA0; // size = 6
typedef struct SoundManagerCustomCmdList {
/* 0x0 */ u16 data[3];
} SoundManagerCustomCmdList; // size = 6
typedef struct SoundManager {
/* 0x000 */ struct AuGlobals* globals;
/* 0x004 */ struct AlUnkVoice* currentVoice;
/* 0x004 */ struct AuVoice* currentVoice;
/* 0x008 */ u8* sefData;
/* 0x00C */ s32* normalSounds[8];
/* 0x02C */ s32* soundsWithBit2000;
/* 0x02C */ s32* extraSounds;
/* 0x030 */ s32 playCounter; //?
/* 0x034 */ s32 nextUpdateStep;
/* 0x038 */ s32 nextUpdateInterval;
/* 0x03C */ s32 nextUpdateCounter;
/* 0x040 */ struct Fade fadeInfo;
/* 0x05C */ s32 unk_5C;
/* 0x05C */ s32 busVolume;
/* 0x060 */ s32 randomValue;
/* 0x064 */ s32* customReverbParams[8];
/* 0x084 */ s8 customReverbAmounts[8];
/* 0x08C */ u8 lastCustomEffectIdx;
/* 0x08D */ s8 defaultReverbAmt;
/* 0x08E */ char unk_8E[0x2];
/* 0x090 */ SoundManager90 unk_90[4];
/* 0x0A0 */ SoundManagerA0 unk_A0[4];
/* 0x0B8 */ u16 unk_B8;
/* 0x090 */ SoundManager90 bgmSounds[4];
/* 0x0A0 */ SoundManagerCustomCmdList customCmdList[4];
/* 0x0B8 */ u16 baseVolume;
/* 0x0BA */ s16 unk_BA;
/* 0x0BC */ u8 priority;
/* 0x0BD */ u8 sfxPlayerSelector;
/* 0x0BE */ u8 defaultReverbType;
/* 0x0BF */ u8 unk_BF;
/* 0x0C0 */ u8 unk_C0;
/* 0x0BE */ u8 busId;
/* 0x0BF */ u8 currentVoiceIndex;
/* 0x0C0 */ u8 state;
/* 0x0C1 */ char unk_C1[0x1];
/* 0x0C2 */ SoundSFXEntry soundQueue[16];
/* 0x162 */ s8 unk_162;
@ -577,7 +690,7 @@ typedef struct SoundManager {
/* 0x164 */ u8 sfxQueueNextPos;
/* 0x165 */ s8 unk_165;
/* 0x166 */ char unk_166[0x2];
/* 0x168 */ s32 unk_168;
/* 0x168 */ s32 resetPending;
/* 0x16C */ SoundPlayer players[8];
} SoundManager; // size = 0x6CC
@ -597,38 +710,38 @@ typedef struct AlternatingSoundSet {
/* 0x06 */ s16 currentIndex;
} AlternatingSoundSet; // size = 0x08
typedef struct AlUnkVoice {
typedef struct AuVoice {
/* 0x00 */ Instrument* instrument;
/* 0x04 */ f32 pitchRatio;
/* 0x08 */ s32 unk_08;
/* 0x0C */ s16 volume;
/* 0x08 */ s32 delta;
/* 0x0C */ s16 p_volume; // volume for pvoice
/* 0x0E */ u8 pan;
/* 0x0F */ u8 reverbAmt;
/* 0x10 */ u8 reverbType;
/* 0x0F */ u8 reverb;
/* 0x10 */ u8 busId;
/* 0x11 */ char unk_11[0x3];
/* 0x14 */ AlUnkInstrumentData unk_14;
/* 0x1C */ u8* unk_1C;
/* 0x14 */ EnvelopeData envelope;
/* 0x1C */ u8* cmdPtr;
/* 0x20 */ s32 unk_20;
/* 0x24 */ s32 unk_24;
/* 0x28 */ s32 unk_28;
/* 0x2C */ f32 unk_2C;
/* 0x30 */ s32 unk_30;
/* 0x34 */ u8* unk_34;
/* 0x38 */ u8 unk_38;
/* 0x39 */ u8 unk_39;
/* 0x3A */ u8 unk_3A;
/* 0x3B */ u8 unk_3B;
/* 0x24 */ s32 volChangeTime;
/* 0x28 */ s32 timeLeft;
/* 0x2C */ f32 rate;
/* 0x30 */ s32 volMult;
/* 0x34 */ u8* loopStart;
/* 0x38 */ u8 loopCounter;
/* 0x39 */ u8 initialAmp;
/* 0x3A */ u8 targetAmp;
/* 0x3B */ u8 timeIntervalIndex;
/* 0x3C */ u8 unk_3C;
/* 0x3D */ u8 unk_flags_3D;
/* 0x3E */ u8 unk_3E;
/* 0x3F */ u8 unk_3F;
/* 0x40 */ s16 adjustedVolume;
/* 0x42 */ u8 unk_42;
/* 0x43 */ u8 unk_flags_43;
/* 0x44 */ s8 priorityCopy;
/* 0x3D */ u8 envelopeFlags;
/* 0x3E */ u8 relativeReleaseVolumes;
/* 0x3F */ u8 releaseVolumeMult;
/* 0x40 */ s16 clientVolume;
/* 0x42 */ u8 stopPending;
/* 0x43 */ u8 syncFlags;
/* 0x44 */ s8 clientPriority;
/* 0x45 */ u8 priority;
/* 0x46 */ char unk_46[2];
} AlUnkVoice; // size = 0x48
} AuVoice; // size = 0x48
typedef struct BGMFileInfo {
/* 0x10 */ u8 numSegments;
@ -699,8 +812,8 @@ typedef struct SEFHeader {
/* 0x0E */ u8 hasExtraSection; // 1
/* 0x0F */ s8 unkF; // 0
/* 0x10 */ u16 sections[8];
/* 0x14 */ u16 section2000;
} SEFHeader; // size = 0x16
/* 0x20 */ u16 section2000;
} SEFHeader; // size = 0x22
typedef struct INITHeader {
/* 0x00 */ s32 signature; // 'INIT'
@ -795,7 +908,7 @@ typedef struct AuGlobals {
/* 0x003C */ u16* mseqFileList;
/* 0x0040 */ AuEffectChange effectChanges[4];
/* 0x0050 */ u8 channelDelayPending;
/* 0x0051 */ u8 channelDelayGroupIdx;
/* 0x0051 */ u8 channelDelayBusId;
/* 0x0052 */ u8 channelDelayTime;
/* 0x0053 */ u8 channelDelaySide;
/* 0x0054 */ PEREntry* dataPER;
@ -828,7 +941,7 @@ typedef struct AuGlobals {
/* 0x130D */ char unk_130D[3];
/* 0x1310 */ SoundBank* banks[3];
/* 0x131C */ char unk_131C[4];
/* 0x1320 */ AlUnkVoice voices[24];
/* 0x1320 */ AuVoice voices[24];
} AuGlobals; // size = 0x19E0
typedef struct BGMPlayerTrack {
@ -836,7 +949,7 @@ typedef struct BGMPlayerTrack {
/* 0x04 */ AuFilePos savedPos;
/* 0x08 */ AuFilePos prevReadPos;
/* 0x0C */ Instrument* instrument;
/* 0x10 */ AlUnkInstrumentData unk_10;
/* 0x10 */ EnvelopeData envelope;
/* 0x18 */ s32 subTrackVolume;
/* 0x1C */ s32 subTrackVolumeStep;
/* 0x20 */ s32 subTrackVolumeTarget;
@ -873,7 +986,7 @@ typedef struct BGMPlayerTrack {
/* 0x58 */ u8 isDrumTrack;
/* 0x59 */ u8 parentTrackIdx;
/* 0x5A */ u8 unk_5A;
/* 0x5B */ s8 subtrackReverbType;
/* 0x5B */ s8 subtrackBusId;
/* 0x5C */ u8 index;
/* 0x5D */ char unk_5D[0x3];
} BGMPlayerTrack; // size = 0x60;
@ -905,7 +1018,7 @@ typedef struct BGMPlayer {
/* 0x024 */ s32 bgmFileIndex;
/* 0x028 */ s32 songID;
/* 0x02C */ Fade fadeInfo;
/* 0x048 */ s32 unk_48;
/* 0x048 */ s32 busVolume;
/* 0x04C */ u8 effectIndices[4];
/* 0x050 */ s32 randomValue1;
/* 0x054 */ s32 randomValue2;
@ -964,7 +1077,7 @@ typedef struct BGMPlayer {
/* 0x232 */ u8 bFadeConfigSetsVolume;
/* 0x233 */ u8 unk_233;
/* 0x234 */ u8 priority;
/* 0x235 */ u8 defaultReverbType;
/* 0x235 */ u8 busId;
/* 0x236 */ char unk_236[0x2];
/* 0x238 */ s32 unk_238[8];
/* 0x258 */ u8 unk_258;
@ -975,101 +1088,93 @@ typedef struct BGMPlayer {
/* 0x85C */ SeqNote notes[24];
} BGMPlayer; // size = 0xA9C
typedef struct AlUnkMSEQData {
/* 0x0 */ u8 unk_00;
/* 0x1 */ u8 unk_01;
/* 0x2 */ s16 unk_02;
/* 0x4 */ s16 unk_04;
/* 0x6 */ u16 unk_06;
} AlUnkMSEQData; // size = 0x8
typedef struct MSEQTrackData {
/* 0x0 */ u8 trackIndex;
/* 0x1 */ u8 type;
/* 0x2 */ s16 time;
/* 0x4 */ s16 delta;
/* 0x6 */ u16 goal;
} MSEQTrackData; // size = 0x8
typedef struct MSEQHeader {
/* 0x00 */ s32 signature; // 'MSEQ '
/* 0x04 */ s32 size; // including header
/* 0x08 */ s32 name;
/* 0x0C */ u8 first_iota;
/* 0x0D */ u8 unkCount;
/* 0x0E */ u16 unkOffset;
/* 0x0C */ u8 firstVoiceIdx;
/* 0x0D */ u8 trackSettingsCount;
/* 0x0E */ u16 trackSettingsOffset;
/* 0x10 */ u16 dataStart;
} MSEQHeader; // size variable
typedef struct AlUnkXi {
typedef struct AmbienceTrack {
/* 0x00 */ Instrument* instrument;
/* 0x04 */ AlUnkInstrumentData unk_04;
/* 0x0C */ s16 pitch;
/* 0x0E */ s16 unk_0E;
/* 0x10 */ s32 unk_10;
/* 0x14 */ s16 unk_14;
/* 0x16 */ s16 unk_16;
/* 0x18 */ Vol32 unk_18;
/* 0x1C */ s32 unk_1C;
/* 0x20 */ s16 unk_20;
/* 0x22 */ s16 unk_22;
/* 0x04 */ EnvelopeData envelope;
/* 0x0C */ SoundLerp tuneLerp;
/* 0x18 */ SoundLerp volumeLerp;
/* 0x24 */ s8 pan;
/* 0x25 */ s8 reverb;
/* 0x26 */ u8 flags;
/* 0x27 */ char unk_26[1];
} AlUnkXi; // size = 0x28
/* 0x27 */ char unk_27[1];
} AmbienceTrack; // size = 0x28
typedef struct AlUnkOmega {
/* 0x0 */ u8 unk_00;
/* 0x1 */ u8 unk_01;
/* 0x2 */ s8 unk_02;
/* 0x4 */ s8 unk__03;
} AlUnkOmega; // size = 0x4
typedef struct AmbienceSavedVoice {
/* 0x0 */ u8 trackIndex;
/* 0x1 */ u8 tune;
/* 0x2 */ s8 volume;
/* 0x4 */ char unk_03[1];
} AmbienceSavedVoice; // size = 0x4
typedef struct AlUnkIota {
/* 0x00 */ Q32 unk_00;
typedef struct AmbienceVoiceState {
/* 0x00 */ AmbVoiceStateInfo info;
/* 0x04 */ s16 pitch;
/* 0x06 */ s8 volume;
/* 0x07 */ u8 unk_07;
} AlUnkIota; // size = 0x8
/* 0x07 */ u8 isResumable;
} AmbienceVoiceState; // size = 0x8
//TODO AuStreamPlayer?
typedef struct AuAmbPlayer {
typedef struct AmbiencePlayer {
/* 0x000 */ MSEQHeader* mseqFile;
/* 0x004 */ AuFilePos mseqReadStart;
/* 0x008 */ AuFilePos mseqReadPos;
/* 0x00C */ AuFilePos unk_0C;
/* 0x010 */ AuFilePos unk_10;
/* 0x014 */ Q32 unk_14;
/* 0x018 */ s32 unk_18;
/* 0x00C */ AuFilePos loopStartPos[2];
/* 0x014 */ AmbVoiceStateInfo id;
/* 0x018 */ s32 delay;
/* 0x01C */ s32 unk_1C;
/* 0x020 */ s32 mseqName;
/* 0x024 */ u8 unk_24;
/* 0x024 */ u8 mode;
/* 0x025 */ u8 playState;
/* 0x026 */ u8 unk_26;
/* 0x027 */ u8 unk_27;
/* 0x028 */ u16 time;
/* 0x02A */ u8 unk_2A;
/* 0x02B */ u8 volume;
/* 0x02C */ char unk_2C[4];
/* 0x030 */ s32 firstVoiceIdx;
/* 0x026 */ u8 fadeSettingsType;
/* 0x027 */ char unk_27[1];
/* 0x028 */ u16 fadeSettingsTime;
/* 0x02A */ u8 fadeSettingsInitial; // 255 means from current volume
/* 0x02B */ u8 fadeSettingsGoal;
/* 0x02C */ u8 loopCount[2];
/* 0x02E */ char unk_2E[2];
/* 0x030 */ u32 firstVoiceIdx;
/* 0x034 */ u32 lastVoiceIdx;
/* 0x038 */ s32 unk_38;
/* 0x03C */ s32 volInterpStep;
/* 0x040 */ u16 volInterpTime;
/* 0x042 */ u8 unk_42;
/* 0x043 */ u8 unk_43;
/* 0x044 */ AlUnkXi unk_44[10];
/* 0x1D4 */ AlUnkOmega unk_1D4[4];
} AuAmbPlayer; // size = 0x1E4
/* 0x038 */ s32 fadeVolume;
/* 0x03C */ s32 fadeStep;
/* 0x040 */ u16 fadeTime;
/* 0x042 */ u8 fadeGoal;
/* 0x043 */ u8 resetRequired;
/* 0x044 */ AmbienceTrack tracks[10];
/* 0x1D4 */ AmbienceSavedVoice savedVoices[4];
} AmbiencePlayer; // size = 0x1E4
//TODO AuStreamingManager ?
// 801D57A0
typedef struct AuAmbienceManager {
typedef struct AmbienceManager {
/* 0x000 */ AuGlobals* globals;
/* 0x004 */ s32 nextUpdateStep;
/* 0x008 */ s32 nextUpdateInterval;
/* 0x00C */ s32 nextUpdateCounter;
/* 0x010 */ MSEQHeader* mseqFiles[4];
/* 0x020 */ u8 unk_20;
/* 0x021 */ u8 unk_21;
/* 0x020 */ u8 numActivePlayers;
/* 0x021 */ u8 loadTracksFadeInfo;
/* 0x022 */ u8 priority;
/* 0x023 */ u8 defaultReverbType;
/* 0x024 */ AuAmbPlayer mseqPlayers[4];
/* 0x7B4 */ AlUnkIota mseqVoiceStates[16];
} AuAmbienceManager;
/* 0x023 */ u8 busId;
/* 0x024 */ AmbiencePlayer players[4];
/* 0x7B4 */ AmbienceVoiceState voiceStates[16];
} AmbienceManager;
typedef struct AlUnkGemini {
/* 0x00 */ u16 sound1;
@ -1094,11 +1199,11 @@ extern s32 CUSTOM_SMALL_ROOM_PARAMS[];
extern s32 CUSTOM_ECHO_PARAMS_1[];
extern s32 CUSTOM_ECHO_PARAMS_3[];
extern s32 CUSTOM_ECHO_PARAMS_2[];
extern s32 D_80078544[];
extern EnvelopePreset DummyInstrumentEnvelope;
extern u8 AmbientSoundIDtoMSEQFileIndex[];
extern s32 D_800785A0[];
extern s32 AuEnvelopeIntervals[];
extern s32 PreventBGMPlayerUpdate;
extern u16 D_80078DB6;
extern u16 AuAmbiencePlayOnlyIndex;
extern AuSynDriver* gActiveSynDriverPtr;
extern AuSynDriver* gSynDriverPtr;
@ -1110,7 +1215,7 @@ extern AuGlobals* gSoundGlobals;
extern BGMPlayer* gBGMPlayerC;
extern BGMPlayer* gBGMPlayerB;
extern AuCallback BeginSoundUpdateCallback;
extern AuAmbienceManager* gAuAmbienceManager;
extern AmbienceManager* gAuAmbienceManager;
extern SoundManager* gSoundManager;
extern BGMPlayer* gBGMPlayerA;

View File

@ -14,7 +14,7 @@ u8 volatile AuSynUseStereo = TRUE;
//bss
extern Acmd* AlCmdListBuffers[3];
extern NUScTask D_800A3520[3];
extern NUScTask nuAuTasks[3];
extern u8* D_800A3628[3];
extern s32 AlFrameSize;
extern s32 AlMinFrameSize;
@ -25,7 +25,6 @@ extern NUDMABuffer* D_800A3BD4;
extern NUDMABuffer nuAuDmaBufList[50];
extern AuSynDriver auSynDriver;
extern u64 rspbootUcodeBuffer[];
extern s32 AlNumFields;
extern u64 n_aspMain_text_bin[];
extern u64 n_aspMain_data_bin[];
extern u8 AuHeapBase[AUDIO_HEAP_SIZE];
@ -41,7 +40,7 @@ void create_audio_system(void) {
config.num_pvoice = 24;
config.num_bus = 4;
outputRate = osAiSetFrequency(32000);
frameSize = (AlNumFields * outputRate + 59) / 60;
frameSize = (nusched.retraceCount * outputRate + 59) / 60;
config.outputRate = outputRate;
config.unk_0C = 0;
config.heap = &nuAuHeap;
@ -53,21 +52,21 @@ void create_audio_system(void) {
AlCmdListBuffers[i] = alHeapAlloc(config.heap, 1, AUDIO_COMMAND_LIST_BUFFER_SIZE);
}
for (i = 0; i < ARRAY_COUNT(D_800A3520); i++) {
D_800A3520[i].next = NULL;
D_800A3520[i].msg = 0;
D_800A3520[i].list.t.type = M_AUDTASK;
D_800A3520[i].list.t.ucode_boot = rspbootUcodeBuffer;
D_800A3520[i].list.t.ucode_boot_size = 0x100;
D_800A3520[i].list.t.ucode = n_aspMain_text_bin;
D_800A3520[i].list.t.ucode_data = n_aspMain_data_bin;
D_800A3520[i].list.t.ucode_data_size = SP_UCODE_DATA_SIZE;
D_800A3520[i].list.t.dram_stack = NULL;
D_800A3520[i].list.t.dram_stack_size = 0;
D_800A3520[i].list.t.output_buff = NULL;
D_800A3520[i].list.t.output_buff_size = 0;
D_800A3520[i].list.t.yield_data_ptr = NULL;
D_800A3520[i].list.t.yield_data_size = 0;
for (i = 0; i < ARRAY_COUNT(nuAuTasks); i++) {
nuAuTasks[i].next = NULL;
nuAuTasks[i].msg = 0;
nuAuTasks[i].list.t.type = M_AUDTASK;
nuAuTasks[i].list.t.ucode_boot = rspbootUcodeBuffer;
nuAuTasks[i].list.t.ucode_boot_size = 0x100;
nuAuTasks[i].list.t.ucode = n_aspMain_text_bin;
nuAuTasks[i].list.t.ucode_data = n_aspMain_data_bin;
nuAuTasks[i].list.t.ucode_data_size = SP_UCODE_DATA_SIZE;
nuAuTasks[i].list.t.dram_stack = NULL;
nuAuTasks[i].list.t.dram_stack_size = 0;
nuAuTasks[i].list.t.output_buff = NULL;
nuAuTasks[i].list.t.output_buff_size = 0;
nuAuTasks[i].list.t.yield_data_ptr = NULL;
nuAuTasks[i].list.t.yield_data_size = 0;
}
for (i = 0; i < ARRAY_COUNT(D_800A3628); i++) {
@ -128,10 +127,10 @@ void nuAuMgr(void* arg) {
switch (*mesg_type) {
case NU_SC_RETRACE_MSG:
if (cmdList_len != 0 && nuAuTaskStop == NU_AU_TASK_RUN) {
D_800A3520[cmdListIndex].msgQ = &auRtnMesgQ;
D_800A3520[cmdListIndex].list.t.data_ptr = (u64*)cmdListBuf;
D_800A3520[cmdListIndex].list.t.data_size = (cmdListAfter_ptr - cmdListBuf) * sizeof(Acmd);
osSendMesg(&nusched.audioRequestMQ, &D_800A3520[cmdListIndex], OS_MESG_BLOCK);
nuAuTasks[cmdListIndex].msgQ = &auRtnMesgQ;
nuAuTasks[cmdListIndex].list.t.data_ptr = (u64*)cmdListBuf;
nuAuTasks[cmdListIndex].list.t.data_size = (cmdListAfter_ptr - cmdListBuf) * sizeof(Acmd);
osSendMesg(&nusched.audioRequestMQ, &nuAuTasks[cmdListIndex], OS_MESG_BLOCK);
nuAuCleanDMABuffers();
osRecvMesg(&auRtnMesgQ, NULL, 1);
if (++bufferIndex == 3) {

View File

@ -1,6 +1,6 @@
#include "audio.h"
extern s32 D_80078554;
extern u8 EnvelopeReleaseDefaultFast[];
extern u8 BgmDivisors[8];
extern u8 D_80078558[40];
@ -513,12 +513,12 @@ AuResult func_8004E0F4(SongUpdateEvent* update) {
return status;
}
void au_bgm_player_init(BGMPlayer* player, s32 priority, s32 reverbType, AuGlobals* globals) {
void au_bgm_player_init(BGMPlayer* player, s32 priority, s32 busId, AuGlobals* globals) {
s16 i;
player->globals = globals;
func_8004E880(player, BGM_SAMPLE_RATE, 48);
player->unk_48 = 0x8000;
player->busVolume = 0x8000;
player->masterTempo = BGM_DEFAULT_TEMPO;
player->masterVolume = 0x7F000000;
player->updateCounter = 0;
@ -543,7 +543,7 @@ void au_bgm_player_init(BGMPlayer* player, s32 priority, s32 reverbType, AuGloba
player->bFadeConfigSetsVolume = FALSE;
player->masterState = BGM_PLAY_STATE_IDLE;
player->priority = priority;
player->defaultReverbType = reverbType;
player->busId = busId;
*(s32*)player->segLoopCounters = 0;
player->unk_222 = 0;
player->unk_223 = 0;
@ -638,12 +638,12 @@ void func_8004E444(BGMPlayer* arg0) {
s32 i;
for (i = 0; i < ARRAY_COUNT(arg0->effectIndices); i++) {
s8 temp = arg0->effectIndices[i];
s8 busId = arg0->effectIndices[i];
if (temp < 0) {
if (busId < 0) {
return;
}
func_80053A98(temp, mult, arg0->unk_48);
au_fade_set_volume(busId, mult, arg0->busVolume);
}
}
@ -729,7 +729,7 @@ void au_bgm_player_initialize(BGMPlayer* player) {
track->isDrumTrack = FALSE;
track->parentTrackIdx = 0;
track->unk_5A = 0;
track->subtrackReverbType = player->defaultReverbType;
track->subtrackBusId = player->busId;
track->index = i;
}
@ -1006,7 +1006,7 @@ void au_bgm_player_update_playing(BGMPlayer *player) {
s16 notePitch;
u8 bFinished;
AlUnkVoice* voice;
AuVoice* voice;
BGMDrumInfo* drumInfo;
BGMPlayerTrack* track;
SeqNote* note;
@ -1190,7 +1190,7 @@ void au_bgm_player_update_playing(BGMPlayer *player) {
if (!bAcquiredVoiceIdx) {
s32 shortestLength = 0xFFFF;
u8 voice_it;
AlUnkVoice* curVoice;
AuVoice* curVoice;
SeqNote* curNote;
for (voice_it = track->unk_52; voice_it < track->unk_53; voice_it++) {
curVoice = &player->globals->voices[voice_it];
@ -1238,13 +1238,13 @@ void au_bgm_player_update_playing(BGMPlayer *player) {
} else {
drumInfo = player->drums[notePitch - 72]; // = 6 * 12
}
note->ins = au_get_instrument(player->globals, (u16)drumInfo->bankPatch >> 8, (u16)drumInfo->bankPatch & 0xFF, &voice->unk_14);
note->ins = au_get_instrument(player->globals, (u16)drumInfo->bankPatch >> 8, (u16)drumInfo->bankPatch & 0xFF, &voice->envelope);
if (drumInfo->randVolume != 0) {
note->volume = note->noteVelocity * au_bgm_get_random_vol(player->randomValue1, drumInfo->volume, drumInfo->randVolume);
} else {
note->volume = note->noteVelocity * drumInfo->volume;
}
voice->adjustedVolume = ((
voice->clientVolume = ((
((player->masterVolume >> 0x15) * (track->subTrackVolume >> 0x15) * (track->unkVolume >> 0x15)) >> 0x14)
* (track->segTrackVolume * note->volume)) >> 0x10;
note->adjustedPitch =
@ -1264,15 +1264,15 @@ void au_bgm_player_update_playing(BGMPlayer *player) {
voice->pan = drumInfo->pan;
}
if (drumInfo->randReverb != 0) {
voice->reverbAmt = au_bgm_get_random_reverb(player->randomValue1, drumInfo->reverb, drumInfo->randReverb);
voice->reverb = au_bgm_get_random_reverb(player->randomValue1, drumInfo->reverb, drumInfo->randReverb);
} else {
voice->reverbAmt = drumInfo->reverb;
voice->reverb = drumInfo->reverb;
}
} else {
note->volume = ((
((player->masterVolume >> 0x15) * (track->subTrackVolume >> 0x15) * (track->unkVolume >> 0x15)) >> 0x14)
* (track->segTrackVolume * note->noteVelocity)) >> 9;
voice->adjustedVolume = note->volume;
voice->clientVolume = note->volume;
note->ins = track->instrument;
note->adjustedPitch =
(notePitch * 100)
@ -1291,26 +1291,26 @@ void au_bgm_player_update_playing(BGMPlayer *player) {
} else {
voice->pan = track->subTrackPan;
}
voice->reverbAmt = track->subTrackReverb;
voice->reverb = track->subTrackReverb;
if (track->unk_4C != 0) {
voice->unk_14.unk_00 = (s32*) player->unk_174[track->unk_4C - 1]; //TODO ???
voice->envelope.cmdListPress = (u8*) player->unk_174[track->unk_4C - 1]; //TODO ???
} else {
voice->unk_14.unk_00 = track->unk_10.unk_00;
voice->envelope.cmdListPress = track->envelope.cmdListPress;
}
voice->unk_14.unk_04 = track->unk_10.unk_04;
voice->envelope.cmdListRelease = track->envelope.cmdListRelease;
}
voice->instrument = note->ins;
voice->pitchRatio = note->pitchRatio;
voice->reverbType = track->subtrackReverbType;
voice->busId = track->subtrackBusId;
if (note->noteLength >= 2) {
note->unk_note_17 = 1;
note->tremoloTime = track->trackTremoloTime;
note->unk_13 = 0;
note->tremoloAmount = track->trackTremoloAmount;
voice->unk_flags_43 = AU_VOICE_SYNC_FLAG_ALL;
voice->syncFlags = AU_VOICE_SYNC_FLAG_ALL;
voice->priority = player->priority;
voice->priorityCopy = voice->priority;
voice->clientPriority = voice->priority;
}
}
} else {
@ -1355,7 +1355,7 @@ void au_bgm_player_update_playing(BGMPlayer *player) {
if (note->noteLength > 0) {
note->noteLength--;
if (note->noteLength == 0) {
voice->unk_flags_3D |= AU_VOICE_3D_FLAG_10;
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_KEY_RELEASED;
}
}
if (track->isDrumTrack) {
@ -1363,16 +1363,16 @@ void au_bgm_player_update_playing(BGMPlayer *player) {
note->pitchRatio = au_compute_pitch_ratio(((note->adjustedPitch + note->unk_14) + track->segTrackTune) + player->detune) * note->ins->pitchRatio;
if (voice->pitchRatio != note->pitchRatio) {
voice->pitchRatio = note->pitchRatio;
voice->unk_flags_43 |= AU_VOICE_SYNC_FLAG_PITCH;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PITCH;
}
}
if (track->changed.volume) {
voice->adjustedVolume = (
voice->clientVolume = (
((((player->masterVolume >> 0x15)
* (track->subTrackVolume >> 0x15))
* (track->unkVolume >> 0x15)) >> 0x14)
* (track->segTrackVolume * note->volume)) >> 0x10;
voice->unk_flags_3D |= AU_VOICE_3D_FLAG_VOL_CHANGED;
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_VOL_CHANGED;
}
} else {
if (note->tremoloTime != 0) {
@ -1401,7 +1401,7 @@ void au_bgm_player_update_playing(BGMPlayer *player) {
note->pitchRatio = au_compute_pitch_ratio(var_a1_5 + ((note->adjustedPitch + track->segTrackTune) + player->detune)) * note->ins->pitchRatio;
if (voice->pitchRatio != note->pitchRatio) {
voice->pitchRatio = note->pitchRatio;
voice->unk_flags_43 |= AU_VOICE_SYNC_FLAG_PITCH;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PITCH;
}
}
} else if (track->changed.tune || (player->detune != 0)) {
@ -1409,20 +1409,20 @@ void au_bgm_player_update_playing(BGMPlayer *player) {
note->pitchRatio = au_compute_pitch_ratio((note->adjustedPitch + track->segTrackTune) + player->detune) * note->ins->pitchRatio;
if (voice->pitchRatio != note->pitchRatio) {
voice->pitchRatio = note->pitchRatio;
voice->unk_flags_43 |= AU_VOICE_SYNC_FLAG_PITCH;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PITCH;
}
}
if (track->changed.volume) {
s32 tempVolume = ((player->masterVolume >> 0x15) * (track->subTrackVolume >> 0x15) * (track->unkVolume >> 0x15)) >> 0x14;
note->volume = (tempVolume * (track->segTrackVolume * note->noteVelocity)) >> 9;
voice->adjustedVolume = note->volume;
voice->unk_flags_3D |= AU_VOICE_3D_FLAG_VOL_CHANGED;
voice->clientVolume = note->volume;
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_VOL_CHANGED;
voice->pan = track->subTrackPan;
voice->reverbAmt = track->subTrackReverb;
voice->reverb = track->subTrackReverb;
} else if (track->changed.pan || track->changed.reverb) {
voice->pan = track->subTrackPan;
voice->reverbAmt = track->subTrackReverb;
voice->unk_flags_43 |= AU_VOICE_SYNC_FLAG_10;
voice->reverb = track->subTrackReverb;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PAN_FXMIX;
}
}
}
@ -1488,18 +1488,18 @@ void au_BGMCmd_E2_MasterPitchShift(BGMPlayer* player, BGMPlayerTrack* track) {
}
void au_BGMCmd_E3(BGMPlayer* player, BGMPlayerTrack* track) {
player->globals->effectChanges[player->defaultReverbType].type = player->seqCmdArgs.UnkCmdE3.bank;
player->globals->effectChanges[player->defaultReverbType].changed = TRUE;
player->globals->effectChanges[player->busId].type = player->seqCmdArgs.UnkCmdE3.effectType;
player->globals->effectChanges[player->busId].changed = TRUE;
}
void au_BGMCmd_E6_MasterEffect(BGMPlayer* player, BGMPlayerTrack* track) {
u8 index = player->seqCmdArgs.MasterEffect.index;
u32 temp_v1 = player->effectIndices[index];
u32 busId = player->effectIndices[index];
if ((index < 4) && (temp_v1 < 0x80)) {
if (player->globals->effectChanges[temp_v1].type != player->seqCmdArgs.MasterEffect.value) {
player->globals->effectChanges[temp_v1].type = player->seqCmdArgs.MasterEffect.value;
player->globals->effectChanges[temp_v1].changed = TRUE;
if ((index < 4) && (busId < 0x80)) {
if (player->globals->effectChanges[busId].type != player->seqCmdArgs.MasterEffect.value) {
player->globals->effectChanges[busId].type = player->seqCmdArgs.MasterEffect.value;
player->globals->effectChanges[busId].changed = TRUE;
}
player->effectValues[index] = player->seqCmdArgs.MasterEffect.value;
}
@ -1537,7 +1537,7 @@ void au_BGMCmd_E5_MasterVolumeFade(BGMPlayer* player, BGMPlayerTrack* track) {
void au_BGMCmd_E8_TrackOverridePatch(BGMPlayer* player, BGMPlayerTrack* track) {
track->patch = player->seqCmdArgs.TrackOverridePatch.patch;
track->instrument = au_get_instrument(player->globals, player->seqCmdArgs.TrackOverridePatch.bank, track->patch, &track->unk_10);
track->instrument = au_get_instrument(player->globals, player->seqCmdArgs.TrackOverridePatch.bank, track->patch, &track->envelope);
}
void au_BGMCmd_E9_SubTrackVolume(BGMPlayer* arg0, BGMPlayerTrack* track) {
@ -1648,7 +1648,7 @@ void au_BGMCmd_F5_TrackVoice(BGMPlayer* player, BGMPlayerTrack* track) {
patch = (u8)instrument->bankPatch;
volume = instrument->volume & 0x7F;
track->patch = patch;
track->instrument = au_get_instrument(player->globals, bank, patch, &track->unk_10);
track->instrument = au_get_instrument(player->globals, bank, patch, &track->envelope);
if (volume != 0) {
volume <<= 0x18;
}
@ -1662,12 +1662,12 @@ void au_BGMCmd_F5_TrackVoice(BGMPlayer* player, BGMPlayerTrack* track) {
void au_BGMCmd_F7_SubTrackReverbType(BGMPlayer* player, BGMPlayerTrack* track) {
u8 index = player->seqCmdArgs.SubTrackReverbType.index;
s8 type = player->effectIndices[index];
s8 busId = player->effectIndices[index];
if ((index < 4) && (type >= 0)) {
track->subtrackReverbType = type;
if ((index < 4) && (busId >= 0)) {
track->subtrackBusId = busId;
} else {
track->subtrackReverbType = player->defaultReverbType;
track->subtrackBusId = player->busId;
}
}
@ -1703,8 +1703,8 @@ void au_BGMCmd_FC_Jump(BGMPlayer* player, BGMPlayerTrack* track) {
track->unk_4D = 0;
track->unkVolume = 0;
for (i = track->unk_52; i < track->unk_53; i++) {
AlUnkVoice* voice = &player->globals->voices[i];
if ((voice->priority == player->priority) && (voice->unk_1C != NULL)) {
AuVoice* voice = &player->globals->voices[i];
if ((voice->priority == player->priority) && (voice->cmdPtr != NULL)) {
au_reset_voice(voice, i);
}
}
@ -1720,7 +1720,7 @@ void au_BGMCmd_FC_Jump(BGMPlayer* player, BGMPlayerTrack* track) {
track->trackTremoloTime = 0;
track->subTrackVolumeTime = 0;
track->unk_57 = 0;
track->subtrackReverbType = player->defaultReverbType;
track->subtrackBusId = player->busId;
}
void au_BGMCmd_FF(BGMPlayer* player, BGMPlayerTrack* track) {
@ -1736,7 +1736,7 @@ void au_BGMCmd_FF(BGMPlayer* player, BGMPlayerTrack* track) {
switch (arg0) {
case 1:
if ((arg1 < ARRAY_COUNT(player->effectIndices)) && ((s8)player->effectIndices[arg1] >= 0)) {
player->globals->channelDelayGroupIdx = player->effectIndices[arg1];
player->globals->channelDelayBusId = player->effectIndices[arg1];
if (arg2 != 0) {
temp_a3 = arg2 & 0xF;
temp_a1 = ((arg2 >> 4) & 1) + 1;
@ -1785,10 +1785,10 @@ void au_BGMCmd_FF(BGMPlayer* player, BGMPlayerTrack* track) {
break;
case 5:
if (player->soundManager != NULL) {
for (i = 0; i < ARRAY_COUNT(player->soundManager->unk_90); i++) {
if ((player->soundManager->unk_90[i].unk_0) == 0) {
player->soundManager->unk_90[i].unk_0 = arg1;
player->soundManager->unk_90[i].volume = ((player->fadeInfo.currentVolume.u16 * player->fadeInfo.volScale.u16) + 0x7FFF) >> 0x17;
for (i = 0; i < ARRAY_COUNT(player->soundManager->bgmSounds); i++) {
if ((player->soundManager->bgmSounds[i].unk_0) == 0) {
player->soundManager->bgmSounds[i].unk_0 = arg1;
player->soundManager->bgmSounds[i].volume = ((player->fadeInfo.currentVolume.u16 * player->fadeInfo.volScale.u16) + 0x7FFF) >> 0x17;
break;
}
}
@ -1990,7 +1990,7 @@ void func_80050900(BGMPlayer* player) {
u8 i;
for (i = 0; i < ARRAY_COUNT(player->globals->voices); i++) {
AlUnkVoice* voice = &player->globals->voices[i];
AuVoice* voice = &player->globals->voices[i];
if (voice->priority == player->priority) {
au_reset_voice(voice, i);
}
@ -2001,7 +2001,7 @@ AuResult func_80050970(SongUpdateEvent* update) {
BGMPlayer* player;
BGMPlayerTrack* track;
BGMPlayerTrack* parentTrack;
AlUnkVoice* voice;
AuVoice* voice;
s32 i;
s32 j;
s8 oldVolume;
@ -2025,8 +2025,8 @@ AuResult func_80050970(SongUpdateEvent* update) {
for (j = parentTrack->unk_52; j < parentTrack->unk_53; j++) {
voice = &player->globals->voices[j];
if (voice->priority == player->priority) {
voice->unk_14.unk_04 = &D_80078554;
voice->unk_flags_3D |= AU_VOICE_3D_FLAG_10;
voice->envelope.cmdListRelease = EnvelopeReleaseDefaultFast;
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_KEY_RELEASED;
}
}
oldVolume = track->subTrackVolume >> 24;
@ -2043,8 +2043,8 @@ AuResult func_80050970(SongUpdateEvent* update) {
for (j = track->unk_52; j < track->unk_53; j++) {
voice = &player->globals->voices[j];
if (voice->priority == player->priority) {
voice->unk_14.unk_04 = &D_80078554;
voice->unk_flags_3D |= AU_VOICE_3D_FLAG_10;
voice->envelope.cmdListRelease = EnvelopeReleaseDefaultFast;
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_KEY_RELEASED;
}
}
oldVolume = parentTrack->subTrackVolume >> 24;

View File

@ -1,31 +1,52 @@
#include "audio.h"
extern s8 BlankMseqData;
extern u8 BlankMseqData[];
enum LambdaState24 {
LAMBDA_24_0 = 0,
LAMBDA_24_1 = 1,
LAMBDA_24_2 = 2,
LAMBDA_24_3 = 3
#define TRACK_ID_DRUM 9
enum AmbientMode {
AMB_MODE_NORMAL = 0,
AMB_MODE_RESUMING = 1,
AMB_MODE_STOPPED = 2,
AMB_MODE_PAUSING = 3
};
enum MseqPlayState {
MSEQ_PLAYER_PLAYING = 0,
MSEQ_PLAYER_STOPPED = 1,
MSEQ_PLAYER_STOPPING = 2
enum AmbientFadeState {
AMB_FADE_IN = 0,
AMB_FADE_OUT = 1,
AMB_FADE_OUT_PAUSING = 2,
};
void au_mseq_manager_init(AuAmbienceManager* manager, s8 priority, s8 reverbType, AuGlobals* globals) {
AuAmbPlayer* lambda;
enum AmbientPlayState {
AMB_PLAYER_PLAYING = 0,
AMB_PLAYER_STOPPED = 1,
AMB_PLAYER_STOPPING = 2
};
enum MSEQCommand {
MSEQ_CMD_80_STOP_SOUND = 0x80,
MSEQ_CMD_90_PLAY_SOUND = 0x90,
MSEQ_CMD_A0_SET_VOLUME_PAN = 0xA0,
MSEQ_CMD_B0_MULTI = 0xB0,
MSEQ_CMD_C0_SET_INSTRUMENT = 0xC0,
MSEQ_CMD_E0_TUNING = 0xE0,
MSEQ_CMD_SUB_66_START_LOOP = 0x66,
MSEQ_CMD_SUB_67_END_LOOP = 0x67,
MSEQ_CMD_SUB_68_SET_REVERB = 0x68,
MSEQ_CMD_SUB_69_SET_RESUMABLE = 0x69,
};
void au_amb_manager_init(AmbienceManager* manager, s8 priority, s8 busId, AuGlobals* globals) {
AmbiencePlayer* player;
s32 i;
au_memset(manager, sizeof(*manager), 0);
for (i = 0; i < ARRAY_COUNT(manager->mseqPlayers); i++) {
lambda = &manager->mseqPlayers[i];
lambda->unk_14.u8[0] = i;
lambda->unk_18 = 1;
lambda->unk_38 = 0x7F000000;
for (i = 0; i < ARRAY_COUNT(manager->players); i++) {
player = &manager->players[i];
player->id.playerIndex = i;
player->delay = 1;
player->fadeVolume = 0x7F000000;
}
manager->globals = globals;
@ -33,46 +54,46 @@ void au_mseq_manager_init(AuAmbienceManager* manager, s8 priority, s8 reverbType
manager->nextUpdateCounter = 2;
manager->nextUpdateInterval = 2;
manager->priority = priority;
manager->defaultReverbType = reverbType;
manager->busId = busId;
}
AuResult func_80050C30(u32 arg0) {
if (gAuAmbienceManager->unk_20 <= arg0) {
AuResult au_amb_check_player_index(u32 index) {
if (gAuAmbienceManager->numActivePlayers <= index) {
return AU_AMBIENCE_ERROR_3;
} else {
return AU_RESULT_OK;
}
}
void func_80050C54(s32 arg0, s32 arg1) {
gAuAmbienceManager->unk_21 = arg1;
void au_amb_load_tracks_fade(s32 arg0, s32 arg1) {
gAuAmbienceManager->loadTracksFadeInfo = arg1;
}
void au_mseq_set_disabled(s32 index, s32 disable) {
AuAmbienceManager* manager = gAuAmbienceManager;
AuAmbPlayer* ambPlayer = &manager->mseqPlayers[index];
void au_amb_set_disabled(s32 index, s32 disable) {
AmbienceManager* manager = gAuAmbienceManager;
AmbiencePlayer* ambPlayer = &manager->players[index];
if (!disable) {
ambPlayer->playState = MSEQ_PLAYER_PLAYING;
ambPlayer->playState = AMB_PLAYER_PLAYING;
} else {
ambPlayer->playState = MSEQ_PLAYER_STOPPING;
ambPlayer->playState = AMB_PLAYER_STOPPING;
}
}
AuResult func_80050CA0(s32 index, s32 time) {
AuAmbPlayer* lambda = &gAuAmbienceManager->mseqPlayers[index];
AuResult au_amb_start(s32 index, s32 time) {
AmbiencePlayer* player = &gAuAmbienceManager->players[index];
MSEQHeader* mseq = gAuAmbienceManager->mseqFiles[index];
AuResult status = AU_RESULT_OK;
if (mseq != NULL) {
if (lambda->mseqName == 0) {
func_800510A4(gAuAmbienceManager, mseq, index);
if (player->mseqName == 0) {
au_amb_play_sequence(gAuAmbienceManager, mseq, index);
if (time != 0) {
lambda->time = time;
lambda->unk_2A = 0;
lambda->volume = 0x7F;
lambda->unk_26 = 0;
func_80050D50(lambda);
player->fadeSettingsTime = time;
player->fadeSettingsInitial = 0;
player->fadeSettingsGoal = 127;
player->fadeSettingsType = AMB_FADE_IN;
au_amb_fade_setup(player);
}
} else {
status = AU_AMBIENCE_ERROR_1;
@ -83,299 +104,645 @@ AuResult func_80050CA0(s32 index, s32 time) {
return status;
}
void func_80050D50(AuAmbPlayer* lambda) {
u16 time = lambda->time;
void au_amb_fade_setup(AmbiencePlayer* player) {
u16 time = player->fadeSettingsTime;
if (lambda->unk_2A == 0xFF) {
lambda->unk_2A = lambda->unk_38 >> 0x18;
if (player->fadeSettingsInitial == 255) {
player->fadeSettingsInitial = player->fadeVolume >> 0x18;
}
if (time >= SND_MIN_DURATION && time <= SND_MAX_DURATION) {
lambda->unk_38 = lambda->unk_2A << 0x18;
lambda->unk_42 = lambda->volume;
lambda->volInterpTime = (u32)(time * 10) / 115;
lambda->volInterpStep = ((lambda->volume - lambda->unk_2A) << 0x18) / ((s16)lambda->volInterpTime & 0xFFFF);
player->fadeVolume = player->fadeSettingsInitial << 0x18;
player->fadeGoal = player->fadeSettingsGoal;
player->fadeTime = (u32)(time * 10) / 115; // TODO figure out why is the ratio like this
player->fadeStep = ((player->fadeSettingsGoal - player->fadeSettingsInitial) << 0x18) / ((s16)player->fadeTime & 0xFFFF);
}
lambda->time = 0;
lambda->unk_2A = 0;
lambda->volume = 0;
player->fadeSettingsTime = 0;
player->fadeSettingsInitial = 0;
player->fadeSettingsGoal = 0;
}
void func_80050EF0_fade_out_unk(s32 index, s32 time) {
AuAmbPlayer* lambda = &gAuAmbienceManager->mseqPlayers[index];
void au_amb_pause(s32 index, s32 time) {
AmbiencePlayer* player = &gAuAmbienceManager->players[index];
if ((lambda->mseqReadStart != NULL) && (lambda->mseqReadPos != NULL)) {
if (player->mseqReadStart != NULL && player->mseqReadPos != NULL) {
if (time != 0) {
lambda->unk_2A = 0xFF;
lambda->time = time;
lambda->volume = 0;
lambda->unk_26 = 2;
player->fadeSettingsInitial = 255;
player->fadeSettingsTime = time;
player->fadeSettingsGoal = 0;
player->fadeSettingsType = AMB_FADE_OUT_PAUSING;
return;
}
lambda->unk_24 = LAMBDA_24_3;
player->mode = AMB_MODE_PAUSING;
}
}
void func_80050EF0_fade_in_unk(s32 index, s32 time) {
AuAmbPlayer* lambda = &gAuAmbienceManager->mseqPlayers[index];
void au_amb_resume(s32 index, s32 time) {
AmbiencePlayer* player = &gAuAmbienceManager->players[index];
if ((lambda->mseqReadStart != NULL) && (lambda->mseqReadPos != NULL)) {
lambda->unk_24 = LAMBDA_24_1;
if (player->mseqReadStart != NULL && player->mseqReadPos != NULL) {
player->mode = AMB_MODE_RESUMING;
if (time != 0) {
lambda->time = time;
player->fadeSettingsTime = time;
} else {
lambda->time = SND_MIN_DURATION;
player->fadeSettingsTime = SND_MIN_DURATION;
}
lambda->unk_2A = 0;
lambda->volume = SND_MAX_VOLUME_8;
lambda->unk_26 = 0;
player->fadeSettingsInitial = 0;
player->fadeSettingsGoal = SND_MAX_VOLUME_8;
player->fadeSettingsType = AMB_FADE_IN;
}
}
void func_80050EF0_fade_out_quick(s32 index) {
AuAmbPlayer* lambda = &gAuAmbienceManager->mseqPlayers[index];
void au_amb_stop_quick(s32 index) {
AmbiencePlayer* player = &gAuAmbienceManager->players[index];
if ((lambda->mseqReadStart != NULL) && (lambda->mseqReadPos != NULL)) {
if (lambda->unk_24 != LAMBDA_24_0) {
lambda->mseqReadPos = NULL;
lambda->mseqName = 0;
lambda->unk_24 = LAMBDA_24_0;
if (player->mseqReadStart != NULL && player->mseqReadPos != NULL) {
if (player->mode != AMB_MODE_NORMAL) {
player->mseqReadPos = NULL;
player->mseqName = 0;
player->mode = AMB_MODE_NORMAL;
return;
}
lambda->mseqReadPos = &BlankMseqData;
lambda->unk_18 = 1;
player->mseqReadPos = BlankMseqData;
player->delay = 1;
}
}
void func_80050EF0_fade_out_slow(s32 index, s32 time) {
AuAmbPlayer* lambda = &gAuAmbienceManager->mseqPlayers[index];
void au_amb_stop_slow(s32 index, s32 time) {
AmbiencePlayer* player = &gAuAmbienceManager->players[index];
if ((lambda->mseqReadStart != NULL) && (lambda->mseqReadPos != NULL)) {
if (player->mseqReadStart != NULL && player->mseqReadPos != NULL) {
if (time != 0) {
lambda->time = time;
player->fadeSettingsTime = time;
} else {
lambda->time = SND_MIN_DURATION;
player->fadeSettingsTime = SND_MIN_DURATION;
}
lambda->unk_2A = -1;
lambda->volume = 0;
lambda->unk_26 = 1;
player->fadeSettingsInitial = 255;
player->fadeSettingsGoal = 0;
player->fadeSettingsType = AMB_FADE_OUT;
}
}
void au_mseq_set_volume(s32 index, s32 time, s32 volume) {
AuAmbPlayer* lambda = &gAuAmbienceManager->mseqPlayers[index];
if ((lambda->mseqReadStart != 0) && (lambda->mseqReadPos != 0)) {
void au_amb_set_volume(s32 index, s32 time, s32 volume) {
AmbiencePlayer* player = &gAuAmbienceManager->players[index];
if ((player->mseqReadStart != 0) && (player->mseqReadPos != 0)) {
if (volume <= 0) {
volume = 1;
} else if (volume > SND_MAX_VOLUME_8) {
volume = SND_MAX_VOLUME_8;
}
if (time != 0) {
lambda->time = time;
player->fadeSettingsTime = time;
} else {
lambda->time = SND_MIN_DURATION;
player->fadeSettingsTime = SND_MIN_DURATION;
}
lambda->unk_2A = -1;
lambda->volume = volume;
lambda->unk_26 = 0;
player->fadeSettingsInitial = 255;
player->fadeSettingsGoal = volume;
player->fadeSettingsType = AMB_FADE_IN;
}
}
AuResult func_80051050(s32 arg0) {
AuAmbPlayer* lambda = &gAuAmbienceManager->mseqPlayers[arg0];
AuResult au_amb_is_stopped(s32 index) {
AmbiencePlayer* player = &gAuAmbienceManager->players[index];
AuResult status = AU_RESULT_OK;
if ((lambda->mseqReadStart != NULL) && (lambda->mseqReadPos != NULL)) {
if (player->mseqReadStart != NULL && player->mseqReadPos != NULL) {
status = AU_AMBIENCE_ERROR_1;
if (lambda->unk_24 != LAMBDA_24_0) {
if (player->mode != AMB_MODE_NORMAL) {
status = AU_AMBIENCE_ERROR_2;
}
}
return status;
}
void func_800510A4(AuAmbienceManager* manager, MSEQHeader* mseqFile, s32 index) {
AuAmbPlayer* lambda;
AlUnkXi* xi;
void au_amb_play_sequence(AmbienceManager* manager, MSEQHeader* mseqFile, s32 index) {
AmbiencePlayer* player;
AmbienceTrack* track;
AuFilePos readPos;
s32 i;
lambda = &manager->mseqPlayers[index];
au_memset(lambda, sizeof(*lambda), 0);
player = &manager->players[index];
au_memset(player, sizeof(*player), 0);
lambda->mseqFile = mseqFile;
player->mseqFile = mseqFile;
readPos = AU_FILE_RELATIVE(mseqFile->dataStart, mseqFile);
lambda->unk_14.u8[0] = index;
lambda->mseqReadPos = readPos;
lambda->unk_10 = readPos;
lambda->unk_0C = readPos;
lambda->mseqReadStart = readPos;
player->id.playerIndex = index;
player->mseqReadPos = readPos;
player->loopStartPos[1] = readPos;
player->loopStartPos[0] = readPos;
player->mseqReadStart = readPos;
lambda->unk_18 = 1;
lambda->unk_38 = 0x7F000000;
lambda->unk_42 = 0x7F;
player->delay = 1;
player->fadeVolume = 0x7F000000;
player->fadeGoal = 0x7F;
lambda->mseqName = lambda->mseqFile->name;
lambda->firstVoiceIdx = lambda->mseqFile->first_iota;
lambda->lastVoiceIdx = lambda->firstVoiceIdx + 16;
if (lambda->lastVoiceIdx > 24) {
lambda->lastVoiceIdx = 24;
player->mseqName = player->mseqFile->name;
player->firstVoiceIdx = player->mseqFile->firstVoiceIdx;
player->lastVoiceIdx = player->firstVoiceIdx + 16;
if (player->lastVoiceIdx > 24) {
player->lastVoiceIdx = 24;
}
for (i = 0; i < 10; i++) {
xi = &lambda->unk_44[i];
xi->instrument = manager->globals->defaultInstrument;
xi->unk_18.full = 0x7FFFFFFF;
xi->pan = 0x40;
for (i = 0; i < ARRAY_COUNT(player->tracks); i++) {
track = &player->tracks[i];
track->instrument = manager->globals->defaultInstrument;
track->volumeLerp.current = 0x7FFFFFFF;
track->pan = 64;
}
lambda->unk_43 = 1;
player->resetRequired = TRUE;
}
void snd_ambient_manager_update(AuAmbienceManager* manager) {
void au_amb_manager_update(AmbienceManager* manager) {
u32 i;
s32 j;
for (i = 0; i < ARRAY_COUNT(manager->mseqVoiceStates); i++) {
AlUnkIota* temp = &manager->mseqVoiceStates[i];
for (i = 0; i < ARRAY_COUNT(manager->voiceStates); i++) {
AmbienceVoiceState* voiceState = &manager->voiceStates[i];
if ((temp->unk_00.u8[3] == 1) && (manager->globals->voices[i].priority != manager->priority)) {
temp->unk_00.s32 = 0;
if (voiceState->info.released == TRUE && manager->globals->voices[i].priority != manager->priority) {
voiceState->info.all = 0;
}
}
for (j = 0; j < ARRAY_COUNT(manager->mseqPlayers); j++) {
AuAmbPlayer* lambda = &manager->mseqPlayers[j];
s32 var;
for (j = 0; j < ARRAY_COUNT(manager->players); j++) {
AmbiencePlayer* player = &manager->players[j];
s32 mode;
if (lambda->mseqReadPos != NULL) {
if (manager->unk_21) {
// not usually taken
func_80051334(manager, lambda);
if (player->mseqReadPos != NULL) {
if (manager->loadTracksFadeInfo) {
au_amb_load_track_fade_info(manager, player);
}
var = lambda->unk_24;
if (var != LAMBDA_24_0) {
if (var == LAMBDA_24_3) {
lambda->unk_24 = LAMBDA_24_2;
func_800522A8(manager, lambda);
au_mseq_player_stop(manager, lambda);
} else if (lambda->unk_24 == LAMBDA_24_1) {
lambda->unk_24 = LAMBDA_24_0;
if (lambda->time != 0) {
func_80050D50(lambda);
mode = player->mode;
if (mode != AMB_MODE_NORMAL) {
if (mode == AMB_MODE_PAUSING) {
player->mode = AMB_MODE_STOPPED;
au_amb_save_voices(manager, player);
au_amb_player_stop(manager, player);
} else if (player->mode == AMB_MODE_RESUMING) {
player->mode = AMB_MODE_NORMAL;
if (player->fadeSettingsTime != 0) {
au_amb_fade_setup(player);
}
func_8005232C(manager, lambda);
au_amb_restore_voices(manager, player);
}
} else {
if (lambda->time != 0) {
func_80050D50(lambda);
// case AMB_MODE_NORMAL
if (player->fadeSettingsTime != 0) {
au_amb_fade_setup(player);
}
if (lambda->playState == MSEQ_PLAYER_STOPPING) {
au_mseq_player_stop(manager, lambda);
lambda->playState = MSEQ_PLAYER_STOPPED;
if (player->playState == AMB_PLAYER_STOPPING) {
au_amb_player_stop(manager, player);
player->playState = AMB_PLAYER_STOPPED;
}
func_80051434(manager, lambda);
au_amb_player_update(manager, player);
}
}
}
manager->unk_21 = FALSE;
manager->loadTracksFadeInfo = FALSE;
}
void func_80051334(AuAmbienceManager* manager, AuAmbPlayer* lambda) {
void au_amb_load_track_fade_info(AmbienceManager* manager, AmbiencePlayer* player) {
MSEQHeader* mseqFile;
AlUnkMSEQData* var_a0;
AlUnkXi* xi;
MSEQTrackData* trackData;
AmbienceTrack* track;
s32 offset;
s32 count;
s32 lim;
mseqFile = lambda->mseqFile;
count = mseqFile->unkCount;
if (count != 0 && mseqFile->unkOffset != 0) {
var_a0 = AU_FILE_RELATIVE(mseqFile->unkOffset, mseqFile);
mseqFile = player->mseqFile;
count = mseqFile->trackSettingsCount;
if (count != 0 && mseqFile->trackSettingsOffset != 0) {
trackData = AU_FILE_RELATIVE(mseqFile->trackSettingsOffset, mseqFile);
while (count--) {
xi = &lambda->unk_44[var_a0->unk_00];
if (var_a0->unk_01 == 0) {
xi->unk_14 = var_a0->unk_02;
xi->unk_10 = (var_a0->unk_04 << 0x10) / var_a0->unk_02;
xi->unk_16 = var_a0->unk_06;
} else if (var_a0->unk_01 == 1) {
xi->unk_20 = var_a0->unk_02;
xi->unk_1C = (var_a0->unk_04 << 0x10) / var_a0->unk_02;
xi->unk_22 = var_a0->unk_06;
track = &player->tracks[trackData->trackIndex];
if (trackData->type == 0) {
track->tuneLerp.time = trackData->time;
track->tuneLerp.step = (trackData->delta << 0x10) / trackData->time;
track->tuneLerp.goal = trackData->goal;
} else if (trackData->type == 1) {
track->volumeLerp.time = trackData->time;
track->volumeLerp.step = (trackData->delta << 0x10) / trackData->time;
track->volumeLerp.goal = trackData->goal;
}
var_a0++;
trackData++;
}
}
}
INCLUDE_ASM(void, "audio/2BF90", func_80051434, AuAmbienceManager* arg0, AuAmbPlayer* arg1);
void au_amb_player_update(AmbienceManager* manager, AmbiencePlayer* player) {
u8 isVolumeChanged[16];
u8 isPitchChanged[16];
AuGlobals* globals;
u8 fadeVolChanged;
AmbienceVoiceState* voiceState;
AuVoice* voice;
BGMDrumInfo* drum;
u32 trackIdx;
s32 temp;
s32 i;
u16 bankPatch;
u32 count;
s32 loopId;
u8 op, arg1, arg2;
AmbienceTrack* track;
// could return u8?
s32 au_mseq_read_next(AuAmbPlayer* state) {
globals = manager->globals;
fadeVolChanged = FALSE;
for (i = 0; i < 16U; i++) { // required to use unsigned literal
isVolumeChanged[i] = FALSE;
isPitchChanged[i] = FALSE;
}
if (player->resetRequired == TRUE) {
au_amb_player_stop(manager, player);
player->resetRequired = FALSE;
}
if (player->fadeTime != 0) {
player->fadeVolume += player->fadeStep;
player->fadeTime--;
if (player->fadeTime == 0) {
player->fadeVolume = player->fadeGoal << 0x18;
if (player->fadeSettingsType == AMB_FADE_IN) {
// do nothing
} else if (player->fadeSettingsType == AMB_FADE_OUT) {
player->mseqReadPos = BlankMseqData;
player->delay = 1;
} else if (player->fadeSettingsType == AMB_FADE_OUT_PAUSING) {
player->mode = AMB_MODE_PAUSING;
}
}
fadeVolChanged = TRUE;
}
// update pitch
for (trackIdx = 0; trackIdx < ARRAY_COUNT(player->tracks); trackIdx++) {
track = &player->tracks[trackIdx];
if (track->tuneLerp.time != 0) {
track->tuneLerp.time--;
if (track->tuneLerp.time != 0) {
track->tuneLerp.current += track->tuneLerp.step;
} else {
track->tuneLerp.current = track->tuneLerp.goal << 0x10;
}
temp = player->id.all + (trackIdx << 0x10);
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
voiceState = &manager->voiceStates[i - player->firstVoiceIdx];
// update all voices belonging to current track
if ((voiceState->info.all & 0xFFFF0000) == temp) {
voice = &globals->voices[i];
if (voice->priority == manager->priority && trackIdx != TRACK_ID_DRUM) {
voice->pitchRatio = au_compute_pitch_ratio(voiceState->pitch + (track->tuneLerp.current >> 0x10)) * track->instrument->pitchRatio;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PITCH;
isPitchChanged[i - player->firstVoiceIdx] = TRUE;
}
}
}
}
}
// update volume
for (trackIdx = 0; trackIdx < ARRAY_COUNT(player->tracks); trackIdx++) {
track = &player->tracks[trackIdx];
if (track->volumeLerp.time != 0) {
track->volumeLerp.time--;
if (track->volumeLerp.time != 0) {
track->volumeLerp.current += track->volumeLerp.step;
} else {
track->volumeLerp.current = track->volumeLerp.goal << 0x10;
}
temp = player->id.all + (trackIdx << 0x10);
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
voiceState = &manager->voiceStates[i - player->firstVoiceIdx];
// update all voices belonging to current track
if ((voiceState->info.all & 0xFFFF0000) == temp) {
voice = &globals->voices[i];
if (voice->priority == manager->priority) {
track = &player->tracks[voiceState->info.trackIndex];
voice->clientVolume = ((player->fadeVolume >> 0x18) * (track->volumeLerp.current >> 0x10) * voiceState->volume) >> 0xE;
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_VOL_CHANGED;
}
}
}
}
}
player->delay--;
if (player->delay <= 0) {
while (player->delay == 0) {
op = au_amb_read_next(player);
if ((s8)op >= 0) {
if (op == 0) {
// stop
player->mseqReadPos = NULL;
player->mseqName = 0;
au_amb_player_stop(manager, player);
break;
}
if (op >= 0x78) {
// long delay
player->delay = ((op & 7) << 8) + au_amb_read_next(player) + 0x78;
} else {
//short delay
player->delay = op;
}
continue;
}
// op >= 0x80
// op & 0xF0 : command
// op & 0xF : track index
arg1 = au_amb_read_next(player);
trackIdx = op & 0xF;
track = &player->tracks[trackIdx];
switch (op & 0xF0) {
case MSEQ_CMD_80_STOP_SOUND:
// arg1: sound index
if (player->playState == AMB_PLAYER_PLAYING) {
temp = player->id.all + (trackIdx << 0x10) + (arg1 << 8);
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
if (manager->voiceStates[i - player->firstVoiceIdx].info.all == temp) {
manager->voiceStates[i - player->firstVoiceIdx].info.released = 1;
voice = &globals->voices[i];
if (voice->priority == manager->priority) {
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_KEY_RELEASED;
}
}
}
}
break;
case MSEQ_CMD_90_PLAY_SOUND:
// arg1: pitch or drum sound id
// arg2: volume
arg2 = au_amb_read_next(player);
if (player->playState == AMB_PLAYER_PLAYING) {
// find free voice
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
voice = &globals->voices[i];
if (voice->priority == AU_PRIORITY_FREE) {
break;
}
}
if (i >= player->lastVoiceIdx) {
// use another ambience voice
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
voice = &globals->voices[i];
if (voice->priority == manager->priority) {
au_reset_voice(voice, i);
break;
}
}
}
if (i >= player->lastVoiceIdx) {
// try stealing voice with lower priority
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
voice = &globals->voices[i];
if (voice->priority < manager->priority) {
au_reset_voice(voice, i);
break;
}
}
}
if (i < player->lastVoiceIdx) {
isVolumeChanged[i - player->firstVoiceIdx] = TRUE;
isPitchChanged[i - player->firstVoiceIdx] = TRUE;
voiceState = &manager->voiceStates[i - player->firstVoiceIdx];
// set playerIndex, trackIndex and tune
voiceState->info.all = player->id.all + (trackIdx << 0x10) + (arg1 << 8);
if (track->flags & 1) {
voiceState->isResumable = TRUE;
} else {
voiceState->isResumable = FALSE;
}
if (trackIdx != TRACK_ID_DRUM) {
if (track->flags & 1) {
voiceState->isResumable = TRUE;
} else {
voiceState->isResumable = FALSE;
}
voiceState->pitch = (arg1 & 0x7F) * 100 - track->instrument->keyBase;
voiceState->volume = arg2 & 0x7F;
voice->clientVolume = ((player->fadeVolume >> 0x18) * (track->volumeLerp.current >> 0x10) * voiceState->volume) >> 0xE;
voice->pitchRatio = au_compute_pitch_ratio(voiceState->pitch + (track->tuneLerp.current >> 0x10)) * track->instrument->pitchRatio;
voice->pan = track->pan;
voice->reverb = track->reverb;
voice->instrument = track->instrument;
voice->busId = manager->busId;
voice->envelope.cmdListPress = track->envelope.cmdListPress;
voice->envelope.cmdListRelease = track->envelope.cmdListRelease;
} else {
voiceState->isResumable = FALSE;
drum = &manager->globals->dataPER->drums[arg1 & 0x7F];
bankPatch = drum->bankPatch;
voice->instrument = au_get_instrument(manager->globals, bankPatch >> 8, bankPatch & 0xFF, &voice->envelope);
voiceState->pitch = drum->keyBase - voice->instrument->keyBase;
voiceState->volume = ((arg2 & 0x7F) * drum->volume) >> 7;
voice->clientVolume = ((player->fadeVolume >> 0x18) * (track->volumeLerp.current >> 0x10) * voiceState->volume) >> 0xE;
voice->pitchRatio = au_compute_pitch_ratio(voiceState->pitch) * voice->instrument->pitchRatio;
voice->pan = drum->pan;
voice->reverb = drum->reverb;
voice->busId = manager->busId;
}
voice->syncFlags = AU_VOICE_SYNC_FLAG_ALL;
voice->priority = manager->priority;
voice->clientPriority = voice->priority;
}
}
break;
case MSEQ_CMD_A0_SET_VOLUME_PAN:
// higher bit: set pan (1) or volume (0)
// lower 7 bits: value
if (arg1 & 0x80) {
track->pan = arg1 & 0x7F;
temp = player->id.all + (trackIdx << 0x10);
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
voiceState = &manager->voiceStates[i - player->firstVoiceIdx];
if ((voiceState->info.all & 0xFFFF0000) == temp) {
voice = &globals->voices[i];
if (voice->priority == manager->priority && trackIdx != TRACK_ID_DRUM) {
voice->pan = track->pan;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PAN_FXMIX;
}
}
}
} else {
track->volumeLerp.current = arg1 << 0x18;
if (track->volumeLerp.current != 0) {
track->volumeLerp.current |= 0xFFFFFF;
}
temp = player->id.all + (trackIdx << 0x10);
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
voiceState = &manager->voiceStates[i - player->firstVoiceIdx];
if ((voiceState->info.all & 0xFFFF0000) == temp) {
voice = &globals->voices[i];
if (voice->priority == manager->priority) {
voice->clientVolume = ((player->fadeVolume >> 0x18) * (track->volumeLerp.current >> 0x10) * voiceState->volume) >> 0xE;
if (!isVolumeChanged[i - player->firstVoiceIdx]) {
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_VOL_CHANGED;
isVolumeChanged[i - player->firstVoiceIdx] = TRUE;
}
}
}
}
}
break;
case MSEQ_CMD_B0_MULTI:
// arg1: sub command
// arg2: depends on sub command
arg2 = au_amb_read_next(player);
switch (arg1) {
case MSEQ_CMD_SUB_66_START_LOOP:
// arg2: loop id
player->loopStartPos[arg2 & 1] = player->mseqReadPos;
break;
case MSEQ_CMD_SUB_67_END_LOOP:
// arg2 lower bit: loop id
// (arg2 & 0x7C) >> 2: loop count
loopId = arg2 & 1;
count = (arg2 & 0x7C) >> 2;
if (count != 0) {
if (player->loopCount[loopId] != 0) {
player->loopCount[loopId]--;
// if it's the last iteration then don't jump to the loop start
if (player->loopCount[loopId] != 0) {
player->mseqReadPos = player->loopStartPos[loopId];
}
} else {
// first iteration, set loop counter
player->mseqReadPos = player->loopStartPos[loopId];
player->loopCount[loopId] = count;
}
} else {
// infinite loop
player->mseqReadPos = player->loopStartPos[loopId];
player->loopCount[loopId] = 0;
}
break;
case MSEQ_CMD_SUB_68_SET_REVERB:
track->reverb = arg2;
break;
case MSEQ_CMD_SUB_69_SET_RESUMABLE:
if (arg2 == 1) {
track->flags |= 1;
}
break;
}
break;
case MSEQ_CMD_C0_SET_INSTRUMENT:
// arg1: bank
// arg2: patch
arg2 = au_amb_read_next(player);
if (trackIdx != TRACK_ID_DRUM) {
track->instrument = au_get_instrument(manager->globals, arg1, arg2, &track->envelope);
}
break;
case MSEQ_CMD_E0_TUNING:
// arg1: coarse tune
// arg2: fine tune
track->tuneLerp.current = (arg1 << 0x18) + (au_amb_read_next(player) << 0x10);
temp = player->id.all + (trackIdx << 0x10);
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
voiceState = &manager->voiceStates[i - player->firstVoiceIdx];
if ((voiceState->info.all & 0xFFFF0000) == temp) {
voice = &globals->voices[i];
if (voice->priority == manager->priority && trackIdx != TRACK_ID_DRUM) {
voice->pitchRatio = au_compute_pitch_ratio(voiceState->pitch + (track->tuneLerp.current >> 0x10)) * track->instrument->pitchRatio;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PITCH;
isPitchChanged[i - player->firstVoiceIdx] = 1;
}
}
}
break;
case 0xF0: // required to match
break;
}
}
}
if (fadeVolChanged) {
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
voiceState = &manager->voiceStates[i - player->firstVoiceIdx];
// update all voices belonging to this player
if ((voiceState->info.all & 0xFF000000) == player->id.all) {
voice = &globals->voices[i];
if (voice->priority == manager->priority && !isVolumeChanged[i - player->firstVoiceIdx]) {
track = &player->tracks[voiceState->info.trackIndex];
voice->clientVolume = ((player->fadeVolume >> 0x18) * (track->volumeLerp.current >> 0x10) * voiceState->volume) >> 0xE;
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_VOL_CHANGED;
}
}
}
}
}
u8 au_amb_read_next(AmbiencePlayer* state) {
u8 value = *state->mseqReadPos++;
return value;
}
void au_mseq_player_stop(AuAmbienceManager* manager, AuAmbPlayer* lambda) {
AlUnkVoice* voice;
Q32* temp_s1;
void au_amb_player_stop(AmbienceManager* manager, AmbiencePlayer* player) {
AuVoice* voice;
AmbienceVoiceState* voiceState;
s32 i;
for (i = lambda->firstVoiceIdx; i < lambda->lastVoiceIdx; i++) {
temp_s1 = &manager->mseqVoiceStates[i - lambda->firstVoiceIdx].unk_00;
if (*temp_s1->u8 == lambda->unk_14.u8[0]) {
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
voiceState = &manager->voiceStates[i - player->firstVoiceIdx];
if (voiceState->info.playerIndex == player->id.playerIndex) {
voice = &manager->globals->voices[i];
if (voice->priority == manager->priority) {
au_reset_voice(voice, i);
}
temp_s1->s32 = 0;
voiceState->info.all = 0;
}
}
}
void func_800522A8(AuAmbienceManager* arg0, AuAmbPlayer* lambda) {
AlUnkOmega* omega = lambda->unk_1D4;
u32 copied = 0;
void au_amb_save_voices(AmbienceManager* arg0, AmbiencePlayer* player) {
AmbienceSavedVoice* savedVoice = player->savedVoices;
u32 numSaved = 0;
s32 i;
for (i = lambda->firstVoiceIdx; i < lambda->lastVoiceIdx; i++) {
AlUnkIota* iota = &arg0->mseqVoiceStates[i - lambda->firstVoiceIdx];
for (i = player->firstVoiceIdx; i < player->lastVoiceIdx; i++) {
AmbienceVoiceState* voiceState = &arg0->voiceStates[i - player->firstVoiceIdx];
if (iota->unk_07 == 0) {
if (!voiceState->isResumable) {
continue;
}
omega->unk_00 = iota->unk_00.u8[1];
omega->unk_01 = iota->unk_00.u8[2];
omega->unk_02 = iota->volume;
savedVoice->trackIndex = voiceState->info.trackIndex;
savedVoice->tune = voiceState->info.tune;
savedVoice->volume = voiceState->volume;
omega++;
copied++;
if (copied >= 4) {
savedVoice++;
numSaved++;
if (numSaved >= ARRAY_COUNT(player->savedVoices)) {
break;
}
}
}
void func_8005232C(AuAmbienceManager* manager, AuAmbPlayer* lambda) {
void au_amb_restore_voices(AmbienceManager* manager, AmbiencePlayer* player) {
AuGlobals* globals;
AlUnkVoice* voice;
AlUnkOmega* omega;
AlUnkIota* iota;
AlUnkXi* xi;
AuVoice* voice;
AmbienceSavedVoice* savedVoice;
AmbienceVoiceState* voiceState;
AmbienceTrack* track;
u32 i, j;
globals = manager->globals;
if (lambda->playState == MSEQ_PLAYER_PLAYING) {
for (i = 0; i < ARRAY_COUNT(lambda->unk_1D4); i++) {
omega = &lambda->unk_1D4[i];
if (omega->unk_01 != 0) {
xi = &lambda->unk_44[omega->unk_00];
if (player->playState == AMB_PLAYER_PLAYING) {
for (i = 0; i < ARRAY_COUNT(player->savedVoices); i++) {
savedVoice = &player->savedVoices[i];
if (savedVoice->tune != 0) {
track = &player->tracks[savedVoice->trackIndex];
// find first free voice
for (j = lambda->firstVoiceIdx; j < lambda->lastVoiceIdx; j++) {
for (j = player->firstVoiceIdx; j < player->lastVoiceIdx; j++) {
voice = &globals->voices[j];
if (voice->priority == AU_PRIORITY_FREE) {
break;
@ -383,8 +750,8 @@ void func_8005232C(AuAmbienceManager* manager, AuAmbPlayer* lambda) {
}
// try stealing a voice with lower priority
if (j >= lambda->lastVoiceIdx) {
for (j = lambda->firstVoiceIdx; j < lambda->lastVoiceIdx; j++) {
if (j >= player->lastVoiceIdx) {
for (j = player->firstVoiceIdx; j < player->lastVoiceIdx; j++) {
voice = &globals->voices[j];
if (voice->priority < manager->priority) {
au_reset_voice(voice, j);
@ -393,27 +760,27 @@ void func_8005232C(AuAmbienceManager* manager, AuAmbPlayer* lambda) {
}
}
if (j < lambda->lastVoiceIdx) {
iota = &manager->mseqVoiceStates[j - lambda->firstVoiceIdx];
iota->unk_00.s32 = lambda->unk_14.s32 + (omega->unk_00 << 0x10) + (omega->unk_01 << 8);
iota->pitch = ((omega->unk_01 & 0x7F) * 100) - xi->instrument->keyBase;
iota->volume = omega->unk_02 & 0x7F;
voice->adjustedVolume = ((lambda->unk_38 >> 0x18) * xi->unk_18.half * iota->volume) >> 0xE;
voice->pitchRatio = au_compute_pitch_ratio(iota->pitch + xi->pitch) * xi->instrument->pitchRatio;
voice->pan = xi->pan;
voice->reverbAmt = xi->reverb;
voice->instrument = xi->instrument;
voice->reverbType = manager->defaultReverbType;
voice->unk_14.unk_00 = xi->unk_04.unk_00;
voice->unk_14.unk_04 = xi->unk_04.unk_04;
voice->unk_flags_43 = AU_VOICE_SYNC_FLAG_ALL;
if (j < player->lastVoiceIdx) {
voiceState = &manager->voiceStates[j - player->firstVoiceIdx];
voiceState->info.all = player->id.all + (savedVoice->trackIndex << 0x10) + (savedVoice->tune << 8);
voiceState->pitch = (savedVoice->tune & 0x7F) * 100 - track->instrument->keyBase;
voiceState->volume = savedVoice->volume & 0x7F;
voice->clientVolume = ((player->fadeVolume >> 0x18) * (track->volumeLerp.current >> 0x10) * voiceState->volume) >> 0xE;
voice->pitchRatio = au_compute_pitch_ratio(voiceState->pitch + (track->tuneLerp.current >> 0x10)) * track->instrument->pitchRatio;
voice->pan = track->pan;
voice->reverb = track->reverb;
voice->instrument = track->instrument;
voice->busId = manager->busId;
voice->envelope.cmdListPress = track->envelope.cmdListPress;
voice->envelope.cmdListRelease = track->envelope.cmdListRelease;
voice->syncFlags = AU_VOICE_SYNC_FLAG_ALL;
voice->priority = manager->priority;
voice->priorityCopy = voice->priority;
voice->clientPriority = voice->priority;
}
}
omega->unk_00 = 0;
omega->unk_01 = 0;
omega->unk_02 = 0;
savedVoice->trackIndex = 0;
savedVoice->tune = 0;
savedVoice->volume = 0;
}
}
}

View File

@ -1,155 +1,165 @@
#include "common.h"
#include "audio.h"
void func_800525A0(AuGlobals* globals) {
void au_update_stopped_voices(AuGlobals* globals) {
s32 i;
for (i = 0; i < ARRAY_COUNT(globals->voices); i++) {
AlUnkVoice* voice = &globals->voices[i];
AuVoice* voice = &globals->voices[i];
if (voice->unk_42 != 0) {
if (voice->stopPending) {
au_syn_stop_voice(i);
voice->unk_42 = 0;
voice->unk_1C = NULL;
voice->stopPending = FALSE;
voice->cmdPtr = NULL;
voice->priority = AU_PRIORITY_FREE;
}
}
}
void func_80052614(AuGlobals* globals) {
void au_init_voices(AuGlobals* globals) {
s32 i;
for (i = 0; i < ARRAY_COUNT(globals->voices); i++) {
AlUnkVoice* temp = &globals->voices[i];
AuVoice* voice = &globals->voices[i];
temp->unk_1C = NULL;
temp->unk_20 = 0;
temp->unk_24 = 0;
temp->unk_28 = 0;
temp->unk_3B = 0;
temp->unk_3C = 0;
temp->unk_flags_3D = 0;
temp->unk_3E = 0;
temp->unk_3F = 0x80;
voice->cmdPtr = NULL;
voice->unk_20 = 0;
voice->volChangeTime = 0;
voice->timeLeft = 0;
voice->timeIntervalIndex = 0;
voice->unk_3C = 0;
voice->envelopeFlags = 0;
voice->relativeReleaseVolumes = FALSE;
voice->releaseVolumeMult = 0x80;
}
}
void func_80052660(AuGlobals* globals) {
AlUnkVoice* voice;
void au_update_voices(AuGlobals* globals) {
AuVoice* voice;
s8 var_a0;
s16 unkTemp;
s16 currentAmp;
s32 i;
for (i = 0; i < ARRAY_COUNT(globals->voices); i++) {
voice = &globals->voices[i];
if (voice->unk_1C == NULL) {
if (voice->cmdPtr == NULL) {
continue;
}
if (voice->unk_flags_3D & AU_VOICE_3D_FLAG_HANDLED_VOL_CHANGE) {
func_80052B44(voice);
if (voice->envelopeFlags & AU_VOICE_ENV_FLAG_HANDLED_VOL_CHANGE) {
// client volume changed on previous frame
au_voice_after_volume_change(voice);
continue;
}
if (voice->unk_flags_3D & AU_VOICE_3D_FLAG_10) {
voice->unk_flags_3D &= ~AU_VOICE_3D_FLAG_10;
voice->unk_flags_3D |= AU_VOICE_3D_FLAG_1;
voice->unk_1C = (u8*)voice->unk_14.unk_04;
if (voice->unk_28 > AU_5750) {
voice->unk_39 = voice->unk_39 + (s32) (voice->unk_2C * (f32) (voice->unk_24 - voice->unk_28));
if (voice->envelopeFlags & AU_VOICE_ENV_FLAG_KEY_RELEASED) {
// client released the key
voice->envelopeFlags &= ~AU_VOICE_ENV_FLAG_KEY_RELEASED;
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_STOP;
voice->cmdPtr = (u8*)voice->envelope.cmdListRelease;
// the key can be released before press cmdlist processed completely, we must handle this case properly
if (voice->timeLeft > AU_5750) {
voice->initialAmp = voice->initialAmp + (s32) (voice->rate * (f32) (voice->volChangeTime - voice->timeLeft));
} else {
voice->unk_39 = voice->unk_3A;
voice->initialAmp = voice->targetAmp;
}
voice->unk_3B = *voice->unk_1C++;
var_a0 = *voice->unk_1C;
if (*(s8*)voice->unk_1C++ < 0) {
voice->timeIntervalIndex = *voice->cmdPtr++;
var_a0 = *voice->cmdPtr;
if (*(s8*)voice->cmdPtr++ < 0) {
// in this case release volumes are relative to last press volume
var_a0 &= 0x7F;
voice->unk_3E = 1;
voice->unk_3F = voice->unk_39;
voice->relativeReleaseVolumes = TRUE;
voice->releaseVolumeMult = voice->initialAmp;
}
voice->unk_3A = var_a0;
voice->targetAmp = var_a0;
voice->unk_28 = D_800785A0[voice->unk_3B];
voice->unk_24 = voice->unk_28;
if (voice->unk_flags_3D & AU_VOICE_3D_FLAG_VOL_CHANGED) {
voice->unk_flags_3D &= ~AU_VOICE_3D_FLAG_VOL_CHANGED;
if (voice->unk_28 > AU_5750) {
voice->unk_28 -= AU_5750;
voice->unk_flags_3D |= AU_VOICE_3D_FLAG_HANDLED_VOL_CHANGE;
unkTemp = voice->unk_39 + (s32) (voice->unk_2C * (voice->unk_24 - voice->unk_28));
voice->timeLeft = AuEnvelopeIntervals[voice->timeIntervalIndex];
voice->volChangeTime = voice->timeLeft;
if (voice->envelopeFlags & AU_VOICE_ENV_FLAG_VOL_CHANGED) {
voice->envelopeFlags &= ~AU_VOICE_ENV_FLAG_VOL_CHANGED;
if (voice->timeLeft > AU_5750) {
voice->timeLeft -= AU_5750;
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_HANDLED_VOL_CHANGE;
currentAmp = voice->initialAmp + (s32) (voice->rate * (voice->volChangeTime - voice->timeLeft));
} else {
unkTemp = voice->unk_3A;
currentAmp = voice->targetAmp;
}
voice->unk_08 = AUDIO_SAMPLES;
voice->delta = AUDIO_SAMPLES;
} else {
voice->unk_08 = func_80052BC0(voice->unk_24);
unkTemp = voice->unk_3A;
voice->delta = au_voice_get_delta(voice->volChangeTime);
currentAmp = voice->targetAmp;
}
voice->volume = (((unkTemp * voice->adjustedVolume * voice->unk_3F) >> 0xE) * voice->unk_30) >> 7;
voice->unk_flags_43 |= AU_VOICE_SYNC_FLAG_4;
voice->p_volume = (((currentAmp * voice->clientVolume * voice->releaseVolumeMult) >> 0xE) * voice->volMult) >> 7;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PARAMS;
} else {
if (voice->unk_28 == -1) {
if (voice->unk_flags_3D & AU_VOICE_3D_FLAG_VOL_CHANGED) {
voice->unk_flags_3D &= ~AU_VOICE_3D_FLAG_VOL_CHANGED;
voice->volume = (((voice->unk_39 * voice->adjustedVolume * voice->unk_3F) >> 0xE) * voice->unk_30) >> 7;
voice->unk_flags_43 |= AU_VOICE_SYNC_FLAG_4;
if (voice->timeLeft == -1) {
// keep current volume, this is 'sustain' phase
if (voice->envelopeFlags & AU_VOICE_ENV_FLAG_VOL_CHANGED) {
voice->envelopeFlags &= ~AU_VOICE_ENV_FLAG_VOL_CHANGED;
voice->p_volume = (((voice->initialAmp * voice->clientVolume * voice->releaseVolumeMult) >> 0xE) * voice->volMult) >> 7;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PARAMS;
}
} else {
voice->unk_28 -= AU_5750;
if (voice->unk_28 <= 0) {
if (*voice->unk_1C == 0xFF) {
if (voice->unk_flags_3D & AU_VOICE_3D_FLAG_1) {
voice->unk_flags_3D = 0;
voice->unk_1C = NULL;
voice->unk_42 = 1;
voice->timeLeft -= AU_5750;
if (voice->timeLeft <= 0) {
if (*voice->cmdPtr == ENV_CMD_END) {
if (voice->envelopeFlags & AU_VOICE_ENV_FLAG_STOP) {
// if we reached the end after key release, stop the voice completely
voice->envelopeFlags = 0;
voice->cmdPtr = NULL;
voice->stopPending = TRUE;
} else {
voice->unk_28 = -1;
voice->unk_24 = -1;
voice->unk_3B = 0x3B;
voice->unk_08 = AUDIO_SAMPLES;
voice->unk_2C = 0.0f;
voice->unk_39 = voice->unk_3A;
// we reached the end of press cmdlist, keep the last volume until the key is released
voice->timeLeft = -1;
voice->volChangeTime = -1;
voice->timeIntervalIndex = ENV_TIME_300MS; // doesn't seem to affect anything
voice->delta = AUDIO_SAMPLES;
voice->rate = 0.0f;
voice->initialAmp = voice->targetAmp;
}
} else {
voice->unk_3B = func_80052CFC(voice);
voice->unk_39 = voice->unk_3A;
voice->unk_3A = (*voice->unk_1C++) & 0x7F;
voice->unk_28 = D_800785A0[voice->unk_3B];
voice->unk_24 = voice->unk_28;
if (voice->unk_24 != 0) {
voice->unk_2C = ((f32) voice->unk_3A - (f32) voice->unk_39) / (f32) voice->unk_24;
// get next envelope point
voice->timeIntervalIndex = au_voice_step(voice);
voice->initialAmp = voice->targetAmp;
voice->targetAmp = (*voice->cmdPtr++) & 0x7F;
voice->timeLeft = AuEnvelopeIntervals[voice->timeIntervalIndex];
voice->volChangeTime = voice->timeLeft;
if (voice->volChangeTime != 0) {
voice->rate = ((f32) voice->targetAmp - (f32) voice->initialAmp) / (f32) voice->volChangeTime;
} else {
voice->unk_2C = 0.0f;
voice->rate = 0.0f;
}
if (voice->unk_flags_3D & AU_VOICE_3D_FLAG_VOL_CHANGED) {
voice->unk_flags_3D &= ~AU_VOICE_3D_FLAG_VOL_CHANGED;
if (voice->unk_28 > AU_5750) {
voice->unk_28 -= AU_5750;
voice->unk_flags_3D |= AU_VOICE_3D_FLAG_HANDLED_VOL_CHANGE;
unkTemp = voice->unk_39 + (s32) (voice->unk_2C * (voice->unk_24 - voice->unk_28));
if (voice->envelopeFlags & AU_VOICE_ENV_FLAG_VOL_CHANGED) {
voice->envelopeFlags &= ~AU_VOICE_ENV_FLAG_VOL_CHANGED;
if (voice->timeLeft > AU_5750) {
voice->timeLeft -= AU_5750;
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_HANDLED_VOL_CHANGE;
currentAmp = voice->initialAmp + (s32) (voice->rate * (voice->volChangeTime - voice->timeLeft));
} else {
unkTemp = voice->unk_3A;
currentAmp = voice->targetAmp;
}
voice->unk_08 = AUDIO_SAMPLES;
voice->delta = AUDIO_SAMPLES;
} else {
voice->unk_08 = func_80052BC0(voice->unk_24);
unkTemp = voice->unk_3A;
voice->delta = au_voice_get_delta(voice->volChangeTime);
currentAmp = voice->targetAmp;
}
voice->volume = (((unkTemp * voice->adjustedVolume * voice->unk_3F) >> 0xE) * voice->unk_30) >> 7;
voice->unk_flags_43 |= AU_VOICE_SYNC_FLAG_4;
voice->p_volume = (((currentAmp * voice->clientVolume * voice->releaseVolumeMult) >> 0xE) * voice->volMult) >> 7;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PARAMS;
}
} else {
if (voice->unk_flags_3D & AU_VOICE_3D_FLAG_VOL_CHANGED) {
voice->unk_flags_3D &= ~AU_VOICE_3D_FLAG_VOL_CHANGED;
if (voice->unk_28 > AU_5750) {
voice->unk_28 -= AU_5750;
voice->unk_flags_3D |= AU_VOICE_3D_FLAG_HANDLED_VOL_CHANGE;
unkTemp = voice->unk_39 + (s32) (voice->unk_2C * (voice->unk_24 - voice->unk_28));
// we are between two envelope points, do nothing, just handle client volume change
if (voice->envelopeFlags & AU_VOICE_ENV_FLAG_VOL_CHANGED) {
voice->envelopeFlags &= ~AU_VOICE_ENV_FLAG_VOL_CHANGED;
if (voice->timeLeft > AU_5750) {
voice->timeLeft -= AU_5750;
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_HANDLED_VOL_CHANGE;
currentAmp = voice->initialAmp + (s32) (voice->rate * (voice->volChangeTime - voice->timeLeft));
} else {
unkTemp = voice->unk_3A;
currentAmp = voice->targetAmp;
}
voice->unk_08 = AUDIO_SAMPLES;
voice->volume = (((unkTemp * voice->adjustedVolume * voice->unk_3F) >> 0xE) * voice->unk_30) >> 7;
voice->unk_flags_43 |= AU_VOICE_SYNC_FLAG_4;
voice->delta = AUDIO_SAMPLES;
voice->p_volume = (((currentAmp * voice->clientVolume * voice->releaseVolumeMult) >> 0xE) * voice->volMult) >> 7;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PARAMS;
}
}
}
@ -157,81 +167,82 @@ void func_80052660(AuGlobals* globals) {
}
}
void func_80052B44(AlUnkVoice* arg0) {
arg0->volume = (((arg0->unk_3A * arg0->adjustedVolume * arg0->unk_3F) >> 14) * arg0->unk_30) >> 7;
arg0->unk_08 = func_80052BC0(arg0->unk_28);
arg0->unk_flags_3D &= ~AU_VOICE_3D_FLAG_HANDLED_VOL_CHANGE;
arg0->unk_flags_43 |= AU_VOICE_SYNC_FLAG_4;
void au_voice_after_volume_change(AuVoice* voice) {
voice->p_volume = (((voice->targetAmp * voice->clientVolume * voice->releaseVolumeMult) >> 14) * voice->volMult) >> 7;
voice->delta = au_voice_get_delta(voice->timeLeft);
voice->envelopeFlags &= ~AU_VOICE_ENV_FLAG_HANDLED_VOL_CHANGE;
voice->syncFlags |= AU_VOICE_SYNC_FLAG_PARAMS;
}
s32 func_80052BC0(s32 arg0) {
return (arg0 / AU_5750) * AUDIO_SAMPLES;
s32 au_voice_get_delta(s32 msecs) {
return (msecs / AU_5750) * AUDIO_SAMPLES;
}
void func_80052BF8(AlUnkVoice* voice, AlUnkInstrumentData* arg1) {
s32 x;
void au_voice_start(AuVoice* voice, EnvelopeData* envData) {
s32 intervalIndex;
voice->unk_14.unk_00 = arg1->unk_00;
voice->unk_1C = (u8*) voice->unk_14.unk_00;
voice->unk_14.unk_04 = arg1->unk_04;
voice->unk_30 = 0x80;
voice->unk_34 = 0;
voice->envelope.cmdListPress = envData->cmdListPress;
voice->cmdPtr = voice->envelope.cmdListPress;
voice->envelope.cmdListRelease = envData->cmdListRelease;
voice->volMult = 0x80;
voice->loopStart = NULL;
x = func_80052CFC(voice);
voice->unk_flags_3D = 0;
voice->unk_39 = 0;
voice->unk_3A = *voice->unk_1C++;
voice->unk_3B = x;
voice->unk_24 = D_800785A0[x];
voice->unk_28 = voice->unk_24;
intervalIndex = au_voice_step(voice);
voice->envelopeFlags = 0;
voice->initialAmp = 0;
voice->targetAmp = *voice->cmdPtr++;
voice->timeIntervalIndex = intervalIndex;
voice->volChangeTime = AuEnvelopeIntervals[intervalIndex];
voice->timeLeft = voice->volChangeTime;
voice->volume = (voice->unk_3A * voice->adjustedVolume * voice->unk_30) >> 14;
voice->unk_08 = func_80052BC0(voice->unk_24);
if (voice->unk_24 != 0) {
voice->unk_2C = ((f32) voice->unk_3A - (f32) voice->unk_39) / voice->unk_24;
voice->p_volume = (voice->targetAmp * voice->clientVolume * voice->volMult) >> 14;
voice->delta = au_voice_get_delta(voice->volChangeTime);
if (voice->volChangeTime != 0) {
voice->rate = ((f32) voice->targetAmp - (f32) voice->initialAmp) / voice->volChangeTime;
} else {
voice->unk_2C = 0.0f;
voice->rate = 0.0f;
}
voice->unk_3E = 0;
voice->unk_3F = 0x80;
voice->relativeReleaseVolumes = FALSE;
voice->releaseVolumeMult = 0x80;
}
u8 func_80052CFC(AlUnkVoice* voice) {
// performs special commands and returns interval index
u8 au_voice_step(AuVoice* voice) {
u32 op;
u8 arg;
while (TRUE) {
if (((s8)(op = *voice->unk_1C++)) >= 0) {
if (((s8)(op = *voice->cmdPtr++)) >= 0) {
break;
}
switch ((u8)op) {
case 0xFE:
arg = *voice->unk_1C++;
case ENV_CMD_SET_MULTIPLIER:
arg = *voice->cmdPtr++;
if (arg > 0x80) {
arg = 0x80;
}
voice->unk_30 = arg;
voice->volMult = arg;
break;
case 0xFD:
voice->unk_30 += (s8) *voice->unk_1C++;
if (voice->unk_30 > 0x80) {
voice->unk_30 = 0x80;
} else if (voice->unk_30 < 0) {
voice->unk_30 = 0;
case ENV_CMD_ADD_MULTIPLIER:
voice->volMult += (s8) *voice->cmdPtr++;
if (voice->volMult > 0x80) {
voice->volMult = 0x80;
} else if (voice->volMult < 0) {
voice->volMult = 0;
}
break;
case 0xFC:
voice->unk_38 = *voice->unk_1C++;
voice->unk_34 = voice->unk_1C;
case ENV_CMD_START_LOOP:
voice->loopCounter = *voice->cmdPtr++; // 0 means infinite loop
voice->loopStart = voice->cmdPtr;
break;
case 0xFB:
voice->unk_1C++;
if (voice->unk_38 == 0 || --voice->unk_38 != 0) {
voice->unk_1C = voice->unk_34;
case ENV_CMD_END_LOOP:
voice->cmdPtr++;
if (voice->loopCounter == 0 || --voice->loopCounter != 0) {
voice->cmdPtr = voice->loopStart;
}
break;
default:
voice->unk_1C++;
voice->cmdPtr++;
break;
}
}
@ -239,6 +250,6 @@ u8 func_80052CFC(AlUnkVoice* voice) {
}
void func_80052E18(AlUnkVoice* arg0) {
arg0->unk_flags_3D |= AU_VOICE_3D_FLAG_VOL_CHANGED;
void au_voice_set_vol_changed(AuVoice* voice) {
voice->envelopeFlags |= AU_VOICE_ENV_FLAG_VOL_CHANGED;
}

View File

@ -3,7 +3,8 @@
// data
extern u16 D_80078530[9];
extern s32 D_8007854C[2];
extern u8 EnvelopePressDefault[];
extern u8 EnvelopeReleaseDefault[];
extern f32 AlTuneScaling[];
@ -14,9 +15,9 @@ extern f32 AlTuneScaling[];
#endif
void func_80052E30(u8 index) {
AlUnkVoice* voice = &gSoundGlobals->voices[index];
AuVoice* voice = &gSoundGlobals->voices[index];
voice->unk_1C = NULL;
voice->cmdPtr = NULL;
voice->priority = AU_PRIORITY_FREE;
}
@ -77,19 +78,19 @@ void au_engine_init(s32 outputRate) {
}
for (i = 0; i < ARRAY_COUNT(globals->voices); i++) {
AlUnkVoice* voice;
au_pvoice_set_group(i, 0);
AuVoice* voice;
au_pvoice_set_bus(i, 0);
au_syn_set_wavetable(i, globals->defaultInstrument);
voice = &globals->voices[i];
voice->instrument = NULL;
voice->pitchRatio = 0;
voice->volume = -1;
voice->p_volume = -1;
voice->pan = 0xFF;
voice->reverbAmt = 0xFF;
voice->reverbType = 0;
voice->unk_42 = 0;
voice->unk_flags_43 = 0;
voice->priorityCopy = AU_PRIORITY_FREE;
voice->reverb = 0xFF;
voice->busId = 0;
voice->stopPending = FALSE;
voice->syncFlags = 0;
voice->clientPriority = AU_PRIORITY_FREE;
voice->priority = AU_PRIORITY_FREE;
}
@ -99,23 +100,23 @@ void au_engine_init(s32 outputRate) {
globals->banks[i] = alHeapAlloc(alHeap, 1, 0x840);
}
au_bgm_player_init(gBGMPlayerA, AU_PRIORITY_BGM_PLAYER_MAIN, AU_FX_NONE, globals);
effects[0] = 0;
effects[1] = 3;
au_bgm_player_init(gBGMPlayerA, AU_PRIORITY_BGM_PLAYER_MAIN, FX_BUS_BGMA_MAIN, globals);
effects[0] = FX_BUS_BGMA_MAIN;
effects[1] = FX_BUS_BGMA_AUX;
effects[2] = -1;
effects[3] = -1;
au_bgm_set_effect_indices(gBGMPlayerA, effects);
au_bgm_player_init(gBGMPlayerB, AU_PRIORITY_BGM_PLAYER_AUX, AU_FX_BIGROOM, globals);
effects[0] = 2;
au_bgm_player_init(gBGMPlayerB, AU_PRIORITY_BGM_PLAYER_AUX, FX_BUS_BGMB, globals);
effects[0] = FX_BUS_BGMB;
effects[1] = -1;
effects[2] = -1;
effects[3] = -1;
au_bgm_set_effect_indices(gBGMPlayerB, effects);
au_sfx_init(gSoundManager, AU_PRIORITY_SFX_MANAGER, AU_FX_SMALLROOM, globals, 16);
au_mseq_manager_init(gAuAmbienceManager, AU_PRIORITY_MSEQ_MANAGER, AU_FX_SMALLROOM, globals);
func_80052614(globals);
au_sfx_init(gSoundManager, AU_PRIORITY_SFX_MANAGER, FX_BUS_SOUND, globals, 16);
au_amb_manager_init(gAuAmbienceManager, AU_PRIORITY_MSEQ_MANAGER, FX_BUS_SOUND, globals);
au_init_voices(globals);
au_load_BK_headers(globals, alHeap);
if (au_fetch_SBN_file(globals->mseqFileList[0], AU_FMT_SEF, &fileEntry) == AU_RESULT_OK) {
au_read_rom(fileEntry.offset, globals->dataSEF, fileEntry.data & 0xFFFFFF);
@ -138,7 +139,7 @@ void au_engine_init(s32 outputRate) {
globals->instrumentGroups[7] = globals->instrumentGroup1;
globals->channelDelaySide = 0;
globals->channelDelayTime = 0;
globals->channelDelayGroupIdx = 0;
globals->channelDelayBusId = 0;
globals->channelDelayPending = 0;
au_delay_channel(0);
@ -160,7 +161,7 @@ static void au_reset_instrument(Instrument* instrument) {
instrument->loopCount = 0;
instrument->type = 0;
instrument->unk_25 = 0;
instrument->unkOffset = (InstrumentEffect*) &D_80078544; //TODO: fix type of data
instrument->envelopes = &DummyInstrumentEnvelope;
instrument->unk_26 = 0;
instrument->unk_27 = 0;
instrument->unk_28 = 0;
@ -171,7 +172,7 @@ static void au_reset_instrument(Instrument* instrument) {
}
static void au_reset_drum_entry(BGMDrumInfo* arg0) {
arg0->bankPatch = 8208;
arg0->bankPatch = 0x2010;
arg0->keyBase = 4800; // middle C?
arg0->volume = 0x7F;
arg0->pan = 64;
@ -194,20 +195,20 @@ static void au_reset_instrument_entry(BGMInstrumentInfo* arg0) {
void au_update_clients_2(void) {
AuGlobals* globals = gSoundGlobals;
SoundManager* sfxManager = gSoundManager;
AuAmbienceManager* ambManager = gAuAmbienceManager;
AmbienceManager* ambManager = gAuAmbienceManager;
BGMPlayer* bgmPlayer;
func_80053654(globals);
au_syn_update(globals);
ambManager->nextUpdateCounter -= ambManager->nextUpdateStep;
if (ambManager->nextUpdateCounter <= 0) {
ambManager->nextUpdateCounter += ambManager->nextUpdateInterval;
snd_ambient_manager_update(ambManager);
au_amb_manager_update(ambManager);
}
if (sfxManager->fadeInfo.fadeTime != 0) {
au_fade_update(&sfxManager->fadeInfo);
func_80053A98(sfxManager->defaultReverbType, sfxManager->fadeInfo.currentVolume.u16, sfxManager->unk_5C);
au_fade_set_volume(sfxManager->busId, sfxManager->fadeInfo.currentVolume.u16, sfxManager->busVolume);
}
sfxManager->nextUpdateCounter -= sfxManager->nextUpdateStep;
@ -258,7 +259,7 @@ void au_update_clients_2(void) {
bgmPlayer->unk_5C = au_bgm_player_update_main(bgmPlayer);
}
}
func_80052660(globals);
au_update_voices(globals);
}
void au_update_players_main(void) {
@ -283,7 +284,7 @@ void au_update_players_main(void) {
au_sfx_update_main(manager);
}
void func_80053654(AuGlobals* globals) {
void au_syn_update(AuGlobals* globals) {
u32 i;
if (globals->unk_130C == 2) {
@ -295,12 +296,12 @@ void func_80053654(AuGlobals* globals) {
switch (globals->channelDelaySide) {
case 1:
au_set_delay_time(globals->channelDelayTime);
au_delay_left_channel(globals->channelDelayGroupIdx);
au_delay_left_channel(globals->channelDelayBusId);
globals->channelDelayPending = FALSE;
break;
case 2:
au_set_delay_time(globals->channelDelayTime);
au_delay_right_channel(globals->channelDelayGroupIdx);
au_delay_right_channel(globals->channelDelayBusId);
globals->channelDelayPending = FALSE;
break;
default:
@ -310,68 +311,69 @@ void func_80053654(AuGlobals* globals) {
}
}
if (globals->effectChanges[FX_BUS_0].changed) {
au_bus_set_effect(FX_BUS_0, globals->effectChanges[FX_BUS_0].type);
globals->effectChanges[FX_BUS_0].changed = FALSE;
if (globals->effectChanges[FX_BUS_BGMA_MAIN].changed) {
au_bus_set_effect(FX_BUS_BGMA_MAIN, globals->effectChanges[FX_BUS_BGMA_MAIN].type);
globals->effectChanges[FX_BUS_BGMA_MAIN].changed = FALSE;
}
if (globals->effectChanges[FX_BUS_1].changed) {
au_bus_set_effect(FX_BUS_1, globals->effectChanges[FX_BUS_1].type);
globals->effectChanges[FX_BUS_1].changed = FALSE;
if (globals->effectChanges[FX_BUS_SOUND].changed) {
au_bus_set_effect(FX_BUS_SOUND, globals->effectChanges[FX_BUS_SOUND].type);
globals->effectChanges[FX_BUS_SOUND].changed = FALSE;
} if (globals->effectChanges[FX_BUS_2].changed) {
au_bus_set_effect(FX_BUS_2, globals->effectChanges[FX_BUS_2].type);
globals->effectChanges[FX_BUS_2].changed = FALSE;
} if (globals->effectChanges[FX_BUS_BGMB].changed) {
au_bus_set_effect(FX_BUS_BGMB, globals->effectChanges[FX_BUS_BGMB].type);
globals->effectChanges[FX_BUS_BGMB].changed = FALSE;
}
if (globals->effectChanges[FX_BUS_3].changed) {
au_bus_set_effect(FX_BUS_3, globals->effectChanges[FX_BUS_3].type);
globals->effectChanges[FX_BUS_3].changed = FALSE;
if (globals->effectChanges[FX_BUS_BGMA_AUX].changed) {
au_bus_set_effect(FX_BUS_BGMA_AUX, globals->effectChanges[FX_BUS_BGMA_AUX].type);
globals->effectChanges[FX_BUS_BGMA_AUX].changed = FALSE;
}
for (i = 0; i < ARRAY_COUNT(globals->voices); i++) {
AlUnkVoice* voice = &globals->voices[i];
u8 voiceUpdateFlags = voice->unk_flags_43;
AuVoice* voice = &globals->voices[i];
u8 voiceUpdateFlags = voice->syncFlags;
if (voice->unk_42 != 0) {
if (voice->stopPending) {
au_syn_stop_voice(i);
voice->unk_42 = 0;
voice->unk_1C = NULL;
voice->stopPending = FALSE;
voice->cmdPtr = NULL;
voice->priority = AU_PRIORITY_FREE;
}
if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_ALL) {
func_80052BF8(voice, &voice->unk_14);
au_syn_start_voice_params(i, voice->reverbType, voice->instrument, voice->pitchRatio, voice->volume, voice->pan, voice->reverbAmt, voice->unk_08);
voice->priority = voice->priorityCopy;
au_voice_start(voice, &voice->envelope);
au_syn_start_voice_params(i, voice->busId, voice->instrument, voice->pitchRatio, voice->p_volume, voice->pan, voice->reverb, voice->delta);
// priority may be AU_PRIORITY_FREE if this voice was stolen and reset
voice->priority = voice->clientPriority;
} else {
if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_PITCH) {
au_syn_set_pitch(i, voice->pitchRatio);
}
if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_4) {
au_syn_set_mixer_params(i, voice->volume, voice->unk_08, voice->pan, voice->reverbAmt);
} else if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_10) {
au_syn_set_pan_fxmix(i, voice->pan, voice->reverbAmt);
if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_PARAMS) {
au_syn_set_mixer_params(i, voice->p_volume, voice->delta, voice->pan, voice->reverb);
} else if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_PAN_FXMIX) {
au_syn_set_pan_fxmix(i, voice->pan, voice->reverb);
}
}
voice->unk_flags_43 = 0;
voice->syncFlags = 0;
}
}
void func_80053888(AlUnkVoice* voice, u8 index) {
if (voice->priority != 0) {
voice->unk_1C = NULL;
voice->unk_42 = 1;
voice->unk_flags_43 = 0;
void au_reset_nonfree_voice(AuVoice* voice, u8 index) {
if (voice->priority != AU_PRIORITY_FREE) {
voice->cmdPtr = NULL;
voice->stopPending = TRUE;
voice->syncFlags = 0;
au_syn_set_volume_delta(index, 0, AUDIO_SAMPLES);
}
}
// uncertain name
void au_reset_voice(AlUnkVoice* voice, u8 index) {
voice->unk_1C = NULL;
voice->unk_42 = 1;
voice->unk_flags_43 = 0;
au_syn_set_volume_delta(index, 0, AUDIO_SAMPLES);
void au_reset_voice(AuVoice* voice, u8 voiceIdx) {
voice->cmdPtr = NULL;
voice->stopPending = TRUE;
voice->syncFlags = 0;
au_syn_set_volume_delta(voiceIdx, 0, AUDIO_SAMPLES);
}
// array offsets into AlTuneScaling
@ -427,8 +429,8 @@ void au_fade_update(Fade* fade) {
}
}
void func_80053A98(u8 busId, u16 arg1, s32 arg2) {
au_bus_set_volume(busId, (u32)(arg1 * arg2) >> 15);
void au_fade_set_volume(u8 busId, u16 volume, s32 busVolume) {
au_bus_set_volume(busId, (u32)(volume * busVolume) >> 15);
}
void func_80053AC8(Fade* fade) {
@ -475,17 +477,17 @@ void func_80053BA8(Fade* fade) {
}
//TODO cleanup and documentation
Instrument* au_get_instrument(AuGlobals* globals, u32 bank, u32 patch, AlUnkInstrumentData* arg3) {
Instrument* au_get_instrument(AuGlobals* globals, u32 bank, u32 patch, EnvelopeData* envData) {
Instrument* instrument = (*globals->instrumentGroups[(bank & 0x70) >> 4])[patch];
InstrumentEffect* temp_a0 = instrument->unkOffset;
u32 sampleIdx = bank & 3;
EnvelopePreset* preset = instrument->envelopes;
u32 envelopeIdx = bank & 3;
if (sampleIdx < temp_a0->count) {
arg3->unk_00 = AU_FILE_RELATIVE(temp_a0, temp_a0->unk_04[sampleIdx].unkOffset1);
arg3->unk_04 = AU_FILE_RELATIVE(temp_a0, temp_a0->unk_04[sampleIdx].unkOffset2);
if (envelopeIdx < preset->count) {
envData->cmdListPress = AU_FILE_RELATIVE(preset, preset->offsets[envelopeIdx].offsetPress);
envData->cmdListRelease = AU_FILE_RELATIVE(preset, preset->offsets[envelopeIdx].offsetRelease);
} else {
arg3->unk_00 = &D_8007854C[0];
arg3->unk_04 = &D_8007854C[1];
envData->cmdListPress = EnvelopePressDefault;
envData->cmdListRelease = &EnvelopePressDefault[4]; //EnvelopeReleaseDefault;
}
return instrument;
}
@ -643,7 +645,7 @@ BGMPlayer* func_80053F64(s32 arg0) {
#define SBN_LOOKUP(i,fmt,e) (au_fetch_SBN_file(globals->mseqFileList[AmbientSoundIDtoMSEQFileIndex[i]], fmt, &e))
AuResult au_ambient_load(u32 ambSoundID) {
AuAmbienceManager* manager;
AmbienceManager* manager;
SBNFileEntry fileEntry;
AuGlobals* globals;
MSEQHeader* mseqFile;
@ -652,19 +654,19 @@ AuResult au_ambient_load(u32 ambSoundID) {
globals = gSoundGlobals;
manager = gAuAmbienceManager;
if (ambSoundID < AMBIENT_RADIO) {
if (manager->mseqPlayers[0].mseqName == 0 && SBN_LOOKUP(ambSoundID, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
if (manager->players[0].mseqName == 0 && SBN_LOOKUP(ambSoundID, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
au_read_rom(fileEntry.offset, globals->dataMSEQ[0], fileEntry.data & 0xFFFFFF);
manager->mseqFiles[0] = globals->dataMSEQ[0];
for (i = 1; i < ARRAY_COUNT(manager->mseqFiles); i++) {
manager->mseqFiles[i] = NULL;
}
manager->unk_20 = 1;
manager->numActivePlayers = 1;
}
} else if (ambSoundID == AMBIENT_RADIO
&& manager->mseqPlayers[0].mseqName == 0
&& manager->mseqPlayers[1].mseqName == 0
&& manager->mseqPlayers[2].mseqName == 0) {
manager->unk_20 = 0;
&& manager->players[0].mseqName == 0
&& manager->players[1].mseqName == 0
&& manager->players[2].mseqName == 0) {
manager->numActivePlayers = 0;
for (i = 0; i < ARRAY_COUNT(manager->mseqFiles); i++) {
manager->mseqFiles[i] = NULL;
}
@ -689,7 +691,7 @@ AuResult au_ambient_load(u32 ambSoundID) {
au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
manager->mseqFiles[3] = mseqFile;
manager->unk_20 = 4;
manager->numActivePlayers = 4;
if (SBN_LOOKUP(ambSoundID + 4, AU_FMT_BK, fileEntry) == AU_RESULT_OK) {
snd_load_BK(fileEntry.offset, 2);
}
@ -1027,11 +1029,11 @@ void au_swizzle_BK_instruments(s32 bkFileOffset, SoundBank* bank, InstrumentGrou
if (instrument->predictor != NULL) {
instrument->predictor = AU_FILE_RELATIVE(bank, instrument->predictor);
}
if (instrument->unkOffset != NULL) {
instrument->unkOffset = AU_FILE_RELATIVE(bank, instrument->unkOffset);
if (instrument->envelopes != NULL) {
instrument->envelopes = AU_FILE_RELATIVE(bank, instrument->envelopes);
}
instrument->unk_25 = arg4;
instrument->pitchRatio = *((s32*)(&instrument->pitchRatio)) / outputRate; // what is happening here?
instrument->pitchRatio = instrument->outputRate / outputRate;
} else {
instruments[i] = defaultInstrument;
}
@ -1134,13 +1136,13 @@ void func_80054CE0(s32 arg0, u32 idx) {
if (idx < ARRAY_COUNT(D_80078530)) {
s32 temp_s0 = D_80078530[idx];
if (arg0 & 1) {
gBGMPlayerA->unk_48 = temp_s0;
gBGMPlayerA->busVolume = temp_s0;
func_80053AC8(&gBGMPlayerA->fadeInfo);
gBGMPlayerB->unk_48 = temp_s0;
gBGMPlayerB->busVolume = temp_s0;
func_80053AC8(&gBGMPlayerB->fadeInfo);
}
if (arg0 & 0x10) {
gSoundManager->unk_5C = temp_s0;
gSoundManager->busVolume = temp_s0;
func_80053AC8(&gSoundManager->fadeInfo);
}
}
@ -1148,7 +1150,7 @@ void func_80054CE0(s32 arg0, u32 idx) {
s32 func_80054D74(s32 arg0, s32 arg1) {
if (arg0 & 0x10) {
return func_8004B9E4(gSoundManager, arg1);
return au_sfx_set_reverb_type(gSoundManager, arg1);
}
return 0;
}

View File

@ -5,7 +5,7 @@ static u8* snd_song_get_track_volumes_set(MusicTrackVols arg0);
s32 PreventBGMPlayerUpdate = FALSE;
u16 D_80078DB4 = 0;
u16 D_80078DB6 = 0;
u16 AuAmbiencePlayOnlyIndex = 0;
// lists of data:
// u8 trackIdx
@ -229,7 +229,7 @@ void snd_adjust_sound(s32 soundID, u8 volume, u8 pan) {
pan = 0x7F;
}
au_sfx_enqueue_event(soundManager, soundID | 0x1000, vol, 0, pan);
au_sfx_enqueue_event(soundManager, soundID | SOUND_ID_ADJUST, vol, 0, pan);
}
void snd_adjust_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift) {
@ -250,17 +250,17 @@ void snd_adjust_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
pitchShift = -2400;
}
au_sfx_enqueue_event(soundManager, soundID | 0x1000, vol, pitchShift, pan);
au_sfx_enqueue_event(soundManager, soundID | SOUND_ID_ADJUST, vol, pitchShift, pan);
}
void snd_stop_sound(s32 soundID) {
SoundManager* soundManager = gSoundManager;
au_sfx_enqueue_event(soundManager, soundID | 0x8000, 0, 0, 0);
au_sfx_enqueue_event(soundManager, soundID | SOUND_ID_STOP, 0, 0, 0);
}
void func_800553F4(void) {
gSoundManager->unk_168 = 1;
void snd_reset(void) {
gSoundManager->resetPending = 1;
}
void snd_start_sound_raw(s32 soundID, s16 volume, s16 pitchShift, s32 pan) {
@ -269,137 +269,135 @@ void snd_start_sound_raw(s32 soundID, s16 volume, s16 pitchShift, s32 pan) {
au_sfx_enqueue_event(soundManager, soundID, volume, pitchShift, pan);
}
AuResult snd_ambient_load(s32 ambSoundID) {
AuResult snd_load_ambient(s32 ambSoundID) {
return au_ambient_load(ambSoundID);
}
AuResult snd_ambient_80055464(s32 arg0, s32 arg1) {
AuResult status = func_80050C30(arg0);
AuResult snd_ambient_play(s32 index, s32 fadeInTime) {
AuResult status = au_amb_check_player_index(index);
if (status != AU_RESULT_OK) {
return status;
}
return func_80050CA0(arg0, arg1);
return au_amb_start(index, fadeInTime);
}
AuResult snd_ambient_quick_fade_out(s32 arg0) {
AuResult status = func_80050C30(arg0);
AuResult snd_ambient_stop_quick(s32 index) {
AuResult status = au_amb_check_player_index(index);
if (status == AU_RESULT_OK) {
func_80050EF0_fade_out_quick(arg0);
au_amb_stop_quick(index);
}
return status;
}
AuResult snd_ambient_slow_fade_out(s32 arg0, s32 arg1) {
AuResult status = func_80050C30(arg0);
AuResult snd_ambient_stop_slow(s32 index, s32 fadeOutTime) {
AuResult status = au_amb_check_player_index(index);
if (status == AU_RESULT_OK) {
func_80050EF0_fade_out_slow(arg0, arg1);
au_amb_stop_slow(index, fadeOutTime);
}
return status;
}
// fade out sounds (kmr_00)
AuResult snd_ambient_8005553C(s32 arg0, s32 arg1) {
AuResult status = func_80050C30(arg0);
AuResult snd_ambient_pause(s32 index, s32 fadeOutTime) {
AuResult status = au_amb_check_player_index(index);
if (status == AU_RESULT_OK) {
func_80050EF0_fade_out_unk(arg0, arg1);
au_amb_pause(index, fadeOutTime);
}
return status;
}
// fade in sounds (kmr_00) -- restart?
AuResult snd_ambient_80055590(s32 arg0, s32 arg1) {
AuResult status = func_80050C30(arg0);
AuResult snd_ambient_resume(s32 index, s32 fadeInTime) {
AuResult status = au_amb_check_player_index(index);
if (status == AU_RESULT_OK) {
func_80050EF0_fade_in_unk(arg0, arg1);
au_amb_resume(index, fadeInTime);
}
return status;
}
AuResult snd_ambient_800555E4(s32 arg0) {
AuResult status = func_80050C30(arg0);
AuResult snd_ambient_is_stopped(s32 index) {
AuResult status = au_amb_check_player_index(index);
if (status != AU_RESULT_OK) {
return status;
}
return func_80051050(arg0);
return au_amb_is_stopped(index);
}
//TODO sets a flag which tells the manager to mute players
AuResult snd_ambient_80055618(s32 index, s32 arg1) {
AuResult status = func_80050C30(index);
// TODO perhaps inaccurate name
AuResult snd_ambient_mute(s32 index, s32 arg1) {
AuResult status = au_amb_check_player_index(index);
if (status == AU_RESULT_OK) {
func_80050C54(index, arg1);
au_amb_load_tracks_fade(index, arg1);
}
return status;
}
AuResult snd_ambient_set_volume(s32 index, s32 time, s32 volume) {
AuResult status = func_80050C30(index);
AuResult status = au_amb_check_player_index(index);
if (status == AU_RESULT_OK) {
au_mseq_set_volume(index, time, volume);
au_amb_set_volume(index, time, volume);
}
return status;
}
AuResult snd_ambient_disable(s32 index) {
AuResult status = func_80050C30(index);
AuResult status = au_amb_check_player_index(index);
if (status == AU_RESULT_OK) {
au_mseq_set_disabled(index, TRUE);
au_amb_set_disabled(index, TRUE);
}
return status;
}
AuResult snd_ambient_enable(s32 index) {
AuResult status = func_80050C30(index);
AuResult status = au_amb_check_player_index(index);
if (status == AU_RESULT_OK) {
au_mseq_set_disabled(index, FALSE);
au_amb_set_disabled(index, FALSE);
}
return status;
}
// snd_ambient_init_tracks?
void snd_ambient_80055760(s32 trackIdx) {
// snd_ambient_init_tracks ?
void snd_ambient_80055760(s32 index) {
u32 i;
s32 lim = 4;
D_80078DB6 = 0xFF;
AuAmbiencePlayOnlyIndex = 0xFF;
for (i = 0; i < lim; i++) {
if (snd_ambient_80055464(i, 0) != AU_RESULT_OK) {
if (snd_ambient_play(i, 0) != AU_RESULT_OK) {
return;
}
}
snd_ambient_set_track(trackIdx);
snd_ambient_play_only(index);
}
AuResult snd_ambient_800557CC(s32 fadeTime) {
AuResult snd_ambient_stop_all(s32 time) {
AuResult status = AU_RESULT_OK;
s32 lim = 4;
u32 i;
for (i = 0; i < lim; i++) {
if (i == D_80078DB6) {
status = snd_ambient_slow_fade_out(i, fadeTime);
if (i == AuAmbiencePlayOnlyIndex) {
status = snd_ambient_stop_slow(i, time);
} else {
status = snd_ambient_quick_fade_out(i);
status = snd_ambient_stop_quick(i);
}
if (status != AU_RESULT_OK) {
break;
@ -408,11 +406,11 @@ AuResult snd_ambient_800557CC(s32 fadeTime) {
return status;
}
AuResult snd_ambient_set_track(s32 index) {
AuResult snd_ambient_play_only(s32 index) {
AuResult status = AU_RESULT_OK;
s32 lim = 4;
if (index != D_80078DB6) {
if (index != AuAmbiencePlayOnlyIndex) {
u32 i;
for (i = 0; i < lim; i++) {
@ -428,7 +426,7 @@ AuResult snd_ambient_set_track(s32 index) {
}
if (status == AU_RESULT_OK) {
D_80078DB6 = index;
AuAmbiencePlayOnlyIndex = index;
}
}
@ -860,10 +858,10 @@ void func_800561E4(s32 arg0) {
func_80054D74(0x10, arg0);
}
void func_80056204(void) {
func_8004BA54(gSoundManager, 0);
void enable_sounds(void) {
au_sfx_set_state(gSoundManager, SND_MANAGER_STATE_ENABLED);
}
void func_80056228(void) {
func_8004BA54(gSoundManager, 1);
void disable_sounds(void) {
au_sfx_set_state(gSoundManager, SND_MANAGER_STATE_DISABLED);
}

View File

@ -70,7 +70,7 @@ void au_driver_init(AuSynDriver* driver, ALConfig* config) {
voice->envMixer.pan = 64;
voice->unk_74 = 0;
voice->next = NULL;
voice->groupID = 0;
voice->busId = FX_BUS_BGMA_MAIN;
voice->index = i;
}
@ -141,8 +141,8 @@ Acmd* alAudioFrame(Acmd* cmdList, s32* cmdLen, s16* outBuf, s32 outLen) {
for (i = 0; i < gSynDriverPtr->num_pvoice; i++) {
pvoice = &gSynDriverPtr->pvoices[i];
if ((pvoice->groupID != 0xFF) && (pvoice->groupID < gSynDriverPtr->num_bus)) {
fxBus = &gSynDriverPtr->fxBus[pvoice->groupID];
if ((pvoice->busId != 0xFF) && (pvoice->busId < gSynDriverPtr->num_bus)) {
fxBus = &gSynDriverPtr->fxBus[pvoice->busId];
if (fxBus->tail != NULL) {
fxBus->tail->next = pvoice;
} else {
@ -284,10 +284,10 @@ void au_bus_set_fx_params(u8 index, s16 delayIndex, s16 paramID, s32 value) {
au_fx_param_hdl(fxBus->fxR, delayIndex, paramID, value);
}
void au_pvoice_set_group(u8 index, s8 groupID) {
void au_pvoice_set_bus(u8 index, s8 busId) {
AuPVoice* pvoice = &gSynDriverPtr->pvoices[index];
pvoice->groupID = groupID;
pvoice->busId = busId;
}
// based on n_alSynStopVoice
@ -325,13 +325,13 @@ void au_syn_start_voice(u8 voiceIdx) {
}
// based on n_alSynStartVoiceParams
void au_syn_start_voice_params(u8 voiceIdx, u8 groupIdx, Instrument* instrument, f32 pitch, s16 vol, u8 pan, u8 fxMix, s32 delta) {
void au_syn_start_voice_params(u8 voiceIdx, u8 busId, Instrument* instrument, f32 pitch, s16 vol, u8 pan, u8 fxMix, s32 delta) {
AuPVoice* pvoice = &gSynDriverPtr->pvoices[voiceIdx];
AuLoadFilter* decoder = &pvoice->decoder;
AuEnvMixer* envMixer = &pvoice->envMixer;
AuResampler* resampler = &pvoice->resampler;
pvoice->groupID = groupIdx;
pvoice->busId = busId;
decoder->instrument = instrument;
pvoice->decoder.memin = (s32)decoder->instrument->base;
@ -591,7 +591,7 @@ s32 au_syn_get_playing(u8 voiceIdx) {
s32 au_syn_get_bus(u8 voiceIdx) {
AuPVoice* pvoice = &gSynDriverPtr->pvoices[voiceIdx];
return pvoice->groupID;
return pvoice->busId;
}
f32 au_syn_get_pitch(u8 voiceIdx) {

View File

@ -39,9 +39,9 @@ void update_ambient_sounds(void) {
case AMBIENT_SOUND_FADE_OUT:
if (ambientSoundState->flags & 1) {
if (ambientSoundState->fadeTime < 250) {
error = snd_ambient_quick_fade_out(0);
error = snd_ambient_stop_quick(0);
} else {
error = snd_ambient_slow_fade_out(0, ambientSoundState->fadeTime);
error = snd_ambient_stop_slow(0, ambientSoundState->fadeTime);
}
if (error != AU_RESULT_OK) {
@ -52,15 +52,15 @@ void update_ambient_sounds(void) {
break;
case AMBIENT_SOUND_FADE_IN:
if (ambientSoundState->flags & 1) {
if (snd_ambient_800555E4(0) != AU_RESULT_OK) {
if (snd_ambient_is_stopped(0) != AU_RESULT_OK) {
return;
}
ambientSoundState->flags &= ~1;
}
if (ambientSoundState->soundID < 0) {
ambientSoundState->fadeState = AMBIENT_SOUND_IDLE;
} else if (snd_ambient_load(ambientSoundState->soundID) == AU_RESULT_OK) {
if (snd_ambient_80055464(0, 0) == AU_RESULT_OK) {
} else if (snd_load_ambient(ambientSoundState->soundID) == AU_RESULT_OK) {
if (snd_ambient_play(0, 0) == AU_RESULT_OK) {
ambientSoundState->fadeState = AMBIENT_SOUND_IDLE;
ambientSoundState->flags |= 1;
}
@ -73,7 +73,7 @@ s32 play_ambient_sounds(s32 soundID, s32 fadeTime) {
AmbientSoundSettings* state = &AmbientSoundData;
if (!gGameStatusPtr->musicEnabled) {
snd_ambient_quick_fade_out(state->soundID);
snd_ambient_stop_quick(state->soundID);
state->flags &= ~1;
return 1;
}

View File

@ -84,7 +84,7 @@ void bgm_update_music_settings(void) {
s16 state2 = 2;
s16 flag4 = MUSIC_SETTINGS_FLAG_4;
s32 flags;
for (i; i < 2; i++, music++) {
switch (music->state) {
case 0:
@ -165,7 +165,7 @@ void bgm_update_music_settings(void) {
music->variation = music->savedVariation;
music->songName = music->savedSongName;
music->state = 0;
music->flags |= MUSIC_SETTINGS_FLAG_1;
music->flags |= MUSIC_SETTINGS_FLAG_1;
music->flags &= ~MUSIC_SETTINGS_FLAG_8;
}
}
@ -401,7 +401,7 @@ void bgm_pop_battle_song(void) {
} else {
musicSetting->flags |= MUSIC_SETTINGS_FLAG_8;
_bgm_set_song(0, musicSetting->savedSongID, musicSetting->savedVariation, 0, 8);
snd_ambient_80055590(0, 250);
snd_ambient_resume(0, 250);
}
}
}
@ -410,7 +410,7 @@ void bgm_push_battle_song(void) {
MusicSettings* musicSetting = gMusicSettings;
if (gGameStatusPtr->demoState == 0 && !(gOverrideFlags & GLOBAL_OVERRIDES_20000)) {
snd_ambient_8005553C(0, 250);
snd_ambient_pause(0, 250);
musicSetting->savedSongID = musicSetting->songID;
musicSetting->savedVariation = musicSetting->variation;
musicSetting->savedSongName = musicSetting->songName;

View File

@ -1,34 +1,34 @@
// 2BF90.c
void au_mseq_manager_init(AuAmbienceManager* arg0, s8 arg1, s8 reverbType, AuGlobals* arg3);
AuResult func_80050C30(u32 arg0);
void func_80050C54(s32 arg0, s32 arg1);
void au_mseq_set_disabled(s32 arg0, s32 arg1);
AuResult func_80050CA0(s32 arg0, s32 arg1);
void func_80050D50(AuAmbPlayer* arg0);
void func_80050EF0_fade_out_unk(s32 arg0, s32 arg1);
void func_80050EF0_fade_in_unk(s32 arg0, s32 arg1);
void func_80050EF0_fade_out_quick(s32 arg0);
void func_80050EF0_fade_out_slow(s32 arg0, s32 arg1);
void au_mseq_set_volume(s32 arg0, s32 arg1, s32 arg2);
AuResult func_80051050(s32 arg0);
void func_800510A4(AuAmbienceManager* arg0, MSEQHeader* mseq, s32 index);
void snd_ambient_manager_update(AuAmbienceManager* arg0);
void func_80051334(AuAmbienceManager* manager, AuAmbPlayer* lambda);
void func_80051434(AuAmbienceManager* manager, AuAmbPlayer* lambda);
s32 au_mseq_read_next(AuAmbPlayer* arg0);
void au_mseq_player_stop(AuAmbienceManager* arg0, AuAmbPlayer* arg1);
void func_800522A8(AuAmbienceManager* arg0, AuAmbPlayer* lambda);
void func_8005232C(AuAmbienceManager* manager, AuAmbPlayer* lambda);
void au_amb_manager_init(AmbienceManager* arg0, s8 arg1, s8 reverbType, AuGlobals* arg3);
AuResult au_amb_check_player_index(u32 arg0);
void au_amb_load_tracks_fade(s32 arg0, s32 arg1);
void au_amb_set_disabled(s32 arg0, s32 arg1);
AuResult au_amb_start(s32 arg0, s32 arg1);
void au_amb_fade_setup(AmbiencePlayer* arg0);
void au_amb_pause(s32 arg0, s32 arg1);
void au_amb_resume(s32 arg0, s32 arg1);
void au_amb_stop_quick(s32 arg0);
void au_amb_stop_slow(s32 arg0, s32 arg1);
void au_amb_set_volume(s32 arg0, s32 arg1, s32 arg2);
AuResult au_amb_is_stopped(s32 arg0);
void au_amb_play_sequence(AmbienceManager* arg0, MSEQHeader* mseq, s32 index);
void au_amb_manager_update(AmbienceManager* arg0);
void au_amb_load_track_fade_info(AmbienceManager* manager, AmbiencePlayer* lambda);
void au_amb_player_update(AmbienceManager* manager, AmbiencePlayer* lambda);
u8 au_amb_read_next(AmbiencePlayer* arg0);
void au_amb_player_stop(AmbienceManager* arg0, AmbiencePlayer* arg1);
void au_amb_save_voices(AmbienceManager* arg0, AmbiencePlayer* lambda);
void au_amb_restore_voices(AmbienceManager* manager, AmbiencePlayer* lambda);
// 2d9a0_len_890.c
void func_800525A0(AuGlobals* globals);
void func_80052614(AuGlobals* globals);
void func_80052660(AuGlobals* globals);
void func_80052B44(AlUnkVoice* arg0);
s32 func_80052BC0(s32 arg0);
void func_80052BF8(AlUnkVoice* voice, AlUnkInstrumentData* arg1);
u8 func_80052CFC(AlUnkVoice* voice);
void func_80052E18(AlUnkVoice* arg0);
void au_update_stopped_voices(AuGlobals* globals);
void au_init_voices(AuGlobals* globals);
void au_update_voices(AuGlobals* globals);
void au_voice_after_volume_change(AuVoice* arg0);
s32 au_voice_get_delta(s32 arg0);
void au_voice_start(AuVoice* voice, EnvelopeData* arg1);
u8 au_voice_step(AuVoice* voice);
void au_voice_set_vol_changed(AuVoice* arg0);
//2e230_len_2190.c
void func_80052E30(u8 index);
@ -38,19 +38,19 @@ static void au_reset_drum_entry(BGMDrumInfo* arg0);
static void au_reset_instrument_entry(BGMInstrumentInfo* arg0);
void au_update_clients_2(void);
void au_update_players_main(void);
void func_80053654(AuGlobals* globals);
void func_80053888(AlUnkVoice* arg0, u8 arg1);
void au_reset_voice(AlUnkVoice* arg0, u8 arg1);
void au_syn_update(AuGlobals* globals);
void au_reset_nonfree_voice(AuVoice* arg0, u8 arg1);
void au_reset_voice(AuVoice* arg0, u8 arg1);
f32 au_compute_pitch_ratio(s32 arg0);
void au_fade_init(Fade* fade, s32 time, s32 startValue, s32 endValue);
void au_fade_clear(Fade* fade);
void au_fade_update(Fade* fade);
void func_80053A98(u8 arg0, u16 arg1, s32 arg2);
void au_fade_set_volume(u8 arg0, u16 arg1, s32 arg2);
void func_80053AC8(Fade* fade);
void au_fade_set_vol_scale(Fade* fade, s16 value);
void func_80053B04(Fade* fade, u32 arg1, s32 target);
void func_80053BA8(Fade* fade);
Instrument* au_get_instrument(AuGlobals* globals, u32 bank, u32 patch, AlUnkInstrumentData* arg3);
Instrument* au_get_instrument(AuGlobals* globals, u32 bank, u32 patch, EnvelopeData* arg3);
void au_get_bgm_player_and_file(u32 playerIndex, BGMHeader** outCurrentTrackData, BGMPlayer** outPlayer);
void au_get_bgm_player(u32 playerIndex, BGMPlayer** outPlayer);
AuResult au_load_song_files(u32 arg0, BGMHeader* arg1, BGMPlayer* arg2);
@ -97,9 +97,9 @@ void au_sfx_load_groups_from_SEF(SoundManager* sndMgr);
void au_sfx_clear_queue(SoundManager* manager);
void au_sfx_enqueue_event(SoundManager* manager, u32 soundID, s16 volume, s16 pitchShift, u8 pan);
void au_sfx_update_main(SoundManager* manager);
s32 func_8004B9E4(SoundManager* manager, s32 arg1);
void func_8004BA54(SoundManager* manager, s32 arg1);
void func_8004BA74(SoundManager* manager, SoundSFXEntry* entry, SoundManagerA0*);
s32 au_sfx_set_reverb_type(SoundManager* manager, s32 arg1);
void au_sfx_set_state(SoundManager* manager, s32 arg1);
void au_sfx_load_sound(SoundManager* manager, SoundSFXEntry* entry, SoundManagerCustomCmdList*);
s16 au_sfx_manager_update(SoundManager* manager);
// 28910_len_5090.c
@ -179,22 +179,22 @@ void snd_start_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift);
void snd_adjust_sound(s32 soundID, u8 volume, u8 pan);
void snd_adjust_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift);
void snd_stop_sound(s32 soundID);
void func_800553F4(void);
void snd_reset(void);
void snd_start_sound_raw(s32 soundID, s16 volume, s16 pitchShift, s32 pan);
AuResult snd_ambient_load(s32 arg0);
AuResult snd_ambient_80055464(s32 arg0, s32 arg1);
AuResult snd_ambient_quick_fade_out(s32 arg0);
AuResult snd_ambient_slow_fade_out(s32 arg0, s32 arg1);
AuResult snd_ambient_8005553C(s32 arg0, s32 arg1);
AuResult snd_ambient_80055590(s32 arg0, s32 arg1);
AuResult snd_ambient_800555E4(s32 arg0);
AuResult snd_ambient_80055618(s32 arg0, s32 arg1);
AuResult snd_load_ambient(s32 arg0);
AuResult snd_ambient_play(s32 arg0, s32 arg1);
AuResult snd_ambient_stop_quick(s32 arg0);
AuResult snd_ambient_stop_slow(s32 arg0, s32 arg1);
AuResult snd_ambient_pause(s32 arg0, s32 arg1);
AuResult snd_ambient_resume(s32 arg0, s32 arg1);
AuResult snd_ambient_is_stopped(s32 arg0);
AuResult snd_ambient_mute(s32 arg0, s32 arg1);
AuResult snd_ambient_set_volume(s32 arg0, s32 arg1, s32 arg2);
AuResult snd_ambient_disable(s32 arg0);
AuResult snd_ambient_enable(s32 arg0);
void snd_ambient_80055760(s32 arg0);
AuResult snd_ambient_800557CC(s32 arg0);
AuResult snd_ambient_set_track(s32 arg0);
AuResult snd_ambient_stop_all(s32 arg0);
AuResult snd_ambient_play_only(s32 arg0);
AuResult au_song_load(s32 songID, s32 playerIndex);
AuResult au_song_start(s32 songName);
AuResult au_song_start_variation(s32 songName, s32 variation);
@ -240,8 +240,8 @@ void audio_set_mono(void);
void func_800561A4(s32 arg0);
void func_800561C4(s32 arg0);
void func_800561E4(s32 arg0);
void func_80056204(void);
void func_80056228(void);
void enable_sounds(void);
void disable_sounds(void);
*/
// 31650.c
@ -256,7 +256,7 @@ void au_bus_set_volume(u8 arg0, u16 arg1);
u16 au_bus_get_volume(u8 arg0, u16 arg1);
void au_bus_set_effect(u8 arg0, u8 effectID);
void au_bus_set_fx_params(u8 arg0, s16 arg1, s16 arg2, s32 arg3);
void au_pvoice_set_group(u8 arg0, s8 arg1);
void au_pvoice_set_bus(u8 arg0, s8 arg1);
void au_syn_stop_voice(u8 voiceIdx);
void au_syn_start_voice(u8 index);
void au_syn_start_voice_params(u8 index, u8 reverbType, Instrument* table, f32 pitch, s16 vol, u8 pan, u8 fxMix, s32 delta);
@ -301,7 +301,7 @@ s32 au_fx_param_hdl(AuFX* fx, s16 index, s16 paramID, s32 value);
void sfx_reset_door_sounds(void);
void sfx_clear_sounds(void);
void sfx_clear_env_sounds(s16 playSounds);
void sfx_update_looping_sound_params(void);
void sfx_update_env_sound_params(void);
void sfx_set_reverb_mode(s32 arg0);
s32 sfx_get_reverb_mode(void);
void sfx_stop_env_sounds(void);
@ -311,7 +311,7 @@ SoundInstance* sfx_get_env_sound_instance(s32 soundID);
void sfx_play_sound_looping(s32 soundId, u8 volume, u8 pan, s16 pitchShift);
void sfx_register_looping_sound_at_position(s32 soundID, s32 flags, f32 x, f32 y, f32 z);
s32 sfx_adjust_env_sound_pos(s32 soundID, s32 sourceFlags, f32 x, f32 y, f32 z);
void func_80149A6C(s32 soundID, s32 keepPlaying);
void snd_stop_tracking_env_sound_pos(s32 soundID, s32 keepPlaying);
void sfx_play_sound_with_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift);
void sfx_adjust_env_sound_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift);
void sfx_stop_sound(s32 soundID);

View File

@ -11,22 +11,22 @@ void snd_start_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift);
void snd_adjust_sound(s32 soundID, u8 volume, u8 pan);
void snd_adjust_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift);
void snd_stop_sound(s32 soundID);
void func_800553F4(void);
void snd_reset(void);
void snd_start_sound_raw(s32 soundID, s16 volume, s16 pitchShift, s32 pan);
AuResult snd_ambient_load(s32 arg0);
AuResult snd_ambient_80055464(s32 arg0, s32 arg1);
AuResult snd_ambient_quick_fade_out(s32 arg0);
AuResult snd_ambient_slow_fade_out(s32 arg0, s32 arg1);
AuResult snd_ambient_8005553C(s32 arg0, s32 arg1);
AuResult snd_ambient_80055590(s32 arg0, s32 arg1);
AuResult snd_ambient_800555E4(s32 arg0);
AuResult snd_ambient_80055618(s32 arg0, s32 arg1);
AuResult snd_load_ambient(s32 arg0);
AuResult snd_ambient_play(s32 arg0, s32 arg1);
AuResult snd_ambient_stop_quick(s32 arg0);
AuResult snd_ambient_stop_slow(s32 arg0, s32 arg1);
AuResult snd_ambient_pause(s32 arg0, s32 arg1);
AuResult snd_ambient_resume(s32 arg0, s32 arg1);
AuResult snd_ambient_is_stopped(s32 arg0);
AuResult snd_ambient_mute(s32 arg0, s32 arg1);
AuResult snd_ambient_set_volume(s32 arg0, s32 arg1, s32 arg2);
AuResult snd_ambient_disable(s32 arg0);
AuResult snd_ambient_enable(s32 arg0);
void snd_ambient_80055760(s32 arg0);
AuResult snd_ambient_800557CC(s32 arg0);
AuResult snd_ambient_set_track(s32 arg0);
AuResult snd_ambient_stop_all(s32 arg0);
AuResult snd_ambient_play_only(s32 arg0);
AuResult au_song_load(s32 songID, s32 playerIndex);
AuResult au_song_start(s32 songName);
AuResult au_song_start_variation(s32 songName, s32 variation);
@ -66,14 +66,14 @@ void audio_set_mono(void);
void func_800561A4(s32 arg0);
void func_800561C4(s32 arg0);
void func_800561E4(s32 arg0);
void func_80056204(void);
void func_80056228(void);
void enable_sounds(void);
void disable_sounds(void);
// sfx.h
void sfx_reset_door_sounds(void);
void sfx_clear_sounds(void);
void sfx_clear_env_sounds(s16 playSounds);
void sfx_update_looping_sound_params(void);
void sfx_update_env_sound_params(void);
void sfx_set_reverb_mode(s32 arg0);
s32 sfx_get_reverb_mode(void);
void sfx_stop_env_sounds(void);
@ -81,7 +81,7 @@ void sfx_stop_env_sounds(void);
void sfx_play_sound_looping(s32 soundId, u8 volume, u8 pan, s16 pitchShift);
void sfx_register_looping_sound_at_position(s32 soundID, s32 flags, f32 x, f32 y, f32 z);
s32 sfx_adjust_env_sound_pos(s32 soundID, s32 sourceFlags, f32 x, f32 y, f32 z);
void func_80149A6C(s32 soundID, s32 keepPlaying);
void snd_stop_tracking_env_sound_pos(s32 soundID, s32 keepPlaying);
void sfx_play_sound_with_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift);
void sfx_adjust_env_sound_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift);
void sfx_stop_sound(s32 soundID);

View File

@ -5,56 +5,56 @@
// sound IDs
s32 LoopingSounds[] = {
0x00000287, 0x000002A8, 0x00000054, 0x00000056, 0x00000024, 0x00000027, 0x00000021, 0x00000022, 0x00000349,
0x00000273, 0x00000275, 0x00000275, 0x00000274, 0x00000273, 0x00000274, 0x00000099, 0x0000009E, 0x0000032E,
0x0000008E, 0x00000089, 0x00000083, 0x00000388, 0x000000A0, 0x0000004A, 0x0000009F, 0x00000168, 0x00000185,
0x00000052, 0x0000004E, 0x0000004F, 0x00000189, 0x00000000, 0x00000000, 0x00000198, 0x00000199, 0x00000194,
0x0000019A, 0x00000091, 0x00000164, 0x00000271, 0x00000271, 0x00000274, 0x00000275, 0x00000271, 0x00000273,
0x00000271, 0x00000273, 0x00000271, 0x00000274, 0x00000275, 0x00000276, 0x00000271, 0x00000273, 0x00000271,
0x00000274, 0x00000276, 0x00000275, 0x00000271, 0x00000271, 0x00000271, 0x00000271, 0x00000276, 0x00000275,
0x00000274, 0x0000039E, 0x00000341, 0x00000207, 0x00000271, 0x00000271, 0x00000275, 0x00000276, 0x00000271,
0x00000271, 0x00000271, 0x00000050, 0x00000070, 0x0000036C, 0x0000036D, 0x00000295, 0x00000043, 0x00000197,
0x00000221, 0x0000022A, 0x0000022B, 0x00002040, 0x00000046, 0x00000033, 0x00000034, 0x00000039, 0x0000004C,
0x0000004D, 0x000001B1, 0x000001B2, 0x00000094, 0x0000005D, 0x0000005B, 0x00000060, 0x000001B3, 0x00000000,
0x000000AD, 0x000000AE, 0x000000AF, 0x0000023D, 0x000000A2, 0x00000248, 0x00000249, 0x00000391, 0x000003BC,
0x000003AD, 0x0000022C, 0x0000022D,
SOUND_287, SOUND_2A8, SOUND_54, SOUND_56, SOUND_24, SOUND_27, SOUND_21, SOUND_22, SOUND_349,
SOUND_273, SOUND_275, SOUND_275, SOUND_274, SOUND_273, SOUND_274, SOUND_99, SOUND_9E, SOUND_32E,
SOUND_8E, SOUND_89, SOUND_83, SOUND_388, SOUND_A0, SOUND_4A, SOUND_9F, SOUND_168, SOUND_185,
SOUND_52, SOUND_4E, SOUND_4F, SOUND_189, 0, 0, SOUND_198, SOUND_199, SOUND_194,
SOUND_19A, SOUND_91, SOUND_164, SOUND_271, SOUND_271, SOUND_274, SOUND_275, SOUND_271, SOUND_273,
SOUND_271, SOUND_273, SOUND_271, SOUND_274, SOUND_275, SOUND_276, SOUND_271, SOUND_273, SOUND_271,
SOUND_274, SOUND_276, SOUND_275, SOUND_271, SOUND_271, SOUND_271, SOUND_271, SOUND_276, SOUND_275,
SOUND_274, SOUND_39E, SOUND_341, SOUND_207, SOUND_271, SOUND_271, SOUND_275, SOUND_276, SOUND_271,
SOUND_271, SOUND_271, SOUND_50, SOUND_70, SOUND_36C, SOUND_36D, SOUND_295, SOUND_43, SOUND_197,
SOUND_221, SOUND_22A, SOUND_22B, SOUND_2040, SOUND_JR_TROOPA_SWIM, SOUND_33, SOUND_34, SOUND_39, SOUND_4C,
SOUND_4D, SOUND_1B1, SOUND_1B2, SOUND_94, SOUND_5D, SOUND_5B, SOUND_60, SOUND_1B3, 0,
SOUND_AD, SOUND_AE, SOUND_AF, SOUND_23D, SOUND_A2, SOUND_248, SOUND_249, SOUND_391, SOUND_3BC,
SOUND_3AD, SOUND_22C, SOUND_22D,
};
// all sound IDs for alternating sounds
s32 D_8014F48C[] = { 0x00000336, 0x00000316 };
s32 D_8014F494[] = { 0x00000337, 0x00000317 };
s32 D_8014F49C[] = { 0x00000338, 0x00000318 };
s32 D_8014F4A4[] = { 0x00000339, 0x00000319 };
s32 D_8014F4AC[] = { 0x0000033A, 0x0000031A };
s32 D_8014F4B4[] = { 0x0000033B, 0x0000031B };
s32 D_8014F4BC[] = { 0x0000033C, 0x0000031C };
s32 D_8014F4C4[] = { 0x0000033D, 0x0000031D };
s32 D_8014F4CC[] = { 0x0000033E, 0x0000031E };
s32 D_8014F4D4[] = { 0x0000033F, 0x0000031F };
s32 D_8014F4DC[] = { 0x00000340, 0x00000340 };
s32 D_8014F4E4[] = { 0x000002F4, 0x000002F5 };
s32 D_8014F4EC[] = { 0x0000032F, 0x00000330 };
s32 D_8014F4F4[] = { 0x00000334, 0x00000335 };
s32 D_8014F4FC[] = { 0x000002F1, 0x000002F2 };
s32 D_8014F504[] = { 0x000000C1, 0x000000C2 };
s32 D_8014F50C[] = { 0x000000C3, 0x000000C4 };
s32 D_8014F514[] = { 0x000001CB, 0x000001CD };
s32 D_8014F51C[] = { 0x000001CC, 0x000001CE };
s32 D_8014F524[] = { 0x000002A6, 0x000002A7 };
s32 D_8014F52C[] = { 0x0000020C, 0x0000020D, 0x0000020E };
s32 D_8014F538[] = { 0x00000259, 0x0000025A };
s32 D_8014F540[] = { 0x0000025C, 0x0000025D };
s32 D_8014F548[] = { 0x00000331, 0x00000332, 0x00000333 };
s32 D_8014F554[] = { 0x00002078, 0x00002079 };
s32 D_8014F55C[] = { 0x00000179, 0x0000017A };
s32 D_8014F564[] = { 0x000001FB, 0x000001FC };
s32 D_8014F56C[] = { 0x0000203A, 0x0000203B };
s32 D_8014F574[] = { 0x0000022E, 0x0000022F };
s32 D_8014F57C[] = { 0x0000202A, 0x0000202B };
s32 D_8014F584[] = { 0x00002041, 0x00002042 };
s32 D_8014F58C[] = { 0x00002043, 0x00002044 };
s32 D_8014F594[] = { 0x00002078, 0x00002079 };
s32 D_8014F59C[] = { 0x000003B6, 0x000003B7 };
s32 D_8014F48C[] = { SOUND_336, SOUND_316 };
s32 D_8014F494[] = { SOUND_337, SOUND_317 };
s32 D_8014F49C[] = { SOUND_338, SOUND_318 };
s32 D_8014F4A4[] = { SOUND_339, SOUND_319 };
s32 D_8014F4AC[] = { SOUND_33A, SOUND_31A };
s32 D_8014F4B4[] = { SOUND_33B, SOUND_31B };
s32 D_8014F4BC[] = { SOUND_33C, SOUND_31C };
s32 D_8014F4C4[] = { SOUND_33D, SOUND_31D };
s32 D_8014F4CC[] = { SOUND_33E, SOUND_31E };
s32 D_8014F4D4[] = { SOUND_33F, SOUND_31F };
s32 D_8014F4DC[] = { SOUND_340, SOUND_340 };
s32 D_8014F4E4[] = { SOUND_2F4, SOUND_2F5 };
s32 D_8014F4EC[] = { SOUND_32F, SOUND_330 };
s32 D_8014F4F4[] = { SOUND_334, SOUND_335 };
s32 D_8014F4FC[] = { SOUND_2F1, SOUND_2F2 };
s32 D_8014F504[] = { SOUND_BOO_VANISH, SOUND_C2 };
s32 D_8014F50C[] = { SOUND_BOO_APPEAR, SOUND_C4 };
s32 D_8014F514[] = { SOUND_1CB, SOUND_1CD };
s32 D_8014F51C[] = { SOUND_1CC, SOUND_1CE };
s32 D_8014F524[] = { SOUND_2A6, SOUND_2A7 };
s32 D_8014F52C[] = { SOUND_20C, SOUND_20D, SOUND_20E };
s32 D_8014F538[] = { SOUND_259, SOUND_25A };
s32 D_8014F540[] = { SOUND_25C, SOUND_25D };
s32 D_8014F548[] = { SOUND_331, SOUND_332, SOUND_333 };
s32 D_8014F554[] = { SOUND_2078, SOUND_2079 };
s32 D_8014F55C[] = { SOUND_179, SOUND_17A };
s32 D_8014F564[] = { SOUND_1FB, SOUND_1FC };
s32 D_8014F56C[] = { SOUND_203A, SOUND_203B };
s32 D_8014F574[] = { SOUND_22E, SOUND_22F };
s32 D_8014F57C[] = { SOUND_202A, SOUND_202B };
s32 D_8014F584[] = { SOUND_2041, SOUND_2042 };
s32 D_8014F58C[] = { SOUND_2043, SOUND_2044 };
s32 D_8014F594[] = { SOUND_2078, SOUND_2079 };
s32 D_8014F59C[] = { SOUND_3B6, SOUND_3B7 };
AlternatingSoundSet AlternatingSounds[] = {
{
@ -205,10 +205,10 @@ s32 OpenCloseSounds[][2] = {
{ SOUND_20A3, SOUND_20A4 },
};
extern SoundInstance D_801598A0[MAX_SOUND_INSTANCES];
extern SoundInstance D_801599B8[MAX_SOUND_INSTANCES];
extern SoundInstance* D_80159AD0;
extern s32 D_80159AD4;
extern SoundInstance wEnvSounds[MAX_SOUND_INSTANCES];
extern SoundInstance bEnvSounds[MAX_SOUND_INSTANCES];
extern SoundInstance* gCurrentEnvSounds;
extern s32 SfxReverbMode;
void sfx_compute_spatialized_sound_params_full(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags) {
s32 screenX, screenY, screenZ;
@ -298,9 +298,9 @@ void sfx_reset_door_sounds(void) {
}
void sfx_clear_sounds(void) {
bzero(&D_801598A0, sizeof(D_801598A0));
bzero(&D_801599B8, sizeof(D_801599B8));
D_80159AD0 = D_801598A0;
bzero(&wEnvSounds, sizeof(wEnvSounds));
bzero(&bEnvSounds, sizeof(bEnvSounds));
gCurrentEnvSounds = wEnvSounds;
sfx_set_reverb_mode(0);
sfx_reset_door_sounds();
}
@ -308,34 +308,34 @@ void sfx_clear_sounds(void) {
// name might be incorrect?
void sfx_clear_env_sounds(s16 playSounds) {
if (!gGameStatusPtr->isBattle) {
D_80159AD0 = D_801598A0;
gCurrentEnvSounds = wEnvSounds;
} else {
D_80159AD0 = D_801599B8;
gCurrentEnvSounds = bEnvSounds;
}
if (playSounds) {
SoundInstance* sound = D_80159AD0;
SoundInstance* sound = gCurrentEnvSounds;
s32 i;
for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
if (sound->flags & SOUND_INSTANCE_FLAG_1) {
if (sound->flags & SOUND_INSTANCE_FLAG_ACTIVE) {
snd_start_sound_with_shift(sound->soundID, sound->volume, sound->pan, sound->pitchShift);
}
}
} else {
bzero(D_80159AD0, MAX_SOUND_INSTANCES * sizeof(SoundInstance));
bzero(gCurrentEnvSounds, MAX_SOUND_INSTANCES * sizeof(SoundInstance));
}
}
void sfx_update_looping_sound_params(void) {
SoundInstance* sound = D_80159AD0;
void sfx_update_env_sound_params(void) {
SoundInstance* sound = gCurrentEnvSounds;
u16 volume;
u16 pan;
s32 i;
for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
if (sound->flags & SOUND_INSTANCE_FLAG_1) {
if (sound->flags & SOUND_INSTANCE_FLAG_2) {
if (sound->flags & SOUND_INSTANCE_FLAG_ACTIVE) {
if (sound->flags & SOUND_INSTANCE_FLAG_POSITION_CHANGED) {
sfx_get_spatialized_sound_params(sound->position.x, sound->position.y, sound->position.z, &volume, &pan, sound->sourceFlags);
sound->volume = volume;
sound->pan = pan;
@ -347,11 +347,11 @@ void sfx_update_looping_sound_params(void) {
void sfx_set_reverb_mode(s32 mode) {
func_800561E4(mode);
D_80159AD4 = mode;
SfxReverbMode = mode;
}
s32 sfx_get_reverb_mode(void) {
return D_80159AD4;
return SfxReverbMode;
}
void sfx_stop_env_sounds(void) {
@ -359,25 +359,25 @@ void sfx_stop_env_sounds(void) {
s32 i;
if (!gGameStatusPtr->isBattle) {
D_80159AD0 = D_801598A0;
gCurrentEnvSounds = wEnvSounds;
} else {
D_80159AD0 = D_801599B8;
gCurrentEnvSounds = bEnvSounds;
}
sound = D_80159AD0;
sound = gCurrentEnvSounds;
for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
if (sound->flags & SOUND_INSTANCE_FLAG_1) {
if (sound->flags & SOUND_INSTANCE_FLAG_ACTIVE) {
snd_stop_sound(sound->soundID);
}
}
}
SoundInstance* sfx_get_env_sound_instance(s32 soundID) {
SoundInstance* sound = D_80159AD0;
SoundInstance* sound = gCurrentEnvSounds;
s32 i;
for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
if (sound->flags & SOUND_INSTANCE_FLAG_1 && sound->soundID == soundID) {
if (sound->flags & SOUND_INSTANCE_FLAG_ACTIVE && sound->soundID == soundID) {
return sound;
}
}
@ -386,11 +386,11 @@ SoundInstance* sfx_get_env_sound_instance(s32 soundID) {
}
void sfx_play_sound_looping(s32 soundId, u8 volume, u8 pan, s16 pitchShift) {
SoundInstance* sound = D_80159AD0;
SoundInstance* sound = gCurrentEnvSounds;
s32 i;
for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
if (!(sound->flags & SOUND_INSTANCE_FLAG_1)) {
if (!(sound->flags & SOUND_INSTANCE_FLAG_ACTIVE)) {
break;
}
}
@ -399,17 +399,17 @@ void sfx_play_sound_looping(s32 soundId, u8 volume, u8 pan, s16 pitchShift) {
sound->soundID = soundId;
sound->volume = volume;
sound->pitchShift = pitchShift;
sound->flags |= SOUND_INSTANCE_FLAG_1;
sound->flags |= SOUND_INSTANCE_FLAG_ACTIVE;
snd_start_sound_with_shift(soundId, volume, pan, pitchShift);
}
void sfx_register_looping_sound_at_position(s32 soundID, s32 flags, f32 x, f32 y, f32 z) {
SoundInstance* sound = D_80159AD0;
SoundInstance* sound = gCurrentEnvSounds;
s32 i;
for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
if (!(sound->flags & SOUND_INSTANCE_FLAG_1)) {
if (!(sound->flags & SOUND_INSTANCE_FLAG_ACTIVE)) {
break;
}
}
@ -419,7 +419,7 @@ void sfx_register_looping_sound_at_position(s32 soundID, s32 flags, f32 x, f32 y
sound->position.y = y;
sound->position.z = z;
sound->soundID = soundID;
sound->flags |= (SOUND_INSTANCE_FLAG_1 | SOUND_INSTANCE_FLAG_2);
sound->flags |= SOUND_INSTANCE_FLAG_ACTIVE | SOUND_INSTANCE_FLAG_POSITION_CHANGED;
sfx_play_sound_at_position(soundID, flags, x, y, z);
}
@ -436,15 +436,15 @@ s32 sfx_adjust_env_sound_pos(s32 soundID, s32 sourceFlags, f32 x, f32 y, f32 z)
sound->position.y = y;
sound->position.z = z;
sound->soundID = soundID;
sound->flags |= (SOUND_INSTANCE_FLAG_1 | SOUND_INSTANCE_FLAG_2);
sound->flags |= SOUND_INSTANCE_FLAG_ACTIVE | SOUND_INSTANCE_FLAG_POSITION_CHANGED;
return TRUE;
}
void func_80149A6C(s32 soundID, s32 keepPlaying) {
void snd_stop_tracking_env_sound_pos(s32 soundID, s32 keepPlaying) {
SoundInstance* sound = sfx_get_env_sound_instance(soundID);
if (sound != NULL) {
sound->flags &= -SOUND_INSTANCE_FLAG_4; //TODO use logical negate here
sound->flags &= ~(SOUND_INSTANCE_FLAG_ACTIVE | SOUND_INSTANCE_FLAG_POSITION_CHANGED);
if (!keepPlaying) {
snd_stop_sound(sound->soundID);
}
@ -463,6 +463,7 @@ void sfx_play_sound_with_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
s32 soundType = (soundID & 0x70000000) >> 0x1C;
switch (soundType) {
case SOUND_TYPE_LOOPING:
// 0x8xxxxxxx
sfx_play_sound_looping(LoopingSounds[soundIndex], volume, pan, pitchShift);
return;
case SOUND_TYPE_EXIT_DOOR:
@ -472,6 +473,7 @@ void sfx_play_sound_with_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
soundID = OpenCloseSounds[gCurrentRoomDoorSounds][soundIndex];
break;
case SOUND_TYPE_ALTERNATING:
// 0xBxxxxxxx
alternatingSet = &AlternatingSounds[soundIndex];
if (alternatingSet->currentIndex >= alternatingSet->soundCount) {
alternatingSet->currentIndex = 0;
@ -502,7 +504,7 @@ void sfx_stop_sound(s32 soundID) {
s32 sound = soundID;
if (sound & SOUND_TYPE_SPECIAL) {
func_80149A6C(LoopingSounds[sound & 0xFFFF], 0);
snd_stop_tracking_env_sound_pos(LoopingSounds[sound & 0xFFFF], FALSE);
} else {
snd_stop_sound(sound);
}
@ -518,16 +520,16 @@ void sfx_play_sound_at_player(s32 soundID, s32 flags) {
sfx_play_sound_at_position(soundID, flags, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z);
}
void sfx_play_sound_at_npc(s32 soundID, s32 arg1, s32 npcID) {
void sfx_play_sound_at_npc(s32 soundID, s32 flags, s32 npcID) {
Npc* npc = get_npc_safe(npcID);
if (npc != NULL) {
sfx_play_sound_at_position(soundID, arg1, npc->pos.x, npc->pos.y, npc->pos.z);
sfx_play_sound_at_position(soundID, flags, npc->pos.x, npc->pos.y, npc->pos.z);
}
}
void sfx_play_sound_at_position(s32 soundID, s32 flags, f32 posX, f32 posY, f32 posZ) {
if ((soundID & 0xF0000000) == 0x80000000) {
if ((soundID & 0xF0000000) == SOUND_TYPE_SPECIAL) {
s32 id = LoopingSounds[soundID & 0xFFFF];
sfx_register_looping_sound_at_position(id, flags, posX, posY, posZ);
@ -614,6 +616,7 @@ void sfx_compute_spatialized_sound_params_0(f32 x, f32 y, f32 z, s16* volume, s1
}
if (!gGameStatusPtr->isBattle) {
// 25/75 at screen edge
*pan = (screenX * 0.2f) + 32.0f;
} else {
f32 temp_f20 = ((screenX * 127.0) / SCREEN_WIDTH) - 64.0;

File diff suppressed because it is too large Load Diff

View File

@ -285,7 +285,7 @@ ApiStatus b_area_isk_part_1_ChompChainUpdate(Evt* script, s32 isInitialCall) {
if (animState->unk_18 < 2.0f * -animState->unk_14) {
animState->unk_18 = 2.0f * -animState->unk_14;
if (actor->state.varTable[8] != 0 && i == 0) {
sfx_play_sound_at_position(SOUND_2063, 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(SOUND_2063, SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
}
animState->currentPos.y += animState->unk_18;

View File

@ -300,7 +300,7 @@ ApiStatus b_area_isk_part_2_chain_chomp_ChompChainUpdate(Evt* script, s32 isInit
if (animState->unk_18 < 2.0f * -animState->unk_14) {
animState->unk_18 = 2.0f * -animState->unk_14;
if (actor->state.varTable[8] != 0 && i == 0) {
sfx_play_sound_at_position(SOUND_2063, 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(SOUND_2063, SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
}
animState->currentPos.y += animState->unk_18;

View File

@ -1450,7 +1450,7 @@ EvtScript N(8021CD50) = {
EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_749)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Red_Anim09)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Red_Anim07)

View File

@ -225,7 +225,7 @@ EvtScript N(EVS_ShakeTree) = {
EVT_BUF_READ1(LVar5)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar6, LVarF, LVar8)
EVT_CALL(PlaySound, SOUND_SMASH_GOOMNUT_TREE)
EVT_CALL(PlaySound, 0x166)
EVT_CALL(PlaySound, SOUND_SHAKE_TREE)
EVT_THREAD
EVT_SET(LocalFlag(0), 0)
EVT_IF_NE(LVar1, 0)
@ -238,7 +238,7 @@ EvtScript N(EVS_ShakeTree) = {
EVT_CALL(N(TransformFoliage), LVar3, EVT_FLOAT(0.1), EVT_FLOAT(0.2), LVarF, 0)
EVT_IF_EQ(LocalFlag(0), 0)
EVT_SET(LocalFlag(0), 1)
EVT_CALL(PlaySoundAtModel, LVar3, 358, 0)
EVT_CALL(PlaySoundAtModel, LVar3, SOUND_SHAKE_TREE, SOUND_SPACE_MODE_0)
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(1)
@ -270,7 +270,7 @@ EvtScript N(EVS_ShakeTree) = {
EVT_CALL(N(TransformFoliage), LVar4, EVT_FLOAT(0.1), EVT_FLOAT(0.2), LVarF, 0)
EVT_IF_EQ(LocalFlag(0), 0)
EVT_SET(LocalFlag(0), 1)
EVT_CALL(PlaySoundAtModel, LVar4, 357, 0)
EVT_CALL(PlaySoundAtModel, LVar4, SOUND_SMASH_GOOMNUT_TREE, SOUND_SPACE_MODE_0)
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(1)

View File

@ -418,7 +418,7 @@ EvtScript N(attackFireBreath) = {
EVT_CALL(N(StartRumbleWithParams), 50, 148)
EVT_CALL(PlaySound, SOUND_3BD)
EVT_WAIT(70)
EVT_CALL(PlaySound, SOUND_7BD)
EVT_CALL(PlaySound, SOUND_3BD | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_END_THREAD
EVT_CALL(SetNpcAnimation, 0, ANIM_ParadePeach_Weep)
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C)

View File

@ -1505,7 +1505,7 @@ EvtScript N(attackFlameBreath) = {
EVT_CALL(N(StartRumbleWithParams), 50, 148)
EVT_CALL(PlaySound, SOUND_3BD)
EVT_WAIT(70)
EVT_CALL(PlaySound, SOUND_7BD)
EVT_CALL(PlaySound, SOUND_3BD | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_END_THREAD
EVT_WAIT(10)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)

View File

@ -1363,7 +1363,7 @@ EvtScript N(attackFlameBreath) = {
EVT_CALL(N(StartRumbleWithParams), 50, 148)
EVT_CALL(PlaySound, SOUND_3BD)
EVT_WAIT(70)
EVT_CALL(PlaySound, SOUND_7BD)
EVT_CALL(PlaySound, SOUND_3BD | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_END_THREAD
EVT_WAIT(10)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)

View File

@ -1596,7 +1596,7 @@ EvtScript N(attackFlameBreath) = {
EVT_CALL(N(StartRumbleWithParams), 50, 148)
EVT_CALL(PlaySound, SOUND_3BD)
EVT_WAIT(70)
EVT_CALL(PlaySound, SOUND_7BD)
EVT_CALL(PlaySound, SOUND_3BD | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_END_THREAD
EVT_WAIT(10)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)

View File

@ -440,7 +440,7 @@ EvtScript N(acrobaticAttack) = {
EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_749)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Black_Anim09)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Black_Anim07)

View File

@ -278,7 +278,7 @@ EvtScript N(handleEvent_80219500) = {
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(EVENT_SHOCK_HIT)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_759)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_SET_CONST(LVar0, 1)
EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07)
EVT_EXEC_WAIT(DoShockHit)
@ -287,7 +287,7 @@ EvtScript N(handleEvent_80219500) = {
EVT_EXEC_WAIT(DoJumpBack)
EVT_EXEC_WAIT(N(80219464))
EVT_CASE_EQ(EVENT_SHOCK_DEATH)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_759)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_SET_CONST(LVar0, 1)
EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07)
EVT_EXEC_WAIT(DoShockHit)

View File

@ -652,9 +652,9 @@ EvtScript N(spawnColorado) = {
EVT_CALL(SpeakToPlayer, 0, -1, -1, 0, MSG_CH5_0104)
EVT_THREAD
EVT_LOOP(9)
EVT_CALL(PlaySoundAtNpc, 0, SOUND_20BA, 0)
EVT_CALL(PlaySoundAtNpc, 0, SOUND_20BA, SOUND_SPACE_MODE_0)
EVT_WAIT(2)
EVT_CALL(PlaySoundAtNpc, 0, SOUND_3B4, 0)
EVT_CALL(PlaySoundAtNpc, 0, SOUND_3B4, SOUND_SPACE_MODE_0)
EVT_WAIT(2)
EVT_END_LOOP
EVT_END_THREAD
@ -662,7 +662,7 @@ EvtScript N(spawnColorado) = {
EVT_CALL(SetNpcAnimationSpeed, 0, EVT_FLOAT(2.0))
EVT_CALL(SetNpcSpeed, 0, EVT_FLOAT(10.0))
EVT_CALL(NpcMoveTo, 0, 70, 0, 0)
EVT_CALL(PlaySoundAtNpc, 0, SOUND_E8, 0)
EVT_CALL(PlaySoundAtNpc, 0, SOUND_E8, SOUND_SPACE_MODE_0)
EVT_CALL(SetNpcAnimationSpeed, 0, EVT_FLOAT(1.0))
EVT_CALL(SetNpcJumpscale, 0, EVT_FLOAT(1.0))
EVT_CALL(SetNpcAnimation, 0, ANIM_BattleKolorado_Injured)
@ -693,9 +693,9 @@ EvtScript N(spawnColorado) = {
EVT_CALL(NpcJump0, 0, 50, 0, 0, 12)
EVT_THREAD
EVT_LOOP(4)
EVT_CALL(PlaySoundAtNpc, 0, SOUND_20BA, 0)
EVT_CALL(PlaySoundAtNpc, 0, SOUND_20BA, SOUND_SPACE_MODE_0)
EVT_WAIT(2)
EVT_CALL(PlaySoundAtNpc, 0, SOUND_3B4, 0)
EVT_CALL(PlaySoundAtNpc, 0, SOUND_3B4, SOUND_SPACE_MODE_0)
EVT_WAIT(2)
EVT_END_LOOP
EVT_END_THREAD
@ -1373,7 +1373,7 @@ EvtScript N(onDeath) = {
EVT_THREAD
EVT_CALL(PlaySound, SOUND_3BC)
EVT_CALL(ShakeCam, 1, 0, 119, EVT_FLOAT(0.3))
EVT_CALL(PlaySound, SOUND_7BC)
EVT_CALL(PlaySound, SOUND_3BC | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 80, 234)
EVT_CALL(func_8027D32C, ACTOR_SELF)
@ -1471,7 +1471,7 @@ EvtScript N(onDeath) = {
EVT_THREAD
EVT_CALL(PlaySound, SOUND_3BC)
EVT_CALL(ShakeCam, 1, 0, 165, EVT_FLOAT(1.2))
EVT_CALL(PlaySound, SOUND_7BC)
EVT_CALL(PlaySound, SOUND_3BC | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 80, 300)
EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, FALSE)
@ -1644,7 +1644,7 @@ EvtScript N(onDeath) = {
EVT_CALL(PlaySound, SOUND_3BC)
EVT_CALL(ShakeCam, 1, 0, 100, EVT_FLOAT(0.5))
EVT_CALL(ShakeCam, 1, 0, 8, EVT_FLOAT(0.2))
EVT_CALL(PlaySound, SOUND_7BC)
EVT_CALL(PlaySound, SOUND_3BC | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 80, 216)
EVT_THREAD

View File

@ -440,7 +440,7 @@ EvtScript N(80222824) = {
EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_749)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Black_Anim09)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Black_Anim07)

View File

@ -441,7 +441,7 @@ EvtScript N(8021BC2C) = {
EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_749)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Blue_Anim09)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Blue_Anim07)

View File

@ -441,7 +441,7 @@ EvtScript N(80220D2C) = {
EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_749)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Green_Anim09)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Green_Anim07)

View File

@ -441,7 +441,7 @@ EvtScript N(8021F22C) = {
EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_749)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Pink_Anim09)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Pink_Anim07)

View File

@ -955,7 +955,7 @@ EvtScript N(8022BF14) = {
EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_749)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Red_Anim09)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Red_Anim07)

View File

@ -441,7 +441,7 @@ EvtScript N(8021D72C) = {
EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_749)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Yellow_Anim09)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Yellow_Anim07)

View File

@ -1272,7 +1272,7 @@ EvtScript N(shy_guy_attack2) = {
EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_749)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Red_Anim09)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Red_Anim07)

View File

@ -425,42 +425,42 @@ EvtScript N(8021B0E4) = {
EVT_CALL(SetPartJumpGravity, ACTOR_SELF, 5, EVT_FLOAT(0.5))
EVT_CALL(JumpPartTo, ACTOR_SELF, 5, LVar0, LVar1, LVar2, 60, 1)
EVT_WAIT(30)
EVT_CALL(PlaySoundAtModel, 15, 482, 0)
EVT_CALL(PlaySoundAtModel, 15, SOUND_1E2, SOUND_SPACE_MODE_0)
EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(1.0))
EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 100, 20)
EVT_WAIT(20)
EVT_CALL(PlaySoundAtModel, 11, 482, 0)
EVT_CALL(PlaySoundAtModel, 11, SOUND_1E2, SOUND_SPACE_MODE_0)
EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 10, EVT_FLOAT(1.5))
EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 150, 20)
EVT_WAIT(30)
EVT_CALL(PlaySoundAtModel, 9, 482, 0)
EVT_CALL(PlaySoundAtModel, 9, SOUND_1E2, SOUND_SPACE_MODE_0)
EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 10, EVT_FLOAT(1.0))
EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 100, 20)
EVT_WAIT(30)
EVT_CALL(PlaySoundAtModel, 31, 482, 0)
EVT_CALL(PlaySoundAtModel, 31, SOUND_1E2, SOUND_SPACE_MODE_0)
EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(0.7))
EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 70, 20)
EVT_WAIT(20)
EVT_CALL(PlaySoundAtModel, 25, 482, 0)
EVT_CALL(PlaySoundAtModel, 25, SOUND_1E2, SOUND_SPACE_MODE_0)
EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, 1, 0, 10, EVT_FLOAT(1.0))
EVT_END_THREAD
EVT_CALL(N(StartRumbleWithParams), 100, 20)
EVT_WAIT(20)
EVT_CALL(PlaySoundAtModel, 43, 482, 0)
EVT_CALL(PlaySoundAtModel, 43, SOUND_1E2, SOUND_SPACE_MODE_0)
EVT_CALL(N(StartRumbleWithParams), 60, 20)
EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_00)

View File

@ -379,7 +379,7 @@ EvtScript N(handleEvent_8021B8BC) = {
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(47)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_759)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_SET_CONST(LVar0, 0x00000001)
EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07)
EVT_EXEC_WAIT(DoShockHit)
@ -388,7 +388,7 @@ EvtScript N(handleEvent_8021B8BC) = {
EVT_EXEC_WAIT(DoJumpBack)
EVT_EXEC_WAIT(N(8021B2FC))
EVT_CASE_EQ(38)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_759)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_SET_CONST(LVar0, 0x00000001)
EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07)
EVT_EXEC_WAIT(DoShockHit)

View File

@ -439,7 +439,7 @@ EvtScript N(acrobaticAttack) = {
EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_749)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Red_Anim09)
EVT_WAIT(10)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_ShyGuy_Red_Anim07)

View File

@ -20,7 +20,7 @@ ApiStatus N(func_802A1280_72A9D0)(Evt* script, s32 isInitialCall) {
Actor* enemy = get_actor(script->owner1.enemyID);
Actor* target;
sfx_play_sound_at_position(SOUND_231, 0, enemy->state.goalPos.x, enemy->state.goalPos.y, enemy->state.goalPos.z);
sfx_play_sound_at_position(SOUND_231, SOUND_SPACE_MODE_0, enemy->state.goalPos.x, enemy->state.goalPos.y, enemy->state.goalPos.z);
target = get_actor(enemy->targetActorID);
dispatch_event_actor(target, EVENT_SCARE_AWAY);

View File

@ -465,7 +465,7 @@ ApiStatus N(SpinyFlipActionCommand)(Evt* script, s32 isInitialCall) {
} else {
sAimingTimer = 80;
hud_element_set_script(hudStick, &HES_StickTapRight);
sfx_play_sound_at_position(SOUND_312, 0, 0.0f, 0.0f, 0.0f);
sfx_play_sound_at_position(SOUND_312, SOUND_SPACE_MODE_0, 0.0f, 0.0f, 0.0f);
script->functionTemp[0] = 2;
}
break;
@ -1466,7 +1466,7 @@ ApiStatus N(ProcessHurricane)(Evt* script, s32 isInitialCall) {
sHuffPuffBreathEffect->data.huffPuffBreath->pos.z = 0.0f;
if (script->functionTemp[2] != 0) {
sfx_play_sound_at_position(SOUND_201E, 0, partner->currentPos.x, partner->currentPos.y, partner->currentPos.z);
sfx_play_sound_at_position(SOUND_201E, SOUND_SPACE_MODE_0, partner->currentPos.x, partner->currentPos.y, partner->currentPos.z);
}
script->functionTemp[2] = 0;
@ -1489,7 +1489,7 @@ ApiStatus N(ProcessHurricane)(Evt* script, s32 isInitialCall) {
sHuffPuffBreathEffect->data.huffPuffBreath->speedX = 2.0f;
if (script->functionTemp[2] == 0) {
sfx_play_sound_at_position(SOUND_201F, 0, partner->currentPos.x, partner->currentPos.y, partner->currentPos.z);
sfx_play_sound_at_position(SOUND_201F, SOUND_SPACE_MODE_0, partner->currentPos.x, partner->currentPos.y, partner->currentPos.z);
}
script->functionTemp[2] = 1;

View File

@ -436,7 +436,7 @@ ApiStatus N(CarryAway)(Evt* evt, s32 isInitialCall) {
parakarry->state.moveTime = clamp_angle(parakarry->state.moveTime);
if (gGameStatusPtr->frameCounter % 10 == 0) {
sfx_play_sound_at_position(SOUND_2009, 0, parakarry->state.currentPos.x, parakarry->state.currentPos.y, parakarry->state.currentPos.z);
sfx_play_sound_at_position(SOUND_2009, SOUND_SPACE_MODE_0, parakarry->state.currentPos.x, parakarry->state.currentPos.y, parakarry->state.currentPos.z);
}
if (parakarry->state.currentPos.x > 240.0f) {
@ -499,9 +499,9 @@ ApiStatus N(FlyAround)(Evt* script, s32 isInitialCall) {
}
if (script->functionTemp[3] != 0) {
sfx_play_sound_at_position(SOUND_200A, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
} else {
sfx_play_sound_at_position(SOUND_200B, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
}
script->functionTemp[3] = 1 - script->functionTemp[3];
}
@ -521,9 +521,9 @@ ApiStatus N(FlyAround)(Evt* script, s32 isInitialCall) {
} while (0);
if (script->functionTemp[3] != 0) {
sfx_play_sound_at_position(SOUND_200A, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
} else {
sfx_play_sound_at_position(SOUND_200B, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
}
script->functionTemp[3] = 1 - script->functionTemp[3];
}
@ -543,9 +543,9 @@ ApiStatus N(FlyAround)(Evt* script, s32 isInitialCall) {
} while (0); // TODO macro?
if (script->functionTemp[3] != 0) {
sfx_play_sound_at_position(SOUND_200A, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
} else {
sfx_play_sound_at_position(SOUND_200B, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
}
script->functionTemp[3] = 1 - script->functionTemp[3];
}
@ -565,9 +565,9 @@ ApiStatus N(FlyAround)(Evt* script, s32 isInitialCall) {
} while (0); // TODO macro?
if (script->functionTemp[3] != 0) {
sfx_play_sound_at_position(SOUND_200A, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
} else {
sfx_play_sound_at_position(SOUND_200B, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
}
script->functionTemp[3] = 1 - script->functionTemp[3];
}

View File

@ -255,9 +255,9 @@ ApiStatus N(ProcessTidalWave)(Evt* script, s32 isInitialCall) {
} while (0);
if (script->functionTemp[2] != 0) {
sfx_play_sound_at_position(SOUND_29B, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_29B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
} else {
sfx_play_sound_at_position(SOUND_29C, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_29C, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
}
script->functionTemp[2] = 1 - script->functionTemp[2];
}
@ -279,9 +279,9 @@ ApiStatus N(ProcessTidalWave)(Evt* script, s32 isInitialCall) {
} while (0); // TODO macro?
if (script->functionTemp[2] != 0) {
sfx_play_sound_at_position(SOUND_29B, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_29B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
} else {
sfx_play_sound_at_position(SOUND_29C, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_29C, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
}
script->functionTemp[2] = 1 - script->functionTemp[2];
}
@ -303,9 +303,9 @@ ApiStatus N(ProcessTidalWave)(Evt* script, s32 isInitialCall) {
} while (0); // TODO macro?
if (script->functionTemp[2] != 0) {
sfx_play_sound_at_position(SOUND_29B, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_29B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
} else {
sfx_play_sound_at_position(SOUND_29C, 0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
sfx_play_sound_at_position(SOUND_29C, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z);
}
script->functionTemp[2] = 1 - script->functionTemp[2];
}
@ -328,7 +328,7 @@ ApiStatus N(ProcessTidalWave)(Evt* script, s32 isInitialCall) {
sEffect->data.waterFountain->unk_3C = partner->scale.x;
sEffect->data.waterFountain->unk_40 = partner->scale.x;
if (state->moveTime == 0x46) {
sfx_play_sound_at_position(SOUND_29D, 0, 0.0f, 0.0f, 0.0f);
sfx_play_sound_at_position(SOUND_29D, SOUND_SPACE_MODE_0, 0.0f, 0.0f, 0.0f);
fx_underwater(0, -50.0f, 20.0f, 0.0f, 1.0f, 120);
}

View File

@ -458,9 +458,9 @@ ApiStatus N(ProcessPeachStarBeam)(Evt* script, s32 isInitialCall) {
}
if (script->functionTemp[2] == 0) {
sfx_play_sound(SOUND_648);
sfx_play_sound(SOUND_248 | SOUND_ID_TRIGGER_CHANGE_SOUND);
} else {
sfx_play_sound(SOUND_649);
sfx_play_sound(SOUND_249 | SOUND_ID_TRIGGER_CHANGE_SOUND);
}
script->functionTemp[0] = PEACH_STAR_BEAM_FLY_TO_TARGET;
} else {
@ -637,11 +637,11 @@ ApiStatus N(ProcessPeachStarBeam)(Evt* script, s32 isInitialCall) {
script->functionTemp[1]--;
if (script->functionTemp[1] == 0) {
if (script->functionTemp[2] == 0) {
func_80149A6C(SOUND_248, TRUE);
sfx_play_sound(SOUND_648);
snd_stop_tracking_env_sound_pos(SOUND_248, TRUE);
sfx_play_sound(SOUND_248 | SOUND_ID_TRIGGER_CHANGE_SOUND);
} else {
func_80149A6C(SOUND_249, TRUE);
sfx_play_sound(SOUND_649);
snd_stop_tracking_env_sound_pos(SOUND_249, TRUE);
sfx_play_sound(SOUND_249 | SOUND_ID_TRIGGER_CHANGE_SOUND);
}
}
}
@ -680,9 +680,9 @@ ApiStatus N(ProcessPeachStarBeam)(Evt* script, s32 isInitialCall) {
}
if (script->functionTemp[2] == 0) {
func_80149A6C(SOUND_248, FALSE);
snd_stop_tracking_env_sound_pos(SOUND_248, FALSE);
} else {
func_80149A6C(SOUND_249, FALSE);
snd_stop_tracking_env_sound_pos(SOUND_249, FALSE);
}
script->functionTemp[0] = PEACH_STAR_BEAM_SPIRITS_SCATTER;
break;

View File

@ -11,13 +11,13 @@ ApiStatus N(UnkSfxFunc)(Evt* script, s32 isInitialCall) {
distY = actor->state.goalPos.y - actor->currentPos.y;
distZ = actor->state.goalPos.z - actor->currentPos.z;
script->functionTemp[0] = ((sqrtf(SQ(distX) + SQ(distY) + SQ(distZ)) / actor->state.speed) * 0.5f) + 1.0f;
sfx_play_sound_at_position(SOUND_359, 0.0f, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(SOUND_359, SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
if (script->functionTemp[0]-- > 0) {
return ApiStatus_BLOCK;
}
sfx_play_sound_at_position(SOUND_759, 0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
sfx_play_sound_at_position(SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND, SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
return ApiStatus_DONE2;
}

View File

@ -18,7 +18,7 @@ EvtScript N(EVS_SearchBush) = {
EVT_CALL(N(TransformFoliage), LVar3, EVT_FLOAT(0.1), 1, LVarF, 0)
EVT_IF_EQ(LocalFlag(0), 0)
EVT_SET(LocalFlag(0), 1)
EVT_CALL(PlaySoundAtModel, LVar3, SOUND_SEARCH_BUSH, 0)
EVT_CALL(PlaySoundAtModel, LVar3, SOUND_SEARCH_BUSH, SOUND_SPACE_MODE_0)
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(1)
@ -87,7 +87,7 @@ EvtScript N(EVS_ShakeTree) = {
EVT_CALL(N(TransformFoliage), LVar3, EVT_FLOAT(0.1), EVT_FLOAT(0.2), LVarF, 0)
EVT_IF_EQ(LocalFlag(0), 0)
EVT_SET(LocalFlag(0), 1)
EVT_CALL(PlaySoundAtModel, LVar3, SOUND_SHAKE_TREE, 0)
EVT_CALL(PlaySoundAtModel, LVar3, SOUND_SHAKE_TREE, SOUND_SPACE_MODE_0)
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(1)
@ -119,7 +119,7 @@ EvtScript N(EVS_ShakeTree) = {
EVT_CALL(N(TransformFoliage), LVar4, EVT_FLOAT(0.1), EVT_FLOAT(0.2), LVarF, 0)
EVT_IF_EQ(LocalFlag(0), 0)
EVT_SET(LocalFlag(0), 1)
EVT_CALL(PlaySoundAtModel, LVar4, SOUND_SMASH_GOOMNUT_TREE, 0)
EVT_CALL(PlaySoundAtModel, LVar4, SOUND_SMASH_GOOMNUT_TREE, SOUND_SPACE_MODE_0)
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(1)

View File

@ -151,7 +151,7 @@ void disable_x_update(EffectInstance* effect) {
data[1].unk_28 = 0;
data->unk_38++;
if (data->pos.y > -500.0f) {
shim_sfx_play_sound_at_position(SOUND_2107, 0, data->pos.x, data->pos.y, data->pos.z);
shim_sfx_play_sound_at_position(SOUND_2107, SOUND_SPACE_MODE_0, data->pos.x, data->pos.y, data->pos.z);
}
} else if (unk_3C < unk_38) {
shim_load_effect(EFFECT_DISABLE_X);

View File

@ -150,7 +150,7 @@ void star_update(EffectInstance* effect) {
landing_dust_main(0, data->unk_04, data->unk_08 - 5.0f, data->unk_0C, 0.0f);
if (!gGameStatusPtr->isBattle) {
shim_sfx_play_sound_at_position(SOUND_B0000016, 0, data->unk_04, data->unk_08, data->unk_0C);
shim_sfx_play_sound_at_position(SOUND_B0000016, SOUND_SPACE_MODE_0, data->unk_04, data->unk_08, data->unk_0C);
}
data->unk_00 = 0;

View File

@ -756,7 +756,7 @@ void update_encounters_neutral(void) {
cond = TRUE;
}
if (cond) {
sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, 0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z);
currentEncounter->hitType = ENCOUNTER_TRIGGER_HAMMER;
currentEncounter->hitTier = gPlayerData.hammerLevel;
enemy->encountered = ENCOUNTER_TRIGGER_HAMMER;
@ -842,7 +842,7 @@ void update_encounters_neutral(void) {
currentEncounter->hitTier = 2;
break;
}
sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, 0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z);
enemy->encountered = ENCOUNTER_STATE_NEUTRAL;
currentEncounter->currentEncounter = encounter;
currentEncounter->currentEnemy = enemy;
@ -890,7 +890,7 @@ void update_encounters_neutral(void) {
cond = TRUE;
}
if ((playerStatus->animFlags & PA_FLAG_SPINNING) && !(enemy->flags & ENEMY_FLAG_20000000) && cond) {
sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, 0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z);
testX = playerStatus->position.x + ((npc->pos.x - playerStatus->position.x) * 0.5f);
testY = playerStatus->position.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->position.y + playerStatus->colliderHeight)) * 0.5f);
testZ = playerStatus->position.z + ((npc->pos.z - playerStatus->position.z) * 0.5f);
@ -981,7 +981,7 @@ START_BATTLE:
if (!is_ability_active(ABILITY_CHILL_OUT) && currentEncounter->firstStrikeType == FIRST_STRIKE_ENEMY) {
set_action_state(ACTION_STATE_ENEMY_FIRST_STRIKE);
npc = get_npc_unsafe(enemy->npcID);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, 0, npc->pos.x, npc->pos.y, npc->pos.z);
sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, npc->pos.x, npc->pos.y, npc->pos.z);
}
currentEncounter->scriptedBattle = FALSE;
gEncounterState = ENCOUNTER_STATE_PRE_BATTLE;

View File

@ -386,7 +386,7 @@ s32 entity_block_handle_collision(Entity* entity) {
return TRUE;
}
set_entity_commandlist(entity, Entity_BreakingBlock_Script);
sfx_play_sound_at_position(SOUND_14F, 0, entity->position.x, entity->position.y, entity->position.z);
sfx_play_sound_at_position(SOUND_14F, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
break;
case ENTITY_TYPE_HAMMER2_BLOCK:
case ENTITY_TYPE_HAMMER2_BLOCK_TINY:
@ -401,7 +401,7 @@ s32 entity_block_handle_collision(Entity* entity) {
return TRUE;
}
set_entity_commandlist(entity, Entity_BreakingBlock_Script);
sfx_play_sound_at_position(SOUND_150, 0, entity->position.x, entity->position.y, entity->position.z);
sfx_play_sound_at_position(SOUND_150, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
break;
case ENTITY_TYPE_HAMMER3_BLOCK:
case ENTITY_TYPE_HAMMER3_BLOCK_TINY:
@ -409,7 +409,7 @@ s32 entity_block_handle_collision(Entity* entity) {
return TRUE;
}
set_entity_commandlist(entity, Entity_BreakingBlock_Script);
sfx_play_sound_at_position(SOUND_151, 0, entity->position.x, entity->position.y, entity->position.z);
sfx_play_sound_at_position(SOUND_151, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
break;
case ENTITY_TYPE_MULTI_TRIGGER_BLOCK:
case ENTITY_TYPE_HEALING_BLOCK:

View File

@ -144,7 +144,7 @@ void entity_shattering_block_init(Entity* entity) {
fragmentMatrices = Entity_ShatteringHammer3Block_FragmentsMatrices;
break;
case ENTITY_TYPE_BRICK_BLOCK:
sfx_play_sound_at_position(SOUND_158, 0, entity->position.x, entity->position.y, entity->position.z);
sfx_play_sound_at_position(SOUND_158, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
fragmentDisplayLists = Entity_ShatteringBrickBlock_FragmentsRender;
fragmentMatrices = Entity_ShatteringBrickBlock_FragmentsMatrices;
break;

View File

@ -22,7 +22,7 @@ void entity_ScriptSpring_idle(Entity* entity) {
set_action_state(ACTION_STATE_USE_SPRING);
}
exec_entity_commandlist(entity);
sfx_play_sound_at_position(SOUND_2086, 0, entity->position.x, entity->position.y, entity->position.z);
sfx_play_sound_at_position(SOUND_2086, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
}
}
@ -37,7 +37,7 @@ void entity_SimpleSpring_idle(Entity* entity) {
play_model_animation(entity->virtualModelIndex, Entity_SimpleSpring_AnimLaunch);
entity_start_script(entity);
exec_entity_commandlist(entity);
sfx_play_sound_at_position(SOUND_2086, 0, entity->position.x, entity->position.y, entity->position.z);
sfx_play_sound_at_position(SOUND_2086, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
disable_player_input();
playerStatus->currentSpeed = 0;
}

View File

@ -138,12 +138,12 @@ void entity_SpinningFlower_init(Entity* entity) {
}
void func_802BB314_E2DC44(Entity* entity) {
sfx_play_sound_at_position(SOUND_8000006A, 0, entity->position.x, entity->position.y, entity->position.z);
sfx_play_sound_at_position(SOUND_8000006A, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
}
void func_802BB34C_E2DC7C(void) {
sfx_play_sound(SOUND_791);
func_80149A6C(0x391, 1);
sfx_play_sound(SOUND_391 | SOUND_ID_TRIGGER_CHANGE_SOUND);
snd_stop_tracking_env_sound_pos(SOUND_391, TRUE);
}
void entity_PinkFlowerLight_setupGfx(s32 entityIndex) {

View File

@ -237,7 +237,7 @@ ApiStatus func_802D62E4(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 soundID = evt_get_variable(script, *args++);
func_80149A6C(soundID, TRUE);
snd_stop_tracking_env_sound_pos(soundID, TRUE);
return ApiStatus_DONE2;
}

View File

@ -16,7 +16,7 @@ ApiStatus ShowStartRecoveryShimmer(Evt* script, s32 isInitialCall) {
f32 z = evt_get_float_variable(script, *args++);
show_start_recovery_shimmer(x, y, z, evt_get_variable(script, *args++));
sfx_play_sound_at_position(SOUND_2055, 0, x, y, z);
sfx_play_sound_at_position(SOUND_2055, SOUND_SPACE_MODE_0, x, y, z);
return ApiStatus_DONE2;
}
@ -27,7 +27,7 @@ ApiStatus ShowRecoveryShimmer(Evt* script, s32 isInitialCall) {
f32 z = evt_get_float_variable(script, *args++);
show_recovery_shimmer(x, y, z, evt_get_variable(script, *args++));
sfx_play_sound_at_position(SOUND_378, 0, x, y, z);
sfx_play_sound_at_position(SOUND_378, SOUND_SPACE_MODE_0, x, y, z);
return ApiStatus_DONE2;
}

View File

@ -266,7 +266,7 @@ s32 player_jump(Evt* script, s32 isInitialCall, s32 mode) {
anim = ANIM_Mario_90005;
}
suggest_player_anim_clearUnkFlag(anim);
sfx_play_sound_at_player(SOUND_JUMP_2081, 0);
sfx_play_sound_at_player(SOUND_JUMP_2081, SOUND_SPACE_MODE_0);
}
script->functionTemp[0] = 1;
}

View File

@ -136,7 +136,7 @@ void func_802B735C_E2290C(void) {
case 2:
D_802B7C78_E23228->scale = 0.57f;
D_802B7C78_E23228->unk_24++;
sfx_play_sound_at_player(SOUND_17B, 0);
sfx_play_sound_at_player(SOUND_17B, SOUND_SPACE_MODE_0);
break;
case 3:
D_802B7C78_E23228->scale = 0.53f;

View File

@ -111,7 +111,7 @@ void step_game_loop(void) {
func_80138198();
bgm_update_music_settings();
update_ambient_sounds();
sfx_update_looping_sound_params();
sfx_update_env_sound_params();
update_windows();
update_curtains();

View File

@ -126,7 +126,7 @@ void func_802B71D4(void) {
D_802B7D18_E22588->unk_20++;
if (D_802B7D18_E22588->unk_20 >= var_v1 + 2) {
D_802B7D18_E22588->unk_20 = 0;
sfx_play_sound_at_player(SOUND_7D, 0);
sfx_play_sound_at_player(SOUND_7D, SOUND_SPACE_MODE_0);
}
if (D_802B7D18_E22588->unk_20 < 2) {
part.palette = D_802B7C80_E224F0;

View File

@ -48,7 +48,7 @@ void state_init_demo(void) {
gGameStatusPtr->demoStickX = 0;
gGameStatusPtr->demoStickY = 0;
func_80056228();
disable_sounds();
set_map_transition_effect(2);
set_screen_overlay_params_front(0, 255.0f);
clear_saved_variables();
@ -87,7 +87,7 @@ void state_step_demo(void) {
gGameStatusPtr->nextDemoScene = 0;
gGameStatusPtr->demoState = 0;
gGameStatusPtr->peachFlags = 0;
func_80056204();
enable_sounds();
gGameStatusPtr->isBattle = FALSE;
gGameStatusPtr->unk_76 = 0;
gGameStatusPtr->disableScripts = FALSE;

View File

@ -109,7 +109,7 @@ void action_hammer_play_hit_fx(s32 hitID) {
break;
}
sfx_play_sound_at_player(soundID, 0);
sfx_play_sound_at_player(soundID, SOUND_SPACE_MODE_0);
start_rumble(256, 50);
}
@ -265,7 +265,7 @@ void action_update_hammer(void) {
}
suggest_player_anim_clearUnkFlag(anim);
sfx_play_sound_at_player(soundID, 0);
sfx_play_sound_at_player(soundID, SOUND_SPACE_MODE_0);
HammerHit->unk_0C = 0;
HammerHit->unk_14 = 0;
}
@ -378,7 +378,7 @@ void func_802B6820_E256F0(void) {
} else {
soundID = SOUND_2115;
}
sfx_play_sound_at_player(soundID, 0);
sfx_play_sound_at_player(soundID, SOUND_SPACE_MODE_0);
action_hammer_play_hit_fx(HammerHit->hitID);

View File

@ -48,7 +48,7 @@ void action_update_hit_lava(void) {
subtract_hp(1);
open_status_menu_long();
gOverrideFlags |= GLOBAL_OVERRIDES_40;
sfx_play_sound_at_player(SOUND_E8, 0);
sfx_play_sound_at_player(SOUND_E8, SOUND_SPACE_MODE_0);
}
switch (playerStatus->actionSubstate) {
@ -173,7 +173,7 @@ void action_update_hit_lava(void) {
start_rumble(256, 50);
phys_adjust_cam_on_landing();
gCameras[CAM_DEFAULT].moveFlags &= ~CAMERA_MOVE_FLAG_2;
sfx_play_sound_at_player(SOUND_3FB, 0);
sfx_play_sound_at_player(SOUND_3FB, SOUND_SPACE_MODE_0);
suggest_player_anim_setUnkFlag(ANIM_Mario_8001A);
playerStatus->flags &= ~PS_FLAG_HIT_FIRE;
playerStatus->flags &= ~PS_FLAG_FLYING;

View File

@ -53,10 +53,10 @@ void action_update_jump(void) {
if (playerStatus->actionState == ACTION_STATE_JUMP) {
if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) {
sfx_play_sound_at_player(SOUND_JUMP_8BIT_MARIO, 0);
sfx_play_sound_at_player(SOUND_JUMP_8BIT_MARIO, SOUND_SPACE_MODE_0);
}
else {
sfx_play_sound_at_player(SOUND_JUMP_2081, 0);
sfx_play_sound_at_player(SOUND_JUMP_2081, SOUND_SPACE_MODE_0);
}
}
}

View File

@ -44,8 +44,8 @@ void action_update_land(void) {
}
suggest_player_anim_clearUnkFlag(anim);
sfx_play_sound_at_player(SOUND_8161, 0);
sfx_play_sound_at_player(SOUND_SOFT_LAND, 0);
sfx_play_sound_at_player(SOUND_161 | SOUND_ID_STOP, SOUND_SPACE_MODE_0);
sfx_play_sound_at_player(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0);
if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
phys_adjust_cam_on_landing();
@ -132,7 +132,7 @@ void action_update_peach_land(void) {
playerStatus->landPos.x = playerStatus->position.x;
playerStatus->landPos.z = playerStatus->position.z;
sfx_play_sound_at_player(SOUND_SOFT_LAND, 0);
sfx_play_sound_at_player(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0);
if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
phys_adjust_cam_on_landing();

View File

@ -56,7 +56,7 @@ void action_update_sliding(void) {
D_802B6798 = 0.0f;
D_802B679C = 0;
suggest_player_anim_clearUnkFlag(ANIM_Mario_1000A);
sfx_play_sound_at_player(SOUND_167, 0);
sfx_play_sound_at_player(SOUND_167, SOUND_SPACE_MODE_0);
gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y;
}
speed = playerStatus->currentSpeed;
@ -119,7 +119,7 @@ void action_update_sliding(void) {
}
playerStatus->currentSpeed -= speed;
if (playerStatus->currentSpeed <= 0.0f) {
sfx_play_sound_at_player(SOUND_DUST_OFF, 0);
sfx_play_sound_at_player(SOUND_DUST_OFF, SOUND_SPACE_MODE_0);
suggest_player_anim_setUnkFlag(ANIM_Mario_DustOff);
playerStatus->actionSubstate = SUBSTATE_DUST_OFF;
playerStatus->currentStateTime = 15;
@ -149,7 +149,7 @@ void action_update_sliding(void) {
if (hitID >= 0) {
SlideLaunchSpeed = -1;
suggest_player_anim_setUnkFlag(ANIM_Mario_80003);
sfx_play_sound_at_player(SOUND_162, 0);
sfx_play_sound_at_player(SOUND_162, SOUND_SPACE_MODE_0);
playerStatus->actionSubstate++; // SUBSTATE_CRASH
}
break;
@ -170,7 +170,7 @@ void action_update_sliding(void) {
}
if (playerStatus->animNotifyValue != 0) {
suggest_player_anim_setUnkFlag(ANIM_Mario_DustOff);
sfx_play_sound_at_player(SOUND_DUST_OFF, 0);
sfx_play_sound_at_player(SOUND_DUST_OFF, SOUND_SPACE_MODE_0);
playerStatus->currentStateTime = 15;
playerStatus->actionSubstate++; // SUBSTATE_DUST_OFF
}

View File

@ -111,7 +111,7 @@ void action_update_parasol(void) {
disguiseNpc = get_npc_by_index(PeachDisguiseNpcIndex);
disguiseNpc->flags |= NPC_FLAG_40000;
playerStatus->flags |= PS_FLAG_ROTATION_LOCKED;
sfx_play_sound_at_player(SOUND_FD, 0);
sfx_play_sound_at_player(SOUND_FD, SOUND_SPACE_MODE_0);
}
}
@ -120,7 +120,7 @@ void action_update_parasol(void) {
if (playerStatus->flipYaw[CAM_DEFAULT] == 0) {
if (peach_disguise_check_overlaps() < 0) {
suggest_player_anim_clearUnkFlag(ANIM_Peach_C0024);
sfx_play_sound_at_player(SOUND_92, 0);
sfx_play_sound_at_player(SOUND_92, SOUND_SPACE_MODE_0);
playerStatus->actionSubstate++; // SUBSTATE_USE_PARASOL
} else {
suggest_player_anim_clearUnkFlag(ANIM_Peach_C0027);
@ -145,7 +145,7 @@ void action_update_parasol(void) {
playerStatus->currentStateTime = 12;
playerStatus->flags |= PS_FLAG_ROTATION_LOCKED;
playerStatus->actionSubstate++; // SUBSTATE_DISGUISE_BEGIN
sfx_play_sound_at_player(SOUND_FD, 0);
sfx_play_sound_at_player(SOUND_FD, SOUND_SPACE_MODE_0);
}
break;
case SUBSTATE_DISGUISE_BEGIN:
@ -384,7 +384,7 @@ void action_update_parasol(void) {
if (transformation->revertTime != 0) {
if (transformation->revertTime <= 10) {
if (transformation->revertTime == 10) {
sfx_play_sound_at_player(SOUND_FE, 0);
sfx_play_sound_at_player(SOUND_FE, SOUND_SPACE_MODE_0);
}
if ((transformation->revertTime & 3) == 0) {
fx_stars_shimmer(4,

View File

@ -107,7 +107,7 @@ void action_update_spin(void) {
playerSpinState->spinSoundID = SOUND_2114;
}
sfx_play_sound_at_player(playerSpinState->spinSoundID, 0);
sfx_play_sound_at_player(playerSpinState->spinSoundID, SOUND_SPACE_MODE_0);
suggest_player_anim_setUnkFlag(anim);
if ((clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].currentYaw) <= 180.0f)) {

View File

@ -39,7 +39,7 @@ void action_update_spin_jump(void) {
disable_player_input();
playerStatus->flags |= PS_FLAG_SPECIAL_JUMP;
gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y;
sfx_play_sound_at_player(SOUND_SPIN_JUMP, 0);
sfx_play_sound_at_player(SOUND_SPIN_JUMP, SOUND_SPACE_MODE_0);
}
landed = FALSE;
@ -135,7 +135,7 @@ void action_update_spin_jump(void) {
playerStatus->pitch = 0.0f;
playerStatus->actionSubstate++;
exec_ShakeCam1(0, 0, 4);
sfx_play_sound_at_player(SOUND_149, 0);
sfx_play_sound_at_player(SOUND_149, SOUND_SPACE_MODE_0);
start_rumble(128, 25);
panels = &gCurrentHiddenPanels;
panels->tryFlipTrigger = TRUE;

View File

@ -91,7 +91,7 @@ void action_update_tornado_jump(void) {
playerStatus->currentStateTime = 3;
playerStatus->flags |= PS_FLAG_FALLING;
playerStatus->actionSubstate++;
sfx_play_sound_at_player(SOUND_TORNADO_JUMP, 0);
sfx_play_sound_at_player(SOUND_TORNADO_JUMP, SOUND_SPACE_MODE_0);
}
if (colliderBelow >= 0) {
playerStatus->flags &= ~(PS_FLAG_SPINNING | PS_FLAG_FLYING);
@ -123,7 +123,7 @@ void action_update_tornado_jump(void) {
playerStatus->flags &= ~(PS_FLAG_SPINNING | PS_FLAG_FLYING);
phys_player_land();
exec_ShakeCam1(0, 0, 4);
sfx_play_sound_at_player(SOUND_14A, 0);
sfx_play_sound_at_player(SOUND_14A, SOUND_SPACE_MODE_0);
start_rumble(256, 50);
gCurrentHiddenPanels.tryFlipTrigger = TRUE;
@ -150,7 +150,7 @@ void action_update_tornado_jump(void) {
playerStatus->actionState = ACTION_STATE_TORNADO_POUND;
playerStatus->actionSubstate++;
exec_ShakeCam1(0, 0, 4);
sfx_play_sound_at_player(SOUND_14A, 0);
sfx_play_sound_at_player(SOUND_14A, SOUND_SPACE_MODE_0);
start_rumble(256, 50);
gCurrentHiddenPanels.tryFlipTrigger = TRUE;

View File

@ -58,7 +58,7 @@ void action_update_use_munchlesia(void) {
gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
hitPosY = player_check_collision_below(Munchlesia_LaunchVelocity, &colliderID);
if (colliderID >= 0) {
sfx_play_sound_at_player(SOUND_162, 0);
sfx_play_sound_at_player(SOUND_162, SOUND_SPACE_MODE_0);
suggest_player_anim_setUnkFlag(ANIM_Mario_80003);
playerStatus->position.y = hitPosY;
D_802B62E0 = 10;

View File

@ -30,7 +30,7 @@ void action_update_use_tweester(void) {
PlayerTweesterPhysics->angularVelocity = 6.0f;
PlayerTweesterPhysics->liftoffVelocityPhase = 50.0f;
PlayerTweesterPhysics->countdown = 120;
sfx_play_sound_at_player(SOUND_TWEESTER_LAUNCH, 0);
sfx_play_sound_at_player(SOUND_TWEESTER_LAUNCH, SOUND_SPACE_MODE_0);
}
switch (playerStatus->actionSubstate) {

View File

@ -316,7 +316,7 @@ StaticNpc N(NpcData_Boo_01)[] = {
EvtScript N(EVS_TubbaWalking) = {
EVT_LOOP(LVar0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, SOUND_SPACE_MODE_0)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 10, EVT_FLOAT(0.5))
EVT_WAIT(5)
EVT_END_LOOP
@ -327,7 +327,7 @@ EvtScript N(EVS_TubbaWalking) = {
EvtScript N(EVS_Scene_TubbaRaid) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(NpcFacePlayer, NPC_Boo_03, 1)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_03, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_03, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(ShowEmote, NPC_Boo_03, EMOTE_EXCLAMATION, -45, 20, TRUE, 0, 0, 0, 0)
EVT_WAIT(20)
EVT_CALL(GetNpcPos, NPC_Boo_03, LVar0, LVar1, LVar2)
@ -350,12 +350,12 @@ EvtScript N(EVS_Scene_TubbaRaid) = {
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SpeakToPlayer, NPC_Boo_03, ANIM_Boo_Tan_Talk, ANIM_Boo_Tan_Idle, 0, MSG_CH3_00A0)
EVT_CALL(PlaySoundAt, SOUND_20F6, 0, 450, 200, 160)
EVT_CALL(PlaySoundAt, SOUND_20F6, SOUND_SPACE_MODE_0, 450, 200, 160)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 20, EVT_FLOAT(0.8))
EVT_CALL(PlaySoundAtNpc, NPC_Boo_01, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_02, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_03, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_05, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_01, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_02, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_03, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_05, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(ShowEmote, NPC_Boo_01, EMOTE_EXCLAMATION, -45, 20, TRUE, 0, 0, 0, 0)
EVT_CALL(ShowEmote, NPC_Boo_02, EMOTE_EXCLAMATION, -45, 20, TRUE, 0, 0, 0, 0)
EVT_CALL(ShowEmote, NPC_Boo_03, EMOTE_EXCLAMATION, -45, 20, TRUE, 0, 0, 0, 0)
@ -435,8 +435,8 @@ EvtScript N(EVS_Scene_TubbaRaid) = {
EVT_CALL(NpcFaceNpc, NPC_Boo_01, NPC_Tubba, 1)
EVT_CALL(NpcFaceNpc, NPC_Boo_02, NPC_Tubba, 1)
EVT_CALL(SetNpcPos, NPC_Boo_03, 272, 190, 214)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_01, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_02, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_01, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_02, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(ShowEmote, NPC_Boo_01, EMOTE_EXCLAMATION, 45, 20, TRUE, 0, 0, 0, 0)
EVT_CALL(ShowEmote, NPC_Boo_02, EMOTE_EXCLAMATION, 45, 20, TRUE, 0, 0, 0, 0)
EVT_THREAD
@ -518,7 +518,7 @@ EvtScript N(EVS_Scene_TubbaRaid) = {
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_THREAD
EVT_WAIT(50)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_315, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_315, SOUND_SPACE_MODE_0)
EVT_END_THREAD
EVT_WAIT(40)
EVT_CALL(SetNpcPos, NPC_Boo_03, NPC_DISPOSE_LOCATION)

View File

@ -26,7 +26,7 @@ EvtScript N(EVS_SpawnStarCard) = {
EVT_CALL(PlaySound, SOUND_80000067)
EVT_CALL(N(StarSpiritEffectFunc1))
EVT_CALL(StopSound, SOUND_80000067)
EVT_CALL(PlaySoundAt, SOUND_B2, 0, 145, 65, 0)
EVT_CALL(PlaySoundAt, SOUND_B2, SOUND_SPACE_MODE_0, 145, 65, 0)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT(12)
@ -35,7 +35,7 @@ EvtScript N(EVS_SpawnStarCard) = {
EVT_THREAD
EVT_WAIT(50)
EVT_WAIT(115)
EVT_CALL(PlaySoundAt, SOUND_137, 0, 145, 65, 0)
EVT_CALL(PlaySoundAt, SOUND_137, SOUND_SPACE_MODE_0, 145, 65, 0)
EVT_END_THREAD
EVT_CALL(N(StarSpiritEffectFunc4), 1)
EVT_THREAD
@ -61,7 +61,7 @@ EvtScript N(EVS_SpawnStarCard) = {
EVT_WAIT(1)
EVT_END_IF
EVT_CALL(N(StarSpiritEffectFunc4), 3)
EVT_CALL(PlaySoundAtPlayer, SOUND_138, 0)
EVT_CALL(PlaySoundAtPlayer, SOUND_138, SOUND_SPACE_MODE_0)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(GB_StoryProgress, STORY_CH3_STAR_SPIRIT_RESCUED)
EVT_CALL(GotoMapSpecial, EVT_PTR("kmr_23"), kmr_23_ENTRY_2, TRANSITION_14)
@ -88,7 +88,7 @@ EvtScript N(EVS_RespawnStarCard) = {
EVT_CALL(PlaySound, SOUND_80000067)
EVT_CALL(N(StarSpiritEffectFunc1))
EVT_CALL(StopSound, SOUND_80000067)
EVT_CALL(PlaySoundAt, SOUND_B2, 0, 145, 65, 0)
EVT_CALL(PlaySoundAt, SOUND_B2, SOUND_SPACE_MODE_0, 145, 65, 0)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT(12)
@ -97,7 +97,7 @@ EvtScript N(EVS_RespawnStarCard) = {
EVT_THREAD
EVT_WAIT(50)
EVT_WAIT(115)
EVT_CALL(PlaySoundAt, SOUND_137, 0, 145, 65, 0)
EVT_CALL(PlaySoundAt, SOUND_137, SOUND_SPACE_MODE_0, 145, 65, 0)
EVT_END_THREAD
EVT_CALL(N(StarSpiritEffectFunc4), 1)
EVT_THREAD
@ -123,7 +123,7 @@ EvtScript N(EVS_RespawnStarCard) = {
EVT_WAIT(1)
EVT_END_IF
EVT_CALL(N(StarSpiritEffectFunc4), 3)
EVT_CALL(PlaySoundAtPlayer, SOUND_138, 0)
EVT_CALL(PlaySoundAtPlayer, SOUND_138, SOUND_SPACE_MODE_0)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(GB_StoryProgress, STORY_CH3_STAR_SPIRIT_RESCUED)
EVT_CALL(GotoMapSpecial, EVT_PTR("kmr_23"), kmr_23_ENTRY_2, TRANSITION_14)
@ -152,20 +152,20 @@ EvtScript N(EVS_Scene_TubbaReunion) = {
EVT_CALL(SetPanTarget, CAM_DEFAULT, 5, 0, -147)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(RotateModel, MODEL_o39, 80, 0, -1, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(SetNpcJumpscale, NPC_TubbasHeart, EVT_FLOAT(2.5))
EVT_CALL(NpcJump0, NPC_TubbasHeart, 0, 20, -120, 8)
EVT_WAIT(1)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, 0, 10, -60, 12)
EVT_WAIT(1)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, 0, 0, 0, 12)
EVT_WAIT(1)
EVT_CALL(SetNpcVar, NPC_TubbasHeart, 0, 0)
EVT_THREAD
EVT_LOOP(0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, 0, 0, 0, 10)
EVT_WAIT(1)
EVT_CALL(GetNpcVar, NPC_TubbasHeart, 0, LVar0)
@ -185,7 +185,7 @@ EvtScript N(EVS_Scene_TubbaReunion) = {
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, COLLIDER_tt3, SOUND_BASIC_DOOR_CLOSE, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_tt3, SOUND_BASIC_DOOR_CLOSE, SOUND_SPACE_MODE_0)
EVT_END_THREAD
EVT_CALL(NpcFaceNpc, NPC_TubbasHeart, NPC_Tubba, 0)
EVT_CALL(SpeakToPlayer, NPC_TubbasHeart, ANIM_TubbasHeart_Anim0A, ANIM_TubbasHeart_Anim01, 5, MSG_CH3_00C7)
@ -197,10 +197,10 @@ EvtScript N(EVS_Scene_TubbaReunion) = {
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, 75, 0, 10, 12)
EVT_WAIT(1)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, 150, 0, 20, 12)
EVT_WAIT(1)
EVT_THREAD
@ -215,7 +215,7 @@ EvtScript N(EVS_Scene_TubbaReunion) = {
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(SetNpcAnimation, NPC_Tubba, ANIM_WorldTubba_Anim22)
EVT_END_THREAD
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, 298, 56, 31, 18)
EVT_CALL(SetNpcPos, NPC_TubbasHeart, NPC_DISPOSE_LOCATION)
EVT_CALL(EnableNpcShadow, NPC_TubbasHeart, FALSE)
@ -226,7 +226,7 @@ EvtScript N(EVS_Scene_TubbaReunion) = {
EVT_END_THREAD
EVT_WAIT(20)
EVT_THREAD
EVT_CALL(PlaySoundAtCollider, COLLIDER_tt3, SOUND_BASIC_DOOR_OPEN, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_tt3, SOUND_BASIC_DOOR_OPEN, SOUND_SPACE_MODE_0)
EVT_CALL(MakeLerp, 0, 80, 10, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
@ -262,7 +262,7 @@ EvtScript N(EVS_Scene_TubbaReunion) = {
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, COLLIDER_tt3, SOUND_BASIC_DOOR_CLOSE, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_tt3, SOUND_BASIC_DOOR_CLOSE, SOUND_SPACE_MODE_0)
EVT_END_THREAD
EVT_CALL(PlayerMoveTo, 200, 0, 35)
EVT_WAIT(5)

View File

@ -23,7 +23,7 @@ EvtScript N(EVS_SetupWindmill) = {
EvtScript N(EVS_UpdateWindmill) = {
EVT_SETF(LVar0, EVT_FLOAT(0.0))
EVT_SET(LVar1, 30)
EVT_CALL(PlaySoundAtModel, MODEL_o36, SOUND_8000004A, 0)
EVT_CALL(PlaySoundAtModel, MODEL_o36, SOUND_8000004A, SOUND_SPACE_MODE_0)
EVT_LABEL(0)
EVT_ADDF(LVar0, EVT_FLOAT(1.0))
EVT_CALL(N(WrapWindmillAngle))

View File

@ -26,7 +26,7 @@ EvtScript N(EVS_UnlockDoor) = {
EVT_CALL(CloseChoicePopup)
EVT_SET(GB_StoryProgress, STORY_CH3_UNLOCKED_WINDY_MILL)
EVT_CALL(N(GetEntityPosition), MV_Unk_00, LVar0, LVar1, LVar2)
EVT_CALL(PlaySoundAt, SOUND_269, 0, LVar0, LVar1, LVar2)
EVT_CALL(PlaySoundAt, SOUND_269, SOUND_SPACE_MODE_0, LVar0, LVar1, LVar2)
EVT_SET(LVar0, MV_Unk_00)
EVT_CALL(N(RemovePadlock))
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_NORMAL)

View File

@ -17,7 +17,7 @@ API_CALLABLE(N(UpgradeStarPowerCh3)) {
EvtScript N(EVS_TubbaWalking) = {
EVT_LOOP(0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, SOUND_SPACE_MODE_0)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 3, EVT_FLOAT(0.8))
EVT_END_LOOP
EVT_RETURN
@ -54,22 +54,22 @@ EvtScript N(EVS_Scene_BossDefeated) = {
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldTubba_Anim22)
EVT_WAIT(15)
EVT_LOOP(4)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, SOUND_SPACE_MODE_0)
EVT_CALL(SetNpcVar, NPC_Boo_02, 0, 1)
EVT_WAIT(4)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, SOUND_SPACE_MODE_0)
EVT_CALL(SetNpcVar, NPC_Boo_05, 0, 1)
EVT_WAIT(4)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, SOUND_SPACE_MODE_0)
EVT_CALL(SetNpcVar, NPC_Boo_01, 0, 1)
EVT_WAIT(6)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, SOUND_SPACE_MODE_0)
EVT_CALL(SetNpcVar, NPC_Boo_03, 0, 1)
EVT_WAIT(8)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, SOUND_SPACE_MODE_0)
EVT_CALL(SetNpcVar, NPC_Boo_04, 0, 1)
EVT_WAIT(6)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, SOUND_SPACE_MODE_0)
EVT_CALL(SetNpcVar, NPC_Boo_06, 0, 1)
EVT_WAIT(6)
EVT_END_LOOP
@ -78,7 +78,7 @@ EvtScript N(EVS_Scene_BossDefeated) = {
EVT_WAIT(30)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldTubba_Anim22)
EVT_WAIT(10)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_B0000010, SOUND_SPACE_MODE_0)
EVT_CALL(SetNpcVar, NPC_Boo_02, 0, 1)
EVT_WAIT(15)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldTubba_Anim21)
@ -451,7 +451,7 @@ EvtScript N(EVS_Scene_SkolarRescued) = {
EVT_CALL(SetNpcAnimation, NPC_Skolar, ANIM_WorldSkolar_Leap)
EVT_WAIT(20)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_GotItem)
EVT_CALL(PlaySoundAtPlayer, SOUND_139, 0)
EVT_CALL(PlaySoundAtPlayer, SOUND_139, SOUND_SPACE_MODE_0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_SET(LVar3, LVar1)
EVT_ADD(LVar1, 50)
@ -464,7 +464,7 @@ EvtScript N(EVS_Scene_SkolarRescued) = {
EVT_WAIT(6)
EVT_END_LOOP
EVT_WAIT(20)
EVT_CALL(PlaySoundAtPlayer, SOUND_188, 0)
EVT_CALL(PlaySoundAtPlayer, SOUND_188, SOUND_SPACE_MODE_0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 20)
EVT_PLAY_EFFECT(EFFECT_ENERGY_ORB_WAVE, 4, LVar0, LVar1, LVar2, 1, 30)
@ -530,7 +530,7 @@ EvtScript N(EVS_Scene_SkolarRescued) = {
EVT_END_THREAD
EVT_THREAD
EVT_WAIT(15)
EVT_CALL(PlaySoundAtNpc, NPC_Skolar, SOUND_2045, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Skolar, SOUND_2045, SOUND_SPACE_MODE_0)
EVT_END_THREAD
EVT_WAIT(10)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_1002A)

View File

@ -49,17 +49,17 @@ EvtScript N(EVS_EnterMap) = {
EVT_CALL(RotateModel, MODEL_o37, 80, 0, -1, 0)
EVT_CALL(SetNpcAnimation, NPC_TubbasHeart, ANIM_TubbasHeart_Anim06)
EVT_CALL(SetNpcJumpscale, NPC_TubbasHeart, EVT_FLOAT(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, -50, 0, 50, 10)
EVT_CALL(SetNpcAnimation, NPC_TubbasHeart, ANIM_TubbasHeart_Anim07)
EVT_WAIT(1)
EVT_CALL(SetNpcAnimation, NPC_TubbasHeart, ANIM_TubbasHeart_Anim06)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, -110, 0, 110, 10)
EVT_CALL(SetNpcAnimation, NPC_TubbasHeart, ANIM_TubbasHeart_Anim07)
EVT_WAIT(1)
EVT_CALL(SetNpcAnimation, NPC_TubbasHeart, ANIM_TubbasHeart_Anim06)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, -180, 0, 180, 10)
EVT_CALL(SetNpcAnimation, NPC_TubbasHeart, ANIM_TubbasHeart_Anim07)
EVT_WAIT(1)
@ -73,7 +73,7 @@ EvtScript N(EVS_EnterMap) = {
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, COLLIDER_tts, SOUND_BASIC_DOOR_CLOSE, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_tts, SOUND_BASIC_DOOR_CLOSE, SOUND_SPACE_MODE_0)
EVT_WAIT(20)
EVT_CALL(SetPlayerPos, 0, 0, 0)
EVT_CALL(SetNpcPos, NPC_PARTNER, 0, 0, 0)

View File

@ -21,13 +21,13 @@ EvtScript N(EVS_NpcIdle_TubbasHeart) = {
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim13)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_SELF, 0, 25, -10, 6)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_2086, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_2086, SOUND_SPACE_MODE_0)
EVT_CALL(N(PlaySpringAnimation))
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim13)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_SELF, 0, 200, 0, 15)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_SET(GB_StoryProgress, STORY_CH3_HEART_ESCAPED_WELL)

View File

@ -8,21 +8,21 @@ EvtScript N(EVS_NpcIdle_TubbasHeart) = {
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(3.0))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_SUB(LVar0, 30)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 8)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim14)
EVT_WAIT(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim13)
EVT_SUB(LVar0, 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 12)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim14)
EVT_WAIT(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim13)
EVT_SUB(LVar0, 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 12)
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)

View File

@ -34,10 +34,10 @@ EvtScript N(EVS_Scene_MeetHeart) = {
EVT_THREAD
EVT_CALL(SetNpcJumpscale, NPC_TubbasHeart, EVT_FLOAT(2.5))
EVT_CALL(GetNpcPos, NPC_TubbasHeart, LVar0, LVar1, LVar2)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, LVar0, LVar1, LVar2, 10)
EVT_WAIT(1)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_TubbasHeart, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, LVar0, LVar1, LVar2, 10)
EVT_END_THREAD
EVT_WAIT(40)

View File

@ -28,7 +28,7 @@ EvtScript N(EVS_NpcIdle_TubbasHeart) = {
EvtScript N(EVS_Heart_OpenDoor) = {
EVT_WAIT(15)
EVT_CALL(PlaySoundAtCollider, COLLIDER_ttw, SOUND_BASIC_DOOR_OPEN, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_ttw, SOUND_BASIC_DOOR_OPEN, SOUND_SPACE_MODE_0)
EVT_CALL(MakeLerp, 0, 80, 10, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
@ -52,7 +52,7 @@ EvtScript N(EVS_Heart_CloseDoor) = {
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, COLLIDER_ttw, SOUND_BASIC_DOOR_CLOSE, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_ttw, SOUND_BASIC_DOOR_CLOSE, SOUND_SPACE_MODE_0)
EVT_RETURN
EVT_END
};
@ -85,7 +85,7 @@ EvtScript N(EVS_Scene_HeartEscape) = {
EVT_LOOP(2)
EVT_CALL(GetNpcPos, NPC_TubbasHeart, LVar0, LVar1, LVar2)
EVT_CALL(SetNpcJumpscale, NPC_TubbasHeart, EVT_FLOAT(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, LVar0, LVar1, LVar2, 12)
EVT_WAIT(1)
EVT_END_LOOP
@ -107,7 +107,7 @@ EvtScript N(EVS_Scene_HeartEscape) = {
EVT_IF_EQ(LVar0, SUBLIST_DONE)
EVT_BREAK_LOOP
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, LVar0, LVar1, LVar2, 12)
EVT_WAIT(1)
EVT_END_LOOP
@ -117,7 +117,7 @@ EvtScript N(EVS_Scene_HeartEscape) = {
EVT_IF_EQ(LVar0, SUBLIST_DONE)
EVT_BREAK_LOOP
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_TubbasHeart, LVar0, LVar1, LVar2, 12)
EVT_WAIT(1)
EVT_END_LOOP

View File

@ -8,21 +8,21 @@ EvtScript N(EVS_NpcIdle_TubbasHeart) = {
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(3.0))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_SUB(LVar0, 30)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 8)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim14)
EVT_WAIT(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim13)
EVT_SUB(LVar0, 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 12)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim14)
EVT_WAIT(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim13)
EVT_SUB(LVar0, 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 12)
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)

View File

@ -8,21 +8,21 @@ EvtScript N(EVS_NpcIdle_TubbasHeart) = {
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(3.0))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_SUB(LVar0, 30)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 8)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim14)
EVT_WAIT(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim13)
EVT_SUB(LVar0, 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 12)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim14)
EVT_WAIT(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_TubbasHeart_Anim13)
EVT_SUB(LVar0, 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, SOUND_SPACE_MODE_0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 12)
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)

View File

@ -4,7 +4,7 @@
API_CALLABLE(N(PlaySentinelSounds)) {
Npc* npc = get_npc_unsafe(get_enemy(NPC_Sentinel)->npcID);
sfx_adjust_env_sound_pos(SOUND_32E, 0, npc->pos.x, npc->pos.y, npc->pos.z);
sfx_adjust_env_sound_pos(SOUND_32E, SOUND_SPACE_MODE_0, npc->pos.x, npc->pos.y, npc->pos.z);
return ApiStatus_DONE2;
}
@ -21,7 +21,7 @@ EvtScript N(EVS_SetDoorRots) = {
EVT_SET(LVar3, 0)
EVT_SUB(LVar3, LVar2)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deiliwt, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deiliwt, SOUND_CREAKY_DOOR_OPEN, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deiliwt, SOUND_CREAKY_DOOR_OPEN, SOUND_SPACE_MODE_0)
EVT_CALL(MakeLerp, 0, 80, 30, EASING_LINEAR)
EVT_LABEL(10)
EVT_CALL(UpdateLerp)
@ -48,7 +48,7 @@ EvtScript N(EVS_CloseDoors) = {
EVT_GOTO(10)
EVT_END_IF
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_deiliwt, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deiliwt, SOUND_CREAKY_DOOR_CLOSE, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deiliwt, SOUND_CREAKY_DOOR_CLOSE, SOUND_SPACE_MODE_0)
EVT_RETURN
EVT_END
};
@ -211,7 +211,7 @@ EvtScript N(EVS_TubbaTaunting) = {
EVT_WAIT(LVar0)
EVT_IF_EQ(MV_PreventTaunting, FALSE)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(PlaySoundAt, SOUND_B4, 0, 240, 10, -125)
EVT_CALL(PlaySoundAt, SOUND_B4, SOUND_SPACE_MODE_0, 240, 10, -125)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 20, EVT_FLOAT(2.0))
EVT_CALL(ShowMessageAtScreenPos, MSG_CH3_00EF, 160, 40)
EVT_CALL(DisablePlayerInput, FALSE)
@ -251,10 +251,10 @@ EvtScript N(EVS_Scene_BoosApproachManor) = {
EVT_CALL(SpeakToPlayer, NPC_Boo_01, ANIM_Boo_Tan_Talk, ANIM_Boo_Tan_Idle, 5, MSG_CH3_00DB)
EVT_CALL(SpeakToPlayer, NPC_Boo_05, ANIM_Boo_Tan_Talk, ANIM_Boo_Tan_Idle, 5, MSG_CH3_00DC)
EVT_CALL(SpeakToPlayer, NPC_Boo_01, ANIM_Boo_Tan_Talk, ANIM_Boo_Tan_Idle, 5, MSG_CH3_00DD)
EVT_CALL(PlaySoundAt, SOUND_B4, 0, 240, 10, -125)
EVT_CALL(PlaySoundAt, SOUND_B4, SOUND_SPACE_MODE_0, 240, 10, -125)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 20, EVT_FLOAT(2.0))
EVT_WAIT(10)
EVT_CALL(PlaySoundAt, SOUND_B4, 0, 240, 10, -125)
EVT_CALL(PlaySoundAt, SOUND_B4, SOUND_SPACE_MODE_0, 240, 10, -125)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 20, EVT_FLOAT(2.0))
EVT_CALL(InterpNpcYaw, NPC_Boo_01, 90, 1)
EVT_CALL(ShowMessageAtScreenPos, MSG_CH3_00DE, 160, 40)
@ -270,12 +270,12 @@ EvtScript N(EVS_Scene_BoosApproachManor) = {
EvtScript N(EVS_Scene_EscapeFromTubba) = {
EVT_CALL(SetPlayerSpeed, EVT_FLOAT(8.0))
EVT_CALL(PlayerMoveTo, 184, -44, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_01, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_02, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_03, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_04, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_05, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_06, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_01, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_02, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_03, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_04, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_05, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(PlaySoundAtNpc, NPC_Boo_06, SOUND_262, SOUND_SPACE_MODE_0)
EVT_CALL(ShowEmote, NPC_Boo_01, EMOTE_EXCLAMATION, 45, 20, TRUE, 0, 0, 0, 0)
EVT_CALL(ShowEmote, NPC_Boo_02, EMOTE_EXCLAMATION, 45, 20, TRUE, 0, 0, 0, 0)
EVT_CALL(ShowEmote, NPC_Boo_03, EMOTE_EXCLAMATION, 45, 20, TRUE, 0, 0, 0, 0)
@ -329,10 +329,10 @@ EvtScript N(EVS_Scene_EscapeFromTubba) = {
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
EVT_CALL(PlaySoundAt, SOUND_B4, 0, 240, 10, -125)
EVT_CALL(PlaySoundAt, SOUND_B4, SOUND_SPACE_MODE_0, 240, 10, -125)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 20, EVT_FLOAT(2.0))
EVT_WAIT(5)
EVT_CALL(PlaySoundAt, SOUND_B4, 0, 240, 10, -125)
EVT_CALL(PlaySoundAt, SOUND_B4, SOUND_SPACE_MODE_0, 240, 10, -125)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 20, EVT_FLOAT(2.0))
EVT_CALL(ShowMessageAtScreenPos, MSG_CH3_00E7, 160, 40)
EVT_EXEC_WAIT(N(EVS_BraceDoor1))
@ -556,7 +556,7 @@ EvtScript N(EVS_Scene_ThrownOutBySentinel) = {
EVT_CALL(SetNpcPos, NPC_Sentinel, 175, 85, -33)
EVT_CALL(SetNpcAnimation, NPC_Sentinel, ANIM_Sentinel_Anim09)
EVT_WAIT(20)
EVT_CALL(PlaySoundAtNpc, NPC_Sentinel, SOUND_2F7, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Sentinel, SOUND_2F7, SOUND_SPACE_MODE_0)
EVT_CALL(SetNpcAnimation, NPC_Sentinel, ANIM_Sentinel_Anim02)
EVT_CALL(SetNpcPos, NPC_Sentinel, 175, 70, -33)
EVT_THREAD
@ -573,7 +573,7 @@ EvtScript N(EVS_Scene_ThrownOutBySentinel) = {
EVT_END_THREAD
EVT_CALL(SetPlayerJumpscale, 0)
EVT_CALL(PlayerJump1, 175, 0, -35, 10)
EVT_CALL(PlaySoundAtNpc, NPC_Sentinel, SOUND_162, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Sentinel, SOUND_162, SOUND_SPACE_MODE_0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80003)
EVT_THREAD
EVT_WAIT(2)
@ -617,9 +617,9 @@ EvtScript N(EVS_Scene_ThrownOutBySentinel) = {
EVT_WAIT(20)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_DustOff)
EVT_WAIT(7)
EVT_CALL(PlaySoundAtPlayer, SOUND_DUST_OFF, 0)
EVT_CALL(PlaySoundAtPlayer, SOUND_DUST_OFF, SOUND_SPACE_MODE_0)
EVT_WAIT(8)
EVT_CALL(PlaySoundAtPlayer, SOUND_DUST_OFF, 0)
EVT_CALL(PlaySoundAtPlayer, SOUND_DUST_OFF, SOUND_SPACE_MODE_0)
EVT_WAIT(15)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_8001B)
EVT_WAIT(25)

View File

@ -21,9 +21,9 @@ EvtScript N(EVS_Scene_TubbaSmashBridges) = {
EVT_CALL(InterruptUsePartner)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_8000A)
EVT_THREAD
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, SOUND_SPACE_MODE_0)
EVT_WAIT(5)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, SOUND_SPACE_MODE_0)
EVT_WAIT(5)
EVT_END_THREAD
EVT_THREAD
@ -32,7 +32,7 @@ EvtScript N(EVS_Scene_TubbaSmashBridges) = {
EVT_WAIT(30)
EVT_THREAD
EVT_LOOP(12)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, SOUND_SPACE_MODE_0)
EVT_WAIT(5)
EVT_END_LOOP
EVT_END_THREAD
@ -133,10 +133,10 @@ EvtScript N(EVS_Scene_TubbaSmashBridges) = {
EVT_CALL(NpcMoveTo, NPC_Tubba, 176, 0, 0)
EVT_END_THREAD
EVT_THREAD
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, SOUND_SPACE_MODE_0)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 5, EVT_FLOAT(0.3))
EVT_WAIT(5)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, SOUND_SPACE_MODE_0)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 2, EVT_FLOAT(0.15))
EVT_WAIT(8)
EVT_END_THREAD
@ -160,10 +160,10 @@ EvtScript N(EVS_Scene_TubbaSmashBridges) = {
EVT_END_THREAD
EVT_THREAD
EVT_LOOP(0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, SOUND_SPACE_MODE_0)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 5, EVT_FLOAT(0.3))
EVT_WAIT(5)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20F6, SOUND_SPACE_MODE_0)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 2, EVT_FLOAT(0.15))
EVT_WAIT(8)
EVT_END_LOOP

View File

@ -24,7 +24,7 @@ EvtScript N(EVS_UnlockPrompt_Door) = {
EVT_CALL(CloseChoicePopup)
EVT_SET(GF_DGB01_UnlockedEastWing, TRUE)
EVT_CALL(N(GetEntityPosition), MV_PadlockEntityID, LVar0, LVar1, LVar2)
EVT_CALL(PlaySoundAt, SOUND_269, 0, LVar0, LVar1, LVar2)
EVT_CALL(PlaySoundAt, SOUND_269, SOUND_SPACE_MODE_0, LVar0, LVar1, LVar2)
EVT_SET(LVar0, MV_PadlockEntityID)
EVT_CALL(N(RemovePadlock))
EVT_RESUME_GROUP(EVT_GROUP_01)

View File

@ -20,7 +20,7 @@ EvtScript N(EVS_NpcIdle_Tubba_Floor3) = {
EVT_WAIT(1)
EVT_END_LOOP
EVT_SET(GB_ARN_Tubba_MapID, 1)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittne, SOUND_CREAKY_DOOR_OPEN, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittne, SOUND_CREAKY_DOOR_OPEN, SOUND_SPACE_MODE_0)
EVT_CALL(MakeLerp, 0, 80, 10, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
@ -48,7 +48,7 @@ EvtScript N(EVS_NpcIdle_Tubba_Floor3) = {
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittne, SOUND_CREAKY_DOOR_CLOSE, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittne, SOUND_CREAKY_DOOR_CLOSE, SOUND_SPACE_MODE_0)
EVT_END_THREAD
EVT_CALL(SpeakToPlayer, NPC_Tubba, ANIM_WorldTubba_Anim10, ANIM_WorldTubba_Anim06, 0, MSG_CH3_0101)
EVT_THREAD
@ -66,7 +66,7 @@ EvtScript N(EVS_NpcIdle_Tubba_Floor3) = {
EVT_CALL(SetNpcJumpscale, NPC_Tubba, EVT_FLOAT(1.0))
EVT_CALL(GetNpcPos, NPC_Tubba, LVar0, LVar1, LVar2)
EVT_CALL(NpcJump0, NPC_Tubba, LVar0, LVar1, LVar2, 30)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20A0, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_20A0, SOUND_SPACE_MODE_0)
EVT_CALL(PlaySound, SOUND_8000005D)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 15, EVT_FLOAT(4.0))
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 15, EVT_FLOAT(2.0))
@ -121,7 +121,7 @@ EvtScript N(EVS_NpcIdle_Tubba_Floor1) = {
EVT_CALL(AwaitPlayerApproach, 0, 420, 400)
EVT_SET(GB_ARN_Tubba_MapID, 1)
EVT_SET(GB_StoryProgress, STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittse, SOUND_CREAKY_DOOR_OPEN, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittse, SOUND_CREAKY_DOOR_OPEN, SOUND_SPACE_MODE_0)
EVT_CALL(MakeLerp, 0, 80, 10, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
@ -148,7 +148,7 @@ EvtScript N(EVS_NpcIdle_Tubba_Floor1) = {
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittse, SOUND_CREAKY_DOOR_CLOSE, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittse, SOUND_CREAKY_DOOR_CLOSE, SOUND_SPACE_MODE_0)
EVT_END_THREAD
EVT_THREAD
EVT_LOOP(0)

View File

@ -55,7 +55,7 @@ EvtScript N(EVS_PushClock_Impl) = {
EVT_CALL(DisablePlayerInput, FALSE)
EVT_END_THREAD
EVT_CALL(MakeLerp, LVar6, LVar7, 100, EASING_LINEAR)
EVT_CALL(PlaySoundAtCollider, COLLIDER_o77, SOUND_80000010, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_o77, SOUND_80000010, SOUND_SPACE_MODE_0)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(TranslateModel, MODEL_o77, LVar0, 0, 0)

View File

@ -24,7 +24,7 @@ EvtScript N(EVS_UnlockPrompt_UpperDoor) = {
EVT_CALL(CloseChoicePopup)
EVT_SET(GF_DGB03_UnlockedThirdFloor, TRUE)
EVT_CALL(N(GetEntityPosition), MV_PadlockEntityID, LVar0, LVar1, LVar2)
EVT_CALL(PlaySoundAt, SOUND_269, 0, LVar0, LVar1, LVar2)
EVT_CALL(PlaySoundAt, SOUND_269, SOUND_SPACE_MODE_0, LVar0, LVar1, LVar2)
EVT_SET(LVar0, MV_PadlockEntityID)
EVT_CALL(N(RemovePadlock))
EVT_RESUME_GROUP(EVT_GROUP_01)

View File

@ -34,7 +34,7 @@ EvtScript N(EVS_NpcIdle_Tubba) = {
EVT_END_LOOP
EVT_SET(GB_ARN_Tubba_MapID, 8)
EVT_SET(GB_StoryProgress, STORY_CH3_TUBBA_CHASED_MARIO_IN_HALL)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittne, SOUND_CREAKY_DOOR_OPEN, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittne, SOUND_CREAKY_DOOR_OPEN, SOUND_SPACE_MODE_0)
EVT_CALL(MakeLerp, 0, 80, 10, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
@ -61,7 +61,7 @@ EvtScript N(EVS_NpcIdle_Tubba) = {
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittne, SOUND_CREAKY_DOOR_CLOSE, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittne, SOUND_CREAKY_DOOR_CLOSE, SOUND_SPACE_MODE_0)
EVT_END_THREAD
EVT_CALL(NpcMoveTo, NPC_SELF, -500, 80, 10)
EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(EVS_NpcAI_Tubba)))
@ -359,7 +359,7 @@ EvtScript N(EVS_NpcIdle_LastClubba) = {
EvtScript N(EVS_NpcInteract_LastClubba) = {
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldClubba_Anim08)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_2F1, 0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_2F1, SOUND_SPACE_MODE_0)
EVT_WAIT(10)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldClubba_Anim02)
EVT_WAIT(20)

View File

@ -68,7 +68,7 @@ EvtScript N(EVS_UseSpring) = {
EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(0.0))
EVT_CALL(PlayerJump1, 375, 25, -250, 10)
EVT_CALL(N(PlaySpringAnimation))
EVT_CALL(PlaySoundAtPlayer, SOUND_2086, 0)
EVT_CALL(PlaySoundAtPlayer, SOUND_2086, SOUND_SPACE_MODE_0)
EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(0.7))
EVT_CALL(PlayerJump, 375, 0, -175, 15)
EVT_KILL_THREAD(LVarA)

View File

@ -32,7 +32,7 @@ EvtScript N(EVS_SetupSpikes) = {
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(60)
EVT_CALL(PlaySoundAtCollider, COLLIDER_o215, SOUND_2093, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_o215, SOUND_2093, SOUND_SPACE_MODE_0)
EVT_THREAD
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o215, COLLIDER_FLAGS_UPPER_MASK)
EVT_END_THREAD

Some files were not shown because too many files have changed in this diff Show More