forked from MeloNX/MeloNX
fix adreno hooking
This commit is contained in:
parent
a0c9d3b7de
commit
f8c1e745ca
@ -23,6 +23,7 @@
|
|||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
android:appCategory="game"
|
android:appCategory="game"
|
||||||
android:theme="@style/Theme.RyujinxAndroid"
|
android:theme="@style/Theme.RyujinxAndroid"
|
||||||
|
android:extractNativeLibs="true"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
@ -194,20 +194,12 @@ void onFrameEnd(double time) {
|
|||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT jlong JNICALL
|
JNIEXPORT jlong JNICALL
|
||||||
Java_org_ryujinx_android_NativeHelpers_loadDriver(JNIEnv *env, jobject thiz,
|
Java_org_ryujinx_android_NativeHelpers_loadDriver(JNIEnv *env, jobject thiz,
|
||||||
jstring driver_path,
|
|
||||||
jstring native_lib_path,
|
jstring native_lib_path,
|
||||||
jstring private_apps_path,
|
jstring private_apps_path,
|
||||||
jstring public_apps_path,
|
|
||||||
jstring driver_name) {
|
jstring driver_name) {
|
||||||
auto driverPath = getStringPointer(env, driver_path);
|
|
||||||
auto libPath = getStringPointer(env, native_lib_path);
|
auto libPath = getStringPointer(env, native_lib_path);
|
||||||
auto privateAppsPath = getStringPointer(env, private_apps_path);
|
auto privateAppsPath = getStringPointer(env, private_apps_path);
|
||||||
auto driverName = getStringPointer(env, driver_name);
|
auto driverName = getStringPointer(env, driver_name);
|
||||||
auto publicPath = getStringPointer(env, public_apps_path);
|
|
||||||
|
|
||||||
std::string redirectPath = publicPath;
|
|
||||||
|
|
||||||
redirectPath += "gpu/vk_file_redirect/";
|
|
||||||
|
|
||||||
auto handle = adrenotools_open_libvulkan(
|
auto handle = adrenotools_open_libvulkan(
|
||||||
RTLD_NOW,
|
RTLD_NOW,
|
||||||
@ -216,15 +208,13 @@ Java_org_ryujinx_android_NativeHelpers_loadDriver(JNIEnv *env, jobject thiz,
|
|||||||
libPath,
|
libPath,
|
||||||
privateAppsPath,
|
privateAppsPath,
|
||||||
driverName,
|
driverName,
|
||||||
nullptr,//redirectPath.c_str(),
|
nullptr,
|
||||||
nullptr
|
nullptr
|
||||||
);
|
);
|
||||||
|
|
||||||
delete driverPath;
|
|
||||||
delete libPath;
|
delete libPath;
|
||||||
delete privateAppsPath;
|
delete privateAppsPath;
|
||||||
delete driverName;
|
delete driverName;
|
||||||
delete publicPath;
|
|
||||||
|
|
||||||
return (jlong)handle;
|
return (jlong)handle;
|
||||||
}
|
}
|
@ -95,9 +95,20 @@ class GameHost(context: Context?, val controller: GameController, val mainViewMo
|
|||||||
if(driverViewModel.selected.isNotEmpty()) {
|
if(driverViewModel.selected.isNotEmpty()) {
|
||||||
var privatePath = mainViewModel.activity.filesDir;
|
var privatePath = mainViewModel.activity.filesDir;
|
||||||
var privateDriverPath = privatePath.absolutePath + "/driver/"
|
var privateDriverPath = privatePath.absolutePath + "/driver/"
|
||||||
|
val pD = File(privateDriverPath)
|
||||||
|
if(pD.exists())
|
||||||
|
pD.deleteRecursively()
|
||||||
|
|
||||||
|
pD.mkdirs()
|
||||||
|
|
||||||
var driver = File(driverViewModel.selected)
|
var driver = File(driverViewModel.selected)
|
||||||
driver.copyTo(File(privateDriverPath + driver.name), true)
|
var parent = driver.parentFile
|
||||||
driverHandle = NativeHelpers().loadDriver(driverViewModel.selected, mainViewModel.activity.applicationInfo.nativeLibraryDir!!, privateDriverPath, mainViewModel.activity.getExternalFilesDir(null)!!.absolutePath, driver.name)
|
for (file in parent.walkTopDown()){
|
||||||
|
if(file.absolutePath == parent.absolutePath)
|
||||||
|
continue
|
||||||
|
file.copyTo(File(privateDriverPath + file.name), true)
|
||||||
|
}
|
||||||
|
driverHandle = NativeHelpers().loadDriver(mainViewModel.activity.applicationInfo.nativeLibraryDir!! + "/", privateDriverPath, driver.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
success = _nativeRyujinx.graphicsInitializeRenderer(
|
success = _nativeRyujinx.graphicsInitializeRenderer(
|
||||||
|
@ -16,5 +16,5 @@ class NativeHelpers {
|
|||||||
external fun attachCurrentThread() : Unit
|
external fun attachCurrentThread() : Unit
|
||||||
external fun detachCurrentThread() : Unit
|
external fun detachCurrentThread() : Unit
|
||||||
|
|
||||||
external fun loadDriver(driverPath:String, nativeLibPath:String, privateAppsPath:String, publicAppsPath:String, driverName:String) : Long
|
external fun loadDriver(nativeLibPath:String, privateAppsPath:String, driverName:String) : Long
|
||||||
}
|
}
|
@ -380,18 +380,23 @@ class SettingViews {
|
|||||||
driverViewModel.selected =
|
driverViewModel.selected =
|
||||||
driver.driverPath
|
driver.driverPath
|
||||||
})
|
})
|
||||||
Column {
|
Column(modifier = Modifier.clickable {
|
||||||
|
selectedDriver.value =
|
||||||
|
ind
|
||||||
|
isChanged.value =
|
||||||
|
true
|
||||||
|
driverViewModel.selected =
|
||||||
|
driver.driverPath
|
||||||
|
}) {
|
||||||
Text(text = driver.libraryName,
|
Text(text = driver.libraryName,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth())
|
||||||
.clickable {
|
Text(text = driver.driverVersion,
|
||||||
selectedDriver.value =
|
modifier = Modifier
|
||||||
ind
|
.fillMaxWidth())
|
||||||
isChanged.value =
|
Text(text = driver.description,
|
||||||
true
|
modifier = Modifier
|
||||||
driverViewModel.selected =
|
.fillMaxWidth())
|
||||||
driver.driverPath
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user