Commit Graph
82 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5 2f5bb829f3 Demangle: rewrite the SN Systems demangler
The old one was reverse engineered from a handful of symbols and got the
shape of the format wrong - it required a digit right after the kind
character, which most real symbols don't have. Measured against a PSP
executable that shipped with its symbol table intact, it decoded 238 of
4662 mangled symbols, most of those incorrectly.

Worked out properly from that binary, the format turns out to be:

  __0 <kind> <name...> <params> [_ <return type>] [<qualifier>]

where the kind character (member function, free function, operator, data)
is the only thing that says how many name components follow, since nothing
separates the last one from the first parameter. Lengths are letters
(A = 0, a = 26); "5" marks an enclosing namespace; "7...._" is a template
argument list, with "4" plus a compact integer for a non-type argument and
"9<index>A" for a back-reference to one; "T<index>" and "N<count><index>"
repeat an earlier parameter; a trailing "K" is const and a trailing "T" is
a static member function. Also handles __TID_/__T_ (the two halves of a
class's RTTI) and __sti__ (a translation unit's static initializers).

That decodes 4661 of the 4662. The one holdout is an STL symbol whose
template argument is a reference to a member of another template.

Declarator wrapping is shared with the CodeWarrior demangler now, so
pointers to arrays come out as "short (**)[64]" in both.

docs/SNSystemsMangling.md describes the format, marking what's inferred
rather than attested.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SF5eS5QDNexLksRDeDZvwY
2026-08-29 23:44:35 +02:00
Henrik RydgårdandClaude Opus 5 dfc04f3578 Demangle: handle CodeWarrior templates, function pointers and @-symbols
Checked against two PSP binaries that shipped with intact symbol tables,
which turned up several constructs the format's usual description doesn't
mention:

- Template arguments are written literally inside the length-prefixed name
  ("39CList<Q38hlScreen5Brwsr13CContentsUnit>"), not with a "__PT" prefix,
  and they nest. Function templates put theirs in the base name instead,
  followed by the return type.
- A family of "@"-decorated symbols for things with no C++ name: thunks
  ("@12@__dt__3SonFv"), string literals, function-local statics and their
  guard variables. Plus __vt__/__RTTI__/__sinit_, printed in the same style
  as the Itanium special names.
- Types are now built as a split declarator, so a pointer to a function
  comes out as "int (*)(int)" rather than "int (int) *".

Also stop the lenient pass from turning plain C names with a "__" in them
into nonsense - "I3dClut__FlushCache" became "I3dClut(long, ...)". It now
requires a class qualifier, which costs nothing: over ~10000 symbols the
lenient pass rescued none and only produced those false positives.

Symbol map names go from 128 to 256 characters, since a demangled name
keeps its parameters and templates make short work of 128.

docs/CodeWarriorMangling.md describes the format, marking the parts that
are inferred from cfront rather than attested in a real binary.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SF5eS5QDNexLksRDeDZvwY
2026-08-29 23:23:57 +02:00
Henrik RydgårdandClaude Opus 5 27869abb6a Demangle: add CodeWarrior and SN Systems symbol demanglers
Older PSP binaries weren't built with GCC, so the Itanium demangler doesn't
help with them. Add two more, tried in turn by DemangleSymbolName():

- Metrowerks CodeWarrior, a descendant of the AT&T cfront scheme
  ("getDistance__6KzUtilFP7st_unitP7st_unit"). Handles Q<n> qualified names,
  the cfront type codes including T/N back-references, cv-qualifiers, and the
  operator/ctor/dtor name codes.
- SN Systems SNC/ProDG ("__0f5DstdIbad_castEwhatvK"), which encodes name
  component lengths as letters. Reverse engineered from a small sample, so
  the parts that are guesses are marked as such - they don't affect the name.

Both are rougher than the Itanium one: they aim for a correctly qualified name
plus a plausible parameter list, and print "..." for a parameter they can't
decode rather than throwing the name away. Results come back as a
DemangledSymbol with the name, parameters, return type and qualifiers kept
separate, in case a caller wants more than the printed string.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFV5DUTc9ZYAKgsCMZGwX8
2026-08-29 12:18:27 +02:00
Henrik RydgårdandClaude Opus 5 049bcd5483 Demangle C++ symbol names when loading ELF symbols
C++ homebrew has an unreadable symbol table -
everything is _ZN10PxRenderer7DrawImmE... - which makes the disassembly and
symbol list nearly useless. Add an Itanium C++ ABI demangler and run ELF
symbols through it on load, in both ElfReader::LoadSymbols (unstripped EXECs,
which is what a CMake pspdev EBOOT actually contains) and the companion-ELF
path.

The demangling standard is called Itanium for historical reasons - it
was defined for Itanium but ended up being almost universally
applicable.

Written from scratch rather than using __cxa_demangle, which doesn't exist on
MSVC/UWP, or vendoring LLVM's demangler, whose license doesn't fit. Anything
unrecognized (arbitrary constant expressions, decltype) aborts the parse and
the caller gets the original mangled name back, so a caller never sees a
half-parsed result. Recursion is depth-capped since the input comes from a
file we didn't write.

Checked against c++filt as an oracle: of 1089 mangled symbols in a real C++
homebrew EBOOT, one differs; of 55189 from libstdc++/libLLVM/cc1plus, 22
differ and 413 are declined. Fuzzed with 220k mutated and random inputs under
ASan/UBSan.

Also adds a right-click menu to the ImDebugger symbol list.

Note that SymbolMap stores names in char[128], so the longest STL names get
truncated in the UI. Still far more readable than the mangled form.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X3DbkJ8ShYiXU7q5Tv1LZu
2026-08-26 08:12:45 +02:00
Henrik Rydgård 6508ae0aae Reorganize the vertex ShaderId bits, better sorting order 2026-07-07 20:16:32 +02:00
Henrik Rydgård c46774c923 Fix the ImGe debugger vertex list 2026-06-02 14:53:37 +02:00
Henrik Rydgård 8113cb9147 Misc cleanup and renaming 2026-06-02 11:39:33 +02:00
Henrik Rydgård f60e27a9b7 Just some refactoring of the GPUStatistics struct, and more use of StringWriter 2026-05-29 14:40:31 +02:00
Henrik Rydgård d108fe25d1 Rework constant buffer loading, barrier fix 2026-04-23 13:32:06 +02:00
Henrik Rydgård c0cb010e42 MSVC project: Move the aemu_postoffice files into Common/ext 2026-01-22 01:35:08 +01:00
Henrik Rydgård 45c029cd7c Fix issue with missing strings in I18n.cpp 2026-01-22 01:30:38 +01:00
Henrik Rydgård 8b8c776491 Fix visual issue with rotation button on the pause screen 2026-01-19 17:00:41 +01:00
Henrik Rydgård 75f8a5c0e3 NiceTimeFormat: Show up to two minutes as seconds, and up to two hours as minutes. Avoids the plural problem and is nicer. 2026-01-06 20:52:37 +01:00
Henrik Rydgård 800a68f32d Sanity checking in Utf8.cpp, improve logging for missing translations 2025-12-15 17:17:23 +01:00
Henrik Rydgård 3116eba395 More UI work (#21035)
* Improve a couple of on-screen buttons (menu, fastforward)

* Fix the new continue button, oops

* Add some missing translations

* Split a translation string to make portrait look better

* More GameScreen redesign

* Don't accidentally go into game-specific mode

* Fix layout issue with popupscreens, fix context menu positioning

* One more icon
2025-11-24 20:33:13 +01:00
Henrik Rydgård 21026a38d7 Change Android launch mode to singleInstance, work-around minor text wrapping issue 2025-11-23 20:04:19 +01:00
Henrik Rydgård 3895bab1dc Fix more translation issues 2025-08-29 22:52:17 +02:00
Henrik Rydgård a1a9278047 Remove the upgrade reminder
We haven't activated it for a long time, and nowadays PPSSPP has a completely
different level of compatibility and performance compared to back when
we added the upgrade reminder.

Also I'm no longer a fan of HTTP requests on startup, even if only every
10 times like we did.

So, away it goes.

Moved the potentially useful translation strings into [Dialog].
2025-06-11 09:34:20 +02:00
Henrik Rydgård 5f7b698012 Lots of logging and cleanup. 2025-04-07 21:40:52 +02:00
Henrik Rydgård 62cd4bbefc Minor cleanups and fixes. sceJpeg will not work without HLE, so removed from disable-list. 2025-04-03 18:16:10 +02:00
Henrik Rydgård 1a93d8a1f9 Some work on symbol export, minor cleanups 2025-03-29 14:23:59 +01:00
Henrik Rydgård 9ae8691623 Fix FPS display regression 2025-03-29 11:16:33 +01:00
Henrik Rydgård 9f22d3a64e Re-enable the "HLE module browser". Add ability to export modules as jpscptrace definitions. 2025-03-25 00:11:42 +01:00
Henrik Rydgård adbceabd93 Show fake-loaded HLE modules in the debugger. Notify Atrac of its address when one is loaded
Will be useful later.
2025-03-15 15:56:11 +01:00
Henrik Rydgård 70543c0363 Update AnalyzeTrack 2025-03-05 17:02:46 +01:00
Henrik Rydgård a78ce8dfd6 Add easy way to copy build number, add way to copy system information to clipboard.
Fixes #18375, although more info could be added.
2025-02-20 10:57:10 -06:00
Henrik Rydgård 4fd085683e Fix translation mistake 2025-02-18 10:56:55 -06:00
Henrik Rydgård 9bee4192ba Implement exit confirmation when closing the window on Windows. 2025-02-17 13:09:11 -06:00
Henrik Rydgård 5eeb15b30a Use Exists instead of GetFileInfo in more cases 2024-11-30 00:39:38 +01:00
Herman Semenov 45429bcd85 [Common/Data/File/Input/Net/Serialize/System/UI] Using for based loop C++17 and replaced on structured binding map C++17 2024-09-17 17:42:08 +02:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård 5999690af5 i18n: Remove our awkward ampersand-escape support, except in [DesktopUI] 2024-05-31 09:45:59 +02:00
Henrik Rydgård 5d8560e379 Text wrapping bugfixes 2024-05-25 09:16:00 +02:00
Henrik Rydgård 8112e51c13 More string_view 2024-05-24 13:42:49 +02:00
Henrik Rydgård 4b45bde38f Convert WordWrapper to use std::string_view 2024-05-24 13:39:49 +02:00
Henrik Rydgård f6ca8101e0 Start getting string_view into WordWrapper 2024-05-24 12:40:11 +02:00
Herman Semenov c20cb3f4be Minor optimize methods std::string using param as char with simpler implementation 2024-04-10 17:57:05 +03:00
Herman Semenov 17ecee1715 Fixed return copies from functions and const ref params 2024-04-02 18:37:00 +03:00
Henrik Rydgård c5791764d8 Make the i18n T function use std::string_view
Buildfixes, crashfixes

One more

Android buildfix

Buildfix Qt
2024-02-12 18:44:39 +01:00
Henrik Rydgård 21d5257fbf Translation keys etc: Address feedback from TotalCaesar659 2024-01-23 19:23:23 +01:00
Henrik Rydgård ff0a9f2417 Remove allocation on translation key lookup 2024-01-19 14:11:18 +01:00
Henrik Rydgård 7fafc0d83b Improve error handling in homebrew install slightly 2023-12-20 18:28:41 +01:00
Herman Semenov 2a31f8c6c0 [Common/Core/HLE] Object out of scope optimization for better codegeneration (lower level scope) 2023-12-20 12:33:56 +03:00
Henrik Rydgård ebaebf5945 Merge pull request #18546 from GermanAizek/make-smart-ptr
[Common Data/Core Dialog HLE/GPU Common Vulkan] Optimize create smart pointers using C++17 std::make_*
2023-12-14 14:02:55 +01:00
Herman Semenov 08070e7f31 [Common Data/Core Dialog HLE/GPU Common Vulkan] Optimize create smart pointer using C++17 std::make_* 2023-12-14 15:44:16 +03:00
Herman Semenov 5a0d54be83 [Common/Data/GPU/Input/System/UI] Added const reference for function params 2023-12-14 14:21:11 +03:00
Henrik Rydgård a9c1bc2ce7 Add translation string, show uncompressed size if different from disk size 2023-11-27 01:11:43 +01:00
Henrik Rydgård b5c4b2c3f7 Add a missing comment 2023-09-27 12:31:17 +02:00
Henrik Rydgård cec3693526 Wrapper: Minor ordering fix 2023-08-17 15:24:00 +02:00
Henrik Rydgård d82ecf1d3e IniFile: Store sections in unique_ptrs, instead of directly.
This fixes an issue when you create two sections consecutively and
retain pointers to them, and then modify them, such as happens in the
postshader ini initialization. Previously, one of the section pointers
could get invalidated since the section vector got resized. Now, the
pointed-to sections don't move around in memory, only the list of them
does.
2023-08-13 13:41:43 +02:00