From b8cd00c15b3e576921dc0b0da6cbe6b832baa722 Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 22 May 2013 21:18:35 +0200 Subject: added SetVolume --- include/game.h | 6 +++++- kamek_pal.x | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/game.h b/include/game.h index 1eb7a17..d72e349 100755 --- a/include/game.h +++ b/include/game.h @@ -3816,6 +3816,7 @@ extern "C" void Pause__Q44nw4r3snd6detail10BasicSoundFbi(void *_this, bool pause extern "C" void Stop__Q44nw4r3snd6detail10BasicSoundFi(void *_this, int unk); extern "C" void StrmSound_SetTrackVolume(void *_this, u32 mask, int count, float value); extern "C" void SetPitch__Q44nw4r3snd6detail10BasicSoundFf(void *_this, float value); +extern "C" void SetVolume__Q44nw4r3snd6detail10BasicSoundFfi(void *_this, float value, int count); namespace nw4r { namespace snd { @@ -3832,6 +3833,8 @@ namespace nw4r { void SetPitch(float value) { SetPitch__Q44nw4r3snd6detail10BasicSoundFf(data, value); } void Pause(bool pause, int count) { Pause__Q44nw4r3snd6detail10BasicSoundFbi(data, pause, count); } + void SetVolume(float value, int count) { SetVolume__Q44nw4r3snd6detail10BasicSoundFfi(data, pause, count); } + void *GetSound() const { return data; } void DetachSound(); @@ -3971,7 +3974,8 @@ inline int Player_VF3D4(void *self) { VF_END; } -extern "C" void PlaySoundWithFunctionB4(void *spc, nw4r::snd::SoundHandle *handle, int id, int unk); +extern "C" void PlaySoundWithFunctionB4(void *src, nw4r::snd::SoundHandle *handle, int id, int unk); +extern "C" void CheckIfPlayingSound(void *src, int id); extern void *SoundRelatedClass; void GetPosForLayoutEffect(VEC3 *pos, bool quack); diff --git a/kamek_pal.x b/kamek_pal.x index 5f5eeef..55a94ce 100644 --- a/kamek_pal.x +++ b/kamek_pal.x @@ -127,6 +127,7 @@ SECTIONS { Pause__Q44nw4r3snd6detail10BasicSoundFbi = 0x80266580; Stop__Q44nw4r3snd6detail10BasicSoundFi = 0x80266390; SetPitch__Q44nw4r3snd6detail10BasicSoundFf = 0x802675F0; + SetVolume__Q44nw4r3snd6detail10BasicSoundFfi = 0x80267560; StrmSound_SetTrackVolume = 0x8027F9D0; DontShowPreGame = 0x8042A490; -- cgit v1.2.3 From 483ebc6f00a35e972ef90fd81dbda39d114960e4 Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 22 May 2013 21:18:44 +0200 Subject: added red ring event control --- bugfixes.yaml | 6 ++++++ src/randomcrap.S | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/bugfixes.yaml b/bugfixes.yaml index 4b47df8..9f5a48c 100644 --- a/bugfixes.yaml +++ b/bugfixes.yaml @@ -3,6 +3,12 @@ # yaml, hasn't it... source_files: [../src/randomcrap.S, ../src/music.cpp, ../src/fix38.S, ../src/nullsub.S, ../src/newer.cpp] hooks: + - name: RedRingEventControl + type: branch_insn + branch_type: b + src_addr_pal: 0x80A93038 + target_func: 'RedRingEventControl' + - name: DisableTerrainShading type: patch addr_pal: 0x8008E6F8 diff --git a/src/randomcrap.S b/src/randomcrap.S index 29bf758..fff6c98 100644 --- a/src/randomcrap.S +++ b/src/randomcrap.S @@ -384,6 +384,16 @@ llaReturn: sfsdfsdf: .float 512.0 .text + +.global RedRingEventControl +RedRingEventControl: + lwz r10, 4(r31) + srwi. r10, r10, 28 + beq dontResetRREDelay + li r5, 0 +dontResetRREDelay: + b set__10dFlagMgr_cFUcibbbUi + .global EFB_Crap .extern EFBMagic2__Fv .extern ContinueFromEFBMagic2 -- cgit v1.2.3 From f525c40321d24bbc83d8dcfdbcd63e89c368917f Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 22 May 2013 21:18:52 +0200 Subject: hammer suit model fixes --- src/poweruphax.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/poweruphax.cpp b/src/poweruphax.cpp index f2895de..1bb5dc8 100644 --- a/src/poweruphax.cpp +++ b/src/poweruphax.cpp @@ -45,8 +45,8 @@ void dHammerSuitRenderer_c::setup(dPlayerModelHandler_c *handler, int sceneID) { nw4r::g3d::ResFile rf(getResource("hammerM", "g3d/suit.brres")); - if (victim->player_id_1 <= 1) { - helmet.setup(rf.GetResMdl((victim->player_id_1 == 0) ? "marioHelmet" : "luigiHelmet"), &allocator, 0, 1, 0); + if (victim->player_id_2 <= 1) { + helmet.setup(rf.GetResMdl((victim->player_id_2 == 0) ? "marioHelmet" : "luigiHelmet"), &allocator, 0, 1, 0); SetupTextures_MapObj(&helmet, sceneID); } @@ -64,7 +64,7 @@ void dHammerSuitRenderer_c::setup(dPlayerModelHandler_c *handler, int sceneID) { (nw4r::g3d::ResMdl*)(((u32)victimModel->scnObj) + 0xE8); //headNodeID = playerResMdl->GetResNode("player_head").GetID(); - if (victim->player_id_1 <= 1) + if (victim->player_id_2 <= 1) headNodeID = playerResMdl->GetResNode("face_1").GetID(); rootNodeID = playerResMdl->GetResNode("skl_root").GetID(); } @@ -73,7 +73,7 @@ void dHammerSuitRenderer_c::draw() { if (victim->powerup_id != 7) return; - if (victim->player_id_1 <= 1) { + if (victim->player_id_2 <= 1) { // Materials: 2=hair 3=hat; Modes: BACK=visible ALL=invisible SetCullModeForMaterial(&victim->getCurrentModel()->head, 3, GX_CULL_ALL); -- cgit v1.2.3 From a165a5fd2e8bd9ce78e7f67e410ad26f4ef87a49 Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 22 May 2013 21:19:01 +0200 Subject: chestnut anti-bubble fix --- src/chestnut.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/chestnut.cpp b/src/chestnut.cpp index 7ebfc4d..ff653c0 100644 --- a/src/chestnut.cpp +++ b/src/chestnut.cpp @@ -159,9 +159,11 @@ float daEnChestnut_c::nearestPlayerDistance() { for (int i = 0; i < 4; i++) { if (dAcPy_c *player = dAcPy_c::findByID(i)) { - float thisDist = abs(player->pos.x - pos.x); - if (thisDist < bestSoFar) - bestSoFar = thisDist; + if (strcmp(player->states2.getCurrentState()->getName(), "dAcPy_c::StateID_Balloon")) { + float thisDist = abs(player->pos.x - pos.x); + if (thisDist < bestSoFar) + bestSoFar = thisDist; + } } } -- cgit v1.2.3