Commit Graph

65 Commits

Author SHA1 Message Date
Michael Scire
944ff3d5f6 ncm: fix two comments 2023-10-16 12:30:44 -07:00
Michael Scire
2125f3c404 ncm: better detect + fix 17 brick after-the-fact
This adds detection for missing-save or empty-save, and rebuilds in either case.
2023-10-16 12:30:44 -07:00
Michael Scire
5d5699a7e8 ncm: work around change in Nintendo save handling behavior
Static save files do not require an entry in the save data indexer to mount.
Prior to 17.0.0, save data files were considered static if userid was 0.
In 17.0.0+, only 8000000000000000 is static.

However, some users using cfw do not have an entry for 8000000000000120 in the indexer,
for various reasons (but mostly manual nand-restore, I think). Thus, on boot of 17.0.0+,
FS will say 8000000000000120 is not present (not in indexer), and NCM will create it anew.

The 8000000000000120 save will then be empty, and then the firmware can't boot.

To workaround this, logic has been re-enabled on 17.0.0+ for building the content meta database.
Thus, if the user encounters this error, the 8000000000000120 save will be emptied, but then
it will be automatically reconstructed, fixing the problem.
2023-10-12 09:22:32 -07:00
Michael Scire
c9a576e990 ncm: update for new 17.0.0 apis 2023-10-12 09:22:29 -07:00
Michael Scire
af0d008900 ncm: alignment was changed for PlaceHolderId/ContentId in 16.0.0 2023-02-23 09:00:38 -07:00
Michael Scire
7a77f2ac8d ncm: fix inversion in activation skipping 2023-02-23 09:00:38 -07:00
Michael Scire
f4a976c2c7 ncm: Add IntegratedContent*Impl 2023-02-23 09:00:37 -07:00
Michael Scire
a203daa849 ncm: first pass at ContentManagerImpl refactor (missing the IntegratedImpls, won't link) 2023-02-23 09:00:37 -07:00
Michael Scire
8cdda02e4d ncm: fix copy/paste error in switch case 2023-02-23 09:00:36 -07:00
Michael Scire
1465b1447b libstrat: make build with new ncm/fs api changes (sysmodules probably fail to build) 2023-02-23 09:00:35 -07:00
Michael Scire
3cba51b85f boot2: update for 16.0.0 2023-02-23 09:00:35 -07:00
Michael Scire
b2232894f3 ncm: update enums, refactor comparison operators 2022-10-18 11:10:46 -07:00
Michael Scire
bbb682ea36 ncm: GetContentAccessibilities, GetContentInfo* 2022-10-12 09:15:44 -07:00
Michael Scire
6a5d2ced4b ams: globally prefer R_RETURN to return for ams::Result 2022-04-04 17:46:58 -07:00
Michael Scire
6f4618ea60 ams: use R_SUCCEED, R_THROW globally 2022-04-04 17:46:57 -07:00
Michael Scire
652828c4f3 strat: fix clang build 2022-03-23 11:25:20 -07:00
Michael Scire
797a6deaf3 ncm: hot take, uninitialized data bad 2022-03-23 09:16:03 -07:00
Michael Scire
39047de5c2 ncm: update client code to better reflect latest sysupdate 2022-03-23 09:15:56 -07:00
Michael Scire
d7a9c7ec4c ams: support building unit test programs on windows/linux/macos 2022-03-23 09:15:46 -07:00
Michael Scire
9ac47ccc1b lib: add missing semicolon 2022-03-23 09:15:40 -07:00
SciresM
00203fd7c3 Integrate new result macros. (#1780)
* result: try out some experimental shenanigans

* result: sketch out some more shenanigans

* result: see what it looks like to convert kernel to use result conds instead of guards

* make rest of kernel use experimental new macro-ing
2022-03-23 09:15:40 -07:00
Michael Scire
9436b9a555 ams: deduplicate static initialization logic 2022-01-19 16:28:54 -08:00
Léo Lam
2916512fb7 Minor header fixes to reduce parsing issues with Clang (#1700)
* Work around Clang's incomplete C++20 support for omitting typename

* vapours: fix Clang error about missing return in constexpr function

* stratosphere: fix call to non-constexpr strlen in constexpr function

strlen being constexpr is a non-compliant GCC extension; Clang
explicitly rejects it: https://reviews.llvm.org/D23692

* stratosphere: add a bunch of missing override specifiers

* stratosphere: work around Clang consteval bug

Minimal example: https://godbolt.org/z/MoM64v93M

The issue seems to be that Clang does not consider f(x) to be a
constant expression if x comes from a template argument that isn't
a non-type auto template argument (???)

We can work around this by relaxing GetMessageHeaderForCheck (by using
constexpr instead of consteval). This produces no functional changes
because the result of GetMessageHeaderForCheck() is assigned to a
constexpr variable, so the result is guaranteed to be computed
at compile-time.

* stratosphere: fix missing require clauses in definitions

GCC not requiring the require clauses to be repeated for member
definitions is actually a compiler bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96830

Clang rejects declarations with missing require clauses.

* Fix ALWAYS_INLINE_LAMBDA and parameter list relative order

While GCC doesn't seem to care about the position of the always_inline
attribute relative to the parameter list, Clang is very picky
and requires the attribute to appear after the parameter list
(and before a trailing return type)

* stratosphere: fix static constexpr member variable with incomplete type

GCC accepts this for some reason (because of the lambda?) but Clang
correctly rejects this.
2021-11-30 16:34:43 -08:00
Michael Scire
3e33fb6361 strat: use m_ for member variables 2021-10-15 23:54:35 -07:00
Michael Scire
3b5f56ab9f ams: replace most remaining operator & with std::addressof 2021-10-15 23:54:34 -07:00
Michael Scire
e2df2f98a3 strat: always use explicit result namespacing 2021-10-15 23:54:33 -07:00
Michael Scire
843dc8e521 libstrat: fix compilation without pre-compiled header/without lto 2021-10-07 23:06:28 -07:00
Michael Scire
fd1b6d4578 libstrat: enable -Wextra, -Werror
This caught an embarrassingly large number of bugs.
2021-10-07 23:06:28 -07:00
Michael Scire
002422d5dc ams: the copyright^H^H^H^H^H^H^Hmplex plane is the algebraic closure of the reals 2021-10-07 23:06:25 -07:00
Michael Scire
c68298a00e stratosphere: use SdkMutex/SdkRecursiveMutex over Mutex 2021-10-07 23:06:22 -07:00
Michael Scire
dc52a32285 ncm: fix destructor availability 2021-09-19 11:01:04 -07:00
Adubbz
4afce6965f ncm: updated to 13.0.0 2021-09-19 10:35:35 -07:00
Adubbz
66104b830a ncm: skeleton new commands 2021-09-19 10:35:34 -07:00
Michael Scire
dc3f54a713 ams: std::optional -> util::optional 2021-07-12 01:59:51 -07:00
Michael Scire
888b39fa50 ams: assume gcc 11 2021-04-29 03:04:54 -07:00
Michael Scire
68ddbc732a ncm: fix iteration of nested-subdirectory content files 2021-04-12 17:13:22 -07:00
Michael Scire
7bee0289ee ncm: fix random error when deleting content 2021-04-12 17:13:22 -07:00
Michael Scire
3bcfb043f1 ncm: fix GameCardStorageRoot mount point (closes #1404) 2021-04-11 03:59:05 -07:00
Adubbz
a156728af7 ncm: Updated ListContentId for 11.0.0 2021-04-11 03:59:04 -07:00
Michael Scire
fddf313699 ams: distribute sysmodules in single file as stratosphere.romfs 2021-04-11 03:59:02 -07:00
Michael Scire
834549081a ncm: fix ContentStorageImplBase constructor 2021-02-02 18:32:59 -08:00
Michael Scire
a1504c0df4 string_view: remove now unecessary comment 2021-02-02 12:16:22 -08:00
Michael Scire
29b3baf678 util::string_view, update pgl for new sf semantics 2021-02-02 12:16:21 -08:00
Michael Scire
637c44f64d libstrat: convert to experimental new (super-accurate) sf allocation semantics 2021-02-02 12:16:20 -08:00
Michael Scire
26369e34f1 ams: use util::SNPrintf over std:: (size/linker improvements) 2021-01-13 10:41:28 -08:00
Michael Scire
e44d2a211c ncm: fix abort in ListContentMetaInfo 2020-12-02 06:53:04 -08:00
Michael Scire
103c81abc5 ncm: safer access patterns for FirmwareVariationInfo 2020-08-01 15:31:00 -07:00
Michael Scire
9f8f932383 ncm: loosen FirmwareVariation restrictions. 2020-08-01 15:30:59 -07:00
Michael Scire
ffc68d133f ncm: rights ids were added in 2.0.0 2020-08-01 15:30:58 -07:00
Michael Scire
771de71f0c ncm: make *ActivateContentMetaDatabase play nice with 1.0.0 2020-08-01 15:30:56 -07:00