Commit Graph

4710 Commits

Author SHA1 Message Date
emoose 35bc47708e [VFS] Add some STFS magic numbers, skip hash table checks for read only packages 2020-01-11 21:46:44 +11:00
emoose 774f656300 [VFS] Fix GetHashEntry for level 2 entries... 2020-01-11 21:01:28 +11:00
emoose 081a9da17a [VFS] Fix BlockToHashBlockOffset's level 2 case (blockStep0 -> blockStep1)
& changed code to switch statement instead.
2020-01-11 20:44:15 +11:00
emoose d32dca424b [VFS] Improve STFS GetBlockHash function - now gets hash from correct hash table.
This should hopefully allow Xenia to be more compatible with larger / more made-use-of profiles.

Each hash table actually consists of two hash tables for redundancy, which table is used is decided by the hash table level above it.
Previously there was some code to try swapping which table to use if a flag isn't set, but the code ended up being commented out & unused...

After looking at some other X360 mod tools sources I've managed to come up with this solution, which visits each hash-level it can to retrieve the correct table number to use.
Really this is probably a little inefficient, the code I based this on would actually cache each table in memory to make these visits a lot quicker, maybe should look into doing the same here.
For packages with read_only_package() == true, this maybe isn't even necessary too - but it's probably worth keeping it as-is just in case though.
2020-01-11 20:44:14 +11:00
emoose f41c833688 [XAM] Add some proper error codes to a few XamUser functions
It might be worth finding games/apps that use these functions and see what error codes they check against...
2020-01-11 20:44:14 +11:00
emoose 09b58a7052 [XAM] Simplify XamShowDeviceSelectorUI, update an old device ID
Storing the content type inside the device ID from DeviceSelectorUI shouldn't be needed now.
AFAIK it was only used so that we could extract it later inside XamContentGetDeviceData, but that wasn't actually how GetDeviceData was meant to work.
2020-01-11 20:44:14 +11:00
emoose 811825afab [Kernel] Fix wide-printf functions not processing %ws format correctly
This would break strings like memory://%.*ws, because the %ws would set FF_IsWide, but FF_IsWide is actually treated as an "is opposite encoding" flag.
Since the function is already wide, that flag would make it think it's opposite encoding and it'd try reading the param as ASCII instead of Unicode...
2020-01-11 20:44:14 +11:00
emoose 086c28e55d [Kernel] *FormatData: make peek() match get() endian, fix skip() not advancing pointer 2020-01-11 20:44:14 +11:00
Gliniak d4b43246ee Removed useless file that survived rebase 2020-01-11 20:44:14 +11:00
Gliniak 2c9f7bcc76 [Log] Added information about implementation state 2020-01-11 20:44:14 +11:00
Gliniak 8e79625b56 Revert "[XAM/User] Added title_id == 0 check for few User functions"
This reverts commit 05433007c5.
2020-01-11 20:44:14 +11:00
Gliniak 074fcd4bb7 [XAM/User] Added title_id == 0 check for few User functions
Games like to report title_id as 0 (it is expected behaviour).
0 in this case means currently opened title
2020-01-11 20:44:14 +11:00
Gliniak f95838cf6d [GPU] InitializeRingBuffer - Clear buffer space to prevent random data readout 2020-01-11 20:44:14 +11:00
emoose a216fae710 [XAM] Add XamShowCreateProfileUI & XamProfileCreate impl.
Seems to kinda work, xshell uses XamProfileCreate and says that it's successful at least.
Dash uses the ShowUI function, but doesn't seem to login to the created profile correctly for some reason... restarting with the toml configured for the new profile does seem to work though.
2020-01-11 20:44:13 +11:00
emoose 5cf3bbf829 [VFS] Oops, fix wrong BlockToOffset result for non-CON packages 2020-01-11 20:44:13 +11:00
emoose 243c9c9a22 [Kernel] Fix XamReadTile not returning profile pic, breaking dash profile...
This caused dash not to load profile anymore, since dash passes user_index == kNone...
The new method should be closer to how things are actually meant to work.
2020-01-11 20:44:13 +11:00
emoose a6e1231531 [VFS] Port new BlockToOffsetSTFS algo from stfs-headers
65ca664fdb
This should give better compatibility with CON packages - ie. profiles taken from actual consoles should hopefully extract properly without errors, now there's shouldn't be any need for extracting them with Velocity/Horizon first.
2020-01-11 20:44:13 +11:00
emoose 2b2a2ade43 [XMP] Add extra checks from XAM to help prevent dash host crash 2020-01-11 20:44:13 +11:00
emoose f31e28a2f7 [User] Add some extra checks from XAM to Read/WriteProfileSettings exports 2020-01-11 20:44:13 +11:00
emoose 73330e67f4 [XAM/User] Fix wrong error code given when ReadProfileSettings buffer is too small
Strange, seems ReadProfileSettings returns this error as the result code instead of the xoverlapped error code - it could be possible other Xam functions do the same too.
This fixes Crackdown loading (thanks Gliniak for the tip about buffer size), hope it doesn't break any other games though.
2020-01-11 20:44:13 +11:00
emoose 77b30b1374 [XAM/User] Fix dashboard GPD overwrite when loading new game 2020-01-11 20:44:13 +11:00
emoose b1d352d9d8 [XAM/User] Allow titles to actually access title-specific settings
Would only allow access to dash GPD previously...
I'm not sure if we need to setup the XPROFILE_TITLE_SPECIFIC settings in advance or not though, really it should be on the games to do this themselves, but not sure whats actually needed...

This should probably fix games that would save progress to profile (Halo 3 progression, etc.), haven't actually noticed any changes myself yet though.
2020-01-11 20:44:12 +11:00
emoose 2878146aed [User/XAM] Oops, fix null pointer deref 2020-01-11 20:44:12 +11:00
emoose fc5f761fa5 [XAM/User] Try logging in to any available profile when XUID isn't set
Now the XUID doesn't need to be set at all for Xenia to try logging into an available profile (as long as signin_state != 0, previously this needed XUID to be set to '1')

So from a default install, you should be able to just drop an X360 profile into the right profiles dir, and when you run Xenia it'll login to it automatically for you, no config changes needed!

This applies to all 4 user slots, just set their signin states, drop 4 profiles in and it should log them all into each one seperately, then you can edit the config with specific profile XUIDs for each user.

Xenia should now only generate a default XeniaUser profile when no profiles are available for a user.
2020-01-11 20:44:12 +11:00
emoose 5bd51bc6a0 [XAM/User] Add UserIndex enum, handle special UserIndexes inside KernelState::user_profile 2020-01-11 20:44:12 +11:00
emoose 2418869fda [XAM/User] Add support for multiple signed-in users/profiles
This adds support for multiple profiles to Xenia, profiles can be configured with the [Profiles] user_*_xuid / user_*_state config settings.
If state is non-zero (1 = offline, 2 = LIVE), the profile will be counted as logged-on - either with a generated XeniaUser gamertag, or if the XUID is set to 1 the first available profile will be loaded.
The XUID can also be set to the offline-XUID (E000...) of an existing profile, to sign in the user as that profile.
(Profiles should be stored in the Xenia content/FFFE07D1/00010000/ folder, either as an STFS package or an extracted folder)

All the XamUser* functions have been updated to support multiple user_index's provided to them too.
(there's still issues with weird indexes like 0xFF, 0x7FF9... being given though, still dunno what's with that, the KernelState::user_profile() code will treat 0xFF as 0)

I'm not really sure if this is the most ideal way to do things though, but it does appear to work fine, at least Halo 3 does detect the profiles with state > 0 fine.

TODO: look into changing up xam_content to make use of user_index & profiles.
It shouldn't be too difficult now to emulate the same content paths X360 uses (seperating content by XUID etc)
Would probably be a good idea, since it'd probably be needed for us to support multiple profiles properly, so that they don't all share savegames etc...
2020-01-11 20:44:12 +11:00
emoose 28be8c80c3 [HID] Allow winkey driver to use the first unused user index
This removes the user_index == 0 requirement from the InputSystem code, and updates WinKeyInputDriver to use the first non-connected user index if it can.

Eg. if you had 2 XInput controllers plugged in, those two will take up user index 0 and 1, and keyboard will take user index 2.
If all four indexes are taken up already, the WinKey driver will be disabled.

(This is done by passing already-setup drivers to each drivers Setup function: since WinKey is the last to be setup, this'll let it query the XInput driver and find which user_index it should handle)
2020-01-11 20:44:12 +11:00
emoose dbd9eb9f61 [Xam/Content] Remove unused ResolveGameUserContentPath func
(not needed since we store this stuff inside GPD now)
2020-01-11 20:44:11 +11:00
emoose 96096ab0a0 [XAM] Allow loading profile from STFS (extracts package automatically!)
Profiles can now be placed as either an extracted folder with GPDs, or an STFS package, inside the Documents\Xenia\content\FFFE07D1\00010000\ directory
eg. Documents\Xenia\content\FFFE07D1\00010000\E0000E07FA53D7F1
(this roughly matches the same location as X360 stores it)

If loading an STFS package the package will first get extracted to <path>.dir/, and then the profile is loaded/saved into that directory.
(originally was going to mount the package and read everything in-memory, but then realized how hard adding new files/modifying/etc would be.. VFS doesn't allow mixing two devices into the same mount_path afaik)

Code for extraction is taken from xenia-vfs-dump (as StfsContainerDevice::ExtractToFolder)

A [XAM]profile_xuid config option is added too, which should let you pick which profile to load from the FFFE07D1\00010000\ folder if you have multiple there.
(at least I hope it should - something like "profile_xuid = 0xE0000E07FA53D7F1" will work I hope... cpptoml might have issues with hex digits though, not sure, will investigate later...)
If profile_xuid isn't set (left at -1), Xenia will just load whatever the first file/folder inside there is.
2020-01-11 20:44:11 +11:00
emoose 2e618a6e7e [Base] Change DEFINE_uint64 -> DEFINE_int64, cpptoml seems to have issues with uint64..
Tried setting a uint64 setting to -1 (FFFF FFFF FFFF FFFF), which made it throw a out of range exception when loading the toml...
Internally it uses int64 to parse numbers, so I guess it doesn't work well with converting to uint64?
Changing everything from uint64->int64 seems to solve it though, now -1 works fine.
2020-01-11 20:44:11 +11:00
emoose c299247a63 [VFS] Fix STFS file table info being read in wrong endian 2020-01-11 20:44:11 +11:00
emoose e292d58928 [XAM/User] Fix AchievementPlatform definitions...
big oof
2020-01-11 20:44:11 +11:00
emoose 5034b2cba7 [XAM/User] Store profile inside content root instead of next to EXE
eg. Documents/Xenia/content/profile/
2020-01-11 20:44:11 +11:00
emoose 25bb73b8c1 [XAM/Misc] Impl. IsSystem/IsXbox1/IsSystemExperience & FirstRunExperienceShouldRun exports 2020-01-11 20:44:11 +11:00
emoose f3571477dc [XAM/User] Only add arcade games to profile if license_mask is set 2020-01-11 20:44:11 +11:00
emoose de0fb991e0 [XAM/User] GetTitleId -> GetTitleData, check flags/titletype before adding to profile 2020-01-11 20:44:11 +11:00
emoose 9d26537681 [XAM/User] ...CreateTitlesPlayedEnumerator: sort titles by date played (thanks Gliniak!) 2020-01-11 20:44:10 +11:00
emoose ba6bef0252 [XAM/User] Stub GetIndexFromXUID, add param to IsOnlineEnabled
Maybe can help with user_index issues? Not sure, dash still seems to use some wacky indexes sometimes..
2020-01-11 20:44:10 +11:00
emoose e10dd9a389 [XAM/User] XamReadTile: support reading gamerpic from profile tile_64.png file 2020-01-11 20:44:10 +11:00
emoose 6f2469543a [XAM/User] Add extra checks to XamReadTile, remove GetTitleSpa
GetTitleGpd should work fine for what we're using it for here... it could be a good idea to keep an instance of the current SpaFile of the running title and have a GetTitleSpa that returns that though, since I think some stuff like XamReadString might eventually need access to SPA data, not really sure yet though.
2020-01-11 20:44:10 +11:00
emoose c3a552dc7f [XAM] Allow reading binary & unicode settings, but block AVATAR_INFO_1 2020-01-11 20:44:10 +11:00
emoose 192a16d3d3 [XAM] Small XamUserCreateTitlesPlayedEnumerator tweaks + other fixups 2020-01-11 20:44:10 +11:00
emoose f2a443e9a6 [XAM] UserProfile: Update ach/gamerscore info inside UpdateGpd, add dash checks to SetTitleSpaData 2020-01-11 20:44:10 +11:00
emoose 230f571824 [XAM] UserProfile::LoadProfile: setup default settings 2020-01-11 20:44:10 +11:00
emoose fc78fa92cf [XAM] Update profile setting code to use new xdbf::Setting struct 2020-01-11 20:44:10 +11:00
emoose 626467951d [XAM] xdbf.h: const-ify some parameters 2020-01-11 20:44:10 +11:00
emoose f64dd882c9 [XAM] xdbf.h: add more achievement details (flags, comments..) 2020-01-11 20:44:09 +11:00
emoose a539266d28 [XAM] xdbf_xbox.h: add X360 GPD settings structs + minor fixups 2020-01-11 20:44:09 +11:00
Gliniak 49e292718a [XAM/User] XamUserCreateTitlesPlayedEnumerator - Skip titles without achievements
It mimics behaviour of real 360 dashboard that
skips info about demos and system apps

also smaller code style changes
2020-01-11 20:44:09 +11:00
Gliniak 1a872dcd85 [XAM/User] Implemented sketchy XamReadTileEx
Also changes to XamReadTile
2020-01-11 20:44:09 +11:00
Gliniak f282fbe21c [XAM/User] Resolved missing profile tab on 12xxx dashboard
It doesn't provide overlap pointer and requires instant response
2020-01-11 20:44:09 +11:00
Gliniak 80eb0b6c4c [XAM/User] Added descriptions and labels for achievements
Disclaimer: On old dash it causes memleak (slight),
newer dashboards allocates them only once which is solution for that.

Ps. If anyone have easy solution please implement it. Cheers
2020-01-11 20:44:09 +11:00
Gliniak a9210375a6 [XAM/Misc] Added stub for: XamIsXbox1TitleId 2020-01-11 20:44:09 +11:00
Gliniak 2e15185e8a [User] Removed hardcode from XPROFILE_GAMERCARD_TITLES_PLAYED
(Now dashboard 9199 shows more reliable amount of games played)
2020-01-11 20:44:09 +11:00
Cancerous 94c00674b8 stubs for 9199 (eventually) 2020-01-11 20:44:09 +11:00
Gliniak 9d637ae402 [User] Added method for calculating gamerscore 2020-01-11 20:44:09 +11:00
Gliniak d565d87d8d [XAM/Media] Added stub for: XamLoaderGetMediaInfo 2020-01-11 20:44:08 +11:00
Gliniak ba19fe83b8 [XAM/User] Added Stub for: XamUserIsOnlineEnabled 2020-01-11 20:44:08 +11:00
Gliniak edac054ebd [XAM/User] XamUserGetGamerTag - added exception for user_index -1 (0xFF)
(Fixes gamertag in 9199 dash)
2020-01-11 20:44:08 +11:00
Gliniak e386038a62 [Profile] Added dummy settings (This causes gamertag to appear) 2020-01-11 20:44:08 +11:00
Gliniak 091bb36393 [XAM] XamReadTile - Changed size of item_id 2020-01-11 20:44:08 +11:00
Gliniak 926afdb5d8 [XAM/User] Implemented XamUserGetGamerTag 2020-01-11 20:44:08 +11:00
Gliniak 30c5551220 [XAM] XNotifyGetNext - Fixed null check for !param_ptr (Thanks randprint) 2020-01-11 20:44:08 +11:00
Gliniak e47674668c [XAM/Avatar] Added stub for: XamAvatarLoadAnimation
This enable running AvatarEditor

Disclaimer: Games that uses Avatars might crash
2020-01-11 20:44:08 +11:00
Gliniak eaba53a1b8 [Kernel] Added few elemenmts to xeExGetXConfigSetting
This will allow to go inside "Console Settings" in NXE Dashboard
and fixes stability on older dashboards
2020-01-11 20:44:08 +11:00
Gliniak 42fbe828d7 [XAM/Nui] Added stubs for: XamNuiIsDeviceReady, XamIsNuiAutomationEnabled 2020-01-11 20:44:08 +11:00
Gliniak e3f3659f08 [XAM/Notify] XNotifyGetNext - Added check to assure if param_ptr is correct 2020-01-11 20:44:07 +11:00
Gliniak 5358aec284 [Memory] Preallocate encrypted memory region
(Fixes dashboards up to 12625)
2020-01-11 20:44:07 +11:00
Gliniak ca1a2692ab [XAM/Sketchy] Implemented XamReadTile 2020-01-11 20:44:07 +11:00
Gliniak caac1d6618 [Kernel] Rewrote ObReferenceObjectByHandle. Thanks Cookie for ideas 2020-01-11 20:44:07 +11:00
Gliniak ef1b049408 [KERNEL] Do not convert time if provided time_ptr is invalid (Fixes Dark Souls crash) 2020-01-11 20:44:07 +11:00
Gliniak 8f8c0a439a [GPD] Implemented XamUserCreateTitlesPlayedEnumerator 2020-01-11 20:44:07 +11:00
Cancerous 3c2d99876a [Kernel] Make XHttpStartup succeed and add stubs for XHttpOpen and XHttpConnect that fail 2020-01-11 20:35:07 +11:00
Cancerous a1db296a2c Revert "[Kernel] - Try to shut down XMP so games won't spam it's functions"
This reverts commit 2df353fdde.
2020-01-11 20:35:01 +11:00
emoose 7fa2567d20 [XBDM] Add impl. for DmGetXboxName, stub 5 functions
Stubs: DmGetXbeInfo, DmIsDebuggerPresent, DmRegisterCommandProcessor, DmRegisterCommandProcessorEx
This helps progress some debug builds of games, DmGetXboxName error codes are based on what some games seem to expect from it.
Will probably be a good idea to move most of this to xbdm_info.cc soon.
2020-01-11 20:30:18 +11:00
Cancerous 56925afdc8 [Kernel] remove option to disable WSAStartup 2020-01-11 20:30:00 +11:00
Cancerous a9f587199a [Kernel] - Try to shut down XMP so games won't spam it's functions 2020-01-11 20:29:54 +11:00
Cancerous c63f4df9cc [Kernel] Add XHttpStartup Stub, try to gracefully fail and shutdown more of the networking so games won't spam the related functions 2020-01-11 20:29:49 +11:00
emoose faf4e410a0 [Kernel] Include XEX version in log 2020-01-11 20:29:41 +11:00
emoose 70c616fe27 [Kernel/CPU] Fix XEX version numbers not being output correctly
Couldn't find a way to get bitfields & byte-swapping to play well together, so this was the best I could come up with... at least the proper version numbers will show in the log file now :)
2020-01-11 20:29:35 +11:00
emoose 06f7617c57 [Kernel] Allow XEX to continue load after ApplyPatch fails
This should be safe to do hopefully, most errors happen before any part of the XEX is modified, and the errors that can happen after modification should be very rare/impossible thanks to the earlier checks.
It might be good to write up some way to revert any changes though...
2020-01-11 20:27:03 +11:00
emoose f6f32298e3 [CPU] Check patch MediaID if patch signature check failed
This should let us make sure patches are being applied to the right XEX, without needing to rely on the signature.
2020-01-11 20:26:51 +11:00
emoose f58fba9219 [CPU] Fix heap corruption by XEXP header patch not resizing headers correctly
This should hopefully fix GTA IV's TU (for media ID 6AC07221 at least)
2020-01-11 20:26:41 +11:00
emoose 3e74b85c20 [VFS/Kernel] Fixes to allow games to make use of cache partitions
Happy new year! Here's my first commit of the 2020s :)

With these fixes, Halo 3 Epsilon will now write cached map data & other things (autosaves/datamine...) to the cache0/cache1 partitions, (as long as mount_cache cvar is set)
(Halo 3 retail will also write some things to cache with this, but oddly doesn't cache map stuff... which is strange because Epsilon was built only a day or two after the retail build, so I'm not sure why it'd work differently...
Maybe retail needs a TU applied for it to work or something like that)
Other games should hopefully work with cache now too (AFAIK the problem was in SDK library code, that a lot of games probably share)
No idea if this will actually improve anything though, but at least things will work closer to what games expect :)

The way this works is by tricking the cache-partition code (staticly linked into the game exe) into thinking that the Partition0/Cache0/Cache1 devices are valid.
To do that I made another kind of VFS device, the NullDevice, which just takes in a list of paths to handle.
Whenever an IO request is made to one of these paths, the NullDevice can simply pretend to the game that everything was successful, which satisfies the requirements needed for caching.

It also makes use of another trick: setting TitleInsecureCacheDrive XEX permission, which seems to skip a huge chunk of cache-init code (STFC filesystem device registration & stuff like that)
I'm not sure if this would work with every single revision of the STFC/cache code though...
At least in Halo 3 the retail code will handle the TitleInsecureCacheDrive case for us fine, but maybe older/more recent versions don't include functionality for it, need to look into it some more.
(I did try an impl. without needing this permission months ago, got pretty far with it but got caught on one tiny issue that I couldn't figure out... too bad I didn't find out about this permission earlier!)
2020-01-02 12:15:06 +11:00
Cancerous f9f2b2f702 [Kernel] HDD and save detection changes 2019-12-28 23:22:47 -05:00
Cancerous d90cc3a7e9 [Kernel] added more checks to filter user_index out of range 2019-12-28 23:22:36 -05:00
Cancerous 600d750d95 [Kernel] - further adjustments to xam overlapped ui for storage selection and messages 2019-12-28 23:22:07 -05:00
Cancerous b49bbe30e4 [Kernel] - time fix for darksouls 2019-12-28 23:22:03 -05:00
Cancerous 6303a17010 [VFS] more logging for resolving files 2019-12-28 23:21:58 -05:00
Cancerous 7fefb79339 [Kernel] - swapdisc fixes for gtav 2019-12-28 23:21:54 -05:00
Cancerous 96a75cefe3 [Kernel] stubs for 9199 (eventually) 2019-12-28 23:21:46 -05:00
illusion98 a303baa897 Force 1080p output mode 2019-12-19 04:16:52 -05:00
illusion98 65eed6f061 Merge remote-tracking branch 'CookiePLMonster/xex-unload-image' into canary-old-update 2019-12-16 04:11:36 -05:00
Gliniak efde5068b0 [Achievements] XamUserCreateAchievementEnumerator - title_id 0 behaviour
Based on research 0 in title_id is interpreted as current game
2019-12-14 10:49:58 -05:00
Gliniak 7ed41824a5 [XAM] Removed code related to buffer clear
Some games have hardcoded buffer size which doesn't match real size
2019-12-14 10:49:46 -05:00
Joel Linn 9bb78d41e7 [HID/Linux] Implement cross platform controller input using SDL2 library. 2019-12-07 17:07:02 +01:00
Cancerous f0cc9562ae further ajustment to buffer size to fix regression 2019-12-06 12:23:09 -05:00
Cancerous cb246e7501 title update fixup - breaks xex1 temporarily 2019-12-06 12:01:20 -05:00
Cancerous 5627e3abb5 [Kernel] More adjustment to XNotification spam filter 2019-12-06 09:55:26 -05:00
Cancerous 027f691770 [Kernel] - adjusting XAMEnumerate buffer size to fix Angry Birds and Resonance of Fate - thanks Gliniak 2019-12-06 09:55:02 -05:00
Gliniak 1fb027daa7 [Kernel/Sketchy] Implemented NtQueueApcThread
Signed-off-by: Gliniak <Gliniak93@gmail.com>
2019-12-05 02:44:27 -05:00
illusion98 e469101678 Merge remote-tracking branch 'upstream/master' into canary-old-update 2019-12-05 02:44:05 -05:00
Triang3l c43ccc073d [D3D12] Submit command lists on primary buffer end 2019-12-04 21:42:26 +03:00
Cancerous e1ec74dcbe [Kernel, UI]
threaded UI notifications from emoose Issue 1296
added fixups for hdd detection in more games (wheelman for example)
changed filter that stops notification spam
2019-12-02 09:56:11 -05:00
illusion98 8d25068fef [Kernel] Title Update fixup
Co-Authored-By: aerosoul94 <aerosoul94@hotmail.com>
2019-12-02 09:50:21 -05:00
illusion98 17481ebdd1 Revert "[Memory] Trigger watches when making pages writable, not the other way around"
A Workaround for UE3 games causing exploding vertices.
This reverts commit 8ba6f3fc37.
2019-12-02 09:49:49 -05:00
illusion98 470df23c31 [Kernel] use TV Gamma as default instead of CRT 2019-12-02 09:49:38 -05:00
Radosław Gliński f98770190e [THREADING] Removed old walkaround for zombie threads 2019-12-02 09:48:53 -05:00
illusion98 bdd5947e85 small fixup for fps counter
this code is a meme
2019-12-02 09:43:14 -05:00
illusion98 c4c9f104d8 Merge remote-tracking branch 'upstream/master' into canary-old-1 2019-12-02 09:40:45 -05:00
Joel Linn 922f1f220a [CPU] Implement mftb instruction natively.
When the cvars clock_no_scaling and clock_source_raw are set, tick counts will be directly calculated in the emitted code.
2019-12-01 17:11:58 -06:00
Joel Linn 15d422d988 [Base] Optional raw Clock source.
New cvar clock_source_raw allows to use the cpu cycle counter itself as an alternative time source, if system timing resolution is to low and causes problems.
2019-12-01 17:11:58 -06:00
Joel Linn f88d46cead [Base] Optional Clock scaling bypass.
New cvar clock_no_scaling bypasses all time scaling code.
Clock state is non dynamic.
Timing is always derived from host.
2019-12-01 17:11:58 -06:00
Joel Linn 7e244e0488 [Base] Clock state now unaltered by threading.
- Removed tick and time values from ThreadSavedState.
- Removed affiliated get/set code from Save and Restore.
- Removed dangerous SetGuestTickCount method.
2019-12-01 17:11:58 -06:00
Joel Linn d6ce72ddc9 [Base] Clock reworked.
- Time progression is now equal and in sync on all threads.
- Floating point imprecisions do not interfere with timing.
2019-12-01 17:11:58 -06:00
Triang3l 6a3a56b3b9 [D3D12] Workaround for texture flickering on Nvidia - don't use sampler 2047 2019-12-01 21:39:48 +03:00
Silent c5db959154 [Kernel] Retain handles and not objects in XThread
This fixes cases introduced by 52e836d0f81e752ba368717e68773b591adfa9cf
where thread handles get closed before the thread finishes.
Handle was assumed to be alive there, which was not true as
threads self-referenced only their objects, not their handles.

Affected games: Payday 2 Demo
2019-11-30 20:08:30 -06:00
Silent 728531eff7 [Kernel] Operate on handle refcounts in Ob funcs
Although this seems counter-intuitive, operating on handle
reference counters in
- ObLookupThreadByThreadId
- ObReferenceObjectByHandle
- ObDereferenceObject
allows to cleanly clean up handles for resources created elsewhere
and destructed by ObDereferenceObject (for example, threads with 0x80
creation flag). Operating on pointer reference counters alone
would leave a stray handle in the slots list.
2019-11-30 20:08:30 -06:00
Silent 05ef022fd7 [Kernel] Do not retain handle in ExCreateThread
Closing the thread handle should delete the thread object
if it's finished. When this handle was retained, closing the handle
left a lingering handle reference and thus this XThread would leak
2019-11-30 20:08:30 -06:00
Silent 5bec69e983 [Kernel] Add some useful asserts 2019-11-30 20:08:30 -06:00
gibbed ae15c27a24 [x64] Take advantage of StashConstantXmm. 2019-11-30 20:08:10 -06:00
gibbed 04a54cc58f [x64] Fix constant src2 in VECTOR_ROTATE_LEFT_V128. 2019-11-30 20:08:10 -06:00
gibbed f7a8c5ce7a [x64] Fix corruption of src1 in calls to EmulateVectorRotateLeft.
To mitigate this mistake in the future, implemented new
StashConstantXmm functions.
2019-11-30 20:08:10 -06:00
gibbed 43cef29c6d [UI] Disable saving of imgui INI file.
By default imgui saves an INI file named 'imgui.ini' to the current directory,
which is undesired behavior. Until we can properly specify a full path to
a good location, disable saving of the INI file.
2019-11-30 18:54:15 -06:00
aerosoul bc8b629092 [Kernel] Enable XEX1 loading 2019-11-20 18:09:28 -06:00
Joel Linn 03d5455a2f [imgui] Fixes to work with new api.
- Font atlas is now owned by context.
- Switch from deprecated io.RenderDrawListsFn callback to dedicated call in window.cc.
- Replaced deprecated ImGuiCol_ModalWindowDarkening with ImGuiCol_ModalWindowDimBg.
- Replaced deprecated SetScrollHere() with SetScrollHereY().
- Replaced deprecated GetContentRegionAvailWidth() with GetContentRegionAvail().x.
- Replaced deprecated ShowTestWindow() with ShowDemoWindow().
- Replaced deprecated ImGuiCol_ChildWindowBg with ImGuiCol_ChildBg.
- Replaced deprecated SetNextTreeNodeOpen() with SetNextItemOpen().
2019-11-20 08:05:40 -06:00
Joel Linn 1985169924 [imgui] Make code compile with new imgui. 2019-11-20 08:05:40 -06:00
Triang3l 8ba6f3fc37 [Memory] Trigger watches when making pages writable, not the other way around 2019-11-10 14:21:36 +03:00
Triang3l 26e1a67036 [GPU] Separate dxbc and dxbctext shader compiler targets 2019-11-09 00:13:23 +03:00
Triang3l e5b8f0cb27
[Vulkan] Remove an obsolete comment about GLSL 2019-11-08 23:16:37 +03:00
Margen67 09e1028154 Remove (hopefully) last OpenGL leftovers & crunch
Crunch is unused.
2019-11-08 09:10:51 -08:00
Triang3l d4a5a57867 [D3D12] Remove command_list.h inclusion 2019-11-06 08:08:49 +03:00
Triang3l c8f3c93802 [D3D12] Don't create multiple command lists as they're just encoders 2019-11-06 08:06:12 +03:00
Triang3l 00116fad2d [D3D12] Don't assume there's a null D3D descriptor handle 2019-11-04 21:10:32 +03:00
Triang3l c499229455 [GPU] Store an EDRAM snapshot in traces 2019-11-04 17:30:20 +03:00
Triang3l 1bb3cd45ca [APU] Support XAudio 2.7 2019-11-02 22:27:38 +03:00
Triang3l 9deb710607 [D3D12] CP: Framework for multiple command lists per frame 2019-10-31 23:33:11 +03:00
Joel Linn 7fe4bbe7f3 [APU/Linux] Implement cross platform audio using SDL2 library. 2019-10-28 22:35:25 +01:00
Triang3l 6e5a0ebf7b [D3D12] CP: Separate guest frame and non-frame submissions 2019-10-28 22:00:59 +03:00
Triang3l d3b6f71ae1 [D3D12] Don't use D3D12Context for command processor fence 2019-10-28 10:49:32 +03:00
Triang3l b4af63fe31 [D3D12] Detach UploadBufferPool and DescriptorHeapPool from D3D12Context 2019-10-27 20:53:53 +03:00
Triang3l f23ba862f6 [D3D12] Trace viewer entry point 2019-10-27 00:37:33 +03:00
illusion98 770bba5b45 [Kernel] AVPack cvar
idk what teh hell im doing 😹
2019-10-26 02:25:34 -05:00
illusion98 dd8ba067a0 Merge remote-tracking branch 'upstream/master' into canary 2019-10-26 02:23:23 -05:00
Triang3l 36f4158f09 [GPU] Trace dump: Do PIX/RenderDoc capture if attached 2019-10-25 21:32:17 +03:00
illusion98 77d4b5a7d4 Merge remote-tracking branch 'upstream/master' into canary 2019-10-25 03:57:49 -05:00
Triang3l f75d927cc5 [D3D12] Resolve fetch memory read tracing 2019-10-25 09:17:08 +03:00
Triang3l c057b5a032 [D3D12] Make trace dump partially work 2019-10-25 08:38:06 +03:00
Triang3l b622e894d6 [D3D12] Replicate the last texture component into non-existent ones 2019-10-23 23:47:17 +03:00
Triang3l 4623b41023 [D3D12] Trace guest memory operations 2019-10-23 23:33:50 +03:00
Triang3l e07b0ed2ad [VFS] Fix some security issues in StfsContainerDevice code 2019-10-22 08:55:45 +03:00
Margen67 d0e3281741 Merge remote-tracking branch 'upstream/master' into canary 2019-10-21 22:23:17 -07:00
Triang3l 1005651855 [D3D12] Fix DXN swizzle and cleanup texture swizzles 2019-10-21 21:16:29 +03:00
Triang3l a9ed73bdd1 [GPU] Remove most hardcoded register/instruction layouts from common and D3D12 code 2019-10-20 19:40:37 +03:00
Triang3l f83269cf8c [GPU] Refactor: Register structs in D3D12CommandProcessor and some other places 2019-10-19 23:32:38 +03:00
illusion98 15627fb803 Revert "Thread order tweak to threading PR"
This reverts commit 0fc7ac4218.
2019-10-10 07:38:36 -05:00
illusion98 3ab478da75 Change default config file name 2019-10-10 07:38:30 -05:00
Radosław Gliński 779cfc6624 Implemented instructions: rldclx, rldcrx 2019-09-23 04:45:14 -05:00
illusion98 7a7c44b0b7 Merge remote-tracking branch 'upstream/master' into canary 2019-09-15 03:25:21 -05:00
Triang3l f748e5af49 [Emulator] Default XEX cvar 2019-09-14 20:30:04 +03:00
illusion98 cf6cc7a108 Merge remote-tracking branch 'upstream/master' into canary 2019-09-13 03:11:03 -05:00
Cancerous b6e1902579 return error in NetDll_WSARecvFrom so we don't wait on packets we won't be getting - fixes State of decay with other XBLA fixes already merged in canary 2019-09-13 03:10:11 -05:00
gibbed f6e2012e8c [Kernel] Workaround for crash seen on N3 demo boot.
Changes NtAllocateVirtualMemory so that it ignores specified page size when a
base address is specified. Requires verification if this is desired behavior.
2019-09-13 03:10:06 -05:00
Radosław Gliński 47f9142080 Added stub implementation of WSAFDIsSet. I hope that arguments correct 2019-09-13 03:09:48 -05:00
illusion98 4bd98ea3d8 Add command to show fps in titlebar 2019-09-13 03:09:09 -05:00
gibbed c19a052b96 [XAM] Don't use strncpy for XamUserGetName. 2019-09-12 03:41:02 -05:00
Prism Tutaj 4b89a060d4 Fix discord cvar 2019-09-09 08:13:03 -05:00
Cancerous 73b7bad11b Merge branch 'get-proc-address-by-ordinal' of https://github.com/CookiePLMonster/xenia into canary
[Kernel] Fixup GetProcAddressByOrdinal #1473
2019-09-08 23:10:12 -04:00
Silent 9021a7c922
[CPU] Fix off-by-one in max ordinals check 2019-09-08 22:34:31 +02:00
Silent 286a7a03f9
[Kernel] Fixup GetProcAddressByOrdinal
Now properly takes a global lock when populating guest_trampoline_map_
as opposed to taking and immediately releasing it
Also removes a redundant find() from guest_trampoline_map_
so map is not searched twice if the function has already been generated.
2019-09-08 21:32:34 +02:00
Prism Tutaj 7eb69ca255 miscellaneous linux fixes. Disables vulkan-trace-viewer and dumper 2019-09-07 20:30:25 -05:00
Prism Tutaj 313f38e538 Revert "Merge remote-tracking branch 'canary/systemlink'"
This reverts commit 7091177142, reversing
changes made to c9631fb73d.
2019-09-07 17:08:02 -05:00
Cancerous 25df5a6e94 Merge branch 'master' of https://github.com/xenia-project/xenia into canary
# Conflicts:
#	src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc - resolved in xboxkrnl_xconfig.cc?
2019-09-05 09:18:37 -04:00
Cancerous ba46b6a6f8 Merge cleanup and fixes 2019-09-05 08:23:43 -04:00
Cancerous 127b465ccc Merge branch 'profile-gpds-rebase' of https://github.com/emoose/xenia into canary
Merge Emoose profiles-gpds https://github.com/emoose/xenia/tree/profile-gpds-rebase
2019-09-05 05:24:42 -04:00
gibbed b422ed750b Oops. Didn't mean to add that yet. 2019-09-04 23:16:06 -05:00
gibbed 2780e7b1a6 Add user_country cvar, rename game_language cvar.
- [Kernel] Rename game_language cvar to user_language.
- [Kernel] Recategorize user_language to XConfig.
- [Kernel] Add user_country cvar, used instead of hardcoded value in XConfig.
- [XAM] Use user_country cvar for xeXamGetLocaleEx instead of
  xeExGetXConfigSetting.
2019-09-04 23:02:55 -05:00
gibbed 4f4b83b421 [Kernel] Move ExGetXConfigSetting to its own file.
- [Kernel] Clean up xboxkrnl registration function declarations.
- [Kernel] Move ExGetXConfigSetting to its own file.
2019-09-04 23:02:55 -05:00
gibbed d58544b406 [XAM] Fix incomplete locale tables. 2019-09-04 23:02:55 -05:00
Cancerous 8200b36af7 Merge branch 'master' of https://github.com/ObsidianNA/xenia into canary
Recent Files Menu Bar #1396
2019-09-04 23:20:02 -04:00
Cancerous 7d03c3a28c Merge branch 'master_XNotifyGetNext_Dequeue' of https://github.com/Gliniak/xenia into canary
[XAM] Dequeue remain notification when match_id is incorrect #1463
2019-09-04 22:09:06 -04:00
Cancerous 11f50b25fd Merge branch 'master_FE_msg_getNotify_fixes' of https://github.com/Gliniak/xenia into canary
"Template" for 0xFE message: 0x22005
2019-09-04 22:07:00 -04:00
Cancerous 07c9533c12 Merge branch 'swapdiscv2' of https://github.com/randprint/xenia into canary
[Kernel] XamSwapDisc and supporting functions

 swapdiscv2 (#1458)
2019-09-04 21:52:01 -04:00
Cancerous d5a44504a0 Merge branch 'xex-unload-image' of https://github.com/CookiePLMonster/xenia into canary
[Kernel] Make XexUnloadImage fully release the image

Previously XexUnloadImage did not cleanup the image fully,
and if XexLoadImage was to be called again on the same module,
it was not initialized fully, leading to a crash when using it.

[Kernel] (Partially) fix module refcounting

.xex module handles were retained twice in several places,
possibly causing them to leak.
More placed may have to be fixed too.
2019-09-04 21:40:27 -04:00
Cancerous b91b1eb356 Merge branch 'crypt-fixes' of https://github.com/CookiePLMonster/xenia into canary
[Kernel] Fix SHA1 and SHA256 state endianness

Fixes malfunctioning SHA256 hash,
corrupting its state between Update and Finish calls.
 crypt-fixes (#1461)
2019-09-04 21:36:22 -04:00
Cancerous f3a1500c20 Merge branch 'master' of https://github.com/xenia-project/xenia into canary
c22f76e [Base] Const-ize store and store_and_swap templ... - gibbed
ce78d71 [CPU] Add locale export category. - gibbed
8589238 [XAM] Implement a number of language/locale rel... - gibbed
2019-09-04 21:15:16 -04:00
gibbed 858923898f [XAM] Implement a number of language/locale related functions.
[XAM] Implement XamGetLocale, XamGetOnlineCountryFromLocale,
  XamGetOnlineCountryString, XamGetCountryString, XamGetLanguageString,
  XamGetLanguageLocaleString, XamGetOnlineLanguageAndCountryString,
  XamGetLocaleString, XamGetLocaleFromOnlineCountry,
  XamGetLanguageFromOnlineLanguage, XamGetOnlineLanguageString,
  XamGetCountryFromOnlineCountry, and XamGetLocaleEx.
2019-09-04 20:03:25 -05:00
gibbed ce78d7110e [CPU] Add locale export category. 2019-09-04 20:03:25 -05:00
gibbed c22f76e87f [Base] Const-ize store and store_and_swap templates.
[Base] Make value argument for store and store_and_swap templates
const&.
2019-09-04 19:58:17 -05:00
Cancerous 7825877040 FPS Counter at the end of the display chain #1362
from IceTDrinker
https://github.com/xenia-project/xenia/pull/1362
2019-09-04 07:54:55 -04:00
Cancerous 0fc7ac4218 Thread order tweak to threading PR 2019-09-04 07:40:43 -04:00
illusion98 6eabaa259a Merge remote-tracking branch 'randprint/ThreadDistribution' into canary 2019-09-04 06:20:02 -05:00
illusion98 7c52c211e1 Merge remote-tracking branch 'randprint/window-dimensions' into canary 2019-09-04 06:20:01 -05:00
illusion98 3d909462ac [Kernel] Add Gamertag config variable 2019-09-04 06:19:41 -05:00
illusion98 bcc571e574 Merge remote-tracking branch 'upstream/master' into canary 2019-09-04 05:50:18 -05:00
Silent 2ecf687983
[Kernel] Fix SHA1 and SHA256 state endianness
Fixes malfunctioning SHA256 hash,
corrupting its state between Update and Finish calls.
2019-09-03 22:55:43 +02:00
Rados??aw Gli??ski bea0cc4922 Fixed Mask incorrectness. Does mask_ == 0x01 means accept all?
Affected Games:
- Grid 2 (freezes)
- Skate. (Menu Soundtrack)
- Crackdown 2 Demo (ingame freeze)
2019-09-03 20:36:53 +02:00
Triang3l 84a8dc91e4 [D3D12] Filtering between array texture layers 2019-09-03 10:14:25 +03:00
Silent 19251993fc
[Kernel] Make XexUnloadImage fully release the image
Previously XexUnloadImage did not cleanup the image fully,
and if XexLoadImage was to be called again on the same module,
it was not initialized fully, leading to a crash when using it.
2019-09-02 21:48:51 +02:00
Silent 6630a494ac
[Kernel] (Partially) fix module refcounting
.xex module handles were retained twice in several places,
possibly causing them to leak.
More placed may have to be fixed too.
2019-09-02 21:44:43 +02:00