Commit Graph

173 Commits

Author SHA1 Message Date
Joel Linn
38d589d1e0 [kernel] Remove unnecessary string copy 2022-03-08 12:17:57 -06:00
Triang3l
fe3f0f26e4 [UI] Image post-processing and full presentation/window rework
[GPU] Add FXAA post-processing
[UI] Add FidelityFX FSR and CAS post-processing
[UI] Add blue noise dithering from 10bpc to 8bpc
[GPU] Apply the DC PWL gamma ramp closer to the spec, supporting fully white color
[UI] Allow the GPU CP thread to present on the host directly, bypassing the UI thread OS paint event
[UI] Allow variable refresh rate (or tearing)
[UI] Present the newest frame (restart) on DXGI
[UI] Replace GraphicsContext with a far more advanced Presenter with more coherent surface connection and UI overlay state management
[UI] Connect presentation to windows via the Surface class, not native window handles
[Vulkan] Switch to simpler Vulkan setup with no instance/device separation due to interdependencies and to pass fewer objects around
[Vulkan] Lower the minimum required Vulkan version to 1.0
[UI/GPU] Various cleanup, mainly ComPtr usage
[UI] Support per-monitor DPI awareness v2 on Windows
[UI] DPI-scale Dear ImGui
[UI] Replace the remaining non-detachable window delegates with unified window event and input listeners
[UI] Allow listeners to safely destroy or close the window, and to register/unregister listeners without use-after-free and the ABA problem
[UI] Explicit Z ordering of input listeners and UI overlays, top-down for input, bottom-up for drawing
[UI] Add explicit window lifecycle phases
[UI] Replace Window virtual functions with explicit desired state, its application, actual state, its feedback
[UI] GTK: Apply the initial size to the drawing area
[UI] Limit internal UI frame rate to that of the monitor
[UI] Hide the cursor using a timer instead of polling due to no repeated UI thread paints with GPU CP thread presentation, and only within the window
2022-01-29 13:22:03 +03:00
gibbed
975eadf17e [Kernel] Assert export function return/arg types. 2022-01-09 14:16:37 -06:00
gibbed
12ec728989 [Kernel] Use tables for export groups. 2022-01-09 14:16:37 -06:00
gibbed
3ad0a7dab2 [Kernel] Suffix export functions with _entry. 2022-01-09 12:17:03 -06:00
Triang3l
fdec0ab332 [Code] Make union usage more consistent 2021-11-03 20:45:09 +03:00
gibbed
997d0555db Lint/format .inc files. 2021-06-28 20:32:52 -05:00
emoose
c889a8af3f [CPU] Load alt-title-ids XEX header into XexModule::opt_alternate_title_ids_ 2021-06-25 23:48:25 -05:00
Gliniak
4cc2dad005 [Object] Remove object name from name_table on object removal 2021-06-25 23:14:39 -05:00
Joel Linn
c0fb300a05 [Kernel] Remove explicit SHIM calling convention
Shim exports are called from GuestToHostThunk which dictates the calling
convention. The default system calling convention is different depending
on OS (Windows vs. everything else) and architecture. PR #1339 addresses
this for x64 Linux.
There is no reason for explicit `__cdecl`. Also, it is not available in
GCC. We could use `__attribute__((ms_abi))` or
`__attribute__((sysv_abi))` but that just adds complexity.
2021-06-02 22:28:43 -05:00
Joel Linn
07a060b002 [Kernel] Solve ambiguity in RegisterExport()
- Remove overload for exports with `void` return type
- Use `if constexpr (std::is_void<R>::value)` to differentiate
2021-06-02 22:28:43 -05: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
Triang3l
e49e26e4a0 [Kernel] shim_utils lint fix 2021-05-16 18:34:27 +03:00
emoose
ce19d948f0 [Base] Move XdbfLocale to xbox.h as XLanguage, let STFS headers use it
Renamed to XLanguage because AFAIK locale on Xbox is a different concept involving countries, this enum only involves languages though.
2021-05-05 12:35:51 -05:00
gibbed
38c3db1afb [CPU/Kernel] Transparently byteswap xex2_version. 2021-05-01 17:29:05 -05:00
gibbed
524efcab7d [Kernel] Lint fix. 2021-05-01 12:20:14 -05:00
gibbed
4ce43369a7 Use English game title when available. 2021-04-07 03:47:17 -05:00
gibbed
164aa8e8ca [Kernel] Scope object type enum. 2020-11-22 20:34:07 -06:00
Sandy Carter
432369ae84 [kernel] Define param order between compilers
Fix issue in clang where args were inverted last to first due to the way
c++ implements function calls.
The function make_tuple, being a function, has undefined ordering of
resolution of the values of its parameters `Ps(init)` and would vary
between compilers. Namely clang would resolve them in order and msvc
would resolve them in reverse order.
This normally would not matter except for the fact that init maintains
a mutable state which is affected my the order of operations:
init.ordinal is a counter and also defines where in memory a value is
stored.
The C++ standard doesn't define an order of resolution of parameters in
a function but it will define an order in a brace-initializer.
Switching make_tuple for a brace-initializer enforces an order which is
the same between all compilers (tested gcc, clang and msvc).
Prior code was written to decrement ordinal due to the reverse
traversal.
This has been switched to incrementing thanks to the in-order
traversal.
2020-11-22 13:54:00 +03:00
Gliniak
7fd1991074 [Kernel/Object] Added base to object handle 2020-08-29 15:17:31 +03:00
Triang3l
2cd69092ce [Kernel] Fix incorrect C-like structure declaration 2020-06-06 22:25:48 +03:00
gibbed
bc92169fce [Kernel] Remove unnecessary newline. 2020-04-13 12:57:14 -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
Silent
5bec69e983 [Kernel] Add some useful asserts 2019-11-30 20:08:30 -06:00
aerosoul
bc8b629092 [Kernel] Enable XEX1 loading 2019-11-20 18:09:28 -06:00
Triang3l
803fa0cba9 [Kernel] Fix TranslateUnicodeString endian and size 2019-08-28 09:20:10 +03:00
Triang3l
2507f1a819 [Memory] TranslateVirtual in shim and strings 2019-08-14 10:31:11 +03:00
Triang3l
0067f5561d [Kernel] More TranslateVirtual/HostToGuestVirtual usage 2019-08-14 08:28:30 +03:00
Jonathan Goyvaerts
c1af632562 Replace all gflag implementations with cvar implementations 2019-08-03 02:34:07 +02:00
gibbed
bc0ebcb26e - Clean up log level names, no need for LOG_LEVEL_ prefix when it is an
enum class.
- Clarify usage of log level in comment.
2019-04-30 17:41:27 -05:00
gibbed
08fb15fcca [Kernel] Oops. 2018-11-24 19:16:14 -06:00
gibbed
207589e5a1 [CPU/Kernel] Correct parsing of XEX_HEADER_IMPORT_LIBRARIES. 2018-11-24 04:05:41 -06:00
Margen67
896ac4a682 Update documentation.
- Convert http to https, provide archive link when possible.
- Made CPU-JIT.png more readable on dark themes;
Added a white background so there isn't black text on a black
background.
2018-11-22 09:20:09 -06:00
gibbed
394105d359 [CPU/Kernel] Cleanup and rework of how kernel exports are declared. 2018-11-20 13:03:17 -06:00
emoose
bbb5c938ec [CPU] Fix XexModule::FindSaveRest not finding functions properly 2018-11-01 15:50:56 +00: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
gibbed
fc0cc89a1d [Kernel] Add X_HRESULT_result. (yes, the name is stupid) 2018-05-27 18:12:48 -05:00
gibbed
4cc2aaf5b9 Remove unnecessary usage of xe::be. 2018-05-27 16:35:01 -05:00
gibbed
6e9994ee41 [Kernel] Log handle addditions/removals. 2018-05-22 05:57:32 -05:00
DrChat
aaf281351d Format all code with new clang-format 2017-12-14 20:44:43 -06:00
Dr. Chat
4f0c0f2724 Shims: No implicit dereferencing of pointers 2017-05-17 04:45:31 -05: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
gibbed
cec8932605 Log lpwstring_t contents. 2017-01-09 23:57:47 -06:00
gibbed
d17d02f606 Log lpstring_t contents. 2017-01-09 17:11:17 -06:00
gibbed
2e8c34377f Implemented NetDll_shutdown.
De-borked LoadFdset/StoreFdset in regards to handling of correct counts
and invalid sockets.
2017-01-09 06:58:15 -06:00
gibbed
d730784efb Added XBDM stubs. 2017-01-09 04:51:55 -06:00
maxton
cc0adb95f1 Add word pointer type 2016-12-20 18:22:41 -05:00
x1nixmzeng
5be1a24f7a Clang formatting 2016-07-30 15:00:51 +01:00