Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ obj/

# Upstream source is reconstructed from its pinned revision and patch.
third_party/nxnative/

# Reference-only checkouts kept on disk but never published.
vendor/d3hack/
.impeccable/
*.cpk
*.shd
Expand All @@ -80,3 +83,4 @@ third_party/nxnative/
*.ttf
*.heic
*.mov
.serena/*
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
PY := .venv/bin/python
.PHONY: setup bootstrap rewrite verify shaders mac app run test
.PHONY: setup bootstrap rewrite verify shaders mac app run test env
# --no-config: this machine's global uv config pins exclude-newer=7 days,
# which rejects the pinned versions in requirements.txt.
setup:
python3 -m venv .venv
$(PY) -m pip install -r requirements.txt
uv venv --python 3.12 .venv
uv pip install --no-config --python .venv/bin/python -r requirements.txt
env:
nix develop
bootstrap:
$(PY) tools/dr3.py bootstrap
rewrite:
Expand Down
2 changes: 1 addition & 1 deletion PRODUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Inherit the current Bayonetta3 Mobile native launcher's two-column UIKit setting

## Rendering and network truth

The selected Air widescreen profile renders 1568×720 with expanded horizontal camera view. MetalFX Spatial targets 2560×1176; normal mode targets 2560×1440. Device rendering and performance must be verified separately from build or simulator UI results. Local multiplayer uses a native LAN transport and Bonjour discovery; actual two-device gameplay requires an end-to-end test. Battle.net and mesh are outside this request's implementation.
The selected Air widescreen profile renders 1920×720 with expanded horizontal camera view. MetalFX Spatial targets 2560×960; normal mode targets 2560×1440. Device rendering and performance must be verified separately from build or simulator UI results. Local multiplayer uses a native LAN transport and Bonjour discovery; actual two-device gameplay requires an end-to-end test. Battle.net and mesh are outside this request's implementation.

## Constraints

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ Independent community research; not an official port and not affiliated with or

## Observed status

As of **2026-10-18**. Research preview, not complete-game compatibility.
As of **2026-10-27**. Research preview, not complete-game compatibility.

| Area | Verified scope |
|---|---|
| macOS / Apple silicon | Native startup, town/menu/inventory interaction, controller input and isolated save/reload checks |
| iPhone Air / A19 Pro / iOS 27.2 | User-confirmed town entry, working touch input, audible sound and corrected wide-screen output |
| iPhone 15 Pro / A17 Pro / iOS 27.2 | Device-specific build, development-signed USB install, complete resource checks and app launch; gameplay/performance not yet verified |
| Graphics | 1,323 unique original stages compiled locally; 1,993 iPhoneOS libraries including fetch/layout variants; MetalFX Spatial and Normal/Wide launch options |
| Graphics | 1,323 unique original stages compiled locally; 1,993 iPhoneOS libraries including fetch/layout variants; MetalFX Spatial and Normal/Wide/Wider launch options |
| Offline seasons and challenge rifts | Season 37 calendar, season XVars and the weekly challenge-rift payload are injected from the host with no online state; the Challenge Rifts row appears in Mode Select. Entry is still locked until a Greater Rift is cleared, so rift entry is **not** verified |
| Local Wi-Fi | Mac host → iPhone client joined the same party; user confirmed both characters visible. Long sessions, combat/drop/scene synchronization, four players and reverse hosting remain unverified |
| Public Internet / Mesh | Design contract only; no released Mesh integration or Battle.net services |

The launcher offers Metal HUD, MetalFX Spatial, normal/wide view and local Wi-Fi options. The tested wide profile renders at 1568×720; mobile MetalFX targets approximately 2K while preserving aspect. macOS and iOS use separate shader builds. Frame rate varies with device and scene; this is not a guarantee of sustained 60 FPS.
The macOS launcher offers three display modes — Normal 16:9 (1600×900), Wide (1568×720) and Wider (1920×720) — plus Metal HUD, MetalFX Spatial and local Wi-Fi options. Both patched modes expand the horizontal view while keeping the vertical field of view; iOS keeps its single wide mode at 1920×720. Mobile MetalFX targets approximately 2K while preserving aspect. macOS and iOS use separate shader builds. Frame rate varies with device and scene; this is not a guarantee of sustained 60 FPS.

Constant-update forwarding substantially improved the observed Mac scene performance, but the original lantern flicker reproduced when forwarding was enabled. Attachment-dependency guards retain the optimization; the original location still needs dynamic visual acceptance. Full chapters, sustained thermal behavior, every rendering path and extended multiplayer stability are pending. See [status](STATUS.md), [acceptance checklist](docs/COMPLETION_CHECKLIST.md), [rendering notes](docs/LANTERN_STABILITY.md) and [LAN scope](docs/LAN_MULTIPLAYER.md).

Expand Down
7 changes: 4 additions & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@

## 实测范围

截至 **2026-10-18**,仍是研究预览版,不代表全流程兼容。
截至 **2026-10-27**,仍是研究预览版,不代表全流程兼容。

| 平台 / 功能 | 已验证范围 |
|---|---|
| Apple silicon Mac | 原生启动、城镇/菜单/背包操作、实体手柄、隔离存档保存与重载 |
| iPhone Air / A19 Pro / iOS 27.2 | 用户确认进入城镇、触摸正常、有声音、宽屏显示修正 |
| iPhone 15 Pro / A17 Pro / iOS 27.2 | 按 A17 编译、开发签名 USB 安装、完整资源检查和启动;游玩与性能待确认 |
| 图形 | 本地提取 1323 个唯一阶段,iOS 含变体共 1993 个库;启动可选 HUD、MetalFX Spatial、正常/宽屏 |
| 图形 | 本地提取 1323 个唯一阶段,iOS 含变体共 1993 个库;启动可选 HUD、MetalFX Spatial、正常/宽屏/超宽屏 |
| 离线赛季与挑战秘境 | 主机注入第 37 赛季日历、赛季 XVar 与每周挑战秘境数据,不依赖联网;模式选择已出现挑战秘境一行,但需先通关一个大秘境才解锁,**进入秘境尚未验证** |
| 本地 Wi-Fi | Mac 建房、iPhone 加入同一队伍,用户确认看到双方角色;长时间同步、战斗/掉落/换场景、四人及反向建房待验收 |
| 公网 / Mesh | 仅有接入契约,尚未完成;不提供战网、商店及互联网好友服务 |

实测宽屏为 1568×720,保留纵向视野;手机 MetalFX 按画幅输出约 2K。帧率随设备和场景变化,不承诺全程 60 FPS。常量更新转发曾显著改善 Mac 实测帧率,也曾引发灯笼闪烁;附件依赖守卫保留优化,原位置动态画面仍需验收。详见[当前状态](STATUS.md)、[剩余验收](docs/COMPLETION_CHECKLIST.md)与[灯笼记录](docs/LANTERN_STABILITY.md)。
macOS 启动器提供三档画面:正常 16:9(1600×900)、宽屏(1568×720)与超宽屏(1920×720),后两者扩大左右视野并保留纵向视野;iOS 仍只有 1920×720 一档宽屏。手机 MetalFX 按画幅输出约 2K。帧率随设备和场景变化,不承诺全程 60 FPS。常量更新转发曾显著改善 Mac 实测帧率,也曾引发灯笼闪烁;附件依赖守卫保留优化,原位置动态画面仍需验收。详见[当前状态](STATUS.md)、[剩余验收](docs/COMPLETION_CHECKLIST.md)与[灯笼记录](docs/LANTERN_STABILITY.md)。

## 自行构建

Expand Down
13 changes: 11 additions & 2 deletions STATUS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Local development status — 2026-10-27

Offline season content:
- The offline lobby never issues the publisher fetch, so the host now calls the game's own callbacks with the documents it would have downloaded: Seasons and Blacklist (branches gated observe-only first, then seeded), the season XVars pair, and the weekly challenge-rift payload read from `work/rift_data`. A 90 s run reports season vector size 1, season 37, seasons/blacklist flags 1; the challenge call publishes `valid=1, number 346` while Continue loads the hero and commits the save. Derivation recorded in docs/UPSTREAM_CHANGES.md; the d3hack reference checkout is no longer distributed.
- The Challenge Rifts row now appears in Game Settings → Mode Select but stays locked until a Greater Rift is cleared, so **rift entry is not verified**. `Config.txt` is not injected because that callback dereferences `self`.
- Two earlier approaches were removed after measurement: writing bit `0x4` into the resolved service object made the front end believe an online session existed and stalled main-menu Continue; d3hack's spawn gate (site 10) made every hero hang on world entry.
- A third display mode (Wider 1920×720) and the raised wide profile ship with per-mode patched images that are verified against the requested mode's word table. MSAA logging shows 2.7.7 never calls `nvnTextureBuilderSetSamples`: every texture and the swapchain is single-sample.
- Synthetic state: 58 Python tests discovered, 52 executed and 6 opt-in (Bonjour/LAN) skipped, plus the native Metal/GameController suite from `make test`. `tools/audit_public.py --all-history` passes on the published tree.

# Local development status — 2026-10-18

Public source snapshot:
Expand All @@ -16,7 +25,7 @@ Current LAN result (2026-10-18):

Latest configuration/LAN integration:
- D2R Mobile fast-forwarded from 21cf97b to 9393b00 (v1.0.18); three existing local modified files preserved byte-for-byte. Generic MIT touch joystick/socket artwork copied with provenance, original D3 bindings retained.
- Native iOS launch menu selects HUD, MetalFX, wide/normal and Wi-Fi LAN before guest preload. Real camera/UI wide profile 1568×720 is embedded as signed code alongside original; MetalFX output is 2560×1176 for Air or 2560×1440 for normal. Differently shaped iPads preserve picture aspect.
- Native iOS launch menu selects HUD, MetalFX, wide/normal and Wi-Fi LAN before guest preload. Real camera/UI wide profile 1920×720 is embedded as signed code alongside original; MetalFX output is 2560×960 for Air or 2560×1440 for normal. Differently shaped iPads preserve picture aspect.
- Complete `make test` and Mac/iPhoneOS builds passed; actual MetalFX GPU fixture passed 336 channel checks. Four opt-in LAN ASan/UBSan tests include actual Bonjour discovery, UDP/TCP and lifecycle boundaries. These are separate from actual multiplayer gameplay acceptance.
- Candidate Mac app: `work/macapp-lan-metalfx/DR3 Mobile.app`. Signed iOS SHA: ac59ec201249df26df12c5b72c2a25758dbbad6e7d6458a313245e09577a457f, developer team, both memory entitlements verified. Current install/session status is in `work/run/ios-launch-settings-20261018/` and `work/ios-device-session.json`.
- User confirmed old iPhone build reached town with working touch and audible sound. Original Mac save remains unchanged. User saved to title before authorizing this update; device save and original app separately backed up.
Expand All @@ -31,7 +40,7 @@ Target: Diablo III Eternal Collection, base title 01001B300B9BE000, update 2.7.7

Latest integration (2026-10-17, local Apple Silicon):
- Candidate: `work/macapp-complete/DR3 Mobile.app`, runtime `fcffb365d4d29c767abd2378a11ee1042c0e25682374e4c04fec1bd404131749`. Old baseline/candidate apps remain separate. Uniform forwarding and targeted attachment guard stay on.
- Final packaging also enables forwarding from startup in both Mac app and CLI; launcher source/binary hashes are in the app receipt. The app was repackaged and signature-verified without launching a game window. The 39 Python tests passed again; the tested native runtime and shader chain are unchanged.
- Final packaging also enables forwarding from startup in both Mac app and CLI; launcher source/binary hashes are in the app receipt. The app was repackaged and signature-verified without launching a game window. The Python tests passed again (39 at the time; 58 are discovered now); the tested native runtime and shader chain are unchanged.
- Production CopyCommands and GPU synchronization are implemented and SDK 8.2 semantics checked. New integration fixture: 64/64; upstream GPU fixture: 64/64; GPU validation rerun passed. Normalized vertex input failures fixed with actual-format fetch shims, 9 prebuilt layouts, 544 hash-bound source records, 128 independently expected GPU register channels and three real PSO positive/negative controls.
- Strict CPK decoding now verifies 51/51 archives, 1,386,014 sectors and stored-payload CRC. Original 1569 SHD bytes match. A fresh exact-runtime registry audit reports 314 implemented NVN entries / 16 no-ops / 206 unregistered, with 129 observed APIs and no observed no-op or unregistered calls in the integrated town run. Unobserved is not unused.
- Integrated offscreen town: 110 seconds, 5912 frames, graceful exit 0, no CRASH/FATAL/red warning, original save unchanged. Last 30 seconds: 442 draws / 56 passes / one attachment boundary, GPU p50 3.959 ms, p95 5.035 ms. These are offscreen work times, not foreground FPS or the original blue-lantern visual acceptance.
Expand Down
2 changes: 1 addition & 1 deletion docs/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Read [GAME_FILES.md](GAME_FILES.md) first. 本教程从你已经合法准备的

## Prerequisites / 环境

Apple silicon Mac; macOS 26+; full Xcode with Metal tools (tested Xcode 27); Python 3.12+; LLVM; .NET 10; SPIRV-Cross; XcodeGen for iOS. Install and select your own Xcode/toolchains. The verifier currently expects Homebrew LLVM at `/opt/homebrew/opt/llvm/bin`. Prepare substantial free disk space: the tested base/language resource set alone is about 22.75 GB, with additional extraction, shader and build caches.
Apple silicon Mac; macOS 26+; full Xcode with Metal tools (tested Xcode 27); Python 3.12+; LLVM; .NET 10; SPIRV-Cross; XcodeGen for iOS. Install and select your own Xcode/toolchains. LLVM is resolved from `LLVM_BIN`, then `llvm-mc` on `PATH`, and only then from Homebrew's `/opt/homebrew/opt/llvm/bin`. On a nix machine `nix develop` (see `flake.nix`) provides LLVM, .NET 10, SPIRV-Cross and Python 3.12 — it deliberately drops nix's `xcrun`/`clang` wrappers so Xcode's toolchain and the separately installed Metal compiler (`xcodebuild -downloadComponent MetalToolchain`) stay in charge. Prepare substantial free disk space: the tested base/language resource set alone is about 22.75 GB, with additional extraction, shader and build caches.

```sh
git clone https://github.com/enginefuture/dr3-mobile.git
Expand Down
4 changes: 2 additions & 2 deletions docs/LAUNCH_UI.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Mac 是上述原生设置界面的 AppKit 适配,继续沿用左侧游戏身

- 使用真实 `NSWindow`、`NSBox`、`NSSegmentedControl`、原生 checkbox 与圆角开始按钮;窗口、分组表面和控件状态交由 AppKit 绘制。自建文字使用 `labelColor`/`secondaryLabelColor`,不把深色截图中的采样色写成固定色值。
- 标题使用系统字体 28 pt semibold,说明与状态使用系统字体 12 pt;分组标题与控件文字沿用 AppKit 默认排印。窗口初始内容区为 760×470 pt,最小内容区为 700×450 pt;左右边距 28 pt、上边距 28 pt、底部至少 24 pt,左栏宽 240 pt,栏间距 30 pt。左栏间距 16 pt,右侧分组间距 14 pt,分组内部间距 8 pt。最小尺寸和大字号下的实际布局尚未独立截图验收。
- 新的偏好域默认选择正常 16:9,Metal HUD、MetalFX 超分与本地 Wi-Fi 联机默认开启。正常/宽屏和三个开关立即保存至 `NSUserDefaults`;重新打开启动器可重新选择。宽屏选项依赖包内独立的 `rewrite-wide` 映像,打包时检查其配置与独立验证结果;资源缺失时该分段不可选并回到正常模式。
- 新的偏好域默认选择正常 16:9,Metal HUD、MetalFX 超分与本地 Wi-Fi 联机默认开启。画面模式分为 `Normal` / `Wide` / `Wider` 三段,保存为 `LaunchDisplayMode`(`"normal" | "wide" | "wider"`);旧 `LaunchWide` 布尔只在缺少新键时迁移(true → `wide`,false 或缺失 → `normal`)。两个 patched 分段分别依赖包内 `rewrite-wide` 与 `rewrite-wider` 映像;打包时各自检查配置与独立验证结果,目录缺失时该分段不可选,选择也会回退到正常模式。三个开关同样立即保存至 `NSUserDefaults`。
- 玩家选择后点击“开始游戏”(Return 快捷键)才启动游戏。启动器先设置本次画面、HUD、MetalFX 与 LAN 环境,再以 `execv` 执行新的 host 进程;重复开始受保护。源码为启动失败提供原生 `NSAlert` 并恢复开始按钮,但错误状态外观尚未截图验证。
- 正常模式说明为 1280×720、原版 16:9 视野;宽屏说明为 1568×720、扩大左右视野。MetalFX 开关会切换“超分至 2K”或“直接适配窗口”的辅助文字。`third_party/nxnative/dm/host/front_mac.m` 按所选画面比例居中显示,在窗口尺寸或 backing scale 改变时重新计算画面区域,允许留边;MetalFX 的输出目标为正常 2560×1440/宽屏 2560×1176。这是源码中的显示契约,完整窗口调整与性能验收另行记录。
- 正常模式说明为 1600×900、原版 16:9 视野;宽屏说明为 1568×720;超宽屏说明为 1920×720,均扩大左右视野。MetalFX 开关会切换“超分至 2K”或“直接适配窗口”的辅助文字。`third_party/nxnative/dm/host/front_mac.m` 按所选画面比例居中显示,窗口默认尺寸由该比例推导,在窗口尺寸或 backing scale 改变时重新计算画面区域,允许留边;MetalFX 的输出目标为正常 2560×1440/宽屏 2560×1176/超宽屏 2560×960。这是源码中的显示契约,完整窗口调整与性能验收另行记录。
- 常规包使用本机原有 `work/run/save`,界面显示“存档:本机游戏进度”。私有 `tools/mac_app.py --test-session <目录>` 将既有独立存档副本路径写入 bundle 的 `DR3TestSessionRoot`,启动器显示“存档:联机测试副本”;测试包的该标记不代表常规包改用了副本。

当前有效截图是 `.impeccable/review/mac-launcher/desktop.png`(1520×1004),来自实际 AppKit 启动器的系统深色外观,可确认两栏、三个设置分组、宽屏选择、开启的图形/LAN 开关与测试存档标记均可读。早期 `initial-layout.png` 是已被替换的压缩布局,不作为当前界面依据。`.impeccable/review/mac-launcher/finish-review.json` 的 `ship` 只覆盖 Mac 启动器 UI;本次另有宽屏选择持久化及 MetalFX 关闭/开启辅助文字的运行检查。浅色外观、其他语言、大字号、辅助功能遍历和错误状态外观仍未验收。
Expand Down
Loading