From 1c6debd0303f522c8a3382fe0e546c12ee10d7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=9A=93?= Date: Sun, 27 Apr 2025 18:51:30 -0400 Subject: [PATCH] Complete the audio bindings in libretro builds --- binding-sandbox/audio-binding.h | 12 ++++++++++++ src/audio/audio.cpp | 2 -- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/binding-sandbox/audio-binding.h b/binding-sandbox/audio-binding.h index c42f59dd..5d0abbd0 100644 --- a/binding-sandbox/audio-binding.h +++ b/binding-sandbox/audio-binding.h @@ -326,6 +326,16 @@ namespace mkxp_sandbox { return SANDBOX_NIL; } + static VALUE setup_midi(VALUE self) { + mkxp_retro::audio->setupMidi(); + return SANDBOX_NIL; + } + + static VALUE reset(VALUE self) { + mkxp_retro::audio->reset(); + return SANDBOX_NIL; + } + VALUE module; void operator()() { @@ -346,6 +356,8 @@ namespace mkxp_sandbox { SANDBOX_AWAIT(rb_define_module_function, module, "me_fade", (VALUE (*)(ANYARGS))me_fade, 1); SANDBOX_AWAIT(rb_define_module_function, module, "se_play", (VALUE (*)(ANYARGS))se_play, -1); SANDBOX_AWAIT(rb_define_module_function, module, "se_stop", (VALUE (*)(ANYARGS))se_stop, 0); + SANDBOX_AWAIT(rb_define_module_function, module, "setup_midi", (VALUE (*)(ANYARGS))setup_midi, 0); + SANDBOX_AWAIT(rb_define_module_function, module, "__reset__", (VALUE (*)(ANYARGS))reset, 0); } } ) diff --git a/src/audio/audio.cpp b/src/audio/audio.cpp index 622475ad..3407f442 100644 --- a/src/audio/audio.cpp +++ b/src/audio/audio.cpp @@ -501,9 +501,7 @@ void Audio::seStop() void Audio::setupMidi() { -#ifndef MKXPZ_RETRO shState->midiState().initIfNeeded(shState->config()); -#endif // MKXPZ_RETRO } double Audio::bgmPos(int track)