From d5f388cf2ffc802915d221d7f10a118adb71ad3a Mon Sep 17 00:00:00 2001 From: olebeck <31539311+olebeck@users.noreply.github.com> Date: Sun, 22 Jun 2025 03:27:22 +0200 Subject: [PATCH] use custom pvr apphint --- CMakeLists.txt | 5 +++++ ISLE/isleapp.cpp | 31 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 802e75c5..6f25d942 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -520,6 +520,11 @@ if (ISLE_BUILD_APP) if (WIN32) target_link_libraries(isle PRIVATE winmm) endif() + + if(VITA) + target_link_libraries(isle PRIVATE GLESv2) + endif() + # Link LEGO1 target_link_libraries(isle PRIVATE lego1) if(ISLE_DEBUG) diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index 6c4c8e2f..5203dcae 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -50,6 +50,13 @@ #include "emscripten/messagebox.h" #endif +#ifdef __vita__ +extern "C"{ +#include +} +#include +#endif + DECOMP_SIZE_ASSERT(IsleApp, 0x8c) // GLOBAL: ISLE 0x410030 @@ -261,6 +268,29 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char** argv) SDL_SetHint(SDL_HINT_MOUSE_TOUCH_EVENTS, "0"); SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0"); +#ifdef __vita__ + SDL_setenv_unsafe("VITA_PVR_SKIP_INIT", "enable", 1); + PVRSRV_PSP2_APPHINT hint; + + sceKernelLoadStartModule("vs0:sys/external/libfios2.suprx", 0, NULL, 0, NULL, NULL); + sceKernelLoadStartModule("vs0:sys/external/libc.suprx", 0, NULL, 0, NULL, NULL); + sceKernelLoadStartModule("app0:/module/libgpu_es4_ext.suprx", 0, NULL, 0, NULL, NULL); + sceKernelLoadStartModule("app0:/module/libIMGEGL.suprx", 0, NULL, 0, NULL, NULL); + PVRSRVInitializeAppHint(&hint); + + #if DO_HARDWARE_TRANSFERS == 0 + hint.bDisableHWTextureUpload = 1; + hint.bDisableHWTQBufferBlit = 1; + hint.bDisableHWTQMipGen = 1; + hint.bDisableHWTQNormalBlit = 1; + hint.bDisableHWTQTextureUpload = 1; + #endif + + #define GPU_MEM_SIZE 16777216 + hint.ui32DriverMemorySize = GPU_MEM_SIZE; + PVRSRVCreateVirtualAppHint(&hint); +#endif + if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK)) { char buffer[256]; SDL_snprintf( @@ -671,6 +701,7 @@ MxResult IsleApp::SetupWindow() SDL_DestroyProperties(props); if (!m_windowHandle) { + SDL_Log("failed to create window: %s", SDL_GetError()); return FAILURE; }