Commit Graph

1308 Commits

Author SHA1 Message Date
georgemoralis
1adbdb53fd
Merge branch 'main' into fontlib 2026-01-12 10:04:58 +02:00
Stephen Miller
910f737079
Core: Add libSceRtc, libSceJpegDec, libSceJpegEnc, and libScePngEnc LLEs (#3918)
* Run libSceRtc LLE

The more we've used our HLE, the more issues we've had with it.
While we debug these bugs, re-enabling LLE will address any regressions the swap caused.

* libSceJpegDec LLE

Needed for Trackmania until we implement HLE for this library

* libScePngEnc LLE

Needed for Minecraft until we implement HLE for this library

* Update documentation appropriately

* libSceJpegEnc LLE

By @georgemoralis's request
2026-01-11 20:48:41 +02:00
Stephen Miller
3844a2fb54
Lib.Videodec2: Stub sceVideodec2AllocateComputeQueue to return a valid computeQueue pointer. (#3915)
* Stub compute queue output to cpuGpuMemory

* Rename namespace

This has bugged me for far too long

* Oops
2026-01-11 10:47:34 +02:00
Stephen Miller
ae47dd5d54
Handle exceptions from OutputDebugString API. (#3914)
Needed after #3900
2026-01-11 03:36:36 +02:00
Stephen Miller
12cd27d0b7
Fix socket_is_ready (#3912) 2026-01-10 21:15:06 +02:00
Stephen Miller
ed73d2b02c
Libraries: libSceNpWebApi2 stubs (#3908)
* libSceNpWebApi2 stubs

Based on some brief decompilation, brings some extra Unreal Engine titles futher.

* Clang

* Suggestions and fixes
2026-01-10 17:33:28 +02:00
Stephen Miller
b84c5ed110
Corrected physical base handling for memory pools (#3909)
On real hardware, each pool commit can have multiple physical memory allocations, always allocating the lowest free physical addresses first.

Currently, since we currently only support one physical mapping per VMA, I create a separate VMA representing each physical allocation we perform.
2026-01-10 17:23:42 +02:00
marecl
f42a566cef
Dirents backport (#3876)
* lseek for directories behaves correctly when final index is smaller than 0 (EINVAL)
Backported and improved dirents from QFS
Normal directory dirents update on change

* PFS moves pointer to end when last dirent is returned

* Correct entry type in PFS directory
2026-01-10 00:35:43 +02:00
Valdis Bogdāns
8376f17c2c
Merge branch 'main' into fontlib 2026-01-09 23:48:07 +02:00
georgemoralis
be99cb4d5b
Emulator state (#3906)
* moved getShowFpsCounter to emu state

* more state variables

* fps counter is back

* removed fpscolor
2026-01-09 19:42:05 +02:00
Vladislav Mikhalin
f7a473b391
read compiled SDK version from eboot (#3905) 2026-01-09 18:29:09 +03:00
w1naenator
4ae39ff2df Fix: fypo 2026-01-09 14:39:18 +02:00
Valdis Bogdāns
6174ce1c74
Update fontft_internal.cpp
typo fix
2026-01-09 14:23:00 +02:00
w1naenator
78faac52e5 clang 2026-01-09 13:04:48 +02:00
w1naenator
d845b9503d Refactor font rendering and path resolution logic to fix Metaphor: ReFantazio glyphs cropping and anywhereVR "thin" glyphs.
- Updated RenderCodepointToSurface and RenderCodepointToSurfaceWithScale functions to set result->transImage to nullptr instead of result->stage.
- Modified font definitions to use updated font file names for various language sets.
- Introduced ResolveSystemFontPathCandidate function to streamline font path resolution, allowing for better handling of font directories.
- Enhanced LoadFontFile function to check for font files in "font" and "font2" directories based on the parent directory name.
- Improved error logging for font path overrides in ResolveSystemFontPath function.
2026-01-09 13:00:17 +02:00
Valdis Bogdāns
cfe3259999
Merge branch 'main' into fontlib 2026-01-09 11:44:49 +02:00
TheThunderTurner
233192fa95
LIbrary: libSceRudp (#3903)
* libSceRudp

* use newer glslang

* remove module start/stop

* register lib, revert glslang upgrade

* 2026

* remove default funcions
2026-01-08 21:22:21 +02:00
w1naenator
e9ca20b65d Add internal font handling structures and layout computation functions
This commit introduces a new header file `fontft_internal.h` containing
various structures and functions for managing font handles, layout metrics,
and rendering operations. Key additions include:

- Definitions for `FontHandleOpenInfo`, `FontHandleStyleStateTail`,
  and `FontHandleOpaqueNative` to encapsulate font state and properties.
- Layout-related structures such as `HorizontalLayoutBlocks`,
  `VerticalLayoutBlocks`, and their respective I/O structures for
  managing layout metrics and effects.
- Functions for computing horizontal and vertical layout blocks,
  along with utility functions for handling layout words in byte format.
- Stubs for library functions related to font management and rendering.

These changes aim to enhance the font rendering capabilities of the
shadPS4 Emulator Project, providing a robust foundation for future
font-related features.
2026-01-08 03:08:29 +02:00
Valdis Bogdāns
cfcd365158
Merge branch 'shadps4-emu:main' into fontlib 2026-01-06 14:25:59 +02:00
georgemoralis
256397aa3b
Net fixes (#3895)
* support for flag in recv/send

* make kalapsofos happy

* on more SendMessage try

* ReceiveMessage too
2026-01-05 01:57:31 +02:00
mercury501
975b1d312a
Fixed dialog text input off by one error (#3892)
* Fixed dialog off by one error

* Fixed exclusion error

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2026-01-04 21:30:50 +02:00
kalaposfos13
df844f8c02
Add thread names to log lines (#3893)
* the bare minimum (this won't even compile on windows yet)

* well I guess this is redundant now

* Windows GetThreadName

* Move function to common/thread and add full guest name where applicable

* the loathsome clang-formatter

* do stuff first ask for opinions later

* copyright 2026

* remove unused header

* copyright 2024-2026

---------

Co-authored-by: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com>
2026-01-04 21:10:42 +02:00
Vladislav Mikhalin
9a3e4ea56b
ajm: support for m4aac (#3880)
* ajm m4aac

* fix build on unix

* small tunes

* skip 2 frames if nodelay is not set, change to google repo
2025-12-28 13:24:42 +02:00
Vladislav Mikhalin
05f14e3682
ajm fixes (#3875) 2025-12-23 11:11:52 +02:00
Valdis Bogdāns
ff947b61a5
Merge branch 'shadps4-emu:main' into fontlib 2025-12-23 01:06:25 +02:00
Rodrigo Cioletti
138425fdf4
Network: Fixed null string crash on sceNetResolverCreate (#3872)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* Network: Fixed null string crash on sceNetResolverCreate

* Assigned an empty string for better code styling

* Fixed wrong commit
2025-12-21 15:50:49 +02:00
Valdis Bogdāns
42f088f56d
Merge branch 'shadps4-emu:main' into fontlib 2025-12-20 14:07:47 +02:00
marecl
2bbb04ff55
ENAMETOOLONG, posix_rename fix (#3869)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* ENAMETOOLONG on paths > 255 characters
Corrected posix_rename behaviour:
* handles errors only if dst exists (shouldn't error out if doesn't)
* recursively removes "old name" (would otherwise fail if it's a not-empty dir)
* actually creates target directory

* Updated detection

* destubbed unlink()

* proper error returned
2025-12-19 14:58:07 +02:00
Valdis Bogdāns
20927a88d7
Merge branch 'shadps4-emu:main' into fontlib 2025-12-12 22:17:50 +02:00
Stephen Miller
9e7df6ae54
Kernel.Vmm: Remove hack from #2726 (#3864)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* Remove SceKernelInternalMemory mapping

Contrary to my initial beliefs, this is very much a hack.

* Unreachable for unpatched code

This will always infinitely loop, making logs extremely large.

* Update linker.cpp
2025-12-11 12:24:45 +02:00
AlpinDale
de6c5bbb83
cli: add --show-fps to the CLI launcher (#3860)
* cli: add `--show-fps` to the CLI launcher

* fix: clang-format

* nit: PascalCase -> camelCase
2025-12-08 21:02:54 +01:00
Stephen Miller
65f0b07c34
libkernel: Implement sceKernelEnableDmemAliasing, proper mapping type checks in posix_mmap (#3859)
* Basic handling for MAP_VOID, MAP_STACK, and MAP_ANON in mmap.

* Update memory.cpp

* Update memory.cpp

* Dmem aliasing check

* Oops
2025-12-08 13:46:32 +02:00
kalaposfos13
2a5910ed51
New translations en_us.ts (OpenOrbis) (#3858) 2025-12-07 23:56:51 +02:00
Stephen Miller
391d30cbb1
cpu_patches: Patch stack canary accesses (#3857)
* Patch stack checks done using fs:[0x28]

Additionally adds support for multiple patches per instruction, since this makes two separate patches we need to conditionally perform for mov instructions.

* Missing include

* Disable patches for Apple

Mac can use their native FS segment directly, so these patches aren't needed

* Oops
2025-12-06 22:47:39 -08:00
Odukoya Abdullahi Ademola
5183cbe686
sceHttpUriSweepPath (#3854)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
2025-12-04 10:50:24 +02:00
Odukoya Abdullahi Ademola
9e80cde60d
Implement http uri escape unescape (#3853)
* Implement sceHttpUriEscape and sceHttpUriUnescape

* Implement sceHttpUriEscape and sceHttpUriUnescape

* edge case

---------

Co-authored-by: Pirky10 <odukoyaabdullah@gmail.com>
2025-12-04 10:50:01 +02:00
kalaposfos13
98fd0689ac
Revert non-Linux parts of #3819 (#3852)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* Revert non-Linux parts of #3819

* More OpenOrbis stuff that I couldn't be bothered to put in a new PR
2025-12-03 15:05:19 +02:00
Pirky
e5ea55e425
np: Add dialog state tracking for NpCommerce (#3841) 2025-12-02 10:22:41 +02:00
Stephen Miller
a5f9280841
Return CPU mode based on param.sfo attributes (#3846)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
Values are based on hardware observations.
2025-12-01 10:21:19 +02:00
kalaposfos13
cf866ab294
Don't bother trying to restart the emulator if sceSystemServiceLoadExec is called with an invalid path (#3845)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2025-11-30 22:40:58 +02:00
TheThunderTurner
78e301c3db
libSceNpCommerce (#3839)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* libSceNpCommerce

* copyright notice
2025-11-29 23:47:15 +02:00
Valdis Bogdāns
e53d581a78
Merge branch 'main' into fontlib 2025-11-24 22:20:59 +02:00
w1naenator
59785a020d Scaling and font state
Removed env‑driven debug scaling (ScaleMode, GetScaleMode, GetScaleBias, SHADPS4_FONT_SCALE_*).
Added FontState::is_otf_cff and storing of external vmetrics (ext_ascent, ext_descent, ext_lineGap).
Introduced ComputeScaleExtPoint, ComputeScaleExtPixel, IsEmProfileExternalFont and ComputeScaleExtForState to choose ascender‑ vs EM‑based scaling per font (system fonts + CFF → ascender; selected TTF profiles → EM).
Updated callers (sceFontGetCharGlyphMetrics, glyph cache, layout, renderer, clones, scale setters) to use ComputeScaleExtForState instead of ComputeScale / ComputeScaleExt.
System font handling

Added ReportSystemFaceRequest helper to centralize “attach system font or log why not” and avoid repeating the logic at each call site.
Slightly adjusted when system_requested is set and how fallback/system attach errors are reported.
Horizontal layout

sceFontGetHorizontalLayout now logs invalid parameter/handle and, when an external face is present, uses that face’s vmetrics and the per‑state scale to compute baselineOffset and lineAdvance.
(Fallback still uses the simple scale_h‑based approximation.)
Glyph rendering (horizontal)

Reworked sceFontRenderCharGlyphImageHorizontal:
Resolves effective pixel scale from the attached style frame + point/pixel API via ResolveStyleFrameScale.
Uses ComputeScaleExtForState to compute scale_y (and derived scale_x), rather than a single global scale.
Always computes metrics from stbtt_GetCodepointHMetrics + GetCodepointBitmapBoxSubpixel, with metrics->h_bearing_* and h_adv in sync with those scales.
Introduces a clearer origin/gravity model:
System fonts: (x,y) treated as raw top‑left.
Certain external TTFs (EM‑profile) : (x,y) treated as baseline.
Other external fonts (CFF/point etc.): (x,y) treated as line‑top with baseline offset.
Validates surfaces more strictly and returns NO_SUPPORT_SURFACE when buffer/size/bpp are invalid; supports only 1‑bpp and 4‑bpp.
Uses a local glyph_bitmap and a straightforward blit with scissor/clipping, instead of the older mix of cached bitmaps/PUA logging.
Removed PUA/placeholder glyph debug tracing and the more ad‑hoc baseline “adjusted_y” heuristic.
Logging clean‑up

Standardized LOG_INFO/LOG_DEBUG in sceFont* functions:
Info: usually just "called" or a short description (“scale pixel set requested”, etc.).
Debug: "parameters:\n"/"result:\n"/"template state:\n" followed by values on separate lines.
LOG_ERROR messages no longer repeat the function name (logger already prints it); they now say "invalid parameter", "invalid font handle", "no support glyph (face/scale)", "no support surface (buffer)", etc.
Added missing error logs before some early returns (allocation failures, page_count == 0, invalid parameters), and upgraded a few previous LOG_DEBUG “invalid params” to LOG_ERROR where they correspond to an error return.
2025-11-24 22:05:34 +02:00
kalaposfos13
2577dfde7e
Add assert on SFO file being empty (#3815)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2025-11-23 17:30:09 -08:00
Stephen Miller
f6ae5544fd
Kernel.Vmm: Protect Fixes (#3822)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* Some mprotect fixes

The biggest thing here is preventing mprotect on memory that isn't mapped in address space. This would cause exceptions before, but succeeds on real hardware.
I've also included a couple other minor fixes, mostly based around some tests I recently performed.

Note: All changes to memory pools in this PR are assumed. I have not yet tested memory pools with any of this logic, but I do at least want to prevent mprotect on pool reserved memory to avoid crashes.

* Update memory.cpp

* clang
2025-11-22 10:32:53 +02:00
oltolm
4922d526fe
msys2: fix build (#3818)
* cmake: fix mingw-w64 build

* time.cpp: fix build with Clang on Windows

* tls.h: include malloc.h for alloca
2025-11-22 10:32:29 +02:00
w1naenator
c3948bff95 Merge branch 'fontlib' of https://github.com/w1naenator/shadPS4 into fontlib 2025-11-22 01:21:19 +02:00
w1naenator
7600090b9c clang 2025-11-22 01:21:16 +02:00
Valdis Bogdāns
95b9ea6f99
Merge branch 'main' into fontlib 2025-11-22 01:15:41 +02:00
w1naenator
e3e8561d58 font.cpp
Added full glyph tracking/outline plumbing plus mutex-protected generated-glyph tracking and helpers (BuildTrueOutline, true-outline extraction, glyf detection, system-font cache/fallback logic, etc.).
Swapped OTF defaults for several JP/JP_AR sets (and CJK sets used by Death Stranding / Anywhere VR) to SSTAribStdB24-Regular.ttf or other TTFs so we load glyf faces.
Wrapped every LOG_* call in INFO/DEBUG pairs: INFO just announces the call, DEBUG lists each parameter on its own line with an extra trailing newline; warnings/errors remain for validation/fallback.
Implemented TTF detection for cache loading and fallback with logging.
Renamed glyph param struct/members, moved glyph handle struct into the header, and renamed the glyph API parameters/fields accordingly.
font.h

Added the new glyph outline/glyph handle definitions and renamed OrbisFontGenerateGlyphParams members (id, res0, form_options, mem, res1/2).
Updated function prototypes to use the renamed types and pointers (e.g., sceFontGenerateCharGlyph signature now matches the new names).
fontft.cpp

Reworked sceFontSelectLibraryFt/sceFontSelectRendererFt logging to follow the same INFO/DEBUG pattern (INFO announces that selection is requested, DEBUG dumps all params).
2025-11-22 01:14:32 +02:00