How codepdbh/nfsu2-recompiled works
This repository provides a statically recompiled Need for Speed: Underground 2 game, with a playable Android ARM64 runtime and a Windows bring-up host. The principal Android workflow runs from launcher configuration and game-data selection through native guest startup, rendering, input, and audio. Supporting branches cover GPU-driver management and diagnostics, plus the Windows host’s runtime hooks and widescreen support. Several Android subsystems are documented in the README but their implementation was not sampled, so those connections are shown as unverified rather than asserted as inspected calls.
Main entry points: guest_runtime.cpp Guest execution · LauncherActivity.java Launcher and settings · main.c Windows game host · GameActivity.java Game activity
Components 24
Android app
- Launcher and settings
android/app/src/main/java/com/nfsu2/androidevolved/LauncherActivity.java - Game options
android/app/src/main/java/com/nfsu2/androidevolved/GameOptions.java - Game activity
android/app/src/main/java/com/nfsu2/androidevolved/GameActivity.java - Touch controls
android/app/src/main/java/com/nfsu2/androidevolved/RacingControlsView.java - Game data
android/app/src/main/cpp/game_data.h
Guest runtime
- Native entry and renderer
android/app/src/main/cpp/main.cpp - Guest boot worker
android/app/src/main/cpp/guest_boot_worker.h - Guest execution
android/app/src/main/cpp/guest_runtime.cpp - Guest memory
android/app/src/main/cpp/guest_memory.h - Guest heap
android/app/src/main/cpp/guest_heap.h - Audio streaming
android/app/src/main/cpp/audio_mixer.h - Gamepad input
android/app/src/main/cpp/gamepad_input.h
Graphics
- D3D9 bridge
android/app/src/main/cpp/d3d9_bridge.cpp - Vulkan driver
android/app/src/main/cpp/vulkan_driver.cpp - DXVK Android port
ports/dxvk_android/android_wsi.cpp
Windows host
- Windows game host
src/host/main.c - Windows runtime
src/runtime/nfs_runtime.c - D3D9 hooks and trace
src/runtime/d3d9_trace.c - Widescreen and pacing
src/runtime/widescreen.c - Runtime logging
src/platform/nfs_log.c
Device support
- GPU driver management
android/app/src/main/java/com/nfsu2/androidevolved/GpuDrivers.java - Diagnostics and updates
android/app/src/main/java/com/nfsu2/androidevolved/Diagnostics.java
Other components
- Player
- Vulkan device
Connections 27
- Player → Launcher and settings: opens
README.md - Launcher and settings → Game options: reads and sets
android/app/src/main/java/com/nfsu2/androidevolved/LauncherActivity.java - Launcher and settings → Game activity: launches
android/app/src/main/java/com/nfsu2/androidevolved/LauncherActivity.java - Game activity → Touch controls: updates controls
android/app/src/main/java/com/nfsu2/androidevolved/GameActivity.java - Game activity → Game options: reads settings
android/app/src/main/java/com/nfsu2/androidevolved/GameActivity.java - Game activity → Native entry and renderer: configures native runtime
- Native entry and renderer → Game data: loads game data
android/app/src/main/cpp/main.cpp - Native entry and renderer → Guest boot worker: starts guest
android/app/src/main/cpp/main.cpp - Guest boot worker → Guest execution: connects runtime
android/app/src/main/cpp/guest_boot_worker.h - Guest execution → Guest memory: uses guest memory
android/app/src/main/cpp/guest_runtime.cpp - Guest execution → Guest heap: uses guest heap
android/app/src/main/cpp/guest_runtime.cpp - Guest execution → D3D9 bridge: calls graphics bridge
android/app/src/main/cpp/guest_runtime.cpp - Guest execution → Widescreen and pacing: uses display hooks
android/app/src/main/cpp/guest_runtime.cpp - Guest execution → Audio streaming: streams audio
- Guest execution → Gamepad input: dispatches input
- D3D9 bridge → Vulkan driver: translates rendering
- Vulkan driver → DXVK Android port: uses DXVK port
- DXVK Android port → Vulkan device: renders on
- Launcher and settings → GPU driver management: manages drivers
android/app/src/main/java/com/nfsu2/androidevolved/LauncherActivity.java - Launcher and settings → Diagnostics and updates: opens diagnostics
android/app/src/main/java/com/nfsu2/androidevolved/LauncherActivity.java - GPU driver management → Game options: persists selection
android/app/src/main/java/com/nfsu2/androidevolved/GpuDrivers.java - Windows game host → Windows runtime: runs guest runtime
src/host/main.c - Windows game host → D3D9 hooks and trace: hooks graphics
src/host/main.c - Windows game host → Widescreen and pacing: applies display fixes
src/host/main.c - D3D9 hooks and trace → Widescreen and pacing: sets resolution
src/runtime/d3d9_trace.c - Windows game host → Runtime logging: records runtime events
src/host/main.c - Windows runtime → Runtime logging: reports runtime events
src/runtime/nfs_runtime.c