Commit Graph

5410 Commits

Author SHA1 Message Date
emoose 04fcdeb24d
[Kernel] GPD: Set unlock/played times, add missing SPA achievements to existing GPDs...
For example if a user applies a TU that adds achievements after already running the non-patched game, this should add any new achievements it finds.

Will also update the last_played time of a title when the SPA gets loaded in (on game launch), and also set the unlock_time when unlocking achievements.

Unlocking also only updates the title GPD (+ dash GPD) now, instead of needing to rewrite every GPD.
2019-08-05 18:25:52 +01:00
emoose faeddbd34d
[Kernel] Copy title image/name from SPA->GPD, fix XDBF free data...
Velocity should now load Xenia-created GPDs fine :D

To try it just make a new profile package in Velocity, inject GPDs from Xenia, and inject random Account file from a 360 profile.
Then close created package, use Tools -> Profile Tools -> Profile Editor to open the package you just created, and if all goes well the profile should load up fine.
2019-08-05 18:25:51 +01:00
emoose e510972691
[Kernel] Update XamUserCreateAchievementEnumerator to work with GPDs
Seems to work fine, tested with Tetris TGM ACE which uses achievements to track progression & unlock things in the game, and unlocking achievements in the GPDs does unlock things in game as intended.
Haven't actually tested unlocking the achievements in-game and then checking though (my tetris skills are awful :P), but I think it should work fine.

Strings aren't copied into it yet since I didn't want to alloc guest memory for every CreateEnumerator call...
Not many games actually have in-game achievement lists though, but I've added a placeholder string for any that might.

Like said in the comment, maybe we should alloc those strings in guest mem when the game GPD/SPA is first loaded in?
2019-08-05 18:25:49 +01:00
emoose 8368e8ce06
[Kernel] Let XGIUserWriteAchievements unlock achievements
XGIUserWriteAchievements seems to be the main (only?) way achievements are unlocked, when used that'll now try getting the GPD from UserProfile and unlock the achievements passed to it.

Dash GPD info is recalced and GPDs get written to disk whenever achievements are unlocked, letting achievements persist across instances.

TODO:
- "Achievement Unlocked!" UI, writing to log isn't much of an indicator :P
- XamUserCreateAchievementEnumerator, needs to return XACHIEVEMENT_DETAILS structs, which also contain pointers to strings in guest memory...
- Copy over more data from SPA? (need to check what data 360 copies to it)
- Optimize GPD writing, atm every GPD gets rewritten even if it hasn't been changed...
- Change profile folder path? Maybe allow using 360 profiles eventually?
- GPD settings
2019-08-05 18:25:48 +01:00
emoose 2a5ab07024
[Kernel] Let UserProfile load/save GPDs, convert SPA -> GPD on XEX load
UserProfile will now try loading dash GPD + any game GPDs from the "profile" folder when initialized.

After loading an XEX the title's SPA data gets passed to UserProfile, which will then either set current GPD based on title ID in the SPA, or create new GPD and copy achievements/images over to it.
2019-08-05 18:25:46 +01:00
emoose 734bbc7515
[Kernel] Add XdbfTitlePlayed support to GpdFile, used by dash GPD
Eventually user_profile would read dash GPD, loop through XdbfTitlePlayed entries, load GPD for each one...
Also eventually settings will be stored in dash GPD (eg. the ones currently defined in user_profile.cc)
2019-08-05 18:25:44 +01:00
emoose 00f3627715
[Base] Make Emulator::CompleteLaunch use SpaFile instead 2019-08-05 18:25:43 +01:00
emoose 52984280c3
[Kernel] Add achievement stuff to XdbfWrapper, convert it to a full XDBF parser...
XdbfWrapper would only wrap existing in-memory data, making modifying data (or creating new data) non-trivial.
The new XdbfFile class parses all the XDBF stuff into different vectors, making modifications a lot easier.

GpdFile and SpaFile are both children of XdbfWrapper, SpaFile has the same functions as the older XdbfGameData class, but now includes support for parsing achievements too.
The GpdFile class also supports achievements, and both classes parse into a common XdbfAchievement struct, which makes it simple to eg. copy achievements from a SPA file into a new GPD file.

TODO:
- images?
- GPD settings (user_profile has some code for this, not sure how much we can use here though...)
- modify user_profile to make use of this
2019-08-05 18:25:41 +01:00
gibbed 35e79d1979 [Base] Fix checks in cvar string escaping. 2019-08-04 21:55:06 -05:00
Rick Gibbed ce8d3cb978
Merge pull request #1392 from Margen67/update-documentation
Update and move documentation from website to GitHub Wiki.
2019-08-04 20:39:30 -05:00
Margen67 dd46e30be5 [building.md+README.md] Move building instructions+xb to building, make Quickstart link to wiki
Also update and remove outdated information.
2019-08-05 08:24:52 +07:00
Rick Gibbed 483d5e8ff4
Merge pull request #1409 from Margen67/appveyor-cleanup
Clean up .appveyor.yml.
2019-08-04 18:34:29 -05:00
Rick Gibbed 9f24d61268
Merge pull request #1401 from Margen67/upgrade-travis
[Travis] Use newer clang+llvm and libvulkan, remove outdated comments.
2019-08-04 18:29:00 -05:00
Triang3l cb0e18c7dc [Memory] BaseHeap::host_address_offset 2019-08-04 23:55:54 +03:00
Triang3l 25675cb8b8 [Memory] E0000000 adjustment in watches only for Windows 2019-08-04 23:10:59 +03:00
gibbed bbe4d416ff [Core] Fix writing of multiline values in config. 2019-08-04 13:00:15 -05:00
gibbed 41b8dbdd76 [Core] Fix SaveConfig on non-Windows. 2019-08-04 12:48:41 -05:00
gibbed 13a67d64a9 [Core] Fix ParseFile on non-Windows. 2019-08-04 12:20:51 -05:00
gibbed 306f358c07 [Base] Drop inline on string_util/vec128 implementations for now because clang is whining. 2019-08-04 12:00:04 -05:00
gibbed 7d6d732999 [Kernel] Of course I forget to commit another local change. 2019-08-04 11:44:18 -05:00
gibbed 36bd0df586 [Base] Move float/double to_hex_string implementation out of header. Maybe fix Travis complaining. 2019-08-04 11:38:01 -05:00
gibbed 1ebf7bb484 [Kernel] Implement KeTryToAcquireSpinLockAtRaisedIrql. Maybe correctly. 2019-08-04 11:36:49 -05:00
Triang3l 68017eadea [Vulkan] Add missing line to mark a texture as watched 2019-08-04 18:29:20 +03:00
gibbed 4248f9ed19 [Base] Fix formatting in string_util.cc. 2019-08-04 07:32:24 -05:00
gibbed 693958f8b7 [Base] Fix escaping quote runs. 2019-08-04 07:29:29 -05:00
gibbed bee55ce5bb [Base/Core] Work on config/cvars. Properly escape string values when saving config. 2019-08-04 07:09:05 -05:00
gibbed 82f85c98f0 [Base] Add wide version of split_path. 2019-08-04 06:47:09 -05:00
gibbed 01c656b77b [Base] Add split_string. 2019-08-04 06:46:07 -05:00
gibbed 2048239f30 [Base] Move implementation out of header where appropriate, and qualify std namespace. 2019-08-04 04:40:19 -05:00
gibbed 40cc8c52d7 [Base] Qualify std namespace. 2019-08-04 04:39:22 -05:00
gibbed 8b1f728d85 [Base] Use vwsprintf instead of _vsnwprintf. 2019-08-04 03:44:08 -05:00
gibbed 5ea54d9326 [Core] Fix config load/save not using wide strings for path. 2019-08-04 03:30:57 -05:00
gibbed b685211b96 [Base] Add wide versions of FatalError. 2019-08-04 03:26:18 -05:00
gibbed 29fcde6687 Fix submodule URLs. 2019-08-04 03:23:36 -05:00
gibbed 85b4b561bf [Base] Fix Travis complaints with cvar code. 2019-08-04 02:52:28 -05:00
gibbed a1c9d57afc [App] Make target into a transient cvar. 2019-08-04 02:18:03 -05:00
gibbed f360053198 [Base/Core] Bring cvar/config code in line with the style guide. 2019-08-04 02:17:22 -05:00
gibbed 7ba460552c [Base/Core] Add support for transient cvars. 2019-08-04 02:12:46 -05:00
gibbed 9a9a55aa49 [Core] Report the actual reason config parse failed. 2019-08-04 01:22:01 -05:00
gibbed 53b564c1a6 [APU] Only set the work event/wait on the worker thread when they actually exist. 2019-08-04 00:49:32 -05:00
gibbed 38a6d110e7 [APU] Only wait on the worker thread if it actually exists. 2019-08-04 00:27:49 -05:00
gibbed e48f4ce004 [Core] Only wait on the main thread if it actually exists. 2019-08-03 23:48:05 -05:00
gibbed 4970fc8673 [Kernel] Make XObject type() const. 2019-08-03 23:47:16 -05:00
gibbed b2f62b1982 Clean up cvars (rename, recategorize). 2019-08-03 23:46:03 -05:00
Rick Gibbed 9d924950cc
Merge pull request #1417 from emoose/xnotify-fixes
[Kernel] Make XamShow*UI exports send XN_SYS_UI notifications, & small XNotifyListener fix.
2019-08-03 22:37:59 -05:00
emoose 313e81ec38
[Kernel] Add XN_SYS_UI notifications to XamShow*UI exports 2019-08-04 03:57:06 +01:00
emoose c3476e8e19
[Kernel] Make XNotifyListener::notifications_ a std::vector, allowing multiple to use the same ID.
Previously adding a notification that already exists would just overwrite the older notifications value, meaning the game would never see that older notification.
This would break games like Project Sylpheed, which seems to require seeing XN_SYS_UI = true eventually followed by XN_SYS_UI = false for the game to realize all system UIs are closed.
2019-08-04 03:55:57 +01:00
gibbed 0ac83f99dc [App] Add winkey input driver last. 2019-08-03 20:47:39 -05:00
gibbed f2dac86b3f [App] Use make_unique when creating a derived type instance. 2019-08-03 20:46:03 -05:00
gibbed 02ea74becd [App] Only create input nop driver when explicitly requested. 2019-08-03 20:07:19 -05:00