The core builds with a static Makefile (Makefile + Makefile.common) in the
manner of the other ParaLLEl cores, for every target .gitlab-ci.yml has:
Linux x86_64/aarch64, Windows (MinGW, native or cross), macOS, iOS, tvOS,
Android arm64/x86_64 and webOS. CMake, vcpkg and their overlay ports are
gone; the libraries the core needs are submodules built with it (fmt
12.1.0, glm 1.0.1, glslang 15.1.0, libusb 1.0.29, pugixml 1.15, zlib
1.3.1, zstd 1.5.7), with the generated files and the graphic packs
produced by the Makefile itself (tools/pack_graphic_packs.c), and a
precompiled header for gcc and clang.
The core is renamed parallel_gx2 (parallel_gx2_libretro.info, library
name "ParaLLEl GX2").
HTTP and TLS go through RetroArch's libretro-common (net_http with the
per-request TLS settings, the built-in TLS client, x509, the hashes and
the KDF) in place of libcurl, OpenSSL and mbedTLS: dependencies/curl-compat
is the small libcurl API nlibcurl and napi use, on one transfer thread with
lock-free submission and per-handle event queues, with its own tests
against local HTTP and TLS servers, plain and under ASan/UBSan and TSan,
in both CIs. The libretro-common files are plain copies from RetroArch.
boost is replaced by the few headers the core uses (boost-compat), and
the CI files build with the Makefile.
The GamePad's sticks went from libretro_get_analog_state straight into
vpad.cpp, past ControllerBase and its dead zone, so the slightest touch
moved them while a Pro Controller had Cemu's 25%. Two core options in
Controller, 0-50% in steps of 5, 25% by default as standalone: player 1
(the GamePad, applied in libretro_get_analog_state, or port 1's
controller) and players 2-4. LibretroController hands the value to
ControllerBase as its axis setting, so Wii Remotes and Pro/Classic
Controllers follow it too (demifiend9, NNshi).
Updates and DLC in system/Cemu/titles, the built-in graphic packs and their options, the device types per port, rumble and screen layouts, the iOS/tvOS/webOS builds, and a status section that says what is known not to work today instead of what worked in August. The install step copies the core under its own name.
23 commits since the last sync: SAMPLE_G/SAMPLE_LB texture offsets, vertex export bursts, the shader loop regression, GX2 shader mode handling, MOVA overflow, cubemap slice copies, OSTicksToCalendarTime leap years, and nsysnet select starvation.
The core now reports its version as 2.6-341-g32e6628a (git describe against the v2.6 tag) instead of a bare 2.6.
None of these were built into the core any more; now they are gone from the
tree as well. Input comes from the frontend and audio goes to it, so SDL, the
DSU client, the keyboard provider, real Wiimotes over hidapi/BlueZ, the
GameCube adapter, XInput and DirectInput go, and so do cubeb (the submodule
with it), XAudio2, XAudio 2.7, DirectSound and the DirectX 2010 headers, the
Discord Rich Presence client, Feral GameMode and the ScreenSaver helper that
only SDL filled in. The code that stays loses the #if branches that named
them; the API enums keep their values, since config files store them. The
README's build steps lose the packages and flags only these needed, and
upstream's BUILD.md, CONTRIBUTING.md, CODING_STYLE.md and boost.natvis go
with the standalone they describe. libusb stays: nsyshid passes real USB toy
portals through to the game.
.upstream-excluded lists every path removed for being standalone-only, the
wx GUI included, and AGENTS.md says to run git rm --pathspec-from-file on it
right after merging upstream Cemu. That settles modify/delete conflicts in
favour of the deletion and also removes files upstream newly adds under those
paths, which git would otherwise bring in without any conflict.
Built on all seven targets plus iOS and tvOS.
The buildbot builds this branch nightly for every target the core has, so
the releases that were here are gone - they could only ever be older than
what RetroArch's own Core Downloader hands out.
Reported by @i30817 in #13, and the README was simply stale: libretro_init_paths
has taken mlc01 from RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY since the move off
system/Cemu/mlc01 - writable per-user data belongs in the save directory by
libretro convention, and that is where every save has been going.
Also says what happens when the frontend offers no save directory (the system
one, as before) and that "Sort saves by core" does not produce Cemu/Cemu, since
someone looking for their saves is the reason to read this line at all.
cache_context was false, so RetroArch destroyed the Vulkan context whenever it
rebuilt its video driver - which a fullscreen toggle does mid-title. Every
object this renderer owns lives on that device, so the emulator carried on
against a dead one: before the upstream sync the GPU thread wedged on a lock,
after it the driver faulted, and each attempt at a fix moved the symptom rather
than removing it.
The crash report finally said so plainly once the handler recorded the guest
state before attempting a host backtrace (which faults here and swallows the
rest of the report): "no PPC instance on this thread" ruled out emulated code,
lr pointed inside libvulkan_freedreno and pc at an address that is not mapped
at all - the driver calling through an object that had been freed. PCEE2, whose
fullscreen toggle works, sets cache_context = true.
Verified: two toggles during NSMBU, RetroArch logging "Using cached Vulkan
context" each time, no crash and no GPU-park timeout.
This retracts the claim in the previous commit and in the README that
suspending the emulated CPU was the missing piece - it was not. The GPU pause
gate stays: it keeps the GPU thread off the frontend's objects while the
swapchain is swapped, and costs one atomic read per command packet.
RetroArch tears its graphics context down under a running title when the user
toggles fullscreen, and this core renders through the frontend's Vulkan device,
so everything it does during that window is undefined. Before the upstream sync
it wedged the GPU thread on a lock; afterwards it faults inside the driver, in
LatteQuery_UpdateFinishedQueries off the command processor's vsync handling.
Comparing against the pre-sync core showed the same toggle hanging it, so this
is not a regression from the merge - the merge only changed which way it fails.
The command processor now checks a gate at each command boundary.
context_destroy raises it and waits for the GPU thread to park; context_reset
releases it. The wait is bounded at 500ms and warns rather than blocking
forever: a frozen frontend would be worse than the race being closed.
This is not the whole fix. With the GPU thread parked the title keeps
executing, its GX2 calls go unanswered, and it can jump to a bad address -
observed as a guest-side fault after the toggle, where the crash used to be in
the driver. Suspending the emulated CPU across the teardown is what is still
missing, and that reaches into the coreinit scheduler.
README: drop the claim that fullscreen toggles are survivable - they are not,
and were not before this sync either. It is now written up as a known issue
with what is done and what is left.
The Vulkan present path kept using the retro_hw_render_interface_vulkan cached
when the renderer was built. RetroArch rebuilds its video driver behind the
core's back - a fullscreen toggle does it - and frees that interface without
calling context_destroy or context_reset, so presenting through the cached
pointer is a use-after-free waiting to happen. It now asks for the current
interface every frame and skips the present when there is none. (The same defect
was just diagnosed and fixed in the PCEE2 core, where it reliably crashed on the
frontend's F key.)
LIBRETRO.md becomes README.md, and it picks up what this sync changed:
submodules are required for the build (vcpkg lives in one, and configure fails
without it), the arm64/vcpkg environment, the extension-flag reconciliation on
the frontend's device, the process-exit path, SDL3, and a section on syncing
with upstream Cemu - remote, branch main, why this fork's own main is left
alone, and the four things that break every time. The key-file list said the
core still had a separate CemuLibretroLinux.cpp; it does not.
Note for future syncs: README.md exists upstream too, so it will conflict on
every merge from now on, where LIBRETRO.md never could.
* Implement GDB stub debugger
Can be enabled by using the "--enable-gdbstub" option (and the debugger GUI, although that's untested) which'll pause any game you launch at start-up. Will start at port 1337 although it'll eventually be user-editable. The code is a bit weirdly sorted and also just needs a general cleanup, so expect that eventually too. And uses egyptian braces but formatting was easier to do at the end, so that's also something to do.
It has been tested to work with IDA Pro, Clion and the standalone interface for now, but I plan on writing some instructions in the PR to follow for people who want to use this. Memory breakpoints aren't possible yet, only execution breakpoints.
This code was aimed to be decoupled from the existing debugger to be able to be ported to the Wii U for an equal debugging experience. That's also why it uses the Cafe OS's thread sleep and resuming functions whenever possible instead of using recompiler/interpreter controls.
* Add memory writing and floating point registers support
* Reformat code a bit
* Format code to adhere to Cemu's coding style
* Rework GDB Stub settings in GUI
* Small styling fixes
* Rework execution breakpoints
Should work better in some edge cases now. But this should also allow for adding access breakpoints since it's now more separated.
* Implement access breakpoints
* Fix some issues with breakpoints
* Fix includes for Linux
* Fix unnecessary include
* Tweaks for Linux compatibility
* Use std::thread instead of std::jthread to fix MacOS support
* Enable GDB read/write breakpoints on x86 only
* Fix compilation for GCC compilers at least
The thread type varies on some platforms, so supporting this is hell... but let's get it to compile on MacOS first.
* Disable them for MacOS due to lack of ptrace
---------
Co-authored-by: Exzap <[email protected]>