Commit graph

4119 commits

Author SHA1 Message Date
Pengfei Zhu
41bff0e3b7
Merge pull request #5316 from lioncash/init
core: Resolve -Wreorder warnings
2020-05-02 15:42:31 +08:00
Lioncash
563a540dfd core: Resolve -Wreorder warnings
Ensures the initialization order matches the actual order that the class
member variables will be initialized in.
2020-05-01 23:32:46 -04:00
Lioncash
a32ad7f1f2 soc_u: Prevent undefined behavior with CTRPollFD
This class is memcpy-ed and memcpy has the requirement that data passed
to it must be trivially copyable, otherwise the behavior is undefined.

This is trivial to resolve as BitField was made trivially copyable a
while ago, so this explicit copy assignment operator isn't necessary.
2020-05-01 22:30:10 -04:00
Pengfei Zhu
70a43be714
Merge pull request #5306 from lioncash/view2
file-sys: Make use of std::string_view where applicable
2020-05-02 08:07:10 +08:00
Pengfei Zhu
8e7abecf7e
Merge pull request #5307 from lioncash/guard
file_sys/seed_db: Add missing include guard
2020-05-02 08:04:58 +08:00
Pengfei Zhu
5a008a74fa
Merge pull request #5304 from lioncash/layered
layered_fs: Mark functions as static where applicable
2020-05-02 08:02:35 +08:00
Pengfei Zhu
6907568034
Merge pull request #5309 from lioncash/dtor
applets: Make destructors virtual where applicable
2020-05-02 08:02:14 +08:00
Pengfei Zhu
59984df603
Merge pull request #5308 from lioncash/rsa
core/hw/rsa: Minor cleanup
2020-05-02 08:01:58 +08:00
Lioncash
89eeb64854 applets/swkbd: Make destructor virtual
Prevents undefined behavior when destroying a derived class through a
base class pointer.
2020-05-01 10:44:31 -04:00
Lioncash
aeb6a037ed applets/mii_selector: Make destructor virtual
Prevents undefined behavior when destroying derived classes through a
base class pointer.
2020-05-01 10:42:57 -04:00
Lioncash
3ab0701192 core/hw/rsa: Make GetSignature() a const member function
This doesn't directly modify instance state, so it can be made const.
2020-05-01 10:17:43 -04:00
Lioncash
c55e81b946 core/hw/rsa: Make operator bool explicit
Prevents error-prone implicit conversions to bool from occurring.
2020-05-01 10:14:50 -04:00
Lioncash
75bac1e514 core/hw/rsa: Take std::vector instances by value
Allows us to std::move them and allow calling code to eliminate copies
from occurring entirely.
2020-05-01 10:14:07 -04:00
Lioncash
98385b75d6 file_sys/seed_db: Add missing include guard
Prevents any potential inclusion errors from occurring.
2020-05-01 09:59:58 -04:00
Lioncash
10a32c94b6 title_metadata: Take std::vector by const reference in Load()
This isn't modified in the implementation, so this can be a const
reference to eliminate an unnecessary heap reallocation.
2020-05-01 09:53:44 -04:00
Lioncash
147073a5a0 file-sys: Make use of std::string_view where applicable
Same behavior, but makes the interface more flexible and allows
non-std::string instances to be used with it.
2020-05-01 09:49:36 -04:00
Lioncash
37a6ea72e5 layered_fs: Mark functions as static where applicable
Makes them internally linked and prevents potential
-Wmissing-declaration warnings.
2020-05-01 09:35:59 -04:00
Lioncash
9cff314abb service/ir: Remove erroneous forward declaration
This can be removed as it's not used. Even if it were however, it would
be an incorrect forward declaration, as ServiceManager exists within the
Service::SM namespace, not the top-level SM namespace.
2020-05-01 08:54:27 -04:00
FearlessTobi
7f8151b9b9 savedata_archive: Make GetFreeBytes return a more accurate value
Previously, we were returning a value that was way too big, causing an integer overflow in Fractured Souls.
According to wwylele, the biggest oberserved save size for 3DS is 1MB, so this new value should leave plenty of room, even if games use a bigger size.
2020-04-29 05:42:40 +02:00
Mat M
98fe5f82c5
memory: Make getter functions const qualified where applicable (#5251)
Many of these functions are capable of being used within const contexts,
so we can apply the const qualifier in some cases and add const based
overloads for others, which makes the interface a little bit more
flexible and const-correct.
2020-04-28 14:43:52 -05:00
Mat M
96832a2c82
core/memory: Make use of std::move in Entry::operator= (#5233)
* core/memory: Amend unusual return value of operator=

operator= usually returns a reference to this. Given there's no comment
explaining why void was used, this can be assumed to be an oversight.

* core/memory: Make use of std::move in Entry::operator=

Same behavior, minus the need for an atomic reference count increment
and decrement (since MemoryRef contains a std::shared_ptr).
2020-04-28 14:39:02 -05:00
badda71
f18aef0579
add program counter in unmapped memory access log messages (#5149)
* add program counter in unmapped memory access log messages
2020-04-27 16:31:34 +02:00
xperia64
03145e307b Add measured frame cycles 2020-04-26 18:02:25 -04:00
xperia64
5e95b35900 Update FPS to roughly match the actual 3DS rate 2020-04-26 03:22:11 -04:00
Ben
39463f1f6d
ArmInterface: return ref instead of copy for GetTimer (#5227)
* ArmInterface: return ref instead of copy for GetTimer

* ArmInterface: add const ref GetTimer

* ArmInterface: return raw pointer instead of shared_ptr in GetTimer

* remove more unnecessary shared_ptr usage

* Fix save states

* fix unit tests
2020-04-22 07:44:58 +02:00
Mat M
b82d4315fe
custom_tex_cache: Remove reliance on the global system instance (#5252)
Removes direct usages of Core::System::GetInstance() and instead passes
the direct necessities through the interface.
2020-04-20 21:50:16 -05:00
Hamish Milne
6783289909 CR actions 2020-04-20 16:30:49 +01:00
Hamish Milne
55c9162d02 Clean up the Callback (don't store a shared_ptr to parent) 2020-04-20 16:29:50 +01:00
Sebastian Valle
3597921ec5
Merge pull request #5235 from lioncash/move
ipc_helpers: Make PushStaticBuffer take std::vector by value
2020-04-19 21:51:52 -05:00
Ben
0f72dd6d85
Merge pull request #5250 from lioncash/build
core/memory: Fix #5246
2020-04-19 19:39:32 +02:00
Ben
1856752b61
Merge pull request #5203 from Subv/apt_title_allowed
Services/APT: Implemented the IsTitleAllowed function.
2020-04-19 16:50:47 +02:00
Ben
182aa1e39d
Merge pull request #5238 from lioncash/return
kernel/shared_page: Silence missing return warning in GetInitTime()
2020-04-19 11:31:45 +02:00
Mat M
8014c67faa
service: Resolve trivially avoidable copies (#5237)
* am/am: Avoid redundant copy in GetProgramInfoFromCia()

We can just use a reference to the title metadata. Avoids copying
several data entries and std::vector instances that don't need to be
copied.

* hle/service: Avoid redundant copying of std::string

GetUserPath() returns the path as a reference, so we can make use of
said reference to avoid making copies.
2020-04-19 09:24:37 +02:00
Mat M
e54b640e0b
nwm/nwm_uds: Avoid copying all elements in channel_data map where applicable (#5236)
By using a reference here, we avoid copying every single element in the
map, each of which contains a std::share_ptr and std::deque containing
std::vectors.
2020-04-19 07:57:57 +02:00
Lioncash
99eedced4a core/memory: Fix #5246
We can simplify the overload sent to be less confusing (and
error-prone), while also unbreaking 32-bit builds.
2020-04-19 01:56:03 -04:00
Lioncash
f7ad004fb0 kernel/shared_page: Silence missing return warning in GetInitTime()
We can use UNREACHABLE_MSG to indicate that this path isn't intended to
be reached, as it would indicate a wrong enum value.
2020-04-18 19:48:54 -04:00
Lioncash
7eabcdf1c3 apt/applet_manager: std::move parameter in GlanceParameter()
Same behavior, minus a redundant copy.
2020-04-18 19:22:03 -04:00
Lioncash
a6e37b48e9 ipc_helpers: Make PushStaticBuffer take std::vector by value
Allows interfaces to move the vector into the calls, avoiding any
reallocations.

Many existing call sites already std::move into the parameter, expecting
a move to occur. Only a few remain where this wasn't already
being done, which we can convert over.
2020-04-18 19:17:11 -04:00
Lioncash
8b22c80ba2 core/memory: Resolve sign conversion in serialize()
auto i = 0 deduces to an int, which was being compared with a size_t
within the loop condition.
2020-04-18 18:50:40 -04:00
Hamish Milne
397bd1bb73
Fix MIC_U serialization and timing (#5223)
* Fix MIC_U serialization and timing

* Better sample rate conversion

* Actually should be every 15 samples

* Reduce rounding errors
2020-04-18 20:52:56 +02:00
Sebastian Valle
75c9784239
Services/APT: Implemented the GetCaptureInfo function. (#5194)
This one is similar to the ReceiveCaptureBufferInfo function except it doesn't clear the capture buffer, according to 3dbrew.

This function is used by the Home Menu
2020-04-18 20:48:09 +02:00
Hamish Milne
c5a3bf9728 Fix clang format 2020-04-18 15:14:01 +01:00
Hamish Milne
1fb3c9f08c Fix Address Arbiter serialization 2020-04-18 15:10:54 +01:00
B3n30
922a5f738a fix typo; updated comment about apples bad driver 2020-04-18 15:55:19 +02:00
B3n30
1e54f27cde Add flag to disable seperable shaders for osx Intel GPUs. Default is false 2020-04-18 13:37:58 +02:00
Subv
07f49e588e Services/APT: Implemented the IsTitleAllowed function.
The Home Menu uses this to determine whether it is allowed to launch an app (call StartApplication)

This is a no-op for us, we allow any and all titles to be launched. The official APT module holds a list of some forbidden titles like some versions of IronFall and Flipnote Studio 3D.
2020-04-18 00:26:08 -05:00
Pengfei Zhu
8967b403b9
Merge pull request #5196 from Subv/apt_sys_menu_arg
Services/APT: Implemented the Store/LoadSysMenuArg functions.
2020-04-18 13:24:10 +08:00
Pengfei Zhu
47829ee095
Merge pull request #5213 from Subv/fs_resource
Services/FS: Stubbed GetSdmcArchiveResource and GetNandArchiveResource.
2020-04-18 13:22:21 +08:00
Ben
c605bb42db
Merge pull request #4908 from hamish-milne/feature/savestates-2
Save states
2020-04-17 21:52:51 +02:00
Hamish Milne
f5b23eff4b Correctly register AddressArbiter as a type of WakeupCallback 2020-04-17 14:13:22 +01:00
Hamish Milne
026a63bcf7
Merge pull request #5130 from B3n30/warn_if_cia_contend_is_encrypted
Show an error if CIA contend is encrypted
2020-04-17 00:09:36 +01:00
Hamish Milne
ab998b04c8
Merge pull request #5108 from B3n30/load_aes_key_X0x25_from_nativeFirm
Load NCCHSecure2 keyX from native firm
2020-04-17 00:07:15 +01:00
Hamish Milne
7af4b1a18e Merge branch 'master' into feature/savestates-2 2020-04-17 00:01:43 +01:00
Hamish Milne
9afd58cec2
Merge pull request #5185 from MerryMage/fix-gdbstub
gdbstub: Fix some gdbstub jankiness
2020-04-16 23:52:00 +01:00
Hamish Milne
d6c84227d8 Fixed NWM not responding 2020-04-16 20:44:25 +01:00
Hamish Milne
9cd669db84 Merge branch 'master' into feature/savestates-2 2020-04-16 19:03:49 +01:00
Subv
0d8c3ee1d3 Services/APT: Implemented the Store/LoadSysMenuArg functions.
They are called by the Home Menu during initialization.

These functions will not see much use until we actually implement application jumping and system rebooting. For now we just need them to prevent some unmapped reads in the Home Menu due to the static buffers not being properly set up.
2020-04-15 22:32:11 -05:00
Subv
783e7af5b2 Services/FS: Stubbed GetSdmcArchiveResource and GetNandArchiveResource.
Also rewritten how GetArchiveResource works so that they all use the same interface.
We should decide what to do with these at some point.

Related to #3131 and #3110
2020-04-15 16:52:55 -05:00
Sebastian Valle
9ae37da292
Kernel/Process: Fixed scheduling multiple processes in the SysCore using Dynarmic (#5193)
* Kernel/Process: Notify the CPUs that a new pagetable has been set every time the process they're executing changes.

Previously the page table would only be changed when the current CPU's page table was changed, this lead to stale JIT states and the PC going to 0 when context-switching a different core inside the ThreadManager::SwitchContext function because the JIT for a new pagetable is only constructed upon receiving the change notification.

* Kernel/Process: Use the relevant CPU's last process to determine when to switch its current process.

Previously it was checking the kernel's current_process variable, which gets overwritten every time a CPU runs its slice. The rescheduling happens after all CPUs have run their slice so the code was effectively only checking the last CPU's process.
2020-04-15 14:35:19 +02:00
Valentin Vanelslande
263e5be78e
Fix Luigi's Mansion can't remove amiibo bug (#5200)
* Fix Luigi's Mansion can't remove amiibo bug
2020-04-14 14:33:49 +02:00
Hamish Milne
3a651ac9fc Fix clang format 2020-04-13 18:08:15 +01:00
Hamish Milne
d53e94db88 Show save/load errors to the user 2020-04-12 23:12:15 +01:00
Hamish Milne
915c426dc9 Merge remote-tracking branch 'upstream/master' into feature/savestates-2 2020-04-12 22:26:24 +01:00
Mat M
f75cc8be64
Merge pull request #5184 from MerryMage/dyn-update-2020-04
Update dynarmic (Apr 2020)
2020-04-12 09:10:21 -04:00
Hamish Milne
828f88d20a Merge branch 'master' into feature/savestates-2 2020-04-12 11:24:06 +01:00
Hamish Milne
77c4b26e6c Attempt to improve save/load during frame advance 2020-04-11 22:25:57 +01:00
Hamish Milne
19872b599b Fix button state not persisting between loads 2020-04-11 20:47:14 +01:00
Hamish Milne
34af0d3452 Attempt to fix network bug 2020-04-11 20:33:38 +01:00
Hamish Milne
4be752dd98 Allow GDB debugging through loads 2020-04-11 19:47:31 +01:00
Hamish Milne
e6b40486c5 Add a couple of useful SVC logs 2020-04-11 19:47:06 +01:00
Hamish Milne
3871d74bc2 Fix mic sharedmemory not being deallocated 2020-04-11 19:33:21 +01:00
Subv
0e88940df1 Warnings/Thread: Added missing case for the Dormant thread status in ResumeFromWait. 2020-04-11 12:24:09 -05:00
Hamish Milne
e9ab8f82d4 Add disk archive serialization (fix crash in driver renegade etc.) 2020-04-11 11:52:11 +01:00
Hamish Milne
a210e7e2bd Sync GPU state after loading (fix FE terrain bug) 2020-04-11 10:28:52 +01:00
Hamish Milne
7b3a8e9bf5 Fix clang format 2020-04-10 20:22:40 +01:00
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