From 714ef195d3fc153c923fd0ab8237e0f23ed63f0c Mon Sep 17 00:00:00 2001 From: jaby Date: Tue, 24 Sep 2024 22:22:19 +0200 Subject: [PATCH] Play bubble sound when pressing buttons --- .../src/Overlay/ControllerTest/controller_state.cpp | 8 ++++++++ examples/PoolBox/application/src/asset_mgr.cpp | 2 ++ examples/PoolBox/assets/Makefile | 1 + examples/PoolBox/iso/Config.xml | 2 ++ 4 files changed, 13 insertions(+) diff --git a/examples/PoolBox/application/src/Overlay/ControllerTest/controller_state.cpp b/examples/PoolBox/application/src/Overlay/ControllerTest/controller_state.cpp index cda13cab..5d2919b8 100644 --- a/examples/PoolBox/application/src/Overlay/ControllerTest/controller_state.cpp +++ b/examples/PoolBox/application/src/Overlay/ControllerTest/controller_state.cpp @@ -1,5 +1,6 @@ #include "include/controller_state.hpp" #include +#include namespace ControllerTest { using DigitalButton = Periphery::AnalogeController::Button; @@ -7,6 +8,9 @@ namespace ControllerTest { static void set_active(GPU::SPRT_16::Linked& sprt, bool is_active) { sprt->tex_offset.y = is_active ? 16 : 0; + if(is_active) { + SPU::voice[1].play_if_end(); + } } static void set_active(GPU::POLY_FT4::Linked& poly, bool is_active) { @@ -14,6 +18,10 @@ namespace ControllerTest { poly->tex_offset1.y = is_active ? 16 : 0; poly->tex_offset2.y = is_active ? 32 : 16; poly->tex_offset3.y = is_active ? 32 : 16; + + if(is_active) { + SPU::voice[1].play_if_end(); + } } static const char* get_type_name(Periphery::ControllerType type) { diff --git a/examples/PoolBox/application/src/asset_mgr.cpp b/examples/PoolBox/application/src/asset_mgr.cpp index b6153c4a..54f9ab99 100644 --- a/examples/PoolBox/application/src/asset_mgr.cpp +++ b/examples/PoolBox/application/src/asset_mgr.cpp @@ -18,6 +18,7 @@ namespace Assets { __jabyengine_request_lba_for(PACO, "ASSETS/MAIN/PACO.IMG"), __jabyengine_request_lba_for(DFISH, "ASSETS/MAIN/DFISH.IMG"), __jabyengine_request_lba_for(APPLE_SFX, "SFX/APPLE.VAG"), + __jabyengine_request_lba_for(BLUBB_SFX, "SFX/BLUBB.VAG"), __jabyengine_request_lba_for(MIX_XA, "XAAUDIO/MIX.XA"), __jabyengine_request_lba_for(BIOS_INFO_OVL, "BIO.BIN"), __jabyengine_request_lba_for(GPU_TEST_OVL, "GTO.BIN"), @@ -65,6 +66,7 @@ namespace Assets { CDFileBuilder::simple_tim(LBA::PACO, PacoTIM), CDFileBuilder::simple_tim(LBA::DFISH, DoenerFishInfo.tim), CDFileBuilder::sony_vag(LBA::APPLE_SFX, VAG::create(0, 1.0_vol)), + CDFileBuilder::sony_vag(LBA::BLUBB_SFX, VAG::create(1, 1.0_vol)), CustomCDFileBuilder::jingle(32), }; diff --git a/examples/PoolBox/assets/Makefile b/examples/PoolBox/assets/Makefile index 9ba30da4..c93cc47b 100644 --- a/examples/PoolBox/assets/Makefile +++ b/examples/PoolBox/assets/Makefile @@ -13,6 +13,7 @@ CLUT_4_COLOR_TRANS_FLAGS = simple-tim clut4 --color-trans INPUT += $(OUTPUT_DIR)/Evacuation_cdda.xa INPUT += $(OUTPUT_DIR)/fox.xa INPUT += $(OUTPUT_DIR)/apple.vag +INPUT += $(OUTPUT_DIR)/blubb.vag ## Images INPUT += $(OUTPUT_DIR)/TexturePage.img diff --git a/examples/PoolBox/iso/Config.xml b/examples/PoolBox/iso/Config.xml index 56bc04a2..bcb3da94 100644 --- a/examples/PoolBox/iso/Config.xml +++ b/examples/PoolBox/iso/Config.xml @@ -45,7 +45,9 @@ ../assets/audio/temp/breaking.wav