基于 Libretro API 的 Mednafen PSX 独立端口/分支。
Beetle PSX is a port/fork of Mednafen's PSX module to the libretro API. Beetle PSX currently runs on Linux, OSX and Windows.
Notable additions in this fork are:
This fork overhauls the Vulkan renderer's HD texture replacement pipeline so packs stay smooth on demanding content — particularly multi-palette animated sprites like Alucard in Castlevania: Symphony of the Night. It adds a three-tier, decode-once cache (VRAM images → RAM pixels → disk, LRU-evicted), binds cached textures in the same frame they're drawn to eliminate per-frame pop-in, and decodes PNGs on a 4-thread pool. New core options let you choose the caching method — Eager (the stock-Beetle default: prefetch all of a texture's palettes) or Lazy (load each texture+palette on demand) — and set the VRAM/RAM cache budgets (defaults 3 GB / 2 GB). The on-disk pack format is unchanged. Full details: HD_TEXTURE_CACHE.md.
Tested with RetroArch 1.22.2 (git 69a4f0e, build date Nov 20 2025, Compiler: MinGW 10.2.0 64-bit) on Windows.
An opt-in alternative to per-upload-rectangle HD textures: the Vulkan renderer can dump and replace at whole VRAM texture-page granularity (clean 256×256 tiles) instead of the fragmented upload-rectangle sections, which is friendlier for authoring static backgrounds, UI and 3D art. It layers on top of the HD texture cache above and reuses the same three-tier cache, IO pool and budgets. Default behaviour is unchanged (upload-rect), so existing packs are unaffected.
Options (all default to the classic upload-rect behaviour):
Upload-rect / Page-aligned / Both (collect both pack types in one playthrough).Upload-rect / Page-aligned, with an optional Cross-Mode Fallback so one pack type can fill gaps from the other without converting packs.] toggles HD replacements with an on-screen message; ' reloads replacements from disk.Page packs and upload-rect packs are not interchangeable (the hash covers a different region of VRAM). Full details and the authoring workflow: PAGE_ALIGN.md.
With Color Format set to 30-bit Color (HDR), the Vulkan and OpenGL renderers present HDR10 — 10 bits per channel, PQ-encoded, Rec.2020 — instead of the historical 8-bit-per-channel output. Set it and restart; everything else below is optional tuning.
Two separate things, and it is worth keeping them apart because they are solved by different parts of the pipeline.
Precision. The renderer already carries more than 8 bits internally. At any internal resolution above 1x, upscaled gradients are computed at higher precision than the 8-bit output can express, so the final quantisation is where banding is introduced — not the source material. A 10-bit output keeps what the renderer already had.
Range. The PSX blends by adding: additive semi-transparency sums the source and destination, and where translucent layers stack the result exceeds white. On an 8-bit path that overshoot is clamped and the detail inside it is gone. A wide float framebuffer keeps it, and the HDR encode maps it into the headroom above reference white instead of throwing it away.
Neither is an invention of new detail. Both are about not destroying detail the renderer already produced.
| Renderer | Vulkan or OpenGL. The Software renderer has no HDR path and ignores every option here. |
| Frontend | Must accept SET_PIXEL_FORMAT(HDR10_2101010). |
| Display | An HDR-capable screen, in HDR mode, with the frontend's HDR output enabled. |
| Restart | Color Format takes effect on restart. The rest apply immediately. |
The core does not guess. RETRO_PIXEL_FORMAT_HDR10_2101010 is a contract: it
tells the frontend the presented image is PQ Rec.2020, and a frontend that
cannot present HDR10 is required to reject it rather than silently
down-convert. So the return value is authoritative.
XRGB8888 and falls back to the 24-bit path.
Nothing is half-enabled and nothing is quietly wrong.Either way it is logged, so a configuration that did not take is visible rather than mysterious:
[Color Format] 30-bit HDR requested: engaged (paper white 200 nits, gamut 0, output mode 1).
[HDR] Display peak: 1000 nitsThree values are the frontend's to own, not the core's, and are queried rather than configured here:
| Value | Source | Used for |
|---|---|---|
| Paper white | GET_HDR_PAPER_WHITE_NITS |
Where reference white lands, in nits |
| Display peak | GET_HDR_MAX_NITS |
The ceiling highlights roll off toward |
| Colour Boost | GET_HDR_EXPAND_GAMUT |
Which gamut rotation is applied |
RetroArch's paper-white and Colour Boost sliders change at runtime and do not fire the core's option-update path, so all three are re-queried every frame while HDR is active and take effect on the next present. Display peak is re-read for the same reason: a stale value silently changes how highlights roll off, which is harder to notice than a brightness shift.
If the frontend answers nothing, the fallbacks are the HDR10 reference: 200 nits paper white, 1000 nits peak.
Applied at the display stage, to the finished frame.
1. Linearise. The framebuffer is gamma-encoded, so it is decoded to linear light with the transfer selected by Reference Display Gamma.
This is applied to the whole value, including anything above 1.0 left by
additive blending. That is deliberate and it matters. Decoding only [0,1]
and treating the overshoot as if it were already linear mixes two domains in
one sum, and the slope then steps by headroom / (2.4 × paper_white) —
1.67× at 200/1000 nits — exactly at reference white. That contours any
gradient crossing white and makes dither grain visibly coarsen at the same
threshold. One transfer across the whole range keeps the encode continuous.
Content in [0,1] is unaffected: every transfer maps 1.0 to 1.0, so ordinary
colour lands on paper white and the roll-off below never engages. The
standard range maps onto the SDR result.
2. Source primaries. If Source Colour Primaries is not Rec.709, a
matrix rotates the coordinates from the assumed authoring display. Applied in
linear light.
3. Scale to paper white. Linear light is multiplied by the frontend's paper-white value.
4. Highlight roll-off. Everything above paper white is compressed toward the display peak. See below.
5. Gamut rotation. Rec.709 to the target container, keyed to the frontend's Colour Boost, using the same matrices RetroArch applies — so switching between SDR and HDR10 does not shift saturation.
6. PQ encode. SMPTE ST.2084 over 0–10000 nits.
headroom = peak_nits − paper_white_nits. Overshoot is normalised against it
and compressed by a shoulder function.
HDR Highlight Roll-Off selects the shoulder:
| Curve | Behaviour | |
|---|---|---|
| Reinhard (Soft Knee) (default) | o/(o+1) |
Gentle, gradual |
| ACES (Filmic) | 1 − e^(−o) |
Rises faster, reaches peak sooner, punchier |
Only over-white content is affected. Everything in the standard range is identical either way.
Two details that are easy to get wrong and are handled explicitly:
Both shoulders have unit slope at the origin. That is what keeps the
encode C1-continuous where overshoot meets reference white. A Narkowicz ACES
fit was used here previously and has slope 0.214 at the origin — it dropped
the slope 4.7× exactly at white, which is a visible step. Normalising it
restores the origin slope but sends the peak derivative to ~8.4, trading the
step for a worse spike just above white. 1 − e^(−x) has unit slope at the
origin, a maximum derivative of 1, and is cheaper than the rational fit.
The knee is driven by the brightest channel, and the overshoot is scaled by that shared factor. Kneeing each channel independently compresses the brightest hardest, which desaturates hot coloured highlights toward white — a saturated additive red would wash out as it got brighter. Sharing the factor preserves the overshoot's chromaticity, so a hot red stays red.
If the frontend reports a peak at or below paper white, headroom clamps to zero and the roll-off degenerates to a clamp at paper white, which is correct rather than a negative range.
Which display transfer the console's output is assumed to be viewed through. Used to linearise before the HDR encode, and to decide what "average" means when supersampled or multisampled samples are combined — those estimate emitted light, so they are averaged as light rather than as stored values.
| Suits | |
|---|---|
| BT.1886 (Gamma 2.4) (default) | Matches the frontend's own SDR→HDR conversion and a TV-like reference |
| Gamma 2.2 | A PC monitor tracking sRGB's nominal gamma |
| sRGB (Piecewise) | How Windows composites SDR content onto an HDR desktop; lifts shadow detail |
This is a viewing-reference choice, not a correctness one. It decides whether HDR lands at the same brightness the 24-bit path did on your display. Against a 2.2 monitor, 2.4 is 12.9% down in linear light at code 0.5 and 24.2% down at 0.25 — which reads as "HDR looks dimmer and more contrasty". If you see that, try Gamma 2.2 or sRGB (Piecewise).
All three agree exactly at 0.0 and 1.0, so paper white and the roll-off knee do not move, and all extend monotonically past 1.0 so the additive overshoot decodes with the same curve as everything else.
Whether additive and subtractive blend sources may exceed reference white.
| Behaviour | |
|---|---|
| Off (Reference White Sources) (default) | Each source is clamped to reference white before blending, matching real hardware. Highlights rise above white only where translucent layers stack. |
| On (Boosted Sources) | Bright modulated sources push roughly twice as hard, for punchier single-layer glow — lasers, lightning, flames — at the cost of accur |
暂无开放 Issues,或尚未同步最近议题。