Commit Graph
4529 Commits
Author SHA1 Message Date
libretroadmin ae0d9d456d menu: C89 in the three drivers' cut-off message box lines
materialui, xmb and ozone reset box_wrap.len between two declarations,
which the C89 build refuses (-Werror=declaration-after-statement).
The reset follows the declarations.
2026-11-16 13:02:32 +01:00
LibretroAdmin 6bac0e5c24 ozone: a message box taller than the screen is drawn
ozone_draw_messagebox() kept the box's position in size_t. For text
taller than the screen the top of it is above the screen, a negative
float stored into an unsigned: the box landed off the screen and the
cut to fit dropped every line, so nothing of the box was drawn - not
its text, not its buttons. The position is an int now, as XMB's and
MaterialUI's are.
2026-11-16 12:02:26 +01:00
LibretroAdmin 61e55fd782 gl2: the XMB effects in a build with Cg and no GLSL
Since the menu installs its effects, gl2 made them from GLSL only, and
a build with Cg but no GLSL drew no background effect. Each effect now
carries a Cg source for GL as well (cg_gl in the effect description,
the six gl_shaders/pipeline_*.cg.h back, the ribbon's built from the
shared ribbon code as D3D9's is), and gl2 makes the program from it
when there is no GLSL program to be had. The Cg programs live in a
context of their own (gfx/drivers_shader/shader_gl_cg.h), so they
outlive the backend's context, which a preset change remakes, and go
with the video driver. Like the GLSL ones they draw from the mesh's
buffer, with their uniforms found once.

Two things drew wrong under Cg and are dealt with here:
- The backend's own program leaves its vertex arrays on between draws,
  and one of them is the attribute an effect's position aliases. Left
  on, it won: the ribbons were drawn from the wrong vertices, the
  simple ribbon a solid blot of layer on layer. An effect's draw now
  turns the backend's arrays off first.
- The Ribbon's glow left its GLSL program bound. gl2 under GLSL binds
  a program for every draw, but the Cg backend's ARB programs do not
  unbind it, and a GLSL program wins over them: everything after the
  glow went through it, a grey screen. The glow's passes now unbind
  their program when done.

gl2 also sets the GLSL dialect for its context whatever the shader
backend, so the GLSL effects build under a Cg chain too.

Test: samples/gfx/menu_effects/menu_effects_cg_test.c (make check-cg),
run in samples-gfx under Xvfb (Cg finds its profiles through GLX). In a
legacy GL context, through the Cg backend itself, every effect's Cg
compiles in its ARB profiles and draws the same whether or not the
backend's own program drew just before, and the glow leaves no GLSL
program bound. Without the two changes above it fails on the ribbon,
the simple ribbon and the glow.
2026-11-16 11:50:35 +01:00
LibretroAdmin 22ba917922 libretro-common: word_wrap_offset(), with a test
menu_wrap_offset(), which finds where a byte of a string landed in its
word_wrap() or word_wrap_wideglyph() wrap, moves to stdstring.c beside
them as word_wrap_offset(), and MaterialUI and XMB call it from there.

It gave a glyph the wide-glyph wrap had put a line end before the
offset of that line end, so the input dialog's caret sat at the end
of the line above; it now gives the glyph's own.

word_wrap_offset_test wraps plain, wide-glyph and mixed text at every
width from 1 to 39, with line ends left or made NUL as the drivers
make them, and checks that every character lands on itself or on the
line end its space or newline became, in order, that the end lands
on the end, that no wrap more than doubles its text, and that the
caret before a word moved to the next line is on that line. It found
the wrong offset and the wide-glyph wrap's runaway at narrow widths.
2026-11-16 11:49:11 +01:00
LibretroAdmin b4fce6fdfc menu: draw the input dialog's text from where it was last wrapped
MaterialUI and XMB joined the input dialog's label and typed text into
a stack buffer every frame, only for the wrap cache to find it the same
as the text it kept. menu_input_dialog_text_is() compares the label and
the typed text with the kept text in place, and while they match the
box is drawn from the kept text itself: the two are joined again only
after a key changes what is typed.
2026-11-16 11:31:07 +01:00
LibretroAdmin b2e58b9389 rgui: draw a message box again only when it changes
With a box up, rgui_set_message() forced a redraw every iteration and
the box's drawing forced one for the next, so RGUI repainted its whole
framebuffer every frame; and the runloop marked the framebuffer dirty
whenever a box was up, so it was uploaded every frame too - for a box
that stays the same until it is answered.

RGUI now keeps the text and button state the framebuffer shows, and
redraws when the text, the box, the highlighted button or the one
under the pointer changes, or once more when the box is gone. A box
no longer marks the framebuffer dirty by itself: RGUI marks it when it
repaints. The pointer and animations still redraw as before.
2026-11-16 11:31:03 +01:00
LibretroAdmin 45ca066beb menu: firmware dialog - one button row's room, and its text borrowed
The missing firmware dialog added room for a button row of its own to
the box in Ozone, XMB and MaterialUI, on top of the room every driver
now makes for a confirm's buttons, which left a gap under them the
height of a second row. That room is gone, with the variables it
left unused.

The dialog's text was copied into menu_state_msg every iteration;
menu_state_text now points at it, as at a built-in confirm's. A load
job freed with the dialog still up takes the dialog down with it, so
the menu never draws a freed message.
2026-11-16 11:25:40 +01:00
Craig Carnell 881b1d41d1 Show a dialog when firmware is missing when it is required for launching a core 2026-11-16 11:25:36 +01:00
LibretroAdmin 9b6b5f6ded menu: place the input dialog's caret in the text's own wrap
MaterialUI and XMB found the caret's line and column by copying the
text up to the cursor to the stack and wrapping that copy, and the
text up to the input line again for a selection: up to three wraps a
frame, with two copies. A wrap only turns whitespace into line ends
and adds line ends, so menu_wrap_offset() walks the box's own wrapped
lines to where the cursor's byte landed. The input dialog's text now
uses the box's kept wrap too, wrapped again only as it is typed.

The prefix's wrap could break differently from the text's: with the
cursor before a word that moved to the next line, the caret sat after
the previous line's last space. It now sits where the character is.
2026-11-16 11:22:01 +01:00
LibretroAdmin 6848606aa4 menu: measure a box's button labels only when they change
MaterialUI, XMB and Ozone measured each button's label with the font
on every frame a confirm box was up. menu_dialog_label_widths() keeps
the widths with the label strings and the font they were measured in,
and measures again only a label that is new, or every label when the
font, its size or the font generation moved. A label is told apart by
its string: another language's is another pointer. The drivers read
the widths in place.
2026-11-16 11:17:36 +01:00
LibretroAdmin 384c9e5404 ozone: fade the message box from the frame, not from shared flags
The box's fade ran on three bits of ozone->flags. The main thread set
two of them every iteration (the render_messagebox callback, and the
input handler clearing one unless the keyboard was up) while frame()
read and wrote them - on the video thread under threaded video, where
the two threads' read-modify-writes of the same word could lose each
other's bits, these or any other.

frame() now fades the box in when its frame carries one, or the
keyboard is up, and out when neither is, keeping whether it showed
one in a field only it writes. The render_messagebox callback is gone;
ozone_render() takes whether a box is up from the menu's own state.
2026-11-16 11:17:23 +01:00
LibretroAdmin ff35e8d193 ozone: wrap and measure a message box's text only when it changes
The box's text was wrapped and every line measured with the font each
frame, though it stays the same for as long as the box is up. The
handle now keeps the wrapped lines and the longest width with the text
and font they were made from, and a frame with the same text, font
and width draws from them. The text is copied only when it changes,
and a box cut short to fit the screen is wrapped again.
2026-11-16 11:12:30 +01:00
LibretroAdmin 3b9846235d xmb: wrap and measure a message box's text only when it changes
The box's text was wrapped, sometimes twice, and every line measured
with the font each frame, though it stays the same for as long as the
box is up. The handle now keeps the wrapped lines, the width they were
wrapped to and the longest line, with the text and the layout they
were made for (screen, font, button row), and a frame with the same
text and layout draws from them. The text is copied only when it
changes. The input dialog's line, which changes as it is typed, is
wrapped as before, and a box cut short to fit the screen is wrapped
again.
2026-11-16 11:12:25 +01:00
LibretroAdmin 331f287879 materialui: wrap and measure a message box's text only when it changes
The box's text was wrapped and every line measured with the font each
frame, though it stays the same for as long as the box is up. The
handle now keeps the wrapped lines and the longest width with the text
and font they were made from, and a frame with the same text, font
and width draws from them. The text is copied only when it changes.
The input dialog's line, which changes as it is typed, is wrapped as
before, and a box cut short to fit the screen is wrapped again.
2026-11-16 11:12:22 +01:00
LibretroAdmin d4330754f1 menu: hand the message box's text over with the frame
XMB, MaterialUI and Ozone copied the box's text into their handles on
the main thread every iteration, and their frame() read it there - on
the video thread under threaded video, with nothing ordering the write
against the read. Ozone also read the menu's own buffer from frame().

The frame info now carries the text: video_info->menu.msgbox points at
the menu's buffer, and the threaded wrapper gives a frame that has a
box its own copy, as it does the statistics text. Without the wrapper
the drivers draw the menu's text in place, with no copy at all. XMB
and MaterialUI no longer need a render_messagebox callback; Ozone's
only sets its fade flags, and its fade animations are tagged with the
alpha they drive.
2026-11-16 11:01:34 +01:00
LibretroAdmin 3020a024fa rgui: measure a message box line's glyphs once
Each line's UTF-8 length was counted for the box's width and again to
centre it when drawn; the first count is kept for the second.
2026-11-16 10:56:13 +01:00
LibretroAdmin 294e68294c rgui: draw the message box from the menu's own text
rgui_set_message() copied the menu's text into a 1 KiB array in the
handle every iteration, for rgui_render() to draw a moment later on
the same thread. The handle now borrows the menu's string: it belongs
to the menu handle, outlives the driver's data, and is only rewritten
by the next menu iteration, after this one's render.
2026-11-16 10:56:09 +01:00
LibretroAdmin 0e48f64456 ozone: keep the message box's text in the handle
ozone_messagebox() freed and strdup'd the text every iteration, while
the frame drew it - on the video thread under threaded video. The
fade animations were tagged with that string's address, which changed
each iteration, so the fade-out never matched the fade-in it kills,
and a context reset dropped the string without freeing it.

The text now goes into a buffer in the handle: no allocation per
frame, and a tag that stays put.
2026-11-16 10:56:06 +01:00
LibretroAdmin 63d82eae74 xmb: keep the message box's text in the handle
xmb_messagebox() strdup'd the text every iteration and xmb_frame()
copied it to the stack and freed it, so a box on screen cost an
allocation, a free and two copies per frame. Under threaded video the
frame runs on the video thread, which freed the main thread's string.

The text now goes into a buffer in the handle, which the frame draws
in place and empties.
2026-11-16 10:56:03 +01:00
Davey Hughes 52342b0223 menu: center a confirm box with its buttons (#20109)
Ozone, XMB, MaterialUI and RGUI centered a confirm box on its text and
then added the button room below it, so every box with buttons hung
low: the Security Warning, Quit's confirm, Check Core Signatures Off
and the first-run prompt. The box was only lifted when its bottom left
the screen.

Each driver now centers the whole box, text and buttons, and still
never lifts it above the top of the screen, so a box taller than the
screen is laid out as before. The plain message box is unchanged.

core_warning_test checks that RGUI centers the warnings' boxes and the
Check Core Signatures Off confirm.
2026-11-16 10:50:52 +01:00
LibretroAdmin e3cdcbe82b menu: the menu installs its effects; drivers draw any effect
The six XMB background effects (ribbon, simple ribbon, simple snow,
snow, bokeh, snowflake) were baked into every video driver as fixed
shader slots, VIDEO_SHADER_MENU to VIDEO_SHADER_MENU_6. Each driver
carried its own copies of the sources, built them whether or not a menu
used them, and had a case per slot in its draw code.

Now the menu owns them. XMB keeps one table of the effects
(menu/drivers/xmb_effects.h) with each effect's sources for every
backend - GLSL (legacy and core), SPIR-V, HLSL SM3 and SM4, Metal and
GX2 - and how it draws (a mesh or a quad, its blend, whether it takes
the ribbon data, whether it flips Y). XMB installs them through
gfx_display_effect_install() and draws one by handing the draw its
effect. The drivers have a single generic path: an effect_install
callback that makes a program from the backend's source, and a draw
that goes by the effect's flags. VIDEO_SHADER_MENU..MENU_6 are gone,
and so is the shader backend's init_menu_shaders.

Installs are kept in a small lock-free table in gfx_display. The
programs are made on the drawing thread when the first effect is
drawn, all at once, so nothing is compiled while an effect is on
screen. When the video driver goes away the programs are dropped and
made again under the next one.

What this removes or speeds up:
- Menus that draw no effect (Ozone, MaterialUI, RGUI, XMB with the
  effect off) build no effect programs at all.
- GL: effect draws use their own program with every uniform and
  attribute location looked up once at compile. Before, every effect
  draw looked up "time", "Ribbon" and "OutputSize" by name through
  the shader backend, with prefix retries, each frame. The quads draw
  from the full-screen mesh's buffer, as the ribbon draws from its
  own: no vertices are uploaded per draw, and nothing is read from
  client memory, which a core profile does not allow.
- GL core: effects no longer switch to and from the shader chain's
  program through the chain path; the chain program is put back only
  after an effect was drawn.
- D3D9 (HLSL and Cg): the constant registers/parameters are found once
  when an effect is compiled, not on every draw.
- Vulkan: display.pipelines shrinks from 9 to 3 (plastic stays at its
  own slot); the effect pipelines are made from the effect's own
  SPIR-V and remade with the passes.
- D3D12: effect bytecode is compiled once; only the PSOs are remade
  when the render target format changes.
- The seven Cg effect sources (gl_shaders/pipeline_*.cg.h) are gone.

Unchanged: the plastic effect and the stock shaders keep their ids;
fonts and other menus use them, and moving them buys nothing.

Behaviour notes:
- GL (gl2) effects need GLSL; a Cg-only GL build no longer draws
  them.
- GL core draws effects only when built with slang (they come from
  the SPIR-V); without it the background is plain.
- D3D9 HLSL no longer falls back to stock shading when an effect
  fails to compile; the effect is skipped instead.

Tests:
- samples/gfx/menu_effects (new): every effect carries a source for
  every backend, its flags hold together, and each source names the
  inputs and uniforms the drivers set for those flags. Each GLSL
  program is made through shader_glsl.c as gl2 makes it - GL legacy
  and core profile, GLES 3 and 2, on Mesa's EGL device - its
  locations checked and drawn once into a framebuffer. The SPIR-V goes
  through spirv-val. Cross-built with mingw-w64, the HLSL is compiled
  under Wine as D3D9 (SM3), D3D10/11 (SM4) and D3D12 (SM5) compile it;
  what Wine's compiler does not yet support (SM1 branches and loops,
  atan) is reported as skipped. Run in samples-gfx and
  samples-gfx-d3d.
- samples/gfx/gfx_display_mesh covers install-once, re-making after
  the driver is lost, and no draw without an install.
- samples/gfx/d3d9_failed_lock's ribbon test follows the new ids.
2026-11-16 08:42:12 +01:00
davey 303e9087c4 menu: Ozone, XMB and MaterialUI keep a confirm on screen
The box is centred on its text, so the buttons' room only grows it
downward: at scale 1.50 the Security Warning ran off the bottom in
XMB and MaterialUI, and in Ozone on a short screen. A box whose bottom
would leave the screen now moves up, never above the top. If it is
still too tall, XMB first wraps it wider by the font's measured width;
then the box is drawn as tall as the screen with the buttons at its
bottom and the text cut back to the last whole paragraph that fits, or
to a line ending in "..." when the first paragraph alone doesn't.

A named row too wide for the box drops its icons; one too wide even
then stacks its buttons one under another, each as wide as the text
column, and a stack whose labels still don't fit drops its icons too.
Text, buttons and hit boxes move together; boxes that fit are drawn as
before.
2026-11-16 07:12:20 +01:00
davey 3d041547e0 menu: draw a confirm's buttons as one row inside the box
Every confirm's buttons come from one getter: Cancel and OK for a
classic confirm, the named buttons of the Security Warning with the
highlighted one lit.

RGUI draws them as one row. When three don't fit its narrowest
layouts they stack one per line, the box widening to the widest
button up to the framebuffer's width, and the box stays on screen. A
button wider than the screen is lit where it shows.

Ozone, XMB and MaterialUI lay the row out from the box's bottom edge,
so it no longer drifts onto or under that edge as the text grows, as
the first-run downloads prompt showed. XMB and MaterialUI placed it
from the text's top, mirrored, about half a line further down per
line of text. In XMB and MaterialUI a row wider than the screen no
longer widens the box past it, and MaterialUI's row stops one margin
inside each side of the screen; Ozone stops the box at the screen's
width and packs from the left.

The Security Warning's highlighted button is drawn with the cursor in
Ozone and on the selection colour in XMB and MaterialUI. Its buttons
carry their pad icons, and in XMB and MaterialUI Cancel and OK keep
theirs. In Ozone every button keeps room for an icon, so nothing
moves with the highlight, and icon and label are centred on the ink,
in the cursor as drawn.

The Security Warning harness now taps each button through RGUI under
a scripted mouse, including a click that wakes the screensaver and a
tap begun on a box since replaced.
2026-11-16 07:12:20 +01:00
davey b54fc15ea9 core signatures: Settings > Core > Check Core Signatures
The value lives in the trust store, not retroarch.cfg, so no config
file can turn the checks off. Turning them off always asks first with
the OK/Back confirm, even with confirmations off; turning them on asks
nothing. The row is hidden when the feature is inactive, and in a
session whose store couldn't be read it shows its value but says it
can't be changed.

The row is a switch like Core Lock's: Left and Right leave it alone
when it already sits on that side, and Start resets it to On.
2026-11-16 07:12:20 +01:00
LibretroAdmin 8498482587 xmb: Ribbon Particles setting
The ribbon's drifting specks of light are drawn only with Ribbon
Particles on, off by default like Ribbon Glow and Plastic Effect. With
it off the ribbon draws its sheet alone, as Simple Ribbon does, and
the glow is made of what the ribbon draws. The Wii U, which builds the
specks on the CPU, skips them too.
2026-11-16 05:52:51 +01:00
Codex 7219a7e189 rgui: retain upscale column maps across frames
Rebuild the horizontal map only when its source or output width changes, and invalidate it when scratch storage is freed. Keep the infrequent map builder separate using RGUI_NOINLINE so it does not disturb the unscaled path.

Reuse the existing scratch allocation and preserve upload-buffer loans and fallback copies. Cover dirty-frame reuse, changed pixels, width changes and height-only reuse in the menu framebuffer fixture.
2026-11-16 05:45:39 +01:00
LibretroAdminandJean-André Santoni 08a6f540cb xmb: new ribbon, Ribbon Glow and Plastic Effect
The Ribbon is a lit sheet with drifting dust, worked out from the
menu's clock alone, so every frame shows it at its own time at any
refresh rate. Plastic Effect shades XMB icons and text as translucent
plastic, and Ribbon Glow adds a soft bloom to the Ribbon; both are
settings of their own, off by default, since both cost GPU time. The
Simplified Ribbon draws from the Ribbon's mesh.

Drivers:
- Every driver draws the sheet on the GPU from the mesh's positions,
  read in place; the Wii U works out only the dust on the CPU.
- The ribbon's data reaches the GPU straight from gfx_display: its own
  buffer index on Metal, written into the mapped constants on
  D3D10/11/12, bound only for the ribbon draw.
- With float images the glow takes one output pass. Vulkan, GL and
  Metal draw its capture and blurs before the frame's first pass, so
  the pass the menu draws in is never split, which on a tiled GPU
  would store and reload the whole target.

Based on PR #20101.

Co-authored-by: Jean-André Santoni <[email protected]>
2026-11-16 05:07:56 +01:00
libretroadmin 64b2dfc719 Cleanups; reduce memsets 2026-11-15 22:44:40 +01:00
sonninnos bfb8c1517d Menu: Standardize portrait vs landscape messagebox size and usability 2026-11-13 11:30:28 +02:00
LibretroAdmin ec71393b7b XMB: free a node's console name with the node
xmb_free_node() frees the console name each horizontal-list node
owns, so the playlist and Explore view tabs no longer leak it when
the list is torn down (the 4-byte leaks in #20065).

menu_icon_ownership now ends through main_exit(), so the menu
driver's free() runs, and its xmb lane counts the copies of the
fixture playlist's name made with strdup (link-wrapped) that are
still unfreed afterwards.
2026-11-12 00:33:51 +01:00
sonninnos 2c80e1abd6 Add Bluetooth settings visibility option 2026-11-11 08:26:03 +02:00
Codex afcfce0d67 ozone: retain media previews through settings refreshes
Do not replace the settings preview player in browser selection or thumbnail refresh callbacks while media settings are active. Other thumbnail update paths already preserve this ownership.

Exercise external movie activation, the settings mouse button, stale browser selection and thumbnail refresh notifications, playback progress and Back. Check root and subfolder paths on Windows and rendered preview pixels in the GPU menu jobs.
2026-11-10 19:17:36 +01:00
Davey Hughes 56952c9a25 Android: follow-up fixes for screens on other displays (gl and vulkan) (#20044)
* rgui: upload the menu again to the video driver a reinit makes

Closing content with RGUI up left the screen black until a key press.
The staged content load presents frames between its stages, so RGUI
can upload its framebuffer to the old video driver and clear FB_DIRTY
just before the driver stage replaces that driver. The new one has no
menu texture, nothing in the menu changes, and RGUI never uploads
again.

command_event_reinit sets FB_DIRTY after its reinit, but the staged
load and video-only resets reach the menu only through context_reset,
so RGUI marks its framebuffer dirty there. The menu_icon_ownership
harness gets an rgui lane that reinits the video driver and checks
the next upload reaches the new one.

* video: draw a frame queued before a view count shrink with its views

Under threaded video the wrapper ran SET_VIEW_COUNT ahead of the frame
it had already claimed, so a closing core's last queued frame drew
after its view chains were gone: whole, both screens stacked, until the
menu's first frame replaced it.

The wrapper still answers at once, but a smaller count reaches the
driver only once the frames queued before it have drawn. A grow applies
at once as before, with the main thread waiting for the preset parse.
Vulkan and glcore therefore build view chains only when the count
grows, so a deferred shrink never parses a preset. They also keep the
headset's whole-frame chain across a count change: it does not depend
on the count, and with chains built only on a grow nothing would
rebuild it after a shrink to 0.

* android: don't make a second screen's EGL surface once Java took it back

Java can take the second screen's surface back between the poll that
hands it over and the frame that makes its EGL surface. Skip making one
then; the screens go back to the main window as they do when a make
fails. Java can still take the surface back during the make itself; the
node's own ANativeWindow reference keeps the window alive through that.

* android: ask a display move by display id and number it

A move named its display by its place in the list, and Java looked
that up later on the UI thread against whatever list was newest, so a
display coming or going in between could send RetroArch elsewhere.
Java now gets the display id and fails the move when that display is
gone. Native code now counts the ids when it compares display lists,
so a display unplugged and plugged back is a new list and its failures
clear.

A failure was a bare flag, so one move's failure could end the next
move and mark its display unable. Each move now carries a number and a
failure counts only for the move it names. The move code also loses
two stores that were always overwritten.

* android: end the refocus hold after a move only when it is done

A move onto a display that is no longer valid now fails at once
instead of waiting out its timeout. The hold that keeps RetroArch's
window unfocusable after a move ends only on the focus loss Android
answers it with, not on a gain that was already queued; an earlier
hold ends only once the new move has started; and onStop() ends a
running hold rather than leaving it to its timer.

* video_windows: tell an external monitor by its display type

Android lists the AYN Thor's two panels and a DP monitor with the same
unknown connection type, so Auto took the monitor for a second panel:
on a one-screen phone Game Screen 2 went to it. Java now reads the
hidden Display.getType() by reflection where it can and passes
internal or external with each display. A display typed internal is
never a monitor; where the type is unknown, a non-default display with
an unknown connection and a product name now counts as one.

* video: give a Presentation on another display its own UI wait

The menu waits up to a second for the Presentation it is laid out for
to show, but the wait was only counted from the first one. Once a
Presentation had shown, one made on another display had no wait left
and the menu fell back to the main window at once.

* input: keep the menu's mouse where it was while the menu is in a window

With Mouse Support on, the menu moving into the Presentation read as a
mouse move to (0,0) for a frame, which marks the pointer active there.
The view keeps the main window's last mouse position instead.

* input: match a window's touches only from a windowed publication

A publication without windows after one with them left the old window
ids in place, so a window's touch lookup could still match them. Only
touches published in a window match now. No Android path publishes
that way today.

* vulkan: copy a waiting window's views on a new frame

A screen window that was up but had no free image on a new frame did
not get its views copied, so a later repeat that drew it, as a pause
with the menu there does, left black areas where those views go. They
are copied on every new frame now.

* video: load the idle logo from the assets directory without widgets

The idle logo's path came from the widgets, which only start with
On-Screen Notifications on, so with them off the idle window stayed
black. Without the widgets' path it is built from the assets
directory the way the widgets build it.

* android: hold the focus when Android moves RetroArch between displays

When the display RetroArch is on, or moving to, goes away, Android
moves the Activity to the default display and can send that display's
focus gain before the removed display's loss. A task moved to another
display and straight back gets no configuration change, and can read
the old display's loss last too. With the loss last, RetroArch pauses
while Android keeps it focused, and no later focus event wakes it.

Count these as moves, as RetroArch's own moves are: a removal, and any
change of RetroArch's display it did not ask for. From Android 10, with
more than one display, so is losing and regaining the top-resumed place
while focused, or regaining it unfocused within a second of losing it
after a loss no hold asked for. The refocus hold that covers a move's
late loss then covers these too: the window is made unfocusable until
Android has taken the focus, then gets the gain again. A gain already on
its way skips the hold, and a move marked while RetroArch is focused
ends after a second with no focus event.

* samples: close test gaps in video_windows and android_focus

The is_default check set the flag and read it back, so it could not
fail; Auto's fallback to the default display now shows the flag at
work. Cover a display listed without an ordinal, and display keys at
sizes 0 to 3, two unnamed displays and a 63-character name. Drop a
stale note from android_focus_test's header.

* video: fix wording left over from the display rows

The Screen Display sublabel still named the Separate mode, a setting
the display rows removed; it now says "when it has a window of its
own". The warnings for a screen window that can't be drawn, or whose
surface is gone, said its screens go back to the main window, but a
window that shows only the menu reaches them too. They now read like
the one for a window that can't be made: what it shows stays in the
main window.

Comments that no longer matched the code are reworded. pointer_frame's
model of the driver before the publication is named was_* rather than
today_*, and a wrong commit hash and a plan tag go from the tests.
video_driver_free_internal() uses VIDEO_ANDROID_RELEASE_KEPT_WINDOWS()
rather than open-coding it, with no change in behaviour.
2026-11-09 18:59:16 +01:00
LibretroAdmin 9b31b1bcea ozone: OK on the Images sidebar tab leaves the sidebar
With the cursor on the Images tab, OK opened the list's selected image
instead of moving into the list and collapsing the sidebar, and Back
could not close the viewer, since Back's sidebar branch runs first.
The history shortcut to the viewer now applies only outside the sidebar.

The history image test enters the tab from the sidebar and presses OK.
2026-11-09 17:25:58 +01:00
LibretroAdmin a4cde9db7d Fix clang warnings from the macOS build
rslc_front: the parser's error returns go through rslc_p_fail()'s
false directly instead of a comma expression. encoding_deflate: the
past-end refill counts its overrun in a branch. gl2: drop an unused
local. record_ffmpeg: ok starts false and the lowered-thread flag lives
only under FFMPEG_HAVE_THREAD_NICE. rgui: subtitle glyph counts are
narrowed after clamping to the column count. r7z: pend_method takes
the resumable coder's method ID explicitly as 32 bits.
2026-11-08 19:52:02 +01:00
Davey Hughes 5756db8659 Input: Plays As, several controllers on one player, with hotkeys of their own (#19916)
* OpenXR: the controllers' slots are not read from the driver's view

A joypad driver that keeps its pads' state lends it to the snapshot
bridge through view(), and the bridge reads that in place of a copy
(48f9503c16). The headset's joypad wrapper is made from the driver it
wraps and kept that driver's view(), so under udev or winraw the
bridge read the controllers' slots from the driver's own pads there,
which are empty: the OpenXR controllers gave no input at all.

The wrapper of a driver that lends now has a view() of its own. It
lends none for the controllers' slots, which the bridge then copies
through the wrapper's button and axis calls, and the driver's for
every other slot.

openxr_input wraps a driver that lends all-zero views, and reads the
controllers' slot and one of the driver's the way the bridge does.

* Menu: bind capture goes to the bound user, not the controller slot

A bind capture knows the user whose binds it sets and the slot of the
controller it listens to, that user's Device Index. Three of its steps
used the user whose number is the slot instead: Bind All set every
bind after the first in that user's binds, each capture took the key
it replaced, whose mapping bit it clears, from that user's bind, and a
mouse bind listened to that user's mouse.

So with user 1's Device Index set by hand to the controller in slot 3,
Bind All for user 1 wrote all but its first bind over user 3's, which
were saved as such, and cleared the bit of a key user 3 still had
bound. A mouse bind for user 1 was never heard with one mouse, and
took user 3's click with a mouse for each user, though at run time
user 1's binds read user 1's mouse. All three now go to the bound
user.

frontend_overhead runs Bind All for user 1 on slot 3, and clicks each
user's mouse while binding user 1's B there.

* samples: hotkey_menu reads its sources as UTF-8

extract.py read input/input_driver.c in the locale's encoding, cp1252
for a native Windows Python, which fails on that file's UTF-8, so the
harness did not build there without PYTHONUTF8=1. It reads and writes
UTF-8 now; on Linux its output is unchanged.

* Input: a core port's rumble reaches every user mapped to it

A core port's rumble now goes to every user mapped to that port, the
users its input is read from, rather than to the user with the port's
number. Its motor answers true when any of theirs does; a port no user
is mapped to rumbles nothing and answers false. With every user on its
own port nothing changes.

* Input: Tap Delay holds Hotkey Enable back from its first frame

The hotkey pass reads the controllers as the last poll left them, and
the frame's own poll comes after it, under early, normal and late
polling alike. So with Hotkey Enable Tap Delay on, each press of the
Enable button reached the core for one frame before the tap saw it
and began holding it back.

While the tap is idle, a core read that finds the Enable's game button
down now asks whether the Enable is held in the frame's poll, and if
so holds the button back. The same button from another controller or
key, with the Enable up, is still the game's. Other reads cost one
test, and with Tap Delay at 0 nothing changes.

* Input: users sharing a core port drive the menu and fire profile hotkeys

With the menu up, user 1 and every user mapped to its core port drive
it. The other users on the hotkey user's core port fire hotkeys from
their own controllers in the one hotkey pass; with Hotkeys Follow
Player 1 those are core port 1's other users. With user 1 on None, the
users on core port 1 do both, and user 1 keeps them. With every user
on its own port nothing changes.

A sharing controller fires the hotkeys its profile binds, never the
hand-set ones, which stay the hotkey user's pad's: a hand-set button
names a button of one controller, and on a pad of another model it is
some other button. Its Hotkey Enable is its profile's too. While the
hotkey user has a Hotkey Enable, a sharer's hotkeys need the sharer's
own or the keyboard's, and a sharer holding its own opens only its own
hotkeys, not the hotkey user's; held on any of them, it holds game
input back. With none for the hotkey user, sharers fire freely. The
table of a sharer's profile hotkeys is made when a bind or its profile
changes, not each frame.

With Hotkey Enable Tap Delay each controller taps on its own: a tap
holds back and replays that controller's own Enable button. A hotkey
swallows the tap of the controller that fired it, and the keyboard's
tap when the keyboard's Enable opened it. Any controller's Enable held
short of the delay holds game input back, another controller's Enable
held past it included. Enable presses released while the delay is 0
are not played once it is turned on, user 1's included.

* Input: Plays As, a controller's own player, places it on connect

Sixteen entries, input_plays_as_device_N and input_plays_as_player_N,
name controllers as a reservation does, vid:pid then name, each with a
player (0 Auto). When they are read, each connected controller, lowest
slot first, takes the first entry naming it that no other has taken; a
0000:0000 vid:pid matches by the name after it, not every controller
without one. Giving a controller a player makes an entry for it,
refused when all sixteen are in use; set back to Auto, its entry is
freed.

The entries are read with the binds and written with the input
entries, a free entry's keys taken out. Two of a model are told apart
only by order, so a model's entries are written at their own places
in the order a start hands them out: lowest slot first, a gone one's
in its place, and one on Auto ahead of another of its model as an
Auto entry of its own. Once the main configuration is saved, the
entries in memory are laid out the same way, so reading it again in
the session gives each its own too. Saving an override puts them back
after its comparison load, as it does the binds. The reservations'
vid:pid parse is shared with them, unchanged.

On connect, a controller set to player N takes port N. Whoever else is
there moves to the first free port, unless it also plays as N, by its
own player or, on Auto, by N's reservation naming it: then the
newcomer shares, from the highest free port below Max Users. An Auto
controller that N's reservation names shares the same way when port N
holds a controller set to N. An explicit player beats a reservation
naming the controller. With any reservation set, Auto controllers are
otherwise left to the reservations; with none, and a player set by an
entry, they take the first free port. With no player set nothing
changes.

The moves are for this run only, through input_driver_exchange_ports(),
now in every build: the configuration keeps the ports the user set. A
reservation's own placement made while the ports are in a runtime
layout is runtime as well, so it is not saved either; reservations
place again at every connect.

A joypad driver restart lets go of every claim, since its pads can come
back in other slots with no disconnect: a pad reported again where it
is plugged in takes back its entry, the rest take theirs in slot order.
While a player is in effect, the registry's restore of the ports is
left to placement. A config reload keeps each controller's entry while
it still names it, so two of a model keep theirs. The entries count
among the settings whose change starts the joypad driver again at a
video restart, and so does a config reload that undid runtime moves.

* Input: a controller playing as another's player shares its core port

A user whose controller plays as another user's player feeds that
user's core port through the port map: that user's Mapped Port, from
remap files or identity. Its own Mapped Port is never changed or
saved. Everything that reads a user's core port reads this effective
port, and the Quick Menu's Mapped Port row reads "Shares Player 1 (core
port 1)" for a sharer.

An Auto controller placed to share with the player a reservation names
keeps sharing while it stays connected, also once that player's
controller leaves. The poll rebuilds the map when who shares changes,
and the core is told its controllers again between frames, not while
netplay or a replay owns the ports. Under First Press a press on any
of a player's controllers gives that player's user its port.

* Menu: a controller's player in Input > Controllers and Port N Controls

Settings > Input > Controllers, after RetroPad Binds, has a row per
connected controller in port order, then those past Max Users, then
the Plays As entries of controllers that are gone. A row's value is
the controller's player or, on Auto with a port, "Auto (1)", the player
Auto gives it. The sublabel names the player first and a controller
port only by its page name: "Player 1", "Player 1, shared · binds in
Port 3 Controls" for a controller sharing a player from another port,
"Not playing: more controllers than Max Users", or "Not connected".

On a Controllers row, Left and Right step through Auto, 1 to Max Users;
OK opens them as a list. RetroPad Binds > Port N Controls starts with a
row for each connected controller playing as the player port N feeds,
the same setting, then Add Controller: the other connected controllers
with a port, each with the player it plays as now, where a pick moves
that controller to this player. One controller on several players stays
Device Index's.

A change to a connected controller marks the configuration changed and
places it again as its connect did, with any controller it pushes off a
port, and no driver restarted. The entry point is in task_autodetect.c,
beside the reservation placement it reuses. A controller whose change
left no player in effect goes to the first free port. While Plays As is
in use, a change of Max Users places again the controllers left with no
port and those whose player comes within it. With every entry taken a
new one is refused with a notice.

A controller set to a player above Max Users reads "Above Max Users:
plays as Auto (Player 2)". On Port N Controls a row's sublabel reads
"This port" or "Shared · binds in Port 3 Controls". Device Index's note
for a controller another port reads becomes "used by Port 2".

After Add Controller, Port N Controls links to Port M Controls for each
controller playing as player N from port M, such as "OpenXR Controllers
(Port 4 Controls)": that controller's binds are port M's. Quick Menu >
Controls > Port N Controls starts with the same links to the pages that
hold its remaps. Both lists and the Quick Menu's Port N Controls are
made again on hotplug, and Port N Controls after a Device Index change,
with the cursor kept on its row.

The menu lanes are in stereo_headset_test, which already links the
shipping menu objects and runs in CI's OpenXR jobs; a build without
OpenXR skips it.

* Input: a controller's own hotkey buttons

A Plays As entry keeps a button and an axis of its own for any hotkey,
input_plays_as_<hotkey>_btn_N and _axis_N, written only where set; an
entry that has one is kept on Auto. It counts neither as a player nor
among the settings whose change starts the joypad driver again. A
sharer reads its own first, then its profile's, never the set's; the
hotkey port's own controller reads its own, then the set's, then its
profile's. Button and axis go each on their own.

The bind values, "8", "h0up", "+1", are read and written by helpers in
input_driver.c that the configuration's own binds now use too.

* Input: Hotkey Enable pairs with the controller it is on

A sharing controller's hotkeys go by its own Hotkey Enable, its bind or
its profile's, whatever the hotkey user has: one with an Enable fires
while it holds it or the keyboard's, one with none fires freely. With
Hotkey Device Type Merge on and a keyboard Hotkey Enable bound, a
sharer with none waits for the keyboard's, as master makes user 1's pad
wait. Holding a sharer's Enable holds game input back as any Hotkey
Enable does, and opens only that sharer's hotkeys.

Keyboard and mouse hotkeys keep master's Hotkey Enable rule whatever
sharers are connected: a sharer's Enable does not open them. Nor does
it open an input_combo_N entry with a key; an entry of RetroPad buttons
alone opens with it, as those buttons are every port's. A sharer with
an Enable of its own needs it for the menu toggle too, and whether a
pending menu tap is kept is read from the sharer's own binds, not the
set's.

The hotkey user's pad Enable plays no part in a sharer's hotkeys: each
controller's hotkeys are its own, and so is its Enable.

With Hotkey Enable Tap Delay, the hotkey of a sharer with no Enable of
its own leaves the keyboard's tap alone, as the keyboard's Enable did
not open it. Under Hotkey Device Type Merge, where such a sharer waits
for the keyboard's Enable, its hotkey swallows the keyboard's tap.

* Menu: hotkeys bound from a sharing controller are its own

Binding a hotkey also listens to the controllers that fire the hotkeys,
those on the hotkey user's core port, and its prompt gains "Listening
to Player 1's controllers", for the player the hotkey user plays as. A
press on the keyboard, the mouse, user 1's pad or the hotkey user's
goes to the set as before; a sharing controller's press is kept as that
controller's own, with an entry made for it at its player, refused with
the full notice when none is free. A press from a controller that has
its own bind for the hotkey replaces that bind, user 1's pad included.

Any bind, RetroPad binds too, also hears the port's own controller when
it is in a slot at or past Max Users, where Plays As placement can put
it, so that port's binds can be set from it.

A hotkey's row shows each connected controller's own after the set's,
"Select · OpenXR Controllers: L3", and clearing it clears theirs too.

* OpenXR: the headset shares player 1 on Auto and moves no one

For the headset's controllers, Combined or each hand in Separate, Auto
means sharing player 1, so a VR player's pad and headset both drive
player 1 with no setup. They take the highest free slot and the highest
free port below Max Users, so pads keep the low ones, and share their
player whether anyone is on its port or not, moving no one; a pad
turned on later lands on port 1 and shares with them. Set to a number,
they do the same with that player. Every other controller's Auto takes
the first free port.

A reservation naming the headset beats its Auto, as for pads, and a
number beats a reservation. A pad set to the player whose port a
headset on Auto holds takes that port, and the headset moves to the
highest free port, or gets none. Any change of Max Users places the
headset again at once, on the highest free port. Wherever Plays As asks
whether a player is in effect, a connected headset on Auto counts as
player 1, as one set to 1 does.

OpenXR looks up each controller's player only when the devices or the
entries change, and places a controller again when it starts or stops
playing as a player, or when a slot below Max Users frees up for one
placed past it. A player's controller that a pad pushed out of its slot
is placed by its player rather than taking the port with it. A headset
entry names the controller by the name OpenXR looks it up by.

The laser answers the core once, for the core port the headset's
controllers play on, so it no longer mixes with another user's mouse;
in Separate each hand's player gets it, the pointing hand aiming and
firing and the other reading offscreen. A headset controller with no
player drives no pointer, and the Monado e2e cases follow the new
placement.

mapped_port_test is built a second time with OpenXR, as
mapped_port_openxr_test, and CI runs both.

* Menu: OpenXR Controller Layout under Input > Controllers

Combined or Separate is how the headset's controllers appear, so it
moves from the headset's video rows to the bottom of
Settings > Input > Controllers, named for what it sets. The key and its
values are unchanged. Switching it reconnects the headset's
controllers, and the cursor stays on the row.

* Input: Plays As in core, content directory and game overrides

Save Override now saves the controllers' own players and hotkeys. Each
controller whose player or own hotkeys differ from the main
configuration's (with --appendconfig) has its whole entry written, all
of its entries for two of a model, in the order a start hands them
out, one on Auto ahead of another of its model as an Auto entry; one
the main configuration gives an entry and the session none is written
as Auto. An entry the same as the main configuration's is not written,
so a controller set back drops out of the override.

An override's entries are read on their own and go over the ones read
before by controller, as entries are matched to controllers (vid:pid,
else name), not by number: the last file naming a controller gives it
its whole entry, in the place of the one it had, two of a model taking
a file's entries in order, an Auto one included, the connected ones
lowest slot first; a controller no override names keeps the main
configuration's. Auto takes one back to Auto, and a controller new to
the entries takes a free one, if any of the sixteen is. Until now the
files' keys merged one by one, so an entry could pair one file's
controller with another's player, and no override could take an entry
back to Auto.

Loading or unloading an override from the menu, or loading the active
ones again, places the controllers again at once, as a Player change
does: those whose player changed, or all of them where the reload read
the configured ports back over the moves. Content load and close leave
it to the joypad driver's restart, as before.

mapped_port_test covers the merge, what is saved and the placing
again; video_screens_test saves, unloads and loads a game override
with a Plays As change.

* Input: a controller keeps its Plays As entry while its twin is unplugged

Two controllers of one model share the entries that name them, each
taking the first one no other connected controller holds. With one of
the two unplugged, anything that made the other take an entry again
could hand it the unplugged one's: a Player or Max Users change,
loading or unloading an override, any re-read of the main config, a
joypad driver restart, and Online Updater > Update Controller
Profiles, which reports every connected controller again. The
controller left then played the other one's player, and that one came
back to its twin's.

An unplugged controller's entry now stays its own for the rest of the
session, and only a connect takes it: that controller coming back, or
another of its model. A reload keeps it while the entry in its place
is still of its model, and an override's entries pair with it as if
the unplugged controller still held it from its slot. So an override
loaded with a twin unplugged gives the other twin the entry it adds
and leaves the unplugged one its own. Save Configuration and Save
Override count it as that controller's too, so what they write pairs
the same way when it is loaded again.

Placed again for a Player or Max Users change, or by Update Controller
Profiles, a controller keeps the entry it holds, or none. Reported
again by its driver while still connected, it keeps the one it holds.
A reload is judged as a whole once its last override is read: a
controller takes an entry it did not hold before only where the
reload added it for its model, so one an override newly names still
gets that entry.

A joypad driver restart still lets every claim go and hands the
entries out again in the order the controllers are reported, as a
start does, but its reports leave an unplugged controller's entry
alone. A driver's report queued behind a profile update's is not
dropped as a repeat of it, since the update takes no entry, and the
update it supersedes shows no toast, so one shows, as before.

* OpenXR e2e: FRAME_BINDS catches up with the grip poses already bound

Every profile binds pointer/grip to both hands' grip poses, and
input-frame-profile matches FRAME_BINDS exactly, so the table now lists
the poses as they are bound.

* Menu: OpenXR touch settings on Input > Controllers

Touch Hands, Touch Button and Touch Passthrough are added for the hands
that touch a screen they point at, the button that touches, and whether
that button's other binds fire too, with Touch Hands None to turn touch
off for the headset's controllers; a later commit puts them to use.
They follow OpenXR Controller Layout, Laser Pointer and Laser Beam,
which move here from Stereo 3D & Screens, at the end of Settings >
Input > Controllers, shown only for a video driver with a headset path.
A hotplug keeps the cursor on any of these rows, and overrides save
them per game.

* OpenXR: the headset's menu button is button 16, bound to Menu Toggle

The menu action of each profile presses button 16 of the pad, the left
hand's in Separate, instead of being a hotkey of its own, and the
built-in profiles bind Menu Toggle to it and label it "Menu", as pad
profiles name their Guide or Home button. It opens the menu from the
same button as before and can be bound elsewhere like a pad's Guide
button. Touch's one menu button presses button 16 once held a second.
In Edit Screens the menu button always opens the menu, whatever is
bound and whether or not Hotkey Enable is held.

Sharing player 1, the button goes by Hotkey Enable as a sharer's Guide
does where its profile has none: it opens the menu whether or not
player 1's Hotkey Enable is held, and the enabler alone opens nothing.
mapped_port_test covers both.

With the menu open, a press of the controllers' buttons hides the
laser's dots until a trigger is pulled, so hand drift cannot undo their
navigation. The menu button navigates nothing, and with no content Menu
Toggle leaves the menu open, so its press does not count.

* OpenXR: the Touch Button's buttons as pointer actions of each hand

Grip, stick click, bumper and A to Y each have an action per hand in the
laser's action set, bound from a table per profile in the same
suggestion as the pad's rows, so either controller layout can read them;
the trigger is the pad's own. The Frame's exact binding list in the e2e
gains them.

A runtime that refuses a suggestion loses its palm first, then these
rows, then edit mode's, a smaller loss tried before a larger, and keeps
the rest of the profile. INPUT_OPENXR_MAX_BINDS goes from 48 to 64 to
hold these rows with edit mode's (Index 52, Touch 51, the Frame 58); a
profile whose pad and Touch Button rows pass it is not suggested at
all, and the log names it.

* OpenXR: touch with the chosen button and hands

The Touch Button, read from its own action or, for the trigger, from the
pad's, touches a live screen the hand points at; the trigger still
clicks the menu, and is L2 or R2 on a screen once it is not the Touch
Button. A hand touches only if Touch Hands has it and its controller has
the button, as read from each hand's interaction profile; only such
hands aim at the screens, become the pointer or show a dot there, and
with none the screens stay the mouse's. The others aim at the menu
alone, which video_xr_pick() now takes as a flag. Touch Passthrough lets
the trigger's L2 or R2 through its touch.

A hand takes a changed setting at its next press. A button held through
a change of Touch Button, Touch Hands or the hand's controller profile
is no press: the trigger goes by its own last read, and any other button
counts as held until it is let go.

* OpenXR: a touch holds back its button's other binds

OpenXR gives an input to every action bound to it, so a Touch Button
other than the trigger also reaches the pad. While it touches, or a
press of it would, the pad's buttons bound to the same input of that
hand in the profile's rows are let go, in Combined and in Separate: the
Index grip's L or R, the Frame right stick's menu button. Touch
Passthrough leaves them pressed.

With the menu open, a press of the controllers takes the laser from the
dots until a trigger pull. Like the triggers' L2 and R2, what a Touch
Button's input feeds does not count as such a press, with Touch
Passthrough on or off, so the button can still touch a live screen
there. Another button on the same hand still counts.

* Menu: Touch Button offers the buttons the controllers have

The dropdown lists the buttons either hand's controller has, as its
interaction profile names them, and the one chosen; left and right step
through the same, skipping the rest. A choice the controllers lack, as
from an override made on another controller, reads "(not on this
controller)". With no controller known every button is offered. The poll
publishes those buttons through an atomic, since with threaded video XMB
draws the value on the video thread.

* docs: OpenXR controllers, touching and the menu button

Where the headset's input rows are now, what Touch Hands, Touch Button
and Touch Passthrough do, None included, and that the menu button is a
Menu Toggle bind that Hotkey Enable applies to as to a pad's Guide; on
Touch controllers in Combined it is Start, and button 16 once held a
second. Laser Pointer's description says the Touch Button touches a
screen and the trigger clicks the menu, true with Touch Passthrough on
too.
2026-11-08 16:16:19 +01:00
LibretroAdmin 5bf0c36d14 First-run downloads: reuse the Online Updater path, fix the space check
Follow-up to the first-run download prompt (PR #18878).

- Downloads go through action_ok_download_generic (new public wrapper
  action_ok_download_bundle) instead of a copied version of it.  The
  copy predated the stream-to-disk sink, so a first run held the 72MB
  assets zip and the 52MB database zip in RAM, and skipped the check
  that refuses to truncate an archive still being extracted.
- The free-space check asked about the target directory, which on a
  real first run does not exist yet: statvfs failed, -1 came back, and
  assets and databases were never offered.  It now asks the nearest
  existing parent, and an unknown answer no longer blocks the download.
- The prompt is an ordinary msg enum through menu_dialog_confirm_set.
  The 512-byte confirm_text buffer in menu_dialog, the second confirm
  setter and the extra branches in the iterate path are gone.
- Missing bundles are scanned once at menu init into a bitmask that the
  confirm handler uses; directories are not walked a second time.
- Offered only with HAVE_CONFIGFILE, the only first-run signal there is;
  dead have_bundled_assets logic removed.
- path_get_free_space: GetDiskFreeSpaceExA resolved at run time (not in
  the first Windows 95), GetDiskFreeSpaceA fallback, no <windows.h> on
  Xbox, statfs on Android (statvfs needs API 19), statvfs only on
  platforms known to have it instead of every __unix__ target.
- path_is_empty_directory: dotfiles (.nomedia, .DS_Store) do not count,
  the open call does not filter them outside Windows; documented.
- Ozone caches the Cancel label with the other footer labels instead of
  measuring it every frame the dialog is up.
- Pointer: one close, then confirm or cancel.
- Prompt text no longer promises overlays on platforms that skip them.
2026-11-07 23:49:58 +01:00
Craig Carnell bf93e5568a Add popup on first run if missing assets/controller profiles/core info files to download them 2026-11-07 23:49:58 +01:00
sonninnos 535ab2e8e3 Menu: Bind + remap list corrections
- Fix remap dropdown title with keyboard type
- Fix bind list item help texts
- Fix bind touchpad icons
2026-11-07 23:55:06 +02:00
LibretroAdmin 2443ac01fe menu: the media viewer's title follows the image shown
In Ozone, opening an image from the file browser with OK and pressing
Up/Down to step to the next image changed the picture but kept the
first image's name as the title.

The title was refreshed by each menu driver on a selection change, and
Ozone only did that when the fullscreen view had been asked for with
START. The viewer opened by OK sets the "shown" flag but not the
"wanted" one, so its title was never refreshed while stepping.

Every step through the viewer - the OK that opens it, Up/Down/Left/
Right, continuous playback - goes through
menu_media_open_selected_file, so the title now belongs there: it takes
the driver's title buffer and rewrites it for the file it opens. Ozone
and XMB pass theirs; no driver can open a file in the viewer and leave
the old name up. A row the viewer cannot show leaves the title alone.

samples/gfx/media_controls: viewer_title drives the real
menu_media_browser.c through OK, Down, a row the viewer cannot show,
Down past it and Up, checking the title each time, plus truncation to
the buffer and no buffer. It fails on the old code.
2026-11-07 16:29:11 +01:00
Davey HughesandLibretroAdmin 08e5b72a88 Scan from the command line: exit status, Manual Scan options, playlist refresh (#19977)
* file_path: stop at the end of the path after '~'

fill_pathname_expand_special() skipped two characters after a leading
'~' or ':', so a bare "~" read past its NUL and "~x" lost the x. It
now skips the prefix and a slash after it, if there is one.

* scan: hand the callback user data and what the scan did

task_push_dbscan() and task_push_manual_content_scan() take user data
for their callback, and the callback's task_data is now a
task_dbscan_result_t: how many entries the scan added, how many its
playlists already held, and how many files matched nothing. A file is
counted by what became of it, so an archive that is expanded is not
counted as unmatched, and a loose scan's unmatched files count as
added. Callers pass NULL for now.

* scan: say in the result when a scan failed

A scan that ends before it runs (bad setup, no valid content, a DAT
that will not load) or ends with a task error now sets the result's
failed flag. A database folder that is missing or unset is treated as
an empty one, so it reports the same "no database" error instead of
finishing as if it had scanned.

* scan: count the files a scan could not read

A file whose scan fails (an unreadable file, a failed lookup) was in
no count. The result now carries an errors count for them. They do
not fail the scan.

* scan: print --scan errors on stderr and totals on stdout

A command-line scan now ends with a totals line on stdout, or with the
reason it failed on stderr. A file it could not read is listed on
stderr. The ++/==/?? marks are coloured only when their stream is a
terminal, so pipes and redirected output get plain text; on Windows
redirected output keeps its marks instead of losing them to
WriteConsole.

* scan: the manual scan finder skips a finished task

A finished scan stays in the task queue while its callback runs, and
the finder that refuses a second scan for the same playlist still
matched it, so a scan pushed from that callback was refused.

* retroarch: run every --scan, then exit with what the scans did

Each --scan is collected while the command line is parsed and run in
turn once it is done, so later options and further --scan flags are
no longer dropped. A path is expanded and made absolute first; one
that does not exist, or a scan that cannot start, is reported on
stderr and the next path still runs. --scan with --cloudsync or
--command is refused.

Without --menu the exit status is 1 if any scan failed, else 0 if any
added an entry, else 2, and a content path given with the scans is
ignored, with a line on stderr. With --menu each finished scan starts
the next, as a second scan is refused while one runs.

* manual_content_scan: clear the database name a refresh did not save

A playlist with no saved database name left the name buffer
uninitialised, and the refresh compared it against every installed
database, so whatever was on the stack could pick a database the
playlist never named.

* scan: Skip Database References names the scan's one playlist

The option was meant to put the playlist's name in each entry's
db_name, even for a database match (#18641), for users who build
their own thumbnail sets. When the scan picks the playlists, db_name
also picks the playlist an entry goes to, so with the option on every
match went to one playlist named after the content folder.

It now applies only when the scan writes one playlist, and gives
that playlist's name, a loose scan's unmatched entries included. With
the target on <Automatic>, or Fully Automatic with the option left on
from a Custom scan, matches go to their databases' playlists as with
it off; the entries of a custom playlist look their thumbnails up
under its name, not the folder's.

* scan: name the scanned folder in the start line

The "Scanning content" line, in the log and in --scan's output, has
named the database folder since the manual scan and the database scan
were merged (2fdf736d51); before, it named the path being scanned. It
names the content folder again.

* manual_content_scan: reset, scan overrides and their apply

The command line's scan options need each scan to start from the
defaults and to lay their values over them, or over a playlist's saved
settings. Add a reset, a record of those options and a function that
applies it through the existing setters: a core named by path, file
name or display name, a database, a playlist, the database check or a
DAT, extensions and the switches, stopping with a reason at the first
that does not resolve.

A core path is normalised before it is compared. A core's file name
matches in the case given first, then ignoring case, on every
platform; a display name matches exactly. Given another database, a
playlist named after its database keeps that name as a custom one, so
a refresh still writes the same playlist.

The core setter's copy step becomes its own function, so a core found
by path or file name can be set. Nothing calls the new functions yet.

* scan: run --scan items through one chain

The --scan paths ran through a loop in retroarch.c, and with --menu
through a second chain of their own. The scan options and playlist
refreshes to come need one runner for every item, from the command
line and from the menu.

task_push_dbscan_chain() runs a list of items one task at a time: a
prep task lists the databases, then each step is pushed from the last
task's callback on the main thread, so nothing waits and nothing
locks. An item that fails is reported and the run goes on; a
cancelled task ends it. retroarch.c builds the items in the first
argument pass and hands them to the chain; without --menu it waits
for the chain's end and exits as before.

Running out of memory prints "out of memory" on stderr: for an item's
path the item fails, and for the chain itself nothing runs, which
without --menu exits 1.

The chain also prints a scan's override errors, and the warnings for
an option that needs one playlist or does nothing for a single file,
which the scan options of the next commit can trigger.

* retroarch: Manual Scan options for --scan

--scan-playlist, --scan-database, --scan-match, --scan-dat, --scan-core,
--scan-exts and the five switches set the Manual Scan settings of the
--scan before them; a --scan without any stays Fully Automatic.

Values are checked in the first pass, so an option before any --scan,
an empty or bad value, or one too long for its setting ends the run
with its reason on stderr and status 1, before the config loads and
before anything is scanned. Cores, databases and DAT files are
resolved when their scan runs, and one that does not resolve fails
only that scan.

* scan: refresh playlists in the chain

A refresh item rescans one playlist with its saved scan settings, as
the menu's Refresh Playlist does, with the item's scan options laid
over them and written back by the scan. A refresh-all item does the
same for every playlist in the playlist folder that has saved
settings, in the order Manage Playlists lists them, histories and
favorites left out.

A refresh item names its playlist by name or by a path in the playlist
folder. A bare "name.lpl" is the playlist folder's file, and an
absolute path is normalised before it is checked against the folder.
The name is looked up in the folder's listing on every platform, the
exact name first, then ignoring case, since macOS and FAT/exFAT cards
ignore case; the refresh then takes the file's own name, so a
database's playlist stays one. Two or more playlists that match only
in other cases fail the item.

The playlist folder walk and each playlist load run in prep tasks: on
the worker with a threaded queue, under the shared I/O window without
one, each pushed from the previous step's callback. A playlist whose
saved content folder is gone is skipped rather than failed. A listing
that runs out of memory fails the refresh-all; a playlist folder that
is missing or cannot be read lists nothing, and the refresh-all ends
with "no playlists with saved scan settings". A refresh's start line
names its content folder; its totals and failure lines name the
playlist.

* retroarch: --scan-refresh and --scan-refresh-all

--scan-refresh=NAME|PATH rescans a playlist with its saved scan
settings, as the menu's Refresh Playlist does, and --scan-refresh-all
rescans every playlist that has them. Both are items of the same run
as --scan: the scan options after one are laid over the saved
settings and written back, and the exit status follows the same rule.

--scan-playlist after a refresh is refused, so a refresh always
updates its own playlist, and an empty --scan-refresh is refused as
the other empty values are. Like --scan, the refresh options cannot be
combined with --cloudsync or --command; the error names whichever of
the three comes first on the command line.

* menu: Refresh All Playlists

Manage Playlists gets Refresh All Playlists as its first entry when it
lists any playlist, so an empty list still says there are no entries.
It rescans every playlist that has saved scan settings, with those
settings, through the same chain as --scan-refresh-all, and ends with
one notification saying how many playlists were refreshed, skipped
(content folder gone) and failed.

While a content scan runs it is refused with a new message; a refused
scan had none. Other languages come through Crowdin.

While a scan chain runs (Refresh All, or a command-line scan with
--menu), Start Scan, a playlist's Refresh, Scan Directory and Scan
File are refused with the same message, as they would run with the
settings the chain last loaded. task_push_dbscan() returns false then
too, which covers the companion and the iOS caller.

* docs: --scan, refresh and the Manual Scan options in the man page

--help lists the options but not what a script needs: the order the
scans run in, the exit status and what the options set. The man page
now has them, next to --cloudsync, and CHANGES.md has the entry.

* scan chain: writes from workers reach the playlist cache by note

A playlist written by a task - the chain's prep parse, a scan, a
playlist-manager task, whatever thread it runs on - leaves a note on a
lock-free stack instead of reading the cached playlist; the main
thread applies the notes when it next decides whether the cache may
stand in, so no worker reads playlist_cached while the main thread
frees or installs it. Without threads or pointer atomics a write
applies at once.

The chain's prep tasks set their handlers by name, and
thread_read_audit.py fails on a handler set from a
retro_task_handler_t parameter, which would hide every handler passed
in. The chain puts the Manual Scan settings it found back when it
ends, and is no longer running when its done callback runs, so that
callback may start another. task_push_dbscan() says why it refuses,
so the menu and the companions show the same reason, and the
companions' status line takes it from companion_core. --scan and
--scan-refresh set the verbosity override, so a config with logging
off cannot detach the console the totals go to, and refuse a path too
long for the chain's buffers. The Refresh All notification passes the
length written, and fill_pathname_expand_special() stops at the end of
a buffer shorter than the home or application directory.

Lanes: playlist_parity_test writes the cached file from a worker,
once at the same size and then while the main thread reuses and frees
the cache; database_scan_test checks the refusal message, the restored
settings and a done callback that starts the next chain;
fill_pathname_test expands into a buffer shorter than the home
directory.

* playlist: header-only parse for the scan chain's prep

The prep task needs a playlist's saved scan settings and nothing else,
yet parsed every entry and, through autofix, could write the file back
from a worker. playlist_parse_begin_header() stops at "items", rebases
the scan record in memory when the base content directory moved, and
marks the playlist so playlist_write_file() refuses it.

Lane: playlist_parity_test header_only (entries skipped, scan dir
rebased, file bytes untouched, old format).

* scan chain: ask the file system nothing on the main thread

The chain's steps ran on the main thread between its tasks and stat'd
and realpath'd there: a --scan path's resolve and stat, a
--scan-refresh path's two realpaths, the content folder's stat, the
saved and override DATs' stat and size, an override core path's
realpath.  On a network share each of those can stall a frame.

- manual_content_scan_fs_read() reads them on any thread, touching
  nothing but its arguments; the _fs variants of the content-folder,
  playlist and override setters take its answers instead of asking.
  The plain setters pass NULL and behave as before, so the menu is
  unchanged.
- A --scan path gets its own prep task (dbscan_path_handler); a
  --scan-refresh resolves its path inside the load task, and the load
  reads the folder, the saved DAT and the overrides' paths once the
  header is parsed.  The worker gets copies of the item's strings.
- The prep's state is freed in one place.

Lane: database_scan_test "fs off main": six items that each stop
before their scan, on a threaded queue, with path_stat, path_is_valid,
path_is_directory, path_get_size and path_resolve_realpath wrapped:
no call on the main thread.

Not moved: the scan task's own push still stats the content folder
and the DAT (manual_content_scan_get_task_config), shared with the
menu.

* samples: the scan chain's lanes hold on Windows and without realpath

From a native Windows run of both tests:

- database_scan_test "fs off main" refreshed f_gone.lpl through
  "pl/../pl/", which only a realpath folds; the sample builds without
  RARCH_INTERNAL, where path_resolve_realpath() folds nothing, so the
  item was rightly not in the playlist folder.  It names the playlist
  by its plain path now, which the check still realpaths on the
  worker.
- "another case, a database's playlist" read the system name type
  after the chain ended, and the chain puts the Manual Scan settings
  back then.  The item callback records each scan's type instead.
- playlist_parity_test's header lane expected "/moved/snes"; autofix
  converts the suffix to the local form, "/moved\snes" on Windows.
- The worker lane's stress read required a core name of every read.
  Windows replaces the file with MoveFileExW, and an open that meets
  the replace fails: that read is an empty playlist, which has none.

---------

Co-authored-by: LibretroAdmin <[email protected]>
2026-11-04 19:34:05 +01:00
libretroadmin 311fed569e menu: view Images history entries in place
OK on an entry of the Images (image history) list opens the image in
the menu viewer at once, in all four menu drivers, instead of offering
Run and loading it as content - a load that the menu then turned into
a file browser at the image's folder, so Back went to that browser.
Back now closes the viewer and leaves the Images list as it was, the
same entry selected; on Ozone's Images tab that also needed the
depth-one Back to stop moving the selection while the viewer is open.

An entry whose file is gone, or with the built-in image viewer off,
keeps its Run action. The menu-media workflow runs a new history-image
lane through each driver's real input path.
2026-10-31 19:50:57 +01:00
LibretroAdmin 3e4d9ae7dc rgui: upscale by whole factors exactly
The upscale mapped output pixels to source pixels through a 16.16
ratio rounded down, (fb_width << 16) / out_width.  At any factor that
is not a power of two the ratio comes out short, so the first source
column and row are repeated once too often and the last ones once too
few: at 3x, column 0 is three pixels wide plus one and the last column
is two, and the drift moves every column boundary between them.  It
shows as uneven text and uneven borders at Internal Upscale 3x, 5x, 6x
and 7x, and at the Auto level whenever it lands on one of those.

The source of each output pixel is now floor(dst * fb / out), stepped
along each row and column with a remainder, so there is no division
and nothing can overflow.  At a whole factor each source pixel is
repeated exactly that many times.

Output at 2x, 4x and 8x is unchanged byte for byte; at other factors
it now matches an exact reference (checked over 1500 random sizes,
factors and pitches, under ASan and UBSan).
2026-10-28 13:37:51 +01:00
LibretroAdmin 9e4aabacc5 rgui: draw text from row masks, build each upscaled row once
Text: every glyph pixel was a bool to test, so each character cost 50
(5x10) to 100 (10x10) branches, set or not.  The font LUTs now also
hold each glyph row as a bit mask (bitmapfont_lut_t.rows, built by the
loaders from the bool LUT, which stays for the other users), and the
blits walk only the set pixels: each mask is taken 5 bits at a time
through a 32-entry table of set columns, in ascending order, so pixels
and shadows are written in the same order as before.  No compiler
builtins.  The eight blit variants share two helpers for the glyph.

Upscale (Menu > User Interface > Internal Upscale): the source column
of each output column is worked out once per redraw instead of per
pixel, and each output row is built once into a line buffer and copied
to every output row that repeats it.  The output can be a buffer loaned
by the driver (upload heap, dumb buffer), so it is written row by row
and never read back.  The line buffer is allocated before the loan is
taken, grown only when the output gets wider, and freed with the
upscale buffer.

Output is unchanged byte for byte.  Text, 22 lines of 40 characters:

               x86-64     armhf (qemu)  aarch64 (qemu)
  5x10          0.47       0.54          0.67
  5x10 shadow   0.56       0.49          0.63
  10x10         0.37       0.61          0.51
  10x10 shadow  0.41       0.44          0.46
  6x10          0.37       0.57          0.57
  6x10 shadow   0.57       0.52          0.57

Upscale of 320x240, 2x to 6x: 0.27-0.39 of the time on x86-64 (at 4x,
460 us down to 145 us), 0.26-0.58 on armhf and 0.22-0.51 on aarch64
(qemu, relative only).

Tested against the old code with standalone harnesses: all ten blit
functions on random glyphs (blank, full and mixed rows, so shadows
overlap the next glyph) and random UTF-8 text across every font range,
40000 blits; the upscale loop over 600 random sizes, integer and
non-integer factors and padded pitches, under ASan and UBSan.  Changing
the walk order, run step or line reuse makes them fail.  Builds clean
with GCC (gnu99 and gnu89 with -Wdeclaration-after-statement, with and
without HAVE_LANGEXTRA) and Clang.
2026-10-28 13:37:47 +01:00
Codex 2f46e4c979 android: integrate hardware movie decoders with Vulkan imports 2026-10-27 10:40:52 +01:00
Codex 18cd961f51 media: retain transport state across video context resets
Save the current movie path, position and pause state before the viewer releases its player. Restore only the matching movie once its transport is ready, and discard saved state on media changes or cancellation. Cover delayed readiness and refusals in the shared controls tests, plus paused-position recovery through a real driver reset in all four menu harnesses.
2026-10-27 09:09:20 +01:00
libretroadmin ccd885c4f2 Temporal Upscaler: DLSS Neural Rendering
DLSS 5's Neural Rendering model runs over DLSS Super Resolution's
output when its library, nvngx_dlssnr.dll, is in the DLSS directory.
It goes through the same NGX session as Super Resolution: the driver's
NGX core loads the library from the directory it is given at init,
creates the feature (18) on the frame's command buffer and evaluates
it on Super Resolution's output with the core's depth and motion
vectors at render size. Cores before its driver (616.64) have no such
capability; the session then marks it unavailable and Super
Resolution goes on alone.

Settings > Video > Scaling > DLSS Neural Rendering holds the switch,
off by default, and the model's tuning: preset, style, intensity,
local structure, local tone, skin structure and auto skin mask. The
entry is shown only with DLSS selected, the library found, NGX not
OptiScaler's, and no session having found the driver without it.
The settings reach the backends as one word. The model reads its
tuning only at creation, so a changed setting rebuilds the feature
once it has held for 30 frames; turning it off retires the feature
through the same ring as Super Resolution's. System Information and
the log name the library's version, read from its file without
loading it, or say the driver needs updating.

The upscaler samples drive both backends against stand-in NGX cores
that know the feature: the tuning at creation, the evaluate's inputs
and guide sizes, the rebuild after a change holds, the release when
off, and a core without it; the loader sample finds the library and
reads its version.
2026-10-26 11:11:00 +01:00
LibretroAdmin 184f65aa03 menu: image picks keep their OK action in the media viewer (#19911)
The fullscreen viewer opens a file-list row only when it is not a
FILE_TYPE_IMAGE pick, so choosing a Background image in XMB sets the
wallpaper again instead of opening the image. The same rule gates OK in
the viewer on XMB, Ozone, MaterialUI and RGUI.

The menu media harness gains --wallpaper-pick, which goes through the
Background setting and its browser with the real driver and callbacks;
it runs for XMB and MaterialUI, the menus that offer the setting.

Closes #19911
2026-10-26 03:41:37 +01:00
Codex 77f2e5d56e menu: keep media playing while browsing its settings
Retain the current media preview across settings navigation and restore the fullscreen viewer on Back without changing playback or pause state. Cover all four menus, real browser rebuilds and visible preview pixels.
2026-10-25 08:49:06 +01:00
Codex a352690514 media: add continuous folder playback and fullscreen settings
Advance naturally sorted folder movies only after clean playback completion. Retain the final frame, stop on decode errors, and expose previous/next and settings controls in all four menu drivers.

Drain terminal AV1 output and update preview audio repeat policy without reopening the player. Cover completion, queue lifetime, invalid next files, toolbar actions and native menu presentation.
2026-10-24 17:25:12 +02:00