Commit Graph

236 Commits

Author SHA1 Message Date
Herman S.
6203d382e2 [Kernel] Clear object handles before release in ObjectTable::Reset
During bulk teardown, objects still had stale handle entries when
Release() triggered their destructors, hitting the handles_.empty()
assertion.
2026-03-09 14:15:14 +09:00
Herman S.
a00fd0eb12 [Kernel] Remove some log spam 2026-03-09 14:15:14 +09:00
Herman S.
02fccd9113 [Kernel/XMP] Add title-specific file I/O hooks for XMP volume sync
Some games persist BGM volume through their own save files but never
call XMPSetVolume. Add a TitlePatch system that intercepts NtReadFile/
NtWriteFile to apply game-specific logic as well as logic to identify
the memory location that the volume data is read into and monitor that
memory location for changes, updating XMP player volume if it changes
during gameplay.

Includes patches for known games with this issue:
Dead or Alive Xtreme 2 (544307D2), PGR4 (4D5307F9) and PGR3 (4D5307D1)
2026-03-09 08:59:15 +09:00
Herman S.
eb914ae77d [Kernel] Return null on handle type mismatch instead of asserting 2026-03-09 00:07:45 +09:00
Herman S.
f9d4dbc8e9 [Build] Use clang 20 for clang format consistently across Win/Lin 2026-02-15 01:25:43 +09:00
The-Little-Wolf
a8fe4666ad [XEX] - log outputs
- Finish XEX_HEADER_XBOX360_LOGO, XEX_HEADER_FILE_FORMAT_INFO, XEX_HEADER_DELTA_PATCH_DESCRIPTOR, XEX_HEADER_SYSTEM_FLAGS_32, XEX_HEADER_ENABLED_FOR_CALLCAP, and XEX_HEADER_GAME_RATINGS
- Add missing xex2_header_keys
- Add flag name outputs
- Removed magic number
- Added X_FILE_CHARACTERISTICS to X_FILE_FS_DEVICE_INFORMATION
2026-01-30 18:45:04 +01:00
Adrian
4b73839bf1 [XAM] Added std::optional to SPA getters 2026-01-06 18:22:35 +01:00
oltolm
492fa7c632 use concepts instead of SFINAE 2025-12-22 10:00:52 +01:00
Adrian
6783bea223 [XAM] Implemented SPA XMAT 2025-11-23 19:17:39 +01:00
Adrian
d915dd808d [XAM] Implemented SPA XRPT 2025-11-22 21:19:49 +01:00
Adrian
eb6221d631 [XAM] Added is_system_property util to UserData 2025-11-19 21:50:37 +01:00
Adrian
243178a310 [XAM] Implemented SPA Stats Views 2025-11-18 21:27:45 +01:00
Gliniak
b3a4ae5507 [Kernel] Added ability to mark xbdm calls as HighFrequency 2025-10-29 12:02:41 +01:00
Margen67
f36dbd2b33 [3PP] Switch to zlib-ng 2025-07-27 02:46:43 -07:00
Gliniak
4182852a4b [Base] Split of xbox.h file
- Splitted into: kernel.h and xam.h
- Removed UpdateSpaData from KernelState into ContentManager
2025-07-26 21:25:32 +02:00
Margen67
3eef564ff8 [format] Require EOF newline 2025-07-19 14:42:21 -07:00
Margen67
4cb783bf22 Header cleanup 2025-07-19 14:42:21 -07:00
Adrian
fd1abfe6aa [Lint/CI] Use LLVM v19 for Linux & Lint 2025-06-21 00:25:27 +02:00
Gliniak
b864149575 [Misc] Cleanup in Kernel 2025-05-31 12:00:47 +02:00
Gliniak
fe739208b6 [VFS] Rewrote STFS to use memory mapping
- Replaced old-style buffer, buffer_length with std::span
- Added STFS and SVOD specific Entry and File classes
- Other smaller improvements
2025-05-14 21:38:02 +02:00
Adrian
bde7d5579a [Kernel] Fixed xex2_version 2025-04-15 20:37:20 +02:00
Gliniak
1110cdd372 [Kernel] Added support for writing/reading GPD files
This breaks settings in games that are using them and savefiles in games that use settings to store progress
2025-03-07 11:59:48 +01:00
Adrian
60318a5db6 [Module] Include XEX_SYSTEM_FLAGS in the log 2025-02-26 19:22:43 +01:00
Gliniak
1688ea5d69 [Kernel] Replaced TranslateAnsiString with TranslateAnsiPath for file paths.
This removes paths that starts or ends with whitespace characters
2025-01-14 22:45:43 +01:00
Gliniak
09be7e874a [All] Fixed multiple issues during build on Linux
- Added some fixes introduced by RodoMa92 in PR198

- Lack of AVX2 extension (should be done differently in the future)
- Disable deprecated-volatile warning
- Added missing override in posix EventInfo, ImGui notification class and XContent class
- Removed not used XAudio2.h include in XMP
- Fixed missing switch-case in XObject
- Added fugly template in native_list.h
- Fixed multiple smaller issues
2025-01-10 21:41:45 +01:00
Gliniak
2fc36721b4 [Kernel] Removed useless GameInfoWrapper class
It was added back in 2016 and never really used.
I tested few games and never saw GameInfo.bin in XNA games or any other game
2024-12-14 20:51:16 +01:00
Gliniak
0368e06b71 [XDBF] Added option to read XTHD section
This will be useful as it contains title id and version
2024-12-10 19:10:17 +01:00
Gliniak
952526a78e [Util] Added crypto utils required for decrypting/encrypting account data.
Thanks Emoose for implementation
2024-09-28 10:54:48 +02:00
Pipi86
6a8a6d15c0 [Kernel] Removed typos from xlast.h and xlast.cc 2024-09-23 09:25:59 +02:00
Adrian
629707b935 [XLast] Presence string parser
Thanks Gliniak for parser.
2024-09-21 19:31:53 +02:00
Adrian
12bf52b363 [XLast] Add presence getters 2024-09-21 18:16:46 +02:00
Gliniak
854b7df2ba [Kernel] Added Property class and storing them for user 2024-09-21 17:40:30 +02:00
Gliniak
86bd62125d [Kernel] Implemented Game Info Database
This aggregates XDBF and XLAST into one entity.

Replaced UserData::Key into more versatile AttributeKey for future usage in properties
2024-09-20 19:29:37 +02:00
Gliniak
d232bdbecf [UTIL] Fixed bug in TranslateUnicodeString code
It was incorrectly copying length in bytes instead
of character count which was causing out of bounds access and string corruption
2024-09-13 12:21:21 +02:00
Gliniak
ec267c348a [LINT] Fixed lint issues after clang-format update 2024-06-13 20:56:56 +02:00
Gliniak
4ee9fa970d [Kernel] XDBF: Removed unknown fields from: XdbfContextTableEntry 2024-03-17 19:39:50 +01:00
Gliniak
b9061e6292 [LINT] Linted files + Added lint job to CI 2024-03-12 19:19:30 +01:00
Gliniak
321305cbf8 [XAM] Changes to settings handling
- Fixed incorrect X_USER_PROFILE_SETTING structure
- Added X_USER_PROFILE_SETTING_HEADER based on entries from console
- Removed X_USER_PROFILE_SETTING_DATA in favor of X_USER_DATA
X_USER_DATA is used also in Properties in exactly the same way
- Removed is_set in favor of X_USER_PROFILE_SETTING_SOURCE
- Prevent setting from storing settings longer than 0x3E8 bytes. Some games try to write bigger value which causes them to crash
2024-02-18 17:27:59 +01:00
Gliniak
18b5a6706a [Kernel] Revert Guest->Host Object Mapping 2024-01-20 10:15:54 +01:00
Gliniak
49d44600e8 [XDBF] Added support for reading compressed XLast XML file
To decompress it we need gzip and then some library for XML to read it
2024-01-10 22:03:27 +01:00
Gliniak
d93ba3dfcf [XDBF] Added support for reading Stats and Match Collection 2024-01-06 16:50:30 +01:00
Gliniak
d6dc4dc556 [Kernel] Added Extracting Properties and Contexts out of SPA file
+ Did a bit of a cleanup in achievement earning code
2023-12-21 20:43:19 +01:00
disjtqz
275454089e [Kernel] Implement ObCreateObject 2023-10-21 17:33:07 +02:00
disjtqz
6a08208dc8 Proper misalignment for AllocatePool, add guest object table 2023-10-14 19:29:25 +02:00
disjtqz
ee424ae14a [Kernel] nonintrusive guest to host object mapping 2023-10-14 15:01:12 +02:00
disjtqz
d0a6cec024 total apc rework 2023-10-11 17:43:59 +02:00
disjtqz
b5ddd30572 moved xsemaphore to xthread.d
add typed guest pointer template
add X_KSPINLOCK, rework spinlock functions.
rework irql related code, use irql on pcr instead of on XThread
add guest linked list helper functions
renamed ProcessInfoBlock to X_KPROCESS
assigned names to many kernel structure fields
2023-10-11 17:43:59 +02:00
Byrom90
f743cf1e65 Implimented xex timestamp logging & ldr_data field. Allows custom plugins to access a modules timedatestamp via LDR_DATA_TABLE_ENTRY. 2023-08-08 08:45:43 +02:00
chss95cs@gmail.com
2fa2f1a78c Add more wrapper functions to ppc_context_t in kernel, want to switch…
… over to referencing state through ppc_context as much as possible, it'll make implementing things like kernel processes much easier in the future

Move forward definitions of kernel types into kernel_fwd.h

Stub implementation of  XamLoaderGetMediaInfoEx
Partially implement XamSetDashContext
implement XamGetDashContext
Stub implementation of XamUserIsUnsafeProgrammingAllowed
Stub implementation of XamUserGetSubscriptionType
Expanded the supported object types for ObReferenceObjectByHandle and wrapped the logic for encoding the type in a constexpr function
ObReferenceObjectByName was taking lpstring_t for first param, but the function actually takes X_ANSI_STRING ptr

NtReleaseMutant actually does not return anything from KeReleaseMutant, it just checks the handle and returns whether it was invalid.

Changed the raise/lower irql functions to just set the irql on the pcr instead of setting it on field of Processor, processor is a shared object and irql is per-thread

Semi-stub implementation of KeGetImagePageTableEntry. I locked at it in the HV and got it so the values are in the same range the HV returns + actually reflect the page & memory range, but i doubt its equal to the values the hv returns on real hw. Used by modern dashboards, don't know for what.
Log error message for ObDereferenceObject w/ null ptr.

Allocate a special fixed page that dashboards reference, currently don't know what the data on that page is supposed to be.
Add current_irql field to X_KPCR
Added Device object member of XObject::Type enum
Added some notes about other gpu registers, found a table of register names and indices in xam
2023-04-23 10:39:52 -04:00
chss95cs@gmail.com
27c4cef1b5 Added logger flags, for selectively disabling categories of logging (cpu, apu, kernel). Need to make more log messages make use of these flags.
The "close window" keyboard hotkey (Guide-B) now toggles between loglevel -1 and the loglevel set in your config.
Added LoggerBatch class, which accumulates strings into the threads scratch buffer. This is only intended to be used for very high frequency debug logging. if it exhausts the thread buffer, it just silently stops.
Cleaned nearly 8 years of dust off of the pm4 packet disassembler code, now supports all packets that the command processor supports.
Added extremely verbose logging for gpu register writes. This is not compiled in outside of debug builds, requires LogLevel::Debug and log_guest_driven_gpu_register_written_values = true.
Added full logging of all PM4 packets in the cp. This is not compiled in outside of debug builds, requires LogLevel::Debug and disassemble_pm4.
Piggybacked an implementation of guest callstack backtraces using the stackpoints from enable_host_guest_stack_synchronization. If enable_host_guest_stack_synchronization = false, no backtraces can be obtained.
Added log_ringbuffer_kickoff_initiator_bts. when a thread updates the cp's read pointer, it dumps the backtrace of that thread
Changed the names of the gpu registers CALLBACK_ADDRESS and CALLBACK_CONTEXT to the correct names.
Added a note about CP_PROG_COUNTER
Added CP_RB_WPTR to the gpu register table
Added notes about CP_RB_CNTL and CP_RB_RPTR_ADDR. Both aren't necessary for HLE
Changed name of UNKNOWN_0E00 gpu register to TC_CNTL_STATUS. Games only seem to write 1 to it (L2 invalidate)
2023-04-16 12:42:42 -04:00