602 Commits
Author SHA1 Message Date
LibretroAdmin 8f1331adab Hash in C89
The texture hash, the CRC32 helpers, Adler-32 and the Ector hash are C;
the texture hash picks CRC32 or MurmurHash3 once with a branch instead
of calling through a function pointer each time, CPUDetect still
deciding which. The hashes are bit for bit the old ones, so cached and
saved hashes stay valid.
2026-11-09 21:34:27 +01:00
LibretroAdmin 82611ed0b0 Remove WindowSystemInfo: the frontend owns the window
Of it, the backends read the EFB scale, now passed as the backbuffer
scale; GLContext::Create tested for libretro, its only context; and
the controller interface kept a render window that is always null. The
video backends' Initialize, InitBackendInfo and PopulateBackendInfo,
Core::Init, EmuThread and StartEmuThread, BootCore and the controller
interface lose the parameter; PrepareWindow, ChangeWindow, the window
change refresh and the Vulkan instance's surface extensions go, as
nothing presents but the frontend.
2026-11-09 04:42:44 +01:00
LibretroAdmin 39ab0c6083 Remove free look and the hotkey manager
The projection is the game's, turned only by the VR camera. Savestates
keep the free look camera's place: written as one at rest, and read past
whichever kind a state holds. The hotkey manager and the controller setup
that alone started it are gone too.
2026-11-08 00:08:21 +01:00
LibretroAdmin 5e7772c97e Follow-ups to the LIBRETRO ifdef removal
D3D11 sets logic op support from the device again (off on UWP) and
always reports object names: the UWP check's else had swallowed the
object-name line and logic op was never on. The Android input backend
is no longer created, so its source, include and CIFACE_USE_ANDROID go.
Core.h declarations indented with spaces like the rest of the file.
2026-11-07 14:55:52 +01:00
libretroadmin c878c0d818 remove LIBRETRO ifdefs 2026-11-07 14:23:51 +01:00
LibretroAdmin cd38818e52 Common: pointer and size instead of spans, loops instead of STL algorithms
SHA1, HMAC, hex dumps, PNG loading, file search, DHCP options, HTTP
posts and DirectIOFile reads and writes take pointer plus size; callers
pass their buffers straight through. Contains.h is gone; lookups are
plain loops. File search and FAT FST sorting are in-place heap sorts;
min/max/clamp/copy/fill become ternaries, memcpy and memset. Watch
string import and export had no callers and are removed.
2026-11-07 13:37:26 +01:00
LibretroAdmin 53238c0a06 VideoCommon, backends, input, DiscIO: std::atomic -> retro_atomic
- CommandProcessor: the FIFO registers shared by the CPU and GPU
  threads are retro_atomic words, read and written through LoadReg and
  StoreReg; MMIO's LowPart/HighPart take those words.
- Fifo: the video buffer write and seen pointers, the sync ticks and
  the stop request.
- PerfQueryBase: the query count and results sit behind base-class
  helpers that every backend (Metal too) uses instead of touching the
  atomics.
- Custom assets: the loader's memory delta and an asset's last load
  time are 64-bit words; Present's swap flag is an int.
- D3D's input layout, Vulkan's waiting_for_submit.
- InputCommon: a NumericSetting's value and the Wiimote and Android
  rumble levels are kept as their bits in a 64-bit word; the
  ControllerInterface flags, counter and aspect ratio are int words.
- CachedBlob's fill position and stop flag.

UICommon/GameFileCache is deleted: only the Android app's game list
used it, and that is not part of the core.
2026-11-06 00:19:39 +01:00
LibretroAdmin 49abc7d61f libretro: call the frontend only from retro_run
In dual core the CPU thread called into the frontend while the
frontend's own loop was running: every button and axis read went to
input_cb from SI polling, each field's audio went to the batch
callback, and rumble went to the rumble interface.

retro_run now reads every input of the libretro devices once, right
after poll_cb, and emulation reads those values. Rumble the emulation
asks for is kept until the end of retro_run, which hands it over
together with the audio the frame produced.
2026-11-05 23:34:29 +01:00
LibretroAdmin c478df9181 Measure elapsed time by retro_run, not the host clock
FrameClock also sums frame lengths at the refresh rate the core reports,
and the core-wide Clock (CommonTypes.h) reads that sum. Everything that
measured elapsed time now follows the frontend: it advances a frame at a
time and stands still while the frontend pauses. That covers input
expression timers, cursor and gyro integration, Wiimote-as-device
timeouts, the DSU client, VR controller velocity, Free Look, IOS socket
timeouts, the BBA TCP timers, custom asset load times, OSD message
lifetimes, Common::Timer and the Dolphin IOS device's elapsed time.
Local steady_clock aliases are removed so nothing bypasses it.

Calendar reads stay: the RTC's starting date, file and log timestamps,
and generated file names still take the host's date and time.

Deleted: SteadyAwakeClock, the debugger's unused CodeTrace, and the
host-time diagnostics in IOS request handling and DVDThread.
2026-11-05 22:05:07 +01:00
LibretroAdmin f7d5095739 Core, InputCommon, VideoCommon: remove the remaining locks
Every std::mutex, lock_guard, unique_lock, scoped_lock,
condition_variable, call_once and semaphore left in Source/Core is
replaced by a lock-free design:

- Input: the device list, control bindings, stick calibration and
  default device are published snapshots read under a quiesce; a
  rebind requested while another thread is rebinding is handed to
  that thread instead of waited for.
- WiimoteReal: the pool thread owns the slots and runs commands from
  an MPSC queue; the active Wiimotes are atomic slots.
- EXI/SI/IOS devices: socket and packet traffic goes through SPSC
  rings or MPSC handoffs owned by one thread; USB scanning publishes
  its device list, and libusb transfers drain through a CallGate.
- Memory cards: the flush thread applies change records queued by
  the CPU thread.
- Custom assets: loads are scheduled as a published batch with an
  atomic cursor, results come back over an MPSC stack, and busy
  assets are skipped and retried.
- D3D state and GL program caches use insert-only atomic maps
  (Common/AtomicHashMap.h).
- Logging appends with O_APPEND / FILE_APPEND_DATA; FatFs reports
  busy instead of waiting; per-socket WSAStartup/WSACleanup.

Deleted as unused by the libretro core: the profiler, the FIFO
recorder, the volume verifier, the touch InputOverrider and the
GameCube adapter's libusb path.
2026-11-05 20:11:31 +01:00
LibretroAdmin 767c898df8 Move every thread onto rthreads and add a lock-free parallel_for
No std::thread, std::async, std::future or std::promise is left. Each
thread is an sthread with a plain entry point: Common::ThreadEntry<&C::F>
turns a member function into one, Common::JoinThread joins and clears a
handle, and Common::StartDetachedThread covers the fire-and-forget users.

Common/ParallelFor.{h,c} (C89) runs fn(ctx, i) for i in [0, count) on a
persistent pool of one worker per extra core plus the caller. Jobs are
claimed with an atomic counter, workers park on an eventcount between
batches, and the batch hand-off is a seq_cst users/active pair, so there
is no lock anywhere. A caller that finds the pool busy runs its batch
serially instead of waiting. retro_deinit joins the pool.

- VolumeWii::HashGroup spawned 64 threads per 2 MiB group and
  EncryptGroup another one per core; both are now parallel_for batches
  on the pool. The H1/H2 tail is a few small hashes and runs inline.
- VolumeVerifier spawned up to five std::async threads per chunk; the
  chunk's tasks now go to one persistent worker that fans them out with
  parallel_for, still overlapping the next read. The Redump lookup is an
  sthread joined in Finish or the destructor.
- The dual-core "GPU thread" in Core only set a thread_local on itself
  and exited, since the frontend runs the GPU loop. It is gone, along
  with the non-libretro branches of Core.cpp.
- The emu thread is started through Core::StartEmuThread.
- CPU core counts come from cpu_features_get_core_amount().
2026-11-05 13:00:34 +01:00
LibretroAdmin 8c7aa58f6b Remove UPnP, the unused host input backends, disc conversion and DolphinTool
None of these run in the core: UPnP served NetPlay; the DInput, XInput,
WGInput, Win32, Quartz, Xlib, evdev and Pipes input backends are never
enabled, since input comes from libretro; and disc conversion, with its
multithreaded compressor, was only reached from DolphinTool. The WIA,
RVZ and GCZ readers stay.
2026-11-05 13:00:29 +01:00
LibretroAdmin 12247f1f50 Rebuild Event, BlockingLoop and the thread helpers on libretro-common
Common::Event is an atomic flag with a retro_eventcount to park on, so
Set takes no lock and makes no syscall while nobody waits. BlockingLoop
loses both of its mutexes: waiters park on an eventcount and re-check
IsDone(), so any number may wait at once, and Prepare hands setup to
the one thread that moves the loop out of the stopped state.

The thread helpers name, yield and sleep through rthreads and
retro_timers; the unused affinity and SwitchCurrentThread helpers go.
2026-11-05 13:00:26 +01:00
LibretroAdmin ec372a67b6 Remove Qt
The core runs only inside a libretro frontend. The Qt frontend and its
submodule go, together with what only it used: the Qt DBus screensaver
inhibit, the JIT's single-block erase, the string translator hook, the
Qt translation catalogs and Transifex config, the desktop packaging
(NSIS, RPM, Flatpak) and the autoupdate overview.
2026-11-05 04:28:14 +01:00
LibretroAdmin b7e2db4e32 Remove SDL
The core takes its input from the libretro frontend and never builds the
SDL controller backend. The SDL submodule, the backend, its config entries
and the SDL hints and version bits of the Qt frontend go.
2026-11-05 04:28:11 +01:00
LibretroAdmin 6e35fc179b Add a static Makefile for the libretro core
Builds parallel_gamecubewii_libretro for every lane .gitlab-ci.yml covers:
unix (Linux x86_64/aarch64), webos, win64 (MinGW-w64), osx (x86_64/arm64,
CROSS_COMPILE), ios-arm64, tvos-arm64, android-arm64 and android-x86_64.
The source lists and per-library flags follow what the CMake LIBRETRO=ON
build links into the core, without the units only the standalone frontends
use. The per-platform configure results for curl, libusb, libiconv and mGBA
are checked in under Externals/<library>/makefile; the remaining generated
files are produced by the Makefile under obj/gen.

The Android input backend's JNI entry points belong to the Android app and
are left out of the core, which links with --no-undefined everywhere.

The Windows code builds against MinGW-w64 headers older than 12.0 as well:
D3D12 includes d3d12sdklayers.h explicitly, and the constants, declarations
and const-correct pointer types those headers lack for D3D12, device
notifications, the Wii Remote Bluetooth path, the IOS IP stack and thread
naming are provided locally.
2026-11-04 23:49:57 +01:00
Craig Carnell eb97db0652 Merge tag '2609' into 2606a-update
Release for September 2026
2026-09-24 10:15:25 +01:00
JosJuice ca8c6ee45e Merge pull request #14830 from JoshuaVandaele/sdl-miscs
SDLGamepad: Add Misc 2 through 6
2026-09-03 21:28:31 +02:00
JosJuice 5ff90a0471 Merge pull request #14686 from JoshuaVandaele/sdl-touchpads
SDLGamepad: Support multiple touchpads
2026-09-03 21:28:20 +02:00
Joshua Vandaële b572e4ca5a SDLGamepad: Add Misc 2 through 6
SDL 3 has more misc buttons for "additional controller buttons" (e.g. left/right trigger clicks on a GameCube controller, or for the second touchpad click on the Steam Controller) which use these additional named Misc buttons. Taken from [SDL_GamepadButton](https://wiki.libsdl.org/SDL3/SDL_GamepadButton)
2026-08-28 07:37:18 +02:00
JMC47 4f8af23db5 Merge pull request #14718 from JosJuice/android-vibration-length
Android: Make vibration length variable
2026-08-27 12:48:49 -04:00
Joshua Vandaële 7da0baae93 SDLGamepad: Support multiple touchpads 2026-08-10 22:41:40 +02:00
Craig Carnell d02c31a877 Merge in upstream/master and resolve compiler failures from update 2026-08-07 20:58:58 +01:00
Scott Mansell 20fea85b53 Merge pull request #14765 from slick-daddy/opt-6
InputCommon: return the device list directly in GetAllDevices
2026-07-30 21:10:41 +12:00
Dr. Dystopia 08e183d322 Replace string concatination with fmt::format 2026-07-28 12:39:54 +02:00
slick-daddy aa2167d473 Return m_devices directly in GetAllDevices(). 2026-07-27 06:15:36 +03:00
JosJuice b67188cc44 Android: Make vibration length variable
Previously we would vibrate for 100 ms on every vibration, which was
especially annoying if a game was doing a bunch of vibrations that were
supposed to be much shorter than that. Now we tell Android to vibrate
for 10 s, then cancel the vibration as soon as the game turns the
vibration off.
2026-07-09 21:05:10 +02:00
Craig Carnell e222665eb0 mingw: lower case windows includes 2026-07-08 09:18:29 +01:00
JosJuice 64a73e5636 Android: Fix mixup between Vibrator id and index
This fixes https://bugs.dolphin-emu.org/issues/14076. The issue report
more or less already says it all, but to provide a shorter summary:
We were fetching a list of vibrator IDs, but instead of passing the
vibrator ID to the vibrator manager, we passed the index of the ID in
the list. This happened to work fine on many devices, including all
devices that use DolphinVibratorManagerCompat, due to the only Vibrator
having both an index and ID of 0. But on some devices, it failed due to
the ID of the Vibrator being 1.

This fix makes us correctly pass the ID to the vibrator manager. We
still use indices in controller INI files, both for compatibility with
the controller mappings shipped with Dolphin (which use index 0) and for
backwards compatibility with older controller INI files.
2026-06-26 22:10:16 +02:00
Craig Carnell 3d070f498a libretro: update to 2606 2026-06-25 09:54:48 +01:00
Vlad Firoiu 20718de37e Unconditionally lock in ControllerInterface::UpdateInput. 2026-05-06 15:57:03 -04:00
Martino Fontana 95dec13203 Improve usage of std::move and const references parameters
Accomplished using `run-clang-tidy` with `performance-move-const-arg,performance-unnecessary-value-param,modernize-pass-by-value`.

Changed arguments to const references, removed them where inappropriate (e.g. sink parameters). Same with std::move.

Manually reviewed each change to make sure that it makes sense, and do something more appropriate if possible.
2026-04-17 12:39:46 +02:00
Craig Carnell 242e427832 libretro: fix uwp version 2026-03-14 15:03:48 +00:00
TellowKrinkle 8d7e612ed5 DSU: Don't crash on bad hostname 2026-03-12 12:15:40 -04:00
TellowKrinkle 80762e0575 DSU: Don't crash on bad hostname 2026-03-01 00:08:08 -06:00
Craig Carnell 7743c7e1dd Merge in upstream dolphin/master into libretro 2026-02-22 09:07:47 +00:00
JMC47 981b7df420 Merge pull request #14335 from TixoRebel/joycon-config
Core: Add SDL Hints settings
2026-02-20 02:44:52 -05:00
Andrew Strauss 61c36b0cc8 Add new window to configure SDL hints and store them in the main ini file
Signed-off-by: Andrew Strauss <[email protected]>
2026-02-20 02:05:35 -05:00
JosJuice bd92388d2f Android: Rework input device hotplug
Previously, when an input device was connected or disconnected, we would
recreate all devices. This commit makes it so we only touch the relevant
device instead. This matters because recreating a device causes us to
drop all held buttons for that device. Due to Android only delivering
inputs as events, we're unable to poll for currently held buttons when
recreating a device.

This recently became a problem for users of Ayn devices due to a
firmware update. Every now and then, something about the display
viewports changes, triggering an update to an input device that I assume
is a touch input device. This input device isn't something users
normally map in Dolphin's controller settings, but it changing was
causing Dolphin to drop all held buttons for the device's built-in
gamepad as well as any other connected gamepads.
2026-02-08 10:38:43 +01:00
Martino Fontana a14c88ba67 Remove unused imports
Yellow squiggly lines begone!
Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes.
If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed.
The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports.
Not everything is removed, but the cleanup should be substantial enough.
Because this done on Linux, code that isn't used on it is mostly untouched.
(Hopefully no open PR is depending on these imports...)
2026-01-25 16:12:15 +01:00
Sintendo 60ca0626df Remove VectorToJStringArray 2026-01-24 16:50:10 +01:00
JMC47 035bcffc63 Merge pull request #14289 from Sintendo/typos
Fix various typos and spelling mistakes
2026-01-17 19:10:50 -05:00
Sintendo 1e0473e44f Fix various typos and spelling mistakes 2026-01-17 20:11:38 +01:00
Joshua Vandaële 6cc121aceb DInputKeyboardMouse: Always report all possible buttons 2026-01-07 01:08:34 +01:00
Craig Carnell ee45d31871 Adjust sample rate options, 2 new options, compatibility with upstream, Windows RT/WIL functionality 2025-12-24 17:25:52 +00:00
Craig Carnell 73d2b069bf Merge upstream/master into libretro 2025-12-22 11:48:26 +00:00
Jordan Woyak 21eb43c16e ControllerInterface: Turn off SDL's GameCube controller adapter handling when Dolphin is configured to use the adapter. 2025-12-09 16:51:41 -06:00
Craig Carnell f011bebbad Merge upstream/master into libretro 2025-11-16 16:22:40 +00:00
Jordan Woyak da6c65bf3b Common: Remove the string parameters from the HookableEvent interface. 2025-11-06 22:34:40 -06:00
Jordan Woyak ca6d8e1f0b InputCommon: Make ControllerInterface RegisterDevicesChangedCallback use Common::HookableEvent. 2025-11-05 17:12:56 -06:00