Retro Porting Toolkit · Bring classic console games to modern hardware

How does host-native HLE make a port faster?

Keep the faithful LLE path as the reference, then replace expensive groups of LLE parts with host-native HLE that keeps the same contract. Measured on nine toolchains, this is where the big speed gains came from.

A faithful port is often slow at first. That is expected. The low-level path copies the console one small step at a time, and a modern PC has to pay for every step.

The fix is not to make the low-level path less faithful. The fix is to replace groups of low-level parts with one faster part that gives the same answer. What are HLE and LLE? explains the rule. This page shows what it looks like in practice and how much it gained.

Why does LLE come first?

Because you cannot check a fast answer without a correct one.

If a port starts with HLE, a wrong answer can look right just because the game kept running. If it starts with LLE, every later HLE part has something to be compared against.

There is a second reason. A slow, correct port is a stable target. Optimizing too early means you keep re-optimizing code that is still changing. These projects waited until players, including speedrunners using glitches, found the LLE versions behaving like the originals. Only then did the speed work start.

What kinds of speedups are there?

There are three, and each one needs a different kind of proof.

KindWhat changesWhat proves it
Exact host-cost removalNothing the game can see. Inline a hot helper, cache a result until the guest changes its input, turn off unused diagnostics.The output is identical.
Exact replacementA whole subsystem or routine is swapped for a host-native one behind the same seam. A GPU renderer replaces a software one. A native routine replaces a guest leaf function.The output still matches LLE exactly, checked across a set of scenes.
Approved approximationThe result is allowed to differ a little, such as a filter or floating point rounding.The trade-off is written down and its effect is checked. It is never called identical.

The first two are the normal goal. The third is allowed, but it must say what it trades away.

What does an exact replacement look like?

Three examples from real ports.

GBA line compositor. The original renderer works one pixel at a time: find the tile, flip it, look up the palette, check windows and priority, blend. The HLE version decodes a tile span of up to eight pixels at once, decides window rules once per line, and keeps colors in native RGB555 until the line is done. It uses the same entry point and has no cache across lines. Across 128 deterministic test frames covering every video mode, it produced byte-identical output to the original, and gameplay runs of two games matched too. Overall FPS rose about 7% on Mario Kart: Super Circuit and 6% on Mega Man Zero. Small, but exact in every case tested.

GBA high-resolution renderer. At high internal resolution the CPU was doing all the sampling. The new path does that sampling, composition and presentation on the GPU, fed by fixed per-line state from the CPU. The image stays on the GPU. CPU code that needs the image gets a copy only when it asks. A portable CPU version stays behind the same interface for machines without a usable GPU path. On Mario Kart: Super Circuit at 8x widescreen, CPU time per frame dropped from 72.6 ms to 11.8 ms.

PlayStation draw batching. In one Mega Man X4 boss fight, the port sent about 1,300 draw batches per frame. After the change it sends 31 to 63. At 1080p, GPU time per frame fell from 24.9 ms to 15.9 ms and the frame rate rose from 39.8 to 58.7 FPS.

Each of these is one HLE part replacing many LLE steps. None of them changes what the game sees.

What were the results?

Each comparison is two builds of the same game on the same PC, playing the same stretch of gameplay back to back. Most of these games are locked to their original speed, so the win shows up as spare time per frame. That headroom can be spent on higher resolution, widescreen, or weaker hardware.

SystemGame and settingCPU time per frame, beforeAfter
PlayStationApe Escape, 4K9.39 ms5.90 ms
PlayStationMega Man X6, 4x3.89 ms1.99 ms
SNESMega Man X, 16:96.09 ms1.94 ms
SNESSuper Metroid, 16:97.93 ms3.21 ms
Game Boy AdvanceMario Kart: Super Circuit, 8x widescreen72.6 ms11.8 ms
Virtual BoyWario Land9.09 ms4.77 ms
Virtual BoyZero Racers5.14 ms2.68 ms
Sega GenesisSonic the Hedgehog, CRT filter2.14 ms0.72 ms
Original XboxBlinx, 3x (per update)57.0 ms34.4 ms
Nintendo DSMetroid Prime Hunters14.8 ms11.8 ms
NESMetroid10.27 ms8.84 ms
NESThe Legend of Zelda11.58 ms10.22 ms
Master SystemSonic the Hedgehog0.47 ms0.41 ms
Game GearSonic Blast0.64 ms0.56 ms

Master System and Game Gear share one toolchain, so this is nine toolchains.

Some of those gains are easy to feel. Blinx at 3x went from 23.8 to 29.5 updates per second against a target of 30. On a 2013 PC with a GTX 760, Mario Kart: Super Circuit at 8x went from under 25 FPS to over 150.

The source and charts are in Slowing down to speed up.

Why did some systems gain more than others?

Most of the gains came from the 16-bit era and from the high-resolution modes of later systems. Widescreen and high resolution mean more screen to draw, so a costly drawing path costs more there. On SNES, the biggest gains were in widescreen.

The 8-bit systems gained less. Their hardware is simple: a slow CPU, a basic tile and sprite chip, a few sound channels. Reproducing it was never the expensive part. Sonic on the Master System already took under half a millisecond per frame, about 3% of its frame budget.

Did everything work?

No. Every idea was built and measured, and kept only if it won.

On PlayStation, 10 changes shipped and 12 were thrown out. One native geometry engine made Ape Escape 22% slower. On Genesis, about a dozen ideas, including new FM synth kernels, were measured and reverted. On GBA, a native renderer change measured 12.9% less CPU time, but its paired runs varied too much to call it a win, so it stays off by default.

A rejected idea is still useful if it is written down. It stops the next person from trying the same dead end.

What about assembly and SIMD?

They are allowed, with conditions.

  • The fast path is gated by CPU, operating system and ABI at build time, not only by a runtime check.
  • Optional CPU features are detected before they are used.
  • A portable version always stays behind the same interface, so every supported platform still compiles, links and runs.
  • Both paths are tested.

Netplay adds one more rule. Players exchange their CPU features and available paths once, before the match starts, and settle on one shared set. If one player's machine lacks an optimization that has to match, everyone uses the portable path. The choice stays fixed for the whole match.

Where do I go next?