Commit Graph

132 Commits

Author SHA1 Message Date
disjtqz
ee424ae14a [Kernel] nonintrusive guest to host object mapping 2023-10-14 15:01:12 +02:00
Gliniak
e613134793 Merge branch 'master' of https://github.com/xenia-project/xenia into canary_experimental 2023-10-02 10:07:05 +02:00
Gliniak
f6b5424a9f [VFS] Fixed invalid month decoding in decode_fat_timestamp 2023-09-14 12:32:51 +03:00
Gliniak
0f331b5313 [Testing] Added test project for vfs
- Added test case for: decode_fat_timestamp
- Changed location of: decode_fat_timestamp
2023-09-14 12:32:51 +03:00
Gliniak
9554f82c10 [VFS] More cleanup in Zarchive loader 2023-09-04 21:09:40 +02:00
Gliniak
9496c04ac5 [VFS] Zarchive cleanup & style changes 2023-09-03 21:31:17 +02:00
Romain Tisserand
2cd2d1d620 [VFS] Add support for loading ZArchive files 2023-09-03 21:16:34 +02:00
Gliniak
e191f2d8d0 Separation of STFS, SVOD into different entities 2023-09-03 19:37:22 +02:00
Gliniak
c1bd30eb7f Fixed invalid month decoding in decode_fat_timestamp 2023-09-02 10:49:58 +02:00
Gliniak
d9e1c5024f Added test project for vfs
- Added test case for: decode_fat_timestamp
- Changed location of: decode_fat_timestamp
2023-09-02 10:49:58 +02:00
chris
afef35c1c0 Implement RtlRandom (which despite its name is located in Xam, not xboxkrnl, which is why its not in xboxkrnl_rtl)
Stub XamVoiceSubmitPacket
Stubs for __CAP_Start_Profiling/End_Profiling/Enter_Function/Exit_Function
add a note about io_status_block in NtDeviceIoControlFile, change the param's type
move the X_IOCTL_ constants from NtDeviceIoControlFile's body into xbox.h
add X_STATUS_INVALID_IMAGE_FORMAT to xbox.h
Implement XexLoadImageHeaders
Much more correct version of IoCreateDevice, properly initializes/allocates device extension data
Stub version of IoDeleteDevice
Open the quickstart guide in the browser the first time a user opens the emulator
Add some persistent flags that are stored in the registry on windows, not in the config. These are just used to indicate whether one-time tasks have run, like showing the quickstart guide. On non-windows platforms a default value is returned that skips any of these tasks so they don't run every single time.

If the user opens a .iso file, show a warning telling them that we do not condone or support piracy. If the user closes the messagebox within two seconds set a sticky flag that will show them the warning every time instead. Otherwise the warning is never shown again. The Beep function is used to spook them a bit, to hopefully make them less likely to skip the message
If a user opens an archive file, which we do not support, explain to them that they're dumb.

Removed messages intended to "catch" pirates.  If they're out there, we don't want to know about them. A huge chunk of the discourse on our discord is now about piracy. Hopefully these changes will deter them from coming to us for now, but some of these messages may backfire
2023-07-23 14:26:10 -04:00
Margen67
71b8c2357e Fix broken errors, log ISO path 2023-06-28 00:25:44 -07:00
chss95cs@gmail.com
c86233cc80 Detect corrupted xiso images that have file entries that are out of range and show a fatal error. 2023-04-23 12:52:03 -04:00
Adrian
321dd75e05 [VFS] Fixed allow_game_relative_writes to write invalid cached entries
This PR fixes https://github.com/xenia-canary/xenia-canary/issues/123 a bug where files would not write to the host if they were deleted from the host filesystem during runtime.
2023-02-08 22:38:16 +01:00
chss95cs@gmail.com
c1d922eebf Minor decoder optimizations, kernel fixes, cpu backend fixes 2022-11-05 10:50:33 -07:00
chrisps
8186792113 Revert "Minor decoder optimizations, kernel fixes, cpu backend fixes" 2022-11-01 14:45:36 -07:00
chss95cs@gmail.com
550d1d0a7c use much faster exp2/cos approximations in ffmpeg, large decrease in cpu usage on my machine on decoder thread
properly byteswap r13 for spinlock
Add PPCOpcodeBits
stub out broken fpscr updating in ppc_hir_builder. it's just code that repeatedly does nothing right now.
add note about 0 opcode bytes being executed to ppc_frontend
Add assert to check that function end is greater than function start, can happen with malformed functions
Disable prefetch and cachecontrol by default, automatic hardware prefetchers already do the job for the most part
minor cleanup in simplification_pass, dont loop optimizations, let the pass manager do it for us
Add experimental "delay_via_maybeyield" cvar, which uses MaybeYield to "emulate" the db16cyc instruction
Add much faster/simpler way of directly calling guest functions, no longer have to do a byte by byte search through the generated code
Generate label string ids on the fly
Fix unused function warnings for prefetch on clang, fix many other clang warnings
Eliminated majority of CallNativeSafes by replacing them with naive generic code paths.
^ Vector rotate left, vector shift left, vector shift right, vector shift arithmetic right, and vector average are included
These naive paths are implemented small loops that stash the two inputs to the stack and load them in gprs from there, they are not particularly fast but should be an order of magnitude faster than callnativesafe
to a host function, which would involve a call, stashing all volatile registers, an indirect call, potentially setting up a stack frame for the arrays that the inputs get stashed to, the actual operations, a return, loading all volatile registers, a return, etc
Added the fast SHR_V128 path back in
Implement signed vector average byte, signed vector average word. previously we were emitting no code for them. signed vector average byte appears in many games
Fix bug with signed vector average 32, we were doing unsigned shift, turning negative values into big positive ones potentially
2022-10-30 08:48:58 -07:00
chss95cs@gmail.com
d8c94b1aee Fix premake filter mistake that broke debug builds (and likely any build other than release) 2022-10-08 10:10:36 -07:00
chss95cs@gmail.com
b4c175d8a3 Enable SDL_LEAN_AND_MEAN, SDL_RENDER_DISABLED, saves about 500kb in final exe
Build several projects that arent performance critical with /Os and /O1 under msvc windows
2022-09-29 07:26:38 -07:00
Gliniak
010b59e81c [Emulator] Install Content: Create header for installed packages
This fixes support for certain DLCs
2022-08-20 20:44:30 +02:00
Gliniak
469d062a50 [Emulator] Updated "Install Content" function to match PR status 2022-08-20 20:44:30 +02:00
Gliniak
79ffbe3971 Merge branch 'importContent' of https://github.com/Gliniak/xenia.git into canary_experimental 2022-07-30 12:44:24 +02:00
Gliniak
433a8a8a5e [Emulator] Added option for content installation 2022-07-30 12:41:26 +02:00
Gliniak
6e1e62378f Merge branch 'master' of https://github.com/xenia-project/xenia into canary_experimental 2022-07-17 21:27:52 +02:00
Triang3l
624f2b2d9e [Base] Android content URI file memory mapping 2022-07-17 16:34:17 +03:00
Triang3l
34a952d789 [Base] Wrap strdup and strcasecmp in xe:: functions 2022-07-17 16:14:29 +03:00
Gliniak
a190bf9fd8 Changed max component length for host and svod types 2022-05-22 13:06:42 +02:00
Wunkolo
1a8068b151 [Base] Add user-literals for several memory sizes
Rather than using `n * 1024 * 1024`, this adds a convenient `_MiB`/`_KiB` user-literal to the new `literals.h` header to concisely describe units of memory in a much more readable way. Any other useful literals can be added to this header. These literals exist in the `xe::literals` namespace so they are opt-in, similar to `std::chrono` literals, and require a `using namespace xe::literals` statement to utilize it within the current scope.

I've done a pass through the codebase to replace trivial instances of `1024 * 1024 * ...` expressions being used but avoided anything that added additional casting complexity from `size_t` to `uint32_t` and such to keep this commit concise.
2022-01-02 11:51:31 -06:00
Triang3l
fdec0ab332 [Code] Make union usage more consistent 2021-11-03 20:45:09 +03:00
Triang3l
6ce5330f5f [UI] Loop thread to main thread WindowedAppContext 2021-08-28 19:38:24 +03:00
emoose
bf8138a886 [VFS] Add NullDevice (returns success for all calls), handle \Device\Harddisk0\ with it
XMountUtilityDrive code tries reading/writing from \Device\Harddisk0\Cache0 / Cache1 / Partition0, NullDevice handling \Device\Harddisk0 will make that code think that the reads/writes were successful, so the utility-drive mount can proceed without failing.
2021-08-18 17:34:59 -05:00
gibbed
fa8e2ee788 [VFS] Suppress error msg for ShaderDumpxe:\CB.
[VFS] Suppress error message for ShaderDumpxe:\CompareBackends.
2021-06-28 20:32:52 -05:00
gibbed
771f8fb292 Fix HostPathFile access checks.
Fix HostPathFile access checks to additionally check generic access.
2021-06-27 20:01:03 -05:00
emoose
13f30d3492 [Kernel] Merge Content*Data structs into XCONTENT*_DATA
Also moved XContentType to xbox.h so code can make use of it without needing to include STFS stuff
2021-06-25 23:48:25 -05:00
emoose
422fc4f24e [VFS/STFS] Check fread return values, add SVOD local structs
A few minor improvements to StfsContainerDevice too, and now StfsContainerFile::ReadSync will set out_bytes_read to the actual
number of bytes read
2021-05-18 09:04:45 -05:00
emoose
478bb90922 [VFS/STFS] Use xe::filesystem::OpenFile instead of memory-mapping
Adds StfsDirectoryEntry / StfsDirectoryBlock to make it easier to fread()
2021-05-18 09:04:45 -05:00
emoose
2659b70c90 [VFS/STFS] Improved StfsHashEntry, minor struct improvements
Changed XEPACKEDSTRUCT to #pragma pack, added setters for some fields that didn't have them, named some anonymous structs which might help with other compilers.
2021-05-18 09:04:45 -05:00
emoose
aa155612fb [VFS/STFS] Move x360-specific STFS structs to stfs_xbox.h 2021-05-18 09:04:45 -05:00
Triang3l
0965975cbe [VFS] Fix missing unordered_map include in stfs_container_device.h 2021-05-17 02:50:01 +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
emoose
99b7848a34 [VFS/STFS] Cache any hash-blocks we read from in memory 2021-05-05 12:35:51 -05:00
emoose
6ba9b032a3 [VFS/STFS] Check for end-of-chain when reading dir entries, warn if chain size is wrong 2021-05-05 12:35:51 -05:00
emoose
8d7768c7fa [VFS/STFS] Secondary hash-block improvements
GetBlockHash now visits upper-level hash tables (if needed) to check the active_index flag that decides if secondary hash-block should be used or not.
This should give better support for CON packages, important for X360 profiles/game saves (some well-used profiles can be heavily fragmented)
2021-05-05 12:35:51 -05:00
emoose
09e0db029a [VFS/STFS] Add BlockToHashBlockOffsetSTFS for more accurate hash table offset 2021-05-05 12:35:51 -05:00
emoose
509f33ba27 [VFS/STFS] Fix BlockToOffsetSTFS for non-read_only_format (CON) packages
Previous code would give wrong results for those types of packages as the block_shift would cancel itself out, moving it to happen afterward let it give the right result though, probably a mistake while reversing it.
(eg. block 0 would give 0xB000, but that's wrong for non-read_only packages as 0xA000 and 0xB000 are reserved for the first hash-table there, fixed code returns the correct 0xC000 offset)

Also changed it to a multiply & renamed it to blocks_per_hash_table to make it more obvious what the purpose is.
2021-05-05 12:35:51 -05:00
emoose
14783b03f2 [VFS/STFS] Update mmap_total_size & total_allocation_units() 2021-05-05 12:35:51 -05:00
emoose
84f566d92b [VFS] STFS/XContent structure improvements
Now makes use of xe::be<T> and removes need for read() method
2021-05-05 12:35:51 -05:00
Gliniak
06ab8589b4 [Kernel/IO] Return error creating dir as non-dir.
[Kernel/IO] Return error when creating directory with non-directory
flag in NtCreateFile.
2020-12-06 17:07:34 -06:00
gibbed
cabd28b9bb [VFS] Fix handling of remove_all return value. 2020-11-24 02:02:49 -06:00
gibbed
bda31a443e [VFS] Avoid exception on remove/remove_all. 2020-11-24 00:23:38 -06:00