[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111356":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":8,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":14,"starSnapshotCount":14,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},111356,"NFSU2-Revived-Android","mininxd\u002FNFSU2-Revived-Android","mininxd",null,"C",83,17,1,9,0,13,28,8,47.07,false,"main",true,[],"2026-11-23 04:49:27","2026-11-23 17:42:52","\u003Cdiv align=\"center\">\n\n# Need for Speed Underground 2 — Revived (Android)\n\n### Static Recompilation of SPEED2.EXE into Native C (x86 & ARM64)\n\n[![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPlatform-Windows%20x86%20%7C%20Android%20ARM64-blue.svg)](#requirements)\n[![Graphics](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGraphics-Direct3D%209%20%7C%20Vulkan%20(DXVK)-orange.svg)](#features)\n[![Audio](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAudio-AAudio%20%7C%20DirectSound-green.svg)](#features)\n[![Netcode](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMultiplayer-Prometheus%20Adhoc%20Relay-purple.svg)](#features)\n[![Latest Release](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Fmininxd\u002FNFSU2-Revived-Android?color=brightgreen)](https:\u002F\u002Fgithub.com\u002Fmininxd\u002FNFSU2-Revived-Android\u002Freleases\u002Flatest)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT%20(Tooling)-lightgrey.svg)](#legal--disclaimer)\n\n\u003Cp>\n  \u003Cem>NFSU2 Revived is a native ARM64 Android port of \u003Cstrong>Need for Speed: Underground 2\u003C\u002Fstrong> (x86-32 \u003Ccode>SPEED2.EXE\u003C\u002Fcode>), statically recompiled into portable C with Vulkan graphics acceleration, low-latency audio, native free-roam multiplayer, and customizable touch and gamepad controls.\u003C\u002Fem>\n\u003C\u002Fp>\n\n[⚡ Features](#features) • [📥 Downloads](#downloads) • [📱 Android Setup](#android-setup-guide) • [🏗️ Architecture](#architecture-overview) • [📊 Status](#project-status) • [🛠️ Build](#building-from-source) • [👥 Credits](#credits--attribution) • [⚖️ Legal](#legal--disclaimer)\n\n---\n\n\u003C\u002Fdiv>\n\n## Downloads\n\n| Package | Target ABI | Minimum Requirements | Link |\n|---|---|---|---|\n| **NFSU2 Revived APK** | `arm64-v8a` | Android 10+ (API 29), Vulkan 1.1+ | [Download Latest Release](https:\u002F\u002Fgithub.com\u002Fmininxd\u002FNFSU2-Revived-Android\u002Freleases\u002Flatest) |\n\n> [!NOTE]\n> **Game assets are not included.** You must provide original PC game files from a legally owned copy of Need for Speed: Underground 2.\n\n---\n\n## Features\n\n- **⚡ Static Binary Recompilation**: Recompiles 27,742 x86 functions into standard C99 code. Executes directly on target hardware without dynamic binary translation, JIT compilation, or hypervisor emulation overhead.\n- **🚗 Unlocked Regional Cars**: Unlocks and integrates European-exclusive cars (**Peugeot 106** and **Opel Corsa**) directly on NTSC game files, available in Career car lot, Quick Race car selection, and AI opponent rosters.\n- **🛠️ Gameplay & Engine Fixes**: Built-in 3D ground shadow alignment fix, damaged glass fix, high-framerate pacing adjustments, and dedicated hydraulic bounce\u002Flift control buttons.\n- **🌋 DXVK Native Vulkan Acceleration**: Translates Direct3D 9 calls to Vulkan via an embedded DXVK Native runtime, featuring widescreen rendering, texture caching, and low-overhead frame pacing.\n- **🌐 Native Free Roam Multiplayer**: Built-in C companion (`libnfsu2_roam.so`) connecting directly to Prometheus Adhoc infrastructure (`adhoc.eahub.eu`). Synchronizes online player cars, 3D body kits, positions, and minimap markers in Bayview free roam with zero port forwarding.\n- **🎮 Input Flexibility & Dynamic Mapping**:\n  - **Customizable Touch Controls**: Drag-and-drop on-screen controls editor with button scaling, custom positioning, and layout presets (*Classic*, *Xbox*, *PlayStation*).\n  - **Dynamic In-Game Synchronization**: Touch buttons and tilt steering dynamically mirror custom keyboard mappings configured in the in-game options menu.\n  - **Physical Controller Support**: USB and Bluetooth gamepads recognized as DirectInput controllers with normalized Z-Axis triggers and standard button labels (A, B, X, Y, bumpers, D-pad).\n  - **Gyroscope Steering**: Tilt-based steering with configurable sensitivity and deadzones.\n- **🚀 Energy-Aware CPU Scheduling (EAS)**: Integrated topology inspection in Rust (`libperf_cores.so`) and C (`roam_android.c`) detecting CPU capacities and frequencies to pin critical simulation and audio threads to high-performance (Big\u002FPrime) cores.\n- **🔊 Low-Latency AAudio Output**: Native PCM audio streaming with thread priority elevation and underrun protection.\n- **🖥️ Resolution & FPS Scaling**:\n  - Dynamic render resolution presets (25%, 50%, 75%, 720p, Native Display).\n  - Configurable frame rate limits (30 FPS, 60 FPS, 120 FPS, Uncapped) to balance battery consumption and thermals.\n- **🌍 Native Localization**: Automatically detects and loads localized game assets (English, Spanish, French, German, Italian, etc.) directly from device storage.\n\n---\n\n## Android Setup Guide\n\n### 1. Install the APK\nDownload and install the latest `NFSU2-Revived-v*-arm64.apk` from the [Releases](https:\u002F\u002Fgithub.com\u002Fmininxd\u002FNFSU2-Revived-Android\u002Freleases\u002Flatest) page.\n\n### 2. Copy Game Files\nPrepare a clean PC installation of **Need for Speed: Underground 2** (US v1.2 recommended). Place the game files on your device using either method:\n\n- **Method A (Folder)**:\n  Copy the entire game folder contents to internal storage at:\n  ```\n  \u002Fsdcard\u002Fnfsu2\u002F\n  ```\n  *(Expected layout contains `SPEED2.EXE`, `GLOBAL\u002F`, `CARS\u002F`, `TRACKS\u002F`, `SOUND\u002F`, etc.)*\n\n- **Method B (Direct Cache Zip)**:\n  Compress your game files into a zip archive named `NFSU2_GameFiles.zip` and place it at:\n  ```\n  \u002Fsdcard\u002Fcache\u002FNFSU2_GameFiles.zip\n  ```\n  The launcher will automatically extract the game files to `\u002Fsdcard\u002Fnfsu2\u002F` on first launch.\n\n### 3. Launch & Configure\n1. Open the **NFSU2** launcher on your phone and grant storage permissions when prompted.\n2. Select your desired display resolution, FPS cap, and game language.\n3. Tap **Launch Game** to start racing.\n\n> [!TIP]\n> **Lag or Stutter on HyperOS \u002F MIUI \u002F ColorOS \u002F One UI?**\n> If your game stutters in fullscreen but runs smoothly when the status bar is pulled down, read our [OS Lag & Refresh Rate Troubleshooting Guide](readme_os_lag.md) for quick device-specific fixes.\n\n---\n\n## Architecture Overview\n\n```mermaid\nflowchart TD\n    subgraph INPUT[\"Original Executable\"]\n        EXE[\"SPEED2.EXE (x86-32 PE)\"]\n    end\n\n    subgraph RECOMP[\"Static Binary Recompilation Pipeline\"]\n        DISASM[\"Disassembly & Block Analysis (pcrecomp disasm32)\"]\n        LIFT[\"Instruction Lifting (lift32 + simd32)\"]\n        CORE[\"Portable C99 Core Engine (27,742 Functions \u002F ~8.9M LOC)\"]\n        \n        EXE --> DISASM\n        DISASM --> LIFT\n        LIFT --> CORE\n    end\n\n    subgraph PLATFORMS[\"Target Platforms\"]\n        subgraph WINDOWS[\"Windows Host (x86)\"]\n            WIN_HOST[\"Native MSVC Host Runtime (Win32 \u002F D3D9 \u002F DSound)\"]\n        end\n\n        subgraph ANDROID[\"Android Runtime (ARM64)\"]\n            direction TB\n            subgraph SUBSYSTEMS[\"Native Subsystems\"]\n                DXVK[\"DXVK Native (Direct3D 9 to Vulkan 1.1 \u002F 1.3)\"]\n                AAUDIO[\"AAudio Low-Latency Audio Backend\"]\n                ROAM[\"libnfsu2_roam.so (Prometheus Adhoc Free Roam)\"]\n                PERF[\"libperf_cores.so (Rust EAS Core Pinning)\"]\n            end\n\n            subgraph CONTROLS[\"Input & Controls\"]\n                ACTION_SYNC[\"In-Memory Action Reflection (0x86e89c)\"]\n                TOUCH[\"RacingControlsView (Custom HUD & Tilt Steering)\"]\n                PAD[\"Physical Gamepad Bridge (Normalized Z-Axis)\"]\n                ACTION_SYNC --> TOUCH\n                ACTION_SYNC --> PAD\n            end\n\n            APP[\"Android App Launcher & NativeActivity (Java \u002F NDK)\"]\n            \n            SUBSYSTEMS --> APP\n            CONTROLS --> APP\n        end\n    end\n\n    CORE --> WINDOWS\n    CORE --> SUBSYSTEMS\n```\n\nThe pipeline lifts disassembled 32-bit x86 instructions into platform-independent C code. System calls and platform libraries (Direct3D 9, DirectSound, DirectInput, Win32 API) are bound to native host bridges:\n\n- On **Windows**, calls route directly to native system runtime libraries.\n- On **Android**, rendering calls route to Vulkan via DXVK Native, audio routes through AAudio, and input events route through the Android NDK and touch overlay system.\n\n---\n\n## Project Status\n\n| Milestone \u002F Subsystem | Platform | Status | Implementation Details |\n|---|---|:---:|---|\n| **C Code Lifting (M0)** | Portable | **Complete** | 27,742 functions lifted into C99 with 0 lift errors. |\n| **Windows Host (M1–M8)** | Windows | **Complete** | MSVC compilation, D3D9 device initialization, window management. |\n| **Intro FMVs & Audio** | Win \u002F Android | **Complete** | Video playback and multichannel audio streaming via DirectSound\u002FAAudio. |\n| **Car Models & Shaders** | Win \u002F Android | **Complete** | Correct 16-bit flag parsing; car geometry, vinyls, rims, reflections active. |\n| **In-Game Races & Physics** | Win \u002F Android | **Playable** | Circuit, Sprint, Drag, Drift, and Outrun races fully functional. |\n| **Android ARM64 Runtime** | Android | **Playable** | Stable gameplay on modern ARM64 devices with Vulkan graphics. |\n| **Free Roam Multiplayer** | Android | **Complete** | Prometheus Adhoc UDP sync with 3D player presence and minimap icons. |\n| **Custom Touch Controls** | Android | **Complete** | Dynamic scancode mirroring, customizable HUD layout, tilt steering. |\n| **Controller \u002F Joypad** | Android | **Complete** | DirectInput pad device enumeration, normalized Z-Axis triggers, button labels. |\n| **Thread Pinning (EAS)** | Android | **Complete** | Automatic binding of worker threads to Big\u002FPrime CPU cores. |\n\n### Win32 & DirectX Library Translation Coverage\n\n![NFSU2 Library Progress](library-progress.svg)\n\nThe translation surface tracks all Win32 and DirectX 9 functions imported by `SPEED2.EXE` and required by the Android native runtime. Progress can be viewed, updated, and regenerated using `scripts\u002Flibrary_progress.py`.\n\n---\n\n## Tested Game Executable\n\nThe recompilation tables, widescreen hooks, and memory offsets are validated against the standard v1.2 US retail executable:\n\n| Property | Value |\n|---|---|\n| **File Name** | `SPEED2.EXE` |\n| **File Size** | 4,800,512 bytes |\n| **SHA-256 Checksum** | `f9dd86c054878ce6276beb07c1fd61874f7a1e4bf1f241b084c65b73e24168a7` |\n| **Format** | Unpacked PE32 x86 executable (clean `.text` section, intact relocations) |\n\n*For deep binary details and symbol reconstruction notes, see [docs\u002FNFSU2_BINARY_REPORT.md](docs\u002FNFSU2_BINARY_REPORT.md) and [docs\u002FNFSU2_RECON.md](docs\u002FNFSU2_RECON.md).*\n\n---\n\n## Requirements\n\n### Android Build\n- Android SDK Platform 35 (Android 15) \u002F Minimum SDK 26 (Android 8.0+)\n- Android NDK r25c or newer (Clang ARM64)\n- Vulkan 1.1+ capable device (Vulkan 1.3 recommended)\n- Java Development Kit (JDK) 17\n\n### Windows Host (Optional Development Tooling)\n- Windows 10 \u002F 11 64-bit\n- Visual Studio 2022 \u002F 2026 with C++ x86 Desktop toolset\n- Python 3.10+ with `capstone`, `pefile`, `unicorn`, `keystone-engine`\n\n---\n\n## Building from Source\n\n### Android APK\n\n1. Clone the repository with submodules:\n   ```bash\n   git clone --recursive https:\u002F\u002Fgithub.com\u002Fmininxd\u002FNFSU2-Revived-Android.git\n   cd NFSU2-Revived-Android\n   ```\n\n2. Build the release APK with Gradle:\n   ```bash\n   cd android\n   .\u002Fgradlew assembleRelease\n   ```\n   The built APK will be generated at `android\u002Fapp\u002Fbuild\u002Foutputs\u002Fapk\u002Frelease\u002Fapp-release-unsigned.apk`.\n\n### Native C Lifter Pipeline (Host)\n\n```bash\n# 1. Initialize MSVC x86 build environment\nsource scripts\u002Fvsenv.sh x86\n\n# 2. Normalize executable relocations\npython scripts\u002Fnormalize_exe.py \"$GAME_DIR\u002FSPEED2.EXE\" work\u002FSPEED2.analysis.exe\n\n# 3. Extract seeds (vtables and RTTI)\npython ..\u002Fpcrecomp\u002Ftools\u002Fcpp\u002Fvtable_scan.py work\u002FSPEED2.analysis.exe --seeds work\u002Fvtable_seeds.json\npython ..\u002Fpcrecomp\u002Ftools\u002Fcpp\u002Frtti.py work\u002FSPEED2.analysis.exe --seeds work\u002Frtti_seeds.json\n\n# 4. Generate catalog & lift assembly to C99\npython scripts\u002Frun_lift.py catalog work\u002FSPEED2.analysis.exe work\u002Fseeds_all.json work\u002Fcatalog.json\npython scripts\u002Frun_lift.py lift work\u002FSPEED2.analysis.exe work\u002Fcatalog.json src\u002Frecomp\u002Fgen\n\n# 5. Compile Windows host binary\nscripts\u002Fbuild.sh\nscripts\u002Frun.sh\n```\n\n---\n\n## Technical Documentation\n\nDetailed deep-dives on the recompilation internals and platform backends:\n\n- [Android Runtime Architecture](docs\u002FANDROID_RUNTIME.md)\n- [OS Refresh Rate & Lag Optimization (HyperOS \u002F MIUI \u002F ColorOS)](readme_os_lag.md)\n- [Audio Pipeline & Frame Pacing](docs\u002FAUDIO_FRAME_PACING.md)\n- [Threading & Synchronization](docs\u002FTHREADING.md)\n- [Direct3D 9 Usage & Translation](docs\u002FD3D9_USAGE.md)\n- [Function Recovery & Lifting Strategy](docs\u002FFUNCTION_RECOVERY.md)\n- [Binary Analysis Report](docs\u002FNFSU2_BINARY_REPORT.md)\n\n---\n\n## Credits & Attribution\n\nThis project is **NFSU2 Revived**. Full credit and attribution to the pioneering developers and projects that made this possible:\n\n- **[codepdbh\u002Fnfsu2-recompiled](https:\u002F\u002Fgithub.com\u002Fcodepdbh\u002Fnfsu2-recompiled)** — Original static binary recompilation of `SPEED2.EXE`, Windows host implementation, and foundational Android port & launcher.\n- **[Manuel Peña (manuelpllull)](https:\u002F\u002Fgithub.com\u002Fmanuelpllull)** — R36S handheld port ([nfsu2-recompiled-r36s](https:\u002F\u002Fgithub.com\u002Fmanuelpllull\u002Fnfsu2-recompiled-r36s)) and widescreen hook research.\n- **[sp00nznet\u002Fpcrecomp](https:\u002F\u002Fgithub.com\u002Fsp00nznet\u002Fpcrecomp)** — Underlying static binary recompilation engine and x86 lifter framework.\n- **[doitsujin\u002Fdxvk](https:\u002F\u002Fgithub.com\u002Fdoitsujin\u002Fdxvk)** — Vulkan-based Direct3D 9 translation layer.\n- **[ThirteenAG\u002FWidescreenFixesPack](https:\u002F\u002Fgithub.com\u002FThirteenAG\u002FWidescreenFixesPack)** — Widescreen display enhancements and aspect ratio scaling.\n- **[ExOptsTeam\u002FNFSU2ExOpts](https:\u002F\u002Fgithub.com\u002FExOptsTeam\u002FNFSU2ExOpts)** — Reference research for regional car unlocks.\n- **[th0mk\u002Fnfsu2-web](https:\u002F\u002Fgithub.com\u002Fth0mk\u002Fnfsu2-web)** — Reference web implementation and touch controls layout.\n\n---\n\n## Legal & Disclaimer\n\n- **Need for Speed**, **Underground**, **EA**, and all associated logos, game titles, assets, and trademarks are the intellectual property of **Electronic Arts Inc.**\n- This project is an independent reverse engineering and software preservation research initiative for educational purposes.\n- **No proprietary game code, binaries, music tracks, videos, textures, or 3D models are hosted or distributed in this repository.**\n- All original code authored for this port (lifter modifications, Android bridge, native companions, launcher, and scripts) is licensed under the [MIT License](LICENSE).\n","这是一个将《极品飞车：地下狂飙2》（PC版SPEED2.EXE）静态反编译并原生移植到Android ARM64平台的开源项目。项目通过静态二进制重编译技术，将x86汇编逻辑转换为可移植C99代码，结合嵌入式DXVK实现Direct3D9到Vulkan的高效图形转换，并支持AAudio低延迟音频、Prometheus Adhoc协议的免配置自由漫游多人联机。适用于在Android设备（Android 10+、Vulkan 1.1+）上运行原版游戏资源的怀旧玩家与模拟器技术研究者。",2,"2026-11-24 04:40:55","CREATED_QUERY"]