Commit graph

4194 commits

Author SHA1 Message Date
Hamish Milne 7988978661 Fix VFP registers serialization (0 fps when loading etc.) 2020-04-10 19:36:38 +01:00
Hamish Milne 3278a4d7ef Fix crashes when loading with cameras active 2020-04-10 14:02:18 +01:00
MerryMage 8b7b6e9f74 arm_dynarmic: Remove dependence on interpreter 2020-04-07 19:07:59 +01:00
Hamish Milne e74b44042b Added save + load hotkeys 2020-04-06 23:05:55 +01:00
MerryMage d17ab5cd91 gdbstub: Fix some gdbstub jankiness
1. Ensure that register information available to gdbstub is most up-to-date.
2. There's no reason to check for current_thread == thread when emitting a trap.
   Doing this results in random hangs whenever a step happens upon a thread switch.
2020-04-06 21:24:54 +01:00
Hamish Milne 7ff985cef9 Fixed TAS movie serialization 2020-04-06 21:23:39 +01:00
Hamish Milne ac37de10fc Reconnect cheat_engine during load 2020-04-06 20:26:41 +01:00
MerryMage e04590a06d externals: Update dynarmic to b58048a 2020-04-06 17:31:30 +01:00
Hamish Milne b5f394dd12 Use placeholders for serialized paths 2020-04-05 00:20:59 +01:00
Marshall Mohror 9c7da35382
Merge pull request #5083 from zhaowenlan1779/video-dumping-update
video_core, citra_qt: Video dumping updates
2020-04-03 21:15:32 -05:00
Marshall Mohror 00667c222a
Merge pull request #5117 from FearlessTobi/n3ds-setting
citra_qt/system: Add N3DS mode checkbox and enable it by default
2020-04-03 17:52:31 -05:00
Marshall Mohror f14e973a27
Texture Filtering v2 (#5166)
* video_core/renderer_opengl: Move SurfaceParams into its own file

Some of its enums are needed outside of the rasterizer cache
and trying to use it caused circular dependencies.

* video_core/renderer_opengl: Overhaul the texture filter framework

This should make it less intrusive.
Now texture filtering doesn't have any mutable global state.
The texture filters now always upscale to the internal rendering resolution.
This simplifies the logic in UploadGLTexture and it simply takes the role of BlitTextures at the end of the function.
This also prevent extra blitting required when uploading to a framebuffer surface with a mismatched size.

* video_core/renderer_opengl: Use generated mipmaps for filtered textures

The filtered guest mipmaps often looked terrible.

* core/settings: Remove texture filter factor

* sdl/config: Remove texture filter factor

* qt/config: Remove texture filter factor
2020-04-02 22:42:50 -05:00
Hamish Milne 74c06bd13e Attempt to fix crashes with LLE applets 2020-04-02 01:43:27 +01:00
Hamish Milne d4ccce1365 Add some member initializers in thread 2020-04-02 00:14:00 +01:00
Hamish Milne 714a85119d Don't crash when getting perf stats 2020-04-01 22:50:19 +01:00
Hamish Milne 5b6ee9a6ab Clear out state before deserialization - fixes many crashes. 2020-04-01 22:06:22 +01:00
Hamish Milne f156fdd332 clang format fixes etc. 2020-03-31 18:27:33 +01:00
Hamish Milne 92640fc29c Code review actions (plus hopefully fix the linux CI) 2020-03-31 17:54:28 +01:00
Hamish Milne 9bd189a155 More cleaning up 2020-03-29 19:07:56 +01:00
Hamish Milne 6760ea18b6 Serialize ArchiveManager and other code review actions 2020-03-29 18:56:25 +01:00
Hamish Milne 04aa351c40 Code review - general gardening 2020-03-29 16:14:36 +01:00
Hamish Milne 8f059ae398
Apply suggestions from code review
Co-Authored-By: Mat M. <mathew1800@gmail.com>
2020-03-29 11:39:46 +01:00
B3n30 ab76b0b684 addressed review comments 2020-03-28 22:47:11 +01:00
Hamish Milne 841255cd16 Attempt to fix the linux builds 2020-03-28 21:40:18 +00:00
Hamish Milne de9ae14059 Only serialize wchar paths on windows 2020-03-28 19:29:29 +00:00
Hamish Milne 8f164a16ce Review changes 2020-03-28 17:08:27 +00:00
Hamish Milne d92b3e9754 Code review changes - clarified HTTP serialization 2020-03-28 16:29:15 +00:00
FearlessTobi b4ac1c0559 citra_qt/system: Add N3DS mode checkbox and enable it by default 2020-03-28 16:49:35 +01:00
Hamish Milne 4aab38f133 Refactored out the horrible static var in CoreTiming 2020-03-28 15:47:36 +00:00
Hamish Milne 917d651a3c Added copyright notices on new files 2020-03-28 15:21:10 +00:00
Hamish Milne 025960bcdd Attempt to fix flatpak CI 2020-03-28 15:10:35 +00:00
Hamish Milne 03379b2072 Merge remote-tracking branch 'upstream/master' into feature/savestates-2 2020-03-28 12:46:24 +00:00
Hamish Milne 7049af744f Merge remote-tracking branch 'upstream/master' into feature/savestates-2 2020-03-28 12:33:21 +00:00
Hamish Milne 1ff8d002a9
Merge pull request #5025 from jroweboy/tomoscrewme
Add CPU Clock Frequency slider
2020-03-28 12:31:41 +00:00
Pengfei Zhu 3edc4a3055
service/ldr_ro: Fix CRO loading when the buffer contained multiple VM areas (#5125)
* vm_manager: Handle multiple areas in ChangeMemoryState

It is possible that a few areas have the same permisson and state, but with different backing pointers. Currently, this function assumes that only one continous area is found, but this is not always the case.

* service/ldr_ro: Handle multiple areas in VerifyBufferState

It is possible that the buffer passed from the game is made up of multiple areas with the same permisson and state but different backing pointers. Change the check to allow that.
2020-03-28 13:26:54 +01:00
Hamish Milne 232b52a27d Minor cleanup 2020-03-28 09:59:45 +00:00
Hamish Milne 3d1180ee21 DSP now works... committing this!! 2020-03-27 22:19:29 +00:00
Hamish Milne 5604613642 More merge fixes 2020-03-27 21:48:58 +00:00
Pengfei Zhu 25ebf03c35
Merge pull request #5120 from zhaowenlan1779/file-write
service/fs: Update file size on write
2020-03-22 01:00:31 +08:00
zhupengfei 22bfa7b5de
ffmpeg: Misc fixes
The most important one being adding a mutex to protect the format_context. Apparently it wasn't thread safe (as one'd expect) but I didn't think about that.

Should fix some of the strange issues happening with MP4 muxers, etc.
2020-03-21 12:02:21 +08:00
B3n30 ed51f06097 fix path usage in InstallCia 2020-03-17 13:40:58 +01:00
Ben 590099a17a
CFG: Let GetSystemModel report model based on Settings:is_new_3ds (#5104)
* CFG: Let GetSystemModel report model based on  Settings:is_new_3ds

* Always write ol3ds console model to cfg savegame
2020-03-16 20:05:06 +01:00
Marshall Mohror a7d3489dc9
video_core: add texture filtering (#5017)
video_core: add texture filtering
2020-03-16 09:42:05 -05:00
B3n30 eaaa76b922 Adressed review comments 2020-03-15 21:51:44 +01:00
B3n30 a4457d871c Log if common key during Ticket::Load is missing 2020-03-15 21:10:26 +01:00
B3n30 1d92343344 fix more review comments 2020-03-15 19:00:26 +01:00
B3n30 2465fd423a fix review comments 2020-03-15 18:57:29 +01:00
B3n30 391580c658 fix clang-format 2020-03-15 18:50:52 +01:00
B3n30 ae4ba287d5 warn if cia contend is encrypted 2020-03-15 18:23:19 +01:00
Pengfei Zhu ad3c464e2d
Merge pull request #5116 from zhaowenlan1779/cam-vsync
service/cam: Implement Vsync interrupt events
2020-03-12 10:42:39 +08:00
Hamish Milne da3ab3d56e Merge branch 'master' into feature/savestates-2 2020-03-07 21:23:08 +00:00
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
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
zhupengfei 0fe832bb49
Make the arrays const 2020-02-29 09:11:34 +08: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 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 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
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
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
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
zhupengfei a487016cb4
core, citra_qt: Implement a save states file format and slot UI
10 slots are offered along with 'Save to Oldest Slot' and 'Load from Newest Slot'.

The savestate format is similar to the movie file format. It is called CST (Citra SavesTate), and is basically a 0x100 byte header (consisting of magic, revision, creation time and title ID) followed by Zstd compressed raw savestate data.

The savestate files are saved to the `states` folder in Citra's user folder. The files are named like `<Title ID>.<Slot ID>.cst`.
2020-02-18 13:19:52 +08:00
zhupengfei 7d880f94db
Add simple zstd compression
Just a simple default compression is able to shrink savestate file size from ~160MB to ~20MB.
2020-02-16 23:25:30 +08:00
zhupengfei 57efc41973
service/cecd: Add missing SessionData serialization 2020-02-14 17:15:08 +08:00
zhupengfei 7e8041df28
kernel/timer: Add missing base object 2020-02-14 17:13:53 +08:00
Hamish Milne 246ae84a52 Pretty sure ARM/Thread serialization works now 2020-02-13 17:42:12 +08:00
Hamish Milne c983528862 Reworked DSP serialization 2020-02-13 17:42:12 +08:00
James Rowe 55c75b5e3e Add ClearAll to rasterizer cache for fully wiping the cache on save/load 2020-02-13 17:42:11 +08:00
James Rowe 3e34ad6890 Hack: Workaround crash when loading state and gyro is used 2020-02-13 17:42:11 +08:00
Hamish Milne 0effb229cd Fix geometry pipeline; attempt to fix motion controls 2020-02-13 17:42:10 +08:00
Hamish Milne 35c3ca995c Fixed a bug (??) in arm_dynarmic where PageTableChanged could reset the CPU context 2020-02-13 17:42:10 +08:00
Hamish Milne b2370ea353 Fixed setting the right DSP service on deserialization 2020-02-13 17:42:10 +08:00
Hamish Milne 2217b3558d Fixed file services serialization 2020-02-13 17:42:10 +08:00
Hamish Milne c24ea0f0ee Serialize core timing 2020-02-13 17:42:09 +08:00
Hamish Milne 8abc5525be Added Signals; more runtime fixes 2020-02-13 17:42:09 +08:00
Hamish Milne e4f05884c3 Fixed serialization runtime exceptions 2020-02-13 17:42:08 +08:00
Hamish Milne ca971ff31f Serialize file/directory services 2020-02-13 17:42:08 +08:00
Hamish Milne 9525d81344 More base-derived fixes 2020-02-13 17:42:07 +08:00
Hamish Milne 996aba39fe Correct exports; add some file serialization; fix service base object serialization 2020-02-13 17:42:07 +08:00
Hamish Milne f2de70c3fb Fix crash bugs 2020-02-13 17:42:06 +08:00
Hamish Milne 116d22d562 Refactor out the wakeup_callback function pointer 2020-02-13 17:42:05 +08:00
Hamish Milne 7019561fd5 Bind NWM_UDS service in the constructor 2020-02-13 17:42:05 +08:00
Hamish Milne 96432589bd Use shared_ptr for PageTable 2020-02-13 17:42:04 +08:00
Hamish Milne e4afa8e512 Make the tests pass 2020-02-13 17:42:04 +08:00
Hamish Milne 65d96bf6c1 Changed u8* to MemoryRef 2020-02-13 17:42:00 +08:00
Hamish Milne cf985631e0 Minor tidying up 2020-02-13 17:41:27 +08:00
Hamish Milne 26e90a99cd Added basic UI; misc memory fixes 2020-02-13 17:41:27 +08:00
Hamish Milne 558e710e17 Finished archives; remove pod.h 2020-02-13 17:41:26 +08:00
Hamish Milne 2bf5b46460 Basic archive backend serialization 2020-02-13 17:41:26 +08:00
Hamish Milne 2d2c7218ef Serialize CECD, CFG services 2020-02-13 17:41:25 +08:00
Hamish Milne ef2e503281 Serialize QTM, Y2R services 2020-02-13 17:41:24 +08:00
Hamish Milne 92857efca4 Serialize PTM service 2020-02-13 17:41:24 +08:00
Hamish Milne f5e2f873b0 Serialize NWM service 2020-02-13 17:41:24 +08:00
Hamish Milne 571b1062f0 Serialize NIM, PS, PXI, SOC, SSL services 2020-02-13 17:41:23 +08:00
Hamish Milne 2409ee39cb Serialize IR, MVD, NDM, NEWS, NFC 2020-02-13 17:41:23 +08:00
Hamish Milne 3d6e372f96 More clang format fixes. Really need to standardise the version of this 2020-02-13 17:41:23 +08:00
Hamish Milne 01ec2e8a67 Serialize MIC service 2020-02-13 17:41:22 +08:00
Hamish Milne e3c0211b74 Fix clang format 2020-02-13 17:41:22 +08:00
Hamish Milne eb67167b7c Serialize IR service 2020-02-13 17:41:22 +08:00
Hamish Milne 8bd3e8cd27 Serialize HTTP service 2020-02-13 17:41:22 +08:00
Hamish Milne 74361fa3fb Serialize HID service 2020-02-13 17:41:21 +08:00
Hamish Milne 30494c06a4 Serialize GSP service 2020-02-13 17:41:21 +08:00
Hamish Milne 9877bf7d48 Change how the boost target works; disable external warnings in MSVC 2020-02-13 17:41:20 +08:00
Hamish Milne d041901a30 Some more CI fixes 2020-02-13 17:41:20 +08:00
Hamish Milne c7106e232f Fix a bug on mingw 2020-02-13 17:41:16 +08:00
Hamish Milne d6862c2fca Some CI fixes 2020-02-13 17:40:52 +08:00
Hamish Milne 7b846ffa98 clang-format fixes 2020-02-13 17:39:15 +08:00
Hamish Milne d482fb359c Attempting to fix mingw on windows 2020-02-13 17:38:25 +08:00
Hamish Milne 6917eaf53b Use load_construct_data for kernel objects 2020-02-13 17:38:25 +08:00
Hamish Milne 3ed8d95866 Serialize FS service; some compiler fixes 2020-02-13 17:38:24 +08:00
Hamish Milne d1096de245 Added FRD service serialization 2020-02-13 17:38:24 +08:00
Hamish Milne 4354179156 Added ERR service serialization 2020-02-13 17:38:23 +08:00
Hamish Milne 452ae2e371 Added DSP service serialization 2020-02-13 17:38:23 +08:00
Hamish Milne 30fe2bfe38 Added DLP service serialization 2020-02-13 17:38:23 +08:00
Hamish Milne a0c3b91785 Added CSND serialization 2020-02-13 17:38:23 +08:00
Hamish Milne 17b9cbefef CAM service serialization 2020-02-13 17:38:22 +08:00
Hamish Milne 1185d62792 BOSS service serialization 2020-02-13 17:38:22 +08:00
Hamish Milne 5265c79056 APT service serialization 2020-02-13 17:38:21 +08:00
Hamish Milne 3e752002c4 Replace g_kernel with Core::Global etc. 2020-02-13 17:38:21 +08:00
Hamish Milne e707685c2a Serialize AM services 2020-02-13 17:38:20 +08:00
Hamish Milne 89e4e49a63 Finished AC and ACT service serialization 2020-02-13 17:38:20 +08:00
Hamish Milne 3fd5c431f1 Service serialization framework; done AC 2020-02-13 17:38:20 +08:00
Hamish Milne ac0337d8df Started IPC services serialization 2020-02-13 17:38:19 +08:00
Hamish Milne 7a5bde0b44 Serialize service manager, server prt 2020-02-13 17:38:19 +08:00
Hamish Milne 4f95575d41 Serialize some more kernel objects 2020-02-13 17:38:18 +08:00
Hamish Milne 8c81500dee Serialize kernel/hle/memory 2020-02-13 17:38:18 +08:00
Hamish Milne c284192a87 Serialize geometry_pipeline 2020-02-13 17:38:17 +08:00
Hamish Milne f557d26b40 Added CPU, mutex, process, thread, timer 2020-02-13 17:38:16 +08:00
Hamish Milne 06891d9454 Added client/server objects 2020-02-13 17:38:16 +08:00
Hamish Milne 5035e68dad Added derived kernel objects 2020-02-13 17:38:15 +08:00
Hamish Milne f79c9668a3 Added shader state; WIP kernel objects 2020-02-13 17:38:10 +08:00
Hamish Milne 6f00976ab5 video_core serialization 2020-02-13 17:34:16 +08:00
Hamish Milne ee2cae2093 Added core serialization 2020-02-13 17:34:13 +08:00
Hamish Milne dc04774ece Added POD serialization 2020-02-13 17:27:51 +08:00
Hamish Milne 6940c99ed6 Added boost serialization 2020-02-13 17:27:50 +08: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
zhupengfei b81c9bd738
fix clang format 2020-02-10 07:41:31 +08: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 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 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 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
Vitor Kiguchi 2035207dde log disk shader cache setting 2020-01-23 00:49:17 -03: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
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 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
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 6f269c375f citra, citra_qt, settings.h, default_ini.h: Add option for interlaced 3D 2020-01-16 22:12:50 -06:00
James Rowe 45bc5b465e Add a error log for unsupported configurations for disk cache 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 b5bc05738c Add settings for disk shader cache 2020-01-15 19:58:33 -07: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
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 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 36c5058d66 Reintroduce a vsync option for people with really bad drivers 2019-12-15 15:42:05 -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
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
vvanelslande e1e136d72f service/mic: actually use the specified device 2019-11-11 17:15:10 -05:00
vvanelslande 1f708e8bad settings, configure_input: fix rename input profile 2019-11-09 16:55:03 -05:00
James Rowe 586b8e8b46 Change from QOpenGLWidget to QWindow
While QOpenGLWidget sounds like a good idea, it has issues which are
harder to debug due to how Qt manages the context behind the scenes. We
could probably work around any of these issues over time, but its
probably easier to do it ourselves with a QWindow directly.

Plus using QWindow + createWindowContainer is the easiest to use
configuration for Qt + Vulkan so this is probably much better in the
long run.
2019-11-09 13:12:30 -07:00
James Rowe 9c32c0b98b Change from render to texture to render to renderbuffer 2019-11-09 13:12:29 -07:00
James Rowe 52d7676831 recreate mailbox to use a queue instead 2019-11-09 13:12:29 -07:00
James Rowe 6fff8e3921 Remove screen change detection since it breaks make changing screen. (Still need to test windows) 2019-11-09 13:12:29 -07:00
James Rowe 8d17aa40fd Remove vsync setting 2019-11-09 13:12:26 -07:00
James Rowe c2e7903825 Split graphics out of EmuWindow in preparation of shared contexts 2019-11-09 13:10:17 -07:00
James Rowe db7a627a2e Add scope acquire context to simplify MakeCurrent and DoneCurrent calls 2019-11-09 13:10:17 -07:00
Khangaroo df99d98240 specify size of buffer and use openglstate in getteximageoes 2019-11-09 12:58:17 -07:00
Khangaroo 5450d4980d crash hotfix (no clang-format because on phone)
hotfix 2: check if the texture is custom before dumping

hotfix 4: fix custom texture conflict detection
2019-11-09 12:56:28 -07:00
Khangaroo ae4aaf2fc1 nested folder support + refuse to load incompatibly sized textures + general cleanups 2019-11-09 12:56:27 -07:00
Khangaroo 8a98310a16 address more comments, fix dumping textures that already got dumped 2019-11-09 12:56:27 -07:00
Khangaroo c2a32e942b address more comments 2019-11-09 12:56:27 -07:00
Khangaroo f09489475a fix texture dumping on opengl es, create load folder if none exists if custom textures is enabled 2019-11-09 12:56:27 -07:00
Khangaroo 8b881ac1fc fix preload textures being enabled when it shouldn't
address more comments
2019-11-09 12:56:25 -07:00
Khangaroo 391e552927 qimageinterface fixes, remove old lodepng, address more comments 2019-11-09 12:56:24 -07:00
Khangaroo b81c15941e add image interface, remove lodepng from video_core/core, address more comments, fix comments
remove unnecessary conversion
2019-11-09 12:56:21 -07:00
Khangaroo 5940361b81 new-line that clang-format didn't fix
address some comments
2019-11-09 12:56:17 -07:00
Khangaroo 59b475a4b9 implement custom texture preload 2019-11-09 12:56:17 -07:00
Khangaroo 6d90c42a79 fix crashes, add custom texture cache, load textures from load directory 2019-11-09 12:54:40 -07:00
khang06 e0d63bd21b add texture dumping as a config entry 2019-11-09 12:53:12 -07:00
FearlessTobi 0a3f75c25f Backport changes from yuzu-emu/yuzu#2806 2019-09-22 17:40:04 +02:00
James Rowe 223bfc9a2a
Merge pull request #4847 from zhaowenlan1779/ipc-debugger
core, citra_qt: IPC Recorder
2019-09-21 00:04:07 -06:00
Weiyi Wang 176b8b4a0b
Merge pull request #4917 from vitor-k/long-title
Allow displaying the long_title of the game
2019-09-20 12:59:04 -04:00
James Rowe c1d3b5e61c
Merge pull request #4934 from vitor-k/boost_remnant
Remove boost headers not currently used
2019-09-18 10:57:37 -06:00
James Rowe 4b05078def
Merge pull request #4922 from Steveice10/master
Filter non-executable files out of the game list.
2019-09-16 23:51:44 -06:00
vitor-k 147a7f0dec Remove boost headers not currently used 2019-09-15 15:18:38 -03:00
vitor-k bb12af1da7 Remove unused boost header 2019-09-15 14:00:55 -03:00
Pengfei Zhu 360e6cb513
Merge pull request #4900 from leoetlino/exheader-fix
ncch_container: Fix NCCH decryption heuristic when replacing exheader
2019-09-14 10:33:06 -05:00
James Rowe 7bfd829c77
Merge pull request #4893 from wwylele/nfc-state
NFC: extract frontend-facing tag state
2019-09-13 08:59:51 -06:00
vitor-k f9cded05fd Allow displaying of the full title in the interface, as well as use the full title in the search filter 2019-09-09 23:36:21 -03:00
James Rowe d6f2bc8c04
Merge pull request #4896 from zhaowenlan1779/game-list-fix-3
citra_qt: Misc game list updates/fixes
2019-09-09 20:04:04 -06:00
Steveice10 5cf684c951 Filter non-executable files out of the game list. 2019-09-08 14:19:11 -07:00
Weiyi Wang 24ec11f928
Merge pull request #4915 from FearlessTobi/port-2818
Port citra-emu/citra#2818: "externals: update fmt to 6.0.0"
2019-09-08 08:42:02 -04:00
Pengfei Zhu 4bc22aa350
Merge pull request #4918 from vitor-k/warnings
Silence warnings from unused code and mismatched declaration
2019-09-06 22:08:06 +08:00
Ethan 56091241ff externals: update fmt to 6.0.0 2019-09-05 02:39:13 +02:00
Weiyi Wang 42d3d563b9
Merge pull request #4897 from zhaowenlan1779/warning-core-timing
core_timing: Silence sign comparison warnings
2019-09-03 16:06:27 -04:00
vitor-k 6e3652d15b Struct vs class declaration and unused variable 2019-09-02 22:45:38 -03:00
Valentin Vanelslande 2959b002cd applet_manager: remove the "we are going to disable loading LLE applets before further fixes are done" comments
LLE Applets are enabled again in #4500, but @wwylele didn't remove these comments.
2019-08-29 20:41:16 -05:00
Léo Lam 7318913f5a ncch_container: Fix NCCH decryption heuristic when replacing exheader
Fixes a regression from #4862, which caused the NCCH title ID checking
heuristic to be skipped whenever the exheader is replaced.

I was thinking the heuristic wouldn't be needed in that case, but it
turns out that many users still have pathological NCCHs that indicate
they are encrypted but are actually decrypted...

Now the original exheader is always read and used for the heuristic
to determine whether the NCCH is actually encrypted; only then do we
load a replacement exheader (if it exists) to avoid affecting the
heuristic.
2019-08-22 17:52:30 +08:00
zhupengfei ebc43239f0
core_timing: Silence sign comparison warnings
This is causing a lot of warnings all over the place.
2019-08-20 22:25:18 +08:00
zhupengfei 531bf857f5
Remove old region free logic 2019-08-20 21:03:41 +08:00
zhupengfei ce3459192e
fixup! CMake: separate options for FFmpeg decoder/dumper 2019-08-20 14:58:43 +08:00
zhupengfei f8b3950829
CMake: separate options for FFmpeg decoder/dumper
Separate options are now provided for FFmpeg AAC audio decoder and FFmpeg video dumper. This allows users to configure Citra with greater freedom.

Also, previously for Linux builds, AAC decoder is accidentally enabled along with the dumper, which could potentially cause patent issues (?). This commit fixes it by only enabling video dumper.
2019-08-20 14:45:39 +08:00
zhupengfei f40232adc9
service/sm: Add service name retrival based on client port ID
This is for displaying the service names. This function is only used in the frontend, because Recorder which is in the Kernel cannot and should not have access to SM in the System.
2019-08-20 03:07:30 +08:00
zhupengfei efd69e1315
kernel, service: Add HLE request/reply recording
Pretty much the same as LLE requests, the 'translate' part is chosen. A function is added to the context class to record requests that involves unimplemented HLE functions.
2019-08-20 03:07:29 +08:00
zhupengfei a27dfc269a
kernel: Add LLE request/reply recording
The 'translate' function is a great place to put this in IMO as it is possible to get both untranslated and translated cmdbufs. However a kernel reference has to be passed here, but it is not too hard fortunately.
2019-08-20 03:07:29 +08:00
zhupengfei cb0bd6530c
kernel/svc: Add request registering
All necessary objects are available here, making this a great place for the registering part.
2019-08-20 03:07:27 +08:00
zhupengfei b093d39a27
kernel: Add IPC Recorder to KernelSystem
Refer to the previous commit message for reasons why this is in kernel.
2019-08-20 03:07:26 +08:00
zhupengfei a3057c968b
kernel: Add IPC Recorder class
This class resides in Kernel mainly because that, it's hard for kernel objects to get references to the System (and therefore to the Recorder), while much easier for KernelSystem. If this is to be moved to System the code will likely get much more complex with System (or Recorder) references passed everywhere.
2019-08-20 03:07:25 +08:00
zhupengfei 71e0c40310
service: Add service function name lookup based on header code
This is for displaying the function name for HLE requests. Probably it is possible to do the same for LLE ones but it would require having the HLE handlers available even when not using them, which doesn't seem to make sense and is more of a hack than a proper solution in my opinion.
2019-08-20 03:07:25 +08:00
Weiyi Wang b4d45b57c7
Merge pull request #4879 from tywald/accurate-gs-on
Remove 'Accurate Geometry Shader' setting
2019-08-18 15:52:45 -04:00
Weiyi Wang 8b8111b425 NFC: extract frontend-facing tag state
Added a new state amiibo_in_range. This state is akin to the real world
physical relationship between a 3DS machine and an amiibo, which is
independent from the service state (or even the machine is powered on or
not). The service state nfc_tag_state is then synchronized with this
physical state on every potential point when the state changes. This
solves the issue where user might load an amiibo before NFC service
initializes, or remove an amiibo after NFC service shutdown, which
previously causes inconsistent state change.

Also removed std::atomic on nfc_tag_state, because
1. It is already protected by g_hle_lock
2. It wasn't properly used in the code anyway. For example, there are
many double loading on this variable, which effectively make it
non-atomic.
2019-08-17 21:56:12 -04:00
James Rowe 0cffab04b5 Fixup! Prevent issue deleting PerfStats 2019-08-16 21:54:33 -06:00
James Rowe 00eeaf0e9c
Merge pull request #4882 from jroweboy/frametime-logging
Frametime logging for tracking performance over time
2019-08-16 19:33:53 -06:00
James Rowe 135b054f74
Update telemetry_session.cpp
Change Session -> Performance
2019-08-15 19:36:02 -06:00
James Rowe 331a9fc12b Change over to std::shared_ptr 2019-08-14 21:30:49 -06:00