Prototype 2 (Switch)
Prototype 2
Sobre el proyecto
Prototype 2 es un videojuego de acción-aventura de mundo abierto desarrollado por Radical Entertainment y publicado por Activision, y es la secuela de Prototype de 2009. Anunciado por primera vez en los Premios Spike VGA 2010, fue lanzado en abril de 2012 para PlayStation 3 y Xbox 360, y en julio de 2012 para Microsoft Windows. En julio de 2015, el juego fue relanzado junto con su predecesor como el Prototype Biohazard Bundle para PlayStation 4 y Xbox One. Las versiones separadas de los dos juegos estuvieron disponibles en agosto de 2015.
Información oficial del proyecto
[PROTOTYPE] and [PROTOTYPE 2] for Nintendo Switch
Native Nintendo Switch ports of the Xbox 360 versions of Prototype (2009) and Prototype 2 (2012), made by static recompilation with ReXGlue: the games' PowerPC code is translated to C++ and compiled to ARM64 for Horizon OS, and their Direct3D command stream is drawn with Vulkan (NVK/Mesa). No emulator, no Xbox 360 GPU emulation.
Free. Not for sale. News: t.me/fspores
This repository has no game files. You need your own copy of the Xbox 360 games.
Download
Ready builds (NROs, settings, HOME-menu NSP forwarders): see Releases.
What you get
| Prototype | Prototype 2 | |
|---|---|---|
| Port | this project (fungalspores) | penettrator 0.2.0, built from his sources with our fixes |
| Picture | 720x400 + FSR 1, adjustable (640 to 1280) | 800x448 + FSR 1, adjustable (640 to 1200) |
| FPS* | menus and cutscenes 30-60, gameplay 22-30 (lows 17 instead of 9 since 1.4.0) | city 25-30 |
| Sound | yes | yes |
| Saves | yes (fixed) | yes |
* Switch Lite (Mariko) with Horizon OC at CPU 1963 / GPU 1152 / RAM 2333 MHz. Lower at stock clocks.
Install
Needs Atmosphère 1.8.0+ with sigpatches, DBI (or another NSP installer), ~7 GB (Prototype) and ~8 GB (Prototype 2) on the SD card. FAT32 is fine.
-
Copy
switch/from the release to the root of the SD card:sdmc:/switch/prototype-nx/prototype.nro, prototype.toml sdmc:/switch/prototype2-nx/prototype2.nro, prototype2.toml -
Put your game files there:
- Prototype →
sdmc:/switch/prototype-nx/game/(withdefault.xexinside) - Prototype 2 →
sdmc:/switch/prototype2-nx/game_root/(withdefault.xexinside)
From an ISO:
extract-xiso -x "Prototype.iso" -d game.$SystemUpdateis not needed. - Prototype →
-
Install both NSPs from
nsp/with DBI and start the games from the HOME menu. They start throughrex-start.nro: it shows the game for five seconds, and + opens its settings (the internal resolution) written straight into the game's TOML. Without an NSP: hold R while starting any installed game and pick the port in the Homebrew menu. Not from the Album: applet mode does not have enough memory.
Tested editions
- Prototype: Xbox 360, title ID 4156084E (Russian edition).
- Prototype 2:
default.xexSHA-256f6caf82c433b0bb20fe701912388b1e7ee8d6b529d8fc275af960ac2e9ddcab8.
The code is recompiled from one specific default.xex; other editions may not start.
Settings
prototype.toml / prototype2.toml next to the NRO. Restart the game after a change.
| Setting | Prototype | Prototype 2 | |
|---|---|---|---|
| internal resolution | proto_render_width x _height 720x400 | p2_render_width x _height 800x448 | the game itself draws into the smaller frame (scene, depth, effects); FSR scales it to the screen. The height rounds down to a multiple of 16 |
p2_native_max_anisotropy | 1 | 2 | |
p2_native_shadow_max_cascades | 2 | 4 | shadow cascades (4 = the game's own) |
p2_ped_max_scale, p2_vehicle_max_scale | - | 0.15, 0.15 | pedestrians and cars (1.0 = the game's own); crowds cost the most CPU |
user_language: 12 Russian, 1 English (depends on your copy).
Prototype 2 runs on all four CPU cores and heats the console more than the first game. With Horizon OC / sys-clk,
give it (0150524F54320000) its own clock profile. Do not use high overclocks on an Erista (original) console.
Settings screen (rex-start/)
A small homebrew between the HOME icon and the port, after winenx-start: libnx framebuffer, the console's own font through FreeType, no SDL. It offers the internal resolution only (Prototype 640 to 1280, Prototype 2 640x352 to 1200x672, Silent Hill: Downpour too) and copies every other line through untouched (quotes and line endings included); the height follows the width it is paired with. Press nothing and the game starts as before.
What we fixed
Prototype (port from scratch, ReXGlue + the masseffect-nx Horizon SDK + the Prototype 2 NX native renderer):
- Hangs in cutscenes, transitions and after the pause menu: the main thread held the scene critical sections
while waiting for the render thread to drain the full command ring, and the render thread needed them.
The main thread now releases the critical sections it owns while it waits (
src/proto_deadlock_fix.cpp); the render thread drains in place when the ring fills during its own drain. - "Corrupted" saves: the game writes the save file's size into its first word and checks it on load; the SDK
returned the size cached when the file was opened (0). Fixed in
XFile::Write/SetLength. - Console signature stubs (
XeKeysConsolePrivateKeySign/...SignatureVerification) returned "invalid". - Profile-guided optimization with our own profile: an instrumented build writes
/pgo-protoon the SD card (src/proto_pgo.cpp,-DPROTO_PGO=GEN), a play session leaves the counters, and the release is built with-DPROTO_PGO=USE -DPROTO_PGO_DATA=<dir>. - Adjustable internal render size: the game hard-codes a 1280x720 back buffer in
sub_82A0E118;tools/prepare_proto_codegen.pyroutes it toproto_render_width/proto_render_height. - The renderer updated to the one from Prototype 2 0.2.0 (texture cache with eviction, batched occlusion queries, materials no longer disappear after leaving the map open).
- Per-address locks instead of one process-wide mutex for the game's lwarx/stwcx. regions; guest memory
accesses without
volatile(from Prototype 2 NX); audio, 30-60 FPS menus with the native renderer.
Prototype 2 (penettrator's port, built from his GPL-3.0 sources):
- The same SDK fixes (saves, signatures, critical sections).
- A better picture (see Settings).
- No temperature-sensor polling: an open
tssession for the whole game coincided with Horizon OC'shoc:clkcrashing under load (andpcv/ptm/Busafter it).
Prototype, 1.4.0 (Prototype 2 in the 1.4.0 release is the 1.3.0 build; the same changes made it softer and slower there and are not shipped for it yet):
- PGO is back. Releases 1.2.0 and 1.3.0 were built without the profile by mistake (the release builds came from
a build directory configured without it);
tools/make_release.shnow refuses a build without the profile. - Speed patches from mgr-nx-deko on the generated code (
tools/mgr/): a gueststwcx.is__atomic_compare_exchange_ninstead of__sync_bool_compare_and_swap, which GCC follows with admb ishon the A57 (611 barriers after a store-exclusive in Prototype, 24 left); the 16-byte byte reversal of every vector load and store is REV64 + EXT that GCC folds into one constant TBL, instead of a mask load, an AND and a TBL (vector ANDs 9687 -> 1770); constant word shuffles are one permutation instead of a chain of lane inserts. The lowest frame rate in fights went from about 9 to 17 fps. - The pipeline cache and the prewarm list are fsync'd before the rename: leaving through HOME lost the session's compiled pipelines, and the next start compiled them again. A splash with the credit is shown for 3 seconds before each game (skip with A/B/+).
Building
Everything was built on an Android phone (Alpine Linux in PRoot, aarch64) without Docker; a normal Linux box works the same way. Outline:
- devkitA64:
tools/proot/pull_dka64.pyunpacks the arm64devkitpro/devkita64image; on musl hosts runtools/proot/patch_dkp.shandwrap_dkp.sh(cc1/cc1plus/lto1 must stay unpatched, called through ld-linux). - SDK: masseffect-nx at
a85b0b4+patches/rexglue-sdk-masseffect-nx.patch; third-party sources with itstools/fetch_thirdparty.py(rexglue-sdk v0.10.0). Hostrexglue:cmake -S sdk -B out/host -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DREXGLUE_ENABLE_TRACY=OFF && ninja -C out/host rexglue(on musl add-lucontext_posix -lucontext; without/dev/shmrun it withLD_PRELOADoftools/proot/shmshim.c). - Mesa/NVK: mesa-switch at
d4a00ea0ab3+patches/mesa-switch.patch, thentools/proot/mesa_p2_build.sh(needs meson >= 1.7, Rust nightly + rust-src + rustfmt, a dynamically linked bindgen 0.73+, mesa_clc/vtn_bindgen2 from a native Mesa build). - Prototype:
prototype/build.sh(codegen ~1-2 min, NRO ~10-35 min). PGO: build once with-DPROTO_PGO=GEN, play 10-15 minutes, copysdmc:/pgo-protooff the console and build again with-DPROTO_PGO=USE -DPROTO_PGO_DATA=<that folder>from the same build directory. - Prototype 2: as in penettrator's
docs/BUILD.en.md: codegen ofproject/prototype2_manifest.toml, thentools/prepare_switch_codegen.py,prepare_no_volatile.py,prepare_switch_hot.pyandcmake -S switch -B build/switch ... -DP2_DIRECT_CALLS=ON -DP2_GUEST_LTO=ON -DP2_LEAF_LOCALS=ON -DP2_ARM_VMX=ON(~25 min with LTO). - Settings screen:
rex-start/build.sh(devkitA64 + FreeType from the portlibs). - NSP forwarders:
forwarder/build_forwarder.py --launcher sdmc:/switch/rex-start.nro --nro sdmc:/switch/prototype-nx/prototype.nro --icon art/icon_prototype.jpg --title Prototype --author fungalspores --version 1.4.0 --tid 0150524F54310000 --keys <your prod.keys> --out out/(needs Forwarder-Mod9853bd9cloned toforwarder/loader). Your ownprod.keysonly; never publish them.
Credits
- penettrator — the Prototype 2 port (prototype2-nx). Thank you!
- NebadasSwifty — masseffect-nx, the SDK with the Horizon layer.
- StevensND — the Horizon layer of ReXGlue and nfsmw-nx.
- R-drg — project8-sw, the base of the native renderer.
- tuancapoo: mgr-nx-deko, the post-codegen speed passes in
tools/mgr/. - Tom Clay and the ReXGlue SDK; the Xenia project.
- danfromtico — mesa-switch; the Mesa project.
- Skywalker25 — Forwarder-Mod; switchbrew (libnx); devkitPro.
- AMD FidelityFX Super Resolution 1.
License
GPL-3.0 (see LICENSE); third-party components under their own licenses (prototype2/THIRD_PARTY_NOTICES.md).
Prototype is a trademark of its owners. This project is not affiliated with Radical Entertainment, Activision,
Microsoft or Nintendo and contains none of their files.
