mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
master
8
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
80feae5f31 |
iOS: route RetroAchievements through native UI instead of ImGui FullscreenUI
The iOS app renders its own SwiftUI UI, so the shared core's ImGui FullscreenUI overlay never appears on screen. Before this change every RetroAchievements event still initialized FullscreenUI and posted the notification through it, adding per-frame render work for an overlay that is invisible on iOS, and the native toast layer never saw the events at all. Add two Host callbacks so a platform can take over notification rendering: bool Host::HasNativeAchievementNotifications() void Host::OnAchievementNotification(key, duration, title, message, badge_path) When HasNativeAchievementNotifications() is true the shared core hands each RA event (unlocks, mastery, leaderboard start/submit/scoreboard, login, connect/disconnect, summary) to OnAchievementNotification and skips ImGuiManager::InitializeFullscreenUI() entirely — in BeginLoadingScreen, ClientLoadGameCallback, DisplayHardcoreDeferredMessage, and SetHardcoreMode — so the invisible overlay and its render loop stay down. The existing ImGui path is unchanged for desktop/Android, which return false from the new callback. Every frontend (eerunner, gsrunner, libretro, sdl, qt, android, test stub, macOS stubs) gets a no-op implementation; iOS provides the real one, posting the notification to its SwiftUI toast layer through ARMSX2_PostRetroAchievementsNotification. The notification now also carries the configured display duration. Also flesh out Achievements::GetCurrentUserStats / GetCurrentGameStats / GetCurrentAchievementList, which were previously unimplemented stubs returning false. The iOS bridge already wired these up to the RetroAchievements panel; they now return the logged-in user's score, the active game's unlock progress, and a bucket-ordered achievement list so the native panel has real data instead of an empty state. Stray RetroAchievements debug fprintf spam in the iOS bridge and overlay defaults is dropped. |
||
|
|
1bbe9225a1 |
remove the YAPS2_* environment-variable knobs
Eight testing-only env gates shipped in release builds, against the project's
own rule that env-var gates are scaffolding:
YAPS2_EESB / _LO / _HI offline A/B bisection of EE superblock formation,
self-labelled "Not a production knob"
YAPS2_EESB_DUMP emitted-host-code dump for the same bisection
YAPS2_NULL_GS libretro M1 headless-renderer fallback (two sites:
the renderer seed and the s_hw_render_vulkan gate --
removing only one leaves an inconsistent pairing)
YAPS2_RUN_SLEEP M2 bring-up pacing sleep in retro_run
YAPS2_PERF_LOG M1/M2 bring-up speed probe
Deletes the knobs and their now-dead branches. eeScanContinuable loses its
famBit parameter, which existed only to feed the bisect mask; the libretro core
now always takes the Vulkan path.
recompiler_tests 1407/1407.
|
||
|
|
4637de4d6e |
libretro: rename the core target to armsx2
CORENAME was still yaps2, so the libretro buildbot looked for yaps2_libretro.so while CMake's OUTPUT_NAME already emitted armsx2_libretro.so -- the artifact would not have been picked up. The make-target alias was stale for the same reason. The shipped armsx2_libretro.info was already correct; RetroArch pairs .so to .info by filename stem, so the core now has its metadata. The core has never been published, so nothing downstream breaks on the rename. |
||
|
|
2262c7bf55 |
Merge remote-tracking branch 'yaps2/main' into jit-transplant
# Conflicts: # pcsx2/arm64/BaseblockEx-arm64.h |
||
|
|
fabccaa4fb |
libretro: rebrand core to armsx2_libretro, wire libretro+SDL CI into build-all
Rename the imported yaps2 libretro core (output .so, .info, core-option prefixes, ini name, Vulkan app/engine identity) to ARMSX2. The core is still gated behind ENABLE_LIBRETRO (default OFF) and needs X11_API=OFF WAYLAND_API=OFF (headless Vulkan-context-negotiation build, same as the CI job). Exports remain retro_* only via link.T. The yaps2 nightly_release.yml is dropped — ARMSX2 has its own release process — and the reusable libretro/SDL build workflows are instead invoked from build-all.yml, so PR runs cover them. armsx2-sdl keeps the kmsdrm handheld frontend buildable for Rocknix-style downstreams. |
||
|
|
76bba7ffd3 |
Libretro: GitLab CI for the libretro buildbot (linux x64 + aarch64) (#9)
The libretro buildbot's linux nightlies are driven by a per-core
.gitlab-ci.yml on the git.libretro.com mirror, not by libretro-super
recipes — this adds one, modeled on flycast's, building yaps2_libretro.so
for linux x86_64 and aarch64 via the linux-cmake ci-templates.
The buildbot containers ship neither Clang nor the pinned third-party
libraries, so the job installs clang-17/lld-17 from apt.llvm.org and
reuses build-dependencies-runner.sh for the dependency set. The
ci-templates drive 'cmake --build --target ${CORENAME}_libretro', so a
yaps2_libretro custom target aliasing pcsx2-libretro is added; the .so is
picked up from the pcsx2-libretro/ build subdirectory via EXTRA_PATH.
Inert on GitHub — the GitHub Actions nightly is unchanged.
|
||
|
|
fbc8ab9fd2 |
Libretro: build the core on PRs too, and ship its info file (#8)
* Libretro: build the core on PRs too, and ship its info file The libretro core build is only wired into nightly_release.yml, so a PR or a push can break pcsx2-libretro while Linux CI stays green -- you find out the next morning. Call the same reusable workflow from linux_build_matrix.yml, so the core is built alongside the Qt and SDL flavours on every PR and push. Also add yaps2_libretro.info. Frontends read it for the core name, extensions, BIOS requirements and feature flags, and it has to sit next to the .so, but it never landed in the repo -- so the nightly ships a core with no info file. Every field comes from pcsx2-libretro/Main.cpp: hw_render/required_hw_api reflect the mandatory Vulkan context sharing (no software or GL fallback toward the frontend), disk_control the .m3u and tray-swap support, and cheats /memory_descriptors/input_descriptors are false because those interfaces are not registered. The same file is proposed for libretro-super in libretro/libretro-super#2013, so the two stay in sync. * Libretro: dithering, trilinear, mipmapping and FXAA core options Fill the graphics-option gap vs the pcee2/lrps2 cores: yaps2_dithering (dithering_ps2 0/1/2), yaps2_trilinear_filtering (TriFilter enum, Automatic=-1), yaps2_mipmapping (hw_mipmap) and yaps2_fxaa (fxaa), defaults matching the base config. Both the v2 table and the legacy variables list carry them. |
||
|
|
e775870c2c |
libretro core frontend (yaps2_libretro.so): Vulkan context sharing, pacing, input, audio (#4)
* Libretro: Scaffold yaps2_libretro core (M1: builds + dlopens)
New pcsx2-libretro/ target producing yaps2_libretro.so (ENABLE_LIBRETRO=ON,
or built on demand). Milestone 1 of the libretro port:
- Full libretro v1 entry-point surface, version-script-restricted to
retro_* exports (PCSX2 internals must not collide with the frontend).
- Host:: implementations adapted from pcsx2-sdl: same CPU-thread state
machine (VMManager::Execute on a dedicated thread, RunOnCPUThread queue),
no windowing/clipboard/file-picker.
- retro_load_game boots the VM headlessly: GS renderer forced to Null,
Surfaceless WindowInfo, null audio; config+data self-contained under
<system dir>/pcsx2 (yaps2-libretro.ini).
- retro_run presents a placeholder XRGB8888 frame; no pacing yet.
- POSITION_INDEPENDENT_CODE forced ON (the pcsx2-sdl ET_EXEC persisted-JIT
trick cannot apply to a shared core).
Verified: builds in org.kde.Sdk 6.10 (gcc), dlopen + retro_api_version +
retro_get_system_info OK.
Next: M2 Vulkan negotiation interface (wrap vkCreateInstance/Device so
GSDeviceVK inits against the frontend-shared device, set_image handoff),
M3 frame pacing + libretro input/audio, M4 savestates/disk control.
* Libretro: M2 Vulkan context sharing + frame handoff (first light)
The lrps2-libretro pattern ported to the modern GSDeviceVK:
- VKLibretro.{h,cpp}: the loader's global vkGetInstanceProcAddr is swapped
for a wrapper that intercepts vkCreateDevice (merges the frontend's
required extensions/layers/features into GS's create info and captures
the shared VkDevice) and vkQueueSubmit (serialises against the frontend
through the HW-render interface queue lock).
- GSDeviceVK: adopts the negotiation-provided VkInstance/VkPhysicalDevice
instead of creating its own (and never destroys the frontend's instance);
the surfaceless BeginPresent branch publishes the merged display texture
(ShaderReadOnly + ExecuteCommandBuffer) into a mutex-guarded slot.
- Main.cpp: RETRO_HW_CONTEXT_VULKAN + context negotiation interface
(create_device opens MTGS from the frontend thread, so GSDeviceVK is
fully constructed before the context reply); the VM boot parks until
context_reset delivers the retro_hw_render_interface_vulkan; retro_run
consumes at most one published frame per call and forwards it via
set_image + video_cb(RETRO_HW_FRAME_BUFFER_VALID), dupe otherwise.
First light verified on Turnip Adreno 618 (and llvmpipe): GT3 boots
(VMManager::Initialize StartupSuccess), frames arrive hw_valid with a
non-black 640x448 readback.
Known gaps for M3: no frame pacing (VM free-runs; YAPS2_RUN_SLEEP=1 paces
headless runs), no libretro input/audio, m_current is sampled by the
frontend while GS may already be rendering the next frame (single
buffered), no OSD.
* Libretro: M3 frame pacing, joypad input, audio
- Pacing: PublishFrame now blocks the GS thread until retro_run consumes
the frame (one presented frame per retro_run; the frontend's cadence is
the emulation's vsync). Enabled at context_reset, aborted before any
path that could otherwise leave the GS thread parked (context_destroy,
retro_unload_game, VKLibretro::Shutdown). Static screens still dupe
thanks to yaps2's SkipDuplicateFrames -- the VM keeps 100% speed and the
frontend gets video_cb(NULL) for unchanged frames.
- Input: retro_run forwards the libretro joypad + both analogs straight
into the DualShock2 bind slots (Pad::GetPad(0)->Set), bypassing
InputManager; SDL input source stays disabled.
- Audio: AudioStream grows a public PullFrames() (frontend-driven pull
from the ring), SPU2 exposes GetOutputStream(), the config pins the
Null backend (mix into the ring, no device thread), and retro_run
drains the ring into audio_batch_cb with float->s16 conversion.
- Config: EmuFolders::Settings is now set explicitly (the libretro path
bypasses SetDataDirectory, so the INI used to land in the cwd).
Verified on Adreno 618 with GT3: internal fps 59.9, speed 100%, frames
publish on change, INI persists under <system>/pcsx2/inis.
* Libretro: Stable backbuffer ring + dynamic PAL av_info
Fixes the RetroArch heap-corruption crash ~2 minutes in (GT3 FMV -> demo
race transition): the published frame was the pooled m_current texture,
which GSDeviceVK recycles while the frontend still samples the view for
cached-frame replays. Frames are now copied into a dedicated ring of
three backbuffer textures owned outside the pool; on a resolution change
the displaced buffer is retired (kept alive until device teardown)
instead of destroyed, because the frontend can replay the old image
indefinitely (e.g. while its menu is open). Verified: headless harness
clean over 4+ minutes at ~100% speed, RetroArch session stable past the
previous crash point.
Also: when the booted VM reports a vertical frequency different from the
NTSC default (PAL 50Hz, progressive), retro_run pushes an updated
retro_system_av_info to the frontend.
* Libretro: M4 save states (retro_serialize/retro_unserialize)
SaveState grows in-memory zip variants sharing the existing disk code:
SaveState_ZipToBuffer writes the ArchiveEntryList into a libzip
buffer source (zip_source_keep + read-back after close), and
SaveState_UnzipFromBuffer opens one over the incoming blob; the whole
entry/version/screenshot pipeline is reused via a shared
SaveState_UnzipFromZip body, so the on-disk and in-memory formats are
identical (a retro state is a valid .p2s payload).
retro_serialize runs SaveState_DownloadState + ZipToBuffer as a blocking
RunOnCPUThread job with frame pacing temporarily disabled -- while the
frontend is inside retro_serialize it is not calling retro_run, so a
parked PublishFrame would deadlock the GS freeze. The fixed
retro_serialize_size bound is 68 MiB (DownloadState's 64 MiB working
buffer + slack); the actual zip length travels as a leading u64 inside
the block.
Verified on GT3 (Adreno 618): serialize 587 ms, unserialize 131 ms,
emulation continues cleanly after the in-place load.
* Libretro: M4 core options + disk control (m3u multi-disc)
Core options (RETRO_ENVIRONMENT_SET_VARIABLES): GS renderer
(Vulkan/Software; the software renderer still presents through the
shared Vulkan context, so the negotiation path is unchanged), internal
resolution 1x-4x (EmuCore/GS upscale_multiplier, live), fast boot and
widescreen patches. Startup values apply before LoadStartupSettings;
later changes re-apply via VMManager::ApplySettings on the CPU thread.
Disk control (SET_DISK_CONTROL_EXT_INTERFACE): .m3u playlists parse
into a disc list (relative entries resolved against the playlist dir),
single-disc content registers as a one-entry list, and closing the tray
swaps via VMManager::ChangeDisc on the CPU thread. m3u added to
valid_extensions.
Regression-tested on GT3: boot, savestate roundtrip and rendering
unchanged.
* Libretro: OSD via real present path into the backbuffer
The surfaceless BeginPresent no longer copies m_current and skips the
frame -- with the libretro context active it begins an actual present
render pass targeting the dedicated backbuffer (clear + viewport/scissor,
same sequence as the swapchain path) and returns PresentResult::OK. The
whole standard presentation pipeline now runs unchanged: PresentRect
draws the display aspect-corrected with TV shaders/linear filtering,
FullscreenUI::Render and ImGuiManager::RenderOSD draw the overlay, and
EndPresent (libretro branch) finishes the backbuffer, submits without
swapchain semantics and publishes the image to the frontend. The old
copy-based publish is gone.
New core option: yaps2_show_fps (EmuCore/GS OsdShowFPS).
Verified on GT3/Adreno 618: readback shows the ImGui FPS counter drawn
over the aspect-corrected frame; boot/savestate regression clean.
* Libretro: Fix retro_serialize bounds check to include the u64 length header
The check compared buffer.size() against the caller's buffer size, but the
write is sizeof(u64) + buffer.size() — a state within 8 bytes of the
reported serialize size would overflow the frontend's buffer.
* Libretro: Size the output canvas to the internal resolution
The present backbuffer was sized from the fixed 640x448 window info, so
the upscale option rendered internally at 2x-4x and then got scaled back
down before the frontend ever saw the frame.
The present path now tracks the merged frame: expand it to the target
aspect ratio (the internal-resolution screenshot rule), clamp it to the
advertised max geometry (2732x2048, 4x PAL at 4:3), and resize the
surfaceless "window" before the draw rect is computed so the whole
frame stays consistent. ResizeWindow learns to adopt a new size with no
swap chain, and retro_run reports geometry changes with SET_GEOMETRY so
the frontend keeps scaling correctly. Resizes are rare in practice (boot,
FMV/interlace switches, option changes) and reuse the existing
retire-don't-destroy backbuffer ring.
* Libretro: Core options v2 + video/performance options
Registers options through SET_CORE_OPTIONS_V2 with Video/Performance/
System categories and per-option help text (legacy SET_VARIABLES kept as
the fallback), and adds:
- Aspect ratio (Auto 4:3/3:2, 4:3, 16:9, Stretch) — the canvas sizing
follows it, and 16:9 pairs with the widescreen patches option
- Deinterlacing mode (Automatic/Off/Weave/Bob/Blend/Adaptive)
- No-interlacing patches (progressive output for supported games)
- Blending accuracy (Minimum-Maximum)
- EE cycle rate (50%-300%) and EE cycle skip speed hacks
* Libretro: Don't double-load the Vulkan library in EnumerateGPUs
The frontend preloads libvulkan for the context negotiation, and
EnumerateGPUs asserted (and would have unloaded the host's library) when
called with no device open — which is exactly the Software renderer
path, via D3D::GetPreferredRenderer. Use the already-loaded library and
leave it loaded.
* Libretro: Second wave of core options
Video: texture filtering, anisotropic filtering, software renderer
threads. Performance: hardware download mode (readbacks are expensive
on tile-based mobile GPUs), MTVU and Instant VU1 toggles. System: BIOS
selection (scanned from <system>/pcsx2/bios at option registration,
auto = first valid image) and cheats (.pnach loading).
* Libretro: Fix crash on content close
Two shutdown bugs, both hit on every quit-from-menu:
- GSDeviceVK::Destroy destroyed the negotiated VkDevice, but that device
belongs to the frontend (it made the vkCreateDevice call) and the
frontend tears it down after context_destroy — RetroArch was left
waiting on and destroying a dead device (freeze, then segfault).
Guard it like the adopted VkInstance already was.
- The frontend replays the last set_image indefinitely (menu background,
duped frames), so retro_unload_game now retracts the image and waits
for the GPU before VM teardown destroys the textures it points at.
Verified: 6/6 clean RetroArch exits after a full Vulkan content run
(was a reliable SIGSEGV on close before).
* Libretro: Reclaim retired presentation backbuffers
A resolution change retires the displaced backbuffer instead of freeing
it, because the frontend may still be replaying its image for a few
cached/duped frames. But the retired list was only cleared at device
teardown, so every interlace<->progressive switch (frequent in FMV-heavy
games) leaked a full-resolution render target for the rest of the
session.
Each retired backbuffer is now tagged with a monotonic present count and
reclaimed once kLibretroRetireFrames (6) presents have gone by --
comfortably beyond any libretro frontend's swapchain depth (2-3), and
GSTextureVK destruction is itself fence-deferred, so the underlying
Vulkan objects aren't freed until the GPU is done with them either.
Verified: GT3 boots/renders through its 640x448<->640x480 interlace
switches with no crash (harness + real RetroArch, clean exit).
* Libretro: Move libretro headers to 3rdparty/libretro
The libretro Vulkan HW-render interface header was pulled in by adding
pcsx2-libretro/ to PCSX2_FLAGS's INTERFACE include path, which leaked
onto every target that consumes PCSX2_FLAGS (and had the GS backend
reaching into the frontend's source dir).
Move libretro.h + libretro_vulkan.h into 3rdparty/libretro/ behind a
header-only INTERFACE library (libretro-headers), and link it PRIVATE
to the two targets that actually need it: PCSX2 (for VKLibretro.cpp) and
the pcsx2-libretro frontend. No other target sees the headers now.
|