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