Zero Hour engine — macOS (Apple Silicon) engine-v0.1.10
engine-v0.1.10 — Save / Load / Replay now work on macOS
Native macOS (Apple Silicon) build of the Command & Conquer: Generals — Zero Hour
engine. This release makes saving, loading, and replays work. Previously Save
did nothing and the Load menu was always empty.
The GeneralsZH Launcher downloads this engine automatically. You must own a
legitimate copy of Zero Hour — EA game data is not included. Apple Silicon
(M-series) only. Checksums in SHA256SUMS.
Fixed
1. Saving did nothing; the Load menu was always empty.
- Symptom: pressing Save showed no error but wrote nothing usable, and the Load
screen was empty even after "saving". - Cause: the engine builds file paths with Windows
\separators (e.g.
…/Save\game.sav). The direct-fopensites already converted\→/, but the
POSIX-backed Win32 filesystem shims (mkdir/chdir/stat/access/unlink/
open) did not — so the game created a directory literally namedSave\
while the save file was opened atSave/…. On a clean profile the write failed
outright; the Load menu also enumerated the wrong (empty) directory. - Fix: every path-taking compat shim now normalises
\→/(with case-correction),
the same way the fopen sites do. Saves write, auto-increment their filenames,
and appear in the Load menu.
2. Loading a save showed "Error loading game".
- Symptom: selecting a save and pressing Load popped an error instead of loading.
- Cause: two stacked pre-existing bugs, only reachable once saving worked —
(a) the engine's path-normaliser first asks Windows for the required buffer size
viaGetFullPathName(path, 0, NULL), which the compat shim always failed; and
(b) the map-path safety check compared paths case-sensitively, but macOS is
case-insensitive and the saved map path is stored lower-cased — so a perfectly
valid map was rejected. - Fix: the shim now answers the size query per the Win32 contract, and path
containment compares case-insensitively on macOS. Saves load correctly.
3. Replays are recorded and play back.
- Cause: the same
\-path-separator class of bug affected the replay writer, so
replays landed in the wrong folder. - Fix: replays now record to
Replays/and play back from the Load Replay menu. - Note (by design, not a bug): recording a replay of a game continued from a
save is intentionally unsupported — a replay needs the full command history
from the start of the match, which a mid-game save snapshot does not contain.
This matches the original game (the "Save Replay" button is greyed for a loaded
game).
Changed
- Hardened the whole macOS filesystem boundary: 21 additional direct-
fopen
sites across the engine (replays, local-file I/O, temp files, debug/crash logs,
stats) now normalise Windows paths too — closing this class of bug for good.
No graphics or effects were removed. In-game memory usage is unchanged (flat).