Files
d2r-mobile/dm/ios/tests/fixtures/native_binding/README.zh-CN.md
T
shenleiandClaude Opus 5.5 4d91f80bae Android port (Adreno): Vulkan backend, GameActivity app, touch HUD, lifecycle, minimap quest goals
- host/android: Vulkan replay backend (nvn_vk.c) with pipeline/descriptor caching, ADPF,
  AChoreographer present link; Linux compat layer; Makefile.android (headless dmhost + APK lib)
- android/app: GameActivity shell without Gradle (build_apk.sh), AAudio output, touch HUD port
  (touch_app.c + TouchOverlay.java, three layers: body / joystick / minimap goals),
  lifecycle save-on-background like iOS, art_from_ipa.py for touch / HUD / mapgoal art
- touch: shared touch controls moved from ios/Sources to dm/touch
- patch_nso.py Android ruleset, dmsh_vk.py shader pack, DM_TOUCH_PRODUCT defaults
- hle_audio: AAudio resume waits through STARTING and reopens once on failure
- .gitignore: local resources/ (original game data) never committed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 14:55:05 +09:00

46 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# native_binding — 技能绑定解析的测试夹具
English: [README.md](README.md)
只给单元测试用。App 运行时不读这两个文件,测试也不会改它们。
**公开仓库不带这两份夹具**:它们是从运行中的游戏内存抓下来的两张表。缺了它们,下面三个要读夹具的测试自动跳过并打印一行说明,其余测试照常。要跑这三个测试,得自己从运行中的游戏抓这两张表,照下面的文件名放到本目录;测试里的断言是按下面这份快照的内容写的,内容不同就要相应改断言。
## 背景
右侧技能钮上要显示「这个键现在绑着哪个技能」。这份信息在运行中的游戏内存里是两张表,外壳只读地取出来再解析(`../../../../touch/dm_touch_game_bridge.c` 负责取,`../../../../touch/dm_touch_game_state.c` 的 `dm_tg_parse` 负责解析):
- **键位表**:六个手柄键(B、A、Y、X、R、ZR)各对应哪个普通技能槽、哪个替代技能槽。替代槽是按住 ZL 时用的那一套。
- **绑定表**:每个技能槽里绑着的技能编号,空槽是 `0xFFFFFFFF`。
## 文件
| 文件 | 大小 | 内容 |
|---|---|---|
| `mapping.bin` | 114 字节 | 键位表的一份快照。解析只用前 72 字节:6 项,每项 3 个 32 位小端整数(逻辑键、普通槽、替代槽) |
| `bindings.bin` | 896 字节 | 绑定表的一份快照:32 项,每项 28 字节,每项开头的 32 位小端整数是技能编号 |
这份快照里的内容,测试里的断言按它写:
- 键位:B → 普通槽 1 / 替代槽 7,A → 0 / 6,Y → 2 / 8,X → 3 / 9,R → 4 / 10,ZR → 5 / 11。
- 绑定:第一组的 0、2、7 号槽有技能,其余为空;从第 16 项起的第二组全空。7 号槽是回城技能,所以解析结果里回城的按法是 ZL + B。
校验值(SHA-256):
```
b9777515f225f235ac1223dd04bf15db250f1240f893511737ceecf357367362 mapping.bin
4d4f4cde5d08f35f9a988ac61aff54913499d32322ac95fa3ce7763c16a11262 bindings.bin
```
## 谁在用
`dm/ios/tests/Makefile` 的 `test` 目标把这两个文件作为参数传给三个测试(文件不在时这三个测试跳过):
| 测试 | 用它验什么 |
|---|---|
| `t_native_binding` | 解析:正常情况读出上面的键位与回城按法;长度不够、槽号越界、键位重复、观察到的技能编号对不上时一律拒绝 |
| `t_game_bridge` | 把两张表放进一块模拟的游戏内存,验从内存读取到产出快照的整条通路:读取不改寄存器、不改表;不在局内时不出快照 |
| `t_native_hud_bridge` | 同上,另验要先确认调用来自当前这一局的 HUD 才出快照,换了一局要重新确认 |
运行:`make -C dm/ios/tests test`。