Commit graph

308 commits

Author SHA1 Message Date
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
Vitor K
a26b466ac8
Use unique_ptr on all ui objects from .ui files (#5511)
* Forward declare ui and use unique_ptr

* ConfigureEnhancements: use unique_ptr for ui

* Use make_unique instead of new where applicable

* Move some of the ui includes that already used unique_ptr

* main.cpp: also make use of make_unique on Config

* Address review comments
2020-10-01 09:23:01 +08: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
Lioncash
1e2e9e555a yuzu: Make use of qOverload where applicable
Eliminates a verbose function cast.
2020-08-28 16:55:55 +02:00
Vitor Kiguchi
9c2986de41 profiler: remove unnecessary includes 2020-08-17 18:31:58 -03:00
David Marcec
7c578b0579 frontend: Improve wait tree readability for dark themes 2020-07-19 14:41:50 +02: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
Hamish Milne
4d6bd9b569 Fix the merge 2020-04-13 11:50:27 +01:00
Hamish Milne
e733eed6bd Merge remote-tracking branch 'upstream/master' into feature/savestates-2 2020-04-13 11:36:05 +01:00
Sebastian Valle
e480a8032b
Debuggers/Qt: Show the threads process names and ids in the Wai… (#5201) 2020-04-12 23:44:51 +02:00
Hamish Milne
915c426dc9 Merge remote-tracking branch 'upstream/master' into feature/savestates-2 2020-04-12 22:26:24 +01:00
Hamish Milne
7988978661 Fix VFP registers serialization (0 fps when loading etc.) 2020-04-10 19:36:38 +01:00
MerryMage
8b7b6e9f74 arm_dynarmic: Remove dependence on interpreter 2020-04-07 19:07:59 +01:00
Gauvain "GovanifY" Roussel-Tarbouriech
2a616fcc5e ipc_debugger: Fixing NULL ptr call on multiple clear 2020-02-23 03:54:29 +01: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
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
vvanelslande
a650402eb5 citra_qt/RecordDialog: close when OK is clicked
The OK button didn't do anything before.
2019-09-21 23:56:07 -05:00
zhupengfei
3d14abeb41
citra_qt/record_dialog: Switch to QFormLayout 2019-08-29 00:03:56 +08:00
zhupengfei
42cefdbff0 citra_qt/debugger: Add recorder widget
This widget provides a simple list of recorded requests as well as a simple filter and the 'Clear' button. Requests with status 'HLE Unimplemented' or 'Error' will be marked out with the red color.

This widget handles retrival of service name. For reasons refer to a previous commit message.

Added the widget to the Debugging menu, pretty much the same as other debugging widgets.
2019-08-20 03:08:55 +08:00
zhupengfei
45930e0621 citra_qt: Add record dialog
This 'View Record' dialog shows all relevant information on a record as well as the command buffers.
2019-08-20 03:08:20 +08:00
James Rowe
7fe9a094a5 Remove qt5_wrap_ui macro usage 2019-08-16 19:35:37 -06:00
Lioncash
4832b29d3d yuzu/debugger: Specify string conversions explicitly 2019-07-28 15:13:03 +02:00
Weiyi Wang
3a567390ee citra_qt/profiler: add parenthesis to silent warning
This is indeed confusing
2019-07-14 14:14:34 -04:00
Tobias
623b0621ab
Port various minor changes from yuzu PRs (#4725)
* common/thread: Remove unused functions

Many of these functions are carried over from Dolphin (where they aren't
used anymore). Given these have no use (and we really shouldn't be
screwing around with OS-specific thread scheduler handling from the
emulator, these can be removed.

The function for setting the thread name is left, however, since it can
have debugging utility usages.

* input_common/sdl: Use a type alias to shorten declaration of GetPollers

Just makes the definitions a little bit more tidy.

* input_common/sdl: Correct return values within implementations of GetPollers()

In both cases, we weren't actually returning anything, which is
undefined behavior.

* yuzu/debugger/graphics_surface: Fill in missing surface format listings

Fills in the missing surface types that were marked as unknown. The
order corresponds with the TextureFormat enum within
video_core/texture.h.

We also don't need to all of these strings as translatable (only the
first string, as it's an English word).

* yuzu/debugger/graphics_surface: Clean up connection overload deduction

We can utilize qOverload with the signal connections to make the
function deducing a little less ugly.

* yuzu/debugger/graphics_surface: Tidy up SaveSurface

- Use QStringLiteral where applicable.

- Use const where applicable

- Remove unnecessary precondition check (we already assert the pixbuf
  being non null)

* yuzu/debugger/graphics_surface: Display error messages for file I/O errors

* core: Add missing override specifiers where applicable

Applies the override specifier where applicable. In the case of
destructors that are  defaulted in their definition, they can
simply be removed.

This also removes the unnecessary inclusions being done in audin_u and
audrec_u, given their close proximity.

* kernel/thread: Make parameter of GetWaitObjectIndex() const qualified

The pointed to member is never actually modified, so it can be made
const.

* kernel/thread: Avoid sign conversion within GetCommandBufferAddress()

Previously this was performing a u64 + int sign conversion. When dealing
with addresses, we should generally be keeping the arithmetic in the
same signedness type.

This also gets rid of the static lifetime of the constant, as there's no
need to make a trivial type like this potentially live for the entire
duration of the program.

* kernel/codeset: Make CodeSet's memory data member a regular std::vector

The use of a shared_ptr is an implementation detail of the VMManager
itself when mapping memory. Because of that, we shouldn't require all
users of the CodeSet to have to allocate the shared_ptr ahead of time.
It's intended that CodeSet simply pass in the required direct data, and
that the memory manager takes care of it from that point on.

This means we just do the shared pointer allocation in a single place,
when loading modules, as opposed to in each loader.

* kernel/wait_object: Make ShouldWait() take thread members by pointer-to-const

Given this is intended as a querying function, it doesn't make sense to
allow the implementer to modify the state of the given thread.
2019-05-01 14:28:49 +02:00
Weiyi Wang
5f11c5f733 Kernel: replace boost::intrusive_ptr with std::shared_ptr 2019-03-24 14:32:11 -04:00
Lioncash
643472e24a common/vector_math: Move Vec[x] types into the Common namespace
These types are within the common library, so they should be using the
Common namespace.
2019-03-02 15:04:13 +01:00
Lioncash
c2790a3f86 yuzu/wait_tree: Pass QString by value and std::move in the initializer list for WaitTreeText
Just a trivial modernization that potentially avoids copying strings in certain scenarios.
2018-12-16 01:18:06 +01:00
Weiyi Wang
296c458e0e Memory: move GetPhysicalPointer and IsValidPhysicalAddress into class 2018-12-05 20:21:14 -05:00
Weiyi Wang
445538c2cf
Merge pull request #4371 from wwylele/kernel-global-3
Kernel: eliminate global state for threads and timers
2018-10-30 00:36:10 -04:00
fearlessTobi
494d86d083 graphic_breakpoints: Correct translation of strings in BreakpointModel's data() function
tr() will not function properly on static/global data like this, as the
object is only ever constructed once, so the strings won't translate if
the language is changed without restarting the program, which is
undesirable. Instead we can just turn the map into a plain old function
that maps the values to their equivalent strings. This is also lessens
the memory allocated, since it's only allocating memory for the strings
themselves, and not an encompassing map as well.
2018-10-27 00:33:31 +02:00
Weiyi Wang
20ae37ba4f kernel/Thread: move thread list into the manager 2018-10-26 16:07:45 -04:00
fearlessTobi
3ee9f669c1 Address review comments 2018-09-21 16:39:10 +02:00
Lioncash
ca3d9d659e kernel/thread: Include thread-related enums within the kernel namespace
Previously, these were sitting outside of the Kernel namespace, which
doesn't really make sense, given they're related to the Thread class
which is within the Kernel namespace.
2018-09-15 17:16:20 +02:00
Lioncash
5dfa7b74b5 thread: Convert ThreadStatus into an enum class
Makes the thread status strongly typed, so implicit conversions can't
happen. It also makes it easier to catch mistakes at compile time.
2018-09-15 17:02:44 +02:00
Weiyi Wang
7d8f115185 Prefix all size_t with std::
done automatically by executing regex replace `([^:0-9a-zA-Z_])size_t([^0-9a-zA-Z_])` -> `$1std::size_t$2`
2018-09-06 16:03:28 -04:00
James Rowe
05118a2326
Merge pull request #4130 from FearlessTobi/port-942
Port #942 from yuzu: "qt: Minor cleanup-related changes"
2018-08-26 12:22:34 -06:00
Merry
9b9227089b
Merge pull request #4121 from FearlessTobi/port-894
Port #894 from yuzu: "kernel: Move object class to its own source files"
2018-08-26 00:02:33 +01:00
Merry
ed79288e41
Merge pull request #4124 from FearlessTobi/port-907
Port #907 from yuzu: "yuzu: Use Qt 5 signal/slots where applicable"
2018-08-24 19:00:10 +01:00
zhaowenlan1779
642f0bd62b Port "kernel/event: Make data members private" from yuzu (#4077)
* kernel/event: Make data members private

Instead we can simply provide accessors to the required data instead of
giving external read/write access to the variables directly.

* fix compile error
2018-08-24 19:43:28 +02:00
fearlessTobi
1f0cbf43d6 Port #942 from yuzu: "qt: Minor cleanup-related changes" 2018-08-24 17:14:09 +02:00
Lioncash
79434d3d4c citra-qt: Use Qt 5 signal/slots where applicable
Makes the signal/slot connections type-safe instead of string-based.
2018-08-23 18:34:25 +02:00
Lioncash
63c7b44ba8 kernel: Move object class to its own source files
General moving to keep kernel object types separate from the direct
kernel code. Also essentially a preliminary cleanup before eliminating
global kernel state in the kernel code.
2018-08-23 17:31:59 +02:00
zhaowenlan1779
e837717592
citra_qt: set object name for LLEServiceModulesWidget
Gets rid of a qt error that occurs when Citra is closed.
2018-08-14 20:28:47 +08:00
BreadFish64
d09646ab9d citra-qt: service: add convenient LLE service module configuration (#3967)
* citra-qt: service: add convenient LLE service module configuration

* fix SDL settings

* unexpose AttemptLLE

* static

* fix array includes

* use default with writesetting
2018-08-09 21:10:11 +02:00
Merry
6a9e18a49a
Merge pull request #4022 from zhaowenlan1779/port-yuzu-837
Port yuzu-emu/yuzu#837 from yuzu
2018-08-01 15:01:17 +01:00
Lioncash
8e103d0675
kernel/timer: Make data members private where applicable
Instead, we can just expose functions that return the queryable state
instead of letting anything modify it.
2018-08-01 17:49:52 +08:00
Lioncash
bf5b5d25ed wait_tree: Silence warning about all code paths not returning a value
If code execution hits this spot, something has gone very wrong, so mark
the path as unreachable. This silences a warning on MSVC.
2018-07-30 16:32:09 +08:00
Weiyi Wang
a9f8887c93
remove trailing space 2018-07-02 19:47:41 +03:00
Weiyi Wang
4be2f12914
log/console: no need to test first call
Just let `console_shown` be initialized to the default status (console isn't shown on startup)
2018-07-02 19:39:13 +03:00
wwylele
810b86f451 citra_qt: only toggle console if the setting has been changed 2018-06-30 13:07:30 +03:00