Android: move the shell to dm/android and the Vulkan backend to dm/gfx/vulkan

Mirror the iOS layout instead of nesting Android inside dm/host:
- dm/android/app       GameActivity app (manifest, java, res, build_apk.sh)
- dm/android/Sources   front_app.c, touch_app.c, front_headless.c
- dm/android/Makefile  entry point (apk / lib / install / headless / tests);
                       rules in build.mk (was dm/host/Makefile.android),
                       run with dm/host as cwd; outputs in dm/android/build/
- dm/android/tests     t_vk_perf
- dm/gfx/vulkan        nvn_vk.c and friends, next to the Metal backend

Only include paths, build paths and docs change; no code changes.
The Mac / iOS source lists do not pick up gfx/vulkan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-14 16:59:36 +09:00
co-authored by Claude Opus 5.5
parent 3429c6c0a4
commit 3c25cd89fc
26 changed files with 135 additions and 72 deletions
+8 -1
View File
@@ -75,6 +75,10 @@ English: [README.md](README.md)
App 把 `host/` 与 `gfx/` 的源码直接编进去,前端接口 `host/front.h` 在 Mac 上由 `host/front_mac.m` 实现、在 iOS 上由 `ios/Sources/front_ios.m` 实现。改写后的模块映像由 `ios/tools/gen_embed.py` 生成内嵌汇编,编进可执行文件;`loader.c` 的 iOS 分支不拷贝代码,只把这几块按原来的相对位置映射回去。触摸操作与界面也在 `ios/` 里。细节见 [ios/README.zh-CN.md](ios/README.zh-CN.md)。
### 6. Android 外壳(`android/`,仅 Adreno 机型)
同一套 `host/` 与 `gfx/` 源码用 NDK 编成 `libd2r.so`,由 GameActivity 加载;前端接口由 `android/Sources/front_app.c` 实现,触屏 HUD 在 `android/Sources/touch_app.c`。图形回放换成 Vulkan:`gfx/vulkan/nvn_vk.c` 接 `hle_nvn.c` 录下的同一份命令。系统接口的差异由 `host/compat/linux/` 补齐。细节见 [android/README.zh-CN.md](android/README.zh-CN.md)。
## 目录
| 位置 | 内容 |
@@ -82,8 +86,9 @@ App 把 `host/` 与 `gfx/` 的源码直接编进去,前端接口 `host/front.h
| `PRODUCT` | 当前改写产物的代号,一行 |
| `tools/` | 改写器 `patch_nso.py`、产物脚本 `product.sh`、读游戏资源存储的 `dmx.py`、构建期改写资源存储的 `casc_overlay.py`,以及一批读码与分析脚本 |
| `host/` | 宿主:装载、系统调用与系统库接管、Mac 前端、游戏内功能;`host/tests/` 是单元测试 |
| `gfx/` | 图形层:`nvn/`(接口层与 Metal 回放)、`tex/`(贴图格式与解排布)、`tools/`(着色器翻译链)、`tests/` |
| `gfx/` | 图形层:`nvn/`(接口层与 Metal 回放)、`vulkan/`(Android 的 Vulkan 回放)、`tex/`(贴图格式与解排布)、`tools/`(着色器翻译链)、`tests/` |
| `ios/` | iOS App:`Sources/`、工程描述 `project.yml`、出包与装机脚本 `run.sh`、`tools/`(资源生成、冒烟、界面回归)、`tests/` |
| `android/` | Android App:`app/`(GameActivity、`res/`、出包脚本)、`Sources/`(前端与触屏 HUD)、构建入口 `Makefile`、`tests/` |
| `verify/` | 验证:改写等价回归 `regress.sh`、整套验收 `accept.sh` 及其各项用到的脚本与格式说明 |
| `data/` | 随仓库的小数据:资源覆盖层的借用路径登记表。启动预取清单公开仓库不带:缺了就不预取,启动时少一步提前解码 |
| `i18n/` | 中英文案表 `ui_text.tsv`;`scan_literals.py` 检查玩家看得到的中文都进了这张表,例外登记在 `literal_whitelist.tsv` |
@@ -128,6 +133,8 @@ DM_ROMFS=<Update/RomFS 目录> DM_SAVE=<存档目录> DM_TEMP=<临时目录> DM_
**单元测试**:`make -C dm/host/tests run`、`make -C dm/gfx/tests run`、`make -C dm/ios/tests test`。
**出 Android 包**:`make -C dm/android -j8`(产物 `dm/android/build/app/d2r.apk`),`make -C dm/android install` 装到 adb 连着的手机。
**出 iOS 包**:`cd dm/ios && ./run.sh build`,装到设备用 `./run.sh install`。签名配置见顶层 README。
**整套验收**:`dm/verify/accept.sh [--fast|--full]` 把改写等价、存档对拍、画面闸门、单测、iOS 构建、功能用例等并在一起跑。它除游戏文件外还要用到参照运行数据和标准存档,这些没有随仓库提供;取参照运行数据用的模拟器驱动脚本也不随仓库提供,所以整套验收在仓库外跑不了。