Play bubble sound when pressing buttons

This commit is contained in:
2024-09-24 22:22:19 +02:00
parent b79dd47982
commit 714ef195d3
4 changed files with 13 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
#include "include/controller_state.hpp"
#include <PSX/GPU/gpu.hpp>
#include <PSX/SPU/spu.hpp>
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) {

View File

@@ -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),
};