Commit graph

6974 commits

Author SHA1 Message Date
James Rowe
17e9522921
Merge pull request #5069 from vitor-k/min-window2
Update minimum window size based on current layout
2020-02-08 12:46:20 -07:00
zhupengfei
db18f6c79a
Address review
simplify code
2020-02-07 23:53:00 +08:00
zhupengfei
2ec99b83aa
core: Reset archive_manager on shutdown.
This holds the archives which include the SelfNCCH archive which holds the RomFS files. If we don't reset it the LayeredFS class can't get destructed and mods files won't be released.
2020-02-07 23:45:02 +08:00
zhupengfei
6e0afbaa19
Fix build
Explicitly use `std::min<std::size_t>`

Added virtual destructor
2020-02-07 16:26:33 +08:00
zhupengfei
eed9de2336
core/file_sys: Allow exheader replacement to be read from mods path
The previous method (filename.exheader) can still be used.
2020-02-07 15:55:35 +08:00
zhupengfei
53d0c618a0
core/file_sys: Read mods for the original title for updates
Updates can override RomFS and ExeFS, therefore we should apply the mods to them as well.
2020-02-07 15:20:20 +08:00
zhupengfei
7c652a0479
citra_qt: Add 'Open Mods Location' 2020-02-07 15:20:20 +08:00
zhupengfei
91e5a39a08
core/file_sys: Allow exefs mods to be read from mods path
The original path (file_name.exefsdir) is still supported, but alternatively users can choose to put exefs patches in the same place as LayeredFS files (`load/mods/<Title ID>/exefs`).
2020-02-07 15:20:19 +08:00
zhupengfei
8a570bf00c
core: Use LayeredFS while reading RomFS
Only enabled for NCCHs that do not have an override romfs.

LayeredFS files should be put in the `load` directory in User Directory. The directory structure is similar to yuzu's but currently does not allow named mods yet. Replacement files should be put in `load/mods/<Title ID>/romfs` while patches/stubs should be put in `load/mods/<Title ID>/romfs_ext`.
2020-02-07 15:20:18 +08:00
zhupengfei
890405bb7c
core/file_sys: LayeredFS implementation
This implementation is different from Luma3DS's which directly hooks the SDK functions. Instead, we read the RomFS's metadata and figure out the directory and file structure. Then, relocations (i.e. replacements/deletions/patches) are applied. Afterwards, we rebuild the metadata, and assign 'fake' data offsets to the files. When we want to read file data from this rebuilt RomFS, we use binary search to find the last data offset smaller or equal to the given offset and read from that file  (either from the original RomFS, or from replacement files, or from buffered data with patches applied) and any later files when length is not enough.

The code that rebuilds the metadata is pretty complex and uses quite a few variables to keep track of necessary information like metadata offsets. According to my tests, it is able to build RomFS-es identical to the original (but without trailing garbage data) when no relocations are applied.
2020-02-07 15:19:57 +08:00
zhupengfei
83e0cc45f4
core/file_sys: Make RomFSReader an abstract interface
The original RomFSReader is renamed to DirectRomFSReader that directly reads the RomFS.
2020-02-07 15:19:53 +08:00
zhupengfei
05a82b15e6
swkbd: Fix digit filter
The DIGIT filter was incorrectly implemented as preventing all digits. It actually limits the maximum digit count to max_digits, according to ctrulib and hardware testing.
2020-02-04 16:56:30 +08:00
Tobias
eb0364dd5f
citra_qt: config: Move audio to its own tab. (#5079)
- We have some important audio settings, makes them more discoverable.

Co-Authored-By: bunnei <bunneidev@gmail.com>

Co-authored-by: bunnei <bunneidev@gmail.com>
2020-02-01 16:04:48 +01:00
BreadFish64
e7a073e15f logging/backend: Change type of filename from string to const char*
This was suggested by degasus in https://github.com/yuzu-emu/yuzu/pull/3326 in order to avoid an unnecessary copy.
2020-01-28 14:29:26 +01:00
Bartosz Kaszubowski
ff66f723bb GUI: fix minor issues with dark themes
GUI: rename and reorder themes
2020-01-28 14:24:52 +01:00
FearlessTobi
4b7a45ccc7 yuzu/main: Specify string conversions explicitly 2020-01-23 22:45:13 +01:00
James Rowe
5f20bf0e10
Merge pull request #5073 from vitor-k/log-shader-cache-option
Log disk shader cache setting
2020-01-22 21:25:17 -07:00
James Rowe
f3e6c4f841
Merge pull request #5071 from jroweboy/loading-bar
QT Frontend: Add disk shader loading progress bar
2020-01-22 21:24:43 -07:00
Vitor Kiguchi
2035207dde log disk shader cache setting 2020-01-23 00:49:17 -03:00
James Rowe
426e214c25 Loading Screen: Vertically Center everything 2020-01-22 17:26:27 -07:00
James Rowe
961a7b59c9 QT Frontend: Add disk shader loading progress bar
Until we get a on screen display or async shader loading, we should at
least have some measure of progress in the meantime. This is 90% a port
from the loading screen I made for yuzu, but with a slightly different
changed detection for when to display the ETA. Now we keep track of a
rolling estimate for shader load ETA and only display a ETA if its going
to take longer than 10 seconds.
2020-01-22 17:18:00 -07:00
James Rowe
5fb456f17f Frontend: Prevent DiskShader option from being selected if HW Shaders are disabled 2020-01-22 09:50:31 -07:00
James Rowe
bd29261e0a Frontend: Only load disk resources if hw shader is enabled 2020-01-22 09:47:53 -07:00
Vitor Kiguchi
b713fe3329 Address review comments 2020-01-22 12:51:04 -03:00
Vitor Kiguchi
157f82141d Make a separate function for getting minimum size based on layout 2020-01-21 19:31:39 -03:00
James Rowe
5fd1ff08d7
Merge pull request #5024 from jroweboy/temp-hle-audio-fix
Prevent out of memory errors when the game passes in an improper length value
2020-01-21 15:30:20 -07:00
Vitor Kiguchi
0dcb886ef2 clang format 2020-01-21 14:24:16 -03:00
Vitor Kiguchi
718f04af6d Correctly treat cases when current size is smaller than the minimum defined by the layout 2020-01-21 13:32:51 -03:00
Vitor Kiguchi
5d0353c391 correct ProcessConfigurationChanges 2020-01-20 23:00:33 -03:00
Vitor Kiguchi
6e1a873e57 use the defined constants instead of magic numbers for screen dimensions 2020-01-20 23:00:33 -03:00
Vitor Kiguchi
64737afdbc Change min_client_area_size based on layout 2020-01-20 23:00:21 -03:00
James Rowe
a0f9c795c8
Merge pull request #5043 from vitor-k/screen-rotate
Implement Upright/Book-style layout
2020-01-20 18:38:06 -07:00
Vitor Kiguchi
c2179a1dd0 log the upright screen setting 2020-01-20 22:32:16 -03:00
Vitor Kiguchi
5eb9a5b3bc Set hotkey for screen rotation 2020-01-20 22:32:15 -03:00
Vitor Kiguchi
be88d2a59a implement upright orientation for side and large frame layouts 2020-01-20 22:32:15 -03:00
vitor-k
89cab445d4 Implementation of screen rotation without use of additional layouts.
This is based on what was done using additional layouts, but modified
to have a variable to control rotation and making it so Single Screen
Layout behaves like Upright Single would, and Default Layout behaves
like Upright Double would, when the new variable is used.

Large Layout and Side Layout currently ignore the new variable.
New variable still currently doesn't have a hotkey.
2020-01-20 22:31:51 -03:00
bunnei
591c6a64d7 common: SPSCQueue: Notify after incrementing queue size. 2020-01-19 13:35:49 +01:00
TotalCaesar659
df6cf6bbb6 Add headbar icon on Linux 2020-01-19 13:29:53 +01:00
James Rowe
e4285097f4
Merge pull request #5021 from ccawley2011/cpu_detect
common/cpu_detect: Remove unused functionality
2020-01-17 20:30:29 -07:00
James Rowe
e74a402c69
Merge pull request #4923 from jroweboy/diskcachelul
Disk Shader Caching
2020-01-17 18:15:50 -07:00
iwubcode
43f8aadd52 renderer_opengl: Allow usage of interlaced 3D 2020-01-16 22:12:50 -06:00
iwubcode
6f269c375f citra, citra_qt, settings.h, default_ini.h: Add option for interlaced 3D 2020-01-16 22:12:50 -06:00
James Rowe
e95bc52b3d Only check for sanitize_mul if theres a shader in the cache 2020-01-16 08:35:52 -07:00
James Rowe
43c9695bf9 Fix title bar 2020-01-15 23:52:41 -07:00
James Rowe
cf4125a6a5 Only load precompiled shaders if their sanitize_mul setting matches 2020-01-15 21:10:37 -07:00
James Rowe
6945b6539f Address review and update zstd 2020-01-15 19:58:34 -07:00
James Rowe
936094dd27 Log the number of entries in each cache 2020-01-15 19:58:34 -07:00
James Rowe
45bc5b465e Add a error log for unsupported configurations for disk cache 2020-01-15 19:58:34 -07:00
James Rowe
2d86bc6db5 Rename InvalidateTransferable to InvalidateAll to match what it does 2020-01-15 19:58:34 -07:00
James Rowe
7092ba8480 Only add shaders to precompiled cache if they are new 2020-01-15 19:58:34 -07:00
James Rowe
061a33477f Properly bind the shader sampler and uniform bindings 2020-01-15 19:58:34 -07:00
James Rowe
a20c81d593 Change VFS vector to regular vector 2020-01-15 19:58:34 -07:00
James Rowe
6f2756089d citra-sdl: Add Load Disk Resources 2020-01-15 19:58:34 -07:00
James Rowe
d418f0438d citra-qt: Load Disk Resources 2020-01-15 19:58:34 -07:00
James Rowe
d03d201482 Add GetRenderer to core 2020-01-15 19:58:34 -07:00
James Rowe
be52d3a7d0 Add missing changes from yuzu file_util 2020-01-15 19:58:34 -07:00
James Rowe
4e9ec4efd0 Add shader disk caching 2020-01-15 19:58:33 -07:00
James Rowe
ce3f8bf94e Add frontend settings 2020-01-15 19:58:33 -07:00
James Rowe
b5b6ce5fdc Add shader cache version generation 2020-01-15 19:58:33 -07:00
James Rowe
b5bc05738c Add settings for disk shader cache 2020-01-15 19:58:33 -07:00
James Rowe
8f67d6a444 Add ZSTD compression for precompiled cache 2020-01-15 19:58:33 -07:00
James Rowe
cd86c9b043
Merge pull request #5036 from leoetlino/bps
file_sys: Add support for BPS patching
2020-01-15 12:04:54 -07:00
James Rowe
45bff6ab58
Merge pull request #5033 from BreadFish64/fix_game_list
qt: do not use an invalid update smdh
2020-01-15 11:51:35 -07:00
James Rowe
01686f78fe
Merge pull request #5037 from leoetlino/thin-archives
CMake: Create thin archives on Linux
2020-01-01 14:29:43 -05:00
BreadFish64
b3beff0f4c common/logging: don't use regex for path trimming 2019-12-24 14:19:18 -06:00
Léo Lam
756d231ff9 file_sys: Add support for BPS patches
The BPS format allows distributing patches that are smaller and that do
not contain copyrighted content if data is relocated
(unlike non-trivial IPS patches).

This is essential for games such as MM3D that have three barely
different code revisions. Supporting all three versions would
demand an unreasonable amount of work; with BPS patches only one
version has to be supported.
2019-12-22 10:46:47 +01:00
Léo Lam
3140086c60 file_sys: Handle patch applying failures
This changes ApplyCodePatch to return a ResultStatus, which makes it
possible to determine whether patch applying has failed. Previously,
only a boolean was returned, and false was returned when no patch
was found OR when a patch was found but applying it failed.

This also changes AppLoader_NCCH to return an error if patching fails
because the executable is likely to be left in an inconsistent state
and we should not proceed booting in that case.
2019-12-22 10:46:47 +01:00
Léo Lam
1377be9902 file_sys: Move IPS patching code into separate source file
In anticipation of a new BPS patcher.
2019-12-22 10:46:47 +01:00
Léo Lam
72a081c617 CMake: Create thin archives on Linux
This significantly reduces unnecessary disk writes and space usage
when building Citra.

libcore.a is now only ~1MB rather than several hundred megabytes.
2019-12-22 10:12:00 +01:00
BreadFish64
cadfd6834d qt: do not use an invalid update smdh 2019-12-18 21:51:06 -06:00
James Rowe
020cd56ad8
Merge pull request #5030 from jroweboy/reorder-queue-acquire
Remove wait for free buffer
2019-12-18 16:07:52 -07:00
James Rowe
dd258acfaf
Merge pull request #5027 from jroweboy/ffmpeg-fix
Reenable AAC FFMPEG decoding
2019-12-17 08:49:35 -07:00
James Rowe
f9421eedcc
Merge pull request #5028 from jroweboy/missing-vsync-telemetry
Add missing vsync telemetry field
2019-12-17 08:49:08 -07:00
James Rowe
1d14b98f81 Remove accidentally pushed debugging logs (#5029) 2019-12-17 11:13:47 +01:00
James Rowe
f369196c9f Remove wait for free buffer
Previously we would first attempt to use any buffer that was free,
meaning whichever buffer has already been displayed. This has poor
interactions when the operating system throttles the update rate of the
window, so if there isn't any free buffers available, just reuse the
oldest frame instead.
2019-12-16 20:02:01 -07:00
James Rowe
b559d1a495 Add missing vsync telemetry field
Was removed as part of #4940 but readded again.
2019-12-16 19:30:28 -07:00
James Rowe
e53a2ac411 Reenable AAC FFMPEG decoding
Simple cut/paste issue where initialized is only set to true when the
emulation attempts to init the Binary Pipe, but we used it to test if
the FFMPEG decoder was valid and disabled it if it wasn't. Just return
the value of have_ffmpeg_dl instead so when dynamic loading is added
it'll still work.
2019-12-16 19:23:43 -07:00
James Rowe
439d550850
Merge pull request #4940 from jroweboy/presentation-thread
Split Presentation thread from Render thread
2019-12-15 20:25:34 -07:00
James Rowe
408e225048 Destroy GLWindow on exit to prevent issues closing the app while in fullscreen 2019-12-15 16:20:59 -07:00
James Rowe
36c5058d66 Reintroduce a vsync option for people with really bad drivers 2019-12-15 15:42:05 -07:00
James Rowe
87facaa2e2 Prevent out of memory errors when the game passes in an improper length value
HACK

In Luigi's Mansion Dark Moon in HLE audio, the game mysteriously passes
in an extremely large value for length, which without any checks, causes
HLE audio to allocate an extremely large buffer.

This value seemingly is caused by some other HLE audio feature is missing,
and Luigi's Mansion subtracts two values to get a length, without
checking for overflow first. This appears to be caused by an incorrect
HLE audio emulation, as its fixed entirely by only changing to LLE. As
such, further investigation is required, but in the meantime, completely
eating up our users RAM is unacceptable.
2019-12-14 18:18:59 -07:00
James Rowe
ddb7ead3e4
Merge pull request #5020 from jroweboy/dynamic-mf
Runtime Load MediaFoundation dlls on Windows
2019-12-14 10:13:54 -07:00
James Rowe
30dfe1fcb8 Use the correct register length for index_array
The index_array can't possible be 31 bits long as that would index
out of bounds memory. According to 3dbrew, this should be 28
2019-12-13 18:08:07 -07:00
Cameron Cawley
9a45d32a5f common/cpu_detect: Remove Common::CPUVendor
It's only used by telemetry, where the information it provides can be gained from the brand string.
2019-12-09 22:39:56 +00:00
Cameron Cawley
bc5ad137c0 common/cpu_detect: Remove unused functionality 2019-12-09 22:36:32 +00:00
James Rowe
337ac73915 Improve aac decoder selection 2019-12-08 16:18:39 -07:00
James Rowe
b395efe804 Dynamically load Media Foundation 2019-12-08 13:54:27 -07:00
James Rowe
65613cce81 Add microprofile scopes for presentation 2019-12-02 18:59:12 -07:00
James Rowe
9ae3eb4a30 Remove high dpi scaling flag as it needs more work first 2019-12-02 18:34:11 -07:00
zhupengfei
17ba846a3f
applets/swkbd: Remove text memory clearing
The text shared memory wasn't supposed to be cleared according to my comparison with the LLE swkbd. This can cause issues in certain games such as Harvest Moon.

A null terminator is added to the text copied to mark the end of the string.
2019-12-01 23:01:07 +08:00
James Rowe
866df2644b
Merge pull request #4982 from vvanelslande/mic-device
service/mic: actually use the specified device
2019-11-28 21:23:36 -07:00
James Rowe
de17fe31fb clang-format 2019-11-28 20:47:33 -07:00
James Rowe
ea40eb0994 Use the proper parent window
Fixes an issue where the touch point is incorrect in OpenGLWindow when the render
target is initialized for the first time with single window mode disabled.
2019-11-28 20:35:50 -07:00
James Rowe
123c0212ef Fix window resizing bug 2019-11-28 11:20:42 -07:00
James Rowe
782eae7f65 Fix drag and drop 2019-11-28 10:56:58 -07:00
James Rowe
15ed600c91
Merge pull request #4956 from vitor-k/game-sorting
Fixes to game list sorting
2019-11-20 09:48:08 -07:00
James Rowe
e6c7f84dc6
Merge pull request #4964 from citra-emu/wwylele-patch-1
unfold UNREACHABLE implementation for dumb compilers
2019-11-20 09:43:48 -07:00
Weiyi Wang
6d0189b4b1
Merge pull request #4992 from FearlessTobi/port-2513
yuzu/game_list&multiplayer: Specify string conversions explicitly
2019-11-20 10:45:21 -05:00
Weiyi Wang
85f2e577b5
Merge pull request #5006 from FearlessTobi/port-3123
Port yuzu-emu/yuzu#3123: "common/logging: Silence no return value warnings"
2019-11-20 10:34:47 -05:00
James Rowe
0acacc4e1a
Merge pull request #5002 from vvanelslande/username-fix
Fix moderation by room host in dedicated rooms
2019-11-19 23:51:21 -07:00