Skip to content

fadi-labib/Generals-Android

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,081 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C&C Generals: Zero Hour — Native on Android

APK CI Docs License: GPL v3 Discussions

The real 2003 engine, compiled for arm64, playing skirmish matches on a tablet. No emulation: DirectX 8 → DXVK → Vulkan 1.3 on a bundled Mesa Turnip driver, loaded rootlessly with libadrenotools. RTS touch controls: tap-select, drag-box, long-press right-click, two-finger pan, pinch zoom.

Zero Hour skirmish gameplay on a Galaxy Tab S7+

Ported in under 24 hours as a human + AI collaboration — possible only because Ammaar Reshi's iOS/iPadOS port and the GeneralsX lineage had already carried this engine across the hard miles. No game assets included — bring your own Zero Hour (Steam, ~$5 on sale).

Get it

  1. Device: arm64 Android with a Qualcomm Adreno 6xx/7xx GPU (others: #9).
  2. APK: Releases → sideload (Samsung gotcha).
  3. Assets: push your own game files — how.

More questions? FAQ.

Status

Menus, shell map, skirmish vs AI ✅ ~30–60 FPS at 2800×1752
Touch, audio, HOME→resume
Campaign / Challenge / video #12
Non-Adreno GPUs (Xclipse, Mali) #9

Full list: Known issues & remaining work.

Build from source

git clone https://github.com/fadi-labib/Generals-Android.git && cd Generals-Android
git submodule update --init --recursive references/fadi-labib-dxvk references/libadrenotools
cmake --preset android-vulkan
cmake --build build/android-vulkan --target z_generals -j$(nproc --ignore=1)
./scripts/build/android/build-adrenotools.sh && ./scripts/build/android/fetch-turnip.sh
./scripts/build/android/package-android-zh.sh --install

Full guide (toolchain, debugging toolbox, traps): Android build guide.

The port in five walls

Five mechanics had to be discovered the hard way — each broke the port until fixed:

  • Vulkan 1.3 on a Vulkan 1.1 device — the stock Adreno driver caps at 1.1, so bundle Mesa Turnip and load it rootlessly (via libadrenotools).
  • One Vulkan loader, not two — SDL and DXVK each bring their own; the surface has to be created through DXVK's or the instance dispatch mismatches.
  • The one-producer ANativeWindow rule — the engine's device-retry loop leaked the connection → black screen. Fixed by deferring surface creation to first present.
  • Shared libc++ across .so boundaries — otherwise C++ exceptions and RTTI vanish at the boundary and the real Vulkan error gets swallowed.
  • A zero-initialized heap — the 2003 code silently assumes new returns zeroed memory; bionic's malloc doesn't.

The full story — the renderer night, the 2 am black-screen hunt, the touch deep-dive, and 17 cataloged bugs with root causes: The Android Journey · Bugs & Lessons · rendering pipeline · touch controls.

Contributing

Human or AI, the door is open — the repo is deliberately AI-first:

Credits

This project is the newest link in a chain, and says so gladly — the speed was borrowed from years of work by:

  • Westwood / EA Pacific — the game; EA — the GPL v3 source release.
  • TheSuperHackers — build modernization and cross-platform groundwork, with FFmpeg/OpenAL backends by feliwir.
  • Fighter19's Unix port — SDL3 platform management, 64-bit fixes, the DXVK approach.
  • fbraz3/GeneralsX — the macOS/Linux port: compatibility layer, vcpkg build system, DXVK integration.
  • Ammaar Reshi's iOS/iPadOS port — the direct parent and the single biggest reason this took a day, not months: the touch→mouse translator (adopted wholesale, then evolved here — improvements flow back), the lifecycle handling, the DXVK-on-mobile cross-build methodology, and the porting playbook that turned debugging into lookups. Want this on Mac/iPhone/iPad? Go there.
  • Mesa Turnip · libadrenotools · K11MCH1's drivers · DXVK · SDL · OpenAL Soft · FFmpeg — the load-bearing walls.

Engine code GPL v3; game assets not included, not licensed here.

About

Command & Conquer Generals: Zero Hour running natively on Android — real engine (EA GPL v3 source, via GeneralsX)

Topics

Resources

License

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 95.7%
  • C 2.7%
  • CMake 0.7%
  • Python 0.5%
  • Shell 0.4%
  • Perl 0.0%