From fc5f735d9e784f728344ab57a4594150a01600f0 Mon Sep 17 00:00:00 2001 From: GrayJack Date: Sat, 3 Jan 2026 01:38:40 -0300 Subject: [PATCH 1/5] refactor(audiorouting): Add the missing functions on the header --- src/kernel/pspaudiorouting.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/kernel/pspaudiorouting.h b/src/kernel/pspaudiorouting.h index 16891bc426..4a45b32ba1 100644 --- a/src/kernel/pspaudiorouting.h +++ b/src/kernel/pspaudiorouting.h @@ -27,5 +27,19 @@ int sceAudioRoutingSetMode( int mode ); */ int sceAudioRoutingGetMode(); +/** Get the current routing volume mode. + * + * @return The current routing volume mode. + */ +int sceAudioRoutingGetVolumeMode(); + +/** Set the routing volume mode. + * + * @param vol_mode The routing volume to set (`0` or `1`). + * + * @return `0` on success, `< 0` on error. + */ +int sceAudioRoutingSetVolumeMode(int vol_mode); + #endif From 63e9c2d95590c43e8f0dd807bbbd480e0c1c8983 Mon Sep 17 00:00:00 2001 From: GrayJack Date: Sat, 3 Jan 2026 01:59:56 -0300 Subject: [PATCH 2/5] fix(audiorouting): Fix C++ support on `pspaudiorouting.h` --- src/kernel/pspaudiorouting.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/kernel/pspaudiorouting.h b/src/kernel/pspaudiorouting.h index 4a45b32ba1..b33e2bc60c 100644 --- a/src/kernel/pspaudiorouting.h +++ b/src/kernel/pspaudiorouting.h @@ -11,6 +11,10 @@ #ifndef __PSPAUDIOROUTING_H__ #define __PSPAUDIOROUTING_H__ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /** * Set routing mode. * @@ -41,5 +45,9 @@ int sceAudioRoutingGetVolumeMode(); */ int sceAudioRoutingSetVolumeMode(int vol_mode); -#endif +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __PSPAUDIOROUTING_H__ */ From 68d378d0958c9683dd0f80794423802a58eb23a2 Mon Sep 17 00:00:00 2001 From: GrayJack Date: Thu, 15 Jan 2026 01:11:36 -0300 Subject: [PATCH 3/5] feat: Add `sceAudioRouting` to user --- src/user/Makefile.am | 8 +++++++- src/user/sceAudioRouting.S | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/user/sceAudioRouting.S diff --git a/src/user/Makefile.am b/src/user/Makefile.am index bac5f39516..29a90fa812 100644 --- a/src/user/Makefile.am +++ b/src/user/Makefile.am @@ -32,6 +32,8 @@ LOADEXEC_OBJS = LoadExecForUser_0000.o LoadExecForUser_0001.o LoadExecForUser_00 IMPOSE_OBJS = sceImpose_0000.o sceImpose_0001.o sceImpose_0002.o sceImpose_0003.o sceImpose_0004.o sceImpose_0005.o sceImpose_0006.o sceImpose_0007.o sceImpose_0008.o sceImpose_0009.o sceImpose_0010.o sceImpose_0011.o sceImpose_0012.o sceImpose_0013.o sceImpose_0014.o sceImpose_0015.o +AUDIOROUTING_OBJS = sceAudioRouting_0000.o sceAudioRouting_0001.o sceAudioRouting_0002.o sceAudioRouting_0003.o + libpspuserincludedir = @PSPSDK_INCLUDEDIR@ libpspuserinclude_HEADERS = \ pspiofilemgr.h \ @@ -81,7 +83,8 @@ $(THREADMAN_OBJS) \ $(UTILS_OBJS) \ $(INTERRUPT_OBJS) \ $(LOADEXEC_OBJS) \ -$(IMPOSE_OBJS) +$(IMPOSE_OBJS) \ +$(AUDIOROUTING_OBJS) $(IO_OBJS): IoFileMgrForUser.S $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ @@ -115,3 +118,6 @@ $(LOADEXEC_OBJS): LoadExecForUser.S $(IMPOSE_OBJS): sceImpose.S $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ + +$(AUDIOROUTING_OBJS): sceAudioRouting.S + $(AM_V_CPPAS)$(CPPASCOMPILE) -DF_$* $< -c -o $@ diff --git a/src/user/sceAudioRouting.S b/src/user/sceAudioRouting.S new file mode 100644 index 0000000000..d218b2177e --- /dev/null +++ b/src/user/sceAudioRouting.S @@ -0,0 +1,19 @@ + .set noreorder + +#include "pspimport.s" + +#ifdef F_sceAudioRouting_0000 + IMPORT_START "sceAudioRouting",0x40010000 +#endif +#ifdef F_sceAudioRouting_0001 + IMPORT_FUNC "sceAudioRouting",0x28235C56,sceAudioRoutingGetVolumeMode +#endif +#ifdef F_sceAudioRouting_0002 + IMPORT_FUNC "sceAudioRouting",0x36FD8AA9,sceAudioRoutingSetMode +#endif +#ifdef F_sceAudioRouting_0003 + IMPORT_FUNC "sceAudioRouting",0x39240E7D,sceAudioRoutingGetMode +#endif +#ifdef F_sceAudioRouting_0004 + IMPORT_FUNC "sceAudioRouting",0xBB548475,sceAudioRoutingSetVolumeMode +#endif From 9d556d5d78c7c54337e30fbc7d280612fead9730 Mon Sep 17 00:00:00 2001 From: GrayJack Date: Thu, 15 Jan 2026 01:16:13 -0300 Subject: [PATCH 4/5] refactor: Move the header for `sceAudioRouting{_driver}` to user folder To follow what is done to other modules when the functions exists on both user-land and kernel-lang --- src/kernel/Makefile.am | 3 +-- src/user/Makefile.am | 1 + src/{kernel => user}/pspaudiorouting.h | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/{kernel => user}/pspaudiorouting.h (100%) diff --git a/src/kernel/Makefile.am b/src/kernel/Makefile.am index 6948ea3af1..8cb87c3c13 100644 --- a/src/kernel/Makefile.am +++ b/src/kernel/Makefile.am @@ -72,8 +72,7 @@ libpspkernelinclude_HEADERS = \ pspexception.h \ pspsysclib.h \ pspimpose_driver.h \ - pspinit.h \ - pspaudiorouting.h + pspinit.h lib_LIBRARIES = libpspkernel.a diff --git a/src/user/Makefile.am b/src/user/Makefile.am index 29a90fa812..3d6b07bd98 100644 --- a/src/user/Makefile.am +++ b/src/user/Makefile.am @@ -36,6 +36,7 @@ AUDIOROUTING_OBJS = sceAudioRouting_0000.o sceAudioRouting_0001.o sceAudioRoutin libpspuserincludedir = @PSPSDK_INCLUDEDIR@ libpspuserinclude_HEADERS = \ + pspaudiorouting.h \ pspiofilemgr.h \ pspiofilemgr_devctl.h \ pspiofilemgr_dirent.h \ diff --git a/src/kernel/pspaudiorouting.h b/src/user/pspaudiorouting.h similarity index 100% rename from src/kernel/pspaudiorouting.h rename to src/user/pspaudiorouting.h From 214fa8c55f06b417c2e8798e1070c73543198121 Mon Sep 17 00:00:00 2001 From: GrayJack Date: Thu, 15 Jan 2026 01:45:03 -0300 Subject: [PATCH 5/5] fix: Fix audiorouting header --- src/user/pspaudiorouting.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/user/pspaudiorouting.h b/src/user/pspaudiorouting.h index b33e2bc60c..2297e6e644 100644 --- a/src/user/pspaudiorouting.h +++ b/src/user/pspaudiorouting.h @@ -29,13 +29,13 @@ int sceAudioRoutingSetMode( int mode ); * * @return the current routing mode. */ -int sceAudioRoutingGetMode(); +int sceAudioRoutingGetMode(void); /** Get the current routing volume mode. * * @return The current routing volume mode. */ -int sceAudioRoutingGetVolumeMode(); +int sceAudioRoutingGetVolumeMode(void); /** Set the routing volume mode. *