Commit Graph

7745 Commits (780c21ab2d48aeb5aee921943b14c8de76e86910)

Author SHA1 Message Date
Lioncash d257a3b56c partition_data_manager: Take VirtualFile by const reference in constructor
Given the VirtualFile instance isn't stored into the class as a data
member, or written to, this can just be turned into a const reference,
as the constructor doesn't need to make a copy of it.
6 years ago
Lioncash e96d69c328 partition_data_manager: Amend constructor initializer list order
Orders the members in the exact order they would be initialized. This
also prevents compiler warnings about this sort of thing.
6 years ago
Lioncash aaca7543f0 partition_data_manager: Remove unused includes
Gets unused includes out of the headers and moves them into the cpp file
if they're used there instead.
6 years ago
Lioncash 06898263f6 key_manager: Use std::vector's insert() instead of std::copy with a back_inserter
If the data is unconditionally being appended to the back of a
std::vector, we can just directly insert it there without the need to
insert all of the elements one-by-one with a std::back_inserter.
6 years ago
Lioncash e70c08b543 key_manager: Brace long conditional body
If a conditional (or it's body) travels more than one line, it should be
braced.
6 years ago
Lioncash ef5639bfbb key_manager: Don't assume file seeks and reads will always succeed
Given the filesystem should always be assumed to be volatile, we should
check and bail out if a seek operation isn't successful. This'll prevent
potentially writing/returning garbage data from the function in rare
cases.

This also allows removing a check to see if an offset is within the
bounds of a file before perfoming a seek operation. If a seek is
attempted beyond the end of a file, it will fail, so this essentially
combines two checks into one in one place.
6 years ago
Lioncash 82ea1cf35a key_manager: Remove unnecessary seek in DeriveSDSeed()
Given the file is opened a few lines above and no operations are done,
other than check if the file is in a valid state, the read/write pointer
will always be at the beginning of the file.
6 years ago
Zach Hilman f61379f8d2 patch_manager: Move non-Program RomFS patch log to Debug
Normal Program-type patches will still be logged to aid in debugging, but for others (mainly Control), it was moved to Debug.
6 years ago
Zach Hilman 90c07e0d33 content_archive: Move get key log to Trace level
Avoids printing live keys in the general log.
6 years ago
bunnei 1584fb6b38
Merge pull request #1409 from DarkLordZach/key-derivation
crypto: Add support for full key derivation
6 years ago
bunnei c2aa4293ec
Merge pull request #1483 from lioncash/codeset
kernel/process: Make CodeSet a regular non-inherited object
6 years ago
bunnei 38b027aa81
Merge pull request #1484 from FernandoS27/calculate-size
Implemented helper function to correctly calculate a texture's size
6 years ago
bunnei ffcda6c08e
Merge pull request #1481 from lioncash/typo
svc: Fix typos in sanitizing checks for MapMemory/UnmapMemory
6 years ago
FernandoS27 97b6405a17 Implemented helper function to correctly calculate a texture's size 6 years ago
bunnei 2946d4bdbe
Merge pull request #1467 from ogniK5377/svcbreak-type-fix
Fixed incorrect types for svcBreak
6 years ago
Lioncash 1abed2f4c4 kernel/process: Make CodeSet a regular non-inherited object
These only exist to ferry data into a Process instance and end up going
out of scope quite early. Because of this, we can just make it a plain
struct for holding things and just std::move it into the relevant
function. There's no need to make this inherit from the kernel's Object
type.
6 years ago
bunnei 0f7ab3e21a
Merge pull request #1478 from ogniK5377/remap-invalidhandle-remap
Passing an invalid nmap handle to Remap should throw an error
6 years ago
bunnei f9d03b1d41
Merge pull request #1482 from lioncash/init
thread: Remove unnecessary memset from ResetThreadContext()
6 years ago
bunnei dc328440c8
Merge pull request #1479 from ogniK5377/nmap-revamped
Added error codes for nvmap
6 years ago
Lioncash b492d43e63 thread: Remove unnecessary memset from ResetThreadContext()
Regular value initialization is adequate here for zeroing out data. It
also has the benefit of not invoking undefined behavior if a non-trivial
type is ever added to the struct for whatever reason.
6 years ago
David Marcec 4d2de6564f Returned an error before processing other remaps 6 years ago
David Marcec c55b5de0fb Made the minimum alignment more clear 6 years ago
Lioncash 4ccf30dfaa svc: Fix typos in sanitizing checks for MapMemory/UnmapMemory 6 years ago
bunnei 9bf409f275
Merge pull request #1474 from ogniK5377/hwopus-decodeinterleavedwithperformance
HwOpus, Implemented DecodeInterleavedWithPerformance
6 years ago
bunnei 3fd26b7147
Merge pull request #1472 from lioncash/san
svc: Add missing address range sanitizing checks to MapMemory/UnmapMemory
6 years ago
bunnei bc293e1751
Merge pull request #1476 from bunnei/fix-unmap-flush
nvhost_as_gpu: Flush/invalidate CPU VAddr on UnmapBuffer.
6 years ago
David Marcec c7763603ef Added error codes for nvmap 6 years ago
David Marcec 5dd538cace Passing an invalid nmap handle to Remap should throw an error
Added error for invalid nmap handles
6 years ago
ReinUsesLisp 17290a4416 gl_shader_decompiler: Implement VMAD 6 years ago
bunnei bf795edac4 nvhost_as_gpu: Flush CPU VAddr on UnmapBuffer. 6 years ago
Lioncash 28ec921d0d core/CMakeLists: Make all web_service-related libraries private
Now that all external dependencies are hidden, we can remove
json-headers from the publically linked libraries, as the use of this
library is now completely hidden from external users of the web_service
library. We can also make the web_services library private as well,
considering it's not a requirement. If a library needs to link in
web_service, it should be done explicitly -- not via indirect linking.
6 years ago
Lioncash 183a664405 web_backend: Make Client use the PImpl idiom
Like with TelemetryJson, we can make the implementation details private
and avoid the need to expose httplib to external libraries that need to
use the Client class.
6 years ago
David Marcec fa10905e1e HwOpus, Implemented DecodeInterleavedWithPerformance
Used by sonic ages
6 years ago
bunnei 6d82c4adf9
Merge pull request #1458 from FernandoS27/fix-render-target-block-settings
Fixed block height settings for RenderTargets and Depth Buffers
6 years ago
Lioncash a7725d354c telemetry_json: Use the PImpl idiom to avoid unnecessary dependency exposure
Users of the web_service library shouldn't need to care about an
external library like json.h. However, given it's exposed in our
interface, this requires that other libraries publicly link in the JSON
library. We can do better.

By using the PImpl idiom, we can hide this dependency in the cpp file
and remove the need to link that library in altogether.
6 years ago
Lioncash c422f146ee telemetry_json: Add missing override specifier to the destructor of TelemetryJson 6 years ago
Lioncash 881bb2295d telemetry_json: Take std::string parameters by value
Taking them by const reference isn't advisable here, because it means
the std::move calls were doing nothing and we were always copying the
std::string instances.
6 years ago
Lioncash a34e5e51d8 telemetry_json: Remove unnecessary includes
Removes unused includes. Also rectifies a missing <chrono> include.
6 years ago
Lioncash 6e6ce2ce39 core/CMakeLists: Use target_compile_definitions instead of add_definitions for specifying ENABLE_WEB_SERVICE
Avoids introducing the definition to the whole directory space and
localizes it to being added to the library that needs it.
6 years ago
Lioncash 72e9cb523e svc: Add missing address range sanitizing checks to MapMemory/UnmapMemory
This adds the missing address range checking that the service functions
do before attempting to map or unmap memory. Given that both service
functions perform the same set of checks in the same order, we can wrap
these into a function and just call it from both functions, which
deduplicates a little bit of code.
6 years ago
bunnei 03ec936ca0
Merge pull request #1460 from FernandoS27/scissor_test
Implemented Scissor Testing
6 years ago
bunnei ee1b204749
Merge pull request #1425 from ReinUsesLisp/geometry-shaders
gl_shader_decompiler: Implement geometry shaders
6 years ago
Lioncash 5c0408596f kernel/thread: Use a regular pointer for the owner/current process
There's no real need to use a shared pointer in these cases, and only
makes object management more fragile in terms of how easy it would be to
introduce cycles. Instead, just do the simple thing of using a regular
pointer. Much of this is just a hold-over from citra anyways.

It also doesn't make sense from a behavioral point of view for a
process' thread to prolong the lifetime of the process itself (the
process is supposed to own the thread, not the other way around).
6 years ago
bunnei 5461b21c7a
Merge pull request #1461 from lioncash/warn
ips_layer: Silence truncation and conversion warnings
6 years ago
bunnei 3ac874c32e
Merge pull request #1464 from lioncash/unique
patch_manager: Return a std::unique_ptr from ParseControlNCA() and GetControlMetadata() instead of a std::shared_ptr
6 years ago
FernandoS27 5f4ee6f0c8 Add memory Layout to Render Targets and Depth Buffers 6 years ago
David Marcec 2db37ddea9 Changed all casts in svc_wrap.h to be static_cast instead 6 years ago
David Marcec 09b6dda8f0 Use a better name than "dont_kill_application"
signal_debugger seems like a more fitting name
6 years ago
David Marcec a4412c8e22 Fixed incorrect types for svcBreak
svcBreak reason should be a u32, not a u64.
6 years ago
FernandoS27 af653906d0 Fixed block height settings for RenderTargets and Depth Buffers, and added block width and block depth 6 years ago
bunnei bc6939beaa
Merge pull request #1466 from lioncash/unused
gl_shader_decompiler: Remove unused variables in TMML's implementation
6 years ago
bunnei 0b3d4db98b
Merge pull request #1463 from FearlessTobi/port-4310
Port citra-emu/citra#4310: "Handle touch input"
6 years ago
bunnei fe16905de1
Merge pull request #1459 from ogniK5377/break
svcBreak, Signalling to the debugger should not kill execution
6 years ago
bunnei 89939be9e6
Merge pull request #1465 from lioncash/telemetry
telemetry_session: Minor miscellaneous changes
6 years ago
bunnei 141a0d9386
Merge pull request #1462 from lioncash/move
ips_layer: Minor miscellaneous changes
6 years ago
bunnei 6aab309e41
Merge pull request #1455 from ogniK5377/smo-softlockfix
Fixed smo softlock due to incorrect effect state updating
6 years ago
Lioncash 6e27c5d4d1 gl_shader_decompiler: Remove unused variables in TMML's implementation
Given "y" isn't always used, but "x" is, we can rearrange this to avoid
unused variable warnings by changing the names of op_a and op_b
6 years ago
Lioncash e3b4d31f4e telemetry_session: Remove doxygen comment for a non-existent parameter
There's no "func" parameter, so this can just be removed.
6 years ago
Lioncash 8aa4889e76 telemetry_session: Add missing includes
Prevents potential compilation issues in the future by including missing
headers for certain functions and types.
6 years ago
Lioncash 1964f4bbb3 telemetry_session: Remove unimplemented FinalizeAsyncJob prototype
This isn't implemented anywhere, so it can just be removed.
6 years ago
Lioncash 8723cc8798 telemetry_session: Use a std::array in GenerateTelemetryId()
We don't need to potentially heap-allocate a std::string instance here,
given the data is known ahead of time. We can just place it within an
array and pass this to the mbedtls functions.
6 years ago
Lioncash 6636f3ff47 patch_manager: Return a std::unique_ptr from ParseControlNCA() and GetControlMetadata() instead of a std::shared_ptr
Neither of these functions require the use of shared ownership of the
returned pointer. This makes it more difficult to create reference
cycles with, and makes the interface more generic, as std::shared_ptr
instances can be created from a std::unique_ptr, but the vice-versa
isn't possible. This also alters relevant functions to take NCA
arguments by const reference rather than a const reference to a
std::shared_ptr. These functions don't alter the ownership of the memory
used by the NCA instance, so we can make the interface more generic by
not assuming anything about the type of smart pointer the NCA is
contained within and make it the caller's responsibility to ensure the
supplied NCA is valid.
6 years ago
NeatNit 4f24343f32 implemented touch in Qt and SDL
change TouchToPixelPos to return std::pair<int, int>

static_cast (SDL)

various minor style and code improvements

style - PascalCase for function names

made touch events private

const pointer arg in touch events

make TouchToPixelPos a const member function

did I do this right?

braces on barely-multiline if

remove question comment (confirmed in Discord)

fixed consts

remove unused parameter from TouchEndEvent

DRY - High-DPI scaled touch put in separate function

also fixes a bug where if you start touching (with either mouse or touchscreen) and drag the mouse to the LEFT of the emulator window, the touch point jumps to the RIGHT side of the touchscreen; draggin to above the window would make it jump to the bottom.

implicit conversion from QPoint to QPointF, apparently

I have no idea what const even means but I'll put it here anyway

remove unused or used-once variables

make touch scaling functions const, and put their implementations together

removed unused FingerID parameters

QTouchEvent forward declaration; add comment to TouchBegin that was lost in an edit

better DRY in SDL

To do -> TODO(NeatNit)

remove unused include
6 years ago
Lioncash 465175cdf5 ips_layer: Avoid constructing std::vector instances where not necessary
We can just compare the existing std::vector instance with a constexpr
std::array containing the desired match. This is lighter resource-wise,
as we don't need to allocate on the heap.
6 years ago
Lioncash 9ff743bc0a ips_layer: Remove unnecessary explicit std::pair constructor in std::array
Makes the layout of the array consistent, by making all elements match,
instead of special-casing the first one.
6 years ago
Lioncash f7d2889fb4 ips_layer: Add missing includes
Adds missing includes to prevent potential compilation issues in the
future. Also moves the definition of a struct into the cpp file, so that
some includes don't need to be introduced within the header.
6 years ago
Lioncash 93ac8d0fea ips_layer: std::move data within PatchIPS() and Apply()
We don't need to make a copy of the read data, so we can std::move it
into the make_shared call here.
6 years ago
Lioncash 567e818440 ips_layer: Silence truncation and conversion warnings
Makes type conversions explicit to avoid compiler warnings.
6 years ago
FernandoS27 be97fc884d Implement Scissor Test 6 years ago
David Marcec f5631e78d1 Added bitfield instead of manually checking if the bit is set 6 years ago
FernandoS27 30ff42b8cc Assert Scissor tests 6 years ago
David Marcec a47c1c77e6 EffectOutStatus padding is now in hex 6 years ago
David Marcec af3ba94b2a Actual kill execution when the bit isn't set, not the other way around 6 years ago
David Marcec c50f66a8eb svcBreak, Signalling to the debugger should not kill execution
When loading NROs, svcBreak is called to signal to the debugger that a new "module" is loaded. As no debugger is technically attached we shouldn't be killing the programs execution.
6 years ago
bunnei 561d79e034
Merge pull request #1423 from DarkLordZach/romfs-file-exts
fsmitm_romfsbuild: Add support for stubbing and IPS patches in LFS
6 years ago
bunnei 6b48ba5271
Merge pull request #1424 from DarkLordZach/ips-witch
ips_layer: Add support for IPSwitch executable patches
6 years ago
bunnei fd891ee9c0
Merge pull request #1456 from ogniK5377/aoc-u-fixups
Fixed assertion due to CountAddOnContent & Casting warnings
6 years ago
bunnei 3f1f82a8c4
Merge pull request #1457 from ogniK5377/unmap-buffer
Unmapping an unmapped buffer should succeed
6 years ago
David Marcec c5c184246d Unmapping an unmapped buffer should succeed
Hardware tests show that trying to unmap an unmapped buffer already should always succeed. Hardware test was tested up to 32 iterations of attempting to unmap
6 years ago
ReinUsesLisp 7c2d6ef210 gl_shader_decompiler: Move position varying location from 15 to 0 and apply an offset 6 years ago
ReinUsesLisp ee4d538850 gl_shader_decompiler: Implement geometry shaders 6 years ago
ReinUsesLisp 4d0c682468 video_core: Allow LabelGLObject to use extra info on any object 6 years ago
Zach Hilman f945e9767c nso/nro: Use default allocation size for arg_data 6 years ago
Zach Hilman 081f5c1dbf cmd: Support passing game arguments from command line
Uses -p (--program) and following string as args.
6 years ago
Zach Hilman 8bbc12b9c2 qt: Add UI option to configure arguments 6 years ago
Zach Hilman 95dff555a4 settings: Add program_args string setting 6 years ago
Zach Hilman e09505ff61 nso/nro: Add NSO arguments structure to data section
Only added if arguments string is non-empty and a pass is requested by loader.
6 years ago
Zach Hilman 3ec054643e partition_data_manager: Rename system files for hekate
x
6 years ago
Zach Hilman 8f958b89e7 qt: Add rederive keyset menu option 6 years ago
Zach Hilman 3edafc6802 qt: Add key derivation progress bar on initial setup 6 years ago
Zach Hilman 29dc6f4519 crypto: Add PartitionDataManager
Keeps track of system files for key derivation
6 years ago
Zach Hilman 4aad010f7a key_manager: Add support for loading keys from partition data 6 years ago
Zach Hilman d041d6231c key_manager: Add ETicket key derivation
Derives titlekeys
6 years ago
Zach Hilman a57aac5772 key_manager: Add base key derivation
Derives master keys, game encryption keys, and package1/2 keys
6 years ago
Zach Hilman d7398283e3 key_manager: Add BIS key getter 6 years ago
Zach Hilman d6a0d5d432 key_manager: Add support for more keys
TSEC, SBK, BIS, and other Sources for proper derivation
6 years ago
Zach Hilman c79d2ca6cf key_manager: Add keyblob support 6 years ago
Zach Hilman e4602748d6 key_manager: Add support for crypto revisions past 04 6 years ago
Zach Hilman 9e34303fb9 key_manager: Add support for comments in keyfiles 6 years ago
Zach Hilman 1fa6ee4723 vfs: Move forward declarations to separate file 6 years ago