百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

beetle-psx-libretro

> 编程语言
开源

基于 Libretro API 的 Mednafen PSX 独立端口/分支。

343 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

基于 Libretro API 的 Mednafen PSX 独立端口/分支。

Beetle PSX libretro

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:

  • PBP and CHD file format support, developed by Zapeth;
  • Software renderer internal resolution upscaling, implemented by simias;
  • An OpenGL 3.3 renderer, developed by simias;
  • A Vulkan renderer, developed by TinyTiger;
  • PGXP perspective correct texturing and subpixel precision, developed by iCatButler;
  • OpenBIOS, allowing the emulator to be used without a BIOS file;
  • HD texture replacement caching overhaul (Vulkan renderer), see HD_TEXTURE_CACHE.md;
  • Page-aligned HD texture dump/replacement, an opt-in mode for static/3D art (Vulkan renderer), see PAGE_ALIGN.md;
  • HD Reduce Palette Range, an opt-in hash of only a texture's used palette entries for better replacement match coverage (Vulkan renderer);
  • Video CD playback, including support for the 1 MB SCPH-5903 kernel, see Video CD;
  • HDR10 output (PQ Rec.2020, 10-bit), with highlight roll-off, gamut and reference-gamma controls, see HDR output;

HD texture replacement caching

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.

Page-aligned texture replacement (experimental)

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):

  • HD Dump Mode — Upload-rect / Page-aligned / Both (collect both pack types in one playthrough).
  • HD Replacement Mode — Upload-rect / Page-aligned, with an optional Cross-Mode Fallback so one pack type can fill gaps from the other without converting packs.
  • HD Reduce Palette Range — hash only the CLUT entries a texture actually uses (not the whole CLUT), so one replacement keeps matching across unused/rewritten palette slots; applies to both upload-rect and page paths. Backward-compatible with existing packs.
  • HD Texture Caching Method also gains Lazy (synchronous) — load on first use but block until ready (no pop-in, may briefly stutter when many new textures appear at once).
  • HD Texture Folder — keep the dump/replacement folders under the Content, System or Save directory (auto-created).
  • Live hotkeys (requires RetroArch Game Focus): ] 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.

HDR output

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.

Why a PS1 emulator has anything to put in HDR

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.

Requirements

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.

How the core knows HDR is really on

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.

  • Accepted → HDR encode engaged.
  • Rejected → the core restores 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 nits

Values taken from the frontend

Three 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.

The encode, step by step

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.

Highlight roll-off

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.

Options

Reference Display Gamma

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.

HDR Additive Overbright

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· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言