Commit Graph
26 Commits
Author SHA1 Message Date
jhaizhou-opsandClaude Opus 5.5 1e0e7934c9 Docs: the entertainment mode in the README feature table; the camera doc says how to switch it in game (Options > Custom > Camera view) and where it runs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 09:54:06 +08:00
dc5778d352 Entertainment mode: over-the-shoulder and first-person camera (#165)
Over-the-shoulder and first-person camera (entertainment mode; Custom page > Camera view, off by default)

- Perspective camera rebuilt from the original orthographic one, on Metal (iOS / Mac) and Vulkan (Android / HarmonyOS), shared math in xbg_cam.h
- Over the shoulder: follows the move direction, pulls in and rises at walls, keeps the view within what the game draws
- First person: the left stick walks and strafes relative to the view; the camera follows the ground height
- Touch: drag the right half to look around (horizontal turns, vertical tilts); turn buttons and optional motion sensors on Android
- Arrows on the screen edge for monsters off the picture, coloured by name tier (normal / champion / unique / act boss); the player's own summons left out
- A facing pointer on the minimap and the full-screen map
- Names, health bars and taps follow the perspective picture

Co-Authored-By: Yuechuan Yang <22333122+yyan160@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 09:50:18 +08:00
jhaizhou-opsandClaude Opus 5.5 2428e5b3af Adreno 750: inline shader helpers at load; the pipeline guard covers graphics pipelines (#123, #153, #166)
The Adreno 750 shader compiler (libllvm-qgl.so) segfaults (addr=0x48) building any pipeline whose shader has subgroup
instructions inside a called helper function: 098a and 6a7a (compute) and 358197ac, 5c1ca4e7, e1c00b41 and others (pixel)
on four Samsung / Xiaomi phones. v2.0.1 skipped only 098a.

- Engine: on Qualcomm Adreno 750-799, a shader of that shape (187 in the pack) has its helpers inlined at load with the
  SPIRV-Tools passes merge-return, inline-entry-points-exhaustive and eliminate-dead-functions (marker gfx-inline 1 / 0).
  The import pack is unchanged; only the APK is updated. The warm-up's inlined SPIR-V is reused on the graphics thread.
- dm/third_party/spirv-tools: SPIRV-Tools v2026.3 library sources, pre-generated tables and the SPIR-V headers it includes,
  built into the Android package only, without debug info. DM_VK_INLINE_CS is removed.
- pipeguard: every pipeline-building thread (graphics, warm-up, async) marks its build in gfx-pipe-inflight.<slot>; an
  entry in flight on two boots in a row goes into gfx-pipe-skip (c:<key> for compute, g:<stage keys> for graphics); a
  graphics pipeline error is skipped instead of fatal. v2.0.1's unprefixed entries and its hard 098a skip are dropped.
- Android: graphics log lines go to the dm tag and the log file; crash lines print library+offset for symbol-less libraries.

Verified on Adreno 830 (vivo) with a v2.0.1 import pack: default unchanged, forced inlining in game with the same picture,
guard record / skip / restore / old entries. See docs/android-notes/2026-10-27-adreno-750-inline.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 18:40:19 +08:00
vickFunWorld 24616499a8 Android: Adreno 740/750 default the quad and warp32 rewrites off (#148)
The two Adreno shader rewrites were written for the Adreno 730 and run there
and on the Adreno 830. On Adreno 740 (Snapdragon 8 Gen 2) the newer driver
accepts the rewritten SPIR-V and then faults: dmesg has "gpu timeout" and
kgsl status 00EF1087, the driver drops the device, and the next submit fails
with VK_ERROR_DEVICE_LOST (#141). On Adreno 750 (8 Gen 3) the submission never
finishes; the async command pool reset waits 10 s, gets VK_TIMEOUT, and the
slot reuse aborts with "s.reset_result failed: 2" (Redmi K70 Pro report,
#123 and the other 8 Gen 3 issues).

xbg_adreno_policy.h decides by device family: Qualcomm, model 740-799. A
marker file still wins, so either rewrite can be forced back on for a test;
the JNI's DM_GFX_* values no longer override the device default. Adreno 730,
Adreno 830 and other vendors are unchanged, and existing import packs work
without a rebuild.

The pool-reset wait now logs the GPU hang and the fatal message names it,
instead of leaving a bare "2" in the crash report.

With both rewrites off, #141 ran 27,900+ frames at a 16.63 ms p50 on an
iQOO 11 with the same import pack. This build has not run on an 8 Gen 2 or
8 Gen 3 phone yet; the PR is a draft until it does.

Refs #141, #123, #137, #138, #139, #142, #143
2026-10-26 21:09:08 +08:00
jhaizhouandcodingOuch e3756f8942 Adopt community PR #120: optional VP8 cutscene playback on iOS
dm/ios/tools/build_ffmpeg_ios.sh builds a static FFmpeg (7.1.1, LGPL 2.1+) for iOS, and building the App with
DM_MOVIE_FFMPEG=1 / MOVIE_FFMPEG=1 links it so cutscenes are decoded to the screen, as the Mac host already can
(#97). Builds that turn it on also get a Cinematics entry on the main menu and a Chinese / English voice choice in
Custom. Default builds are unchanged: no FFmpeg, no extra Custom rows, the same saved settings.

Taken in with two changes: the voice rows are compiled in only together with FFmpeg (the PR added them to every
build), and t_fs_case.c gets the stub the host tests need to link. The language code mapping keeps v2.0's Korean.
docs/DEPENDENCIES lists FFmpeg and its license.

Checked: host unit tests, the full acceptance gate, the Mac smoke test and the on-device smoke test (3/3 each);
a default build shows no voice rows and has no FFmpeg symbols; an FFmpeg build run as the iOS App on a Mac played
Act02start.webm (1280x720) at a steady 60 fps, with different frames captured at 16 s and 40 s. Not yet run on an
iPhone; cutscene audio still goes through the game's own path.

Co-authored-by: codingOuch <25929878+codingOuch@users.noreply.github.com>
2026-10-23 15:12:16 +08:00
jhaizhouandxielh96 16b87031c3 Adopt community PR #121: iCloud save sync for the Mac App with a paid developer account
`DM_MAC_ICLOUD=1 dm/tools/mac_app.sh` signs the Mac App with the Mac provisioning profile you put into
`~/dm-work/mac-sign` (or `DM_MAC_SIGN_DIR`): team, bundle identifier, entitlements and certificate are read
from the profile, and the keychain identity is matched by the embedded certificate's SHA-1 fingerprint, so the
App carries the iCloud entitlement and syncs saves like the iPhone / iPad App. Without the switch the App is
signed locally as before. docs/MAC and the homepage describe how to turn it on.

Ported into the internal tree and checked: the code change matches the PR line for line once comments are
stripped; a default build still signs ad-hoc; with the switch, an empty signing folder and an invalid profile
stop with their specific messages. Signing with a real profile and the iCloud sync itself were tested by the
author on an M1 Pro with a paid account.

Co-authored-by: xielh96 <16849027+xielh96@users.noreply.github.com>
2026-10-23 14:28:51 +08:00
b811b90172 v2.0: Android and HarmonyOS ports, Korean, iPhone Duo, Xbox controller layout, separate game packages, Mac icon and pointer
- Android (#113, @yyan160; graphics engine and shader-bundle packer from @biglawine's HarmonyOS port): an
  Android app (dm/android) with a JNI host, a touch overlay on the shared touch state machine, Vulkan
  presentation and AAudio sound; an NVN-to-Vulkan replay engine (dm/gfx/vulkan) behind the same backend
  interface as Metal; the shared host now builds for Apple and Android, and the module rewriter has an
  Android target (DM_TARGET=android; Apple output unchanged). Measured by the authors at a median 60 fps on
  a Redmi K50 Ultra.
- Android install with your own game files: the release APK (dm/android/tools/shell_apk.sh) contains no game
  content; dm/tools/d2rm_android.py makes an import pack (rewritten program, Vulkan shader bundles, touch overlay,
  data tables) that the App imports from Download/S2X/D2R Mobile/android with a progress screen. The shader export
  step (dm/gfx/tools/dmsh_vk.py) makes the 6,927 game shader bundles byte-for-byte identical to the tested set.
- Android rewriter fix (#113, @yyan160): rewrite blocks no longer stash registers below sp (Android has no red
  zone); equiv.py checks Android outputs, structck.py recognizes the Android block shapes. Apple output unchanged.
- Android touch controls drawn as on iOS (sockets, silver skill silhouettes, joystick), no map key in game state,
  no virtual pad buttons over panels; dm/android/tools/art_compare.sh compares the two drawings pixel by pixel.
- HarmonyOS (#114, @biglawine): a HarmonyOS NEXT app (dm/harmony, ArkTS shell + N-API library) on the same shared host
  and Vulkan engine as Android; shared changes are behind __OHOS__ or opt-in switches (adaptive present tier, fence waits
  woken on completion, OHAudio, HiTrace markers, a byte-identical BC fast path).
- HarmonyOS install with your own game files (@biglawine, 0.19.4 / code122): the release HAP is unsigned and contains
  no game content; players re-sign it with their own debug certificate and import a pack made with
  dm/tools/d2rm_android.py --target ohos. The registering stand-ins read the tables only when dm_derived_reload() is
  called (on __OHOS__); first import creates the target folders; outside a game a map toggle request is dropped
  before the AutoMap exists. Run by the author on a Mate 90 Pro Max: re-sign, install, import, in game, save and exit.
- Vulkan: NaN-ignoring min / max / clamp as on Maxwell (#113, @yyan160), fixing one-frame black tiles on the OnePlus 13.
- Xbox controllers (from #110, @rrroy5640): recognized automatically and given the PC / Xbox layout (bottom
  confirms, right goes back) with the game's Xbox button icons; other controllers are unchanged. The Mac-only
  keyboard prompt switch became a three-way prompt style (Switch / keyboard / Xbox) on every platform.
- Separate base and update packages (#106, @PowerBeef): setup.sh and extract_game.sh take both packages and
  read the title keys from their tickets.
- Mac App (#108, #109, @PowerBeef): the project's icon by default; the pointer hides after resting 3 s.
- run.sh install no longer goes through the test-device battery gate (#107, @PowerBeef).
- Chinese wording (#101, @zzz6519003): 「旧接口版」 and 「默认构建」 throughout.
- Dynamic 3D resolution (from #113): a run of dropped frames counts only its first 3 frames unless it lasts
  1 s, so one-off stalls no longer lower the resolution.
- In-game Korean (#118, @soulsakura): a 한국어 column for all our UI text, a fifth option in the language row (each
  checkbox now sits before its name), Korean touch wording and map name plates, Korean voice when the game files
  carry it; a Korean system language picks Korean on first install.
- iPhone Duo: in full screen the output size follows the window when the phone is unfolded or folded, up to the
  size the game started with; needs Xcode 27.1 for the inner screen to be filled. Test switches DM_TEST_FOLD and
  DM_TEST_SCREEN simulate the two screens with the iOS package on a Mac.
- README: Android and HarmonyOS sections, device table and credits in all three languages; dependency list for Android.

Every change was ported into the internal tree with its authors credited. For the shared files, the code
changes match the pull requests' after stripping comments. Host / graphics / iOS unit tests, the full
acceptance gate and the Mac smoke test passed; the rewriter's rule sets were rebuilt and passed the
equivalence regression; an iOS build of this code was played on an iPhone; the Android APK with an import pack
made from our own game files was played on a vivo X200 Ultra.

Exported from main 8055e5212.

Co-authored-by: Yuechuan Yang <22333122+yyan160@users.noreply.github.com>
Co-authored-by: biglawine <26263820+biglawine@users.noreply.github.com>
Co-authored-by: rrroy <hly5640@gmail.com>
Co-authored-by: Patrice Déry <109446870+PowerBeef@users.noreply.github.com>
Co-authored-by: Sam Snowman(赵正中) <zhengzhongzhao@gmail.com>
Co-authored-by: soulsakura <74704744+soulsakura@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 09:21:08 +08:00
53e7c5bb9c Adopt community PRs: in-game Russian (#100), Mac packaging (#96), optional Mac VP8 movies (#97)
- Russian (ruRU), from #100 by @XpycT: a Русский column for all our UI text, a four-way language row
  (中文 / English / Español / Русский) in Options → Custom, Russian touch wording, map goal name plates,
  and first launch following a Russian device language. Voice: the Russian voice-over is used when your
  game files include it (chunk 16, present in a package built from complete game data), otherwise English.
  Item notes remain Chinese and Spanish only.
- Mac packaging, from #96 by @SwonDev: SW_MAC_ROMFS_COPY=1 bundles your own resources (private use only),
  SW_MAC_ICON_SOURCE builds an App icon from your own image, linked non-system dylibs are copied into the
  bundle and relinked, and the bundle is verified with a strict codesign check. Rebuilding into the same
  output directory still replaces the whole App.
- Mac movies, from #97 by @SwonDev: MOVIE_FFMPEG=1 swaps the duration-only movie backend for FFmpeg VP8
  decoding to NV12; the default build and iOS are unchanged. See dm/host/MOVIE.md.

Every change was ported into the internal tree and passed the host unit tests, a Russian UI regression
run on the iOS app on Mac, the Mac smoke test, a real-iPhone smoke test (3/3) and the full acceptance gate.

Exported from main 69614143f.

Co-authored-by: XpycT <XpycT.TOP@gmail.com>
Co-authored-by: SwonDev <35969131+SwonDev@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 13:13:20 +08:00
44a6770601 Apple TV (tvOS) community port as a separate DmTV target; Rift and Mac fixes
- Apple TV 4K (3rd gen, A15): community port by @yinqingyan, contributed under
  the MIT License with the author's consent
  (https://github.com/jhaizhou-ops/d2r-mobile/issues/53#issuecomment-6184331793).
  Developer preview: reached character selection on the author's Apple TV;
  entering the game, full controller mapping and saves are not verified, and
  the maintainers have not tested it on real hardware. Separate DmTV target in
  dm/ios/project.yml (the iOS target is unchanged), bundled tvOS shaders,
  zh/en strings, icon generated from the iOS icon. Real hardware only: the tvOS
  Simulator GPU cannot run the renderer. See dm/tvos/README.md.
- Rift: the next guardian wave no longer spawns in town after you go back; it
  spawns when you return to the Rift level (#44, from @hubeiqiao's PR #45). A
  Rift monster that dies just across the border in the neighbouring original
  level no longer triggers that level's original quest events.
- Mac: choosing the folder that directly holds the .data files is accepted, and
  Chinese folder names show correctly in the error message; frame pacing follows
  the refresh rate of the screen the window is on (72 fps on 144 Hz screens).
- iCloud: forked shared stashes are merged in game (items, gold and Chronicle
  vault) instead of one copy replacing the other.
- Touch: with the primary skill empty, tapping "+" on the main attack button
  opens the skill picker.
- Renderer: fixed-function state is not re-sent when unchanged; copy-encoder
  reuse adds an in-encoder barrier on Metal 4; per-pass GPU timing works on
  Metal 4 again.

Co-authored-by: yinqingyan <271124084+yinqingyan@users.noreply.github.com>
Co-authored-by: hubeiqiao <12777592+hubeiqiao@users.noreply.github.com>
2026-10-15 13:23:23 +08:00
jhaizhou b94670c795 v1.0.15: shell is now build input (.zip), launch self-check for incomplete packages and devices without Metal 3, graphics translation on its own thread, save with the pause menu open, wide-iPhone item tooltip and Chronicle rewards fixes 2026-10-15 04:32:15 +08:00
jhaizhouandseedds e2a0c9a9b5 NPC speech restored (explicit 5.1 to stereo downmix); graphics memory pools made resident only on first GPU use (about 0.5 GB less held); render targets written through a format-changing view attached with that format, sRGB swapchain presented through a non-sRGB view (#36); bloom / FXAA texture-slot rewrites mark bindings dirty; Mac App plays sound and fills 16:10 screens
The render-target view issue (#36) was found and diagnosed by seedds on another port built from this repository, who also proposed the fix direction.

Co-authored-by: seedds <3463322+seedds@users.noreply.github.com>
2026-10-14 21:46:55 +08:00
jhaizhou 5bc5a01087 Docs: which devices are supported (iPhone / iPad by chip and system, Mac), what the in-app dialogs mean, and what self-built packages do not include 2026-10-14 12:08:38 +08:00
jhaizhouandJoe Hu 2e7177c080 Greater Rift: two Guardians from level 75, overtime status spelled out (#33); item descriptions stay open on touch (#32); Mac: click monsters to attack, items take the mouse, Share Log
The overtime status (#33) was reported with a clear direction by Joe Hu, who also sent a patch along the same lines (#34).

Co-authored-by: Joe Hu <12777592+hubeiqiao@users.noreply.github.com>
2026-10-14 10:34:48 +08:00
jhaizhouandJoe Hu dc3cc22b9b Greater Rift: confirm before the next-level door (#25), robust return to a finished run, top bar capped at level 100 (#29), monster life clamp; Mac: close X on the rift page
The top-bar fix (#29) was reported and diagnosed by Joe Hu, who also sent a fix along the same lines (#30).

Co-authored-by: Joe Hu <12777592+hubeiqiao@users.noreply.github.com>
2026-10-14 07:02:05 +08:00
jhaizhouandJoe Hu 135773b44f Docs: regression checklist for Greater Rift minion life (verification matrix proposed by the reporter of #23)
Co-authored-by: Joe Hu <12777592+hubeiqiao@users.noreply.github.com>
2026-10-14 05:34:59 +08:00
jhaizhou feb2bb9fdc Greater Rift minion life fix (#23); Mac click-to-walk and keyboard key names; older-API declaration de-duplication 2026-10-14 05:22:34 +08:00
jhaizhou d9e95c3381 Older systems: iOS 18+ / macOS 15+ via the older-API build; floating left stick; runeword required level; Mac keyboard, mouse and docs; clearer older-device dialog 2026-10-14 01:49:25 +08:00
jhaizhou eab0fada7c No-Xcode route: older devices (A16 and earlier) are supported - give the packaging tool a Legacy Device Pack with D2RM_ASTC_PACK 2026-10-13 19:52:03 +08:00
jhaizhou b50b976523 Older devices (A16 and earlier): a start-to-finish guide for the Legacy Device Pack
docs/LEGACY_DEVICES.md explains why older chips need an extra texture pack, how to build the astcenc encoder, the three commands that make the pack from your own game files, how to build the App with it and where the folder goes on the phone. The README links to it from the performance section and the status table. astc_pack.py now names the output folder "Legacy Device Pack", the name the App asks for.
2026-10-13 19:23:29 +08:00
jhaizhou 2b270ff76e Docs: the Mac version requires macOS 26 or later (the graphics layer is built on Metal 4); setup.sh notes it on older systems 2026-10-13 18:15:23 +08:00
jhaizhou 6a2474d917 Native macOS App (first version): dm/tools/mac_app.sh, docs/MAC.md
The Mac host can now be packaged as a double-click macOS App with keyboard, mouse and gamepad input, saves under Application Support, a first-launch resource-folder picker and save-before-quit. dm/tools/mac_app.sh builds it after ./setup.sh; by default the package carries no derived content and points at this machine's build outputs, so it runs only on the Mac that built it and needs only a local ad-hoc signature.

Nobody has played this version by hand yet; what was verified was run unattended. See docs/MAC.md.
2026-10-13 16:49:19 +08:00
jhaizhou ffab0bf5d2 Docs: name the game version as the console shows it (1.0.34.0, PC 3.3.94012); note community ports to other versions; package format is not checked 2026-10-13 15:28:59 +08:00
jhaizhou c3f981251f Docs: note that game build 3.3.94012 is version 1.0.34.0 on the console 2026-10-13 09:12:24 +08:00
jhaizhou ea86e79688 Fix shell packaging (issue #1): drop stale prefetch list, clearer pack error; sync with trunk 2026-10-12 21:09:04 +08:00
jhaizhou 286fbd417b State the required game edition: Reign of the Warlock expansion 2026-10-12 17:03:52 +08:00
jhaizhou 46578a2b5d Initial public release 2026-10-12 16:51:08 +08:00