/* * Deltarune Vita native-GXM bring-up probe. * * This executable intentionally contains no vitaGL calls. nanovg-gxm is * used only as a small zlib-licensed sceGxm command/allocator layer while the * Butterscotch Renderer backend is implemented incrementally. Its embedded * GXP programs also make this probe independent from libshacccg. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "nanovg.h" #include "bs_bootstrap_probe.h" #include "bs_renderer_contract.h" #include "image_decoder.h" #include "runner.h" #include "runner_mouse.h" #include "vita_background_work.h" #include "vita_room_prefetch.h" #include "native_mic.h" #include "audio/openal/al_audio_system.h" #ifdef NATIVE_GXM_VIDEO #include "native_video_gxm.h" #endif /* Used only by Butterscotch's Vita OpenAL stream policy and diagnostics. */ int g_vitaActiveChapter = 0; int g_vitaProbeLoggingEnabled = 1; int g_nativeStretchFill = 0; int g_nativeBorderMode = 1; int g_nativeBetterBorders = 0; /* Observed by GXM application surface compositor each frame. * Native UI is kept unwarped, and movies skip geometry distortion. */ int g_nativeCrtTubeEnabled = 0; NVGcontext* g_nativeSettingsVG = NULL; int g_nativeGxpAvailable = 0; /* Same main-thread stack as the VitaGL executable (playable_main.c): the VM * runs every GML call recursively on this thread. The C heap stays at the * SDK's 128 MiB default. Unlike VitaGL, GXM textures and surfaces come from * the user memory left outside the heap; 256 MiB left 9 MiB free in the * Chapter 5 final battle. The parser only bulk-reads chunks when malloc * succeeds and streams otherwise. */ unsigned int sceUserMainThreadStackSize = 4 * 1024 * 1024; int _newlib_heap_size_user = 128 * 1024 * 1024; /* Newer SDK headers removed this legacy diagnostic-only result code while the * pinned nanovg-gxm strerror table still names it. It is never generated by * this probe; retain a unique value solely to compile that table. */ #ifndef SCE_GXM_ERROR_INVALID_AUXILIARY_SURFACE #define SCE_GXM_ERROR_INVALID_AUXILIARY_SURFACE ((int)0x805B10FF) #endif #define NANOVG_GXM_IMPLEMENTATION #define NANOVG_GXM_UTILS_IMPLEMENTATION #include "nanovg_gxm_native.h" #include "rgba4444_native.h" #ifndef NATIVE_GXM_PROBE_VERSION #define NATIVE_GXM_PROBE_VERSION "v0.78-gxm-dev" #endif static void log_line(const char *line) { sceIoMkdir("ux0:data/deltarune", 0777); sceIoMkdir("ux0:data/deltarune/deltarunevita", 0777); SceUID fd = sceIoOpen("ux0:data/deltarune/deltarunevita/native-gxm-probe.log", SCE_O_WRONLY | SCE_O_CREAT | SCE_O_APPEND, 0666); if (fd >= 0) { sceIoWrite(fd, line, strlen(line)); sceIoWrite(fd, "\n", 1); sceIoClose(fd); } } /* Debug DEV capture: while DEV logging is enabled, everything appended to * native-gxm-probe.log is copied into devlogs/chapter N/__