-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PCSX2 fastmem depression * Move away from PCSX2 fastmem * Add enum_flag_ops.hpp * Finally building on Windows * Almost got a PoC * Fix arm64 builds * This somehow works * This also works... * Properly fix fastmem * Add free region manager * Update boost * Add ScopeExit * Comment out asserts on Linux/Mac/Android * Comment out ASSERT_MSG asserts too * Fix derp * Attempt to fix Android * Disable fastmem on Android * Fix Android again maybe pt 2 * android pls * AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA * AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA * Update host_memory.cpp * Properly reset memory arena on reset * Proper ashmem code for Android * more * Add temporary Android buildjet script for faster prototype builds * Fix fastmem (again) * Clean up shared memory
- Loading branch information
1 parent
28461a1
commit c088911
Showing
18 changed files
with
2,139 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Android Build (Buildjet) | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
arm64: | ||
runs-on: buildjet-32vcpu-ubuntu-2204 | ||
|
||
strategy: | ||
matrix: | ||
build_type: | ||
- release | ||
|
||
steps: | ||
- name: Set BUILD_TYPE variable | ||
run: echo "BUILD_TYPE=${{ matrix.build_type }}" >> $GITHUB_ENV | ||
|
||
- uses: actions/checkout@v4 | ||
- name: Fetch submodules | ||
run: git submodule update --init --recursive | ||
|
||
- name: Set up gradle caches | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-pandroid-arm64-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-pandroid-arm64- | ||
- name: Setup Vulkan SDK | ||
uses: humbletim/[email protected] | ||
with: | ||
vulkan-query-version: latest | ||
vulkan-use-cache: true | ||
vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Tools, Glslang | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '17' | ||
|
||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/build -DBUILD_HYDRA_CORE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -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 RelWithDebInfo | ||
# Strip the generated library and move it to the appropriate location | ||
${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded ./build/libAlber.so | ||
mv ./build/libAlber.so ./src/pandroid/app/src/main/jniLibs/arm64-v8a/ | ||
# Build the Android app with Gradle | ||
cd src/pandroid | ||
./gradlew assembleDebug | ||
ls -R app/build/outputs | ||
cd ../.. | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Android APKs (arm64) | ||
path: | | ||
./src/pandroid/app/build/outputs/apk/${{ env.BUILD_TYPE }}/app-${{ env.BUILD_TYPE }}.apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// SPDX-FileCopyrightText: 2019 Dolphin Emulator Project | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
namespace Common { | ||
/** | ||
* Provides a platform-independent interface for loading a dynamic library and retrieving symbols. | ||
* The interface maintains an internal reference count to allow one handle to be shared between | ||
* multiple users. | ||
*/ | ||
class DynamicLibrary final { | ||
public: | ||
/// Default constructor, does not load a library. | ||
explicit DynamicLibrary(); | ||
|
||
/// Automatically loads the specified library. Call IsOpen() to check validity before use. | ||
explicit DynamicLibrary(const char* filename); | ||
|
||
/// Initializes the dynamic library with an already opened handle. | ||
explicit DynamicLibrary(void* handle_); | ||
|
||
/// Moves the library. | ||
DynamicLibrary(DynamicLibrary&&) noexcept; | ||
DynamicLibrary& operator=(DynamicLibrary&&) noexcept; | ||
|
||
/// Delete copies, we can't copy a dynamic library. | ||
DynamicLibrary(const DynamicLibrary&) = delete; | ||
DynamicLibrary& operator=(const DynamicLibrary&) = delete; | ||
|
||
/// Closes the library. | ||
~DynamicLibrary(); | ||
|
||
/// Returns the specified library name with the platform-specific suffix added. | ||
[[nodiscard]] static std::string getUnprefixedFilename(const char* filename); | ||
|
||
/// Returns the specified library name in platform-specific format. | ||
/// Major/minor versions will not be included if set to -1. | ||
/// If libname already contains the "lib" prefix, it will not be added again. | ||
/// Windows: LIBNAME-MAJOR-MINOR.dll | ||
/// Linux: libLIBNAME.so.MAJOR.MINOR | ||
/// Mac: libLIBNAME.MAJOR.MINOR.dylib | ||
[[nodiscard]] static std::string getVersionedFilename(const char* libname, int major = -1, int minor = -1); | ||
|
||
/// Returns true if a module is loaded, otherwise false. | ||
[[nodiscard]] bool isOpen() const { return handle != nullptr; } | ||
|
||
/// Loads (or replaces) the handle with the specified library file name. | ||
/// Returns true if the library was loaded and can be used. | ||
[[nodiscard]] bool open(const char* filename); | ||
|
||
/// Unloads the library, any function pointers from this library are no longer valid. | ||
void close(); | ||
|
||
/// Returns the address of the specified symbol (function or variable) as an untyped pointer. | ||
/// If the specified symbol does not exist in this library, nullptr is returned. | ||
[[nodiscard]] void* getSymbolAddress(const char* name) const; | ||
|
||
/// Obtains the address of the specified symbol, automatically casting to the correct type. | ||
/// Returns true if the symbol was found and assigned, otherwise false. | ||
template <typename T> | ||
[[nodiscard]] bool getSymbol(const char* name, T* ptr) const { | ||
*ptr = reinterpret_cast<T>(getSymbolAddress(name)); | ||
return *ptr != nullptr; | ||
} | ||
|
||
private: | ||
/// Platform-dependent data type representing a dynamic library handle. | ||
void* handle = nullptr; | ||
}; | ||
} // namespace Common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include <type_traits> | ||
|
||
#define DECLARE_ENUM_FLAG_OPERATORS(type) \ | ||
[[nodiscard]] constexpr type operator|(type a, type b) noexcept { \ | ||
using T = std::underlying_type_t<type>; \ | ||
return static_cast<type>(static_cast<T>(a) | static_cast<T>(b)); \ | ||
} \ | ||
[[nodiscard]] constexpr type operator&(type a, type b) noexcept { \ | ||
using T = std::underlying_type_t<type>; \ | ||
return static_cast<type>(static_cast<T>(a) & static_cast<T>(b)); \ | ||
} \ | ||
[[nodiscard]] constexpr type operator^(type a, type b) noexcept { \ | ||
using T = std::underlying_type_t<type>; \ | ||
return static_cast<type>(static_cast<T>(a) ^ static_cast<T>(b)); \ | ||
} \ | ||
[[nodiscard]] constexpr type operator<<(type a, type b) noexcept { \ | ||
using T = std::underlying_type_t<type>; \ | ||
return static_cast<type>(static_cast<T>(a) << static_cast<T>(b)); \ | ||
} \ | ||
[[nodiscard]] constexpr type operator>>(type a, type b) noexcept { \ | ||
using T = std::underlying_type_t<type>; \ | ||
return static_cast<type>(static_cast<T>(a) >> static_cast<T>(b)); \ | ||
} \ | ||
constexpr type& operator|=(type& a, type b) noexcept { \ | ||
a = a | b; \ | ||
return a; \ | ||
} \ | ||
constexpr type& operator&=(type& a, type b) noexcept { \ | ||
a = a & b; \ | ||
return a; \ | ||
} \ | ||
constexpr type& operator^=(type& a, type b) noexcept { \ | ||
a = a ^ b; \ | ||
return a; \ | ||
} \ | ||
constexpr type& operator<<=(type& a, type b) noexcept { \ | ||
a = a << b; \ | ||
return a; \ | ||
} \ | ||
constexpr type& operator>>=(type& a, type b) noexcept { \ | ||
a = a >> b; \ | ||
return a; \ | ||
} \ | ||
[[nodiscard]] constexpr type operator~(type key) noexcept { \ | ||
using T = std::underlying_type_t<type>; \ | ||
return static_cast<type>(~static_cast<T>(key)); \ | ||
} \ | ||
[[nodiscard]] constexpr bool True(type key) noexcept { \ | ||
using T = std::underlying_type_t<type>; \ | ||
return static_cast<T>(key) != 0; \ | ||
} \ | ||
[[nodiscard]] constexpr bool False(type key) noexcept { \ | ||
using T = std::underlying_type_t<type>; \ | ||
return static_cast<T>(key) == 0; \ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.