使用 Fable 将《命令与征服:将军》原生移植至 macOS、iPhone 和 iPad。
Command and Conquer Generals natively ported to macOS, iPhone, iPad using Fable

原始链接: https://github.com/ammaarreshi/Generals-Mac-iOS-iPad/tree/main

该项目为 Apple Silicon Mac、iPhone 和 iPad 带来了《命令与征服:将军 – 零点行动》的原生性能。通过将 2003 年原始引擎源码编译为 ARM64 架构,并利用转换层(DXVK/MoltenVK),游戏无需模拟即可运行。它还针对移动端优化了触控操作,包括框选和双指缩放功能。 此版本基于 EA 开源的源码,并在 *GeneralsX* 移植的基础上增加了对 iOS/iPadOS 的支持以及关键的引擎修复。请注意,**不包含游戏资源文件**;用户必须拥有正版副本(例如通过 Steam),才能下载必要的数据。 该项目提供了适用于 macOS 和 iOS 的完整构建脚本,需要 Xcode 和特定的开发工具。尽管该移植版功能完善,但仍处于持续开发中,已知在 iOS 长时间运行期间存在内存管理方面的局限性。详细文档(包括技术“移植指南”和 AI 辅助开发过程的完整工程日志)可在仓库中查阅。 **核心资源:** * **源码:** [GitHub - Generals-Mac-iOS-iPad](https://github.com/ammaarreshi/Generals-Mac-iOS-iPad.git) * **需求:** 原始游戏资源(需拥有 Steam 版)。 * **鸣谢:** 由 Ammaar Reshi 使用 Claude Code 工程化开发。

开发者 ammaarreshi 利用“Fable”项目成功将经典即时战略游戏《命令与征服:将军》移植到了 macOS、iPhone 和 iPad 上。该项目基于 EA 在 GPL v3 协议下发布的源代码,并在 *GeneralsX* 分支的基础上进行了改进,加入了必要的引擎修复和针对移动设备的优化。 该项目采用了一套复杂的渲染管线(从 DirectX 8 转为 DXVK,再到 Vulkan,最后通过 MoltenVK 转换为 Metal),从而在苹果硬件上实现了原生性能。开发者表示,响应社区的请求,未来有意将类似的移植技术应用于《沙丘:皇帝》等其他经典作品。Hacker News 上的讨论显示了社区对此项目的热烈反响,用户不仅期待能有更广泛的 Linux (Debian) 支持,还指出该项目凸显了原生 Vulkan 驱动对苹果设备带来的潜在优势。
相关文章

原文
IMG_3457_500

Zero Hour running natively on Apple Silicon Macs, iPhone, and iPad — campaign, skirmish, and Generals Challenge, with touch controls built for RTS (tap-select, drag-box, long-press deselect, two-finger scroll, pinch zoom). No emulation: this is the real 2003 engine compiled for ARM64, rendering DirectX 8 → DXVK → Vulkan → MoltenVK → Metal.

Built on EA's GPL v3 source release via fbraz3/GeneralsX (which did the heavy lifting of the macOS/Linux port — this fork adds the iOS/iPadOS port and a set of engine fixes). The original GeneralsX README lives on the upstream-main branch.

No game assets are included or distributed. You need your own copy (Steam, ~$5 on sale).

Prerequisites (one time):

# Toolchain
xcode-select --install
brew install cmake ninja meson pkgconf
brew install --cask steamcmd

# vcpkg (full clone — a shallow clone breaks manifest baselines)
git clone https://github.com/microsoft/vcpkg ~/vcpkg && ~/vcpkg/bootstrap-vcpkg.sh
export VCPKG_ROOT=~/vcpkg          # add to your shell profile

# LunarG Vulkan SDK (NOT the Homebrew cask) — https://vulkan.lunarg.com/sdk/home
export VULKAN_SDK=$HOME/VulkanSDK/<version>/macOS   # add to your shell profile

Clone, build, get assets, play:

git clone https://github.com/ammaarreshi/Generals-Mac-iOS-iPad.git GeneralsX
cd GeneralsX
./scripts/build/macos/build-macos-zh.sh     # checks deps, configures, builds
./scripts/build/macos/deploy-macos-zh.sh    # creates ~/GeneralsX/GeneralsZH + run.sh
./scripts/get-assets.sh <your_steam_username>   # fetches game data you own
cd ~/GeneralsX/GeneralsZH && ./run.sh -win

Quick start — iPhone / iPad

On top of the macOS prerequisites: full Xcode (signed into your Apple ID), brew install xcodegen, and a (free or paid) Apple Developer team.

cd GeneralsX
git submodule update --init references/fbraz3-dxvk   # iOS DXVK is built from this + Patches/dxvk-ios.patch
./scripts/build/ios/fetch-moltenvk.sh                # pinned MoltenVK.framework (checksummed)
./scripts/build/ios/stage-fonts.sh                   # Liberation fonts, renamed as the game expects
cmake --preset ios-vulkan
cmake --build build/ios-vulkan --target z_generals
GX_TEAM_ID=<your-team-id> GX_BUNDLE_ID=com.you.generalszh \
    ./scripts/build/ios/package-ios-zh.sh --install  # assembles, signs, installs

Find your team id in Xcode → Settings → Accounts. Assets ship inside the app bundle (self-contained install); --dev skips the ~2.7 GB copy for fast code iteration.

Path What it is
docs/port/PORTING_PLAYBOOK.md The complete engineering log of this port: every failure mode, root cause, fix — start with §8, the bug archaeology: the black minimap, the silent EVA lines, and the chirp
docs/port/PORTING_PATTERNS.md Generalized methodology for porting classic Windows games to Apple platforms
docs/port/RELEASE_CHECKLIST.md Gate for public release
scripts/get-assets.sh Steam asset fetcher (your own copy; app 2732960)
scripts/build/macos/, scripts/build/ios/ Build, deploy, packaging pipelines
ios/ XcodeGen signing-stub project + ios/config/ (staged Options.ini, dxvk.conf)
Patches/dxvk-ios.patch DXVK changes the iOS d3d8/d3d9 dylibs are built from (applied via the local-fork build)
  • Long sessions on iPad can be killed by iOS for memory (~3 GB+ resident); the app exits to the home screen with no dialog. Session logs (current + previous) are in the Files app under the game's folder. Under investigation.
  • Backgrounding mid-game can occasionally crash on iOS — the lifecycle pause covers the common paths; a rare race remains. Save often.

Engine code GPL v3 (EA's source release → GeneralsX → this fork). Game assets: not included, not licensed here. Credits: Westwood/EA Pacific (the game), EA (the source release), fbraz3/GeneralsX (the base port), TheSuperHackers/GeneralsGameCode (community mainline), DXVK, MoltenVK, SDL, OpenAL Soft, FFmpeg, Liberation Fonts.

This port was built as a human+AI collaboration: engineering by Claude Code (Anthropic's Claude, Fable model), directed and playtested on real devices by Ammaar Reshi. The engineering log in docs/port/ is the unedited record of how that worked.

联系我们 contact @ memedata.com