Repository navigation
v0.4.0: Speed, and System Shock 2 on the PS Vita
Tools only, as always: no game code and no executables are included. You build everything from your own copy of System Shock 2 (NewDark 2.48). The default output is unchanged; everything new for speed is opt-in.
PS Vita backend (new)
port/backends/vita/: the recompiled game on a homebrew-enabled PS Vita (vitaGL). It boots and plays on real hardware, level changes and saves included, at about 15-21 fps exploring and 6-8 fps in heavy firefights. The game's own code on one CPU core is the limit; rendering, file access and sound run on the other cores.- Built with the same
port/build.pyplus the vitasdk toolchain; instructions in[port/backends/vita/README.md](https://github.com/Owloeb/NewDarkRecompiled/blob/v0.4.0/port/backends/vita/README.md). Measurements, what helped and what didn't:[PERF.md](https://github.com/Owloeb/NewDarkRecompiled/blob/v0.4.0/port/backends/vita/PERF.md). - A file layer for the memory card: read windows and read-ahead, written files kept in memory until closed, a 24 MB cache for the sound archives, and a hang watchdog that forces a core dump.
Faster generated code (port/build.py --cache-regs, opt-in)
- Guest registers live in C locals instead of the CPU struct. Indirect calls and imports are held to the calling convention, a new proof (
lift_preserve.py) works out which registers each function preserves, and the x87 stack moves into C locals too (lift_x87.py, about 1.5x on float-heavy code). Indirect calls go through a per-thread cache of recent targets. - Verified at run time with
--abi-check: every call that relies on an assumption checks it and logs any violation. Full play sessions on Linux and the Vita reported none. There are new tests with negative controls (harness/abi_test/run.sh) and random-program fuzzing (csmith_fuzz.py, integer and floating point). How it works:[docs/RECOMPILER.md](https://github.com/Owloeb/NewDarkRecompiled/blob/v0.4.0/docs/RECOMPILER.md#register-caching---cache-regs).
Portable host
- Render thread: the renderer can run on its own core, together with the Direct3D per-vertex work (transform, lighting, fog), at most one frame behind the game. On by default on the Vita;
SS2PORT_RENDER_THREAD=1on the desktop. Ports now implement one extra call,plat_gfx_deferred. - Fast paths (
--fastpaths): native C for the hottest engine functions: string and key hashes, the hash-table lookups behind object queries,_ftol/_ftol2and a bitmap copy. Each one is checked against the game's own instructions in an x86 emulator (port/tests/fastpaths/check.py). - Buffered file writes: level changes were slow under WSL because every small write went straight to disk. They're now fast.
- File reads no longer hold the guest lock, so other guest threads keep running during slow I/O.
- Sampling profiler:
--prof, plustools/fnprof.pyto summarise it. --guest-backedfor platforms without lazy memory commit, and--symbolsfor named crash reports.
Naming the engine
- Play-session recorder (
host/build_win.py --record) andtools/suggest_names.py: play the game and get a work list of which functions run for which activity. - The engine's console command table is harvested automatically (106 commands,
tools/annotate.py); hand-verified key handlers and the AI message factories are insymbols/manual.sym.
Documentation
- Reorganised around what you want to do.
[docs/FLAGS.md](https://github.com/Owloeb/NewDarkRecompiled/blob/v0.4.0/docs/FLAGS.md)lists every build option, command-line flag, environment variable, switch file and tool in one place.
Tests
- Conformance: 509 checks headless, 536 with pixel-exact rendering (also with the render thread on), plain and
--cache-regswith--abi-check. - New suites: render-thread stress test (600,000 random calls, ThreadSanitizer), Vita sound cache, fast paths against the game's own code, and
--cache-regsend to end.
Full changelog: [v0.3.0...v0.4.0](v0.3.0...v0.4.0)