# Spider-Man 2 PS2 Recomp An unofficial, experimental effort to statically recompile the USA PlayStation 2 release of Spider-Man 2 (`SLUS-20776`) for native PC execution. This repository is source-only. It does not contain the game executable, disc image, assets, Sony SDK material, BIOS files, generated recompiled game code, savestates, or copyrighted data dumps. Contributors must supply their own legally obtained copy of the game. ## Status The port is not playable yet. Current native Windows progress: - Boots through the original pink-screen and black-screen blockers. - Initializes IOP/SIF services and streams real sectors from a user-provided disc extraction. - Renders the memory-card warning at 512x448. - Accepts controller/keyboard Cross input and advances to the legal splash. - Renders the Activision and Spider-Man logos on the legal splash. - Still omits the central copyright text and has horizontal placement differences. The current graphics checkpoint is precise: the recomp emits four of the five `TEX0` descriptors observed in the matching PCSX2 legal-splash reference. The missing descriptor is `0x20059485E1412CA5`. See [docs/HANDOFF.md](docs/HANDOFF.md) for evidence and the next experiment. ## Legal Setup You need: - A legally obtained USA Spider-Man 2 PS2 disc image. - A local extraction containing `SLUS_207.76`, `AMALGA.PAK`, `MOVIES.PAK`, `SOUNDS.PAK`, `IOPRP300.IMG`, and the disc IRX files. - Ghidra with a PlayStation 2 Emotion Engine processor extension. - CMake 3.20 or newer. - Visual Studio 2022 Build Tools with C++ support on Windows. Keep the extracted game outside this repository. The helper script rejects a game directory located inside the checkout. Read [docs/LEGAL.md](docs/LEGAL.md) before contributing. ## Quick Start Clone recursively and build the tools/tests: ```powershell git clone --recurse-submodules cd Spider-Man-2-PS2-Recomp cmake -S . -B out/build cmake --build out/build --config Release ``` Create a local config that points at your legal extraction: ```powershell .\tools\New-SpiderMan2Config.ps1 -GameRoot D:\LegalGames\SpiderMan2-PS2 ``` Recompile after exporting or refreshing the Ghidra function map: ```powershell .\out\build\ps2xRecomp\Release\ps2_recomp.exe .\out\spider-man-2-config.toml ``` Generated game code stays local and must never be committed. See [game/SLUS-20776/README.md](game/SLUS-20776/README.md) for the complete workflow. ## Repository Contents - `ps2xAnalyzer`, `ps2xRecomp`, `ps2xRuntime`, `ps2xIOP`: PS2Recomp source plus the current runtime fixes. - `ps2xTest`: regression tests for IOP, SIF, DMA, VIF, VU1, GS, controller input, and kernel behavior. - `game/SLUS-20776`: legal metadata only, including the function-boundary CSV and sanitized config template. - `tools/ghidra-spider-man-2`: headless Ghidra scripts used to recover stripped function boundaries. - `tools/parse_pcsx2_gs_dump.py`: offline GS dump analysis helper. - `docs/HANDOFF.md`: exact continuation state and next experiment. - `docs/VALIDATION.md`: clean-build commands and the latest source-only test result. ## Help Wanted The most useful current contributions are: - Determine why the fifth legal-splash texture descriptor is absent. - Complete VIF/VU1 behavior using focused PCSX2 comparisons and regression tests. - Correct GS sprite placement and legal-splash text rendering. - Improve controller mapping after the first interactive screen is reached. - Keep the full test suite green while extending hardware behavior. - Build a reproducible source-only generation pipeline for contributors with legal media. Do not submit guessed guest-memory patches or hard-coded replacement textures. Fix the first proven protocol or hardware-semantic divergence and add a focused test. ## Upstream This work is based on [ran-j/PS2Recomp](https://github.com/ran-j/PS2Recomp), an experimental PlayStation 2 static recompiler. The public checkpoint starts from upstream commit `f4309cd18c184544f7891058676aaeef64357350` and preserves its GPL-3.0 license. ## Disclaimer This project is not affiliated with or endorsed by Sony, Activision, Marvel, Treyarch, or the original developers and publishers. Spider-Man and related marks are property of their respective owners.