Open-source project
ammaarreshi/Generals-Mac-iOS-iPad avatar
ammaarreshi/Generals-Mac-iOS-iPad

Command and Conquer Generals Zero Hour on macOS and iOS: An Engineering Port

Command & Conquer Generals: Zero Hour running natively on macOS, iPhone & iPad — real engine (EA GPL v3 source, via GeneralsX), DXVK/MoltenVK renderer, RTS touch controls. No game assets included.

1,641 stars204 forksC++NOASSERTION

At a glance

What is it?
This fork of GeneralsX brings Command and Conquer Generals: Zero Hour natively to Apple Silicon Macs, iPhone, and iPad using the real 2003 engine compiled for ARM64, with DirectX 8 rendering translated through DXVK and MoltenVK to Metal. No game assets are included: you need your own copy from Steam. The engineering log documents every failure mode in the iOS port, from the filesystem sandbox to the render loop.
Who is it for?
This port is the right starting point for an engineer or enthusiast who wants to play Command and Conquer Generals: Zero Hour on a Mac or Apple device and is willing to build from source. The macOS path requires Xcode command-line tools, Homebrew, CMake, Ninja, Meson, vcpkg, and the LunarG Vulkan SDK.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 88 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What This Port Is and What It Needs

Command and Conquer Generals: Zero Hour was released by EA in 2003 as a Windows RTS. EA open-sourced the engine under GPL v3. This fork builds on that source release through a chain of community work: TheSuperHackers modernized the codebase, Fighter19 produced the first Unix port, and fbraz3/GeneralsX added macOS and Linux support. This fork adds the iOS and iPadOS port and a set of engine bug fixes.

The project targets Apple Silicon Macs (ARM64), iPhone, and iPad. Intel Macs are not mentioned in the build instructions. The game requires your own legitimately owned copy of the assets, available on Steam (app ID 2732960) for approximately $5 on sale. The scripts/get-assets.sh script fetches the assets from Steam using SteamCMD once you have purchased the game.

The Rendering Pipeline: D3D8 to Metal

Zero Hour's renderer speaks DirectX 8. Apple platforms speak Metal. The translation chain runs in two hops. DXVK translates Direct3D 8 and 9 calls to Vulkan. MoltenVK translates Vulkan to Metal. The result is that the original D3D8 draw calls eventually reach the GPU as Metal commands, without rewriting the renderer.

This chain existed for macOS in GeneralsX. The iOS port required adapting DXVK for iPhoneOS, which it had never targeted. The problem is that iOS restricts dlopen to the app bundle: DXVK's Vulkan loader was not written for this constraint. The solution is a patch at Patches/dxvk-ios.patch, built from a DXVK submodule, that confines dynamic loading to the bundle. The iOS DXVK build uses Meson as a cross-compile toolchain.

MoltenVK is pinned at a specific version. The script scripts/build/ios/fetch-moltenvk.sh downloads the pinned MoltenVK.framework with a checksum verification. Using an unpinned version risks Metal translation failures that are difficult to diagnose.

Building and Running on macOS

The macOS build requires a one-time toolchain setup:

sh
xcode-select --install
brew install cmake ninja meson pkgconf
brew install --cask steamcmd

vcpkg must be a full clone, not a shallow one, because the manifest baselines require full history:

sh
git clone https://github.com/microsoft/vcpkg ~/vcpkg && ~/vcpkg/bootstrap-vcpkg.sh
export VCPKG_ROOT=~/vcpkg

The LunarG Vulkan SDK must be installed from lunarg.com, not the Homebrew cask. After installation, set VULKAN_SDK to the macOS path inside the SDK directory.

Clone and build:

sh
git clone https://github.com/ammaarreshi/Generals-Mac-iOS-iPad.git GeneralsX
cd GeneralsX
./scripts/build/macos/build-macos-zh.sh
./scripts/build/macos/deploy-macos-zh.sh
./scripts/get-assets.sh <your_steam_username>
cd ~/GeneralsX/GeneralsZH && ./run.sh -win

Building and Deploying to iPhone or iPad

The iOS build requires the full macOS toolchain plus Xcode (signed into an Apple ID), xcodegen, and a free or paid Apple Developer team ID.

sh
brew install xcodegen
git submodule update --init references/fbraz3-dxvk
./scripts/build/ios/fetch-moltenvk.sh
./scripts/build/ios/stage-fonts.sh
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

The package script assembles, signs, and installs the app. Assets ship inside the app bundle as a self-contained install. A --dev flag skips the approximately 2.7 GB asset copy for faster iteration on code changes.

A free Apple Developer account works for personal device installation with a 7-day certificate expiry. A paid account ($99/year) gives 12-month certificates and removes the reinstall requirement.

iOS-Specific Engineering Challenges

The README documents the iOS porting challenges in detail. Four were structural.

The engine assumes it can write to the filesystem anywhere it lives. iOS apps live in a read-only, code-signed bundle. Every configuration write, cache, and save path was rerouted, and the working directory was bootstrapped from the bundle.

The iOS app switcher seizes the Metal drawable without backgrounding the process. Drawing one additional frame after the drawable is taken causes a crash on resume. The render and simulation loop was modified to pause in this state.

SDL3 delivers raw touch events. An RTS needs a mouse. The implementation adds RTS tap semantics on top: taps are deferred until the 2003 GUI has processed hover (so menu buttons highlight correctly), a drag distinguishes between a selection box and a camera pan, long-press becomes right-click, and a cancelled touch never generates a ghost click.

The README documents two notable bug hunts after the initial port: a minimap that rendered black because a 2003 texture-format fallback silently dropped the alpha channel, and an EVA voice that went randomly mute because a zombie audio stream held a global no-talk flag while looping indefinitely. Both were diagnosed on a real device and fixed.

Known Issues and Limitations

Long sessions on iPad can be terminated by iOS when resident memory exceeds approximately 3GB. The app exits to the home screen without a dialog. Session logs are available in the Files app under the game's folder for both the current and previous sessions. The README describes this as under investigation.

Backgrounding mid-game can occasionally crash on iOS. The lifecycle pause mechanism covers the common case but not all edge cases.

The build process is complex. The macOS path has eight steps and requires five separate tools beyond the standard Xcode toolchain. The iOS path adds three more. This is not a project for users who are unfamiliar with building C++ projects from source. The porting_playbook and porting_patterns documents in docs/port/ are intended for engineers who want to apply the same approach to other games.

The license is GPL v3, inherited from EA's source release. Distributing compiled builds requires compliance with the GPL v3 terms, including making the source available.

Repository Layout and Documentation

The repository documents its own engineering thoroughly. docs/port/PORTING_PLAYBOOK.md is the complete engineering log of the port, organized with a bug archaeology section (section 8) that walks through the minimap and audio failures in detail. docs/port/PORTING_PATTERNS.md extracts the methodology for porting other classic Windows games to Apple platforms, intended for engineers who want to apply the same approach to other titles.

Build scripts live in scripts/build/macos/ and scripts/build/ios/. The iOS Xcode project stub is in ios/, with staging configuration under ios/config/. The DXVK patch is at Patches/dxvk-ios.patch, applied during the iOS DXVK build. The vcpkg.json manifest at the repository root defines C++ dependencies managed by vcpkg. A CMakePresets.json includes presets for the macOS and iOS builds, including the ios-vulkan preset used in the iOS build steps.

The last push was on 2026-07-05. There are no GitHub releases. The README explicitly credits the project as a human and AI collaboration: the C++ engineering was performed by Claude Code (Anthropic's Fable model), directed and playtested by a human who owned all decisions and described symptoms such as a black minimap and intermittent audio chirping.

Editorial conclusion

This port is the right starting point for an engineer or enthusiast who wants to play Command and Conquer Generals: Zero Hour on a Mac or Apple device and is willing to build from source. The macOS path requires Xcode command-line tools, Homebrew, CMake, Ninja, Meson, vcpkg, and the LunarG Vulkan SDK. The iOS path additionally requires a full Xcode installation and an Apple Developer account. The port is licensed under GPL v3 from EA's source release. Check the LICENSE.md for the current terms before distributing compiled builds.

Frequently asked questions

Is Command and Conquer Generals Zero Hour available on macOS?

Not officially. This open-source fork compiles the real GPL v3 engine from EA's source release for Apple Silicon using DXVK and MoltenVK to translate the DirectX 8 renderer to Metal. You build it yourself from source and supply your own copy of the game assets from Steam.

Where can I play Generals Zero Hour today?

The original game is available on Steam (app ID 2732960). This fork lets you run it on Apple Silicon Macs, iPhone, and iPad by building from source and fetching your Steam-owned assets via the included scripts/get-assets.sh script.

Does the Generals iOS port require a paid Apple Developer account?

No. A free Apple Developer account is sufficient to sign and install the app on a personal device, but the certificate expires after 7 days and must be re-signed. A paid developer account ($99/year) provides 12-month certificates and removes the reinstall requirement.

Official sources

  1. ammaarreshi/Generals-Mac-iOS-iPad on GitHub
  2. Issues
  3. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/ammaarreshi-generals-mac-ios-ipad.svg)](https://hysenlabs.com/projects/ammaarreshi-generals-mac-ios-ipad)