Engineering

Side project · Active · 2026

DuskOnVita

An unofficial PS Vita port of Twilight Princess that runs the game’s decompiled code natively on the console, without emulation.

Hyrule Field bridge on the console, 5 to 11 Nov
18.3 → 29.1 FPS
Source: Hyrule Field bridge on the console, 5 to 11 Nov
static-geometry hits compared with the original in verify mode, 0 mismatches
337,408
Source: static-geometry hits compared with the original in verify mode, 0 mismatches
dated console runs in the public log, 2 rejected ones included
52
Source: dated console runs in the public log, 2 rejected ones included
Twilight Princess running on a PS Vita 1000 in Ordon village, Link standing next to a villager
Version 0.9.0 in Ordon, on a real PS Vita 1000.

C++ · GXM · VitaSDK · CMake · Docker · Python

Problem

Could the PS Vita run Twilight Princess natively, at the original 30 FPS, with the game behaving exactly as it was made?

I wrote the Vita side with AI assistance. That covers the GX-to-GXM renderer, audio, input, memory, the settings page and the measurement tools.

Constraints

  • The game speaks GameCubeEvery GPU command is translated to the Vita’s GXM API while the game runs. An app gets 3 ARM Cortex-A9 cores, at up to 444 MHz.
  • The game must stay exactA speed-up that is on by default gives the same result bit for bit. Anything that changes the simulation is an opt-in setting.
  • No game data in the downloadPlayers bring their own disc. The button prompts and the LiveArea pictures are drawn in code.

Critical point 1 of 3

One frame took 154 ms. The game needs 33.

On 22 October the port ran Link’s house at 6.3 FPS, with everything on one core. Preparing vertices alone cost 66 ms, 43% of the frame. I moved the GameCube command decoding to a second core and stopped re-checking geometry the game had not changed.

One frame took 154 ms. The game needs 33. Build v61 · 22 Oct. 154 ms · 6.34 FPS · one core.
PartmsShare
Game simulation128%
J3D draw building2013%
GX command decode3120%
Vertex preparation6643%
vitaGL calls2516%
Total154100%
  • 33 ms budget · 30 FPS
  • 66 ms · under 15 FPS the game itself slows down
One frame of build v61 in Link’s house, in milliseconds, to scale.docs/PERFORMANCE.md

Critical point 2 of 3

Same output, checked 337,408 times.

A speed-up is on by default only if it gives the same result as the original code. Each one has a verify mode that runs both and counts differences. Static geometry passed 337,408 comparisons with 0 mismatches.

Same frames, same input

Original code
Fast path

337,408comparisons, static geometry

0mismatches

Static geometry was checked in the emulator. The matrix fast path went through the same check on the console: 10.6 million products, 0 differences.docs/PERFORMANCE.md

Critical point 3 of 3

Every console run is in the log.

I measure speed only on a real PS Vita 1000 and log each run with what changed. The log holds 52 runs. Two were faster and I rejected them because they dropped draws. Ordon village still runs at 9.9 FPS in its widest view.

  • one console run, any place
  • the Hyrule Field bridge
  • Link’s house, 22 → 23 Oct: 6.34 → 20.24 FPS, several changes
  • struck through: rejected, draws were lost
Every console run is in the log.
DateRunFPSNote
22 Oct 2026v53r2 · Link’s house8.59
22 Oct 2026v53r2 · Ordon, outside Link’s house7.20
22 Oct 2026v54 · Link’s house8.19Rejected: draws were lost (uniform failures)
22 Oct 2026v54 · Ordon, outside Link’s house9.65Rejected: draws were lost (uniform failures)
22 Oct 2026v61 · Link’s house6.34
22 Oct 2026v61 · Ordon, outside Link’s house7.39
23 Oct 2026g2c-vgl · Link’s house20.24
23 Oct 2026g2c-vgl · Ordon, outside Link’s house22.94
23 Oct 2026g2c-vgl · Faron fight11.71
23 Oct 2026g2c-gxm · Link’s house19.45
23 Oct 2026g2c-gxm · Ordon, outside Link’s house27.23
23 Oct 2026g2c-gxm · Faron fight14.04
28 Oct 2026b1 · Ordon, outside Link’s house27.92
28 Oct 2026b1 · Ordon village centre11.81
28 Oct 2026b1 · Castle Town, twilight16.73
28 Oct 2026b1 · Kakariko, twilight12.84
28 Oct 2026b1 · Hyrule Field bridge19.56
28 Oct 2026b1 · Faron fight11.59
28 Oct 2026b2 · Ordon, outside Link’s house27.44
28 Oct 2026b2 · Ordon village centre12.35
28 Oct 2026b2 · Castle Town, twilight19.80
28 Oct 2026b2 · Kakariko, twilight12.60
28 Oct 2026b2 · Hyrule Field bridge18.90
28 Oct 2026b2 · Faron fight11.50
5 Nov 2026b3 · Ordon, outside Link’s house27.57
5 Nov 2026b3 · Ordon village centre12.30
5 Nov 2026b3 · Castle Town, twilight19.26
5 Nov 2026b3 · Kakariko, twilight12.72
5 Nov 2026b3 · Hyrule Field bridge19.55
5 Nov 2026b3 · Faron fight11.74
10 Nov 2026p1-control · Ordon village centre12.29
10 Nov 2026p1-gx · Ordon village centre13.05
10 Nov 2026p1 · Ordon village centre13.87
10 Nov 2026p1-perf · Ordon village centre15.60
10 Nov 2026p1 · Hyrule Field bridge28.15
10 Nov 2026p1 · Kakariko, twilight14.72
10 Nov 2026p4 · Ordon village centre14.35
10 Nov 2026p4 · Ordon, outside Link’s house28.83
10 Nov 2026p4 · Kakariko, twilight15.49
10 Nov 2026p4 · Faron fight14.53
11 Nov 2026p5 · Kakariko, twilight16.53
11 Nov 2026p5 · Castle Town, twilight25.77
11 Nov 2026p5 · Hyrule Field bridge29.14
11 Nov 2026p5 · Ordon, outside Link’s house28.81
11 Nov 2026p5 · Faron fight14.63
12 Nov 2026p8 · Ordon village, its widest view8.72
13 Nov 2026p12 · Ordon village centre15.59
13 Nov 2026p12 · Kakariko, twilight18.61
13 Nov 2026p12 · Ordon village, its widest view9.87
13 Nov 2026p12 · Palace of Twilight, entrance13.72
13 Nov 2026p12 · Snowpeak Ruins, room 919.26
13 Nov 2026p12 · Hyrule Field, the enemy areas14.48
30 FPS, the original game
under 15 FPS the game itself slows down
Link’s house, 22 → 23 Oct: 6.34 → 20.24 FPS, several changes
Each dot is one run’s average. Hover a dot for its build, place and figure.docs/benchmarks.csv

Result

On the Hyrule Field bridge, 18.3 FPS became 29.1.

The same six places, measured on 5 November and again on 10 and 11 November. Version 0.9.0 boots from the player’s own disc image, plays the opening in Ordon and saves on a real PS Vita 1000.

On the Hyrule Field bridge, 18.3 FPS became 29.1.
Placebefore (FPS)after (FPS)Note
Hyrule Field bridge18.329.1
Castle Town, twilight21.127.0
Ordon, outside Link’s house28.529.5
Kakariko, twilight12.214.9
Faron fight11.714.6run averages
Ordon village centre11.913.6to 10 Nov
30 FPS, the original game
Link standing still, drawn at 75 % with the play profile.README, “Numbers”