diff --git a/.github/workflows/Hydra_Build.yml b/.github/workflows/Hydra_Build.yml index dbdfbf1b..66cd2e27 100644 --- a/.github/workflows/Hydra_Build.yml +++ b/.github/workflows/Hydra_Build.yml @@ -213,3 +213,32 @@ jobs: path: | ${{github.workspace}}/build/panda3ds_libretro.so ${{github.workspace}}/docs/libretro/panda3ds_libretro.info + + ARM-Libretro-Android: + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v4 + - name: Fetch submodules + run: git submodule update --init --recursive + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DBUILD_LIBRETRO_CORE=1 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DENABLE_VULKAN=0 -DENABLE_USER_BUILD=ON -DCMAKE_CXX_FLAGS="-march=armv8-a+crypto" + + - name: Build + run: | + # Apply patch for GLES compatibility + git apply ./.github/gles.patch + # Build the project with CMake + cmake --build ${{github.workspace}}/build --config ${{ env.BUILD_TYPE }} + + # Strip the generated library + ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded ./build/panda3ds_libretro.so + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: Android arm64 Libretro core + path: | + ${{github.workspace}}/build/panda3ds_libretro.so + ${{github.workspace}}/docs/libretro/panda3ds_libretro.info diff --git a/src/jni_driver.cpp b/src/jni_driver.cpp index 6a156360..7274c9c4 100644 --- a/src/jni_driver.cpp +++ b/src/jni_driver.cpp @@ -10,11 +10,11 @@ #include "android_utils.hpp" #include "sdl_sensors.hpp" -std::unique_ptr emulator = nullptr; -HIDService* hidService = nullptr; -RendererGL* renderer = nullptr; -bool romLoaded = false; -JavaVM* jvm = nullptr; +static std::unique_ptr emulator = nullptr; +static HIDService* hidService = nullptr; +static RendererGL* renderer = nullptr; +static bool romLoaded = false; +static JavaVM* jvm = nullptr; jclass alberClass; jmethodID alberClassOpenDocument; diff --git a/src/libretro_core.cpp b/src/libretro_core.cpp index aca8330d..b44687b2 100644 --- a/src/libretro_core.cpp +++ b/src/libretro_core.cpp @@ -19,8 +19,8 @@ static std::filesystem::path savePath; static bool screenTouched = false; static bool usingGLES = false; -std::unique_ptr emulator; -RendererGL* renderer; +static std::unique_ptr emulator; +static RendererGL* renderer; std::filesystem::path Emulator::getConfigPath() { return std::filesystem::path(savePath / "config.toml"); } std::filesystem::path Emulator::getAppDataRoot() { return std::filesystem::path(savePath / "Emulator Files"); }