Commit graph

8301 commits

Author SHA1 Message Date
Lioncash
88597535d6 core: Make the main System class use the PImpl idiom
core.h is kind of a massive header in terms what it includes within
itself. It includes VFS utilities, kernel headers, file_sys header,
ARM-related headers, etc. This means that changing anything in the
headers included by core.h essentially requires you to rebuild almost
all of core.

Instead, we can modify the System class to use the PImpl idiom, which
allows us to move all of those headers to the cpp file and forward
declare the bulk of the types that would otherwise be included, reducing
compile times. This change specifically only performs the PImpl portion.
2018-08-31 07:16:57 -04:00
bunnei
bb49036b76 Merge pull request #1198 from lioncash/kernel
kernel: Eliminate kernel global state
2018-08-30 10:02:50 -04:00
bunnei
53bf73fa4b Merge pull request #1202 from FearlessTobi/port-3825
Port #3825 from Citra: "travis: share environment variables with Docker"
2018-08-30 09:54:32 -04:00
bunnei
2e59406c72 Merge pull request #1172 from tech4me/impl_iadd3
Shaders: Implemented IADD3
2018-08-30 09:52:27 -04:00
tech4me
6df9c631c2 Shaders: Implemented IADD3 2018-08-29 13:44:41 -04:00
fearlessTobi
8ba6aaf849 Remove Citra specific variable 2018-08-29 15:29:37 +02:00
liushuyu
9ec16f734a travis: share env variables with Docker 2018-08-29 15:28:13 +02:00
Lioncash
4913549d6b kernel: Eliminate kernel global state
As means to pave the way for getting rid of global state within core,
This eliminates kernel global state by removing all globals. Instead
this introduces a KernelCore class which acts as a kernel instance. This
instance lives in the System class, which keeps its lifetime contained
to the lifetime of the System class.

This also forces the kernel types to actually interact with the main
kernel instance itself instead of having transient kernel state placed
all over several translation units, keeping everything together. It also
has a nice consequence of making dependencies much more explicit.

This also makes our initialization a tad bit more correct. Previously we
were creating a kernel process before the actual kernel was initialized,
which doesn't really make much sense.

The KernelCore class itself follows the PImpl idiom, which allows
keeping all the implementation details sealed away from everything else,
which forces the use of the exposed API and allows us to avoid any
unnecessary inclusions within the main kernel header.
2018-08-28 22:31:51 -04:00
bunnei
124c5b77ad Merge pull request #1193 from lioncash/priv
gpu: Make memory_manager private
2018-08-28 12:28:57 -04:00
bunnei
6fd07fa8d3 Merge pull request #1192 from lioncash/unused
gl_rasterizer: Remove unused variables
2018-08-28 12:28:13 -04:00
bunnei
fbbcb38b3d Merge pull request #1191 from lioncash/noexcept
hle/result: Make ResultVal's move constructor as noexcept
2018-08-28 12:27:48 -04:00
bunnei
e7add3c300 Merge pull request #1194 from lioncash/alloc
gl_shader_cache: Remove unused program_code vector in GetShaderAddress()
2018-08-28 11:27:44 -04:00
Lioncash
33943e0928 gl_shader_cache: Remove unused program_code vector in GetShaderAddress()
Given std::vector is a type with a non-trivial destructor, this
variable cannot be optimized away by the compiler, even if unused.
Because of that, something that was intended to be fairly lightweight,
was actually allocating 32KB and deallocating it at the end of the
function.
2018-08-28 11:20:41 -04:00
Lioncash
b4a81f9bca gpu: Make memory_manager private
Makes the class interface consistent and provides accessors for
obtaining a reference to the memory manager instance.

Given we also return references, this makes our more flimsy uses of
const apparent, given const doesn't propagate through pointers in the
way one would typically expect. This makes our mutable state more
apparent in some places.
2018-08-28 11:11:50 -04:00
Lioncash
a08b7d9e11 gl_rasterizer: Remove unused variables 2018-08-28 10:46:29 -04:00
bunnei
5c66212201 Merge pull request #1190 from FearlessTobi/im-so-retarded
yuzu: Fix two stupid errors made in #1141
2018-08-28 09:57:05 -04:00
Lioncash
be902fe06e hle/result: Make ResultVal's move constructor as noexcept
Many containers within the standard library provide different behaviors
based on whether or not a move constructor/assignment operator can be
guaranteed not to throw or not.

Notably, implementations will generally use std::move_if_noexcept (or an
internal implementation of it) to provide strong exception guarantees.
If a move constructor potentially throws (in other words, is not
noexcept), then certain behaviors will create copies, rather than moving
the values.

For example, consider std::vector. When a std::vector calls resize(),
there are two ways the elements can be relocated to the new block of
memory (if a reallocation happens), by copy, or by moving the existing
elements into the new block of memory. If a type does not have a
guarantee that it will not throw in the move constructor, a copy will
happen. However, if it can be guaranteed that the move constructor won't
throw, then the elements will be moved.

This just allows ResultVal to be moved instead of copied all the time if
ever used in conjunction with containers for whatever reason.
2018-08-28 09:39:50 -04:00
fearlessTobi
5eba42402e Fix two stupid errors made in #1141 2018-08-28 15:16:03 +02:00
bunnei
f727e5f0de Merge pull request #1165 from bunnei/shader-cache
renderer_opengl: Implement a new shader cache.
2018-08-27 20:35:58 -04:00
bunnei
e0ee49217d Merge pull request #1189 from FearlessTobi/fix-stick-directions
yuzu: Fix input UI direction order for the right stick
2018-08-27 19:16:23 -04:00
fearlessTobi
a872444869 yuzu: Fix stick UI direction order 2018-08-28 00:59:21 +02:00
bunnei
1f06fb1ff2 Merge pull request #1177 from lioncash/err
kernel/error: Amend several error codes
2018-08-27 18:37:48 -04:00
bunnei
22a22cec64 renderer_opengl: Implement a new shader cache. 2018-08-27 18:26:46 -04:00
bunnei
4dd06095a7 gl_rasterizer_cache: Update to use RasterizerCache base class. 2018-08-27 18:26:46 -04:00
bunnei
3e58cfc5e6 video_core: Add RasterizerCache class for common cache management code. 2018-08-27 18:26:45 -04:00
bunnei
59003a3ea2 Merge pull request #1169 from Lakumakkara/sel
shader_bytecode: fix SEL_IMM bitstring
2018-08-27 18:24:57 -04:00
bunnei
64a421947a Merge pull request #1188 from lioncash/unused
vfs_real: Remove unused variable in CreateDirectoryRelative()
2018-08-27 18:24:23 -04:00
bunnei
e222e19f33 Merge pull request #1170 from lioncash/ret
file_util: Correct return value in early exit of ReadFileToString()
2018-08-27 18:18:31 -04:00
bunnei
6434cdbfc0 Merge pull request #1175 from lioncash/ns
core: Namespace all code in the arm subdirectory under the Core namespace
2018-08-27 18:17:12 -04:00
bunnei
fd6d22b311 Merge pull request #1187 from lioncash/shadow
registered_cache: Get rid of variable shadowing in ProcessFiles()
2018-08-27 18:15:49 -04:00
Lioncash
402118fae3 vfs_real: Remove unused variable in CreateDirectoryRelative() 2018-08-27 15:58:23 -04:00
Lioncash
02030bad92 registered_cache: Get rid of variable shadowing in ProcessFiles()
Prevents compiler warnings.
2018-08-27 15:55:56 -04:00
bunnei
03cc44a178 Merge pull request #1128 from DarkLordZach/malformed-hex-crash
hex_util: Replace logic_errors with LOG_CRITICAL
2018-08-27 15:45:22 -04:00
bunnei
8f8fe329ca Merge pull request #1176 from lioncash/info
svc: Return process title ID if queried in GetInfo()
2018-08-27 15:44:52 -04:00
bunnei
3d857a52e9 Merge pull request #1174 from lioncash/debug
debug_utils: Minor individual interface changes
2018-08-27 15:44:29 -04:00
bunnei
7c523f39c5 Merge pull request #1162 from ogniK5377/ttf-plu
PL:U Added SharedFonts loading via TTF
2018-08-27 15:43:10 -04:00
bunnei
3494bcd921 Merge pull request #1168 from lioncash/header
hid: Move core include to cpp file
2018-08-27 15:42:52 -04:00
bunnei
1cf204712c Merge pull request #1171 from lioncash/true
core: Remove always true conditionals in Load()
2018-08-27 15:41:58 -04:00
bunnei
ebd17d98b6 Merge pull request #1180 from tech4me/languagecode_fix
set: Fixed GetAvailableLanguageCodes() to follow the max_entries
2018-08-27 15:41:38 -04:00
tech4me
7ae21a7cdd set: Fixed GetAvailableLanguageCodes() to follow the max_entries
Rightnow, in games use GetAvailableLanguageCodes(), there is a WriteBuffer() with size larger than the buffer_size. (Core Critical core\hle\kernel\hle_ipc.cpp:WriteBuffer:296: size (0000000000000088) is greater than buffer_size (0000000000000078))

0x88 = 17(languages) * 8
0x78 = 15(languages) * 8

GetAvailableLanguageCodes() can only support 15 languages.
After firmware 4.0.0 there are 17 supported language instead of 15, to enable this GetAvailableLanguageCodes2() need to be used.
So GetAvailableLanguageCodes() will be caped at 15 languages.
Reference:
http://switchbrew.org/index.php/Settings_services
2018-08-26 00:11:13 -07:00
bunnei
5972e46f57 Merge pull request #1173 from lioncash/batch
maxwell3d: Move FinishedPrimitiveBatch event after AcceleratedDrawBatch()
2018-08-25 10:59:54 -04:00
bunnei
360028e94d Merge pull request #1167 from lioncash/assert
gl_rasterizer: Correct assertion condition in SyncLogicOpState()
2018-08-25 10:50:59 -04:00
Lioncash
8eb062bba4 kernel/error: Amend error code for ERR_MAX_CONNECTIONS_REACHED
We can make this error code an alias of the resource limit exceeded
error code, allowing us to get rid of the lingering 3DS error code of
the same type.
2018-08-25 09:40:42 -04:00
Lioncash
4c6743a155 kernel/error: Amend error code for ERR_PORT_NAME_TOO_LONG
We can treat this as an alias of TooLarge for documentation purposes.
This also lets us get rid of another lingering 3DS-related error code.
2018-08-25 09:40:29 -04:00
Lioncash
ce900c1cb8 kernel/error: Add error code for the handle table being full
This replaces the lingering 3DS constant with the proper one, and
utilizes it within HandleTable's Create() member function.
2018-08-25 09:40:21 -04:00
Lioncash
d97ec0683f kernel/error: Add error code for invalid memory permissions 2018-08-25 09:40:12 -04:00
Lioncash
eec7892cad kernel/error: Correct kernel error code for invalid combination 2018-08-25 09:40:00 -04:00
Sebastian Valle
b151ff8867 Merge pull request #1166 from lioncash/typo
filesystem: Fix typo in log message
2018-08-25 07:19:46 -05:00
Lioncash
d99d679e9e svc: Return process title ID if queried in GetInfo()
We already have the variable itself set up to perform this task, so we
can just return its value from the currently executing process instead
of always stubbing it to zero.
2018-08-25 05:02:28 -04:00
Mat M
80937ec31a Merge pull request #1094 from DarkLordZach/nax0
file_sys: Add support for NAX archives
2018-08-24 23:47:46 -04:00