Commit Graph

5819 Commits

Author SHA1 Message Date
Margen67 68d78bd087 Update README.md 2020-07-15 05:19:24 +11:00
emoose 78c728b81d 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-07-15 04:35:43 +11:00
emoose 9719627296 Include XEX version in log 2020-07-15 04:35:43 +11:00
emoose c74c2a5511 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-07-15 04:35:43 +11:00
emoose b4f088fb00 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-07-15 04:35:43 +11:00
emoose 602c1d1dac 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-07-15 04:35:43 +11:00
emoose 35a3a60631 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-07-15 04:35:43 +11:00
emoose d47f2a6ef1 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-07-15 04:35:43 +11:00
Cancerous d6136ad8bc stubs for 9199 (eventually) 2020-07-15 04:35:43 +11:00
Cancerous 523fbcf130 further ajustment to buffer size to fix regression 2020-07-15 04:35:43 +11:00
Cancerous 5c7032c826 title update fixup - breaks xex1 temporarily 2020-07-15 04:35:43 +11:00
illusion98 79d6893eec Title Update fixup
Co-Authored-By: aerosoul94 <aerosoul94@hotmail.com>
2020-07-15 04:35:43 +11:00
Cancerous 144e2eb51c - adjusting XAMEnumerate buffer size to fix Angry Birds and Resonance of Fate - thanks Gliniak 2020-07-15 04:35:43 +11:00
Cancerous 6587672b19 icon fix 2020-07-15 04:35:43 +11:00
illusion98 6caa874305 Change default config file name 2020-07-15 04:35:42 +11:00
illusion98 5aee57cae8 Change window title
xenia -> xenia-canary
2020-07-15 04:35:42 +11:00
Cancerous 3be412ba84 New Icons 2020-07-15 04:35:42 +11:00
illusion98 2651a60712 Add command to show fps in titlebar 2020-07-15 04:35:42 +11:00
illusion98 7683e0847c Change ID and new description 2020-07-15 04:35:42 +11:00
illusion98 cfb417c2a5 Add Time Elasped and Description Text
Display Time Elapsed when idle or playing a game
Display description when hovering over the icon
2020-07-15 04:35:42 +11:00
chss95cs@gmail.com 17930b1810 Add constant folding for OPCODE_ROTATE_LEFT 2020-07-15 04:35:42 +11:00
chss95cs@gmail.com 063444254c Reuse flag results in OPCODE_BRANCH_TRUE codegen if the preceding instruction was a comparison that already set the cpu flags 2020-07-15 04:35:42 +11:00
Gliniak b65d8b2963 [Kernel/Xam] XamEnumerate: Disable zeroing memory 2020-07-15 04:35:42 +11:00
Gliniak c43fedebce [Kernel] Do not load module explicitly
Application should be responsible for loading xex modules
2020-07-15 04:35:42 +11:00
Gliniak 6353577c6d [Kernel/Xam] Fixed non-empty directories removal 2020-07-15 04:35:42 +11:00
Gliniak 2c3e1def64 [Kernel/Xam] Fixed wrong path creation related to saved content 2020-07-15 04:35:42 +11:00
Gliniak 3fd16eed90 RtlTimeToTimeFields Check for highest defined time_t value. 2020-07-15 04:35:42 +11:00
emoose 64144ffdca Add more mount paths for the local directory
This adds more mount paths for the XEX's local directory to Emulator::LaunchXexFile, so any XEXs that try to use these mountpoints can load files from the XEX directory.

Mount points added:
- \Device\Harddisk0\Partition0 -  original mountpoint used by Xenia
- \Device\Harddisk0\Partition1 - some games/apps seem to use this to refer to HDD1:
- \Device\Harddisk0\Partition1\DEVKIT
  Used by xshell.xex, gets linked as E: (aka "development drive")
  Even if a DEVKIT folder exists inside the local folder, it seems we still have to add this mount point explicitly.

- \Device\LauncherData
  Also used by xshell.xex for various UI resources
  The xlaunch.fdf file is normally mounted via DmMountFdfxVolume to this path (xlaunch.fdf is a FATX formatted container)
  By mounting this xshell can retrieve extracted resources from the local dir.

- \SystemRoot
  Normally refers to the NAND, used by dash.xex to retrieve XZP resources when they aren't inside xam.xex.
  Other apps also use this to refer to other system XEXs/resources
  By mounting it we can just place any needed resources in the local dir.
2020-07-15 04:35:42 +11:00
emoose d3c3dc5cf6 Add PVR register to mfspr
PVR stores the processor/motherboard revision, the latest I could find seems to be 0x710800 which is probably a Corona.
XShell tries to retrieve this during launch to print it on the console (search "XSHELL: CPUPVR" on pastebin for some examples)
Xenia crashes because it's unimplemented, so I just made it return 0x710800. It could be worth moving this to be a constant somewhere though.

IIRC hypervisor/kernel uses this for some things too, but since we don't emulate those it's not much of a problem, but there could still be other XEXs which use it for something.
2020-07-15 04:35:42 +11:00
emoose ee1b7b4e64 Add more XConfig settings & --xconfig_initial_setup flag
This just adds some extra XConfig settings that the dashboard tries to retrieve.

The XCONFIG_USER_RETAIL_FLAGS setting gets used to decide whether to show the initial setup/OOBE wizard or not.
Since the OOBE currently isn't usable in Xenia (mostly due to missing XamProfile* exports, afaik), this setting is by default set to skip it.
But if that isn't desired the --xconfig_initial_setup flag can be used to un-set it.
2020-07-15 04:35:42 +11:00
emoose b7857d77c6 ContentManager: add more checks for folder-packages
Fixes problems with folder packages not being created
2020-07-15 04:35:42 +11:00
emoose ab41204a61 UserModule: try searching for & mounting TU packages to load XEXP patches from.
This uses ContentManager to look for title updates, updates should be inside Content\[TitleID]\000B0000\
The updates can either be made up of an STFS package, or a folder containing extracted update files.

The update will then be mounted under update:\, so games that rely on loading updated assets from the TU should also work with it.
2020-07-15 04:35:42 +11:00
emoose d89a4883bb ContentManager: add support for STFS packages, title_id override
Normally ContentManager resolves package paths by using kernel_state_->title_id() as the title ID, but if we want to use ContentManager for TU's that won't work, since the XEX won't be fully loaded into kernel_state_->executable_module_ yet.

We can get around this by allowing the title ID used by ContentManager to be overridden, this should also help us support games that load packages from other title IDs.
2020-07-15 04:35:42 +11:00
emoose d55960fce5 Fix running import library entrypoints via new XThread param
This is fixed by adding a new startup_type parameter to XThread, which
lets us create an XThread that can run DllMain with correct arguments.
LaunchModule is then modified to use that param when launching a DLL
module that has an entrypoint. UserModule::LoadXexContinue also has code
added to call SetExecutableModule prior to loading any import libraries
2020-07-15 04:35:42 +11:00
emoose 675d8d88d4 Fix loading import library modules 2020-07-15 04:35:42 +11:00
IceTDrinker d360c80094 FPS Counter at the end of the display chain
1) Gives actual refresh rate of the window

2) FPS display based on profiler data, toggleable by pressing the the h key
on the keyboard, use Shift + h to modify FPS text scale (x1, x2 or x4)

3) Fix linux build by updating the gtk window

4) Fix linux build again, include microprofiler header directly and correct
parameters sent to ImGui::Text

5) Fix linux build by using a define to hide undefined functions on linux
2020-07-15 04:35:42 +11:00
ObsidianNA 4d709dccd2 Recent Files List
Overview:
Added a Pop-up menu named 'Open Recent' under the 'File' menu bar item that lists 10 recently opened files.

- It stores the paths of opened games inside a file named 'recent.txt' in the same folder where the xenia.exe is located.

- If the file doesn't exits, the program creates it, then paths are stored when a new file is opened.

- Each time a file is opened, the program compares stored paths with the new one, if it exists then the path is moved to the top of the list to indicate that it is the most recent file opened.

- 'Open Recent' entries are refreshed once xenia is re-started.
2020-07-15 04:35:42 +11:00
emoose 251b35ff14 Fix bug with deleting StfsContentPackage & ensure instance gets deleted 2020-07-15 04:35:42 +11:00
emoose 9ecdf5eba8 Add virtual dtor to ContentPackage, hopefully fix travis... 2020-07-15 04:35:42 +11:00
emoose 52e5885a47 Allow reading FolderContentPackage thumb from headers.bin file 2020-07-15 04:35:41 +11:00
emoose cf85ee1b24 Split code into StfsContentPackage / FolderContentPackage classes 2020-07-15 04:35:41 +11:00
emoose aca251d382 Read STFS headers for unpackaged files from [path].headers 2020-07-15 04:35:41 +11:00
emoose 3423198de3 Allow reading XCONTENT_DATA info from STFS headers 2020-07-15 04:35:41 +11:00
emoose 6e06c164c7 ContentManager: add support for STFS packages 2020-07-15 04:35:41 +11:00
emoose a45813fad6 Add APC support to NtWriteFile 2020-07-15 04:35:41 +11:00
Cancerous ce5845b1aa XGI messages to fix Jetpac XBLA. addition changes to get AegisWings, Jetpac, MetalSlug 3, and State of Decay in game.
+ Updated PR from Permanulled PR#1150
2020-07-15 04:35:41 +11:00
Cancerous 7a2efec4fe Add window dimension cvars 2020-07-15 04:35:41 +11:00
Gliniak ce1e7f1ce6 [Kernel/Xam] Implemented XamSwapDisc 2020-07-15 04:35:41 +11:00
Triang3l 9418f3f2c5 [D3D12] Fix a storing typo in the DXT3 decompression shader 2020-07-14 17:45:41 +03:00
gibbed c99c430665 [Kernel] Reject IO for invalid characters.
[Kernel] Reject IO for paths with invalid characters.
2020-07-12 12:22:24 -05:00