Commit graph

3966 commits

Author SHA1 Message Date
zhupengfei
7d880f94db
Add simple zstd compression
Just a simple default compression is able to shrink savestate file size from ~160MB to ~20MB.
2020-02-16 23:25:30 +08:00
zhupengfei
57efc41973
service/cecd: Add missing SessionData serialization 2020-02-14 17:15:08 +08:00
zhupengfei
7e8041df28
kernel/timer: Add missing base object 2020-02-14 17:13:53 +08:00
Hamish Milne
246ae84a52 Pretty sure ARM/Thread serialization works now 2020-02-13 17:42:12 +08:00
Hamish Milne
c983528862 Reworked DSP serialization 2020-02-13 17:42:12 +08:00
James Rowe
55c75b5e3e Add ClearAll to rasterizer cache for fully wiping the cache on save/load 2020-02-13 17:42:11 +08:00
James Rowe
3e34ad6890 Hack: Workaround crash when loading state and gyro is used 2020-02-13 17:42:11 +08:00
Hamish Milne
0effb229cd Fix geometry pipeline; attempt to fix motion controls 2020-02-13 17:42:10 +08:00
Hamish Milne
35c3ca995c Fixed a bug (??) in arm_dynarmic where PageTableChanged could reset the CPU context 2020-02-13 17:42:10 +08:00
Hamish Milne
b2370ea353 Fixed setting the right DSP service on deserialization 2020-02-13 17:42:10 +08:00
Hamish Milne
2217b3558d Fixed file services serialization 2020-02-13 17:42:10 +08:00
Hamish Milne
c24ea0f0ee Serialize core timing 2020-02-13 17:42:09 +08:00
Hamish Milne
8abc5525be Added Signals; more runtime fixes 2020-02-13 17:42:09 +08:00
Hamish Milne
e4f05884c3 Fixed serialization runtime exceptions 2020-02-13 17:42:08 +08:00
Hamish Milne
ca971ff31f Serialize file/directory services 2020-02-13 17:42:08 +08:00
Hamish Milne
9525d81344 More base-derived fixes 2020-02-13 17:42:07 +08:00
Hamish Milne
996aba39fe Correct exports; add some file serialization; fix service base object serialization 2020-02-13 17:42:07 +08:00
Hamish Milne
f2de70c3fb Fix crash bugs 2020-02-13 17:42:06 +08:00
Hamish Milne
116d22d562 Refactor out the wakeup_callback function pointer 2020-02-13 17:42:05 +08:00
Hamish Milne
7019561fd5 Bind NWM_UDS service in the constructor 2020-02-13 17:42:05 +08:00
Hamish Milne
96432589bd Use shared_ptr for PageTable 2020-02-13 17:42:04 +08:00
Hamish Milne
e4afa8e512 Make the tests pass 2020-02-13 17:42:04 +08:00
Hamish Milne
65d96bf6c1 Changed u8* to MemoryRef 2020-02-13 17:42:00 +08:00
Hamish Milne
cf985631e0 Minor tidying up 2020-02-13 17:41:27 +08:00
Hamish Milne
26e90a99cd Added basic UI; misc memory fixes 2020-02-13 17:41:27 +08:00
Hamish Milne
558e710e17 Finished archives; remove pod.h 2020-02-13 17:41:26 +08:00
Hamish Milne
2bf5b46460 Basic archive backend serialization 2020-02-13 17:41:26 +08:00
Hamish Milne
2d2c7218ef Serialize CECD, CFG services 2020-02-13 17:41:25 +08:00
Hamish Milne
ef2e503281 Serialize QTM, Y2R services 2020-02-13 17:41:24 +08:00
Hamish Milne
92857efca4 Serialize PTM service 2020-02-13 17:41:24 +08:00
Hamish Milne
f5e2f873b0 Serialize NWM service 2020-02-13 17:41:24 +08:00
Hamish Milne
571b1062f0 Serialize NIM, PS, PXI, SOC, SSL services 2020-02-13 17:41:23 +08:00
Hamish Milne
2409ee39cb Serialize IR, MVD, NDM, NEWS, NFC 2020-02-13 17:41:23 +08:00
Hamish Milne
3d6e372f96 More clang format fixes. Really need to standardise the version of this 2020-02-13 17:41:23 +08:00
Hamish Milne
01ec2e8a67 Serialize MIC service 2020-02-13 17:41:22 +08:00
Hamish Milne
e3c0211b74 Fix clang format 2020-02-13 17:41:22 +08:00
Hamish Milne
eb67167b7c Serialize IR service 2020-02-13 17:41:22 +08:00
Hamish Milne
8bd3e8cd27 Serialize HTTP service 2020-02-13 17:41:22 +08:00
Hamish Milne
74361fa3fb Serialize HID service 2020-02-13 17:41:21 +08:00
Hamish Milne
30494c06a4 Serialize GSP service 2020-02-13 17:41:21 +08:00
Hamish Milne
9877bf7d48 Change how the boost target works; disable external warnings in MSVC 2020-02-13 17:41:20 +08:00
Hamish Milne
d041901a30 Some more CI fixes 2020-02-13 17:41:20 +08:00
Hamish Milne
c7106e232f Fix a bug on mingw 2020-02-13 17:41:16 +08:00
Hamish Milne
d6862c2fca Some CI fixes 2020-02-13 17:40:52 +08:00
Hamish Milne
7b846ffa98 clang-format fixes 2020-02-13 17:39:15 +08:00
Hamish Milne
d482fb359c Attempting to fix mingw on windows 2020-02-13 17:38:25 +08:00
Hamish Milne
6917eaf53b Use load_construct_data for kernel objects 2020-02-13 17:38:25 +08:00
Hamish Milne
3ed8d95866 Serialize FS service; some compiler fixes 2020-02-13 17:38:24 +08:00
Hamish Milne
d1096de245 Added FRD service serialization 2020-02-13 17:38:24 +08:00
Hamish Milne
4354179156 Added ERR service serialization 2020-02-13 17:38:23 +08:00
Hamish Milne
452ae2e371 Added DSP service serialization 2020-02-13 17:38:23 +08:00
Hamish Milne
30fe2bfe38 Added DLP service serialization 2020-02-13 17:38:23 +08:00
Hamish Milne
a0c3b91785 Added CSND serialization 2020-02-13 17:38:23 +08:00
Hamish Milne
17b9cbefef CAM service serialization 2020-02-13 17:38:22 +08:00
Hamish Milne
1185d62792 BOSS service serialization 2020-02-13 17:38:22 +08:00
Hamish Milne
5265c79056 APT service serialization 2020-02-13 17:38:21 +08:00
Hamish Milne
3e752002c4 Replace g_kernel with Core::Global etc. 2020-02-13 17:38:21 +08:00
Hamish Milne
e707685c2a Serialize AM services 2020-02-13 17:38:20 +08:00
Hamish Milne
89e4e49a63 Finished AC and ACT service serialization 2020-02-13 17:38:20 +08:00
Hamish Milne
3fd5c431f1 Service serialization framework; done AC 2020-02-13 17:38:20 +08:00
Hamish Milne
ac0337d8df Started IPC services serialization 2020-02-13 17:38:19 +08:00
Hamish Milne
7a5bde0b44 Serialize service manager, server prt 2020-02-13 17:38:19 +08:00
Hamish Milne
4f95575d41 Serialize some more kernel objects 2020-02-13 17:38:18 +08:00
Hamish Milne
8c81500dee Serialize kernel/hle/memory 2020-02-13 17:38:18 +08:00
Hamish Milne
c284192a87 Serialize geometry_pipeline 2020-02-13 17:38:17 +08:00
Hamish Milne
f557d26b40 Added CPU, mutex, process, thread, timer 2020-02-13 17:38:16 +08:00
Hamish Milne
06891d9454 Added client/server objects 2020-02-13 17:38:16 +08:00
Hamish Milne
5035e68dad Added derived kernel objects 2020-02-13 17:38:15 +08:00
Hamish Milne
f79c9668a3 Added shader state; WIP kernel objects 2020-02-13 17:38:10 +08:00
Hamish Milne
6f00976ab5 video_core serialization 2020-02-13 17:34:16 +08:00
Hamish Milne
ee2cae2093 Added core serialization 2020-02-13 17:34:13 +08:00
Hamish Milne
dc04774ece Added POD serialization 2020-02-13 17:27:51 +08:00
Hamish Milne
6940c99ed6 Added boost serialization 2020-02-13 17:27:50 +08:00
zhupengfei
4273b967b5
core/file_sys: Do not apply the same mods to DLCs
Now you can apply separate mods to DLCs and mods for the original title won't be applied.
2020-02-11 14:03:07 +08:00
zhupengfei
b81c9bd738
fix clang format 2020-02-10 07:41:31 +08:00
zhupengfei
d9ae4c332d
layered_fs: Do not open all replacement files on load
Instead open them when we want to read them. This is because the standard library has a limit on the number of opened files.
2020-02-09 21:48:42 +08:00
zhupengfei
13e2d534e9
core: Add dump RomFS support
This is added to LayeredFS, then the NCCH container and then the loader interface.
2020-02-09 20:59:31 +08:00
James Rowe
17e9522921
Merge pull request #5069 from vitor-k/min-window2
Update minimum window size based on current layout
2020-02-08 12:46:20 -07:00
zhupengfei
db18f6c79a
Address review
simplify code
2020-02-07 23:53:00 +08:00
zhupengfei
2ec99b83aa
core: Reset archive_manager on shutdown.
This holds the archives which include the SelfNCCH archive which holds the RomFS files. If we don't reset it the LayeredFS class can't get destructed and mods files won't be released.
2020-02-07 23:45:02 +08:00
zhupengfei
6e0afbaa19
Fix build
Explicitly use `std::min<std::size_t>`

Added virtual destructor
2020-02-07 16:26:33 +08:00
zhupengfei
eed9de2336
core/file_sys: Allow exheader replacement to be read from mods path
The previous method (filename.exheader) can still be used.
2020-02-07 15:55:35 +08:00
zhupengfei
53d0c618a0
core/file_sys: Read mods for the original title for updates
Updates can override RomFS and ExeFS, therefore we should apply the mods to them as well.
2020-02-07 15:20:20 +08:00
zhupengfei
91e5a39a08
core/file_sys: Allow exefs mods to be read from mods path
The original path (file_name.exefsdir) is still supported, but alternatively users can choose to put exefs patches in the same place as LayeredFS files (`load/mods/<Title ID>/exefs`).
2020-02-07 15:20:19 +08:00
zhupengfei
8a570bf00c
core: Use LayeredFS while reading RomFS
Only enabled for NCCHs that do not have an override romfs.

LayeredFS files should be put in the `load` directory in User Directory. The directory structure is similar to yuzu's but currently does not allow named mods yet. Replacement files should be put in `load/mods/<Title ID>/romfs` while patches/stubs should be put in `load/mods/<Title ID>/romfs_ext`.
2020-02-07 15:20:18 +08:00
zhupengfei
890405bb7c
core/file_sys: LayeredFS implementation
This implementation is different from Luma3DS's which directly hooks the SDK functions. Instead, we read the RomFS's metadata and figure out the directory and file structure. Then, relocations (i.e. replacements/deletions/patches) are applied. Afterwards, we rebuild the metadata, and assign 'fake' data offsets to the files. When we want to read file data from this rebuilt RomFS, we use binary search to find the last data offset smaller or equal to the given offset and read from that file  (either from the original RomFS, or from replacement files, or from buffered data with patches applied) and any later files when length is not enough.

The code that rebuilds the metadata is pretty complex and uses quite a few variables to keep track of necessary information like metadata offsets. According to my tests, it is able to build RomFS-es identical to the original (but without trailing garbage data) when no relocations are applied.
2020-02-07 15:19:57 +08:00
zhupengfei
83e0cc45f4
core/file_sys: Make RomFSReader an abstract interface
The original RomFSReader is renamed to DirectRomFSReader that directly reads the RomFS.
2020-02-07 15:19:53 +08:00
zhupengfei
05a82b15e6
swkbd: Fix digit filter
The DIGIT filter was incorrectly implemented as preventing all digits. It actually limits the maximum digit count to max_digits, according to ctrulib and hardware testing.
2020-02-04 16:56:30 +08:00
Vitor Kiguchi
2035207dde log disk shader cache setting 2020-01-23 00:49:17 -03:00
Vitor Kiguchi
b713fe3329 Address review comments 2020-01-22 12:51:04 -03:00
Vitor Kiguchi
157f82141d Make a separate function for getting minimum size based on layout 2020-01-21 19:31:39 -03:00
Vitor Kiguchi
0dcb886ef2 clang format 2020-01-21 14:24:16 -03:00
Vitor Kiguchi
718f04af6d Correctly treat cases when current size is smaller than the minimum defined by the layout 2020-01-21 13:32:51 -03:00
Vitor Kiguchi
5d0353c391 correct ProcessConfigurationChanges 2020-01-20 23:00:33 -03:00
Vitor Kiguchi
6e1a873e57 use the defined constants instead of magic numbers for screen dimensions 2020-01-20 23:00:33 -03:00
Vitor Kiguchi
64737afdbc Change min_client_area_size based on layout 2020-01-20 23:00:21 -03:00
James Rowe
a0f9c795c8
Merge pull request #5043 from vitor-k/screen-rotate
Implement Upright/Book-style layout
2020-01-20 18:38:06 -07:00
Vitor Kiguchi
c2179a1dd0 log the upright screen setting 2020-01-20 22:32:16 -03:00
Vitor Kiguchi
be88d2a59a implement upright orientation for side and large frame layouts 2020-01-20 22:32:15 -03:00
vitor-k
89cab445d4 Implementation of screen rotation without use of additional layouts.
This is based on what was done using additional layouts, but modified
to have a variable to control rotation and making it so Single Screen
Layout behaves like Upright Single would, and Default Layout behaves
like Upright Double would, when the new variable is used.

Large Layout and Side Layout currently ignore the new variable.
New variable still currently doesn't have a hotkey.
2020-01-20 22:31:51 -03:00