Skip to content

Vectrex

codingncaffeine edited this page Jun 6, 2026 · 1 revision

Vectrex (vecx)

The vecx core uses hardware OpenGL rendering with some non-obvious frontend requirements. On Linux it renders into an FBO via a GL context, read back through the never-blocking PBO ring and presented on the native Wayland toplevel (X11/SDL fallback).

FBO Must Be Sized Before context_reset

SET_HW_RENDER fires during retro_load_game with no geometry information — the frontend creates a placeholder FBO (e.g. 640x480). The core later reports true geometry via retro_get_system_av_info. If context_reset is called while the FBO is still at 640x480, the core locks onto those dimensions — permanently clipping the frame.

Fix: After retro_load_game returns, resize the FBO to max_width x max_height from retro_system_av_info before calling context_reset.

Use Video Callback Dimensions, Not Full FBO

The FBO is square (e.g. 1024x1024 or 1080x1080) but the core renders to a portrait sub-region matching the resolution multiplier (e.g. 869x1080). Reading back the entire FBO via glReadPixels includes black columns on the right, shifting the game left.

Fix: Use width and height from the retro_video_refresh_t callback for glReadPixels — the handler sets UseFullFboReadback => false for exactly this reason (see VectrexHandler.cs). The core's aspect_ratio (~0.8049) is already baked into those dimensions. The Linux default is vecx_res_multi = 3.

AR Correction for Readback HW Cores

Unlike cores that present directly to the window, vecx uses glReadPixels into a CPU buffer displayed like a software frame. The aspect ratio correction (scale transform) must be applied the same way as for software cores — not skipped.

Game Overlays

Vectrex games originally shipped with transparent plastic color overlays on the CRT. The libretro/overlay-borders set provides 1080p PNG versions of 38 game overlays.

Download them from Preferences → Extras (the libretro overlay-borders set). Once downloaded, overlays are enabled by default and matched to your ROMs automatically by filename. Toggle an overlay on or off per game from the in-game cog menu. The matching overlay is rendered as a full-viewport transparent image on top of the game output. Per-game enable/disable state is persisted by VectrexOverlayService.cs.

Clone this wiki locally