Commit Graph
79 Commits
Author SHA1 Message Date
Dean 4a027f138c Merge pull request #8250 from vittoriosalvadore/codex/fix-font-render-surface-stride
fix(libSceFont): accept overlapping render surface rows
2026-11-02 03:21:46 +13:00
akkadbakkad89 d60cfed900 fix(libSceFont): reject segment writes that cannot fit inside the arena 2026-11-01 05:40:20 +01:00
akkadbakkad89 686c914a0b fix(libSceFont): bound segment writes at the arena extent 2026-11-01 05:40:20 +01:00
akkadbakkad89 b99aaba744 fix(libSceFont): allow split segment stops, guard only unitSize 0 2026-11-01 05:40:20 +01:00
akkadbakkad89andDevin 1d95e3925e feat(libSceFont): implement drawup gradient segment insertion
sceFontGraphicsAppendGradientSegment decodes from the 4.03 libSceFont
body at 0x20500: sorted-inserts a 0x18-byte color-stop node into the +8
chain of linear (0x20) and radial (0x30) gradient records while
node->+4 == record->+4 and position >= node->+0x10. Stop records live in
a unit byte stream built from the per-object segment arena at
object->+0x10 (+0xc0 descriptor, mutex at +0x40, stats +0x48/+0x4c),
allocated by the span allocator at 0x1b5e0 (12-byte nodes: count(22b),
chain index(21b), span end(21b); index 0 is the sentinel). Units chain
through frame->+0x18/+0x20 with byte position in frame->+0x10/+0x14;
sub-0x18 tails get a 0xff pad record plus a zeroed tail. Validation
order, error codes (0x80460020/0x80460086/0x80460002/0x804600a0), NaN
acceptance, stats updates skipped on alloc failure, and the pad loop's
abandon-on-failure all follow the disassembly; guest_font_graphics
covers insert order, epoch stop, pads, unit boundaries and exhaustion.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-01 05:40:20 +01:00
akkadbakkad89andDevin af51d245f9 docs(libSceFont): scope the 13.42 callback difference per body
The 13.42 runs report error paths storing at frame +4 without the
registered callback on the image/pattern bodies, while the fills'
sealed paths still invoke it. Scope the recorded difference
accordingly.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-01 04:16:05 +01:00
akkadbakkad89andDevin fe6cd4504f fix(libSceFont): correct drawup option1, sealed error path, and pool return
Firmware 4.03 re-disassembly of the drawup bodies fixes three
transliteration errors:

- Option1Flags[1] is 0x3000, not 0x2000: the option1 jump table at
  0x37fcc routes index 1 to case code that ors 0x2000 then falls into
  or 0x1000.
- Sealed paths run the shared error epilogue (store at frame+4 and
  invoke the registered callback), like every other error path; use
  DrawupRecordError instead of a bare return.
- DrawupPoolAllocate returns memory + completingNodeIndex*slotSize
  (0x1bcc0 marks slots start..start+count but returns the node whose
  span finished the run), not the run's first slot.

The 13.42 emulator report matches on all three; its callback
suppression and +0x20 pool entries are firmware differences, not
deviations here.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-01 04:16:05 +01:00
akkadbakkad89 b258d8ed3a feat(libSceFont): implement drawup flat color and gradient record producers 2026-11-01 04:16:04 +01:00
akkadbakkad89andDevin 3f90ab8e0b fix(libSceFont): correct drawup option1, sealed error path, and pool return
Firmware 4.03 re-disassembly of the drawup bodies fixes three
transliteration errors:

- Option1Flags[1] is 0x3000, not 0x2000: the option1 jump table at
  0x37fcc routes index 1 to case code that ors 0x2000 then falls into
  or 0x1000.
- Sealed paths run the shared error epilogue (store at frame+4 and
  invoke the registered callback), like every other error path; use
  DrawupRecordError instead of a bare return.
- DrawupPoolAllocate returns memory + completingNodeIndex*slotSize
  (0x1bcc0 marks slots start..start+count but returns the node whose
  span finished the run), not the run's first slot.

The 13.42 emulator report matches on all three; its callback
suppression and +0x20 pool entries are firmware differences, not
deviations here.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 16:33:04 +00:00
akkadbakkad89 74948cef4c fix(libSceFont): guard drawup pool scan index and size test descriptor 2026-10-31 14:21:02 +05:30
akkadbakkad89 23527403a5 feat(libSceFont): implement drawup texture image/pattern record producers
Firmware 4.03 bodies at 0x20cb0 (image) and 0x20f50 (pattern) recovered:
frame magic/sticky/parameter checks with error store at +4 and hook,
record-pool u16 free-run allocation under the pool mutex, 0x80 record
header (type 0x40/0x50, sequence, payload at +0x80), descriptor memcpy
of mode bytes, and same-sequence queue append bumping frame+0x28.
libSceFont links libkernel for scePthreadMutexLock/Unlock; guest test
covers validation, record bytes, queue order and the allocator.
2026-10-31 13:05:37 +05:30
akkadbakkad89 d9a6517b6f fix(libSceFont): correct DrawupFillTexturePatternObject ABI
Firmware 4.03 body at 0x20f50 takes ten integer arguments with the\noutput pointer last - the PPSA20397 libSceFontGsm.prx caller rotates\nsix registers and pushes four stack arguments, no float registers.\nUpdate the declaration, stub and signature assertion, and record the\nverified offsets and record/queue semantics in the debt file.
2026-10-31 12:45:22 +05:30
MarcZX10 9253494692 docs(libSceFont): glyph attribute accepts only 0x10 and 0x11
Old claim: every glyph keeps an opaque int attribute whose valid values are unknown, and an attribute never set is 0.

What the code does: sceFontGlyphDefineAttribute returns SCE_FONT_ERROR_INVALID_PARAMETER for any value other than 0x10 or 0x11, stores the value in one bit of the glyph flags and returns the previous 0x10 or 0x11, so a glyph never set reads 0x10. sceFontGlyphGetAttribute returns 0x10 or 0x11 and ignores its attribute argument. The handle pair sceFontDefineAttribute and sceFontGetAttribute is unchanged: an int that reads 0 when never set.

Permalinks at the audited SHA:
- https://github.com/boykopovar/AnyPS5/blob/b1b5353cfcee098ed17e3ba8a6e616bee97c9215/core/libs/prx/libSceFont/src/Render.cpp#L527-L549
- https://github.com/boykopovar/AnyPS5/blob/b1b5353cfcee098ed17e3ba8a6e616bee97c9215/core/libs/prx/libSceFont/src/Style.cpp#L147-L162
2026-10-30 14:05:33 +00:00
Adrià e049725553 Merge pull request #13096 from Celegans12/feat/font-inventory-exports-20261030
feat(font): add missing font inventory exports
2026-10-30 11:56:59 +01:00
maximaxi01 47fa9ee0a6 fix(libSceFont): accept overlapping render surface rows 2026-10-30 02:54:49 -04:00
Adrià 3efd0c8386 Merge pull request #12674 from hyvvs/feat/font-graphics-resource
fix(libSceFont): correct drawup texture argument ABI
2026-10-30 07:16:49 +01:00
Codex 4c39b1f5c8 feat(font): add missing font inventory exports 2026-10-30 02:32:51 +02:00
hyvvs d8e256b77c docs(libSceFont): cite original drawup recovery evidence 2026-10-29 21:27:34 +01:00
hyvvs 70ec0f302d docs(libSceFont): clarify drawup ABI and mode width 2026-10-29 21:26:11 +01:00
Adrià cc0e00efcd Merge pull request #12585 from xXPBSXx/test/font-rebind-renderer
test(libSceFont): cover the sceFontRebindRenderer return codes
2026-10-29 21:19:27 +01:00
Adrià 40a8faf90a Merge pull request #12528 from legendary-cookie/test/font-outline-buffer
test(libSceFont): cover the renderer outline buffer size, reset and policy
2026-10-29 20:35:00 +01:00
hyvvs facc4e8781 fix(libSceFont): restore drawup texture argument ABI 2026-10-29 02:22:40 +01:00
xXPBSXxandClaude Sonnet 5.5 75bb8cb2bc docs(libSceFont): record that sceFontRebindRenderer follows the shadPS4 port
The return codes of sceFontRebindRenderer come from our shadPS4-based port and
are unmeasured; the new test pins them, so the debt file now says so.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 23:10:18 +01:00
AdriàandClaude Sonnet 5.5 b617382728 docs(libSceFont): record the unmeasured renderer outline buffer behaviour
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 19:18:31 +01:00
Misjudgments 410e3b8b21 fix(libSceFont): keep horizontal writing on a single baseline
Horizontal writing steps advanced the pen by the glyph's vertical advance on
every character, so text drifted down diagonally (steepest for CJK fonts,
whose vertical advance is roughly the em size). The step's GlyphMetrics
width/height were also overwritten with the pen position, leaving the first
glyph of each run invisible at pen (0, 0).

Every supported writing form (0x10/0x11/0x12) is horizontal, so the pen must
advance only along X and the step reports the real glyph width/height.
2026-10-28 12:50:41 +01:00
Lindamea1andClaude Opus 5.5 ac682a4064 fix(libSceFont): stop a font writing from owning its string's characters
sceFontWritingInit took a reference on the string's host character
storage and kept it in the caller's SceFontWriting bytes. Only a later
sceFontWritingInit on the same, unchanged bytes dropped it, so every
string drawn with a fresh, zeroed or overwritten writing leaked its
characters, and re-initialising both copies of a copied writing dropped
its one reference twice. A SceFontWriting has no teardown export, so it
is plain caller memory and cannot own anything.

sceFontCreateString now allocates the characters through the string's
FontMemory, as it already did the string, so no character pointer the
guest receives points into host memory. sceFontDestroyString clears
the string's magic and frees both, and a failed create clears it before
freeing the string. A writing keeps only a pointer to its string and
checks the magic on every step, so after the destroy its steps return
null unless that memory holds the magic again, as when a new string is
allocated there. An init that fails after resetting the writing still
leaves it stepping nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 09:00:33 +00:00
Adrià 63d5eb00e4 Merge pull request #10892 from EagleBearerYS/feat/scefont-glyph-render-image-v2
feat(libSceFont): render generated glyphs with sceFontGlyphRenderImage
2026-10-27 07:59:02 +01:00
Adrià Franch cfc700020f docs(debt): fix sentence break and move font entry off the section end 2026-10-27 00:29:09 +01:00
akkadbakkad89 31d91561c9 docs(debt): record recovered evidence for CbMemsetExclusive and font drawup fills 2026-10-27 00:29:05 +01:00
Adrià 7a21897555 Merge pull request #10636 from xXPBSXx/docs/debt-font-renderglyphimage-title
docs(debt): note how titles call sceFontRenderCharGlyphImage
2026-10-26 22:18:09 +01:00
Yunus Shaikh 7d86f79ebe fix(libSceFont): follow the module's frame order and leave vertical glyph renders unimplemented
BunnyFl ran firmware 13.42's libSceFont natively against this PR's
checks. With both set, the surface's style frame wins over the argument,
so it is now taken first. A frame that sets no scale, zeroed or only
initialised, is accepted and keeps the glyph's generation scale instead
of returning SCE_FONT_ERROR_INVALID_PARAMETER. A valid
sceFontGlyphRenderImageVertical call, and sceFontGlyphRenderImage on a
vertical font, throw again: the module draws the char call's pixels
there but reports a different advance and stride (40/40 against 90/90
at 40 px), and one case doesn't name the rule.

The test drops the vertical comparison and the non-renderer pointer
check, whose result in the module depends on memory past the pointer,
and checks the frame order and the unscaled frames.
2026-10-26 05:05:24 -07:00
Adrià cbaacd2910 Merge pull request #9731 from hypermoist/feat/font-words
feat(libSceFont): build and search word dictionaries as the console does
2026-10-26 11:42:17 +01:00
Dean ca8257d923 Merge pull request #10952 from AZLisme/feat/batch2-font-letter-traversal
fix(libSceFont): exhaust render-step character traversal
2026-10-26 22:06:04 +13:00
Adrià 34b882ff19 Merge pull request #9722 from hypermoist/feat/font-graphics-fill-descriptors
feat(libSceFont): build the graphics region and fill descriptors as the console does
2026-10-25 23:49:00 +01:00
Dean fd450a5b9b Merge pull request #8997 from HQasper/claude/project-thread-wjykmu
fix(libSceFont): select the Hangul Light system font
2026-10-26 11:08:35 +13:00
Dean fe86ec4a3d Merge pull request #10539 from hypermoist/feat/font-get-glyphs-outline-profile
feat(libSceFont): report the glyph outline profile through the FreeType driver
2026-10-26 02:20:13 +13:00
AZLisme 0afde4ec7c fix(libSceFont): exhaust characters within a writing step 2026-10-25 18:13:22 +08:00
Yunus Shaikh 68820535b9 feat(libSceFont): render generated glyphs with sceFontGlyphRenderImage
Draw a glyph from sceFontGenerateCharGlyph through the sceFontRenderCharGlyphImage rasterizer at the glyph's own scale, with the renderer argument checked as sceFontBindRenderer checks it and the style frame argument, else the surface's frame, applied as surface frames are. The horizontal and vertical forms place the image like their character forms. The three functions build on RenderCodeWithStyle and ApplyStyleFrame from the previous commit and move out of Unimplemented.cpp.
2026-10-25 07:27:44 +00:00
hypermistandClaude Opus 5.5 0c799de538 test(libSceFont): stop pinning the unimplemented font-set outline profile path
The font-set record path still throws in production, but the test no
longer asserts it: tests cover implemented behaviour only. The null-output
check on a font-set handle stays. The outline profile debt entry states
the gap without naming a source.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 19:57:38 +13:00
hypermist 938458062e Merge branch 'feat/font-get-font-style-information' into feat/font-get-glyphs-outline-profile
# Conflicts:
#	docs/dev/debt/libSceFont.md
2026-10-25 19:50:28 +13:00
hypermistandClaude Opus 5.5 c46dfd259d docs(libSceFont): state the font style information gap without naming a source
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 19:50:06 +13:00
hypermist 19f50102fa Merge branch 'feat/font-get-font-metrics' into feat/font-get-font-style-information
# Conflicts:
#	docs/dev/debt/libSceFont.md
2026-10-25 19:50:06 +13:00
hypermistandClaude Opus 5.5 a2df041469 docs(libSceFont): state the font metrics gap without naming a source
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 19:49:25 +13:00
xXPBSXxandClaude Sonnet 5.5 0a17562fc7 docs(debt): note how titles call sceFontRenderCharGlyphImage
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 02:08:52 +01:00
klosixgaming-arch 0e46a0c497 fix(libSceFont): resolve a default string direction at creation
A string created from a text source in the default horizontal form (0x10)
reported 0x10. TEKKEN: DARK RESURRECTION (PPSA31371) passes the reported form
to sceFontCreateWritingLine, which only accepts 0x11 and 0x12, so the call
failed and the layout width was 0.

On firmware 13.42 sceFontCreateString decides the direction for a default-form
source and sceFontStringGetWritingForm returns the stored form. The string
gets 0x12 when its first strong character is left to right, 0x11 when it is
right to left, and 0x12 when it has none. Left-to-right and right-to-left marks
count as strong, embeddings and overrides do not, and text between an isolate
initiator and its PDI is skipped. Explicit 0x11 and 0x12 sources keep their
form.

The test follows the table reported on the pull request. Which characters are
strong is decided by Unicode block ranges here, not by the full bidi class
tables.
2026-10-24 19:21:23 -05:00
hypermistandClaude Opus 5.5 be0142a377 Merge remote-tracking branch 'upstream/main' into feat/font-words
Kept main's Api.hpp declarations and dropped the duplicated struct block from Unimplemented.cpp.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 12:39:45 +13:00
hypermistandClaude Opus 5.5 45047622f2 Merge remote-tracking branch 'upstream/main' into feat/font-graphics-fill-descriptors
Kept main's Api.hpp struct definitions and dropped the duplicates from FontGraphics.hpp.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 12:06:11 +13:00
Dean Galvin 18e0b85d1f Merge main into codex/fix-font-render-surface-stride 2026-10-25 12:05:14 +13:00
hypermistandClaude Opus 5.5 928729bdfb feat(libSceFont): report the glyph outline profile through the FreeType driver
sceFontGetFontGlyphsOutlineProfile reports the maxp maximum contours,
points, composite contours and composite points through the driver slot
at SysDriver+0x70, as libSceFont and libSceFontFt do in firmware 13.60.
A maxp older than 1.0 returns SCE_FONT_ERROR_NO_SUPPORT_FUNCTION, and a
failed call clears the output. Font-set records, which the console
merges over system font entries, still throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 22:02:15 +13:00
hypermistandClaude Opus 5.5 2dd8d4902d feat(libSceFont): report font style information through the FreeType driver
sceFontGetFontStyleInformation fills the 24-byte style block through the
driver slot at SysDriver+0x48, as libSceFont and libSceFontFt do in
firmware 13.60: the FreeType family and style names, the italic and bold
flags, the OS/2 weight class when it is a multiple of 100 from 100 to 900,
the width class below 10, and 1 plus a right-to-left head direction plus
0x80 for vertical metrics. A font-set record supplies the same fields
directly. A failed call points both names at an empty string and clears
the rest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 18:30:38 +13:00