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) {