#include <PR/ultratypes.h>12#include "sfx.h"34static u32 sCurrSfx; // bitset of currently playing sound effects5static u32 sPrevSfx; // bitset of sound effects that were playing on the previous frame67/**8* Stops all sound effects9*/10void gd_reset_sfx(void) {11sPrevSfx = GD_SFX_NONE;12sCurrSfx = GD_SFX_NONE;13}1415/**16* Returns a bitset of the newly started sound effects.17* This is used by geo_draw_mario_head_goddard to start new sounds.18*/19u32 gd_new_sfx_to_play(void) {20return ~sPrevSfx & sCurrSfx;21}2223/**24* Called at the start of a frame.25*/26void gd_sfx_update(void) {27sPrevSfx = sCurrSfx;28sCurrSfx = GD_SFX_NONE;29}3031/**32* Marks a sound effect to be played. This must be called repeatedly once per33* frame to keep the sound effect playing.34*/35void gd_play_sfx(enum GdSfx sfx) {36sCurrSfx |= sfx;37}383940