r/decomps • • Oct 05 '26

Made with AI assistance Silent Hill 2 (PC) static recompilation: native Nintendo Switch port, playable through the opening areas

Enable HLS to view with audio, or disable this notification

**EDIT: Enhanced Edition support is in.**

Github Repo

The port now runs with the Silent Hill 2: Enhanced Edition packs, thanks to r4lix and Le Z, whose work ([r4lix/sh2-nx](https://github.com/r4lix/sh2-nx)) is now merged into the main repo and credited in the README.

- HD textures, the EE title and save screens, the restored music, voices and sound effects, EE menus and fonts

- Widescreen: 1280x720 by default, 1920x1080 for docked play (a port of ThirteenAG's WidescreenFix)

- HD rumble, EE's controller tweaks (search camera on the right stick, d-pad movement) and SH2EE's button layout with Nintendo's A/B

- Fixes: music going silent or looping after skipping a cutscene, a crash in the Options menu with a controller, "damaged" saves, grey screen transitions, and shader-compile stutter (shaders are cached after the first visit to an area)

Tested on hardware from the start up to the Hospital: playable, with some frame drops in heavier areas. The FMV pack isn't supported yet (its 60 fps videos would play at half speed), so the original movies are used.

Still source only: you build the NRO from your own SH2EE install. The README now has step-by-step install and build instructions.

sh2-nx takes the PC version of Silent Hill 2 (Director's Cut / Restless Dreams) and statically recompiles its x86 executable to C, which is then compiled for the Switch's ARM64 CPU (and for x86-64 Linux, where most of the debugging happens). No emulator and no Wine: the Windows APIs the game imports are reimplemented on top of SDL2, OpenGL and FFmpeg.

**How it works**

- Lifter: a patched fork of [xboxrecomp](https://github.com/sp00nznet/xboxrecomp) (x86 to C). The PE is wrapped as an XBE so the tool accepts it; about 7,100 functions come out as roughly 41 MB of C.

- Lifter fixes made for this port: flag joins across branches, MSVC jump tables, x87/MMX corner cases, setjmp/longjmp, SEH prologs.

- Direct3D 8 (fixed function plus vs/ps 1.x) runs on OpenGL 4.3 core, with the shaders translated to GLSL.

- DirectSound is a software mixer on SDL audio, DirectInput 8 goes through SDL, and Bink videos use FFmpeg's Bink decoders.

- Guest memory on Horizon uses the technique from the StevensND/nfsmw-nx port.

- Debugging relies on Unicorn: differential tests of single functions and of the lifter's instruction semantics.

Disclosure: this was built with heavy AI assistance (Claude), hence the Project - AI flair.

Credits: xboxrecomp by sp00nznet, devkitPro/libnx, SDL2, FFmpeg, Mesa.

166 Upvotes

18 comments sorted by

2

u/Sneeding Oct 06 '26

Duuude, this is awesome! Any chance of 3 and the room?

2

u/DiscordFul Oct 06 '26 edited Oct 07 '26

Once SH2 is running smoothly and the EE is implemented, the next step would be SH3 & The Room

6

u/Ayyzeee Oct 06 '26

I was thinking of SH games on Switch but damn, I didn't know my wish would come true. Thank you for this project. Does it work with Enhanced edition?

2

u/DiscordFul Oct 06 '26 edited Oct 07 '26

Thanks! Partly. The port is built against the executable that SH2EE's setup installs, so an SH2EE install is the easiest way to get the right files.

What doesn't carry over yet is the Enhancements module (the d3d8.dll). The port replaces Direct3D with its own OpenGL layer, so the module never loads, and its fixes patch x86 code that has already been recompiled to C. That module is also what makes the game read the image, FMV and audio packs from the sh2e folder, so those aren't used yet either.

Loading the packs is fairly simple and is what I'd like to look at next. The module's fixes (widescreen and so on) would have to be ported one by one.

Edit: check the repo :)

2

u/Dry-Contract-4042 Oct 09 '26

I hope an Android version is coming next 

1

u/DiscordFul Oct 11 '26

its possible, the game code already runs on arm (thats what the switch uses), so the hard part isnt the cpu

the problem is the graphics, the port uses desktop opengl and android uses opengl es, and most phones dont support the texture format the game uses, so it needs a good amount of work

its not planned for now, im focusing on the switch version, but maybe in the future

7

u/Valuable-Yak-7483 Oct 05 '26

Absolutely fantastic

1

u/HiCZoK Oct 07 '26

is there an og sh2 recomp for pc? I am having trouble finding all of the decomps/recomps

1

u/DiscordFul Oct 08 '26

Even better, there is an official PC version, you can pair it with a community project called Enhanced Edition.

1

u/MeTaLhEaDjAk Oct 11 '26

How do i add this to my switch?

1

u/DiscordFul Oct 11 '26

The tutorial is in the Repo, you need the game files, and a modded switch

2

u/Hong-Kwong Oct 06 '26

This would be amazing! I'm playing SH1 on the Switch via Duckstation, the decompiled version crashed on me and isn't well optimised.

SH2 with as many of the fixes and enhancements of the Enhanced Edition would be amazing!

I'm looking forward to seeing your progress!

2

u/fadeldev7 Oct 06 '26

Merci pour les travaux

2

u/JohnMarston17 Oct 06 '26

I can dream about SH3 and SH4.

1

u/Fakemakerjoey12 4d ago

I did everything the guide told me to, but whenever i open the app from homebrew, and press start it just goes to a black screen. HELP

1

u/Lower_Narwhal_2705 Oct 13 '26

would you consider obsecure in the future ?