Commit Graph

156 Commits

Author SHA1 Message Date
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
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
gibbed
4aaca8cbf3 Fixed copying junk data into initialized XEX memory when XEX is unencrypted. 2016-06-22 15:53:07 -05:00
gibbed
096febb3bb Oops. Unbreaking shim_utils.h. 2016-06-18 14:02:38 -05:00
gibbed
4fc3bdf213 Fixed AppendParam for X_EX_TITLE_TERMINATE_REGISTRATION,
X_EXCEPTION_RECORD.
Added AppendParam for X_OBJECT_ATTRIBUTES.
2016-06-18 13:44:52 -05:00
Ben Vanik
9c93fa5187 Cleaning up xdbf stuff.
- moving next to xex utils
- fixing error cases around icon setting (and allowing reset)
- making C++11
- abstracting a bit so future additions will be easier
- fixing non-xex uses
2016-01-10 11:04:55 -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
Ben Vanik
2f012fb56d Though I disagree with these lint fixes, I want travis to shut up. 2016-01-01 18:38:20 +00:00
Ben Vanik
b02ca62388 Fixing most remaining C++ warnings in clang. 2016-01-01 18:37:33 +00:00
Ben Vanik
3ca0bff246 Avoid duplicate object handle assignment on creation. 2015-12-29 14:03:23 -08:00
Ben Vanik
948aa2400d Formatting all code. Too gnarly to rebase properly. 2015-12-29 13:13:34 -08:00
Dr. Chat
a6322c7bf4 NativeList getters/setters 2015-12-29 13:09:36 -08:00
Dr. Chat
b3ed0fa445 NativeList default constructor 2015-12-29 13:09:33 -08:00
Dr. Chat
a4865bd24a Retain objects when restored into the object table. 2015-12-29 13:09:31 -08:00
Dr. Chat
7e88e54cbe XObject::host_object -> XObject::is_host_object 2015-12-29 13:09:23 -08:00
Dr. Chat
ce92dd5691 ObjectTable Save/Restore (and overloads/PurgeAllObjects/GetAllObjects) 2015-12-29 13:09:19 -08:00
sephiroth99
a281f6d70d ObjectTable: Remove explicit specialization in class scope
Function template 'LookupObject' in ObjectTable class has
a specialization in class scope, which is not allowed.

While MSVC seems OK with that, clang complains about it.

Fix this issue by moving the definition of the specialisation
outside the class scope, and moving the declaration in the
'.cc' file.
2015-12-17 01:04:44 -05:00