Feature/random fixes platform support (#179)

* feat: implement memory card IOP

* feat: IOP trace

* feat: move IOP logic to ps2xIOP
refactor: small refactor on audio api on runtime

* feat: android support
feat: prevent race on GS
feat: a bit cleanup and reimplement on memory card

* feat: finish guest thread
feat: android build support
feat: vita build support with suspicious setup scripts

* feat: remove idea from track
This commit is contained in:
Ranieri
2026-07-22 02:37:53 -03:00
committed by GitHub
parent 1176609890
commit f3687c5ae6
40 changed files with 1133 additions and 146 deletions
+36
View File
@@ -0,0 +1,36 @@
# Android runner
## Requirements
- Android Studio (recommended) or a local Gradle 8.7+ / JDK 17 install
- Android SDK 34 + NDK (installed automatically by Android Studio on first sync)
- CMake 3.22.1 from the SDK (Android Studio installs it on demand)
## Building
Option A — Android Studio: open the `android/` folder and run the `app` configuration.
Option B — command line (no wrapper is committed; generate it once):
```sh
cd android
gradle wrapper --gradle-version 8.9
./gradlew assembleRelease
```
APK output: `android/app/build/outputs/apk/release/app-release.apk`.
## Running a game
Since there is no argv on Android, the guest ELF path comes from
`PS2X_DEFAULT_BOOT_ELF`, set via the `ps2xBootElf` Gradle property
(`android/gradle.properties`, or `-Pps2xBootElf=...` on the command line).
```sh
adb install app/build/outputs/apk/release/app-release.apk
adb shell mkdir -p /storage/emulated/0/Android/data/com.ps2x.runner/files
adb push "path/to/game/." /storage/emulated/0/Android/data/com.ps2x.runner/files/
```
Logs: raylib output goes to logcat (`adb logcat -s raylib`); runtime `std::cout`/`cerr`
output is not redirected to logcat yet.
+59
View File
@@ -0,0 +1,59 @@
plugins {
id 'com.android.application'
}
// Override with: gradlew assembleRelease -Pps2xBootElf=/absolute/path/on/device.elf
def ps2xBootElf = project.findProperty('ps2xBootElf') ?: '/storage/emulated/0/Android/data/com.ps2x.runner/files/game.elf'
android {
namespace 'com.ps2x.runner'
compileSdk 34
ndkVersion '28.2.13676358'
defaultConfig {
applicationId 'com.ps2x.runner'
minSdk 28
targetSdk 34
versionCode 1
versionName '0.1.0'
externalNativeBuild {
cmake {
arguments '-DPS2X_BUILD_RECOMP=OFF',
'-DPS2X_BUILD_ANALYZER=OFF',
'-DPS2X_BUILD_TEST=OFF',
'-DPS2X_BUILD_STUDIO=OFF',
'-DPS2X_ENABLE_SCCACHE=OFF',
'-DPS2X_RUNNER_UNITY_BUILD_BATCH_SIZE=32',
'-DANDROID_CPP_FEATURES=rtti exceptions',
"-DPS2X_DEFAULT_BOOT_ELF=${ps2xBootElf}"
targets 'ps2EntryRunner'
}
}
ndk {
abiFilters 'arm64-v8a', 'x86_64'
}
}
externalNativeBuild {
cmake {
path '../../CMakeLists.txt'
version '3.22.1'
}
}
buildTypes {
debug {
externalNativeBuild {
cmake {
arguments '-DCMAKE_BUILD_TYPE=RelWithDebInfo'
}
}
}
release {
minifyEnabled false
signingConfig signingConfigs.debug
}
}
}
+27
View File
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="PS2 Recomp"
android:hasCode="false"
android:isGame="true">
<activity
android:name="android.app.NativeActivity"
android:configChanges="orientation|screenSize|screenLayout|keyboard|keyboardHidden|navigation"
android:screenOrientation="landscape"
android:exported="true">
<!-- Runner shared library built by ps2xRuntime/CMakeLists.txt -->
<meta-data
android:name="android.app.lib_name"
android:value="ps2EntryRunner" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
+3
View File
@@ -0,0 +1,3 @@
plugins {
id 'com.android.application' version '8.6.1' apply false
}
+4
View File
@@ -0,0 +1,4 @@
org.gradle.jvmargs=-Xmx4g
android.useAndroidX=true
# ps2xBootElf=/storage/emulated/0/Android/data/com.ps2x.runner/files/SLUS_201.84
+7
View File
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+17
View File
@@ -0,0 +1,17 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}
rootProject.name = 'PS2Recomp'
include ':app'