summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReiko Asakura2020-03-18 14:07:57 -0400
committerReiko Asakura2020-03-18 14:07:57 -0400
commit5b0857147aec560139cf9a08b463aa11fcdcc1b6 (patch)
treeea10abdb280bf21b0c2a777d990465ec48c26384
parentInitialise inject and hook variables (diff)
downloadmusicpremium-5b0857147aec560139cf9a08b463aa11fcdcc1b6.tar.gz
Build with DolceSDK
-rw-r--r--CMakeLists.txt10
-rw-r--r--musicpremium.c18
2 files changed, 12 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7789b15..1c2680e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,15 +7,15 @@
cmake_minimum_required(VERSION 3.0)
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
- if(DEFINED ENV{VITASDK})
- set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
+ if(DEFINED ENV{DOLCESDK})
+ set(CMAKE_TOOLCHAIN_FILE "$ENV{DOLCESDK}/share/dolce.toolchain.cmake" CACHE PATH "toolchain file")
else()
- message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
+ message(FATAL_ERROR "Please define DOLCESDK to point to your SDK path!")
endif()
endif()
project(music_premium LANGUAGES C)
-include("$ENV{VITASDK}/share/vita.cmake" REQUIRED)
+include("$ENV{DOLCESDK}/share/dolce.cmake" REQUIRED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdlib -Wall -Wextra -O3 -std=c99")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostdlib")
@@ -34,7 +34,7 @@ target_link_libraries("${ELF}"
taihenModuleUtils_stub
)
-vita_create_self("${SELF}"
+dolce_create_self("${SELF}"
"${ELF}"
CONFIG exports.yml
UNSAFE
diff --git a/musicpremium.c b/musicpremium.c
index 3159ffe..552de96 100644
--- a/musicpremium.c
+++ b/musicpremium.c
@@ -5,17 +5,13 @@
*/
#include <string.h>
+#include <psp2kern/audioout.h>
#include <psp2kern/kernel/modulemgr.h>
+#include <psp2kern/kernel/processmgr.h>
#include <psp2kern/kernel/sysmem.h>
#include <psp2kern/sblacmgr.h>
#include <taihen.h>
-#define PROCESS_ID_SELF 0
-#define PORT_TYPE_BGM 1
-#define PORT_TYPE_VOICE 2
-
-extern int ksceSblACMgrIsPspEmu(SceUID pid);
-
#define GLZ(x) do {\
if ((x) < 0) { goto fail; }\
} while (0)
@@ -114,13 +110,13 @@ static int get_addr(void **inject_addr, void **hook_addr) {
static int sceAudioOutOpenPort_hook(int portType, int len, int freq, int param) {
int port;
- if (portType == PORT_TYPE_BGM && ksceSblACMgrIsPspEmu(PROCESS_ID_SELF)) {
+ if (portType == SCE_AUDIO_OUT_PORT_TYPE_BGM && ksceSblACMgrIsPspEmu(SCE_KERNEL_PROCESS_ID_SELF)) {
tai_module_info_t minfo;
minfo.size = sizeof(minfo);
// redirect to voice port if not Adrenaline
- if (GET_MODULE(PROCESS_ID_SELF, "AdrenalineUser", &minfo) < 0) {
- port = TAI_CONTINUE(int, hook_ref[0], PORT_TYPE_VOICE, len, freq, param);
+ if (GET_MODULE(SCE_KERNEL_PROCESS_ID_SELF, "AdrenalineUser", &minfo) < 0) {
+ port = TAI_CONTINUE(int, hook_ref[0], SCE_AUDIO_OUT_PORT_TYPE_VOICE, len, freq, param);
goto done;
}
}
@@ -134,9 +130,9 @@ done:
static int sceAppMgrAcquireBgmPort_impl_hook(void) {
int ret;
- if (ksceSblACMgrIsShell(PROCESS_ID_SELF)) {
+ if (ksceSblACMgrIsShell(SCE_KERNEL_PROCESS_ID_SELF)) {
char tid[0x20];
- ksceKernelGetProcessTitleId(PROCESS_ID_SELF, tid, sizeof(tid));
+ ksceKernelGetProcessTitleId(SCE_KERNEL_PROCESS_ID_SELF, tid, sizeof(tid));
if (STREQ(tid, "VITASHELL") || STREQ(tid, "ELEVENMPV")) {
ret = TAI_CONTINUE(int, hook_ref[1]);