Commit graph

4194 commits

Author SHA1 Message Date
xperia64 e33677b021
Add 3D slider value to the HID shared page (#5676)
* Add 3D slider value to the HID shared page; Fixes MSet

* Use f32
2021-01-05 22:01:01 +01:00
Lioncash 10f440cb59 common/telemetry: Migrate namespace into the Common namespace
Migrates the Telemetry namespace into the Common namespace to make the
code consistent with the rest of our common code.
2021-01-04 05:17:13 +01:00
Lioncash 52fe6daa53 common/telemetry: Migrate core-independent info gathering to common
Previously core itself was the library containing the code to gather
common information (build info, CPU info, and OS info), however all of
this isn't core-dependent and can be moved to the common code and use
the common interfaces. We can then just call those functions from the
core instead.

This will allow replacing our CPU detection with Xbyak's which has
better detection facilities than ours. It also keeps more
architecture-dependent code in common instead of core.
2021-01-04 04:25:03 +01:00
FearlessTobi 1653ebaa45 general: Fix various spelling errors
Co-Authored-By: Morph <39850852+Morph1984@users.noreply.github.com>
2021-01-03 02:39:41 +01:00
xperia64 5f1eb7146d
Merge generic part of Android microphone changes (#5624) 2020-12-30 19:21:03 -05:00
FearlessTobi da908a9ed1 core: Remove unnecessary enum casts in log calls
Follows the video core PR. fmt doesn't require casts for enum classes
anymore, so we can remove quite a few casts.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-12-29 06:39:21 +01:00
xperia64 94013c8e00
Merge ARM64 Dynarmic (#5620)
* Point dynarmic to citra fork, update dynarmic to AArch64 merge branch

* Enable dynarmic ARM64 support
2020-12-28 18:39:00 -05:00
Vitor Kiguchi 981a4611a4 Mark variables only used on trace logs as maybe_unused
Fixes some -Wunused-variable warnings
2020-12-06 16:03:24 -03:00
Vitor Kiguchi e331fac004 Resolve unused variable warnings
(C4101 unreferenced local variable)
2020-12-06 15:59:13 -03:00
Vitor Kiguchi 1df939469a Resolve some type conversion warnings 2020-12-06 15:59:13 -03:00
mnml 6f45b402e7
UDS: implement GetApplicationData (#5533) 2020-12-05 22:27:57 +01:00
zhupengfei 8f0aebcd4f
service/apt: Fix deliver arg hmac size 2020-11-28 08:52:35 +08:00
Pengfei Zhu 21fb9d63f4
service/apt: Implement Deliver Args (#5611)
* service/apt: Add GetModule and GetAppletManager

These will be used to retrieve and set deliver args across system resets (which are currently implemented as complete restarts)

* applet_manager: Implement DeliverArg

`flags` was added to `ApplicationJumpParameters` as flags 0x2 is handled differently from 0x0.

* service/apt: Add ReceiveDeliverArg, implement GetStartupArgument

Some based on guesses.

* Address review comments
2020-11-24 20:10:31 +01:00
Ben 182ffa4243
APT: implement Set and GetWirelessRebootInfo (#5328)
* APT: implement Set and GetWirelessRebootInfo

* make wireless_reboot_info a member of APT::Module

* Removed stubbed from log message
2020-11-23 15:52:35 +01:00
Marshall Mohror 02d6032afb
Merge pull request #5566 from zhaowenlan1779/layered-fs-fix
layered_fs: Make LoadFile and LoadDirectory less recursive
2020-11-17 09:31:25 -06:00
Marshall Mohror a89261d397
Merge pull request #5580 from oneup03/master
Implement Reverse Interlaced 3D
2020-11-16 16:53:05 -06:00
Pengfei Zhu de3d7cf49f
kernel/thread: Change owner_process to std::weak_ptr (#5325)
* kernel/thread: Change owner_process to std::weak_ptr

Previously this leaked almost all kernel objects. In short, Threads own Processes which own HandleTables which own maps of Objects which include Threads.

Changing this to weak_ptr at least got the camera interfaces to destruct properly. Did not really check the other objects though, and I think there are probably more leaks.

* hle/kernel: Lock certain objects while deserializing

When deserializing other kernel objects, these objects (`MemoryRegion`s and `VMManager`s) can possibly get modified. To avoid inconsistent state caused by destructor side-effects, we may as well simply lock them until loading is fully completed.

* Fix silly typo

Somehow this didn't break?!
2020-11-15 12:59:45 +01:00
OneUp03 a4f57e6910 Implement Reverse Interlaced 3D 2020-10-16 11:41:08 -05:00
FearlessTobi 51d348b087 General: Make use of std::nullopt where applicable
Allows some implementations to avoid completely zeroing out the internal
buffer of the optional, and instead only set the validity byte within
the structure.

This also makes it consistent how we return empty optionals.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-10-03 17:25:54 +02:00
Pengfei Zhu aced133a3d
Merge pull request #5565 from scarabeusiv/patch-1
Fix compilation with boost 1.74.0
2020-09-30 22:03:01 -05:00
Weiyi Wang 1032b60d9b
Bump kernel version for 3DSX (#5446) 2020-10-01 09:54:42 +08:00
Vitor K ff9c3b0531
Make sure some things are logged (#5515)
* sdl_impl.cpp: actually log the sdl error

* Log cpu slider and vsync
2020-10-01 09:23:37 +08:00
zhupengfei faf9162dbd
layered_fs: Make LoadFile and LoadDirectory less recursive
The deep recursion has caused issues in certain games with large numbers of files, especially with MSVC builds.

Previously the recursion depth is about equal to the number of files present. With this the depth should be about equal to the maximum depth of the directory structure of the RomFS.
2020-10-01 00:32:40 +08:00
Tomáš Chvátal 860ccf2a41
Fix compilation with boost 1.74.0
The serialization module was heavily changed and it now this header needs to be included as it is relied in many other parts of citra.
2020-09-30 11:29:06 +02:00
xperia64 1128f5f8ee Silence some noisy switch case warning 2020-09-06 16:22:48 -04:00
Pengfei Zhu 6a77547bde
Minor frontend fixes to savestates (#5430) 2020-09-03 00:04:23 +02:00
Tobias f6b543886c
Port yuzu-emu/yuzu#4528: "common: Make use of [[nodiscard]] where applicable" (#5535)
Co-authored-by: LC <712067+lioncash@users.noreply.github.com>
2020-08-31 21:06:16 +02:00
Marshall Mohror e48110bdf4
Merge pull request #5512 from vitor-k/untangle-includes
Forward declare some classes and remove some unnecessary includes
2020-08-29 22:02:25 -05:00
Tobias 08e508e846
Port yuzu-emu/yuzu#4472: "perf_stats: Mark GetMeanFrametime() as const" (#5498)
The general pattern is to mark mutexes as mutable when it comes to
matters of constness, given the mutex acts as a transient member of a
data structure.

Co-Authored-By: LC <lioncash@users.noreply.github.com>
2020-08-29 17:29:20 +02:00
Vitor Kiguchi 08e4614817 interface.h: forward declare resolution 2020-08-20 01:30:13 -03:00
Vitor Kiguchi a6efc7c1ee Separate the enums from cam/cam.h
The settings.h file doesn't actually need all of the definitions
on cam.h, only some of the enums. They can, therefore, be separated
into another file, which is included by settings.h instead.
The other changes are fixing files that included settings.h and
depended on indirect includes from includes of includes of cam.h
2020-08-19 01:45:57 -03:00
FearlessTobi 08f3fdfaec settings: Make use of std::string_view over std::string for logging
In all usages of LogSetting(), string literals are provided.
std::string_view is better suited here, as we won't churn a bunch of
string allocations every time the settings are logged out.

While we're at it, we can fold LogSetting() into LogSettings(), given
it's only ever used there.

Co-Authored-By: Mat M. <lioncash@users.noreply.github.com>
2020-07-19 15:07:16 +02:00
Ben 1722701c07
[WIP] NCCHContainer: support for partitions if container is NCSD (#5345)
* GetProgramLaunchInfo: improve to for 3ds files

* NCSD: allow to load other partitions

* fix typo

* Update src/core/hle/service/fs/fs_user.cpp

Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>

* Update src/core/hle/service/fs/fs_user.cpp

Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>

Co-authored-by: Marshall Mohror <mohror64@gmail.com>
Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>
2020-07-14 09:14:30 -05:00
SutandoTsukai181 485d64ae73
citra-qt: Add an "Alternative Speed Limit" with its hotkey (#5281)
* Change "Toggle Speed Limit" to toggle between 100% and a custom value

This will change the shortcut for "Toggle Speed Limit" to make it swap between 100% and the value of "Limit Speed Percent" in the config. Old functionality is still there, but renamed to "Unthrottle".

* Complete reimplementation of the function

* Fix something that didn't get saved correctly

* Fix missing indentation

* Rewrite to keep only a single QSpinBox

* Second rewrite

* set Unthrottled to 0 in the Qspinbox

* Hotkey for Unthrottle

* minor improvements to the design

* Apply suggestions from code review

Co-authored-by: Ben <bene_thomas@web.de>

* Default slider values

* clang-format fixes

* Prevent the speed slider from changing size

...when an element in its row has variable width.

* Change "Game Speed" to "Emulation Speed"

* Apply suggestions from code review

`game_speed` to` emulation_speed`

Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>

* Fix for QSliders

* Revert "Prevent the speed slider from changing size"

This reverts commit ddaca20044.

* clang-format

...doesn't seem to stick to a choice

* Fix 2 for QSliders

Co-authored-by: B3n30 <benediktthomas@gmail.com>
Co-authored-by: Ben <bene_thomas@web.de>
Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>
2020-06-20 13:52:14 -05:00
Ben cb44e4408d
Improve performance of applying cheats; Set correct interval for applying cheats (#5305) 2020-06-20 13:20:31 -05:00
LC 902cc1eb49
am: Resolve truncation and sign conversion warnings in WriteContentData() (#5397)
We can adjust the API to allow std::size_t indices, which simplifies
operating with standard container types. It also prevents truncation
warnings from occurring in these cases as well.
2020-06-20 13:09:56 -05:00
LC 8ce81b19be
General: Remove usages of ARRAY_SIZE where applicable. (#5392)
Same behavior, but without our own boilerplate function.
2020-06-19 09:10:45 -05:00
LC f7aaa37bf2
archive: Make use of std::pair for OpenFileFromArchive (#5399)
* archive: Make use of std::pair for OpenFileFromArchive

The tuple only makes use of two elements, so we can use a pair to
simplify the number of underlying template instantiations that need to
be done, while also simplifying the surrounding code.

* archive: Simplify MakeResult calls

MakeResult can deduce the contained result type based off the type of
the variable being passed to it, so explicitly specifying it is a little
verbose.
2020-06-19 09:02:00 -05:00
xperia64 2e24183e53
Interpolation v2, w/vector and roundf (#5350) 2020-06-14 14:56:10 -04:00
Pengfei Zhu 16913feb44
Merge pull request #5273 from xperia64/frame_timing_tweak
Update FPS to roughly match the actual 3DS rate
2020-06-12 22:14:03 +08:00
xperia64 b0aa58ba56 Fix cheat frame interval 2020-06-11 23:29:12 -04:00
xperia64 c873b38387 Update codec information 2020-06-11 22:05:29 -04:00
Pengfei Zhu 9b20ff0369
Merge pull request #5401 from xperia64/fix_pipe_read_size
Fix ReadPipeIfPossible Size
2020-06-11 22:37:50 +08:00
xperia64 c63797a096 Recomment the ffmpeg backend 2020-06-10 19:47:28 -04:00
xperia64 016d2b08e3 Fix ffmpeg time base 2020-06-10 19:42:23 -04:00
Pengfei Zhu e6ad0d390e
Merge pull request #5381 from zhaowenlan1779/swkbd-another-fix
applets/swkbd: Properly handle button_text
2020-06-08 22:04:49 +08:00
xperia64 fd0a618b16 Fix ReadPipeIfPossible 2020-06-07 16:16:36 -04:00
Pengfei Zhu edb5977fba
Merge pull request #5400 from lioncash/count
fs/file: Make use of std::move where applicable
2020-06-07 23:00:08 +08:00
Pengfei Zhu 1643cf5b86
Merge pull request #5398 from lioncash/call
am: Remove redundant c_str() calls
2020-06-07 22:57:40 +08:00
Pengfei Zhu 0b307a86a6
Merge pull request #5394 from lioncash/uninit
cro_helper: Silence -Wuninitialized warning
2020-06-07 22:53:06 +08:00
Lioncash 5259ab7566 fs/file: Make use of std::move where applicable
Avoids unnecessary atomic reference count increments and decrements.
2020-06-06 11:24:36 -04:00
Lioncash d859f5c9eb am: Remove redundant c_str() calls
Avoids redundant std::string constructions.
2020-06-06 00:00:03 -04:00
Lioncash 0cc6eb3134 gsp_gpu: Mark REGS_BEGIN as constexpr
Same behavior, but more consistent with the already constexpr file-scope
variables.
2020-06-05 21:12:38 -04:00
Lioncash a17027783f gsp_gpu: Resolve sign conversion warnings
Resolves numerous warnings about signed/unsigned conversion warnings.
2020-06-05 21:09:20 -04:00
Lioncash 37861326ce gsp_gpu: Mark GetUnusedThreadId() as const
This doesn't modify class state.
2020-06-05 21:05:22 -04:00
Lioncash 9e515a50b7 cro_helper: Silence -Wuninitialized warning
We can simply initialize the variable in this case with a consistent
value.
2020-06-05 20:58:23 -04:00
Lioncash f8ab6e9247 nwm: Eliminate signed conversion warnings
While we're at it, we can also improve some of the allocations and
copying that would be going on in one case by preallocating and then
emplacing before modifying.
2020-06-05 20:52:28 -04:00
zhupengfei b34ceb89c5
nwm_uds: Change ASSERT to LOG_ERROR
This might be caused by some packet/status delay within the enet protocol, or may be caused by our not properly handling disconnection. Anyway, this situation *can* happen, and we should not crash Citra for a non-critical error.
2020-06-04 23:06:10 +08:00
zhupengfei 9965ce6938
nwm_uds: Make sure client node information match host's
This change is not HW tested as I do not have 3 3DSes, but this should make sure that all the members of the network hold the same `node_info`, `nodes` and the bitmasks, etc.
2020-06-04 22:18:39 +08:00
zhupengfei 4918f86622
service/nwm_uds: Ensure consistency regarding node IDs
Previously, when connecting, the host was using the incorrect node_id to update `node_info`.

This is an attempt to fix tywald's problem with MH, reported on Discord a while ago. I'm not sure if this would actually fix that though.
2020-06-04 22:18:21 +08:00
Pengfei Zhu 81a1e5680f
Merge pull request #5163 from z87/input-touch-mapping
input: allow mapping buttons to touchscreen
2020-05-31 22:23:02 +08:00
zhupengfei 190a053987
applets/swkbd: Properly handle button_text
I'm not sure why we decided to have a boolean here, but apparently that wasn't the correct behaviour. According to HW tests, the Software Keyboard simply displays the default text when the button text provided is empty (**not necessarily all zero**). For example, if you set a text for one of the buttons and leave others empty, the button you set will have your text, while others will have their default texts. Removed the boolean and updated frontend code to make it correct.
2020-05-31 09:41:30 +08:00
xperia64 7dc472a3a7
Fix "core.cpp" clang-format (#5375) 2020-05-29 01:53:14 +02:00
Pengfei Zhu 61c8ea3fe9
Merge pull request #5333 from lioncash/heap
fs_user: std::move vectors where applicable
2020-05-28 22:49:57 +08:00
Ben 57aa18f52e
Improve core timing accuracy (#5257)
* Improve core timing accuracy

* remove wrong global_ticks, use biggest ticks over all cores for GetGlobalTicks

* merge max slice length change
2020-05-12 22:48:30 +02:00
Ben 007fb63e47
Merge pull request #5230 from B3n30/circumvent_apple_intel_hw_shader_issue
Add flag to disable seperable shaders for osx Intel GPUs.
2020-05-09 12:34:21 +02:00
Ben 8a69172570
Merge pull request #5231 from hamish-milne/fix-address-arbiter-serialization
Fix Address Arbiter serialization
2020-05-09 12:33:35 +02:00
Lioncash ba2ae9616a fs_user: std::move vectors where applicable
Allows removing some allocation churn in some locations by moving
std::vectors into Path where applicable.
2020-05-04 12:07:57 -04:00
z87 41facaece3 input_common: add TouchFromButtonDevice 2020-05-04 13:51:37 +03:00
Mat M e9819b61a6
service: Mark variables as [[maybe_unused]] where applicable (#5318)
Quite a few service functions are stubbed but still pop all their
arguments, which can lead to unused variable warnings.

We can mark the unused arguments with [[maybe_unused]] to silence these
warnings until a full implementation of these functions are made.
2020-05-04 12:22:33 +02:00
Mat M 6e48149ee1
fs/archive: Make use of std::make_shared where applicable (#5319)
Allows implementations to allocate the object and the shared_ptr control
block in one allocation instead of needing to do two separate
allocations.

Also looks much nicer to the reader.
2020-05-04 12:22:13 +02:00
Mat M 79536ddb11
service/cfg: Convert file-scope std::vector to std::array (#5320)
Same behavior, but without a static runtime constructor that needs to
run at program start.
2020-05-04 12:21:56 +02:00
Mat M 30414eeb4b
service/cfg: Make GenerateConsoleUniqueId() return a pair (#5321)
Same behavior, but allows the use of structured bindings.
2020-05-04 12:21:43 +02:00
Ben 2874401703
cfg-savegame: add DebugMode block (#5330) 2020-05-04 12:19:44 +02:00
Pengfei Zhu 60669a7dd8
swkbd: Fix a bug where clicking Cancel hangs the game (#5294)
* swkbd: Fix a bug where clicking Cancel hangs the game

The text is validated in `Finalize`. If the validation fails, an error is returned and the applet is not actually finalized. This can result in hangs.

This is usually not a problem as the frontend is expected to validate the text passed to `Finalize`. However, when the user clicked on `Cancel`, the text is ignored and the frontend won't do any validation. Therefore, we should skip the validation here as well.

Also fixed a potential data race. All these functions should now be called on the same thread

* Address review comments

Renamed the fields
Remove close button
2020-05-04 11:31:17 +02:00
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