Max Payne in a browser tab
Open maxpayne.cc in Chrome or Safari, on a desktop or a phone, and you are playing Remedy's 2001 PC build of Max Payne (v1.05): Prologue through Part III, comics, bullet time, AI, music, voices, and saves that survive a reload. There is no x86 emulator in the middle. Every executable and engine DLL was statically recompiled from x86 to C and compiled to WebAssembly; a custom C runtime and WebGPU/AudioWorklet layer stand in for Windows, Direct3D 8, DirectInput 8, and DirectSound 8.
maxpayne.wasm.br)
1. Ten PE binaries in one flat 32-bit guest space
After Need for Speed Underground (one monolithic Speed.exe), Max Payne was a harder architectural test. Remedy's MAX-FX engine splits the game across MaxPayne.exe, five engine DLLs (all preferring base address 0x10000000), and four Visual C++ 6.0 runtime DLLs. On top of that, e2_d3d8_driver_mfc.dll is loaded dynamically as a plugin via LoadLibraryA.
tools/recomp/images.py rebases all ten PE images by applying their IMAGE_REL_BASED_HIGHLOW relocation tables into fixed, non-overlapping slots below HEAP_LO = 0x11000000, resolves cross-DLL imports (by name, ordinal, and forwarder chains) statically, and routes only true OS imports to the host layer:
10 PE binaries (MaxPayne.exe + 5 MAX-FX DLLs + 4 VC++ 6.0 DLLs)
|
v tools/recomp/images.py + frontend.py rebase, IAT link, CFG discovery
|
v tools/recomp/lift.py (2,405 LoC Python) x86 / x87 / MMX -> C chunks
|
v build/gen/*.c + host/*.c (12,936 LoC C) Win32, D3D8, SM1->WGSL, DSound, DInput
|
v Emscripten (-pthread, Brotli-11) maxpayne.wasm.br (14.5 MB)
|
v web/*.js (7,848 LoC JS/HTML) WebGPU, AudioWorklet, OPFS Worker, Touch
| PE Image | Rebased Base | Role | Lifted Functions |
|---|---|---|---|
MaxPayne.exe | 0x00400000 | Game logic, AI, levels, comics, menus, UI | 45,048 |
MFC42.DLL | 0x10600000 | VC++ 6.0 MFC runtime | 10,439 |
MSVCP60.DLL | 0x10900000 | VC++ 6.0 C++ STL runtime | 3,453 |
e2mfc.dll | 0x10100000 | MAX-FX scene graph, portals, camera, sprites | 2,780 |
e2_d3d8_driver_mfc.dll | 0x10400000 | Direct3D 8 render driver plugin + D3DX | 1,897 |
rlmfc.dll | 0x10000000 | Remedy low-level math, memory, RAS archive I/O | 1,653 |
MSVCRT.DLL | 0x10800000 | C runtime (_ftol, longjmp, math, strings) | 1,411 |
MSVCIRT.DLL | 0x10a00000 | Legacy iostream runtime | 577 |
sndmfc.dll | 0x10300000 | 3D sound engine, voices, music streaming | 566 |
grphmfc.dll | 0x10200000 | Textures, G_Image, embedded libjpeg 6a | 410 |
| Total (10 binaries) | 0 failed functions | 68,234 |
2. Static x86/x87/MMX lifter and the Unicorn differential oracle
The entire static recompiler — PE loader, control-flow frontend, x86/x87/MMX lifter, and build driver — is 2,405 lines of Python in tools/recomp/. Each lifted function takes one pointer Ctx *c holding the flat 32-bit guest memory, general registers, flags, x87 stack, and MMX registers. Guest pages below 0x10000 are unmapped so null dereferences trap loudly instead of corrupting memory.
Floating-point semantics matter in a 2001 physics and portal engine. In host/rt.h, x87 NaN propagation implements Intel SDM Table 4-7 explicitly (larger significand wins; ties pick the positive NaN) rather than relying on host ARM64/Wasm NaN canonicalization:
// host/rt.h: x87 NaN propagation (Intel SDM table 4-7), independent of host CPU/Wasm rules
static inline double fnan2(double a, double b) {
if (a == a) return bitsd(dbits(b) | 0x8000000000000ull);
if (b == b) return bitsd(dbits(a) | 0x8000000000000ull);
uint64_t x = dbits(a) | 0x8000000000000ull, y = dbits(b) | 0x8000000000000ull;
uint64_t mx = x & 0xfffffffffffffull, my = y & 0xfffffffffffffull;
if (mx != my) return bitsd(mx > my ? x : y);
return bitsd(x < y ? x : y); // same significand: prefer the one without the sign bit
}
Any change to lift.py, rt.h, or patches.py is gated before running the game by difftest.py, which executes lifted functions against the Unicorn x86 CPU emulator on randomized inputs and compares every register, flag, x87 slot, and touched memory page. The current build passes 2,000 functions / 7,940 cases with 0 crashes (1,995/1,996 exact match). For subtle runtime bugs, RN_LIFT_TRACE + host/difftrace.c records a single real call from the game and replays it instruction-by-instruction against Unicorn.

3. Direct3D 8, Shader Model 1.x → WGSL, and lock-free audio
Max Payne talks to Windows through four subsystems that do not exist in a browser: Win32/threads/files, Direct3D 8, DirectInput 8, and DirectSound 8. Those are rebuilt in 12,936 lines of C under host/.
- Direct3D 8 → WebGPU (
d3d8.c,ffp.c,sm1.c): implements both the D3D8 fixed-function pipeline (lighting, fog, texture stages, alpha test) and a full Shader Model 1.1–1.4 bytecode decoder, disassembler, WGSL compiler, and CPU reference interpreter. Even WGSL's edge cases are handled explicitly:
// host/sm1.c: WGSL forbids constant Infinity, so u.af.z (always 0) keeps D3D8 RCP(0) semantics legal
fn d3d_inf() -> f32 { return bitcast<f32>(0x7f800000u | u.af.z); }
fn d3d_rcp(x: f32) -> f32 {
if (x == 1.0) { return 1.0; }
if (x == 0.0) { return d3d_inf(); }
return 1.0 / x;
}
- DirectSound 8 → AudioWorklet (
dsound.c,audio.js): a C mixer thread with 4-tap Hermite interpolation writes stereo floats into a lock-freeSharedArrayBufferring buffer. Inside the browser'sAudioWorkletProcessor, a real-time linear resampler (ratio = 44100 / ctx.sampleRate) keeps pitch and tempo exact on 48 kHz iOS Safari and Bluetooth hardware with zero overhead when the device runs at 44.1 kHz. - Saves in Chrome and Safari (
opfs.js,files.c): saves and registry settings stay local in the browser's Origin Private File System (OPFS). Because Safari does not implementcreateWritable()on OPFS handles, every write is routed through a dedicated Worker usingcreateSyncAccessHandle(), with atomic temp-file replacement so a tab close never truncates a save.
4. Two-source discipline: 10 byte patches, widescreen, and verified fast paths
Every modification to original game code or data lives in a single manifest: tools/recomp/patches.py. Every entry checks the original bytes before applying (a mismatch aborts the build) and requires two independent sources — Ghidra plus Capstone, or static reverse engineering plus a runtime oracle. Across all ten binaries, there are only 10 byte patches (32-bit texture flag capture without the startup dialog, WASD/Space/Q menu navigation, and a 4× faster JPEG pixel clear loop at 0x1020437f).
True Hor+ widescreen (16:9 desktop and 19.5:9 phones without stretching) uses four mid-function hooks in host/widescreen.c. Widening the camera projection tangents alone leaves rooms clipped to a 4:3 box because MAX-FX derives portal culling frustums separately — so both must scale together:
// host/widescreen.c: e2mfc P_Camera::validate (0x10114da5) + portal culling (0x67a12d)
void rn_ws_camera(Ctx *c) {
uint32_t cam = c->r[ECX];
float x = ldf(c, cam + 0x200) * scale_x, y = ldf(c, cam + 0x204) * scale_y;
memcpy(c->mem + cam + 0x200, &x, 4);
memcpy(c->mem + cam + 0x204, &y, 4);
}
void rn_ws_portal_first(Ctx *c) {
uint32_t a = c->r[EBP] - 0x10; // tan(fov / 2) in getFirstSceneToRender
float t = ldf(c, a) * scale_x;
memcpy(c->mem + a, &t, 4);
*fr(c, 0) *= scale_y; // st(0) = tan(fov / 2) * viewport height
}
For load-time hot spots, 15 surgical HOST_FUNCS in host/fast.c accelerate pure pixel/JPEG/memory loops in native C/Wasm while falling back to the lifted original on any unhandled case. Under RN_FASTCHECK, the host runs both the fast path and the lifted original and asserts bit-for-bit equality on every output pixel and FPU control word:
| Guest Address | Host Stand-In | Profiled Bottleneck |
|---|---|---|
0x1043a907 | rn_d3dx_convert | D3DX A8R8G8B8 → X8R8G8B8 float round-trip: 35% of level load |
0x1020a080..0x10210920 | rn_jpeg_onepass / idct / ycc / huff | Embedded libjpeg 6a float IDCT on software x87: 40% of load (IDCT offloaded to helper thread) |
0x5dc360 | rn_ldb_import | Streams texture upload + free per map, cutting peak guest heap from 1.25 GB |
0x10203be0 | rn_copy_with_scale | F5 quicksave thumbnail bilinear scale: eliminated ~210 ms gameplay stall |
0x10401b59 | rn_map_readback | Skipped redundant GPU readback inside P_Map::destruct: saved 41–59 ms on comic → game |
5. Phone light version and cold-load engineering
Two strict rules govern every UI and runtime decision: every layout change ships for both desktop and phone, and a phone always plays the light version — original 2001 retail textures inside x_*.ras (dropping the 587-file, 1 GB HD texture pack where Part1_Level1 alone held 466 Mpx of JPEG versus 3.9 Mpx retail), 640 MB memory profile, hard 30 fps pacing, FXAA disabled so mobile text stays sharp, and game-frame-paced touch taps so 120 Hz screens never drop menu presses.

On a local M4, dropping the HD pack cut Part1_Level1 load from 38 s to 5 s. On a cold network (measured at 80 ms RTT and 50 Mbit), serial 256 KB Range XHRs still spent ~59 s in round-trip latency alone (740 requests). Two changes brought cold loads down by 3×:
- 4-thread level-hint prefetch: while WebAssembly boots, four helper threads fetch 2 MB blocks listed in
web/level_hint.tsvinto the block cache with aninflight[]dedup table. - 1 MB immutable gzip pieces (
game-z/<sha256>.gz): compressible archives (x_data.ras,x_english.ras,x_music.ras, exe/DLLs) are sliced into content-addressed 1 MB gzip chunks served from Cloudflare R2 withCOOP/COEP/CORPheaders. Helpers warm the browser's native HTTP cache with no RAM eviction cap.
Network Optimization Stage (80 ms RTT, 50 Mbit, cold part1_level1) | Desktop | Phone (light) |
|---|---|---|
| Baseline: serial 256 KB Range XHRs (740 requests) | 94.1 s | 75.3 s |
| + 4-thread level-hint prefetch (2 MB requests) | 37.2 s | 49.8 s |
| + 1 MB immutable gzip pieces warming browser HTTP cache | 27 s (130 MB) | 24 s (122 MB) |
6. What did not work
Several plausible ideas hit hard platform walls and were cut cleanly rather than papered over:
| Experiment | What happened |
|---|---|
| 32-bit Chrome Android | Refused a 1 GB SharedArrayBuffer; booted at 640 MB, then died on a 35 MB background allocation during level load. |
Emscripten wasm-split | Prototype secondary module is not propagated to pthread workers — incompatible with a multithreaded guest. |
| HD texture pack on phones | Decoding 466 Mpx of re-encoded JPEGs in lifted code stalled a Moto G6 Plus for >5 minutes; replaced by the mandatory light version. |
| Phone HUD as loose discs on an arc | Too spread out for real thumbs; replaced with compact landscape thumb clusters and top utility pills. |
Custom X-Raw-Length header on R2 | rclone copyto rejects non-standard HTTP headers on Cloudflare R2; removed to keep the static deploy contract clean. |
7. Play it and read the code
Play at maxpayne.cc. The full source is on GitHub (no copyrighted game files included), and the 5-layer, 4-wave post-ship audit (89 named findings reconciled across 36 files) lives in the forensic reconciliation book.
In the repo: tools/recomp/images.py · tools/recomp/lift.py · tools/recomp/patches.py · tools/recomp/difftest.py · host/d3d8.c · host/sm1.c · host/fast.c · host/widescreen.c · web/gpu.js · web/audio.js · docs/forensic_reconciliation_book.md
Abre maxpayne.cc en Chrome o Safari, en computadora o en celular, y estás jugando la versión de PC de 2001 de Max Payne (v1.05): desde el Prólogo hasta la Parte III, cómics, bullet time, IA, música, voces y partidas guardadas que sobreviven al recargar la página. No hay ningún emulador de x86 de por medio. Cada ejecutable y DLL del motor se recompiló estáticamente de x86 a C y de C a WebAssembly; un runtime propio en C y una capa de WebGPU/AudioWorklet hacen el trabajo de Windows, Direct3D 8, DirectInput 8 y DirectSound 8.
maxpayne.wasm.br)
1. Diez binarios PE en un solo espacio plano de 32 bits
Después de Need for Speed Underground (un solo Speed.exe monolítico), Max Payne fue una prueba de arquitectura mucho más dura. El motor MAX-FX de Remedy reparte el juego entre MaxPayne.exe, cinco DLL del motor (todas con dirección base preferida 0x10000000) y cuatro DLL del runtime de Visual C++ 6.0. Además, e2_d3d8_driver_mfc.dll se carga dinámicamente como plugin con LoadLibraryA.
tools/recomp/images.py reubica las diez imágenes PE aplicando sus tablas de relocación IMAGE_REL_BASED_HIGHLOW en espacios fijos sin traslape por debajo de HEAP_LO = 0x11000000, resuelve de forma estática todos los imports entre DLL (por nombre, ordinal y forwarders) y deja pasar a la capa host únicamente las llamadas reales al sistema operativo:
10 binarios PE (MaxPayne.exe + 5 DLLs MAX-FX + 4 DLLs VC++ 6.0)
|
v tools/recomp/images.py + frontend.py rebase, enlazado IAT, descubrimiento CFG
|
v tools/recomp/lift.py (2,405 LoC Python) x86 / x87 / MMX -> bloques C
|
v build/gen/*.c + host/*.c (12,936 LoC C) Win32, D3D8, SM1->WGSL, DSound, DInput
|
v Emscripten (-pthread, Brotli-11) maxpayne.wasm.br (14.5 MB)
|
v web/*.js (7,848 LoC JS/HTML) WebGPU, AudioWorklet, OPFS Worker, Touch
| Imagen PE | Base reubicada | Rol | Funciones levantadas |
|---|---|---|---|
MaxPayne.exe | 0x00400000 | Lógica del juego, IA, niveles, cómics, menús, UI | 45,048 |
MFC42.DLL | 0x10600000 | Runtime MFC de VC++ 6.0 | 10,439 |
MSVCP60.DLL | 0x10900000 | Runtime STL C++ de VC++ 6.0 | 3,453 |
e2mfc.dll | 0x10100000 | Grafo de escena MAX-FX, portales, cámara, sprites | 2,780 |
e2_d3d8_driver_mfc.dll | 0x10400000 | Plugin de driver Direct3D 8 + D3DX | 1,897 |
rlmfc.dll | 0x10000000 | Matemáticas, memoria y lectura de archivos RAS | 1,653 |
MSVCRT.DLL | 0x10800000 | Runtime C (_ftol, longjmp, matemáticas, cadenas) | 1,411 |
MSVCIRT.DLL | 0x10a00000 | Runtime iostream clásico | 577 |
sndmfc.dll | 0x10300000 | Motor de sonido 3D, voces y streaming de música | 566 |
grphmfc.dll | 0x10200000 | Texturas, G_Image y libjpeg 6a embebido | 410 |
| Total (10 binarios) | 0 funciones fallidas | 68,234 |
2. Recompilador x86/x87/MMX y el oráculo diferencial Unicorn
Todo el recompilador estático — cargador PE, frontend de flujo de control, lifter x86/x87/MMX y orquestador de compilación — cabe en 2,405 líneas de Python en tools/recomp/. Cada función levantada recibe un puntero Ctx *c con la memoria plana de 32 bits, registros generales, banderas, pila x87 y registros MMX. Las páginas por debajo de 0x10000 nunca se mapean, de modo que cualquier puntero nulo falla de inmediato en lugar de corromper estado en silencio.
La semántica de punto flotante importa mucho en un motor de físicas y portales de 2001. En host/rt.h, la propagación de NaN de x87 sigue la tabla 4-7 del manual de Intel explícitamente (gana el significando mayor; en empate gana el positivo) en vez de depender de la canonicalización del CPU host o de WebAssembly:
// host/rt.h: propagación de NaN x87 (Intel SDM tabla 4-7), independiente de ARM64/Wasm
static inline double fnan2(double a, double b) {
if (a == a) return bitsd(dbits(b) | 0x8000000000000ull);
if (b == b) return bitsd(dbits(a) | 0x8000000000000ull);
uint64_t x = dbits(a) | 0x8000000000000ull, y = dbits(b) | 0x8000000000000ull;
uint64_t mx = x & 0xfffffffffffffull, my = y & 0xfffffffffffffull;
if (mx != my) return bitsd(mx > my ? x : y);
return bitsd(x < y ? x : y); // mismo significando: preferir el que no tiene bit de signo
}
Cualquier cambio a lift.py, rt.h o patches.py pasa primero por difftest.py, que ejecuta funciones levantadas contra el emulador de CPU Unicorn con entradas aleatorias y compara cada registro, bandera, ranura x87 y página de memoria tocada. El build actual pasa 2,000 funciones / 7,940 casos con 0 crashes (1,995/1,996 exactos). Para bugs sutiles en ejecución real, RN_LIFT_TRACE + host/difftrace.c graba una llamada viva del juego y la reproduce instrucción por instrucción frente a Unicorn.

3. Direct3D 8, Shader Model 1.x → WGSL y audio sin bloqueos
Max Payne habla con Windows mediante cuatro subsistemas que no existen en un navegador: Win32/hilos/archivos, Direct3D 8, DirectInput 8 y DirectSound 8. Los reconstruí en 12,936 líneas de C dentro de host/.
- Direct3D 8 → WebGPU (
d3d8.c,ffp.c,sm1.c): implementa tanto el pipeline de función fija de D3D8 (iluminación, niebla, etapas de textura, alpha test) como un decodificador, desensamblador, compilador a WGSL e intérprete CPU de referencia para bytecode Shader Model 1.1–1.4. Incluso las esquinas de WGSL se cuidan de forma explícita:
// host/sm1.c: WGSL prohíbe Inf constante; u.af.z (siempre 0) conserva la semántica D3D8 de RCP(0)
fn d3d_inf() -> f32 { return bitcast<f32>(0x7f800000u | u.af.z); }
fn d3d_rcp(x: f32) -> f32 {
if (x == 1.0) { return 1.0; }
if (x == 0.0) { return d3d_inf(); }
return 1.0 / x;
}
- DirectSound 8 → AudioWorklet (
dsound.c,audio.js): un hilo mezclador en C con interpolación Hermite de 4 puntos escribe floats estéreo en un ring buffer lock-free sobreSharedArrayBuffer. Dentro delAudioWorkletProcessor, un remuestreador lineal en tiempo real (ratio = 44100 / ctx.sampleRate) mantiene afinación y velocidad exactas en hardware a 48 kHz (iOS Safari y Bluetooth) sin costo extra cuando el dispositivo corre a 44.1 kHz. - Partidas guardadas en Chrome y Safari (
opfs.js,files.c): los saves y el registro viven en el Origin Private File System (OPFS) del navegador. Como Safari no implementacreateWritable()en OPFS, toda escritura pasa por un Worker dedicado concreateSyncAccessHandle()y reemplazo atómico para que cerrar la pestaña nunca trunque una partida.
4. Regla de dos fuentes: 10 parches de bytes, widescreen y rutas rápidas verificadas
Cada modificación al código o a los datos originales vive en un solo manifiesto: tools/recomp/patches.py. Cada entrada verifica los bytes originales antes de aplicarse (si no coinciden, el build se detiene) y exige dos fuentes independientes — Ghidra más Capstone, o lectura estática más un oráculo en ejecución. En los diez binarios completos solo hay 10 parches de bytes (bandera de texturas de 32 bits sin el diálogo de inicio, navegación de menús con WASD/Space/Q y un ciclo de limpieza JPEG 4× más rápido en 0x1020437f).
El widescreen real Hor+ (16:9 en escritorio y 19.5:9 en celulares sin estirar la imagen) usa cuatro hooks a mitad de función en host/widescreen.c. Ensanchar solo las tangentes de la cámara deja los cuartos recortados a 4:3 porque MAX-FX calcula el frustum de portales por separado, así que ambos escalan juntos:
// host/widescreen.c: e2mfc P_Camera::validate (0x10114da5) + recorte de portales (0x67a12d)
void rn_ws_camera(Ctx *c) {
uint32_t cam = c->r[ECX];
float x = ldf(c, cam + 0x200) * scale_x, y = ldf(c, cam + 0x204) * scale_y;
memcpy(c->mem + cam + 0x200, &x, 4);
memcpy(c->mem + cam + 0x204, &y, 4);
}
void rn_ws_portal_first(Ctx *c) {
uint32_t a = c->r[EBP] - 0x10; // tan(fov / 2) en getFirstSceneToRender
float t = ldf(c, a) * scale_x;
memcpy(c->mem + a, &t, 4);
*fr(c, 0) *= scale_y; // st(0) = tan(fov / 2) * altura del viewport
}
Para los cuellos de botella de carga, 15 HOST_FUNCS quirúrgicas en host/fast.c aceleran ciclos puros de píxeles, JPEG y copia de memoria en C/Wasm nativo, cayendo al código levantado en cualquier caso no cubierto. Con RN_FASTCHECK, el host corre ambas versiones y comprueba igualdad bit a bit en cada píxel de salida y en la palabra de control del FPU:
| Dirección guest | Reemplazo host | Cuello de botella perfilado |
|---|---|---|
0x1043a907 | rn_d3dx_convert | Ida y vuelta a float A8R8G8B8 → X8R8G8B8 de D3DX: 35% de la carga del nivel |
0x1020a080..0x10210920 | rn_jpeg_onepass / idct / ycc / huff | IDCT en float de libjpeg 6a sobre x87 en software: 40% de la carga (IDCT movido a hilo auxiliar) |
0x5dc360 | rn_ldb_import | Sube y libera cada textura al decodificarla, bajando el pico de heap guest desde 1.25 GB |
0x10203be0 | rn_copy_with_scale | Miniatura del guardado rápido F5: eliminó un tirón de ~210 ms en juego |
0x10401b59 | rn_map_readback | Evitó readback redundante de GPU dentro de P_Map::destruct: ahorró 41–59 ms de cómic a nivel |
5. Versión ligera para celular e ingeniería de carga fría
Dos principios rigen cada cambio de interfaz y runtime: todo cambio de UI sale para ambos formatos (escritorio y celular), y un celular siempre juega la versión ligera — texturas originales de 2001 dentro de x_*.ras (omitiendo el paquete HD de 587 archivos y 1 GB donde solo Part1_Level1 tenía 466 Mpx de JPEG contra 3.9 Mpx retail), perfil de 640 MB, tope estricto de 30 fps, FXAA apagado para mantener nítidos texto y HUD, y toques temporizados por cuadro de juego para que pantallas de 120 Hz nunca pierdan un tap en menús.

En una M4 local, omitir el paquete HD bajó la carga de Part1_Level1 de 38 s a 5 s. En red fría (medido a 80 ms RTT y 50 Mbit), las peticiones Range seriales de 256 KB seguían gastando ~59 s solo en ida y vuelta (740 requests). Dos cambios recortaron la carga fría 3×:
- Prefetch de pistas de nivel en 4 hilos: mientras arranca WebAssembly, cuatro hilos auxiliares descargan bloques de 2 MB listados en
web/level_hint.tsvhacia la caché de bloques con tablainflight[]sin duplicados. - Piezas gzip inmutables de 1 MB (
game-z/<sha256>.gz): los archivos comprimibles (x_data.ras,x_english.ras,x_music.ras, exe/DLLs) se parten en piezas gzip de 1 MB por hash en Cloudflare R2 con encabezadosCOOP/COEP/CORP. Los hilos auxiliares calientan la caché HTTP nativa del navegador sin tope de RAM.
Etapa de optimización en red (80 ms RTT, 50 Mbit, part1_level1 frío) | Escritorio | Celular (ligera) |
|---|---|---|
| Base: XHR Range seriales de 256 KB (740 requests) | 94.1 s | 75.3 s |
| + Prefetch en 4 hilos por pista de nivel (requests de 2 MB) | 37.2 s | 49.8 s |
| + Piezas gzip inmutables de 1 MB calentando la caché HTTP | 27 s (130 MB) | 24 s (122 MB) |
6. Lo que no funcionó
Varias ideas razonables chocaron con límites reales de plataforma y se descartaron de raíz en lugar de emparcharlas:
| Experimento | Qué pasó |
|---|---|
| Chrome Android de 32 bits | Rechazó un SharedArrayBuffer de 1 GB; arrancó con 640 MB y murió en una asignación de 35 MB al cargar el nivel. |
wasm-split de Emscripten | El módulo secundario del prototipo no se propaga a los workers pthread — incompatible con un guest multihilo. |
| Paquete de texturas HD en celular | Decodificar 466 Mpx de JPEG en código levantado trabó un Moto G6 Plus por >5 minutos; sustituido por la versión ligera obligatoria. |
| HUD móvil como discos sueltos en arco | Demasiado separados para jugar con pulgares; reemplazado por grupos compactos en horizontal y píldoras superiores. |
Header personalizado X-Raw-Length en R2 | rclone copyto rechaza encabezados HTTP no estándar en Cloudflare R2; eliminado para mantener limpio el contrato de despliegue. |
7. Juégalo y lee el código
Juega en maxpayne.cc. El código fuente completo está en GitHub (sin archivos con copyright del juego), y la auditoría forense de 5 capas y 4 oleadas (89 hallazgos reconciliados en 36 archivos) vive en el libro de reconciliación forense.
En el repo: tools/recomp/images.py · tools/recomp/lift.py · tools/recomp/patches.py · tools/recomp/difftest.py · host/d3d8.c · host/sm1.c · host/fast.c · host/widescreen.c · web/gpu.js · web/audio.js · docs/forensic_reconciliation_book.md