Commit graph

7037 commits

Author SHA1 Message Date
zhupengfei
fc251b32b0
service/fs: Update file size on write
The file's size is stored in FileSessionSlot and retrieved when the game calls GetSize. However, it is not updated when the file is written to, which can possibly change the file size. Therefore, this can cause GetSize to return incorrect results.
2020-03-05 14:50:08 +08:00
Pengfei Zhu
7afcc0d658
Merge pull request #5106 from GovanifY/master
gdbstub: Ensure gdbstub doesn't drop packets crucial to initialization
2020-03-03 23:53:28 +08:00
zhupengfei
28014496c6
Fix incorrect port_id use 2020-03-03 12:13:45 +08:00
zhupengfei
eced511382
service/cam: Implement Vsync interrupt callbacks
According to HW tests, this vsync event is signaled for activated cameras at about the same frequency as the frame rate. The last 5 vsync timings are recorded (in microseconds) and can be retrieved with the service function.

Also, corrected the default frame_rate to 15, according to HW test.

This should fix the missing camera images in certain games.
2020-03-01 17:07:43 +08:00
Vitor Kiguchi
c9b6233f59 NetworkMessage: create ErrorManager class to provide a context to tr 2020-02-29 20:48:58 -03:00
Vitor Kiguchi
d7f6cc3951 game_list_p.h: Specify the context for tr 2020-02-29 20:29:36 -03:00
Tobias
6d3d9f7a8a
core: Add support for N3DS memory mappings (#5103)
* core: Add support for N3DS memory mappings

* Address review comments
2020-02-29 19:48:27 +01:00
Marshall Mohror
ab8cb17ab7
Merge pull request #5111 from BreadFish64/interval
video_core: use explicit interval type in texture cache
2020-02-29 11:25:04 -06:00
zhupengfei
0fe832bb49
Make the arrays const 2020-02-29 09:11:34 +08:00
BreadFish64
cfd2ab6121 video_core: use explicit interval type in texture cache
The default is discrete_interval which has dynamic open-ness.
We only use right_open intervals anyway. In theory this could allow some compile-time optimizations.
2020-02-28 13:45:19 -06:00
zhupengfei
9d57325a8b
core/file_sys: Add alternative override pathes for ExeFS files
You can now directly place ExeFS overrides/patches inside the mod folder (instead of the exefs subfolder). This allows us to have drop-in compatibility with Luma3DS mods.
2020-02-28 23:36:17 +08:00
zhupengfei
a50ba7192b
citra_qt: Split options into 'Specific' and 'Generic'
For easier usage. Also made the option list sortable.
2020-02-28 18:26:20 +08:00
zhupengfei
f3e9780d10
ffmpeg: Avoid listing child classes for AVFormatContext and AVCodecContext
As they actually have every encoder/format as their child classes, this will result in a lot of extra options being added.
2020-02-28 16:40:13 +08:00
zhupengfei
a28eac08ae
ffmpeg: Properly handle non-planar formats
For non-planar formats, only the first data plane is used. Therefore,
they need to be handled differently in certain places.
2020-02-27 16:55:20 +08:00
zhupengfei
c9c26955d2
dumping_dialog: Prompt when path is empty 2020-02-27 16:55:19 +08:00
zhupengfei
8868d4db86
citra_qt: Fixed a bug when dumping dialog is cancelled or closed 2020-02-27 16:55:18 +08:00
zhupengfei
c38202bd30
dumping_dialog: Add a line edit for the options
So that users can just paste a set of parameters they found elsewhere.
2020-02-27 16:55:18 +08:00
zhupengfei
0a4be71913
citra_qt: Add simple video dumping error reporting
This is just a simple message that tells the user to refer to the log
2020-02-27 16:55:17 +08:00
zhupengfei
71c64c2617
citra_qt: Use the new dumping dialog
Note that it is only compiled in for FFmpeg video dumper enabled builds
2020-02-27 16:55:16 +08:00
zhupengfei
f82ba41fe0
citra_qt/dumping: Add dumping dialog
This is the main dialog of video dumping. This dialog allows the user to set output format, output path, video/audio encoder and video/audio bitrate.

When a format is selected, the list of video and audio encoders are updated. Only encoders of codecs that can be contained in the format is shown.
2020-02-27 16:55:16 +08:00
zhupengfei
e769d90aa8
citra_qt/dumping: Add options dialog
This is a simple list of name-value pairs of options. Users can double-click on an option to set or modify its value.
2020-02-27 16:55:15 +08:00
zhupengfei
94bc09d3ae
citra_qt/dumping: Add option set dialog
This dialog allows changing the value and unsetting one option. There are three possible variants of this dialog:

1. The LineEdit layout. This is used for normal options like string and duration, and just features a textbox for the user to type in whatever they want to set.

2. The ComboBox layout. This is used when there are named constants for an option, or when the option accepts an enum value like sample_format or pixel_format. A description will be displayed for the currently selected named constant. The user can also select 'custom' and type in their own value.

3. The CheckBox-es layout. This is used for flags options. A checkbox will be displayed for each named constant and the user can tick the flags they want to set.
2020-02-27 16:55:14 +08:00
zhupengfei
8c4bcf9f59
ffmpeg: Add ListFormats and ListEncoders
These two functions allow the frontend to get a list of encoders/formats and their specific options.

Retrieving the options is harder than it sounds due to FFmpeg's strange AVClass and AVOption system. For example, for integer and flags options, 'named constants' can be set. They are of type `AV_OPT_TYPE_CONST` and are categoried according to the `unit` field. An option can recognize all constants of the same `unit`.
2020-02-27 16:55:14 +08:00
zhupengfei
4161163d9c
ffmpeg: Correctly handle sample rates
Previously, we just used the native sample rate for encoding. However, some encoders like libmp3lame doesn't support it. Therefore, we now use a supported sample rate (preferring the native one if possible).

FFmpeg requires audio data to be sent in a sequence of frames, each containing the same specific number of samples. Previously, we buffered input samples in FFmpegBackend. However, as the source and destination sample rates can now be different, we should buffer resampled data instead. swresample have an internal input buffer, so we now just forward all data to it and 'gradually' receive resampled data, at most one frame_size at a time. When there is not enough resampled data to form a frame, we will record the current offset and request for less data on the next call.

Additionally, this commit also fixes a flaw. When an encoder supports variable frame sizes, its frame size is reported to be 0, which breaks our buffering system. Now we treat variable frame size encoders as having a frame size of 160 (the size of a HLE audio frame).
2020-02-27 16:55:13 +08:00
zhupengfei
8b9c01ded9
ffmpeg: Correctly handle sample format
We previously assumed that the first preferred sample format is planar, but that may not be true for all codecs. Instead we should find a supported sample format that is planar.
2020-02-27 16:55:12 +08:00
zhupengfei
17461b5d11
ffmpeg: Correctly set pixel format
While YUV420P is widely used, not all encoders accept it (e.g. Intel QSV only accepts NV12). We should use the codec's preferred pixel format instead as we need to rescale the frame anyway.
2020-02-27 16:55:11 +08:00
zhupengfei
834da14329
citra, citra_qt: Add video dumping config read/write
The default values are VP9/libvorbis just like before. The default configuration is provided for VP9
2020-02-27 16:55:11 +08:00
zhupengfei
016f8be0b8
core/dumping: Allow format/encoder selection+configuration
The ParamPackage got modified so that we can use range-based for on it
2020-02-27 16:55:10 +08:00
zhupengfei
3c6765e87c
core: Properly std::move things around 2020-02-27 16:55:09 +08:00
zhupengfei
06a0d86e9c
video_core, core: Move pixel download to its own thread
This uses the mailbox model to move pixel downloading to its own thread, eliminating Nvidia's warnings and (possibly) making use of GPU copy engine.

To achieve this, we created a new mailbox type that is different from the presentation mailbox in that it never discards a rendered frame.

Also, I tweaked the projection matrix thing so that it can just draw the frame upside down instead of having the CPU flip it.
2020-02-27 16:55:08 +08:00
B3n30
ebeea43fb8 Load RSA slot_0 data from bootrom; load and decrypt data from native firm for NCCHSecure2 keyslot 2020-02-26 16:43:53 +01:00
Pengfei Zhu
5b54a99f96
Merge pull request #5088 from zhaowenlan1779/layered-fs
core/file_sys: LayeredFS support
2020-02-25 07:48:10 +08:00
Gauvain "GovanifY" Roussel-Tarbouriech
8fedd5c240 gdbstub: small logic bug fix with defer_start 2020-02-24 14:30:24 +01:00
Gauvain "GovanifY" Roussel-Tarbouriech
d8bb37fc2f gdbstub: Ensure gdbstub doesn't drop packets crucial to initialization 2020-02-23 21:37:40 +01:00
Pengfei Zhu
1dfcb0937e
Merge pull request #5105 from GovanifY/master
ipc_debugger: Fixing NULL ptr call on multiple clear
2020-02-23 22:31:09 +08:00
liushuyu
cff00f38c5
Implements fdk_aac decoder (#4764)
* audio_core: dsp_hle: implements fdk_aac decoder

* audio_core: dsp_hle: clean up and add comments

* audio_core: dsp_hle: move fdk include to cpp file

* audio_core: dsp_hle: detects broken fdk_aac...

... and refuses to initialize if that's the case

* audio_core: dsp_hle: fdk_aac: address comments...

... and rebase commits

* fdk_decoder: move fdk header to cpp file
2020-02-23 11:01:21 +01:00
zhupengfei
8eacfceb6a
layered_fs: Fix missing file size update
This was a silly typo from a previous change.
2020-02-23 15:22:41 +08:00
Marshall Mohror
3ae1b5e2d6
Merge pull request #5047 from BreadFish64/patch-3
fix c++ standard flag for msvc
2020-02-22 21:18:08 -06:00
Gauvain "GovanifY" Roussel-Tarbouriech
2a616fcc5e ipc_debugger: Fixing NULL ptr call on multiple clear 2020-02-23 03:54:29 +01:00
James Rowe
59c159e8a0
Merge pull request #5087 from FearlessTobi/port-3374
Port yuzu-emu/yuzu#3374: "input_common/udp: Minor changes"
2020-02-22 14:54:45 -07:00
Marshall Mohror
688e44bc8b
videocore/renderer_opengl/gl_rasterizer_cache: Move bits per pixel table out of function (#5101)
* videocore/renderer_opengl/gl_rasterizer_cache: Move bits per pixel table out of function

GCC and MSVC copy the table at runtime with the old implementation, which is wasteful and prevents inlining. Unfortunately, static constexpr variables are not legal in constexpr functions, so the table has to be external.
Also replaced non-standard assert with DEBUG_ASSERT_MSG.

* fix case of table name in assert

* set table to private
2020-02-22 14:37:42 -07:00
James Rowe
276d56ca9b Add CPU Clock Frequency slider
This slider affects the number of cycles that the guest cpu emulation
reports that have passed since the last time slice. This option scales
the result returned by a percentage that the user selects. In some games
underclocking the CPU can give a major speedup. Exposing this as an
option will give users something to toy with for performance, while also
potentially enhancing games that experience lag on the real console
2020-02-21 16:03:07 -07:00
Marshall Mohror
990d27f4f9 Remove C++ standard flag 2020-02-21 16:45:02 -06:00
Ben
55ec7031cc
Core timing 2.0 (#4913)
* Core::Timing: Add multiple timer, one for each core

* revert clang-format; work on tests for CoreTiming

* Kernel:: Add support for multiple cores, asserts in HandleSyncRequest because Thread->status == WaitIPC

* Add some TRACE_LOGs

* fix tests

* make some adjustments to qt-debugger, cheats and gdbstub(probably still broken)

* Make ARM_Interface::id private, rework ARM_Interface ctor

* ReRename TimingManager to Timing for smaler diff

* addressed review comments
2020-02-21 19:31:32 +01:00
Ben
e3dbdcbdff
HTTP_C::Implement Context::MakeRequest (#4754)
* HTTP_C::Implement Context::MakeRequest

* httplib: Add add_client_cert_ASN1 and set_verify

* HTTP_C: Fix request methode strings case in MakeRequest

* HTTP_C: clang-format and cleanups

* HTTP_C: Add comment about async in BeginRequest and BeginRequestAsync

* Update httplib to contain all the changes we need; adapt http_c and web_services to the changes in httplib; addressed minor review comments

* Add android-ifaddrs
2020-02-21 19:04:04 +01:00
Marshall Mohror
996f1546b2
core: Remove outdated MSVC workarounds (#5099)
* core/hw/gpu: Remove outdated MSVC workarounds

* core/hle/service/hid: Remove MSVC workaround
2020-02-20 13:40:21 -06:00
Vitor K
4991c0121a
Remove duplicate code from the migration of frame limit to gene… (#5091) 2020-02-15 14:38:20 +01:00
Tobias
f106e76132
Port yuzu commit: "yuzu/CMakeLists: Disable implicit QString co… (#5074)
* yuzu/CMakeLists: Disable implicit QString conversions

Now that all of our code is compilable with implicit QString
conversions, we can enforce it at compile-time by disabling them.

Co-Authored-By: Mat M. <lioncash@users.noreply.github.com>

* citra_qt: Remove lots of implicit QString conversions

Co-authored-by: Mat M. <mathew1800@gmail.com>
2020-02-11 13:12:09 +01:00
zhupengfei
4273b967b5
core/file_sys: Do not apply the same mods to DLCs
Now you can apply separate mods to DLCs and mods for the original title won't be applied.
2020-02-11 14:03:07 +08:00
FearlessTobi
4c2c27046d Fix compilation 2020-02-10 12:10:42 +01:00
Pengfei Zhu
b53b4bfb17 Merge pull request #5062 from FearlessTobi/port-3173
Port yuzu-emu/yuzu#3173: "common: SPSCQueue: Notify after incrementing queue size."
2020-02-10 12:10:45 +08:00
zhupengfei
b81c9bd738
fix clang format 2020-02-10 07:41:31 +08:00
Lioncash
7362fe48ac input_common/udp: Add missing override specifiers
Prevents trivial warnings and ensures interfaces are properly
maintained between the base class.
2020-02-09 23:00:02 +01:00
Lioncash
575ab92a76 input_common/udp: std::move SocketCallback instances where applicable
std::function is allowed to heap allocate if the size of the captures
associated with each lambda exceed a certain threshold. This prevents
potentially unnecessary reallocations from occurring.
2020-02-09 23:00:02 +01:00
Lioncash
fcdc191107 input_common/udp: std::move shared_ptr within Client constructor
Gets rid of a trivially avoidable atomic reference count increment and
decrement.
2020-02-09 23:00:02 +01:00
Lioncash
8a0f8c3a4f udp/client: Replace deprecated from_string() call with make_address_v4()
Future-proofs code if boost is ever updated.
2020-02-09 23:00:02 +01:00
Lioncash
7d45fdc1df input_common/udp: Silence -Wreorder warning for Socket
Amends the constructor initializer list to specify the order of its
elements in the same order that initialization would occur.
2020-02-09 23:00:01 +01:00
Lioncash
d7a58fe24d input_common/udp: Remove unnecessary inclusions 2020-02-09 23:00:01 +01:00
Lioncash
b39a611a3d input_common/udp: Add missing header guard 2020-02-09 23:00:01 +01:00
zhupengfei
d9ae4c332d
layered_fs: Do not open all replacement files on load
Instead open them when we want to read them. This is because the standard library has a limit on the number of opened files.
2020-02-09 21:48:42 +08:00
zhupengfei
b87bc5d351
citra_qt: Add 'Dump RomFS' menu action
A progress dialog will be displayed. However no progress is reported and the user also cannot cancel it.
2020-02-09 21:01:56 +08:00
zhupengfei
13e2d534e9
core: Add dump RomFS support
This is added to LayeredFS, then the NCCH container and then the loader interface.
2020-02-09 20:59:31 +08:00
James Rowe
03cde53cb6 Merge pull request #5077 from FearlessTobi/port-3339
Port yuzu-emu/yuzu#3339: "GUI: fix minor issues with dark themes + rename and reorder themes"
2020-02-08 12:49:15 -07:00
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