Compare commits

..

42 Commits

Author SHA1 Message Date
GaryOderNichts
3e864b10e7 coreinit/memblockheap: Add padding bytes to MEMBlockHeap struct
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2026-04-04 16:56:21 +02:00
GaryOderNichts
2341956f64 Add semaphore functions for gx2/dmae 2026-04-04 16:49:54 +02:00
Cynthia Coan
6b29dd6ee2
Add OSGetConsoleType, and MCP_GetSystemMode (#441)
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
* add OSGetConsoleType, and MCP_GetSystemMode

this adds in two functions that were an exported symbol in the system
libraries, but not included in any headers. these are useful for doing
two things:

- determine what kind of console you're running on (for users who want
  to know if they're running a CAT-DEV, CAT-R, Kiosk Unit, Retail
  Wii-U's, etc.)
- determine if the wii-u is currently running in production/development
  mode. this shouldn't be too useful for many users, as not too much
  changes besides certain extra libraries/etc. are loaded in memory.
  however, users may want to lock things behind development mode as dev
  mode can only be normally enabled when there's extra memory.

* add new comment to mask
2026-03-27 02:17:08 +01:00
GaryOderNichts
2016e429c1 wutnewlib: fix lock_try_acquire
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2026-02-16 19:10:34 +01:00
fincs
afa43f676d
wutnewlib: implement new unified threading syscalls (replaces wutstdc++) (#434)
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2026-01-25 19:33:25 +01:00
capitalistspz
26ed8f3b39
Add declarations for some Wiimote audio stuff, +documentation (#433)
* Add declarations for some Wiimote audio stuff, +documentation

* Small comment changes
2026-01-25 13:12:47 +01:00
Cynthia Coan
49fe30fe49
coreinit/filesystem: Label HFIO/PCFS mount source type (#431)
* properly label PCFS mount type

now that we've got an open-source way of booting a cat-dev, and using
PCFS, we can confirm that this second mount source is indeed PCFS.

* fix one space

* pcfs -> hfio
2026-01-25 13:11:43 +01:00
capitalistspz
6cd63fe2b3
Include wut.h in h264/stream.h (#432)
* Include `wut.h` in `h264/stream.h`

Not having `wut.h` included when using this header results in redefinition errors because of `WUT_PACKED`

* Add a space
2025-12-28 17:16:39 +01:00
Daniel K. O.
e3ac119037
Added field to control swkbd keyboard layout. (#429)
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
Co-authored-by: Daniel K. O. (dkosmari) <none@none>
2025-11-01 14:30:01 +01:00
Daniel K. O.
1b412d2769
wutsocket fixes: select() handles timeout wrong, and poll() lacks a safety check (#428)
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
* - Fix select() to also update the fd_set arguments on timeout condition.
- Move the nfds argument restriction to the nsysnet side.
- Allow user-defined FD_SETSIZE, since newlib's fd_set allow custom sizes.
- Define __socklen_t_defined when socklen_t is typedefed.

* Added safety check for poll(): the nsysnet fd must fit in nsysnet_fd_set.

---------

Co-authored-by: Daniel K. O. (dkosmari) <none@none>
2025-10-10 20:27:42 +02:00
capitalistspz
cac70f560e Correct capitalization to WPADGetGameDataTimeStamp
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2025-08-19 09:28:25 +02:00
GaryOderNichts
2c98cc91aa Run clang-format
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
`find . -regex '.*\.\(cpp\|hpp\|cu\|cuh\|c\|h\)' -exec clang-format -style=file -i {} \;`
2025-06-05 11:06:04 +01:00
GaryOderNichts
4f18f8041a Add formatting check workflow
Bundle clang-format-diff with workflow
2025-06-05 11:06:04 +01:00
GaryOderNichts
2b66122422 Add .clang-format
Co-authored-by: Maschell <Maschell@gmx.de>
2025-06-05 11:06:04 +01:00
Dave Murphy
fa650f92c4
remove unused dist target (#422) 2025-05-29 12:14:44 +01:00
GaryOderNichts
5fdc7ffe85 wutnewlib: Remove obsolete declarations to fix compiling with GCC 15 2025-05-24 20:56:14 +02:00
Daniel K. O.
81db8e5dd4
Add WUT_FORMAT_PRINTF and fix some format string bugs. (#404)
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2025-05-17 22:35:56 +02:00
GaryOderNichts
1bbdc75f27 wutsocket/ioctl: Remove unimplemented requests
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2025-05-16 22:13:22 +02:00
capitalistspz
b418690722
h264/decode: Make H264DECSetParam_USER_MEMORY take void** (#418) 2025-05-16 21:47:53 +02:00
capitalistspz
1447a0ed92
padscore: Add KPADSetSamplingCallback, WENCGetEncodeData and documentation improvements (#411)
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
* Add `WENCGetEncodeData`

* `const` and out

* WPADInfo changes

* WPADInfo changes

* Add `KPADSetSamplingCallback`

* Miscellaneous comment changes
2025-05-11 19:28:56 +02:00
GaryOderNichts
b35e595a6e nsysccr/cdc: Add lowlevel NFC commands
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2025-03-29 19:10:12 +01:00
GaryOderNichts
a92c2b178b coreinit/debug: Add OSSendFatalError
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2025-03-16 19:34:51 +01:00
Andrew
4847ddce41
bsp: Add all BSP errors (#412)
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2025-02-19 12:45:23 +01:00
Dave Murphy
958936de47
update changelog for 1.7.0
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2024-12-06 09:17:46 +00:00
Dave Murphy
941fd90b39
update changelog for 1.6.0 2024-12-06 09:16:33 +00:00
Daniel K. O.
5c9b87ce75
- Added WPADStatus* structs for various extensions. (#406)
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
- Added more enums and enum values.
- Added `padscore/wbc.h` header.
- Added more fields to KPADStatus.
- Added some more WPAD and KPAD functions.

--HG--
branch : padscore-additions-hg

Co-authored-by: Daniel K. O. (dkosmari) <none@none>
2024-10-26 18:22:17 +02:00
Daniel K. O.
6f48526d37
coreinit: Add memory allocator functions (#402)
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
Co-authored-by: Daniel K. O. (dkosmari) <none@none>
2024-10-07 22:04:47 +02:00
Daniel K. O.
8b65fd6ce9
Fix typo in nsysnet and add more nn::ac functions. (#401)
Co-authored-by: Daniel K. O. (dkosmari) <none@none>
2024-10-01 21:21:24 +02:00
Daniel K. O.
ad730b9dcb
Added OSSetPerformanceMonitor(). (#400)
* Added `OSSetPerformanceMonitor()`.

--HG--
branch : perf-mon

* Renamed everything.

--HG--
branch : perf-mon

* Added header to tests.

--HG--
branch : perf-mon

---------

Co-authored-by: Daniel K. O. (dkosmari) <none@none>
2024-09-30 11:32:53 +02:00
capitalistspz
7c93c38731
camera: event argument correction (#399)
* Event arg correction from surface to surface buffer

* Correct offset check
2024-09-07 00:34:03 +02:00
GaryOderNichts
34ad45777a avm: Add CEC functions 2024-08-25 18:57:51 +02:00
GaryOderNichts
bbcf70dbc0 tve: Add CEC functions 2024-08-25 18:57:51 +02:00
Maschell
c38b84c175 coreinit: add "MCP_DEVICE_TYPE_AUTO" 2024-08-10 17:43:27 +02:00
Maschell
55a4708ced nn_acp: Add ACPDevice enum values, add save related functions 2024-08-10 17:43:27 +02:00
GaryOderNichts
15b28d8587 nsysccr/cdc: Add CCRCDCSysGetInfo 2024-08-10 17:06:42 +02:00
Maschell
09e3a2440b
nn_idb: Fix copy headers, fix nn::idb::IDBReader::Initialize (#395)
* nn_idb: Fix copy headers, fix nn::idb::IDBReader::Initialize

* Update libraries/nn_idb/src/IDBReader.cpp

Co-authored-by: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com>

---------

Co-authored-by: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com>
2024-08-04 23:44:54 +02:00
Andrew Hawes
9a32ef1b65 nn_acp: Add ACPRemoveSaveDir* 2024-07-31 16:57:19 +02:00
capitalistspz
327de261b7
camera: corrections and comments (#392)
* camera: correct CAMSetupInfo struct layout, more comments

* offsets

* error -> failed

* Background comment
2024-07-31 16:56:31 +02:00
Maschell
8b05ac3410 nn_ccr: Add CCRSysSetCurrentLCDMode and CCRSysGetCurrentLCDMode 2024-07-23 01:05:43 +02:00
capitalistspz
7044eaa8e4
coreinit/screen: Swap row and column parameters in OSScreenPutFontEx (#391)
* coreinit/OSScreenPutFontEx: Swap row and column parameters

* swap the comment order too
2024-07-19 19:56:49 +02:00
Daniel López Guimaraes
29f5093bf0 nn/dlp: Fix Initialize functions on ServerPrivate
These functions were pointing to the `Server` implementation, and not
the `ServerPrivate` one. Fix the typo using the correct `ServerPrivate`
export instead.
2024-07-19 18:54:10 +02:00
Daniel López Guimaraes
0ae8f8a507 nn/dlp: Add initial headers 2024-07-13 16:35:13 +02:00
333 changed files with 15079 additions and 10705 deletions

90
.clang-format Normal file
View File

@ -0,0 +1,90 @@
---
BasedOnStyle: LLVM
AccessModifierOffset: -3
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: AcrossEmptyLinesAndComments
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AlignOperands: Align
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: All
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- asm
- WUT_FORMAT_PRINTF
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: Never
AfterEnum: true
AfterExternBlock: false
AfterStruct: true
AfterFunction: true
AfterNamespace: true
AfterUnion: true
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
CompactNamespaces: false
ConstructorInitializerIndentWidth: 3
ContinuationIndentWidth: 3
FixNamespaceComments: true
IncludeBlocks: Preserve
IncludeCategories:
# Include wut headers first
- Regex: '^[<|"]wut'
Priority: 1
- Regex: '^<'
Priority: 2
- Regex: '^"'
Priority: 3
IndentAccessModifiers: false
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 3
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PointerAlignment: Right
ReflowComments: false
SeparateDefinitionBlocks: Leave
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
TypenameMacros:
- BOOL
- RPLWRAP
UseTab: Never

197
.github/workflows/clang-format-diff.py vendored Executable file
View File

@ -0,0 +1,197 @@
#!/usr/bin/env python3
#
# ===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ===------------------------------------------------------------------------===#
"""
This script reads input from a unified diff and reformats all the changed
lines. This is useful to reformat all the lines touched by a specific patch.
Example usage for git/svn users:
git diff -U0 --no-color --relative HEAD^ | {clang_format_diff} -p1 -i
svn diff --diff-cmd=diff -x-U0 | {clang_format_diff} -i
It should be noted that the filename contained in the diff is used unmodified
to determine the source file to update. Users calling this script directly
should be careful to ensure that the path in the diff is correct relative to the
current working directory.
"""
from __future__ import absolute_import, division, print_function
import argparse
import difflib
import re
import subprocess
import sys
if sys.version_info.major >= 3:
from io import StringIO
else:
from io import BytesIO as StringIO
def main():
parser = argparse.ArgumentParser(
description=__doc__.format(clang_format_diff="%(prog)s"),
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument(
"-i",
action="store_true",
default=False,
help="apply edits to files instead of displaying a diff",
)
parser.add_argument(
"-p",
metavar="NUM",
default=0,
help="strip the smallest prefix containing P slashes",
)
parser.add_argument(
"-regex",
metavar="PATTERN",
default=None,
help="custom pattern selecting file paths to reformat "
"(case sensitive, overrides -iregex)",
)
parser.add_argument(
"-iregex",
metavar="PATTERN",
default=r".*\.(?:cpp|cc|c\+\+|cxx|cppm|ccm|cxxm|c\+\+m|c|cl|h|hh|hpp"
r"|hxx|m|mm|inc|js|ts|proto|protodevel|java|cs|json|s?vh?)",
help="custom pattern selecting file paths to reformat "
"(case insensitive, overridden by -regex)",
)
parser.add_argument(
"-sort-includes",
action="store_true",
default=False,
help="let clang-format sort include blocks",
)
parser.add_argument(
"-v",
"--verbose",
action="store_true",
help="be more verbose, ineffective without -i",
)
parser.add_argument(
"-style",
help="formatting style to apply (LLVM, GNU, Google, Chromium, "
"Microsoft, Mozilla, WebKit)",
)
parser.add_argument(
"-fallback-style",
help="The name of the predefined style used as a"
"fallback in case clang-format is invoked with"
"-style=file, but can not find the .clang-format"
"file to use.",
)
parser.add_argument(
"-binary",
default="clang-format",
help="location of binary to use for clang-format",
)
args = parser.parse_args()
# Extract changed lines for each file.
filename = None
lines_by_file = {}
for line in sys.stdin:
match = re.search(r"^\+\+\+\ (.*?/){%s}(\S*)" % args.p, line)
if match:
filename = match.group(2)
if filename is None:
continue
if args.regex is not None:
if not re.match("^%s$" % args.regex, filename):
continue
else:
if not re.match("^%s$" % args.iregex, filename, re.IGNORECASE):
continue
match = re.search(r"^@@.*\+(\d+)(?:,(\d+))?", line)
if match:
start_line = int(match.group(1))
line_count = 1
if match.group(2):
line_count = int(match.group(2))
# The input is something like
#
# @@ -1, +0,0 @@
#
# which means no lines were added.
if line_count == 0:
continue
# Also format lines range if line_count is 0 in case of deleting
# surrounding statements.
end_line = start_line
if line_count != 0:
end_line += line_count - 1
lines_by_file.setdefault(filename, []).extend(
["--lines", str(start_line) + ":" + str(end_line)]
)
# Reformat files containing changes in place.
has_diff = False
for filename, lines in lines_by_file.items():
if args.i and args.verbose:
print("Formatting {}".format(filename))
command = [args.binary, filename]
if args.i:
command.append("-i")
if args.sort_includes:
command.append("--sort-includes")
command.extend(lines)
if args.style:
command.extend(["--style", args.style])
if args.fallback_style:
command.extend(["--fallback-style", args.fallback_style])
try:
p = subprocess.Popen(
command,
stdout=subprocess.PIPE,
stderr=None,
stdin=subprocess.PIPE,
universal_newlines=True,
)
except OSError as e:
# Give the user more context when clang-format isn't
# found/isn't executable, etc.
raise RuntimeError(
'Failed to run "%s" - %s"' % (" ".join(command), e.strerror)
)
stdout, _stderr = p.communicate()
if p.returncode != 0:
return p.returncode
if not args.i:
with open(filename) as f:
code = f.readlines()
formatted_code = StringIO(stdout).readlines()
diff = difflib.unified_diff(
code,
formatted_code,
filename,
filename,
"(before formatting)",
"(after formatting)",
)
diff_string = "".join(diff)
if len(diff_string) > 0:
has_diff = True
sys.stdout.write(diff_string)
if has_diff:
return 1
if __name__ == "__main__":
sys.exit(main())

47
.github/workflows/format-check.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: Formatting check
on: [pull_request]
jobs:
formatting-check:
name: Formatting check
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
# To get a diff from the PR we need to fetch 2 commits.
# The checkout action will create a merge commit as {{ github.sha }}.
fetch-depth: 2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -yqq clang-format-18
- name: Format check
id: format-check
run: |
git diff -U0 --no-color ${{ github.sha }}^ -- '*.cpp' '*.c' '*.h' '*.hpp' |
./.github/workflows/clang-format-diff.py -p1 -binary clang-format-18 > clang-format.patch || true
# Check if patch is not empty
if [ -s clang-format.patch ]; then
echo "###############################################################"
echo "# Format checks failed!"
echo "# A patch has been uploaded as an artifact and is shown below."
echo "###############################################################"
# Show patch
cat clang-format.patch
exit 1
fi
- name: Upload format fixes patch
uses: actions/upload-artifact@v4
if: ${{ failure() && steps.format-check.outcome == 'failure' }}
with:
name: clang-format.patch
path: clang-format.patch
if-no-files-found: ignore

View File

@ -1,3 +1,61 @@
#### wut 1.7.0
###### New features / improvements
* nn/dlp: Add initial headers by @DaniElectra in https://github.com/devkitPro/wut/pull/389
* nn/dlp: Fix Initialize functions on ServerPrivate by @DaniElectra in https://github.com/devkitPro/wut/pull/390
* nn_ccr: Add `CCRSysSetCurrentLCDMode` and `CCRSysGetCurrentLCDMode` by @Maschell in https://github.com/devkitPro/wut/pull/393
* nsysccr/cdc: Add CCRCDCSysGetInfo by @GaryOderNichts in https://github.com/devkitPro/wut/pull/398* nn_acp: Add ACPRemoveSaveDir* by @Andrew1Hawes in https://github.com/devkitPro/wut/pull/394
* nn_acp: Add various save related functions by @Maschell in https://github.com/devkitPro/wut/pull/396
* Add HDMI CEC functions by @GaryOderNichts in https://github.com/devkitPro/wut/pull/397
* Added `OSSetPerformanceMonitor()`. by @dkosmari in https://github.com/devkitPro/wut/pull/400
###### Fixes and corrections
* coreinit/screen: Swap row and column parameters in OSScreenPutFontEx by @capitalistspz in https://github.com/devkitPro/wut/pull/391
* camera: corrections and comments by @capitalistspz in https://github.com/devkitPro/wut/pull/392
* nn_idb: Fix copy headers, fix nn::idb::IDBReader::Initialize by @Maschell in https://github.com/devkitPro/wut/pull/395
* camera: event argument correction by @capitalistspz in https://github.com/devkitPro/wut/pull/399
## New Contributors
* @dkosmari made their first contribution in https://github.com/devkitPro/wut/pull/400
#### wut 1.6.0
###### New features / improvements
* nn_idb: Implement icon database reading by @Maschell in https://github.com/devkitPro/wut/pull/357
* nn_idb: move include into libraries directory by @Maschell in https://github.com/devkitPro/wut/pull/365
* wut_types: Implement more operators for `WUT_ENUM_BITMASK_TYPE` by @GaryOderNichts in https://github.com/devkitPro/wut/pull/369
* whb/gfx: Use 4:3 TV buffers on 4:3 TVs by @jranderia3 in https://github.com/devkitPro/wut/pull/383
###### Breaking changes
* padscore: rename `nunchuck` -> `nunchuk` in https://github.com/devkitPro/wut/pull/348
###### CafeOS related changes
* More nn_ccr and nsysccr struct/enum fixes by @Maschell in https://github.com/devkitPro/wut/pull/361
* Add functions to control the Eco mode by @Maschell in https://github.com/devkitPro/wut/pull/363
* nn_sl: Fix wrong parameters for nn::sl::LaunchInfoDatabase::Unregister by @Maschell in https://github.com/devkitPro/wut/pull/362
* sysapp: Add all possible "jumpTo" targets for SysAppSettingsArgs by @Maschell in https://github.com/devkitPro/wut/pull/366
* nn_ccr: Add CCRSysSetInitBootFlag and CCRSysInitializeSettings, add CCRCDCUicConfigIdEnum values by @Maschell in https://github.com/devkitPro/wut/pull/364
* padscore: Add more functions and types in https://github.com/devkitPro/wut/pull/348
* nsysccr/cdc: Add language and ext update functions by @GaryOderNichts in https://github.com/devkitPro/wut/pull/368
* coreinit: Add __OSPhysicalToEffectiveCached and __OSPhysicalToEffectiveUncached by @Maschell in https://github.com/devkitPro/wut/pull/367
* coreinit: Add "SavedFrame" related functions by @Maschell in https://github.com/devkitPro/wut/pull/374
* nn_acp: Add ACPGetTitleMetaDir and ACPGetTitleMetaDirByTitleListType by @Maschell in https://github.com/devkitPro/wut/pull/375
* coreinit: Add __FSAShimDecodeIosErrorToFsaStatus by @Maschell in https://github.com/devkitPro/wut/pull/378
* coreinit: add stopwatch.h and stopwatchatomic.h by @capitalistspz in https://github.com/devkitPro/wut/pull/370
* nn_ccr: Add CCRSysCaffeineBootCheckAbort; nsysccr: fix quick start menu value in CCRCDCDrcStateEnum by @Maschell in https://github.com/devkitPro/wut/pull/372
* gx2: add GX2GetMainCoreId by @Maschell in https://github.com/devkitPro/wut/pull/380
* vpad: Add VPADGetButtonProcMode by @Maschell in https://github.com/devkitPro/wut/pull/376
* sndcore2: Update AXTransitionAudioBuffer struct by @Maschell in https://github.com/devkitPro/wut/pull/373
* coreinit: Fix wrong/duplicate OSGetCodegenVirtAddrRange declaration, formatting by @Maschell in https://github.com/devkitPro/wut/pull/371
* avm: Add some missing DRC functions by @Maschell in https://github.com/devkitPro/wut/pull/379
* nsysccr: Add CCRCDCRegister*AttachCallback functions by @Maschell in https://github.com/devkitPro/wut/pull/377
* gx2: Add GX2AllocateTilingApertureEx and GX2FreeTilingAperture by @GaryOderNichts in https://github.com/devkitPro/wut/pull/381
* nsysnet/netconfig: Add SOGetProxyConfig by @GaryOderNichts in https://github.com/devkitPro/wut/pull/382
* gx2: Add GX2GetSystemTVAspectRatio by @GaryOderNichts in https://github.com/devkitPro/wut/pull/384
* nsysccr/cdc: Update CCRCDCDrcStateEnum with test menu names by @GaryOderNichts in https://github.com/devkitPro/wut/pull/386
* More DRX definitions by @team-orangeBlue in https://github.com/devkitPro/wut/pull/385
* nn/uds: Add initial headers by @DaniElectra in https://github.com/devkitPro/wut/pull/387
#### wut 1.5.0
###### New features / improvements

View File

@ -2,10 +2,6 @@
TOPDIR ?= $(CURDIR)
include $(TOPDIR)/share/wut_rules
export WUT_MAJOR := 1
export WUT_MINOR := 4
export WUT_PATCH := 0
VERSION := $(WUT_MAJOR).$(WUT_MINOR).$(WUT_PATCH)
#---------------------------------------------------------------------------------
@ -20,7 +16,6 @@ TARGET := wut
SOURCES := cafe \
libraries/wutcrt \
libraries/wutnewlib \
libraries/wutstdc++ \
libraries/wutmalloc \
libraries/wutdevoptab \
libraries/wutsocket \
@ -105,21 +100,13 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
#---------------------------------------------------------------------------------
all: lib/libwut.a lib/libwutd.a
dist-bin: all
@tar --exclude=*~ -cjf wut-$(VERSION).tar.bz2 \
include lib share \
-C libraries/libwhb include \
-C ../libgfd include \
-C ../libirc include
dist-src:
@tar --exclude=*~ -cjf wut-src-$(VERSION).tar.bz2 cafe include libraries share Makefile
dist: dist-src dist-bin
install: dist-bin
mkdir -p $(DESTDIR)$(DEVKITPRO)/wut
bzip2 -cd wut-$(VERSION).tar.bz2 | tar -xf - -C $(DESTDIR)$(DEVKITPRO)/wut
install: all
@mkdir -p $(DESTDIR)$(DEVKITPRO)/wut
@cp -frv include lib share $(DESTDIR)$(DEVKITPRO)/wut
@cp -frv libraries/libwhb/include $(DESTDIR)$(DEVKITPRO)/wut
@cp -frv libraries/nn_idb/include $(DESTDIR)$(DEVKITPRO)/wut
@cp -frv libraries/libgfd/include $(DESTDIR)$(DEVKITPRO)/wut
@cp -frv libraries/libirc/include $(DESTDIR)$(DEVKITPRO)/wut
lib:
@[ -d $@ ] || mkdir -p $@

View File

@ -77,7 +77,6 @@ ACPGetTitleMetaXmlByTitleListType
ACPGetTitleSaveDir
ACPGetTitleSaveDirEx
ACPGetTitleSaveDirExWithoutMetaCheck
ACPGetTitleSaveMetaXml
ACPGetWoodTin
ACPImportSaveDataFromBuffer
ACPImportSaveDirOfAccountWithEncryption
@ -161,3 +160,4 @@ WaitExternalStorage__Q2_2nn3acpFv
:TEXT_WRAP
ACPGetTitleMetaXml
ACPGetTitleSaveMetaXml

92
include/avm/cec.h Normal file
View File

@ -0,0 +1,92 @@
#pragma once
#include <wut.h>
#include <tve/cec.h>
/**
* \defgroup avm_cec AVM HDMI CEC
* \ingroup avm
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* Initializes CEC.
*
* \return
* \c TRUE on success.
*/
BOOL
AVMCECInit(void);
/**
* Enable CEC.
*/
void
AVMEnableCEC(void);
/**
* Disable CEC.
*/
void
AVMDisableCEC(void);
/**
* Sends a CEC command.
*
* \param destination
* Logical address of the device where the command should be sent to.
*
* \param opCode
* The op code of the command to send.
*
* \param parameters
* Pointer to optional command parameters.
*
* \param numParameters
* The amount of additional parameters.
*
* \return
* \c TRUE on success.
*/
BOOL
AVMCECSendCommand(TVECECLogicalAddress destination,
TVECECOpCode opCode,
uint8_t *parameters,
uint8_t numParameters);
/**
* Get the last receieved CEC command.
*
* \param outInitiator
* Pointer to store the logical address of the initiator of the command to.
*
* \param outOpCode
* Pointer to store the op code of the command to.
*
* \param outParameters
* Pointer to store additional parameters to.
*
* \param numParameters
* Pointer to store the amount of additional parameters to.
*
* \return
* \c TRUE on success.
*
* \warning
* This will return success even if no new command has been receieved.
* The caller should check that the parameters were actually written to.
*/
BOOL
AVMCECReceiveCommand(TVECECLogicalAddress *outInitiator,
TVECECOpCode *outOpCode,
uint8_t *outParameters,
uint8_t *outNumParameters);
#ifdef __cplusplus
}
#endif
/** @} */

View File

@ -37,59 +37,88 @@ typedef enum CamError
CAMERA_ERROR_OK = 0,
CAMERA_ERROR_INVALID_ARG = -1,
CAMERA_ERROR_INVALID_HANDLE = -2,
CAMERA_ERROR_TOO_MANY_SURFACES = -4,
CAMERA_ERROR_INSUFFICIENT_MEMORY = -5,
CAMERA_ERROR_NOT_READY = -6,
CAMERA_ERROR_UNINITIALIZED = -8,
CAMERA_ERROR_UNKNOWN = -10,
CAMERA_ERROR_UVC = -9,
CAMERA_ERROR_UVD_CONTEXT = -10,
CAMERA_ERROR_DEVICE_IN_USE = -12,
CAMERA_ERROR_SEGMENT_VIOLATION = -14
CAMERA_ERROR_UVD_SESSION = -13,
CAMERA_ERROR_SEGMENT_VIOLATION = -15
} CamError;
typedef enum CamFps
{
CAMERA_FPS_15,
CAMERA_FPS_30
CAMERA_FPS_15 = 0,
CAMERA_FPS_30 = 1
} CamFps;
typedef enum CamStreamType
{
CAMERA_STREAM_TYPE_1
CAMERA_STREAM_TYPE_1 = 0
} CamStreamType;
typedef enum CamEventType
{
CAMERA_DECODE_DONE = 0,
CAMERA_DRC_DETACH
CAMERA_DRC_DETACH = 1
} CamEventType;
struct CAMEventData
{
//! Event type
CamEventType eventType;
uint32_t data0;
uint32_t data1;
uint32_t data2;
union
{
struct
{
//! Pointer to the buffer of the decoded image
void *surfaceBuffer;
//! Handle of instance
CAMHandle handle;
//! TRUE if decode failed
BOOL failed;
} decode;
struct
{
//! Will be FALSE
BOOL connected;
//! Handle of instance
CAMHandle handle;
} detach;
//! Event args
uint32_t args[3];
};
};
WUT_CHECK_OFFSET(CAMEventData, 0x00, eventType);
WUT_CHECK_OFFSET(CAMEventData, 0x04, data0);
WUT_CHECK_OFFSET(CAMEventData, 0x08, data1);
WUT_CHECK_OFFSET(CAMEventData, 0x0C, data2);
WUT_CHECK_OFFSET(CAMEventData, 0x04, decode.surfaceBuffer);
WUT_CHECK_OFFSET(CAMEventData, 0x08, decode.handle);
WUT_CHECK_OFFSET(CAMEventData, 0x0c, decode.failed);
WUT_CHECK_OFFSET(CAMEventData, 0x04, detach.connected);
WUT_CHECK_OFFSET(CAMEventData, 0x08, detach.handle);
WUT_CHECK_OFFSET(CAMEventData, 0x04, args);
WUT_CHECK_SIZE(CAMEventData, 0x10);
typedef void(*CAMEventHandler)(CAMEventData *camEventData);
typedef void (*CAMEventHandler)(CAMEventData *camEventData);
struct CAMMode
{
int unk_0x00;
//! If TRUE, the GamePad will display the camera output regardless of what is being rendered
BOOL forceDrc;
//! Framerate setting
CamFps fps;
};
WUT_CHECK_OFFSET(CAMMode, 0x00, unk_0x00);
WUT_CHECK_OFFSET(CAMMode, 0x00, forceDrc);
WUT_CHECK_OFFSET(CAMMode, 0x04, fps);
WUT_CHECK_SIZE(CAMMode, 0x08);
struct CAMWorkMem
{
int size; // size of the work mem
void *pMem; // pointer to the work mem
//! Size of the work memory
uint32_t size;
//! Pointer to the work memory
void *pMem;
};
WUT_CHECK_OFFSET(CAMWorkMem, 0x00, size);
WUT_CHECK_OFFSET(CAMWorkMem, 0x04, pMem);
@ -97,9 +126,12 @@ WUT_CHECK_SIZE(CAMWorkMem, 0x08);
struct CAMStreamInfo
{
//! Stream type, only CAMERA_STREAM_TYPE_1 is valid
CamStreamType type;
int height; // stream height
int width; // stream width
//! Stream height
uint32_t height;
//! Stream width
uint32_t width;
};
WUT_CHECK_OFFSET(CAMStreamInfo, 0x00, type);
WUT_CHECK_OFFSET(CAMStreamInfo, 0x04, height);
@ -108,32 +140,43 @@ WUT_CHECK_SIZE(CAMStreamInfo, 0x0C);
struct CAMSetupInfo
{
//! Stream info
CAMStreamInfo streamInfo;
//! Memory used by library to record and decode frames
CAMWorkMem workMem;
//! Event handler
CAMEventHandler eventHandler;
WUT_UNKNOWN_BYTES(4);
//! Camera mode
CAMMode mode;
//! See \link OS_THREAD_ATTRIB \endlink
uint32_t threadAffinity;
WUT_UNKNOWN_BYTES(0x10);
WUT_PADDING_BYTES(0x10);
};
WUT_CHECK_OFFSET(CAMSetupInfo, 0x00, streamInfo);
WUT_CHECK_OFFSET(CAMSetupInfo, 0x0C, workMem);
WUT_CHECK_OFFSET(CAMSetupInfo, 0x14, eventHandler);
WUT_CHECK_OFFSET(CAMSetupInfo, 0x1C, mode);
WUT_CHECK_OFFSET(CAMSetupInfo, 0x24, threadAffinity);
WUT_CHECK_SIZE(CAMSetupInfo, 0x38);
WUT_CHECK_OFFSET(CAMSetupInfo, 0x18, mode);
WUT_CHECK_OFFSET(CAMSetupInfo, 0x20, threadAffinity);
WUT_CHECK_SIZE(CAMSetupInfo, 0x34);
struct CAMSurface
{
int surfaceSize;
//! Number of bytes allocated to surface buffer
int32_t surfaceSize;
//! Surface buffer data
void *surfaceBuffer;
int height; // surface height
int width; // surface width
int pitch;
int alignment; // surface alignment
int tileMode;
int pixelFormat;
//! Surface height
int32_t height;
//! Surface width
int32_t width;
//! Surface pitch
int32_t pitch;
//! Surface alignment
int32_t alignment;
//! Tile mode, should be zero
int32_t tileMode;
//! Pixel format, Should be zero
int32_t pixelFormat;
};
WUT_CHECK_OFFSET(CAMSurface, 0x00, surfaceSize);
WUT_CHECK_OFFSET(CAMSurface, 0x04, surfaceBuffer);
@ -145,24 +188,52 @@ WUT_CHECK_OFFSET(CAMSurface, 0x18, tileMode);
WUT_CHECK_OFFSET(CAMSurface, 0x1C, pixelFormat);
WUT_CHECK_SIZE(CAMSurface, 0x20);
/**
* Initialize the camera
* \returns camera handle on success, and -1 on failure
*/
CAMHandle
CAMInit(int instance, CAMSetupInfo *setupInfo, CAMError *err);
/**
* Deinitialize and clean up
*/
void
CAMExit(CAMHandle handle);
/**
* Start recording and decoding frames
*/
CAMError
CAMOpen(CAMHandle handle);
/**
* Stops recording and decoding.
* Automatically called when the process is moved to background
*/
CAMError
CAMClose(CAMHandle handle);
CAMError
/**
* Get the number of bytes requied by the work memory
* \returns number of bytes
* \returns CAM_ERROR_INVALID_ARG if streamInfo is NULL
*/
int32_t
CAMGetMemReq(CAMStreamInfo *streamInfo);
/**
* Submit 1 surface to the working queue.
* Once the frame is captured and decoded, the event handler set in CAMInit will fire, and the frame will be dequeued.
* Up to 20 surfaces may be queued.
* Surface data is returned in the NV12 format
*/
CAMError
CAMSubmitTargetSurface(CAMHandle handle, CAMSurface *surface);
/**
* Checks whether memory is segmented correctly to be used with the camera library
*/
CAMError
CAMCheckMemSegmentation(void *pMem, uint32_t size);

View File

@ -1,8 +1,8 @@
#pragma once
#include <wut.h>
#include "context.h"
#include "threadqueue.h"
#include "time.h"
#include "context.h"
/**
* \defgroup coreinit_alarms Alarms

View File

@ -12,16 +12,32 @@
extern "C" {
#endif
typedef int32_t BSPError;
typedef uint32_t BSPHardwareVersion;
typedef uint32_t BSPConsoleTypeRaw;
typedef enum BSPErrors
typedef enum BSPError
{
BSP_ERROR_OK = 0,
BSP_ERROR_OK = 0x0,
BSP_ERROR_UNKNOWN_ENTITY = 0x1,
BSP_ERROR_UNKNOWN_ATTRIBUTE = 0x2,
BSP_ERROR_INVALID_INSTANCE = 0x4,
BSP_ERROR_CFG_CORRUPTED = 0x8,
BSP_ERROR_DEVICE_ERROR = 0x10,
BSP_ERROR_DEVICE_BUSY = 0x20,
BSP_ERROR_IOS_ERROR = 0x40,
BSP_ERROR_RESPONSE_TOO_LARGE = 0x80,
} BSPErrors;
BSP_ERROR_SPECIFIED_SIZE_INVALID = 0x80,
BSP_ERROR_HEAP_ERROR = 0x100,
BSP_ERROR_ENTITY_LIST_FULL = 0x200,
BSP_ERROR_UNSUPPORTED_METHOD = 0x400,
BSP_ERROR_UNKNOWN_HARDWARE_VERSION = 0x800,
BSP_ERROR_QUERY_UNAVAILABLE = 0x1000,
BSP_ERROR_UNKNOWN_DEVICE = 0x2000,
BSP_ERROR_INVALID_PARAMETER = 0x4000,
BSP_ERROR_DEVICE_NOT_FOUND = 0x8000,
BSP_ERROR_REQUEST_DENIED = 0x10000,
BSP_ERROR_UNSUPPORTED_PARAMETER = 0x20000,
BSP_ERROR_BOARD_CONFIG_INVALID = 0x40000,
} BSPError;
typedef enum BSPHardwareVersions
{

View File

@ -15,7 +15,8 @@ extern "C" {
//! A bitfield of enum OS_CONTEXT_STATE.
typedef uint16_t OSContextState;
enum OS_CONTEXT_STATE {
enum OS_CONTEXT_STATE
{
OS_CONTEXT_STATE_OSCALLBACK = 1 << 3,
OS_CONTEXT_STATE_USERMODE_SAVED = 1 << 4
};

View File

@ -14,6 +14,15 @@ extern "C" {
#endif
/**
* Can be used to mask the return value of
* \ref OSGetConsoleType
* for determining the "group" of console. See the function for more
* information around the values the mask gives.
*/
#define OS_CONSOLE_TYPE_MASK 0xF0000000
/**
* Gets the number of cores in the system. On a retail Wii U, this is always 3.
*
@ -58,6 +67,22 @@ BOOL
OSIsMainCore();
/**
* Get the type of console this code is actively running on.
*
* Most of the field is relatively unknown but you can use
* \ref OS_CONSOLE_TYPE_MASK
* which returns whether the unit is a Retail/CAT-R unit with `0x00000000`,
* a CAT-DEV or other CAFE development board with `0x10000000`, and an
* orchestrax unit with `0x20000000`.
*
* \returns
* A number representing the specific console types.
*/
uint32_t
OSGetConsoleType();
#ifdef __cplusplus
}
#endif

View File

@ -12,14 +12,16 @@
extern "C" {
#endif
typedef enum COSReportLevel{
typedef enum COSReportLevel
{
COS_REPORT_LEVEL_ERROR = 0,
COS_REPORT_LEVEL_WARN = 1,
COS_REPORT_LEVEL_INFO = 2,
COS_REPORT_LEVEL_VERBOSE = 3,
} COSReportLevel;
typedef enum COSReportModule{
typedef enum COSReportModule
{
COS_REPORT_MODULE_UNKNOWN_0 = 0,
COS_REPORT_MODULE_UNKNOWN_1 = 1,
COS_REPORT_MODULE_UNKNOWN_2 = 2,
@ -29,28 +31,33 @@ typedef enum COSReportModule{
void
COSVReport(COSReportModule module,
COSReportLevel level,
const char* fmt,
...);
const char *fmt,
...)
WUT_FORMAT_PRINTF(3, 4);
void
COSError(COSReportModule module,
const char* fmt,
...);
const char *fmt,
...)
WUT_FORMAT_PRINTF(2, 3);
void
COSInfo(COSReportModule module,
const char* fmt,
...);
const char *fmt,
...)
WUT_FORMAT_PRINTF(2, 3);
void
COSVerbose(COSReportModule module,
const char* fmt,
...);
const char *fmt,
...)
WUT_FORMAT_PRINTF(2, 3);
void
COSWarn(COSReportModule module,
const char* fmt,
...);
const char *fmt,
...)
WUT_FORMAT_PRINTF(2, 3);
#ifdef __cplusplus
}

View File

@ -11,6 +11,8 @@
extern "C" {
#endif
typedef struct OSFatalError OSFatalError;
typedef void (*DisassemblyPrintFn)(const char *fmt, ...);
typedef uint32_t (*DisassemblyFindSymbolFn)(uint32_t addr, char *symbolNameBuf, uint32_t symbolNameBufSize);
@ -20,6 +22,39 @@ typedef enum DisassemblePPCFlags
DISASSEMBLE_PPC_FLAGS_NONE = 0,
} DisassemblePPCFlags;
typedef enum OSFatalErrorMessageType
{
OS_FATAL_ERROR_UNKOWN = 0,
OS_FATAL_ERROR_GENERAL = 1,
//! These are only valid for errorCode 1600200 - 1609999
OS_FATAL_ERROR_CORRUPTION = 2,
OS_FATAL_ERROR_FATAL_SYSTEM_OR_USB = 3,
OS_FATAL_ERROR_CORRUPTION_SLC = 4,
OS_FATAL_ERROR_CORRUPTION_USB = 5,
OS_FATAL_ERROR_STORAGE_REMOVED = 6,
OS_FATAL_ERROR_DISC_REMOVED = 7,
OS_FATAL_ERROR_CORRUPTION_DISC = 8,
OS_FATAL_ERROR_WRITE_PROTECT = 9,
} OSFatalErrorMessageType;
struct OSFatalError
{
OSFatalErrorMessageType messageType;
uint32_t errorCode;
uint32_t processId;
uint32_t internalErrorCode;
uint32_t line;
char functionName[64];
WUT_UNKNOWN_BYTES(0x80);
};
WUT_CHECK_OFFSET(OSFatalError, 0x00, messageType);
WUT_CHECK_OFFSET(OSFatalError, 0x04, errorCode);
WUT_CHECK_OFFSET(OSFatalError, 0x08, processId);
WUT_CHECK_OFFSET(OSFatalError, 0x0C, internalErrorCode);
WUT_CHECK_OFFSET(OSFatalError, 0x10, line);
WUT_CHECK_OFFSET(OSFatalError, 0x14, functionName);
WUT_CHECK_SIZE(OSFatalError, 0xD4);
void
OSConsoleWrite(const char *msg,
@ -30,30 +65,40 @@ __OSConsoleWrite(const char *msg,
uint32_t size);
void
OSReport(const char *fmt, ...);
OSReport(const char *fmt, ...)
WUT_FORMAT_PRINTF(1, 2);
void
OSReportVerbose(const char *fmt, ...);
OSReportVerbose(const char *fmt, ...)
WUT_FORMAT_PRINTF(1, 2);
void
OSReportInfo(const char *fmt, ...);
OSReportInfo(const char *fmt, ...)
WUT_FORMAT_PRINTF(1, 2);
void
OSReportWarn(const char *fmt, ...);
OSReportWarn(const char *fmt, ...)
WUT_FORMAT_PRINTF(1, 2);
void
OSPanic(const char *file,
uint32_t line,
const char *fmt, ...);
const char *fmt,
...)
WUT_FORMAT_PRINTF(3, 4);
void
OSFatal(const char *msg);
void
OSSendFatalError(OSFatalError *error,
const char *functionName,
uint32_t line);
uint32_t
OSGetSymbolName(uint32_t addr,

View File

@ -39,7 +39,8 @@ typedef enum OSDynLoad_Error
typedef OSDynLoad_Error (*OSDynLoadAllocFn)(int32_t size, int32_t align, void **outAddr);
typedef void (*OSDynLoadFreeFn)(void *addr);
typedef enum OSDynLoad_ExportType {
typedef enum OSDynLoad_ExportType
{
OS_DYNLOAD_EXPORT_FUNC = 0,
OS_DYNLOAD_EXPORT_DATA = 1,
} OSDynLoad_ExportType;
@ -130,7 +131,8 @@ struct OSDynLoad_LoaderSectionInfo
uint32_t flags;
void *address;
union {
union
{
//! Size of the section, set when type != SHT_RPL_IMPORTS
uint32_t size;

View File

@ -11,8 +11,10 @@
extern "C" {
#endif
// clang-format off
void
RPLWRAP(exit)(int code);
// clang-format on
void
_Exit(int code);

View File

@ -13,8 +13,7 @@ extern "C" {
#endif
typedef void (*OSFiberEntryFn)();
typedef void (*OSFiberExEntryFn)(uint32_t arg1, uint32_t arg2,
uint32_t arg3, uint32_t arg4);
typedef void (*OSFiberExEntryFn)(uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4);
int32_t
OSSwitchFiber(OSFiberEntryFn entry,

View File

@ -1,10 +1,10 @@
#pragma once
#include <wut.h>
#include <coreinit/alarm.h>
#include <coreinit/fastmutex.h>
#include <coreinit/ios.h>
#include <coreinit/messagequeue.h>
#include <coreinit/time.h>
#include <coreinit/ios.h>
#include <coreinit/fastmutex.h>
#include <coreinit/alarm.h>
/**
* \defgroup coreinit_fs Filesystem
@ -181,7 +181,8 @@ typedef enum FSVolumeState
FS_VOLUME_STATE_INVALID = 11,
} FSVolumeState;
typedef enum FSMediaState {
typedef enum FSMediaState
{
FS_MEDIA_STATE_READY = 0,
FS_MEDIA_STATE_NO_MEDIA = 1,
FS_MEDIA_STATE_INVALID_MEDIA = 2,
@ -189,9 +190,11 @@ typedef enum FSMediaState {
FS_MEDIA_STATE_MEDIA_ERROR = 4,
} FSMediaState;
typedef enum FSMountSourceType {
typedef enum FSMountSourceType
{
FS_MOUNT_SOURCE_SD = 0,
FS_MOUNT_SOURCE_UNK = 1,
//! Devkit only API currently. Uses the PCFS channel to perform I/O operations on the attached host machine.
FS_MOUNT_SOURCE_HFIO = 1,
} FSMountSourceType;
typedef enum FSOpenFileFlags
@ -204,8 +207,8 @@ typedef enum FSOpenFileFlags
FS_OPEN_FLAG_PREALLOC_SIZE = (1 << 1)
} FSOpenFileFlags;
typedef void(*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
typedef void(*FSStateChangeCallback)(FSClient *, FSVolumeState, void *);
typedef void (*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
typedef void (*FSStateChangeCallback)(FSClient *, FSVolumeState, void *);
struct FSFsm
{
@ -238,8 +241,8 @@ WUT_CHECK_SIZE(FSMessage, 0x10);
*/
struct FSClientBodyLink
{
FSClientBody* next;
FSClientBody* prev;
FSClientBody *next;
FSClientBody *prev;
};
WUT_CHECK_OFFSET(FSClientBodyLink, 0x00, next);
WUT_CHECK_OFFSET(FSClientBodyLink, 0x04, prev);
@ -259,7 +262,7 @@ struct FSClientBody
FSCmdQueue cmdQueue;
//! The last dequeued command.
FSCmdBlockBody* lastDequeuedCommand;
FSCmdBlockBody *lastDequeuedCommand;
//! Emulated error, set with FSSetEmulatedError.
FSError emulatedError;
@ -292,7 +295,7 @@ struct FSClientBody
FSClientBodyLink link;
//! Pointer to unaligned FSClient structure.
FSClient* client;
FSClient *client;
};
WUT_CHECK_OFFSET(FSClientBody, 0x1444, clientHandle);
WUT_CHECK_OFFSET(FSClientBody, 0x1448, fsm);
@ -397,7 +400,8 @@ WUT_CHECK_OFFSET(FSAsyncResult, 0x20, block);
WUT_CHECK_OFFSET(FSAsyncResult, 0x24, status);
WUT_CHECK_SIZE(FSAsyncResult, 0x28);
struct FSCmdBlockBody {
struct FSCmdBlockBody
{
WUT_UNKNOWN_BYTES(0x96C);
FSAsyncResult asyncResult;
WUT_UNKNOWN_BYTES(0x68);
@ -419,7 +423,8 @@ struct FSMountSource
};
WUT_CHECK_SIZE(FSMountSource, 0x300);
struct WUT_PACKED FSVolumeInfo {
struct WUT_PACKED FSVolumeInfo
{
uint32_t flags;
FSMediaState mediaState;
WUT_UNKNOWN_BYTES(0x4);
@ -450,22 +455,24 @@ WUT_CHECK_SIZE(FSVolumeInfo, 444);
* Get an aligned FSClientBody from an FSClient.
*/
static inline FSClientBody *
FSGetClientBody(FSClient *client) {
FSGetClientBody(FSClient *client)
{
if (!client) {
return NULL;
}
return (FSClientBody *) ((((uint32_t) client) + 0x3F) & ~0x3F);
return (FSClientBody *)((((uint32_t)client) + 0x3F) & ~0x3F);
}
/**
* Get an aligned FSCmdBlockBody from an FSCmdBlock.
*/
static inline FSCmdBlockBody *
FSGetCmdBlockBody(FSCmdBlock *cmdBlock) {
FSGetCmdBlockBody(FSCmdBlock *cmdBlock)
{
if (!cmdBlock) {
return NULL;
}
return (FSCmdBlockBody *) ((((uint32_t) cmdBlock) + 0x3F) & ~0x3F);
return (FSCmdBlockBody *)((((uint32_t)cmdBlock) + 0x3F) & ~0x3F);
}
void

View File

@ -1,6 +1,5 @@
#pragma once
#include "wut.h"
#include <wut.h>
#include "filesystem.h"
#ifdef __cplusplus
@ -83,7 +82,8 @@ typedef void (*FSAAsyncCallbackFn)(FSError result,
/**
* Block information.
*/
struct FSABlockInfo {
struct FSABlockInfo
{
WUT_UNKNOWN_BYTES(0x14);
};
WUT_CHECK_SIZE(FSABlockInfo, 0x14);
@ -91,7 +91,8 @@ WUT_CHECK_SIZE(FSABlockInfo, 0x14);
/**
* Device information.
*/
struct FSADeviceInfo {
struct FSADeviceInfo
{
WUT_UNKNOWN_BYTES(0x08);
uint64_t deviceSizeInSectors;
uint32_t deviceSectorSize;
@ -104,19 +105,22 @@ WUT_CHECK_SIZE(FSADeviceInfo, 0x28);
/**
* File System information.
*/
struct FSAFileSystemInfo {
struct FSAFileSystemInfo
{
WUT_UNKNOWN_BYTES(0x1E);
};
WUT_CHECK_SIZE(FSAFileSystemInfo, 0x1E);
typedef enum FSAMountPriority {
typedef enum FSAMountPriority
{
FSA_MOUNT_PRIORITY_BASE = 0x1,
FSA_MOUNT_PRIORITY_RAM_DISK_CACHE = 0x4,
FSA_MOUNT_PRIORITY_TITLE_UPDATE = 0x9,
FSA_MOUNT_PRIORITY_UNMOUNT_ALL = 0x80000000,
} FSAMountPriority;
typedef enum FSAQueryInfoType {
typedef enum FSAQueryInfoType
{
FSA_QUERY_INFO_FREE_SPACE_SIZE = 0x0,
FSA_QUERY_INFO_DIR_SIZE = 0x1,
FSA_QUERY_INFO_ENTRY_NUM = 0x2,
@ -128,12 +132,14 @@ typedef enum FSAQueryInfoType {
FSA_QUERY_INFO_FRAGMENT_BLOCK_INFO = 0x8,
} FSAQueryInfoType;
typedef enum FSAReadFlag {
typedef enum FSAReadFlag
{
FSA_READ_FLAG_NONE = 0x0,
FSA_READ_FLAG_READ_WITH_POS = 0x1
} FSAReadFlag;
typedef enum FSAWriteFlag {
typedef enum FSAWriteFlag
{
FSA_WRITE_FLAG_NONE = 0x0,
FSA_WRITE_FLAG_READ_WITH_POS = 0x1
} FSAWriteFlag;
@ -152,19 +158,22 @@ WUT_CHECK_OFFSET(FSAProcessInfo, 0x08, processId);
WUT_CHECK_OFFSET(FSAProcessInfo, 0x0C, groupId);
WUT_CHECK_SIZE(FSAProcessInfo, 0x10);
struct FSARequestRawOpen {
struct FSARequestRawOpen
{
char path[0x280];
};
WUT_CHECK_OFFSET(FSARequestRawOpen, 0x0, path);
WUT_CHECK_SIZE(FSARequestRawOpen, 0x280);
struct FSARequestRawClose {
struct FSARequestRawClose
{
int32_t handle;
};
WUT_CHECK_OFFSET(FSARequestRawClose, 0x0, handle);
WUT_CHECK_SIZE(FSARequestRawClose, 0x04);
struct WUT_PACKED FSARequestRawRead {
struct WUT_PACKED FSARequestRawRead
{
WUT_UNKNOWN_BYTES(0x4);
uint64_t blocks_offset;
uint32_t count;
@ -177,7 +186,8 @@ WUT_CHECK_OFFSET(FSARequestRawRead, 0x10, size);
WUT_CHECK_OFFSET(FSARequestRawRead, 0x14, device_handle);
WUT_CHECK_SIZE(FSARequestRawRead, 0x18);
struct WUT_PACKED FSARequestRawWrite {
struct WUT_PACKED FSARequestRawWrite
{
WUT_UNKNOWN_BYTES(0x4);
uint64_t blocks_offset;
uint32_t count;
@ -211,7 +221,7 @@ WUT_CHECK_SIZE(FSARequestAppendFile, 0x10);
*/
struct FSARequestChangeDir
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
};
WUT_CHECK_OFFSET(FSARequestChangeDir, 0x0, path);
WUT_CHECK_SIZE(FSARequestChangeDir, 0x280);
@ -222,7 +232,7 @@ WUT_CHECK_SIZE(FSARequestChangeDir, 0x280);
*/
struct FSARequestChangeMode
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
uint32_t mode1;
uint32_t mode2;
};
@ -270,7 +280,7 @@ WUT_CHECK_SIZE(FSARequestFlushFile, 0x4);
*/
struct FSARequestFlushQuota
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
};
WUT_CHECK_OFFSET(FSARequestFlushQuota, 0x0, path);
WUT_CHECK_SIZE(FSARequestFlushQuota, 0x280);
@ -281,7 +291,7 @@ WUT_CHECK_SIZE(FSARequestFlushQuota, 0x280);
*/
struct FSARequestGetInfoByQuery
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
FSAQueryInfoType type;
};
WUT_CHECK_OFFSET(FSARequestGetInfoByQuery, 0x0, path);
@ -316,7 +326,7 @@ WUT_CHECK_SIZE(FSARequestIsEof, 0x4);
*/
struct FSARequestMakeDir
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
uint32_t permission;
};
WUT_CHECK_OFFSET(FSARequestMakeDir, 0x0, path);
@ -328,7 +338,7 @@ WUT_CHECK_SIZE(FSARequestMakeDir, 0x284);
*/
struct WUT_PACKED FSARequestMakeQuota
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
uint32_t mode;
uint64_t size;
};
@ -343,10 +353,10 @@ WUT_CHECK_SIZE(FSARequestMakeQuota, 0x28C);
*/
struct FSARequestMount
{
char path[FS_MAX_PATH +1];
char target[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
char target[FS_MAX_PATH + 1];
uint32_t unk0x500;
void* unkBuf;
void *unkBuf;
uint32_t unkBufLen;
};
WUT_CHECK_OFFSET(FSARequestMount, 0x0, path);
@ -362,11 +372,11 @@ WUT_CHECK_SIZE(FSARequestMount, 0x50C);
*/
struct WUT_PACKED FSARequestMountWithProcess
{
char path[FS_MAX_PATH +1];
char target[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
char target[FS_MAX_PATH + 1];
FSAMountPriority priority;
FSAProcessInfo process;
void* unkBuf;
void *unkBuf;
uint32_t unkBufLen;
};
WUT_CHECK_OFFSET(FSARequestMountWithProcess, 0x0, path);
@ -383,7 +393,7 @@ WUT_CHECK_SIZE(FSARequestMountWithProcess, 0x51C);
*/
struct FSARequestOpenDir
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
};
WUT_CHECK_OFFSET(FSARequestOpenDir, 0x0, path);
WUT_CHECK_SIZE(FSARequestOpenDir, 0x280);
@ -393,7 +403,7 @@ WUT_CHECK_SIZE(FSARequestOpenDir, 0x280);
*/
struct FSARequestOpenFile
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
char mode[FS_MODE_LENGTH];
uint32_t unk0x290;
uint32_t unk0x294;
@ -424,7 +434,7 @@ WUT_CHECK_SIZE(FSARequestReadDir, 0x4);
struct FSARequestReadFile
{
//! Virtual pointer used only by Cafe, for IOS we should use ioctlv.vecs[1]
uint8_t* buffer;
uint8_t *buffer;
uint32_t size;
uint32_t count;
FSAFilePosition pos;
@ -445,7 +455,7 @@ WUT_CHECK_SIZE(FSARequestReadFile, 0x18);
*/
struct FSARequestRemove
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
};
WUT_CHECK_OFFSET(FSARequestRemove, 0x0, path);
WUT_CHECK_SIZE(FSARequestRemove, 0x280);
@ -456,8 +466,8 @@ WUT_CHECK_SIZE(FSARequestRemove, 0x280);
*/
struct FSARequestRename
{
char oldPath[FS_MAX_PATH +1];
char newPath[FS_MAX_PATH +1];
char oldPath[FS_MAX_PATH + 1];
char newPath[FS_MAX_PATH + 1];
};
WUT_CHECK_OFFSET(FSARequestRename, 0x0, oldPath);
WUT_CHECK_OFFSET(FSARequestRename, 0x280, newPath);
@ -515,7 +525,7 @@ WUT_CHECK_SIZE(FSARequestTruncateFile, 0x4);
*/
struct FSARequestUnmount
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
uint32_t unk0x280;
};
WUT_CHECK_OFFSET(FSARequestUnmount, 0x0, path);
@ -528,7 +538,7 @@ WUT_CHECK_SIZE(FSARequestUnmount, 0x284);
*/
struct WUT_PACKED FSARequestUnmountWithProcess
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
FSAMountPriority priority;
FSAProcessInfo process;
};
@ -544,7 +554,7 @@ WUT_CHECK_SIZE(FSARequestUnmountWithProcess, 0x294);
struct FSARequestWriteFile
{
//! Virtual pointer used only by Cafe, for IOS we should use ioctlv.vecs[1]
const uint8_t* buffer;
const uint8_t *buffer;
uint32_t size;
uint32_t count;
FSAFilePosition pos;
@ -561,7 +571,7 @@ WUT_CHECK_SIZE(FSARequestWriteFile, 0x18);
struct FSARequestChangeOwner
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
WUT_UNKNOWN_BYTES(4);
uint32_t owner;
WUT_UNKNOWN_BYTES(4);
@ -572,10 +582,12 @@ WUT_CHECK_OFFSET(FSARequestChangeOwner, 0x284, owner);
WUT_CHECK_OFFSET(FSARequestChangeOwner, 0x28C, group);
WUT_CHECK_SIZE(FSARequestChangeOwner, 0x290);
struct FSARequest {
struct FSARequest
{
FSError emulatedError;
union {
union
{
FSARequestRawOpen rawOpen;
FSARequestRawClose rawClose;
FSARequestRawRead rawRead;
@ -616,7 +628,8 @@ WUT_CHECK_OFFSET(FSARequest, 0x04, rawOpen);
WUT_CHECK_SIZE(FSARequest, 0x520);
struct FSAResponseRawOpen {
struct FSAResponseRawOpen
{
int handle;
};
WUT_CHECK_OFFSET(FSAResponseRawOpen, 0x0, handle);
@ -624,7 +637,7 @@ WUT_CHECK_SIZE(FSAResponseRawOpen, 0x4);
struct FSAResponseGetCwd
{
char path[FS_MAX_PATH +1];
char path[FS_MAX_PATH + 1];
};
WUT_CHECK_OFFSET(FSAResponseGetCwd, 0x0, path);
WUT_CHECK_SIZE(FSAResponseGetCwd, 0x280);
@ -652,7 +665,8 @@ WUT_CHECK_SIZE(FSAResponseGetVolumeInfo, 0x1BC);
struct WUT_PACKED FSAResponseGetInfoByQuery
{
union WUT_PACKED {
union WUT_PACKED
{
FSABlockInfo badBlockInfo;
FSADeviceInfo deviceInfo;
uint64_t dirSize;
@ -703,9 +717,11 @@ struct FSAResponseStatFile
WUT_CHECK_OFFSET(FSAResponseStatFile, 0x0, stat);
WUT_CHECK_SIZE(FSAResponseStatFile, 0x64);
struct WUT_PACKED FSAResponse {
struct WUT_PACKED FSAResponse
{
uint32_t word0;
union WUT_PACKED {
union WUT_PACKED
{
FSAResponseRawOpen rawOpen;
FSAResponseGetCwd getCwd;
FSAResponseGetFileBlockAddress getFileBlockAddress;
@ -723,7 +739,8 @@ WUT_CHECK_OFFSET(FSAResponse, 0x0, word0);
WUT_CHECK_OFFSET(FSAResponse, 0x4, rawOpen);
WUT_CHECK_SIZE(FSAResponse, 0x293);
enum FSACommandEnum {
enum FSACommandEnum
{
FSA_COMMAND_INVALID = 0x0,
FSA_COMMAND_MOUNT = 0x1,
FSA_COMMAND_UNMOUNT = 0x2,
@ -791,12 +808,14 @@ enum FSACommandEnum {
FSA_COMMAND_SEND_PROFILE_CMD = 0x8E,
};
enum FSAIpcRequestTypeEnum {
enum FSAIpcRequestTypeEnum
{
FSA_IPC_REQUEST_IOCTL = 0,
FSA_IPC_REQUEST_IOCTLV = 1,
};
struct FSAAsyncResult {
struct FSAAsyncResult
{
//! Queue to put a message on when command is complete.
OSMessageQueue *ioMsgQueue;
@ -831,7 +850,8 @@ WUT_CHECK_OFFSET(FSAAsyncResult, 0x24, response);
WUT_CHECK_OFFSET(FSAAsyncResult, 0x28, userContext);
WUT_CHECK_SIZE(FSAAsyncResult, 0x2C);
struct WUT_PACKED FSAShimBuffer {
struct WUT_PACKED FSAShimBuffer
{
//! Buffer for FSA IPC request.
FSARequest request;
WUT_UNKNOWN_BYTES(0x60);
@ -880,7 +900,8 @@ typedef void (*FSAClientAttachAsyncCallbackFn)(FSError result,
FSAResponse *response,
void *userContext);
struct FSAClientAttachAsyncData {
struct FSAClientAttachAsyncData
{
//! Callback to call when an attach has happened.
FSAClientAttachAsyncCallbackFn userCallback;
@ -895,13 +916,15 @@ WUT_CHECK_OFFSET(FSAClientAttachAsyncData, 0x04, userContext);
WUT_CHECK_OFFSET(FSAClientAttachAsyncData, 0x08, ioMsgQueue);
WUT_CHECK_SIZE(FSAClientAttachAsyncData, 0xC);
typedef enum FSAMountFlags {
typedef enum FSAMountFlags
{
FSA_MOUNT_FLAG_LOCAL_MOUNT = 0,
FSA_MOUNT_FLAG_BIND_MOUNT = 1,
FSA_MOUNT_FLAG_GLOBAL_MOUNT = 2,
} FSAMountFlags;
typedef enum FSAUnmountFlags {
typedef enum FSAUnmountFlags
{
FSA_UNMOUNT_FLAG_NONE = 0x00000000,
FSA_UNMOUNT_FLAG_FORCE = 0x00000002,
FSA_UNMOUNT_FLAG_BIND_MOUNT = 0x80000000,

View File

@ -158,7 +158,7 @@ IM_GetParameter(IOSHandle handle,
void *asyncCallbackContext);
IOSError
IM_GetParameters(IMParameters* parameters);
IM_GetParameters(IMParameters *parameters);
IOSError
IM_GetNvParameter(IOSHandle handle,

View File

@ -6,7 +6,11 @@ extern "C" {
#endif
int
__os_snprintf(char *buf, size_t n, const char *format, ... );
__os_snprintf(char *buf,
size_t n,
const char *format,
...)
WUT_FORMAT_PRINTF(3, 4);
#ifdef __cplusplus
}

View File

@ -29,7 +29,7 @@ typedef enum OSInterruptType
OS_INTERRUPT_TYPE_AHB = 12
} OSInterruptType;
typedef void(*OSUserInterruptHandler)(OSInterruptType type, OSContext* interruptedContext);
typedef void (*OSUserInterruptHandler)(OSInterruptType type, OSContext *interruptedContext);
BOOL
OSEnableInterrupts();

View File

@ -1,8 +1,8 @@
#pragma once
#include <wut.h>
#include "mutex.h"
#include "ios.h"
#include "mutex.h"
#ifdef __cplusplus
extern "C" {
@ -17,7 +17,8 @@ typedef struct IPCBufPool IPCBufPool;
*
* Functions similar to a ring buffer.
*/
struct IPCBufPoolFIFO {
struct IPCBufPoolFIFO
{
//! The current message index to push to.
int32_t pushIndex;
@ -43,7 +44,8 @@ WUT_CHECK_SIZE(IPCBufPoolFIFO, 0x14);
/**
* Attributes returned by IPCBufPoolGetAttributes.
*/
struct IPCBufPoolAttributes {
struct IPCBufPoolAttributes
{
//! Size of a message in the buffer pool.
uint32_t messageSize;
@ -63,7 +65,8 @@ WUT_CHECK_SIZE(IPCBufPoolAttributes, 0x0C);
/**
* A simple message buffer pool used for IPC communication.
*/
struct IPCBufPool {
struct IPCBufPool
{
//! Magic header always set to IPCBufPool::MagicHeader.
uint32_t magic;

View File

@ -12,7 +12,8 @@
extern "C" {
#endif
typedef enum OSICICommand {
typedef enum OSICICommand
{
OS_ICI_COMMAND_INVALID_IC_RANGE = 1,
OS_ICI_COMMAND_RESCHEDULE_CORE = 2,
OS_ICI_COMMAND_HALT_CORE = 3,
@ -30,13 +31,14 @@ typedef enum OSICICommand {
OS_ICI_COMMAND_OVERLAY_ARENA = 0xF,
} OSICICommand;
typedef void (*OSExceptionCallbackExFn)(OSExceptionType exceptionType, OSContext * interruptedContext, OSContext *cbContext);
typedef void (*OSExceptionCallbackExFn)(OSExceptionType exceptionType, OSContext *interruptedContext, OSContext *cbContext);
typedef void (*KernelTimerCallbackFn)(OSExceptionType exception, OSContext *interruptedContext, OSContext *currentContext);
typedef uint32_t KernelTimerHandle;
typedef struct OSExceptionChainInfo {
typedef struct OSExceptionChainInfo
{
OSExceptionCallbackExFn callback;
void *stack;
OSContext *context;
@ -46,8 +48,10 @@ WUT_CHECK_OFFSET(OSExceptionChainInfo, 4, stack);
WUT_CHECK_OFFSET(OSExceptionChainInfo, 8, context);
WUT_CHECK_SIZE(OSExceptionChainInfo, 12);
typedef struct KernelInfo0 {
struct CoreinitInfo {
typedef struct KernelInfo0
{
struct CoreinitInfo
{
void *loaderHandle;
void *textAddr;
uint32_t textOffset;
@ -127,7 +131,8 @@ WUT_CHECK_OFFSET(KernelInfo0, 0x9C, unk0x9C);
WUT_CHECK_OFFSET(KernelInfo0, 0xA0, titleId);
WUT_CHECK_SIZE(KernelInfo0, 0xA8);
typedef struct KernelInfo6 {
typedef struct KernelInfo6
{
uint64_t osTitleId;
uint32_t unk0x08;
WUT_PADDING_BYTES(0x108 - 0xC);
@ -136,14 +141,33 @@ WUT_CHECK_OFFSET(KernelInfo6, 0x00, osTitleId);
WUT_CHECK_OFFSET(KernelInfo6, 0x08, unk0x08);
WUT_CHECK_SIZE(KernelInfo6, 0x108);
void __KernelSetUserModeExHandler(OSExceptionType exceptionType, OSExceptionChainInfo *chainInfo, OSExceptionChainInfo *prevChainInfo);
void
__KernelSetUserModeExHandler(OSExceptionType exceptionType,
OSExceptionChainInfo *chainInfo,
OSExceptionChainInfo *prevChainInfo);
KernelTimerHandle __KernelAllocateTimer(KernelTimerCallbackFn, void *exceptionStack, OSContext *context);
uint32_t __KernelPrimeTimer(KernelTimerHandle handle, uint64_t startTimeInTicks, uint64_t intervalInTicks, uint32_t unknown);
KernelTimerHandle
__KernelAllocateTimer(KernelTimerCallbackFn,
void *exceptionStack,
OSContext *context);
void __KernelSendICI(OSICICommand cmd, void *arg1, uint32_t unknown1, uint32_t unknown2);
uint32_t
__KernelPrimeTimer(KernelTimerHandle handle,
uint64_t startTimeInTicks,
uint64_t intervalInTicks,
uint32_t unknown);
void __KernelGetInfo(uint32_t type, void *outBuffer, uint32_t outBufferSize, uint32_t core);
void
__KernelSendICI(OSICICommand cmd,
void *arg1,
uint32_t unknown1,
uint32_t unknown2);
void
__KernelGetInfo(uint32_t type,
void *outBuffer,
uint32_t outBufferSize,
uint32_t core);
static inline void
__KernelGetInfo0(KernelInfo0 *outBuffer, uint32_t core)

View File

@ -63,9 +63,11 @@ typedef enum MCPAppType
typedef enum MCPDeviceType
{
MCP_DEVICE_TYPE_AUTO = 1, /* returns result for ODD, MLC and USB */
MCP_DEVICE_TYPE_ODD = 2,
MCP_DEVICE_TYPE_MLC = 3,
MCP_DEVICE_TYPE_USB = 4,
/* any value >= 5 is MCP_DEVICE_TYPE_AUTO */
} MCPDeviceType;
typedef enum MCPDeviceFlags
@ -100,6 +102,16 @@ typedef enum MCPCompatAVFile
MCP_COMPAT_AV_FILE_DEINT = 0x01,
} MCPCompatAVFile;
typedef enum MCPSystemMode
{
//! This unit is in 'retail'/'production' mode.
MCP_PRODUCTION = 0x00,
//! This unit is in 'development' mode (default for CAT-DEV).
MCP_DEVELOPMENT = 0x01,
//! This unit is in 'test' mode.
MCP_TEST = 0x02,
} MCPSystemMode;
struct WUT_PACKED MCPDevice
{
char type[8];
@ -239,6 +251,10 @@ MCPError
MCP_GetOwnTitleInfo(int32_t handle,
MCPTitleListType *titleInfo);
MCPError
MCP_GetSystemMode(int32_t handle,
MCPSystemMode *mode);
MCPError
MCP_GetSysProdSettings(int32_t handle,
MCPSysProdSettings *settings);
@ -310,7 +326,7 @@ MCP_TitleListByUniqueId(int32_t handle,
MCPError
MCP_TitleListByDevice(int32_t handle,
const char *device,
const char *deviceName,
uint32_t *outTitleCount,
MCPTitleListType *titleList,
uint32_t titleListSizeBytes);
@ -324,7 +340,7 @@ MCP_TitleListByDeviceType(int32_t handle,
MCPError
MCP_TitleListByAppAndDevice(int32_t handle,
MCPAppType appType,
const char *device,
const char *deviceName,
uint32_t *outTitleCount,
MCPTitleListType *titleList,
uint32_t titleListSizeBytes);
@ -380,6 +396,22 @@ MCP_ChangeEcoSettings(int32_t handle,
uint32_t maxOnTime,
uint16_t defaultOffTime);
static inline const char *
MCP_GetDeviceNameByDeviceType(MCPDeviceType deviceType)
{
switch (deviceType) {
case MCP_DEVICE_TYPE_AUTO:
return "auto";
case MCP_DEVICE_TYPE_ODD:
return "odd";
case MCP_DEVICE_TYPE_MLC:
return "mlc";
case MCP_DEVICE_TYPE_USB:
return "usb";
}
return "auto";
}
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,108 @@
#pragma once
#include <wut.h>
#include "memheap.h"
/**
* \defgroup coreinit_memallocator Allocator
* \ingroup coreinit
*
* Functions for managing generic allocator objects.
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef struct MEMAllocatorFunctions MEMAllocatorFunctions;
typedef struct MEMAllocator MEMAllocator;
typedef void *(*MEMAllocatorAllocFn)(MEMAllocator *allocator, uint32_t size);
typedef void (*MEMAllocatorFreeFn)(MEMAllocator *allocator, void *ptr);
//! Holds context information that will be used to allocate and free memory.
struct MEMAllocator
{
//! Points to the alloc/free functions.
MEMAllocatorFunctions *funcs;
//! The heap handle.
MEMHeapHandle heap;
//! The alignment the allocator will use.
uint32_t align;
WUT_UNKNOWN_BYTES(4);
};
WUT_CHECK_OFFSET(MEMAllocator, 0x0, funcs);
WUT_CHECK_OFFSET(MEMAllocator, 0x4, heap);
WUT_CHECK_OFFSET(MEMAllocator, 0x8, align);
WUT_CHECK_SIZE(MEMAllocator, 0x10);
//! The alloc/free functions.
struct MEMAllocatorFunctions
{
MEMAllocatorAllocFn alloc;
MEMAllocatorFreeFn free;
};
WUT_CHECK_OFFSET(MEMAllocatorFunctions, 0x0, alloc);
WUT_CHECK_OFFSET(MEMAllocatorFunctions, 0x4, free);
WUT_CHECK_SIZE(MEMAllocatorFunctions, 0x8);
/**
* Allocates memory from the allocator.
*
* \return `allocator->funcs.alloc(allocator, size)`.
*/
void *
MEMAllocFromAllocator(MEMAllocator *allocator,
uint32_t size);
/**
* Frees memory back to the allocator.
*
* It simply calls `allocator->funcs.free(allocator, ptr)`.
*/
void
MEMFreeToAllocator(MEMAllocator *allocator,
void *ptr);
/**
* Initializes an allocator from an Expanded Heap.
*/
void
MEMInitAllocatorForExpHeap(MEMAllocator *allocator,
MEMHeapHandle heap,
uint32_t alignment);
/**
* Initializes an allocator from a Frame Heap.
*/
void
MEMInitAllocatorForFrmHeap(MEMAllocator *allocator,
MEMHeapHandle heap,
uint32_t alignment);
/**
* Initializes an allocator from a Unit Heap.
*/
void
MEMInitAllocatorForUnitHeap(MEMAllocator *allocator,
MEMHeapHandle heap);
/**
* Initializes an allocator from the Default Heap.
*/
void
MEMInitAllocatorForDefaultHeap(MEMAllocator *allocator);
/**
* Initializes an allocator from a Block Heap.
*/
void
MEMInitAllocatorForBlockHeap(MEMAllocator *allocator,
MEMHeapHandle heap,
uint32_t alignment);
#ifdef __cplusplus
}
#endif
/** @} */

View File

@ -75,6 +75,8 @@ struct WUT_PACKED MEMBlockHeap
//! Free block count
uint32_t numFreeBlocks;
WUT_PADDING_BYTES(0xC);
};
WUT_CHECK_OFFSET(MEMBlockHeap, 0x00, header);
WUT_CHECK_OFFSET(MEMBlockHeap, 0x40, defaultTrack);
@ -83,7 +85,7 @@ WUT_CHECK_OFFSET(MEMBlockHeap, 0x64, firstBlock);
WUT_CHECK_OFFSET(MEMBlockHeap, 0x68, lastBlock);
WUT_CHECK_OFFSET(MEMBlockHeap, 0x6C, firstFreeBlock);
WUT_CHECK_OFFSET(MEMBlockHeap, 0x70, numFreeBlocks);
WUT_CHECK_SIZE(MEMBlockHeap, 0x74);
WUT_CHECK_SIZE(MEMBlockHeap, 0x80);
MEMHeapHandle
MEMInitBlockHeap(MEMBlockHeap *heap,

View File

@ -16,8 +16,7 @@ typedef struct MEMExpHeap MEMExpHeap;
typedef struct MEMExpHeapBlock MEMExpHeapBlock;
typedef struct MEMExpHeapBlockList MEMExpHeapBlockList;
typedef void (*MEMExpHeapBlockVisitor)(void *block, MEMHeapHandle heap,
void *context);
typedef void (*MEMExpHeapBlockVisitor)(void *block, MEMHeapHandle heap, void *context);
typedef enum MEMExpHeapMode
{

View File

@ -1,13 +1,13 @@
#pragma once
#include <wut.h>
#include "spinlock.h"
#include "memlist.h"
#include "spinlock.h"
/**
* \defgroup coreinit_memheap Common Memory Heap
* \ingroup coreinit
*
* Common memory heap fucntions.
* Common memory heap functions.
* @{
*/

View File

@ -0,0 +1,206 @@
#pragma once
#include <wut.h>
/**
* \defgroup coreinit_performancemonitor Performance Monitor
* \ingroup coreinit
*
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/// Used to tell OSSetPerformanceMonitor() which arguments are valid.
typedef enum OSPerfMonArg
{
OS_PM_ARG_MMCR0 = 1u << 0u,
OS_PM_ARG_MMCR1 = 1u << 1u,
OS_PM_ARG_PMC1 = 1u << 2u,
OS_PM_ARG_PMC2 = 1u << 3u,
OS_PM_ARG_PMC3 = 1u << 4u,
OS_PM_ARG_PMC4 = 1u << 5u,
} OSPerfMonArg;
/**
* Flags to write to (U)MMCR0 register.
*
* \sa OSSetPerformanceMonitor
*/
typedef enum OSPerfMonMMCR0Flags
{
OS_PM_MMCR0_PMC1_CURRENT = 0b0000000u << 6,
OS_PM_MMCR0_PMC1_CPU_CYCLES = 0b0000001u << 6,
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED = 0b0000010u << 6,
OS_PM_MMCR0_PMC1_TBL_RISING_TRANSITIONS = 0b0000011u << 6,
OS_PM_MMCR0_PMC1_INSTRUCTIONS_DISPATCHED = 0b0000100u << 6,
OS_PM_MMCR0_PMC1_EIEIO_INSTRUCTIONS_COMPLETED = 0b0000101u << 6,
OS_PM_MMCR0_PMC1_ITLB_SEARCH_CYCLES = 0b0000110u << 6,
OS_PM_MMCR0_PMC1_L2_HITS = 0b0000111u << 6,
OS_PM_MMCR0_PMC1_INSTRUCTIONS_EA_DELIVERED = 0b0001000u << 6,
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED_MATCHES_IABR = 0b0001001u << 6,
OS_PM_MMCR0_PMC1_SLOW_L1_MISSES = 0b0001010u << 6,
OS_PM_MMCR0_PMC1_UNRESOLVED_BRANCHES = 0b0001011u << 6,
OS_PM_MMCR0_PMC1_UNRESOLVED_STALL_CYCLES = 0b0001100u << 6,
OS_PM_MMCR0_PMC1_L1_SHARED_STORES = 0b0001110u << 6,
OS_PM_MMCR0_PMC1_L2_SHARED_INTERVENTIONS = 0b0001111u << 6,
OS_PM_MMCR0_PMC1_CACHE_PARADOXES = 0b0010000u << 6,
OS_PM_MMCR0_PMC1_CIU_LOAD_REQUESTS = 0b0010100u << 6,
OS_PM_MMCR0_PMC1_BIU_ADDRESS_ONLY_REQUESTS = 0b0010101u << 6,
OS_PM_MMCR0_PMC1_CIU_PARADOXES = 0b0010110u << 6,
OS_PM_MMCR0_PMC1_60XE_BUS_DATA_BEATS = 0b0010111u << 6,
OS_PM_MMCR0_PMC2_CURRENT = 0b000000u,
OS_PM_MMCR0_PMC2_CPU_CYCLES = 0b000001u,
OS_PM_MMCR0_PMC2_INSTRUCTIONS_COMPLETED = 0b000010u,
OS_PM_MMCR0_PMC2_TBL_RISING_TRANSITIONS = 0b000011u,
OS_PM_MMCR0_PMC2_INSTRUCTIONS_DISPATCHED = 0b000100u,
OS_PM_MMCR0_PMC2_L1_ICACHE_MISSES = 0b000101u,
OS_PM_MMCR0_PMC2_ITLB_MISSES = 0b000110u,
OS_PM_MMCR0_PMC2_L2_INSTRUCTION_MISSES = 0b000111u,
OS_PM_MMCR0_PMC2_PRED_BRANCHES_NOT_TAKEN = 0b001000u,
OS_PM_MMCR0_PMC2_RESERVED_LOADS = 0b001010u,
OS_PM_MMCR0_PMC2_LOADS_AND_STORES = 0b001011u,
OS_PM_MMCR0_PMC2_CACHE_SNOOPS = 0b001100u,
OS_PM_MMCR0_PMC2_L1_TO_L2_CASTOUTS = 0b001101u,
OS_PM_MMCR0_PMC2_SYSTEM_UNIT_INSTRUCTIONS = 0b001110u,
OS_PM_MMCR0_PMC2_L1_INSTRUCTION_MISS_CYCLES = 0b001111u,
OS_PM_MMCR0_PMC2_FIRST_SPECULATIVE_BRANCH_RESOLVES = 0b010000u,
OS_PM_MMCR0_PMC2_L2_SHARED_STORES = 0b010001u,
OS_PM_MMCR0_PMC2_L1_SHARED_INTERVENTIONS = 0b010010u,
OS_PM_MMCR0_PMC2_CIU_STORE_REQUESTS = 0b010100u,
OS_PM_MMCR0_PMC2_SLOW_OUTSTANDING_BIU_TRANSACTIONS = 0b010101u,
OS_PM_MMCR0_PMC2_CIU_MODIFIED_INTERVENTIONS = 0b010110u,
} OSPerfMonMMCR0Flags;
/**
* Flags to write to (U)MMCR1 register.
*
* \sa OSSetPerformanceMonitor
*/
typedef enum OSPerfMonMMCR1Flags
{
OS_PM_MMCR1_PMC3_CURRENT = 0b00000u << 27,
OS_PM_MMCR1_PMC3_CPU_CYCLES = 0b00001u << 27,
OS_PM_MMCR1_PMC3_INSTRUCTIONS_COMPLETED = 0b00010u << 27,
OS_PM_MMCR1_PMC3_TBL_RISING_TRANSITIONS = 0b00011u << 27,
OS_PM_MMCR1_PMC3_INSTRUCTIONS_DISPATCHED = 0b00100u << 27,
OS_PM_MMCR1_PMC3_L1_DCACHE_MISSES = 0b00101u << 27,
OS_PM_MMCR1_PMC3_DTLB_MISSES = 0b00110u << 27,
OS_PM_MMCR1_PMC3_L2_DATA_MISSES = 0b00111u << 27,
OS_PM_MMCR1_PMC3_PRED_BRANCHES_TAKEN = 0b01000u << 27,
OS_PM_MMCR1_PMC3_COND_STORES_COMPLETED = 0b01010u << 27,
OS_PM_MMCR1_PMC3_FPU_INSTRUCTIONS_COMPLETED = 0b01011u << 27,
OS_PM_MMCR1_PMC3_L2_CASTOUTS_BY_SNOOPS = 0b01100u << 27,
OS_PM_MMCR1_PMC3_L2_CACHE_OPERATIONS = 0b01101u << 27,
OS_PM_MMCR1_PMC3_L1_LOAD_MISS_CYCLES = 0b01111u << 27,
OS_PM_MMCR1_PMC3_SECOND_SPECULATIVE_BRANCH_RESOLVES = 0b10000u << 27,
OS_PM_MMCR1_PMC3_BPU_STALL_LR_CR_CYCLES = 0b10001u << 27,
OS_PM_MMCR1_PMC3_L1_MODIFIED_INTERVENTIONS = 0b10010u << 27,
OS_PM_MMCR1_PMC3_ICBI_SNOOPS = 0b10011u << 27,
OS_PM_MMCR1_PMC3_CIU_ADDRESS_ONLY_REQUESTS = 0b10100u << 27,
OS_PM_MMCR1_PMC3_BIU_LOAD_REQUESTS = 0b10101u << 27,
OS_PM_MMCR1_PMC3_CIU_SHARED_INTERVENTIONS = 0b10110u << 27,
OS_PM_MMCR1_PMC4_CURRENT = 0b00000u << 22,
OS_PM_MMCR1_PMC4_CPU_CYCLES = 0b00001u << 22,
OS_PM_MMCR1_PMC4_INSTRUCTIONS_COMPLETED = 0b00010u << 22,
OS_PM_MMCR1_PMC4_TBL_RISING_TRANSITIONS = 0b00011u << 22,
OS_PM_MMCR1_PMC4_INSTRUCTIONS_DISPATCHED = 0b00100u << 22,
OS_PM_MMCR1_PMC4_L2_CASTOUTS = 0b00101u << 22,
OS_PM_MMCR1_PMC4_DTLB_SEARCH_CYCLES = 0b00110u << 22,
OS_PM_MMCR1_PMC4_BRANCHES_MISPREDICTED = 0b01000u << 22,
OS_PM_MMCR1_PMC4_INTACT_COND_STORES_COMPLETED = 0b01010u << 22,
OS_PM_MMCR1_PMC4_SYNC_INSTRUCTIONS_COMPLETED = 0b01011u << 22,
OS_PM_MMCR1_PMC4_SNOOP_RETRIES = 0b01100u << 22,
OS_PM_MMCR1_PMC4_INTEGER_OPERATIONS = 0b01101u << 22,
OS_PM_MMCR1_PMC4_BPU_STALL_TWO_BRANCHES_CYCLES = 0b01110u << 22,
OS_PM_MMCR1_PMC4_L2_MODIFIED_INTERVENTIONS = 0b10000u << 22,
OS_PM_MMCR1_PMC4_TLBIE_SNOOPS = 0b10001u << 22,
OS_PM_MMCR1_PMC4_L2_BANK_REFRESH_OVERFLOWS = 0b10010u << 22,
OS_PM_MMCR1_PMC4_CIU_ARTRY_COUNT = 0b10100u << 22,
OS_PM_MMCR1_PMC4_BIU_STORE_REQUESTS = 0b10101u << 22,
OS_PM_MMCR1_PMC4_CIU_TWO_CORE_SHARED_INTERVENTIONS = 0b10110u << 22,
} OSPerfMonMMCR1Flags;
/**
* Write to performance monitor registers.
*
* Performance monitor registers can only be written by the kernel, this allows userspace
* to write to them.
*
* \param arg_mask OR-ed values from `OSPerfMonArg`, indicating which of the following
* arguments are to be written to registers.
*
* \param mmcr0 OR-ed values from `OSPerfMonMMCR0Flags` to write to register MMCR0.
* \param mmcr1 OR-ed values from `OSPerfMonMMCR1Flags` to write to register MMCR1.
* \param pmc1 Value to write to register PMC1.
* \param pmc2 Value to write to register PMC2.
* \param pmc3 Value to write to register PMC3.
* \param pmc4 Value to write to register PMC4.
*/
void
OSSetPerformanceMonitor(uint32_t arg_mask,
uint32_t mmcr0,
uint32_t mmcr1,
uint32_t pmc1,
uint32_t pmc2,
uint32_t pmc3,
uint32_t pmc4);
/**
* Convenience function to read from UPMC1.
*/
static inline uint32_t
OSGetUPMC1()
{
uint32_t result;
asm("mfupmc1 %[result]"
: [result] "=r"(result));
return result;
}
/**
* Convenience function to read from UPMC2.
*/
static inline uint32_t
OSGetUPMC2()
{
uint32_t result;
asm("mfupmc2 %[result]"
: [result] "=r"(result));
return result;
}
/**
* Convenience function to read from UPMC3.
*/
static inline uint32_t
OSGetUPMC3()
{
uint32_t result;
asm("mfupmc3 %[result]"
: [result] "=r"(result));
return result;
}
/**
* Convenience function to read from UPMC4.
*/
static inline uint32_t
OSGetUPMC4()
{
uint32_t result;
asm("mfupmc4 %[result]"
: [result] "=r"(result));
return result;
}
#ifdef __cplusplus
}
#endif
/** @} */

View File

@ -11,7 +11,7 @@
extern "C" {
#endif
extern void* __OSSchedulerLock;
extern void *__OSSchedulerLock;
void
__OSEnableScheduler();
@ -20,16 +20,16 @@ void
__OSDisableScheduler();
void
__OSLockScheduler(void* lockId);
__OSLockScheduler(void *lockId);
void
__OSUnlockScheduler(void* lockId);
__OSUnlockScheduler(void *lockId);
BOOL
OSIsSchedulerLocked(void* lockId);
OSIsSchedulerLocked(void *lockId);
void
__OSTryLockScheduler(void* lockId);
__OSTryLockScheduler(void *lockId);
void
__OSTouchSchedulerLock();

View File

@ -154,14 +154,14 @@ OSScreenFlipBuffersEx(OSScreenID screen);
* \param screen
* The ID of the screen to draw to. Only the work buffer will be affected.
*
* \param row
* The row, in characters, to place the text in. 0 corresponds to the top of
* the screen.
*
* \param column
* The column, in characters, to place the text at. 0 corresponds to the left of
* the screen.
*
* \param row
* The row, in characters, to place the text in. 0 corresponds to the top of
* the screen.
*
* \param buffer
* Pointer to the string of text to draw. Null-terminated.
*
@ -176,8 +176,8 @@ OSScreenFlipBuffersEx(OSScreenID screen);
*/
void
OSScreenPutFontEx(OSScreenID screen,
uint32_t row,
uint32_t column,
uint32_t row,
const char *buffer);
/**

View File

@ -79,7 +79,8 @@ struct SmdElement
{
SmdElementType type;
uint32_t size;
union {
union
{
uint8_t data[0xf8];
SmdVector spec;
uint32_t vectorPaddr;
@ -96,7 +97,8 @@ struct SmdReceiveData
{
SmdElementType type;
uint32_t size;
union {
union
{
uint8_t message[0x80];
SmdVector spec;
SmdVector *vector;

View File

@ -177,7 +177,7 @@ MPInitTask(MPTask *task,
uint32_t userArg2);
BOOL
MPTermTask(MPTask* task);
MPTermTask(MPTask *task);
BOOL
MPGetTaskInfo(MPTask *task,

View File

@ -3,9 +3,9 @@
#include <time.h>
#include "alarm.h"
#include "context.h"
#include "time.h"
#include "threadqueue.h"
#include "exception.h"
#include "threadqueue.h"
#include "time.h"
/**
* \defgroup coreinit_thread Thread
@ -126,7 +126,8 @@ enum OS_THREAD_ATTRIB
OS_THREAD_ATTRIB_UNKNOWN = 1 << 7
};
enum OS_THREAD_TYPE {
enum OS_THREAD_TYPE
{
OS_THREAD_TYPE_DRIVER = 0,
OS_THREAD_TYPE_IO = 1,
OS_THREAD_TYPE_APP = 2
@ -169,7 +170,7 @@ WUT_CHECK_SIZE(OSFastMutexQueue, 0x08);
struct OSTLSSection
{
void* data;
void *data;
WUT_UNKNOWN_BYTES(4);
};
WUT_CHECK_OFFSET(OSTLSSection, 0x00, data);
@ -309,10 +310,10 @@ struct WUT_ALIGNAS(8) OSThread
WUT_UNKNOWN_BYTES(0x2);
//! TLS Sections
OSTLSSection* tlsSections;
OSTLSSection *tlsSections;
//! The fast mutex we are currently waiting for
OSFastMutex* fastMutex;
OSFastMutex *fastMutex;
//! The fast mutexes we are currently contended on
OSFastMutexQueue contendedFastMutexes;

View File

@ -11,7 +11,8 @@
extern "C" {
#endif
uint64_t OSGetTitleID(void);
uint64_t
OSGetTitleID(void);
#ifdef __cplusplus
}

View File

@ -9,7 +9,8 @@ extern "C" {
int
__OSGetSavedAudioFlags();
int __OSGetTransitionAudioBuffer(void **buffer,
int
__OSGetTransitionAudioBuffer(void **buffer,
uint32_t *size);
void

View File

@ -1,5 +1,6 @@
#pragma once
#include <wut.h>
#include <gx2/semaphore.h>
/**
* \defgroup dmae_sync Synchronization
@ -14,6 +15,12 @@ extern "C" {
//! Timestamp for a DMAE operation.
typedef uint64_t DMAETimeStamp;
DMAETimeStamp
DMAEGetLastSubmittedTimeStamp(void);
DMAETimeStamp
DMAEGetRetiredTimeStamp(void);
/**
* Waits for a DMAE operation to complete.
*
@ -26,6 +33,16 @@ typedef uint64_t DMAETimeStamp;
BOOL
DMAEWaitDone(DMAETimeStamp timestamp);
uint32_t
DMAEGetTimeout(void);
void
DMAESetTimeout(uint32_t timeout);
void
DMAESemaphore(GX2Semaphore *semaphore,
GX2SemaphoreAction action);
#ifdef __cplusplus
}
#endif

View File

@ -17,30 +17,52 @@ struct FSClient;
namespace Rpl
{
void ErrEulaSetVersion(int version);
bool ErrEulaJump(const char *buffer, uint32_t bufferSize);
void ErrEulaPlayAppearSE(bool playAppearSoundEffect);
bool ErrEulaIsSelectCursorActive();
void ErrEulaChangeLang(nn::erreula::LangType language);
void ErrEulaDisappearHomeNixSign();
bool ErrEulaIsAppearHomeNixSign();
void ErrEulaAppearHomeNixSign(const nn::erreula::HomeNixSignArg &arg);
void ErrEulaSetControllerRemo(nn::erreula::ControllerType controller);
int32_t ErrEulaGetSelectButtonNumError();
int32_t ErrEulaGetResultCode();
nn::erreula::ResultType ErrEulaGetResultType();
nn::erreula::State ErrEulaGetStateErrorViewer();
bool ErrEulaIsDecideSelectRightButtonError();
bool ErrEulaIsDecideSelectLeftButtonError();
bool ErrEulaIsDecideSelectButtonError();
void ErrEulaDisappearError();
void ErrEulaAppearError(const nn::erreula::AppearArg &arg);
void ErrEulaCalc(const nn::erreula::ControllerInfo &controllerInfo);
void ErrEulaDrawDRC();
void ErrEulaDrawTV();
void ErrEulaDestroy();
void ErrEulaCreate(void *workMemory, nn::erreula::RegionType region,
nn::erreula::LangType language, FSClient *fsClient);
void
ErrEulaSetVersion(int version);
bool
ErrEulaJump(const char *buffer, uint32_t bufferSize);
void
ErrEulaPlayAppearSE(bool playAppearSoundEffect);
bool
ErrEulaIsSelectCursorActive();
void
ErrEulaChangeLang(nn::erreula::LangType language);
void
ErrEulaDisappearHomeNixSign();
bool
ErrEulaIsAppearHomeNixSign();
void
ErrEulaAppearHomeNixSign(const nn::erreula::HomeNixSignArg &arg);
void
ErrEulaSetControllerRemo(nn::erreula::ControllerType controller);
int32_t
ErrEulaGetSelectButtonNumError();
int32_t
ErrEulaGetResultCode();
nn::erreula::ResultType
ErrEulaGetResultType();
nn::erreula::State
ErrEulaGetStateErrorViewer();
bool
ErrEulaIsDecideSelectRightButtonError();
bool
ErrEulaIsDecideSelectLeftButtonError();
bool
ErrEulaIsDecideSelectButtonError();
void
ErrEulaDisappearError();
void
ErrEulaAppearError(const nn::erreula::AppearArg &arg);
void
ErrEulaCalc(const nn::erreula::ControllerInfo &controllerInfo);
void
ErrEulaDrawDRC();
void
ErrEulaDrawTV();
void
ErrEulaDestroy();
void
ErrEulaCreate(void *workMemory, nn::erreula::RegionType region, nn::erreula::LangType language, FSClient *fsClient);
} // namespace Rpl

View File

@ -140,7 +140,7 @@ GX2DebugCaptureEnd(GX2DebugCaptureEndFlags flags);
* Equivalent to calling GX2DebugCaptureFrames(filename, 1)
*/
void
GX2DebugCaptureFrame(const char* filename);
GX2DebugCaptureFrame(const char *filename);
/**
@ -152,7 +152,7 @@ GX2DebugCaptureFrame(const char* filename);
* Capture begins and ends during GX2SwapScanBuffers.
*/
void
GX2DebugCaptureFrames(const char* filename,
GX2DebugCaptureFrames(const char *filename,
uint32_t count);
#ifdef __cplusplus

View File

@ -246,7 +246,7 @@ typedef enum GX2InvalidateMode
GX2_INVALIDATE_MODE_CPU = 1 << 6,
GX2_INVALIDATE_MODE_STREAM_OUT_BUFFER = 1 << 7,
GX2_INVALIDATE_MODE_EXPORT_BUFFER = 1 << 8,
GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER= GX2_INVALIDATE_MODE_CPU | GX2_INVALIDATE_MODE_ATTRIBUTE_BUFFER,
GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER = GX2_INVALIDATE_MODE_CPU | GX2_INVALIDATE_MODE_ATTRIBUTE_BUFFER,
GX2_INVALIDATE_MODE_CPU_TEXTURE = GX2_INVALIDATE_MODE_CPU | GX2_INVALIDATE_MODE_TEXTURE,
GX2_INVALIDATE_MODE_CPU_SHADER = GX2_INVALIDATE_MODE_CPU | GX2_INVALIDATE_MODE_SHADER,
} GX2InvalidateMode;
@ -348,6 +348,12 @@ typedef enum GX2ScanTarget
WUT_ENUM_BITMASK_TYPE(GX2ScanTarget)
typedef enum GX2SemaphoreAction
{
GX2_SEMAPHORE_ACTION_WAIT = 0,
GX2_SEMAPHORE_ACTION_SIGNAL = 1,
} GX2SemaphoreAction;
typedef enum GX2ShaderMode
{
GX2_SHADER_MODE_UNIFORM_REGISTER = 0,

34
include/gx2/semaphore.h Normal file
View File

@ -0,0 +1,34 @@
#pragma once
#include <wut.h>
#include "enum.h"
/**
* \defgroup gx2_semaphore Semaphore
* \ingroup gx2
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef uint64_t GX2Semaphore;
/**
* Inserts a semaphore into the command stream.
*
* \param semaphore
* Address of the semaphore. Must be aligned by \c 0x8.
*
* \param action
* Semaphore operation to perform.
*/
void
GX2SetSemaphore(GX2Semaphore *semaphore,
GX2SemaphoreAction action);
#ifdef __cplusplus
}
#endif
/** @} */

View File

@ -1,9 +1,9 @@
#pragma once
#include <string.h>
#include <wut.h>
#include <string.h>
#include "enum.h"
#include "sampler.h"
#include "gx2r/buffer.h"
#include "sampler.h"
/**
* \defgroup gx2_shader Shaders
@ -427,9 +427,12 @@ GX2SetGeometryUniformBlock(uint32_t location,
void
GX2SetShaderModeEx(GX2ShaderMode mode,
uint32_t numVsGpr, uint32_t numVsStackEntries,
uint32_t numGsGpr, uint32_t numGsStackEntries,
uint32_t numPsGpr, uint32_t numPsStackEntries);
uint32_t numVsGpr,
uint32_t numVsStackEntries,
uint32_t numGsGpr,
uint32_t numGsStackEntries,
uint32_t numPsGpr,
uint32_t numPsStackEntries);
void
GX2SetStreamOutEnable(BOOL enable);

View File

@ -1,6 +1,6 @@
#pragma once
#include <gx2r/resource.h>
#include <wut.h>
#include <gx2r/resource.h>
#include "enum.h"
/**
@ -28,7 +28,8 @@ struct GX2Surface
uint32_t mipLevels;
GX2SurfaceFormat format;
GX2AAMode aa;
union {
union
{
GX2SurfaceUse use;
GX2RResourceFlags resourceFlags;
};
@ -185,8 +186,8 @@ GX2CopySurfaceEx(const GX2Surface *src,
GX2Point *dstPoints);
void
GX2ResolveAAColorBuffer(const GX2ColorBuffer * srcColorBuffer,
GX2Surface * dstSurface,
GX2ResolveAAColorBuffer(const GX2ColorBuffer *srcColorBuffer,
GX2Surface *dstSurface,
uint32_t dstMip,
uint32_t dstSlice);

View File

@ -12,7 +12,7 @@
extern "C" {
#endif
typedef void * (*GX2RAllocFunction)(GX2RResourceFlags, uint32_t, uint32_t);
typedef void *(*GX2RAllocFunction)(GX2RResourceFlags, uint32_t, uint32_t);
typedef void (*GX2RFreeFunction)(GX2RResourceFlags, void *);
void

View File

@ -80,7 +80,7 @@ H264DECSetParam_OUTPUT_PER_FRAME(void *memory,
*/
H264Error
H264DECSetParam_USER_MEMORY(void *memory,
void *value);
void **value);
/**

View File

@ -1,4 +1,5 @@
#pragma once
#include <wut.h>
/**
* \defgroup h264_stream H264 Stream

View File

@ -59,23 +59,31 @@ WUT_CHECK_SIZE(MICStatus, 0x0C);
* The second parameter to MICInit is unused, any value is valid.
*/
MICHandle
MICInit(MICInstance instance, int unused, MICWorkMemory *workMemory,
MICInit(MICInstance instance,
int unused,
MICWorkMemory *workMemory,
MICError *outError);
MICError
MICOpen(MICHandle handle);
MICError
MICGetState(MICHandle handle, int state, uint32_t *outStateVal);
MICGetState(MICHandle handle,
int state,
uint32_t *outStateVal);
MICError
MICSetState(MICHandle handle, int state, uint32_t stateVal);
MICSetState(MICHandle handle,
int state,
uint32_t stateVal);
MICError
MICGetStatus(MICHandle handle, MICStatus *outStatus);
MICGetStatus(MICHandle handle,
MICStatus *outStatus);
MICError
MICSetDataConsumed(MICHandle handle, int dataAmountConsumed);
MICSetDataConsumed(MICHandle handle,
int dataAmountConsumed);
MICError
MICClose(MICHandle handle);

View File

@ -161,8 +161,7 @@ WUT_CHECK_SIZE(NFCReadT2TResult, 0x3A9);
* \param userContext
* User provided value.
*/
typedef void
(*NFCCallbackFn)(VPADChan chan,
typedef void (*NFCCallbackFn)(VPADChan chan,
NFCError error,
void *userContext);
@ -178,8 +177,7 @@ typedef void
* \param userContext
* User provided value.
*/
typedef void
(*NFCTagDetectCallbackFn)(VPADChan chan,
typedef void (*NFCTagDetectCallbackFn)(VPADChan chan,
BOOL hasTag,
void *userContext);
@ -207,8 +205,7 @@ typedef void
* \param userContext
* User provided value.
*/
typedef void
(*NFCDetectCallbackFn)(VPADChan chan,
typedef void (*NFCDetectCallbackFn)(VPADChan chan,
NFCError error,
NFCUid *uid,
BOOL readOnly,
@ -234,8 +231,7 @@ typedef void
* \param userContext
* User provided value.
*/
typedef void
(*NFCRawDataCallbackFn)(VPADChan chan,
typedef void (*NFCRawDataCallbackFn)(VPADChan chan,
NFCError error,
uint32_t responseSize,
void *responseData,
@ -262,8 +258,7 @@ typedef void
* \param userContext
* User provided value.
*/
typedef void
(*NFCRawDataTwiceCallbackFn)(VPADChan chan,
typedef void (*NFCRawDataTwiceCallbackFn)(VPADChan chan,
NFCError error,
uint8_t numCompleted,
uint32_t response0Size,
@ -302,8 +297,7 @@ typedef void
* \param userContext
* User provided value.
*/
typedef void
(*NFCReadCallbackFn)(VPADChan chan,
typedef void (*NFCReadCallbackFn)(VPADChan chan,
NFCError error,
NFCUid *uid,
BOOL readOnly,
@ -346,8 +340,7 @@ typedef void
* \param userContext
* User provided value.
*/
typedef void
(*NFCReadT2TCallbackFn)(VPADChan chan,
typedef void (*NFCReadT2TCallbackFn)(VPADChan chan,
NFCError error,
uint8_t rfDiscId,
NFCProtocol protocol,
@ -373,8 +366,7 @@ typedef void
* \param userContext
* User provided value.
*/
typedef void
(*NFCGetTagInfoCallbackFn)(VPADChan chan,
typedef void (*NFCGetTagInfoCallbackFn)(VPADChan chan,
NFCError error,
NFCTagInfo *tagInfo,
void *userContext);
@ -397,8 +389,7 @@ typedef void
* \param userContext
* User provided value.
*/
typedef void
(*NFCGetTagInfoMultiCallbackFn)(VPADChan chan,
typedef void (*NFCGetTagInfoMultiCallbackFn)(VPADChan chan,
NFCError error,
uint8_t numTagInfos,
NFCTagInfo *tagInfo0,
@ -1155,6 +1146,7 @@ NFCSetReadOnly(VPADChan chan,
* \return
* 0 on success.
*/
// clang-format off
NFCError
NFCReadT2T(VPADChan chan,
uint32_t discoveryTimeout,
@ -1170,6 +1162,7 @@ NFCReadT2T(VPADChan chan,
uint8_t authenticate,
NFCReadT2TCallbackFn callback,
void *userContext);
// clang-format on
/**
* Write data to a Type 2 NTAG.
@ -1231,6 +1224,7 @@ NFCReadT2T(VPADChan chan,
* \return
* 0 on success.
*/
// clang-format off
NFCError
NFCWriteT2T(VPADChan chan,
uint16_t discoveryTimeout,
@ -1247,6 +1241,7 @@ NFCWriteT2T(VPADChan chan,
uint8_t authenticate, uint8_t activate,
NFCCallbackFn callback,
void *userContext);
// clang-format on
/**
* Get the UID and other parameters from activation event data.

View File

@ -1,6 +1,7 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nsysnet/netconfig.h>
/**
* \defgroup nn_ac_cpp Auto Connect C++ API
@ -24,103 +25,55 @@ namespace ac
* An ID number representing a network configuration. These are the same IDs as
* shown in System Settings' Connection List.
*/
typedef uint32_t ConfigIdNum;
using ConfigIdNum = uint32_t;
/**
* C++ linkage for the autoconnect API, see \link nn::ac \endlink for use.
* Cafe provides mangled symbols for C++ APIs, so nn::ac is actually static
* inline calls to the mangled symbols under nn::ac::detail.
* The configuration for a given network profile (from 1 to 6).
* \sa NetConfCfg
*/
namespace detail
using Config = NetConfCfg;
using ErrorCode = uint32_t;
enum Status
{
extern "C"
{
nn::Result Initialize__Q2_2nn2acFv();
void Finalize__Q2_2nn2acFv();
nn::Result Connect__Q2_2nn2acFv();
nn::Result ConnectAsync__Q2_2nn2acFv();
nn::Result Close__Q2_2nn2acFv();
nn::Result GetCloseStatus__Q2_2nn2acFPQ3_2nn2ac6Status();
nn::Result GetStartupId__Q2_2nn2acFPQ3_2nn2ac11ConfigIdNum(ConfigIdNum *id);
nn::Result Connect__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum(ConfigIdNum id);
nn::Result GetAssignedAddress__Q2_2nn2acFPUl(uint32_t *ip);
} // extern "C"
} // namespace detail
/**
* Initialise the Auto Connect library. Call this function before any other nn::ac
* functions.
*
* \return
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
* and \link nn::Result::IsFailure \endlink.
*
* \sa
* - \link Finalize \endlink
*/
static inline nn::Result
Initialize()
{
return detail::Initialize__Q2_2nn2acFv();
}
/**
* Cleanup the Auto Connect library. Do not call any nn::ac functions (other
* than \link Initialize \endlink) after calling this function.
*
* \sa
* - \link Initialize \endlink
*/
static inline void
Finalize()
{
return detail::Finalize__Q2_2nn2acFv();
}
STATUS_FAILED = -1,
STATUS_OK = 0,
STATUS_PROCESSING = 1,
};
/**
* Gets the default connection configuration id. This is the default as marked
* in System Settings.
*
* \param id
* A pointer to an \link ConfigIdNum \endlink to write the config ID to. Must
* not be a \c nullptr.
*
* \return
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
* and \link nn::Result::IsFailure \endlink.
*/
static inline nn::Result
GetStartupId(ConfigIdNum *id)
{
return detail::GetStartupId__Q2_2nn2acFPQ3_2nn2ac11ConfigIdNum(id);
}
nn::Result
BeginLocalConnection(bool unknown)
asm("BeginLocalConnection__Q2_2nn2acFb");
static inline nn::Result
Connect()
{
return detail::Connect__Q2_2nn2acFv();
}
void
ClearConfig(Config *cfg)
asm("ClearConfig__Q2_2nn2acFP16netconf_profile_");
static inline nn::Result
ConnectAsync()
{
return detail::ConnectAsync__Q2_2nn2acFv();
}
static inline nn::Result
nn::Result
Close()
{
return detail::Close__Q2_2nn2acFv();
}
asm("Close__Q2_2nn2acFv");
static inline nn::Result
GetCloseStatus()
{
return detail::GetCloseStatus__Q2_2nn2acFPQ3_2nn2ac6Status();
}
nn::Result
CloseAll()
asm("CloseAll__Q2_2nn2acFv");
nn::Result
Connect(const Config *cfg)
asm("Connect__Q2_2nn2acFPC16netconf_profile_");
nn::Result
Connect(ConfigIdNum id)
asm("Connect__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum");
nn::Result
Connect()
asm("Connect__Q2_2nn2acFv");
nn::Result
ConnectAsync(const Config *cfg)
asm("ConnectAsync__Q2_2nn2acFPC16netconf_profile_");
/**
* Connects to a network, using the configuration represented by the given
@ -133,11 +86,36 @@ GetCloseStatus()
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
* and \link nn::Result::IsFailure \endlink.
*/
static inline nn::Result
Connect(ConfigIdNum id)
{
return detail::Connect__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum(id);
}
nn::Result
ConnectAsync(ConfigIdNum id)
asm("ConnectAsync__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum");
nn::Result
ConnectAsync()
asm("ConnectAsync__Q2_2nn2acFv");
nn::Result
ConnectWithRetry()
asm("ConnectWithRetry__Q2_2nn2acFv");
nn::Result
DeleteConfig(ConfigIdNum id)
asm("DeleteConfig__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum");
nn::Result
EndLocalConnection()
asm("EndLocalConnection__Q2_2nn2acFv");
/**
* Cleans up the Auto Connect library. Do not call any nn::ac functions (other
* than \link Initialize \endlink) after calling this function.
*
* \sa
* - \link Initialize \endlink
*/
void
Finalize()
asm("Finalize__Q2_2nn2acFv");
/**
* Gets the IP address assosciated with the currently active connection.
@ -151,11 +129,120 @@ Connect(ConfigIdNum id)
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
* and \link nn::Result::IsFailure \endlink.
*/
static inline nn::Result
nn::Result
GetAssignedAddress(uint32_t *ip)
{
return detail::GetAssignedAddress__Q2_2nn2acFPUl(ip);
}
asm("GetAssignedAddress__Q2_2nn2acFPUl");
nn::Result
GetAssignedAlternativeDns(uint32_t *ip)
asm("GetAssignedAlternativeDns__Q2_2nn2acFPUl");
nn::Result
GetAssignedGateway(uint32_t *ip)
asm("GetAssignedGateway__Q2_2nn2acFPUl");
nn::Result
GetAssignedPreferedDns(uint32_t *ip)
asm("GetAssignedPreferedDns__Q2_2nn2acFPUl");
nn::Result
GetAssignedSubnet(uint32_t *ip)
asm("GetAssignedSubnet__Q2_2nn2acFPUl");
nn::Result
GetCloseStatus(Status *status)
asm("GetCloseStatus__Q2_2nn2acFPQ3_2nn2ac6Status");
nn::Result
GetCompatId(ConfigIdNum *id)
asm("GetCompatId__Q2_2nn2acFPQ3_2nn2ac11ConfigIdNum");
nn::Result
GetConnectResult(nn::Result *result)
asm("GetConnectResult__Q2_2nn2acFPQ2_2nn6Result");
nn::Result
GetConnectStatus(Status *status)
asm("GetConnectStatus__Q2_2nn2acFPQ3_2nn2ac6Status");
nn::Result
GetLastErrorCode(ErrorCode *error)
asm("GetLastErrorCode__Q2_2nn2acFPUi");
nn::Result
GetRunningConfig(Config *cfg)
asm("GetRunningConfig__Q2_2nn2acFP16netconf_profile_");
/**
* Gets the default connection configuration id. This is the default as marked
* in System Settings.
*
* \param id
* A pointer to an \link ConfigIdNum \endlink to write the config ID to. Must
* not be a \c nullptr.
*
* \return
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
* and \link nn::Result::IsFailure \endlink.
*/
nn::Result
GetStartupId(ConfigIdNum *id)
asm("GetStartupId__Q2_2nn2acFPQ3_2nn2ac11ConfigIdNum");
/**
* Initializes the Auto Connect library. Call this function before any other nn::ac
* functions.
*
* \return
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
* and \link nn::Result::IsFailure \endlink.
*
* \sa
* - \link Finalize \endlink
*/
nn::Result
Initialize()
asm("Initialize__Q2_2nn2acFv");
nn::Result
IsAnyKeepingConnect(bool keeping)
asm("IsAnyKeepingConnect__Q2_2nn2acFPb");
nn::Result
IsApplicationConnected(bool *connected)
asm("IsApplicationConnected__Q2_2nn2acFPb");
nn::Result
IsAutoConnectionFatallyFailed(nn::Result *failed)
asm("IsAutoConnectionFatallyFailed__Q2_2nn2acFQ2_2nn6Result");
nn::Result
IsConfigExisting(ConfigIdNum id, bool *existing)
asm("IsConfigExisting__Q2_2nn2acFQ3_2nn2ac11ConfigIdNumPb");
nn::Result
IsKeepingConnect(bool *keeping)
asm("IsKeepingConnect__Q2_2nn2acFPb");
nn::Result
IsReadyToConnect(bool *ready)
asm("IsReadyToConnect__Q2_2nn2acFPb");
nn::Result
ReadConfig(ConfigIdNum id, Config *cfg)
asm("ReadConfig__Q2_2nn2acFQ3_2nn2ac11ConfigIdNumP16netconf_profile_");
nn::Result
SetCompatId(ConfigIdNum id)
asm("SetCompatId__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum");
nn::Result
SetStartupId(ConfigIdNum id)
asm("SetStartupId__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum");
nn::Result
WriteConfig(ConfigIdNum id, const Config *cfg)
asm("WriteConfig__Q2_2nn2acFQ3_2nn2ac11ConfigIdNumPC16netconf_profile_");
} // namespace ac
} // namespace nn

View File

@ -7,8 +7,8 @@
#include <nn/acp/client.h>
#include <nn/acp/device.h>
#include <nn/acp/drcled_c.h>
#include <nn/acp/drcled_cpp.h>
#include <nn/acp/result.h>
#include <nn/acp/save.h>
#include <nn/acp/title.h>
#include <nn/acp/drcled_c.h>
#include <nn/acp/drcled_cpp.h>

View File

@ -12,10 +12,18 @@
extern "C" {
#endif
typedef int32_t ACPDeviceType;
typedef enum ACPDeviceType
{
ACP_DEVICE_TYPE_AUTO = 1,
ACP_DEVICE_TYPE_ODD = 2,
ACP_DEVICE_TYPE_HFIODISC = 2, /* when ApplicationDevice is emulated */
ACP_DEVICE_TYPE_MLC = 3,
ACP_DEVICE_TYPE_HFIOMLC = 3, /* when ApplicationDevice is emulated */
ACP_DEVICE_TYPE_USB = 4,
} ACPDeviceType;
ACPResult
ACPCheckApplicationDeviceEmulation(BOOL* emulation);
ACPCheckApplicationDeviceEmulation(BOOL *emulation);
#ifdef __cplusplus
}

View File

@ -1,8 +1,8 @@
#pragma once
#include <wut.h>
#include <nn/acp/result.h>
#include <nn/acp/device.h>
#include <nn/acp/result.h>
#ifdef __cplusplus
extern "C" {

View File

@ -1,14 +1,16 @@
#pragma once
#include <wut.h>
#include <nn/acp/result.h>
#include <nn/acp/device.h>
#include <nn/acp/result.h>
#ifdef __cplusplus
namespace nn {
namespace nn
{
namespace acp {
namespace acp
{
typedef uint8_t DrcLedStatus;
typedef uint32_t DrcLedPattern;

View File

@ -8,7 +8,8 @@
* @{
*/
typedef enum ACPResult {
typedef enum ACPResult
{
ACP_RESULT_SUCCESS = 0,
ACP_RESULT_INVALID = -200,

View File

@ -1,7 +1,7 @@
#pragma once
#include <wut.h>
#include <nn/acp/result.h>
#include <nn/acp/device.h>
#include <nn/acp/result.h>
/**
* \defgroup nn_acp_save Save
@ -15,12 +15,27 @@
extern "C" {
#endif
typedef uint64_t ACPTitleId;
typedef struct ACPSaveDirInfo ACPSaveDirInfo;
struct WUT_PACKED ACPSaveDirInfo
{
WUT_UNKNOWN_BYTES(0x8);
uint32_t persistentId;
WUT_UNKNOWN_BYTES(0x14);
char path[0x40];
WUT_PADDING_BYTES(0x80 - 0x60);
};
WUT_CHECK_OFFSET(ACPSaveDirInfo, 0x08, persistentId);
WUT_CHECK_OFFSET(ACPSaveDirInfo, 0x20, path);
WUT_CHECK_SIZE(ACPSaveDirInfo, 0x80);
ACPResult
ACPCreateSaveDir(uint32_t persistentId,
ACPDeviceType deviceType);
ACPResult
ACPIsExternalStorageRequired(BOOL* required);
ACPIsExternalStorageRequired(BOOL *required);
ACPResult
ACPMountExternalStorage();
@ -28,6 +43,48 @@ ACPMountExternalStorage();
ACPResult
ACPMountSaveDir();
/**
* Deletes the given user's save data directory for the given title.
*
* \param persistentId
* The persistent ID of the user. Pass \c 0 to delete the 'common' directory.
*
* \return
* ACP_RESULT_SUCCESS on success.
*/
ACPResult
ACPRemoveSaveDir(uint32_t persistentId,
uint64_t titleId,
ACPDeviceType deviceType);
/**
* Deletes the given user's save data directory for the given title.
*
* \param persistentId
* The persistent ID of the user. Pass \c 0 to delete the 'common' directory.
*
* \return
* ACP_RESULT_SUCCESS on success.
*/
ACPResult
ACPRemoveSaveDirWithoutFlush(uint32_t persistentId,
uint64_t titleId,
ACPDeviceType deviceType);
/**
* Deletes the given user's save data directory for the given title.
*
* \param persistentId
* The persistent ID of the user. Pass \c 0 to delete the 'common' directory.
*
* \return
* ACP_RESULT_SUCCESS on success.
*/
ACPResult
ACPRemoveSaveDirWithoutMetaCheck(uint32_t persistentId,
uint64_t titleId,
ACPDeviceType deviceType);
ACPResult
ACPRepairSaveMetaDir();
@ -37,6 +94,59 @@ ACPUnmountExternalStorage();
ACPResult
ACPUnmountSaveDir();
/**
* Gets all titles id which have save data
*
* @param deviceType
* @param titlesOut needs to be aligned to 0x40
* @param maxCount needs to be a multiple of 8
* @param countOut
* @return ACP_RESULT_SUCCESS on success.
*/
ACPResult
ACPGetSaveDataTitleIdList(ACPDeviceType deviceType,
uint64_t *titlesOut,
uint32_t maxCount,
uint32_t *countOut);
/**
* Gets a list of all saves dir for a given title id
*
* @param titleId
* @param deviceType
* @param u1 seems to be always 0
* @param saveDirInfo needs to be aligned to 0x40
* @param maxCount
* @param countOut
* @return ACP_RESULT_SUCCESS on success.
*/
ACPResult
ACPGetTitleSaveDirEx(uint64_t titleId,
ACPDeviceType deviceType,
uint32_t u1,
ACPSaveDirInfo *saveDirInfo,
uint32_t maxCount,
uint32_t *countOut);
/**
* Gets a list of all saves dir for a given title id
*
* @param titleId
* @param deviceType
* @param u1 seems to be always 0
* @param saveDirInfo needs to be aligned to 0x40
* @param maxCount
* @param countOut
* @return ACP_RESULT_SUCCESS on success.
*/
ACPResult
ACPGetTitleSaveDirExWithoutMetaCheck(uint64_t titleId,
ACPDeviceType deviceType,
uint32_t u1,
ACPSaveDirInfo *saveDirInfo,
uint32_t maxCount,
uint32_t *countOut);
#ifdef __cplusplus
}
#endif

View File

@ -1,9 +1,9 @@
#pragma once
#include <wut.h>
#include <nn/acp/result.h>
#include <nn/acp/device.h>
#include <coreinit/mcp.h>
#include <nn/acp/device.h>
#include <nn/acp/result.h>
/**
* \defgroup nn_acp_title Title
@ -20,7 +20,8 @@ extern "C" {
typedef uint64_t ACPTitleId;
typedef struct ACPMetaXml ACPMetaXml;
struct WUT_PACKED ACPMetaXml {
struct WUT_PACKED ACPMetaXml
{
uint64_t title_id;
uint64_t boss_id;
uint64_t os_version;
@ -235,13 +236,13 @@ WUT_CHECK_OFFSET(ACPMetaXml, 0x308C, publisher_pt);
WUT_CHECK_OFFSET(ACPMetaXml, 0x318C, publisher_ru);
WUT_CHECK_OFFSET(ACPMetaXml, 0x328C, publisher_zht);
WUT_CHECK_OFFSET(ACPMetaXml, 0x338C, add_on_unique_id);
WUT_CHECK_SIZE(ACPMetaXml,0x3440);
WUT_CHECK_SIZE(ACPMetaXml, 0x3440);
ACPResult
ACPAssignTitlePatch(MCPTitleListType* titleInfo);
ACPAssignTitlePatch(MCPTitleListType *titleInfo);
ACPResult
ACPGetTitleIdOfMainApplication(ACPTitleId* titleId);
ACPGetTitleIdOfMainApplication(ACPTitleId *titleId);
/**
* Gets the MetaXML for a given title id
@ -249,9 +250,11 @@ ACPGetTitleIdOfMainApplication(ACPTitleId* titleId);
* @param metaXml must be aligned to 0x40
* @return ACP_RESULT_SUCCESS on success
*/
// clang-format off
ACPResult
RPLWRAP(ACPGetTitleMetaXml)(ACPTitleId titleId,
ACPMetaXml *metaXml);
// clang-format on
/**
* Gets the MetaXML for a given title id
@ -262,13 +265,40 @@ RPLWRAP(ACPGetTitleMetaXml)(ACPTitleId titleId,
*/
static inline ACPResult
ACPGetTitleMetaXml(ACPTitleId titleId,
ACPMetaXml *metaXml) {
if ((uintptr_t) metaXml & 0x3F) {
ACPMetaXml *metaXml)
{
if ((uintptr_t)metaXml & 0x3F) {
return ACP_RESULT_INVALID_PARAMETER;
}
return RPLWRAP(ACPGetTitleMetaXml)(titleId, metaXml);
}
// clang-format off
ACPResult
RPLWRAP(ACPGetTitleSaveMetaXml)(uint64_t titleId,
ACPMetaXml* metaXml,
ACPDeviceType deviceType);
// clang-format on
/**
* Gets the save dir MetaXML for a given title id
* @param titleId
* @param metaXml must be aligned to 0x40
* @param deviceType
* @return ACP_RESULT_SUCCESS on success,
* ACP_RESULT_INVALID_PARAMETER if metaXml is not aligned properly
*/
static inline ACPResult
ACPGetTitleSaveMetaXml(ACPTitleId titleId,
ACPMetaXml *metaXml,
ACPDeviceType deviceType)
{
if ((uintptr_t)metaXml & 0x3F) {
return ACP_RESULT_INVALID_PARAMETER;
}
return RPLWRAP(ACPGetTitleSaveMetaXml)(titleId, metaXml, deviceType);
}
ACPResult
ACPGetTitleMetaDir(ACPTitleId titleId,
char *directory,
@ -276,13 +306,13 @@ ACPGetTitleMetaDir(ACPTitleId titleId,
ACPResult
ACPGetTitleMetaDirByDevice(ACPTitleId titleId,
char* directory,
char *directory,
size_t directoryLen,
ACPDeviceType deviceType);
ACPResult
ACPGetTitleMetaDirByTitleListType(MCPTitleListType titleListType,
char* directory,
char *directory,
size_t directoryLen);
#ifdef __cplusplus

View File

@ -1,7 +1,7 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/ffl/miidata.h>
#include <nn/result.h>
/**
* \defgroup nn_act_client Accounts Client API
@ -12,9 +12,11 @@
#ifdef __cplusplus
namespace nn {
namespace nn
{
namespace act {
namespace act
{
//https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/nn/act/nn_act_types.h
@ -53,11 +55,11 @@ GetAccountIdEx(char outAccountId[AccountIdSize], SlotNo slot)
asm("GetAccountIdEx__Q2_2nn3actFPcUc");
nn::Result
GetBirthday(uint16_t* outYear, uint8_t* outMonth, uint8_t* outDay)
GetBirthday(uint16_t *outYear, uint8_t *outMonth, uint8_t *outDay)
asm("GetBirthday__Q2_2nn3actFPUsPUcT2");
nn::Result
GetBirthdayEx(uint16_t* outYear, uint8_t* outMonth, uint8_t* outDay, SlotNo slot)
GetBirthdayEx(uint16_t *outYear, uint8_t *outMonth, uint8_t *outDay, SlotNo slot)
asm("GetBirthdayEx__Q2_2nn3actFPUsPUcT2Uc");
SlotNo
@ -69,19 +71,19 @@ GetDeviceHash(char outHash[DeviceHashSize])
asm("GetDeviceHash__Q2_2nn3actFPUL");
nn::Result
LoadConsoleAccount(SlotNo slot, ACTLoadOption unk1, char const * unk2, bool unk3)
LoadConsoleAccount(SlotNo slot, ACTLoadOption unk1, char const *unk2, bool unk3)
asm("LoadConsoleAccount__Q2_2nn3actFUc13ACTLoadOptionPCcb");
nn::Result
GetMii(FFLStoreData* mii)
GetMii(FFLStoreData *mii)
asm("GetMii__Q2_2nn3actFP12FFLStoreData");
nn::Result
GetMiiEx(FFLStoreData* mii, SlotNo slot)
GetMiiEx(FFLStoreData *mii, SlotNo slot)
asm("GetMiiEx__Q2_2nn3actFP12FFLStoreDataUc");
nn::Result
GetMiiImageEx(size_t* outImageSize, void* buffer, size_t bufferSize, int unk, SlotNo slot)
GetMiiImageEx(size_t *outImageSize, void *buffer, size_t bufferSize, int unk, SlotNo slot)
asm("GetMiiImageEx__Q2_2nn3actFPUiPvUi15ACTMiiImageTypeUc");
nn::Result
@ -125,7 +127,7 @@ GetPrincipalId(void)
asm("GetPrincipalId__Q2_2nn3actFv");
nn::Result
GetPrincipalIdEx(PrincipalId* outId, SlotNo slot)
GetPrincipalIdEx(PrincipalId *outId, SlotNo slot)
asm("GetPrincipalIdEx__Q2_2nn3actFPUiUc");
SimpleAddressId
@ -133,7 +135,7 @@ GetSimpleAddressId(void)
asm("GetSimpleAddressId__Q2_2nn3actFv");
nn::Result
GetSimpleAddressId(SimpleAddressId* outId, SlotNo slot)
GetSimpleAddressId(SimpleAddressId *outId, SlotNo slot)
asm("GetSimpleAddressIdEx__Q2_2nn3actFPUiUc");
SlotNo
@ -145,7 +147,7 @@ GetTransferableId(uint32_t unk1)
asm("GetTransferableId__Q2_2nn3actFUi");
nn::Result
GetTransferableIdEx(TransferrableId* outId, uint32_t unk1, SlotNo slot)
GetTransferableIdEx(TransferrableId *outId, uint32_t unk1, SlotNo slot)
asm("GetTransferableIdEx__Q2_2nn3actFPULUiUc");
nn::Result

View File

@ -32,6 +32,15 @@ typedef enum CCRSysInitBootFlag
CCR_SYS_BOOT_FLAG_FIRST_BOOT = 1,
} CCRSysInitBootFlag;
typedef enum CCRSysLCDMode
{
CCR_SYS_LCD_MODE_BRIGHTNESS_1 = 1,
CCR_SYS_LCD_MODE_BRIGHTNESS_2 = 2,
CCR_SYS_LCD_MODE_BRIGHTNESS_3 = 3,
CCR_SYS_LCD_MODE_BRIGHTNESS_4 = 4,
CCR_SYS_LCD_MODE_BRIGHTNESS_5 = 5,
} CCRSysLCDMode;
struct CCRSysUpdateState
{
uint32_t state;
@ -286,6 +295,20 @@ CCRSysSetInitBootFlag(CCRSysInitBootFlag flag);
int32_t
CCRSysInitializeSettings();
/**
* Sets the brightness of the DRC.
* @return 0 on success, -1 on error.
*/
int32_t
CCRSysSetCurrentLCDMode(CCRSysLCDMode mode);
/**
* Gets the brightness of the DRC.
* @return 0 on success, -1 on error.
*/
int32_t
CCRSysGetCurrentLCDMode(CCRSysLCDMode *mode);
#ifdef __cplusplus
}
#endif

View File

@ -25,7 +25,7 @@ WUT_CHECK_OFFSET(CCRAppLaunchParam, 0x08, uuid);
WUT_CHECK_SIZE(CCRAppLaunchParam, 0xFF);
void
CCRSysCaffeineGetAppLaunchParam(CCRAppLaunchParam * data);
CCRSysCaffeineGetAppLaunchParam(CCRAppLaunchParam *data);
uint32_t
CCRSysCaffeineBootCheck();

View File

@ -4,14 +4,18 @@
#ifdef __cplusplus
namespace nn {
namespace nn
{
namespace cfg {
namespace cfg
{
namespace CTR {
namespace CTR
{
//! Represents a console username, used in UDS and DLP
struct UserName {
struct UserName
{
char16_t name[12];
};
WUT_CHECK_SIZE(UserName, 0x18);

View File

@ -12,7 +12,8 @@
extern "C" {
#endif
typedef enum CmptScreenType {
typedef enum CmptScreenType
{
CMPT_SCREEN_TYPE_TV = 1,
CMPT_SCREEN_TYPE_DRC,
CMPT_SCREEN_TYPE_BOTH,
@ -26,7 +27,7 @@ typedef enum CmptScreenType {
* 0 on success.
*/
int32_t
CMPTGetDataSize(uint32_t* outSize);
CMPTGetDataSize(uint32_t *outSize);
/**
* Launches the specified vWii title.
@ -35,7 +36,7 @@ CMPTGetDataSize(uint32_t* outSize);
* 0 on success.
*/
int32_t
CMPTLaunchTitle(void* dataBuffer, uint32_t bufferSize, uint64_t titleId);
CMPTLaunchTitle(void *dataBuffer, uint32_t bufferSize, uint64_t titleId);
/**
* Launches vWii System Menu.
@ -44,7 +45,7 @@ CMPTLaunchTitle(void* dataBuffer, uint32_t bufferSize, uint64_t titleId);
* 0 on success.
*/
int32_t
CMPTLaunchMenu(void* dataBuffer, uint32_t bufferSize);
CMPTLaunchMenu(void *dataBuffer, uint32_t bufferSize);
/**
* Launches vWii Data Management.
@ -53,7 +54,7 @@ CMPTLaunchMenu(void* dataBuffer, uint32_t bufferSize);
* 0 on success.
*/
int32_t
CMPTLaunchDataManager(void* dataBuffer, uint32_t bufferSize);
CMPTLaunchDataManager(void *dataBuffer, uint32_t bufferSize);
/**
* Sets the screen type.

8
include/nn/dlp.h Normal file
View File

@ -0,0 +1,8 @@
#pragma once
/**
* \defgroup nn_dlp nn_dlp
* Download Play functions
*/
#include <nn/dlp/Cafe.h>

359
include/nn/dlp/Cafe.h Normal file
View File

@ -0,0 +1,359 @@
#pragma once
#include <wut.h>
#include <nn/cfg/CTR.h>
#include <nn/result.h>
#include <nn/uds/NodeInformation.h>
/**
* \defgroup nn_dlp nn_dlp
* \ingroup nn_dlp
* Download Play functions (see \link nn::dlp \endlink)
* @{
*/
#ifdef __cplusplus
namespace nn
{
namespace dlp
{
namespace Cafe
{
enum PollStateChangeFlags : uint8_t
{
//! Prevents \c PollStateChange from blocking if no new data is available
DLP_POLL_NONBLOCK = 1 << 0,
};
WUT_CHECK_SIZE(PollStateChangeFlags, 0x1);
//! Represents the client state
enum class ClientState : uint32_t
{
//! The client is accepted for the DLP child distribution
Accepted = 5,
//! The client is receiving the distributed DLP child
Receiving = 6,
//! The client has received the distribution and is ready to boot the DLP child
Ready = 7,
//! The client is connected to the session and pending to be accepted
Connecting = 64
};
WUT_CHECK_SIZE(ClientState, 0x4);
//! Represents the server state. All values between 3 and 7 are considered internal state
enum class ServerState : uint32_t
{
//! The server is not initialized
Uninitialized = 0,
//! The server is initialized but there is no active network
Idle = 1,
//! The server is open to new connections
Open = 2,
//! The server is distributing the DLP child to the clients
DistributingInternal = 7,
//! The server has distributed the DLP child
Distributed = 8,
//! The server has finished distribution and clients are booted into the DLP child
Finished = 9,
//! The server failed to distribute the DLP child to the clients
Failed = 10,
//! Public value for internal states
Distributing = 11
};
WUT_CHECK_SIZE(ServerState, 0x4);
class Server
{
public:
/**
* Accepts a client into the DLP child distribution.
*
* \param nodeId
* The node ID of the client.
*/
static nn::Result
AcceptClient(uint16_t nodeId)
asm("AcceptClient__Q4_2nn3dlp4Cafe6ServerSFUs");
/**
* Closes the DLP session.
*/
static nn::Result
CloseSessions()
asm("CloseSessions__Q4_2nn3dlp4Cafe6ServerSFv");
/**
* Disconnects a client from the DLP session. This cannot be done after starting distribution.
*
* \param nodeId
* The node ID of the client.
*/
static nn::Result
DisconnectClient(uint16_t nodeId)
asm("DisconnectClient__Q4_2nn3dlp4Cafe6ServerSFUs");
/**
* Finalizes DLP.
*/
static nn::Result
Finalize()
asm("Finalize__Q4_2nn3dlp4Cafe6ServerSFv");
/**
* Gets information about a client.
*
* \param clientInfo
* Pointer where the client information is written.
*
* \param nodeId
* Node ID of the client.
*/
static nn::Result
GetClientInfo(nn::uds::Cafe::NodeInformation *clientInfo, uint16_t nodeId)
asm("GetClientInfo__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3uds4Cafe15NodeInformationUs");
/**
* Gets a client state.
*
* \param state
* Pointer where the client state is filled in.
*
* \param nodeId
* Node ID of the client.
*/
static nn::Result
GetClientState(ClientState *state, uint16_t nodeId)
asm("GetClientState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ClientStateUs");
/**
* Gets a client state.
*
* \param state
* Pointer where the client state is filled in.
*
* \param unitsTotal
* Pointer filled with the total number of units being distributed.
* Only filled when starting distribution and the DLP child isn't cached.
*
* \param unitsReceived
* Pointer filled with the number of units that the client has received.
* Only filled when starting distribution and the DLP child isn't cached.
*
* \param nodeId
* Node ID of the client.
*/
static nn::Result
GetClientState(ClientState *state,
uint32_t *unitsTotal,
uint32_t *unitsReceived,
uint16_t nodeId)
asm("GetClientState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ClientStatePUiT2Us");
/**
* Gets the clients that are connected to the DLP session.
*
* \param receivedLength
* Pointer where the number of clients written to the array is stored.
*
* \param connectingClients
* Array where the node IDs of the clients are written.
*
* \param length
* Number of nodes that the \c connectingClients array can hold.
*/
static nn::Result
GetConnectingClients(uint16_t *receivedLength,
uint16_t *connectingClients,
uint16_t length)
asm("GetConnectingClients__Q4_2nn3dlp4Cafe6ServerSFPUsT1Us");
/**
* Gets the server state. Internal states are filtered as \link Distributing \endlink .
*
* \param state
* Pointer where the server state is written.
*/
static nn::Result
GetState(ServerState *state)
asm("GetState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ServerState");
/**
* Initializes DLP.
*
* \param maxClientNum
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
*
* \param uniqueId
* Unique ID of the DLP child to be distributed.
*
* \param childIndex
* Index of the DLP child to be distributed.
*
* \param userName
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
*/
static nn::Result
Initialize(uint8_t maxClientNum,
uint32_t uniqueId,
uint8_t childIndex,
nn::cfg::CTR::UserName *userName)
asm("Initialize__Q4_2nn3dlp4Cafe6ServerSFUcUiT1PQ4_2nn3cfg3CTR8UserName");
/**
* Initializes DLP.
*
* \param dupNoticeNeed
* Unknown output bool, always false on the Wii U.
*
* \param maxClientNum
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
*
* \param uniqueId
* Unique ID of the DLP child to be distributed.
*
* \param childIndex
* Index of the DLP child to be distributed.
*
* \param userName
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
*/
static nn::Result
Initialize(bool *dupNoticeNeed,
uint8_t maxClientNum,
uint32_t uniqueId,
uint8_t childIndex,
nn::cfg::CTR::UserName *userName)
asm("Initialize__Q4_2nn3dlp4Cafe6ServerSFPbUcUiT2PQ4_2nn3cfg3CTR8UserName");
/**
* Opens the DLP session.
*
* \param isManualAccept
* If set, all clients must be accepted to allow them to join the session.
*
* \param channel
* The channel to be used for hosting the session. Use 0 to choose a channel automatically.
* Must be either 0, 1, 6 or 11.
*/
static nn::Result
OpenSessions(bool isManualAccept, uint8_t channel)
asm("OpenSessions__Q4_2nn3dlp4Cafe6ServerSFbUc");
/**
* Checks if the server state chas changed, and waits until it changes if specified.
*
* \param flags
* Flags, see \link PollStateChangeFlags \endlink for all flags.
*/
static nn::Result
PollStateChange(uint8_t flags)
asm("PollStateChange__Q4_2nn3dlp4Cafe6ServerSFUc");
/**
* Reboots all clients into the Download Play child.
*
* \param passPhrase
* Passphrase to be used by the client when connecting to the main UDS network.
* If \c NULL, it will be set to an empty string.
*/
static nn::Result
RebootAllClients(const char *passPhrase)
asm("RebootAllClients__Q4_2nn3dlp4Cafe6ServerSFPCc");
/**
* Starts distribution of the Download Play child.
*/
static nn::Result
StartDistribution()
asm("StartDistribute__Q4_2nn3dlp4Cafe6ServerSFv");
};
class ServerPrivate
{
public:
/**
* Gets the server state. Internal states are not filtered.
*
* \param state
* Pointer where the server state is written.
*/
static nn::Result
GetInternalState(ServerState *state)
asm("GetInternalState__Q4_2nn3dlp4Cafe13ServerPrivateSFPQ4_2nn3dlp4Cafe11ServerState");
/**
* Initializes DLP.
*
* \param maxClientNum
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
*
* \param uniqueId
* Unique ID of the DLP child to be distributed.
*
* \param childIndex
* Index of the DLP child to be distributed.
*
* \param blockBufferSize
* Unknown parameter (default: 0xC000). Must be bigger than 0x4000 and smaller than 0x80000 inclusively.
*
* \param blockBufferNum
* Unknown parameter (default: 2). Must be a number between 2 and 4 inclusively.
*
* \param userName
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
*/
static nn::Result
Initialize(uint8_t maxClientNum,
uint32_t uniqueId,
uint8_t childIndex,
uint32_t blockBufferSize,
uint32_t blockBufferNum,
nn::cfg::CTR::UserName *userName)
asm("Initialize__Q4_2nn3dlp4Cafe13ServerPrivateSFUcUiT1N22PQ4_2nn3cfg3CTR8UserName");
/**
* Initializes DLP.
*
* \param dupNoticeNeed
* Unknown output bool, always false on the Wii U.
*
* \param maxClientNum
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
*
* \param uniqueId
* Unique ID of the DLP child to be distributed.
*
* \param childIndex
* Index of the DLP child to be distributed.
*
* \param blockBufferSize
* Unknown parameter (default: 0xC000). Must be bigger than 0x4000 and smaller than 0x80000 inclusively.
*
* \param blockBufferNum
* Unknown parameter (default: 2). Must be a number between 2 and 4 inclusively.
*
* \param userName
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
*/
static nn::Result
Initialize(bool *dupNoticeNeed,
uint8_t maxClientNum,
uint32_t uniqueId,
uint8_t childIndex,
uint32_t blockBufferSize,
uint32_t blockBufferNum,
nn::cfg::CTR::UserName *userName)
asm("Initialize__Q4_2nn3dlp4Cafe13ServerPrivateSFPbUcUiT2N23PQ4_2nn3cfg3CTR8UserName");
};
} // namespace Cafe
} // namespace dlp
} // namespace nn
/** @} */
#endif

View File

@ -3,8 +3,8 @@
#include <coreinit/filesystem.h>
#include <nn/result.h>
#include <padscore/kpad.h>
#include <vpad/input.h>
#include <string.h>
#include <vpad/input.h>
/**
* \defgroup nn_erreula_erreula Error Viewer

View File

@ -14,13 +14,15 @@ extern "C" {
// https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/nn/ffl/nn_ffl_miidata.h
typedef enum FFLCreateIDFlags {
typedef enum FFLCreateIDFlags
{
FFL_CREATE_ID_FLAG_WII_U = 0x1 | 0x4,
FFL_CREATE_ID_FLAG_TEMPORARY = 0x2,
FFL_CREATE_ID_FLAG_NORMAL = 0x8,
} FFLCreateIDFlags;
typedef struct WUT_PACKED FFLCreateID {
typedef struct WUT_PACKED FFLCreateID
{
FFLCreateIDFlags flags : 4;
uint32_t timestamp : 28;
@ -31,7 +33,8 @@ WUT_CHECK_OFFSET(FFLCreateID, 4, deviceHash);
WUT_CHECK_SIZE(FFLCreateID, 10);
//Note: the endian may be wrong here
typedef struct WUT_PACKED FFLiMiiDataCore {
typedef struct WUT_PACKED FFLiMiiDataCore
{
// 0x00
uint8_t birth_platform : 4;
uint8_t unk_0x00_b4 : 4;
@ -150,14 +153,16 @@ WUT_CHECK_OFFSET(FFLiMiiDataCore, 0x2F, fatness);
WUT_CHECK_OFFSET(FFLiMiiDataCore, 0x33, hair_type);
WUT_CHECK_SIZE(FFLiMiiDataCore, 0x48);
typedef struct WUT_PACKED FFLiMiiDataOfficial {
typedef struct WUT_PACKED FFLiMiiDataOfficial
{
FFLiMiiDataCore core;
uint16_t creator_name[10];
} FFLiMiiDataOfficial;
WUT_CHECK_OFFSET(FFLiMiiDataOfficial, 0x48, creator_name);
WUT_CHECK_SIZE(FFLiMiiDataOfficial, 0x5C);
typedef struct WUT_PACKED FFLStoreData {
typedef struct WUT_PACKED FFLStoreData
{
FFLiMiiDataOfficial data;
uint16_t unk_0x5C;
uint16_t checksum;

View File

@ -1,8 +1,8 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/ffl/miidata.h>
#include <nn/act.h>
#include <nn/ffl/miidata.h>
#include <nn/result.h>
/**
* \defgroup nn_fp_fp Friends Presence
@ -207,11 +207,11 @@ struct FriendRequest
};
WUT_CHECK_SIZE(FriendRequest, 0x164);
typedef void(*FPAsyncCallback)(nn::Result, void *);
typedef void(*NotificationHandlerFn)(nn::fp::NotificationType, nn::act::PrincipalId, void *);
typedef void (*FPAsyncCallback)(nn::Result, void *);
typedef void (*NotificationHandlerFn)(nn::fp::NotificationType, nn::act::PrincipalId, void *);
nn::Result
AcceptFriendRequestAsync(nn::act::LocalFriendCode/*unsure*/, FPAsyncCallback, void *)
AcceptFriendRequestAsync(nn::act::LocalFriendCode /*unsure*/, FPAsyncCallback, void *)
asm("AcceptFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
@ -226,7 +226,7 @@ AddBlackListAsync(nn::act::PrincipalId, FPAsyncCallback, void *)
nn::Result
AddFriendAsync(char nnid[nn::act::AccountIdSize]/*unsure*/, FPAsyncCallback, void *)
AddFriendAsync(char nnid[nn::act::AccountIdSize] /*unsure*/, FPAsyncCallback, void *)
asm("AddFriendAsync__Q2_2nn2fpFPCcPFQ2_2nn6ResultPv_vPv");
@ -261,7 +261,7 @@ AddRecentPlayRecord(const nn::fp::RecentPlayRecord *, unsigned int)
nn::Result
CancelFriendRequestAsync(nn::act::LocalFriendCode/*unsure*/, FPAsyncCallback, void *)
CancelFriendRequestAsync(nn::act::LocalFriendCode /*unsure*/, FPAsyncCallback, void *)
asm("CancelFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
@ -281,7 +281,7 @@ DeleteFriendFlagsAsync(const unsigned int *, unsigned int, unsigned int, FPAsync
nn::Result
DeleteFriendRequestAsync(nn::act::LocalFriendCode/*unsure*/, FPAsyncCallback, void *)
DeleteFriendRequestAsync(nn::act::LocalFriendCode /*unsure*/, FPAsyncCallback, void *)
asm("DeleteFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
@ -296,7 +296,7 @@ DeleteSaveDirectory(unsigned int)
nn::Result
DenyFriendRequestAsync(nn::act::LocalFriendCode/*unsure*/, FPAsyncCallback, void *)
DenyFriendRequestAsync(nn::act::LocalFriendCode /*unsure*/, FPAsyncCallback, void *)
asm("DenyFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
@ -336,7 +336,7 @@ GetBlackListEx(nn::fp::BlackListedPrincipal *outBlackList, unsigned int *, unsig
nn::Result
GetBlackList(nn::act::PrincipalId *outBlackListPrincipalBuffer, unsigned int *outBlackListPrincipalBufferSize, unsigned int/*unk*/, unsigned int maxReadCount)
GetBlackList(nn::act::PrincipalId *outBlackListPrincipalBuffer, unsigned int *outBlackListPrincipalBufferSize, unsigned int /*unk*/, unsigned int maxReadCount)
asm("GetBlackList__Q2_2nn2fpFPUiT1UiT3");
@ -366,7 +366,7 @@ GetFriendListEx(nn::fp::FriendData *outFriendData, nn::act::PrincipalId *princip
nn::Result
GetFriendList(nn::act::PrincipalId *outPrincipalBuffer, unsigned int *outPrincipalBufferReadCount, unsigned int unkn/*slotId maybe*/, unsigned int principalBufferSize)
GetFriendList(nn::act::PrincipalId *outPrincipalBuffer, unsigned int *outPrincipalBufferReadCount, unsigned int unkn /*slotId maybe*/, unsigned int principalBufferSize)
asm("GetFriendList__Q2_2nn2fpFPUiT1UiT3");
@ -411,7 +411,7 @@ GetFriendRequestListEx(nn::fp::FriendRequest *, nn::act::PrincipalId *principalB
nn::Result
GetFriendRequestList(nn::act::PrincipalId *outBuffer, unsigned int *outReadCount, unsigned int/*unk*/, unsigned int count)
GetFriendRequestList(nn::act::PrincipalId *outBuffer, unsigned int *outReadCount, unsigned int /*unk*/, unsigned int count)
asm("GetFriendRequestList__Q2_2nn2fpFPUiT1UiT3");
@ -521,7 +521,7 @@ IsInitialized(void)
bool
IsInvitation(nn::fp::GameMode *, nn::act::PrincipalId myPrincipalId, unsigned int/*unk*/)
IsInvitation(nn::fp::GameMode *, nn::act::PrincipalId myPrincipalId, unsigned int /*unk*/)
asm("IsInvitation__Q2_2nn2fpFPCQ3_2nn2fp8GameModeUiT2");
@ -591,7 +591,7 @@ RemoveFriendAsync(unsigned int, FPAsyncCallback, void *)
uint32_t
ResultToErrorCode(nn::Result)
ResultToErrorCode(nn::Result)
asm("ResultToErrorCode__Q2_2nn2fpFQ2_2nn6Result");
@ -601,7 +601,7 @@ SetInvitationParameter(nn::fp::GameMode *, unsigned int *, unsigned int, bool)
nn::Result
SetLedEventMask(uint32_t)
SetLedEventMask(uint32_t)
asm("SetLedEventMask__Q2_2nn2fpFUi");

View File

@ -176,10 +176,12 @@ HPADShutdown(void);
* \return
* The amount of buffers read or a negative value on error.
*/
// clang-format off
int32_t
RPLWRAP(HPADRead)(HPADChan chan,
HPADStatus *buffers,
int32_t count);
// clang-format on
/**
* Reads status buffers from a specified HPAD channel.

View File

@ -4,5 +4,5 @@
* \defgroup nn_idb nn_idb
*/
#include <nn/idb/idb_cpp.h>
#include <nn/idb/IDBReader.h>
#include <nn/idb/idb_cpp.h>

View File

@ -57,11 +57,13 @@ somemopt(SOMemOptRequest request,
uint32_t size,
SOMemOptFlags flags);
// clang-format off
int
RPLWRAP(somemopt)(SOMemOptRequest request,
void *buffer,
uint32_t size,
SOMemOptFlags flags);
// clang-format on
#ifdef __cplusplus
}

View File

@ -5,5 +5,5 @@
* Nintendo Figurine (amiibo) Platform library.
*/
#include <nn/nfp/nfp_cpp.h>
#include <nn/nfp/amiibo_settings_cpp.h>
#include <nn/nfp/nfp_cpp.h>

View File

@ -12,9 +12,11 @@
#ifdef __cplusplus
namespace nn {
namespace nn
{
namespace nfp {
namespace nfp
{
enum class AmiiboSettingsMode : uint32_t
{

View File

@ -1,9 +1,9 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/ffl/miidata.h>
#include <coreinit/event.h>
#include <nfc/nfc.h>
#include <nn/ffl/miidata.h>
#include <nn/result.h>
/**
* \defgroup nn_nfp
@ -14,9 +14,11 @@
#ifdef __cplusplus
namespace nn {
namespace nn
{
namespace nfp {
namespace nfp
{
//! NN_NFP result descriptions for \link nn::Result::GetDescription \endlink.
enum ResultDescription
@ -101,7 +103,7 @@ struct ApplicationAreaCreateInfo
//! The access ID with which the area should be created
uint32_t accessID;
//! The initial data to write to the area
void* data;
void *data;
//! The size of the data
uint32_t size;
//! reserved bytes, must be set to 0

View File

@ -10,9 +10,11 @@
#ifdef __cplusplus
namespace nn {
namespace nn
{
namespace pdm {
namespace pdm
{
//! Flags for PlayDiary
typedef enum PlayDiaryFlags : uint16_t
@ -138,7 +140,7 @@ WaitForConvertDone()
* 0 on success.
*/
uint32_t
GetPlayDiaryMaxLength(uint32_t* outMaxLength)
GetPlayDiaryMaxLength(uint32_t *outMaxLength)
asm("GetPlayDiaryMaxLength__Q2_2nn3pdmFPi");
/**
@ -154,7 +156,7 @@ GetPlayDiaryMaxLength(uint32_t* outMaxLength)
* 0 on success.
*/
uint32_t
GetPlayDiaryLength(uint32_t* outLength, uint32_t userId)
GetPlayDiaryLength(uint32_t *outLength, uint32_t userId)
asm("GetPlayDiaryLength__Q2_2nn3pdmFPii");
/**
@ -170,7 +172,7 @@ GetPlayDiaryLength(uint32_t* outLength, uint32_t userId)
* 0 on success.
*/
uint32_t
GetPlayDiaryStart(uint32_t* outStart, uint32_t userId)
GetPlayDiaryStart(uint32_t *outStart, uint32_t userId)
asm("GetPlayDiaryStart__Q2_2nn3pdmFPii");
/**
@ -195,7 +197,7 @@ GetPlayDiaryStart(uint32_t* outStart, uint32_t userId)
* 0 on success.
*/
uint32_t
GetPlayDiary(uint32_t* outAmount, PlayDiary* outPlayDiaries, uint32_t userId, uint32_t amount)
GetPlayDiary(uint32_t *outAmount, PlayDiary *outPlayDiaries, uint32_t userId, uint32_t amount)
asm("GetPlayDiary__Q2_2nn3pdmFPiPQ3_2nn3pdm9PlayDiaryiT3");
/**
@ -217,7 +219,7 @@ GetPlayDiary(uint32_t* outAmount, PlayDiary* outPlayDiaries, uint32_t userId, ui
* May be smaller than the amount passed to the function.
*/
uint32_t
GetPlayDiary(PlayDiary* outPlayDiaries, uint32_t userId, uint32_t amount)
GetPlayDiary(PlayDiary *outPlayDiaries, uint32_t userId, uint32_t amount)
asm("GetPlayDiary__Q2_2nn3pdmFPQ3_2nn3pdm9PlayDiaryiT2");
/**
@ -231,7 +233,7 @@ GetPlayDiary(PlayDiary* outPlayDiaries, uint32_t userId, uint32_t amount)
* 0 on success.
*/
uint32_t
GetPlayEventMaxLength(uint32_t* outMaxLength)
GetPlayEventMaxLength(uint32_t *outMaxLength)
asm("GetPlayEventMaxLength__Q2_2nn3pdmFPi");
/**
@ -256,7 +258,7 @@ GetPlayEventMaxLength(uint32_t* outMaxLength)
* 0 on success.
*/
uint32_t
GetPlayEvent(uint32_t* outAmount, PlayEvent* outPlayEvents, uint32_t userId, uint32_t amount)
GetPlayEvent(uint32_t *outAmount, PlayEvent *outPlayEvents, uint32_t userId, uint32_t amount)
asm("GetPlayEvent__Q2_2nn3pdmFPiPQ3_2nn3pdm9PlayEventiT3");
/**
@ -270,7 +272,7 @@ GetPlayEvent(uint32_t* outAmount, PlayEvent* outPlayEvents, uint32_t userId, uin
* 0 on success.
*/
uint32_t
GetPlayLogMaxLength(uint32_t* outMaxLength)
GetPlayLogMaxLength(uint32_t *outMaxLength)
asm("GetPlayLogMaxLength__Q2_2nn3pdmFPi");
/**
@ -286,7 +288,7 @@ GetPlayLogMaxLength(uint32_t* outMaxLength)
* 0 on success.
*/
uint32_t
GetPlayLogLength(uint32_t* outLength, uint32_t userId)
GetPlayLogLength(uint32_t *outLength, uint32_t userId)
asm("GetPlayLogLength__Q2_2nn3pdmFPii");
/**
@ -302,7 +304,7 @@ GetPlayLogLength(uint32_t* outLength, uint32_t userId)
* 0 on success.
*/
uint32_t
GetPlayLogStart(uint32_t* outStart, uint32_t userId)
GetPlayLogStart(uint32_t *outStart, uint32_t userId)
asm("GetPlayLogStart__Q2_2nn3pdmFPii");
/**
@ -327,7 +329,7 @@ GetPlayLogStart(uint32_t* outStart, uint32_t userId)
* 0 on success.
*/
uint32_t
GetPlayLog(uint32_t* outAmount, PlayLog* outPlayLogs, uint32_t userId, uint32_t amount)
GetPlayLog(uint32_t *outAmount, PlayLog *outPlayLogs, uint32_t userId, uint32_t amount)
asm("GetPlayLog__Q2_2nn3pdmFPiPQ3_2nn3pdm7PlayLogiT3");
/**
@ -349,7 +351,7 @@ GetPlayLog(uint32_t* outAmount, PlayLog* outPlayLogs, uint32_t userId, uint32_t
* May be smaller than the amount passed to the function.
*/
uint32_t
GetPlayLog(PlayLog* outPlayLogs, uint32_t userId, uint32_t amount)
GetPlayLog(PlayLog *outPlayLogs, uint32_t userId, uint32_t amount)
asm("GetPlayLog__Q2_2nn3pdmFPQ3_2nn3pdm7PlayLogiT2");
/**
@ -363,7 +365,7 @@ GetPlayLog(PlayLog* outPlayLogs, uint32_t userId, uint32_t amount)
* 0 on success.
*/
uint32_t
GetPlayStatsMaxLength(uint32_t* outMaxLength)
GetPlayStatsMaxLength(uint32_t *outMaxLength)
asm("GetPlayStatsMaxLength__Q2_2nn3pdmFPi");
/**
@ -379,7 +381,7 @@ GetPlayStatsMaxLength(uint32_t* outMaxLength)
* 0 on success.
*/
uint32_t
GetPlayStatsLength(uint32_t* outLength, uint32_t userId)
GetPlayStatsLength(uint32_t *outLength, uint32_t userId)
asm("GetPlayStatsLength__Q2_2nn3pdmFPii");
/**
@ -399,7 +401,7 @@ GetPlayStatsLength(uint32_t* outLength, uint32_t userId)
* 0 on success
*/
uint32_t
GetPlayStatsOfTitleId(PlayStats* outPlayStats, uint32_t userId, uint64_t titleId)
GetPlayStatsOfTitleId(PlayStats *outPlayStats, uint32_t userId, uint64_t titleId)
asm("GetPlayStatsOfTitleId__Q2_2nn3pdmFPQ3_2nn3pdm9PlayStatsiUL");
/**
@ -424,7 +426,7 @@ GetPlayStatsOfTitleId(PlayStats* outPlayStats, uint32_t userId, uint64_t titleId
* 0 on success.
*/
uint32_t
GetPlayStats(uint32_t* outAmount, PlayStats* outPlayStats, uint32_t userId, uint32_t amount)
GetPlayStats(uint32_t *outAmount, PlayStats *outPlayStats, uint32_t userId, uint32_t amount)
asm("GetPlayStats__Q2_2nn3pdmFPiPQ3_2nn3pdm9PlayStatsiT3");
/**
@ -446,7 +448,7 @@ GetPlayStats(uint32_t* outAmount, PlayStats* outPlayStats, uint32_t userId, uint
* May be smaller than the amount passed to the function.
*/
uint32_t
GetPlayStats(PlayStats* outPlayStats, uint32_t userId, uint32_t amount)
GetPlayStats(PlayStats *outPlayStats, uint32_t userId, uint32_t amount)
asm("GetPlayStats__Q2_2nn3pdmFPQ3_2nn3pdm9PlayStatsiT2");
void

View File

@ -34,7 +34,8 @@ struct NNResult
* \sa
* - \link NNResult_IsFailure \endlink
*/
static inline int NNResult_IsSuccess(NNResult result)
static inline int
NNResult_IsSuccess(NNResult result)
{
return result.value >= 0;
}
@ -51,7 +52,8 @@ static inline int NNResult_IsSuccess(NNResult result)
* \sa
* - \link NNResult_IsSuccess \endlink
*/
static inline int NNResult_IsFailure(NNResult result)
static inline int
NNResult_IsFailure(NNResult result)
{
return result.value < 0;
}
@ -228,6 +230,11 @@ public:
};
public:
Result() :
mValue(0)
{
}
Result(Level level, Module module, unsigned description) :
mValue(((level & 0x7) << 29) | ((module & 0x1FF) << 20) | (description & 0xFFFFF))
{
@ -247,7 +254,8 @@ public:
* \sa
* - \link IsSuccess \endlink
*/
bool IsFailure() const
bool
IsFailure() const
{
return !IsSuccess();
}
@ -261,22 +269,26 @@ public:
* \sa
* - \link IsFailure \endlink
*/
bool IsSuccess() const
bool
IsSuccess() const
{
return mValue >= 0; // level >= 0
}
bool IsLegacy() const
bool
IsLegacy() const
{
return ((mValue >> 27) & 0x3) == SIGNATURE_IS_LEGACY;
}
unsigned GetDescription() const
unsigned
GetDescription() const
{
return mValue & (IsLegacy() ? 0x3FF : 0xFFFFF);
}
int GetLevel() const
int
GetLevel() const
{
if (IsLegacy()) {
return (mValue << 14) >> 28; // cause arithmetic shift
@ -285,12 +297,14 @@ public:
return mValue >> 29;
}
unsigned GetModule() const
unsigned
GetModule() const
{
return (mValue >> 20) & (IsLegacy() ? 0x7F : 0x1FF);
}
unsigned GetSummary() const
unsigned
GetSummary() const
{
if (IsLegacy()) {
return (mValue >> 10) & 0xF;
@ -311,12 +325,14 @@ public:
return result;
}
bool operator==(const Result &other) const
bool
operator==(const Result &other) const
{
return mValue == other.mValue;
}
bool operator!=(const Result &other) const
bool
operator!=(const Result &other) const
{
return mValue != other.mValue;
}

View File

@ -1,8 +1,8 @@
#pragma once
#include <wut.h>
#include <nn/acp/device.h>
#include <coreinit/filesystem.h>
#include <nn/acp/device.h>
#ifdef __cplusplus
extern "C" {

View File

@ -1,42 +1,54 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/ISerializer.h>
#include <nn/sl/KillerNotification.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace details {
typedef struct WUT_PACKED CacheManagerInternal {
namespace nn::sl
{
namespace details
{
typedef struct WUT_PACKED CacheManagerInternal
{
ISerializerInternal *quickStartTitleInfoSerializer;
ISerializerInternal *killerNotificationSerializer;
ISerializerInternal *jumpTitleInfoSerializer;
} CacheManagerInternal;
WUT_CHECK_SIZE(CacheManagerInternal, 0x0c);
WUT_CHECK_OFFSET(CacheManagerInternal, 0x00, quickStartTitleInfoSerializer);
WUT_CHECK_OFFSET(CacheManagerInternal, 0x04, killerNotificationSerializer);
WUT_CHECK_OFFSET(CacheManagerInternal, 0x08, jumpTitleInfoSerializer);
} CacheManagerInternal;
WUT_CHECK_SIZE(CacheManagerInternal, 0x0c);
WUT_CHECK_OFFSET(CacheManagerInternal, 0x00, quickStartTitleInfoSerializer);
WUT_CHECK_OFFSET(CacheManagerInternal, 0x04, killerNotificationSerializer);
WUT_CHECK_OFFSET(CacheManagerInternal, 0x08, jumpTitleInfoSerializer);
extern "C" CacheManagerInternal *__ct__Q3_2nn2sl12CacheManagerFv(CacheManagerInternal *);
extern "C" void SetupInitialCache__Q3_2nn2sl12CacheManagerFv(CacheManagerInternal *);
extern "C" nn::Result GetKillerNotificationCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl18KillerNotificationPQ3_2nn2sl9TitleInfo(CacheManagerInternal *, KillerNotification *, TitleInfo *);
extern "C" nn::Result GetQuickStartCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoi(CacheManagerInternal *, TitleInfo *, int);
extern "C" nn::Result Get__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoiPQ3_2nn2sl18KillerNotificationT1(CacheManagerInternal *, TitleInfo *, int, KillerNotification *, TitleInfo *);
extern "C" nn::Result Initialize__Q3_2nn2sl12CacheManagerFRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfoRQ3_2nn2sl49ISerializer__tm__30_Q3_2nn2sl18KillerNotificationT1(
extern "C" CacheManagerInternal *
__ct__Q3_2nn2sl12CacheManagerFv(CacheManagerInternal *);
extern "C" void
SetupInitialCache__Q3_2nn2sl12CacheManagerFv(CacheManagerInternal *);
extern "C" nn::Result
GetKillerNotificationCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl18KillerNotificationPQ3_2nn2sl9TitleInfo(CacheManagerInternal *, KillerNotification *, TitleInfo *);
extern "C" nn::Result
GetQuickStartCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoi(CacheManagerInternal *, TitleInfo *, int);
extern "C" nn::Result
Get__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoiPQ3_2nn2sl18KillerNotificationT1(CacheManagerInternal *, TitleInfo *, int, KillerNotification *, TitleInfo *);
extern "C" nn::Result
Initialize__Q3_2nn2sl12CacheManagerFRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfoRQ3_2nn2sl49ISerializer__tm__30_Q3_2nn2sl18KillerNotificationT1(
CacheManagerInternal *,
ISerializerInternal *,
ISerializerInternal *,
ISerializerInternal *);
} // namespace details
} // namespace details
class CacheManager {
public:
CacheManager() : mQuickStartTitleInfoSerializer(nullptr),
class CacheManager
{
public:
CacheManager() :
mQuickStartTitleInfoSerializer(nullptr),
mKillerNotificationSerializer(nullptr),
mJumpTitleInfoSerializer(nullptr) {
mJumpTitleInfoSerializer(nullptr)
{
if (__ct__Q3_2nn2sl12CacheManagerFv(&mInstance) != nullptr) {
mQuickStartTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(mInstance.quickStartTitleInfoSerializer);
mKillerNotificationSerializer = details::SerializerFromPtr<KillerNotification>(mInstance.killerNotificationSerializer);
@ -44,35 +56,51 @@ namespace nn::sl {
}
}
[[nodiscard]] details::ISerializerBase<TitleInfo> &GetQuickStartTitleInfoSerializer() {
[[nodiscard]] details::ISerializerBase<TitleInfo> &
GetQuickStartTitleInfoSerializer()
{
return mQuickStartTitleInfoSerializer;
}
[[nodiscard]] details::ISerializerBase<KillerNotification> &GetKillerNotificationSerializer() {
[[nodiscard]] details::ISerializerBase<KillerNotification> &
GetKillerNotificationSerializer()
{
return mKillerNotificationSerializer;
}
[[nodiscard]] details::ISerializerBase<TitleInfo> &GetJumpTitleInfoSerializer() {
[[nodiscard]] details::ISerializerBase<TitleInfo> &
GetJumpTitleInfoSerializer()
{
return mJumpTitleInfoSerializer;
}
void SetupInitialCache() {
void
SetupInitialCache()
{
SetupInitialCache__Q3_2nn2sl12CacheManagerFv(&mInstance);
}
nn::Result GetKillerNotificationCache(KillerNotification *u1, TitleInfo *u2) {
nn::Result
GetKillerNotificationCache(KillerNotification *u1, TitleInfo *u2)
{
return GetKillerNotificationCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl18KillerNotificationPQ3_2nn2sl9TitleInfo(&mInstance, u1, u2);
}
nn::Result GetQuickStartCache(TitleInfo *u1, int u2) {
nn::Result
GetQuickStartCache(TitleInfo *u1, int u2)
{
return GetQuickStartCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoi(&mInstance, u1, u2);
}
nn::Result Get(TitleInfo *u1, int u2, KillerNotification *u3, TitleInfo *u4) {
nn::Result
Get(TitleInfo *u1, int u2, KillerNotification *u3, TitleInfo *u4)
{
return Get__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoiPQ3_2nn2sl18KillerNotificationT1(&mInstance, u1, u2, u3, u4);
}
void Initialize(details::ISerializerBase<TitleInfo> &quickStartTitleInfoSerializer, details::ISerializerBase<KillerNotification> &killerNotificationSerializer, details::ISerializerBase<TitleInfo> &jumpTitleInfoSerializer) {
void
Initialize(details::ISerializerBase<TitleInfo> &quickStartTitleInfoSerializer, details::ISerializerBase<KillerNotification> &killerNotificationSerializer, details::ISerializerBase<TitleInfo> &jumpTitleInfoSerializer)
{
Initialize__Q3_2nn2sl12CacheManagerFRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfoRQ3_2nn2sl49ISerializer__tm__30_Q3_2nn2sl18KillerNotificationT1(&mInstance,
quickStartTitleInfoSerializer.GetInternal(),
killerNotificationSerializer.GetInternal(),
@ -84,12 +112,12 @@ namespace nn::sl {
~CacheManager() = default;
private:
private:
details::CacheManagerInternal mInstance{};
details::SerializerFromPtr<TitleInfo> mQuickStartTitleInfoSerializer;
details::SerializerFromPtr<KillerNotification> mKillerNotificationSerializer;
details::SerializerFromPtr<TitleInfo> mJumpTitleInfoSerializer;
};
};
} // namespace nn::sl
#endif

View File

@ -1,49 +1,61 @@
#pragma once
#include <wut.h>
#include <coreinit/time.h>
#include <nn/result.h>
#include <nn/sl/ISettingAccessor.h>
#include <nn/sl/ITimeAccessor.h>
#include <nn/sl/IUpdatePackageAccessor.h>
#include <nn/sl/details/ISerializerDetails.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace details {
typedef struct WUT_PACKED ConditionInternal {
namespace nn::sl
{
namespace details
{
typedef struct WUT_PACKED ConditionInternal
{
ISettingAccessorInternal *settingAccessor;
IUpdatePackageAccessorInternal *updatePackageAccessor;
ISerializerInternal *previousSendingTimeSerializer;
ITimeAccessorInternal *timeAccessor;
void *vtable;
} ConditionInternal;
WUT_CHECK_SIZE(ConditionInternal, 0x14);
WUT_CHECK_OFFSET(ConditionInternal, 0x00, settingAccessor);
WUT_CHECK_OFFSET(ConditionInternal, 0x04, updatePackageAccessor);
WUT_CHECK_OFFSET(ConditionInternal, 0x08, previousSendingTimeSerializer);
WUT_CHECK_OFFSET(ConditionInternal, 0x0C, timeAccessor);
WUT_CHECK_OFFSET(ConditionInternal, 0x10, vtable);
} ConditionInternal;
WUT_CHECK_SIZE(ConditionInternal, 0x14);
WUT_CHECK_OFFSET(ConditionInternal, 0x00, settingAccessor);
WUT_CHECK_OFFSET(ConditionInternal, 0x04, updatePackageAccessor);
WUT_CHECK_OFFSET(ConditionInternal, 0x08, previousSendingTimeSerializer);
WUT_CHECK_OFFSET(ConditionInternal, 0x0C, timeAccessor);
WUT_CHECK_OFFSET(ConditionInternal, 0x10, vtable);
extern "C" ConditionInternal *__ct__Q3_2nn2sl9ConditionFv(ConditionInternal *);
extern "C" nn::Result GetEnability__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
extern "C" nn::Result StoreCurrentTimeAsPreviousSendingTime__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
extern "C" nn::Result NeedsUpdate__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
extern "C" nn::Result GetPreviousSendingTime__Q3_2nn2sl9ConditionCFPL(ConditionInternal *, int64_t *outTime);
extern "C" void Initialize__Q3_2nn2sl9ConditionFRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl22IUpdatePackageAccessorRQ3_2nn2sl20ISerializer__tm__2_LRQ3_2nn2sl13ITimeAccessor(ConditionInternal *,
extern "C" ConditionInternal *
__ct__Q3_2nn2sl9ConditionFv(ConditionInternal *);
extern "C" nn::Result
GetEnability__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
extern "C" nn::Result
StoreCurrentTimeAsPreviousSendingTime__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
extern "C" nn::Result
NeedsUpdate__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
extern "C" nn::Result
GetPreviousSendingTime__Q3_2nn2sl9ConditionCFPL(ConditionInternal *, int64_t *outTime);
extern "C" void
Initialize__Q3_2nn2sl9ConditionFRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl22IUpdatePackageAccessorRQ3_2nn2sl20ISerializer__tm__2_LRQ3_2nn2sl13ITimeAccessor(ConditionInternal *,
ISettingAccessorInternal *,
IUpdatePackageAccessorInternal *,
ISerializerInternal *,
ITimeAccessorInternal *);
} // namespace details
} // namespace details
class Condition {
public:
Condition() : mSettingAccessor(nullptr),
class Condition
{
public:
Condition() :
mSettingAccessor(nullptr),
mUpdatePackageAccessor(nullptr),
mPreviousSendingTimeSerializer(nullptr),
mTimeAccessor(nullptr) {
mTimeAccessor(nullptr)
{
if (__ct__Q3_2nn2sl9ConditionFv(&mInstance) != nullptr) {
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingAccessor);
mUpdatePackageAccessor = details::UpdatePackageAccessorFromPtr(mInstance.updatePackageAccessor);
@ -54,42 +66,60 @@ namespace nn::sl {
~Condition() = default;
[[nodiscard]] details::ISettingAccessorBase &GetSettingAccessor() {
[[nodiscard]] details::ISettingAccessorBase &
GetSettingAccessor()
{
return mSettingAccessor;
}
[[nodiscard]] details::IUpdatePackageAccessorBase &GetUpdatePackageAccessor() {
[[nodiscard]] details::IUpdatePackageAccessorBase &
GetUpdatePackageAccessor()
{
return mUpdatePackageAccessor;
}
[[nodiscard]] details::ISerializerBase<OSTime> &GetPreviousSendingTimeSerializer() {
[[nodiscard]] details::ISerializerBase<OSTime> &
GetPreviousSendingTimeSerializer()
{
return mPreviousSendingTimeSerializer;
}
[[nodiscard]] details::ITimeAccessorBase &GetTimeAccessor() {
[[nodiscard]] details::ITimeAccessorBase &
GetTimeAccessor()
{
return mTimeAccessor;
}
nn::Result GetEnability() {
nn::Result
GetEnability()
{
return GetEnability__Q3_2nn2sl9ConditionCFv(&mInstance);
}
nn::Result NeedsUpdate() {
nn::Result
NeedsUpdate()
{
return NeedsUpdate__Q3_2nn2sl9ConditionCFv(&mInstance);
}
nn::Result StoreCurrentTimeAsPreviousSendingTime() {
nn::Result
StoreCurrentTimeAsPreviousSendingTime()
{
return StoreCurrentTimeAsPreviousSendingTime__Q3_2nn2sl9ConditionCFv(&mInstance);
}
nn::Result GetPreviousSendingTime(int64_t *outTime) {
nn::Result
GetPreviousSendingTime(int64_t *outTime)
{
return GetPreviousSendingTime__Q3_2nn2sl9ConditionCFPL(&mInstance, outTime);
}
void Initialize(details::ISettingAccessorBase &settingAccessor,
void
Initialize(details::ISettingAccessorBase &settingAccessor,
details::IUpdatePackageAccessorBase &updatePackageAccessor,
details::ISerializerBase<OSTime> &previousSendingTimeSerializer,
details::ITimeAccessorBase &timeAccessor) {
details::ITimeAccessorBase &timeAccessor)
{
Initialize__Q3_2nn2sl9ConditionFRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl22IUpdatePackageAccessorRQ3_2nn2sl20ISerializer__tm__2_LRQ3_2nn2sl13ITimeAccessor(
&mInstance,
settingAccessor.GetInternal(),
@ -102,13 +132,13 @@ namespace nn::sl {
mTimeAccessor = details::TimeAccessorFromPtr(timeAccessor.GetInternal());
}
private:
private:
details::ConditionInternal mInstance = {};
details::SettingAccessorFromPtr mSettingAccessor;
details::UpdatePackageAccessorFromPtr mUpdatePackageAccessor;
details::SerializerFromPtr<OSTime> mPreviousSendingTimeSerializer;
details::TimeAccessorFromPtr mTimeAccessor;
};
};
} // namespace nn::sl

View File

@ -1,5 +1,6 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/IIconInfoAccessor.h>
#include <nn/sl/ISettingAccessor.h>
@ -8,40 +9,58 @@
#include <nn/sl/LaunchInfoDatabase.h>
#include <nn/sl/details/IAccountInfoAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn ::sl {
namespace details {
typedef struct WUT_PACKED DataCreatorInternal {
namespace nn ::sl
{
namespace details
{
typedef struct WUT_PACKED DataCreatorInternal
{
IIconInfoAccessorInternal *iconInfoAccessor;
IAccountInfoAccessorInternal *accountInfoAccessor;
ISettingAccessorInternal *settingInfoAccessor;
ITitleIconCacheInternal *titleIconCache;
void *vtable;
} DataCreatorInternal;
WUT_CHECK_SIZE(DataCreatorInternal, 0x14);
WUT_CHECK_OFFSET(DataCreatorInternal, 0x00, iconInfoAccessor);
WUT_CHECK_OFFSET(DataCreatorInternal, 0x04, accountInfoAccessor);
WUT_CHECK_OFFSET(DataCreatorInternal, 0x08, settingInfoAccessor);
WUT_CHECK_OFFSET(DataCreatorInternal, 0x0c, titleIconCache);
WUT_CHECK_OFFSET(DataCreatorInternal, 0x10, vtable);
} DataCreatorInternal;
WUT_CHECK_SIZE(DataCreatorInternal, 0x14);
WUT_CHECK_OFFSET(DataCreatorInternal, 0x00, iconInfoAccessor);
WUT_CHECK_OFFSET(DataCreatorInternal, 0x04, accountInfoAccessor);
WUT_CHECK_OFFSET(DataCreatorInternal, 0x08, settingInfoAccessor);
WUT_CHECK_OFFSET(DataCreatorInternal, 0x0c, titleIconCache);
WUT_CHECK_OFFSET(DataCreatorInternal, 0x10, vtable);
extern "C" DataCreatorInternal *__ct__Q3_2nn2sl11DataCreatorFv(DataCreatorInternal *);
extern "C" nn::Result Create__Q3_2nn2sl11DataCreatorFPQ3_2nn2sl16TransferableInfoPCQ3_2nn2sl9TitleInfoiRCQ3_2nn2sl18KillerNotificationRCQ3_2nn2sl9TitleInfoRQ3_2nn2sl18LaunchInfoDatabase(
DataCreatorInternal *, TransferableInfo *, const TitleInfo *, int, const KillerNotification &, const TitleInfo &, LaunchInfoDatabase &);
extern "C" nn::Result Initialize__Q3_2nn2sl11DataCreatorFRQ3_2nn2sl17IIconInfoAccessorRQ3_2nn2sl20IAccountInfoAccessorRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl15ITitleIconCache(
DataCreatorInternal *, IIconInfoAccessorInternal *, IAccountInfoAccessorInternal *, ISettingAccessorInternal *, ITitleIconCacheInternal *);
} // namespace details
extern "C" DataCreatorInternal *
__ct__Q3_2nn2sl11DataCreatorFv(DataCreatorInternal *);
extern "C" nn::Result
Create__Q3_2nn2sl11DataCreatorFPQ3_2nn2sl16TransferableInfoPCQ3_2nn2sl9TitleInfoiRCQ3_2nn2sl18KillerNotificationRCQ3_2nn2sl9TitleInfoRQ3_2nn2sl18LaunchInfoDatabase(
DataCreatorInternal *,
TransferableInfo *,
const TitleInfo *,
int,
const KillerNotification &,
const TitleInfo &,
LaunchInfoDatabase &);
extern "C" nn::Result
Initialize__Q3_2nn2sl11DataCreatorFRQ3_2nn2sl17IIconInfoAccessorRQ3_2nn2sl20IAccountInfoAccessorRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl15ITitleIconCache(
DataCreatorInternal *,
IIconInfoAccessorInternal *,
IAccountInfoAccessorInternal *,
ISettingAccessorInternal *,
ITitleIconCacheInternal *);
} // namespace details
class DataCreator {
public:
DataCreator() : mIconInfoAccessor(nullptr),
class DataCreator
{
public:
DataCreator() :
mIconInfoAccessor(nullptr),
mAccountInfoAccessor(nullptr),
mSettingAccessor(nullptr),
mTitleIconCache(nullptr) {
mTitleIconCache(nullptr)
{
if (__ct__Q3_2nn2sl11DataCreatorFv(&mInstance) != nullptr) {
mIconInfoAccessor = details::IconInfoAccessorFromPtr(mInstance.iconInfoAccessor);
mAccountInfoAccessor = details::AccountInfoAccessorFromPtr(mInstance.accountInfoAccessor);
@ -50,33 +69,45 @@ namespace nn ::sl {
}
}
[[nodiscard]] details::IIconInfoAccessorBase &getIconInfoAccessor() {
[[nodiscard]] details::IIconInfoAccessorBase &
getIconInfoAccessor()
{
return mIconInfoAccessor;
}
[[nodiscard]] details::IAccountInfoAccessorBase &getAccountInfoAccessor() {
[[nodiscard]] details::IAccountInfoAccessorBase &
getAccountInfoAccessor()
{
return mAccountInfoAccessor;
}
[[nodiscard]] details::ISettingAccessorBase &getSettingAccessor() {
[[nodiscard]] details::ISettingAccessorBase &
getSettingAccessor()
{
return mSettingAccessor;
}
[[nodiscard]] details::ITitleIconCacheBase &getTitleIconCache() {
[[nodiscard]] details::ITitleIconCacheBase &
getTitleIconCache()
{
return mTitleIconCache;
}
nn::Result Create(TransferableInfo *outTransferableInfo,
nn::Result
Create(TransferableInfo *outTransferableInfo,
const TitleInfo *quickstartTitleInfos,
int numQuickstartTitleInfos,
const KillerNotification &killerNotification,
const TitleInfo &killerNotificationTitleInfo,
LaunchInfoDatabase &launchInfoDatabase) {
LaunchInfoDatabase &launchInfoDatabase)
{
return details::Create__Q3_2nn2sl11DataCreatorFPQ3_2nn2sl16TransferableInfoPCQ3_2nn2sl9TitleInfoiRCQ3_2nn2sl18KillerNotificationRCQ3_2nn2sl9TitleInfoRQ3_2nn2sl18LaunchInfoDatabase(
&mInstance, outTransferableInfo, quickstartTitleInfos, numQuickstartTitleInfos, killerNotification, killerNotificationTitleInfo, launchInfoDatabase);
}
void Initialize(details::IIconInfoAccessorBase &iconInfoAccessor, details::IAccountInfoAccessorBase &accountInfoAccessor, details::ISettingAccessorBase &settingAccessor, details::ITitleIconCacheBase &titleIconCache) {
void
Initialize(details::IIconInfoAccessorBase &iconInfoAccessor, details::IAccountInfoAccessorBase &accountInfoAccessor, details::ISettingAccessorBase &settingAccessor, details::ITitleIconCacheBase &titleIconCache)
{
details::Initialize__Q3_2nn2sl11DataCreatorFRQ3_2nn2sl17IIconInfoAccessorRQ3_2nn2sl20IAccountInfoAccessorRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl15ITitleIconCache(
&mInstance, iconInfoAccessor.GetInternal(), accountInfoAccessor.GetInternal(), settingAccessor.GetInternal(), titleIconCache.GetInternal());
mIconInfoAccessor = details::IconInfoAccessorFromPtr(mInstance.iconInfoAccessor);
@ -87,13 +118,13 @@ namespace nn ::sl {
~DataCreator() = default;
private:
private:
details::DataCreatorInternal mInstance = {};
details::IconInfoAccessorFromPtr mIconInfoAccessor;
details::AccountInfoAccessorFromPtr mAccountInfoAccessor;
details::SettingAccessorFromPtr mSettingAccessor;
details::TitleIconCacheFromPtr mTitleIconCache;
};
};
}; // namespace nn::sl
#endif

View File

@ -1,43 +1,57 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/ISettingAccessor.h>
#include <nn/sl/ITimeAccessor.h>
#include <nn/sl/ITransferrer.h>
#include <nn/sl/KillerNotification.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace nn::sl
{
namespace details {
typedef struct WUT_PACKED DrcManagerInternal {
namespace details
{
typedef struct WUT_PACKED DrcManagerInternal
{
ITransferrerInternal *drcTransferrer;
ISettingAccessorInternal *settingsAccessor;
ITimeAccessorInternal *timeAccessor;
void *vtable;
} DrcManagerInternal;
WUT_CHECK_SIZE(DrcManagerInternal, 0x10);
WUT_CHECK_OFFSET(DrcManagerInternal, 0x00, drcTransferrer);
WUT_CHECK_OFFSET(DrcManagerInternal, 0x04, settingsAccessor);
WUT_CHECK_OFFSET(DrcManagerInternal, 0x08, timeAccessor);
WUT_CHECK_OFFSET(DrcManagerInternal, 0x0C, vtable);
} DrcManagerInternal;
WUT_CHECK_SIZE(DrcManagerInternal, 0x10);
WUT_CHECK_OFFSET(DrcManagerInternal, 0x00, drcTransferrer);
WUT_CHECK_OFFSET(DrcManagerInternal, 0x04, settingsAccessor);
WUT_CHECK_OFFSET(DrcManagerInternal, 0x08, timeAccessor);
WUT_CHECK_OFFSET(DrcManagerInternal, 0x0C, vtable);
extern "C" DrcManagerInternal *__ct__Q3_2nn2sl10DrcManagerFv(DrcManagerInternal *);
extern "C" nn::Result CancelTransfer__Q3_2nn2sl10DrcManagerFv(DrcManagerInternal *);
extern "C" nn::Result PushNotification__Q3_2nn2sl10DrcManagerFPbPCQ3_2nn2sl18KillerNotificationbT3L(DrcManagerInternal *, bool *, const KillerNotification *, bool, bool, uint64_t);
extern "C" nn::Result Transfer__Q3_2nn2sl10DrcManagerFRCQ3_2nn2sl16TransferableInfobQ4_2nn2sl12ITransferrer12TransferMode(DrcManagerInternal *, TransferableInfo *, bool, TransferMode);
extern "C" DrcManagerInternal *
__ct__Q3_2nn2sl10DrcManagerFv(DrcManagerInternal *);
extern "C" nn::Result
CancelTransfer__Q3_2nn2sl10DrcManagerFv(DrcManagerInternal *);
extern "C" nn::Result
PushNotification__Q3_2nn2sl10DrcManagerFPbPCQ3_2nn2sl18KillerNotificationbT3L(DrcManagerInternal *, bool *, const KillerNotification *, bool, bool, uint64_t);
extern "C" nn::Result
Transfer__Q3_2nn2sl10DrcManagerFRCQ3_2nn2sl16TransferableInfobQ4_2nn2sl12ITransferrer12TransferMode(DrcManagerInternal *, TransferableInfo *, bool, TransferMode);
extern "C" nn::Result Initialize__Q3_2nn2sl10DrcManagerFRQ3_2nn2sl12ITransferrerRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl13ITimeAccessor(
DrcManagerInternal *, ITransferrerInternal *, ISettingAccessorInternal *, ITimeAccessorInternal *);
} // namespace details
class DrcManager {
public:
DrcManager() : mTransferrer(nullptr),
extern "C" nn::Result
Initialize__Q3_2nn2sl10DrcManagerFRQ3_2nn2sl12ITransferrerRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl13ITimeAccessor(
DrcManagerInternal *,
ITransferrerInternal *,
ISettingAccessorInternal *,
ITimeAccessorInternal *);
} // namespace details
class DrcManager
{
public:
DrcManager() :
mTransferrer(nullptr),
mSettingAccessor(nullptr),
mTimeAccessor(nullptr) {
mTimeAccessor(nullptr)
{
if (__ct__Q3_2nn2sl10DrcManagerFv(&mInstance) != nullptr) {
mTransferrer = details::TransferrerFromPtr(mInstance.drcTransferrer);
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingsAccessor);
@ -47,31 +61,45 @@ namespace nn::sl {
~DrcManager() = default;
details::ITransferrerBase &GetTransferrer() {
details::ITransferrerBase &
GetTransferrer()
{
return mTransferrer;
}
details::ISettingAccessorBase &GetSettingAccessor() {
details::ISettingAccessorBase &
GetSettingAccessor()
{
return mSettingAccessor;
}
details::ITimeAccessorBase &GetTimeAccessor() {
details::ITimeAccessorBase &
GetTimeAccessor()
{
return mTimeAccessor;
}
nn::Result CancelTransfer() {
nn::Result
CancelTransfer()
{
return CancelTransfer__Q3_2nn2sl10DrcManagerFv(&mInstance);
}
nn::Result PushNotification(bool *u1, const KillerNotification *u2, bool u3, bool u4, uint64_t u5) {
nn::Result
PushNotification(bool *u1, const KillerNotification *u2, bool u3, bool u4, uint64_t u5)
{
return PushNotification__Q3_2nn2sl10DrcManagerFPbPCQ3_2nn2sl18KillerNotificationbT3L(&mInstance, u1, u2, u3, u4, u5);
}
nn::Result Transfer(TransferableInfo *u1, bool u2, TransferMode u3) {
nn::Result
Transfer(TransferableInfo *u1, bool u2, TransferMode u3)
{
return Transfer__Q3_2nn2sl10DrcManagerFRCQ3_2nn2sl16TransferableInfobQ4_2nn2sl12ITransferrer12TransferMode(&mInstance, u1, u2, u3);
}
void Initialize(details::ITransferrerBase &transferrer, details::ISettingAccessorBase &settingAccessor, details::ITimeAccessorBase &timeAccessor) {
void
Initialize(details::ITransferrerBase &transferrer, details::ISettingAccessorBase &settingAccessor, details::ITimeAccessorBase &timeAccessor)
{
Initialize__Q3_2nn2sl10DrcManagerFRQ3_2nn2sl12ITransferrerRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl13ITimeAccessor(
&mInstance,
transferrer.GetInternal(),
@ -79,13 +107,13 @@ namespace nn::sl {
timeAccessor.GetInternal());
}
private:
private:
details::DrcManagerInternal mInstance = {};
details::TransferrerFromPtr mTransferrer;
details::SettingAccessorFromPtr mSettingAccessor;
details::TimeAccessorFromPtr mTimeAccessor;
};
};
} // namespace nn::sl
#endif

View File

@ -1,55 +1,72 @@
#pragma once
#include <wut.h>
#include <coreinit/filesystem.h>
#include <nn/result.h>
#include <nn/sl/IStream.h>
#include <nn/sl/details/IStreamDetails.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace details {
typedef struct WUT_PACKED FileStreamInternal {
namespace nn::sl
{
namespace details
{
typedef struct WUT_PACKED FileStreamInternal
{
void *vtable;
FSClient *fsClient;
FSCmdBlock *fsCmdBlock;
FSFileHandle fileHandle;
} FileStreamInternal;
WUT_CHECK_SIZE(FileStreamInternal, 0x10);
WUT_CHECK_OFFSET(FileStreamInternal, 0x00, vtable);
WUT_CHECK_OFFSET(FileStreamInternal, 0x04, fsClient);
WUT_CHECK_OFFSET(FileStreamInternal, 0x08, fsCmdBlock);
WUT_CHECK_OFFSET(FileStreamInternal, 0x0C, fileHandle);
} FileStreamInternal;
WUT_CHECK_SIZE(FileStreamInternal, 0x10);
WUT_CHECK_OFFSET(FileStreamInternal, 0x00, vtable);
WUT_CHECK_OFFSET(FileStreamInternal, 0x04, fsClient);
WUT_CHECK_OFFSET(FileStreamInternal, 0x08, fsCmdBlock);
WUT_CHECK_OFFSET(FileStreamInternal, 0x0C, fileHandle);
extern "C" nn::Result Initialize__Q3_2nn2sl10FileStreamFP8FSClientP10FSCmdBlockPCcT3(FileStreamInternal *, FSClient *, FSCmdBlock *, char const *, char const *);
extern "C" FileStreamInternal *__ct__Q3_2nn2sl10FileStreamFv(FileStreamInternal *);
extern "C" void __dt__Q3_2nn2sl10FileStreamFv(FileStreamInternal *, int);
} // namespace details
extern "C" nn::Result
Initialize__Q3_2nn2sl10FileStreamFP8FSClientP10FSCmdBlockPCcT3(FileStreamInternal *, FSClient *, FSCmdBlock *, char const *, char const *);
extern "C" FileStreamInternal *
__ct__Q3_2nn2sl10FileStreamFv(FileStreamInternal *);
extern "C" void
__dt__Q3_2nn2sl10FileStreamFv(FileStreamInternal *, int);
} // namespace details
class FileStream : public details::IStreamBase {
public:
FileStream() {
class FileStream : public details::IStreamBase
{
public:
FileStream()
{
__ct__Q3_2nn2sl10FileStreamFv(&mInstance);
}
~FileStream() override {
~FileStream() override
{
__dt__Q3_2nn2sl10FileStreamFv(&mInstance, 2);
}
nn::Result Read(uint32_t *bytesRead, void *buffer, uint32_t readSize) override {
nn::Result
Read(uint32_t *bytesRead, void *buffer, uint32_t readSize) override
{
auto *base = reinterpret_cast<details::IStreamInternal *>(&mInstance);
return base->vtable->ReadFn(base, bytesRead, buffer, readSize);
}
nn::Result Write(uint32_t *bytesWritten, void *buffer, uint32_t readSize) override {
nn::Result
Write(uint32_t *bytesWritten, void *buffer, uint32_t readSize) override
{
auto *base = reinterpret_cast<details::IStreamInternal *>(&mInstance);
return base->vtable->WriteFn(base, bytesWritten, buffer, readSize);
}
nn::Result GetSize(uint32_t *fileSize) override {
nn::Result
GetSize(uint32_t *fileSize) override
{
auto *base = reinterpret_cast<details::IStreamInternal *>(&mInstance);
return base->vtable->GetSizeFn(base, fileSize);
}
nn::Result Seek(int32_t offset, nn::sl::SeekOrigin seekOrigin) override {
nn::Result
Seek(int32_t offset, nn::sl::SeekOrigin seekOrigin) override
{
auto *base = reinterpret_cast<details::IStreamInternal *>(&mInstance);
return base->vtable->SeekFn(base, offset, seekOrigin);
}
@ -57,17 +74,21 @@ namespace nn::sl {
/**
* The given client and cmd must be valid during the whole liftime of the filestream
*/
nn::Result Initialize(FSClient *client, FSCmdBlock *cmdBlock, char const *path, char const *mode) {
nn::Result
Initialize(FSClient *client, FSCmdBlock *cmdBlock, char const *path, char const *mode)
{
return Initialize__Q3_2nn2sl10FileStreamFP8FSClientP10FSCmdBlockPCcT3(&mInstance, client, cmdBlock, path, mode);
}
details::IStreamInternal *GetInternal() override {
details::IStreamInternal *
GetInternal() override
{
return reinterpret_cast<details::IStreamInternal *>(&mInstance);
}
private:
private:
details::FileStreamInternal mInstance = {};
};
};
}; // namespace nn::sl

View File

@ -1,45 +1,59 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IAccountInfoAccessorDetails.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
class IAccountInfoAccessor : public details::IAccountInfoAccessorBase {
namespace nn::sl
{
class IAccountInfoAccessor : public details::IAccountInfoAccessorBase
{
public:
IAccountInfoAccessor() {
public:
IAccountInfoAccessor()
{
InitInternalVtable();
}
IAccountInfoAccessor(IAccountInfoAccessor &src) {
IAccountInfoAccessor(IAccountInfoAccessor &src)
{
InitInternalVtable();
}
IAccountInfoAccessor &operator=(const IAccountInfoAccessor &other) {
IAccountInfoAccessor &
operator=(const IAccountInfoAccessor &other)
{
InitInternalVtable();
return *this;
}
IAccountInfoAccessor &operator=(IAccountInfoAccessor &&src) noexcept {
IAccountInfoAccessor &
operator=(IAccountInfoAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~IAccountInfoAccessor() override = default;
private:
static nn::Result GetWrapper(details::IAccountInfoAccessorInternal *instance, AccountInfo *outAccountInfo) {
private:
static nn::Result
GetWrapper(details::IAccountInfoAccessorInternal *instance, AccountInfo *outAccountInfo)
{
return instance->vtable->instance->Get(outAccountInfo);
}
details::IAccountInfoAccessorInternal *GetInternal() override {
details::IAccountInfoAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetFn = &GetWrapper};
mInstance.vtable = &mVTable;
@ -47,9 +61,10 @@ namespace nn::sl {
details::IAccountInfoAccessorInternal mInstance{};
details::IAccountInfoAccessorInternalVTable mVTable{};
};
};
details::IAccountInfoAccessorBase &GetDefaultAccountInfoAccessor();
details::IAccountInfoAccessorBase &
GetDefaultAccountInfoAccessor();
} // namespace nn::sl
#endif

View File

@ -1,48 +1,62 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IBlackListAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace nn::sl
{
class IBlackListAccessor : public details::IBlackListAccessorBase {
class IBlackListAccessor : public details::IBlackListAccessorBase
{
public:
IBlackListAccessor() {
public:
IBlackListAccessor()
{
InitInternalVtable();
}
IBlackListAccessor(IBlackListAccessor &src) {
IBlackListAccessor(IBlackListAccessor &src)
{
InitInternalVtable();
}
IBlackListAccessor &operator=(const IBlackListAccessor &other) {
IBlackListAccessor &
operator=(const IBlackListAccessor &other)
{
InitInternalVtable();
return *this;
}
IBlackListAccessor &operator=(IBlackListAccessor &&src) noexcept {
IBlackListAccessor &
operator=(IBlackListAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~IBlackListAccessor() override = default;
private:
static nn::Result GetWrapper(details::IBlackListAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) {
private:
static nn::Result
GetWrapper(details::IBlackListAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos)
{
return instance->vtable->instance->Get(outTitleInfos, outTitleInfosSize, maxTitleInfos);
}
details::IBlackListAccessorInternal *GetInternal() override {
details::IBlackListAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetFn = &GetWrapper};
mInstance.vtable = &mVTable;
@ -50,9 +64,10 @@ namespace nn::sl {
details::IBlackListAccessorInternal mInstance{};
details::IBlackListAccessorInternalVTable mVTable{};
};
};
details::IBlackListAccessorBase &GetDefaultBlackListAccessor();
details::IBlackListAccessorBase &
GetDefaultBlackListAccessor();
} // namespace nn::sl
#endif

View File

@ -1,47 +1,61 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IDefaultTitleAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace nn::sl
{
class IDefaultTitleAccessor : public details::IDefaultTitleAccessorBase {
class IDefaultTitleAccessor : public details::IDefaultTitleAccessorBase
{
public:
IDefaultTitleAccessor() {
public:
IDefaultTitleAccessor()
{
InitInternalVtable();
}
IDefaultTitleAccessor(IDefaultTitleAccessor &src) {
IDefaultTitleAccessor(IDefaultTitleAccessor &src)
{
InitInternalVtable();
}
IDefaultTitleAccessor &operator=(const IDefaultTitleAccessor &other) {
IDefaultTitleAccessor &
operator=(const IDefaultTitleAccessor &other)
{
InitInternalVtable();
return *this;
}
IDefaultTitleAccessor &operator=(IDefaultTitleAccessor &&src) noexcept {
IDefaultTitleAccessor &
operator=(IDefaultTitleAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~IDefaultTitleAccessor() override = default;
private:
static nn::Result GetWrapper(details::IDefaultTitleAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) {
private:
static nn::Result
GetWrapper(details::IDefaultTitleAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos)
{
return instance->vtable->instance->Get(outTitleInfos, outTitleInfosSize, maxTitleInfos);
}
details::IDefaultTitleAccessorInternal *GetInternal() override {
details::IDefaultTitleAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetFn = &GetWrapper};
mInstance.vtable = &mVTable;
@ -49,9 +63,10 @@ namespace nn::sl {
details::IDefaultTitleAccessorInternal mInstance{};
details::IDefaultTitleAccessorInternalVTable mVTable{};
};
};
details::IDefaultTitleAccessorBase &GetDefaultDefaultTitleAccessor();
details::IDefaultTitleAccessorBase &
GetDefaultDefaultTitleAccessor();
} // namespace nn::sl
#endif

View File

@ -1,47 +1,61 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IDiscCachedTitleAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace nn::sl
{
class DiscCachedTitleAccessor : public details::IDiscCachedTitleAccessorBase {
class DiscCachedTitleAccessor : public details::IDiscCachedTitleAccessorBase
{
public:
DiscCachedTitleAccessor() {
public:
DiscCachedTitleAccessor()
{
InitInternalVtable();
}
DiscCachedTitleAccessor(DiscCachedTitleAccessor &src) {
DiscCachedTitleAccessor(DiscCachedTitleAccessor &src)
{
InitInternalVtable();
}
DiscCachedTitleAccessor &operator=(const DiscCachedTitleAccessor &other) {
DiscCachedTitleAccessor &
operator=(const DiscCachedTitleAccessor &other)
{
InitInternalVtable();
return *this;
}
DiscCachedTitleAccessor &operator=(DiscCachedTitleAccessor &&src) noexcept {
DiscCachedTitleAccessor &
operator=(DiscCachedTitleAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~DiscCachedTitleAccessor() override = default;
private:
static nn::Result GetWrapper(details::IDiscCachedTitleAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) {
private:
static nn::Result
GetWrapper(details::IDiscCachedTitleAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos)
{
return instance->vtable->instance->Get(outTitleInfos, outTitleInfosSize, maxTitleInfos);
}
details::IDiscCachedTitleAccessorInternal *GetInternal() override {
details::IDiscCachedTitleAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetFn = &GetWrapper};
mInstance.vtable = &mVTable;
@ -49,9 +63,10 @@ namespace nn::sl {
details::IDiscCachedTitleAccessorInternal mInstance{};
details::IDiscCachedTitleAccessorInternalVTable mVTable{};
};
};
details::IDiscCachedTitleAccessorBase &GetDefaultDiscCachedTitleAccessor();
details::IDiscCachedTitleAccessorBase &
GetDefaultDiscCachedTitleAccessor();
} // namespace nn::sl
#endif

View File

@ -1,49 +1,65 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IIconInfoAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
class IIconInfoAccessor : public details::IIconInfoAccessorBase {
namespace nn::sl
{
class IIconInfoAccessor : public details::IIconInfoAccessorBase
{
public:
IIconInfoAccessor() {
public:
IIconInfoAccessor()
{
InitInternalVtable();
}
IIconInfoAccessor(IIconInfoAccessor &src) {
IIconInfoAccessor(IIconInfoAccessor &src)
{
InitInternalVtable();
}
IIconInfoAccessor &operator=(const IIconInfoAccessor &other) {
IIconInfoAccessor &
operator=(const IIconInfoAccessor &other)
{
InitInternalVtable();
return *this;
}
IIconInfoAccessor &operator=(IIconInfoAccessor &&src) noexcept {
IIconInfoAccessor &
operator=(IIconInfoAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~IIconInfoAccessor() override = default;
private:
static nn::Result GetTitleIconInfoWrapper(details::IIconInfoAccessorInternal *instance, nn::sl::IconInfo *outIconInfo, const nn::sl::TitleInfo &titleInfo, nn::sl::Language language) {
private:
static nn::Result
GetTitleIconInfoWrapper(details::IIconInfoAccessorInternal *instance, nn::sl::IconInfo *outIconInfo, const nn::sl::TitleInfo &titleInfo, nn::sl::Language language)
{
return instance->vtable->instance->GetTitleIconInfo(outIconInfo, titleInfo, language);
}
static nn::Result GetMiiIconWrapper(details::IIconInfoAccessorInternal *instance, void *buffer, uint32_t buffer_size, uint32_t slot) {
static nn::Result
GetMiiIconWrapper(details::IIconInfoAccessorInternal *instance, void *buffer, uint32_t buffer_size, uint32_t slot)
{
return instance->vtable->instance->GetMiiIcon(buffer, buffer_size, slot);
}
details::IIconInfoAccessorInternal *GetInternal() override {
details::IIconInfoAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetTitleIconInfoFn = GetTitleIconInfoWrapper,
.GetMiiIconFn = GetMiiIconWrapper};
@ -52,9 +68,10 @@ namespace nn::sl {
details::IIconInfoAccessorInternal mInstance{};
details::IIconInfoAccessorInternalVTable mVTable{};
};
};
details::IIconInfoAccessorBase &GetDefaultIconInfoAccessor();
details::IIconInfoAccessorBase &
GetDefaultIconInfoAccessor();
} // namespace nn::sl
#endif

View File

@ -1,47 +1,61 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IInstalledTitleListAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
class IInstalledTitleListAccessor : public details::IInstalledTitleListAccessorBase {
namespace nn::sl
{
class IInstalledTitleListAccessor : public details::IInstalledTitleListAccessorBase
{
public:
IInstalledTitleListAccessor() {
public:
IInstalledTitleListAccessor()
{
InitInternalVtable();
}
IInstalledTitleListAccessor(IInstalledTitleListAccessor &src) {
IInstalledTitleListAccessor(IInstalledTitleListAccessor &src)
{
InitInternalVtable();
}
IInstalledTitleListAccessor &operator=(const IInstalledTitleListAccessor &other) {
IInstalledTitleListAccessor &
operator=(const IInstalledTitleListAccessor &other)
{
InitInternalVtable();
return *this;
}
IInstalledTitleListAccessor &operator=(IInstalledTitleListAccessor &&src) noexcept {
IInstalledTitleListAccessor &
operator=(IInstalledTitleListAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~IInstalledTitleListAccessor() override = default;
private:
static nn::Result GetWrapper(details::IInstalledTitleListAccessorInternal *instance, nn::sl::TitleInfo *outInstalledTitleInfos, int *outInstalledTitleInfosSize, int maxInstalledTitleInfos) {
private:
static nn::Result
GetWrapper(details::IInstalledTitleListAccessorInternal *instance, nn::sl::TitleInfo *outInstalledTitleInfos, int *outInstalledTitleInfosSize, int maxInstalledTitleInfos)
{
return instance->vtable->instance->Get(outInstalledTitleInfos, outInstalledTitleInfosSize, maxInstalledTitleInfos);
}
details::IInstalledTitleListAccessorInternal *GetInternal() override {
details::IInstalledTitleListAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetFn = &GetWrapper};
mInstance.vtable = &mVTable;
@ -49,9 +63,10 @@ namespace nn::sl {
details::IInstalledTitleListAccessorInternal mInstance{};
details::IInstalledTitleListAccessorInternalVTable mVTable{};
};
};
details::IInstalledTitleListAccessorBase &GetDefaultInstalledTitleListAccessor();
details::IInstalledTitleListAccessorBase &
GetDefaultInstalledTitleListAccessor();
} // namespace nn::sl
#endif

View File

@ -1,46 +1,60 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IKillerNotificationAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
class IKillerNotificationAccessor : public details::IKillerNotificationAccessorBase {
namespace nn::sl
{
class IKillerNotificationAccessor : public details::IKillerNotificationAccessorBase
{
public:
IKillerNotificationAccessor() {
public:
IKillerNotificationAccessor()
{
InitInternalVtable();
}
IKillerNotificationAccessor(IKillerNotificationAccessor &src) {
IKillerNotificationAccessor(IKillerNotificationAccessor &src)
{
InitInternalVtable();
}
IKillerNotificationAccessor &operator=(const IKillerNotificationAccessor &other) {
IKillerNotificationAccessor &
operator=(const IKillerNotificationAccessor &other)
{
InitInternalVtable();
return *this;
}
IKillerNotificationAccessor &operator=(IKillerNotificationAccessor &&src) noexcept {
IKillerNotificationAccessor &
operator=(IKillerNotificationAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~IKillerNotificationAccessor() override = default;
private:
static nn::Result GetWrapper(details::IKillerNotificationAccessorInternal *instance, KillerNotification *outBuffer, int *outNum, int outBufferNum) {
private:
static nn::Result
GetWrapper(details::IKillerNotificationAccessorInternal *instance, KillerNotification *outBuffer, int *outNum, int outBufferNum)
{
return instance->vtable->instance->Get(outBuffer, outNum, outBufferNum);
}
details::IKillerNotificationAccessorInternal *GetInternal() override {
details::IKillerNotificationAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetFn = &GetWrapper};
mInstance.vtable = &mVTable;
@ -48,9 +62,10 @@ namespace nn::sl {
details::IKillerNotificationAccessorInternal mInstance{};
details::IKillerNotificationAccessorInternalVTable mVTable{};
};
};
details::IKillerNotificationAccessorBase &GetDefaultKillerNotificationAccessor();
details::IKillerNotificationAccessorBase &
GetDefaultKillerNotificationAccessor();
} // namespace nn::sl
#endif

View File

@ -1,45 +1,59 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/ILaunchedTitleListAccessoDetails.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
class ILaunchedTitleListAccessor : public details::ILaunchedTitleListAccessorBase {
namespace nn::sl
{
class ILaunchedTitleListAccessor : public details::ILaunchedTitleListAccessorBase
{
public:
ILaunchedTitleListAccessor() {
public:
ILaunchedTitleListAccessor()
{
InitInternalVtable();
}
ILaunchedTitleListAccessor(ILaunchedTitleListAccessor &src) {
ILaunchedTitleListAccessor(ILaunchedTitleListAccessor &src)
{
InitInternalVtable();
}
ILaunchedTitleListAccessor &operator=(const ILaunchedTitleListAccessor &other) {
ILaunchedTitleListAccessor &
operator=(const ILaunchedTitleListAccessor &other)
{
InitInternalVtable();
return *this;
}
ILaunchedTitleListAccessor &operator=(ILaunchedTitleListAccessor &&src) noexcept {
ILaunchedTitleListAccessor &
operator=(ILaunchedTitleListAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~ILaunchedTitleListAccessor() override = default;
private:
static nn::Result GetByAccountWrapper(details::ILaunchedTitleListAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfoSize, int inTitleInfosSize, int userId) {
private:
static nn::Result
GetByAccountWrapper(details::ILaunchedTitleListAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfoSize, int inTitleInfosSize, int userId)
{
return instance->vtable->instance->GetByAccount(outTitleInfos, outTitleInfoSize, inTitleInfosSize, userId);
}
details::ILaunchedTitleListAccessorInternal *GetInternal() override {
details::ILaunchedTitleListAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetByAccountFn = &GetByAccountWrapper};
mInstance.vtable = &mVTable;
@ -47,15 +61,18 @@ namespace nn::sl {
details::ILaunchedTitleListAccessorInternal mInstance{};
details::ILaunchedTitleListAccessorInternalVTable mVTable{};
};
};
enum LaunchedTitleListAccessorType {
enum LaunchedTitleListAccessorType
{
TITLE_LIST_ACCESSOR_LAUNCHED_TITLES = 0,
TITLE_LIST_ACCESSOR_PLAY_STATS = 1,
};
};
details::ILaunchedTitleListAccessorBase &GetDefaultLaunchedTitleListAccessor(LaunchedTitleListAccessorType type);
details::ILaunchedTitleListAccessorBase &GetDefaultLaunchedTitleListAccessor();
details::ILaunchedTitleListAccessorBase &
GetDefaultLaunchedTitleListAccessor(LaunchedTitleListAccessorType type);
details::ILaunchedTitleListAccessorBase &
GetDefaultLaunchedTitleListAccessor();
} // namespace nn::sl
#endif

View File

@ -1,48 +1,62 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IMetaInfoAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace nn::sl
{
class MetaInfoAccessor : public details::IMetaInfoAccessorBase {
class MetaInfoAccessor : public details::IMetaInfoAccessorBase
{
public:
MetaInfoAccessor() {
public:
MetaInfoAccessor()
{
InitInternalVtable();
}
MetaInfoAccessor(MetaInfoAccessor &src) {
MetaInfoAccessor(MetaInfoAccessor &src)
{
InitInternalVtable();
}
MetaInfoAccessor &operator=(const MetaInfoAccessor &other) {
MetaInfoAccessor &
operator=(const MetaInfoAccessor &other)
{
InitInternalVtable();
return *this;
}
MetaInfoAccessor &operator=(MetaInfoAccessor &&src) noexcept {
MetaInfoAccessor &
operator=(MetaInfoAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~MetaInfoAccessor() override = default;
private:
static nn::Result GetWrapper(details::IMetaInfoAccessorInternal *instance, nn::sl::TitleMetaInfo *outMetaInfo, const nn::sl::TitleInfo &titleInfo) {
private:
static nn::Result
GetWrapper(details::IMetaInfoAccessorInternal *instance, nn::sl::TitleMetaInfo *outMetaInfo, const nn::sl::TitleInfo &titleInfo)
{
return instance->vtable->instance->Get(outMetaInfo, titleInfo);
}
details::IMetaInfoAccessorInternal *GetInternal() override {
details::IMetaInfoAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetFn = &GetWrapper};
mInstance.vtable = &mVTable;
@ -50,9 +64,10 @@ namespace nn::sl {
details::IMetaInfoAccessorInternal mInstance{};
details::IMetaInfoAccessorInternalVTable mVTable{};
};
};
details::IMetaInfoAccessorBase &GetDefaultMetaInfoAccessor();
details::IMetaInfoAccessorBase &
GetDefaultMetaInfoAccessor();
} // namespace nn::sl
#endif

View File

@ -1,45 +1,59 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IPreferentialTitleAccessorDetails.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
class IPreferentialTitleAccessor : public details::IPreferentialTitleAccessorBase {
namespace nn::sl
{
class IPreferentialTitleAccessor : public details::IPreferentialTitleAccessorBase
{
public:
IPreferentialTitleAccessor() {
public:
IPreferentialTitleAccessor()
{
InitInternalVtable();
}
IPreferentialTitleAccessor(IPreferentialTitleAccessor &src) {
IPreferentialTitleAccessor(IPreferentialTitleAccessor &src)
{
InitInternalVtable();
}
IPreferentialTitleAccessor &operator=(const IPreferentialTitleAccessor &other) {
IPreferentialTitleAccessor &
operator=(const IPreferentialTitleAccessor &other)
{
InitInternalVtable();
return *this;
}
IPreferentialTitleAccessor &operator=(IPreferentialTitleAccessor &&src) noexcept {
IPreferentialTitleAccessor &
operator=(IPreferentialTitleAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~IPreferentialTitleAccessor() override = default;
private:
static nn::Result GetWrapper(details::IPreferentialTitleAccessorInternal *instance, TitleInfo *outTitleInfo, uint32_t *outTitleInfoSize, int maxTitleInfo, uint32_t u1) {
private:
static nn::Result
GetWrapper(details::IPreferentialTitleAccessorInternal *instance, TitleInfo *outTitleInfo, uint32_t *outTitleInfoSize, int maxTitleInfo, uint32_t u1)
{
return instance->vtable->instance->Get(outTitleInfo, outTitleInfoSize, maxTitleInfo, u1);
}
details::IPreferentialTitleAccessorInternal *GetInternal() override {
details::IPreferentialTitleAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetFn = &GetWrapper};
mInstance.vtable = &mVTable;
@ -47,9 +61,10 @@ namespace nn::sl {
details::IPreferentialTitleAccessorInternal mInstance{};
details::IPreferentialTitleAccessorInternalVTable mVTable{};
};
};
details::IPreferentialTitleAccessorBase &GetDefaultPreferentialTitleAccessor();
details::IPreferentialTitleAccessorBase &
GetDefaultPreferentialTitleAccessor();
} // namespace nn::sl
#endif

View File

@ -1,65 +1,87 @@
#pragma once
#include <wut.h>
#include <coreinit/time.h>
#include <nn/result.h>
#include <nn/sl/KillerNotification.h>
#include <nn/sl/details/ISerializerDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
template<typename T>
class ISerializer : public details::ISerializerBase<T> {
namespace nn::sl
{
template<typename T>
class ISerializer : public details::ISerializerBase<T>
{
public:
ISerializer() {
public:
ISerializer()
{
InitInternalVtable();
}
ISerializer(ISerializer &src) {
ISerializer(ISerializer &src)
{
InitInternalVtable();
}
ISerializer &operator=(const ISerializer &other) {
ISerializer &
operator=(const ISerializer &other)
{
InitInternalVtable();
return *this;
}
ISerializer &operator=(ISerializer &&src) noexcept {
ISerializer &
operator=(ISerializer &&src) noexcept
{
InitInternalVtable();
return *this;
}
nn::Result Serialize(T *buffer, uint32_t num) {
nn::Result
Serialize(T *buffer, uint32_t num)
{
return details::ISerializerBase<T>::Serialize(buffer, num * sizeof(buffer));
}
nn::Result Deserialize(T *buffer, uint32_t num) {
nn::Result
Deserialize(T *buffer, uint32_t num)
{
return details::ISerializerBase<T>::Deserialize(buffer, num * sizeof(buffer));
}
~ISerializer() override = default;
private:
static nn::Result SerializeWrapper(details::ISerializerInternal *instance, void *buffer, uint32_t size) {
private:
static nn::Result
SerializeWrapper(details::ISerializerInternal *instance, void *buffer, uint32_t size)
{
return details::ISerializerBase<T>::instance->vtable->instance->Serialize(buffer, size);
}
static nn::Result DeserializeWrapper(details::ISerializerInternal *instance, void *buffer, uint32_t size) {
static nn::Result
DeserializeWrapper(details::ISerializerInternal *instance, void *buffer, uint32_t size)
{
return details::ISerializerBase<T>::instance->vtable->instance->Deserialize(buffer, size);
}
static nn::Result GetCountWrapper(details::ISerializerInternal *instance, uint32_t *outCount) {
static nn::Result
GetCountWrapper(details::ISerializerInternal *instance, uint32_t *outCount)
{
return details::ISerializerBase<T>::instance->vtable->instance->GetCount(outCount);
}
details::ISerializerInternal *GetInternal() override {
details::ISerializerInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.SerializeFn = &SerializeWrapper,
.DeserializeFn = &DeserializeWrapper,
@ -69,17 +91,22 @@ namespace nn::sl {
details::ISerializerInternal mInstance{};
details::ISerializerInternalVTable mVTable{};
};
};
details::ISerializerBase<nn::sl::IconInfo> &GetDefaultIconInfoSerializer();
details::ISerializerBase<nn::sl::IconInfo> &
GetDefaultIconInfoSerializer();
details::ISerializerBase<nn::sl::TitleInfo> &GetDefaultQuickStartTitleInfoSerializer();
details::ISerializerBase<nn::sl::TitleInfo> &
GetDefaultQuickStartTitleInfoSerializer();
details::ISerializerBase<nn::sl::KillerNotification> &GetDefaultKillerNotificationSerializer();
details::ISerializerBase<nn::sl::KillerNotification> &
GetDefaultKillerNotificationSerializer();
details::ISerializerBase<nn::sl::TitleInfo> &GetDefaultJumpTitleInfoSerializer();
details::ISerializerBase<nn::sl::TitleInfo> &
GetDefaultJumpTitleInfoSerializer();
details::ISerializerBase<OSTime> &GetDefaultPreviousSendingTimeSerializer();
details::ISerializerBase<OSTime> &
GetDefaultPreviousSendingTimeSerializer();
} // namespace nn::sl
#endif

View File

@ -1,46 +1,60 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/ISettingAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
class ISettingAccessor : public details::ISettingAccessorBase {
namespace nn::sl
{
class ISettingAccessor : public details::ISettingAccessorBase
{
public:
ISettingAccessor() {
public:
ISettingAccessor()
{
InitInternalVtable();
}
ISettingAccessor(ISettingAccessor &src) {
ISettingAccessor(ISettingAccessor &src)
{
InitInternalVtable();
}
ISettingAccessor &operator=(const ISettingAccessor &other) {
ISettingAccessor &
operator=(const ISettingAccessor &other)
{
InitInternalVtable();
return *this;
}
ISettingAccessor &operator=(ISettingAccessor &&src) noexcept {
ISettingAccessor &
operator=(ISettingAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~ISettingAccessor() override = default;
private:
static nn::Result GetWrapper(details::ISettingAccessorInternal *instance, Setting *outSetting) {
private:
static nn::Result
GetWrapper(details::ISettingAccessorInternal *instance, Setting *outSetting)
{
return instance->vtable->instance->Get(outSetting);
}
details::ISettingAccessorInternal *GetInternal() override {
details::ISettingAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetFn = &GetWrapper};
mInstance.vtable = &mVTable;
@ -48,9 +62,10 @@ namespace nn::sl {
details::ISettingAccessorInternal mInstance{};
details::ISettingAccessorInternalVTable mVTable{};
};
};
details::ISettingAccessorBase &GetDefaultSettingAccessor();
details::ISettingAccessorBase &
GetDefaultSettingAccessor();
} // namespace nn::sl
#endif

View File

@ -1,58 +1,78 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IStreamDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
class IStream : public details::IStreamBase {
namespace nn::sl
{
class IStream : public details::IStreamBase
{
public:
IStream() {
public:
IStream()
{
InitInternalVtable();
}
IStream(IStream &src) {
IStream(IStream &src)
{
InitInternalVtable();
}
IStream &operator=(const IStream &other) {
IStream &
operator=(const IStream &other)
{
InitInternalVtable();
return *this;
}
IStream &operator=(IStream &&src) noexcept {
IStream &
operator=(IStream &&src) noexcept
{
InitInternalVtable();
return *this;
}
~IStream() override = default;
private:
static nn::Result ReadWrapper(details::IStreamInternal *instance, uint32_t *bytesRead, void *buffer, uint32_t readSize) {
private:
static nn::Result
ReadWrapper(details::IStreamInternal *instance, uint32_t *bytesRead, void *buffer, uint32_t readSize)
{
return instance->vtable->instance->Read(bytesRead, buffer, readSize);
}
static nn::Result WriteWrapper(details::IStreamInternal *instance, uint32_t *bytesWritten, void *buffer, uint32_t readSize) {
static nn::Result
WriteWrapper(details::IStreamInternal *instance, uint32_t *bytesWritten, void *buffer, uint32_t readSize)
{
return instance->vtable->instance->Write(bytesWritten, buffer, readSize);
}
static nn::Result GetSizeWrapper(details::IStreamInternal *instance, uint32_t *fileSize) {
static nn::Result
GetSizeWrapper(details::IStreamInternal *instance, uint32_t *fileSize)
{
return instance->vtable->instance->GetSize(fileSize);
}
static nn::Result SeekWrapper(details::IStreamInternal *instance, int32_t offset, nn::sl::SeekOrigin seekOrigin) {
static nn::Result
SeekWrapper(details::IStreamInternal *instance, int32_t offset, nn::sl::SeekOrigin seekOrigin)
{
return instance->vtable->instance->Seek(offset, seekOrigin);
}
details::IStreamInternal *GetInternal() override {
details::IStreamInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.ReadFn = &ReadWrapper,
.WriteFn = &WriteWrapper,
@ -63,7 +83,7 @@ namespace nn::sl {
details::IStreamInternal mInstance{};
details::IStreamInternalVTable mVTable{};
};
};
} // namespace nn::sl
#endif

View File

@ -1,51 +1,67 @@
#pragma once
#include <wut.h>
#include <coreinit/time.h>
#include <nn/result.h>
#include <nn/sl/details/ITimeAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace nn::sl
{
class ITimeAccessor : public details::ITimeAccessorBase {
class ITimeAccessor : public details::ITimeAccessorBase
{
public:
ITimeAccessor() {
public:
ITimeAccessor()
{
InitInternalVtable();
}
ITimeAccessor(ITimeAccessor &src) {
ITimeAccessor(ITimeAccessor &src)
{
InitInternalVtable();
}
ITimeAccessor &operator=(const ITimeAccessor &other) {
ITimeAccessor &
operator=(const ITimeAccessor &other)
{
InitInternalVtable();
return *this;
}
ITimeAccessor &operator=(ITimeAccessor &&src) noexcept {
ITimeAccessor &
operator=(ITimeAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~ITimeAccessor() override = default;
private:
static nn::Result GetNetworkTimeWrapper(details::ITimeAccessorInternal *instance, OSTime *timeOut, bool *successOut) {
private:
static nn::Result
GetNetworkTimeWrapper(details::ITimeAccessorInternal *instance, OSTime *timeOut, bool *successOut)
{
return instance->vtable->instance->GetNetworkTime(timeOut, successOut);
}
static nn::Result GetLocalTimeWrapper(details::ITimeAccessorInternal *instance, OSTime *timeOut, bool *successOut) {
static nn::Result
GetLocalTimeWrapper(details::ITimeAccessorInternal *instance, OSTime *timeOut, bool *successOut)
{
return instance->vtable->instance->GetLocalTime(timeOut, successOut);
}
details::ITimeAccessorInternal *GetInternal() override {
details::ITimeAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetNetworkTimeFn = &GetNetworkTimeWrapper,
.GetLocalTimeFn = &GetLocalTimeWrapper};
@ -54,9 +70,10 @@ namespace nn::sl {
details::ITimeAccessorInternal mInstance{};
details::ITimeAccessorInternalVTable mVTable{};
};
};
details::ITimeAccessorBase &GetDefaultTimeAccessor();
details::ITimeAccessorBase &
GetDefaultTimeAccessor();
} // namespace nn::sl
#endif

View File

@ -1,59 +1,79 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/ITitleIconCacheDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace nn::sl
{
class ITitleIconCache : public details::ITitleIconCacheBase {
class ITitleIconCache : public details::ITitleIconCacheBase
{
public:
ITitleIconCache() {
public:
ITitleIconCache()
{
InitInternalVtable();
}
ITitleIconCache(ITitleIconCache &src) {
ITitleIconCache(ITitleIconCache &src)
{
InitInternalVtable();
}
ITitleIconCache &operator=(const ITitleIconCache &other) {
ITitleIconCache &
operator=(const ITitleIconCache &other)
{
InitInternalVtable();
return *this;
}
ITitleIconCache &operator=(ITitleIconCache &&src) noexcept {
ITitleIconCache &
operator=(ITitleIconCache &&src) noexcept
{
InitInternalVtable();
return *this;
}
~ITitleIconCache() override = default;
private:
static nn::Result LoadWrapper(details::ITitleIconCacheInternal *instance) {
private:
static nn::Result
LoadWrapper(details::ITitleIconCacheInternal *instance)
{
return instance->vtable->instance->Load();
}
static nn::Result UpdateWrapper(details::ITitleIconCacheInternal *instance, TitleInfo *titleInfos, int num) {
static nn::Result
UpdateWrapper(details::ITitleIconCacheInternal *instance, TitleInfo *titleInfos, int num)
{
return instance->vtable->instance->Update(titleInfos, num);
}
static nn::Result StoreWrapper(details::ITitleIconCacheInternal *instance) {
static nn::Result
StoreWrapper(details::ITitleIconCacheInternal *instance)
{
return instance->vtable->instance->Store();
}
static void GetWrapper(details::ITitleIconCacheInternal *instance, IconInfo *iconInfos, int num) {
static void
GetWrapper(details::ITitleIconCacheInternal *instance, IconInfo *iconInfos, int num)
{
return instance->vtable->instance->Get(iconInfos, num);
}
details::ITitleIconCacheInternal *GetInternal() override {
details::ITitleIconCacheInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.LoadFn = &LoadWrapper,
.UpdateFn = &UpdateWrapper,
@ -64,9 +84,10 @@ namespace nn::sl {
details::ITitleIconCacheInternal mInstance{};
details::ITitleIconCacheInternalVTable mVTable{};
};
};
details::ITitleIconCacheBase &GetDefaultTitleIconCache();
details::ITitleIconCacheBase &
GetDefaultTitleIconCache();
} // namespace nn::sl
#endif

View File

@ -1,48 +1,62 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/ITitleListAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace nn::sl
{
class ITitleListAccessor : public details::ITitleListAccessorBase {
class ITitleListAccessor : public details::ITitleListAccessorBase
{
public:
ITitleListAccessor() {
public:
ITitleListAccessor()
{
InitInternalVtable();
}
ITitleListAccessor(ITitleListAccessor &src) {
ITitleListAccessor(ITitleListAccessor &src)
{
InitInternalVtable();
}
ITitleListAccessor &operator=(const ITitleListAccessor &other) {
ITitleListAccessor &
operator=(const ITitleListAccessor &other)
{
InitInternalVtable();
return *this;
}
ITitleListAccessor &operator=(ITitleListAccessor &&src) noexcept {
ITitleListAccessor &
operator=(ITitleListAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~ITitleListAccessor() override = default;
private:
static nn::Result GetWrapper(details::ITitleListAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) {
private:
static nn::Result
GetWrapper(details::ITitleListAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos)
{
return instance->vtable->instance->Get(outTitleInfos, outTitleInfosSize, maxTitleInfos);
}
details::ITitleListAccessorInternal *GetInternal() override {
details::ITitleListAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetFn = &GetWrapper};
mInstance.vtable = &mVTable;
@ -50,9 +64,10 @@ namespace nn::sl {
details::ITitleListAccessorInternal mInstance{};
details::ITitleListAccessorInternalVTable mVTable{};
};
};
details::ITitleListAccessorBase &GetDefaultTitleListAccessor();
details::ITitleListAccessorBase &
GetDefaultTitleListAccessor();
} // namespace nn::sl
#endif

View File

@ -1,58 +1,80 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/ITransferrerDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
class ITransferrer : public details::ITransferrerBase {
namespace nn::sl
{
class ITransferrer : public details::ITransferrerBase
{
public:
ITransferrer() {
public:
ITransferrer()
{
InitInternalVtable();
}
ITransferrer(ITransferrer &src) {
ITransferrer(ITransferrer &src)
{
InitInternalVtable();
}
ITransferrer &operator=(const ITransferrer &other) {
ITransferrer &
operator=(const ITransferrer &other)
{
InitInternalVtable();
return *this;
}
ITransferrer &operator=(ITransferrer &&src) noexcept {
ITransferrer &
operator=(ITransferrer &&src) noexcept
{
InitInternalVtable();
return *this;
}
~ITransferrer() override = default;
private:
static nn::Result TransferDeprecatedWrapper(details::ITransferrerInternal *instance, void *buffer, uint32_t size, bool setKillerNotification, int transferMode) {
private:
static nn::Result
TransferDeprecatedWrapper(details::ITransferrerInternal *instance, void *buffer, uint32_t size, bool setKillerNotification, int transferMode)
{
return instance->vtable->instance->TransferDeprecated(buffer, size, setKillerNotification, transferMode);
}
static nn::Result TransferWrapper(details::ITransferrerInternal *instance, void *buffer, uint32_t size, bool setKillerNotification, TransferMode transferMode) {
static nn::Result
TransferWrapper(details::ITransferrerInternal *instance, void *buffer, uint32_t size, bool setKillerNotification, TransferMode transferMode)
{
return instance->vtable->instance->Transfer(buffer, size, setKillerNotification, transferMode);
}
static nn::Result CancelTransferWrapper(details::ITransferrerInternal *instance) {
static nn::Result
CancelTransferWrapper(details::ITransferrerInternal *instance)
{
return instance->vtable->instance->CancelTransfer();
}
static nn::Result InvalidateNotificationWrapper(details::ITransferrerInternal *instance, uint32_t u1) {
static nn::Result
InvalidateNotificationWrapper(details::ITransferrerInternal *instance, uint32_t u1)
{
return instance->vtable->instance->InvalidateNotification(u1);
}
static nn::Result DisplayNotificationWrapper(details::ITransferrerInternal *instance, uint32_t u1, uint32_t u2, uint32_t u3) {
static nn::Result
DisplayNotificationWrapper(details::ITransferrerInternal *instance, uint32_t u1, uint32_t u2, uint32_t u3)
{
return instance->vtable->instance->DisplayNotification(u1, u2, u3);
}
details::ITransferrerInternal *GetInternal() override {
details::ITransferrerInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.TransferDeprecatedFn = &TransferDeprecatedWrapper,
.TransferFn = &TransferWrapper,
@ -64,9 +86,10 @@ namespace nn::sl {
details::ITransferrerInternal mInstance{};
details::ITransferrerInternalVTable mVTable{};
};
};
details::ITransferrerBase &GetDrcTransferrer();
details::ITransferrerBase &
GetDrcTransferrer();
} // namespace nn::sl
#endif

View File

@ -1,48 +1,64 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IUpdatePackageAccessorDetails.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
class IUpdatePackageAccessor : public details::IUpdatePackageAccessorBase {
namespace nn::sl
{
class IUpdatePackageAccessor : public details::IUpdatePackageAccessorBase
{
public:
IUpdatePackageAccessor() {
public:
IUpdatePackageAccessor()
{
InitInternalVtable();
}
IUpdatePackageAccessor(IUpdatePackageAccessor &src) {
IUpdatePackageAccessor(IUpdatePackageAccessor &src)
{
InitInternalVtable();
}
IUpdatePackageAccessor &operator=(const IUpdatePackageAccessor &other) {
IUpdatePackageAccessor &
operator=(const IUpdatePackageAccessor &other)
{
InitInternalVtable();
return *this;
}
IUpdatePackageAccessor &operator=(IUpdatePackageAccessor &&src) noexcept {
IUpdatePackageAccessor &
operator=(IUpdatePackageAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~IUpdatePackageAccessor() override = default;
private:
static bool PackageExistsWrapper(details::IUpdatePackageAccessorInternal *instance) {
private:
static bool
PackageExistsWrapper(details::IUpdatePackageAccessorInternal *instance)
{
return instance->vtable->instance->PackageExists();
}
static bool IsUpdatePackageDownloadedWrapper(details::IUpdatePackageAccessorInternal *instance) {
static bool
IsUpdatePackageDownloadedWrapper(details::IUpdatePackageAccessorInternal *instance)
{
return instance->vtable->instance->IsUpdatePackageDownloaded();
}
details::IUpdatePackageAccessorInternal *GetInternal() override {
details::IUpdatePackageAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.PackageExistsFn = PackageExistsWrapper,
.IsUpdatePackageDownloadedFn = IsUpdatePackageDownloadedWrapper};
@ -51,9 +67,10 @@ namespace nn::sl {
details::IUpdatePackageAccessorInternal mInstance{};
details::IUpdatePackageAccessorInternalVTable mVTable{};
};
};
details::IUpdatePackageAccessorBase &GetDefaultUpdatePackageAccessor();
details::IUpdatePackageAccessorBase &
GetDefaultUpdatePackageAccessor();
} // namespace nn::sl
#endif

View File

@ -1,47 +1,61 @@
#pragma once
#include <wut.h>
#include <nn/result.h>
#include <nn/sl/details/IWhiteListAccessorDetails.h>
#include <nn/sl/sl_cpp.h>
#include <wut.h>
#ifdef __cplusplus
namespace nn::sl {
namespace nn::sl
{
class IWhiteListAccessor : public details::IWhiteListAccessorBase {
class IWhiteListAccessor : public details::IWhiteListAccessorBase
{
public:
IWhiteListAccessor() {
public:
IWhiteListAccessor()
{
InitInternalVtable();
}
IWhiteListAccessor(IWhiteListAccessor &src) {
IWhiteListAccessor(IWhiteListAccessor &src)
{
InitInternalVtable();
}
IWhiteListAccessor &operator=(const IWhiteListAccessor &other) {
IWhiteListAccessor &
operator=(const IWhiteListAccessor &other)
{
InitInternalVtable();
return *this;
}
IWhiteListAccessor &operator=(IWhiteListAccessor &&src) noexcept {
IWhiteListAccessor &
operator=(IWhiteListAccessor &&src) noexcept
{
InitInternalVtable();
return *this;
}
~IWhiteListAccessor() override = default;
private:
static nn::Result GetWrapper(details::IWhiteListAccessorInternal *instance, nn::sl::WhiteList *outWhiteList) {
private:
static nn::Result
GetWrapper(details::IWhiteListAccessorInternal *instance, nn::sl::WhiteList *outWhiteList)
{
return instance->vtable->instance->Get(outWhiteList);
}
details::IWhiteListAccessorInternal *GetInternal() override {
details::IWhiteListAccessorInternal *
GetInternal() override
{
return &mInstance;
}
void InitInternalVtable() {
void
InitInternalVtable()
{
mVTable = {.instance = this,
.GetFn = &GetWrapper};
@ -50,9 +64,10 @@ namespace nn::sl {
details::IWhiteListAccessorInternal mInstance{};
details::IWhiteListAccessorInternalVTable mVTable{};
};
};
details::IWhiteListAccessorBase &GetDefaultWhiteListAccessor();
details::IWhiteListAccessorBase &
GetDefaultWhiteListAccessor();
} // namespace nn::sl
#endif

Some files were not shown because too many files have changed in this diff Show More