Commit Graph
63 Commits
Author SHA1 Message Date
libretroadmin 9bf2934a40 Change name to parallel_gx1 2026-11-05 20:13:01 +01:00
LibretroAdmin cb214d1034 Core, VideoCommon: drop std::this_thread waits
Waits that polled now block on an eventcount that the waited-on thread
notifies:

- Booting in dual core waits for the CPU thread to reach its run loop
  instead of polling every millisecond.
- AsyncShaderCompiler::WaitUntilCompletion wakes as each worker
  finishes an item instead of every 33 ms.

Timed sleeps go through Common::SleepUntil and SleepCurrentThreadUs,
built on retro_sleep_us: the CoreTiming throttle, PrecisionTimer, real
Wiimote report pacing, Bluetooth timed transfers, the Linux L2CAP
connect retry and the BBA read thread's idle wait.

FrameTiming::ThrottleFrame had no callers and is deleted.
2026-11-05 20:11:34 +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
Mohammad Syuhada f78a8f6a9d libretro: drop the code comment on the graphics hack options 2026-11-04 19:00:18 +08:00
Mohammad Syuhada 63e7aa247c libretro: Options: graphics hacks go to the base config layer, so a game's INI fixes keep winning 2026-11-03 12:39:15 +08:00
WizzardSK 3d6c288145 libretro: Aspect Ratio: the frontend shows the picture at the mode's aspect ratio, Dolphin stretches it over the frame
Dolphin fitted its picture into the frame by the Aspect Ratio mode, bars
and all, and the frontend scaled the frame to 4:3 or 16:9 once more, so
every mode but Stretch came out squeezed or stretched (Custom, Custom
Stretch and Raw the most). Dolphin now always stretches over the frame,
and the core gives the frontend the aspect ratio Dolphin works out for the
chosen mode (Presenter::CalculateDrawAspectRatio for a given mode), again
whenever it changes. Stretch and VR are as before.

Vulkan hands the frontend the whole swapchain image Dolphin presented
into, as D3D11 and OpenGL do with their backbuffer, instead of the EFB's
size (640x528 against a 640x480 image), which squeezed the picture.
2026-10-28 19:26:30 +01:00
Chris 4d2cc5b697 libretro: Add a Wiimote device option
A frontend can only get a real Wiimote by offering the Real WiiMote
device for each port, next to the emulated Wiimote. This option lets the
player pick one device for every Wii port instead, in place of what the
frontend set: any of the Wiimote devices, a Real WiiMote or a GameCube
Controller. Left at "Set per port", the frontend's choice stands.

Real WiiMote also scans for Wiimotes continuously, since a real one is
only found by scanning.
2026-10-23 09:50:39 +01:00
Craig Carnell be7f2f5973 libretro: add VR mode 2026-10-16 14:27:05 +01:00
Craig Carnell d277222a81 libretro: fix audio stutters in both refresh rate modes 2026-10-16 10:33:11 +01:00
Craig 7a2d51d5fa Merge pull request #514 from cscd98/ai-slop-fix
libretro: don't serialize/unserialize if core is not running
2026-10-11 11:22:15 +01:00
Craig Carnell 5af3cb859b libretro: don't serialize/unserialize if core is not running 2026-10-11 11:19:48 +01:00
Chris 761fb3237b libretro: Declare the core options before a game loads
They were only declared when a game loaded, so a frontend that lists a
core's options without loading content saw none. Kodi's add-on generator
does that, so Dolphin's Kodi add-on ships with no settings.
2026-10-09 21:08:35 +01:00
Craig Carnell dd4feb6b6d libretro: use libretro callbacks to show errors to the user instead of OSD 2026-09-09 12:54:44 +01:00
Craig Carnell 87e4b14447 libretro: add hotkey for upright toggle, rename wiimote to wiimote (upright) 2026-09-02 16:23:22 +01:00
Ryan McClelland b0cfde9c2e libretro: add Wiimote IR passthrough
Adds dolphin_ir_passthrough, letting the frontend supply the Wiimote
camera's view of the sensor bar directly instead of having the core
synthesise it from a cursor position.

The cursor path parks a notional remote two metres from the bar and
rotates it by Total Yaw/Total Pitch, a scale with no physical
derivation, so where the game draws its hand depends on a constant
fitted per game. It also cannot express roll or distance. A frontend
that knows the real geometry (a VR room, a tracked light gun) can
compute the two dots outright, which BuildDesiredWiimoteState already
supports and nothing exposed.

  * The option itself, off by default, under Wiimote IR.

  * The Pointer device registers all four touch indices instead of only
    the first, so the four IR objects ride on indices 0-3. Index 0 keeps
    its old names, leaving the mouse-mode IR binding untouched.

  * IRPassthrough is bound and enabled when the option is on: object N
    takes Pointer:XN+/YN+ over the camera's 0..1 field, PressedN as
    presence, and a small constant size. Bindings are cleared when off,
    since AreInputsBound() is half of what selects this path.

  * irPassthrough is raised at controller setup as well as on an option
    change, so the setting applies on a cold boot.
2026-08-26 16:33:35 -07:00
Craig Carnell fd4b3e5867 libretro: fix logging, also log if core files are missing 2026-08-05 20:11:39 +01:00
Craig 49d36c0a08 Merge pull request #453 from replicacoil/master
Subsystem implementation for the Game Boy Player.
2026-08-02 09:24:22 +01:00
replicacoil 0908cf1132 Subsystem implementation for the Game Boy Player. 2026-07-13 10:40:01 +02:00
Adrien Beudin 632d3a4f1c libretro: fix 240p regression and PAL60 mode switching on CRT/switchres 2026-06-27 18:47:00 +02:00
LibretroAdmin fec5e8e106 Merge pull request #428 from ryanmagoon/fix-savestate-dualcore-crash 2026-06-26 18:36:00 +02:00
Craig Carnell b14fb4347c libretro: disable GL debug by default, add options for this plus toggle some GLES features 2026-06-26 14:27:34 +01:00
Craig Carnell 3d070f498a libretro: update to 2606 2026-06-25 09:54:48 +01:00
LibretroAdmin 8b9e158138 Merge pull request #438 from beudbeud/fix/efb_switchres
fix: efb size for pal and ntsc with switchres
2026-06-24 02:01:52 +02:00
Craig Carnell a2701998b2 libretro: optimize more of retro_run through isUpdated, optimize cached lookup 2026-06-23 21:25:36 +01:00
Adrien Beudin ea331a2d27 fix: efb size for pal and ntsc with switchres 2026-06-08 11:20:57 +02:00
ryanmagoon a4ae019b04 Fix save state crash in dual-core mode
In dual-core mode, retro_serialize and retro_unserialize queue DoState
to the CPU thread via RunOnCPUThread. The CPU thread does not have the
frontend's GL context current, so any GL calls during DoState segfault.

Temporarily declare the calling thread as the CPU thread so DoState
runs inline where the GL context is valid.

Tested on macOS arm64 with a third-party libretro frontend using an
offscreen CGL context.
2026-04-14 00:18:42 -04:00
celerizer 5d9864074c update core options and mmaps 2026-04-05 21:50:45 -04:00
Craig Carnell ae95d31ea8 libretro: generate cheats and integrate into frontend 2026-03-19 14:39:29 -04:00
Craig Carnell 906f24e7f0 libretro: use core target refresh rate to set fps over game region as user has choice 2026-03-17 15:33:09 -04:00
Craig Carnell 2e13745bf5 libretro: aspect ratio update in real time 2026-03-17 15:33:09 -04:00
Craig Carnell 0bd5977073 libretro: add gc/wiispeak/logitech microphone support 2026-03-12 12:15:40 -04:00
Craig Carnell e9f64e4960 libretro: fix shutdown hang with windows 2026-03-10 17:16:27 -04:00
Craig Carnell dfc96ce503 libretro: support sensor data for emulated controller/real wii controller via emulation 2026-03-10 17:16:27 -04:00
Craig c84105557b Merge branch 'libretro:master' into upstream-update-triforce 2026-02-26 17:55:11 +00:00
Eric Warmenhoven 056fcc878e retroachievements: fix some memory maps, report semver for core 2026-02-25 14:25:20 -05:00
Craig Carnell a3b63e56df libretro: triforce support 2026-02-23 16:32:40 +00:00
Craig Carnell aadd3a1c7a libretro: fix bluetooth passthrough mode 2026-02-11 17:26:24 -05: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
Kev df2b1a754b Add crop overscan option
This option fixes NTSC video output for CRT displays by cropping the 528-line EFB to standard 480i/p resolution.
2025-11-21 22:36:55 -05:00
Craig Carnell 98f492713b Fix save/load state when in dual core mode 2025-11-17 07:22:56 -05:00
Craig Carnell ae98a5fa9e Small refactor for upstream changes, add single core mode 2025-11-16 16:25:15 +00:00
Craig Carnell f7bc2f23fb libretro: Add D3D12 renderer 2025-11-16 11:16:24 -05:00
Craig Carnell 7189a75497 Move to core options V2 style 2025-10-30 14:02:54 -04:00
Craig Carnell bb6559e51d Fix async audio crashes, add vSync option 2025-10-30 14:02:54 -04:00
Craig Carnell 2eca222690 Refactor DolphinLibretro on latest upstream changes 2025-10-14 22:54:50 +01:00
zorn c58184dde8 Fix compile errors 2025-10-10 09:23:30 +01:00
zorn 5726a6c639 Fix some errors 2025-10-10 09:23:25 +01:00
Bobby Smith 3b66006c75 Input fixes/improvements (#246)
* Fixed the issue where you had to manually edit `Dolphin.ini` to enable GC controllers 2-4.
* Added the possibility to un/plug Wiimotes or GC controllers on-the-fly. Previously not possible with GC controllers, and it was messing with the players order if Wiimotes were not reconnected in the correct order.
* Added the possibility to use GC controller as players 1-4 in Wii mode. Makes it possible to play Brawl, MK Wii, etc. with a GC layout.
* Fix Wiimotes displaying GC labels by default.
* (not related to inputs) Removed the unused "efb_scale" variable. It was harmless but that's one less warning during compilation :p
2022-03-08 22:40:11 +01:00
Bobby Smith 3b19e6d178 Added a "Rumble" core option and reorganized core options in a more "logical" way (#248) 2022-01-12 11:10:07 +01:00
Bobby Smith 3370f7693b Re-introduce "Wiimote IR" core options (#229) 2021-11-01 21:20:56 +01:00