How ankushkun/sh23ds works
sh23ds is a native Silent Hill 2 port for Nintendo 3DS, using the player’s converted PC Director’s Cut data. The user workflow is: convert the game with the browser packer, install its output on the SD card, then launch and play through the port. The runtime spans progression and events, player/enemy simulation, camera and world rendering, audio, cutscenes, menus, and saves. The README documents these capabilities, but only a small part of the runtime source was sampled; dashed links mark runtime relationships not established by the excerpts.
Main entry points: main.c Game loop · worker.js Browser worker · core.js Pack conversion · texenc.mjs Texture encoder
Components 23
Game conversion
- Browser worker
site/packer/worker.js - Pack conversion
site/packer/core.js - Texture encoder
site/packer/texenc.mjs
Game runtime
- Game loop
port/source/main.c - Stage progression
port/source/prog.c - Events
port/source/events.c - Player movement
port/source/move.c - Combat
port/source/combat.c - Enemy simulation
port/source/enemy.c - Console profile
port/source/profile.c - Data check
port/source/nodata.c
World and presentation
- Characters
port/source/chr.c - PC camera
port/source/game/view/sh2cam.c - Lighting and fog
port/source/fog.c - Stage and rooms
port/source/room.c
Audio and cinematics
- Audio playback
port/source/audio.c - Background music
port/source/bgm.c - Cutscenes
port/source/demo.c - Movie playback
port/source/movie.c
Menus and persistence
- Menus and controls
port/source/optmenu.c - Map display
port/source/map.c - Save handling
port/source/clearsave.c
Other components
- Player
Connections 22
- Player → Browser worker: selects game
README.md - Browser worker → Pack conversion: runs conversion
site/packer/worker.js - Browser worker → Texture encoder: loads encoder
site/packer/worker.js - Player → Game loop: launches
README.md - Game loop → Console profile: initializes
port/source/main.c - Game loop → Data check: checks data
port/source/main.c - Game loop → Audio playback: initializes
port/source/main.c - Game loop → Stage progression: drives
- Game loop → Events: runs
- Game loop → Player movement: updates
- Game loop → Combat: updates
- Game loop → Enemy simulation: updates
- Game loop → Characters: renders
- Game loop → PC camera: uses
- Game loop → Lighting and fog: renders
- Game loop → Stage and rooms: loads
- Game loop → Background music: plays
- Game loop → Cutscenes: runs
- Game loop → Movie playback: plays
- Game loop → Menus and controls: presents
- Game loop → Map display: displays
- Game loop → Save handling: persists