Skip to content

About

Prototype and Prototype 2 (Xbox 360) for Nintendo Switch: static recompilation with ReXGlue, native Vulkan renderer. Free, not for sale. No game files.

Topics

Resources

Stars

42 stars

Watchers

4 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

PROTOTYPE for Nintendo Switch

Русский

Native Nintendo Switch port of the Xbox 360 version of Prototype (2009), made by static recompilation with ReXGlue: the game's PowerPC code is translated to C++ and compiled to ARM64 for Horizon OS, and its 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 game.

status

Download

Ready builds (NRO, settings, HOME-menu NSP forwarder): see Releases.

What you get

Prototype
Port this project (fungalspores)
Picture 720x400 + FSR 1, adjustable (640 to 1280)
FPS* menus and cutscenes 30-60, gameplay 22-30 (lows 17 instead of 9 since 1.4.0)
Sound yes
Saves yes (fixed)
NPC density adjustable (0%, 5%, 10%, 25%, 50%; 10% recommended)

* 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 on the SD card. FAT32 is fine.

  1. Copy switch/ from the release to the root of the SD card:

    sdmc:/switch/rex-start.nro
    sdmc:/switch/prototype-nx/prototype.nro, prototype.toml
    
  2. Put your game files there:

    • Prototype → sdmc:/switch/prototype-nx/game/ (with default.xex inside)

    From an ISO: extract-xiso -x "Prototype.iso" -d game. $SystemUpdate is not needed.

  3. Install the NSP from nsp/ with DBI and start the game from the HOME menu. It starts through rex-start.nro: it shows the game for five seconds, and + opens its settings (the NPC density) 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 edition

  • Prototype: Xbox 360, title ID 4156084E (Russian edition).

The code is recompiled from one specific default.xex; other editions may not start.

Settings

prototype.toml next to the NRO. Restart the game after a change.

Setting Default
proto_render_width x _height 720x400 internal resolution, 640 to 1280
proto_npc_density 0.10 ambient NPC density, 0.0 to 1.0
p2_native_shadow_max_cascades 2 shadow cascades (4 = the game's own)
p2_min_frame_vblanks 1 60 Hz cap (2 = exactly 30 FPS)
user_language 12 12 Russian, 1 English (depends on your copy)

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 four settings that matter — resolution, NPC density, shadow cascades and the frame cap — and copies every other line through untouched.

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).
  • "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-proto on 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.py routes it to proto_render_width / proto_render_height.
  • Adjustable NPC density: the ambient constants in the generated code are routed to proto_npc_density (src/proto_npc.cpp).
  • 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.
  • UI quality: half-res particle optimisation no longer catches interface layers.

Building

Everything was built on an Android phone (Alpine Linux in PRoot, aarch64) without Docker; a normal Linux box works the same way. Outline:

  1. devkitA64: tools/proot/pull_dka64.py unpacks the arm64 devkitpro/devkita64 image; on musl hosts run tools/proot/patch_dkp.sh and wrap_dkp.sh.
  2. SDK: masseffect-nx at a85b0b4 + patches/rexglue-sdk-masseffect-nx.patch; third-party sources with its tools/fetch_thirdparty.py (rexglue-sdk v0.10.0).
  3. Mesa/NVK: mesa-switch at d4a00ea0ab3 + patches/mesa-switch.patch, then tools/proot/mesa_p2_build.sh.
  4. Prototype: prototype/build.sh (codegen ~1-2 min, NRO ~10-35 min). PGO: build once with -DPROTO_PGO=GEN, play 10-15 minutes, copy sdmc:/pgo-proto off the console and build again with -DPROTO_PGO=USE -DPROTO_PGO_DATA=<that folder> from the same build directory.
  5. Settings screen: rex-start/build.sh (devkitA64 + FreeType from the portlibs).
  6. 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.5.0 --tid 0150524F54310000 --keys <your prod.keys> --out out/. Your own prod.keys only; never publish them.

Credits

License

GPL-3.0 (see LICENSE). 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.

About

Prototype and Prototype 2 (Xbox 360) for Nintendo Switch: static recompilation with ReXGlue, native Vulkan renderer. Free, not for sale. No game files.

Topics

Resources

Stars

42 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages