Commit graph

715 commits

Author SHA1 Message Date
Weiyi Wang
4a30a502a0
Merge pull request #4211 from wwylele/web-cleanup
web_service: stop using std::future + callback style async
2018-09-29 23:02:27 -04:00
Weiyi Wang
20e42592ff
Merge pull request #4249 from FearlessTobi/port-760
Port yuzu-emu/yuzu#760: "file_util: Use an enum class for GetUserPath()"
2018-09-22 23:42:59 -04:00
Lioncash
b3221c3180 file_util: Use an enum class for GetUserPath()
Instead of using an unsigned int as a parameter and expecting a user to
always pass in the correct values, we can just convert the enum into an
enum class and use that type as the parameter type instead, which makes
the interface more type safe.

We also get rid of the bookkeeping "NUM_" element in the enum by just
using an unordered map. This function is generally low-frequency in
terms of calls (and I'd hope so, considering otherwise would mean we're
slamming the disk with IO all the time) so I'd consider this acceptable
in this case.
2018-09-22 21:18:56 +02:00
Weiyi Wang
1855fb3d88 common/thread: remove YieldCPU()
simply use the standard library yield()
2018-09-22 00:32:19 -04:00
Weiyi Wang
1e9d60cab6 common/thread: remove unnecessary macro for thread_local
we have bumped compiler version really high that all of them support this
2018-09-22 00:30:56 -04:00
Weiyi Wang
59982c5479
Merge pull request #4221 from FearlessTobi/port-1238
Port #1238 from yuzu: "common/logging: Minor changes"
2018-09-21 12:32:53 -04:00
Lioncash
1cf3ef15b9 common/logging: Amend documentation comments
Multi-line doc comments still need the '<' after the ///, otherwise it's
treated as a regular comment and makes the original doc comment broken
in viewers, IDEs, etc. While we're at it, also fix some typos in the
comments.
2018-09-21 16:26:21 +02:00
Merry
bb9e92c77c
Merge pull request #4194 from MerryMage/audiofifo
audio_core: Simplify sink interface
2018-09-21 13:30:51 +01:00
MerryMage
c9c7097769 ring_buffer: Fix Push 2018-09-19 07:14:36 +01:00
Lioncash
83c32b8d22 common/logging/filter: Replace C-style case with C++ static_cast 2018-09-15 15:43:00 +02:00
Lioncash
787fff9a64 common/logging/filter: Make constructor explicit
Implicit conversions aren't desirable here.
2018-09-15 15:41:51 +02:00
Weiyi Wang
77c1f647cb web_service: stop using std::future + callback style async 2018-09-13 16:14:34 -04:00
EverOddish
04dd91be82 Initial support for scripting (#4016)
* Add ZeroMQ external submodule

* ZeroMQ libzmq building on macOS

* Added RPC namespace, settings and logging

* Added request queue handling and new classes

* Add C++ interface to ZeroMQ

* Added start of ZeroMQ RPC Server implementation.

* Request construction and callback request handling

* Read and write memory implementation

* Add ID to request format and send reply

* Add RPC setting to macOS UI

* Fixed initialization order bug and added exception handling

* Working read-write through Python

* Update CMakeLists for libzmq to resolve target name conflict on Windows

* Platform-specific CMake definitions for Windows/non-Windows

* Add comments

* Revert "Add RPC setting to macOS UI"

* Always run RPC server instead of configurable

* Add Python scripting example. Updated .gitignore

* Rename member variables to remove trailing underscore

* Finally got libzmq external project building on macOS

* Add missing dependency during libzmq build

* Adding more missing dependencies [skip ci]

* Only build what is required from libzmq

* Extra length checks on client input

* Call InvalidateCacheRange after memory write

* Revert MinGW change. Fix clang-format. Improve error handling in request/reply. Allow any length of data read/write in Python.

* Re-organized RPC static global state into a proper class. [skip ci]

* Make sure libzmq always builds in Release mode

* Renamed Request to Packet since Request and Reply are the same thing

* Moved request fulfillment out of Packet and into RPCServer

* Change request thread from sleep to condition variable

* Remove non-blocking polling from ZMQ server code. Receive now blocks and terminates properly without sleeping. This change significantly improves script speed.

* Move scripting files to dist/ instead of src/

* C++ code review changes for jroweboy [skip ci]

* Python code review changes for jroweboy [skip ci]

* Add docstrings and tests to citra.py [skip ci]

* Add host OS check for libzmq build

* Revert "Add host OS check for libzmq build"

* Fixed a hang when emulation is stopped and restarted due to improper destruction order of ZMQ objects [skip ci]

* Add scripting directory to archive packaging [skip ci]

* Specify C/CXX compiler variables on MinGW build

* Only specify compiler on Linux mingw

* Use gcc and g++ on Windows mingw

* Specify generator for mingw

* Don't specify toolchain on windows mingw

* Changed citra.py to support Python 3 instead of Python 2

* Fix bug where RPC wouldn't restart after Stop/Start emulation

* Added copyright to headers and reorganized includes and forward declarations
2018-09-11 22:00:12 +02:00
MerryMage
761ef78408 common: Implement a ring buffer 2018-09-08 22:09:26 +01: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
fearlessTobi
cf8b1726df Address review comments 2018-09-06 00:00:21 +02:00
Lioncash
3284bef360 string_util: Remove StringFromFormat() and related functions
Given we utilize fmt, we don't need to provide our own functions for formatting anymore
2018-09-06 00:00:21 +02:00
Weiyi Wang
22e172946b
Merge pull request #4132 from FearlessTobi/port-966
Port #966 and #414 from yuzu (Cleanups in common and file_util) & Make bitfield assignment operator public
2018-09-05 18:03:36 +03:00
fearlessTobi
c7d8ffd14f Make bitfield assignment operator public
This change needs to be made to get the code compiling again. It was suggested after a conversation with Lioncash.

The conversation can be seen here: https://user-images.githubusercontent.com/20753089/45064197-b6107800-b0b2-11e8-9db8-f696299fb86a.PNG
2018-09-05 02:24:44 +02:00
fearlessTobi
f3f4871275 Fix compilation errors 2018-09-05 02:19:55 +02:00
Merry
b130dd6842
Merge pull request #4161 from FearlessTobi/port-1139
Port #1139 from yuzu: "bit_field: Convert ToBool() into explicit operator bool"
2018-09-02 09:53:50 +01:00
Merry
c99d197ff7
Merge pull request #4156 from FearlessTobi/port-1060
Port #1060 from yuzu: "logging/backend: Use const reference to refer to log filter"
2018-09-02 09:50:57 +01:00
Lioncash
6c3737a786 bit_field: Convert ToBool() into explicit operator bool
Gets rid of a TODO that is long overdue.
2018-09-01 15:44:09 +02:00
Pengfei Zhu
987e1279a3
Merge pull request #4155 from FearlessTobi/port-1062
Port yuzu-emu/yuzu#1062 from yuzu: "common: Remove unused old breakpoint source files"
2018-09-01 10:27:18 +08:00
Lioncash
664e92d6ae common: Remove unused old breakpoint source files
These currently aren't used and contain commented out source code that
corresponds to Dolphin's JIT. Given our CPU code is organized quite
differently, we shouldn't be keeping this around (at the moment it just
adds to compile times marginally).
2018-09-01 00:04:25 +02:00
Pengfei Zhu
270155066c
Merge pull request #4154 from FearlessTobi/port-1063
Port #1063 from yuzu: "common/xbyak_abi: Mark defined functions in header as inline "
2018-08-31 12:59:29 +08:00
Lioncash
8fbfd0f7fa logging/backend: Use const reference to refer to log filter
The filter is returned via const reference, so this was making a
pointless copy of the entire filter every time a message was being
pushed into the logger instance.
2018-08-31 00:13:15 +02:00
Lioncash
0fbae792cf common/xbyak_abi: Mark defined functions in header as inline
Avoids potential One Definition Rule violations when these are used in
the future.
2018-08-31 00:08:42 +02:00
Lioncash
d6bf1b31c8 common/xbyak: Use nested namespace specifiers where applicable 2018-08-31 00:08:34 +02:00
Lioncash
ff1f7555de vector_math: Use variable template version of is_signed in Vec classes
Same behavior, less code
2018-08-30 23:38:32 +02:00
James Rowe
50270fd791
Merge pull request #4059 from zhaowenlan1779/udp-input-ui
citra_qt: add motion/touch config
2018-08-26 11:56:50 -06:00
Tobias
604c1b5fc3
web_service: Change authentication system to use JWT (#4041)
* Change authentication system to JWT

* Address review comments
* Get rid of global variable, fix some documentations, fix a bug when verificating
* Refactor PostJson to avoid code duplication
* Rename jwt_token, add functionality to request a new JWT when getting a 401
* Take bools by value instead of const reference
* Send request again when JWT is invalid and use forward declarations
* Omit brackets
2018-08-25 21:39:23 +02:00
Lioncash
c5d0a0ac65 vector_math: Remove unimplemented function prototypes 2018-08-24 18:46:24 +02:00
Lioncash
d10e579292 vector_math: Make functions constexpr where applicable 2018-08-24 18:46:01 +02:00
Lioncash
6b1ec838aa vector_math: Convert typedefs to type aliases 2018-08-24 18:37:18 +02:00
Lioncash
bf964ac6e9 common: Convert type traits templates over to variable template versions where applicable
Uses the C++17 inline variable variants
2018-08-24 18:22:42 +02:00
Lioncash
a74ba1cd59 file_util: Remove compiler version checks around is_trivially_copyable()
The minimum clang/GCC versions we support already support this. We can also
remove is_standard_layout(), as fread and fwrite only require the type to be
trivially copyable.
2018-08-24 18:18:11 +02:00
zhupengfei
8af89b6979
input_common, common: Add a few functions
These functions include reloading udp client, testing communication and configuring calibration. I also added a function to common/thread.h to use WaitFor.
2018-08-11 14:09:35 +08:00
Merry
d1c364bb85
Merge pull request #4073 from zhaowenlan1779/port-yuzu-988
Port "common/color: Minor cleanup" from yuzu
2018-08-10 21:18:01 +01:00
Lioncash
23e8dd66c4 math_util: Always initialize members of Rectangle
Prevents potentially using the members uninitialized.
2018-08-10 10:11:25 +08:00
Lioncash
319d685b13 common/color: Remove unnecessary const qualifiers on return types
These are just superfluous and not necessesary
2018-08-10 09:35:28 +08:00
Lioncash
b956a2be1c common/color: Get rid of undefined behavior
Gets rid of type punning via reinterpret_cast within functions. Instead,
we use memcpy to transfer the contents across types.
2018-08-10 09:35:27 +08:00
Lioncash
0495ba5d91 file_util: Avoid sign-conversions in WriteArray() and ReadArray()
Prevents compiler warnings.
2018-08-08 15:45:31 +08:00
James Rowe
c35a251d86
Merge pull request #3985 from BreadFish64/fix-warnings
core: clean up warnings
2018-08-02 11:14:57 -06:00
James Rowe
14b0435df2
Merge pull request #3994 from FearlessTobi/replace-clamp-functions
Remove MathUtil::Clamp and replace it with its std:: counterpart
2018-08-02 11:08:07 -06:00
James Rowe
c771dd9813
Merge pull request #4021 from FearlessTobi/port-709
Port #709 from yuzu: "common/misc: Deduplicate code in GetLastErrorMsg()
2018-08-02 11:00:53 -06:00
BreadFish64
aa4b71d0ce update fmt to latest stable release
5.1.0
fixes a multitude of errors on MSVC
2018-08-01 14:10:24 -05:00
Merry
ba6eee71f5
Merge pull request #4024 from zhaowenlan1779/port-yuzu-745
Port yuzu-emu/yuzu#745 from yuzu
2018-08-01 15:02:40 +01:00
Lioncash
b92af5a858
param_package: Take std::string by value in string-based Set() function
Allows avoiding string copies by letting the strings be moved into the
function calls.
2018-08-01 17:21:11 +08:00
Merry
9af731793a
Merge pull request #4025 from zhaowenlan1779/port-yuzu-775
Port "string_util: Minor changes" from yuzu
2018-07-30 18:28:38 +01:00