Repository navigation
星铁显示模式预设为 Vulkan:新装后首次启动不再闪退 - #182
Merged
Merged
Conversation
新装的崩坏:星穹铁道第一次启动自己选 OpenGL ES(files/vulkancaps.bin 写成 03),gfxstream 的 GLES 缺它要的功能,十几秒后闪退;换成 Vulkan 正常。实测首次启动前在 Android/data/<包名>/files 放好 customvulkancaps.bin 和 vulkancaps.bin(都是 0x01),游戏就走 Vulkan、两个文件保持 01;只放 vulkancaps.bin 会被游戏改回 03,只放 customvulkancaps.bin 仍走 GLES。 新客体脚本 modavd-vkmode.sh,照下载盘守护的做法:开机先过一遍,再后台每 3 秒看一遍,开机后才装的游戏在首次启动前也能处理到。名单 com.miHoYo.hkrpg、com.miHoYo.hkrpg.bilibili(B 服没实测)。对每个已安装、不在运行、files/customvulkancaps.bin 不存在的包:缺的目录按系统的建法补上(应用 uid、ext_data_rw、2770,标签取 Android/data 的),两个文件先写成临时名、设好属主和 660 再改名到位,customvulkancaps.bin 最后放,中途失败下一轮补;建出来属主设不上的目录当场删掉。customvulkancaps.bin 已在(游戏里选过,或者我们写过)就不动。 另起脚本而不是加进下载盘守护:下载盘有 MODAVD_DL_DISK=off 的关法、带锁和挂载逻辑,两件事分开互不影响。开机后设置加一步 12b,日志写「游戏显示模式预设」一行;和下载盘一样只在 Windows 上做、默认开。 Refs ModAVD/ModAVD#222
两个文件都改名到位后跑一次 sync(只在真的写了的那一轮);判断「已选过」从 customvulkancaps.bin 存在改成存在且非空,硬杀留下的 0 字节残骸会被重写成 01。每次真的写了文件都记一行 logcat,备注已是 set to Vulkan 时(文件被改坏后补写)也记。 status 对已安装的包带上两个文件的当前值([custom=01 caps=01],不存在写 -,空文件写 empty),管理器开机日志那一行跟着带上。 单测:空 custom(caps 在 / 不在)重写;vulkancaps.bin 改名失败时不写 customvulkancaps.bin、下一轮补齐(钉住写入顺序);补写也有日志;sync 只在写成的那一轮跑。README 中英对齐:闪退时间统一为十几秒 / about fifteen seconds,游戏设置项不用自起的中文叫法。 Refs ModAVD/ModAVD#222
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
新装的《崩坏:星穹铁道》在 ModAVD(Windows)上启动十几秒后闪退:游戏第一次启动时自己选了 OpenGL ES 显示模式,而模拟器的 GLES 缺它要的功能;换成 Vulkan 模式就正常。这个 PR 让管理器在游戏启动前把显示模式预先设成 Vulkan。
做了什么
modavd-vkmode.sh,做法照下载盘的守护:开机后先过一遍,再在后台每 3 秒看一遍。com.miHoYo.hkrpg、B 服com.miHoYo.hkrpg.bilibili):files/customvulkancaps.bin已经在、不是空文件:不动。游戏设置里切显示模式时会写这个文件,所以它在就说明选过了,不覆盖用户的选择。vulkancaps.bin=03):建好Android/data/<包名>/files(属主是应用、属组ext_data_rw、权限 2770),把vulkancaps.bin、customvulkancaps.bin都写成 1 字节01,然后 sync。customvulkancaps.bin最后放:中途被打断时它还不在,下一轮会补齐。空的customvulkancaps.bin当作没选过(硬杀可能留下 0 字节文件)。游戏显示模式预设: 守护已起(pid …);com.miHoYo.hkrpg(已预设为 Vulkan,custom=01 caps=01);脚本的status也带两个文件当前的值。为什么是这两个文件
实测(新装的 4.7.0,游戏启动前预先放文件):
0101vulkancaps.bin=03vulkancaps.bin03customvulkancaps.bin测试
go vet ./...、go test ./...通过。vulkancaps.bin=03):2 秒内两个文件都变成01,再启动正常。customvulkancaps.bin:2 秒内重写。00(当作用户选过):15 秒后没动。已知的限制
Refs ModAVD/ModAVD#222