Retro Porting Toolkit · Bring classic console games to modern hardware

Fit to screen widescreen

Make the view follow the window's shape, from the original 4:3 up to a maximum each game sets, instead of offering only one fixed widescreen size.

Fit to screen is the recommended default shape for widescreen. Instead of one fixed 16:9 mode, the view grows or shrinks to match the window. A 16:9 monitor gets 16:9. An ultrawide gets 21:9 or 32:9. A 4:3 window gets the original game.

The Legend of Zelda: The Minish Cap at its native 240 by 160 view.

The same scene in an ultrawide window. Link and Zelda stay put, and more of the village fills the sides.

What problem does it solve?

A fixed widescreen mode only fits one kind of screen. On a different monitor it is either stretched, cropped or boxed in. Players also resize windows, rotate handhelds and switch between a laptop and a TV.

Fit to screen solves all of those with one setting.

How does it work?

  1. Read the window's drawable size.
  2. Keep the original height. Work out the width that gives square pixels at that height.
  3. Clamp that width between the original width and the game's own maximum.
  4. Render that many columns. If the window changes, do it again.

The view grows with the window until it reaches the game's maximum. Past that, the extra space becomes bars.

The maximum matters. Each game only supports as much width as it can fill with real content. gbarecomp's shared video surface reaches 896 by 160, enough for 50:9, but each game sets its own ceiling inside that, and games that have not opted in stay at 240.

Offer fixed presets too. 16:9, 21:9 and 32:9 are useful when a player wants a stable view, and some features need one.

How do you keep the faithful path?

At a 4:3 window, Fit to screen must produce the original game. No extra margin, no shifted camera, no changed spawns.

Scenes the port does not support should fall back to the original width with bars on the sides. That is better than showing stale or garbage graphics in the margins. Menus, movies and full-screen UI often stay 4:3 on purpose.

What goes wrong?

ProblemWhat to do
The view jumps or tears while resizing.Recompute the width only between frames, and invalidate any margin caches when it changes.
A wider window changes gameplay.If spawns or triggers depend on the view, the wider view is a simulation change. Test it like one. See Widen spawn and cull bounds.
Netplay players see different widths.If the view width can change what the game simulates, players must agree on one fixed width. Mega Man X's netplay only allows the original view or fixed 16:9, 21:9 or 32:9.
Stale tiles appear in the margins.The game is not streaming that area. Fall back to the original width for that scene, or see Fill the edges.

Examples of where it's used

Blinx on XboxLLR. Adaptive follows the window's client size from 4:3 through 32:9, with 16:9, 21:9 and 32:9 presets. Gameplay widens, menus and stage select stay centered 4:3. A fresh launcher defaults to Fit to screen.

Blinx exploring a street in an ultrawide window, with the HUD at the edges.

Jet Set Radio Future on XboxLLR. Widescreen is on by default and follows the window, including ultrawide.

Jet Set Radio Future in a 21:9 window.

gbarecomp. A game opts in with its own maximum view width. The framework handles live resizing and the wider video surface, while each game owns its streaming, camera, spawning and HUD.

Dragon Ball Z: The Legacy of Goku at its native 240 by 160 view.

The same spot at a wider adaptive view, with Goku in the same position. The health bar stays at the top left.

Mega Man X on snesrecomp. Adaptive, 16:9, 21:9 and 32:9 views of expanded gameplay. Its screenshots are on the HUD anchoring, Fill the edges and Widen spawn and cull bounds pages.

Next: once the view is wider, the HUD needs to move. See HUD anchoring.