Why Did I Build This?
"High-level game engines abstract away memory layouts, register allocations, and OS-level calling conventions. I engineered this project to explore the absolute foundational layer of game state management. The objective was to manually construct stack frames, manage shadow spaces, and execute procedural combat loops while interacting directly with the C runtime (`msvcrt`) for I/O and RNG, proving that complex software can be cleanly architected at the lowest possible abstraction layer."
Architecture & Decisions
The codebase is strictly modularized (`main`, `game_logic`, `combat`, `file_io`, `ui`), resolving global symbols during the linking phase. It adheres flawlessly to the Windows x64 ABI: passing the first four parameters via `RCX`, `RDX`, `R8`, and `R9`, allocating 32 bytes of shadow space, and maintaining 16-byte stack alignment. Combat mechanics utilize dynamic RNG bounds and percentage-based scalar multiplications (`imul`, `div`) executed entirely within CPU registers. File I/O is managed directly via `fopen`/`fprintf` external calls bridged to the C runtime, maintaining an autonomous, state-driven combat ledger.
Key Features
- 01.Strict compliance with the Windows x64 ABI, including explicit shadow space allocation and stack boundary alignment
- 02.Modular assembly architecture linking multiple `.asm` objects into a single cohesive executable binary
- 03.Hardware-level pseudo-RNG integration for calculating hit chances, flat damage variance, and percentage-based scalar attacks
- 04.Real-time ANSI-colored terminal rendering and persistent flat-file telemetry logging (`game_log.txt`) directly via `msvcrt` hooks