naett has had a complete libcurl backend all along; we just never built it,
so Linux ran with HTTPS_NOT_AVAILABLE. That means no homebrew store over
HTTPS, and RetroAchievements talking to plain http://retroachievements.org.
libcurl is loaded with dlopen rather than linked, the same way we handle the
Vulkan loader, so it stays a soft dependency: we need the curl headers at
build time, but a build made here still starts on a machine without libcurl
installed - it just reports HTTPS as unavailable, exactly like today. Distro
packagers get the behavior they'd expect either way, and certificate
validation comes free from the system CA store.
New net::HTTPSAvailable() answers "did that work", and SDLMain folds it into
SYSPROP_SUPPORTS_HTTPS, which everything downstream already degrades on.
Four fixes to the backend itself, all noted in ext/naett/README-ppsspp.md:
- panic() called exit(1) on a pipe or curl_multi_perform failure. Taking the
emulator down because a download failed isn't acceptable - the backend now
disables itself and requests complete with naettGenericError.
- CURLINFO_RESPONSE_CODE writes a long into res->code, which is an int. Eight
bytes into four, getting away with it only because the next field absorbs
the zeroes.
- curl_easy_setopt is varargs and wants a long for these options; int literals
and int variables are UB on LP64.
- naettPlatformCloseResponse called through a null function pointer when
libcurl was missing. Found by testing that path, which segfaulted.
CI needs libcurl4-openssl-dev (curl-dev on Alpine) or it would quietly keep
building without HTTPS.
naett has been a submodule pinned at v0.3.3; upstream has had no commits since
April 2024, and we want to carry local changes (next up: a libcurl-backed HTTPS
path for Linux). It's ~1500 lines of MIT C, smaller than several things we
already vendor, so bring it in-tree and drop the submodule.
Also drop the generated single-file amalgam (naett.c) that every build system
was compiling, and build src/*.c directly instead - otherwise the file you edit
isn't the file that gets compiled, which is a trap for anyone patching this.
example/ and testrig/ (a whole Android Studio project) are gone with it.
Two changes were needed to make the sources build on their own, both noted in
ext/naett/README-ppsspp.md along with the upstream commit:
- naett_internal.h now includes naett.h, which the amalgam pulled in first.
- naett_linux.c now includes stdio.h/stdlib.h. It calls exit/calloc/realloc/
free/fprintf without ever including either, and only got away with it because
naett_core.c sat above it in the concatenation.
No functional change - Linux still has HTTPS_NOT_AVAILABLE set, so it doesn't
build naett at all yet.
Rename naett to naett-lib
The RISC-V branch had its instruction-decode logic (including a locally
defined info struct) written directly inline in HandleFault(), unlike
the other three architectures which each delegate to a dedicated
AnalyzeLoadStore function in their disassembler file. Move it into
ext/riscv-disas.h/.cpp as RiscVAnalyzeLoadStore, matching the existing
X86AnalyzeMOV/Arm64AnalyzeLoadStore/ArmAnalyzeLoadStore pattern.
Common and basis_universal call zstd functions directly but never
declared the dependency after being split into their own
CMakeLists.txt files, relying on directory-scope include_directories()
that no longer reached them. Worked on Linux via system zstd.h, but
broke the Android NDK build which has no such fallback.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMv4XdM5dThs9Avr5FPXRv
gason, vma, cityhash, 7zip (ext/lzma-sdk), basis_universal, pugixml,
kirk (ext/libkirk), sfmt19937, xbrz, and xxhash were each defined with
a small add_library() block directly in the root CMakeLists.txt, even
though ext/CMakeLists.txt already exists and handles every other vendor
library (freetype, imgui, naett, discord-rpc, libchdr, zstd, miniupnp,
armips, glew, snappy, ...) via add_subdirectory(). Gave each one its
own ext/<name>/CMakeLists.txt to match that established pattern; xxhash
stays a loose file pair in ext/ (it never had its own directory) so its
add_library() lives directly in ext/CMakeLists.txt instead.
ext/libkirk/CMakeLists.txt already existed but was dead - nothing
add_subdirectory()'d it, and its source list was stale (missing
amctrl.c/.h, which the live inline definition in root had). Replaced
its contents with the current, correct list instead of leaving two
diverging definitions around.
Dropped several target_include_directories()/include_directories()
calls that came along with these (e.g. cityhash, kirk, xbrz, xxhash,
and the lzma-sdk one for 7zip): traced their actual consumers and found
each library's own sources resolve their sibling headers via the
default same-directory quote-include rule, and every external consumer
already uses the full "ext/<name>/..." path resolved through the global
root include - so these were dead weight regardless of position.
Replaced two single-value alias variables (LIB7ZIP_LIBRARY, always
"7zip"; BASISU_LIBRARIES, always "basis_universal") with their target
names directly in Common/CMakeLists.txt, rather than trying to carry
them across the new add_subdirectory boundary - plain set() variables
don't propagate back up out of a child scope without PARENT_SCOPE, so
keeping them as-was would have silently broken Common's link line.
Verified with a fully clean rebuild (removed build/ entirely), a
HEADLESS=ON UNITTEST=ON build, and a LIBRETRO=ON build.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSNaZnHCjmryS3ziVN9gZU
- Make GetPdpStat behave more like in P2P mode
- Now fetches accumulated ready to be received amount of data
instead of only the immediate to be received Pdp block
- Make GetPtpStat behave more like in P2P mode
- Now fetches accumulated ready to be received amount of data
instead of the size of the next server send block
- Make PtpRecv behave more like in P2P mode
- Fix block like behavior where whole server send block has
to be consumed before getting data from the next send block
- Fix block like bahavior where sender sends in small PtpSend
calls while receiver receive with less frequent but bigger
buffer PtpRecv causes bloat(and eventually server kick)
on relay
- bump aemu_postoffice
- timeout TCP connection attempts at 5s to not block the library user too much
- set send and receive buffer sizes after connection to avoid some blocking cases on some platforms with small defaults (windows?)
- pop OSD message when relay connection fails
Improve nonblock relay recv operation responsiveness, it helped a
few games on PSP get back to full speed during multiplayer, might
help severely underpowered devices on PPSSPP as well.
extend max pdp block size, due to user report of the following in
dissidia:
07:53:752 MatchingEven I[SCENET]: HLE\sceNetAdhocMatching.cpp:1188 EventLoop[1]: Matching Event [1=HELLO][00:02:02:02:02:02] OptSize=4696