Merge branch 'modding+' of https://github.com/HarbourMasters/SpaghettiKart into modding+

This commit is contained in:
KiritoDv
2024-11-30 23:34:24 -06:00
41 changed files with 178 additions and 109 deletions
+34
View File
@@ -115,4 +115,38 @@
// Hey, you're very good. See you next time!
#define SOUND_CREDITS_FAREWELL SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x26)
enum MusicSeq {
MUSIC_SEQ_UNKNOWN = -1,
MUSIC_SEQ_00,
MUSIC_SEQ_TITLE_SCREEN,
MUSIC_SEQ_MAIN_MENU,
MUSIC_SEQ_RACEWAYS_WARIO_STADIUM,
MUSIC_SEQ_MOO_MOO_FARM_YOSHI_VALLEY,
MUSIC_SEQ_CHOCO_MOUNTAIN,
MUSIC_SEQ_KOOPA_TROOPA_BEACH,
MUSIC_SEQ_BANSHEE_BOARDWALK,
MUSIC_SEQ_FRAPPE_SNOWLAND,
MUSIC_SEQ_BOWSERS_CASTLE,
MUSIC_SEQ_KALIMARI_DESERT,
MUSIC_SEQ_START_GRID_GP_VS,
MUSIC_SEQ_FINAL_LAP_FANFARE,
MUSIC_SEQ_FINISH_1ST_PLACE,
MUSIC_SEQ_FINISH_2ND_4TH_PLACE,
MUSIC_SEQ_FINISH_5TH_8TH_PLACE,
MUSIC_SEQ_16,
MUSIC_SEQ_STAR_JINGLE,
MUSIC_SEQ_RAINBOW_ROAD,
MUSIC_SEQ_DK_JUNGLE,
MUSIC_SEQ_GAME_OVER,
MUSIC_SEQ_TOADS_TURNPIKE,
MUSIC_SEQ_START_GIRD_TIME_ATTACK,
MUSIC_SEQ_VS_BATTLE_RESULTS,
MUSIC_SEQ_LOSING_RESULTS,
MUSIC_SEQ_BATTLE_ARENAS,
MUSIC_SEQ_AWARD_CEREMONY_BUILDUP,
MUSIC_SEQ_AWARD_CEREMONY_1ST_3RD,
MUSIC_SEQ_STAFF_ROLL,
MUSIC_SEQ_AWARD_CEREMONY_4TH_8TH,
};
#endif // SOUNDS_H
+1 -1
View File
@@ -12,7 +12,7 @@ void sequence_channel_process_sound(struct SequenceChannel* seqChannel, s32 reca
s32 i;
if (seqChannel->changes.as_bitfields.volume || recalculateVolume) {
channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->appliedFadeVolume;
channelVolume = (seqChannel->volume * (seqChannel->volumeScale * seqChannel->seqPlayer->fadeVolume)) * seqChannel->seqPlayer->gameVolume;
if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) {
channelVolume = seqChannel->seqPlayer->muteVolumeScale * channelVolume;
}
+17 -12
View File
@@ -92,7 +92,7 @@ f32 D_800EA120[] = { 0.0f, 0.0f, 0.0f, 0.0f };
f32 D_800EA130[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
f32 D_800EA150 = 1.4f;
u8 D_800EA154[] = { 2, 2, 88, 90, 3, 48, 88, 48 };
u16 D_800EA15C = 0;
u16 gCurrentMusicSeq = 0;
u16 D_800EA160 = 0;
u8 D_800EA164 = 0;
s8 D_800EA168 = 0;
@@ -565,7 +565,7 @@ void func_800C2474(void) {
D_800EA16C = 0;
func_800CBBB8(0xF2000000U, 0);
D_800EA16C = 0;
D_800EA15C = 0;
gCurrentMusicSeq = 0;
D_800EA160 = 0;
D_800EA164 = 0;
D_800EA178 = 1.0f;
@@ -2834,9 +2834,9 @@ void play_sound2(s32 soundBits) {
play_sound(soundBits, &D_800EA1C8, 4, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
}
void func_800C8EAC(u16 arg0) {
void play_sequence(u16 arg0) {
func_800C3448(arg0 | 0x10000);
D_800EA15C = arg0;
gCurrentMusicSeq = arg0;
}
void func_800C8EF8(u16 arg0) {
@@ -3284,7 +3284,7 @@ void func_800CA49C(u8 arg0) {
func_800C3448(0x100100FF); // 0x19000000
func_800C3448(0x110100FF);
func_800C8EF8(0xC);
func_800C3448(D_800EA15C | 0xC1500000);
func_800C3448(gCurrentMusicSeq | 0xC1500000);
func_800C3448(0xC130017D);
}
D_8018FC08 = D_8018FC08 + 1;
@@ -3334,20 +3334,20 @@ void func_800CA730(u8 arg0) {
if (D_8018FC08 != 0) {
if (((u32) (gSequencePlayers[1].enabled)) == 0) {
func_800C3608(1, 5);
func_800C8EAC(D_800EA15C);
play_sequence(gCurrentMusicSeq);
func_800C3448(0xB001307DU);
} else if ((func_800C3508(1) == 0xC) || (func_800C357C(0x0101000C) == 0)) {
func_800C3448(0xC1F00000U);
func_800C3448(D_800EA15C | 0xC1500000);
func_800C3448(gCurrentMusicSeq | 0xC1500000);
func_800C3448(0xC130017DU);
} else {
func_800C3448(0x110100FFU);
func_800C8EAC(D_800EA15C);
play_sequence(gCurrentMusicSeq);
func_800C3448(0xB001307DU);
}
} else {
func_800C3448(0x110100FFU);
func_800C8EAC(D_800EA15C);
play_sequence(gCurrentMusicSeq);
}
}
D_800EA164 = 0;
@@ -3512,11 +3512,11 @@ void func_800CB14C() {
if (D_800EA174 != 0) {
D_800EA174++;
if (D_800EA174 == 3) {
func_800C8EAC(0x001AU);
play_sequence(MUSIC_SEQ_AWARD_CEREMONY_BUILDUP);
func_800C3448(0x4000007F);
}
if (D_800EA174 == 0x012C) {
func_800C8EAC(0x001BU);
play_sequence(MUSIC_SEQ_AWARD_CEREMONY_1ST_3RD);
func_800C3448(0x4000007F);
func_800C8EF8(0x001DU);
func_800C3448(0x41000000);
@@ -3541,12 +3541,17 @@ void func_800CB14C() {
func_800C3448(0x110100FF);
}
if (D_800EA174 == 0x04CE) {
func_800C8EAC(0x0014U);
play_sequence(MUSIC_SEQ_GAME_OVER);
func_800C3448(0x4000007F);
}
}
}
void audio_set_player_volume(u8 player, f32 volume) {
gSequencePlayers[player].gameVolume = volume;
gSequencePlayers[player].recalculateVolume = 1;
}
// run audio?
void func_800CB2C4() {
func_800C1F8C();
+4 -2
View File
@@ -271,7 +271,7 @@ void func_800C8AE4(void);
void func_800C8C7C(u8);
void func_800C8CCC(void);
void play_sound2(s32);
void func_800C8EAC(u16);
void play_sequence(u16);
void func_800C8EF8(u16);
void func_800C8F44(u8);
void func_800C8F80(u8, u32);
@@ -322,6 +322,8 @@ void func_800CB14C(void);
void func_800CB2C4(void);
void func_800CBC24(void);
extern void audio_set_player_volume(u8 player, f32 volume);
// This is some from other file, its definitely not part of audio's data/bss
extern s8 D_801657E5;
@@ -399,7 +401,7 @@ extern f32 D_800EA120[4];
extern f32 D_800EA130[8];
extern f32 D_800EA150; // = 1.4f;
extern u8 D_800EA154[];
extern u16 D_800EA15C;
extern u16 gCurrentMusicSeq;
extern u16 D_800EA160;
extern u8 D_800EA164;
extern s8 D_800EA168;
+2
View File
@@ -663,6 +663,7 @@ void audio_reset_session(void) {
for (var_s5 = 0; var_s5 < 4; var_s5++) {
gSynthesisReverbs[var_s5].useReverb = 0;
}
gNumSynthesisReverbs = temp_s6->numReverbs;
for (var_s5 = 0; var_s5 < gNumSynthesisReverbs; var_s5++) {
reverb = &gSynthesisReverbs[var_s5];
@@ -695,6 +696,7 @@ void audio_reset_session(void) {
}
}
}
func_800BB030(gMaxSimultaneousNotes);
osWritebackDCacheAll();
}
+1
View File
@@ -228,6 +228,7 @@ struct SequencePlayer {
/*0x130, 0x13C*/ u8* bankDmaCurrMemAddr;
/*0x138, 0x140*/ uintptr_t bankDmaCurrDevAddr;
/*0x13C, 0x144*/ size_t bankDmaRemaining;
f32 gameVolume;
}; // size = 0x140, 0x148 on EU, 0x14C on SH
struct AdsrSettings {
+6
View File
@@ -5,6 +5,7 @@
#include "audio/data.h"
#include "audio/heap.h"
#include "audio/internal.h"
#include "audio/external.h"
#include "audio/playback.h"
#include "audio/synthesis.h"
#include "audio/seqplayer.h"
@@ -803,6 +804,11 @@ void audio_init(void) {
sound_alloc_pool_init(&gUnkPool1.pool, soundAlloc(&gAudioInitPool, (u32) D_800EA5D8), (u32) D_800EA5D8);
init_sequence_players();
gAudioLoadLock = 0x76557364;
audio_set_player_volume(SEQ_PLAYER_LEVEL, CVarGetFloat("gMainMusicVolume", 1.0f));
audio_set_player_volume(SEQ_PLAYER_ENV, CVarGetFloat("gEnvironmentVolume", 1.0f));
audio_set_player_volume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f));
}
#else
#ifdef VERSION_EU
+2 -1
View File
@@ -274,7 +274,7 @@ void aResampleImpl(uint8_t flags, uint16_t pitch, RESAMPLE_STATE state) {
void aEnvSetup1Impl(uint8_t initial_vol_wet, uint16_t rate_wet, uint16_t rate_left, uint16_t rate_right) {
rspa.vol_wet = (uint16_t)(initial_vol_wet << 8);
rspa.rate_wet = rate_wet;
rspa.rate_wet = 0;
rspa.rate[0] = rate_left;
rspa.rate[1] = rate_right;
}
@@ -289,6 +289,7 @@ void aEnvMixerImpl(uint16_t in_addr, uint16_t n_samples, bool swap_reverb,
uint16_t dry_left_addr, uint16_t dry_right_addr,
uint16_t wet_left_addr, uint16_t wet_right_addr)
{
swap_reverb = false;
int16_t *in = BUF_S16(in_addr);
int16_t *dry[2] = {BUF_S16(dry_left_addr), BUF_S16(dry_right_addr)};
int16_t *wet[2] = {BUF_S16(wet_left_addr), BUF_S16(wet_right_addr)};
+4
View File
@@ -71,6 +71,10 @@ void note_set_vel_pan_reverb(struct Note* note, f32 velocity, u8 pan, u8 reverbV
velocity = 1.0f;
}
float master_vol = CVarGetFloat("gGameMasterVolume", 1.0f);
volLeft *= master_vol;
volRight *= master_vol;
sub->targetVolLeft = ((s32) (velocity * volLeft * 4095.999f));
sub->targetVolRight = ((s32) (velocity * volRight * 4095.999f));
+2
View File
@@ -6,6 +6,7 @@
#include "objects.h"
#include "path_spawn_metadata.h"
#include "waypoints.h"
#include "sounds.h"
typedef struct {
RGB8 TopRight;
@@ -44,6 +45,7 @@ typedef struct {
s32 MinimapFinishlineX;
s32 MinimapFinishlineY;
SkyboxColours Skybox;
enum MusicSeq Sequence;
} CProperties;
#endif // __ENGINE_H__
+1
View File
@@ -66,6 +66,7 @@ class World {
int32_t MinimapFinishlineX;
int32_t MinimapFinishlineY;
SkyboxColours Skybox;
MusicSeq Sequence;
} Properties;
typedef struct {
+1
View File
@@ -101,6 +101,7 @@ BansheeBoardwalk::BansheeBoardwalk() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {0, 0, 0};
Props.Sequence = MusicSeq::MUSIC_SEQ_BANSHEE_BOARDWALK;
}
void BansheeBoardwalk::Load() {
+1
View File
@@ -96,6 +96,7 @@ BigDonut::BigDonut() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {0, 0, 0};
Props.Sequence = MusicSeq::MUSIC_SEQ_BATTLE_ARENAS;
}
void BigDonut::Load() {
+1
View File
@@ -99,6 +99,7 @@ BlockFort::BlockFort() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {216, 232, 248};
Props.Sequence = MusicSeq::MUSIC_SEQ_CHOCO_MOUNTAIN;
}
void BlockFort::Load() {
+1
View File
@@ -101,6 +101,7 @@ BowsersCastle::BowsersCastle() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {0, 0, 0};
Props.Sequence = MusicSeq::MUSIC_SEQ_BOWSERS_CASTLE;
}
void BowsersCastle::Load() {
+1
View File
@@ -101,6 +101,7 @@ ChocoMountain::ChocoMountain() {
Props.Skybox.FloorBottomRight = {255, 255, 255};
Props.Skybox.FloorBottomLeft = {255, 255, 255};
Props.Skybox.FloorTopLeft = {255, 255, 255};
Props.Sequence = MusicSeq::MUSIC_SEQ_CHOCO_MOUNTAIN;
}
void ChocoMountain::Load() {
+1
View File
@@ -73,6 +73,7 @@ Course::Course() {
Props.CloudList = NULL;
Props.MinimapFinishlineX = 0;
Props.MinimapFinishlineY = 0;
Props.Sequence = MusicSeq::MUSIC_SEQ_UNKNOWN;
}
void Course::Load(Vtx* vtx, Gfx* gfx) {
+1
View File
@@ -75,6 +75,7 @@ public:
int32_t MinimapFinishlineX;
int32_t MinimapFinishlineY;
SkyboxColours Skybox;
MusicSeq Sequence;
} Properties;
Properties Props;
+1
View File
@@ -104,6 +104,7 @@ DKJungle::DKJungle() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {22, 145, 22};
Props.Sequence = MusicSeq::MUSIC_SEQ_DK_JUNGLE;
}
void DKJungle::Load() {
+1
View File
@@ -99,6 +99,7 @@ DoubleDeck::DoubleDeck() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {255, 224, 240};
Props.Sequence = MusicSeq::MUSIC_SEQ_CHOCO_MOUNTAIN;
}
void DoubleDeck::Load() {
+1
View File
@@ -102,6 +102,7 @@ FrappeSnowland::FrappeSnowland() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {0, 99, 164};
Props.Sequence = MusicSeq::MUSIC_SEQ_FRAPPE_SNOWLAND;
}
void FrappeSnowland::Load() {
+1
View File
@@ -102,6 +102,7 @@ KalimariDesert::KalimariDesert() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {255, 192, 0};
Props.Sequence = MusicSeq::MUSIC_SEQ_KALIMARI_DESERT;
}
void KalimariDesert::Load() {
+1
View File
@@ -102,6 +102,7 @@ KoopaTroopaBeach::KoopaTroopaBeach() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {48, 152, 120};
Props.Sequence = MusicSeq::MUSIC_SEQ_KOOPA_TROOPA_BEACH;
}
void KoopaTroopaBeach::Load() {
+1
View File
@@ -105,6 +105,7 @@ LuigiRaceway::LuigiRaceway() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {216, 232, 248};
Props.Sequence = MusicSeq::MUSIC_SEQ_RACEWAYS_WARIO_STADIUM;
}
void LuigiRaceway::Load() {
+1
View File
@@ -102,6 +102,7 @@ MarioRaceway::MarioRaceway() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {0, 0, 0};
Props.Sequence = MusicSeq::MUSIC_SEQ_RACEWAYS_WARIO_STADIUM;
}
void MarioRaceway::Load() {
+1
View File
@@ -102,6 +102,7 @@ MooMooFarm::MooMooFarm() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {255, 184, 99};
Props.Sequence = MusicSeq::MUSIC_SEQ_MOO_MOO_FARM_YOSHI_VALLEY;
}
void MooMooFarm::Load() {
+1
View File
@@ -96,6 +96,7 @@ PodiumCeremony::PodiumCeremony() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {255, 224, 240};
Props.Sequence = MusicSeq::MUSIC_SEQ_UNKNOWN;
}
void PodiumCeremony::Load() {
+1
View File
@@ -99,6 +99,7 @@ RainbowRoad::RainbowRoad() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {0, 0, 0};
Props.Sequence = MusicSeq::MUSIC_SEQ_RAINBOW_ROAD;
}
void RainbowRoad::Load() {
+1
View File
@@ -100,6 +100,7 @@ RoyalRaceway::RoyalRaceway() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {255, 224, 240};
Props.Sequence = MusicSeq::MUSIC_SEQ_RACEWAYS_WARIO_STADIUM;
}
void RoyalRaceway::Load() {
+1
View File
@@ -100,6 +100,7 @@ SherbetLand::SherbetLand() {
Props.Skybox.FloorBottomRight = {128, 184, 248};
Props.Skybox.FloorBottomLeft = {128, 184, 248};
Props.Skybox.FloorTopLeft = {216, 232, 248};
Props.Sequence = MusicSeq::MUSIC_SEQ_FRAPPE_SNOWLAND;
}
void SherbetLand::Load() {
+1
View File
@@ -99,6 +99,7 @@ Skyscraper::Skyscraper() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {0, 0, 0};
Props.Sequence = MusicSeq::MUSIC_SEQ_BATTLE_ARENAS;
}
void Skyscraper::Load() {
+1
View File
@@ -112,6 +112,7 @@ TestCourse::TestCourse() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {0, 0, 0};
Props.Sequence = MusicSeq::MUSIC_SEQ_RACEWAYS_WARIO_STADIUM;
}
void TestCourse::Load() {
+1
View File
@@ -104,6 +104,7 @@ ToadsTurnpike::ToadsTurnpike() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {209, 65, 23};
Props.Sequence = MusicSeq::MUSIC_SEQ_TOADS_TURNPIKE;
}
void ToadsTurnpike::Load() {
+1
View File
@@ -103,6 +103,7 @@ WarioStadium::WarioStadium() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {0, 0, 0};
Props.Sequence = MusicSeq::MUSIC_SEQ_RACEWAYS_WARIO_STADIUM;
}
void WarioStadium::Load() {
+1
View File
@@ -100,6 +100,7 @@ YoshiValley::YoshiValley() {
Props.Skybox.FloorBottomRight = {0, 0, 0};
Props.Skybox.FloorBottomLeft = {0, 0, 0};
Props.Skybox.FloorTopLeft = {95, 40, 15};
Props.Sequence = MusicSeq::MUSIC_SEQ_MOO_MOO_FARM_YOSHI_VALLEY;
}
void YoshiValley::Load() {
+6 -6
View File
@@ -60,7 +60,7 @@ s8 D_8018EE0C;
struct_8018EE10_entry D_8018EE10[2];
/** Data **/
s32 gMenuSelection = START_MENU;
s32 gMenuSelection = LOGO_INTRO_MENU;
s32 D_800E86A4 = 0;
s8 gCharacterSelections[4] = { MARIO, LUIGI, YOSHI, TOAD };
@@ -1851,7 +1851,7 @@ void func_800B3F74(s32 menuSelection) {
}
D_8018EDF1 = D_800F2BE0[gPlayerCount - 1];
func_800CA008(0, 0);
func_800C8EAC(1);
play_sequence(MUSIC_SEQ_TITLE_SCREEN);
D_8018EDFC = 0;
break;
}
@@ -1868,13 +1868,13 @@ void func_800B3F74(s32 menuSelection) {
func_800CB2C4();
gGamestate = 0;
gGamestateNext = 0;
func_800C8EAC(2);
play_sequence(MUSIC_SEQ_MAIN_MENU);
}
switch (D_8018EDE0) {
case 0: {
gMainMenuSelectionDepth = PLAYER_NUM_SELECTION;
func_800C8EAC(2);
play_sequence(MUSIC_SEQ_MAIN_MENU);
gPlayerCount = 1;
if (gScreenModeSelection >= NUM_SCREEN_MODES || gScreenModeSelection < 0) {
gScreenModeSelection = SCREEN_MODE_1P;
@@ -1926,7 +1926,7 @@ void func_800B3F74(s32 menuSelection) {
func_800CB2C4();
gGamestate = 0;
gGamestateNext = 0;
func_800C8EAC(2);
play_sequence(MUSIC_SEQ_MAIN_MENU);
for (i = 0; i < ARRAY_COUNT(D_8018EDE8); i++) {
D_8018EDE8[i] = false;
}
@@ -1966,7 +1966,7 @@ void func_800B3F74(s32 menuSelection) {
func_800CB2C4();
gGamestate = 0;
gGamestateNext = 0;
func_800C8EAC(2);
play_sequence(MUSIC_SEQ_MAIN_MENU);
}
play_sound2(SOUND_MENU_SELECT_MAP);
D_8018EE0A = 0;
+7
View File
@@ -86,10 +86,17 @@ GameEngine::GameEngine() {
"Texture", static_cast<uint32_t>(LUS::ResourceType::Texture), 0);
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryTextureV1>(), RESOURCE_FORMAT_BINARY,
"Texture", static_cast<uint32_t>(LUS::ResourceType::Texture), 1);
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryVertexV0>(), RESOURCE_FORMAT_BINARY,
"Vertex", static_cast<uint32_t>(LUS::ResourceType::Vertex), 0);
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryXMLVertexV0>(), RESOURCE_FORMAT_XML,
"Vertex", static_cast<uint32_t>(LUS::ResourceType::Vertex), 0);
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryDisplayListV0>(), RESOURCE_FORMAT_BINARY,
"DisplayList", static_cast<uint32_t>(LUS::ResourceType::DisplayList), 0);
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryXMLDisplayListV0>(), RESOURCE_FORMAT_XML,
"DisplayList", static_cast<uint32_t>(LUS::ResourceType::DisplayList), 0);
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryMatrixV0>(), RESOURCE_FORMAT_BINARY,
"Matrix", static_cast<uint32_t>(LUS::ResourceType::Matrix), 0);
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryBlobV0>(), RESOURCE_FORMAT_BINARY,
+2 -2
View File
@@ -10,8 +10,8 @@
#include <Fast3D/gfx_pc.h>
#include "libultraship/src/Context.h"
#define SAMPLES_HIGH 454
#define SAMPLES_LOW 438
#define SAMPLES_HIGH 448
#define SAMPLES_LOW 432
#define AUDIO_FRAMES_PER_UPDATE 2
#define NUM_AUDIO_CHANNELS 2
#define SAMPLES_PER_FRAME (SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 2)
+55 -55
View File
@@ -18,6 +18,7 @@
extern "C" {
extern s32 gGamestateNext;
extern s32 gMenuSelection;
#include "audio/external.h"
#include "defines.h"
}
@@ -125,61 +126,60 @@ static const char* filters[3] = {
void DrawSettingsMenu() {
if (UIWidgets::BeginMenu("Settings")) {
// if (UIWidgets::BeginMenu("Audio")) {
// UIWidgets::CVarSliderFloat("Master Volume", "gGameMasterVolume", 0.0f, 1.0f, 1.0f, {
// .format = "%.0f%%",
// .isPercentage = true,
// });
// if (UIWidgets::CVarSliderFloat("Main Music Volume", "gMainMusicVolume", 0.0f, 1.0f, 1.0f,
// {
// .format = "%.0f%%",
// .isPercentage = true,
// })) {
// audio_set_player_volume(SEQ_PLAYER_LEVEL, CVarGetFloat("gMainMusicVolume", 1.0f));
// }
// if (UIWidgets::CVarSliderFloat("Sound Effects Volume", "gSFXMusicVolume",
// 0.0f, 1.0f, 1.0f, {
// .format = "%.0f%%",
// .isPercentage = true,
// })) {
// audio_set_player_volume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f));
// }
// if (UIWidgets::CVarSliderFloat("Environment Volume", "gEnvironmentVolume",
// 0.0f, 1.0f, 1.0f, {
// .format = "%.0f%%",
// .isPercentage = true,
// })) {
// audio_set_player_volume(SEQ_PLAYER_ENV, CVarGetFloat("gEnvironmentVolume", 1.0f));
// }
//
// static std::unordered_map<Ship::AudioBackend, const char*> audioBackendNames = {
// { Ship::AudioBackend::WASAPI, "Windows Audio Session API" },
// { Ship::AudioBackend::PULSE, "PulseAudio" },
// { Ship::AudioBackend::SDL, "SDL" },
// };
//
// ImGui::Text("Audio API (Needs reload)");
// auto currentAudioBackend = Ship::Context::GetInstance()->GetAudio()->GetAudioBackend();
//
// if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) {
// UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
// }
// if (ImGui::BeginCombo("##AApi", audioBackendNames[currentAudioBackend])) {
// for (uint8_t i = 0; i <
// Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size(); i++) {
// auto backend = Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->data()[i];
// if (ImGui::Selectable(audioBackendNames[backend], backend == currentAudioBackend)) {
// Ship::Context::GetInstance()->GetAudio()->SetAudioBackend(backend);
// }
// }
// ImGui::EndCombo();
// }
// if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) {
// UIWidgets::ReEnableComponent("");
// }
//
// ImGui::EndMenu();
// }
if (UIWidgets::BeginMenu("Audio")) {
UIWidgets::CVarSliderFloat("Master Volume", "gGameMasterVolume", 0.0f, 1.0f, 1.0f, {
.format = "%.0f%%",
.isPercentage = true,
});
if (UIWidgets::CVarSliderFloat("Main Music Volume", "gMainMusicVolume", 0.0f, 1.0f, 1.0f,
{
.format = "%.0f%%",
.isPercentage = true,
})) {
audio_set_player_volume(SEQ_PLAYER_LEVEL, CVarGetFloat("gMainMusicVolume", 1.0f));
}
if (UIWidgets::CVarSliderFloat("Sound Effects Volume", "gSFXMusicVolume",
0.0f, 1.0f, 1.0f, {
.format = "%.0f%%",
.isPercentage = true,
})) {
audio_set_player_volume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f));
}
if (UIWidgets::CVarSliderFloat("Environment Volume", "gEnvironmentVolume",
0.0f, 1.0f, 1.0f, {
.format = "%.0f%%",
.isPercentage = true,
})) {
audio_set_player_volume(SEQ_PLAYER_ENV, CVarGetFloat("gEnvironmentVolume", 1.0f));
}
static std::unordered_map<Ship::AudioBackend, const char*> audioBackendNames = {
{ Ship::AudioBackend::WASAPI, "Windows Audio Session API" },
{ Ship::AudioBackend::SDL, "SDL" },
};
ImGui::Text("Audio API (Needs reload)");
auto currentAudioBackend = Ship::Context::GetInstance()->GetAudio()->GetCurrentAudioBackend();
if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) {
UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
}
if (ImGui::BeginCombo("##AApi", audioBackendNames[currentAudioBackend])) {
for (uint8_t i = 0; i <
Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size(); i++) {
auto backend = Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->data()[i];
if (ImGui::Selectable(audioBackendNames[backend], backend == currentAudioBackend)) {
Ship::Context::GetInstance()->GetAudio()->SetCurrentAudioBackend(backend);
}
}
ImGui::EndCombo();
}
if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) {
UIWidgets::ReEnableComponent("");
}
ImGui::EndMenu();
}
UIWidgets::Spacer(0);
+5 -25
View File
@@ -21,6 +21,7 @@
#include "effects.h"
#include "math.h"
#include "menus.h"
#include "sounds.h"
#include "port/Game.h"
#pragma intrinsic(sqrtf)
@@ -423,31 +424,10 @@ void func_8028EC98(s32 arg0) {
func_800029B0();
if (GetCourse() == GetMarioRaceway() || GetCourse() == GetRoyalRaceway() || GetCourse() == GetLuigiRaceway() ||
GetCourse() == GetWarioStadium()) {
func_800C8EAC(3);
} else if (GetCourse() == GetToadsTurnpike()) {
func_800C8EAC(21);
} else if (GetCourse() == GetYoshiValley() || GetCourse() == GetMooMooFarm()) {
func_800C8EAC(4);
} else if (GetCourse() == GetChocoMountain() || GetCourse() == GetBlockFort() || GetCourse() == GetDoubleDeck()) {
func_800C8EAC(5);
} else if (GetCourse() == GetKalimariDesert()) {
func_800C8EAC(10);
} else if (GetCourse() == GetKoopaTroopaBeach()) {
func_800C8EAC(6);
} else if (GetCourse() == GetBowsersCastle()) {
func_800C8EAC(9);
} else if (GetCourse() == GetBansheeBoardwalk()) {
func_800C8EAC(7);
} else if (GetCourse() == GetFrappeSnowland() || GetCourse() == GetSherbetLand()) {
func_800C8EAC(8);
} else if (GetCourse() == GetRainbowRoad()) {
func_800C8EAC(18);
} else if (GetCourse() == GetDkJungle()) {
func_800C8EAC(19);
} else if (GetCourse() == GetSkyscraper() || GetCourse() == GetBigDonut()) {
func_800C8EAC(25);
enum MusicSeq sequence = CourseManager_GetProps()->Sequence;
if(sequence != MUSIC_SEQ_UNKNOWN){
play_sequence(sequence);
}
}
+5 -5
View File
@@ -30,7 +30,7 @@ raceways_wario_stadium:
banks:
- sound/banks/bank_3
moo_moo_fame_yoshi_valley:
moo_moo_farm_yoshi_valley:
type: NAUDIO:V0:SEQUENCE
id: 4
size: 0x1CA0
@@ -62,7 +62,7 @@ banshee_boardwalk:
banks:
- sound/banks/bank_7
seq_08:
frappe_snowland:
type: NAUDIO:V0:SEQUENCE
id: 8
size: 0x23D0
@@ -70,7 +70,7 @@ seq_08:
banks:
- sound/banks/bank_8
seq_09:
bowsers_castle:
type: NAUDIO:V0:SEQUENCE
id: 9
size: 0x1800
@@ -126,7 +126,7 @@ finish_5th_8th_place:
banks:
- sound/banks/bank_11
seq_10:
seq_16:
type: NAUDIO:V0:SEQUENCE
id: 16
size: 0x1410
@@ -150,7 +150,7 @@ rainbow_road:
banks:
- sound/banks/bank_15
maybe_boo_item:
dk_jungle:
type: NAUDIO:V0:SEQUENCE
id: 19
size: 0x06C0