PEUKERT Freedoom player engine adaptation, 2026-10-19
License: GPL-2.0-or-later, see COPYING.md and individual upstream notices.

Upstream: https://github.com/fabiangreffrath/crispy-doom
Revision: fdeabe4c23a833534b70aa84a22f1685aae7125d (Crispy Doom 7.2.0)
Built with Emscripten 4.0.18, CMake 3.31.6, SDL 2.32.8, SDL_mixer 2.8.0.

Modifications:
- Current Emscripten runtime exports and 64 MiB initial growing memory.
- Emscripten function-pointer cast emulation preserves Crispy state-action
  dispatch across its one- and three-argument legacy action callbacks.
- Browser-owned animation loop, supporting pauseMainLoop/resumeMainLoop.
- Proportional touch API, diagonal normalization, finite-value clamping.
- Edge-triggered jump API using Crispy's actual vertical momentum, collision,
  ceiling and landing constraints. No camera-only substitute.
- Read-only integration diagnostics for actual render dimensions and physics.

Build: activate Emscripten 4.0.18, install CMake, run ./peukert-web-build.sh.
SDL and SDL_mixer source dependencies are included under dependencies/ in the
outer archive. Emscripten ports fetch these same pinned releases automatically.
The compiler/runtime is available at https://github.com/emscripten-core/emscripten
(tag 4.0.18); compiler binaries via https://github.com/emscripten-core/emsdk.
Game content is separate: unmodified Freedoom Phase 1 0.13.0, BSD-3-Clause.

JavaScript API:
Module.callMain([...]), Module.FS, Module.pauseMainLoop(), Module.resumeMainLoop().
Module._peukert_touch_motion(forward, strafe, turn): numbers -1..1.
Positive values mean forward, right strafe and right turn respectively.
Forward/strafe respect normal walk/run speed and diagonal magnitude <=1.
Turn at +1 means 1280 Doom-angle units/tic (approximately 246 degrees/second).
Keyboard inputs remain additive and bounded by normal Doom maximum movement.
Reset with (0,0,0) whenever releasing touch or pausing/hiding the document.
Module._peukert_jump(): one jump request. Ignored in menus, pause or demos.
Module._peukert_engine_info(field), numeric read-only diagnostics:
 0 renderer width; 1 renderer height; 2 player z; 3 floor z; 4 vertical velocity;
 5 health; 6 bullet ammo; 7 player x; 8 player y; 9 facing angle degrees;
 10 in level; 11 menu open; 12 pause; 13 last forward command;
 14 last side command; 15 last turn command.

Config: main /default.cfg stores key bindings. Separate /crispy-doom.cfg stores
crispy_hires 1, crispy_widescreen 3, crispy_uncapped 1, crispy_fpslimit 60,
crispy_jump 1 (low) or 2 (high), aspect_ratio_correct 1. Pass both config paths.
With hires=1,widescreen=3,aspect_ratio_correct=1: native framebuffer 852x400,
displayed with corrected pixel aspect at 852x480; geometry truly renders at the
higher resolution instead of scaling a 320x200 framebuffer.

Save files use -savedir /savefiles and doomsavN.dsg as before. Crispy supports
additional numbered pages and reads vanilla save files; extended jump state
and rendering are managed by the source port.
