Commit Graph

61 Commits

Author SHA1 Message Date
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
e66028f0ff [Kernel] Check XAM is attached using bounding path 2025-08-18 07:41:50 +02:00
Margen67
4cb783bf22 Header cleanup 2025-07-19 14:42:21 -07: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
60318a5db6 [Module] Include XEX_SYSTEM_FLAGS in the log 2025-02-26 19:22:43 +01:00
Gliniak
3318ab5d4c [3PP] Uplifted FMT version and adjusted messages 2024-12-12 20:28:11 +01:00
Hyper
a867320a87 [Kernel] Implemented XexLoadImageFromMemory 2024-08-27 22:14:21 +02:00
Adrian
5efcc6a71b [Emulator] Launch file based on signature instead of file extension 2024-03-21 15:22:32 +01:00
Gliniak
b9061e6292 [LINT] Linted files + Added lint job to CI 2024-03-12 19:19:30 +01:00
Gliniak
c847987c27 [Kernel] Added printing of alternate title ids 2024-02-10 10:15:23 +01: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
7e58a3b320 Fix compiler errors i introduced under clang-cl
remove xe_kernel_export_shim_fn field of Export function_data, trampoline is now the only way exports get invoked
Remove kernelstate argument from string functions in order to conform to the trampoline signature (the argument was unused anyway)
Constant-evaluated initialization of ppc_opcode_disasm_table, removal of unused std::vector fields
Constant-evaluated initialization of export tables
name field on export is just a const char* now, only immutable static strings are ever passed to it
Remove unused callcount field of export.
PM4 compare op function extracted
Globally apply /Oy, /GS-, /Gw on msvc windows
Remove imgui testwindow code call, it took up like 300 kb
2022-09-29 07:04:17 -07:00
chss95cs@gmail.com
cb85fe401c Huge set of performance improvements, combined with an architecture specific build and clang-cl users have reported absurd gains over master for some gains, in the range 50%-90%
But for normal msvc builds i would put it at around 30-50%
Added per-xexmodule caching of information per instruction, can be used to remember what code needs compiling at start up
Record what guest addresses wrote mmio and backpropagate that to future runs, eliminating dependence on exception trapping. this makes many games like h3 actually tolerable to run under a debugger
fixed a number of errors where temporaries were being passed by reference/pointer
Can now be compiled with clang-cl 14.0.1, requires -Werror off though and some other solution/project changes.
Added macros wrapping compiler extensions like noinline, forceinline, __expect, and cold.
Removed the "global lock" in guest code completely. It does not properly emulate the behavior of mfmsrd/mtmsr and it seriously cripples amd cpus. Removing this yielded around a 3x speedup in Halo Reach for me.
Disabled the microprofiler for now. The microprofiler has a huge performance cost associated with it. Developers can re-enable it in the base/profiling header if they really need it
Disable the trace writer in release builds. despite just returning after checking if the file was open the trace functions were consuming about 0.60% cpu time total
Add IsValidReg, GetRegisterInfo is a huge (about 45k) branching function and using that to check if a register was valid consumed a significant chunk of time
Optimized RingBuffer::ReadAndSwap and RingBuffer::read_count. This gave us the largest overall boost in performance. The memcpies were unnecessary and one of them was always a no-op
Added simplification rules for multiplicative patterns like (x+x), (x<<1)+x
For the most frequently called win32 functions i added code to call their underlying NT implementations, which lets us skip a lot of MS code we don't care about/isnt relevant to our usecases
^this can be toggled off in the platform_win header
handle indirect call true with constant function pointer, was occurring in h3
lookup host format swizzle in denser array
by default, don't check if a gpu register is unknown, instead just check if its out of range. controlled by a cvar
^looking up whether its known or not took approx 0.3% cpu time
Changed some things in /cpu to make the project UNITYBUILD friendly
The timer thread was spinning way too much and consuming a ton of cpu, changed it to use a blocking wait instead
tagged some conditions as XE_UNLIKELY/LIKELY based on profiler feedback (will only affect clang builds)
Shifted around some code in CommandProcessor::WriteRegister based on how frequently it was executed
added support for docdecaduple precision floating point so that we can represent our performance gains numerically
tons of other stuff im probably forgetting
2022-08-13 12:59:00 -07:00
Gliniak
d33be73f3d Fixed crash caused by hash calculation in specific cases 2022-07-08 08:49:43 +02:00
Gliniak
e8aaddf4d5 Merge remote-tracking branch 'GliniakRepo/patchingSystem' into canary_experimental 2022-06-14 17:50:25 +02:00
Gliniak
91f43a374d Initial support for xex patching 2022-06-12 20:10:07 +02:00
Gliniak
5a71b55233 [Kernel] Added missing module hash calculation 2022-05-25 09:03:03 +02:00
Gliniak
b759cb23a5 Better handling of title workspace 2022-05-22 13:11:08 +02:00
Gliniak
db50db3215 Merge remote-tracking branch 'GliniakRepo/TU_APPLY' into canary_experimental 2022-05-19 11:00:34 +02:00
Gliniak
c65f240c0b [Kernel] Improved TUs Support
- Changed name of config option to apply_title_update to better reflect what that option does
- Mount TU package to UPDATE: partition
- Simplified UserModule::title_id()
- Splitted loading module into two parts to allow applying TUs and custom patches
2022-05-06 08:04:47 +02:00
Gliniak
d78fd19ab4 Fixed incorrect hash generation + lint fixes 2022-04-29 20:33:21 +02:00
Gliniak
fc16e3dc40 Support for patch types:
- float
 - double
 - string
 - u16string
 - byte_array

Plus some smaller changes
2022-04-27 09:41:29 +02:00
Gliniak
c73cdb506a Initial support for xex patching 2022-04-26 13:26:49 +02:00
Joel Linn
a86d7173e1 Refactor FourCC magic uses
- Use new fourcc_t type
- Improves compiler compatibility by removing multi chars
2021-06-02 22:28:43 -05:00
gibbed
38c3db1afb [CPU/Kernel] Transparently byteswap xex2_version. 2021-05-01 17:29:05 -05:00
gibbed
a48bb71c2f Overhaul logging. 2020-04-07 16:09:41 -05:00
gibbed
5bf0b34445 C++17ification.
C++17ification!

- Filesystem interaction now uses std::filesystem::path.
- Usage of const char*, std::string have been changed to
  std::string_view where appropriate.
- Usage of printf-style functions changed to use fmt.
2020-04-07 16:09:41 -05:00
aerosoul
bc8b629092 [Kernel] Enable XEX1 loading 2019-11-20 18:09:28 -06:00
Triang3l
741b5ae2ec [Memory] Add HostToGuestVirtual and use it in a couple of places 2019-08-13 23:49:49 +03:00
Jonathan Goyvaerts
c1af632562 Replace all gflag implementations with cvar implementations 2019-08-03 02:34:07 +02:00
gibbed
7ddcd4e32d Oops. Missed a log line for previous two commits. 2019-04-30 17:45:45 -05:00
gibbed
f7501750d9 [CPU/Kernel] Correct size check when parsing XEX_HEADER_IMPORT_LIBRARIES. 2018-11-24 09:38:21 -06:00
gibbed
24dd0267bf [Kernel] Oops. 2018-11-24 04:07:56 -06:00
gibbed
207589e5a1 [CPU/Kernel] Correct parsing of XEX_HEADER_IMPORT_LIBRARIES. 2018-11-24 04:05:41 -06:00
gibbed
2247742494 [Kernel] Add command-line flag to toggle XEX patching. 2018-11-20 14:48:32 -06:00
emoose
bbb5c938ec [CPU] Fix XexModule::FindSaveRest not finding functions properly 2018-11-01 15:50:56 +00:00
Triang3l
3b584a5f1c [Kernel] Clang-format user_module.cc 2018-10-29 11:21:26 +03:00
Dr. Chat
7443b7e61f [CPU] Rename ImportLibrary fields to follow naming conventions 2018-10-28 09:41:31 -05:00
emoose
265903fe66 [CPU] Add XEXP support to XexModule, if XEXP is in same folder as XEX
This was a headache to work out, big thanks to the lack of documentation on .xexp files... a ton of guesswork was involved here but luckily it turned out well.

I did have to make some pretty major changes to the way XEX files are loaded though.
Previously it'd just load everything in one go: XEX headers -> decrypt/decompress data -> load imports/symbols -> set loader data table entries, etc...

Now it's changed to something like this:
- Load base XEX headers + decrypted/decompressed image data, return X_STATUS_PENDING
- In the LoadFromFile call used to load the XEX, search for XEXP patch file (only .xexp in same folder atm)
- If patch exists: load XEXP, decrypt headers/data, apply patch to base XEX, dispose of XEXP
- Finish XEX load via LoadXexContinue() (handles imports/symbols/loader data...)

This saves us from needing to reset the imports/function/symbol stuff after patching (since all the XEX code will be a lot different), but I'm not really sure if I went about it the best way.
2018-10-20 04:36:21 +01:00
emoose
0b7f7e1657 [CPU] Move XEX2 code into XexModule class, autodetect XEX key
Code is mainly just copy/pasted from kernel/util/xex2.cc, I've tried fixing it up to work better in a class, but there's probably some things I missed.

Also includes some minor improvements to the XEX loader, like being able to try both XEX keys (retail/devkit) automatically, and some fixes to how the base address is determined.

(Previously there was code that would get base address from optional header, code that'd get it from xex_security_info, code that'd use a stored base address value...
Now everything reads it from a single stored value instead, which is set either from the xex_security_info, or if it exists from the optional header instead.
Maybe this can help improve compatibility with any weird XEX's that don't have a base address optional header?)

Compressed XEX loader also has some extra checks to make sure the compressed data hash matches what's expected.
Might increase loading times by a fraction, but could save reports from people unknowingly using corrupt XEXs.
(still no checks for non-compressed data though, maybe need to compare data with xex_security_info->ImageHash?)
2018-10-20 04:18:18 +01:00
DrChat
e699be0118 Logging: Add a flag to specify the minimum log level
--log_level = (0=error, 1=warning, 2=info, 3=debug)
2017-03-24 16:28:41 -05:00
Dr. Chat
b66f10f2b8 Testing travis xenia powerpc testing 2017-02-06 00:40:06 -06:00
Dr. Chat
a148b965f1 KernelState should handle module launching 2016-10-24 11:01:10 -05:00
x1nixmzeng
6cc3440086 Find correct launch module for XNA-based games
Added utility to parse game information and updated launch logic to use
it
2016-07-23 18:27:13 +01:00
Ben Vanik
6777ce6668 Reconcile debugger and save state stuff into a single implementation.
Fixes #497 and fixes #496.
Still rough edges, but at least less duplication.
2016-01-18 11:48:21 -08:00
Ben Vanik
86b706d87c Merge pull request #509 from x1nixmzeng/xex-resources
Rebrand the Xenia window with module metadata
2016-01-10 08:55:47 -08:00
x1nixmzeng
06f259c87d Mask the name index instead
The maximum number of import libraries (32) is already asserted
2016-01-09 02:43:29 +00:00
x1nixmzeng
7e4fdf7669 Fixed rare crash when accessing library import by name
The library name index may only be 8-bits.

This bug was not present in the previous implementation due to a bitmask
(0xFF) - see
ea99ba8e3b/src/xenia/kernel/util/xex2.cc (L272)
2016-01-09 01:19:05 +00:00
x1nixmzeng
321e2d8873 Set the window title from the module resource pool 2016-01-07 00:58:05 +00:00