Commit Graph

9326 Commits

Author SHA1 Message Date
ReinUsesLisp 53c06f089d shader_decode: Fixup XMAD 2019-01-15 17:54:53 -03:00
ReinUsesLisp 1be12d5819 shader_ir: Pass to decoder functions basic block's code 2019-01-15 17:54:53 -03:00
ReinUsesLisp 719c83a4c2 shader_decode: Improve zero flag implementation 2019-01-15 17:54:53 -03:00
ReinUsesLisp c75f5c634a shader_ir: Remove composite primitives and use temporals instead 2019-01-15 17:54:53 -03:00
ReinUsesLisp 960b0f653a gl_shader_decompiler: Fixup AssignCompositeHalf 2019-01-15 17:54:53 -03:00
ReinUsesLisp 92610e9705 shader_decode: Use proper primitive names 2019-01-15 17:54:53 -03:00
ReinUsesLisp 44fce20a01 shader_decode: Use BitfieldExtract instead of shift + and 2019-01-15 17:54:53 -03:00
ReinUsesLisp 26d519c0f6 shader_ir: Remove Ipa primitive 2019-01-15 17:54:53 -03:00
ReinUsesLisp 0a9aa9f8db gl_shader_decompiler: Use rasterizer's UBO size limit 2019-01-15 17:54:53 -03:00
ReinUsesLisp 16dee3d290 gl_shader_gen: Fixup code formatting 2019-01-15 17:54:53 -03:00
ReinUsesLisp 685996eabb video_core: Rename glsl_decompiler to gl_shader_decompiler 2019-01-15 17:54:53 -03:00
ReinUsesLisp 8df3fb8b1e shader_ir: Remove RZ and use Register::ZeroIndex instead 2019-01-15 17:54:53 -03:00
ReinUsesLisp 35724f3435 shader_decode: Implement TEXS.F16 2019-01-15 17:54:53 -03:00
ReinUsesLisp afa9967c4a shader_decode: Fixup R2P 2019-01-15 17:54:53 -03:00
ReinUsesLisp be9d40cf0d glsl_decompiler: Fixup TLDS 2019-01-15 17:54:53 -03:00
ReinUsesLisp d08982ed56 glsl_decompiler: Fixup geometry shaders 2019-01-15 17:54:53 -03:00
ReinUsesLisp a90860a63a shader_decode: Fixup WriteLogicOperation zero comparison 2019-01-15 17:54:53 -03:00
ReinUsesLisp afbbc154d0 glsl_decompiler: Fixup permissive member function declarations 2019-01-15 17:54:53 -03:00
ReinUsesLisp 1314fd5277 shader_decode: Fixup PSET 2019-01-15 17:54:53 -03:00
ReinUsesLisp 495fbb2096 shader_decode: Fixup clang-format 2019-01-15 17:54:53 -03:00
ReinUsesLisp 0b1a2a74b6 video_core: Implement IR based geometry shaders 2019-01-15 17:54:53 -03:00
ReinUsesLisp 095b8f822b shader_decode: Implement VMAD and VSETP 2019-01-15 17:54:53 -03:00
ReinUsesLisp a71ce91f9b shader_decode: Implement HSET2 2019-01-15 17:54:53 -03:00
ReinUsesLisp 5896358e4a shader_decode: Rework HSETP2 2019-01-15 17:54:53 -03:00
ReinUsesLisp e0971b5f9c shader_decode: Implement R2P 2019-01-15 17:54:53 -03:00
ReinUsesLisp 8f2327d84b shader_decode: Implement CSETP 2019-01-15 17:54:52 -03:00
ReinUsesLisp da25db6829 shader_decode: Implement PSET 2019-01-15 17:54:52 -03:00
ReinUsesLisp 54bffa5381 shader_decode: Implement HFMA2 2019-01-15 17:54:52 -03:00
ReinUsesLisp 17b2a1d2b0 glsl_decompiler: Remove HNegate inlining 2019-01-15 17:54:52 -03:00
ReinUsesLisp 9cf3fe7511 shader_decode: Implement POPC 2019-01-15 17:54:52 -03:00
ReinUsesLisp 43dffc4afc shader_decode: Implement TLDS (untested) 2019-01-15 17:54:52 -03:00
ReinUsesLisp 8e4e4c60cd shader_decode: Update TLD4 reflecting #1862 changes 2019-01-15 17:54:52 -03:00
ReinUsesLisp fb53e79b7f shader_ir: Fixup TEX and TEXS and partially fix TLD4 decompiling 2019-01-15 17:54:52 -03:00
ReinUsesLisp 8664c00a2e shader_decode: Fixup FSET 2019-01-15 17:54:52 -03:00
ReinUsesLisp bdfa3b5fe9 shader_decode: Implement IADD32I 2019-01-15 17:54:52 -03:00
ReinUsesLisp bcf228b15c shader_decode: Fixup clang-format 2019-01-15 17:54:52 -03:00
ReinUsesLisp dc93729f47 video_core: Return safe values after an assert hits 2019-01-15 17:54:52 -03:00
ReinUsesLisp dbf4c5264b shader_decode: Implement FFMA 2019-01-15 17:54:52 -03:00
ReinUsesLisp 568d9a2a7b video_core: Address feedback 2019-01-15 17:54:52 -03:00
ReinUsesLisp 8ef8fd8188 shader_ir: Fixup file inclusions and clang-format 2019-01-15 17:54:52 -03:00
Mat M 15a03ee53f shader_ir: Move comment node string
Co-Authored-By: ReinUsesLisp <reinuseslisp@airmail.cc>
2019-01-15 17:54:52 -03:00
ReinUsesLisp 4e8b1bf07a shader_ir: Address feedback to avoid UB in bit casting 2019-01-15 17:54:52 -03:00
ReinUsesLisp 6e4aad30c9 shader_decode: Fixup clang-format 2019-01-15 17:54:52 -03:00
ReinUsesLisp 497d16bdf1 shader_decode: Implement LEA 2019-01-15 17:54:52 -03:00
ReinUsesLisp 368b588c7f shader_decode: Implement IADD3 2019-01-15 17:54:52 -03:00
ReinUsesLisp 37de0d1560 shader_decode: Implement LOP3 2019-01-15 17:54:52 -03:00
ReinUsesLisp 40e9335807 shader_decode: Implement ST_L 2019-01-15 17:54:52 -03:00
ReinUsesLisp af828ce72c shader_decode: Implement LD_L 2019-01-15 17:54:52 -03:00
ReinUsesLisp b3c02a5a4e shader_decode: Implement HSETP2 2019-01-15 17:54:52 -03:00
ReinUsesLisp 60d4f9d95d shader_decode: Implement HADD2 and HMUL2 2019-01-15 17:54:52 -03:00
ReinUsesLisp 54a153a786 shader_decode: Implement HADD2_IMM and HMUL2_IMM 2019-01-15 17:54:52 -03:00
ReinUsesLisp 4c506f195a shader_decode: Implement MOV_SYS 2019-01-15 17:54:52 -03:00
ReinUsesLisp 966f3ba473 shader_decode: Implement IMNMX 2019-01-15 17:54:52 -03:00
ReinUsesLisp 68ae98c2ee shader_decode: Implement F2F_C 2019-01-15 17:54:52 -03:00
ReinUsesLisp 039f4d79e5 shader_decode: Implement I2I 2019-01-15 17:54:52 -03:00
ReinUsesLisp 5888937b4f shader_decode: Implement BRA internal flag 2019-01-15 17:54:52 -03:00
ReinUsesLisp 00635651b5 shader_decode: Implement ISCADD 2019-01-15 17:54:52 -03:00
ReinUsesLisp 2b743cc96d shader_decode: Implement XMAD 2019-01-15 17:54:51 -03:00
ReinUsesLisp 364a7e98a1 shader_decode: Implement PBK and BRK 2019-01-15 17:54:51 -03:00
ReinUsesLisp 7dacc87b43 shader_decode: Implement LOP 2019-01-15 17:54:51 -03:00
ReinUsesLisp 37f6b017a0 shader_decode: Implement SEL 2019-01-15 17:54:51 -03:00
ReinUsesLisp 44787c1070 shader_decode: Implement IADD 2019-01-15 17:54:51 -03:00
ReinUsesLisp ed53fd9dbb shader_decode: Implement ISETP 2019-01-15 17:54:51 -03:00
ReinUsesLisp 9516ef648d shader_decode: Implement BFI 2019-01-15 17:54:51 -03:00
ReinUsesLisp 1fa5026f8d shader_decode: Implement ISET 2019-01-15 17:54:51 -03:00
ReinUsesLisp 3d2bc3b2a6 shader_decode: Implement LD_C 2019-01-15 17:54:51 -03:00
ReinUsesLisp df7101ea73 shader_decode: Implement SHL 2019-01-15 17:54:51 -03:00
ReinUsesLisp 87086ae3d6 shader_decode: Implement SHR 2019-01-15 17:54:51 -03:00
ReinUsesLisp 9aed1ef451 shader_decode: Implement LOP32I 2019-01-15 17:54:51 -03:00
ReinUsesLisp 5d71064f60 shader_decode: Implement BFE 2019-01-15 17:54:51 -03:00
ReinUsesLisp 6d21611470 shader_decode: Implement FSET 2019-01-15 17:54:51 -03:00
ReinUsesLisp 22618d59df shader_decode: Implement F2I 2019-01-15 17:54:51 -03:00
ReinUsesLisp d373f13b8a shader_decode: Implement I2F 2019-01-15 17:54:51 -03:00
ReinUsesLisp e456e2c1f3 shader_decode: Implement F2F 2019-01-15 17:54:50 -03:00
ReinUsesLisp d72735028d shader_decode: Stub DEPBAR 2019-01-15 17:54:50 -03:00
ReinUsesLisp 6f10bfaa08 shader_decode: Implement SSY and SYNC 2019-01-15 17:54:50 -03:00
ReinUsesLisp fc0b3219fd shader_decode: Implement PSETP 2019-01-15 17:54:50 -03:00
ReinUsesLisp 839abe1408 shader_decode: Implement TMML 2019-01-15 17:54:50 -03:00
ReinUsesLisp 0425f475d5 shader_decode: Implement TEX and TXQ 2019-01-15 17:54:50 -03:00
ReinUsesLisp c8d0937ae5 shader_decode: Implement TEXS (F32) 2019-01-15 17:54:50 -03:00
ReinUsesLisp ec28320c14 shader_decode: Implement FSETP 2019-01-15 17:54:50 -03:00
ReinUsesLisp 3aa53e3c01 shader_decode: Partially implement BRA 2019-01-15 17:54:50 -03:00
ReinUsesLisp 0398f7d0a4 shader_decode: Implement IPA 2019-01-15 17:54:50 -03:00
ReinUsesLisp bc5992fccb shader_decode: Implement EXIT 2019-01-15 17:54:50 -03:00
ReinUsesLisp efda47fa37 shader_decode: Implement ST_A 2019-01-15 17:54:50 -03:00
ReinUsesLisp 0673f11907 shader_decode: Implement LD_A 2019-01-15 17:54:50 -03:00
ReinUsesLisp b7b08104e5 shader_decode: Implement FADD32I 2019-01-15 17:54:50 -03:00
ReinUsesLisp 0b08169b9d shader_decode: Implement FMUL32_IMM 2019-01-15 17:54:50 -03:00
ReinUsesLisp 4e1582eed1 shader_decode: Implement MOV32_IMM 2019-01-15 17:54:50 -03:00
ReinUsesLisp b558235ec6 shader_decode: Stub RRO_C, RRO_R and RRO_IMM 2019-01-15 17:54:50 -03:00
ReinUsesLisp cb19ed0316 shader_decode: Implement FMNMX_C, FMNMX_R and FMNMX_IMM 2019-01-15 17:54:50 -03:00
ReinUsesLisp 12d5281eff shader_decode: Implement MUFU 2019-01-15 17:54:50 -03:00
ReinUsesLisp bdafb25d16 shader_decode: Implement FADD_C, FADD_R and FADD_IMM 2019-01-15 17:54:50 -03:00
ReinUsesLisp aa64616724 shader_decode: Implement FMUL_C, FMUL_R and FMUL_IMM 2019-01-15 17:54:50 -03:00
ReinUsesLisp 42b7053aa4 shader_decode: Implement MOV_C and MOV_R 2019-01-15 17:54:50 -03:00
ReinUsesLisp 19ca02d47b video_core: Replace gl_shader_decompiler 2019-01-15 17:54:50 -03:00
ReinUsesLisp 5678498dfd glsl_decompiler: Implementation 2019-01-15 17:54:50 -03:00
ReinUsesLisp 74ee18de5e shader_ir: Add condition code helper 2019-01-15 17:54:50 -03:00
ReinUsesLisp 283dd9fb61 shader_ir: Add predicate combiner helper 2019-01-15 17:54:49 -03:00
ReinUsesLisp d28033adca shader_ir: Add comparison helpers 2019-01-15 17:54:49 -03:00
ReinUsesLisp c0d053482c shader_ir: Add half float helpers 2019-01-15 17:54:49 -03:00
ReinUsesLisp e46dd3ce5f shader_ir: Add integer helpers 2019-01-15 17:54:49 -03:00
ReinUsesLisp b91929bf10 shader_ir: Add float helpers 2019-01-15 17:54:49 -03:00
ReinUsesLisp 83e750c9ae shader_ir: Add setters 2019-01-15 17:54:49 -03:00
ReinUsesLisp 394f906044 shader_ir: Add local memory getters 2019-01-15 17:54:49 -03:00
ReinUsesLisp 311d1af657 shader_ir: Add internal flag getters 2019-01-15 17:54:49 -03:00
ReinUsesLisp a66682374f shader_ir: Add attribute getters 2019-01-15 17:54:49 -03:00
ReinUsesLisp 9d5d96500c shader_ir: Add constant buffer getters 2019-01-15 17:54:49 -03:00
ReinUsesLisp 7f89f99c60 shader_ir: Add register getter 2019-01-15 17:54:49 -03:00
ReinUsesLisp f43041efe1 shader_ir: Add immediate node constructors 2019-01-15 17:54:49 -03:00
ReinUsesLisp 25f868d8be shader_ir: Initial implementation 2019-01-15 17:54:49 -03:00
ReinUsesLisp 2b5088a8e9 shader_bytecode: Fixup encoding 2019-01-15 17:54:49 -03:00
ReinUsesLisp f03f054819 shader_header: Make local memory size getter constant 2019-01-15 17:54:49 -03:00
Otávio Pace 9cff0d2ff8 audio_core: remove unnecessary spaces on comments 2019-01-14 00:22:05 -02:00
bunnei e3e62ddf7e Merge pull request #1848 from FreddyFunk/QJsonArray
game_list: Remove a reference of a reference
2019-01-12 02:01:13 -05:00
bunnei b75c0bcec0 Merge pull request #1959 from DarkLordZach/custom-rtc
settings: Add support for setting the RTC manually
2019-01-10 17:05:21 -05:00
bunnei ea894adaf5 Merge pull request #1939 from DarkLordZach/web-applet
applets: Implement HLE web browser applet (LibAppletOff)
2019-01-10 17:04:38 -05:00
ReinUsesLisp 4495d76090 gl_rasterizer: Workaround Intel VAO DSA bug
There is a bug on Intel's blob driver where it fails to properly build a
vertex array object if it's not bound even after creating it with
glCreateVertexArrays. This workaround binds it after creating it to
bypass the issue.
2019-01-09 02:40:19 -03:00
ReinUsesLisp 0bde2e5fc1 gl_global_cache: Add dummy global cache manager 2019-01-08 17:47:45 -03:00
Zach Hilman d73f33373b settings: Fix comment structure 2019-01-07 19:40:28 -05:00
Zach Hilman 63e948f483 settings: Use std::chrono::seconds instead of s64 for RTC 2019-01-07 19:19:40 -05:00
Zach Hilman 921ea45baf time: Use custom RTC settings if applicable for game 2019-01-07 19:19:40 -05:00
Zach Hilman 686e0ad7d0 core: Set custom RTC differential on game boot 2019-01-07 19:19:40 -05:00
Zach Hilman 1f1c7f57a1 qt: Provide UI to edit custom RTC settings 2019-01-07 19:19:40 -05:00
Zach Hilman ac7b60b61b settings: Add custom RTC settings
Stored as signed seconds since epoch.
2019-01-07 19:18:45 -05:00
ReinUsesLisp 33e53c7893 gl_rasterizer: Skip framebuffer configuration if rendertargets have not been changed 2019-01-07 16:23:23 -03:00
bunnei 05929b3674 Merge pull request #1999 from ReinUsesLisp/dirty-shader
gl_shader_cache: Use dirty flags for shaders
2019-01-07 14:22:30 -05:00
ReinUsesLisp 1c8411dc8d gl_rasterizer_cache: Use dirty flags for the depth buffer 2019-01-07 16:22:28 -03:00
ReinUsesLisp 6e932fe118 gl_rasterizer_cache: Use dirty flags for color buffers 2019-01-07 16:20:39 -03:00
ReinUsesLisp 5fec808e30 gl_shader_cache: Use dirty flags for shaders 2019-01-07 16:13:12 -03:00
bunnei d01ea362ae Merge pull request #1989 from lioncash/set
service/vi: Unstub IApplicationDisplayService's SetLayerScalingMode
2019-01-07 12:59:33 -05:00
bunnei 8443f3f9dc Merge pull request #1992 from DarkLordZach/move-profile-manager-ui
qt: Move profile manager to own UI tab
2019-01-07 11:41:37 -05:00
bunnei ecb3fbe75f Merge pull request #1990 from ReinUsesLisp/copy-surface-stream-copy
gl_rasterizer_cache: Use GL_STREAM_COPY for PBOs
2019-01-07 11:34:05 -05:00
ReinUsesLisp a17b13ac37 gl_stream_buffer: Use DSA for buffer management 2019-01-06 16:49:24 -03:00
ReinUsesLisp fe889fb55b gl_rasterizer: Use DSA for vertex array objects 2019-01-06 16:49:24 -03:00
ReinUsesLisp 5ba137cdfe gl_state: Drop uniform buffer state tracking 2019-01-06 00:28:01 -03:00
ReinUsesLisp 8536bb5cfe gl_rasterizer_cache: Use GL_STREAM_COPY for PBOs
Since the data is doing the path CPU -> GPU -> GPU copy is the most
approximate hint. Using GL_STREAM_DRAW generated a performance warning
on Nvidia's stack. Changing this hint removed the warning.
2019-01-05 02:27:55 -03:00
bunnei ea7c477b8a Merge pull request #1988 from lioncash/res
service/vi: Correct reported dimensions from IApplicationDisplayService's GetDisplayResolution()
2019-01-05 00:26:29 -05:00
Lioncash 996c75a63b service/vi: Correct scaling mode conversions
These values are not equivalent, based off RE. The internal value is put
into a lookup table with the following values:

[3, 0, 1, 2, 4]

So the values absolutely do not map 1:1 like the comment was indicating.
2019-01-04 21:45:18 -05:00
Lioncash a45f62bb1c service/vi: Factor out scaling mode conversions from the IPC function itself
Avoids entangling the IPC buffer appending with the actual operation of
converting the scaling values over. This also inserts the proper error
handling for invalid scaling values.
2019-01-04 21:45:18 -05:00
Lioncash 817e2b7b46 service/vi: Unstub IApplicationDisplayService' SetLayerScalingMode()
This appears to only check if the scaling mode can actually be
handled, rather than actually setting the scaling mode for the layer.

This implements the same error handling performed on the passed in
values.
2019-01-04 21:45:14 -05:00
bunnei 2e641b7e12 Merge pull request #1981 from ogniK5377/open-app-area-create
Return no application area when games try to open an application area
2019-01-04 21:42:23 -05:00
bunnei a579678bac Merge pull request #1980 from ogniK5377/applet-msg-update
Proper no message handling for AM::PopMessage
2019-01-04 21:42:12 -05:00
Lioncash 42e7c66a3d service/vi: Correct reported dimensions from IApplicationDisplayService's GetDisplayResolution()
Within the actual service, it makes no distinguishing between docked and
undocked modes. This will always return the constants values reporting
1280x720 as the dimensions.
2019-01-04 19:13:32 -05:00
Zach Hilman fe91364e29 qt: Move profile manager to own UI tab 2019-01-04 17:32:13 -05:00
David Marcec d0aaf94244 Removed pulse event type
Pulse is considered a hack and nothing should be using it. We should completely remove it
2019-01-04 20:47:20 +11:00
bunnei b62c60dc3b Merge pull request #1975 from lioncash/vi
service/vi: Minor updates and corrections to the DisplayInfo struct
2019-01-03 22:45:27 -05:00
David Marcec c7ba3312f4 Return no application area when games try to open an application area
This will prompt CreateApplicationArea
2019-01-04 13:22:25 +11:00
David Marcec a8c8b14c6c Proper no message handling for AM::PopMessage
When we have no messages, we should be returning an error code.
2019-01-04 13:11:17 +11:00
David Marcec b57e173bac Fixed botw deadlock(and possibly 30 fps games rendering too fast? needs testing to confirm)
Upon investigating the issue with #1878, I found that games are the ones who handle the vsync event resetting and not us.
2019-01-03 20:32:47 +11:00
bunnei ee00b44d13 Merge pull request #1976 from lioncash/display
service/vi: Implement OpenDefaultDisplay in terms of OpenDisplay
2019-01-02 21:51:20 -05:00
bunnei a5c8bed9ee Merge pull request #1978 from lioncash/enabled
service/vi: Implement SetDisplayEnabled()
2019-01-02 21:34:12 -05:00
bunnei 9f73394f70 Merge pull request #1942 from DarkLordZach/profile-select-game-boot
qt: Add setting to prompt for user on game boot
2019-01-02 21:05:27 -05:00
bunnei a9a9278360 Merge pull request #1941 from DarkLordZach/profile-select-save-data
qt: Use ProfileSelectionDialog when selecting user for save data
2019-01-02 21:05:02 -05:00
Lioncash a12272b695 service/vi: Implement SetDisplayEnabled()
This IPC command is simply a stub inside the actual service itself, and
just returns a successful error code regardless of input. This is likely
only retained in the service interface to not break older code that relied
upon it succeeding in some way.
2019-01-02 20:48:04 -05:00
bunnei 55d565100c Merge pull request #1977 from lioncash/vi-log
service/vi: Log more information where applicable
2019-01-02 20:36:40 -05:00
Lioncash 76a6355b56 service/vi: Log more information where applicable
In many cases, we didn't bother to log out any of the popped data
members. This logs them out to the console within the logging call to
provide more contextual information.
2019-01-02 19:42:10 -05:00
Lioncash 91431c27c8 service/vi: Implement OpenDefaultDisplay in terms of OpenDisplay
Internally within the vi services, this is essentially all that
OpenDefaultDisplay does, so it's trivial to just do the same, and
forward the default display string into the function.
2019-01-02 18:16:36 -05:00
bunnei 676d302ef4 Merge pull request #1961 from ReinUsesLisp/tex-view-2d
gl_rasterizer_cache: Texture view if shader samples array but OGL is not
2019-01-02 17:51:32 -05:00
Lioncash be02aebfd8 service/vi: Correct initial width and height values
Based off RE, it appears that almost all display types seem to use
1920x1080 except for a few (null display, edid display).
2019-01-02 17:36:03 -05:00
Lioncash 5d9baeccba service/vi: Document unknown DisplayInfo struct members
It appears that the two members indicate whether a display has a bounded
number of layers (and if set, the second member indicates the total
number of layers).
2019-01-02 17:35:58 -05:00
bunnei 180fefe448 Merge pull request #1944 from FearlessTobi/port-4187
Port citra-emu/citra#4187: "Qt/Configure: Use sidebar to divide tabs into smaller groups"
2019-01-02 17:24:38 -05:00
bunnei f20ca84f48 Merge pull request #1969 from lioncash/cast
yuzu: Fix truncation warnings within UI code
2019-01-02 17:20:52 -05:00
Lioncash 7187d20b6a yuzu/configure_general: Silence truncation warnings in loadConfiguration()
The QPixmap API expects an unsigned int.
2018-12-31 19:14:48 -05:00
Lioncash 8611e4d103 yuzu/config: Silence truncation warnings 2018-12-31 19:11:29 -05:00
Lioncash 2935c16688 core/kernel: Remove unnecessary inclusions
Gets rid of a few unnecessary header dependencies in some source files.
2018-12-31 19:04:16 -05:00
bunnei 79fe1a3513 Merge pull request #1966 from lioncash/backtrace
arm_interface: Minor cleanup
2018-12-31 11:11:00 -05:00
Lioncash 669f7ccd9d kernel/svc: Correct misleading error message within CreateThread()
This is a bounds check to ensure that the thread priority is within the
valid range of 0-64. If it exceeds 64, that doesn't necessarily mean
that an actual priority of 64 was expected (it actually means whoever
called the function screwed up their math).

Instead clarify the message to indicate the allowed range of thread
priorities.
2018-12-30 21:29:38 -05:00
Lioncash d82608d18b kernel/svc: Sanitize core number and thread priorities in CreateThread()
Now that we handle the kernel capability descriptors we can correct
CreateThread to properly check against the core and priority masks
like the actual kernel does.
2018-12-30 21:23:56 -05:00
Lioncash d81b00e4ee kernel/process: Rename GetAllowedProcessorMask() and GetAllowedThreadPriorityMask()
Makes them consistent with their kernel capability counterparts.
2018-12-30 21:09:46 -05:00
Lioncash a847292a78 kernel/svc: Simplify thread core ID sanitizing in CreateThread
Rather than use a switch here, this can be collapsed into a simple range
check, which is a little easier on the eyes.
2018-12-30 20:59:54 -05:00
Lioncash 3c36de7f43 arm_interface: Make include path relative for arm_interface.h
Makes it consistent with the rest of the includes.
2018-12-30 20:46:29 -05:00
Lioncash 9dcdcdbc01 arm_interface: Make LogBacktrace() a const member function
This function doesn't modify instance state, so it can be made const.
2018-12-30 20:44:48 -05:00
Lioncash fc4f95104d arm_interface: Mark variables as const where applicable in LogBacktrace()
Two of these variables have fixed values, so we can make that
immediately obvious from the get-go.
2018-12-30 20:43:17 -05:00
Lioncash 15b2878b20 arm_interface: Remove unnecessary semicolon
Namespaces don't require the use of a semicolon. Silences a -Wextra-semi
warning.
2018-12-30 20:41:33 -05:00
Sebastian Valle 8b4f7a9c5e Merge pull request #1956 from lioncash/process-thread
kernel/process: Start the main thread using the specified ideal core
2018-12-30 20:32:41 -05:00
bunnei 31e3f609ba Merge pull request #1847 from ogniK5377/backtrace-break
Print backtrace on svcBreak
2018-12-29 22:58:13 -05:00
bunnei f0954b6b78 Merge pull request #1964 from lioncash/time
service/time: Minor cleanup
2018-12-29 22:57:38 -05:00
ReinUsesLisp dec2113a73 gl_rasterizer_cache: Texture view if shader samples array but OGL is not
When a shader samples a texture array but that texture in OpenGL is
created without layers, use a texture view to increase the texture
hierarchy. For example, instead of binding a GL_TEXTURE_2D bind a
GL_TEXTURE_2D_ARRAY view.
2018-12-29 23:49:12 -03:00
Lioncash 27d7f8b625 service/time: Minor cleanup to GetClockSnapshot()
Moves some variables closer to their actual usage sites.
2018-12-29 21:42:13 -05:00
Lioncash 6a13d386c8 service/time: Fill in some structures and remove padding where not necessary 2018-12-29 18:26:32 -05:00
David Marcec 294399740c Moved log backtrace to arm_interface.cpp. Added printing of error code to fatal 2018-12-29 12:55:19 +11:00
Zach Hilman 543cea4c5d travis: Use correct package for linux Qt5WebEngine 2018-12-28 19:29:49 -05:00
Zach Hilman f49f3e509f web_browser: Add bounds checking to applet interface 2018-12-28 18:20:29 -05:00
bunnei 82662f374a gpu: Remove PixelFormat G8R8U and G8R8S, as they do not seem to exist.
- Fixes UI rendering issues in The Legend of Zelda: Breath of the Wild.
2018-12-28 15:36:45 -05:00
bunnei d533603cf8 Merge pull request #1958 from lioncash/audio
audio_core: Convert LOG_CRITICAL + UNREACHABLE over to UNIMPLEMENTED/UNIMPLEMENTED_MSG
2018-12-28 15:32:41 -05:00
Zach Hilman fd06e469bb main: Add main window integrations for QtWebBrowserApplet 2018-12-28 15:32:39 -05:00
Zach Hilman 58180e39ff qt: Implement Qt frontend to web browser
Using a custom reimplementation of QWebEngineView and an injector script.
2018-12-28 15:32:39 -05:00
Zach Hilman 0cbabc5ee6 core: Add getter and setter for WebBrowserApplet frontend 2018-12-28 15:32:39 -05:00
Zach Hilman 166a1b9526 frontend: Add frontend responder for web browser 2018-12-28 15:32:39 -05:00
Zach Hilman e115b53d10 applets: Implement LibAppletOff (Web) applet 2018-12-28 15:32:39 -05:00
Zach Hilman af0bf947d7 loader: Add accessor for Manual RomFS 2018-12-28 15:32:39 -05:00
Zach Hilman e342002cd2 hid: Make Hid service accessible and add GetPressState 2018-12-28 15:32:03 -05:00
Zach Hilman 94149affe0 romfs: Add SingleDiscard extraction type
Needed for manual RomFS extraction, as Full generates an extra directory and Truncated generates variable results.
2018-12-28 15:30:36 -05:00
Zach Hilman c3ce81337d am: Add size parameter to am:IStorage logging 2018-12-28 15:30:36 -05:00
Lioncash f652c969a4 audio_core: Convert LOG_CRITICAL + UNREACHABLE over to UNIMPLEMENTED/UNIMPLEMENTED_MSG
These two macros being used in tandem were used prior to the
introduction of UNIMPLEMENTED and UNIMPLEMENTED_MSG. This provides
equivalent behavior, just with less typing/reading involved.
2018-12-28 14:13:58 -05:00
Lioncash 852cb94231 kernel/process: Start the main thread using the specified ideal core
This matches kernel behavior in that processes are started using their
specified ideal core, rather than always starting on core 0.
2018-12-27 21:50:16 -05:00
Lioncash 50aed99339 kernel: Rename 'default' CPU core to 'ideal' core
This makes the naming more closely match its meaning. It's just a
preferred core, not a required default core. This also makes the usages
of this term consistent across the thread and process implementations.
2018-12-27 21:48:49 -05:00
Lioncash bf1ab3e562 kernel/thread: Move process thread initialization into process.cpp
This function isn't a general purpose function that should be exposed to
everything, given it's specific to initializing the main thread for a
Process instance.

Given that, it's a tad bit more sensible to place this within
process.cpp, which keeps it visible only to the code that actually needs
it.
2018-12-27 20:32:30 -05:00
bunnei 07aa082e2a Merge pull request #1954 from lioncash/npdm
file_sys/program_metadata: Print out more descriptive address space descriptions
2018-12-27 19:58:36 -05:00
Lioncash a72bda4ecc file_sys/program_metadata: Print out more descriptive address space descriptions
Provides extra information that makes it easier to tell if an executable
being run is using a 36-bit address space or a 39-bit address space.
While we don't support AArch32 executables yet, this also puts in
distinguishing information for the 32-bit address space types as well.
2018-12-27 19:16:45 -05:00
spycrab 8a5f6de6c8 Qt/Configure: Use sidebar to divide tabs into smaller groups 2018-12-28 01:14:57 +01:00
Lioncash e835034c17 kernel/process: Remove most allocation functions from Process' interface
In all cases that these functions are needed, the VMManager can just be
retrieved and used instead of providing the same functions in Process'
interface.

This also makes it a little nicer dependency-wise, since it gets rid of
cases where the VMManager interface was being used, and then switched
over to using the interface for a Process instance. Instead, it makes
all accesses uniform and uses the VMManager instance for all necessary
tasks.

All the basic memory mapping functions did was forward to the Process'
VMManager instance anyways.
2018-12-27 19:08:47 -05:00
Rodolfo Bogado aa86cd851e Add missing uintBitsToFloat to SetRegisterToHalfFloat 2018-12-27 14:39:10 -03:00
bunnei 25a218248a Merge pull request #1928 from lioncash/caps
kernel: Handle kernel capability descriptors
2018-12-27 11:15:34 -05:00
bunnei dad1c81676 Merge pull request #1892 from Tinob/master
Improve Zero flag implementation
2018-12-27 11:06:59 -05:00
bunnei 3341118585 Merge pull request #1929 from bunnei/fix-hid
hid: Fix SetNpadJoyHoldType and improve logging.
2018-12-27 11:04:56 -05:00
bunnei d73812d06b Merge pull request #1945 from bunnei/fix-hid-horiz
npad: Remove code to invert input in horizontal mode.
2018-12-27 11:04:40 -05:00
bunnei 959e977ce3 Merge pull request #1949 from lioncash/unmap
kernel/vm_manager: Reset region attributes when unmapping a VMA
2018-12-27 11:04:26 -05:00
Zach Hilman 9121887ae4 am: Implement GetSaveDataSize and ExtendSaveData
These functions come in a pair and are needed by Smash Ultimate, Minecraft, and Skyrim, amongst others.
2018-12-27 00:18:00 -05:00
Zach Hilman 346c6291df filesystem: Populate save data sizes from control data 2018-12-27 00:18:00 -05:00
Zach Hilman cfb21a8781 savedata_factory: Partially implement IVFC save sizes using files
This stores a file in the save directory called '.yuzu_save_size' which stores the two save sizes (normal area and journaled area) sequentially as u64s.
2018-12-27 00:18:00 -05:00
Zach Hilman 8916266110 loader: Add accessor for game control data 2018-12-27 00:16:55 -05:00
Zach Hilman 80ae27c5fc control_metadata: Update NACP fields with latest Switchbrew data 2018-12-27 00:16:55 -05:00
Zach Hilman 8e1160d668 control_metadata: Use value member instead of unique_ptr to store struct
Serves no actual purpose in this instance besides making NACP's copy assignment deleted, which is not intended behavior.
2018-12-27 00:16:55 -05:00
Zach Hilman f6755b94db vfs: Add reinterpret_casts to WriteArray and Object
Allows these functions to compile when T is not u8.
2018-12-27 00:16:55 -05:00
bunnei 1695b504b0 Merge pull request #1946 from lioncash/decl
renderer_opengl: Correct forward declaration of FramebufferLayout
2018-12-26 20:39:54 -05:00
bunnei 4b7d8b536d Merge pull request #1948 from lioncash/translatable
configure_per_general: Mark UI strings as translatable in the constructor
2018-12-26 20:39:30 -05:00
Lioncash b51e57a751 kernel/vm_manager: Reset region attributes when unmapping a VMA
Like the other members related to memory regions, the attributes need to
be reset back to their defaults as well.
2018-12-26 20:15:29 -05:00
Lioncash ba343cf922 configure_per_general: Mark UI strings as translatable in the constructor
These are user-facing strings, so they should be translatable.
2018-12-26 17:45:15 -05:00
Lioncash bd56fa947d configure_input_simple: Make input profile array constexpr
Calling tr() from a file-scope array isn't advisable, since it can be
executed before the Qt libraries are even fully initialized, which can
lead to crashes.

Instead, the translatable strings should be annotated, and the tr()
function should be called at the string's usage site.
2018-12-26 17:36:36 -05:00
Lioncash 21dec95072 renderer_opengl: Correct forward declaration of FramebufferLayout
This is actually a struct, not a class, which can lead to compilation
warnings.
2018-12-26 17:32:32 -05:00
Rodolfo Bogado 50a48fe118 Apply CC test to the final value to be stored in the register 2018-12-26 18:16:31 -03:00
David 615a0df6b6 Fixed shader linking error due to TLDS (#1934)
* Fixed shader linking error due to TLDS

coord should be coords

* Fix remaining coords
2018-12-26 15:55:39 -05:00
bunnei 037dfae35c Merge pull request #1849 from encounter/svcSetThreadActivity
svc: Implement SetThreadActivity (thread suspension)
2018-12-26 15:54:14 -05:00
bunnei 015093c1dd npad: Remove code to invert input in horizontal mode.
- This was incorrect, the game appears to handle this for us.
- Fixes horizontal mode with Puyo Puyo Tetris and Super Mario Odyssey.
2018-12-26 15:47:11 -05:00
ReinUsesLisp a04b5e9a42 shader_bytecode: Fixup TEXS.F16 encoding 2018-12-26 01:35:44 -03:00
Zach Hilman be622a3a3f qt: Use ProfileSelectionDialog when selecting user for save data
This allows us to present a much nicer UI to the user over a simple combo box and is made easy with the modular nature of the profile-selection applet frontend.
2018-12-25 10:52:50 -05:00
Zach Hilman 95df03fd29 qt: Add setting to prompt for user on game boot
Using the QtProfileSelectorDialog, this implementation is trivial. This mimics the real switch behavior of asking which user on every game boot, but it is default disabled as that might get inconvenient.
2018-12-25 10:42:14 -05:00
bunnei 7961e11cd4 Merge pull request #1886 from FearlessTobi/port-4164
Port citra-emu/citra#4164: "citra_qt, video_core: Screenshot functionality"
2018-12-23 14:36:51 -05:00
bunnei c2e2637b52 Merge pull request #1930 from lioncash/common
common/quaternion: Ensure that w is always initialized
2018-12-23 14:35:29 -05:00
bunnei 4686643323 Merge pull request #1781 from DarkLordZach/applet-profile-select
am: Implement HLE profile selector applet
2018-12-23 14:35:13 -05:00
bunnei 22ef8eea69 Merge pull request #1780 from DarkLordZach/controller-profiles
configure_input: Add Controller Setup Profiles and simplify input UI
2018-12-23 14:34:29 -05:00
Rodolfo Bogado 6ef7d94656 Includde saturation in the evaluation of the control code 2018-12-22 19:19:18 -03:00
Rodolfo Bogado fd77c416fd Handle RZ cases evaluating the expression instead of the register value. 2018-12-22 19:19:18 -03:00
Rodolfo Bogado 0ebab7e4c6 complete emulation of ZeroFlag 2018-12-22 19:19:18 -03:00
Lioncash 8734a27b8d common/quaternion: Ensure that w is always initialized
Previously xyz was always being zero initialized due to its constructor,
but w wasn't. Ensures that we always have a deterministic initial state.
2018-12-21 15:25:31 -05:00
bunnei 1dac8b1e9f Merge pull request #1921 from ogniK5377/no-unit
Fixed uninitialized memory due to missing returns in canary
2018-12-21 14:12:54 -05:00
bunnei fea11df6ee Merge pull request #1920 from heapo/texture_format_selection
Texture format fixes for RGBA16UI for copies and R16U when used as depth
2018-12-21 13:46:17 -05:00
bunnei 70b6a81670 Merge pull request #1925 from lioncash/pid
kernel/{process, thread}: Amend behavior related to IDs
2018-12-21 13:45:27 -05:00
bunnei 953b65add7 Merge pull request #1914 from lioncash/id
service/am: Unstub GetAppletResourceUserId
2018-12-21 13:43:51 -05:00
bunnei 7f47320f34 hid: Fix SetNpadJoyHoldType and improve logging. 2018-12-21 13:37:39 -05:00
Lioncash b221836d5d kernel/process: Hook up the process capability parser to the process itself
While we're at it, we can also toss out the leftover capability parsing
from Citra.
2018-12-21 07:05:34 -05:00
Lioncash d7e7faa0de kernel/process_capability: Handle debug capability flags 2018-12-21 07:05:34 -05:00
Lioncash 1239d16371 kernel/process_capability: Handle handle table capability flags
This just specifies the handle table size. There's also a section of
reserved bits that are checked against.
2018-12-21 07:05:34 -05:00
Lioncash 55e371a3a1 kernel/process_capability: Handle kernel version capability flags 2018-12-21 07:05:34 -05:00
Lioncash 4fbfde34a1 kernel/process_capability: Handle program capability flags 2018-12-21 07:05:34 -05:00
Lioncash 1ae0cc696c kernel/process_capability: Handle interrupt capability flags
Similar to the service capability flags, however, we currently don't
emulate the GIC, so this currently handles all interrupts as being valid
for the time being.
2018-12-21 07:05:34 -05:00
Lioncash e638febf50 kernel/process_capability: Handle syscall capability flags 2018-12-21 07:05:34 -05:00
Lioncash ded092a438 kernel/process_capability: Handle the priority mask and core mask flags
Handles the priority mask and core mask flags to allow building up the
masks to determine the usable thread priorities and cores for a kernel
process instance.
2018-12-21 07:05:34 -05:00
Lioncash c5c8b2ffb9 kernel/process: Introduce process capability parsing skeleton
We've had the old kernel capability parser from Citra, however, this is
unused code and doesn't actually map to how the kernel on the Switch
does it. This introduces the basic functional skeleton for parsing
process capabilities.
2018-12-21 07:05:31 -05:00
Lioncash 0a9a9e9b80 common: Add basic bit manipulation utility function to Common 2018-12-21 07:04:18 -05:00
bunnei 2a2d761bdb Merge pull request #1923 from ogniK5377/nfp-device-list
Device handle should not be a random id, instead it's the current npad id
2018-12-19 13:14:43 -05:00
bunnei 0339f523f0 Merge pull request #1909 from heapo/shadow_sampling_fixes
Fix arrayed texture LOD selection and depth comparison ordering
2018-12-19 13:10:37 -05:00
bunnei e42c75e0d6 Merge pull request #1915 from lioncash/sm
service/sm: Improve debug log for RegisterService
2018-12-19 13:10:11 -05:00
Lioncash 9a15fbc673 kernel/svc: Handle thread handles within GetProcessId
If a thread handle is passed to svcGetProcessId, the kernel attempts to
access the process ID via the thread's instance's owning process.

Technically, this function should also be handling the kernel debug
objects as well, however we currently don't handle those kernel objects
yet, so I've left a note via a comment about it to remind myself when
implementing it in the future.
2018-12-19 12:16:15 -05:00
bunnei e37f4939df Merge pull request #1907 from lioncash/attribute
kernel/svc: Implement svcSetMemoryAttribute
2018-12-19 11:50:50 -05:00
Lioncash 9ba5cae7fc svc: Implement svcSetMemoryAttribute
With all the basic backing functionality implemented, we can now unstub
svcSetMemoryAttribute.
2018-12-19 10:59:40 -05:00
Lioncash 46569d15bd vm_manager: Add member function for setting memory attributes across an address range
This puts the backing functionality for svcSetMemoryAttribute in place,
which will be utilized in a following change.
2018-12-19 10:59:40 -05:00
Lioncash 11c3bd213d vm_manager: Add member function for checking a memory range adheres to certain attributes, permissions and states 2018-12-19 10:59:36 -05:00
Lioncash d15a67cd16 kernel/kernel: Use correct initial PID for userland Process instances
Starts the process ID counter off at 81, which is what the kernel itself
checks against internally when creating processes. It's actually
supposed to panic if the PID is less than 81 for a userland process.
2018-12-18 22:54:01 -05:00
Lioncash 60661a4fd9 kernel/svc: Correct output parameter for svcGetThreadId
The service call uses a 64-bit value, just like svcGetProcessId. This
amends the function signature accordingly.
2018-12-18 22:38:26 -05:00
Lioncash bf75c5f45c kernel/thread: Make thread_id a 64-bit value
The kernel uses a 64-bit value for the thread ID, so we shouldn't be
using a 32-bit value.
2018-12-18 22:37:03 -05:00
Lioncash 7755331f46 kernel/svc: Correct output parameter for svcGetProcessId
svcGetProcessId's out parameter is a pointer to a 64-bit value, not a
32-bit one.
2018-12-18 22:30:56 -05:00
Lioncash b6947f8d6d kernel/process: Make process_id a 64-bit value
In the actual kernel, this is a 64-bit value, so we shouldn't be using a
32-bit type to handle it.
2018-12-18 22:28:55 -05:00
David Marcec 5bd0ff8f77 Device handle should not be a random id, instead it's the current npad id
Found during hardware testing
2018-12-19 14:16:30 +11:00
David Marcec 4b64fcc9d6 Moved backtrace to ArmInterface 2018-12-19 14:10:51 +11:00
David Marcec 4568a12f6d hopefully fix clang format issue 2018-12-19 13:22:09 +11:00
David Marcec 1dfb0a513a Fixed uninitialized memory due to missing returns in canary
Functions which are suppose to crash on non canary builds usually don't return anything which lead to uninitialized memory being used.
2018-12-19 12:52:32 +11:00
Lioncash 479a873d97 service/sm: Improve debug log for RegisterService
Now it also indicates the name and max session count. This also gives a
name to the unknown bool. This indicates if the created port is supposed
to be using light handles or regular handles internally. This is passed
to the respective svcCreatePort parameter internally.
2018-12-18 18:22:22 -05:00
zhupengfei 2dbb90ed65 yuzu, video_core: Screenshot functionality
Allows capturing screenshot at the current internal resolution (native for software renderer), but a setting is available to capture it in other resolutions. The screenshot is saved to a single PNG in the current layout.
2018-12-18 22:54:41 +01:00
heapo aee93ff8cf Texture format fixes: Flag RGBA16UI as GL_RGBA_INTEGER format, and interpret R16U as Z16 when depth_compare is enabled. 2018-12-18 11:34:51 -08:00
bunnei 4e57c35bdc Merge pull request #1913 from MerryMage/default-fpcr
kernel/thread: Set default fpcr
2018-12-18 14:13:57 -05:00
bunnei 55f489f17e Merge pull request #1918 from MerryMage/cntfrq
arm_dynarmic: Set CNTFRQ value
2018-12-18 14:13:35 -05:00
MerryMage 2a92de65fa kernel/thread: Set default fpcr 2018-12-18 17:37:03 +00:00
MerryMage 2c84e1e63d arm_dynarmic: Set CNTFRQ value 2018-12-18 17:28:12 +00:00
bunnei 5191adaf2a Merge pull request #1917 from ReinUsesLisp/fixup-half
shader_bytecode: Fixup half float's operator B encoding
2018-12-18 10:45:58 -05:00
bunnei ace4accc86 Merge pull request #1889 from DarkLordZach/swkbd-state-changed
applets: Correct usage of SignalStateChanged event
2018-12-18 09:59:27 -05:00
ReinUsesLisp 40f57b087c shader_bytecode: Fixup half float's operator B encoding 2018-12-18 04:28:50 -03:00
bunnei 5f678d886e Merge pull request #1903 from heapo/fmul_postfactor
Implement postfactor multiplication/division for fmul instructions
2018-12-17 22:00:43 -05:00
Lioncash 3204df8a21 service/am: Unstub GetAppletResourceUserId
This is supposed to return the current process' ID. (0 indicates an
invalid ID for both process IDs and ARU IDs).
2018-12-17 21:01:14 -05:00
heapo 63c820c8b1 Implement postfactor multiplication/division for fmul instructions 2018-12-17 07:56:25 -08:00
heapo a2df3bdd64 Fix arrayed shadow sampler array slice/depth comparison ordering, as well as invalid GLSL LOD selection. 2018-12-17 07:53:48 -08:00
Lioncash 28b54aedff vm_manager: Rename meminfo_state to state
This is shorter and more concise. This also removes the now-innaccurate
comment, as it's not returned wholesale to svcQueryMemory anymore.
2018-12-15 19:43:36 -05:00
Lioncash a7b8f6d2be vm_manager: Add backing functionality for memory attributes
Adds the barebones enumeration constants and functions in place to
handle memory attributes, while also essentially leaving the attribute
itself non-functional.
2018-12-15 19:43:32 -05:00
bunnei acb6de5552 Merge pull request #1905 from bunnei/ignore-empty-gpu-lists
nvhost_gpu: Skip empty GPU command lists.
2018-12-15 00:35:33 -05:00
bunnei 4cb0df9192 nvhost_gpu: Skip empty GPU command lists. 2018-12-15 00:33:22 -05:00
bunnei bb79c2b1fe Merge pull request #1901 from jschmer/ServiceLeak
Fix Service object leak on emulation stop
2018-12-15 00:30:10 -05:00
bunnei 68ee228b9e Merge pull request #1732 from DarkLordZach/yield-types
svc: Implement yield types 0 and -1
2018-12-15 00:28:12 -05:00
bunnei e93cc21e78 Merge pull request #1902 from lioncash/audio
audio_core: Make g_sink_details internally linked
2018-12-14 21:48:17 -05:00
bunnei 1319f18eaf Merge pull request #1899 from lioncash/state
vm_manager/svc: Modify MemoryState enum, and correct error handling for svcQueryMemory
2018-12-14 15:30:02 -05:00
bunnei 5148191691 Merge pull request #1871 from lioncash/move
yuzu/wait_tree: Pass QString by value and std::move in the initializer list for WaitTreeText
2018-12-14 13:13:32 -05:00
bunnei 719a849f58 Merge pull request #1900 from lioncash/wrapper
svc_wrap: Correct register index for a wrapper specialization
2018-12-14 13:12:55 -05:00
Lioncash 1a69d0d290 audio_core: Make g_sink_details internally linked
We can hide the direct array from external view and instead provide
functions to retrieve the necessary info. This has the benefit of
completely hiding the makeup of the SinkDetails structure from the rest
of the code.

Given that this makes the array hidden, we can also make the array
constexpr by altering the members slightly. This gets rid of several
static constructor calls related to std::vector and std::function.

Now we don't have heap allocations here that need to occur before the
program can even enter main(). It also has the benefit of saving a
little bit of heap space, but this doesn't matter too much, since the
savings in that regard are pretty tiny.
2018-12-13 16:44:32 -05:00
Jens Schmer 151c258fd6 Fix Service object leak on emulation stop
Services created with the ServiceFramework base class install themselves as HleHandlers with an owning shared_ptr in the ServerPort ServiceFrameworkBase::port member variable, creating a cyclic ownership between ServiceFrameworkBase and the ServerPort, preventing deletion of the service objects.

Fix that by removing the ServiceFrameworkBase::port member because that was only used to detect multiple attempts at installing a port. Instead store a flag if the port was already installed to achieve the same functionality.
2018-12-13 20:08:23 +01:00
Lioncash 10de0ac2ec svc: Enable svcQueryProcessMemory
svcQueryProcessMemory is trivial to implement, given all the behavior
necessary for it is present, it just needs a handler for it.
2018-12-12 15:45:05 -05:00
Lioncash 9ba7ae793b svc: Write out the complete MemoryInfo structure in QueryProcessMemory
In the previous change, the memory writing was moved into the service
function itself, however it still had a problem, in that the entire
MemoryInfo structure wasn't being written out, only the first 32 bytes
of it were being written out. We still need to write out the trailing
two reference count members and zero out the padding bits.

Not doing this can result in wrong behavior in userland code in the following
scenario:

MemoryInfo info;                 // Put on the stack, not quaranteed to be zeroed out.
svcQueryMemory(&info, ...);

if (info.device_refcount == ...) // Whoops, uninitialized read.

This can also cause the wrong thing to happen if the user code uses
std::memcmp to compare the struct, with another one (questionable, but
allowed), as the padding bits are not guaranteed to be a deterministic
value. Note that the kernel itself also fully zeroes out the structure
before writing it out including the padding bits.
2018-12-12 15:44:58 -05:00
Lioncash 720705eafc svc: Handle memory writing explicitly within QueryProcessMemory
Moves the memory writes directly into QueryProcessMemory instead of
letting the wrapper function do it. It would be inaccurate to allow the
handler to do it because there's cases where memory shouldn't even be
written to. For example, if the given process handle is invalid.

HOWEVER, if the memory writing is within the wrapper, then we have no
control over if these memory writes occur, meaning in an error case, 68
bytes of memory randomly get trashed with zeroes, 64 of those being
written to wherever the memory info address points to, and the remaining
4 being written wherever the page info address points to.

One solution in this case would be to just conditionally check within
the handler itself, but this is kind of smelly, given the handler
shouldn't be performing conditional behavior itself, it's a behavior of
the managed function. In other words, if you remove the handler from the
equation entirely, does the function still retain its proper behavior?
In this case, no.

Now, we don't potentially trash memory from this function if an invalid
query is performed.
2018-12-12 15:43:31 -05:00
Lioncash 41d72ebb23 vm_manager: Correct ordering of last two struct members of MemoryInfo
These should be swapped.
2018-12-12 15:43:31 -05:00
Lioncash 834a1e6d67 svc_wrap: Correct register index for a wrapper specialization
This would result in svcSetMemoryAttribute getting the wrong value for
its third parameter. This is currently fine, given the service function
is stubbed, however this will be unstubbed in a future change, so this
needs to change.
2018-12-12 15:14:28 -05:00
Lioncash 3dc6c6da09 vm_manager: Amend the returned values for invalid memory queries in QueryMemory()
The kernel returns a memory info instance with the base address set to
the end of the address space, and the size of said block as
0 - address_space_end, it doesn't set both of said members to zero.
2018-12-12 15:08:06 -05:00
Lioncash d7ba5372f3 vm_manager: Migrate memory querying to the VMManager interface
Gets rid of the need to directly access the managed VMAs outside of the
memory manager itself just for querying memory.
2018-12-12 15:07:30 -05:00
Lioncash 1d3d7d08eb vm_manager: Migrate MemoryInfo and PageInfo to vm_manager.h
Gets the two structures out of an unrelated header and places them with
the rest of the memory management code.

This also corrects the structures. PageInfo appears to only contain a
32-bit flags member, and the extra padding word in MemoryInfo isn't
necessary.
2018-12-12 14:03:53 -05:00
Lioncash cf39a01c94 vm_manager: Amend MemoryState enum members
Amends the MemoryState enum to use the same values like the actual
kernel does. Also provides the necessary operators to operate on them.
This will be necessary in the future for implementing
svcSetMemoryAttribute, as memory block state is checked before applying
the attribute.
2018-12-12 14:03:50 -05:00
Jens Schmer 6de2793bbf Fix Process object leak on emulation stop
The Process object kept itself alive indefinitely because its handle_table
contains a SharedMemory object which owns a reference to the same Process object,
creating a circular ownership scenario.

Break that up by storing only a non-owning pointer in the SharedMemory object.
2018-12-12 17:25:56 +01:00
Mat M ef4dfba927 Merge pull request #1891 from DarkLordZach/istorage-getsize
fsp_srv: Implement IStorage::GetSize
2018-12-12 07:31:33 -05:00
bunnei a402bf311e Merge pull request #1893 from lioncash/warn
gl_shader_cache: Resolve truncation compiler warning
2018-12-11 20:47:10 -05:00
bunnei 96c4d61b35 Merge pull request #1895 from lioncash/uninit
patch_manager: Prevent use of a dangling pointer within PatchRomFS
2018-12-11 20:27:37 -05:00
bunnei 220bf69e85 Merge pull request #1877 from heapo/audio_interp
Perf: Avoid (expensive) audio interpolation when sample rates already match
2018-12-11 11:45:53 -05:00
bunnei d0098f0fb4 Merge pull request #1888 from marcosvitali/glFrontFacing
gl_shader_decompiler: IPA fix FrontFacing.
2018-12-11 11:43:38 -05:00
Lioncash 9cb11d1ae4 patch_manager: Prevent use of a dangling pointer within PatchRomFS
fmt::format() returns a std::string instance by value, so calling
.c_str() on it here is equivalent to doing:

auto* ptr = std::string{}.c_str();

The data being pointed to isn't guaranteed to actually be valid anymore
after that expression ends. Instead, we can just take the string as is,
and provide the necessary formatting parameters.
2018-12-11 10:08:13 -05:00
Lioncash 6bdc98b5c8 gl_shader_cache: Dehardcode constant in CalculateProgramSize()
This constant is related to the size of the instruction.
2018-12-10 23:47:20 -05:00
Lioncash df8d7cfc90 gl_shader_cache: Resolve truncation compiler warning
The previous code would cause a warning, as it was truncating size_t
(64-bit) to a u32 (32-bit) implicitly.
2018-12-10 23:44:18 -05:00
bunnei d2177aa20d Merge pull request #1846 from lioncash/dir
file_sys/directory: Amend path buffer size for directory entries
2018-12-10 21:54:03 -05:00
bunnei 841d21795d Merge pull request #1819 from DarkLordZach/disable-addons
patch_manager: Add support for disabling patches
2018-12-10 21:52:19 -05:00
bunnei ea14129420 Merge pull request #1887 from FearlessTobi/port-4476
Port citra-emu/citra#4476: "web_service: move telemetry condition from TelemetrySession constructor to destructor"
2018-12-10 21:47:22 -05:00
bunnei 9fdc303f0e Merge pull request #1883 from lioncash/log-fsp
service/fsp_srv: Correct returned value in GetGlobalAccessLogMode()
2018-12-10 21:45:29 -05:00
bunnei e6ee018d18 Merge pull request #1885 from lioncash/data_id
file_sys/save_data_factory: Update SaveDataSpaceId enum
2018-12-10 21:44:50 -05:00
Zach Hilman 583ab4bb0a fsp_srv: Implement IStorage::GetSize
Takes no input and returns the size as a u64. Needed by Katamari Damacy Reroll to boot.
2018-12-10 14:14:36 -05:00
bunnei 5798d782ad Merge pull request #1740 from FernandoS27/shader_props
Implemented Shader Unique Identifiers
2018-12-10 12:43:43 -05:00
Hexagon12 c32ce3dad1 Merge pull request #1872 from lioncash/proc-info
kernel/process: Set ideal core from metadata
2018-12-10 18:44:14 +02:00
Hexagon12 99bcf7cd48 Merge pull request #1880 from DarkLordZach/cache-storage
savedata_factory: Add CacheStorage and delete TemporaryStorage on boot
2018-12-10 18:41:46 +02:00
bunnei 5642ed351c Merge pull request #1876 from lioncash/vma
vm_manager: Make vma_map private
2018-12-10 10:09:50 -05:00
bunnei 50488780bd Merge pull request #1862 from marcosvitali/tlds
gl_shader_decompiler: TLDS/TLD4/TLD4S Reworked reflecting the source registers, bugs fixed and modularize.
2018-12-10 10:08:20 -05:00
Marcos Vitali 4f59d874d8 gl_shader_decompiler: IPA FrontFacing: the right value when is the front face is 0xFFFFFFFF. 2018-12-09 23:36:21 -03:00
Lioncash b842baf5eb service/fsp_srv: Correct returned value in GetGlobalAccessLogMode()
Based off RE, the backing code only ever seems to use 0-2 as the range
of values 1 being a generic log enable, with 2 indicating logging should
go to the SD card. These are used as a set of flags internally.

Given we only care about receiving the log in general, we can just
always signify that we want logging in general.
2018-12-09 20:42:35 -05:00
Zach Hilman 7a809f935c applets: Correct usage of SignalStateChanged event
This was causing some games (most notably Pokemon Quest) to softlock due to an event being fired when not supposed to. This also removes a hack wherein we were firing the state changed event when the game retrieves it, which is incorrect.
2018-12-09 19:46:15 -05:00
Fernando Sahmkow 1f1cc896d3 Implemented a shader unique identifier. 2018-12-09 17:33:33 -04:00
FernandoS27 a40a8e1603 Add more info into textures' object labels 2018-12-09 17:22:29 -04:00
fearlessTobi 7de4624b7d web_service: move telemetry condition from TelemetrySession constructor to destructor
Fixes an issue where Testcases couldn't be sent when Telemetry was disabled, because both things are tied closely together in the backend.
2018-12-08 14:34:37 +01:00
bunnei 60a2d6f613 Merge pull request #1864 from lioncash/nrr
service/ldr: Amend layouts of NRO and NRR headers
2018-12-07 22:26:31 -05:00
Lioncash e7d4f1aebc file_sys/save_data_factory: Update SaveDataSpaceId enum
Amends it with missing values deduced from RE (ProperSystem being from
SwitchBrew for naming)

(SdCardUser wasn't that difficult to discern given it's used alongside
SdCardSystem when creating the save data indexer, based off the usage of
the string "saveDataIxrDbSd" nearby).
2018-12-07 18:52:18 -05:00
bunnei 5839a3f077 Merge pull request #1874 from lioncash/bindings
hle/service, hle/sm: Minor cleanup
2018-12-07 18:31:04 -05:00
bunnei 49840e686e Merge pull request #1882 from FearlessTobi/backport-4418-fix
Backport review comment from citra-emu/citra#4418
2018-12-07 18:16:10 -05:00
bunnei 6e81f4edc9 Merge pull request #1873 from lioncash/const
loaders: Make GetFileType() a const qualified member function
2018-12-07 18:15:30 -05:00
Marcos Vitali 89a288d7ce gl_shader_decompiler: TLDS/TLD4/TLD4S Reworked reflecting the source registers, bugs fixed and modularize. 2018-12-07 19:09:36 -03:00
Tobias da012f0d54 Backport review comment from citra-emu/citra#4418
Original reason:
As Windows multi-byte character codec is unspecified while we always assume std::string uses UTF-8 in our code base, this can output gibberish when the string contains non-ASCII characters. ::OutputDebugStringW combined with Common::UTF8ToUTF16W is preferred here.
2018-12-07 16:21:18 +01:00
Zach Hilman e809d6c791 savedata_factory: Add support for CacheStorage 2018-12-07 08:47:32 -05:00
Zach Hilman 27b5ca24e8 savedata_factory: Delete TemporaryStorage on startup
Mimics hardware behavior.
2018-12-06 22:07:34 -05:00
bunnei b05edf8b20 Merge pull request #1868 from lioncash/config
configuration/config: Use an intermediary variable for accessing players
2018-12-06 15:24:28 -05:00
bunnei 7ce4d7f20d Merge pull request #1875 from DarkLordZach/oss-ngword2
system_archive: Implement open source NgWord2
2018-12-06 15:23:58 -05:00
Lioncash 70f16242ca memory: Convert ASSERT into a DEBUG_ASSERT within GetPointerFromVMA()
Given memory should always be expected to be valid during normal
execution, this should be a debug assertion, rather than a check in
regular builds.
2018-12-06 15:02:34 -05:00
Lioncash bfb412a71a vm_manager: Make vma_map private
This was only ever public so that code could check whether or not a
handle was valid or not. Instead of exposing the object directly and
allowing external code to potentially mess with the map contents, we
just provide a member function that allows checking whether or not a
handle is valid.

This makes all member variables of the VMManager class private except
for the page table.
2018-12-06 15:02:17 -05:00
bunnei 071f4c3a97 Merge pull request #1861 from lioncash/reset
kernel/svc: Correct behavior of svcResetSignal()
2018-12-06 13:42:46 -05:00
heapo 4c83e5cd1e Avoid (expensive) audio interpolation when sample rates already match 2018-12-06 09:46:08 -08:00
bunnei d6f17bdcc9 Merge pull request #1824 from ReinUsesLisp/fbcache
gl_rasterizer: Implement a framebuffer cache
2018-12-06 11:56:59 -05:00
bunnei 8705b31261 Merge pull request #1863 from ReinUsesLisp/texs-f16
gl_shader_decompiler: Implement TEXS.F16
2018-12-06 11:56:05 -05:00
Zach Hilman 1f604f5be3 system_archive: Implement open source NgWord2 2018-12-06 10:17:50 -05:00
Lioncash 33a9fa9aea hle/service: Replace log + UNIMPLEMENTED with UNIMPLEMENTED_MSG
Combines the two into one, shortening the amount of code here.
2018-12-06 01:40:23 -05:00
Lioncash 7dd574a3a1 hle/service: Remove unnecessary using declarations
Only one usage of the specified objects made use of the lack of
namespacing. Given the low usage, we can just remove these.
2018-12-06 01:37:41 -05:00
Lioncash 129d373b58 hle/service, hle/sm: Compress usages of MakeResult()
These auto-deduce the result based off its arguments, so there's no need
to do that work for the compiler, plus, the function return value itself
already indicates what we're returning.
2018-12-06 01:33:22 -05:00
Lioncash e3fdcaadc1 hle/service, hle/sm: Use structured bindings where applicable
Gets rid of the need to keep the variables separate from their actual
initialization spots.
2018-12-06 01:31:26 -05:00
bunnei 0fd4fa0522 Merge pull request #1867 from lioncash/alloc
system_archive: Use a regular function pointer instead of std::function for the file-scope system archive array
2018-12-05 22:37:14 -05:00
bunnei 27aaabc92b Merge pull request #1866 from lioncash/cache
service/ldr: Deduplicate instruction cache clearing code in LoadNro()
2018-12-05 22:36:44 -05:00
Lioncash 061b5571b6 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-05 18:34:03 -05:00
Lioncash be50f38aff yuzu/game_list_worker: Don't retrieve the file type twice in AddFstEntriesToGameList()
Similarly, here we can avoid doing unnecessary work twice by retrieving
the file type only once and comparing it against relevant operands,
avoiding potential unnecessary object construction/destruction.
2018-12-05 17:58:15 -05:00
Lioncash a034b47596 yuzu/game_list_worker: Don't retrieve file type and file type strings twice in MakeGameListEntry()
While GetFileType() is indeed a getter function, that doesn't mean it's
a trivial function, given some case require reading from the data or
constructing other objects in the background. Instead, only do necessary
work once.
2018-12-05 17:49:37 -05:00
Lioncash 76f5f98b9c loaders: Make GetFileType() a const qualified member function
No implementations actually modify instance state (and it would be
questionable to do that in the first place given the name), so we can
make this a const member function.
2018-12-05 17:49:34 -05:00
heapo 7f12622548 Call shrink_to_fit after page-table vector resizing to cause crt to actually lower vector capacity. For 36-bit titles saves 800MB of commit. 2018-12-05 14:40:56 -08:00
Lioncash f75d6b7dd1 kernel/process: Set ideal core from metadata
A very trivial change. If metadata is available, the process should use
it to retrieve the desired core for the process to run on.
2018-12-05 16:59:37 -05:00
Zach Hilman 885644cdcf configure_input_simple: Properly signal docked mode change 2018-12-05 14:05:57 -05:00
Zach Hilman 0f42bb7a96 configure_input: Add ConfigureInputSimple as default input UI config
Greatly simplifies the current input UI, while still allowing power users to tweak advanced settings. Adds 'input profiles', which are easy autoconfigurations to make getting started easy and fast. Also has a custom option which brings up the current, full UI.
2018-12-05 14:02:02 -05:00
Zach Hilman 5169c4b326 configure_input: Convert into QDialog 2018-12-05 14:02:02 -05:00
Zach Hilman 6d91a87755 configure: Use ConfigureInputSimple for Input tab 2018-12-05 14:02:02 -05:00
Zach Hilman 6514e877cb ui_settings: Add UI setting for input profile index 2018-12-05 14:02:02 -05:00
Lioncash bf2225a10e configuration/config: Use an intermediary variable for accessing players
Avoids typing the same long accessor just to retrieve player attributes.
2018-12-05 03:41:33 -05:00
Lioncash 4d5bca8e2d ng_word: Deduplicate use of a constant value
We've already given the constant to the vector itself, so we don't need
to re-hardcode it in the array.
2018-12-05 02:36:45 -05:00
Lioncash 79627baf05 system_archive: Use a regular function pointer instead of std::function for file-scope system archive array
This allows the array to be constexpr. std::function is also allowed to
allocate memory, which makes its constructor non-trivial, we definitely
don't want to have all of these execute at runtime, taking up time
before the application can actually load.
2018-12-05 02:33:17 -05:00
Lioncash 5b9f1fed1d service/ldr: Deduplicate instruction cache clearing code in LoadNro()
We don't need to specify all of the ARM interfaces explicitly.
2018-12-05 00:33:47 -05:00
Lioncash 2e01f8fdcd service/ldr: Amend layout of the NRO header
The first word is just a padding byte, it's not an actual entry
instruction. Also renames the rest of the entries according to
SwitchBrew.
2018-12-05 00:16:49 -05:00
ReinUsesLisp e228750f52 gl_shader_decompiler: Implement TEXS.F16 2018-12-05 02:06:34 -03:00
Lioncash 361c5982f2 service/ldr: Corrent padding within the NRR header layout
The padding after the magic signature value should be 12 bytes rather
than 28 bytes. The other 16 should be placed after the title ID pattern.
2018-12-05 00:05:04 -05:00
ReinUsesLisp ad7a069b65 gl_shader_decompiler: Fixup inverted if 2018-12-05 01:23:04 -03:00
Zach Hilman b0b7bc2866 svc: Avoid incorrect fast yield condition 2018-12-04 22:11:32 -05:00
bunnei 44e35994ce Merge pull request #1859 from heapo/lut_array_codegen
Convert high-frequency LUT arrays from constexpr to static constexpr
2018-12-04 22:07:12 -05:00
Lioncash 1c6729c361 kernel/svc: Correct behavior of svcResetSignal()
While partially correct, this service call allows the retrieved event to
be null, as it also uses the same handle to check if it was referring to
a Process instance. The previous two changes put the necessary machinery
in place to allow for this, so we can simply call those member functions
here and be done with it.
2018-12-04 20:14:59 -05:00
Lioncash a007480e6f kernel/process: Make Process a WaitObject
Process instances can be waited upon for state changes. This is also
utilized by svcResetSignal, which will be modified in an upcoming
change. This simply puts all of the WaitObject related machinery in
place.
2018-12-04 20:14:59 -05:00
Lioncash b87b5e101a kernel/readable_event: Add member function for enforcing a strict reset contract
svcResetSignal relies on the event instance to have already been
signaled before attempting to reset it. If this isn't the case, then an
error code has to be returned.
2018-12-04 20:14:55 -05:00
heapo 5c8f2009bb Improve msvc codegen for hot-path array LUTs
In some constexpr functions, msvc is building the LUT at runtime
(pushing each element onto the stack) out of an abundance of caution. Moving the
arrays into be file-scoped constexpr's avoids this and turns the functions into
simple look-ups as intended.
2018-12-04 17:13:07 -08:00
bunnei fe2a091cdf Merge pull request #1704 from DarkLordZach/oss-sysarchive
file_sys: Implement open source system archives
2018-12-04 19:59:52 -05:00
bunnei 85bfe2adfd Merge pull request #1837 from lioncash/map
yuzu/game_list_worker: Minor cleanup and code deduplication
2018-12-04 19:57:41 -05:00
Lioncash 0d07ee6c54 yuzu/game_list_worker: Move std::string construction after the termination check in callbacks
Avoids potentially allocating a std::string instance when it isn't
needed.
2018-12-04 18:39:35 -05:00
bunnei 0a498c72d7 Merge pull request #1838 from lioncash/dedup
file_sys/registered_cache: Eliminate variable shadowing
2018-12-04 18:34:49 -05:00
bunnei 924661eda8 Merge pull request #1836 from lioncash/unused
crypto/key_manager: Remove unused variable in GetTicketblob()
2018-12-04 18:28:15 -05:00
Lioncash 42256624f9 kernel/svc: Remove unused header inclusion 2018-12-04 15:48:20 -05:00
Lioncash 98342ed109 kernel/svc: Implement svcSignalEvent()
This function simply does a handle table lookup for a writable event
instance identified by the given handle value. If a writable event
cannot be found for the given handle, then an invalid handle error is
returned. If a writable event is found, then it simply signals the
event, as one would expect.
2018-12-04 15:47:59 -05:00
Lioncash 3db51801b4 kernel/svc: Implement svcCreateEvent()
svcCreateEvent operates by creating both a readable and writable event
and then attempts to add both to the current process' handle table.

If adding either of the events to the handle table fails, then the
relevant error from the handle table is returned.

If adding the readable event after the writable event to the table
fails, then the writable event is removed from the handle table and the
relevant error from the handle table is returned.

Note that since we do not currently test resource limits, we don't check
the resource limit table yet.
2018-12-04 15:47:55 -05:00
Zach Hilman cb527149ee qt: Add Properties menu to game list right-click 2018-12-04 13:34:50 -05:00
bunnei a20eec1c58 Merge pull request #1845 from lioncash/nro
loader/{nro, nso}: Remove dependency on the System class
2018-12-04 12:26:12 -05:00
bunnei 8433f63be0 Merge pull request #1853 from lioncash/event
kernel/object: Amend handle types to distinguish between readable and writable events
2018-12-04 12:25:40 -05:00
Marcos aa575cfea9 Rewrited TEX/TEXS (TEX Scalar). (#1826)
* Rewrited TEX/TEXS (TEX Scalar).

* Style fixes.

* Styles issues.
2018-12-04 12:24:35 -05:00
bunnei 7f95f43451 Merge pull request #1857 from lioncash/res-info
kernel/svc: Implement the resource limit svcGetInfo option
2018-12-04 12:23:19 -05:00
bunnei c0ddf651ac Merge pull request #1854 from Subv/old_command_processor
Don't try to route PFIFO methods (0-0x40) to the other engines.
2018-12-04 08:49:22 -05:00
Luke Street 33473a7e7b debugger: Set paused thread color 2018-12-04 02:25:34 -05:00
Lioncash 59a4ed0d24 kernel/object: Amend handle types to distinguish between readable and writable events
Two kernel object should absolutely never have the same handle ID type.
This can cause incorrect behavior when it comes to retrieving object
types from the handle table. In this case it allows converting a
WritableEvent into a ReadableEvent and vice-versa, which is undefined
behavior, since the object types are not the same.

This also corrects ClearEvent() to check both kernel types like the
kernel itself does.
2018-12-04 02:20:47 -05:00
Lioncash a5925f8407 kernel/handle_table: Amend reference to CTR-OS in Create()
Another hold-over from Citra.
2018-12-04 01:50:44 -05:00
Lioncash 676c46cc81 kernel/svc: Implement the resource limit svcGetInfo option
Allows a process to register the resource limit as part of its handle
table.
2018-12-04 01:50:30 -05:00
Luke Street 0652d95dab svc: Implement SetThreadActivity (thread suspension) 2018-12-04 01:23:50 -05:00
Subv 7d6721e3ae Removed unused file.
This is a leftover from #1792
2018-12-03 23:52:38 -05:00
Subv a052151664 GPU: Don't try to route PFIFO methods (0-0x40) to the other engines. 2018-12-03 23:52:18 -05:00