mirror of
https://github.com/devkitPro/wut.git
synced 2026-04-24 23:46:56 -05:00
Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e864b10e7 | ||
|
|
2341956f64 | ||
|
|
6b29dd6ee2 | ||
|
|
2016e429c1 | ||
|
|
afa43f676d | ||
|
|
26ed8f3b39 | ||
|
|
49fe30fe49 | ||
|
|
6cd63fe2b3 | ||
|
|
e3ac119037 | ||
|
|
1b412d2769 | ||
|
|
cac70f560e | ||
|
|
2c98cc91aa | ||
|
|
4f18f8041a | ||
|
|
2b66122422 | ||
|
|
fa650f92c4 | ||
|
|
5fdc7ffe85 | ||
|
|
81db8e5dd4 | ||
|
|
1bbdc75f27 | ||
|
|
b418690722 | ||
|
|
1447a0ed92 | ||
|
|
b35e595a6e | ||
|
|
a92c2b178b | ||
|
|
4847ddce41 | ||
|
|
958936de47 | ||
|
|
941fd90b39 | ||
|
|
5c9b87ce75 | ||
|
|
6f48526d37 | ||
|
|
8b65fd6ce9 |
90
.clang-format
Normal file
90
.clang-format
Normal 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
197
.github/workflows/clang-format-diff.py
vendored
Executable 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
47
.github/workflows/format-check.yml
vendored
Normal 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
|
||||||
58
CHANGELOG.md
58
CHANGELOG.md
|
|
@ -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
|
#### wut 1.5.0
|
||||||
|
|
||||||
###### New features / improvements
|
###### New features / improvements
|
||||||
|
|
|
||||||
28
Makefile
28
Makefile
|
|
@ -2,10 +2,6 @@
|
||||||
TOPDIR ?= $(CURDIR)
|
TOPDIR ?= $(CURDIR)
|
||||||
include $(TOPDIR)/share/wut_rules
|
include $(TOPDIR)/share/wut_rules
|
||||||
|
|
||||||
export WUT_MAJOR := 1
|
|
||||||
export WUT_MINOR := 4
|
|
||||||
export WUT_PATCH := 0
|
|
||||||
|
|
||||||
VERSION := $(WUT_MAJOR).$(WUT_MINOR).$(WUT_PATCH)
|
VERSION := $(WUT_MAJOR).$(WUT_MINOR).$(WUT_PATCH)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
|
@ -20,7 +16,6 @@ TARGET := wut
|
||||||
SOURCES := cafe \
|
SOURCES := cafe \
|
||||||
libraries/wutcrt \
|
libraries/wutcrt \
|
||||||
libraries/wutnewlib \
|
libraries/wutnewlib \
|
||||||
libraries/wutstdc++ \
|
|
||||||
libraries/wutmalloc \
|
libraries/wutmalloc \
|
||||||
libraries/wutdevoptab \
|
libraries/wutdevoptab \
|
||||||
libraries/wutsocket \
|
libraries/wutsocket \
|
||||||
|
|
@ -105,22 +100,13 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
all: lib/libwut.a lib/libwutd.a
|
all: lib/libwut.a lib/libwutd.a
|
||||||
|
|
||||||
dist-bin: all
|
install: all
|
||||||
@tar --exclude=*~ -cjf wut-$(VERSION).tar.bz2 \
|
@mkdir -p $(DESTDIR)$(DEVKITPRO)/wut
|
||||||
include lib share \
|
@cp -frv include lib share $(DESTDIR)$(DEVKITPRO)/wut
|
||||||
-C libraries/libwhb include \
|
@cp -frv libraries/libwhb/include $(DESTDIR)$(DEVKITPRO)/wut
|
||||||
-C ../nn_idb include \
|
@cp -frv libraries/nn_idb/include $(DESTDIR)$(DEVKITPRO)/wut
|
||||||
-C ../libgfd include \
|
@cp -frv libraries/libgfd/include $(DESTDIR)$(DEVKITPRO)/wut
|
||||||
-C ../libirc include
|
@cp -frv libraries/libirc/include $(DESTDIR)$(DEVKITPRO)/wut
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
lib:
|
lib:
|
||||||
@[ -d $@ ] || mkdir -p $@
|
@[ -d $@ ] || mkdir -p $@
|
||||||
|
|
|
||||||
|
|
@ -13,24 +13,24 @@ extern "C" {
|
||||||
|
|
||||||
typedef enum AVMDrcScanMode
|
typedef enum AVMDrcScanMode
|
||||||
{
|
{
|
||||||
AVM_DRC_SCAN_MODE_UNKNOWN_0 = 0,
|
AVM_DRC_SCAN_MODE_UNKNOWN_0 = 0,
|
||||||
AVM_DRC_SCAN_MODE_UNKNOWN_1 = 1,
|
AVM_DRC_SCAN_MODE_UNKNOWN_1 = 1,
|
||||||
AVM_DRC_SCAN_MODE_UNKNOWN_3 = 3,
|
AVM_DRC_SCAN_MODE_UNKNOWN_3 = 3,
|
||||||
AVM_DRC_SCAN_MODE_UNKNOWN_255 = 255,
|
AVM_DRC_SCAN_MODE_UNKNOWN_255 = 255,
|
||||||
} AVMDrcScanMode;
|
} AVMDrcScanMode;
|
||||||
|
|
||||||
typedef enum AVMDrcMode
|
typedef enum AVMDrcMode
|
||||||
{
|
{
|
||||||
AVM_DRC_MODE_NONE = 0,
|
AVM_DRC_MODE_NONE = 0,
|
||||||
AVM_DRC_MODE_SINGLE = 1,
|
AVM_DRC_MODE_SINGLE = 1,
|
||||||
AVM_DRC_MODE_DOUBLE = 2,
|
AVM_DRC_MODE_DOUBLE = 2,
|
||||||
} AVMDrcMode;
|
} AVMDrcMode;
|
||||||
|
|
||||||
typedef enum AVMDrcSystemAudioMode
|
typedef enum AVMDrcSystemAudioMode
|
||||||
{
|
{
|
||||||
AVM_DRC_SYSTEM_AUDIO_MODE_UNKNOWN_0 = 0, // mono?
|
AVM_DRC_SYSTEM_AUDIO_MODE_UNKNOWN_0 = 0, // mono?
|
||||||
AVM_DRC_SYSTEM_AUDIO_MODE_UNKNOWN_1 = 1, // stereo?
|
AVM_DRC_SYSTEM_AUDIO_MODE_UNKNOWN_1 = 1, // stereo?
|
||||||
AVM_DRC_SYSTEM_AUDIO_MODE_SURROUND = 2,
|
AVM_DRC_SYSTEM_AUDIO_MODE_SURROUND = 2,
|
||||||
} AVMDrcSystemAudioMode;
|
} AVMDrcSystemAudioMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -22,18 +22,18 @@ typedef enum AVMTvAspectRatio
|
||||||
|
|
||||||
typedef enum AVMTvResolution
|
typedef enum AVMTvResolution
|
||||||
{
|
{
|
||||||
AVM_TV_RESOLUTION_576I = 1,
|
AVM_TV_RESOLUTION_576I = 1,
|
||||||
AVM_TV_RESOLUTION_480I = 2,
|
AVM_TV_RESOLUTION_480I = 2,
|
||||||
AVM_TV_RESOLUTION_480P = 3,
|
AVM_TV_RESOLUTION_480P = 3,
|
||||||
AVM_TV_RESOLUTION_720P = 4,
|
AVM_TV_RESOLUTION_720P = 4,
|
||||||
AVM_TV_RESOLUTION_720P_3D = 5,
|
AVM_TV_RESOLUTION_720P_3D = 5,
|
||||||
AVM_TV_RESOLUTION_1080I = 6,
|
AVM_TV_RESOLUTION_1080I = 6,
|
||||||
AVM_TV_RESOLUTION_1080P = 7,
|
AVM_TV_RESOLUTION_1080P = 7,
|
||||||
AVM_TV_RESOLUTION_480I_PAL60 = 10,
|
AVM_TV_RESOLUTION_480I_PAL60 = 10,
|
||||||
AVM_TV_RESOLUTION_576P = 11,
|
AVM_TV_RESOLUTION_576P = 11,
|
||||||
AVM_TV_RESOLUTION_720P_50HZ = 12,
|
AVM_TV_RESOLUTION_720P_50HZ = 12,
|
||||||
AVM_TV_RESOLUTION_1080I_50HZ = 13,
|
AVM_TV_RESOLUTION_1080I_50HZ = 13,
|
||||||
AVM_TV_RESOLUTION_1080P_50HZ = 14,
|
AVM_TV_RESOLUTION_1080P_50HZ = 14,
|
||||||
} AVMTvResolution;
|
} AVMTvResolution;
|
||||||
|
|
||||||
typedef enum AVMTvVideoRegion
|
typedef enum AVMTvVideoRegion
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CAMERA_WIDTH 640
|
#define CAMERA_WIDTH 640
|
||||||
#define CAMERA_PITCH 768
|
#define CAMERA_PITCH 768
|
||||||
#define CAMERA_HEIGHT 480
|
#define CAMERA_HEIGHT 480
|
||||||
|
|
||||||
#define CAMERA_Y_BUFFER_SIZE (CAMERA_PITCH * CAMERA_HEIGHT)
|
#define CAMERA_Y_BUFFER_SIZE (CAMERA_PITCH * CAMERA_HEIGHT)
|
||||||
#define CAMERA_UV_BUFFER_SIZE (CAMERA_PITCH * CAMERA_HEIGHT / 2)
|
#define CAMERA_UV_BUFFER_SIZE (CAMERA_PITCH * CAMERA_HEIGHT / 2)
|
||||||
#define CAMERA_YUV_BUFFER_SIZE (CAMERA_Y_BUFFER_SIZE + CAMERA_UV_BUFFER_SIZE)
|
#define CAMERA_YUV_BUFFER_SIZE (CAMERA_Y_BUFFER_SIZE + CAMERA_UV_BUFFER_SIZE)
|
||||||
|
|
||||||
#define CAMERA_YUV_BUFFER_ALIGNMENT 256
|
#define CAMERA_YUV_BUFFER_ALIGNMENT 256
|
||||||
|
|
||||||
|
|
@ -34,35 +34,35 @@ typedef struct CAMSurface CAMSurface;
|
||||||
|
|
||||||
typedef enum CamError
|
typedef enum CamError
|
||||||
{
|
{
|
||||||
CAMERA_ERROR_OK = 0,
|
CAMERA_ERROR_OK = 0,
|
||||||
CAMERA_ERROR_INVALID_ARG = -1,
|
CAMERA_ERROR_INVALID_ARG = -1,
|
||||||
CAMERA_ERROR_INVALID_HANDLE = -2,
|
CAMERA_ERROR_INVALID_HANDLE = -2,
|
||||||
CAMERA_ERROR_TOO_MANY_SURFACES = -4,
|
CAMERA_ERROR_TOO_MANY_SURFACES = -4,
|
||||||
CAMERA_ERROR_INSUFFICIENT_MEMORY = -5,
|
CAMERA_ERROR_INSUFFICIENT_MEMORY = -5,
|
||||||
CAMERA_ERROR_NOT_READY = -6,
|
CAMERA_ERROR_NOT_READY = -6,
|
||||||
CAMERA_ERROR_UNINITIALIZED = -8,
|
CAMERA_ERROR_UNINITIALIZED = -8,
|
||||||
CAMERA_ERROR_UVC = -9,
|
CAMERA_ERROR_UVC = -9,
|
||||||
CAMERA_ERROR_UVD_CONTEXT = -10,
|
CAMERA_ERROR_UVD_CONTEXT = -10,
|
||||||
CAMERA_ERROR_DEVICE_IN_USE = -12,
|
CAMERA_ERROR_DEVICE_IN_USE = -12,
|
||||||
CAMERA_ERROR_UVD_SESSION = -13,
|
CAMERA_ERROR_UVD_SESSION = -13,
|
||||||
CAMERA_ERROR_SEGMENT_VIOLATION = -15
|
CAMERA_ERROR_SEGMENT_VIOLATION = -15
|
||||||
} CamError;
|
} CamError;
|
||||||
|
|
||||||
typedef enum CamFps
|
typedef enum CamFps
|
||||||
{
|
{
|
||||||
CAMERA_FPS_15 = 0,
|
CAMERA_FPS_15 = 0,
|
||||||
CAMERA_FPS_30 = 1
|
CAMERA_FPS_30 = 1
|
||||||
} CamFps;
|
} CamFps;
|
||||||
|
|
||||||
typedef enum CamStreamType
|
typedef enum CamStreamType
|
||||||
{
|
{
|
||||||
CAMERA_STREAM_TYPE_1 = 0
|
CAMERA_STREAM_TYPE_1 = 0
|
||||||
} CamStreamType;
|
} CamStreamType;
|
||||||
|
|
||||||
typedef enum CamEventType
|
typedef enum CamEventType
|
||||||
{
|
{
|
||||||
CAMERA_DECODE_DONE = 0,
|
CAMERA_DECODE_DONE = 0,
|
||||||
CAMERA_DRC_DETACH = 1
|
CAMERA_DRC_DETACH = 1
|
||||||
} CamEventType;
|
} CamEventType;
|
||||||
|
|
||||||
struct CAMEventData
|
struct CAMEventData
|
||||||
|
|
@ -74,7 +74,7 @@ struct CAMEventData
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
//! Pointer to the buffer of the decoded image
|
//! Pointer to the buffer of the decoded image
|
||||||
void* surfaceBuffer;
|
void *surfaceBuffer;
|
||||||
//! Handle of instance
|
//! Handle of instance
|
||||||
CAMHandle handle;
|
CAMHandle handle;
|
||||||
//! TRUE if decode failed
|
//! TRUE if decode failed
|
||||||
|
|
@ -100,7 +100,7 @@ WUT_CHECK_OFFSET(CAMEventData, 0x08, detach.handle);
|
||||||
WUT_CHECK_OFFSET(CAMEventData, 0x04, args);
|
WUT_CHECK_OFFSET(CAMEventData, 0x04, args);
|
||||||
WUT_CHECK_SIZE(CAMEventData, 0x10);
|
WUT_CHECK_SIZE(CAMEventData, 0x10);
|
||||||
|
|
||||||
typedef void(*CAMEventHandler)(CAMEventData *camEventData);
|
typedef void (*CAMEventHandler)(CAMEventData *camEventData);
|
||||||
|
|
||||||
struct CAMMode
|
struct CAMMode
|
||||||
{
|
{
|
||||||
|
|
@ -192,26 +192,26 @@ WUT_CHECK_SIZE(CAMSurface, 0x20);
|
||||||
* Initialize the camera
|
* Initialize the camera
|
||||||
* \returns camera handle on success, and -1 on failure
|
* \returns camera handle on success, and -1 on failure
|
||||||
*/
|
*/
|
||||||
CAMHandle
|
CAMHandle
|
||||||
CAMInit(int instance, CAMSetupInfo *setupInfo, CAMError *err);
|
CAMInit(int instance, CAMSetupInfo *setupInfo, CAMError *err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deinitialize and clean up
|
* Deinitialize and clean up
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
CAMExit(CAMHandle handle);
|
CAMExit(CAMHandle handle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start recording and decoding frames
|
* Start recording and decoding frames
|
||||||
*/
|
*/
|
||||||
CAMError
|
CAMError
|
||||||
CAMOpen(CAMHandle handle);
|
CAMOpen(CAMHandle handle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stops recording and decoding.
|
* Stops recording and decoding.
|
||||||
* Automatically called when the process is moved to background
|
* Automatically called when the process is moved to background
|
||||||
*/
|
*/
|
||||||
CAMError
|
CAMError
|
||||||
CAMClose(CAMHandle handle);
|
CAMClose(CAMHandle handle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -228,13 +228,13 @@ CAMGetMemReq(CAMStreamInfo *streamInfo);
|
||||||
* Up to 20 surfaces may be queued.
|
* Up to 20 surfaces may be queued.
|
||||||
* Surface data is returned in the NV12 format
|
* Surface data is returned in the NV12 format
|
||||||
*/
|
*/
|
||||||
CAMError
|
CAMError
|
||||||
CAMSubmitTargetSurface(CAMHandle handle, CAMSurface *surface);
|
CAMSubmitTargetSurface(CAMHandle handle, CAMSurface *surface);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether memory is segmented correctly to be used with the camera library
|
* Checks whether memory is segmented correctly to be used with the camera library
|
||||||
*/
|
*/
|
||||||
CAMError
|
CAMError
|
||||||
CAMCheckMemSegmentation(void *pMem, uint32_t size);
|
CAMCheckMemSegmentation(void *pMem, uint32_t size);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
|
#include "context.h"
|
||||||
#include "threadqueue.h"
|
#include "threadqueue.h"
|
||||||
#include "time.h"
|
#include "time.h"
|
||||||
#include "context.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup coreinit_alarms Alarms
|
* \defgroup coreinit_alarms Alarms
|
||||||
|
|
|
||||||
|
|
@ -12,51 +12,67 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef int32_t BSPError;
|
|
||||||
typedef uint32_t BSPHardwareVersion;
|
typedef uint32_t BSPHardwareVersion;
|
||||||
typedef uint32_t BSPConsoleTypeRaw;
|
typedef uint32_t BSPConsoleTypeRaw;
|
||||||
|
|
||||||
typedef enum BSPErrors
|
typedef enum BSPError
|
||||||
{
|
{
|
||||||
BSP_ERROR_OK = 0,
|
BSP_ERROR_OK = 0x0,
|
||||||
BSP_ERROR_IOS_ERROR = 0x40,
|
BSP_ERROR_UNKNOWN_ENTITY = 0x1,
|
||||||
BSP_ERROR_RESPONSE_TOO_LARGE = 0x80,
|
BSP_ERROR_UNKNOWN_ATTRIBUTE = 0x2,
|
||||||
} BSPErrors;
|
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_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
|
typedef enum BSPHardwareVersions
|
||||||
{
|
{
|
||||||
BSP_HARDWARE_VERSION_UNKNOWN = 0x00000000,
|
BSP_HARDWARE_VERSION_UNKNOWN = 0x00000000,
|
||||||
|
|
||||||
// vWii Hardware Versions
|
// vWii Hardware Versions
|
||||||
BSP_HARDWARE_VERSION_HOLLYWOOD_ENG_SAMPLE_1 = 0x00000001,
|
BSP_HARDWARE_VERSION_HOLLYWOOD_ENG_SAMPLE_1 = 0x00000001,
|
||||||
BSP_HARDWARE_VERSION_HOLLYWOOD_ENG_SAMPLE_2 = 0x10000001,
|
BSP_HARDWARE_VERSION_HOLLYWOOD_ENG_SAMPLE_2 = 0x10000001,
|
||||||
BSP_HARDWARE_VERSION_HOLLYWOOD_PROD_FOR_WII = 0x10100001,
|
BSP_HARDWARE_VERSION_HOLLYWOOD_PROD_FOR_WII = 0x10100001,
|
||||||
BSP_HARDWARE_VERSION_HOLLYWOOD_CORTADO = 0x10100008,
|
BSP_HARDWARE_VERSION_HOLLYWOOD_CORTADO = 0x10100008,
|
||||||
BSP_HARDWARE_VERSION_HOLLYWOOD_CORTADO_ESPRESSO = 0x1010000C,
|
BSP_HARDWARE_VERSION_HOLLYWOOD_CORTADO_ESPRESSO = 0x1010000C,
|
||||||
BSP_HARDWARE_VERSION_BOLLYWOOD = 0x20000001,
|
BSP_HARDWARE_VERSION_BOLLYWOOD = 0x20000001,
|
||||||
BSP_HARDWARE_VERSION_BOLLYWOOD_PROD_FOR_WII = 0x20100001,
|
BSP_HARDWARE_VERSION_BOLLYWOOD_PROD_FOR_WII = 0x20100001,
|
||||||
|
|
||||||
// WiiU Hardware Versions
|
// WiiU Hardware Versions
|
||||||
BSP_HARDWARE_VERSION_LATTE_A11_EV = 0x21100010,
|
BSP_HARDWARE_VERSION_LATTE_A11_EV = 0x21100010,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A11_CAT = 0x21100020,
|
BSP_HARDWARE_VERSION_LATTE_A11_CAT = 0x21100020,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A12_EV = 0x21200010,
|
BSP_HARDWARE_VERSION_LATTE_A12_EV = 0x21200010,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A12_CAT = 0x21200020,
|
BSP_HARDWARE_VERSION_LATTE_A12_CAT = 0x21200020,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A2X_EV = 0x22100010,
|
BSP_HARDWARE_VERSION_LATTE_A2X_EV = 0x22100010,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A2X_CAT = 0x22100020,
|
BSP_HARDWARE_VERSION_LATTE_A2X_CAT = 0x22100020,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A3X_EV = 0x23100010,
|
BSP_HARDWARE_VERSION_LATTE_A3X_EV = 0x23100010,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A3X_CAT = 0x23100020,
|
BSP_HARDWARE_VERSION_LATTE_A3X_CAT = 0x23100020,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A3X_CAFE = 0x23100028,
|
BSP_HARDWARE_VERSION_LATTE_A3X_CAFE = 0x23100028,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A4X_EV = 0x24100010,
|
BSP_HARDWARE_VERSION_LATTE_A4X_EV = 0x24100010,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A4X_CAT = 0x24100020,
|
BSP_HARDWARE_VERSION_LATTE_A4X_CAT = 0x24100020,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A4X_CAFE = 0x24100028,
|
BSP_HARDWARE_VERSION_LATTE_A4X_CAFE = 0x24100028,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A5X_EV = 0x25100010,
|
BSP_HARDWARE_VERSION_LATTE_A5X_EV = 0x25100010,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A5X_EV_Y = 0x25100011,
|
BSP_HARDWARE_VERSION_LATTE_A5X_EV_Y = 0x25100011,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A5X_CAT = 0x25100020,
|
BSP_HARDWARE_VERSION_LATTE_A5X_CAT = 0x25100020,
|
||||||
BSP_HARDWARE_VERSION_LATTE_A5X_CAFE = 0x25100028,
|
BSP_HARDWARE_VERSION_LATTE_A5X_CAFE = 0x25100028,
|
||||||
BSP_HARDWARE_VERSION_LATTE_B1X_EV = 0x26100010,
|
BSP_HARDWARE_VERSION_LATTE_B1X_EV = 0x26100010,
|
||||||
BSP_HARDWARE_VERSION_LATTE_B1X_EV_Y = 0x26100011,
|
BSP_HARDWARE_VERSION_LATTE_B1X_EV_Y = 0x26100011,
|
||||||
BSP_HARDWARE_VERSION_LATTE_B1X_CAT = 0x26100020,
|
BSP_HARDWARE_VERSION_LATTE_B1X_CAT = 0x26100020,
|
||||||
BSP_HARDWARE_VERSION_LATTE_B1X_CAFE = 0x26100028
|
BSP_HARDWARE_VERSION_LATTE_B1X_CAFE = 0x26100028
|
||||||
} BSPHardwareVersions;
|
} BSPHardwareVersions;
|
||||||
|
|
||||||
BSPError
|
BSPError
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ DCTouchRange(void *addr,
|
||||||
void
|
void
|
||||||
ICInvalidateRange(void *addr,
|
ICInvalidateRange(void *addr,
|
||||||
uint32_t size);
|
uint32_t size);
|
||||||
|
|
||||||
void
|
void
|
||||||
OSMemoryBarrier();
|
OSMemoryBarrier();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,10 @@ extern "C" {
|
||||||
//! The memory permissions for the codegen area.
|
//! The memory permissions for the codegen area.
|
||||||
typedef enum OSCodegenSecMode
|
typedef enum OSCodegenSecMode
|
||||||
{
|
{
|
||||||
//! The area can be read or written to, but not executed.
|
//! The area can be read or written to, but not executed.
|
||||||
CODEGEN_RW_ = 0,
|
CODEGEN_RW_ = 0,
|
||||||
//! The area can be read or executed, but not written to.
|
//! The area can be read or executed, but not written to.
|
||||||
CODEGEN_R_X = 1,
|
CODEGEN_R_X = 1,
|
||||||
} OSCodegenSecMode;
|
} OSCodegenSecMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,10 @@ extern "C" {
|
||||||
//! A bitfield of enum OS_CONTEXT_STATE.
|
//! A bitfield of enum OS_CONTEXT_STATE.
|
||||||
typedef uint16_t OSContextState;
|
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
|
OS_CONTEXT_STATE_OSCALLBACK = 1 << 3,
|
||||||
|
OS_CONTEXT_STATE_USERMODE_SAVED = 1 << 4
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct OSContext OSContext;
|
typedef struct OSContext OSContext;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,15 @@ extern "C" {
|
||||||
#endif
|
#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.
|
* Gets the number of cores in the system. On a retail Wii U, this is always 3.
|
||||||
*
|
*
|
||||||
|
|
@ -58,6 +67,22 @@ BOOL
|
||||||
OSIsMainCore();
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -12,45 +12,52 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum COSReportLevel{
|
typedef enum COSReportLevel
|
||||||
COS_REPORT_LEVEL_ERROR = 0,
|
{
|
||||||
COS_REPORT_LEVEL_WARN = 1,
|
COS_REPORT_LEVEL_ERROR = 0,
|
||||||
COS_REPORT_LEVEL_INFO = 2,
|
COS_REPORT_LEVEL_WARN = 1,
|
||||||
COS_REPORT_LEVEL_VERBOSE = 3,
|
COS_REPORT_LEVEL_INFO = 2,
|
||||||
|
COS_REPORT_LEVEL_VERBOSE = 3,
|
||||||
} COSReportLevel;
|
} COSReportLevel;
|
||||||
|
|
||||||
typedef enum COSReportModule{
|
typedef enum COSReportModule
|
||||||
COS_REPORT_MODULE_UNKNOWN_0 = 0,
|
{
|
||||||
COS_REPORT_MODULE_UNKNOWN_1 = 1,
|
COS_REPORT_MODULE_UNKNOWN_0 = 0,
|
||||||
COS_REPORT_MODULE_UNKNOWN_2 = 2,
|
COS_REPORT_MODULE_UNKNOWN_1 = 1,
|
||||||
COS_REPORT_MODULE_UNKNOWN_5 = 5,
|
COS_REPORT_MODULE_UNKNOWN_2 = 2,
|
||||||
|
COS_REPORT_MODULE_UNKNOWN_5 = 5,
|
||||||
} COSReportModule;
|
} COSReportModule;
|
||||||
|
|
||||||
void
|
void
|
||||||
COSVReport(COSReportModule module,
|
COSVReport(COSReportModule module,
|
||||||
COSReportLevel level,
|
COSReportLevel level,
|
||||||
const char* fmt,
|
const char *fmt,
|
||||||
...);
|
...)
|
||||||
|
WUT_FORMAT_PRINTF(3, 4);
|
||||||
|
|
||||||
void
|
void
|
||||||
COSError(COSReportModule module,
|
COSError(COSReportModule module,
|
||||||
const char* fmt,
|
const char *fmt,
|
||||||
...);
|
...)
|
||||||
|
WUT_FORMAT_PRINTF(2, 3);
|
||||||
|
|
||||||
void
|
void
|
||||||
COSInfo(COSReportModule module,
|
COSInfo(COSReportModule module,
|
||||||
const char* fmt,
|
const char *fmt,
|
||||||
...);
|
...)
|
||||||
|
WUT_FORMAT_PRINTF(2, 3);
|
||||||
|
|
||||||
void
|
void
|
||||||
COSVerbose(COSReportModule module,
|
COSVerbose(COSReportModule module,
|
||||||
const char* fmt,
|
const char *fmt,
|
||||||
...);
|
...)
|
||||||
|
WUT_FORMAT_PRINTF(2, 3);
|
||||||
|
|
||||||
void
|
void
|
||||||
COSWarn(COSReportModule module,
|
COSWarn(COSReportModule module,
|
||||||
const char* fmt,
|
const char *fmt,
|
||||||
...);
|
...)
|
||||||
|
WUT_FORMAT_PRINTF(2, 3);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct OSFatalError OSFatalError;
|
||||||
|
|
||||||
typedef void (*DisassemblyPrintFn)(const char *fmt, ...);
|
typedef void (*DisassemblyPrintFn)(const char *fmt, ...);
|
||||||
|
|
||||||
typedef uint32_t (*DisassemblyFindSymbolFn)(uint32_t addr, char *symbolNameBuf, uint32_t symbolNameBufSize);
|
typedef uint32_t (*DisassemblyFindSymbolFn)(uint32_t addr, char *symbolNameBuf, uint32_t symbolNameBufSize);
|
||||||
|
|
@ -20,6 +22,39 @@ typedef enum DisassemblePPCFlags
|
||||||
DISASSEMBLE_PPC_FLAGS_NONE = 0,
|
DISASSEMBLE_PPC_FLAGS_NONE = 0,
|
||||||
} DisassemblePPCFlags;
|
} 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
|
void
|
||||||
OSConsoleWrite(const char *msg,
|
OSConsoleWrite(const char *msg,
|
||||||
|
|
@ -30,30 +65,40 @@ __OSConsoleWrite(const char *msg,
|
||||||
uint32_t size);
|
uint32_t size);
|
||||||
|
|
||||||
void
|
void
|
||||||
OSReport(const char *fmt, ...);
|
OSReport(const char *fmt, ...)
|
||||||
|
WUT_FORMAT_PRINTF(1, 2);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OSReportVerbose(const char *fmt, ...);
|
OSReportVerbose(const char *fmt, ...)
|
||||||
|
WUT_FORMAT_PRINTF(1, 2);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OSReportInfo(const char *fmt, ...);
|
OSReportInfo(const char *fmt, ...)
|
||||||
|
WUT_FORMAT_PRINTF(1, 2);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OSReportWarn(const char *fmt, ...);
|
OSReportWarn(const char *fmt, ...)
|
||||||
|
WUT_FORMAT_PRINTF(1, 2);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OSPanic(const char *file,
|
OSPanic(const char *file,
|
||||||
uint32_t line,
|
uint32_t line,
|
||||||
const char *fmt, ...);
|
const char *fmt,
|
||||||
|
...)
|
||||||
|
WUT_FORMAT_PRINTF(3, 4);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OSFatal(const char *msg);
|
OSFatal(const char *msg);
|
||||||
|
|
||||||
|
void
|
||||||
|
OSSendFatalError(OSFatalError *error,
|
||||||
|
const char *functionName,
|
||||||
|
uint32_t line);
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
OSGetSymbolName(uint32_t addr,
|
OSGetSymbolName(uint32_t addr,
|
||||||
|
|
|
||||||
|
|
@ -23,31 +23,32 @@ typedef struct OSDynLoad_InternalData OSDynLoad_InternalData;
|
||||||
|
|
||||||
typedef enum OSDynLoad_Error
|
typedef enum OSDynLoad_Error
|
||||||
{
|
{
|
||||||
OS_DYNLOAD_OK = 0,
|
OS_DYNLOAD_OK = 0,
|
||||||
OS_DYNLOAD_OUT_OF_MEMORY = 0xBAD10002,
|
OS_DYNLOAD_OUT_OF_MEMORY = 0xBAD10002,
|
||||||
OS_DYNLOAD_INVALID_NOTIFY_PTR = 0xBAD1000E,
|
OS_DYNLOAD_INVALID_NOTIFY_PTR = 0xBAD1000E,
|
||||||
OS_DYNLOAD_INVALID_MODULE_NAME_PTR = 0xBAD1000F,
|
OS_DYNLOAD_INVALID_MODULE_NAME_PTR = 0xBAD1000F,
|
||||||
OS_DYNLOAD_INVALID_MODULE_NAME = 0xBAD10010,
|
OS_DYNLOAD_INVALID_MODULE_NAME = 0xBAD10010,
|
||||||
OS_DYNLOAD_INVALID_ACQUIRE_PTR = 0xBAD10011,
|
OS_DYNLOAD_INVALID_ACQUIRE_PTR = 0xBAD10011,
|
||||||
OS_DYNLOAD_EMPTY_MODULE_NAME = 0xBAD10012,
|
OS_DYNLOAD_EMPTY_MODULE_NAME = 0xBAD10012,
|
||||||
OS_DYNLOAD_INVALID_ALLOCATOR_PTR = 0xBAD10017,
|
OS_DYNLOAD_INVALID_ALLOCATOR_PTR = 0xBAD10017,
|
||||||
OS_DYNLOAD_OUT_OF_SYSTEM_MEMORY = 0xBAD1002F,
|
OS_DYNLOAD_OUT_OF_SYSTEM_MEMORY = 0xBAD1002F,
|
||||||
OS_DYNLOAD_TLS_ALLOCATOR_LOCKED = 0xBAD10031,
|
OS_DYNLOAD_TLS_ALLOCATOR_LOCKED = 0xBAD10031,
|
||||||
OS_DYNLOAD_MODULE_NOT_FOUND = 0xFFFFFFFA,
|
OS_DYNLOAD_MODULE_NOT_FOUND = 0xFFFFFFFA,
|
||||||
} OSDynLoad_Error;
|
} OSDynLoad_Error;
|
||||||
|
|
||||||
typedef OSDynLoad_Error (*OSDynLoadAllocFn)(int32_t size, int32_t align, void **outAddr);
|
typedef OSDynLoad_Error (*OSDynLoadAllocFn)(int32_t size, int32_t align, void **outAddr);
|
||||||
typedef void (*OSDynLoadFreeFn)(void *addr);
|
typedef void (*OSDynLoadFreeFn)(void *addr);
|
||||||
|
|
||||||
typedef enum OSDynLoad_ExportType {
|
typedef enum OSDynLoad_ExportType
|
||||||
OS_DYNLOAD_EXPORT_FUNC = 0,
|
{
|
||||||
OS_DYNLOAD_EXPORT_DATA = 1,
|
OS_DYNLOAD_EXPORT_FUNC = 0,
|
||||||
|
OS_DYNLOAD_EXPORT_DATA = 1,
|
||||||
} OSDynLoad_ExportType;
|
} OSDynLoad_ExportType;
|
||||||
|
|
||||||
typedef enum OSDynLoad_EntryReason
|
typedef enum OSDynLoad_EntryReason
|
||||||
{
|
{
|
||||||
OS_DYNLOAD_LOADED = 1,
|
OS_DYNLOAD_LOADED = 1,
|
||||||
OS_DYNLOAD_UNLOADED = 2,
|
OS_DYNLOAD_UNLOADED = 2,
|
||||||
} OSDynLoad_EntryReason;
|
} OSDynLoad_EntryReason;
|
||||||
|
|
||||||
struct OSDynLoad_NotifyData
|
struct OSDynLoad_NotifyData
|
||||||
|
|
@ -97,18 +98,18 @@ WUT_CHECK_SIZE(OSDynLoad_LoaderHeapStatistics, 0x18);
|
||||||
|
|
||||||
struct OSDynLoad_LoaderUserFileInfo
|
struct OSDynLoad_LoaderUserFileInfo
|
||||||
{
|
{
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
uint32_t magic;
|
uint32_t magic;
|
||||||
uint32_t pathStringLength;
|
uint32_t pathStringLength;
|
||||||
char *pathString;
|
char *pathString;
|
||||||
uint32_t fileInfoFlags;
|
uint32_t fileInfoFlags;
|
||||||
int16_t tlsModuleIndex;
|
int16_t tlsModuleIndex;
|
||||||
int16_t tlsAlignShift;
|
int16_t tlsAlignShift;
|
||||||
void *tlsAddressStart;
|
void *tlsAddressStart;
|
||||||
uint32_t tlsSectionSize;
|
uint32_t tlsSectionSize;
|
||||||
uint32_t shstrndx;
|
uint32_t shstrndx;
|
||||||
uint32_t titleLocation;
|
uint32_t titleLocation;
|
||||||
WUT_UNKNOWN_BYTES(0x60 - 0x28);
|
WUT_UNKNOWN_BYTES(0x60 - 0x28);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(OSDynLoad_LoaderUserFileInfo, 0x00, size);
|
WUT_CHECK_OFFSET(OSDynLoad_LoaderUserFileInfo, 0x00, size);
|
||||||
WUT_CHECK_OFFSET(OSDynLoad_LoaderUserFileInfo, 0x04, magic);
|
WUT_CHECK_OFFSET(OSDynLoad_LoaderUserFileInfo, 0x04, magic);
|
||||||
|
|
@ -126,17 +127,18 @@ WUT_CHECK_SIZE(OSDynLoad_LoaderUserFileInfo, 0x60);
|
||||||
|
|
||||||
struct OSDynLoad_LoaderSectionInfo
|
struct OSDynLoad_LoaderSectionInfo
|
||||||
{
|
{
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
void *address;
|
void *address;
|
||||||
|
|
||||||
union {
|
union
|
||||||
//! Size of the section, set when type != SHT_RPL_IMPORTS
|
{
|
||||||
uint32_t size;
|
//! Size of the section, set when type != SHT_RPL_IMPORTS
|
||||||
|
uint32_t size;
|
||||||
|
|
||||||
//! Name offset of the section, set when type == SHT_RPL_IMPORTS
|
//! Name offset of the section, set when type == SHT_RPL_IMPORTS
|
||||||
uint32_t name;
|
uint32_t name;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(OSDynLoad_LoaderSectionInfo, 0x00, type);
|
WUT_CHECK_OFFSET(OSDynLoad_LoaderSectionInfo, 0x00, type);
|
||||||
WUT_CHECK_OFFSET(OSDynLoad_LoaderSectionInfo, 0x04, flags);
|
WUT_CHECK_OFFSET(OSDynLoad_LoaderSectionInfo, 0x04, flags);
|
||||||
|
|
@ -148,29 +150,29 @@ WUT_CHECK_SIZE(OSDynLoad_LoaderSectionInfo, 0x10);
|
||||||
|
|
||||||
struct OSDynLoad_InternalData
|
struct OSDynLoad_InternalData
|
||||||
{
|
{
|
||||||
uint32_t handle;
|
uint32_t handle;
|
||||||
void *loaderHandle;
|
void *loaderHandle;
|
||||||
char *moduleName;
|
char *moduleName;
|
||||||
uint32_t moduleNameLen;
|
uint32_t moduleNameLen;
|
||||||
uint32_t sectionInfoCount;
|
uint32_t sectionInfoCount;
|
||||||
OSDynLoad_LoaderSectionInfo *sectionInfo;
|
OSDynLoad_LoaderSectionInfo *sectionInfo;
|
||||||
OSDynLoad_InternalData **importModules;
|
OSDynLoad_InternalData **importModules;
|
||||||
uint32_t importModuleCount;
|
uint32_t importModuleCount;
|
||||||
uint32_t userFileInfoSize;
|
uint32_t userFileInfoSize;
|
||||||
OSDynLoad_LoaderUserFileInfo *userFileInfo;
|
OSDynLoad_LoaderUserFileInfo *userFileInfo;
|
||||||
OSDynLoad_NotifyData *notifyData;
|
OSDynLoad_NotifyData *notifyData;
|
||||||
void *entryPoint;
|
void *entryPoint;
|
||||||
uint32_t dataSectionSize;
|
uint32_t dataSectionSize;
|
||||||
void *dataSection;
|
void *dataSection;
|
||||||
uint32_t loadSectionSize;
|
uint32_t loadSectionSize;
|
||||||
void *loadSection;
|
void *loadSection;
|
||||||
OSDynLoadFreeFn dynLoadFreeFn;
|
OSDynLoadFreeFn dynLoadFreeFn;
|
||||||
void *codeExports;
|
void *codeExports;
|
||||||
uint32_t numCodeExports;
|
uint32_t numCodeExports;
|
||||||
void *dataExports;
|
void *dataExports;
|
||||||
uint32_t numDataExports;
|
uint32_t numDataExports;
|
||||||
OSDynLoad_InternalData *next;
|
OSDynLoad_InternalData *next;
|
||||||
WUT_UNKNOWN_BYTES(0x94 - 0x58);
|
WUT_UNKNOWN_BYTES(0x94 - 0x58);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(OSDynLoad_InternalData, 0x00, handle);
|
WUT_CHECK_OFFSET(OSDynLoad_InternalData, 0x00, handle);
|
||||||
WUT_CHECK_OFFSET(OSDynLoad_InternalData, 0x04, loaderHandle);
|
WUT_CHECK_OFFSET(OSDynLoad_InternalData, 0x04, loaderHandle);
|
||||||
|
|
@ -198,8 +200,8 @@ WUT_CHECK_SIZE(OSDynLoad_InternalData, 0x94);
|
||||||
|
|
||||||
typedef enum OSDynLoad_NotifyReason
|
typedef enum OSDynLoad_NotifyReason
|
||||||
{
|
{
|
||||||
OS_DYNLOAD_NOTIFY_UNLOADED = 0,
|
OS_DYNLOAD_NOTIFY_UNLOADED = 0,
|
||||||
OS_DYNLOAD_NOTIFY_LOADED = 1
|
OS_DYNLOAD_NOTIFY_LOADED = 1
|
||||||
} OSDynLoad_NotifyReason;
|
} OSDynLoad_NotifyReason;
|
||||||
|
|
||||||
typedef void (*OSDynLoadNotifyFunc)(OSDynLoad_Module module,
|
typedef void (*OSDynLoadNotifyFunc)(OSDynLoad_Module module,
|
||||||
|
|
@ -328,14 +330,14 @@ OSDynLoad_IsModuleLoaded(char const *name,
|
||||||
* Registers a callback that's called whenever a new .rpl is loaded or unloaded
|
* Registers a callback that's called whenever a new .rpl is loaded or unloaded
|
||||||
**/
|
**/
|
||||||
OSDynLoad_Error
|
OSDynLoad_Error
|
||||||
OSDynLoad_AddNotifyCallback(OSDynLoadNotifyFunc notifyFn,
|
OSDynLoad_AddNotifyCallback(OSDynLoadNotifyFunc notifyFn,
|
||||||
void *userContext);
|
void *userContext);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes a previously added a callback
|
* Removes a previously added a callback
|
||||||
**/
|
**/
|
||||||
OSDynLoad_Error
|
OSDynLoad_Error
|
||||||
OSDynLoad_DelNotifyCallback(OSDynLoadNotifyFunc notifyFn,
|
OSDynLoad_DelNotifyCallback(OSDynLoadNotifyFunc notifyFn,
|
||||||
void *userContext);
|
void *userContext);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@ typedef struct OSEvent OSEvent;
|
||||||
typedef enum OSEventMode
|
typedef enum OSEventMode
|
||||||
{
|
{
|
||||||
//! A manual event will only reset when OSResetEvent is called.
|
//! A manual event will only reset when OSResetEvent is called.
|
||||||
OS_EVENT_MODE_MANUAL = 0,
|
OS_EVENT_MODE_MANUAL = 0,
|
||||||
|
|
||||||
//! An auto event will reset everytime a thread is woken.
|
//! An auto event will reset everytime a thread is woken.
|
||||||
OS_EVENT_MODE_AUTO = 1,
|
OS_EVENT_MODE_AUTO = 1,
|
||||||
} OSEventMode;
|
} OSEventMode;
|
||||||
|
|
||||||
#define OS_EVENT_TAG 0x65566E54u
|
#define OS_EVENT_TAG 0x65566E54u
|
||||||
|
|
|
||||||
|
|
@ -16,30 +16,30 @@ typedef BOOL (*OSExceptionCallbackFn)(OSContext *context);
|
||||||
|
|
||||||
typedef enum OSExceptionMode
|
typedef enum OSExceptionMode
|
||||||
{
|
{
|
||||||
OS_EXCEPTION_MODE_SYSTEM = 0,
|
OS_EXCEPTION_MODE_SYSTEM = 0,
|
||||||
OS_EXCEPTION_MODE_THREAD = 1,
|
OS_EXCEPTION_MODE_THREAD = 1,
|
||||||
OS_EXCEPTION_MODE_GLOBAL = 2,
|
OS_EXCEPTION_MODE_GLOBAL = 2,
|
||||||
OS_EXCEPTION_MODE_THREAD_ALL_CORES = 3,
|
OS_EXCEPTION_MODE_THREAD_ALL_CORES = 3,
|
||||||
OS_EXCEPTION_MODE_GLOBAL_ALL_CORES = 4,
|
OS_EXCEPTION_MODE_GLOBAL_ALL_CORES = 4,
|
||||||
} OSExceptionMode;
|
} OSExceptionMode;
|
||||||
|
|
||||||
typedef enum OSExceptionType
|
typedef enum OSExceptionType
|
||||||
{
|
{
|
||||||
OS_EXCEPTION_TYPE_SYSTEM_RESET = 0,
|
OS_EXCEPTION_TYPE_SYSTEM_RESET = 0,
|
||||||
OS_EXCEPTION_TYPE_MACHINE_CHECK = 1,
|
OS_EXCEPTION_TYPE_MACHINE_CHECK = 1,
|
||||||
OS_EXCEPTION_TYPE_DSI = 2,
|
OS_EXCEPTION_TYPE_DSI = 2,
|
||||||
OS_EXCEPTION_TYPE_ISI = 3,
|
OS_EXCEPTION_TYPE_ISI = 3,
|
||||||
OS_EXCEPTION_TYPE_EXTERNAL_INTERRUPT = 4,
|
OS_EXCEPTION_TYPE_EXTERNAL_INTERRUPT = 4,
|
||||||
OS_EXCEPTION_TYPE_ALIGNMENT = 5,
|
OS_EXCEPTION_TYPE_ALIGNMENT = 5,
|
||||||
OS_EXCEPTION_TYPE_PROGRAM = 6,
|
OS_EXCEPTION_TYPE_PROGRAM = 6,
|
||||||
OS_EXCEPTION_TYPE_FLOATING_POINT = 7,
|
OS_EXCEPTION_TYPE_FLOATING_POINT = 7,
|
||||||
OS_EXCEPTION_TYPE_DECREMENTER = 8,
|
OS_EXCEPTION_TYPE_DECREMENTER = 8,
|
||||||
OS_EXCEPTION_TYPE_SYSTEM_CALL = 9,
|
OS_EXCEPTION_TYPE_SYSTEM_CALL = 9,
|
||||||
OS_EXCEPTION_TYPE_TRACE = 10,
|
OS_EXCEPTION_TYPE_TRACE = 10,
|
||||||
OS_EXCEPTION_TYPE_PERFORMANCE_MONITOR = 11,
|
OS_EXCEPTION_TYPE_PERFORMANCE_MONITOR = 11,
|
||||||
OS_EXCEPTION_TYPE_BREAKPOINT = 12,
|
OS_EXCEPTION_TYPE_BREAKPOINT = 12,
|
||||||
OS_EXCEPTION_TYPE_SYSTEM_INTERRUPT = 13,
|
OS_EXCEPTION_TYPE_SYSTEM_INTERRUPT = 13,
|
||||||
OS_EXCEPTION_TYPE_ICI = 14,
|
OS_EXCEPTION_TYPE_ICI = 14,
|
||||||
} OSExceptionType;
|
} OSExceptionType;
|
||||||
|
|
||||||
OSExceptionCallbackFn
|
OSExceptionCallbackFn
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,10 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
void
|
void
|
||||||
RPLWRAP(exit)(int code);
|
RPLWRAP(exit)(int code);
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
void
|
void
|
||||||
_Exit(int code);
|
_Exit(int code);
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef void (*OSFiberEntryFn)();
|
typedef void (*OSFiberEntryFn)();
|
||||||
typedef void (*OSFiberExEntryFn)(uint32_t arg1, uint32_t arg2,
|
typedef void (*OSFiberExEntryFn)(uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4);
|
||||||
uint32_t arg3, uint32_t arg4);
|
|
||||||
|
|
||||||
int32_t
|
int32_t
|
||||||
OSSwitchFiber(OSFiberEntryFn entry,
|
OSSwitchFiber(OSFiberEntryFn entry,
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
|
#include <coreinit/alarm.h>
|
||||||
|
#include <coreinit/fastmutex.h>
|
||||||
|
#include <coreinit/ios.h>
|
||||||
#include <coreinit/messagequeue.h>
|
#include <coreinit/messagequeue.h>
|
||||||
#include <coreinit/time.h>
|
#include <coreinit/time.h>
|
||||||
#include <coreinit/ios.h>
|
|
||||||
#include <coreinit/fastmutex.h>
|
|
||||||
#include <coreinit/alarm.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup coreinit_fs Filesystem
|
* \defgroup coreinit_fs Filesystem
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FS_MAX_PATH (0x27F)
|
#define FS_MAX_PATH (0x27F)
|
||||||
#define FS_MODE_LENGTH (0x10)
|
#define FS_MODE_LENGTH (0x10)
|
||||||
|
|
||||||
typedef uint32_t FSDirectoryHandle;
|
typedef uint32_t FSDirectoryHandle;
|
||||||
|
|
@ -52,100 +52,100 @@ typedef struct FSVolumeInfo FSVolumeInfo;
|
||||||
|
|
||||||
typedef enum FSErrorFlag
|
typedef enum FSErrorFlag
|
||||||
{
|
{
|
||||||
FS_ERROR_FLAG_NONE = 0x0,
|
FS_ERROR_FLAG_NONE = 0x0,
|
||||||
FS_ERROR_FLAG_MAX = 0x1,
|
FS_ERROR_FLAG_MAX = 0x1,
|
||||||
FS_ERROR_FLAG_ALREADY_OPEN = 0x2,
|
FS_ERROR_FLAG_ALREADY_OPEN = 0x2,
|
||||||
FS_ERROR_FLAG_EXISTS = 0x4,
|
FS_ERROR_FLAG_EXISTS = 0x4,
|
||||||
FS_ERROR_FLAG_NOT_FOUND = 0x8,
|
FS_ERROR_FLAG_NOT_FOUND = 0x8,
|
||||||
FS_ERROR_FLAG_NOT_FILE = 0x10,
|
FS_ERROR_FLAG_NOT_FILE = 0x10,
|
||||||
FS_ERROR_FLAG_NOT_DIR = 0x20,
|
FS_ERROR_FLAG_NOT_DIR = 0x20,
|
||||||
FS_ERROR_FLAG_ACCESS_ERROR = 0x40,
|
FS_ERROR_FLAG_ACCESS_ERROR = 0x40,
|
||||||
FS_ERROR_FLAG_PERMISSION_ERROR = 0x80,
|
FS_ERROR_FLAG_PERMISSION_ERROR = 0x80,
|
||||||
FS_ERROR_FLAG_FILE_TOO_BIG = 0x100,
|
FS_ERROR_FLAG_FILE_TOO_BIG = 0x100,
|
||||||
FS_ERROR_FLAG_STORAGE_FULL = 0x200,
|
FS_ERROR_FLAG_STORAGE_FULL = 0x200,
|
||||||
FS_ERROR_FLAG_UNSUPPORTED_CMD = 0x400,
|
FS_ERROR_FLAG_UNSUPPORTED_CMD = 0x400,
|
||||||
FS_ERROR_FLAG_JOURNAL_FULL = 0x800,
|
FS_ERROR_FLAG_JOURNAL_FULL = 0x800,
|
||||||
FS_ERROR_FLAG_ALL = 0xFFFFFFFF,
|
FS_ERROR_FLAG_ALL = 0xFFFFFFFF,
|
||||||
} FSErrorFlag;
|
} FSErrorFlag;
|
||||||
|
|
||||||
typedef enum FSStatus
|
typedef enum FSStatus
|
||||||
{
|
{
|
||||||
FS_STATUS_OK = 0,
|
FS_STATUS_OK = 0,
|
||||||
FS_STATUS_CANCELLED = -1,
|
FS_STATUS_CANCELLED = -1,
|
||||||
FS_STATUS_END = -2,
|
FS_STATUS_END = -2,
|
||||||
FS_STATUS_MAX = -3,
|
FS_STATUS_MAX = -3,
|
||||||
FS_STATUS_ALREADY_OPEN = -4,
|
FS_STATUS_ALREADY_OPEN = -4,
|
||||||
FS_STATUS_EXISTS = -5,
|
FS_STATUS_EXISTS = -5,
|
||||||
FS_STATUS_NOT_FOUND = -6,
|
FS_STATUS_NOT_FOUND = -6,
|
||||||
FS_STATUS_NOT_FILE = -7,
|
FS_STATUS_NOT_FILE = -7,
|
||||||
FS_STATUS_NOT_DIR = -8,
|
FS_STATUS_NOT_DIR = -8,
|
||||||
FS_STATUS_ACCESS_ERROR = -9,
|
FS_STATUS_ACCESS_ERROR = -9,
|
||||||
FS_STATUS_PERMISSION_ERROR = -10,
|
FS_STATUS_PERMISSION_ERROR = -10,
|
||||||
FS_STATUS_FILE_TOO_BIG = -11,
|
FS_STATUS_FILE_TOO_BIG = -11,
|
||||||
FS_STATUS_STORAGE_FULL = -12,
|
FS_STATUS_STORAGE_FULL = -12,
|
||||||
FS_STATUS_JOURNAL_FULL = -13,
|
FS_STATUS_JOURNAL_FULL = -13,
|
||||||
FS_STATUS_UNSUPPORTED_CMD = -14,
|
FS_STATUS_UNSUPPORTED_CMD = -14,
|
||||||
FS_STATUS_MEDIA_NOT_READY = -15,
|
FS_STATUS_MEDIA_NOT_READY = -15,
|
||||||
FS_STATUS_MEDIA_ERROR = -17,
|
FS_STATUS_MEDIA_ERROR = -17,
|
||||||
FS_STATUS_CORRUPTED = -18,
|
FS_STATUS_CORRUPTED = -18,
|
||||||
FS_STATUS_FATAL_ERROR = -0x400,
|
FS_STATUS_FATAL_ERROR = -0x400,
|
||||||
} FSStatus;
|
} FSStatus;
|
||||||
|
|
||||||
typedef enum FSError
|
typedef enum FSError
|
||||||
{
|
{
|
||||||
FS_ERROR_OK = 0,
|
FS_ERROR_OK = 0,
|
||||||
FS_ERROR_NOT_INIT = -0x30001,
|
FS_ERROR_NOT_INIT = -0x30001,
|
||||||
FS_ERROR_BUSY = -0x30002,
|
FS_ERROR_BUSY = -0x30002,
|
||||||
FS_ERROR_CANCELLED = -0x30003,
|
FS_ERROR_CANCELLED = -0x30003,
|
||||||
FS_ERROR_END_OF_DIR = -0x30004,
|
FS_ERROR_END_OF_DIR = -0x30004,
|
||||||
FS_ERROR_END_OF_FILE = -0x30005,
|
FS_ERROR_END_OF_FILE = -0x30005,
|
||||||
FS_ERROR_MAX_MOUNT_POINTS = -0x30010,
|
FS_ERROR_MAX_MOUNT_POINTS = -0x30010,
|
||||||
FS_ERROR_MAX_VOLUMES = -0x30011,
|
FS_ERROR_MAX_VOLUMES = -0x30011,
|
||||||
FS_ERROR_MAX_CLIENTS = -0x30012,
|
FS_ERROR_MAX_CLIENTS = -0x30012,
|
||||||
FS_ERROR_MAX_FILES = -0x30013,
|
FS_ERROR_MAX_FILES = -0x30013,
|
||||||
FS_ERROR_MAX_DIRS = -0x30014,
|
FS_ERROR_MAX_DIRS = -0x30014,
|
||||||
FS_ERROR_ALREADY_OPEN = -0x30015,
|
FS_ERROR_ALREADY_OPEN = -0x30015,
|
||||||
FS_ERROR_ALREADY_EXISTS = -0x30016,
|
FS_ERROR_ALREADY_EXISTS = -0x30016,
|
||||||
FS_ERROR_NOT_FOUND = -0x30017,
|
FS_ERROR_NOT_FOUND = -0x30017,
|
||||||
FS_ERROR_NOT_EMPTY = -0x30018,
|
FS_ERROR_NOT_EMPTY = -0x30018,
|
||||||
FS_ERROR_ACCESS_ERROR = -0x30019,
|
FS_ERROR_ACCESS_ERROR = -0x30019,
|
||||||
FS_ERROR_PERMISSION_ERROR = -0x3001A,
|
FS_ERROR_PERMISSION_ERROR = -0x3001A,
|
||||||
FS_ERROR_DATA_CORRUPTED = -0x3001B,
|
FS_ERROR_DATA_CORRUPTED = -0x3001B,
|
||||||
FS_ERROR_STORAGE_FULL = -0x3001C,
|
FS_ERROR_STORAGE_FULL = -0x3001C,
|
||||||
FS_ERROR_JOURNAL_FULL = -0x3001D,
|
FS_ERROR_JOURNAL_FULL = -0x3001D,
|
||||||
FS_ERROR_UNAVAILABLE_COMMAND = -0x3001F,
|
FS_ERROR_UNAVAILABLE_COMMAND = -0x3001F,
|
||||||
FS_ERROR_UNSUPPORTED_COMMAND = -0x30020,
|
FS_ERROR_UNSUPPORTED_COMMAND = -0x30020,
|
||||||
FS_ERROR_INVALID_PARAM = -0x30021,
|
FS_ERROR_INVALID_PARAM = -0x30021,
|
||||||
FS_ERROR_INVALID_PATH = -0x30022,
|
FS_ERROR_INVALID_PATH = -0x30022,
|
||||||
FS_ERROR_INVALID_BUFFER = -0x30023,
|
FS_ERROR_INVALID_BUFFER = -0x30023,
|
||||||
FS_ERROR_INVALID_ALIGNMENT = -0x30024,
|
FS_ERROR_INVALID_ALIGNMENT = -0x30024,
|
||||||
FS_ERROR_INVALID_CLIENTHANDLE = -0x30025,
|
FS_ERROR_INVALID_CLIENTHANDLE = -0x30025,
|
||||||
FS_ERROR_INVALID_FILEHANDLE = -0x30026,
|
FS_ERROR_INVALID_FILEHANDLE = -0x30026,
|
||||||
FS_ERROR_INVALID_DIRHANDLE = -0x30027,
|
FS_ERROR_INVALID_DIRHANDLE = -0x30027,
|
||||||
FS_ERROR_NOT_FILE = -0x30028,
|
FS_ERROR_NOT_FILE = -0x30028,
|
||||||
FS_ERROR_NOT_DIR = -0x30029,
|
FS_ERROR_NOT_DIR = -0x30029,
|
||||||
FS_ERROR_FILE_TOO_BIG = -0x3002A,
|
FS_ERROR_FILE_TOO_BIG = -0x3002A,
|
||||||
FS_ERROR_OUT_OF_RANGE = -0x3002B,
|
FS_ERROR_OUT_OF_RANGE = -0x3002B,
|
||||||
FS_ERROR_OUT_OF_RESOURCES = -0x3002C,
|
FS_ERROR_OUT_OF_RESOURCES = -0x3002C,
|
||||||
FS_ERROR_MEDIA_NOT_READY = -0x30040,
|
FS_ERROR_MEDIA_NOT_READY = -0x30040,
|
||||||
FS_ERROR_MEDIA_ERROR = -0x30041,
|
FS_ERROR_MEDIA_ERROR = -0x30041,
|
||||||
FS_ERROR_WRITE_PROTECTED = -0x30042,
|
FS_ERROR_WRITE_PROTECTED = -0x30042,
|
||||||
FS_ERROR_INVALID_MEDIA = -0x30043,
|
FS_ERROR_INVALID_MEDIA = -0x30043,
|
||||||
} FSError;
|
} FSError;
|
||||||
|
|
||||||
typedef enum FSMode
|
typedef enum FSMode
|
||||||
{
|
{
|
||||||
FS_MODE_READ_OWNER = 0x400,
|
FS_MODE_READ_OWNER = 0x400,
|
||||||
FS_MODE_WRITE_OWNER = 0x200,
|
FS_MODE_WRITE_OWNER = 0x200,
|
||||||
FS_MODE_EXEC_OWNER = 0x100,
|
FS_MODE_EXEC_OWNER = 0x100,
|
||||||
|
|
||||||
FS_MODE_READ_GROUP = 0x040,
|
FS_MODE_READ_GROUP = 0x040,
|
||||||
FS_MODE_WRITE_GROUP = 0x020,
|
FS_MODE_WRITE_GROUP = 0x020,
|
||||||
FS_MODE_EXEC_GROUP = 0x010,
|
FS_MODE_EXEC_GROUP = 0x010,
|
||||||
|
|
||||||
FS_MODE_READ_OTHER = 0x004,
|
FS_MODE_READ_OTHER = 0x004,
|
||||||
FS_MODE_WRITE_OTHER = 0x002,
|
FS_MODE_WRITE_OTHER = 0x002,
|
||||||
FS_MODE_EXEC_OTHER = 0x001,
|
FS_MODE_EXEC_OTHER = 0x001,
|
||||||
} FSMode;
|
} FSMode;
|
||||||
|
|
||||||
//! Flags for \link FSStat \endlink.
|
//! Flags for \link FSStat \endlink.
|
||||||
|
|
@ -153,81 +153,84 @@ typedef enum FSMode
|
||||||
typedef enum FSStatFlags
|
typedef enum FSStatFlags
|
||||||
{
|
{
|
||||||
//! The retrieved file entry is a (link to a) directory.
|
//! The retrieved file entry is a (link to a) directory.
|
||||||
FS_STAT_DIRECTORY = 0x80000000,
|
FS_STAT_DIRECTORY = 0x80000000,
|
||||||
//! The retrieved file entry also has a quota set.
|
//! The retrieved file entry also has a quota set.
|
||||||
FS_STAT_QUOTA = 0x60000000,
|
FS_STAT_QUOTA = 0x60000000,
|
||||||
//! The retrieved file entry is a (link to a) file.
|
//! The retrieved file entry is a (link to a) file.
|
||||||
FS_STAT_FILE = 0x01000000,
|
FS_STAT_FILE = 0x01000000,
|
||||||
//! The retrieved file entry also is encrypted and can't be opened (see vWii files for example).
|
//! The retrieved file entry also is encrypted and can't be opened (see vWii files for example).
|
||||||
FS_STAT_ENCRYPTED_FILE = 0x00800000,
|
FS_STAT_ENCRYPTED_FILE = 0x00800000,
|
||||||
//! The retrieved file entry also is a link to a different file on the filesystem.
|
//! The retrieved file entry also is a link to a different file on the filesystem.
|
||||||
//! Note: It's currently not known how one can read the linked-to file entry.
|
//! Note: It's currently not known how one can read the linked-to file entry.
|
||||||
FS_STAT_LINK = 0x00010000,
|
FS_STAT_LINK = 0x00010000,
|
||||||
} FSStatFlags;
|
} FSStatFlags;
|
||||||
|
|
||||||
typedef enum FSVolumeState
|
typedef enum FSVolumeState
|
||||||
{
|
{
|
||||||
FS_VOLUME_STATE_INITIAL = 0,
|
FS_VOLUME_STATE_INITIAL = 0,
|
||||||
FS_VOLUME_STATE_READY = 1,
|
FS_VOLUME_STATE_READY = 1,
|
||||||
FS_VOLUME_STATE_NO_MEDIA = 2,
|
FS_VOLUME_STATE_NO_MEDIA = 2,
|
||||||
FS_VOLUME_STATE_INVALID_MEDIA = 3,
|
FS_VOLUME_STATE_INVALID_MEDIA = 3,
|
||||||
FS_VOLUME_STATE_DIRTY_MEDIA = 4,
|
FS_VOLUME_STATE_DIRTY_MEDIA = 4,
|
||||||
FS_VOLUME_STATE_WRONG_MEDIA = 5,
|
FS_VOLUME_STATE_WRONG_MEDIA = 5,
|
||||||
FS_VOLUME_STATE_MEDIA_ERROR = 6,
|
FS_VOLUME_STATE_MEDIA_ERROR = 6,
|
||||||
FS_VOLUME_STATE_DATA_CORRUPTED = 7,
|
FS_VOLUME_STATE_DATA_CORRUPTED = 7,
|
||||||
FS_VOLUME_STATE_WRITE_PROTECTED = 8,
|
FS_VOLUME_STATE_WRITE_PROTECTED = 8,
|
||||||
FS_VOLUME_STATE_JOURNAL_FULL = 9,
|
FS_VOLUME_STATE_JOURNAL_FULL = 9,
|
||||||
FS_VOLUME_STATE_FATAL = 10,
|
FS_VOLUME_STATE_FATAL = 10,
|
||||||
FS_VOLUME_STATE_INVALID = 11,
|
FS_VOLUME_STATE_INVALID = 11,
|
||||||
} FSVolumeState;
|
} FSVolumeState;
|
||||||
|
|
||||||
typedef enum FSMediaState {
|
typedef enum FSMediaState
|
||||||
FS_MEDIA_STATE_READY = 0,
|
{
|
||||||
FS_MEDIA_STATE_NO_MEDIA = 1,
|
FS_MEDIA_STATE_READY = 0,
|
||||||
FS_MEDIA_STATE_INVALID_MEDIA = 2,
|
FS_MEDIA_STATE_NO_MEDIA = 1,
|
||||||
FS_MEDIA_STATE_DIRTY_MEDIA = 3,
|
FS_MEDIA_STATE_INVALID_MEDIA = 2,
|
||||||
FS_MEDIA_STATE_MEDIA_ERROR = 4,
|
FS_MEDIA_STATE_DIRTY_MEDIA = 3,
|
||||||
|
FS_MEDIA_STATE_MEDIA_ERROR = 4,
|
||||||
} FSMediaState;
|
} FSMediaState;
|
||||||
|
|
||||||
typedef enum FSMountSourceType {
|
typedef enum FSMountSourceType
|
||||||
FS_MOUNT_SOURCE_SD = 0,
|
{
|
||||||
FS_MOUNT_SOURCE_UNK = 1,
|
FS_MOUNT_SOURCE_SD = 0,
|
||||||
|
//! Devkit only API currently. Uses the PCFS channel to perform I/O operations on the attached host machine.
|
||||||
|
FS_MOUNT_SOURCE_HFIO = 1,
|
||||||
} FSMountSourceType;
|
} FSMountSourceType;
|
||||||
|
|
||||||
typedef enum FSOpenFileFlags
|
typedef enum FSOpenFileFlags
|
||||||
{
|
{
|
||||||
//! Open file normally
|
//! Open file normally
|
||||||
FS_OPEN_FLAG_NONE = (0 << 0),
|
FS_OPEN_FLAG_NONE = (0 << 0),
|
||||||
//! Open (new) unencrypted file. Used for vWii files since it allows for direct access without the Wii U filesystem through it's block address.
|
//! Open (new) unencrypted file. Used for vWii files since it allows for direct access without the Wii U filesystem through it's block address.
|
||||||
FS_OPEN_FLAG_UNENCRYPTED = (1 << 0),
|
FS_OPEN_FLAG_UNENCRYPTED = (1 << 0),
|
||||||
//! Preallocates new file size using given size
|
//! Preallocates new file size using given size
|
||||||
FS_OPEN_FLAG_PREALLOC_SIZE = (1 << 1)
|
FS_OPEN_FLAG_PREALLOC_SIZE = (1 << 1)
|
||||||
} FSOpenFileFlags;
|
} FSOpenFileFlags;
|
||||||
|
|
||||||
typedef void(*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
|
typedef void (*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
|
||||||
typedef void(*FSStateChangeCallback)(FSClient *, FSVolumeState, void *);
|
typedef void (*FSStateChangeCallback)(FSClient *, FSVolumeState, void *);
|
||||||
|
|
||||||
struct FSFsm
|
struct FSFsm
|
||||||
{
|
{
|
||||||
WUT_UNKNOWN_BYTES(0x38);
|
WUT_UNKNOWN_BYTES(0x38);
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(FSFsm, 0x38);
|
WUT_CHECK_SIZE(FSFsm, 0x38);
|
||||||
|
|
||||||
struct FSCmdQueue
|
struct FSCmdQueue
|
||||||
{
|
{
|
||||||
WUT_UNKNOWN_BYTES(0x44);
|
WUT_UNKNOWN_BYTES(0x44);
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(FSCmdQueue, 0x44);
|
WUT_CHECK_SIZE(FSCmdQueue, 0x44);
|
||||||
|
|
||||||
struct FSMessage
|
struct FSMessage
|
||||||
{
|
{
|
||||||
//! Message data
|
//! Message data
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
WUT_UNKNOWN_BYTES(8);
|
WUT_UNKNOWN_BYTES(8);
|
||||||
|
|
||||||
//! Type of message
|
//! Type of message
|
||||||
OSFunctionType type;
|
OSFunctionType type;
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(FSMessage, 0x00, data);
|
WUT_CHECK_OFFSET(FSMessage, 0x00, data);
|
||||||
WUT_CHECK_OFFSET(FSMessage, 0x0C, type);
|
WUT_CHECK_OFFSET(FSMessage, 0x0C, type);
|
||||||
|
|
@ -238,8 +241,8 @@ WUT_CHECK_SIZE(FSMessage, 0x10);
|
||||||
*/
|
*/
|
||||||
struct FSClientBodyLink
|
struct FSClientBodyLink
|
||||||
{
|
{
|
||||||
FSClientBody* next;
|
FSClientBody *next;
|
||||||
FSClientBody* prev;
|
FSClientBody *prev;
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(FSClientBodyLink, 0x00, next);
|
WUT_CHECK_OFFSET(FSClientBodyLink, 0x00, next);
|
||||||
WUT_CHECK_OFFSET(FSClientBodyLink, 0x04, prev);
|
WUT_CHECK_OFFSET(FSClientBodyLink, 0x04, prev);
|
||||||
|
|
@ -247,52 +250,52 @@ WUT_CHECK_SIZE(FSClientBodyLink, 0x8);
|
||||||
|
|
||||||
struct FSClientBody
|
struct FSClientBody
|
||||||
{
|
{
|
||||||
WUT_UNKNOWN_BYTES(0x1444);
|
WUT_UNKNOWN_BYTES(0x1444);
|
||||||
|
|
||||||
//! IOSHandle returned from fsaShimOpen.
|
//! IOSHandle returned from fsaShimOpen.
|
||||||
IOSHandle clientHandle;
|
IOSHandle clientHandle;
|
||||||
|
|
||||||
//! State machine.
|
//! State machine.
|
||||||
FSFsm fsm;
|
FSFsm fsm;
|
||||||
|
|
||||||
//! Command queue of FS commands.
|
//! Command queue of FS commands.
|
||||||
FSCmdQueue cmdQueue;
|
FSCmdQueue cmdQueue;
|
||||||
|
|
||||||
//! The last dequeued command.
|
//! The last dequeued command.
|
||||||
FSCmdBlockBody* lastDequeuedCommand;
|
FSCmdBlockBody *lastDequeuedCommand;
|
||||||
|
|
||||||
//! Emulated error, set with FSSetEmulatedError.
|
//! Emulated error, set with FSSetEmulatedError.
|
||||||
FSError emulatedError;
|
FSError emulatedError;
|
||||||
|
|
||||||
WUT_UNKNOWN_BYTES(0x1560 - 0x14CC);
|
WUT_UNKNOWN_BYTES(0x1560 - 0x14CC);
|
||||||
|
|
||||||
//! Mutex used to protect FSClientBody data.
|
//! Mutex used to protect FSClientBody data.
|
||||||
OSFastMutex mutex;
|
OSFastMutex mutex;
|
||||||
|
|
||||||
WUT_UNKNOWN_BYTES(4);
|
WUT_UNKNOWN_BYTES(4);
|
||||||
|
|
||||||
//! Alarm used by fsm for unknown reasons.
|
//! Alarm used by fsm for unknown reasons.
|
||||||
OSAlarm fsmAlarm;
|
OSAlarm fsmAlarm;
|
||||||
|
|
||||||
//! Error of last FS command.
|
//! Error of last FS command.
|
||||||
FSError lastError;
|
FSError lastError;
|
||||||
|
|
||||||
bool isLastErrorWithoutVolume;
|
bool isLastErrorWithoutVolume;
|
||||||
|
|
||||||
//! Message used to send FsCmdHandler message when FSA async callback is received.
|
//! Message used to send FsCmdHandler message when FSA async callback is received.
|
||||||
FSMessage fsCmdHandlerMsg;
|
FSMessage fsCmdHandlerMsg;
|
||||||
|
|
||||||
//! Device name of the last mount source returned by FSGetMountSourceNext.
|
//! Device name of the last mount source returned by FSGetMountSourceNext.
|
||||||
char lastMountSourceDevice[0x10];
|
char lastMountSourceDevice[0x10];
|
||||||
|
|
||||||
//! Mount source type to find with FSGetMountSourceNext.
|
//! Mount source type to find with FSGetMountSourceNext.
|
||||||
FSMountSourceType findMountSourceType;
|
FSMountSourceType findMountSourceType;
|
||||||
|
|
||||||
//! Link used for linked list of clients.
|
//! Link used for linked list of clients.
|
||||||
FSClientBodyLink link;
|
FSClientBodyLink link;
|
||||||
|
|
||||||
//! Pointer to unaligned FSClient structure.
|
//! Pointer to unaligned FSClient structure.
|
||||||
FSClient* client;
|
FSClient *client;
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(FSClientBody, 0x1444, clientHandle);
|
WUT_CHECK_OFFSET(FSClientBody, 0x1444, clientHandle);
|
||||||
WUT_CHECK_OFFSET(FSClientBody, 0x1448, fsm);
|
WUT_CHECK_OFFSET(FSClientBody, 0x1448, fsm);
|
||||||
|
|
@ -397,10 +400,11 @@ WUT_CHECK_OFFSET(FSAsyncResult, 0x20, block);
|
||||||
WUT_CHECK_OFFSET(FSAsyncResult, 0x24, status);
|
WUT_CHECK_OFFSET(FSAsyncResult, 0x24, status);
|
||||||
WUT_CHECK_SIZE(FSAsyncResult, 0x28);
|
WUT_CHECK_SIZE(FSAsyncResult, 0x28);
|
||||||
|
|
||||||
struct FSCmdBlockBody {
|
struct FSCmdBlockBody
|
||||||
WUT_UNKNOWN_BYTES(0x96C);
|
{
|
||||||
FSAsyncResult asyncResult;
|
WUT_UNKNOWN_BYTES(0x96C);
|
||||||
WUT_UNKNOWN_BYTES(0x68);
|
FSAsyncResult asyncResult;
|
||||||
|
WUT_UNKNOWN_BYTES(0x68);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(FSCmdBlockBody, 0x96C, asyncResult);
|
WUT_CHECK_OFFSET(FSCmdBlockBody, 0x96C, asyncResult);
|
||||||
WUT_CHECK_SIZE(FSCmdBlockBody, 0x9FC);
|
WUT_CHECK_SIZE(FSCmdBlockBody, 0x9FC);
|
||||||
|
|
@ -419,19 +423,20 @@ struct FSMountSource
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(FSMountSource, 0x300);
|
WUT_CHECK_SIZE(FSMountSource, 0x300);
|
||||||
|
|
||||||
struct WUT_PACKED FSVolumeInfo {
|
struct WUT_PACKED FSVolumeInfo
|
||||||
uint32_t flags;
|
{
|
||||||
FSMediaState mediaState;
|
uint32_t flags;
|
||||||
WUT_UNKNOWN_BYTES(0x4);
|
FSMediaState mediaState;
|
||||||
uint32_t unk0x0C;
|
WUT_UNKNOWN_BYTES(0x4);
|
||||||
uint32_t unk0x10;
|
uint32_t unk0x0C;
|
||||||
int32_t unk0x14;
|
uint32_t unk0x10;
|
||||||
int32_t unk0x18;
|
int32_t unk0x14;
|
||||||
WUT_UNKNOWN_BYTES(0x10);
|
int32_t unk0x18;
|
||||||
char volumeLabel[128];
|
WUT_UNKNOWN_BYTES(0x10);
|
||||||
char volumeId[128];
|
char volumeLabel[128];
|
||||||
char devicePath[16];
|
char volumeId[128];
|
||||||
char mountPath[128];
|
char devicePath[16];
|
||||||
|
char mountPath[128];
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(FSVolumeInfo, 0x00, flags);
|
WUT_CHECK_OFFSET(FSVolumeInfo, 0x00, flags);
|
||||||
WUT_CHECK_OFFSET(FSVolumeInfo, 0x04, mediaState);
|
WUT_CHECK_OFFSET(FSVolumeInfo, 0x04, mediaState);
|
||||||
|
|
@ -450,22 +455,24 @@ WUT_CHECK_SIZE(FSVolumeInfo, 444);
|
||||||
* Get an aligned FSClientBody from an FSClient.
|
* Get an aligned FSClientBody from an FSClient.
|
||||||
*/
|
*/
|
||||||
static inline FSClientBody *
|
static inline FSClientBody *
|
||||||
FSGetClientBody(FSClient *client) {
|
FSGetClientBody(FSClient *client)
|
||||||
|
{
|
||||||
if (!client) {
|
if (!client) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return (FSClientBody *) ((((uint32_t) client) + 0x3F) & ~0x3F);
|
return (FSClientBody *)((((uint32_t)client) + 0x3F) & ~0x3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an aligned FSCmdBlockBody from an FSCmdBlock.
|
* Get an aligned FSCmdBlockBody from an FSCmdBlock.
|
||||||
*/
|
*/
|
||||||
static inline FSCmdBlockBody *
|
static inline FSCmdBlockBody *
|
||||||
FSGetCmdBlockBody(FSCmdBlock *cmdBlock) {
|
FSGetCmdBlockBody(FSCmdBlock *cmdBlock)
|
||||||
|
{
|
||||||
if (!cmdBlock) {
|
if (!cmdBlock) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return (FSCmdBlockBody *) ((((uint32_t) cmdBlock) + 0x3F) & ~0x3F);
|
return (FSCmdBlockBody *)((((uint32_t)cmdBlock) + 0x3F) & ~0x3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -536,16 +543,16 @@ FSGetStatAsync(FSClient *client,
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSRemove(FSClient *client,
|
FSRemove(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
const char *path,
|
const char *path,
|
||||||
FSErrorFlag errorMask);
|
FSErrorFlag errorMask);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSRemoveAsync(FSClient *client,
|
FSRemoveAsync(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
const char *path,
|
const char *path,
|
||||||
FSErrorFlag errorMask,
|
FSErrorFlag errorMask,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
|
|
@ -624,10 +631,10 @@ FSMakeDir(FSClient *client,
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSMakeDirAsync(FSClient *client,
|
FSMakeDirAsync(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
const char *path,
|
const char *path,
|
||||||
FSErrorFlag errorMask,
|
FSErrorFlag errorMask,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSReadDir(FSClient *client,
|
FSReadDir(FSClient *client,
|
||||||
|
|
@ -646,9 +653,9 @@ FSReadDirAsync(FSClient *client,
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSRewindDir(FSClient *client,
|
FSRewindDir(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
FSDirectoryHandle handle,
|
FSDirectoryHandle handle,
|
||||||
FSErrorFlag errorMask);
|
FSErrorFlag errorMask);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSCloseDir(FSClient *client,
|
FSCloseDir(FSClient *client,
|
||||||
|
|
@ -657,18 +664,18 @@ FSCloseDir(FSClient *client,
|
||||||
FSErrorFlag errorMask);
|
FSErrorFlag errorMask);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSGetVolumeInfo(FSClient *client,
|
FSGetVolumeInfo(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
const char *path,
|
const char *path,
|
||||||
FSVolumeInfo *volumeInfo,
|
FSVolumeInfo *volumeInfo,
|
||||||
FSErrorFlag errorMask);
|
FSErrorFlag errorMask);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSGetVolumeInfoAsync(FSClient *client,
|
FSGetVolumeInfoAsync(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
const char *path,
|
const char *path,
|
||||||
FSVolumeInfo *volumeInfo,
|
FSVolumeInfo *volumeInfo,
|
||||||
FSErrorFlag errorMask,
|
FSErrorFlag errorMask,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
|
|
@ -770,47 +777,47 @@ FSReadFileWithPosAsync(FSClient *client,
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSWriteFile(FSClient *client,
|
FSWriteFile(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
uint8_t *buffer,
|
uint8_t *buffer,
|
||||||
uint32_t size,
|
uint32_t size,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
FSFileHandle handle,
|
FSFileHandle handle,
|
||||||
uint32_t unk1,
|
uint32_t unk1,
|
||||||
FSErrorFlag errorMask);
|
FSErrorFlag errorMask);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSWriteFileAsync(FSClient *client,
|
FSWriteFileAsync(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
uint8_t *buffer,
|
uint8_t *buffer,
|
||||||
uint32_t size,
|
uint32_t size,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
FSFileHandle handle,
|
FSFileHandle handle,
|
||||||
uint32_t unk1,
|
uint32_t unk1,
|
||||||
FSErrorFlag errorMask,
|
FSErrorFlag errorMask,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSWriteFileWithPos(FSClient *client,
|
FSWriteFileWithPos(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
uint8_t *buffer,
|
uint8_t *buffer,
|
||||||
uint32_t size,
|
uint32_t size,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
uint32_t pos,
|
uint32_t pos,
|
||||||
FSFileHandle handle,
|
FSFileHandle handle,
|
||||||
uint32_t unk1,
|
uint32_t unk1,
|
||||||
FSErrorFlag errorMask);
|
FSErrorFlag errorMask);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSWriteFileWithPosAsync(FSClient *client,
|
FSWriteFileWithPosAsync(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
uint8_t *buffer,
|
uint8_t *buffer,
|
||||||
uint32_t size,
|
uint32_t size,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
uint32_t pos,
|
uint32_t pos,
|
||||||
FSFileHandle handle,
|
FSFileHandle handle,
|
||||||
uint32_t unk1,
|
uint32_t unk1,
|
||||||
FSErrorFlag errorMask,
|
FSErrorFlag errorMask,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSGetPosFile(FSClient *client,
|
FSGetPosFile(FSClient *client,
|
||||||
|
|
@ -844,44 +851,44 @@ FSSetPosFileAsync(FSClient *client,
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSFlushFile(FSClient *client,
|
FSFlushFile(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
FSFileHandle handle,
|
FSFileHandle handle,
|
||||||
FSErrorFlag errorMask);
|
FSErrorFlag errorMask);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSFlushFileAsync(FSClient *client,
|
FSFlushFileAsync(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
FSFileHandle handle,
|
FSFileHandle handle,
|
||||||
FSErrorFlag errorMask,
|
FSErrorFlag errorMask,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSTruncateFile(FSClient *client,
|
FSTruncateFile(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
FSFileHandle handle,
|
FSFileHandle handle,
|
||||||
FSErrorFlag errorMask);
|
FSErrorFlag errorMask);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSTruncateFileAsync(FSClient *client,
|
FSTruncateFileAsync(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
FSFileHandle handle,
|
FSFileHandle handle,
|
||||||
FSErrorFlag errorMask,
|
FSErrorFlag errorMask,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSRename(FSClient *client,
|
FSRename(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
const char *oldPath,
|
const char *oldPath,
|
||||||
const char *newPath,
|
const char *newPath,
|
||||||
FSErrorFlag errorMask);
|
FSErrorFlag errorMask);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSRenameAsync(FSClient *client,
|
FSRenameAsync(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
const char *oldPath,
|
const char *oldPath,
|
||||||
const char *newPath,
|
const char *newPath,
|
||||||
FSErrorFlag errorMask,
|
FSErrorFlag errorMask,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
FSVolumeState
|
FSVolumeState
|
||||||
FSGetVolumeState(FSClient *client);
|
FSGetVolumeState(FSClient *client);
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -30,12 +30,12 @@ typedef enum IMPadType
|
||||||
|
|
||||||
typedef enum IMDeviceState
|
typedef enum IMDeviceState
|
||||||
{
|
{
|
||||||
IM_DEVICE_STATE_CLEAR = 0,
|
IM_DEVICE_STATE_CLEAR = 0,
|
||||||
IM_DEVICE_STATE_INACTIVE = 1,
|
IM_DEVICE_STATE_INACTIVE = 1,
|
||||||
IM_DEVICE_STATE_ACTIVE = 2,
|
IM_DEVICE_STATE_ACTIVE = 2,
|
||||||
IM_DEVICE_STATE_HOME = 3,
|
IM_DEVICE_STATE_HOME = 3,
|
||||||
IM_DEVICE_STATE_POWER = 4,
|
IM_DEVICE_STATE_POWER = 4,
|
||||||
IM_DEVICE_STATE_SYNC = 5,
|
IM_DEVICE_STATE_SYNC = 5,
|
||||||
} IMDeviceState;
|
} IMDeviceState;
|
||||||
|
|
||||||
struct WUT_PACKED IMRequest
|
struct WUT_PACKED IMRequest
|
||||||
|
|
@ -97,18 +97,18 @@ WUT_CHECK_SIZE(IMDeviceStateEx, 0xC);
|
||||||
|
|
||||||
typedef enum IMParameter
|
typedef enum IMParameter
|
||||||
{
|
{
|
||||||
IM_PARAMETER_INACTIVE_SECONDS = 0,
|
IM_PARAMETER_INACTIVE_SECONDS = 0,
|
||||||
IM_PARAMETER_DIM_ENABLED = 1,
|
IM_PARAMETER_DIM_ENABLED = 1,
|
||||||
IM_PARAMETER_DIM_PERIOD = 2,
|
IM_PARAMETER_DIM_PERIOD = 2,
|
||||||
IM_PARAMETER_APD_ENABLED = 3,
|
IM_PARAMETER_APD_ENABLED = 3,
|
||||||
IM_PARAMETER_APD_PERIOD = 4,
|
IM_PARAMETER_APD_PERIOD = 4,
|
||||||
IM_PARAMETER_RESET_ENABLE = 5,
|
IM_PARAMETER_RESET_ENABLE = 5,
|
||||||
IM_PARAMETER_RESET_SECONDS = 6,
|
IM_PARAMETER_RESET_SECONDS = 6,
|
||||||
IM_PARAMETER_POWER_OFF_ENABLE = 7,
|
IM_PARAMETER_POWER_OFF_ENABLE = 7,
|
||||||
IM_PARAMETER_APD_OCCURED = 8,
|
IM_PARAMETER_APD_OCCURED = 8,
|
||||||
IM_PARAMETER_DIM_ENABLE_TV = 9,
|
IM_PARAMETER_DIM_ENABLE_TV = 9,
|
||||||
IM_PARAMETER_DIM_ENABLE_DRC = 10,
|
IM_PARAMETER_DIM_ENABLE_DRC = 10,
|
||||||
IM_PARAMETER_MAX = 11,
|
IM_PARAMETER_MAX = 11,
|
||||||
} IMParameter;
|
} IMParameter;
|
||||||
|
|
||||||
typedef enum IMTimer
|
typedef enum IMTimer
|
||||||
|
|
@ -158,7 +158,7 @@ IM_GetParameter(IOSHandle handle,
|
||||||
void *asyncCallbackContext);
|
void *asyncCallbackContext);
|
||||||
|
|
||||||
IOSError
|
IOSError
|
||||||
IM_GetParameters(IMParameters* parameters);
|
IM_GetParameters(IMParameters *parameters);
|
||||||
|
|
||||||
IOSError
|
IOSError
|
||||||
IM_GetNvParameter(IOSHandle handle,
|
IM_GetNvParameter(IOSHandle handle,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,11 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ typedef enum OSInterruptType
|
||||||
OS_INTERRUPT_TYPE_AHB = 12
|
OS_INTERRUPT_TYPE_AHB = 12
|
||||||
} OSInterruptType;
|
} OSInterruptType;
|
||||||
|
|
||||||
typedef void(*OSUserInterruptHandler)(OSInterruptType type, OSContext* interruptedContext);
|
typedef void (*OSUserInterruptHandler)(OSInterruptType type, OSContext *interruptedContext);
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
OSEnableInterrupts();
|
OSEnableInterrupts();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,56 +16,56 @@ typedef int32_t IOSHandle;
|
||||||
|
|
||||||
typedef enum IOSOpenMode
|
typedef enum IOSOpenMode
|
||||||
{
|
{
|
||||||
IOS_OPEN_READ = 1 << 0,
|
IOS_OPEN_READ = 1 << 0,
|
||||||
IOS_OPEN_WRITE = 1 << 1,
|
IOS_OPEN_WRITE = 1 << 1,
|
||||||
IOS_OPEN_READWRITE = IOS_OPEN_READ | IOS_OPEN_WRITE,
|
IOS_OPEN_READWRITE = IOS_OPEN_READ | IOS_OPEN_WRITE,
|
||||||
} IOSOpenMode;
|
} IOSOpenMode;
|
||||||
|
|
||||||
typedef enum IOSError
|
typedef enum IOSError
|
||||||
{
|
{
|
||||||
IOS_ERROR_OK = 0,
|
IOS_ERROR_OK = 0,
|
||||||
IOS_ERROR_ACCESS = -1,
|
IOS_ERROR_ACCESS = -1,
|
||||||
IOS_ERROR_EXISTS = -2,
|
IOS_ERROR_EXISTS = -2,
|
||||||
IOS_ERROR_INTR = -3,
|
IOS_ERROR_INTR = -3,
|
||||||
IOS_ERROR_INVALID = -4,
|
IOS_ERROR_INVALID = -4,
|
||||||
IOS_ERROR_MAX = -5,
|
IOS_ERROR_MAX = -5,
|
||||||
IOS_ERROR_NOEXISTS = -6,
|
IOS_ERROR_NOEXISTS = -6,
|
||||||
IOS_ERROR_QEMPTY = -7,
|
IOS_ERROR_QEMPTY = -7,
|
||||||
IOS_ERROR_QFULL = -8,
|
IOS_ERROR_QFULL = -8,
|
||||||
IOS_ERROR_UNKNOWN = -9,
|
IOS_ERROR_UNKNOWN = -9,
|
||||||
IOS_ERROR_NOTREADY = -10,
|
IOS_ERROR_NOTREADY = -10,
|
||||||
IOS_ERROR_ECC = -11,
|
IOS_ERROR_ECC = -11,
|
||||||
IOS_ERROR_ECCCRIT = -12,
|
IOS_ERROR_ECCCRIT = -12,
|
||||||
IOS_ERROR_BADBLOCK = -13,
|
IOS_ERROR_BADBLOCK = -13,
|
||||||
IOS_ERROR_INVALIDOBJTYPE = -14,
|
IOS_ERROR_INVALIDOBJTYPE = -14,
|
||||||
IOS_ERROR_INVALIDRNG = -15,
|
IOS_ERROR_INVALIDRNG = -15,
|
||||||
IOS_ERROR_INVALIDFLAG = -16,
|
IOS_ERROR_INVALIDFLAG = -16,
|
||||||
IOS_ERROR_INVALIDFORMAT = -17,
|
IOS_ERROR_INVALIDFORMAT = -17,
|
||||||
IOS_ERROR_INVALIDVERSION = -18,
|
IOS_ERROR_INVALIDVERSION = -18,
|
||||||
IOS_ERROR_INVALIDSIGNER = -19,
|
IOS_ERROR_INVALIDSIGNER = -19,
|
||||||
IOS_ERROR_FAILCHECKVALUE = -20,
|
IOS_ERROR_FAILCHECKVALUE = -20,
|
||||||
IOS_ERROR_FAILINTERNAL = -21,
|
IOS_ERROR_FAILINTERNAL = -21,
|
||||||
IOS_ERROR_FAILALLOC = -22,
|
IOS_ERROR_FAILALLOC = -22,
|
||||||
IOS_ERROR_INVALIDSIZE = -23,
|
IOS_ERROR_INVALIDSIZE = -23,
|
||||||
IOS_ERROR_NOLINK = -24,
|
IOS_ERROR_NOLINK = -24,
|
||||||
IOS_ERROR_ANFAILED = -25,
|
IOS_ERROR_ANFAILED = -25,
|
||||||
IOS_ERROR_MAXSEMCOUNT = -26,
|
IOS_ERROR_MAXSEMCOUNT = -26,
|
||||||
IOS_ERROR_SEMUNAVAILABLE = -27,
|
IOS_ERROR_SEMUNAVAILABLE = -27,
|
||||||
IOS_ERROR_INVALIDHANDLE = -28,
|
IOS_ERROR_INVALIDHANDLE = -28,
|
||||||
IOS_ERROR_INVALIDARG = -29,
|
IOS_ERROR_INVALIDARG = -29,
|
||||||
IOS_ERROR_NORESOURCE = -30,
|
IOS_ERROR_NORESOURCE = -30,
|
||||||
IOS_ERROR_BUSY = -31,
|
IOS_ERROR_BUSY = -31,
|
||||||
IOS_ERROR_TIMEOUT = -32,
|
IOS_ERROR_TIMEOUT = -32,
|
||||||
IOS_ERROR_ALIGNMENT = -33,
|
IOS_ERROR_ALIGNMENT = -33,
|
||||||
IOS_ERROR_BSP = -34,
|
IOS_ERROR_BSP = -34,
|
||||||
IOS_ERROR_DATAPENDING = -35,
|
IOS_ERROR_DATAPENDING = -35,
|
||||||
IOS_ERROR_EXPIRED = -36,
|
IOS_ERROR_EXPIRED = -36,
|
||||||
IOS_ERROR_NOREADACCESS = -37,
|
IOS_ERROR_NOREADACCESS = -37,
|
||||||
IOS_ERROR_NOWRITEACCESS = -38,
|
IOS_ERROR_NOWRITEACCESS = -38,
|
||||||
IOS_ERROR_NOREADWRITEACCESS = -39,
|
IOS_ERROR_NOREADWRITEACCESS = -39,
|
||||||
IOS_ERROR_CLIENTTXNLIMIT = -40,
|
IOS_ERROR_CLIENTTXNLIMIT = -40,
|
||||||
IOS_ERROR_STALEHANDLE = -41,
|
IOS_ERROR_STALEHANDLE = -41,
|
||||||
IOS_ERROR_UNKNOWNVALUE = -42,
|
IOS_ERROR_UNKNOWNVALUE = -42,
|
||||||
} IOSError;
|
} IOSError;
|
||||||
|
|
||||||
struct IOSVec
|
struct IOSVec
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include "mutex.h"
|
|
||||||
#include "ios.h"
|
#include "ios.h"
|
||||||
|
#include "mutex.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
@ -17,21 +17,22 @@ typedef struct IPCBufPool IPCBufPool;
|
||||||
*
|
*
|
||||||
* Functions similar to a ring buffer.
|
* Functions similar to a ring buffer.
|
||||||
*/
|
*/
|
||||||
struct IPCBufPoolFIFO {
|
struct IPCBufPoolFIFO
|
||||||
//! The current message index to push to.
|
{
|
||||||
int32_t pushIndex;
|
//! The current message index to push to.
|
||||||
|
int32_t pushIndex;
|
||||||
|
|
||||||
//! The current message index to pop from.
|
//! The current message index to pop from.
|
||||||
int32_t popIndex;
|
int32_t popIndex;
|
||||||
|
|
||||||
//! The number of messages in the queue.
|
//! The number of messages in the queue.
|
||||||
int32_t count;
|
int32_t count;
|
||||||
|
|
||||||
//! Tracks the total number of messages in the count.
|
//! Tracks the total number of messages in the count.
|
||||||
int32_t maxCount;
|
int32_t maxCount;
|
||||||
|
|
||||||
//! Messages in the queue.
|
//! Messages in the queue.
|
||||||
void **messages;
|
void **messages;
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(IPCBufPoolFIFO, 0x00, pushIndex);
|
WUT_CHECK_OFFSET(IPCBufPoolFIFO, 0x00, pushIndex);
|
||||||
WUT_CHECK_OFFSET(IPCBufPoolFIFO, 0x04, popIndex);
|
WUT_CHECK_OFFSET(IPCBufPoolFIFO, 0x04, popIndex);
|
||||||
|
|
@ -43,15 +44,16 @@ WUT_CHECK_SIZE(IPCBufPoolFIFO, 0x14);
|
||||||
/**
|
/**
|
||||||
* Attributes returned by IPCBufPoolGetAttributes.
|
* Attributes returned by IPCBufPoolGetAttributes.
|
||||||
*/
|
*/
|
||||||
struct IPCBufPoolAttributes {
|
struct IPCBufPoolAttributes
|
||||||
//! Size of a message in the buffer pool.
|
{
|
||||||
uint32_t messageSize;
|
//! Size of a message in the buffer pool.
|
||||||
|
uint32_t messageSize;
|
||||||
|
|
||||||
//! Size of the buffer pool.
|
//! Size of the buffer pool.
|
||||||
uint32_t poolSize;
|
uint32_t poolSize;
|
||||||
|
|
||||||
//! Number of pending messages in the pool fifo.
|
//! Number of pending messages in the pool fifo.
|
||||||
uint32_t numMessages;
|
uint32_t numMessages;
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(IPCBufPoolAttributes, 0x00, messageSize);
|
WUT_CHECK_OFFSET(IPCBufPoolAttributes, 0x00, messageSize);
|
||||||
WUT_CHECK_OFFSET(IPCBufPoolAttributes, 0x04, poolSize);
|
WUT_CHECK_OFFSET(IPCBufPoolAttributes, 0x04, poolSize);
|
||||||
|
|
@ -63,41 +65,42 @@ WUT_CHECK_SIZE(IPCBufPoolAttributes, 0x0C);
|
||||||
/**
|
/**
|
||||||
* A simple message buffer pool used for IPC communication.
|
* A simple message buffer pool used for IPC communication.
|
||||||
*/
|
*/
|
||||||
struct IPCBufPool {
|
struct IPCBufPool
|
||||||
//! Magic header always set to IPCBufPool::MagicHeader.
|
{
|
||||||
uint32_t magic;
|
//! Magic header always set to IPCBufPool::MagicHeader.
|
||||||
|
uint32_t magic;
|
||||||
|
|
||||||
//! Pointer to buffer used for this IPCBufPool.
|
//! Pointer to buffer used for this IPCBufPool.
|
||||||
void *buffer;
|
void *buffer;
|
||||||
|
|
||||||
//! Size of buffer.
|
//! Size of buffer.
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
|
|
||||||
uint32_t unk0x0C;
|
uint32_t unk0x0C;
|
||||||
uint32_t unk0x10;
|
uint32_t unk0x10;
|
||||||
|
|
||||||
//! Message size from IPCBufPoolCreate.
|
//! Message size from IPCBufPoolCreate.
|
||||||
uint32_t messageSize0x14;
|
uint32_t messageSize0x14;
|
||||||
|
|
||||||
//! Message size from IPCBufPoolCreate.
|
//! Message size from IPCBufPoolCreate.
|
||||||
uint32_t messageSize0x18;
|
uint32_t messageSize0x18;
|
||||||
|
|
||||||
//! Number of messages in the IPCBufPoolFIFO.
|
//! Number of messages in the IPCBufPoolFIFO.
|
||||||
uint32_t messageCount;
|
uint32_t messageCount;
|
||||||
|
|
||||||
//! Pointer to start of messages.
|
//! Pointer to start of messages.
|
||||||
void *messages;
|
void *messages;
|
||||||
|
|
||||||
//! Number of bytes used for the message pointers in IPCBufPoolFIFO.
|
//! Number of bytes used for the message pointers in IPCBufPoolFIFO.
|
||||||
uint32_t *messageIndexSize;
|
uint32_t *messageIndexSize;
|
||||||
|
|
||||||
//! FIFO queue of messages.
|
//! FIFO queue of messages.
|
||||||
IPCBufPoolFIFO fifo;
|
IPCBufPoolFIFO fifo;
|
||||||
|
|
||||||
//! Mutex used to secure access to fifo.
|
//! Mutex used to secure access to fifo.
|
||||||
OSMutex mutex;
|
OSMutex mutex;
|
||||||
|
|
||||||
WUT_UNKNOWN_BYTES(0x04);
|
WUT_UNKNOWN_BYTES(0x04);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(IPCBufPool, 0x00, magic);
|
WUT_CHECK_OFFSET(IPCBufPool, 0x00, magic);
|
||||||
WUT_CHECK_OFFSET(IPCBufPool, 0x04, buffer);
|
WUT_CHECK_OFFSET(IPCBufPool, 0x04, buffer);
|
||||||
|
|
|
||||||
|
|
@ -12,86 +12,90 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum OSICICommand {
|
typedef enum OSICICommand
|
||||||
OS_ICI_COMMAND_INVALID_IC_RANGE = 1,
|
{
|
||||||
OS_ICI_COMMAND_RESCHEDULE_CORE = 2,
|
OS_ICI_COMMAND_INVALID_IC_RANGE = 1,
|
||||||
OS_ICI_COMMAND_HALT_CORE = 3,
|
OS_ICI_COMMAND_RESCHEDULE_CORE = 2,
|
||||||
OS_ICI_COMMAND_PROC_EXIT = 4,
|
OS_ICI_COMMAND_HALT_CORE = 3,
|
||||||
OS_ICI_COMMAND_SET_DABR = 5,
|
OS_ICI_COMMAND_PROC_EXIT = 4,
|
||||||
OS_ICI_COMMAND_PROC_SCHED = 6,
|
OS_ICI_COMMAND_SET_DABR = 5,
|
||||||
OS_ICI_COMMAND_FAST_BG_EXIT = 7,
|
OS_ICI_COMMAND_PROC_SCHED = 6,
|
||||||
OS_ICI_COMMAND_IOP_SHELL_CORE_TRACE = 8,
|
OS_ICI_COMMAND_FAST_BG_EXIT = 7,
|
||||||
OS_ICI_COMMAND_SYSTEM_FATAL = 9,
|
OS_ICI_COMMAND_IOP_SHELL_CORE_TRACE = 8,
|
||||||
OS_ICI_COMMAND_SET_IABR = 10,
|
OS_ICI_COMMAND_SYSTEM_FATAL = 9,
|
||||||
OS_ICI_COMMAND_PANIC_0X15 = 0xB,
|
OS_ICI_COMMAND_SET_IABR = 10,
|
||||||
OS_ICI_COMMAND_PROC_KILL = 0xC,
|
OS_ICI_COMMAND_PANIC_0X15 = 0xB,
|
||||||
OS_ICI_COMMAND_PROC_CRASH = 0xD,
|
OS_ICI_COMMAND_PROC_KILL = 0xC,
|
||||||
OS_ICI_COMMAND_UNKNOWN = 0xE, // Waits for rendezvous, then updates heartbeat
|
OS_ICI_COMMAND_PROC_CRASH = 0xD,
|
||||||
OS_ICI_COMMAND_OVERLAY_ARENA = 0xF,
|
OS_ICI_COMMAND_UNKNOWN = 0xE, // Waits for rendezvous, then updates heartbeat
|
||||||
|
OS_ICI_COMMAND_OVERLAY_ARENA = 0xF,
|
||||||
} OSICICommand;
|
} 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 void (*KernelTimerCallbackFn)(OSExceptionType exception, OSContext *interruptedContext, OSContext *currentContext);
|
||||||
|
|
||||||
typedef uint32_t KernelTimerHandle;
|
typedef uint32_t KernelTimerHandle;
|
||||||
|
|
||||||
typedef struct OSExceptionChainInfo {
|
typedef struct OSExceptionChainInfo
|
||||||
OSExceptionCallbackExFn callback;
|
{
|
||||||
void *stack;
|
OSExceptionCallbackExFn callback;
|
||||||
OSContext *context;
|
void *stack;
|
||||||
|
OSContext *context;
|
||||||
} OSExceptionChainInfo;
|
} OSExceptionChainInfo;
|
||||||
WUT_CHECK_OFFSET(OSExceptionChainInfo, 0, callback);
|
WUT_CHECK_OFFSET(OSExceptionChainInfo, 0, callback);
|
||||||
WUT_CHECK_OFFSET(OSExceptionChainInfo, 4, stack);
|
WUT_CHECK_OFFSET(OSExceptionChainInfo, 4, stack);
|
||||||
WUT_CHECK_OFFSET(OSExceptionChainInfo, 8, context);
|
WUT_CHECK_OFFSET(OSExceptionChainInfo, 8, context);
|
||||||
WUT_CHECK_SIZE(OSExceptionChainInfo, 12);
|
WUT_CHECK_SIZE(OSExceptionChainInfo, 12);
|
||||||
|
|
||||||
typedef struct KernelInfo0 {
|
typedef struct KernelInfo0
|
||||||
struct CoreinitInfo {
|
{
|
||||||
void *loaderHandle;
|
struct CoreinitInfo
|
||||||
void *textAddr;
|
{
|
||||||
uint32_t textOffset;
|
void *loaderHandle;
|
||||||
uint32_t textSize;
|
void *textAddr;
|
||||||
void *dataAddr;
|
uint32_t textOffset;
|
||||||
uint32_t dataOffset;
|
uint32_t textSize;
|
||||||
uint32_t dataSize;
|
void *dataAddr;
|
||||||
void *loadAddr;
|
uint32_t dataOffset;
|
||||||
uint32_t loadOffset;
|
uint32_t dataSize;
|
||||||
uint32_t loadSize;
|
void *loadAddr;
|
||||||
};
|
uint32_t loadOffset;
|
||||||
|
uint32_t loadSize;
|
||||||
|
};
|
||||||
|
|
||||||
int32_t upid;
|
int32_t upid;
|
||||||
int32_t rampid;
|
int32_t rampid;
|
||||||
uint32_t appFlags;
|
uint32_t appFlags;
|
||||||
void *dataAreaStart;
|
void *dataAreaStart;
|
||||||
void *dataAreaEnd;
|
void *dataAreaEnd;
|
||||||
void *physDataAreaStart;
|
void *physDataAreaStart;
|
||||||
void *physDataAreaEnd;
|
void *physDataAreaEnd;
|
||||||
void *physAvailStart;
|
void *physAvailStart;
|
||||||
void *physAvailEnd;
|
void *physAvailEnd;
|
||||||
void *physCodeGenStart;
|
void *physCodeGenStart;
|
||||||
void *physCodeGenEnd;
|
void *physCodeGenEnd;
|
||||||
void *sdaBase;
|
void *sdaBase;
|
||||||
void *sda2Base;
|
void *sda2Base;
|
||||||
uint32_t systemHeapSize;
|
uint32_t systemHeapSize;
|
||||||
void *stackEnd0;
|
void *stackEnd0;
|
||||||
void *stackEnd1;
|
void *stackEnd1;
|
||||||
void *stackEnd2;
|
void *stackEnd2;
|
||||||
void *stackBase0;
|
void *stackBase0;
|
||||||
void *stackBase1;
|
void *stackBase1;
|
||||||
void *stackBase2;
|
void *stackBase2;
|
||||||
void *exceptionStackEnd0;
|
void *exceptionStackEnd0;
|
||||||
void *exceptionStackEnd1;
|
void *exceptionStackEnd1;
|
||||||
void *exceptionStackEnd2;
|
void *exceptionStackEnd2;
|
||||||
void *exceptionStackBase0;
|
void *exceptionStackBase0;
|
||||||
void *exceptionStackBase1;
|
void *exceptionStackBase1;
|
||||||
void *exceptionStackBase2;
|
void *exceptionStackBase2;
|
||||||
void *lockedCacheBase0;
|
void *lockedCacheBase0;
|
||||||
void *lockedCacheBase1;
|
void *lockedCacheBase1;
|
||||||
void *lockedCacheBase2;
|
void *lockedCacheBase2;
|
||||||
struct CoreinitInfo coreinit;
|
struct CoreinitInfo coreinit;
|
||||||
uint32_t unk0x9C;
|
uint32_t unk0x9C;
|
||||||
uint64_t titleId;
|
uint64_t titleId;
|
||||||
} KernelInfo0;
|
} KernelInfo0;
|
||||||
WUT_CHECK_OFFSET(KernelInfo0, 0x00, upid);
|
WUT_CHECK_OFFSET(KernelInfo0, 0x00, upid);
|
||||||
WUT_CHECK_OFFSET(KernelInfo0, 0x04, rampid);
|
WUT_CHECK_OFFSET(KernelInfo0, 0x04, rampid);
|
||||||
|
|
@ -127,23 +131,43 @@ WUT_CHECK_OFFSET(KernelInfo0, 0x9C, unk0x9C);
|
||||||
WUT_CHECK_OFFSET(KernelInfo0, 0xA0, titleId);
|
WUT_CHECK_OFFSET(KernelInfo0, 0xA0, titleId);
|
||||||
WUT_CHECK_SIZE(KernelInfo0, 0xA8);
|
WUT_CHECK_SIZE(KernelInfo0, 0xA8);
|
||||||
|
|
||||||
typedef struct KernelInfo6 {
|
typedef struct KernelInfo6
|
||||||
uint64_t osTitleId;
|
{
|
||||||
uint32_t unk0x08;
|
uint64_t osTitleId;
|
||||||
WUT_PADDING_BYTES(0x108 - 0xC);
|
uint32_t unk0x08;
|
||||||
|
WUT_PADDING_BYTES(0x108 - 0xC);
|
||||||
} KernelInfo6;
|
} KernelInfo6;
|
||||||
WUT_CHECK_OFFSET(KernelInfo6, 0x00, osTitleId);
|
WUT_CHECK_OFFSET(KernelInfo6, 0x00, osTitleId);
|
||||||
WUT_CHECK_OFFSET(KernelInfo6, 0x08, unk0x08);
|
WUT_CHECK_OFFSET(KernelInfo6, 0x08, unk0x08);
|
||||||
WUT_CHECK_SIZE(KernelInfo6, 0x108);
|
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);
|
KernelTimerHandle
|
||||||
uint32_t __KernelPrimeTimer(KernelTimerHandle handle, uint64_t startTimeInTicks, uint64_t intervalInTicks, uint32_t unknown);
|
__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
|
static inline void
|
||||||
__KernelGetInfo0(KernelInfo0 *outBuffer, uint32_t core)
|
__KernelGetInfo0(KernelInfo0 *outBuffer, uint32_t core)
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ extern "C" {
|
||||||
/**
|
/**
|
||||||
* Magic title ID used for triggering a full system reboot.
|
* Magic title ID used for triggering a full system reboot.
|
||||||
*/
|
*/
|
||||||
#define OS_TITLE_ID_REBOOT 0xFFFFFFFFFFFFFFFEllu
|
#define OS_TITLE_ID_REBOOT 0xFFFFFFFFFFFFFFFEllu
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forces a OS relaunch on the next title launch.
|
* Forces a OS relaunch on the next title launch.
|
||||||
|
|
|
||||||
|
|
@ -24,74 +24,74 @@ typedef struct MCPTitleListType MCPTitleListType;
|
||||||
|
|
||||||
typedef enum MCPAppType
|
typedef enum MCPAppType
|
||||||
{
|
{
|
||||||
MCP_APP_TYPE_GAME_UPDATE = 0x0800001B,
|
MCP_APP_TYPE_GAME_UPDATE = 0x0800001B,
|
||||||
MCP_APP_TYPE_GAME_DLC = 0x0800000E,
|
MCP_APP_TYPE_GAME_DLC = 0x0800000E,
|
||||||
MCP_APP_TYPE_BOOT1 = 0x10000009,
|
MCP_APP_TYPE_BOOT1 = 0x10000009,
|
||||||
MCP_APP_TYPE_SYSTEM_LIBRARIES = 0x1000000A,
|
MCP_APP_TYPE_SYSTEM_LIBRARIES = 0x1000000A,
|
||||||
MCP_APP_TYPE_BLUETOOTH_FIRMWARE = 0x10000012,
|
MCP_APP_TYPE_BLUETOOTH_FIRMWARE = 0x10000012,
|
||||||
MCP_APP_TYPE_DRC_FIRMWARE = 0x10000013,
|
MCP_APP_TYPE_DRC_FIRMWARE = 0x10000013,
|
||||||
MCP_APP_TYPE_DRH_FIRMWARE = 0x10000014,
|
MCP_APP_TYPE_DRH_FIRMWARE = 0x10000014,
|
||||||
MCP_APP_TYPE_SYSTEM_VERSION = 0x10000015,
|
MCP_APP_TYPE_SYSTEM_VERSION = 0x10000015,
|
||||||
MCP_APP_TYPE_DRC_LANGUAGE = 0x1000001A,
|
MCP_APP_TYPE_DRC_LANGUAGE = 0x1000001A,
|
||||||
MCP_APP_TYPE_EXCEPTIONS_DATA = 0x18000010,
|
MCP_APP_TYPE_EXCEPTIONS_DATA = 0x18000010,
|
||||||
MCP_APP_TYPE_SHARED_DATA = 0x1800001C,
|
MCP_APP_TYPE_SHARED_DATA = 0x1800001C,
|
||||||
MCP_APP_TYPE_CERT_STORE = 0x1800001E,
|
MCP_APP_TYPE_CERT_STORE = 0x1800001E,
|
||||||
MCP_APP_TYPE_PATCH_MAP_DATA = 0x18000023,
|
MCP_APP_TYPE_PATCH_MAP_DATA = 0x18000023,
|
||||||
MCP_APP_TYPE_WAGONU_MIGRATION_LIST = 0x18000029,
|
MCP_APP_TYPE_WAGONU_MIGRATION_LIST = 0x18000029,
|
||||||
MCP_APP_TYPE_CAFFEINE_TITLE_LIST = 0x18000030,
|
MCP_APP_TYPE_CAFFEINE_TITLE_LIST = 0x18000030,
|
||||||
MCP_APP_TYPE_MCP_TITLE_LIST = 0x18000031,
|
MCP_APP_TYPE_MCP_TITLE_LIST = 0x18000031,
|
||||||
MCP_APP_TYPE_GAME = 0x80000000,
|
MCP_APP_TYPE_GAME = 0x80000000,
|
||||||
MCP_APP_TYPE_GAME_WII = 0x8000002E,
|
MCP_APP_TYPE_GAME_WII = 0x8000002E,
|
||||||
MCP_APP_TYPE_SYSTEM_MENU = 0x90000001,
|
MCP_APP_TYPE_SYSTEM_MENU = 0x90000001,
|
||||||
MCP_APP_TYPE_SYSTEM_UPDATER = 0x9000000B,
|
MCP_APP_TYPE_SYSTEM_UPDATER = 0x9000000B,
|
||||||
MCP_APP_TYPE_SYSTEM_APPS = 0x90000020,
|
MCP_APP_TYPE_SYSTEM_APPS = 0x90000020,
|
||||||
MCP_APP_TYPE_ACCOUNT_APPS = 0x90000021,
|
MCP_APP_TYPE_ACCOUNT_APPS = 0x90000021,
|
||||||
MCP_APP_TYPE_SYSTEM_SETTINGS = 0x90000022,
|
MCP_APP_TYPE_SYSTEM_SETTINGS = 0x90000022,
|
||||||
MCP_APP_TYPE_ECO_PROCESS = 0x9000002F,
|
MCP_APP_TYPE_ECO_PROCESS = 0x9000002F,
|
||||||
MCP_APP_TYPE_EMANUAL = 0xD0000003,
|
MCP_APP_TYPE_EMANUAL = 0xD0000003,
|
||||||
MCP_APP_TYPE_HOME_MENU = 0xD0000004,
|
MCP_APP_TYPE_HOME_MENU = 0xD0000004,
|
||||||
MCP_APP_TYPE_ERROR_DISPLAY = 0xD0000005,
|
MCP_APP_TYPE_ERROR_DISPLAY = 0xD0000005,
|
||||||
MCP_APP_TYPE_BROWSER = 0xD0000006,
|
MCP_APP_TYPE_BROWSER = 0xD0000006,
|
||||||
MCP_APP_TYPE_MIIVERSE_POST = 0xD000000D,
|
MCP_APP_TYPE_MIIVERSE_POST = 0xD000000D,
|
||||||
MCP_APP_TYPE_MIIVERSE = 0xD0000016,
|
MCP_APP_TYPE_MIIVERSE = 0xD0000016,
|
||||||
MCP_APP_TYPE_ESHOP = 0xD0000017,
|
MCP_APP_TYPE_ESHOP = 0xD0000017,
|
||||||
MCP_APP_TYPE_FRIEND_LIST = 0xD0000018,
|
MCP_APP_TYPE_FRIEND_LIST = 0xD0000018,
|
||||||
MCP_APP_TYPE_DOWNLOAD_MANAGEMENT = 0xD0000019,
|
MCP_APP_TYPE_DOWNLOAD_MANAGEMENT = 0xD0000019,
|
||||||
MCP_APP_TYPE_AOC_OVERLAY = 0xD000002C,
|
MCP_APP_TYPE_AOC_OVERLAY = 0xD000002C,
|
||||||
MCP_APP_TYPE_AMIIBO_SETTINGS = 0xD0000033,
|
MCP_APP_TYPE_AMIIBO_SETTINGS = 0xD0000033,
|
||||||
} MCPAppType;
|
} MCPAppType;
|
||||||
|
|
||||||
typedef enum MCPDeviceType
|
typedef enum MCPDeviceType
|
||||||
{
|
{
|
||||||
MCP_DEVICE_TYPE_AUTO = 1, /* returns result for ODD, MLC and USB */
|
MCP_DEVICE_TYPE_AUTO = 1, /* returns result for ODD, MLC and USB */
|
||||||
MCP_DEVICE_TYPE_ODD = 2,
|
MCP_DEVICE_TYPE_ODD = 2,
|
||||||
MCP_DEVICE_TYPE_MLC = 3,
|
MCP_DEVICE_TYPE_MLC = 3,
|
||||||
MCP_DEVICE_TYPE_USB = 4,
|
MCP_DEVICE_TYPE_USB = 4,
|
||||||
/* any value >= 5 is MCP_DEVICE_TYPE_AUTO */
|
/* any value >= 5 is MCP_DEVICE_TYPE_AUTO */
|
||||||
} MCPDeviceType;
|
} MCPDeviceType;
|
||||||
|
|
||||||
typedef enum MCPDeviceFlags
|
typedef enum MCPDeviceFlags
|
||||||
{
|
{
|
||||||
MCP_DEVICE_FLAG_UNK_1 = 0x1,
|
MCP_DEVICE_FLAG_UNK_1 = 0x1,
|
||||||
MCP_DEVICE_FLAG_UNK_2 = 0x2,
|
MCP_DEVICE_FLAG_UNK_2 = 0x2,
|
||||||
MCP_DEVICE_FLAG_UNK_4 = 0x4,
|
MCP_DEVICE_FLAG_UNK_4 = 0x4,
|
||||||
MCP_DEVICE_FLAG_UNK_8 = 0x8,
|
MCP_DEVICE_FLAG_UNK_8 = 0x8,
|
||||||
} MCPDeviceFlags;
|
} MCPDeviceFlags;
|
||||||
|
|
||||||
typedef enum MCPInstallTarget
|
typedef enum MCPInstallTarget
|
||||||
{
|
{
|
||||||
MCP_INSTALL_TARGET_MLC = 0,
|
MCP_INSTALL_TARGET_MLC = 0,
|
||||||
MCP_INSTALL_TARGET_USB = 1,
|
MCP_INSTALL_TARGET_USB = 1,
|
||||||
} MCPInstallTarget;
|
} MCPInstallTarget;
|
||||||
|
|
||||||
typedef enum MCPRegion
|
typedef enum MCPRegion
|
||||||
{
|
{
|
||||||
MCP_REGION_JAPAN = 0x01,
|
MCP_REGION_JAPAN = 0x01,
|
||||||
MCP_REGION_USA = 0x02,
|
MCP_REGION_USA = 0x02,
|
||||||
MCP_REGION_EUROPE = 0x04,
|
MCP_REGION_EUROPE = 0x04,
|
||||||
MCP_REGION_CHINA = 0x10,
|
MCP_REGION_CHINA = 0x10,
|
||||||
MCP_REGION_KOREA = 0x20,
|
MCP_REGION_KOREA = 0x20,
|
||||||
MCP_REGION_TAIWAN = 0x40,
|
MCP_REGION_TAIWAN = 0x40,
|
||||||
} MCPRegion;
|
} MCPRegion;
|
||||||
|
|
||||||
typedef enum MCPCompatAVFile
|
typedef enum MCPCompatAVFile
|
||||||
|
|
@ -102,6 +102,16 @@ typedef enum MCPCompatAVFile
|
||||||
MCP_COMPAT_AV_FILE_DEINT = 0x01,
|
MCP_COMPAT_AV_FILE_DEINT = 0x01,
|
||||||
} MCPCompatAVFile;
|
} 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
|
struct WUT_PACKED MCPDevice
|
||||||
{
|
{
|
||||||
char type[8];
|
char type[8];
|
||||||
|
|
@ -241,6 +251,10 @@ MCPError
|
||||||
MCP_GetOwnTitleInfo(int32_t handle,
|
MCP_GetOwnTitleInfo(int32_t handle,
|
||||||
MCPTitleListType *titleInfo);
|
MCPTitleListType *titleInfo);
|
||||||
|
|
||||||
|
MCPError
|
||||||
|
MCP_GetSystemMode(int32_t handle,
|
||||||
|
MCPSystemMode *mode);
|
||||||
|
|
||||||
MCPError
|
MCPError
|
||||||
MCP_GetSysProdSettings(int32_t handle,
|
MCP_GetSysProdSettings(int32_t handle,
|
||||||
MCPSysProdSettings *settings);
|
MCPSysProdSettings *settings);
|
||||||
|
|
@ -363,7 +377,7 @@ MCP_CompatLoadAVFile(int32_t handle,
|
||||||
/**
|
/**
|
||||||
* Saves the current Cafe log to the SLC logs directory.
|
* Saves the current Cafe log to the SLC logs directory.
|
||||||
* Internally calls IOS_Ioctl() with request \c 0xCD .
|
* Internally calls IOS_Ioctl() with request \c 0xCD .
|
||||||
*
|
*
|
||||||
* \return
|
* \return
|
||||||
* \c 0 on success.
|
* \c 0 on success.
|
||||||
*/
|
*/
|
||||||
|
|
@ -382,8 +396,9 @@ MCP_ChangeEcoSettings(int32_t handle,
|
||||||
uint32_t maxOnTime,
|
uint32_t maxOnTime,
|
||||||
uint16_t defaultOffTime);
|
uint16_t defaultOffTime);
|
||||||
|
|
||||||
static inline const char*
|
static inline const char *
|
||||||
MCP_GetDeviceNameByDeviceType(MCPDeviceType deviceType) {
|
MCP_GetDeviceNameByDeviceType(MCPDeviceType deviceType)
|
||||||
|
{
|
||||||
switch (deviceType) {
|
switch (deviceType) {
|
||||||
case MCP_DEVICE_TYPE_AUTO:
|
case MCP_DEVICE_TYPE_AUTO:
|
||||||
return "auto";
|
return "auto";
|
||||||
|
|
|
||||||
108
include/coreinit/memallocator.h
Normal file
108
include/coreinit/memallocator.h
Normal 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
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
@ -75,6 +75,8 @@ struct WUT_PACKED MEMBlockHeap
|
||||||
|
|
||||||
//! Free block count
|
//! Free block count
|
||||||
uint32_t numFreeBlocks;
|
uint32_t numFreeBlocks;
|
||||||
|
|
||||||
|
WUT_PADDING_BYTES(0xC);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(MEMBlockHeap, 0x00, header);
|
WUT_CHECK_OFFSET(MEMBlockHeap, 0x00, header);
|
||||||
WUT_CHECK_OFFSET(MEMBlockHeap, 0x40, defaultTrack);
|
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, 0x68, lastBlock);
|
||||||
WUT_CHECK_OFFSET(MEMBlockHeap, 0x6C, firstFreeBlock);
|
WUT_CHECK_OFFSET(MEMBlockHeap, 0x6C, firstFreeBlock);
|
||||||
WUT_CHECK_OFFSET(MEMBlockHeap, 0x70, numFreeBlocks);
|
WUT_CHECK_OFFSET(MEMBlockHeap, 0x70, numFreeBlocks);
|
||||||
WUT_CHECK_SIZE(MEMBlockHeap, 0x74);
|
WUT_CHECK_SIZE(MEMBlockHeap, 0x80);
|
||||||
|
|
||||||
MEMHeapHandle
|
MEMHeapHandle
|
||||||
MEMInitBlockHeap(MEMBlockHeap *heap,
|
MEMInitBlockHeap(MEMBlockHeap *heap,
|
||||||
|
|
|
||||||
|
|
@ -16,25 +16,24 @@ typedef struct MEMExpHeap MEMExpHeap;
|
||||||
typedef struct MEMExpHeapBlock MEMExpHeapBlock;
|
typedef struct MEMExpHeapBlock MEMExpHeapBlock;
|
||||||
typedef struct MEMExpHeapBlockList MEMExpHeapBlockList;
|
typedef struct MEMExpHeapBlockList MEMExpHeapBlockList;
|
||||||
|
|
||||||
typedef void (*MEMExpHeapBlockVisitor)(void *block, MEMHeapHandle heap,
|
typedef void (*MEMExpHeapBlockVisitor)(void *block, MEMHeapHandle heap, void *context);
|
||||||
void *context);
|
|
||||||
|
|
||||||
typedef enum MEMExpHeapMode
|
typedef enum MEMExpHeapMode
|
||||||
{
|
{
|
||||||
MEM_EXP_HEAP_MODE_FIRST_FREE = 0,
|
MEM_EXP_HEAP_MODE_FIRST_FREE = 0,
|
||||||
MEM_EXP_HEAP_MODE_NEAREST_SIZE = 1,
|
MEM_EXP_HEAP_MODE_NEAREST_SIZE = 1,
|
||||||
} MEMExpHeapMode;
|
} MEMExpHeapMode;
|
||||||
|
|
||||||
typedef enum MEMExpHeapDirection
|
typedef enum MEMExpHeapDirection
|
||||||
{
|
{
|
||||||
MEM_EXP_HEAP_DIR_FROM_TOP = 0,
|
MEM_EXP_HEAP_DIR_FROM_TOP = 0,
|
||||||
MEM_EXP_HEAP_DIR_FROM_BOTTOM = 1,
|
MEM_EXP_HEAP_DIR_FROM_BOTTOM = 1,
|
||||||
} MEMExpHeapDirection;
|
} MEMExpHeapDirection;
|
||||||
|
|
||||||
typedef enum MEMExpHeapCheckFlags
|
typedef enum MEMExpHeapCheckFlags
|
||||||
{
|
{
|
||||||
MEM_EXP_HEAP_CHECK_FLAGS_NONE = 0,
|
MEM_EXP_HEAP_CHECK_FLAGS_NONE = 0,
|
||||||
MEM_EXP_HEAP_CHECK_FLAGS_LOG_ERRORS = 1,
|
MEM_EXP_HEAP_CHECK_FLAGS_LOG_ERRORS = 1,
|
||||||
} MEMExpHeapCheckFlags;
|
} MEMExpHeapCheckFlags;
|
||||||
|
|
||||||
struct MEMExpHeapBlock
|
struct MEMExpHeapBlock
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ extern "C" {
|
||||||
|
|
||||||
typedef enum MEMFrmHeapFreeMode
|
typedef enum MEMFrmHeapFreeMode
|
||||||
{
|
{
|
||||||
MEM_FRM_HEAP_FREE_HEAD = 1 << 0,
|
MEM_FRM_HEAP_FREE_HEAD = 1 << 0,
|
||||||
MEM_FRM_HEAP_FREE_TAIL = 1 << 1,
|
MEM_FRM_HEAP_FREE_TAIL = 1 << 1,
|
||||||
MEM_FRM_HEAP_FREE_ALL = MEM_FRM_HEAP_FREE_HEAD | MEM_FRM_HEAP_FREE_TAIL,
|
MEM_FRM_HEAP_FREE_ALL = MEM_FRM_HEAP_FREE_HEAD | MEM_FRM_HEAP_FREE_TAIL,
|
||||||
} MEMFrmHeapFreeMode;
|
} MEMFrmHeapFreeMode;
|
||||||
|
|
||||||
typedef struct MEMFrmHeap MEMFrmHeap;
|
typedef struct MEMFrmHeap MEMFrmHeap;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include "spinlock.h"
|
|
||||||
#include "memlist.h"
|
#include "memlist.h"
|
||||||
|
#include "spinlock.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup coreinit_memheap Common Memory Heap
|
* \defgroup coreinit_memheap Common Memory Heap
|
||||||
* \ingroup coreinit
|
* \ingroup coreinit
|
||||||
*
|
*
|
||||||
* Common memory heap fucntions.
|
* Common memory heap functions.
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -20,9 +20,9 @@ typedef MEMHeapHeader *MEMHeapHandle;
|
||||||
|
|
||||||
typedef enum MEMBaseHeapType
|
typedef enum MEMBaseHeapType
|
||||||
{
|
{
|
||||||
MEM_BASE_HEAP_MEM1 = 0,
|
MEM_BASE_HEAP_MEM1 = 0,
|
||||||
MEM_BASE_HEAP_MEM2 = 1,
|
MEM_BASE_HEAP_MEM2 = 1,
|
||||||
MEM_BASE_HEAP_FG = 8,
|
MEM_BASE_HEAP_FG = 8,
|
||||||
} MEMBaseHeapType;
|
} MEMBaseHeapType;
|
||||||
|
|
||||||
typedef enum MEMHeapFillType
|
typedef enum MEMHeapFillType
|
||||||
|
|
@ -34,18 +34,18 @@ typedef enum MEMHeapFillType
|
||||||
|
|
||||||
typedef enum MEMHeapTag
|
typedef enum MEMHeapTag
|
||||||
{
|
{
|
||||||
MEM_BLOCK_HEAP_TAG = 0x424C4B48u,
|
MEM_BLOCK_HEAP_TAG = 0x424C4B48u,
|
||||||
MEM_EXPANDED_HEAP_TAG = 0x45585048u,
|
MEM_EXPANDED_HEAP_TAG = 0x45585048u,
|
||||||
MEM_FRAME_HEAP_TAG = 0x46524D48u,
|
MEM_FRAME_HEAP_TAG = 0x46524D48u,
|
||||||
MEM_UNIT_HEAP_TAG = 0x554E5448u,
|
MEM_UNIT_HEAP_TAG = 0x554E5448u,
|
||||||
MEM_USER_HEAP_TAG = 0x55535248u,
|
MEM_USER_HEAP_TAG = 0x55535248u,
|
||||||
} MEMHeapTag;
|
} MEMHeapTag;
|
||||||
|
|
||||||
typedef enum MEMHeapFlags
|
typedef enum MEMHeapFlags
|
||||||
{
|
{
|
||||||
MEM_HEAP_FLAG_ZERO_ALLOCATED = 1 << 0,
|
MEM_HEAP_FLAG_ZERO_ALLOCATED = 1 << 0,
|
||||||
MEM_HEAP_FLAG_DEBUG_MODE = 1 << 1,
|
MEM_HEAP_FLAG_DEBUG_MODE = 1 << 1,
|
||||||
MEM_HEAP_FLAG_USE_LOCK = 1 << 2,
|
MEM_HEAP_FLAG_USE_LOCK = 1 << 2,
|
||||||
} MEMHeapFlags;
|
} MEMHeapFlags;
|
||||||
|
|
||||||
struct MEMHeapHeader
|
struct MEMHeapHeader
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,11 @@ typedef enum OSMemoryType
|
||||||
|
|
||||||
typedef enum OSSharedDataType
|
typedef enum OSSharedDataType
|
||||||
{
|
{
|
||||||
OS_SHAREDDATATYPE_FONT_CHINESE = 0,
|
OS_SHAREDDATATYPE_FONT_CHINESE = 0,
|
||||||
OS_SHAREDDATATYPE_FONT_KOREAN = 1,
|
OS_SHAREDDATATYPE_FONT_KOREAN = 1,
|
||||||
OS_SHAREDDATATYPE_FONT_STANDARD = 2,
|
OS_SHAREDDATATYPE_FONT_STANDARD = 2,
|
||||||
OS_SHAREDDATATYPE_FONT_TAIWANESE = 3,
|
OS_SHAREDDATATYPE_FONT_TAIWANESE = 3,
|
||||||
OS_SHAREDDATATYPE_FONT_MAX = 4,
|
OS_SHAREDDATATYPE_FONT_MAX = 4,
|
||||||
} OSSharedDataType;
|
} OSSharedDataType;
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,11 @@ extern "C" {
|
||||||
|
|
||||||
typedef enum OSMemoryMapMode
|
typedef enum OSMemoryMapMode
|
||||||
{
|
{
|
||||||
OS_MAP_MEMORY_INVALID = 0,
|
OS_MAP_MEMORY_INVALID = 0,
|
||||||
OS_MAP_MEMORY_READ_ONLY = 1,
|
OS_MAP_MEMORY_READ_ONLY = 1,
|
||||||
OS_MAP_MEMORY_READ_WRITE = 2,
|
OS_MAP_MEMORY_READ_WRITE = 2,
|
||||||
OS_MAP_MEMORY_FREE = 3,
|
OS_MAP_MEMORY_FREE = 3,
|
||||||
OS_MAP_MEMORY_ALLOCATED = 4,
|
OS_MAP_MEMORY_ALLOCATED = 4,
|
||||||
} OSMemoryMapMode;
|
} OSMemoryMapMode;
|
||||||
|
|
||||||
#define OS_PAGE_SIZE (128 * 1024)
|
#define OS_PAGE_SIZE (128 * 1024)
|
||||||
|
|
|
||||||
|
|
@ -17,24 +17,24 @@ typedef struct OSMessageQueue OSMessageQueue;
|
||||||
|
|
||||||
typedef enum OSMessageFlags
|
typedef enum OSMessageFlags
|
||||||
{
|
{
|
||||||
OS_MESSAGE_FLAGS_NONE = 0,
|
OS_MESSAGE_FLAGS_NONE = 0,
|
||||||
OS_MESSAGE_FLAGS_BLOCKING = 1 << 0,
|
OS_MESSAGE_FLAGS_BLOCKING = 1 << 0,
|
||||||
OS_MESSAGE_FLAGS_HIGH_PRIORITY = 1 << 1,
|
OS_MESSAGE_FLAGS_HIGH_PRIORITY = 1 << 1,
|
||||||
} OSMessageFlags;
|
} OSMessageFlags;
|
||||||
|
|
||||||
typedef enum OSFunctionType
|
typedef enum OSFunctionType
|
||||||
{
|
{
|
||||||
OS_FUNCTION_TYPE_HIO_OPEN = 1,
|
OS_FUNCTION_TYPE_HIO_OPEN = 1,
|
||||||
OS_FUNCTION_TYPE_HIO_READ_ASYNC = 2,
|
OS_FUNCTION_TYPE_HIO_READ_ASYNC = 2,
|
||||||
OS_FUNCTION_TYPE_HIO_WRITE_ASYNC = 3,
|
OS_FUNCTION_TYPE_HIO_WRITE_ASYNC = 3,
|
||||||
OS_FUNCTION_TYPE_FSA_CMD_ASYNC = 4,
|
OS_FUNCTION_TYPE_FSA_CMD_ASYNC = 4,
|
||||||
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC = 5,
|
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC = 5,
|
||||||
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC_NO_ALLOC = 6,
|
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC_NO_ALLOC = 6,
|
||||||
OS_FUNCTION_TYPE_FSA_ATTACH_EVENT = 7,
|
OS_FUNCTION_TYPE_FSA_ATTACH_EVENT = 7,
|
||||||
OS_FUNCTION_TYPE_FS_CMD_ASYNC = 8,
|
OS_FUNCTION_TYPE_FS_CMD_ASYNC = 8,
|
||||||
OS_FUNCTION_TYPE_FS_CMD_HANDLER = 9,
|
OS_FUNCTION_TYPE_FS_CMD_HANDLER = 9,
|
||||||
OS_FUNCTION_TYPE_FS_ATTACH_EVENT = 10,
|
OS_FUNCTION_TYPE_FS_ATTACH_EVENT = 10,
|
||||||
OS_FUNCTION_TYPE_FS_STATE_CHANGE_EVENT = 11,
|
OS_FUNCTION_TYPE_FS_STATE_CHANGE_EVENT = 11,
|
||||||
} OSFunctionType;
|
} OSFunctionType;
|
||||||
|
|
||||||
struct OSMessage
|
struct OSMessage
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,14 @@ extern "C" {
|
||||||
|
|
||||||
|
|
||||||
/// Used to tell OSSetPerformanceMonitor() which arguments are valid.
|
/// Used to tell OSSetPerformanceMonitor() which arguments are valid.
|
||||||
typedef enum OSPerfMonArg {
|
typedef enum OSPerfMonArg
|
||||||
OS_PM_ARG_MMCR0 = 1u << 0u,
|
{
|
||||||
OS_PM_ARG_MMCR1 = 1u << 1u,
|
OS_PM_ARG_MMCR0 = 1u << 0u,
|
||||||
OS_PM_ARG_PMC1 = 1u << 2u,
|
OS_PM_ARG_MMCR1 = 1u << 1u,
|
||||||
OS_PM_ARG_PMC2 = 1u << 3u,
|
OS_PM_ARG_PMC1 = 1u << 2u,
|
||||||
OS_PM_ARG_PMC3 = 1u << 4u,
|
OS_PM_ARG_PMC2 = 1u << 3u,
|
||||||
OS_PM_ARG_PMC4 = 1u << 5u,
|
OS_PM_ARG_PMC3 = 1u << 4u,
|
||||||
|
OS_PM_ARG_PMC4 = 1u << 5u,
|
||||||
} OSPerfMonArg;
|
} OSPerfMonArg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -29,49 +30,50 @@ typedef enum OSPerfMonArg {
|
||||||
*
|
*
|
||||||
* \sa OSSetPerformanceMonitor
|
* \sa OSSetPerformanceMonitor
|
||||||
*/
|
*/
|
||||||
typedef enum OSPerfMonMMCR0Flags {
|
typedef enum OSPerfMonMMCR0Flags
|
||||||
OS_PM_MMCR0_PMC1_CURRENT = 0b0000000u << 6,
|
{
|
||||||
OS_PM_MMCR0_PMC1_CPU_CYCLES = 0b0000001u << 6,
|
OS_PM_MMCR0_PMC1_CURRENT = 0b0000000u << 6,
|
||||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED = 0b0000010u << 6,
|
OS_PM_MMCR0_PMC1_CPU_CYCLES = 0b0000001u << 6,
|
||||||
OS_PM_MMCR0_PMC1_TBL_RISING_TRANSITIONS = 0b0000011u << 6,
|
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED = 0b0000010u << 6,
|
||||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_DISPATCHED = 0b0000100u << 6,
|
OS_PM_MMCR0_PMC1_TBL_RISING_TRANSITIONS = 0b0000011u << 6,
|
||||||
OS_PM_MMCR0_PMC1_EIEIO_INSTRUCTIONS_COMPLETED = 0b0000101u << 6,
|
OS_PM_MMCR0_PMC1_INSTRUCTIONS_DISPATCHED = 0b0000100u << 6,
|
||||||
OS_PM_MMCR0_PMC1_ITLB_SEARCH_CYCLES = 0b0000110u << 6,
|
OS_PM_MMCR0_PMC1_EIEIO_INSTRUCTIONS_COMPLETED = 0b0000101u << 6,
|
||||||
OS_PM_MMCR0_PMC1_L2_HITS = 0b0000111u << 6,
|
OS_PM_MMCR0_PMC1_ITLB_SEARCH_CYCLES = 0b0000110u << 6,
|
||||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_EA_DELIVERED = 0b0001000u << 6,
|
OS_PM_MMCR0_PMC1_L2_HITS = 0b0000111u << 6,
|
||||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED_MATCHES_IABR = 0b0001001u << 6,
|
OS_PM_MMCR0_PMC1_INSTRUCTIONS_EA_DELIVERED = 0b0001000u << 6,
|
||||||
OS_PM_MMCR0_PMC1_SLOW_L1_MISSES = 0b0001010u << 6,
|
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED_MATCHES_IABR = 0b0001001u << 6,
|
||||||
OS_PM_MMCR0_PMC1_UNRESOLVED_BRANCHES = 0b0001011u << 6,
|
OS_PM_MMCR0_PMC1_SLOW_L1_MISSES = 0b0001010u << 6,
|
||||||
OS_PM_MMCR0_PMC1_UNRESOLVED_STALL_CYCLES = 0b0001100u << 6,
|
OS_PM_MMCR0_PMC1_UNRESOLVED_BRANCHES = 0b0001011u << 6,
|
||||||
OS_PM_MMCR0_PMC1_L1_SHARED_STORES = 0b0001110u << 6,
|
OS_PM_MMCR0_PMC1_UNRESOLVED_STALL_CYCLES = 0b0001100u << 6,
|
||||||
OS_PM_MMCR0_PMC1_L2_SHARED_INTERVENTIONS = 0b0001111u << 6,
|
OS_PM_MMCR0_PMC1_L1_SHARED_STORES = 0b0001110u << 6,
|
||||||
OS_PM_MMCR0_PMC1_CACHE_PARADOXES = 0b0010000u << 6,
|
OS_PM_MMCR0_PMC1_L2_SHARED_INTERVENTIONS = 0b0001111u << 6,
|
||||||
OS_PM_MMCR0_PMC1_CIU_LOAD_REQUESTS = 0b0010100u << 6,
|
OS_PM_MMCR0_PMC1_CACHE_PARADOXES = 0b0010000u << 6,
|
||||||
OS_PM_MMCR0_PMC1_BIU_ADDRESS_ONLY_REQUESTS = 0b0010101u << 6,
|
OS_PM_MMCR0_PMC1_CIU_LOAD_REQUESTS = 0b0010100u << 6,
|
||||||
OS_PM_MMCR0_PMC1_CIU_PARADOXES = 0b0010110u << 6,
|
OS_PM_MMCR0_PMC1_BIU_ADDRESS_ONLY_REQUESTS = 0b0010101u << 6,
|
||||||
OS_PM_MMCR0_PMC1_60XE_BUS_DATA_BEATS = 0b0010111u << 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_CURRENT = 0b000000u,
|
||||||
OS_PM_MMCR0_PMC2_CPU_CYCLES = 0b000001u,
|
OS_PM_MMCR0_PMC2_CPU_CYCLES = 0b000001u,
|
||||||
OS_PM_MMCR0_PMC2_INSTRUCTIONS_COMPLETED = 0b000010u,
|
OS_PM_MMCR0_PMC2_INSTRUCTIONS_COMPLETED = 0b000010u,
|
||||||
OS_PM_MMCR0_PMC2_TBL_RISING_TRANSITIONS = 0b000011u,
|
OS_PM_MMCR0_PMC2_TBL_RISING_TRANSITIONS = 0b000011u,
|
||||||
OS_PM_MMCR0_PMC2_INSTRUCTIONS_DISPATCHED = 0b000100u,
|
OS_PM_MMCR0_PMC2_INSTRUCTIONS_DISPATCHED = 0b000100u,
|
||||||
OS_PM_MMCR0_PMC2_L1_ICACHE_MISSES = 0b000101u,
|
OS_PM_MMCR0_PMC2_L1_ICACHE_MISSES = 0b000101u,
|
||||||
OS_PM_MMCR0_PMC2_ITLB_MISSES = 0b000110u,
|
OS_PM_MMCR0_PMC2_ITLB_MISSES = 0b000110u,
|
||||||
OS_PM_MMCR0_PMC2_L2_INSTRUCTION_MISSES = 0b000111u,
|
OS_PM_MMCR0_PMC2_L2_INSTRUCTION_MISSES = 0b000111u,
|
||||||
OS_PM_MMCR0_PMC2_PRED_BRANCHES_NOT_TAKEN = 0b001000u,
|
OS_PM_MMCR0_PMC2_PRED_BRANCHES_NOT_TAKEN = 0b001000u,
|
||||||
OS_PM_MMCR0_PMC2_RESERVED_LOADS = 0b001010u,
|
OS_PM_MMCR0_PMC2_RESERVED_LOADS = 0b001010u,
|
||||||
OS_PM_MMCR0_PMC2_LOADS_AND_STORES = 0b001011u,
|
OS_PM_MMCR0_PMC2_LOADS_AND_STORES = 0b001011u,
|
||||||
OS_PM_MMCR0_PMC2_CACHE_SNOOPS = 0b001100u,
|
OS_PM_MMCR0_PMC2_CACHE_SNOOPS = 0b001100u,
|
||||||
OS_PM_MMCR0_PMC2_L1_TO_L2_CASTOUTS = 0b001101u,
|
OS_PM_MMCR0_PMC2_L1_TO_L2_CASTOUTS = 0b001101u,
|
||||||
OS_PM_MMCR0_PMC2_SYSTEM_UNIT_INSTRUCTIONS = 0b001110u,
|
OS_PM_MMCR0_PMC2_SYSTEM_UNIT_INSTRUCTIONS = 0b001110u,
|
||||||
OS_PM_MMCR0_PMC2_L1_INSTRUCTION_MISS_CYCLES = 0b001111u,
|
OS_PM_MMCR0_PMC2_L1_INSTRUCTION_MISS_CYCLES = 0b001111u,
|
||||||
OS_PM_MMCR0_PMC2_FIRST_SPECULATIVE_BRANCH_RESOLVES = 0b010000u,
|
OS_PM_MMCR0_PMC2_FIRST_SPECULATIVE_BRANCH_RESOLVES = 0b010000u,
|
||||||
OS_PM_MMCR0_PMC2_L2_SHARED_STORES = 0b010001u,
|
OS_PM_MMCR0_PMC2_L2_SHARED_STORES = 0b010001u,
|
||||||
OS_PM_MMCR0_PMC2_L1_SHARED_INTERVENTIONS = 0b010010u,
|
OS_PM_MMCR0_PMC2_L1_SHARED_INTERVENTIONS = 0b010010u,
|
||||||
OS_PM_MMCR0_PMC2_CIU_STORE_REQUESTS = 0b010100u,
|
OS_PM_MMCR0_PMC2_CIU_STORE_REQUESTS = 0b010100u,
|
||||||
OS_PM_MMCR0_PMC2_SLOW_OUTSTANDING_BIU_TRANSACTIONS = 0b010101u,
|
OS_PM_MMCR0_PMC2_SLOW_OUTSTANDING_BIU_TRANSACTIONS = 0b010101u,
|
||||||
OS_PM_MMCR0_PMC2_CIU_MODIFIED_INTERVENTIONS = 0b010110u,
|
OS_PM_MMCR0_PMC2_CIU_MODIFIED_INTERVENTIONS = 0b010110u,
|
||||||
} OSPerfMonMMCR0Flags;
|
} OSPerfMonMMCR0Flags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -79,48 +81,49 @@ typedef enum OSPerfMonMMCR0Flags {
|
||||||
*
|
*
|
||||||
* \sa OSSetPerformanceMonitor
|
* \sa OSSetPerformanceMonitor
|
||||||
*/
|
*/
|
||||||
typedef enum OSPerfMonMMCR1Flags {
|
typedef enum OSPerfMonMMCR1Flags
|
||||||
OS_PM_MMCR1_PMC3_CURRENT = 0b00000u << 27,
|
{
|
||||||
OS_PM_MMCR1_PMC3_CPU_CYCLES = 0b00001u << 27,
|
OS_PM_MMCR1_PMC3_CURRENT = 0b00000u << 27,
|
||||||
OS_PM_MMCR1_PMC3_INSTRUCTIONS_COMPLETED = 0b00010u << 27,
|
OS_PM_MMCR1_PMC3_CPU_CYCLES = 0b00001u << 27,
|
||||||
OS_PM_MMCR1_PMC3_TBL_RISING_TRANSITIONS = 0b00011u << 27,
|
OS_PM_MMCR1_PMC3_INSTRUCTIONS_COMPLETED = 0b00010u << 27,
|
||||||
OS_PM_MMCR1_PMC3_INSTRUCTIONS_DISPATCHED = 0b00100u << 27,
|
OS_PM_MMCR1_PMC3_TBL_RISING_TRANSITIONS = 0b00011u << 27,
|
||||||
OS_PM_MMCR1_PMC3_L1_DCACHE_MISSES = 0b00101u << 27,
|
OS_PM_MMCR1_PMC3_INSTRUCTIONS_DISPATCHED = 0b00100u << 27,
|
||||||
OS_PM_MMCR1_PMC3_DTLB_MISSES = 0b00110u << 27,
|
OS_PM_MMCR1_PMC3_L1_DCACHE_MISSES = 0b00101u << 27,
|
||||||
OS_PM_MMCR1_PMC3_L2_DATA_MISSES = 0b00111u << 27,
|
OS_PM_MMCR1_PMC3_DTLB_MISSES = 0b00110u << 27,
|
||||||
OS_PM_MMCR1_PMC3_PRED_BRANCHES_TAKEN = 0b01000u << 27,
|
OS_PM_MMCR1_PMC3_L2_DATA_MISSES = 0b00111u << 27,
|
||||||
OS_PM_MMCR1_PMC3_COND_STORES_COMPLETED = 0b01010u << 27,
|
OS_PM_MMCR1_PMC3_PRED_BRANCHES_TAKEN = 0b01000u << 27,
|
||||||
OS_PM_MMCR1_PMC3_FPU_INSTRUCTIONS_COMPLETED = 0b01011u << 27,
|
OS_PM_MMCR1_PMC3_COND_STORES_COMPLETED = 0b01010u << 27,
|
||||||
OS_PM_MMCR1_PMC3_L2_CASTOUTS_BY_SNOOPS = 0b01100u << 27,
|
OS_PM_MMCR1_PMC3_FPU_INSTRUCTIONS_COMPLETED = 0b01011u << 27,
|
||||||
OS_PM_MMCR1_PMC3_L2_CACHE_OPERATIONS = 0b01101u << 27,
|
OS_PM_MMCR1_PMC3_L2_CASTOUTS_BY_SNOOPS = 0b01100u << 27,
|
||||||
OS_PM_MMCR1_PMC3_L1_LOAD_MISS_CYCLES = 0b01111u << 27,
|
OS_PM_MMCR1_PMC3_L2_CACHE_OPERATIONS = 0b01101u << 27,
|
||||||
OS_PM_MMCR1_PMC3_SECOND_SPECULATIVE_BRANCH_RESOLVES = 0b10000u << 27,
|
OS_PM_MMCR1_PMC3_L1_LOAD_MISS_CYCLES = 0b01111u << 27,
|
||||||
OS_PM_MMCR1_PMC3_BPU_STALL_LR_CR_CYCLES = 0b10001u << 27,
|
OS_PM_MMCR1_PMC3_SECOND_SPECULATIVE_BRANCH_RESOLVES = 0b10000u << 27,
|
||||||
OS_PM_MMCR1_PMC3_L1_MODIFIED_INTERVENTIONS = 0b10010u << 27,
|
OS_PM_MMCR1_PMC3_BPU_STALL_LR_CR_CYCLES = 0b10001u << 27,
|
||||||
OS_PM_MMCR1_PMC3_ICBI_SNOOPS = 0b10011u << 27,
|
OS_PM_MMCR1_PMC3_L1_MODIFIED_INTERVENTIONS = 0b10010u << 27,
|
||||||
OS_PM_MMCR1_PMC3_CIU_ADDRESS_ONLY_REQUESTS = 0b10100u << 27,
|
OS_PM_MMCR1_PMC3_ICBI_SNOOPS = 0b10011u << 27,
|
||||||
OS_PM_MMCR1_PMC3_BIU_LOAD_REQUESTS = 0b10101u << 27,
|
OS_PM_MMCR1_PMC3_CIU_ADDRESS_ONLY_REQUESTS = 0b10100u << 27,
|
||||||
OS_PM_MMCR1_PMC3_CIU_SHARED_INTERVENTIONS = 0b10110u << 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_CURRENT = 0b00000u << 22,
|
||||||
OS_PM_MMCR1_PMC4_CPU_CYCLES = 0b00001u << 22,
|
OS_PM_MMCR1_PMC4_CPU_CYCLES = 0b00001u << 22,
|
||||||
OS_PM_MMCR1_PMC4_INSTRUCTIONS_COMPLETED = 0b00010u << 22,
|
OS_PM_MMCR1_PMC4_INSTRUCTIONS_COMPLETED = 0b00010u << 22,
|
||||||
OS_PM_MMCR1_PMC4_TBL_RISING_TRANSITIONS = 0b00011u << 22,
|
OS_PM_MMCR1_PMC4_TBL_RISING_TRANSITIONS = 0b00011u << 22,
|
||||||
OS_PM_MMCR1_PMC4_INSTRUCTIONS_DISPATCHED = 0b00100u << 22,
|
OS_PM_MMCR1_PMC4_INSTRUCTIONS_DISPATCHED = 0b00100u << 22,
|
||||||
OS_PM_MMCR1_PMC4_L2_CASTOUTS = 0b00101u << 22,
|
OS_PM_MMCR1_PMC4_L2_CASTOUTS = 0b00101u << 22,
|
||||||
OS_PM_MMCR1_PMC4_DTLB_SEARCH_CYCLES = 0b00110u << 22,
|
OS_PM_MMCR1_PMC4_DTLB_SEARCH_CYCLES = 0b00110u << 22,
|
||||||
OS_PM_MMCR1_PMC4_BRANCHES_MISPREDICTED = 0b01000u << 22,
|
OS_PM_MMCR1_PMC4_BRANCHES_MISPREDICTED = 0b01000u << 22,
|
||||||
OS_PM_MMCR1_PMC4_INTACT_COND_STORES_COMPLETED = 0b01010u << 22,
|
OS_PM_MMCR1_PMC4_INTACT_COND_STORES_COMPLETED = 0b01010u << 22,
|
||||||
OS_PM_MMCR1_PMC4_SYNC_INSTRUCTIONS_COMPLETED = 0b01011u << 22,
|
OS_PM_MMCR1_PMC4_SYNC_INSTRUCTIONS_COMPLETED = 0b01011u << 22,
|
||||||
OS_PM_MMCR1_PMC4_SNOOP_RETRIES = 0b01100u << 22,
|
OS_PM_MMCR1_PMC4_SNOOP_RETRIES = 0b01100u << 22,
|
||||||
OS_PM_MMCR1_PMC4_INTEGER_OPERATIONS = 0b01101u << 22,
|
OS_PM_MMCR1_PMC4_INTEGER_OPERATIONS = 0b01101u << 22,
|
||||||
OS_PM_MMCR1_PMC4_BPU_STALL_TWO_BRANCHES_CYCLES = 0b01110u << 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_L2_MODIFIED_INTERVENTIONS = 0b10000u << 22,
|
||||||
OS_PM_MMCR1_PMC4_TLBIE_SNOOPS = 0b10001u << 22,
|
OS_PM_MMCR1_PMC4_TLBIE_SNOOPS = 0b10001u << 22,
|
||||||
OS_PM_MMCR1_PMC4_L2_BANK_REFRESH_OVERFLOWS = 0b10010u << 22,
|
OS_PM_MMCR1_PMC4_L2_BANK_REFRESH_OVERFLOWS = 0b10010u << 22,
|
||||||
OS_PM_MMCR1_PMC4_CIU_ARTRY_COUNT = 0b10100u << 22,
|
OS_PM_MMCR1_PMC4_CIU_ARTRY_COUNT = 0b10100u << 22,
|
||||||
OS_PM_MMCR1_PMC4_BIU_STORE_REQUESTS = 0b10101u << 22,
|
OS_PM_MMCR1_PMC4_BIU_STORE_REQUESTS = 0b10101u << 22,
|
||||||
OS_PM_MMCR1_PMC4_CIU_TWO_CORE_SHARED_INTERVENTIONS = 0b10110u << 22,
|
OS_PM_MMCR1_PMC4_CIU_TWO_CORE_SHARED_INTERVENTIONS = 0b10110u << 22,
|
||||||
} OSPerfMonMMCR1Flags;
|
} OSPerfMonMMCR1Flags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -139,64 +142,61 @@ typedef enum OSPerfMonMMCR1Flags {
|
||||||
* \param pmc3 Value to write to register PMC3.
|
* \param pmc3 Value to write to register PMC3.
|
||||||
* \param pmc4 Value to write to register PMC4.
|
* \param pmc4 Value to write to register PMC4.
|
||||||
*/
|
*/
|
||||||
void OSSetPerformanceMonitor(uint32_t arg_mask,
|
void
|
||||||
uint32_t mmcr0,
|
OSSetPerformanceMonitor(uint32_t arg_mask,
|
||||||
uint32_t mmcr1,
|
uint32_t mmcr0,
|
||||||
uint32_t pmc1,
|
uint32_t mmcr1,
|
||||||
uint32_t pmc2,
|
uint32_t pmc1,
|
||||||
uint32_t pmc3,
|
uint32_t pmc2,
|
||||||
uint32_t pmc4);
|
uint32_t pmc3,
|
||||||
|
uint32_t pmc4);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience function to read from UPMC1.
|
* Convenience function to read from UPMC1.
|
||||||
*/
|
*/
|
||||||
static inline
|
static inline uint32_t
|
||||||
uint32_t
|
|
||||||
OSGetUPMC1()
|
OSGetUPMC1()
|
||||||
{
|
{
|
||||||
uint32_t result;
|
uint32_t result;
|
||||||
asm("mfupmc1 %[result]"
|
asm("mfupmc1 %[result]"
|
||||||
: [result] "=r"(result));
|
: [result] "=r"(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience function to read from UPMC2.
|
* Convenience function to read from UPMC2.
|
||||||
*/
|
*/
|
||||||
static inline
|
static inline uint32_t
|
||||||
uint32_t
|
|
||||||
OSGetUPMC2()
|
OSGetUPMC2()
|
||||||
{
|
{
|
||||||
uint32_t result;
|
uint32_t result;
|
||||||
asm("mfupmc2 %[result]"
|
asm("mfupmc2 %[result]"
|
||||||
: [result] "=r"(result));
|
: [result] "=r"(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience function to read from UPMC3.
|
* Convenience function to read from UPMC3.
|
||||||
*/
|
*/
|
||||||
static inline
|
static inline uint32_t
|
||||||
uint32_t
|
|
||||||
OSGetUPMC3()
|
OSGetUPMC3()
|
||||||
{
|
{
|
||||||
uint32_t result;
|
uint32_t result;
|
||||||
asm("mfupmc3 %[result]"
|
asm("mfupmc3 %[result]"
|
||||||
: [result] "=r"(result));
|
: [result] "=r"(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience function to read from UPMC4.
|
* Convenience function to read from UPMC4.
|
||||||
*/
|
*/
|
||||||
static inline
|
static inline uint32_t
|
||||||
uint32_t
|
|
||||||
OSGetUPMC4()
|
OSGetUPMC4()
|
||||||
{
|
{
|
||||||
uint32_t result;
|
uint32_t result;
|
||||||
asm("mfupmc4 %[result]"
|
asm("mfupmc4 %[result]"
|
||||||
: [result] "=r"(result));
|
: [result] "=r"(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,14 @@ extern "C" {
|
||||||
|
|
||||||
typedef enum OSSavedFrameType
|
typedef enum OSSavedFrameType
|
||||||
{
|
{
|
||||||
OS_SAVED_FRAME_A = 0,
|
OS_SAVED_FRAME_A = 0,
|
||||||
OS_SAVED_FRAME_B = 1,
|
OS_SAVED_FRAME_B = 1,
|
||||||
} OSSavedFrameType;
|
} OSSavedFrameType;
|
||||||
|
|
||||||
typedef enum OSSavedFrameScreen
|
typedef enum OSSavedFrameScreen
|
||||||
{
|
{
|
||||||
OS_SAVED_FRAME_SCREEN_TV = 2,
|
OS_SAVED_FRAME_SCREEN_TV = 2,
|
||||||
OS_SAVED_FRAME_SCREEN_DRC = 4,
|
OS_SAVED_FRAME_SCREEN_DRC = 4,
|
||||||
} OSSavedFrameScreen;
|
} OSSavedFrameScreen;
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void* __OSSchedulerLock;
|
extern void *__OSSchedulerLock;
|
||||||
|
|
||||||
void
|
void
|
||||||
__OSEnableScheduler();
|
__OSEnableScheduler();
|
||||||
|
|
@ -20,17 +20,17 @@ void
|
||||||
__OSDisableScheduler();
|
__OSDisableScheduler();
|
||||||
|
|
||||||
void
|
void
|
||||||
__OSLockScheduler(void* lockId);
|
__OSLockScheduler(void *lockId);
|
||||||
|
|
||||||
void
|
void
|
||||||
__OSUnlockScheduler(void* lockId);
|
__OSUnlockScheduler(void *lockId);
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
OSIsSchedulerLocked(void* lockId);
|
OSIsSchedulerLocked(void *lockId);
|
||||||
|
|
||||||
void
|
void
|
||||||
__OSTryLockScheduler(void* lockId);
|
__OSTryLockScheduler(void *lockId);
|
||||||
|
|
||||||
void
|
void
|
||||||
__OSTouchSchedulerLock();
|
__OSTouchSchedulerLock();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,9 +44,9 @@ extern "C" {
|
||||||
typedef enum OSScreenID
|
typedef enum OSScreenID
|
||||||
{
|
{
|
||||||
//! Represents the TV connected to the system.
|
//! Represents the TV connected to the system.
|
||||||
SCREEN_TV = 0,
|
SCREEN_TV = 0,
|
||||||
//! Represents the screen in the DRC (gamepad).
|
//! Represents the screen in the DRC (gamepad).
|
||||||
SCREEN_DRC = 1,
|
SCREEN_DRC = 1,
|
||||||
} OSScreenID;
|
} OSScreenID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -26,39 +26,39 @@ typedef struct SmdSimpleBufPool SmdSimpleBufPool;
|
||||||
|
|
||||||
typedef enum SmdLockType
|
typedef enum SmdLockType
|
||||||
{
|
{
|
||||||
//! Locking is done with a mutex
|
//! Locking is done with a mutex
|
||||||
SMD_LOCK_TYPE_MUTEX = 0,
|
SMD_LOCK_TYPE_MUTEX = 0,
|
||||||
//! Locking is done by disabling interrupts
|
//! Locking is done by disabling interrupts
|
||||||
SMD_LOCK_TYPE_DISABLE_INTERRUPTS = 1,
|
SMD_LOCK_TYPE_DISABLE_INTERRUPTS = 1,
|
||||||
//! No locking is done
|
//! No locking is done
|
||||||
SMD_LOCK_TYPE_NONE = 2,
|
SMD_LOCK_TYPE_NONE = 2,
|
||||||
} SmdLockType;
|
} SmdLockType;
|
||||||
|
|
||||||
typedef enum SmdPpcState
|
typedef enum SmdPpcState
|
||||||
{
|
{
|
||||||
SMD_PPC_STATE_INVALID = 0,
|
SMD_PPC_STATE_INVALID = 0,
|
||||||
SMD_PPC_STATE_INITIALIZED = 1,
|
SMD_PPC_STATE_INITIALIZED = 1,
|
||||||
SMD_PPC_STATE_CLOSED = 2,
|
SMD_PPC_STATE_CLOSED = 2,
|
||||||
SMD_PPC_STATE_OPENED = 3,
|
SMD_PPC_STATE_OPENED = 3,
|
||||||
} SmdPpcState;
|
} SmdPpcState;
|
||||||
|
|
||||||
typedef enum SmdInterfaceState
|
typedef enum SmdInterfaceState
|
||||||
{
|
{
|
||||||
SMD_INTERFACE_STATE_OPENED = 0x2222,
|
SMD_INTERFACE_STATE_OPENED = 0x2222,
|
||||||
SMD_INTERFACE_STATE_CLOSED = 0x3333,
|
SMD_INTERFACE_STATE_CLOSED = 0x3333,
|
||||||
} SmdInterfaceState;
|
} SmdInterfaceState;
|
||||||
|
|
||||||
typedef enum SmdElementType
|
typedef enum SmdElementType
|
||||||
{
|
{
|
||||||
SMD_ELEMENT_TYPE_MESSAGE = 0,
|
SMD_ELEMENT_TYPE_MESSAGE = 0,
|
||||||
SMD_ELEMENT_TYPE_VECTOR_SPEC = 1,
|
SMD_ELEMENT_TYPE_VECTOR_SPEC = 1,
|
||||||
SMD_ELEMENT_TYPE_VECTOR = 2,
|
SMD_ELEMENT_TYPE_VECTOR = 2,
|
||||||
} SmdElementType;
|
} SmdElementType;
|
||||||
|
|
||||||
struct SmdVectorSpec
|
struct SmdVectorSpec
|
||||||
{
|
{
|
||||||
void *ptr;
|
void *ptr;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(SmdVectorSpec, 0x00, ptr);
|
WUT_CHECK_OFFSET(SmdVectorSpec, 0x00, ptr);
|
||||||
WUT_CHECK_OFFSET(SmdVectorSpec, 0x04, size);
|
WUT_CHECK_OFFSET(SmdVectorSpec, 0x04, size);
|
||||||
|
|
@ -66,9 +66,9 @@ WUT_CHECK_SIZE(SmdVectorSpec, 0x8);
|
||||||
|
|
||||||
struct SmdVector
|
struct SmdVector
|
||||||
{
|
{
|
||||||
uint32_t command;
|
uint32_t command;
|
||||||
int32_t count;
|
int32_t count;
|
||||||
SmdVectorSpec vecs[4];
|
SmdVectorSpec vecs[4];
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(SmdVector, 0x00, command);
|
WUT_CHECK_OFFSET(SmdVector, 0x00, command);
|
||||||
WUT_CHECK_OFFSET(SmdVector, 0x04, count);
|
WUT_CHECK_OFFSET(SmdVector, 0x04, count);
|
||||||
|
|
@ -77,13 +77,14 @@ WUT_CHECK_SIZE(SmdVector, 0x28);
|
||||||
|
|
||||||
struct SmdElement
|
struct SmdElement
|
||||||
{
|
{
|
||||||
SmdElementType type;
|
SmdElementType type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
union {
|
union
|
||||||
uint8_t data[0xf8];
|
{
|
||||||
SmdVector spec;
|
uint8_t data[0xf8];
|
||||||
uint32_t vectorPaddr;
|
SmdVector spec;
|
||||||
};
|
uint32_t vectorPaddr;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(SmdElement, 0x00, type);
|
WUT_CHECK_OFFSET(SmdElement, 0x00, type);
|
||||||
WUT_CHECK_OFFSET(SmdElement, 0x04, size);
|
WUT_CHECK_OFFSET(SmdElement, 0x04, size);
|
||||||
|
|
@ -94,13 +95,14 @@ WUT_CHECK_SIZE(SmdElement, 0x100);
|
||||||
|
|
||||||
struct SmdReceiveData
|
struct SmdReceiveData
|
||||||
{
|
{
|
||||||
SmdElementType type;
|
SmdElementType type;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
union {
|
union
|
||||||
uint8_t message[0x80];
|
{
|
||||||
SmdVector spec;
|
uint8_t message[0x80];
|
||||||
SmdVector *vector;
|
SmdVector spec;
|
||||||
};
|
SmdVector *vector;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(SmdReceiveData, 0x00, type);
|
WUT_CHECK_OFFSET(SmdReceiveData, 0x00, type);
|
||||||
WUT_CHECK_OFFSET(SmdReceiveData, 0x04, size);
|
WUT_CHECK_OFFSET(SmdReceiveData, 0x04, size);
|
||||||
|
|
@ -111,16 +113,16 @@ WUT_CHECK_SIZE(SmdReceiveData, 0x88);
|
||||||
|
|
||||||
struct SmdInterface
|
struct SmdInterface
|
||||||
{
|
{
|
||||||
SmdInterfaceState state;
|
SmdInterfaceState state;
|
||||||
WUT_PADDING_BYTES(0x7C);
|
WUT_PADDING_BYTES(0x7C);
|
||||||
uint32_t elementCount;
|
uint32_t elementCount;
|
||||||
WUT_PADDING_BYTES(0x7C);
|
WUT_PADDING_BYTES(0x7C);
|
||||||
int32_t readOffset;
|
int32_t readOffset;
|
||||||
WUT_PADDING_BYTES(0x7C);
|
WUT_PADDING_BYTES(0x7C);
|
||||||
int32_t writeOffset;
|
int32_t writeOffset;
|
||||||
WUT_PADDING_BYTES(0x7C);
|
WUT_PADDING_BYTES(0x7C);
|
||||||
uint32_t bufPaddr;
|
uint32_t bufPaddr;
|
||||||
WUT_PADDING_BYTES(0x7C);
|
WUT_PADDING_BYTES(0x7C);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(SmdInterface, 0x000, state);
|
WUT_CHECK_OFFSET(SmdInterface, 0x000, state);
|
||||||
WUT_CHECK_OFFSET(SmdInterface, 0x080, elementCount);
|
WUT_CHECK_OFFSET(SmdInterface, 0x080, elementCount);
|
||||||
|
|
@ -131,13 +133,13 @@ WUT_CHECK_SIZE(SmdInterface, 0x280);
|
||||||
|
|
||||||
struct SmdCtrlTable
|
struct SmdCtrlTable
|
||||||
{
|
{
|
||||||
char name[0x10];
|
char name[0x10];
|
||||||
uint32_t reusedCount;
|
uint32_t reusedCount;
|
||||||
WUT_PADDING_BYTES(0x6C);
|
WUT_PADDING_BYTES(0x6C);
|
||||||
SmdInterface iopInterface;
|
SmdInterface iopInterface;
|
||||||
WUT_PADDING_BYTES(0x40);
|
WUT_PADDING_BYTES(0x40);
|
||||||
SmdInterface ppcInterface;
|
SmdInterface ppcInterface;
|
||||||
WUT_PADDING_BYTES(0x40);
|
WUT_PADDING_BYTES(0x40);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(SmdCtrlTable, 0x000, name);
|
WUT_CHECK_OFFSET(SmdCtrlTable, 0x000, name);
|
||||||
WUT_CHECK_OFFSET(SmdCtrlTable, 0x010, reusedCount);
|
WUT_CHECK_OFFSET(SmdCtrlTable, 0x010, reusedCount);
|
||||||
|
|
@ -147,12 +149,12 @@ WUT_CHECK_SIZE(SmdCtrlTable, 0x600);
|
||||||
|
|
||||||
struct SmdPpcCtrlTableVectors
|
struct SmdPpcCtrlTableVectors
|
||||||
{
|
{
|
||||||
SmdCtrlTable *ctrlTable;
|
SmdCtrlTable *ctrlTable;
|
||||||
uint32_t ctrlTableSize;
|
uint32_t ctrlTableSize;
|
||||||
SmdElement *writeBuf;
|
SmdElement *writeBuf;
|
||||||
uint32_t writeBufSize;
|
uint32_t writeBufSize;
|
||||||
SmdElement *readBuf;
|
SmdElement *readBuf;
|
||||||
uint32_t readBufSize;
|
uint32_t readBufSize;
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(SmdPpcCtrlTableVectors, 0x00, ctrlTable);
|
WUT_CHECK_OFFSET(SmdPpcCtrlTableVectors, 0x00, ctrlTable);
|
||||||
WUT_CHECK_OFFSET(SmdPpcCtrlTableVectors, 0x04, ctrlTableSize);
|
WUT_CHECK_OFFSET(SmdPpcCtrlTableVectors, 0x04, ctrlTableSize);
|
||||||
|
|
@ -164,15 +166,15 @@ WUT_CHECK_SIZE(SmdPpcCtrlTableVectors, 0x18);
|
||||||
|
|
||||||
struct SmdPpc
|
struct SmdPpc
|
||||||
{
|
{
|
||||||
SmdPpc *self;
|
SmdPpc *self;
|
||||||
SmdCtrlTable *ctrlTable;
|
SmdCtrlTable *ctrlTable;
|
||||||
SmdLockType lockType;
|
SmdLockType lockType;
|
||||||
OSMutex mutex;
|
OSMutex mutex;
|
||||||
uint32_t messageCount;
|
uint32_t messageCount;
|
||||||
SmdElement *writeBuf;
|
SmdElement *writeBuf;
|
||||||
SmdElement *readBuf;
|
SmdElement *readBuf;
|
||||||
SmdPpcState state;
|
SmdPpcState state;
|
||||||
WUT_PADDING_BYTES(0x38);
|
WUT_PADDING_BYTES(0x38);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(SmdPpc, 0x00, self);
|
WUT_CHECK_OFFSET(SmdPpc, 0x00, self);
|
||||||
WUT_CHECK_OFFSET(SmdPpc, 0x04, ctrlTable);
|
WUT_CHECK_OFFSET(SmdPpc, 0x04, ctrlTable);
|
||||||
|
|
@ -186,19 +188,19 @@ WUT_CHECK_SIZE(SmdPpc, 0x80);
|
||||||
|
|
||||||
struct SmdSimpleBufPool
|
struct SmdSimpleBufPool
|
||||||
{
|
{
|
||||||
SmdSimpleBufPool *self;
|
SmdSimpleBufPool *self;
|
||||||
OSMutex mutex;
|
OSMutex mutex;
|
||||||
void *poolData;
|
void *poolData;
|
||||||
uint32_t poolDataSize;
|
uint32_t poolDataSize;
|
||||||
SmdLockType lockType;
|
SmdLockType lockType;
|
||||||
uint32_t allocSize;
|
uint32_t allocSize;
|
||||||
uint32_t realAllocSize;
|
uint32_t realAllocSize;
|
||||||
uint32_t maxAllocCount;
|
uint32_t maxAllocCount;
|
||||||
void *allocPoolStart;
|
void *allocPoolStart;
|
||||||
void *allocPoolEnd;
|
void *allocPoolEnd;
|
||||||
uint32_t elementsIn;
|
uint32_t elementsIn;
|
||||||
uint32_t freeErrorCount;
|
uint32_t freeErrorCount;
|
||||||
WUT_PADDING_BYTES(0x28);
|
WUT_PADDING_BYTES(0x28);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(SmdSimpleBufPool, 0x00, self);
|
WUT_CHECK_OFFSET(SmdSimpleBufPool, 0x00, self);
|
||||||
WUT_CHECK_OFFSET(SmdSimpleBufPool, 0x04, mutex);
|
WUT_CHECK_OFFSET(SmdSimpleBufPool, 0x04, mutex);
|
||||||
|
|
|
||||||
|
|
@ -21,19 +21,19 @@ typedef uint32_t (*MPTaskFunc)(uint32_t, uint32_t);
|
||||||
|
|
||||||
typedef enum MPTaskState
|
typedef enum MPTaskState
|
||||||
{
|
{
|
||||||
MP_TASK_STATE_INITIALISED = 1 << 0,
|
MP_TASK_STATE_INITIALISED = 1 << 0,
|
||||||
MP_TASK_STATE_READY = 1 << 1,
|
MP_TASK_STATE_READY = 1 << 1,
|
||||||
MP_TASK_STATE_RUNNING = 1 << 2,
|
MP_TASK_STATE_RUNNING = 1 << 2,
|
||||||
MP_TASK_STATE_FINISHED = 1 << 3,
|
MP_TASK_STATE_FINISHED = 1 << 3,
|
||||||
} MPTaskState;
|
} MPTaskState;
|
||||||
|
|
||||||
typedef enum MPTaskQueueState
|
typedef enum MPTaskQueueState
|
||||||
{
|
{
|
||||||
MP_TASK_QUEUE_STATE_INITIALISED = 1 << 0,
|
MP_TASK_QUEUE_STATE_INITIALISED = 1 << 0,
|
||||||
MP_TASK_QUEUE_STATE_READY = 1 << 1,
|
MP_TASK_QUEUE_STATE_READY = 1 << 1,
|
||||||
MP_TASK_QUEUE_STATE_STOPPING = 1 << 2,
|
MP_TASK_QUEUE_STATE_STOPPING = 1 << 2,
|
||||||
MP_TASK_QUEUE_STATE_STOPPED = 1 << 3,
|
MP_TASK_QUEUE_STATE_STOPPED = 1 << 3,
|
||||||
MP_TASK_QUEUE_STATE_FINISHED = 1 << 4,
|
MP_TASK_QUEUE_STATE_FINISHED = 1 << 4,
|
||||||
} MPTaskQueueState;
|
} MPTaskQueueState;
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
|
|
@ -177,7 +177,7 @@ MPInitTask(MPTask *task,
|
||||||
uint32_t userArg2);
|
uint32_t userArg2);
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
MPTermTask(MPTask* task);
|
MPTermTask(MPTask *task);
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
MPGetTaskInfo(MPTask *task,
|
MPGetTaskInfo(MPTask *task,
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "alarm.h"
|
#include "alarm.h"
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
#include "time.h"
|
|
||||||
#include "threadqueue.h"
|
|
||||||
#include "exception.h"
|
#include "exception.h"
|
||||||
|
#include "threadqueue.h"
|
||||||
|
#include "time.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup coreinit_thread Thread
|
* \defgroup coreinit_thread Thread
|
||||||
|
|
@ -60,73 +60,74 @@ typedef void (*OSThreadDeallocatorFn)(OSThread *thread, void *stack);
|
||||||
typedef enum OSThreadSpecificID
|
typedef enum OSThreadSpecificID
|
||||||
{
|
{
|
||||||
//! These can be used by applications
|
//! These can be used by applications
|
||||||
OS_THREAD_SPECIFIC_0 = 0,
|
OS_THREAD_SPECIFIC_0 = 0,
|
||||||
OS_THREAD_SPECIFIC_1 = 1,
|
OS_THREAD_SPECIFIC_1 = 1,
|
||||||
OS_THREAD_SPECIFIC_2 = 2,
|
OS_THREAD_SPECIFIC_2 = 2,
|
||||||
OS_THREAD_SPECIFIC_3 = 3,
|
OS_THREAD_SPECIFIC_3 = 3,
|
||||||
OS_THREAD_SPECIFIC_4 = 4,
|
OS_THREAD_SPECIFIC_4 = 4,
|
||||||
OS_THREAD_SPECIFIC_5 = 5,
|
OS_THREAD_SPECIFIC_5 = 5,
|
||||||
OS_THREAD_SPECIFIC_6 = 6,
|
OS_THREAD_SPECIFIC_6 = 6,
|
||||||
OS_THREAD_SPECIFIC_7 = 7,
|
OS_THREAD_SPECIFIC_7 = 7,
|
||||||
OS_THREAD_SPECIFIC_8 = 8,
|
OS_THREAD_SPECIFIC_8 = 8,
|
||||||
OS_THREAD_SPECIFIC_9 = 9,
|
OS_THREAD_SPECIFIC_9 = 9,
|
||||||
OS_THREAD_SPECIFIC_10 = 10,
|
OS_THREAD_SPECIFIC_10 = 10,
|
||||||
OS_THREAD_SPECIFIC_11 = 11,
|
OS_THREAD_SPECIFIC_11 = 11,
|
||||||
OS_THREAD_SPECIFIC_12 = 12,
|
OS_THREAD_SPECIFIC_12 = 12,
|
||||||
OS_THREAD_SPECIFIC_13 = 13,
|
OS_THREAD_SPECIFIC_13 = 13,
|
||||||
//! These are reserved to wut for internal use
|
//! These are reserved to wut for internal use
|
||||||
OS_THREAD_SPECIFIC_WUT_RESERVED_0 = 14,
|
OS_THREAD_SPECIFIC_WUT_RESERVED_0 = 14,
|
||||||
OS_THREAD_SPECIFIC_WUT_RESERVED_1 = 15,
|
OS_THREAD_SPECIFIC_WUT_RESERVED_1 = 15,
|
||||||
} OSThreadSpecificID;
|
} OSThreadSpecificID;
|
||||||
|
|
||||||
enum OS_THREAD_STATE
|
enum OS_THREAD_STATE
|
||||||
{
|
{
|
||||||
OS_THREAD_STATE_NONE = 0,
|
OS_THREAD_STATE_NONE = 0,
|
||||||
|
|
||||||
//! Thread is ready to run
|
//! Thread is ready to run
|
||||||
OS_THREAD_STATE_READY = 1 << 0,
|
OS_THREAD_STATE_READY = 1 << 0,
|
||||||
|
|
||||||
//! Thread is running
|
//! Thread is running
|
||||||
OS_THREAD_STATE_RUNNING = 1 << 1,
|
OS_THREAD_STATE_RUNNING = 1 << 1,
|
||||||
|
|
||||||
//! Thread is waiting, i.e. on a mutex
|
//! Thread is waiting, i.e. on a mutex
|
||||||
OS_THREAD_STATE_WAITING = 1 << 2,
|
OS_THREAD_STATE_WAITING = 1 << 2,
|
||||||
|
|
||||||
//! Thread is about to terminate
|
//! Thread is about to terminate
|
||||||
OS_THREAD_STATE_MORIBUND = 1 << 3,
|
OS_THREAD_STATE_MORIBUND = 1 << 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum OS_THREAD_REQUEST
|
enum OS_THREAD_REQUEST
|
||||||
{
|
{
|
||||||
OS_THREAD_REQUEST_NONE = 0,
|
OS_THREAD_REQUEST_NONE = 0,
|
||||||
OS_THREAD_REQUEST_SUSPEND = 1,
|
OS_THREAD_REQUEST_SUSPEND = 1,
|
||||||
OS_THREAD_REQUEST_CANCEL = 2,
|
OS_THREAD_REQUEST_CANCEL = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum OS_THREAD_ATTRIB
|
enum OS_THREAD_ATTRIB
|
||||||
{
|
{
|
||||||
//! Allow the thread to run on CPU0.
|
//! Allow the thread to run on CPU0.
|
||||||
OS_THREAD_ATTRIB_AFFINITY_CPU0 = 1 << 0,
|
OS_THREAD_ATTRIB_AFFINITY_CPU0 = 1 << 0,
|
||||||
|
|
||||||
//! Allow the thread to run on CPU1.
|
//! Allow the thread to run on CPU1.
|
||||||
OS_THREAD_ATTRIB_AFFINITY_CPU1 = 1 << 1,
|
OS_THREAD_ATTRIB_AFFINITY_CPU1 = 1 << 1,
|
||||||
|
|
||||||
//! Allow the thread to run on CPU2.
|
//! Allow the thread to run on CPU2.
|
||||||
OS_THREAD_ATTRIB_AFFINITY_CPU2 = 1 << 2,
|
OS_THREAD_ATTRIB_AFFINITY_CPU2 = 1 << 2,
|
||||||
|
|
||||||
//! Allow the thread to run any CPU.
|
//! Allow the thread to run any CPU.
|
||||||
OS_THREAD_ATTRIB_AFFINITY_ANY = ((1 << 0) | (1 << 1) | (1 << 2)),
|
OS_THREAD_ATTRIB_AFFINITY_ANY = ((1 << 0) | (1 << 1) | (1 << 2)),
|
||||||
|
|
||||||
//! Start the thread detached.
|
//! Start the thread detached.
|
||||||
OS_THREAD_ATTRIB_DETACHED = 1 << 3,
|
OS_THREAD_ATTRIB_DETACHED = 1 << 3,
|
||||||
|
|
||||||
//! Enables tracking of stack usage.
|
//! Enables tracking of stack usage.
|
||||||
OS_THREAD_ATTRIB_STACK_USAGE = 1 << 5,
|
OS_THREAD_ATTRIB_STACK_USAGE = 1 << 5,
|
||||||
|
|
||||||
OS_THREAD_ATTRIB_UNKNOWN = 1 << 7
|
OS_THREAD_ATTRIB_UNKNOWN = 1 << 7
|
||||||
};
|
};
|
||||||
|
|
||||||
enum OS_THREAD_TYPE {
|
enum OS_THREAD_TYPE
|
||||||
|
{
|
||||||
OS_THREAD_TYPE_DRIVER = 0,
|
OS_THREAD_TYPE_DRIVER = 0,
|
||||||
OS_THREAD_TYPE_IO = 1,
|
OS_THREAD_TYPE_IO = 1,
|
||||||
OS_THREAD_TYPE_APP = 2
|
OS_THREAD_TYPE_APP = 2
|
||||||
|
|
@ -169,7 +170,7 @@ WUT_CHECK_SIZE(OSFastMutexQueue, 0x08);
|
||||||
|
|
||||||
struct OSTLSSection
|
struct OSTLSSection
|
||||||
{
|
{
|
||||||
void* data;
|
void *data;
|
||||||
WUT_UNKNOWN_BYTES(4);
|
WUT_UNKNOWN_BYTES(4);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(OSTLSSection, 0x00, data);
|
WUT_CHECK_OFFSET(OSTLSSection, 0x00, data);
|
||||||
|
|
@ -309,10 +310,10 @@ struct WUT_ALIGNAS(8) OSThread
|
||||||
WUT_UNKNOWN_BYTES(0x2);
|
WUT_UNKNOWN_BYTES(0x2);
|
||||||
|
|
||||||
//! TLS Sections
|
//! TLS Sections
|
||||||
OSTLSSection* tlsSections;
|
OSTLSSection *tlsSections;
|
||||||
|
|
||||||
//! The fast mutex we are currently waiting for
|
//! The fast mutex we are currently waiting for
|
||||||
OSFastMutex* fastMutex;
|
OSFastMutex *fastMutex;
|
||||||
|
|
||||||
//! The fast mutexes we are currently contended on
|
//! The fast mutexes we are currently contended on
|
||||||
OSFastMutexQueue contendedFastMutexes;
|
OSFastMutexQueue contendedFastMutexes;
|
||||||
|
|
|
||||||
|
|
@ -53,17 +53,17 @@ WUT_CHECK_OFFSET(OSCalendarTime, 0x20, tm_msec);
|
||||||
WUT_CHECK_OFFSET(OSCalendarTime, 0x24, tm_usec);
|
WUT_CHECK_OFFSET(OSCalendarTime, 0x24, tm_usec);
|
||||||
WUT_CHECK_SIZE(OSCalendarTime, 0x28);
|
WUT_CHECK_SIZE(OSCalendarTime, 0x28);
|
||||||
|
|
||||||
#define OSTimerClockSpeed ((OSGetSystemInfo()->busClockSpeed) / 4)
|
#define OSTimerClockSpeed ((OSGetSystemInfo()->busClockSpeed) / 4)
|
||||||
|
|
||||||
#define OSSecondsToTicks(val) ((uint64_t)(val) * (uint64_t)OSTimerClockSpeed)
|
#define OSSecondsToTicks(val) ((uint64_t)(val) * (uint64_t)OSTimerClockSpeed)
|
||||||
#define OSMillisecondsToTicks(val) (((uint64_t)(val) * (uint64_t)OSTimerClockSpeed) / 1000ull)
|
#define OSMillisecondsToTicks(val) (((uint64_t)(val) * (uint64_t)OSTimerClockSpeed) / 1000ull)
|
||||||
#define OSMicrosecondsToTicks(val) (((uint64_t)(val) * (uint64_t)OSTimerClockSpeed) / 1000000ull)
|
#define OSMicrosecondsToTicks(val) (((uint64_t)(val) * (uint64_t)OSTimerClockSpeed) / 1000000ull)
|
||||||
#define OSNanosecondsToTicks(val) (((uint64_t)(val) * ((uint64_t)OSTimerClockSpeed) / 31250ull) / 32000ull)
|
#define OSNanosecondsToTicks(val) (((uint64_t)(val) * ((uint64_t)OSTimerClockSpeed) / 31250ull) / 32000ull)
|
||||||
|
|
||||||
#define OSTicksToSeconds(val) ((uint64_t)(val) / (uint64_t)OSTimerClockSpeed)
|
#define OSTicksToSeconds(val) ((uint64_t)(val) / (uint64_t)OSTimerClockSpeed)
|
||||||
#define OSTicksToMilliseconds(val) (((uint64_t)(val) * 1000ull) / (uint64_t)OSTimerClockSpeed)
|
#define OSTicksToMilliseconds(val) (((uint64_t)(val) * 1000ull) / (uint64_t)OSTimerClockSpeed)
|
||||||
#define OSTicksToMicroseconds(val) (((uint64_t)(val) * 1000000ull) / (uint64_t)OSTimerClockSpeed)
|
#define OSTicksToMicroseconds(val) (((uint64_t)(val) * 1000000ull) / (uint64_t)OSTimerClockSpeed)
|
||||||
#define OSTicksToNanoseconds(val) (((uint64_t)(val) * 32000ull) / ((uint64_t)OSTimerClockSpeed / 31250ull))
|
#define OSTicksToNanoseconds(val) (((uint64_t)(val) * 32000ull) / ((uint64_t)OSTimerClockSpeed / 31250ull))
|
||||||
|
|
||||||
OSTime
|
OSTime
|
||||||
OSGetTime();
|
OSGetTime();
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint64_t OSGetTitleID(void);
|
uint64_t
|
||||||
|
OSGetTitleID(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,9 @@ extern "C" {
|
||||||
int
|
int
|
||||||
__OSGetSavedAudioFlags();
|
__OSGetSavedAudioFlags();
|
||||||
|
|
||||||
int __OSGetTransitionAudioBuffer(void **buffer,
|
int
|
||||||
uint32_t *size);
|
__OSGetTransitionAudioBuffer(void **buffer,
|
||||||
|
uint32_t *size);
|
||||||
|
|
||||||
void
|
void
|
||||||
__OSSetTransitionAudioSize(uint32_t size);
|
__OSSetTransitionAudioSize(uint32_t size);
|
||||||
|
|
|
||||||
|
|
@ -20,75 +20,75 @@ typedef struct UCAsyncParams UCAsyncParams;
|
||||||
|
|
||||||
typedef enum UCCommand
|
typedef enum UCCommand
|
||||||
{
|
{
|
||||||
UC_CMD_READ_SYS_CONFIG = 0x30,
|
UC_CMD_READ_SYS_CONFIG = 0x30,
|
||||||
UC_CMD_WRITE_SYS_CONFIG = 0x31,
|
UC_CMD_WRITE_SYS_CONFIG = 0x31,
|
||||||
UC_CMD_DELETE_SYS_CONFIG = 0x32,
|
UC_CMD_DELETE_SYS_CONFIG = 0x32,
|
||||||
UC_CMD_QUERY_SYS_CONFIG = 0x33,
|
UC_CMD_QUERY_SYS_CONFIG = 0x33,
|
||||||
UC_CMD_LIST_SYS_CONFIG = 0x34,
|
UC_CMD_LIST_SYS_CONFIG = 0x34,
|
||||||
} UCCommand;
|
} UCCommand;
|
||||||
|
|
||||||
typedef enum UCDataType
|
typedef enum UCDataType
|
||||||
{
|
{
|
||||||
UC_DATATYPE_UNDEFINED = 0x00,
|
UC_DATATYPE_UNDEFINED = 0x00,
|
||||||
UC_DATATYPE_UNSIGNED_BYTE = 0x01,
|
UC_DATATYPE_UNSIGNED_BYTE = 0x01,
|
||||||
UC_DATATYPE_UNSIGNED_SHORT = 0x02,
|
UC_DATATYPE_UNSIGNED_SHORT = 0x02,
|
||||||
UC_DATATYPE_UNSIGNED_INT = 0x03,
|
UC_DATATYPE_UNSIGNED_INT = 0x03,
|
||||||
UC_DATATYPE_SIGNED_INT = 0x04,
|
UC_DATATYPE_SIGNED_INT = 0x04,
|
||||||
UC_DATATYPE_FLOAT = 0x05,
|
UC_DATATYPE_FLOAT = 0x05,
|
||||||
UC_DATATYPE_STRING = 0x06,
|
UC_DATATYPE_STRING = 0x06,
|
||||||
UC_DATATYPE_HEXBINARY = 0x07,
|
UC_DATATYPE_HEXBINARY = 0x07,
|
||||||
UC_DATATYPE_COMPLEX = 0x08,
|
UC_DATATYPE_COMPLEX = 0x08,
|
||||||
UC_DATATYPE_INVALID = 0xFF,
|
UC_DATATYPE_INVALID = 0xFF,
|
||||||
} UCDataType;
|
} UCDataType;
|
||||||
|
|
||||||
typedef enum UCErrors
|
typedef enum UCErrors
|
||||||
{
|
{
|
||||||
UC_ERROR_OK = 0,
|
UC_ERROR_OK = 0,
|
||||||
UC_ERROR_ERROR = -1,
|
UC_ERROR_ERROR = -1,
|
||||||
UC_ERROR_OTHER = -0x200001,
|
UC_ERROR_OTHER = -0x200001,
|
||||||
UC_ERROR_SYSTEM = -0x200002,
|
UC_ERROR_SYSTEM = -0x200002,
|
||||||
UC_ERROR_ALLOC = -0x200003,
|
UC_ERROR_ALLOC = -0x200003,
|
||||||
UC_ERROR_OPCODE = -0x200004,
|
UC_ERROR_OPCODE = -0x200004,
|
||||||
UC_ERROR_INVALID_PARAM = -0x200005,
|
UC_ERROR_INVALID_PARAM = -0x200005,
|
||||||
UC_ERROR_INVALID_TYPE = -0x200006,
|
UC_ERROR_INVALID_TYPE = -0x200006,
|
||||||
UC_ERROR_UNSUPPORTED = -0x200007,
|
UC_ERROR_UNSUPPORTED = -0x200007,
|
||||||
UC_ERROR_NON_LEAF_NODE = -0x200008,
|
UC_ERROR_NON_LEAF_NODE = -0x200008,
|
||||||
UC_ERROR_KEY_NOT_FOUND = -0x200009,
|
UC_ERROR_KEY_NOT_FOUND = -0x200009,
|
||||||
UC_ERROR_MODIFY = -0x20000A,
|
UC_ERROR_MODIFY = -0x20000A,
|
||||||
UC_ERROR_STRING_TOO_LONG = -0x20000B,
|
UC_ERROR_STRING_TOO_LONG = -0x20000B,
|
||||||
UC_ERROR_ROOT_KEYS_DIFFER = -0x20000C,
|
UC_ERROR_ROOT_KEYS_DIFFER = -0x20000C,
|
||||||
UC_ERROR_INVALID_LOCATION = -0x20000D,
|
UC_ERROR_INVALID_LOCATION = -0x20000D,
|
||||||
UC_ERROR_BAD_COMMENT = -0x20000E,
|
UC_ERROR_BAD_COMMENT = -0x20000E,
|
||||||
UC_ERROR_READ_ACCESS = -0x20000F,
|
UC_ERROR_READ_ACCESS = -0x20000F,
|
||||||
UC_ERROR_WRITE_ACCESS = -0x200010,
|
UC_ERROR_WRITE_ACCESS = -0x200010,
|
||||||
UC_ERROR_CREATE_ACCESS = -0x200011,
|
UC_ERROR_CREATE_ACCESS = -0x200011,
|
||||||
UC_ERROR_FILE_SYS_NAME = -0x200012,
|
UC_ERROR_FILE_SYS_NAME = -0x200012,
|
||||||
UC_ERROR_FILE_SYS_INIT = -0x200013,
|
UC_ERROR_FILE_SYS_INIT = -0x200013,
|
||||||
UC_ERROR_FILE_SYS_MOUNT = -0x200014,
|
UC_ERROR_FILE_SYS_MOUNT = -0x200014,
|
||||||
UC_ERROR_FILE_OPEN = -0x200015,
|
UC_ERROR_FILE_OPEN = -0x200015,
|
||||||
UC_ERROR_FILE_STAT = -0x200016,
|
UC_ERROR_FILE_STAT = -0x200016,
|
||||||
UC_ERROR_FILE_READ = -0x200017,
|
UC_ERROR_FILE_READ = -0x200017,
|
||||||
UC_ERROR_FILE_WRITE = -0x200018,
|
UC_ERROR_FILE_WRITE = -0x200018,
|
||||||
UC_ERROR_FILE_TOO_BIG = -0x200019,
|
UC_ERROR_FILE_TOO_BIG = -0x200019,
|
||||||
UC_ERROR_FILE_REMOVE = -0x20001A,
|
UC_ERROR_FILE_REMOVE = -0x20001A,
|
||||||
UC_ERROR_FILE_RENAME = -0x20001B,
|
UC_ERROR_FILE_RENAME = -0x20001B,
|
||||||
UC_ERROR_FILE_CLOSE = -0x20001C,
|
UC_ERROR_FILE_CLOSE = -0x20001C,
|
||||||
UC_ERROR_FILE_SEEK = -0x20001D,
|
UC_ERROR_FILE_SEEK = -0x20001D,
|
||||||
UC_ERROR_FILE_CONFIRM = -0x20001E,
|
UC_ERROR_FILE_CONFIRM = -0x20001E,
|
||||||
UC_ERROR_FILE_BACKUP = -0x20001F,
|
UC_ERROR_FILE_BACKUP = -0x20001F,
|
||||||
UC_ERROR_MALFORMED_XML = -0x200020,
|
UC_ERROR_MALFORMED_XML = -0x200020,
|
||||||
UC_ERROR_VERSION = -0x200021,
|
UC_ERROR_VERSION = -0x200021,
|
||||||
UC_ERROR_NO_IPC_BUFFERS = -0x200022,
|
UC_ERROR_NO_IPC_BUFFERS = -0x200022,
|
||||||
UC_ERROR_FILE_LOCK_NEEDED = -0x200024,
|
UC_ERROR_FILE_LOCK_NEEDED = -0x200024,
|
||||||
UC_ERROR_SYS_PROT = -0x200028,
|
UC_ERROR_SYS_PROT = -0x200028,
|
||||||
} UCErrors;
|
} UCErrors;
|
||||||
|
|
||||||
typedef enum UCFileSys
|
typedef enum UCFileSys
|
||||||
{
|
{
|
||||||
UC_FILE_SYS_INVALID = 0x00,
|
UC_FILE_SYS_INVALID = 0x00,
|
||||||
UC_FILE_SYS_SYS = 0x01,
|
UC_FILE_SYS_SYS = 0x01,
|
||||||
UC_FILE_SYS_SLC = 0x02,
|
UC_FILE_SYS_SLC = 0x02,
|
||||||
UC_FILE_SYS_RAM = 0x03,
|
UC_FILE_SYS_RAM = 0x03,
|
||||||
} UCFileSys;
|
} UCFileSys;
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
|
|
@ -118,13 +118,13 @@ typedef void (*UCAsyncCallbackFn)(UCError result,
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
struct UCAsyncParams
|
struct UCAsyncParams
|
||||||
{
|
{
|
||||||
UCAsyncCallbackFn callback;
|
UCAsyncCallbackFn callback;
|
||||||
void *context;
|
void *context;
|
||||||
UCCommand command;
|
UCCommand command;
|
||||||
uint32_t unk0x0C;
|
uint32_t unk0x0C;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
UCSysConfig *settings;
|
UCSysConfig *settings;
|
||||||
IOSVec *vecs;
|
IOSVec *vecs;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
WUT_CHECK_OFFSET(UCAsyncParams, 0x00, callback);
|
WUT_CHECK_OFFSET(UCAsyncParams, 0x00, callback);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
|
#include <gx2/semaphore.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup dmae_sync Synchronization
|
* \defgroup dmae_sync Synchronization
|
||||||
|
|
@ -14,6 +15,12 @@ extern "C" {
|
||||||
//! Timestamp for a DMAE operation.
|
//! Timestamp for a DMAE operation.
|
||||||
typedef uint64_t DMAETimeStamp;
|
typedef uint64_t DMAETimeStamp;
|
||||||
|
|
||||||
|
DMAETimeStamp
|
||||||
|
DMAEGetLastSubmittedTimeStamp(void);
|
||||||
|
|
||||||
|
DMAETimeStamp
|
||||||
|
DMAEGetRetiredTimeStamp(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for a DMAE operation to complete.
|
* Waits for a DMAE operation to complete.
|
||||||
*
|
*
|
||||||
|
|
@ -26,6 +33,16 @@ typedef uint64_t DMAETimeStamp;
|
||||||
BOOL
|
BOOL
|
||||||
DMAEWaitDone(DMAETimeStamp timestamp);
|
DMAEWaitDone(DMAETimeStamp timestamp);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
DMAEGetTimeout(void);
|
||||||
|
|
||||||
|
void
|
||||||
|
DMAESetTimeout(uint32_t timeout);
|
||||||
|
|
||||||
|
void
|
||||||
|
DMAESemaphore(GX2Semaphore *semaphore,
|
||||||
|
GX2SemaphoreAction action);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -17,30 +17,52 @@ struct FSClient;
|
||||||
namespace Rpl
|
namespace Rpl
|
||||||
{
|
{
|
||||||
|
|
||||||
void ErrEulaSetVersion(int version);
|
void
|
||||||
bool ErrEulaJump(const char *buffer, uint32_t bufferSize);
|
ErrEulaSetVersion(int version);
|
||||||
void ErrEulaPlayAppearSE(bool playAppearSoundEffect);
|
bool
|
||||||
bool ErrEulaIsSelectCursorActive();
|
ErrEulaJump(const char *buffer, uint32_t bufferSize);
|
||||||
void ErrEulaChangeLang(nn::erreula::LangType language);
|
void
|
||||||
void ErrEulaDisappearHomeNixSign();
|
ErrEulaPlayAppearSE(bool playAppearSoundEffect);
|
||||||
bool ErrEulaIsAppearHomeNixSign();
|
bool
|
||||||
void ErrEulaAppearHomeNixSign(const nn::erreula::HomeNixSignArg &arg);
|
ErrEulaIsSelectCursorActive();
|
||||||
void ErrEulaSetControllerRemo(nn::erreula::ControllerType controller);
|
void
|
||||||
int32_t ErrEulaGetSelectButtonNumError();
|
ErrEulaChangeLang(nn::erreula::LangType language);
|
||||||
int32_t ErrEulaGetResultCode();
|
void
|
||||||
nn::erreula::ResultType ErrEulaGetResultType();
|
ErrEulaDisappearHomeNixSign();
|
||||||
nn::erreula::State ErrEulaGetStateErrorViewer();
|
bool
|
||||||
bool ErrEulaIsDecideSelectRightButtonError();
|
ErrEulaIsAppearHomeNixSign();
|
||||||
bool ErrEulaIsDecideSelectLeftButtonError();
|
void
|
||||||
bool ErrEulaIsDecideSelectButtonError();
|
ErrEulaAppearHomeNixSign(const nn::erreula::HomeNixSignArg &arg);
|
||||||
void ErrEulaDisappearError();
|
void
|
||||||
void ErrEulaAppearError(const nn::erreula::AppearArg &arg);
|
ErrEulaSetControllerRemo(nn::erreula::ControllerType controller);
|
||||||
void ErrEulaCalc(const nn::erreula::ControllerInfo &controllerInfo);
|
int32_t
|
||||||
void ErrEulaDrawDRC();
|
ErrEulaGetSelectButtonNumError();
|
||||||
void ErrEulaDrawTV();
|
int32_t
|
||||||
void ErrEulaDestroy();
|
ErrEulaGetResultCode();
|
||||||
void ErrEulaCreate(void *workMemory, nn::erreula::RegionType region,
|
nn::erreula::ResultType
|
||||||
nn::erreula::LangType language, FSClient *fsClient);
|
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
|
} // namespace Rpl
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,27 +16,27 @@ typedef struct GX2DebugCaptureInterface GX2DebugCaptureInterface;
|
||||||
|
|
||||||
typedef enum GX2DebugCaptureInterfaceVersion
|
typedef enum GX2DebugCaptureInterfaceVersion
|
||||||
{
|
{
|
||||||
GX2_DEBUG_CAPTURE_INTERFACE_VERSION = 1,
|
GX2_DEBUG_CAPTURE_INTERFACE_VERSION = 1,
|
||||||
} GX2DebugCaptureInterfaceVersion;
|
} GX2DebugCaptureInterfaceVersion;
|
||||||
|
|
||||||
//! Options for \link GX2DebugCaptureStart \endlink.
|
//! Options for \link GX2DebugCaptureStart \endlink.
|
||||||
typedef enum GX2DebugCaptureStartFlags
|
typedef enum GX2DebugCaptureStartFlags
|
||||||
{
|
{
|
||||||
//! When set \link GX2DebugCaptureStart \endlink will call \link GX2DrawDone \endlink before the capture is started.
|
//! When set \link GX2DebugCaptureStart \endlink will call \link GX2DrawDone \endlink before the capture is started.
|
||||||
GX2_DEBUG_CAPTURE_START_FLAGS_NONE = 0,
|
GX2_DEBUG_CAPTURE_START_FLAGS_NONE = 0,
|
||||||
|
|
||||||
//! When set \link GX2DebugCaptureStart \endlink will NOT call \link GX2DrawDone \endlink.
|
//! When set \link GX2DebugCaptureStart \endlink will NOT call \link GX2DrawDone \endlink.
|
||||||
GX2_DEBUG_CAPTURE_START_FLAGS_DISABLE_GX2DRAWDONE = 1,
|
GX2_DEBUG_CAPTURE_START_FLAGS_DISABLE_GX2DRAWDONE = 1,
|
||||||
} GX2DebugCaptureStartFlags;
|
} GX2DebugCaptureStartFlags;
|
||||||
|
|
||||||
//! Options for \link GX2DebugCaptureEnd \endlink.
|
//! Options for \link GX2DebugCaptureEnd \endlink.
|
||||||
typedef enum GX2DebugCaptureEndFlags
|
typedef enum GX2DebugCaptureEndFlags
|
||||||
{
|
{
|
||||||
//! When set \link GX2DebugCaptureEnd \endlink will call \link GX2Flush \endlink before the capture is completed.
|
//! When set \link GX2DebugCaptureEnd \endlink will call \link GX2Flush \endlink before the capture is completed.
|
||||||
GX2_DEBUG_CAPTURE_END_FLAGS_NONE = 0,
|
GX2_DEBUG_CAPTURE_END_FLAGS_NONE = 0,
|
||||||
|
|
||||||
//! When set \link GX2DebugCaptureEnd \endlink will NOT call \link GX2Flush \endlink.
|
//! When set \link GX2DebugCaptureEnd \endlink will NOT call \link GX2Flush \endlink.
|
||||||
GX2_DEBUG_CAPTURE_END_FLAGS_DISABLE_GX2FLUSH = 1,
|
GX2_DEBUG_CAPTURE_END_FLAGS_DISABLE_GX2FLUSH = 1,
|
||||||
} GX2DebugCaptureEndFlags;
|
} GX2DebugCaptureEndFlags;
|
||||||
|
|
||||||
struct GX2DebugCaptureInterface
|
struct GX2DebugCaptureInterface
|
||||||
|
|
@ -140,7 +140,7 @@ GX2DebugCaptureEnd(GX2DebugCaptureEndFlags flags);
|
||||||
* Equivalent to calling GX2DebugCaptureFrames(filename, 1)
|
* Equivalent to calling GX2DebugCaptureFrames(filename, 1)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
GX2DebugCaptureFrame(const char* filename);
|
GX2DebugCaptureFrame(const char *filename);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -152,7 +152,7 @@ GX2DebugCaptureFrame(const char* filename);
|
||||||
* Capture begins and ends during GX2SwapScanBuffers.
|
* Capture begins and ends during GX2SwapScanBuffers.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
GX2DebugCaptureFrames(const char* filename,
|
GX2DebugCaptureFrames(const char *filename,
|
||||||
uint32_t count);
|
uint32_t count);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
34
include/gx2/semaphore.h
Normal file
34
include/gx2/semaphore.h
Normal 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
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string.h>
|
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
|
#include <string.h>
|
||||||
#include "enum.h"
|
#include "enum.h"
|
||||||
#include "sampler.h"
|
|
||||||
#include "gx2r/buffer.h"
|
#include "gx2r/buffer.h"
|
||||||
|
#include "sampler.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup gx2_shader Shaders
|
* \defgroup gx2_shader Shaders
|
||||||
|
|
@ -427,9 +427,12 @@ GX2SetGeometryUniformBlock(uint32_t location,
|
||||||
|
|
||||||
void
|
void
|
||||||
GX2SetShaderModeEx(GX2ShaderMode mode,
|
GX2SetShaderModeEx(GX2ShaderMode mode,
|
||||||
uint32_t numVsGpr, uint32_t numVsStackEntries,
|
uint32_t numVsGpr,
|
||||||
uint32_t numGsGpr, uint32_t numGsStackEntries,
|
uint32_t numVsStackEntries,
|
||||||
uint32_t numPsGpr, uint32_t numPsStackEntries);
|
uint32_t numGsGpr,
|
||||||
|
uint32_t numGsStackEntries,
|
||||||
|
uint32_t numPsGpr,
|
||||||
|
uint32_t numPsStackEntries);
|
||||||
|
|
||||||
void
|
void
|
||||||
GX2SetStreamOutEnable(BOOL enable);
|
GX2SetStreamOutEnable(BOOL enable);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <gx2r/resource.h>
|
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
|
#include <gx2r/resource.h>
|
||||||
#include "enum.h"
|
#include "enum.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -28,7 +28,8 @@ struct GX2Surface
|
||||||
uint32_t mipLevels;
|
uint32_t mipLevels;
|
||||||
GX2SurfaceFormat format;
|
GX2SurfaceFormat format;
|
||||||
GX2AAMode aa;
|
GX2AAMode aa;
|
||||||
union {
|
union
|
||||||
|
{
|
||||||
GX2SurfaceUse use;
|
GX2SurfaceUse use;
|
||||||
GX2RResourceFlags resourceFlags;
|
GX2RResourceFlags resourceFlags;
|
||||||
};
|
};
|
||||||
|
|
@ -185,8 +186,8 @@ GX2CopySurfaceEx(const GX2Surface *src,
|
||||||
GX2Point *dstPoints);
|
GX2Point *dstPoints);
|
||||||
|
|
||||||
void
|
void
|
||||||
GX2ResolveAAColorBuffer(const GX2ColorBuffer * srcColorBuffer,
|
GX2ResolveAAColorBuffer(const GX2ColorBuffer *srcColorBuffer,
|
||||||
GX2Surface * dstSurface,
|
GX2Surface *dstSurface,
|
||||||
uint32_t dstMip,
|
uint32_t dstMip,
|
||||||
uint32_t dstSlice);
|
uint32_t dstSlice);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,19 +13,19 @@ extern "C" {
|
||||||
|
|
||||||
typedef enum GX2_SQ_SEL
|
typedef enum GX2_SQ_SEL
|
||||||
{
|
{
|
||||||
GX2_SQ_SEL_X = 0,
|
GX2_SQ_SEL_X = 0,
|
||||||
GX2_SQ_SEL_Y = 1,
|
GX2_SQ_SEL_Y = 1,
|
||||||
GX2_SQ_SEL_Z = 2,
|
GX2_SQ_SEL_Z = 2,
|
||||||
GX2_SQ_SEL_W = 3,
|
GX2_SQ_SEL_W = 3,
|
||||||
|
|
||||||
GX2_SQ_SEL_R = 0,
|
GX2_SQ_SEL_R = 0,
|
||||||
GX2_SQ_SEL_G = 1,
|
GX2_SQ_SEL_G = 1,
|
||||||
GX2_SQ_SEL_B = 2,
|
GX2_SQ_SEL_B = 2,
|
||||||
GX2_SQ_SEL_A = 3,
|
GX2_SQ_SEL_A = 3,
|
||||||
|
|
||||||
GX2_SQ_SEL_0 = 4,
|
GX2_SQ_SEL_0 = 4,
|
||||||
GX2_SQ_SEL_1 = 5,
|
GX2_SQ_SEL_1 = 5,
|
||||||
GX2_SQ_SEL_MASK = 7,
|
GX2_SQ_SEL_MASK = 7,
|
||||||
} GX2_SQ_SEL;
|
} GX2_SQ_SEL;
|
||||||
|
|
||||||
#define GX2_SEL_MASK(x, y, z, w) (((x) << 24) | ((y) << 16) | ((z) << 8) | (w))
|
#define GX2_SEL_MASK(x, y, z, w) (((x) << 24) | ((y) << 16) | ((z) << 8) | (w))
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef void * (*GX2RAllocFunction)(GX2RResourceFlags, uint32_t, uint32_t);
|
typedef void *(*GX2RAllocFunction)(GX2RResourceFlags, uint32_t, uint32_t);
|
||||||
typedef void (*GX2RFreeFunction)(GX2RResourceFlags, void *);
|
typedef void (*GX2RFreeFunction)(GX2RResourceFlags, void *);
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -14,79 +14,79 @@ extern "C" {
|
||||||
typedef enum GX2RResourceFlags
|
typedef enum GX2RResourceFlags
|
||||||
{
|
{
|
||||||
//! No resource flags specified
|
//! No resource flags specified
|
||||||
GX2R_RESOURCE_BIND_NONE = 0,
|
GX2R_RESOURCE_BIND_NONE = 0,
|
||||||
|
|
||||||
//! This resource is to be used as a texture
|
//! This resource is to be used as a texture
|
||||||
GX2R_RESOURCE_BIND_TEXTURE = 1 << 0,
|
GX2R_RESOURCE_BIND_TEXTURE = 1 << 0,
|
||||||
|
|
||||||
//! This resource is to be used as a colour buffer
|
//! This resource is to be used as a colour buffer
|
||||||
GX2R_RESOURCE_BIND_COLOR_BUFFER = 1 << 1,
|
GX2R_RESOURCE_BIND_COLOR_BUFFER = 1 << 1,
|
||||||
|
|
||||||
//! This resource is to be used as a depth buffer
|
//! This resource is to be used as a depth buffer
|
||||||
GX2R_RESOURCE_BIND_DEPTH_BUFFER = 1 << 2,
|
GX2R_RESOURCE_BIND_DEPTH_BUFFER = 1 << 2,
|
||||||
|
|
||||||
//! This resource is to be used as a scan buffer
|
//! This resource is to be used as a scan buffer
|
||||||
GX2R_RESOURCE_BIND_SCAN_BUFFER = 1 << 3,
|
GX2R_RESOURCE_BIND_SCAN_BUFFER = 1 << 3,
|
||||||
|
|
||||||
//! This resource is to be used as a vertex buffer
|
//! This resource is to be used as a vertex buffer
|
||||||
GX2R_RESOURCE_BIND_VERTEX_BUFFER = 1 << 4,
|
GX2R_RESOURCE_BIND_VERTEX_BUFFER = 1 << 4,
|
||||||
|
|
||||||
//! This resource is to be used as a index buffer
|
//! This resource is to be used as a index buffer
|
||||||
GX2R_RESOURCE_BIND_INDEX_BUFFER = 1 << 5,
|
GX2R_RESOURCE_BIND_INDEX_BUFFER = 1 << 5,
|
||||||
|
|
||||||
//! This resource is to be used as a uniform block
|
//! This resource is to be used as a uniform block
|
||||||
GX2R_RESOURCE_BIND_UNIFORM_BLOCK = 1 << 6,
|
GX2R_RESOURCE_BIND_UNIFORM_BLOCK = 1 << 6,
|
||||||
|
|
||||||
//! This resource is to be used as a shader program
|
//! This resource is to be used as a shader program
|
||||||
GX2R_RESOURCE_BIND_SHADER_PROGRAM = 1 << 7,
|
GX2R_RESOURCE_BIND_SHADER_PROGRAM = 1 << 7,
|
||||||
|
|
||||||
//! This resource is to be used as a stream output
|
//! This resource is to be used as a stream output
|
||||||
GX2R_RESOURCE_BIND_STREAM_OUTPUT = 1 << 8,
|
GX2R_RESOURCE_BIND_STREAM_OUTPUT = 1 << 8,
|
||||||
|
|
||||||
//! This resource is to be used as a display list
|
//! This resource is to be used as a display list
|
||||||
GX2R_RESOURCE_BIND_DISPLAY_LIST = 1 << 9,
|
GX2R_RESOURCE_BIND_DISPLAY_LIST = 1 << 9,
|
||||||
|
|
||||||
//! This resource is to be used as a geometry shader ring buffer
|
//! This resource is to be used as a geometry shader ring buffer
|
||||||
GX2R_RESOURCE_BIND_GS_RING_BUFFER = 1 << 10,
|
GX2R_RESOURCE_BIND_GS_RING_BUFFER = 1 << 10,
|
||||||
|
|
||||||
//! Invalidate resource for a CPU read
|
//! Invalidate resource for a CPU read
|
||||||
GX2R_RESOURCE_USAGE_CPU_READ = 1 << 11,
|
GX2R_RESOURCE_USAGE_CPU_READ = 1 << 11,
|
||||||
|
|
||||||
//! Invalidate resource for a CPU write
|
//! Invalidate resource for a CPU write
|
||||||
GX2R_RESOURCE_USAGE_CPU_WRITE = 1 << 12,
|
GX2R_RESOURCE_USAGE_CPU_WRITE = 1 << 12,
|
||||||
|
|
||||||
//! Invalidate resource for a GPU read
|
//! Invalidate resource for a GPU read
|
||||||
GX2R_RESOURCE_USAGE_GPU_READ = 1 << 13,
|
GX2R_RESOURCE_USAGE_GPU_READ = 1 << 13,
|
||||||
|
|
||||||
//! Invalidate resource for a GPU write
|
//! Invalidate resource for a GPU write
|
||||||
GX2R_RESOURCE_USAGE_GPU_WRITE = 1 << 14,
|
GX2R_RESOURCE_USAGE_GPU_WRITE = 1 << 14,
|
||||||
|
|
||||||
//! Invalidate resource for a DMA read
|
//! Invalidate resource for a DMA read
|
||||||
GX2R_RESOURCE_USAGE_DMA_READ = 1 << 15,
|
GX2R_RESOURCE_USAGE_DMA_READ = 1 << 15,
|
||||||
|
|
||||||
//! Invalidate resource for a DMA write
|
//! Invalidate resource for a DMA write
|
||||||
GX2R_RESOURCE_USAGE_DMA_WRITE = 1 << 16,
|
GX2R_RESOURCE_USAGE_DMA_WRITE = 1 << 16,
|
||||||
|
|
||||||
//! Force resource allocation to be in MEM1
|
//! Force resource allocation to be in MEM1
|
||||||
GX2R_RESOURCE_USAGE_FORCE_MEM1 = 1 << 17,
|
GX2R_RESOURCE_USAGE_FORCE_MEM1 = 1 << 17,
|
||||||
|
|
||||||
//! Force resource allocation to be in MEM2
|
//! Force resource allocation to be in MEM2
|
||||||
GX2R_RESOURCE_USAGE_FORCE_MEM2 = 1 << 18,
|
GX2R_RESOURCE_USAGE_FORCE_MEM2 = 1 << 18,
|
||||||
|
|
||||||
//! Disable CPU invalidation
|
//! Disable CPU invalidation
|
||||||
GX2R_RESOURCE_DISABLE_CPU_INVALIDATE = 1 << 20,
|
GX2R_RESOURCE_DISABLE_CPU_INVALIDATE = 1 << 20,
|
||||||
|
|
||||||
//! Disable GPU invalidation
|
//! Disable GPU invalidation
|
||||||
GX2R_RESOURCE_DISABLE_GPU_INVALIDATE = 1 << 21,
|
GX2R_RESOURCE_DISABLE_GPU_INVALIDATE = 1 << 21,
|
||||||
|
|
||||||
//! Resource is locked for read-only access
|
//! Resource is locked for read-only access
|
||||||
GX2R_RESOURCE_LOCKED_READ_ONLY = 1 << 22,
|
GX2R_RESOURCE_LOCKED_READ_ONLY = 1 << 22,
|
||||||
|
|
||||||
//! Resource was allocated by GX2R.
|
//! Resource was allocated by GX2R.
|
||||||
GX2R_RESOURCE_GX2R_ALLOCATED = 1 << 29,
|
GX2R_RESOURCE_GX2R_ALLOCATED = 1 << 29,
|
||||||
|
|
||||||
//! Resource is locked for all access
|
//! Resource is locked for all access
|
||||||
GX2R_RESOURCE_LOCKED = 1 << 30,
|
GX2R_RESOURCE_LOCKED = 1 << 30,
|
||||||
} GX2RResourceFlags;
|
} GX2RResourceFlags;
|
||||||
|
|
||||||
WUT_ENUM_BITMASK_TYPE(GX2RResourceFlags)
|
WUT_ENUM_BITMASK_TYPE(GX2RResourceFlags)
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ H264DECSetParam_OUTPUT_PER_FRAME(void *memory,
|
||||||
*/
|
*/
|
||||||
H264Error
|
H264Error
|
||||||
H264DECSetParam_USER_MEMORY(void *memory,
|
H264DECSetParam_USER_MEMORY(void *memory,
|
||||||
void *value);
|
void **value);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <wut.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup h264_stream H264 Stream
|
* \defgroup h264_stream H264 Stream
|
||||||
|
|
@ -20,30 +21,30 @@ typedef void (*H264DECFptrOutputFn)(H264DecodeOutput *output);
|
||||||
typedef enum H264Error
|
typedef enum H264Error
|
||||||
{
|
{
|
||||||
//! No errors.
|
//! No errors.
|
||||||
H264_ERROR_OK = 0,
|
H264_ERROR_OK = 0,
|
||||||
|
|
||||||
//! Invalid picture parameter set.
|
//! Invalid picture parameter set.
|
||||||
H264_ERROR_INVALID_PPS = 24,
|
H264_ERROR_INVALID_PPS = 24,
|
||||||
|
|
||||||
//! Invalid sequence parameter set.
|
//! Invalid sequence parameter set.
|
||||||
H264_ERROR_INVALID_SPS = 26,
|
H264_ERROR_INVALID_SPS = 26,
|
||||||
|
|
||||||
//! Invalid slice header.
|
//! Invalid slice header.
|
||||||
H264_ERROR_INVALID_SLICEHEADER = 61,
|
H264_ERROR_INVALID_SLICEHEADER = 61,
|
||||||
|
|
||||||
//! Generic h264 error.
|
//! Generic h264 error.
|
||||||
H264_ERROR_GENERIC = 0x1000000,
|
H264_ERROR_GENERIC = 0x1000000,
|
||||||
|
|
||||||
//! Invalid parameters passed.
|
//! Invalid parameters passed.
|
||||||
H264_ERROR_INVALID_PARAMETER = 0x1010000,
|
H264_ERROR_INVALID_PARAMETER = 0x1010000,
|
||||||
|
|
||||||
//! The amount of memory provided to the h264 library
|
//! The amount of memory provided to the h264 library
|
||||||
//! is insufficient.
|
//! is insufficient.
|
||||||
H264_ERROR_OUT_OF_MEMORY = 0x1020000,
|
H264_ERROR_OUT_OF_MEMORY = 0x1020000,
|
||||||
|
|
||||||
//! Invalid h264 stream profile. Only the baseline (66),
|
//! Invalid h264 stream profile. Only the baseline (66),
|
||||||
//! main (77) and high (100) profiles are allowed.
|
//! main (77) and high (100) profiles are allowed.
|
||||||
H264_ERROR_INVALID_PROFILE = 0x1080000,
|
H264_ERROR_INVALID_PROFILE = 0x1080000,
|
||||||
} H264Error;
|
} H264Error;
|
||||||
|
|
||||||
struct WUT_PACKED H264DecodedVuiParameters
|
struct WUT_PACKED H264DecodedVuiParameters
|
||||||
|
|
@ -167,10 +168,10 @@ struct WUT_PACKED H264DecodeOutput
|
||||||
{
|
{
|
||||||
//! Number of frames output
|
//! Number of frames output
|
||||||
int32_t frameCount;
|
int32_t frameCount;
|
||||||
|
|
||||||
//! Frames
|
//! Frames
|
||||||
H264DecodeResult **decodeResults;
|
H264DecodeResult **decodeResults;
|
||||||
|
|
||||||
//! User memory pointer passed into SetParam
|
//! User memory pointer passed into SetParam
|
||||||
void *userMemory;
|
void *userMemory;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,12 @@ typedef struct MICStatus MICStatus;
|
||||||
|
|
||||||
typedef enum MICError
|
typedef enum MICError
|
||||||
{
|
{
|
||||||
MIC_ERROR_OK = 0,
|
MIC_ERROR_OK = 0,
|
||||||
MIC_ERROR_NOT_OPENED = -1,
|
MIC_ERROR_NOT_OPENED = -1,
|
||||||
MIC_ERROR_INVALID_HANDLE = -2,
|
MIC_ERROR_INVALID_HANDLE = -2,
|
||||||
MIC_ERROR_INIT = -5,
|
MIC_ERROR_INIT = -5,
|
||||||
MIC_ERROR_ALREADY_CLOSED = -7,
|
MIC_ERROR_ALREADY_CLOSED = -7,
|
||||||
MIC_ERROR_INVALID_INSTANCE = -8,
|
MIC_ERROR_INVALID_INSTANCE = -8,
|
||||||
} MICError;
|
} MICError;
|
||||||
|
|
||||||
typedef enum MICInstance
|
typedef enum MICInstance
|
||||||
|
|
@ -46,7 +46,7 @@ WUT_CHECK_SIZE(MICWorkMemory, 0x08);
|
||||||
|
|
||||||
struct MICStatus
|
struct MICStatus
|
||||||
{
|
{
|
||||||
int state; // 1 << 1 = Open
|
int state; // 1 << 1 = Open
|
||||||
int availableData;
|
int availableData;
|
||||||
int bufferPos;
|
int bufferPos;
|
||||||
};
|
};
|
||||||
|
|
@ -59,23 +59,31 @@ WUT_CHECK_SIZE(MICStatus, 0x0C);
|
||||||
* The second parameter to MICInit is unused, any value is valid.
|
* The second parameter to MICInit is unused, any value is valid.
|
||||||
*/
|
*/
|
||||||
MICHandle
|
MICHandle
|
||||||
MICInit(MICInstance instance, int unused, MICWorkMemory *workMemory,
|
MICInit(MICInstance instance,
|
||||||
|
int unused,
|
||||||
|
MICWorkMemory *workMemory,
|
||||||
MICError *outError);
|
MICError *outError);
|
||||||
|
|
||||||
MICError
|
MICError
|
||||||
MICOpen(MICHandle handle);
|
MICOpen(MICHandle handle);
|
||||||
|
|
||||||
MICError
|
MICError
|
||||||
MICGetState(MICHandle handle, int state, uint32_t *outStateVal);
|
MICGetState(MICHandle handle,
|
||||||
|
int state,
|
||||||
|
uint32_t *outStateVal);
|
||||||
|
|
||||||
MICError
|
MICError
|
||||||
MICSetState(MICHandle handle, int state, uint32_t stateVal);
|
MICSetState(MICHandle handle,
|
||||||
|
int state,
|
||||||
|
uint32_t stateVal);
|
||||||
|
|
||||||
MICError
|
MICError
|
||||||
MICGetStatus(MICHandle handle, MICStatus *outStatus);
|
MICGetStatus(MICHandle handle,
|
||||||
|
MICStatus *outStatus);
|
||||||
|
|
||||||
MICError
|
MICError
|
||||||
MICSetDataConsumed(MICHandle handle, int dataAmountConsumed);
|
MICSetDataConsumed(MICHandle handle,
|
||||||
|
int dataAmountConsumed);
|
||||||
|
|
||||||
MICError
|
MICError
|
||||||
MICClose(MICHandle handle);
|
MICClose(MICHandle handle);
|
||||||
|
|
|
||||||
|
|
@ -6,30 +6,30 @@ extern int h_errno;
|
||||||
|
|
||||||
struct hostent
|
struct hostent
|
||||||
{
|
{
|
||||||
char *h_name;
|
char *h_name;
|
||||||
char **h_aliases;
|
char **h_aliases;
|
||||||
int h_addrtype;
|
int h_addrtype;
|
||||||
int h_length;
|
int h_length;
|
||||||
char **h_addr_list;
|
char **h_addr_list;
|
||||||
#define h_addr h_addr_list[0]
|
#define h_addr h_addr_list[0]
|
||||||
};
|
};
|
||||||
|
|
||||||
struct servent
|
struct servent
|
||||||
{
|
{
|
||||||
char *s_name;
|
char *s_name;
|
||||||
char **s_aliases;
|
char **s_aliases;
|
||||||
int s_port;
|
int s_port;
|
||||||
char *s_proto;
|
char *s_proto;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct addrinfo
|
struct addrinfo
|
||||||
{
|
{
|
||||||
int ai_flags;
|
int ai_flags;
|
||||||
int ai_family;
|
int ai_family;
|
||||||
int ai_socktype;
|
int ai_socktype;
|
||||||
int ai_protocol;
|
int ai_protocol;
|
||||||
socklen_t ai_addrlen;
|
socklen_t ai_addrlen;
|
||||||
char *ai_canonname;
|
char *ai_canonname;
|
||||||
struct sockaddr *ai_addr;
|
struct sockaddr *ai_addr;
|
||||||
struct addrinfo *ai_next;
|
struct addrinfo *ai_next;
|
||||||
};
|
};
|
||||||
|
|
@ -86,7 +86,7 @@ gethostbyname(const char *name);
|
||||||
|
|
||||||
struct hostent *
|
struct hostent *
|
||||||
gethostbyaddr(const void *addr,
|
gethostbyaddr(const void *addr,
|
||||||
socklen_t len,
|
socklen_t len,
|
||||||
int type);
|
int type);
|
||||||
|
|
||||||
struct hostent *
|
struct hostent *
|
||||||
|
|
|
||||||
|
|
@ -27,15 +27,15 @@ typedef uint32_t in_addr_t;
|
||||||
|
|
||||||
struct in_addr
|
struct in_addr
|
||||||
{
|
{
|
||||||
in_addr_t s_addr;
|
in_addr_t s_addr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sockaddr_in
|
struct sockaddr_in
|
||||||
{
|
{
|
||||||
sa_family_t sin_family;
|
sa_family_t sin_family;
|
||||||
in_port_t sin_port;
|
in_port_t sin_port;
|
||||||
struct in_addr sin_addr;
|
struct in_addr sin_addr;
|
||||||
unsigned char sin_zero[8];
|
unsigned char sin_zero[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ip_mreq
|
struct ip_mreq
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define SOL_TCP 6
|
#define SOL_TCP 6
|
||||||
|
|
||||||
#define TCP_ACKDELAYTIME 0x2001
|
#define TCP_ACKDELAYTIME 0x2001
|
||||||
#define TCP_NOACKDELAY 0x2002
|
#define TCP_NOACKDELAY 0x2002
|
||||||
#define TCP_MAXSEG 0x2003
|
#define TCP_MAXSEG 0x2003
|
||||||
#define TCP_NODELAY 0x2004
|
#define TCP_NODELAY 0x2004
|
||||||
#define TCP_UNKNOWN 0x2005 // amount of mss received before sending an ack
|
#define TCP_UNKNOWN 0x2005 // amount of mss received before sending an ack
|
||||||
|
|
|
||||||
|
|
@ -25,29 +25,29 @@ typedef struct NFCReadT2TResult NFCReadT2TResult;
|
||||||
|
|
||||||
typedef enum NFCMode
|
typedef enum NFCMode
|
||||||
{
|
{
|
||||||
NFC_MODE_INVALID = -1,
|
NFC_MODE_INVALID = -1,
|
||||||
//! NFC is idle
|
//! NFC is idle
|
||||||
NFC_MODE_IDLE = 0,
|
NFC_MODE_IDLE = 0,
|
||||||
//! NFC is discovering / has an active tag
|
//! NFC is discovering / has an active tag
|
||||||
NFC_MODE_ACTIVE = 1,
|
NFC_MODE_ACTIVE = 1,
|
||||||
} NFCMode;
|
} NFCMode;
|
||||||
|
|
||||||
typedef enum NFCProtocolEnum
|
typedef enum NFCProtocolEnum
|
||||||
{
|
{
|
||||||
NFC_PROTOCOL_UNKNOWN = 0x00,
|
NFC_PROTOCOL_UNKNOWN = 0x00,
|
||||||
NFC_PROTOCOL_T1T = 0x01,
|
NFC_PROTOCOL_T1T = 0x01,
|
||||||
NFC_PROTOCOL_T2T = 0x02,
|
NFC_PROTOCOL_T2T = 0x02,
|
||||||
NFC_PROTOCOL_T3T = 0x03,
|
NFC_PROTOCOL_T3T = 0x03,
|
||||||
NFC_PROTOCOL_ISO_DEP = 0x04,
|
NFC_PROTOCOL_ISO_DEP = 0x04,
|
||||||
NFC_PROTOCOL_15693 = 0x83,
|
NFC_PROTOCOL_15693 = 0x83,
|
||||||
} NFCProtocolEnum;
|
} NFCProtocolEnum;
|
||||||
|
|
||||||
typedef enum NFCTechnologyEnum
|
typedef enum NFCTechnologyEnum
|
||||||
{
|
{
|
||||||
NFC_TECHNOLOGY_A = 0x00,
|
NFC_TECHNOLOGY_A = 0x00,
|
||||||
NFC_TECHNOLOGY_B = 0x01,
|
NFC_TECHNOLOGY_B = 0x01,
|
||||||
NFC_TECHNOLOGY_F = 0x02,
|
NFC_TECHNOLOGY_F = 0x02,
|
||||||
NFC_TECHNOLOGY_ISO15693 = 0x06,
|
NFC_TECHNOLOGY_ISO15693 = 0x06,
|
||||||
} NFCTechnologyEnum;
|
} NFCTechnologyEnum;
|
||||||
|
|
||||||
typedef enum NFCTechnologyMaskEnum
|
typedef enum NFCTechnologyMaskEnum
|
||||||
|
|
@ -161,10 +161,9 @@ WUT_CHECK_SIZE(NFCReadT2TResult, 0x3A9);
|
||||||
* \param userContext
|
* \param userContext
|
||||||
* User provided value.
|
* User provided value.
|
||||||
*/
|
*/
|
||||||
typedef void
|
typedef void (*NFCCallbackFn)(VPADChan chan,
|
||||||
(*NFCCallbackFn)(VPADChan chan,
|
NFCError error,
|
||||||
NFCError error,
|
void *userContext);
|
||||||
void *userContext);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function for \link NFCSetTagDetectCallback \endlink.
|
* Callback function for \link NFCSetTagDetectCallback \endlink.
|
||||||
|
|
@ -178,10 +177,9 @@ typedef void
|
||||||
* \param userContext
|
* \param userContext
|
||||||
* User provided value.
|
* User provided value.
|
||||||
*/
|
*/
|
||||||
typedef void
|
typedef void (*NFCTagDetectCallbackFn)(VPADChan chan,
|
||||||
(*NFCTagDetectCallbackFn)(VPADChan chan,
|
BOOL hasTag,
|
||||||
BOOL hasTag,
|
void *userContext);
|
||||||
void *userContext);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function for \link NFCDetect \endlink.
|
* Callback function for \link NFCDetect \endlink.
|
||||||
|
|
@ -207,14 +205,13 @@ typedef void
|
||||||
* \param userContext
|
* \param userContext
|
||||||
* User provided value.
|
* User provided value.
|
||||||
*/
|
*/
|
||||||
typedef void
|
typedef void (*NFCDetectCallbackFn)(VPADChan chan,
|
||||||
(*NFCDetectCallbackFn)(VPADChan chan,
|
NFCError error,
|
||||||
NFCError error,
|
NFCUid *uid,
|
||||||
NFCUid *uid,
|
BOOL readOnly,
|
||||||
BOOL readOnly,
|
BOOL hasLockedData,
|
||||||
BOOL hasLockedData,
|
NFCNDEFFlags flags,
|
||||||
NFCNDEFFlags flags,
|
void *userContext);
|
||||||
void *userContext);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function for \link NFCSendRawData \endlink and variations.
|
* Callback function for \link NFCSendRawData \endlink and variations.
|
||||||
|
|
@ -234,12 +231,11 @@ typedef void
|
||||||
* \param userContext
|
* \param userContext
|
||||||
* User provided value.
|
* User provided value.
|
||||||
*/
|
*/
|
||||||
typedef void
|
typedef void (*NFCRawDataCallbackFn)(VPADChan chan,
|
||||||
(*NFCRawDataCallbackFn)(VPADChan chan,
|
NFCError error,
|
||||||
NFCError error,
|
uint32_t responseSize,
|
||||||
uint32_t responseSize,
|
void *responseData,
|
||||||
void *responseData,
|
void *userContext);
|
||||||
void *userContext);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function for \link NFCSendRawDataTwice \endlink and variations.
|
* Callback function for \link NFCSendRawDataTwice \endlink and variations.
|
||||||
|
|
@ -262,15 +258,14 @@ typedef void
|
||||||
* \param userContext
|
* \param userContext
|
||||||
* User provided value.
|
* User provided value.
|
||||||
*/
|
*/
|
||||||
typedef void
|
typedef void (*NFCRawDataTwiceCallbackFn)(VPADChan chan,
|
||||||
(*NFCRawDataTwiceCallbackFn)(VPADChan chan,
|
NFCError error,
|
||||||
NFCError error,
|
uint8_t numCompleted,
|
||||||
uint8_t numCompleted,
|
uint32_t response0Size,
|
||||||
uint32_t response0Size,
|
void *response0Data,
|
||||||
void *response0Data,
|
uint32_t response1Size,
|
||||||
uint32_t response1Size,
|
void *response1Data,
|
||||||
void *response1Data,
|
void *userContext);
|
||||||
void *userContext);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function for \link NFCRead \endlink.
|
* Callback function for \link NFCRead \endlink.
|
||||||
|
|
@ -302,16 +297,15 @@ typedef void
|
||||||
* \param userContext
|
* \param userContext
|
||||||
* User provided value.
|
* User provided value.
|
||||||
*/
|
*/
|
||||||
typedef void
|
typedef void (*NFCReadCallbackFn)(VPADChan chan,
|
||||||
(*NFCReadCallbackFn)(VPADChan chan,
|
NFCError error,
|
||||||
NFCError error,
|
NFCUid *uid,
|
||||||
NFCUid *uid,
|
BOOL readOnly,
|
||||||
BOOL readOnly,
|
uint32_t dataSize,
|
||||||
uint32_t dataSize,
|
void *data,
|
||||||
void *data,
|
uint32_t lockedDataSize,
|
||||||
uint32_t lockedDataSize,
|
void *lockedData,
|
||||||
void *lockedData,
|
void *userContext);
|
||||||
void *userContext);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function for \link NFCReadT2T \endlink.
|
* Callback function for \link NFCReadT2T \endlink.
|
||||||
|
|
@ -346,17 +340,16 @@ typedef void
|
||||||
* \param userContext
|
* \param userContext
|
||||||
* User provided value.
|
* User provided value.
|
||||||
*/
|
*/
|
||||||
typedef void
|
typedef void (*NFCReadT2TCallbackFn)(VPADChan chan,
|
||||||
(*NFCReadT2TCallbackFn)(VPADChan chan,
|
NFCError error,
|
||||||
NFCError error,
|
uint8_t rfDiscId,
|
||||||
uint8_t rfDiscId,
|
NFCProtocol protocol,
|
||||||
NFCProtocol protocol,
|
NFCTechnology technology,
|
||||||
NFCTechnology technology,
|
uint8_t uidSize,
|
||||||
uint8_t uidSize,
|
uint8_t *uid,
|
||||||
uint8_t *uid,
|
NFCNTAGVersion *version,
|
||||||
NFCNTAGVersion *version,
|
NFCReadT2TResult *result,
|
||||||
NFCReadT2TResult *result,
|
void *userContext);
|
||||||
void *userContext);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function for \link NFCGetTagInfo \endlink.
|
* Callback function for \link NFCGetTagInfo \endlink.
|
||||||
|
|
@ -373,11 +366,10 @@ typedef void
|
||||||
* \param userContext
|
* \param userContext
|
||||||
* User provided value.
|
* User provided value.
|
||||||
*/
|
*/
|
||||||
typedef void
|
typedef void (*NFCGetTagInfoCallbackFn)(VPADChan chan,
|
||||||
(*NFCGetTagInfoCallbackFn)(VPADChan chan,
|
NFCError error,
|
||||||
NFCError error,
|
NFCTagInfo *tagInfo,
|
||||||
NFCTagInfo *tagInfo,
|
void *userContext);
|
||||||
void *userContext);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function for \link NFCGetTagInfoMulti \endlink.
|
* Callback function for \link NFCGetTagInfoMulti \endlink.
|
||||||
|
|
@ -397,14 +389,13 @@ typedef void
|
||||||
* \param userContext
|
* \param userContext
|
||||||
* User provided value.
|
* User provided value.
|
||||||
*/
|
*/
|
||||||
typedef void
|
typedef void (*NFCGetTagInfoMultiCallbackFn)(VPADChan chan,
|
||||||
(*NFCGetTagInfoMultiCallbackFn)(VPADChan chan,
|
NFCError error,
|
||||||
NFCError error,
|
uint8_t numTagInfos,
|
||||||
uint8_t numTagInfos,
|
NFCTagInfo *tagInfo0,
|
||||||
NFCTagInfo *tagInfo0,
|
NFCTagInfo *tagInfo1,
|
||||||
NFCTagInfo *tagInfo1,
|
NFCTagInfo *tagInfo2,
|
||||||
NFCTagInfo *tagInfo2,
|
void *userContext);
|
||||||
void *userContext);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the NFC library.
|
* Initializes the NFC library.
|
||||||
|
|
@ -1155,6 +1146,7 @@ NFCSetReadOnly(VPADChan chan,
|
||||||
* \return
|
* \return
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
|
// clang-format off
|
||||||
NFCError
|
NFCError
|
||||||
NFCReadT2T(VPADChan chan,
|
NFCReadT2T(VPADChan chan,
|
||||||
uint32_t discoveryTimeout,
|
uint32_t discoveryTimeout,
|
||||||
|
|
@ -1170,6 +1162,7 @@ NFCReadT2T(VPADChan chan,
|
||||||
uint8_t authenticate,
|
uint8_t authenticate,
|
||||||
NFCReadT2TCallbackFn callback,
|
NFCReadT2TCallbackFn callback,
|
||||||
void *userContext);
|
void *userContext);
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write data to a Type 2 NTAG.
|
* Write data to a Type 2 NTAG.
|
||||||
|
|
@ -1231,6 +1224,7 @@ NFCReadT2T(VPADChan chan,
|
||||||
* \return
|
* \return
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
|
// clang-format off
|
||||||
NFCError
|
NFCError
|
||||||
NFCWriteT2T(VPADChan chan,
|
NFCWriteT2T(VPADChan chan,
|
||||||
uint16_t discoveryTimeout,
|
uint16_t discoveryTimeout,
|
||||||
|
|
@ -1247,6 +1241,7 @@ NFCWriteT2T(VPADChan chan,
|
||||||
uint8_t authenticate, uint8_t activate,
|
uint8_t authenticate, uint8_t activate,
|
||||||
NFCCallbackFn callback,
|
NFCCallbackFn callback,
|
||||||
void *userContext);
|
void *userContext);
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the UID and other parameters from activation event data.
|
* Get the UID and other parameters from activation event data.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include <nn/result.h>
|
#include <nn/result.h>
|
||||||
|
#include <nsysnet/netconfig.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup nn_ac_cpp Auto Connect C++ API
|
* \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
|
* An ID number representing a network configuration. These are the same IDs as
|
||||||
* shown in System Settings' Connection List.
|
* 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.
|
* The configuration for a given network profile (from 1 to 6).
|
||||||
* Cafe provides mangled symbols for C++ APIs, so nn::ac is actually static
|
* \sa NetConfCfg
|
||||||
* inline calls to the mangled symbols under nn::ac::detail.
|
|
||||||
*/
|
*/
|
||||||
namespace detail
|
using Config = NetConfCfg;
|
||||||
|
|
||||||
|
using ErrorCode = uint32_t;
|
||||||
|
|
||||||
|
enum Status
|
||||||
{
|
{
|
||||||
extern "C"
|
STATUS_FAILED = -1,
|
||||||
{
|
STATUS_OK = 0,
|
||||||
|
STATUS_PROCESSING = 1,
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
nn::Result
|
||||||
* Gets the default connection configuration id. This is the default as marked
|
BeginLocalConnection(bool unknown)
|
||||||
* in System Settings.
|
asm("BeginLocalConnection__Q2_2nn2acFb");
|
||||||
*
|
|
||||||
* \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);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline nn::Result
|
void
|
||||||
Connect()
|
ClearConfig(Config *cfg)
|
||||||
{
|
asm("ClearConfig__Q2_2nn2acFP16netconf_profile_");
|
||||||
return detail::Connect__Q2_2nn2acFv();
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline nn::Result
|
nn::Result
|
||||||
ConnectAsync()
|
|
||||||
{
|
|
||||||
return detail::ConnectAsync__Q2_2nn2acFv();
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline nn::Result
|
|
||||||
Close()
|
Close()
|
||||||
{
|
asm("Close__Q2_2nn2acFv");
|
||||||
return detail::Close__Q2_2nn2acFv();
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline nn::Result
|
nn::Result
|
||||||
GetCloseStatus()
|
CloseAll()
|
||||||
{
|
asm("CloseAll__Q2_2nn2acFv");
|
||||||
return detail::GetCloseStatus__Q2_2nn2acFPQ3_2nn2ac6Status();
|
|
||||||
}
|
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
|
* 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
|
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
|
||||||
* and \link nn::Result::IsFailure \endlink.
|
* and \link nn::Result::IsFailure \endlink.
|
||||||
*/
|
*/
|
||||||
static inline nn::Result
|
nn::Result
|
||||||
Connect(ConfigIdNum id)
|
ConnectAsync(ConfigIdNum id)
|
||||||
{
|
asm("ConnectAsync__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum");
|
||||||
return detail::Connect__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum(id);
|
|
||||||
}
|
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.
|
* 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
|
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
|
||||||
* and \link nn::Result::IsFailure \endlink.
|
* and \link nn::Result::IsFailure \endlink.
|
||||||
*/
|
*/
|
||||||
static inline nn::Result
|
nn::Result
|
||||||
GetAssignedAddress(uint32_t *ip)
|
GetAssignedAddress(uint32_t *ip)
|
||||||
{
|
asm("GetAssignedAddress__Q2_2nn2acFPUl");
|
||||||
return detail::GetAssignedAddress__Q2_2nn2acFPUl(ip);
|
|
||||||
}
|
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 ac
|
||||||
} // namespace nn
|
} // namespace nn
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
#include <nn/acp/client.h>
|
#include <nn/acp/client.h>
|
||||||
#include <nn/acp/device.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/result.h>
|
||||||
#include <nn/acp/save.h>
|
#include <nn/acp/save.h>
|
||||||
#include <nn/acp/title.h>
|
#include <nn/acp/title.h>
|
||||||
#include <nn/acp/drcled_c.h>
|
|
||||||
#include <nn/acp/drcled_cpp.h>
|
|
||||||
|
|
|
||||||
|
|
@ -12,17 +12,18 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum ACPDeviceType {
|
typedef enum ACPDeviceType
|
||||||
ACP_DEVICE_TYPE_AUTO = 1,
|
{
|
||||||
ACP_DEVICE_TYPE_ODD = 2,
|
ACP_DEVICE_TYPE_AUTO = 1,
|
||||||
ACP_DEVICE_TYPE_HFIODISC = 2, /* when ApplicationDevice is emulated */
|
ACP_DEVICE_TYPE_ODD = 2,
|
||||||
ACP_DEVICE_TYPE_MLC = 3,
|
ACP_DEVICE_TYPE_HFIODISC = 2, /* when ApplicationDevice is emulated */
|
||||||
ACP_DEVICE_TYPE_HFIOMLC = 3, /* when ApplicationDevice is emulated */
|
ACP_DEVICE_TYPE_MLC = 3,
|
||||||
ACP_DEVICE_TYPE_USB = 4,
|
ACP_DEVICE_TYPE_HFIOMLC = 3, /* when ApplicationDevice is emulated */
|
||||||
|
ACP_DEVICE_TYPE_USB = 4,
|
||||||
} ACPDeviceType;
|
} ACPDeviceType;
|
||||||
|
|
||||||
ACPResult
|
ACPResult
|
||||||
ACPCheckApplicationDeviceEmulation(BOOL* emulation);
|
ACPCheckApplicationDeviceEmulation(BOOL *emulation);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include <nn/acp/result.h>
|
|
||||||
#include <nn/acp/device.h>
|
#include <nn/acp/device.h>
|
||||||
|
#include <nn/acp/result.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include <nn/acp/result.h>
|
|
||||||
#include <nn/acp/device.h>
|
#include <nn/acp/device.h>
|
||||||
|
#include <nn/acp/result.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn {
|
namespace nn
|
||||||
|
{
|
||||||
|
|
||||||
namespace acp {
|
namespace acp
|
||||||
|
{
|
||||||
|
|
||||||
typedef uint8_t DrcLedStatus;
|
typedef uint8_t DrcLedStatus;
|
||||||
typedef uint32_t DrcLedPattern;
|
typedef uint32_t DrcLedPattern;
|
||||||
|
|
@ -24,7 +26,7 @@ SetDrcLedDummyPowerStat(uint8_t unk1)
|
||||||
|
|
||||||
void
|
void
|
||||||
SetDrcLedTimerLength(uint64_t unk1,
|
SetDrcLedTimerLength(uint64_t unk1,
|
||||||
uint64_t unk2)
|
uint64_t unk2)
|
||||||
asm("SetDrcLedTimerLength__Q2_2nn3acpFULT1");
|
asm("SetDrcLedTimerLength__Q2_2nn3acpFULT1");
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -41,13 +43,13 @@ TurnOffDrcLedTest(uint8_t unk1)
|
||||||
|
|
||||||
void
|
void
|
||||||
TurnOnDrcLed(uint32_t unk1,
|
TurnOnDrcLed(uint32_t unk1,
|
||||||
DrcLedPattern pattern)
|
DrcLedPattern pattern)
|
||||||
asm("TurnOnDrcLed__Q2_2nn3acpFUiQ3_2nn3acp13DrcLedPattern");
|
asm("TurnOnDrcLed__Q2_2nn3acpFUiQ3_2nn3acp13DrcLedPattern");
|
||||||
|
|
||||||
void
|
void
|
||||||
TurnOnDrcLedTest(uint8_t unk1,
|
TurnOnDrcLedTest(uint8_t unk1,
|
||||||
uint32_t unk2,
|
uint32_t unk2,
|
||||||
DrcLedPattern pattern)
|
DrcLedPattern pattern)
|
||||||
asm("TurnOnDrcLedTest__Q2_2nn3acpFUcUiQ3_2nn3acp13DrcLedPattern");
|
asm("TurnOnDrcLedTest__Q2_2nn3acpFUcUiQ3_2nn3acp13DrcLedPattern");
|
||||||
|
|
||||||
} //namespace acp
|
} //namespace acp
|
||||||
|
|
|
||||||
|
|
@ -8,89 +8,90 @@
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef enum ACPResult {
|
typedef enum ACPResult
|
||||||
ACP_RESULT_SUCCESS = 0,
|
{
|
||||||
|
ACP_RESULT_SUCCESS = 0,
|
||||||
|
|
||||||
ACP_RESULT_INVALID = -200,
|
ACP_RESULT_INVALID = -200,
|
||||||
ACP_RESULT_INVALID_PARAMETER = -201,
|
ACP_RESULT_INVALID_PARAMETER = -201,
|
||||||
ACP_RESULT_INVALID_FILE = -202,
|
ACP_RESULT_INVALID_FILE = -202,
|
||||||
ACP_RESULT_INVALID_XML_FILE = -203,
|
ACP_RESULT_INVALID_XML_FILE = -203,
|
||||||
ACP_RESULT_FILE_ACCESS_MODE = -204,
|
ACP_RESULT_FILE_ACCESS_MODE = -204,
|
||||||
ACP_RESULT_INVALID_NETWORK_TIME = -205,
|
ACP_RESULT_INVALID_NETWORK_TIME = -205,
|
||||||
|
|
||||||
ACP_RESULT_NOT_FOUND = -500,
|
ACP_RESULT_NOT_FOUND = -500,
|
||||||
ACP_RESULT_FILE_NOT_FOUND = -501,
|
ACP_RESULT_FILE_NOT_FOUND = -501,
|
||||||
ACP_RESULT_DIR_NOT_FOUND = -502,
|
ACP_RESULT_DIR_NOT_FOUND = -502,
|
||||||
ACP_RESULT_DEVICE_NOT_FOUND = -503,
|
ACP_RESULT_DEVICE_NOT_FOUND = -503,
|
||||||
ACP_RESULT_TITLE_NOT_FOUND = -504,
|
ACP_RESULT_TITLE_NOT_FOUND = -504,
|
||||||
ACP_RESULT_APPLICATION_NOT_FOUND = -505,
|
ACP_RESULT_APPLICATION_NOT_FOUND = -505,
|
||||||
ACP_RESULT_SYSTEM_CONFIG_NOT_FOUND = -506,
|
ACP_RESULT_SYSTEM_CONFIG_NOT_FOUND = -506,
|
||||||
ACP_RESULT_XML_ITEM_NOT_FOUND = -507,
|
ACP_RESULT_XML_ITEM_NOT_FOUND = -507,
|
||||||
|
|
||||||
ACP_RESULT_ALREADY_EXISTS = -600,
|
ACP_RESULT_ALREADY_EXISTS = -600,
|
||||||
ACP_RESULT_FILE_ALREADY_EXISTS = -601,
|
ACP_RESULT_FILE_ALREADY_EXISTS = -601,
|
||||||
ACP_RESULT_DIR_ALREADY_EXISTS = -602,
|
ACP_RESULT_DIR_ALREADY_EXISTS = -602,
|
||||||
|
|
||||||
ACP_RESULT_ALREADY_DONE = -700,
|
ACP_RESULT_ALREADY_DONE = -700,
|
||||||
|
|
||||||
ACP_RESULT_AUTHENTICATION = -1000,
|
ACP_RESULT_AUTHENTICATION = -1000,
|
||||||
ACP_RESULT_INVALID_REGION = -1001,
|
ACP_RESULT_INVALID_REGION = -1001,
|
||||||
ACP_RESULT_RESTRICTED_RATING = -1002,
|
ACP_RESULT_RESTRICTED_RATING = -1002,
|
||||||
ACP_RESULT_NOT_PRESENT_RATING = -1003,
|
ACP_RESULT_NOT_PRESENT_RATING = -1003,
|
||||||
ACP_RESULT_PENDING_RATING = -1004,
|
ACP_RESULT_PENDING_RATING = -1004,
|
||||||
ACP_RESULT_NET_SETTING_REQUIRED = -1005,
|
ACP_RESULT_NET_SETTING_REQUIRED = -1005,
|
||||||
ACP_RESULT_NET_ACCOUNT_REQUIRED = -1006,
|
ACP_RESULT_NET_ACCOUNT_REQUIRED = -1006,
|
||||||
ACP_RESULT_NET_ACCOUNT_ERROR = -1007,
|
ACP_RESULT_NET_ACCOUNT_ERROR = -1007,
|
||||||
ACP_RESULT_BROWSER_REQUIRED = -1008,
|
ACP_RESULT_BROWSER_REQUIRED = -1008,
|
||||||
ACP_RESULT_OLV_REQUIRED = -1009,
|
ACP_RESULT_OLV_REQUIRED = -1009,
|
||||||
ACP_RESULT_PINCODE_REQUIRED = -1010,
|
ACP_RESULT_PINCODE_REQUIRED = -1010,
|
||||||
ACP_RESULT_INCORRECT_PINCODE = -1011,
|
ACP_RESULT_INCORRECT_PINCODE = -1011,
|
||||||
ACP_RESULT_INVALID_LOGO = -1012,
|
ACP_RESULT_INVALID_LOGO = -1012,
|
||||||
ACP_RESULT_DEMO_EXPIRED_NUMBER = -1013,
|
ACP_RESULT_DEMO_EXPIRED_NUMBER = -1013,
|
||||||
ACP_RESULT_DRC_REQUIRED = -1014,
|
ACP_RESULT_DRC_REQUIRED = -1014,
|
||||||
|
|
||||||
ACP_RESULT_NO_PERMISSION = -1100,
|
ACP_RESULT_NO_PERMISSION = -1100,
|
||||||
ACP_RESULT_NO_FILE_PERMISSION = -1101,
|
ACP_RESULT_NO_FILE_PERMISSION = -1101,
|
||||||
ACP_RESULT_NO_DIR_PERMISSION = -1102,
|
ACP_RESULT_NO_DIR_PERMISSION = -1102,
|
||||||
|
|
||||||
ACP_RESULT_BUSY = -1300,
|
ACP_RESULT_BUSY = -1300,
|
||||||
ACP_RESULT_USB_STORAGE_NOT_READY = -1301,
|
ACP_RESULT_USB_STORAGE_NOT_READY = -1301,
|
||||||
|
|
||||||
ACP_RESULT_CANCELLED = -1400,
|
ACP_RESULT_CANCELLED = -1400,
|
||||||
|
|
||||||
ACP_RESULT_RESOURCE = -1500,
|
ACP_RESULT_RESOURCE = -1500,
|
||||||
ACP_RESULT_DEVICE_FULL = -1501,
|
ACP_RESULT_DEVICE_FULL = -1501,
|
||||||
ACP_RESULT_JOURNAL_FULL = -1502,
|
ACP_RESULT_JOURNAL_FULL = -1502,
|
||||||
ACP_RESULT_SYSTEM_MEMORY = -1503,
|
ACP_RESULT_SYSTEM_MEMORY = -1503,
|
||||||
ACP_RESULT_FS_RESOURCE = -1504,
|
ACP_RESULT_FS_RESOURCE = -1504,
|
||||||
ACP_RESULT_IPC_RESOURCE = -1505,
|
ACP_RESULT_IPC_RESOURCE = -1505,
|
||||||
|
|
||||||
ACP_RESULT_NOT_INITIALISED = -1600,
|
ACP_RESULT_NOT_INITIALISED = -1600,
|
||||||
|
|
||||||
ACP_RESULT_ACCOUNT_ERROR = -1700,
|
ACP_RESULT_ACCOUNT_ERROR = -1700,
|
||||||
|
|
||||||
ACP_RESULT_UNSUPPORTED = -1800,
|
ACP_RESULT_UNSUPPORTED = -1800,
|
||||||
|
|
||||||
ACP_RESULT_DATA_CORRUPTED = -2000,
|
ACP_RESULT_DATA_CORRUPTED = -2000,
|
||||||
ACP_RESULT_DEVICE = -2001,
|
ACP_RESULT_DEVICE = -2001,
|
||||||
ACP_RESULT_SLC_DATA_CORRUPTED = -2002,
|
ACP_RESULT_SLC_DATA_CORRUPTED = -2002,
|
||||||
ACP_RESULT_MLC_DATA_CORRUPTED = -2003,
|
ACP_RESULT_MLC_DATA_CORRUPTED = -2003,
|
||||||
ACP_RESULT_USB_DATA_CORRUPTED = -2004,
|
ACP_RESULT_USB_DATA_CORRUPTED = -2004,
|
||||||
|
|
||||||
ACP_RESULT_MEDIA = -2100,
|
ACP_RESULT_MEDIA = -2100,
|
||||||
ACP_RESULT_MEDIA_NOT_READY = -2101,
|
ACP_RESULT_MEDIA_NOT_READY = -2101,
|
||||||
ACP_RESULT_MEDIA_BROKEN = -2102,
|
ACP_RESULT_MEDIA_BROKEN = -2102,
|
||||||
ACP_RESULT_ODD_MEDIA_NOT_READY = -2103,
|
ACP_RESULT_ODD_MEDIA_NOT_READY = -2103,
|
||||||
ACP_RESULT_ODD_MEDIA_BROKEN = -2104,
|
ACP_RESULT_ODD_MEDIA_BROKEN = -2104,
|
||||||
ACP_RESULT_USB_MEDIA_NOT_READY = -2105,
|
ACP_RESULT_USB_MEDIA_NOT_READY = -2105,
|
||||||
ACP_RESULT_USB_MEDIA_BROKEN = -2106,
|
ACP_RESULT_USB_MEDIA_BROKEN = -2106,
|
||||||
ACP_RESULT_MEDIA_WRITE_PROTECTED = -2107,
|
ACP_RESULT_MEDIA_WRITE_PROTECTED = -2107,
|
||||||
ACP_RESULT_USB_WRITE_PROTECTED = -2108,
|
ACP_RESULT_USB_WRITE_PROTECTED = -2108,
|
||||||
|
|
||||||
ACP_RESULT_MII = -2200,
|
ACP_RESULT_MII = -2200,
|
||||||
ACP_RESULT_ENCRYPTION_ERROR = -2201,
|
ACP_RESULT_ENCRYPTION_ERROR = -2201,
|
||||||
|
|
||||||
ACP_RESULT_GENERIC_ERROR = -4096,
|
ACP_RESULT_GENERIC_ERROR = -4096,
|
||||||
} ACPResult;
|
} ACPResult;
|
||||||
WUT_CHECK_SIZE(ACPResult, 0x4);
|
WUT_CHECK_SIZE(ACPResult, 0x4);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include <nn/acp/result.h>
|
|
||||||
#include <nn/acp/device.h>
|
#include <nn/acp/device.h>
|
||||||
|
#include <nn/acp/result.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup nn_acp_save Save
|
* \defgroup nn_acp_save Save
|
||||||
|
|
@ -18,16 +18,17 @@ extern "C" {
|
||||||
typedef uint64_t ACPTitleId;
|
typedef uint64_t ACPTitleId;
|
||||||
typedef struct ACPSaveDirInfo ACPSaveDirInfo;
|
typedef struct ACPSaveDirInfo ACPSaveDirInfo;
|
||||||
|
|
||||||
struct WUT_PACKED ACPSaveDirInfo {
|
struct WUT_PACKED ACPSaveDirInfo
|
||||||
WUT_UNKNOWN_BYTES(0x8);
|
{
|
||||||
uint32_t persistentId;
|
WUT_UNKNOWN_BYTES(0x8);
|
||||||
WUT_UNKNOWN_BYTES(0x14);
|
uint32_t persistentId;
|
||||||
char path[0x40];
|
WUT_UNKNOWN_BYTES(0x14);
|
||||||
WUT_PADDING_BYTES(0x80 - 0x60);
|
char path[0x40];
|
||||||
|
WUT_PADDING_BYTES(0x80 - 0x60);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(ACPSaveDirInfo, 0x08, persistentId);
|
WUT_CHECK_OFFSET(ACPSaveDirInfo, 0x08, persistentId);
|
||||||
WUT_CHECK_OFFSET(ACPSaveDirInfo, 0x20, path);
|
WUT_CHECK_OFFSET(ACPSaveDirInfo, 0x20, path);
|
||||||
WUT_CHECK_SIZE(ACPSaveDirInfo,0x80);
|
WUT_CHECK_SIZE(ACPSaveDirInfo, 0x80);
|
||||||
|
|
||||||
ACPResult
|
ACPResult
|
||||||
ACPCreateSaveDir(uint32_t persistentId,
|
ACPCreateSaveDir(uint32_t persistentId,
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include <nn/acp/result.h>
|
|
||||||
#include <nn/acp/device.h>
|
|
||||||
#include <coreinit/mcp.h>
|
#include <coreinit/mcp.h>
|
||||||
|
#include <nn/acp/device.h>
|
||||||
|
#include <nn/acp/result.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup nn_acp_title Title
|
* \defgroup nn_acp_title Title
|
||||||
|
|
@ -20,114 +20,115 @@ extern "C" {
|
||||||
typedef uint64_t ACPTitleId;
|
typedef uint64_t ACPTitleId;
|
||||||
typedef struct ACPMetaXml ACPMetaXml;
|
typedef struct ACPMetaXml ACPMetaXml;
|
||||||
|
|
||||||
struct WUT_PACKED ACPMetaXml {
|
struct WUT_PACKED ACPMetaXml
|
||||||
uint64_t title_id;
|
{
|
||||||
uint64_t boss_id;
|
uint64_t title_id;
|
||||||
uint64_t os_version;
|
uint64_t boss_id;
|
||||||
uint64_t app_size;
|
uint64_t os_version;
|
||||||
uint64_t common_save_size;
|
uint64_t app_size;
|
||||||
uint64_t account_save_size;
|
uint64_t common_save_size;
|
||||||
uint64_t common_boss_size;
|
uint64_t account_save_size;
|
||||||
uint64_t account_boss_size;
|
uint64_t common_boss_size;
|
||||||
uint64_t join_game_mode_mask;
|
uint64_t account_boss_size;
|
||||||
uint32_t version;
|
uint64_t join_game_mode_mask;
|
||||||
char product_code[32];
|
uint32_t version;
|
||||||
char content_platform[32];
|
char product_code[32];
|
||||||
char company_code[8];
|
char content_platform[32];
|
||||||
char mastering_date[32];
|
char company_code[8];
|
||||||
uint32_t logo_type;
|
char mastering_date[32];
|
||||||
uint32_t app_launch_type;
|
uint32_t logo_type;
|
||||||
uint32_t invisible_flag;
|
uint32_t app_launch_type;
|
||||||
uint32_t no_managed_flag;
|
uint32_t invisible_flag;
|
||||||
uint32_t no_event_log;
|
uint32_t no_managed_flag;
|
||||||
uint32_t no_icon_database;
|
uint32_t no_event_log;
|
||||||
uint32_t launching_flag;
|
uint32_t no_icon_database;
|
||||||
uint32_t install_flag;
|
uint32_t launching_flag;
|
||||||
uint32_t closing_msg;
|
uint32_t install_flag;
|
||||||
uint32_t title_version;
|
uint32_t closing_msg;
|
||||||
uint32_t group_id;
|
uint32_t title_version;
|
||||||
uint32_t save_no_rollback;
|
uint32_t group_id;
|
||||||
uint32_t bg_daemon_enable;
|
uint32_t save_no_rollback;
|
||||||
uint32_t join_game_id;
|
uint32_t bg_daemon_enable;
|
||||||
uint32_t olv_accesskey;
|
uint32_t join_game_id;
|
||||||
uint32_t wood_tin;
|
uint32_t olv_accesskey;
|
||||||
uint32_t e_manual;
|
uint32_t wood_tin;
|
||||||
uint32_t e_manual_version;
|
uint32_t e_manual;
|
||||||
uint32_t region;
|
uint32_t e_manual_version;
|
||||||
uint32_t pc_cero;
|
uint32_t region;
|
||||||
uint32_t pc_esrb;
|
uint32_t pc_cero;
|
||||||
uint32_t pc_bbfc;
|
uint32_t pc_esrb;
|
||||||
uint32_t pc_usk;
|
uint32_t pc_bbfc;
|
||||||
uint32_t pc_pegi_gen;
|
uint32_t pc_usk;
|
||||||
uint32_t pc_pegi_fin;
|
uint32_t pc_pegi_gen;
|
||||||
uint32_t pc_pegi_prt;
|
uint32_t pc_pegi_fin;
|
||||||
uint32_t pc_pegi_bbfc;
|
uint32_t pc_pegi_prt;
|
||||||
uint32_t pc_cob;
|
uint32_t pc_pegi_bbfc;
|
||||||
uint32_t pc_grb;
|
uint32_t pc_cob;
|
||||||
uint32_t pc_cgsrr;
|
uint32_t pc_grb;
|
||||||
uint32_t pc_oflc;
|
uint32_t pc_cgsrr;
|
||||||
uint32_t pc_reserved0;
|
uint32_t pc_oflc;
|
||||||
uint32_t pc_reserved1;
|
uint32_t pc_reserved0;
|
||||||
uint32_t pc_reserved2;
|
uint32_t pc_reserved1;
|
||||||
uint32_t pc_reserved3;
|
uint32_t pc_reserved2;
|
||||||
uint32_t ext_dev_nunchaku;
|
uint32_t pc_reserved3;
|
||||||
uint32_t ext_dev_classic;
|
uint32_t ext_dev_nunchaku;
|
||||||
uint32_t ext_dev_urcc;
|
uint32_t ext_dev_classic;
|
||||||
uint32_t ext_dev_board;
|
uint32_t ext_dev_urcc;
|
||||||
uint32_t ext_dev_usb_keyboard;
|
uint32_t ext_dev_board;
|
||||||
uint32_t ext_dev_etc;
|
uint32_t ext_dev_usb_keyboard;
|
||||||
char ext_dev_etc_name[512];
|
uint32_t ext_dev_etc;
|
||||||
uint32_t eula_version;
|
char ext_dev_etc_name[512];
|
||||||
uint32_t drc_use;
|
uint32_t eula_version;
|
||||||
uint32_t network_use;
|
uint32_t drc_use;
|
||||||
uint32_t online_account_use;
|
uint32_t network_use;
|
||||||
uint32_t direct_boot;
|
uint32_t online_account_use;
|
||||||
uint32_t reserved_flag0;
|
uint32_t direct_boot;
|
||||||
uint32_t reserved_flag1;
|
uint32_t reserved_flag0;
|
||||||
uint32_t reserved_flag2;
|
uint32_t reserved_flag1;
|
||||||
uint32_t reserved_flag3;
|
uint32_t reserved_flag2;
|
||||||
uint32_t reserved_flag4;
|
uint32_t reserved_flag3;
|
||||||
uint32_t reserved_flag5;
|
uint32_t reserved_flag4;
|
||||||
uint32_t reserved_flag6;
|
uint32_t reserved_flag5;
|
||||||
uint32_t reserved_flag7;
|
uint32_t reserved_flag6;
|
||||||
char longname_ja[512];
|
uint32_t reserved_flag7;
|
||||||
char longname_en[512];
|
char longname_ja[512];
|
||||||
char longname_fr[512];
|
char longname_en[512];
|
||||||
char longname_de[512];
|
char longname_fr[512];
|
||||||
char longname_it[512];
|
char longname_de[512];
|
||||||
char longname_es[512];
|
char longname_it[512];
|
||||||
char longname_zhs[512];
|
char longname_es[512];
|
||||||
char longname_ko[512];
|
char longname_zhs[512];
|
||||||
char longname_nl[512];
|
char longname_ko[512];
|
||||||
char longname_pt[512];
|
char longname_nl[512];
|
||||||
char longname_ru[512];
|
char longname_pt[512];
|
||||||
char longname_zht[512];
|
char longname_ru[512];
|
||||||
char shortname_ja[256];
|
char longname_zht[512];
|
||||||
char shortname_en[256];
|
char shortname_ja[256];
|
||||||
char shortname_fr[256];
|
char shortname_en[256];
|
||||||
char shortname_de[256];
|
char shortname_fr[256];
|
||||||
char shortname_it[256];
|
char shortname_de[256];
|
||||||
char shortname_es[256];
|
char shortname_it[256];
|
||||||
char shortname_zhs[256];
|
char shortname_es[256];
|
||||||
char shortname_ko[256];
|
char shortname_zhs[256];
|
||||||
char shortname_nl[256];
|
char shortname_ko[256];
|
||||||
char shortname_pt[256];
|
char shortname_nl[256];
|
||||||
char shortname_ru[256];
|
char shortname_pt[256];
|
||||||
char shortname_zht[256];
|
char shortname_ru[256];
|
||||||
char publisher_ja[256];
|
char shortname_zht[256];
|
||||||
char publisher_en[256];
|
char publisher_ja[256];
|
||||||
char publisher_fr[256];
|
char publisher_en[256];
|
||||||
char publisher_de[256];
|
char publisher_fr[256];
|
||||||
char publisher_it[256];
|
char publisher_de[256];
|
||||||
char publisher_es[256];
|
char publisher_it[256];
|
||||||
char publisher_zhs[256];
|
char publisher_es[256];
|
||||||
char publisher_ko[256];
|
char publisher_zhs[256];
|
||||||
char publisher_nl[256];
|
char publisher_ko[256];
|
||||||
char publisher_pt[256];
|
char publisher_nl[256];
|
||||||
char publisher_ru[256];
|
char publisher_pt[256];
|
||||||
char publisher_zht[256];
|
char publisher_ru[256];
|
||||||
uint32_t add_on_unique_id[32];
|
char publisher_zht[256];
|
||||||
WUT_UNKNOWN_BYTES(52);
|
uint32_t add_on_unique_id[32];
|
||||||
|
WUT_UNKNOWN_BYTES(52);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(ACPMetaXml, 0x00, title_id);
|
WUT_CHECK_OFFSET(ACPMetaXml, 0x00, title_id);
|
||||||
WUT_CHECK_OFFSET(ACPMetaXml, 0x08, boss_id);
|
WUT_CHECK_OFFSET(ACPMetaXml, 0x08, boss_id);
|
||||||
|
|
@ -235,13 +236,13 @@ WUT_CHECK_OFFSET(ACPMetaXml, 0x308C, publisher_pt);
|
||||||
WUT_CHECK_OFFSET(ACPMetaXml, 0x318C, publisher_ru);
|
WUT_CHECK_OFFSET(ACPMetaXml, 0x318C, publisher_ru);
|
||||||
WUT_CHECK_OFFSET(ACPMetaXml, 0x328C, publisher_zht);
|
WUT_CHECK_OFFSET(ACPMetaXml, 0x328C, publisher_zht);
|
||||||
WUT_CHECK_OFFSET(ACPMetaXml, 0x338C, add_on_unique_id);
|
WUT_CHECK_OFFSET(ACPMetaXml, 0x338C, add_on_unique_id);
|
||||||
WUT_CHECK_SIZE(ACPMetaXml,0x3440);
|
WUT_CHECK_SIZE(ACPMetaXml, 0x3440);
|
||||||
|
|
||||||
ACPResult
|
ACPResult
|
||||||
ACPAssignTitlePatch(MCPTitleListType* titleInfo);
|
ACPAssignTitlePatch(MCPTitleListType *titleInfo);
|
||||||
|
|
||||||
ACPResult
|
ACPResult
|
||||||
ACPGetTitleIdOfMainApplication(ACPTitleId* titleId);
|
ACPGetTitleIdOfMainApplication(ACPTitleId *titleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the MetaXML for a given title id
|
* Gets the MetaXML for a given title id
|
||||||
|
|
@ -249,9 +250,11 @@ ACPGetTitleIdOfMainApplication(ACPTitleId* titleId);
|
||||||
* @param metaXml must be aligned to 0x40
|
* @param metaXml must be aligned to 0x40
|
||||||
* @return ACP_RESULT_SUCCESS on success
|
* @return ACP_RESULT_SUCCESS on success
|
||||||
*/
|
*/
|
||||||
|
// clang-format off
|
||||||
ACPResult
|
ACPResult
|
||||||
RPLWRAP(ACPGetTitleMetaXml)(ACPTitleId titleId,
|
RPLWRAP(ACPGetTitleMetaXml)(ACPTitleId titleId,
|
||||||
ACPMetaXml *metaXml);
|
ACPMetaXml *metaXml);
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the MetaXML for a given title id
|
* Gets the MetaXML for a given title id
|
||||||
|
|
@ -262,17 +265,20 @@ RPLWRAP(ACPGetTitleMetaXml)(ACPTitleId titleId,
|
||||||
*/
|
*/
|
||||||
static inline ACPResult
|
static inline ACPResult
|
||||||
ACPGetTitleMetaXml(ACPTitleId titleId,
|
ACPGetTitleMetaXml(ACPTitleId titleId,
|
||||||
ACPMetaXml *metaXml) {
|
ACPMetaXml *metaXml)
|
||||||
if ((uintptr_t) metaXml & 0x3F) {
|
{
|
||||||
|
if ((uintptr_t)metaXml & 0x3F) {
|
||||||
return ACP_RESULT_INVALID_PARAMETER;
|
return ACP_RESULT_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
return RPLWRAP(ACPGetTitleMetaXml)(titleId, metaXml);
|
return RPLWRAP(ACPGetTitleMetaXml)(titleId, metaXml);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
ACPResult
|
ACPResult
|
||||||
RPLWRAP(ACPGetTitleSaveMetaXml)(uint64_t titleId,
|
RPLWRAP(ACPGetTitleSaveMetaXml)(uint64_t titleId,
|
||||||
ACPMetaXml* metaXml,
|
ACPMetaXml* metaXml,
|
||||||
ACPDeviceType deviceType);
|
ACPDeviceType deviceType);
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the save dir MetaXML for a given title id
|
* Gets the save dir MetaXML for a given title id
|
||||||
|
|
@ -285,8 +291,9 @@ RPLWRAP(ACPGetTitleSaveMetaXml)(uint64_t titleId,
|
||||||
static inline ACPResult
|
static inline ACPResult
|
||||||
ACPGetTitleSaveMetaXml(ACPTitleId titleId,
|
ACPGetTitleSaveMetaXml(ACPTitleId titleId,
|
||||||
ACPMetaXml *metaXml,
|
ACPMetaXml *metaXml,
|
||||||
ACPDeviceType deviceType) {
|
ACPDeviceType deviceType)
|
||||||
if ((uintptr_t) metaXml & 0x3F) {
|
{
|
||||||
|
if ((uintptr_t)metaXml & 0x3F) {
|
||||||
return ACP_RESULT_INVALID_PARAMETER;
|
return ACP_RESULT_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
return RPLWRAP(ACPGetTitleSaveMetaXml)(titleId, metaXml, deviceType);
|
return RPLWRAP(ACPGetTitleSaveMetaXml)(titleId, metaXml, deviceType);
|
||||||
|
|
@ -299,13 +306,13 @@ ACPGetTitleMetaDir(ACPTitleId titleId,
|
||||||
|
|
||||||
ACPResult
|
ACPResult
|
||||||
ACPGetTitleMetaDirByDevice(ACPTitleId titleId,
|
ACPGetTitleMetaDirByDevice(ACPTitleId titleId,
|
||||||
char* directory,
|
char *directory,
|
||||||
size_t directoryLen,
|
size_t directoryLen,
|
||||||
ACPDeviceType deviceType);
|
ACPDeviceType deviceType);
|
||||||
|
|
||||||
ACPResult
|
ACPResult
|
||||||
ACPGetTitleMetaDirByTitleListType(MCPTitleListType titleListType,
|
ACPGetTitleMetaDirByTitleListType(MCPTitleListType titleListType,
|
||||||
char* directory,
|
char *directory,
|
||||||
size_t directoryLen);
|
size_t directoryLen);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include <nn/result.h>
|
|
||||||
#include <nn/ffl/miidata.h>
|
#include <nn/ffl/miidata.h>
|
||||||
|
#include <nn/result.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup nn_act_client Accounts Client API
|
* \defgroup nn_act_client Accounts Client API
|
||||||
|
|
@ -12,25 +12,27 @@
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#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
|
//https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/nn/act/nn_act_types.h
|
||||||
|
|
||||||
using ACTLoadOption = uint32_t;
|
using ACTLoadOption = uint32_t;
|
||||||
using SlotNo = uint8_t;
|
using SlotNo = uint8_t;
|
||||||
using LocalFriendCode = uint64_t;
|
using LocalFriendCode = uint64_t;
|
||||||
using PersistentId = uint32_t;
|
using PersistentId = uint32_t;
|
||||||
using PrincipalId = uint32_t;
|
using PrincipalId = uint32_t;
|
||||||
using SimpleAddressId = uint32_t;
|
using SimpleAddressId = uint32_t;
|
||||||
using TransferrableId = uint64_t;
|
using TransferrableId = uint64_t;
|
||||||
|
|
||||||
static constexpr size_t AccountIdSize = 17;
|
static constexpr size_t AccountIdSize = 17;
|
||||||
static constexpr size_t DeviceHashSize = 8;
|
static constexpr size_t DeviceHashSize = 8;
|
||||||
static constexpr size_t NfsPasswordSize = 17;
|
static constexpr size_t NfsPasswordSize = 17;
|
||||||
static constexpr size_t MiiNameSize = 11;
|
static constexpr size_t MiiNameSize = 11;
|
||||||
static constexpr size_t UuidSize = 16;
|
static constexpr size_t UuidSize = 16;
|
||||||
|
|
||||||
//https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/cafe/libraries/nn_act/nn_act_client.cpp
|
//https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/cafe/libraries/nn_act/nn_act_client.cpp
|
||||||
|
|
||||||
|
|
@ -53,11 +55,11 @@ GetAccountIdEx(char outAccountId[AccountIdSize], SlotNo slot)
|
||||||
asm("GetAccountIdEx__Q2_2nn3actFPcUc");
|
asm("GetAccountIdEx__Q2_2nn3actFPcUc");
|
||||||
|
|
||||||
nn::Result
|
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");
|
asm("GetBirthday__Q2_2nn3actFPUsPUcT2");
|
||||||
|
|
||||||
nn::Result
|
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");
|
asm("GetBirthdayEx__Q2_2nn3actFPUsPUcT2Uc");
|
||||||
|
|
||||||
SlotNo
|
SlotNo
|
||||||
|
|
@ -69,19 +71,19 @@ GetDeviceHash(char outHash[DeviceHashSize])
|
||||||
asm("GetDeviceHash__Q2_2nn3actFPUL");
|
asm("GetDeviceHash__Q2_2nn3actFPUL");
|
||||||
|
|
||||||
nn::Result
|
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");
|
asm("LoadConsoleAccount__Q2_2nn3actFUc13ACTLoadOptionPCcb");
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetMii(FFLStoreData* mii)
|
GetMii(FFLStoreData *mii)
|
||||||
asm("GetMii__Q2_2nn3actFP12FFLStoreData");
|
asm("GetMii__Q2_2nn3actFP12FFLStoreData");
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetMiiEx(FFLStoreData* mii, SlotNo slot)
|
GetMiiEx(FFLStoreData *mii, SlotNo slot)
|
||||||
asm("GetMiiEx__Q2_2nn3actFP12FFLStoreDataUc");
|
asm("GetMiiEx__Q2_2nn3actFP12FFLStoreDataUc");
|
||||||
|
|
||||||
nn::Result
|
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");
|
asm("GetMiiImageEx__Q2_2nn3actFPUiPvUi15ACTMiiImageTypeUc");
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
|
|
@ -125,7 +127,7 @@ GetPrincipalId(void)
|
||||||
asm("GetPrincipalId__Q2_2nn3actFv");
|
asm("GetPrincipalId__Q2_2nn3actFv");
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetPrincipalIdEx(PrincipalId* outId, SlotNo slot)
|
GetPrincipalIdEx(PrincipalId *outId, SlotNo slot)
|
||||||
asm("GetPrincipalIdEx__Q2_2nn3actFPUiUc");
|
asm("GetPrincipalIdEx__Q2_2nn3actFPUiUc");
|
||||||
|
|
||||||
SimpleAddressId
|
SimpleAddressId
|
||||||
|
|
@ -133,7 +135,7 @@ GetSimpleAddressId(void)
|
||||||
asm("GetSimpleAddressId__Q2_2nn3actFv");
|
asm("GetSimpleAddressId__Q2_2nn3actFv");
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetSimpleAddressId(SimpleAddressId* outId, SlotNo slot)
|
GetSimpleAddressId(SimpleAddressId *outId, SlotNo slot)
|
||||||
asm("GetSimpleAddressIdEx__Q2_2nn3actFPUiUc");
|
asm("GetSimpleAddressIdEx__Q2_2nn3actFPUiUc");
|
||||||
|
|
||||||
SlotNo
|
SlotNo
|
||||||
|
|
@ -145,7 +147,7 @@ GetTransferableId(uint32_t unk1)
|
||||||
asm("GetTransferableId__Q2_2nn3actFUi");
|
asm("GetTransferableId__Q2_2nn3actFUi");
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetTransferableIdEx(TransferrableId* outId, uint32_t unk1, SlotNo slot)
|
GetTransferableIdEx(TransferrableId *outId, uint32_t unk1, SlotNo slot)
|
||||||
asm("GetTransferableIdEx__Q2_2nn3actFPULUiUc");
|
asm("GetTransferableIdEx__Q2_2nn3actFPULUiUc");
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
|
|
|
||||||
|
|
@ -18,27 +18,27 @@ typedef struct CCRSysUpdateState CCRSysUpdateState;
|
||||||
typedef enum CCRSysPairingState
|
typedef enum CCRSysPairingState
|
||||||
{
|
{
|
||||||
//! Pairing is complete / hasn't started yet
|
//! Pairing is complete / hasn't started yet
|
||||||
CCR_SYS_PAIRING_FINISHED = 0,
|
CCR_SYS_PAIRING_FINISHED = 0,
|
||||||
//! Pairing is in progress
|
//! Pairing is in progress
|
||||||
CCR_SYS_PAIRING_IN_PROGRESS = 1,
|
CCR_SYS_PAIRING_IN_PROGRESS = 1,
|
||||||
//! Pairing timed out
|
//! Pairing timed out
|
||||||
CCR_SYS_PAIRING_TIMED_OUT = 2,
|
CCR_SYS_PAIRING_TIMED_OUT = 2,
|
||||||
} CCRSysPairingState;
|
} CCRSysPairingState;
|
||||||
|
|
||||||
typedef enum CCRSysInitBootFlag
|
typedef enum CCRSysInitBootFlag
|
||||||
{
|
{
|
||||||
CCR_SYS_BOOT_FLAG_NONE = 0,
|
CCR_SYS_BOOT_FLAG_NONE = 0,
|
||||||
//! Shows "Turn on the TV and Wii U Console.." text on next DRC boot
|
//! Shows "Turn on the TV and Wii U Console.." text on next DRC boot
|
||||||
CCR_SYS_BOOT_FLAG_FIRST_BOOT = 1,
|
CCR_SYS_BOOT_FLAG_FIRST_BOOT = 1,
|
||||||
} CCRSysInitBootFlag;
|
} CCRSysInitBootFlag;
|
||||||
|
|
||||||
typedef enum CCRSysLCDMode
|
typedef enum CCRSysLCDMode
|
||||||
{
|
{
|
||||||
CCR_SYS_LCD_MODE_BRIGHTNESS_1 = 1,
|
CCR_SYS_LCD_MODE_BRIGHTNESS_1 = 1,
|
||||||
CCR_SYS_LCD_MODE_BRIGHTNESS_2 = 2,
|
CCR_SYS_LCD_MODE_BRIGHTNESS_2 = 2,
|
||||||
CCR_SYS_LCD_MODE_BRIGHTNESS_3 = 3,
|
CCR_SYS_LCD_MODE_BRIGHTNESS_3 = 3,
|
||||||
CCR_SYS_LCD_MODE_BRIGHTNESS_4 = 4,
|
CCR_SYS_LCD_MODE_BRIGHTNESS_4 = 4,
|
||||||
CCR_SYS_LCD_MODE_BRIGHTNESS_5 = 5,
|
CCR_SYS_LCD_MODE_BRIGHTNESS_5 = 5,
|
||||||
} CCRSysLCDMode;
|
} CCRSysLCDMode;
|
||||||
|
|
||||||
struct CCRSysUpdateState
|
struct CCRSysUpdateState
|
||||||
|
|
|
||||||
|
|
@ -16,16 +16,16 @@ typedef struct CCRAppLaunchParam CCRAppLaunchParam;
|
||||||
|
|
||||||
struct WUT_PACKED CCRAppLaunchParam
|
struct WUT_PACKED CCRAppLaunchParam
|
||||||
{
|
{
|
||||||
uint64_t launchInfoDatabaseEntryId; // id used in the \link nn::sl::LaunchInfoDatabase
|
uint64_t launchInfoDatabaseEntryId; // id used in the \link nn::sl::LaunchInfoDatabase
|
||||||
char uuid[16]; // account uuid
|
char uuid[16]; // account uuid
|
||||||
WUT_UNKNOWN_BYTES(0xE7);
|
WUT_UNKNOWN_BYTES(0xE7);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(CCRAppLaunchParam, 0x00, launchInfoDatabaseEntryId);
|
WUT_CHECK_OFFSET(CCRAppLaunchParam, 0x00, launchInfoDatabaseEntryId);
|
||||||
WUT_CHECK_OFFSET(CCRAppLaunchParam, 0x08, uuid);
|
WUT_CHECK_OFFSET(CCRAppLaunchParam, 0x08, uuid);
|
||||||
WUT_CHECK_SIZE(CCRAppLaunchParam, 0xFF);
|
WUT_CHECK_SIZE(CCRAppLaunchParam, 0xFF);
|
||||||
|
|
||||||
void
|
void
|
||||||
CCRSysCaffeineGetAppLaunchParam(CCRAppLaunchParam * data);
|
CCRSysCaffeineGetAppLaunchParam(CCRAppLaunchParam *data);
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
CCRSysCaffeineBootCheck();
|
CCRSysCaffeineBootCheck();
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,18 @@
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn {
|
namespace nn
|
||||||
|
{
|
||||||
|
|
||||||
namespace cfg {
|
namespace cfg
|
||||||
|
{
|
||||||
|
|
||||||
namespace CTR {
|
namespace CTR
|
||||||
|
{
|
||||||
|
|
||||||
//! Represents a console username, used in UDS and DLP
|
//! Represents a console username, used in UDS and DLP
|
||||||
struct UserName {
|
struct UserName
|
||||||
|
{
|
||||||
char16_t name[12];
|
char16_t name[12];
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(UserName, 0x18);
|
WUT_CHECK_SIZE(UserName, 0x18);
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,11 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum CmptScreenType {
|
typedef enum CmptScreenType
|
||||||
CMPT_SCREEN_TYPE_TV = 1,
|
{
|
||||||
CMPT_SCREEN_TYPE_DRC,
|
CMPT_SCREEN_TYPE_TV = 1,
|
||||||
CMPT_SCREEN_TYPE_BOTH,
|
CMPT_SCREEN_TYPE_DRC,
|
||||||
|
CMPT_SCREEN_TYPE_BOTH,
|
||||||
} CmptScreenType;
|
} CmptScreenType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -26,7 +27,7 @@ typedef enum CmptScreenType {
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
int32_t
|
int32_t
|
||||||
CMPTGetDataSize(uint32_t* outSize);
|
CMPTGetDataSize(uint32_t *outSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launches the specified vWii title.
|
* Launches the specified vWii title.
|
||||||
|
|
@ -35,7 +36,7 @@ CMPTGetDataSize(uint32_t* outSize);
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
int32_t
|
int32_t
|
||||||
CMPTLaunchTitle(void* dataBuffer, uint32_t bufferSize, uint64_t titleId);
|
CMPTLaunchTitle(void *dataBuffer, uint32_t bufferSize, uint64_t titleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launches vWii System Menu.
|
* Launches vWii System Menu.
|
||||||
|
|
@ -44,7 +45,7 @@ CMPTLaunchTitle(void* dataBuffer, uint32_t bufferSize, uint64_t titleId);
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
int32_t
|
int32_t
|
||||||
CMPTLaunchMenu(void* dataBuffer, uint32_t bufferSize);
|
CMPTLaunchMenu(void *dataBuffer, uint32_t bufferSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launches vWii Data Management.
|
* Launches vWii Data Management.
|
||||||
|
|
@ -53,7 +54,7 @@ CMPTLaunchMenu(void* dataBuffer, uint32_t bufferSize);
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
int32_t
|
int32_t
|
||||||
CMPTLaunchDataManager(void* dataBuffer, uint32_t bufferSize);
|
CMPTLaunchDataManager(void *dataBuffer, uint32_t bufferSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the screen type.
|
* Sets the screen type.
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include <nn/result.h>
|
|
||||||
#include <nn/cfg/CTR.h>
|
#include <nn/cfg/CTR.h>
|
||||||
|
#include <nn/result.h>
|
||||||
#include <nn/uds/NodeInformation.h>
|
#include <nn/uds/NodeInformation.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -14,314 +14,340 @@
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn {
|
namespace nn
|
||||||
|
{
|
||||||
|
|
||||||
namespace dlp {
|
namespace dlp
|
||||||
|
{
|
||||||
|
|
||||||
namespace Cafe {
|
namespace Cafe
|
||||||
enum PollStateChangeFlags : uint8_t {
|
{
|
||||||
//! Prevents \c PollStateChange from blocking if no new data is available
|
enum PollStateChangeFlags : uint8_t
|
||||||
DLP_POLL_NONBLOCK = 1 << 0,
|
{
|
||||||
};
|
//! Prevents \c PollStateChange from blocking if no new data is available
|
||||||
WUT_CHECK_SIZE(PollStateChangeFlags, 0x1);
|
DLP_POLL_NONBLOCK = 1 << 0,
|
||||||
|
};
|
||||||
|
WUT_CHECK_SIZE(PollStateChangeFlags, 0x1);
|
||||||
|
|
||||||
//! Represents the client state
|
//! Represents the client state
|
||||||
enum class ClientState : uint32_t {
|
enum class ClientState : uint32_t
|
||||||
//! The client is accepted for the DLP child distribution
|
{
|
||||||
Accepted = 5,
|
//! The client is accepted for the DLP child distribution
|
||||||
//! The client is receiving the distributed DLP child
|
Accepted = 5,
|
||||||
Receiving = 6,
|
//! The client is receiving the distributed DLP child
|
||||||
//! The client has received the distribution and is ready to boot the DLP child
|
Receiving = 6,
|
||||||
Ready = 7,
|
//! The client has received the distribution and is ready to boot the DLP child
|
||||||
//! The client is connected to the session and pending to be accepted
|
Ready = 7,
|
||||||
Connecting = 64
|
//! The client is connected to the session and pending to be accepted
|
||||||
};
|
Connecting = 64
|
||||||
WUT_CHECK_SIZE(ClientState, 0x4);
|
};
|
||||||
|
WUT_CHECK_SIZE(ClientState, 0x4);
|
||||||
|
|
||||||
//! Represents the server state. All values between 3 and 7 are considered internal state
|
//! Represents the server state. All values between 3 and 7 are considered internal state
|
||||||
enum class ServerState : uint32_t {
|
enum class ServerState : uint32_t
|
||||||
//! The server is not initialized
|
{
|
||||||
Uninitialized = 0,
|
//! The server is not initialized
|
||||||
//! The server is initialized but there is no active network
|
Uninitialized = 0,
|
||||||
Idle = 1,
|
//! The server is initialized but there is no active network
|
||||||
//! The server is open to new connections
|
Idle = 1,
|
||||||
Open = 2,
|
//! The server is open to new connections
|
||||||
//! The server is distributing the DLP child to the clients
|
Open = 2,
|
||||||
DistributingInternal = 7,
|
//! The server is distributing the DLP child to the clients
|
||||||
//! The server has distributed the DLP child
|
DistributingInternal = 7,
|
||||||
Distributed = 8,
|
//! The server has distributed the DLP child
|
||||||
//! The server has finished distribution and clients are booted into the DLP child
|
Distributed = 8,
|
||||||
Finished = 9,
|
//! The server has finished distribution and clients are booted into the DLP child
|
||||||
//! The server failed to distribute the DLP child to the clients
|
Finished = 9,
|
||||||
Failed = 10,
|
//! The server failed to distribute the DLP child to the clients
|
||||||
//! Public value for internal states
|
Failed = 10,
|
||||||
Distributing = 11
|
//! Public value for internal states
|
||||||
};
|
Distributing = 11
|
||||||
WUT_CHECK_SIZE(ServerState, 0x4);
|
};
|
||||||
|
WUT_CHECK_SIZE(ServerState, 0x4);
|
||||||
|
|
||||||
class Server {
|
class Server
|
||||||
public:
|
{
|
||||||
/**
|
public:
|
||||||
* Accepts a client into the DLP child distribution.
|
/**
|
||||||
*
|
* Accepts a client into the DLP child distribution.
|
||||||
* \param nodeId
|
*
|
||||||
* The node ID of the client.
|
* \param nodeId
|
||||||
*/
|
* The node ID of the client.
|
||||||
static nn::Result
|
*/
|
||||||
AcceptClient(uint16_t nodeId) asm("AcceptClient__Q4_2nn3dlp4Cafe6ServerSFUs");
|
static nn::Result
|
||||||
|
AcceptClient(uint16_t nodeId)
|
||||||
|
asm("AcceptClient__Q4_2nn3dlp4Cafe6ServerSFUs");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the DLP session.
|
* Closes the DLP session.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
CloseSessions() asm("CloseSessions__Q4_2nn3dlp4Cafe6ServerSFv");
|
CloseSessions()
|
||||||
|
asm("CloseSessions__Q4_2nn3dlp4Cafe6ServerSFv");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disconnects a client from the DLP session. This cannot be done after starting distribution.
|
* Disconnects a client from the DLP session. This cannot be done after starting distribution.
|
||||||
*
|
*
|
||||||
* \param nodeId
|
* \param nodeId
|
||||||
* The node ID of the client.
|
* The node ID of the client.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
DisconnectClient(uint16_t nodeId) asm("DisconnectClient__Q4_2nn3dlp4Cafe6ServerSFUs");
|
DisconnectClient(uint16_t nodeId)
|
||||||
|
asm("DisconnectClient__Q4_2nn3dlp4Cafe6ServerSFUs");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finalizes DLP.
|
* Finalizes DLP.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
Finalize() asm("Finalize__Q4_2nn3dlp4Cafe6ServerSFv");
|
Finalize()
|
||||||
|
asm("Finalize__Q4_2nn3dlp4Cafe6ServerSFv");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets information about a client.
|
* Gets information about a client.
|
||||||
*
|
*
|
||||||
* \param clientInfo
|
* \param clientInfo
|
||||||
* Pointer where the client information is written.
|
* Pointer where the client information is written.
|
||||||
*
|
*
|
||||||
* \param nodeId
|
* \param nodeId
|
||||||
* Node ID of the client.
|
* Node ID of the client.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
GetClientInfo(nn::uds::Cafe::NodeInformation *clientInfo, uint16_t nodeId) asm("GetClientInfo__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3uds4Cafe15NodeInformationUs");
|
GetClientInfo(nn::uds::Cafe::NodeInformation *clientInfo, uint16_t nodeId)
|
||||||
|
asm("GetClientInfo__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3uds4Cafe15NodeInformationUs");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a client state.
|
* Gets a client state.
|
||||||
*
|
*
|
||||||
* \param state
|
* \param state
|
||||||
* Pointer where the client state is filled in.
|
* Pointer where the client state is filled in.
|
||||||
*
|
*
|
||||||
* \param nodeId
|
* \param nodeId
|
||||||
* Node ID of the client.
|
* Node ID of the client.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
GetClientState(ClientState *state, uint16_t nodeId) asm("GetClientState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ClientStateUs");
|
GetClientState(ClientState *state, uint16_t nodeId)
|
||||||
|
asm("GetClientState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ClientStateUs");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a client state.
|
* Gets a client state.
|
||||||
*
|
*
|
||||||
* \param state
|
* \param state
|
||||||
* Pointer where the client state is filled in.
|
* Pointer where the client state is filled in.
|
||||||
*
|
*
|
||||||
* \param unitsTotal
|
* \param unitsTotal
|
||||||
* Pointer filled with the total number of units being distributed.
|
* Pointer filled with the total number of units being distributed.
|
||||||
* Only filled when starting distribution and the DLP child isn't cached.
|
* Only filled when starting distribution and the DLP child isn't cached.
|
||||||
*
|
*
|
||||||
* \param unitsReceived
|
* \param unitsReceived
|
||||||
* Pointer filled with the number of units that the client has received.
|
* Pointer filled with the number of units that the client has received.
|
||||||
* Only filled when starting distribution and the DLP child isn't cached.
|
* Only filled when starting distribution and the DLP child isn't cached.
|
||||||
*
|
*
|
||||||
* \param nodeId
|
* \param nodeId
|
||||||
* Node ID of the client.
|
* Node ID of the client.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
GetClientState(ClientState *state,
|
GetClientState(ClientState *state,
|
||||||
uint32_t *unitsTotal,
|
uint32_t *unitsTotal,
|
||||||
uint32_t *unitsReceived,
|
uint32_t *unitsReceived,
|
||||||
uint16_t nodeId) asm("GetClientState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ClientStatePUiT2Us");
|
uint16_t nodeId)
|
||||||
|
asm("GetClientState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ClientStatePUiT2Us");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the clients that are connected to the DLP session.
|
* Gets the clients that are connected to the DLP session.
|
||||||
*
|
*
|
||||||
* \param receivedLength
|
* \param receivedLength
|
||||||
* Pointer where the number of clients written to the array is stored.
|
* Pointer where the number of clients written to the array is stored.
|
||||||
*
|
*
|
||||||
* \param connectingClients
|
* \param connectingClients
|
||||||
* Array where the node IDs of the clients are written.
|
* Array where the node IDs of the clients are written.
|
||||||
*
|
*
|
||||||
* \param length
|
* \param length
|
||||||
* Number of nodes that the \c connectingClients array can hold.
|
* Number of nodes that the \c connectingClients array can hold.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
GetConnectingClients(uint16_t *receivedLength,
|
GetConnectingClients(uint16_t *receivedLength,
|
||||||
uint16_t *connectingClients,
|
uint16_t *connectingClients,
|
||||||
uint16_t length) asm("GetConnectingClients__Q4_2nn3dlp4Cafe6ServerSFPUsT1Us");
|
uint16_t length)
|
||||||
|
asm("GetConnectingClients__Q4_2nn3dlp4Cafe6ServerSFPUsT1Us");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the server state. Internal states are filtered as \link Distributing \endlink .
|
* Gets the server state. Internal states are filtered as \link Distributing \endlink .
|
||||||
*
|
*
|
||||||
* \param state
|
* \param state
|
||||||
* Pointer where the server state is written.
|
* Pointer where the server state is written.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
GetState(ServerState *state) asm("GetState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ServerState");
|
GetState(ServerState *state)
|
||||||
|
asm("GetState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ServerState");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes DLP.
|
* Initializes DLP.
|
||||||
*
|
*
|
||||||
* \param maxClientNum
|
* \param maxClientNum
|
||||||
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
||||||
*
|
*
|
||||||
* \param uniqueId
|
* \param uniqueId
|
||||||
* Unique ID of the DLP child to be distributed.
|
* Unique ID of the DLP child to be distributed.
|
||||||
*
|
*
|
||||||
* \param childIndex
|
* \param childIndex
|
||||||
* Index of the DLP child to be distributed.
|
* Index of the DLP child to be distributed.
|
||||||
*
|
*
|
||||||
* \param userName
|
* \param userName
|
||||||
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
Initialize(uint8_t maxClientNum,
|
Initialize(uint8_t maxClientNum,
|
||||||
uint32_t uniqueId,
|
uint32_t uniqueId,
|
||||||
uint8_t childIndex,
|
uint8_t childIndex,
|
||||||
nn::cfg::CTR::UserName *userName) asm("Initialize__Q4_2nn3dlp4Cafe6ServerSFUcUiT1PQ4_2nn3cfg3CTR8UserName");
|
nn::cfg::CTR::UserName *userName)
|
||||||
|
asm("Initialize__Q4_2nn3dlp4Cafe6ServerSFUcUiT1PQ4_2nn3cfg3CTR8UserName");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes DLP.
|
* Initializes DLP.
|
||||||
*
|
*
|
||||||
* \param dupNoticeNeed
|
* \param dupNoticeNeed
|
||||||
* Unknown output bool, always false on the Wii U.
|
* Unknown output bool, always false on the Wii U.
|
||||||
*
|
*
|
||||||
* \param maxClientNum
|
* \param maxClientNum
|
||||||
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
||||||
*
|
*
|
||||||
* \param uniqueId
|
* \param uniqueId
|
||||||
* Unique ID of the DLP child to be distributed.
|
* Unique ID of the DLP child to be distributed.
|
||||||
*
|
*
|
||||||
* \param childIndex
|
* \param childIndex
|
||||||
* Index of the DLP child to be distributed.
|
* Index of the DLP child to be distributed.
|
||||||
*
|
*
|
||||||
* \param userName
|
* \param userName
|
||||||
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
Initialize(bool *dupNoticeNeed,
|
Initialize(bool *dupNoticeNeed,
|
||||||
uint8_t maxClientNum,
|
uint8_t maxClientNum,
|
||||||
uint32_t uniqueId,
|
uint32_t uniqueId,
|
||||||
uint8_t childIndex,
|
uint8_t childIndex,
|
||||||
nn::cfg::CTR::UserName *userName) asm("Initialize__Q4_2nn3dlp4Cafe6ServerSFPbUcUiT2PQ4_2nn3cfg3CTR8UserName");
|
nn::cfg::CTR::UserName *userName)
|
||||||
|
asm("Initialize__Q4_2nn3dlp4Cafe6ServerSFPbUcUiT2PQ4_2nn3cfg3CTR8UserName");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the DLP session.
|
* Opens the DLP session.
|
||||||
*
|
*
|
||||||
* \param isManualAccept
|
* \param isManualAccept
|
||||||
* If set, all clients must be accepted to allow them to join the session.
|
* If set, all clients must be accepted to allow them to join the session.
|
||||||
*
|
*
|
||||||
* \param channel
|
* \param channel
|
||||||
* The channel to be used for hosting the session. Use 0 to choose a channel automatically.
|
* The channel to be used for hosting the session. Use 0 to choose a channel automatically.
|
||||||
* Must be either 0, 1, 6 or 11.
|
* Must be either 0, 1, 6 or 11.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
OpenSessions(bool isManualAccept, uint8_t channel) asm("OpenSessions__Q4_2nn3dlp4Cafe6ServerSFbUc");
|
OpenSessions(bool isManualAccept, uint8_t channel)
|
||||||
|
asm("OpenSessions__Q4_2nn3dlp4Cafe6ServerSFbUc");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the server state chas changed, and waits until it changes if specified.
|
* Checks if the server state chas changed, and waits until it changes if specified.
|
||||||
*
|
*
|
||||||
* \param flags
|
* \param flags
|
||||||
* Flags, see \link PollStateChangeFlags \endlink for all flags.
|
* Flags, see \link PollStateChangeFlags \endlink for all flags.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
PollStateChange(uint8_t flags) asm("PollStateChange__Q4_2nn3dlp4Cafe6ServerSFUc");
|
PollStateChange(uint8_t flags)
|
||||||
|
asm("PollStateChange__Q4_2nn3dlp4Cafe6ServerSFUc");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reboots all clients into the Download Play child.
|
* Reboots all clients into the Download Play child.
|
||||||
*
|
*
|
||||||
* \param passPhrase
|
* \param passPhrase
|
||||||
* Passphrase to be used by the client when connecting to the main UDS network.
|
* 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.
|
* If \c NULL, it will be set to an empty string.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
RebootAllClients(const char *passPhrase) asm("RebootAllClients__Q4_2nn3dlp4Cafe6ServerSFPCc");
|
RebootAllClients(const char *passPhrase)
|
||||||
|
asm("RebootAllClients__Q4_2nn3dlp4Cafe6ServerSFPCc");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts distribution of the Download Play child.
|
* Starts distribution of the Download Play child.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
StartDistribution() asm("StartDistribute__Q4_2nn3dlp4Cafe6ServerSFv");
|
StartDistribution()
|
||||||
};
|
asm("StartDistribute__Q4_2nn3dlp4Cafe6ServerSFv");
|
||||||
|
};
|
||||||
|
|
||||||
class ServerPrivate {
|
class ServerPrivate
|
||||||
public:
|
{
|
||||||
/**
|
public:
|
||||||
* Gets the server state. Internal states are not filtered.
|
/**
|
||||||
*
|
* Gets the server state. Internal states are not filtered.
|
||||||
* \param state
|
*
|
||||||
* Pointer where the server state is written.
|
* \param state
|
||||||
*/
|
* Pointer where the server state is written.
|
||||||
static nn::Result
|
*/
|
||||||
GetInternalState(ServerState *state) asm("GetInternalState__Q4_2nn3dlp4Cafe13ServerPrivateSFPQ4_2nn3dlp4Cafe11ServerState");
|
static nn::Result
|
||||||
|
GetInternalState(ServerState *state)
|
||||||
|
asm("GetInternalState__Q4_2nn3dlp4Cafe13ServerPrivateSFPQ4_2nn3dlp4Cafe11ServerState");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes DLP.
|
* Initializes DLP.
|
||||||
*
|
*
|
||||||
* \param maxClientNum
|
* \param maxClientNum
|
||||||
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
||||||
*
|
*
|
||||||
* \param uniqueId
|
* \param uniqueId
|
||||||
* Unique ID of the DLP child to be distributed.
|
* Unique ID of the DLP child to be distributed.
|
||||||
*
|
*
|
||||||
* \param childIndex
|
* \param childIndex
|
||||||
* Index of the DLP child to be distributed.
|
* Index of the DLP child to be distributed.
|
||||||
*
|
*
|
||||||
* \param blockBufferSize
|
* \param blockBufferSize
|
||||||
* Unknown parameter (default: 0xC000). Must be bigger than 0x4000 and smaller than 0x80000 inclusively.
|
* Unknown parameter (default: 0xC000). Must be bigger than 0x4000 and smaller than 0x80000 inclusively.
|
||||||
*
|
*
|
||||||
* \param blockBufferNum
|
* \param blockBufferNum
|
||||||
* Unknown parameter (default: 2). Must be a number between 2 and 4 inclusively.
|
* Unknown parameter (default: 2). Must be a number between 2 and 4 inclusively.
|
||||||
*
|
*
|
||||||
* \param userName
|
* \param userName
|
||||||
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
Initialize(uint8_t maxClientNum,
|
Initialize(uint8_t maxClientNum,
|
||||||
uint32_t uniqueId,
|
uint32_t uniqueId,
|
||||||
uint8_t childIndex,
|
uint8_t childIndex,
|
||||||
uint32_t blockBufferSize,
|
uint32_t blockBufferSize,
|
||||||
uint32_t blockBufferNum,
|
uint32_t blockBufferNum,
|
||||||
nn::cfg::CTR::UserName *userName) asm("Initialize__Q4_2nn3dlp4Cafe13ServerPrivateSFUcUiT1N22PQ4_2nn3cfg3CTR8UserName");
|
nn::cfg::CTR::UserName *userName)
|
||||||
|
asm("Initialize__Q4_2nn3dlp4Cafe13ServerPrivateSFUcUiT1N22PQ4_2nn3cfg3CTR8UserName");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes DLP.
|
* Initializes DLP.
|
||||||
*
|
*
|
||||||
* \param dupNoticeNeed
|
* \param dupNoticeNeed
|
||||||
* Unknown output bool, always false on the Wii U.
|
* Unknown output bool, always false on the Wii U.
|
||||||
*
|
*
|
||||||
* \param maxClientNum
|
* \param maxClientNum
|
||||||
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
||||||
*
|
*
|
||||||
* \param uniqueId
|
* \param uniqueId
|
||||||
* Unique ID of the DLP child to be distributed.
|
* Unique ID of the DLP child to be distributed.
|
||||||
*
|
*
|
||||||
* \param childIndex
|
* \param childIndex
|
||||||
* Index of the DLP child to be distributed.
|
* Index of the DLP child to be distributed.
|
||||||
*
|
*
|
||||||
* \param blockBufferSize
|
* \param blockBufferSize
|
||||||
* Unknown parameter (default: 0xC000). Must be bigger than 0x4000 and smaller than 0x80000 inclusively.
|
* Unknown parameter (default: 0xC000). Must be bigger than 0x4000 and smaller than 0x80000 inclusively.
|
||||||
*
|
*
|
||||||
* \param blockBufferNum
|
* \param blockBufferNum
|
||||||
* Unknown parameter (default: 2). Must be a number between 2 and 4 inclusively.
|
* Unknown parameter (default: 2). Must be a number between 2 and 4 inclusively.
|
||||||
*
|
*
|
||||||
* \param userName
|
* \param userName
|
||||||
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
||||||
*/
|
*/
|
||||||
static nn::Result
|
static nn::Result
|
||||||
Initialize(bool *dupNoticeNeed,
|
Initialize(bool *dupNoticeNeed,
|
||||||
uint8_t maxClientNum,
|
uint8_t maxClientNum,
|
||||||
uint32_t uniqueId,
|
uint32_t uniqueId,
|
||||||
uint8_t childIndex,
|
uint8_t childIndex,
|
||||||
uint32_t blockBufferSize,
|
uint32_t blockBufferSize,
|
||||||
uint32_t blockBufferNum,
|
uint32_t blockBufferNum,
|
||||||
nn::cfg::CTR::UserName *userName) asm("Initialize__Q4_2nn3dlp4Cafe13ServerPrivateSFPbUcUiT2N23PQ4_2nn3cfg3CTR8UserName");
|
nn::cfg::CTR::UserName *userName)
|
||||||
};
|
asm("Initialize__Q4_2nn3dlp4Cafe13ServerPrivateSFPbUcUiT2N23PQ4_2nn3cfg3CTR8UserName");
|
||||||
|
};
|
||||||
} // namespace Cafe
|
} // namespace Cafe
|
||||||
|
|
||||||
} // namespace dlp
|
} // namespace dlp
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
#include <coreinit/filesystem.h>
|
#include <coreinit/filesystem.h>
|
||||||
#include <nn/result.h>
|
#include <nn/result.h>
|
||||||
#include <padscore/kpad.h>
|
#include <padscore/kpad.h>
|
||||||
#include <vpad/input.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <vpad/input.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup nn_erreula_erreula Error Viewer
|
* \defgroup nn_erreula_erreula Error Viewer
|
||||||
|
|
@ -24,19 +24,19 @@ namespace erreula
|
||||||
|
|
||||||
enum class ControllerType
|
enum class ControllerType
|
||||||
{
|
{
|
||||||
WiiRemote0 = 0,
|
WiiRemote0 = 0,
|
||||||
WiiRemote1 = 1,
|
WiiRemote1 = 1,
|
||||||
WiiRemote2 = 2,
|
WiiRemote2 = 2,
|
||||||
WiiRemote3 = 3,
|
WiiRemote3 = 3,
|
||||||
DrcGamepad = 4,
|
DrcGamepad = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class ErrorType
|
enum class ErrorType
|
||||||
{
|
{
|
||||||
Code = 0,
|
Code = 0,
|
||||||
Message = 1,
|
Message = 1,
|
||||||
Message1Button = 2,
|
Message1Button = 2,
|
||||||
Message2Button = 3,
|
Message2Button = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class LangType
|
enum class LangType
|
||||||
|
|
@ -58,20 +58,20 @@ enum class LangType
|
||||||
|
|
||||||
enum class RegionType
|
enum class RegionType
|
||||||
{
|
{
|
||||||
Japan = 0,
|
Japan = 0,
|
||||||
USA = 1,
|
USA = 1,
|
||||||
Europe = 2,
|
Europe = 2,
|
||||||
China = 3,
|
China = 3,
|
||||||
Korea = 4,
|
Korea = 4,
|
||||||
Taiwan = 5,
|
Taiwan = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class ResultType
|
enum class ResultType
|
||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
|
|
||||||
//! The user exited the error viewer
|
//! The user exited the error viewer
|
||||||
Exited = 1,
|
Exited = 1,
|
||||||
|
|
||||||
// TODO: More result types
|
// TODO: More result types
|
||||||
};
|
};
|
||||||
|
|
@ -79,28 +79,28 @@ enum class ResultType
|
||||||
enum class RenderTarget
|
enum class RenderTarget
|
||||||
{
|
{
|
||||||
//! Render only to TV
|
//! Render only to TV
|
||||||
Tv = 0,
|
Tv = 0,
|
||||||
|
|
||||||
//! Render only to DRC gamepad
|
//! Render only to DRC gamepad
|
||||||
Drc = 1,
|
Drc = 1,
|
||||||
|
|
||||||
//! Render to both TV and Gamepad
|
//! Render to both TV and Gamepad
|
||||||
Both = 2,
|
Both = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class State
|
enum class State
|
||||||
{
|
{
|
||||||
//! The error viewer is completely hidden.
|
//! The error viewer is completely hidden.
|
||||||
Hidden = 0,
|
Hidden = 0,
|
||||||
|
|
||||||
//! The error viewer is drawing the fade-in animation.
|
//! The error viewer is drawing the fade-in animation.
|
||||||
FadeIn = 1,
|
FadeIn = 1,
|
||||||
|
|
||||||
//! The error viewer is done drawing the fade in animation and completely visible.
|
//! The error viewer is done drawing the fade in animation and completely visible.
|
||||||
Visible = 2,
|
Visible = 2,
|
||||||
|
|
||||||
//! The error viewer is drawing the fade-out animation.
|
//! The error viewer is drawing the fade-out animation.
|
||||||
FadeOut = 3,
|
FadeOut = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ErrorArg
|
struct ErrorArg
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,15 @@ extern "C" {
|
||||||
|
|
||||||
// https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/nn/ffl/nn_ffl_miidata.h
|
// 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_WII_U = 0x1 | 0x4,
|
||||||
FFL_CREATE_ID_FLAG_TEMPORARY = 0x2,
|
FFL_CREATE_ID_FLAG_TEMPORARY = 0x2,
|
||||||
FFL_CREATE_ID_FLAG_NORMAL = 0x8,
|
FFL_CREATE_ID_FLAG_NORMAL = 0x8,
|
||||||
} FFLCreateIDFlags;
|
} FFLCreateIDFlags;
|
||||||
|
|
||||||
typedef struct WUT_PACKED FFLCreateID {
|
typedef struct WUT_PACKED FFLCreateID
|
||||||
|
{
|
||||||
FFLCreateIDFlags flags : 4;
|
FFLCreateIDFlags flags : 4;
|
||||||
|
|
||||||
uint32_t timestamp : 28;
|
uint32_t timestamp : 28;
|
||||||
|
|
@ -31,7 +33,8 @@ WUT_CHECK_OFFSET(FFLCreateID, 4, deviceHash);
|
||||||
WUT_CHECK_SIZE(FFLCreateID, 10);
|
WUT_CHECK_SIZE(FFLCreateID, 10);
|
||||||
|
|
||||||
//Note: the endian may be wrong here
|
//Note: the endian may be wrong here
|
||||||
typedef struct WUT_PACKED FFLiMiiDataCore {
|
typedef struct WUT_PACKED FFLiMiiDataCore
|
||||||
|
{
|
||||||
// 0x00
|
// 0x00
|
||||||
uint8_t birth_platform : 4;
|
uint8_t birth_platform : 4;
|
||||||
uint8_t unk_0x00_b4 : 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_OFFSET(FFLiMiiDataCore, 0x33, hair_type);
|
||||||
WUT_CHECK_SIZE(FFLiMiiDataCore, 0x48);
|
WUT_CHECK_SIZE(FFLiMiiDataCore, 0x48);
|
||||||
|
|
||||||
typedef struct WUT_PACKED FFLiMiiDataOfficial {
|
typedef struct WUT_PACKED FFLiMiiDataOfficial
|
||||||
|
{
|
||||||
FFLiMiiDataCore core;
|
FFLiMiiDataCore core;
|
||||||
uint16_t creator_name[10];
|
uint16_t creator_name[10];
|
||||||
} FFLiMiiDataOfficial;
|
} FFLiMiiDataOfficial;
|
||||||
WUT_CHECK_OFFSET(FFLiMiiDataOfficial, 0x48, creator_name);
|
WUT_CHECK_OFFSET(FFLiMiiDataOfficial, 0x48, creator_name);
|
||||||
WUT_CHECK_SIZE(FFLiMiiDataOfficial, 0x5C);
|
WUT_CHECK_SIZE(FFLiMiiDataOfficial, 0x5C);
|
||||||
|
|
||||||
typedef struct WUT_PACKED FFLStoreData {
|
typedef struct WUT_PACKED FFLStoreData
|
||||||
|
{
|
||||||
FFLiMiiDataOfficial data;
|
FFLiMiiDataOfficial data;
|
||||||
uint16_t unk_0x5C;
|
uint16_t unk_0x5C;
|
||||||
uint16_t checksum;
|
uint16_t checksum;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include <nn/result.h>
|
|
||||||
#include <nn/ffl/miidata.h>
|
|
||||||
#include <nn/act.h>
|
#include <nn/act.h>
|
||||||
|
#include <nn/ffl/miidata.h>
|
||||||
|
#include <nn/result.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup nn_fp_fp Friends Presence
|
* \defgroup nn_fp_fp Friends Presence
|
||||||
|
|
@ -22,36 +22,36 @@ namespace fp
|
||||||
|
|
||||||
enum NotificationType
|
enum NotificationType
|
||||||
{
|
{
|
||||||
NOTIFICATION_ONLINE = 1,
|
NOTIFICATION_ONLINE = 1,
|
||||||
NOTIFICATION_OFFLINE = 2,
|
NOTIFICATION_OFFLINE = 2,
|
||||||
NOTIFICATION_PREFERENCE = 3,
|
NOTIFICATION_PREFERENCE = 3,
|
||||||
NOTIFICATION_FRIEND_ONLINE = 4,
|
NOTIFICATION_FRIEND_ONLINE = 4,
|
||||||
NOTIFICATION_FRIEND_OFFLINE = 5,
|
NOTIFICATION_FRIEND_OFFLINE = 5,
|
||||||
NOTIFICATION_FRIEND_PRESENCE = 6,
|
NOTIFICATION_FRIEND_PRESENCE = 6,
|
||||||
NOTIFICATION_FRIEND_MII = 7,
|
NOTIFICATION_FRIEND_MII = 7,
|
||||||
NOTIFICATION_FRIEND_PROFILE = 8,
|
NOTIFICATION_FRIEND_PROFILE = 8,
|
||||||
NOTIFICATION_FRIEND_ADDED = 9,
|
NOTIFICATION_FRIEND_ADDED = 9,
|
||||||
NOTIFICATION_FRIEND_REMOVED = 10,
|
NOTIFICATION_FRIEND_REMOVED = 10,
|
||||||
NOTIFICATION_MY_REQUEST_ADDED = 11,
|
NOTIFICATION_MY_REQUEST_ADDED = 11,
|
||||||
NOTIFICATION_MY_REQUEST_REMOVED = 12,
|
NOTIFICATION_MY_REQUEST_REMOVED = 12,
|
||||||
NOTIFICATION_MY_REQUEST_UPDATED = 13,
|
NOTIFICATION_MY_REQUEST_UPDATED = 13,
|
||||||
NOTIFICATION_BLACKLIST_ADDED = 14,
|
NOTIFICATION_BLACKLIST_ADDED = 14,
|
||||||
NOTIFICATION_BLACKLIST_REMOVED = 15,
|
NOTIFICATION_BLACKLIST_REMOVED = 15,
|
||||||
NOTIFICATION_BLACKLIST_UPDATED = 16,
|
NOTIFICATION_BLACKLIST_UPDATED = 16,
|
||||||
NOTIFICATION_REQUEST_ADDED = 17,
|
NOTIFICATION_REQUEST_ADDED = 17,
|
||||||
NOTIFICATION_REQUEST_REMOVED = 18,
|
NOTIFICATION_REQUEST_REMOVED = 18,
|
||||||
|
|
||||||
//! TODO: find all notification types
|
//! TODO: find all notification types
|
||||||
};
|
};
|
||||||
struct DateTime
|
struct DateTime
|
||||||
{
|
{
|
||||||
uint16_t year;
|
uint16_t year;
|
||||||
uint8_t month;
|
uint8_t month;
|
||||||
uint8_t day;
|
uint8_t day;
|
||||||
uint8_t hour; // hour-1
|
uint8_t hour; // hour-1
|
||||||
uint8_t minutes;
|
uint8_t minutes;
|
||||||
uint8_t seconds; // unsure
|
uint8_t seconds; // unsure
|
||||||
uint8_t milliseconds; // unsure
|
uint8_t milliseconds; // unsure
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(DateTime, 0x00, year);
|
WUT_CHECK_OFFSET(DateTime, 0x00, year);
|
||||||
WUT_CHECK_OFFSET(DateTime, 0x02, month);
|
WUT_CHECK_OFFSET(DateTime, 0x02, month);
|
||||||
|
|
@ -64,19 +64,19 @@ WUT_CHECK_SIZE(DateTime, 0x08);
|
||||||
|
|
||||||
struct GameKey
|
struct GameKey
|
||||||
{
|
{
|
||||||
uint64_t titleId;
|
uint64_t titleId;
|
||||||
uint16_t unk_0x8;
|
uint16_t unk_0x8;
|
||||||
uint32_t unk_0xC;
|
uint32_t unk_0xC;
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(GameKey, 0x00, titleId);
|
WUT_CHECK_OFFSET(GameKey, 0x00, titleId);
|
||||||
WUT_CHECK_SIZE(GameKey, 0x10);
|
WUT_CHECK_SIZE(GameKey, 0x10);
|
||||||
|
|
||||||
struct RecentPlayRecord
|
struct RecentPlayRecord
|
||||||
{
|
{
|
||||||
nn::act::PrincipalId principalId;
|
nn::act::PrincipalId principalId;
|
||||||
uint16_t unk_0x04;
|
uint16_t unk_0x04;
|
||||||
char16_t inGameName[nn::act::AccountIdSize];
|
char16_t inGameName[nn::act::AccountIdSize];
|
||||||
char16_t myMiiName[nn::act::AccountIdSize];
|
char16_t myMiiName[nn::act::AccountIdSize];
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(RecentPlayRecord, 0x00, principalId);
|
WUT_CHECK_OFFSET(RecentPlayRecord, 0x00, principalId);
|
||||||
WUT_CHECK_OFFSET(RecentPlayRecord, 0x04, unk_0x04);
|
WUT_CHECK_OFFSET(RecentPlayRecord, 0x04, unk_0x04);
|
||||||
|
|
@ -86,9 +86,9 @@ WUT_CHECK_SIZE(RecentPlayRecord, 0x4C);
|
||||||
|
|
||||||
struct RecentPlayRecordEx
|
struct RecentPlayRecordEx
|
||||||
{
|
{
|
||||||
RecentPlayRecord playRecord;
|
RecentPlayRecord playRecord;
|
||||||
GameKey game;
|
GameKey game;
|
||||||
DateTime date;
|
DateTime date;
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(RecentPlayRecordEx, 0x00, playRecord);
|
WUT_CHECK_OFFSET(RecentPlayRecordEx, 0x00, playRecord);
|
||||||
WUT_CHECK_OFFSET(RecentPlayRecordEx, 0x50, game);
|
WUT_CHECK_OFFSET(RecentPlayRecordEx, 0x50, game);
|
||||||
|
|
@ -97,23 +97,23 @@ WUT_CHECK_SIZE(RecentPlayRecordEx, 0x68);
|
||||||
|
|
||||||
struct Preference
|
struct Preference
|
||||||
{
|
{
|
||||||
bool unk_0x00;
|
bool unk_0x00;
|
||||||
bool unk_0x01;
|
bool unk_0x01;
|
||||||
bool unk_0x02;
|
bool unk_0x02;
|
||||||
WUT_PADDING_BYTES(1);
|
WUT_PADDING_BYTES(1);
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(Preference, 0x04);
|
WUT_CHECK_SIZE(Preference, 0x04);
|
||||||
|
|
||||||
struct GameMode
|
struct GameMode
|
||||||
{
|
{
|
||||||
BOOL joinAvailabilityFlag;
|
BOOL joinAvailabilityFlag;
|
||||||
uint32_t matchmakeSystemType; // 2 ??
|
uint32_t matchmakeSystemType; // 2 ??
|
||||||
uint32_t joinGameId;
|
uint32_t joinGameId;
|
||||||
uint32_t joinGameMode;
|
uint32_t joinGameMode;
|
||||||
//! only set when joinAvailabilityFlag is TRUE
|
//! only set when joinAvailabilityFlag is TRUE
|
||||||
nn::act::PrincipalId ownerPrincipalId;
|
nn::act::PrincipalId ownerPrincipalId;
|
||||||
uint32_t joinGroupId;
|
uint32_t joinGroupId;
|
||||||
uint8_t applicationArg[0x14];
|
uint8_t applicationArg[0x14];
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(GameMode, 0x00, joinAvailabilityFlag);
|
WUT_CHECK_OFFSET(GameMode, 0x00, joinAvailabilityFlag);
|
||||||
WUT_CHECK_OFFSET(GameMode, 0x04, matchmakeSystemType);
|
WUT_CHECK_OFFSET(GameMode, 0x04, matchmakeSystemType);
|
||||||
|
|
@ -126,10 +126,10 @@ WUT_CHECK_SIZE(GameMode, 0x2C);
|
||||||
|
|
||||||
struct Presence
|
struct Presence
|
||||||
{
|
{
|
||||||
GameMode gameMode;
|
GameMode gameMode;
|
||||||
uint8_t region;
|
uint8_t region;
|
||||||
uint8_t language;
|
uint8_t language;
|
||||||
uint8_t platform;
|
uint8_t platform;
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(Presence, 0x00, gameMode);
|
WUT_CHECK_OFFSET(Presence, 0x00, gameMode);
|
||||||
WUT_CHECK_OFFSET(Presence, 0x2C, region);
|
WUT_CHECK_OFFSET(Presence, 0x2C, region);
|
||||||
|
|
@ -139,8 +139,8 @@ WUT_CHECK_SIZE(Presence, 0x30);
|
||||||
|
|
||||||
struct FriendPresence : Presence
|
struct FriendPresence : Presence
|
||||||
{
|
{
|
||||||
bool isOnline;
|
bool isOnline;
|
||||||
bool isValid;
|
bool isValid;
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(FriendPresence, 0x30, isOnline);
|
WUT_CHECK_OFFSET(FriendPresence, 0x30, isOnline);
|
||||||
WUT_CHECK_OFFSET(FriendPresence, 0x31, isValid);
|
WUT_CHECK_OFFSET(FriendPresence, 0x31, isValid);
|
||||||
|
|
@ -148,7 +148,7 @@ WUT_CHECK_SIZE(FriendPresence, 0x34);
|
||||||
|
|
||||||
struct MyPresence : Presence
|
struct MyPresence : Presence
|
||||||
{
|
{
|
||||||
char16_t presenceText[64];
|
char16_t presenceText[64];
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(MyPresence, 0x30, presenceText);
|
WUT_CHECK_OFFSET(MyPresence, 0x30, presenceText);
|
||||||
WUT_CHECK_SIZE(MyPresence, 0xB0);
|
WUT_CHECK_SIZE(MyPresence, 0xB0);
|
||||||
|
|
@ -156,29 +156,29 @@ WUT_CHECK_SIZE(MyPresence, 0xB0);
|
||||||
//! TODO: find member types and names
|
//! TODO: find member types and names
|
||||||
struct BasicInfo
|
struct BasicInfo
|
||||||
{
|
{
|
||||||
WUT_UNKNOWN_BYTES(0x68);
|
WUT_UNKNOWN_BYTES(0x68);
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(BasicInfo, 0x68);
|
WUT_CHECK_SIZE(BasicInfo, 0x68);
|
||||||
|
|
||||||
//! TODO: find member types and names
|
//! TODO: find member types and names
|
||||||
struct BlackListedPrincipal
|
struct BlackListedPrincipal
|
||||||
{
|
{
|
||||||
WUT_UNKNOWN_BYTES(0xB0);
|
WUT_UNKNOWN_BYTES(0xB0);
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(BlackListedPrincipal, 0xB0);
|
WUT_CHECK_SIZE(BlackListedPrincipal, 0xB0);
|
||||||
|
|
||||||
//! TODO: find member types and names
|
//! TODO: find member types and names
|
||||||
struct Profile
|
struct Profile
|
||||||
{
|
{
|
||||||
WUT_UNKNOWN_BYTES(4);
|
WUT_UNKNOWN_BYTES(4);
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(Profile, 0x04);
|
WUT_CHECK_SIZE(Profile, 0x04);
|
||||||
|
|
||||||
struct Comment
|
struct Comment
|
||||||
{
|
{
|
||||||
uint8_t unk_0x00; // probably bool isVisible
|
uint8_t unk_0x00; // probably bool isVisible
|
||||||
uint8_t unk_0x01; // probably bool
|
uint8_t unk_0x01; // probably bool
|
||||||
char16_t comment[17];
|
char16_t comment[17];
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(Comment, 0x00, unk_0x00);
|
WUT_CHECK_OFFSET(Comment, 0x00, unk_0x00);
|
||||||
WUT_CHECK_OFFSET(Comment, 0x01, unk_0x01);
|
WUT_CHECK_OFFSET(Comment, 0x01, unk_0x01);
|
||||||
|
|
@ -187,487 +187,487 @@ WUT_CHECK_SIZE(Comment, 0x24);
|
||||||
|
|
||||||
struct FriendData
|
struct FriendData
|
||||||
{
|
{
|
||||||
/*! TODO: find types and names */
|
/*! TODO: find types and names */
|
||||||
WUT_UNKNOWN_BYTES(0x228);
|
WUT_UNKNOWN_BYTES(0x228);
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(FriendData, 0x228);
|
WUT_CHECK_SIZE(FriendData, 0x228);
|
||||||
|
|
||||||
struct GameModeDescription
|
struct GameModeDescription
|
||||||
{
|
{
|
||||||
/*! TODO: find size and member types/names */
|
/*! TODO: find size and member types/names */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FriendRequest
|
struct FriendRequest
|
||||||
{
|
{
|
||||||
/* Notes:
|
/* Notes:
|
||||||
* MaxCharsOnKBD = char16_t[63]
|
* MaxCharsOnKBD = char16_t[63]
|
||||||
* Real Buffer prolly = char16_t[64]
|
* Real Buffer prolly = char16_t[64]
|
||||||
**/
|
**/
|
||||||
WUT_UNKNOWN_BYTES(0x164);
|
WUT_UNKNOWN_BYTES(0x164);
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(FriendRequest, 0x164);
|
WUT_CHECK_SIZE(FriendRequest, 0x164);
|
||||||
|
|
||||||
typedef void(*FPAsyncCallback)(nn::Result, void *);
|
typedef void (*FPAsyncCallback)(nn::Result, void *);
|
||||||
typedef void(*NotificationHandlerFn)(nn::fp::NotificationType, nn::act::PrincipalId, void *);
|
typedef void (*NotificationHandlerFn)(nn::fp::NotificationType, nn::act::PrincipalId, void *);
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
AcceptFriendRequestAsync(nn::act::LocalFriendCode/*unsure*/, FPAsyncCallback, void *)
|
AcceptFriendRequestAsync(nn::act::LocalFriendCode /*unsure*/, FPAsyncCallback, void *)
|
||||||
asm("AcceptFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
|
asm("AcceptFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
AddBlackListAsync(nn::act::PrincipalId, nn::fp::GameKey *, FPAsyncCallback, void *)
|
AddBlackListAsync(nn::act::PrincipalId, nn::fp::GameKey *, FPAsyncCallback, void *)
|
||||||
asm("AddBlackListAsync__Q2_2nn2fpFUiPCQ3_2nn2fp7GameKeyPFQ2_2nn6ResultPv_vPv");
|
asm("AddBlackListAsync__Q2_2nn2fpFUiPCQ3_2nn2fp7GameKeyPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
AddBlackListAsync(nn::act::PrincipalId, FPAsyncCallback, void *)
|
AddBlackListAsync(nn::act::PrincipalId, FPAsyncCallback, void *)
|
||||||
asm("AddBlackListAsync__Q2_2nn2fpFUiPFQ2_2nn6ResultPv_vPv");
|
asm("AddBlackListAsync__Q2_2nn2fpFUiPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
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");
|
asm("AddFriendAsync__Q2_2nn2fpFPCcPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
AddFriendAsync(nn::act::PrincipalId /*unsure*/, FPAsyncCallback, void *)
|
AddFriendAsync(nn::act::PrincipalId /*unsure*/, FPAsyncCallback, void *)
|
||||||
asm("AddFriendAsync__Q2_2nn2fpFUiPFQ2_2nn6ResultPv_vPv");
|
asm("AddFriendAsync__Q2_2nn2fpFUiPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
AddFriendRequestAsync(const nn::fp::RecentPlayRecordEx *, const char16_t *, FPAsyncCallback, void *)
|
AddFriendRequestAsync(const nn::fp::RecentPlayRecordEx *, const char16_t *, FPAsyncCallback, void *)
|
||||||
asm("AddFriendRequestAsync__Q2_2nn2fpFPCQ3_2nn2fp18RecentPlayRecordExPCwPFQ2_2nn6ResultPv_vPv");
|
asm("AddFriendRequestAsync__Q2_2nn2fpFPCQ3_2nn2fp18RecentPlayRecordExPCwPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
AddFriendRequestAsync(unsigned int, unsigned char, const char16_t *, unsigned char, const char16_t *, FPAsyncCallback, void *)
|
AddFriendRequestAsync(unsigned int, unsigned char, const char16_t *, unsigned char, const char16_t *, FPAsyncCallback, void *)
|
||||||
asm("AddFriendRequestAsync__Q2_2nn2fpFUiUcPCwT2T3PFQ2_2nn6ResultPv_vPv");
|
asm("AddFriendRequestAsync__Q2_2nn2fpFUiUcPCwT2T3PFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
AddFriendRequestNoTitleAsync(unsigned int, unsigned char, const char16_t *, unsigned char, const char16_t *, FPAsyncCallback, void *)
|
AddFriendRequestNoTitleAsync(unsigned int, unsigned char, const char16_t *, unsigned char, const char16_t *, FPAsyncCallback, void *)
|
||||||
asm("AddFriendRequestNoTitleAsync__Q2_2nn2fpFUiUcPCwT2T3PFQ2_2nn6ResultPv_vPv");
|
asm("AddFriendRequestNoTitleAsync__Q2_2nn2fpFUiUcPCwT2T3PFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
AddRecentPlayRecordEx(const nn::fp::RecentPlayRecordEx *, unsigned int)
|
AddRecentPlayRecordEx(const nn::fp::RecentPlayRecordEx *, unsigned int)
|
||||||
asm("AddRecentPlayRecordEx__Q2_2nn2fpFPCQ3_2nn2fp18RecentPlayRecordExUi");
|
asm("AddRecentPlayRecordEx__Q2_2nn2fpFPCQ3_2nn2fp18RecentPlayRecordExUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
AddRecentPlayRecord(const nn::fp::RecentPlayRecord *, unsigned int)
|
AddRecentPlayRecord(const nn::fp::RecentPlayRecord *, unsigned int)
|
||||||
asm("AddRecentPlayRecord__Q2_2nn2fpFPCQ3_2nn2fp16RecentPlayRecordUi");
|
asm("AddRecentPlayRecord__Q2_2nn2fpFPCQ3_2nn2fp16RecentPlayRecordUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
CancelFriendRequestAsync(nn::act::LocalFriendCode/*unsure*/, FPAsyncCallback, void *)
|
CancelFriendRequestAsync(nn::act::LocalFriendCode /*unsure*/, FPAsyncCallback, void *)
|
||||||
asm("CancelFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
|
asm("CancelFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
CheckSettingStatusAsync(unsigned char *, FPAsyncCallback, void *)
|
CheckSettingStatusAsync(unsigned char *, FPAsyncCallback, void *)
|
||||||
asm("CheckSettingStatusAsync__Q2_2nn2fpFPUcPFQ2_2nn6ResultPv_vPv");
|
asm("CheckSettingStatusAsync__Q2_2nn2fpFPUcPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
ClearLedEvent(void)
|
ClearLedEvent(void)
|
||||||
asm("ClearLedEvent__Q2_2nn2fpFv");
|
asm("ClearLedEvent__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
DeleteFriendFlagsAsync(const unsigned int *, unsigned int, unsigned int, FPAsyncCallback, void *)
|
DeleteFriendFlagsAsync(const unsigned int *, unsigned int, unsigned int, FPAsyncCallback, void *)
|
||||||
asm("DeleteFriendFlagsAsync__Q2_2nn2fpFPCUiUiT2PFQ2_2nn6ResultPv_vPv");
|
asm("DeleteFriendFlagsAsync__Q2_2nn2fpFPCUiUiT2PFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
DeleteFriendRequestAsync(nn::act::LocalFriendCode/*unsure*/, FPAsyncCallback, void *)
|
DeleteFriendRequestAsync(nn::act::LocalFriendCode /*unsure*/, FPAsyncCallback, void *)
|
||||||
asm("DeleteFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
|
asm("DeleteFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
DeleteRecentPlayRecordAll(void)
|
DeleteRecentPlayRecordAll(void)
|
||||||
asm("DeleteRecentPlayRecordAll__Q2_2nn2fpFv");
|
asm("DeleteRecentPlayRecordAll__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
DeleteSaveDirectory(unsigned int)
|
DeleteSaveDirectory(unsigned int)
|
||||||
asm("DeleteSaveDirectory__Q2_2nn2fpFUi");
|
asm("DeleteSaveDirectory__Q2_2nn2fpFUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
DenyFriendRequestAsync(nn::act::LocalFriendCode/*unsure*/, FPAsyncCallback, void *)
|
DenyFriendRequestAsync(nn::act::LocalFriendCode /*unsure*/, FPAsyncCallback, void *)
|
||||||
asm("DenyFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
|
asm("DenyFriendRequestAsync__Q2_2nn2fpFULPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
DetectNatPropertiesAsync(unsigned char *, unsigned char *, unsigned int *, FPAsyncCallback, void *)
|
DetectNatPropertiesAsync(unsigned char *, unsigned char *, unsigned int *, FPAsyncCallback, void *)
|
||||||
asm("DetectNatPropertiesAsync__Q2_2nn2fpFPUcT1PUiPFQ2_2nn6ResultPv_vPv");
|
asm("DetectNatPropertiesAsync__Q2_2nn2fpFPUcT1PUiPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
FinalizeAdmin(void)
|
FinalizeAdmin(void)
|
||||||
asm("FinalizeAdmin__Q2_2nn2fpFv");
|
asm("FinalizeAdmin__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
Finalize(void)
|
Finalize(void)
|
||||||
asm("Finalize__Q2_2nn2fpFv");
|
asm("Finalize__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetBasicInfoAsync(nn::fp::BasicInfo *, unsigned int *, unsigned int, FPAsyncCallback, void *)
|
GetBasicInfoAsync(nn::fp::BasicInfo *, unsigned int *, unsigned int, FPAsyncCallback, void *)
|
||||||
asm("GetBasicInfoAsync__Q2_2nn2fpFPQ3_2nn2fp9BasicInfoPCUiUiPFQ2_2nn6ResultPv_vPv");
|
asm("GetBasicInfoAsync__Q2_2nn2fpFPQ3_2nn2fp9BasicInfoPCUiUiPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetBlackListAccountId(char *outAccountIds, unsigned int *, unsigned int)
|
GetBlackListAccountId(char *outAccountIds, unsigned int *, unsigned int)
|
||||||
asm("GetBlackListAccountId__Q2_2nn2fpFPA17_cPCUiUi");
|
asm("GetBlackListAccountId__Q2_2nn2fpFPA17_cPCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetBlackListAdditionalTime(nn::fp::DateTime *, unsigned int *, unsigned int)
|
GetBlackListAdditionalTime(nn::fp::DateTime *, unsigned int *, unsigned int)
|
||||||
asm("GetBlackListAdditionalTime__Q2_2nn2fpFPQ3_2nn2fp8DateTimePCUiUi");
|
asm("GetBlackListAdditionalTime__Q2_2nn2fpFPQ3_2nn2fp8DateTimePCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetBlackListEx(nn::fp::BlackListedPrincipal *outBlackList, unsigned int *, unsigned int)
|
GetBlackListEx(nn::fp::BlackListedPrincipal *outBlackList, unsigned int *, unsigned int)
|
||||||
asm("GetBlackListEx__Q2_2nn2fpFPQ3_2nn2fp20BlackListedPrincipalPCUiUi");
|
asm("GetBlackListEx__Q2_2nn2fpFPQ3_2nn2fp20BlackListedPrincipalPCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
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");
|
asm("GetBlackList__Q2_2nn2fpFPUiT1UiT3");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendAccountId(char *outAccountIdBuffer, nn::act::PrincipalId *principalBuffer, unsigned int accountIdBufferSize)
|
GetFriendAccountId(char *outAccountIdBuffer, nn::act::PrincipalId *principalBuffer, unsigned int accountIdBufferSize)
|
||||||
asm("GetFriendAccountId__Q2_2nn2fpFPA17_cPCUiUi");
|
asm("GetFriendAccountId__Q2_2nn2fpFPA17_cPCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendApprovalTime(nn::fp::DateTime *outDateTime, unsigned int *, unsigned int)
|
GetFriendApprovalTime(nn::fp::DateTime *outDateTime, unsigned int *, unsigned int)
|
||||||
asm("GetFriendApprovalTime__Q2_2nn2fpFPQ3_2nn2fp8DateTimePCUiUi");
|
asm("GetFriendApprovalTime__Q2_2nn2fpFPQ3_2nn2fp8DateTimePCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendComment(nn::fp::Comment *outComment, unsigned int *, unsigned int)
|
GetFriendComment(nn::fp::Comment *outComment, unsigned int *, unsigned int)
|
||||||
asm("GetFriendComment__Q2_2nn2fpFPQ3_2nn2fp7CommentPCUiUi");
|
asm("GetFriendComment__Q2_2nn2fpFPQ3_2nn2fp7CommentPCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendListAll(unsigned int *, unsigned int *, unsigned int, unsigned int)
|
GetFriendListAll(unsigned int *, unsigned int *, unsigned int, unsigned int)
|
||||||
asm("GetFriendListAll__Q2_2nn2fpFPUiT1UiT3");
|
asm("GetFriendListAll__Q2_2nn2fpFPUiT1UiT3");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendListEx(nn::fp::FriendData *outFriendData, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
GetFriendListEx(nn::fp::FriendData *outFriendData, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
||||||
asm("GetFriendListEx__Q2_2nn2fpFPQ3_2nn2fp10FriendDataPCUiUi");
|
asm("GetFriendListEx__Q2_2nn2fpFPQ3_2nn2fp10FriendDataPCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
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");
|
asm("GetFriendList__Q2_2nn2fpFPUiT1UiT3");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendMii(FFLStoreData *outMiiData, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
GetFriendMii(FFLStoreData *outMiiData, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
||||||
asm("GetFriendMii__Q2_2nn2fpFP12FFLStoreDataPCUiUi");
|
asm("GetFriendMii__Q2_2nn2fpFP12FFLStoreDataPCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendPlayingGame(nn::fp::GameKey *outGameKey, nn::fp::GameModeDescription *outGameModeDescription, nn::act::PrincipalId *principalBuffer, unsigned int maxReadCount)
|
GetFriendPlayingGame(nn::fp::GameKey *outGameKey, nn::fp::GameModeDescription *outGameModeDescription, nn::act::PrincipalId *principalBuffer, unsigned int maxReadCount)
|
||||||
asm("GetFriendPlayingGame__Q2_2nn2fpFPQ3_2nn2fp7GameKeyPQ3_2nn2fp19GameModeDescriptionPCUiUi");
|
asm("GetFriendPlayingGame__Q2_2nn2fpFPQ3_2nn2fp7GameKeyPQ3_2nn2fp19GameModeDescriptionPCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendPresenceEx(nn::fp::FriendPresence *, nn::act::PrincipalId *principalBuffer, unsigned int maxReadCount)
|
GetFriendPresenceEx(nn::fp::FriendPresence *, nn::act::PrincipalId *principalBuffer, unsigned int maxReadCount)
|
||||||
asm("GetFriendPresenceEx__Q2_2nn2fpFPQ3_2nn2fp14FriendPresencePCUiUi");
|
asm("GetFriendPresenceEx__Q2_2nn2fpFPQ3_2nn2fp14FriendPresencePCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendPresence(nn::fp::FriendPresence *, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
GetFriendPresence(nn::fp::FriendPresence *, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
||||||
asm("GetFriendPresence__Q2_2nn2fpFPQ3_2nn2fp14FriendPresencePCUiUi");
|
asm("GetFriendPresence__Q2_2nn2fpFPQ3_2nn2fp14FriendPresencePCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendProfile(nn::fp::Profile *, nn::act::PrincipalId *principalBuffer, unsigned int readCount)
|
GetFriendProfile(nn::fp::Profile *, nn::act::PrincipalId *principalBuffer, unsigned int readCount)
|
||||||
asm("GetFriendProfile__Q2_2nn2fpFPQ3_2nn2fp7ProfilePCUiUi");
|
asm("GetFriendProfile__Q2_2nn2fpFPQ3_2nn2fp7ProfilePCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendRelationship(uint8_t *outRelationshipNum, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
GetFriendRelationship(uint8_t *outRelationshipNum, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
||||||
asm("GetFriendRelationship__Q2_2nn2fpFPUcPCUiUi");
|
asm("GetFriendRelationship__Q2_2nn2fpFPUcPCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendRequestAccountId(char *outAccountIds, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
GetFriendRequestAccountId(char *outAccountIds, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
||||||
asm("GetFriendRequestAccountId__Q2_2nn2fpFPA17_cPCUiUi");
|
asm("GetFriendRequestAccountId__Q2_2nn2fpFPA17_cPCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendRequestListEx(nn::fp::FriendRequest *, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
GetFriendRequestListEx(nn::fp::FriendRequest *, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
||||||
asm("GetFriendRequestListEx__Q2_2nn2fpFPQ3_2nn2fp13FriendRequestPCUiUi");
|
asm("GetFriendRequestListEx__Q2_2nn2fpFPQ3_2nn2fp13FriendRequestPCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
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");
|
asm("GetFriendRequestList__Q2_2nn2fpFPUiT1UiT3");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendRequestMessageId(unsigned long long *outMessageIds, unsigned int *, unsigned int)
|
GetFriendRequestMessageId(unsigned long long *outMessageIds, unsigned int *, unsigned int)
|
||||||
asm("GetFriendRequestMessageId__Q2_2nn2fpFPULPCUiUi");
|
asm("GetFriendRequestMessageId__Q2_2nn2fpFPULPCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendScreenName(char16_t outScreenName[nn::act::MiiNameSize], unsigned int *, unsigned int, bool, unsigned char *)
|
GetFriendScreenName(char16_t outScreenName[nn::act::MiiNameSize], unsigned int *, unsigned int, bool, unsigned char *)
|
||||||
asm("GetFriendScreenName__Q2_2nn2fpFPA11_wPCUiUibPUc");
|
asm("GetFriendScreenName__Q2_2nn2fpFPA11_wPCUiUibPUc");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetFriendSortTime(nn::fp::DateTime *, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
GetFriendSortTime(nn::fp::DateTime *, nn::act::PrincipalId *principalBuffer, unsigned int count)
|
||||||
asm("GetFriendSortTime__Q2_2nn2fpFPQ3_2nn2fp8DateTimePCUiUi");
|
asm("GetFriendSortTime__Q2_2nn2fpFPQ3_2nn2fp8DateTimePCUiUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetLastLedEvent(unsigned int *, unsigned int *)
|
GetLastLedEvent(unsigned int *, unsigned int *)
|
||||||
asm("GetLastLedEvent__Q2_2nn2fpFPUiT1");
|
asm("GetLastLedEvent__Q2_2nn2fpFPUiT1");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetMyAccountId(char *outAccountId)
|
GetMyAccountId(char *outAccountId)
|
||||||
asm("GetMyAccountId__Q2_2nn2fpFPc");
|
asm("GetMyAccountId__Q2_2nn2fpFPc");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetMyComment(nn::fp::Comment *outComment)
|
GetMyComment(nn::fp::Comment *outComment)
|
||||||
asm("GetMyComment__Q2_2nn2fpFPQ3_2nn2fp7Comment");
|
asm("GetMyComment__Q2_2nn2fpFPQ3_2nn2fp7Comment");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetMyMii(FFLStoreData *outMiiData)
|
GetMyMii(FFLStoreData *outMiiData)
|
||||||
asm("GetMyMii__Q2_2nn2fpFP12FFLStoreData");
|
asm("GetMyMii__Q2_2nn2fpFP12FFLStoreData");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetMyPlayingGame(nn::fp::GameKey *outPlayingGmae)
|
GetMyPlayingGame(nn::fp::GameKey *outPlayingGmae)
|
||||||
asm("GetMyPlayingGame__Q2_2nn2fpFPQ3_2nn2fp7GameKey");
|
asm("GetMyPlayingGame__Q2_2nn2fpFPQ3_2nn2fp7GameKey");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetMyPreference(nn::fp::Preference *outPreference)
|
GetMyPreference(nn::fp::Preference *outPreference)
|
||||||
asm("GetMyPreference__Q2_2nn2fpFPQ3_2nn2fp10Preference");
|
asm("GetMyPreference__Q2_2nn2fpFPQ3_2nn2fp10Preference");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetMyPresence(nn::fp::MyPresence *outMyPresence)
|
GetMyPresence(nn::fp::MyPresence *outMyPresence)
|
||||||
asm("GetMyPresence__Q2_2nn2fpFPQ3_2nn2fp10MyPresence");
|
asm("GetMyPresence__Q2_2nn2fpFPQ3_2nn2fp10MyPresence");
|
||||||
|
|
||||||
|
|
||||||
nn::act::PrincipalId
|
nn::act::PrincipalId
|
||||||
GetMyPrincipalId(void)
|
GetMyPrincipalId(void)
|
||||||
asm("GetMyPrincipalId__Q2_2nn2fpFv");
|
asm("GetMyPrincipalId__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetMyProfile(nn::fp::Profile *outProfile)
|
GetMyProfile(nn::fp::Profile *outProfile)
|
||||||
asm("GetMyProfile__Q2_2nn2fpFPQ3_2nn2fp7Profile");
|
asm("GetMyProfile__Q2_2nn2fpFPQ3_2nn2fp7Profile");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetMyScreenName(char16_t *outScreenName)
|
GetMyScreenName(char16_t *outScreenName)
|
||||||
asm("GetMyScreenName__Q2_2nn2fpFPw");
|
asm("GetMyScreenName__Q2_2nn2fpFPw");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetRecentPlayRecord(nn::fp::RecentPlayRecordEx *outPlayRecordBuffer, unsigned int *outPlayRecordBufferSize, unsigned int, unsigned int maxReadCount)
|
GetRecentPlayRecord(nn::fp::RecentPlayRecordEx *outPlayRecordBuffer, unsigned int *outPlayRecordBufferSize, unsigned int, unsigned int maxReadCount)
|
||||||
asm("GetRecentPlayRecord__Q2_2nn2fpFPQ3_2nn2fp18RecentPlayRecordExPUiUiT3");
|
asm("GetRecentPlayRecord__Q2_2nn2fpFPQ3_2nn2fp18RecentPlayRecordExPUiUiT3");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
GetRequestBlockSettingAsync(unsigned char *, unsigned int *, unsigned int, FPAsyncCallback, void *)
|
GetRequestBlockSettingAsync(unsigned char *, unsigned int *, unsigned int, FPAsyncCallback, void *)
|
||||||
asm("GetRequestBlockSettingAsync__Q2_2nn2fpFPUcPCUiUiPFQ2_2nn6ResultPv_vPv");
|
asm("GetRequestBlockSettingAsync__Q2_2nn2fpFPUcPCUiUiPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
HasLoggedIn(void)
|
HasLoggedIn(void)
|
||||||
asm("HasLoggedIn__Q2_2nn2fpFv");
|
asm("HasLoggedIn__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
InitializeAdmin(void)
|
InitializeAdmin(void)
|
||||||
asm("InitializeAdmin__Q2_2nn2fpFv");
|
asm("InitializeAdmin__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
Initialize(void)
|
Initialize(void)
|
||||||
asm("Initialize__Q2_2nn2fpFv");
|
asm("Initialize__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsFriendRequestAllowed(void)
|
IsFriendRequestAllowed(void)
|
||||||
asm("IsFriendRequestAllowed__Q2_2nn2fpFv");
|
asm("IsFriendRequestAllowed__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsInitializedAdmin(void)
|
IsInitializedAdmin(void)
|
||||||
asm("IsInitializedAdmin__Q2_2nn2fpFv");
|
asm("IsInitializedAdmin__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsInitialized(void)
|
IsInitialized(void)
|
||||||
asm("IsInitialized__Q2_2nn2fpFv");
|
asm("IsInitialized__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
bool
|
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");
|
asm("IsInvitation__Q2_2nn2fpFPCQ3_2nn2fp8GameModeUiT2");
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsJoinableForFriendListViewer(nn::fp::FriendPresence *, unsigned int, unsigned long long)
|
IsJoinableForFriendListViewer(nn::fp::FriendPresence *, unsigned int, unsigned long long)
|
||||||
asm("IsJoinableForFriendListViewer__Q2_2nn2fpFPCQ3_2nn2fp14FriendPresenceUiUL");
|
asm("IsJoinableForFriendListViewer__Q2_2nn2fpFPCQ3_2nn2fp14FriendPresenceUiUL");
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsJoinableForFriendListViewer(nn::fp::Presence *, unsigned int, unsigned long long)
|
IsJoinableForFriendListViewer(nn::fp::Presence *, unsigned int, unsigned long long)
|
||||||
asm("IsJoinableForFriendListViewer__Q2_2nn2fpFPCQ3_2nn2fp8PresenceUiUL");
|
asm("IsJoinableForFriendListViewer__Q2_2nn2fpFPCQ3_2nn2fp8PresenceUiUL");
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsJoinable(nn::fp::FriendPresence *, unsigned long long)
|
IsJoinable(nn::fp::FriendPresence *, unsigned long long)
|
||||||
asm("IsJoinable__Q2_2nn2fpFPCQ3_2nn2fp14FriendPresenceUL");
|
asm("IsJoinable__Q2_2nn2fpFPCQ3_2nn2fp14FriendPresenceUL");
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsOnline(void)
|
IsOnline(void)
|
||||||
asm("IsOnline__Q2_2nn2fpFv");
|
asm("IsOnline__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsPreferenceValid(void)
|
IsPreferenceValid(void)
|
||||||
asm("IsPreferenceValid__Q2_2nn2fpFv");
|
asm("IsPreferenceValid__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsRecentPlayRecordCorrupted(void)
|
IsRecentPlayRecordCorrupted(void)
|
||||||
asm("IsRecentPlayRecordCorrupted__Q2_2nn2fpFv");
|
asm("IsRecentPlayRecordCorrupted__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsRequestBlockForced(void)
|
IsRequestBlockForced(void)
|
||||||
asm("IsRequestBlockForced__Q2_2nn2fpFv");
|
asm("IsRequestBlockForced__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
LoginAsync(FPAsyncCallback, void *)
|
LoginAsync(FPAsyncCallback, void *)
|
||||||
asm("LoginAsync__Q2_2nn2fpFPFQ2_2nn6ResultPv_vPv");
|
asm("LoginAsync__Q2_2nn2fpFPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
Logout(void)
|
Logout(void)
|
||||||
asm("Logout__Q2_2nn2fpFv");
|
asm("Logout__Q2_2nn2fpFv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
MarkFriendRequestsAsReceivedAsync(unsigned long long *, unsigned int, FPAsyncCallback, void *)
|
MarkFriendRequestsAsReceivedAsync(unsigned long long *, unsigned int, FPAsyncCallback, void *)
|
||||||
asm("MarkFriendRequestsAsReceivedAsync__Q2_2nn2fpFPCULUiPFQ2_2nn6ResultPv_vPv");
|
asm("MarkFriendRequestsAsReceivedAsync__Q2_2nn2fpFPCULUiPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
RegisterAccountAsync(FPAsyncCallback, void *)
|
RegisterAccountAsync(FPAsyncCallback, void *)
|
||||||
asm("RegisterAccountAsync__Q2_2nn2fpFPFQ2_2nn6ResultPv_vPv");
|
asm("RegisterAccountAsync__Q2_2nn2fpFPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
RemoveBlackListAsync(unsigned int, FPAsyncCallback, void *)
|
RemoveBlackListAsync(unsigned int, FPAsyncCallback, void *)
|
||||||
asm("RemoveBlackListAsync__Q2_2nn2fpFUiPFQ2_2nn6ResultPv_vPv");
|
asm("RemoveBlackListAsync__Q2_2nn2fpFUiPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
RemoveFriendAsync(unsigned int, FPAsyncCallback, void *)
|
RemoveFriendAsync(unsigned int, FPAsyncCallback, void *)
|
||||||
asm("RemoveFriendAsync__Q2_2nn2fpFUiPFQ2_2nn6ResultPv_vPv");
|
asm("RemoveFriendAsync__Q2_2nn2fpFUiPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
ResultToErrorCode(nn::Result)
|
ResultToErrorCode(nn::Result)
|
||||||
asm("ResultToErrorCode__Q2_2nn2fpFQ2_2nn6Result");
|
asm("ResultToErrorCode__Q2_2nn2fpFQ2_2nn6Result");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
SetInvitationParameter(nn::fp::GameMode *, unsigned int *, unsigned int, bool)
|
SetInvitationParameter(nn::fp::GameMode *, unsigned int *, unsigned int, bool)
|
||||||
asm("SetInvitationParameter__Q2_2nn2fpFPQ3_2nn2fp8GameModePCUiUib");
|
asm("SetInvitationParameter__Q2_2nn2fpFPQ3_2nn2fp8GameModePCUiUib");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
SetLedEventMask(uint32_t)
|
SetLedEventMask(uint32_t)
|
||||||
asm("SetLedEventMask__Q2_2nn2fpFUi");
|
asm("SetLedEventMask__Q2_2nn2fpFUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
SetNotificationHandler(uint32_t /*notificationFlags = 1 << NotificationType */, NotificationHandlerFn, void *)
|
SetNotificationHandler(uint32_t /*notificationFlags = 1 << NotificationType */, NotificationHandlerFn, void *)
|
||||||
asm("SetNotificationHandler__Q2_2nn2fpFUiPFQ3_2nn2fp16NotificationTypeUiPv_vPv");
|
asm("SetNotificationHandler__Q2_2nn2fpFUiPFQ3_2nn2fp16NotificationTypeUiPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UnlockParentalControlTemporarily(const char pinCode[5])
|
UnlockParentalControlTemporarily(const char pinCode[5])
|
||||||
asm("UnlockParentalControlTemporarily__Q2_2nn2fpFPCc");
|
asm("UnlockParentalControlTemporarily__Q2_2nn2fpFPCc");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UpdateCommentAsync(const char16_t *, FPAsyncCallback, void *)
|
UpdateCommentAsync(const char16_t *, FPAsyncCallback, void *)
|
||||||
asm("UpdateCommentAsync__Q2_2nn2fpFPCwPFQ2_2nn6ResultPv_vPv");
|
asm("UpdateCommentAsync__Q2_2nn2fpFPCwPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UpdateGameModeDescription(const char16_t *description)
|
UpdateGameModeDescription(const char16_t *description)
|
||||||
asm("UpdateGameModeDescription__Q2_2nn2fpFPCw");
|
asm("UpdateGameModeDescription__Q2_2nn2fpFPCw");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UpdateGameModeEx(nn::fp::GameMode *, const char16_t *)
|
UpdateGameModeEx(nn::fp::GameMode *, const char16_t *)
|
||||||
asm("UpdateGameModeEx__Q2_2nn2fpFPCQ3_2nn2fp8GameModePCw");
|
asm("UpdateGameModeEx__Q2_2nn2fpFPCQ3_2nn2fp8GameModePCw");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UpdateGameModeForOverlayApplication(nn::fp::GameMode *, const char16_t *)
|
UpdateGameModeForOverlayApplication(nn::fp::GameMode *, const char16_t *)
|
||||||
asm("UpdateGameModeForOverlayApplication__Q2_2nn2fpFPCQ3_2nn2fp8GameModePCw");
|
asm("UpdateGameModeForOverlayApplication__Q2_2nn2fpFPCQ3_2nn2fp8GameModePCw");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UpdateGameMode(nn::fp::GameMode *, const char16_t *)
|
UpdateGameMode(nn::fp::GameMode *, const char16_t *)
|
||||||
asm("UpdateGameMode__Q2_2nn2fpFPCQ3_2nn2fp8GameModePCw");
|
asm("UpdateGameMode__Q2_2nn2fpFPCQ3_2nn2fp8GameModePCw");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UpdateGameMode(nn::fp::GameMode *, const char16_t *, unsigned int)
|
UpdateGameMode(nn::fp::GameMode *, const char16_t *, unsigned int)
|
||||||
asm("UpdateGameMode__Q2_2nn2fpFPCQ3_2nn2fp8GameModePCwUi");
|
asm("UpdateGameMode__Q2_2nn2fpFPCQ3_2nn2fp8GameModePCwUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UpdateMiiAsync(FFLStoreData *, char16_t *, FPAsyncCallback, void *)
|
UpdateMiiAsync(FFLStoreData *, char16_t *, FPAsyncCallback, void *)
|
||||||
asm("UpdateMiiAsync__Q2_2nn2fpFPC12FFLStoreDataPCwPFQ2_2nn6ResultPv_vPv");
|
asm("UpdateMiiAsync__Q2_2nn2fpFPC12FFLStoreDataPCwPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UpdateMiiAsync(FFLStoreData *miiData, FPAsyncCallback, void *)
|
UpdateMiiAsync(FFLStoreData *miiData, FPAsyncCallback, void *)
|
||||||
asm("UpdateMiiAsync__Q2_2nn2fpFPC12FFLStoreDataPFQ2_2nn6ResultPv_vPv");
|
asm("UpdateMiiAsync__Q2_2nn2fpFPC12FFLStoreDataPFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UpdatePlayingGame(nn::fp::GameKey *, unsigned int)
|
UpdatePlayingGame(nn::fp::GameKey *, unsigned int)
|
||||||
asm("UpdatePlayingGame__Q2_2nn2fpFPCQ3_2nn2fp7GameKeyUi");
|
asm("UpdatePlayingGame__Q2_2nn2fpFPCQ3_2nn2fp7GameKeyUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UpdatePlayingOverlayApplication(nn::fp::GameKey *, unsigned int)
|
UpdatePlayingOverlayApplication(nn::fp::GameKey *, unsigned int)
|
||||||
asm("UpdatePlayingOverlayApplication__Q2_2nn2fpFPCQ3_2nn2fp7GameKeyUi");
|
asm("UpdatePlayingOverlayApplication__Q2_2nn2fpFPCQ3_2nn2fp7GameKeyUi");
|
||||||
|
|
||||||
|
|
||||||
nn::Result
|
nn::Result
|
||||||
UpdatePreferenceAsync(nn::fp::Preference *, FPAsyncCallback, void *)
|
UpdatePreferenceAsync(nn::fp::Preference *, FPAsyncCallback, void *)
|
||||||
asm("UpdatePreferenceAsync__Q2_2nn2fpFPCQ3_2nn2fp10PreferencePFQ2_2nn6ResultPv_vPv");
|
asm("UpdatePreferenceAsync__Q2_2nn2fpFPCQ3_2nn2fp10PreferencePFQ2_2nn6ResultPv_vPv");
|
||||||
|
|
||||||
} // namespace fp
|
} // namespace fp
|
||||||
} // namespace nn
|
} // namespace nn
|
||||||
|
|
|
||||||
|
|
@ -13,17 +13,17 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! The minimum value of the stick axis
|
//! The minimum value of the stick axis
|
||||||
#define HPAD_STICK_AXIS_MIN -56
|
#define HPAD_STICK_AXIS_MIN -56
|
||||||
//! The maximum value of the stick axis
|
//! The maximum value of the stick axis
|
||||||
#define HPAD_STICK_AXIS_MAX 56
|
#define HPAD_STICK_AXIS_MAX 56
|
||||||
//! The minimum value of the substick axis
|
//! The minimum value of the substick axis
|
||||||
#define HPAD_SUBSTICK_AXIS_MIN -44
|
#define HPAD_SUBSTICK_AXIS_MIN -44
|
||||||
//! The maximum value of the substick axis
|
//! The maximum value of the substick axis
|
||||||
#define HPAD_SUBSTICK_AXIS_MAX 44
|
#define HPAD_SUBSTICK_AXIS_MAX 44
|
||||||
//! The minimum value of the trigger
|
//! The minimum value of the trigger
|
||||||
#define HPAD_TRIGGER_MIN 0
|
#define HPAD_TRIGGER_MIN 0
|
||||||
//! The maximum value of the trigger
|
//! The maximum value of the trigger
|
||||||
#define HPAD_TRIGGER_MAX 150
|
#define HPAD_TRIGGER_MAX 150
|
||||||
|
|
||||||
typedef struct HPADStatus HPADStatus;
|
typedef struct HPADStatus HPADStatus;
|
||||||
typedef struct HPADGGGGStatus HPADGGGGStatus;
|
typedef struct HPADGGGGStatus HPADGGGGStatus;
|
||||||
|
|
@ -50,18 +50,18 @@ typedef enum HPADGGGGChan
|
||||||
|
|
||||||
typedef enum HPADButtons
|
typedef enum HPADButtons
|
||||||
{
|
{
|
||||||
HPAD_BUTTON_A = 0x0001,
|
HPAD_BUTTON_A = 0x0001,
|
||||||
HPAD_BUTTON_B = 0x0002,
|
HPAD_BUTTON_B = 0x0002,
|
||||||
HPAD_BUTTON_X = 0x0004,
|
HPAD_BUTTON_X = 0x0004,
|
||||||
HPAD_BUTTON_Y = 0x0008,
|
HPAD_BUTTON_Y = 0x0008,
|
||||||
HPAD_BUTTON_LEFT = 0x0010,
|
HPAD_BUTTON_LEFT = 0x0010,
|
||||||
HPAD_BUTTON_RIGHT = 0x0020,
|
HPAD_BUTTON_RIGHT = 0x0020,
|
||||||
HPAD_BUTTON_DOWN = 0x0040,
|
HPAD_BUTTON_DOWN = 0x0040,
|
||||||
HPAD_BUTTON_UP = 0x0080,
|
HPAD_BUTTON_UP = 0x0080,
|
||||||
HPAD_BUTTON_START = 0x0100,
|
HPAD_BUTTON_START = 0x0100,
|
||||||
HPAD_TRIGGER_Z = 0x0200,
|
HPAD_TRIGGER_Z = 0x0200,
|
||||||
HPAD_TRIGGER_R = 0x0400,
|
HPAD_TRIGGER_R = 0x0400,
|
||||||
HPAD_TRIGGER_L = 0x0800,
|
HPAD_TRIGGER_L = 0x0800,
|
||||||
|
|
||||||
HPAD_STICK_EMULATION_LEFT = 0x00001000,
|
HPAD_STICK_EMULATION_LEFT = 0x00001000,
|
||||||
HPAD_STICK_EMULATION_RIGHT = 0x00002000,
|
HPAD_STICK_EMULATION_RIGHT = 0x00002000,
|
||||||
|
|
@ -176,10 +176,12 @@ HPADShutdown(void);
|
||||||
* \return
|
* \return
|
||||||
* The amount of buffers read or a negative value on error.
|
* The amount of buffers read or a negative value on error.
|
||||||
*/
|
*/
|
||||||
|
// clang-format off
|
||||||
int32_t
|
int32_t
|
||||||
RPLWRAP(HPADRead)(HPADChan chan,
|
RPLWRAP(HPADRead)(HPADChan chan,
|
||||||
HPADStatus *buffers,
|
HPADStatus *buffers,
|
||||||
int32_t count);
|
int32_t count);
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads status buffers from a specified HPAD channel.
|
* Reads status buffers from a specified HPAD channel.
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,5 @@
|
||||||
* \defgroup nn_idb nn_idb
|
* \defgroup nn_idb nn_idb
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <nn/idb/idb_cpp.h>
|
|
||||||
#include <nn/idb/IDBReader.h>
|
#include <nn/idb/IDBReader.h>
|
||||||
|
#include <nn/idb/idb_cpp.h>
|
||||||
|
|
|
||||||
|
|
@ -57,11 +57,13 @@ somemopt(SOMemOptRequest request,
|
||||||
uint32_t size,
|
uint32_t size,
|
||||||
SOMemOptFlags flags);
|
SOMemOptFlags flags);
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
int
|
int
|
||||||
RPLWRAP(somemopt)(SOMemOptRequest request,
|
RPLWRAP(somemopt)(SOMemOptRequest request,
|
||||||
void *buffer,
|
void *buffer,
|
||||||
uint32_t size,
|
uint32_t size,
|
||||||
SOMemOptFlags flags);
|
SOMemOptFlags flags);
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,5 @@
|
||||||
* Nintendo Figurine (amiibo) Platform library.
|
* Nintendo Figurine (amiibo) Platform library.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <nn/nfp/nfp_cpp.h>
|
|
||||||
#include <nn/nfp/amiibo_settings_cpp.h>
|
#include <nn/nfp/amiibo_settings_cpp.h>
|
||||||
|
#include <nn/nfp/nfp_cpp.h>
|
||||||
|
|
|
||||||
|
|
@ -12,18 +12,20 @@
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn {
|
namespace nn
|
||||||
|
{
|
||||||
|
|
||||||
namespace nfp {
|
namespace nfp
|
||||||
|
{
|
||||||
|
|
||||||
enum class AmiiboSettingsMode : uint32_t
|
enum class AmiiboSettingsMode : uint32_t
|
||||||
{
|
{
|
||||||
//! Open the Mii and Name register menu
|
//! Open the Mii and Name register menu
|
||||||
Register = 0,
|
Register = 0,
|
||||||
//! Open the "Delete Game Data" menu
|
//! Open the "Delete Game Data" menu
|
||||||
DeleteGameData = 1,
|
DeleteGameData = 1,
|
||||||
//! Open the "Restore" menu
|
//! Open the "Restore" menu
|
||||||
Restore = 2,
|
Restore = 2,
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(AmiiboSettingsMode, 0x4);
|
WUT_CHECK_SIZE(AmiiboSettingsMode, 0x4);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include <nn/result.h>
|
|
||||||
#include <nn/ffl/miidata.h>
|
|
||||||
#include <coreinit/event.h>
|
#include <coreinit/event.h>
|
||||||
#include <nfc/nfc.h>
|
#include <nfc/nfc.h>
|
||||||
|
#include <nn/ffl/miidata.h>
|
||||||
|
#include <nn/result.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup nn_nfp
|
* \defgroup nn_nfp
|
||||||
|
|
@ -14,61 +14,63 @@
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn {
|
namespace nn
|
||||||
|
{
|
||||||
|
|
||||||
namespace nfp {
|
namespace nfp
|
||||||
|
{
|
||||||
|
|
||||||
//! NN_NFP result descriptions for \link nn::Result::GetDescription \endlink.
|
//! NN_NFP result descriptions for \link nn::Result::GetDescription \endlink.
|
||||||
enum ResultDescription
|
enum ResultDescription
|
||||||
{
|
{
|
||||||
// Usage results
|
// Usage results
|
||||||
RESULT_OUT_OF_RANGE = 0x03700,
|
RESULT_OUT_OF_RANGE = 0x03700,
|
||||||
RESULT_INVALID_PARAM = 0x03780,
|
RESULT_INVALID_PARAM = 0x03780,
|
||||||
RESULT_INVALID_ALIGNMENT = 0x03800,
|
RESULT_INVALID_ALIGNMENT = 0x03800,
|
||||||
|
|
||||||
// Status results
|
// Status results
|
||||||
RESULT_INVALID_STATE = 0x06400,
|
RESULT_INVALID_STATE = 0x06400,
|
||||||
RESULT_INVALID_TAG = 0x0c800,
|
RESULT_INVALID_TAG = 0x0c800,
|
||||||
RESULT_INVALID_TAG_INFO = 0x0ca80,
|
RESULT_INVALID_TAG_INFO = 0x0ca80,
|
||||||
RESULT_NO_BACKUPENTRY = 0x0e580,
|
RESULT_NO_BACKUPENTRY = 0x0e580,
|
||||||
RESULT_NO_REGISTER_INFO = 0x10900,
|
RESULT_NO_REGISTER_INFO = 0x10900,
|
||||||
RESULT_APP_AREA_MISSING = 0x10400,
|
RESULT_APP_AREA_MISSING = 0x10400,
|
||||||
RESULT_APP_AREA_TAGID_MISMATCH = 0x11d00,
|
RESULT_APP_AREA_TAGID_MISMATCH = 0x11d00,
|
||||||
RESULT_APP_AREA_ALREADY_EXISTS = 0x10e00,
|
RESULT_APP_AREA_ALREADY_EXISTS = 0x10e00,
|
||||||
RESULT_APP_AREA_ACCESS_ID_MISMATCH = 0x11300,
|
RESULT_APP_AREA_ACCESS_ID_MISMATCH = 0x11300,
|
||||||
RESULT_NO_BACKUP_SAVEDATA = 0x38880,
|
RESULT_NO_BACKUP_SAVEDATA = 0x38880,
|
||||||
RESULT_SYSTEM_ERROR = 0x3e880,
|
RESULT_SYSTEM_ERROR = 0x3e880,
|
||||||
|
|
||||||
// Fatal results
|
// Fatal results
|
||||||
RESULT_FATAL = 0x5db00,
|
RESULT_FATAL = 0x5db00,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class NfpState : uint32_t
|
enum class NfpState : uint32_t
|
||||||
{
|
{
|
||||||
//! nn_nfp is uninitialized
|
//! nn_nfp is uninitialized
|
||||||
Uninitialized = 0,
|
Uninitialized = 0,
|
||||||
//! nn_nfp has been initialized
|
//! nn_nfp has been initialized
|
||||||
Initialized = 1,
|
Initialized = 1,
|
||||||
//! Searching for a tag
|
//! Searching for a tag
|
||||||
Searching = 2,
|
Searching = 2,
|
||||||
//! A tag has been found
|
//! A tag has been found
|
||||||
Found = 3,
|
Found = 3,
|
||||||
//! Tag was removed
|
//! Tag was removed
|
||||||
Removed = 4,
|
Removed = 4,
|
||||||
//! The tag is mounted
|
//! The tag is mounted
|
||||||
Mounted = 5,
|
Mounted = 5,
|
||||||
Unknown6 = 6,
|
Unknown6 = 6,
|
||||||
//! The tag was mounted in ROM mode
|
//! The tag was mounted in ROM mode
|
||||||
MountedROM = 7,
|
MountedROM = 7,
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(NfpState, 0x4);
|
WUT_CHECK_SIZE(NfpState, 0x4);
|
||||||
|
|
||||||
enum class AdminFlags : uint8_t
|
enum class AdminFlags : uint8_t
|
||||||
{
|
{
|
||||||
//! The tag was registered and contains register info
|
//! The tag was registered and contains register info
|
||||||
IsRegistered = 1 << 0,
|
IsRegistered = 1 << 0,
|
||||||
//! The tag contains an application area
|
//! The tag contains an application area
|
||||||
HasApplicationData = 1 << 1,
|
HasApplicationData = 1 << 1,
|
||||||
};
|
};
|
||||||
WUT_CHECK_SIZE(AdminFlags, 0x1);
|
WUT_CHECK_SIZE(AdminFlags, 0x1);
|
||||||
|
|
||||||
|
|
@ -101,7 +103,7 @@ struct ApplicationAreaCreateInfo
|
||||||
//! The access ID with which the area should be created
|
//! The access ID with which the area should be created
|
||||||
uint32_t accessID;
|
uint32_t accessID;
|
||||||
//! The initial data to write to the area
|
//! The initial data to write to the area
|
||||||
void* data;
|
void *data;
|
||||||
//! The size of the data
|
//! The size of the data
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
//! reserved bytes, must be set to 0
|
//! reserved bytes, must be set to 0
|
||||||
|
|
|
||||||
|
|
@ -10,19 +10,21 @@
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn {
|
namespace nn
|
||||||
|
{
|
||||||
|
|
||||||
namespace pdm {
|
namespace pdm
|
||||||
|
{
|
||||||
|
|
||||||
//! Flags for PlayDiary
|
//! Flags for PlayDiary
|
||||||
typedef enum PlayDiaryFlags : uint16_t
|
typedef enum PlayDiaryFlags : uint16_t
|
||||||
{
|
{
|
||||||
PLAYDIARY_FLAG_DEFAULT = 0x0000,
|
PLAYDIARY_FLAG_DEFAULT = 0x0000,
|
||||||
|
|
||||||
//! Set when the user played in Wii Mode
|
//! Set when the user played in Wii Mode
|
||||||
//! Note: Title Id should be ffff ffff ffff ffff when set
|
//! Note: Title Id should be ffff ffff ffff ffff when set
|
||||||
PLAYDIARY_FLAG_PLAYED_IN_WII_MODE = 0x0100,
|
PLAYDIARY_FLAG_PLAYED_IN_WII_MODE = 0x0100,
|
||||||
PLAYDIARY_FLAG_UNKNOWN_0A00 = 0x0a00
|
PLAYDIARY_FLAG_UNKNOWN_0A00 = 0x0a00
|
||||||
} PlayDiaryFlags;
|
} PlayDiaryFlags;
|
||||||
WUT_CHECK_SIZE(PlayDiaryFlags, 0x02);
|
WUT_CHECK_SIZE(PlayDiaryFlags, 0x02);
|
||||||
|
|
||||||
|
|
@ -54,11 +56,11 @@ struct WUT_PACKED PlayStats
|
||||||
uint16_t times_played;
|
uint16_t times_played;
|
||||||
//! Date when the title was first played in days since 01/01/2000
|
//! Date when the title was first played in days since 01/01/2000
|
||||||
uint16_t first_time_played;
|
uint16_t first_time_played;
|
||||||
//! Date when the title was last played in days since 01/01/2000
|
//! Date when the title was last played in days since 01/01/2000
|
||||||
uint16_t last_time_played;
|
uint16_t last_time_played;
|
||||||
|
|
||||||
//! Unknown seems to be always 0x0000
|
//! Unknown seems to be always 0x0000
|
||||||
WUT_UNKNOWN_BYTES(2);
|
WUT_UNKNOWN_BYTES(2);
|
||||||
};
|
};
|
||||||
WUT_CHECK_OFFSET(PlayStats, 0x00, title_id);
|
WUT_CHECK_OFFSET(PlayStats, 0x00, title_id);
|
||||||
WUT_CHECK_OFFSET(PlayStats, 0x08, playtime);
|
WUT_CHECK_OFFSET(PlayStats, 0x08, playtime);
|
||||||
|
|
@ -89,21 +91,21 @@ WUT_CHECK_OFFSET(PlayLog, 0x00, title_id);
|
||||||
* \return
|
* \return
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
Initialize()
|
Initialize()
|
||||||
asm("Initialize__Q2_2nn3pdmFv");
|
asm("Initialize__Q2_2nn3pdmFv");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finalize PDM.
|
* Finalize PDM.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
Finalize()
|
Finalize()
|
||||||
asm("Finalize__Q2_2nn3pdmFv");
|
asm("Finalize__Q2_2nn3pdmFv");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close all opened PDM Files.
|
* Close all opened PDM Files.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
CloseAllFiles()
|
CloseAllFiles()
|
||||||
asm("CloseAllFiles__Q2_2nn3pdmFv");
|
asm("CloseAllFiles__Q2_2nn3pdmFv");
|
||||||
|
|
||||||
|
|
@ -123,7 +125,7 @@ Convert(uint32_t userId)
|
||||||
* \return
|
* \return
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
WaitForConvertDone()
|
WaitForConvertDone()
|
||||||
asm("WaitForConvertDone__Q2_2nn3pdmFv");
|
asm("WaitForConvertDone__Q2_2nn3pdmFv");
|
||||||
|
|
||||||
|
|
@ -138,7 +140,7 @@ WaitForConvertDone()
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
GetPlayDiaryMaxLength(uint32_t* outMaxLength)
|
GetPlayDiaryMaxLength(uint32_t *outMaxLength)
|
||||||
asm("GetPlayDiaryMaxLength__Q2_2nn3pdmFPi");
|
asm("GetPlayDiaryMaxLength__Q2_2nn3pdmFPi");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -154,7 +156,7 @@ GetPlayDiaryMaxLength(uint32_t* outMaxLength)
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
GetPlayDiaryLength(uint32_t* outLength, uint32_t userId)
|
GetPlayDiaryLength(uint32_t *outLength, uint32_t userId)
|
||||||
asm("GetPlayDiaryLength__Q2_2nn3pdmFPii");
|
asm("GetPlayDiaryLength__Q2_2nn3pdmFPii");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -170,7 +172,7 @@ GetPlayDiaryLength(uint32_t* outLength, uint32_t userId)
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
GetPlayDiaryStart(uint32_t* outStart, uint32_t userId)
|
GetPlayDiaryStart(uint32_t *outStart, uint32_t userId)
|
||||||
asm("GetPlayDiaryStart__Q2_2nn3pdmFPii");
|
asm("GetPlayDiaryStart__Q2_2nn3pdmFPii");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -195,7 +197,7 @@ GetPlayDiaryStart(uint32_t* outStart, uint32_t userId)
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
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");
|
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.
|
* May be smaller than the amount passed to the function.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
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");
|
asm("GetPlayDiary__Q2_2nn3pdmFPQ3_2nn3pdm9PlayDiaryiT2");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -231,7 +233,7 @@ GetPlayDiary(PlayDiary* outPlayDiaries, uint32_t userId, uint32_t amount)
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
GetPlayEventMaxLength(uint32_t* outMaxLength)
|
GetPlayEventMaxLength(uint32_t *outMaxLength)
|
||||||
asm("GetPlayEventMaxLength__Q2_2nn3pdmFPi");
|
asm("GetPlayEventMaxLength__Q2_2nn3pdmFPi");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -256,7 +258,7 @@ GetPlayEventMaxLength(uint32_t* outMaxLength)
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
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");
|
asm("GetPlayEvent__Q2_2nn3pdmFPiPQ3_2nn3pdm9PlayEventiT3");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -270,7 +272,7 @@ GetPlayEvent(uint32_t* outAmount, PlayEvent* outPlayEvents, uint32_t userId, uin
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
GetPlayLogMaxLength(uint32_t* outMaxLength)
|
GetPlayLogMaxLength(uint32_t *outMaxLength)
|
||||||
asm("GetPlayLogMaxLength__Q2_2nn3pdmFPi");
|
asm("GetPlayLogMaxLength__Q2_2nn3pdmFPi");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -286,7 +288,7 @@ GetPlayLogMaxLength(uint32_t* outMaxLength)
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
GetPlayLogLength(uint32_t* outLength, uint32_t userId)
|
GetPlayLogLength(uint32_t *outLength, uint32_t userId)
|
||||||
asm("GetPlayLogLength__Q2_2nn3pdmFPii");
|
asm("GetPlayLogLength__Q2_2nn3pdmFPii");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -302,7 +304,7 @@ GetPlayLogLength(uint32_t* outLength, uint32_t userId)
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
GetPlayLogStart(uint32_t* outStart, uint32_t userId)
|
GetPlayLogStart(uint32_t *outStart, uint32_t userId)
|
||||||
asm("GetPlayLogStart__Q2_2nn3pdmFPii");
|
asm("GetPlayLogStart__Q2_2nn3pdmFPii");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -327,7 +329,7 @@ GetPlayLogStart(uint32_t* outStart, uint32_t userId)
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
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");
|
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.
|
* May be smaller than the amount passed to the function.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
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");
|
asm("GetPlayLog__Q2_2nn3pdmFPQ3_2nn3pdm7PlayLogiT2");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -363,7 +365,7 @@ GetPlayLog(PlayLog* outPlayLogs, uint32_t userId, uint32_t amount)
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
GetPlayStatsMaxLength(uint32_t* outMaxLength)
|
GetPlayStatsMaxLength(uint32_t *outMaxLength)
|
||||||
asm("GetPlayStatsMaxLength__Q2_2nn3pdmFPi");
|
asm("GetPlayStatsMaxLength__Q2_2nn3pdmFPi");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -379,7 +381,7 @@ GetPlayStatsMaxLength(uint32_t* outMaxLength)
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
GetPlayStatsLength(uint32_t* outLength, uint32_t userId)
|
GetPlayStatsLength(uint32_t *outLength, uint32_t userId)
|
||||||
asm("GetPlayStatsLength__Q2_2nn3pdmFPii");
|
asm("GetPlayStatsLength__Q2_2nn3pdmFPii");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -399,7 +401,7 @@ GetPlayStatsLength(uint32_t* outLength, uint32_t userId)
|
||||||
* 0 on success
|
* 0 on success
|
||||||
*/
|
*/
|
||||||
uint32_t
|
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");
|
asm("GetPlayStatsOfTitleId__Q2_2nn3pdmFPQ3_2nn3pdm9PlayStatsiUL");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -424,7 +426,7 @@ GetPlayStatsOfTitleId(PlayStats* outPlayStats, uint32_t userId, uint64_t titleId
|
||||||
* 0 on success.
|
* 0 on success.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
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");
|
asm("GetPlayStats__Q2_2nn3pdmFPiPQ3_2nn3pdm9PlayStatsiT3");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -446,14 +448,14 @@ GetPlayStats(uint32_t* outAmount, PlayStats* outPlayStats, uint32_t userId, uint
|
||||||
* May be smaller than the amount passed to the function.
|
* May be smaller than the amount passed to the function.
|
||||||
*/
|
*/
|
||||||
uint32_t
|
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");
|
asm("GetPlayStats__Q2_2nn3pdmFPQ3_2nn3pdm9PlayStatsiT2");
|
||||||
|
|
||||||
void
|
void
|
||||||
NotifySetTimeBeginEvent()
|
NotifySetTimeBeginEvent()
|
||||||
asm("NotifySetTimeBeginEvent__Q2_2nn3pdmFv");
|
asm("NotifySetTimeBeginEvent__Q2_2nn3pdmFv");
|
||||||
|
|
||||||
void
|
void
|
||||||
NotifySetTimeEndEvent()
|
NotifySetTimeEndEvent()
|
||||||
asm("NotifySetTimeEndEvent__Q2_2nn3pdmFv");
|
asm("NotifySetTimeEndEvent__Q2_2nn3pdmFv");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,8 @@ struct NNResult
|
||||||
* \sa
|
* \sa
|
||||||
* - \link NNResult_IsFailure \endlink
|
* - \link NNResult_IsFailure \endlink
|
||||||
*/
|
*/
|
||||||
static inline int NNResult_IsSuccess(NNResult result)
|
static inline int
|
||||||
|
NNResult_IsSuccess(NNResult result)
|
||||||
{
|
{
|
||||||
return result.value >= 0;
|
return result.value >= 0;
|
||||||
}
|
}
|
||||||
|
|
@ -51,7 +52,8 @@ static inline int NNResult_IsSuccess(NNResult result)
|
||||||
* \sa
|
* \sa
|
||||||
* - \link NNResult_IsSuccess \endlink
|
* - \link NNResult_IsSuccess \endlink
|
||||||
*/
|
*/
|
||||||
static inline int NNResult_IsFailure(NNResult result)
|
static inline int
|
||||||
|
NNResult_IsFailure(NNResult result)
|
||||||
{
|
{
|
||||||
return result.value < 0;
|
return result.value < 0;
|
||||||
}
|
}
|
||||||
|
|
@ -69,165 +71,170 @@ class Result
|
||||||
public:
|
public:
|
||||||
enum Level
|
enum Level
|
||||||
{
|
{
|
||||||
LEVEL_SUCCESS = 0,
|
LEVEL_SUCCESS = 0,
|
||||||
LEVEL_FATAL = -1,
|
LEVEL_FATAL = -1,
|
||||||
LEVEL_USAGE = -2,
|
LEVEL_USAGE = -2,
|
||||||
LEVEL_STATUS = -3,
|
LEVEL_STATUS = -3,
|
||||||
LEVEL_END = -7,
|
LEVEL_END = -7,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LegacyLevel
|
enum LegacyLevel
|
||||||
{
|
{
|
||||||
LEVEL_INFO = 1,
|
LEVEL_INFO = 1,
|
||||||
LEVEL_RESET = -4,
|
LEVEL_RESET = -4,
|
||||||
LEVEL_REINIT = -5,
|
LEVEL_REINIT = -5,
|
||||||
LEVEL_PERMANENT = -6,
|
LEVEL_PERMANENT = -6,
|
||||||
LEVEL_TEMPORARY = -7,
|
LEVEL_TEMPORARY = -7,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Module
|
enum Module
|
||||||
{
|
{
|
||||||
RESULT_MODULE_COMMON = 0,
|
RESULT_MODULE_COMMON = 0,
|
||||||
RESULT_MODULE_NN_IPC = 1,
|
RESULT_MODULE_NN_IPC = 1,
|
||||||
RESULT_MODULE_NN_BOSS = 2,
|
RESULT_MODULE_NN_BOSS = 2,
|
||||||
RESULT_MODULE_NN_ACP = 3,
|
RESULT_MODULE_NN_ACP = 3,
|
||||||
RESULT_MODULE_NN_IOS = 4,
|
RESULT_MODULE_NN_IOS = 4,
|
||||||
RESULT_MODULE_NN_NIM = 5,
|
RESULT_MODULE_NN_NIM = 5,
|
||||||
RESULT_MODULE_NN_PDM = 6,
|
RESULT_MODULE_NN_PDM = 6,
|
||||||
RESULT_MODULE_NN_ACT = 7,
|
RESULT_MODULE_NN_ACT = 7,
|
||||||
RESULT_MODULE_NN_NGC = 8,
|
RESULT_MODULE_NN_NGC = 8,
|
||||||
RESULT_MODULE_NN_ECA = 9,
|
RESULT_MODULE_NN_ECA = 9,
|
||||||
RESULT_MODULE_NN_NUP = 10,
|
RESULT_MODULE_NN_NUP = 10,
|
||||||
RESULT_MODULE_NN_NDM = 11,
|
RESULT_MODULE_NN_NDM = 11,
|
||||||
RESULT_MODULE_NN_FP = 12,
|
RESULT_MODULE_NN_FP = 12,
|
||||||
RESULT_MODULE_NN_AC = 13,
|
RESULT_MODULE_NN_AC = 13,
|
||||||
RESULT_MODULE_NN_CONNTEST = 14,
|
RESULT_MODULE_NN_CONNTEST = 14,
|
||||||
RESULT_MODULE_NN_DRMAPP = 15,
|
RESULT_MODULE_NN_DRMAPP = 15,
|
||||||
RESULT_MODULE_NN_TELNET = 16,
|
RESULT_MODULE_NN_TELNET = 16,
|
||||||
RESULT_MODULE_NN_OLV = 17,
|
RESULT_MODULE_NN_OLV = 17,
|
||||||
RESULT_MODULE_NN_VCTL = 18,
|
RESULT_MODULE_NN_VCTL = 18,
|
||||||
RESULT_MODULE_NN_NEIA = 19,
|
RESULT_MODULE_NN_NEIA = 19,
|
||||||
RESULT_MODULE_NN_SPM = 20,
|
RESULT_MODULE_NN_SPM = 20,
|
||||||
RESULT_MODULE_NN_EMD = 21,
|
RESULT_MODULE_NN_EMD = 21,
|
||||||
RESULT_MODULE_NN_EC = 22,
|
RESULT_MODULE_NN_EC = 22,
|
||||||
RESULT_MODULE_NN_CIA = 23,
|
RESULT_MODULE_NN_CIA = 23,
|
||||||
RESULT_MODULE_NN_SL = 24,
|
RESULT_MODULE_NN_SL = 24,
|
||||||
RESULT_MODULE_NN_ECO = 25,
|
RESULT_MODULE_NN_ECO = 25,
|
||||||
RESULT_MODULE_NN_TRIAL = 26,
|
RESULT_MODULE_NN_TRIAL = 26,
|
||||||
RESULT_MODULE_NN_NFP = 27,
|
RESULT_MODULE_NN_NFP = 27,
|
||||||
RESULT_MODULE_NN_TEST = 125,
|
RESULT_MODULE_NN_TEST = 125,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LegacyModule
|
enum LegacyModule
|
||||||
{
|
{
|
||||||
MODULE_COMMON = 0,
|
MODULE_COMMON = 0,
|
||||||
MODULE_NN_KERNEL = 1,
|
MODULE_NN_KERNEL = 1,
|
||||||
MODULE_NN_UTIL = 2,
|
MODULE_NN_UTIL = 2,
|
||||||
MODULE_NN_FILE_SERVER = 3,
|
MODULE_NN_FILE_SERVER = 3,
|
||||||
MODULE_NN_LOADER_SERVER = 4,
|
MODULE_NN_LOADER_SERVER = 4,
|
||||||
MODULE_NN_TCB = 5,
|
MODULE_NN_TCB = 5,
|
||||||
MODULE_NN_OS = 6,
|
MODULE_NN_OS = 6,
|
||||||
MODULE_NN_DBG = 7,
|
MODULE_NN_DBG = 7,
|
||||||
MODULE_NN_DMNT = 8,
|
MODULE_NN_DMNT = 8,
|
||||||
MODULE_NN_PDN = 9,
|
MODULE_NN_PDN = 9,
|
||||||
MODULE_NN_GX = 0xA,
|
MODULE_NN_GX = 0xA,
|
||||||
MODULE_NN_I2C = 0xB,
|
MODULE_NN_I2C = 0xB,
|
||||||
MODULE_NN_GPIO = 0xC,
|
MODULE_NN_GPIO = 0xC,
|
||||||
MODULE_NN_DD = 0xD,
|
MODULE_NN_DD = 0xD,
|
||||||
MODULE_NN_CODEC = 0xE,
|
MODULE_NN_CODEC = 0xE,
|
||||||
MODULE_NN_SPI = 0xF,
|
MODULE_NN_SPI = 0xF,
|
||||||
MODULE_NN_PXI = 0x10,
|
MODULE_NN_PXI = 0x10,
|
||||||
MODULE_NN_FS = 0x11,
|
MODULE_NN_FS = 0x11,
|
||||||
MODULE_NN_DI = 0x12,
|
MODULE_NN_DI = 0x12,
|
||||||
MODULE_NN_HID = 0x13,
|
MODULE_NN_HID = 0x13,
|
||||||
MODULE_NN_CAMERA = 0x14,
|
MODULE_NN_CAMERA = 0x14,
|
||||||
MODULE_NN_PI = 0x15,
|
MODULE_NN_PI = 0x15,
|
||||||
MODULE_NN_PM = 0x16,
|
MODULE_NN_PM = 0x16,
|
||||||
MODULE_NN_PMLOW = 0x17,
|
MODULE_NN_PMLOW = 0x17,
|
||||||
MODULE_NN_FSI = 0x18,
|
MODULE_NN_FSI = 0x18,
|
||||||
MODULE_NN_SRV = 0x19,
|
MODULE_NN_SRV = 0x19,
|
||||||
MODULE_NN_NDM = 0x1A,
|
MODULE_NN_NDM = 0x1A,
|
||||||
MODULE_NN_NWM = 0x1B,
|
MODULE_NN_NWM = 0x1B,
|
||||||
MODULE_NN_SOCKET = 0x1C,
|
MODULE_NN_SOCKET = 0x1C,
|
||||||
MODULE_NN_LDR = 0x1D,
|
MODULE_NN_LDR = 0x1D,
|
||||||
MODULE_NN_ACC = 0x1E,
|
MODULE_NN_ACC = 0x1E,
|
||||||
MODULE_NN_ROMFS = 0x1F,
|
MODULE_NN_ROMFS = 0x1F,
|
||||||
MODULE_NN_AM = 0x20,
|
MODULE_NN_AM = 0x20,
|
||||||
MODULE_NN_HIO = 0x21,
|
MODULE_NN_HIO = 0x21,
|
||||||
MODULE_NN_UPDATER = 0x22,
|
MODULE_NN_UPDATER = 0x22,
|
||||||
MODULE_NN_MIC = 0x23,
|
MODULE_NN_MIC = 0x23,
|
||||||
MODULE_NN_FND = 0x24,
|
MODULE_NN_FND = 0x24,
|
||||||
MODULE_NN_MP = 0x25,
|
MODULE_NN_MP = 0x25,
|
||||||
MODULE_NN_MPWL = 0x26,
|
MODULE_NN_MPWL = 0x26,
|
||||||
MODULE_NN_AC = 0x27,
|
MODULE_NN_AC = 0x27,
|
||||||
MODULE_NN_HTTP = 0x28,
|
MODULE_NN_HTTP = 0x28,
|
||||||
MODULE_NN_DSP = 0x29,
|
MODULE_NN_DSP = 0x29,
|
||||||
MODULE_NN_SND = 0x2A,
|
MODULE_NN_SND = 0x2A,
|
||||||
MODULE_NN_DLP = 0x2B,
|
MODULE_NN_DLP = 0x2B,
|
||||||
MODULE_NN_HIOLOW = 0x2C,
|
MODULE_NN_HIOLOW = 0x2C,
|
||||||
MODULE_NN_CSND = 0x2D,
|
MODULE_NN_CSND = 0x2D,
|
||||||
MODULE_NN_SSL = 0x2E,
|
MODULE_NN_SSL = 0x2E,
|
||||||
MODULE_NN_AMLOW = 0x2F,
|
MODULE_NN_AMLOW = 0x2F,
|
||||||
MODULE_NN_NEX = 0x30,
|
MODULE_NN_NEX = 0x30,
|
||||||
MODULE_NN_FRIENDS = 0x31,
|
MODULE_NN_FRIENDS = 0x31,
|
||||||
MODULE_NN_RDT = 0x32,
|
MODULE_NN_RDT = 0x32,
|
||||||
MODULE_NN_APPLET = 0x33,
|
MODULE_NN_APPLET = 0x33,
|
||||||
MODULE_NN_NIM = 0x34,
|
MODULE_NN_NIM = 0x34,
|
||||||
MODULE_NN_PTM = 0x35,
|
MODULE_NN_PTM = 0x35,
|
||||||
MODULE_NN_MIDI = 0x36,
|
MODULE_NN_MIDI = 0x36,
|
||||||
MODULE_NN_MC = 0x37,
|
MODULE_NN_MC = 0x37,
|
||||||
MODULE_NN_SWC = 0x38,
|
MODULE_NN_SWC = 0x38,
|
||||||
MODULE_NN_FATFS = 0x39,
|
MODULE_NN_FATFS = 0x39,
|
||||||
MODULE_NN_NGC = 0x3A,
|
MODULE_NN_NGC = 0x3A,
|
||||||
MODULE_NN_CARD = 0x3B,
|
MODULE_NN_CARD = 0x3B,
|
||||||
MODULE_NN_CARDNOR = 0x3C,
|
MODULE_NN_CARDNOR = 0x3C,
|
||||||
MODULE_NN_SDMC = 0x3D,
|
MODULE_NN_SDMC = 0x3D,
|
||||||
MODULE_NN_BOSS = 0x3E,
|
MODULE_NN_BOSS = 0x3E,
|
||||||
MODULE_NN_DBM = 0x3F,
|
MODULE_NN_DBM = 0x3F,
|
||||||
MODULE_NN_CFG = 0x40,
|
MODULE_NN_CFG = 0x40,
|
||||||
MODULE_NN_PS = 0x41,
|
MODULE_NN_PS = 0x41,
|
||||||
MODULE_NN_CEC = 0x42,
|
MODULE_NN_CEC = 0x42,
|
||||||
MODULE_NN_IR = 0x43,
|
MODULE_NN_IR = 0x43,
|
||||||
MODULE_NN_UDS = 0x44,
|
MODULE_NN_UDS = 0x44,
|
||||||
MODULE_NN_PL = 0x45,
|
MODULE_NN_PL = 0x45,
|
||||||
MODULE_NN_CUP = 0x46,
|
MODULE_NN_CUP = 0x46,
|
||||||
MODULE_NN_GYROSCOPE = 0x47,
|
MODULE_NN_GYROSCOPE = 0x47,
|
||||||
MODULE_NN_MCU = 0x48,
|
MODULE_NN_MCU = 0x48,
|
||||||
MODULE_NN_NS = 0x49,
|
MODULE_NN_NS = 0x49,
|
||||||
MODULE_NN_NEWS = 0x4A,
|
MODULE_NN_NEWS = 0x4A,
|
||||||
MODULE_NN_RO = 0x4B,
|
MODULE_NN_RO = 0x4B,
|
||||||
MODULE_NN_GD = 0x4C,
|
MODULE_NN_GD = 0x4C,
|
||||||
MODULE_NN_CARDSPI = 0x4D,
|
MODULE_NN_CARDSPI = 0x4D,
|
||||||
MODULE_NN_EC = 0x4E,
|
MODULE_NN_EC = 0x4E,
|
||||||
MODULE_NN_WEBBRS = 0x4F,
|
MODULE_NN_WEBBRS = 0x4F,
|
||||||
MODULE_NN_TEST = 0x50,
|
MODULE_NN_TEST = 0x50,
|
||||||
MODULE_NN_ENC = 0x51,
|
MODULE_NN_ENC = 0x51,
|
||||||
MODULE_NN_PIA = 0x52,
|
MODULE_NN_PIA = 0x52,
|
||||||
MODULE_APPLICATION = 0x1FE,
|
MODULE_APPLICATION = 0x1FE,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LegacySummary
|
enum LegacySummary
|
||||||
{
|
{
|
||||||
SUMMARY_SUCCESS = 0,
|
SUMMARY_SUCCESS = 0,
|
||||||
SUMMARY_NOTHING_HAPPENED = 1,
|
SUMMARY_NOTHING_HAPPENED = 1,
|
||||||
SUMMARY_WOULD_BLOCK = 2,
|
SUMMARY_WOULD_BLOCK = 2,
|
||||||
SUMMARY_OUT_OF_RESOURCE = 3,
|
SUMMARY_OUT_OF_RESOURCE = 3,
|
||||||
SUMMARY_NOT_FOUND = 4,
|
SUMMARY_NOT_FOUND = 4,
|
||||||
SUMMARY_INVALID_STATE = 5,
|
SUMMARY_INVALID_STATE = 5,
|
||||||
SUMMARY_NOT_SUPPORTED = 6,
|
SUMMARY_NOT_SUPPORTED = 6,
|
||||||
SUMMARY_INVALID_ARGUMENT = 7,
|
SUMMARY_INVALID_ARGUMENT = 7,
|
||||||
SUMMARY_WRONG_ARGUMENT = 8,
|
SUMMARY_WRONG_ARGUMENT = 8,
|
||||||
SUMMARY_CANCELLED = 9,
|
SUMMARY_CANCELLED = 9,
|
||||||
SUMMARY_STATUS_CHANGED = 10,
|
SUMMARY_STATUS_CHANGED = 10,
|
||||||
SUMMARY_INTERNAL = 11,
|
SUMMARY_INTERNAL = 11,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LegacySignature
|
enum LegacySignature
|
||||||
{
|
{
|
||||||
SIGNATURE_IS_LEGACY = 3,
|
SIGNATURE_IS_LEGACY = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Result() :
|
||||||
|
mValue(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Result(Level level, Module module, unsigned description) :
|
Result(Level level, Module module, unsigned description) :
|
||||||
mValue(((level & 0x7) << 29) | ((module & 0x1FF) << 20) | (description & 0xFFFFF))
|
mValue(((level & 0x7) << 29) | ((module & 0x1FF) << 20) | (description & 0xFFFFF))
|
||||||
{
|
{
|
||||||
|
|
@ -247,7 +254,8 @@ public:
|
||||||
* \sa
|
* \sa
|
||||||
* - \link IsSuccess \endlink
|
* - \link IsSuccess \endlink
|
||||||
*/
|
*/
|
||||||
bool IsFailure() const
|
bool
|
||||||
|
IsFailure() const
|
||||||
{
|
{
|
||||||
return !IsSuccess();
|
return !IsSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -261,22 +269,26 @@ public:
|
||||||
* \sa
|
* \sa
|
||||||
* - \link IsFailure \endlink
|
* - \link IsFailure \endlink
|
||||||
*/
|
*/
|
||||||
bool IsSuccess() const
|
bool
|
||||||
|
IsSuccess() const
|
||||||
{
|
{
|
||||||
return mValue >= 0; // level >= 0
|
return mValue >= 0; // level >= 0
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsLegacy() const
|
bool
|
||||||
|
IsLegacy() const
|
||||||
{
|
{
|
||||||
return ((mValue >> 27) & 0x3) == SIGNATURE_IS_LEGACY;
|
return ((mValue >> 27) & 0x3) == SIGNATURE_IS_LEGACY;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned GetDescription() const
|
unsigned
|
||||||
|
GetDescription() const
|
||||||
{
|
{
|
||||||
return mValue & (IsLegacy() ? 0x3FF : 0xFFFFF);
|
return mValue & (IsLegacy() ? 0x3FF : 0xFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetLevel() const
|
int
|
||||||
|
GetLevel() const
|
||||||
{
|
{
|
||||||
if (IsLegacy()) {
|
if (IsLegacy()) {
|
||||||
return (mValue << 14) >> 28; // cause arithmetic shift
|
return (mValue << 14) >> 28; // cause arithmetic shift
|
||||||
|
|
@ -285,12 +297,14 @@ public:
|
||||||
return mValue >> 29;
|
return mValue >> 29;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned GetModule() const
|
unsigned
|
||||||
|
GetModule() const
|
||||||
{
|
{
|
||||||
return (mValue >> 20) & (IsLegacy() ? 0x7F : 0x1FF);
|
return (mValue >> 20) & (IsLegacy() ? 0x7F : 0x1FF);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned GetSummary() const
|
unsigned
|
||||||
|
GetSummary() const
|
||||||
{
|
{
|
||||||
if (IsLegacy()) {
|
if (IsLegacy()) {
|
||||||
return (mValue >> 10) & 0xF;
|
return (mValue >> 10) & 0xF;
|
||||||
|
|
@ -311,12 +325,14 @@ public:
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const Result &other) const
|
bool
|
||||||
|
operator==(const Result &other) const
|
||||||
{
|
{
|
||||||
return mValue == other.mValue;
|
return mValue == other.mValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const Result &other) const
|
bool
|
||||||
|
operator!=(const Result &other) const
|
||||||
{
|
{
|
||||||
return mValue != other.mValue;
|
return mValue != other.mValue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <wut.h>
|
#include <wut.h>
|
||||||
#include <nn/acp/device.h>
|
|
||||||
#include <coreinit/filesystem.h>
|
#include <coreinit/filesystem.h>
|
||||||
|
#include <nn/acp/device.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
@ -10,9 +10,9 @@ extern "C" {
|
||||||
|
|
||||||
typedef enum SAVEStatus
|
typedef enum SAVEStatus
|
||||||
{
|
{
|
||||||
SAVE_STATUS_OK = 0,
|
SAVE_STATUS_OK = 0,
|
||||||
SAVE_STATUS_NOT_FOUND = -6,
|
SAVE_STATUS_NOT_FOUND = -6,
|
||||||
SAVE_STATUS_STORAGE_FULL = -12,
|
SAVE_STATUS_STORAGE_FULL = -12,
|
||||||
} SAVEStatus;
|
} SAVEStatus;
|
||||||
|
|
||||||
SAVEStatus
|
SAVEStatus
|
||||||
|
|
|
||||||
|
|
@ -1,95 +1,123 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <wut.h>
|
||||||
#include <nn/result.h>
|
#include <nn/result.h>
|
||||||
#include <nn/sl/ISerializer.h>
|
#include <nn/sl/ISerializer.h>
|
||||||
#include <nn/sl/KillerNotification.h>
|
#include <nn/sl/KillerNotification.h>
|
||||||
#include <nn/sl/sl_cpp.h>
|
#include <nn/sl/sl_cpp.h>
|
||||||
#include <wut.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn::sl {
|
namespace nn::sl
|
||||||
namespace details {
|
{
|
||||||
typedef struct WUT_PACKED CacheManagerInternal {
|
namespace details
|
||||||
ISerializerInternal *quickStartTitleInfoSerializer;
|
{
|
||||||
ISerializerInternal *killerNotificationSerializer;
|
typedef struct WUT_PACKED CacheManagerInternal
|
||||||
ISerializerInternal *jumpTitleInfoSerializer;
|
{
|
||||||
} CacheManagerInternal;
|
ISerializerInternal *quickStartTitleInfoSerializer;
|
||||||
WUT_CHECK_SIZE(CacheManagerInternal, 0x0c);
|
ISerializerInternal *killerNotificationSerializer;
|
||||||
WUT_CHECK_OFFSET(CacheManagerInternal, 0x00, quickStartTitleInfoSerializer);
|
ISerializerInternal *jumpTitleInfoSerializer;
|
||||||
WUT_CHECK_OFFSET(CacheManagerInternal, 0x04, killerNotificationSerializer);
|
} CacheManagerInternal;
|
||||||
WUT_CHECK_OFFSET(CacheManagerInternal, 0x08, jumpTitleInfoSerializer);
|
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" CacheManagerInternal *
|
||||||
extern "C" void SetupInitialCache__Q3_2nn2sl12CacheManagerFv(CacheManagerInternal *);
|
__ct__Q3_2nn2sl12CacheManagerFv(CacheManagerInternal *);
|
||||||
extern "C" nn::Result GetKillerNotificationCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl18KillerNotificationPQ3_2nn2sl9TitleInfo(CacheManagerInternal *, KillerNotification *, TitleInfo *);
|
extern "C" void
|
||||||
extern "C" nn::Result GetQuickStartCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoi(CacheManagerInternal *, TitleInfo *, int);
|
SetupInitialCache__Q3_2nn2sl12CacheManagerFv(CacheManagerInternal *);
|
||||||
extern "C" nn::Result Get__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoiPQ3_2nn2sl18KillerNotificationT1(CacheManagerInternal *, TitleInfo *, int, KillerNotification *, TitleInfo *);
|
extern "C" nn::Result
|
||||||
extern "C" nn::Result Initialize__Q3_2nn2sl12CacheManagerFRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfoRQ3_2nn2sl49ISerializer__tm__30_Q3_2nn2sl18KillerNotificationT1(
|
GetKillerNotificationCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl18KillerNotificationPQ3_2nn2sl9TitleInfo(CacheManagerInternal *, KillerNotification *, TitleInfo *);
|
||||||
CacheManagerInternal *,
|
extern "C" nn::Result
|
||||||
ISerializerInternal *,
|
GetQuickStartCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoi(CacheManagerInternal *, TitleInfo *, int);
|
||||||
ISerializerInternal *,
|
extern "C" nn::Result
|
||||||
ISerializerInternal *);
|
Get__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoiPQ3_2nn2sl18KillerNotificationT1(CacheManagerInternal *, TitleInfo *, int, KillerNotification *, TitleInfo *);
|
||||||
} // namespace details
|
extern "C" nn::Result
|
||||||
|
Initialize__Q3_2nn2sl12CacheManagerFRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfoRQ3_2nn2sl49ISerializer__tm__30_Q3_2nn2sl18KillerNotificationT1(
|
||||||
|
CacheManagerInternal *,
|
||||||
|
ISerializerInternal *,
|
||||||
|
ISerializerInternal *,
|
||||||
|
ISerializerInternal *);
|
||||||
|
} // namespace details
|
||||||
|
|
||||||
class CacheManager {
|
class CacheManager
|
||||||
public:
|
{
|
||||||
CacheManager() : mQuickStartTitleInfoSerializer(nullptr),
|
public:
|
||||||
mKillerNotificationSerializer(nullptr),
|
CacheManager() :
|
||||||
mJumpTitleInfoSerializer(nullptr) {
|
mQuickStartTitleInfoSerializer(nullptr),
|
||||||
if (__ct__Q3_2nn2sl12CacheManagerFv(&mInstance) != nullptr) {
|
mKillerNotificationSerializer(nullptr),
|
||||||
mQuickStartTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(mInstance.quickStartTitleInfoSerializer);
|
mJumpTitleInfoSerializer(nullptr)
|
||||||
mKillerNotificationSerializer = details::SerializerFromPtr<KillerNotification>(mInstance.killerNotificationSerializer);
|
{
|
||||||
mJumpTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(mInstance.jumpTitleInfoSerializer);
|
if (__ct__Q3_2nn2sl12CacheManagerFv(&mInstance) != nullptr) {
|
||||||
}
|
mQuickStartTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(mInstance.quickStartTitleInfoSerializer);
|
||||||
}
|
mKillerNotificationSerializer = details::SerializerFromPtr<KillerNotification>(mInstance.killerNotificationSerializer);
|
||||||
|
mJumpTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(mInstance.jumpTitleInfoSerializer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] details::ISerializerBase<TitleInfo> &GetQuickStartTitleInfoSerializer() {
|
[[nodiscard]] details::ISerializerBase<TitleInfo> &
|
||||||
return mQuickStartTitleInfoSerializer;
|
GetQuickStartTitleInfoSerializer()
|
||||||
}
|
{
|
||||||
|
return mQuickStartTitleInfoSerializer;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] details::ISerializerBase<KillerNotification> &GetKillerNotificationSerializer() {
|
[[nodiscard]] details::ISerializerBase<KillerNotification> &
|
||||||
return mKillerNotificationSerializer;
|
GetKillerNotificationSerializer()
|
||||||
}
|
{
|
||||||
|
return mKillerNotificationSerializer;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] details::ISerializerBase<TitleInfo> &GetJumpTitleInfoSerializer() {
|
[[nodiscard]] details::ISerializerBase<TitleInfo> &
|
||||||
return mJumpTitleInfoSerializer;
|
GetJumpTitleInfoSerializer()
|
||||||
}
|
{
|
||||||
|
return mJumpTitleInfoSerializer;
|
||||||
|
}
|
||||||
|
|
||||||
void SetupInitialCache() {
|
void
|
||||||
SetupInitialCache__Q3_2nn2sl12CacheManagerFv(&mInstance);
|
SetupInitialCache()
|
||||||
}
|
{
|
||||||
|
SetupInitialCache__Q3_2nn2sl12CacheManagerFv(&mInstance);
|
||||||
|
}
|
||||||
|
|
||||||
nn::Result GetKillerNotificationCache(KillerNotification *u1, TitleInfo *u2) {
|
nn::Result
|
||||||
return GetKillerNotificationCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl18KillerNotificationPQ3_2nn2sl9TitleInfo(&mInstance, u1, u2);
|
GetKillerNotificationCache(KillerNotification *u1, TitleInfo *u2)
|
||||||
}
|
{
|
||||||
|
return GetKillerNotificationCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl18KillerNotificationPQ3_2nn2sl9TitleInfo(&mInstance, u1, u2);
|
||||||
|
}
|
||||||
|
|
||||||
nn::Result GetQuickStartCache(TitleInfo *u1, int u2) {
|
nn::Result
|
||||||
return GetQuickStartCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoi(&mInstance, u1, u2);
|
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
|
||||||
return Get__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoiPQ3_2nn2sl18KillerNotificationT1(&mInstance, u1, u2, u3, u4);
|
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__Q3_2nn2sl12CacheManagerFRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfoRQ3_2nn2sl49ISerializer__tm__30_Q3_2nn2sl18KillerNotificationT1(&mInstance,
|
Initialize(details::ISerializerBase<TitleInfo> &quickStartTitleInfoSerializer, details::ISerializerBase<KillerNotification> &killerNotificationSerializer, details::ISerializerBase<TitleInfo> &jumpTitleInfoSerializer)
|
||||||
quickStartTitleInfoSerializer.GetInternal(),
|
{
|
||||||
killerNotificationSerializer.GetInternal(),
|
Initialize__Q3_2nn2sl12CacheManagerFRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfoRQ3_2nn2sl49ISerializer__tm__30_Q3_2nn2sl18KillerNotificationT1(&mInstance,
|
||||||
jumpTitleInfoSerializer.GetInternal());
|
quickStartTitleInfoSerializer.GetInternal(),
|
||||||
mQuickStartTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(quickStartTitleInfoSerializer.GetInternal());
|
killerNotificationSerializer.GetInternal(),
|
||||||
mKillerNotificationSerializer = details::SerializerFromPtr<KillerNotification>(killerNotificationSerializer.GetInternal());
|
jumpTitleInfoSerializer.GetInternal());
|
||||||
mJumpTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(jumpTitleInfoSerializer.GetInternal());
|
mQuickStartTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(quickStartTitleInfoSerializer.GetInternal());
|
||||||
}
|
mKillerNotificationSerializer = details::SerializerFromPtr<KillerNotification>(killerNotificationSerializer.GetInternal());
|
||||||
|
mJumpTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(jumpTitleInfoSerializer.GetInternal());
|
||||||
|
}
|
||||||
|
|
||||||
~CacheManager() = default;
|
~CacheManager() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
details::CacheManagerInternal mInstance{};
|
details::CacheManagerInternal mInstance{};
|
||||||
details::SerializerFromPtr<TitleInfo> mQuickStartTitleInfoSerializer;
|
details::SerializerFromPtr<TitleInfo> mQuickStartTitleInfoSerializer;
|
||||||
details::SerializerFromPtr<KillerNotification> mKillerNotificationSerializer;
|
details::SerializerFromPtr<KillerNotification> mKillerNotificationSerializer;
|
||||||
details::SerializerFromPtr<TitleInfo> mJumpTitleInfoSerializer;
|
details::SerializerFromPtr<TitleInfo> mJumpTitleInfoSerializer;
|
||||||
};
|
};
|
||||||
} // namespace nn::sl
|
} // namespace nn::sl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1,114 +1,144 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <wut.h>
|
||||||
#include <coreinit/time.h>
|
#include <coreinit/time.h>
|
||||||
#include <nn/result.h>
|
#include <nn/result.h>
|
||||||
#include <nn/sl/ISettingAccessor.h>
|
#include <nn/sl/ISettingAccessor.h>
|
||||||
#include <nn/sl/ITimeAccessor.h>
|
#include <nn/sl/ITimeAccessor.h>
|
||||||
#include <nn/sl/IUpdatePackageAccessor.h>
|
#include <nn/sl/IUpdatePackageAccessor.h>
|
||||||
#include <nn/sl/details/ISerializerDetails.h>
|
#include <nn/sl/details/ISerializerDetails.h>
|
||||||
#include <wut.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn::sl {
|
namespace nn::sl
|
||||||
namespace details {
|
{
|
||||||
typedef struct WUT_PACKED ConditionInternal {
|
namespace details
|
||||||
ISettingAccessorInternal *settingAccessor;
|
{
|
||||||
IUpdatePackageAccessorInternal *updatePackageAccessor;
|
typedef struct WUT_PACKED ConditionInternal
|
||||||
ISerializerInternal *previousSendingTimeSerializer;
|
{
|
||||||
ITimeAccessorInternal *timeAccessor;
|
ISettingAccessorInternal *settingAccessor;
|
||||||
void *vtable;
|
IUpdatePackageAccessorInternal *updatePackageAccessor;
|
||||||
} ConditionInternal;
|
ISerializerInternal *previousSendingTimeSerializer;
|
||||||
WUT_CHECK_SIZE(ConditionInternal, 0x14);
|
ITimeAccessorInternal *timeAccessor;
|
||||||
WUT_CHECK_OFFSET(ConditionInternal, 0x00, settingAccessor);
|
void *vtable;
|
||||||
WUT_CHECK_OFFSET(ConditionInternal, 0x04, updatePackageAccessor);
|
} ConditionInternal;
|
||||||
WUT_CHECK_OFFSET(ConditionInternal, 0x08, previousSendingTimeSerializer);
|
WUT_CHECK_SIZE(ConditionInternal, 0x14);
|
||||||
WUT_CHECK_OFFSET(ConditionInternal, 0x0C, timeAccessor);
|
WUT_CHECK_OFFSET(ConditionInternal, 0x00, settingAccessor);
|
||||||
WUT_CHECK_OFFSET(ConditionInternal, 0x10, vtable);
|
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" ConditionInternal *
|
||||||
extern "C" nn::Result GetEnability__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
|
__ct__Q3_2nn2sl9ConditionFv(ConditionInternal *);
|
||||||
extern "C" nn::Result StoreCurrentTimeAsPreviousSendingTime__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
|
extern "C" nn::Result
|
||||||
extern "C" nn::Result NeedsUpdate__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
|
GetEnability__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
|
||||||
extern "C" nn::Result GetPreviousSendingTime__Q3_2nn2sl9ConditionCFPL(ConditionInternal *, int64_t *outTime);
|
extern "C" nn::Result
|
||||||
extern "C" void Initialize__Q3_2nn2sl9ConditionFRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl22IUpdatePackageAccessorRQ3_2nn2sl20ISerializer__tm__2_LRQ3_2nn2sl13ITimeAccessor(ConditionInternal *,
|
StoreCurrentTimeAsPreviousSendingTime__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
|
||||||
ISettingAccessorInternal *,
|
extern "C" nn::Result
|
||||||
IUpdatePackageAccessorInternal *,
|
NeedsUpdate__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
|
||||||
ISerializerInternal *,
|
extern "C" nn::Result
|
||||||
ITimeAccessorInternal *);
|
GetPreviousSendingTime__Q3_2nn2sl9ConditionCFPL(ConditionInternal *, int64_t *outTime);
|
||||||
} // namespace details
|
extern "C" void
|
||||||
|
Initialize__Q3_2nn2sl9ConditionFRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl22IUpdatePackageAccessorRQ3_2nn2sl20ISerializer__tm__2_LRQ3_2nn2sl13ITimeAccessor(ConditionInternal *,
|
||||||
|
ISettingAccessorInternal *,
|
||||||
|
IUpdatePackageAccessorInternal *,
|
||||||
|
ISerializerInternal *,
|
||||||
|
ITimeAccessorInternal *);
|
||||||
|
} // namespace details
|
||||||
|
|
||||||
class Condition {
|
class Condition
|
||||||
public:
|
{
|
||||||
Condition() : mSettingAccessor(nullptr),
|
public:
|
||||||
mUpdatePackageAccessor(nullptr),
|
Condition() :
|
||||||
mPreviousSendingTimeSerializer(nullptr),
|
mSettingAccessor(nullptr),
|
||||||
mTimeAccessor(nullptr) {
|
mUpdatePackageAccessor(nullptr),
|
||||||
if (__ct__Q3_2nn2sl9ConditionFv(&mInstance) != nullptr) {
|
mPreviousSendingTimeSerializer(nullptr),
|
||||||
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingAccessor);
|
mTimeAccessor(nullptr)
|
||||||
mUpdatePackageAccessor = details::UpdatePackageAccessorFromPtr(mInstance.updatePackageAccessor);
|
{
|
||||||
mPreviousSendingTimeSerializer = details::SerializerFromPtr<OSTime>(mInstance.previousSendingTimeSerializer);
|
if (__ct__Q3_2nn2sl9ConditionFv(&mInstance) != nullptr) {
|
||||||
mTimeAccessor = details::TimeAccessorFromPtr(mInstance.timeAccessor);
|
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingAccessor);
|
||||||
}
|
mUpdatePackageAccessor = details::UpdatePackageAccessorFromPtr(mInstance.updatePackageAccessor);
|
||||||
}
|
mPreviousSendingTimeSerializer = details::SerializerFromPtr<OSTime>(mInstance.previousSendingTimeSerializer);
|
||||||
|
mTimeAccessor = details::TimeAccessorFromPtr(mInstance.timeAccessor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
~Condition() = default;
|
~Condition() = default;
|
||||||
|
|
||||||
[[nodiscard]] details::ISettingAccessorBase &GetSettingAccessor() {
|
[[nodiscard]] details::ISettingAccessorBase &
|
||||||
return mSettingAccessor;
|
GetSettingAccessor()
|
||||||
}
|
{
|
||||||
|
return mSettingAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] details::IUpdatePackageAccessorBase &GetUpdatePackageAccessor() {
|
[[nodiscard]] details::IUpdatePackageAccessorBase &
|
||||||
return mUpdatePackageAccessor;
|
GetUpdatePackageAccessor()
|
||||||
}
|
{
|
||||||
|
return mUpdatePackageAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] details::ISerializerBase<OSTime> &GetPreviousSendingTimeSerializer() {
|
[[nodiscard]] details::ISerializerBase<OSTime> &
|
||||||
return mPreviousSendingTimeSerializer;
|
GetPreviousSendingTimeSerializer()
|
||||||
}
|
{
|
||||||
|
return mPreviousSendingTimeSerializer;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] details::ITimeAccessorBase &GetTimeAccessor() {
|
[[nodiscard]] details::ITimeAccessorBase &
|
||||||
return mTimeAccessor;
|
GetTimeAccessor()
|
||||||
}
|
{
|
||||||
|
return mTimeAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
nn::Result GetEnability() {
|
nn::Result
|
||||||
return GetEnability__Q3_2nn2sl9ConditionCFv(&mInstance);
|
GetEnability()
|
||||||
}
|
{
|
||||||
|
return GetEnability__Q3_2nn2sl9ConditionCFv(&mInstance);
|
||||||
|
}
|
||||||
|
|
||||||
nn::Result NeedsUpdate() {
|
nn::Result
|
||||||
return NeedsUpdate__Q3_2nn2sl9ConditionCFv(&mInstance);
|
NeedsUpdate()
|
||||||
}
|
{
|
||||||
|
return NeedsUpdate__Q3_2nn2sl9ConditionCFv(&mInstance);
|
||||||
|
}
|
||||||
|
|
||||||
nn::Result StoreCurrentTimeAsPreviousSendingTime() {
|
nn::Result
|
||||||
return StoreCurrentTimeAsPreviousSendingTime__Q3_2nn2sl9ConditionCFv(&mInstance);
|
StoreCurrentTimeAsPreviousSendingTime()
|
||||||
}
|
{
|
||||||
|
return StoreCurrentTimeAsPreviousSendingTime__Q3_2nn2sl9ConditionCFv(&mInstance);
|
||||||
|
}
|
||||||
|
|
||||||
nn::Result GetPreviousSendingTime(int64_t *outTime) {
|
nn::Result
|
||||||
return GetPreviousSendingTime__Q3_2nn2sl9ConditionCFPL(&mInstance, outTime);
|
GetPreviousSendingTime(int64_t *outTime)
|
||||||
}
|
{
|
||||||
|
return GetPreviousSendingTime__Q3_2nn2sl9ConditionCFPL(&mInstance, outTime);
|
||||||
|
}
|
||||||
|
|
||||||
void Initialize(details::ISettingAccessorBase &settingAccessor,
|
void
|
||||||
details::IUpdatePackageAccessorBase &updatePackageAccessor,
|
Initialize(details::ISettingAccessorBase &settingAccessor,
|
||||||
details::ISerializerBase<OSTime> &previousSendingTimeSerializer,
|
details::IUpdatePackageAccessorBase &updatePackageAccessor,
|
||||||
details::ITimeAccessorBase &timeAccessor) {
|
details::ISerializerBase<OSTime> &previousSendingTimeSerializer,
|
||||||
Initialize__Q3_2nn2sl9ConditionFRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl22IUpdatePackageAccessorRQ3_2nn2sl20ISerializer__tm__2_LRQ3_2nn2sl13ITimeAccessor(
|
details::ITimeAccessorBase &timeAccessor)
|
||||||
&mInstance,
|
{
|
||||||
settingAccessor.GetInternal(),
|
Initialize__Q3_2nn2sl9ConditionFRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl22IUpdatePackageAccessorRQ3_2nn2sl20ISerializer__tm__2_LRQ3_2nn2sl13ITimeAccessor(
|
||||||
updatePackageAccessor.GetInternal(),
|
&mInstance,
|
||||||
previousSendingTimeSerializer.GetInternal(),
|
settingAccessor.GetInternal(),
|
||||||
timeAccessor.GetInternal());
|
updatePackageAccessor.GetInternal(),
|
||||||
mSettingAccessor = details::SettingAccessorFromPtr(settingAccessor.GetInternal());
|
previousSendingTimeSerializer.GetInternal(),
|
||||||
mUpdatePackageAccessor = details::UpdatePackageAccessorFromPtr(updatePackageAccessor.GetInternal());
|
timeAccessor.GetInternal());
|
||||||
mPreviousSendingTimeSerializer = details::SerializerFromPtr<OSTime>(previousSendingTimeSerializer.GetInternal());
|
mSettingAccessor = details::SettingAccessorFromPtr(settingAccessor.GetInternal());
|
||||||
mTimeAccessor = details::TimeAccessorFromPtr(timeAccessor.GetInternal());
|
mUpdatePackageAccessor = details::UpdatePackageAccessorFromPtr(updatePackageAccessor.GetInternal());
|
||||||
}
|
mPreviousSendingTimeSerializer = details::SerializerFromPtr<OSTime>(previousSendingTimeSerializer.GetInternal());
|
||||||
|
mTimeAccessor = details::TimeAccessorFromPtr(timeAccessor.GetInternal());
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
details::ConditionInternal mInstance = {};
|
details::ConditionInternal mInstance = {};
|
||||||
details::SettingAccessorFromPtr mSettingAccessor;
|
details::SettingAccessorFromPtr mSettingAccessor;
|
||||||
details::UpdatePackageAccessorFromPtr mUpdatePackageAccessor;
|
details::UpdatePackageAccessorFromPtr mUpdatePackageAccessor;
|
||||||
details::SerializerFromPtr<OSTime> mPreviousSendingTimeSerializer;
|
details::SerializerFromPtr<OSTime> mPreviousSendingTimeSerializer;
|
||||||
details::TimeAccessorFromPtr mTimeAccessor;
|
details::TimeAccessorFromPtr mTimeAccessor;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace nn::sl
|
} // namespace nn::sl
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <wut.h>
|
||||||
#include <nn/result.h>
|
#include <nn/result.h>
|
||||||
#include <nn/sl/IIconInfoAccessor.h>
|
#include <nn/sl/IIconInfoAccessor.h>
|
||||||
#include <nn/sl/ISettingAccessor.h>
|
#include <nn/sl/ISettingAccessor.h>
|
||||||
|
|
@ -8,92 +9,122 @@
|
||||||
#include <nn/sl/LaunchInfoDatabase.h>
|
#include <nn/sl/LaunchInfoDatabase.h>
|
||||||
#include <nn/sl/details/IAccountInfoAccessorDetails.h>
|
#include <nn/sl/details/IAccountInfoAccessorDetails.h>
|
||||||
#include <nn/sl/sl_cpp.h>
|
#include <nn/sl/sl_cpp.h>
|
||||||
#include <wut.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn ::sl {
|
namespace nn ::sl
|
||||||
namespace details {
|
{
|
||||||
typedef struct WUT_PACKED DataCreatorInternal {
|
namespace details
|
||||||
IIconInfoAccessorInternal *iconInfoAccessor;
|
{
|
||||||
IAccountInfoAccessorInternal *accountInfoAccessor;
|
typedef struct WUT_PACKED DataCreatorInternal
|
||||||
ISettingAccessorInternal *settingInfoAccessor;
|
{
|
||||||
ITitleIconCacheInternal *titleIconCache;
|
IIconInfoAccessorInternal *iconInfoAccessor;
|
||||||
void *vtable;
|
IAccountInfoAccessorInternal *accountInfoAccessor;
|
||||||
} DataCreatorInternal;
|
ISettingAccessorInternal *settingInfoAccessor;
|
||||||
WUT_CHECK_SIZE(DataCreatorInternal, 0x14);
|
ITitleIconCacheInternal *titleIconCache;
|
||||||
WUT_CHECK_OFFSET(DataCreatorInternal, 0x00, iconInfoAccessor);
|
void *vtable;
|
||||||
WUT_CHECK_OFFSET(DataCreatorInternal, 0x04, accountInfoAccessor);
|
} DataCreatorInternal;
|
||||||
WUT_CHECK_OFFSET(DataCreatorInternal, 0x08, settingInfoAccessor);
|
WUT_CHECK_SIZE(DataCreatorInternal, 0x14);
|
||||||
WUT_CHECK_OFFSET(DataCreatorInternal, 0x0c, titleIconCache);
|
WUT_CHECK_OFFSET(DataCreatorInternal, 0x00, iconInfoAccessor);
|
||||||
WUT_CHECK_OFFSET(DataCreatorInternal, 0x10, vtable);
|
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" DataCreatorInternal *
|
||||||
extern "C" nn::Result Create__Q3_2nn2sl11DataCreatorFPQ3_2nn2sl16TransferableInfoPCQ3_2nn2sl9TitleInfoiRCQ3_2nn2sl18KillerNotificationRCQ3_2nn2sl9TitleInfoRQ3_2nn2sl18LaunchInfoDatabase(
|
__ct__Q3_2nn2sl11DataCreatorFv(DataCreatorInternal *);
|
||||||
DataCreatorInternal *, TransferableInfo *, const TitleInfo *, int, const KillerNotification &, const TitleInfo &, LaunchInfoDatabase &);
|
extern "C" nn::Result
|
||||||
extern "C" nn::Result Initialize__Q3_2nn2sl11DataCreatorFRQ3_2nn2sl17IIconInfoAccessorRQ3_2nn2sl20IAccountInfoAccessorRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl15ITitleIconCache(
|
Create__Q3_2nn2sl11DataCreatorFPQ3_2nn2sl16TransferableInfoPCQ3_2nn2sl9TitleInfoiRCQ3_2nn2sl18KillerNotificationRCQ3_2nn2sl9TitleInfoRQ3_2nn2sl18LaunchInfoDatabase(
|
||||||
DataCreatorInternal *, IIconInfoAccessorInternal *, IAccountInfoAccessorInternal *, ISettingAccessorInternal *, ITitleIconCacheInternal *);
|
DataCreatorInternal *,
|
||||||
} // namespace details
|
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 {
|
class DataCreator
|
||||||
public:
|
{
|
||||||
DataCreator() : mIconInfoAccessor(nullptr),
|
public:
|
||||||
mAccountInfoAccessor(nullptr),
|
DataCreator() :
|
||||||
mSettingAccessor(nullptr),
|
mIconInfoAccessor(nullptr),
|
||||||
mTitleIconCache(nullptr) {
|
mAccountInfoAccessor(nullptr),
|
||||||
if (__ct__Q3_2nn2sl11DataCreatorFv(&mInstance) != nullptr) {
|
mSettingAccessor(nullptr),
|
||||||
mIconInfoAccessor = details::IconInfoAccessorFromPtr(mInstance.iconInfoAccessor);
|
mTitleIconCache(nullptr)
|
||||||
mAccountInfoAccessor = details::AccountInfoAccessorFromPtr(mInstance.accountInfoAccessor);
|
{
|
||||||
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingInfoAccessor);
|
if (__ct__Q3_2nn2sl11DataCreatorFv(&mInstance) != nullptr) {
|
||||||
mTitleIconCache = details::TitleIconCacheFromPtr(mInstance.titleIconCache);
|
mIconInfoAccessor = details::IconInfoAccessorFromPtr(mInstance.iconInfoAccessor);
|
||||||
}
|
mAccountInfoAccessor = details::AccountInfoAccessorFromPtr(mInstance.accountInfoAccessor);
|
||||||
}
|
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingInfoAccessor);
|
||||||
|
mTitleIconCache = details::TitleIconCacheFromPtr(mInstance.titleIconCache);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] details::IIconInfoAccessorBase &getIconInfoAccessor() {
|
[[nodiscard]] details::IIconInfoAccessorBase &
|
||||||
return mIconInfoAccessor;
|
getIconInfoAccessor()
|
||||||
}
|
{
|
||||||
|
return mIconInfoAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] details::IAccountInfoAccessorBase &getAccountInfoAccessor() {
|
[[nodiscard]] details::IAccountInfoAccessorBase &
|
||||||
return mAccountInfoAccessor;
|
getAccountInfoAccessor()
|
||||||
}
|
{
|
||||||
|
return mAccountInfoAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] details::ISettingAccessorBase &getSettingAccessor() {
|
[[nodiscard]] details::ISettingAccessorBase &
|
||||||
return mSettingAccessor;
|
getSettingAccessor()
|
||||||
}
|
{
|
||||||
|
return mSettingAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] details::ITitleIconCacheBase &getTitleIconCache() {
|
[[nodiscard]] details::ITitleIconCacheBase &
|
||||||
return mTitleIconCache;
|
getTitleIconCache()
|
||||||
}
|
{
|
||||||
|
return mTitleIconCache;
|
||||||
|
}
|
||||||
|
|
||||||
nn::Result Create(TransferableInfo *outTransferableInfo,
|
nn::Result
|
||||||
const TitleInfo *quickstartTitleInfos,
|
Create(TransferableInfo *outTransferableInfo,
|
||||||
int numQuickstartTitleInfos,
|
const TitleInfo *quickstartTitleInfos,
|
||||||
const KillerNotification &killerNotification,
|
int numQuickstartTitleInfos,
|
||||||
const TitleInfo &killerNotificationTitleInfo,
|
const KillerNotification &killerNotification,
|
||||||
LaunchInfoDatabase &launchInfoDatabase) {
|
const TitleInfo &killerNotificationTitleInfo,
|
||||||
return details::Create__Q3_2nn2sl11DataCreatorFPQ3_2nn2sl16TransferableInfoPCQ3_2nn2sl9TitleInfoiRCQ3_2nn2sl18KillerNotificationRCQ3_2nn2sl9TitleInfoRQ3_2nn2sl18LaunchInfoDatabase(
|
LaunchInfoDatabase &launchInfoDatabase)
|
||||||
&mInstance, outTransferableInfo, quickstartTitleInfos, numQuickstartTitleInfos, killerNotification, killerNotificationTitleInfo, 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
|
||||||
details::Initialize__Q3_2nn2sl11DataCreatorFRQ3_2nn2sl17IIconInfoAccessorRQ3_2nn2sl20IAccountInfoAccessorRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl15ITitleIconCache(
|
Initialize(details::IIconInfoAccessorBase &iconInfoAccessor, details::IAccountInfoAccessorBase &accountInfoAccessor, details::ISettingAccessorBase &settingAccessor, details::ITitleIconCacheBase &titleIconCache)
|
||||||
&mInstance, iconInfoAccessor.GetInternal(), accountInfoAccessor.GetInternal(), settingAccessor.GetInternal(), titleIconCache.GetInternal());
|
{
|
||||||
mIconInfoAccessor = details::IconInfoAccessorFromPtr(mInstance.iconInfoAccessor);
|
details::Initialize__Q3_2nn2sl11DataCreatorFRQ3_2nn2sl17IIconInfoAccessorRQ3_2nn2sl20IAccountInfoAccessorRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl15ITitleIconCache(
|
||||||
mAccountInfoAccessor = details::AccountInfoAccessorFromPtr(mInstance.accountInfoAccessor);
|
&mInstance, iconInfoAccessor.GetInternal(), accountInfoAccessor.GetInternal(), settingAccessor.GetInternal(), titleIconCache.GetInternal());
|
||||||
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingInfoAccessor);
|
mIconInfoAccessor = details::IconInfoAccessorFromPtr(mInstance.iconInfoAccessor);
|
||||||
mTitleIconCache = details::TitleIconCacheFromPtr(mInstance.titleIconCache);
|
mAccountInfoAccessor = details::AccountInfoAccessorFromPtr(mInstance.accountInfoAccessor);
|
||||||
}
|
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingInfoAccessor);
|
||||||
|
mTitleIconCache = details::TitleIconCacheFromPtr(mInstance.titleIconCache);
|
||||||
|
}
|
||||||
|
|
||||||
~DataCreator() = default;
|
~DataCreator() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
details::DataCreatorInternal mInstance = {};
|
details::DataCreatorInternal mInstance = {};
|
||||||
details::IconInfoAccessorFromPtr mIconInfoAccessor;
|
details::IconInfoAccessorFromPtr mIconInfoAccessor;
|
||||||
details::AccountInfoAccessorFromPtr mAccountInfoAccessor;
|
details::AccountInfoAccessorFromPtr mAccountInfoAccessor;
|
||||||
details::SettingAccessorFromPtr mSettingAccessor;
|
details::SettingAccessorFromPtr mSettingAccessor;
|
||||||
details::TitleIconCacheFromPtr mTitleIconCache;
|
details::TitleIconCacheFromPtr mTitleIconCache;
|
||||||
};
|
};
|
||||||
}; // namespace nn::sl
|
}; // namespace nn::sl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1,91 +1,119 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <wut.h>
|
||||||
#include <nn/result.h>
|
#include <nn/result.h>
|
||||||
#include <nn/sl/ISettingAccessor.h>
|
#include <nn/sl/ISettingAccessor.h>
|
||||||
#include <nn/sl/ITimeAccessor.h>
|
#include <nn/sl/ITimeAccessor.h>
|
||||||
#include <nn/sl/ITransferrer.h>
|
#include <nn/sl/ITransferrer.h>
|
||||||
#include <nn/sl/KillerNotification.h>
|
#include <nn/sl/KillerNotification.h>
|
||||||
#include <nn/sl/sl_cpp.h>
|
#include <nn/sl/sl_cpp.h>
|
||||||
#include <wut.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn::sl {
|
namespace nn::sl
|
||||||
|
{
|
||||||
|
|
||||||
namespace details {
|
namespace details
|
||||||
typedef struct WUT_PACKED DrcManagerInternal {
|
{
|
||||||
ITransferrerInternal *drcTransferrer;
|
typedef struct WUT_PACKED DrcManagerInternal
|
||||||
ISettingAccessorInternal *settingsAccessor;
|
{
|
||||||
ITimeAccessorInternal *timeAccessor;
|
ITransferrerInternal *drcTransferrer;
|
||||||
void *vtable;
|
ISettingAccessorInternal *settingsAccessor;
|
||||||
} DrcManagerInternal;
|
ITimeAccessorInternal *timeAccessor;
|
||||||
WUT_CHECK_SIZE(DrcManagerInternal, 0x10);
|
void *vtable;
|
||||||
WUT_CHECK_OFFSET(DrcManagerInternal, 0x00, drcTransferrer);
|
} DrcManagerInternal;
|
||||||
WUT_CHECK_OFFSET(DrcManagerInternal, 0x04, settingsAccessor);
|
WUT_CHECK_SIZE(DrcManagerInternal, 0x10);
|
||||||
WUT_CHECK_OFFSET(DrcManagerInternal, 0x08, timeAccessor);
|
WUT_CHECK_OFFSET(DrcManagerInternal, 0x00, drcTransferrer);
|
||||||
WUT_CHECK_OFFSET(DrcManagerInternal, 0x0C, vtable);
|
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" DrcManagerInternal *
|
||||||
extern "C" nn::Result CancelTransfer__Q3_2nn2sl10DrcManagerFv(DrcManagerInternal *);
|
__ct__Q3_2nn2sl10DrcManagerFv(DrcManagerInternal *);
|
||||||
extern "C" nn::Result PushNotification__Q3_2nn2sl10DrcManagerFPbPCQ3_2nn2sl18KillerNotificationbT3L(DrcManagerInternal *, bool *, const KillerNotification *, bool, bool, uint64_t);
|
extern "C" nn::Result
|
||||||
extern "C" nn::Result Transfer__Q3_2nn2sl10DrcManagerFRCQ3_2nn2sl16TransferableInfobQ4_2nn2sl12ITransferrer12TransferMode(DrcManagerInternal *, TransferableInfo *, bool, TransferMode);
|
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(
|
extern "C" nn::Result
|
||||||
DrcManagerInternal *, ITransferrerInternal *, ISettingAccessorInternal *, ITimeAccessorInternal *);
|
Initialize__Q3_2nn2sl10DrcManagerFRQ3_2nn2sl12ITransferrerRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl13ITimeAccessor(
|
||||||
} // namespace details
|
DrcManagerInternal *,
|
||||||
class DrcManager {
|
ITransferrerInternal *,
|
||||||
public:
|
ISettingAccessorInternal *,
|
||||||
DrcManager() : mTransferrer(nullptr),
|
ITimeAccessorInternal *);
|
||||||
mSettingAccessor(nullptr),
|
} // namespace details
|
||||||
mTimeAccessor(nullptr) {
|
class DrcManager
|
||||||
if (__ct__Q3_2nn2sl10DrcManagerFv(&mInstance) != nullptr) {
|
{
|
||||||
mTransferrer = details::TransferrerFromPtr(mInstance.drcTransferrer);
|
public:
|
||||||
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingsAccessor);
|
DrcManager() :
|
||||||
mTimeAccessor = details::TimeAccessorFromPtr(mInstance.timeAccessor);
|
mTransferrer(nullptr),
|
||||||
}
|
mSettingAccessor(nullptr),
|
||||||
}
|
mTimeAccessor(nullptr)
|
||||||
|
{
|
||||||
|
if (__ct__Q3_2nn2sl10DrcManagerFv(&mInstance) != nullptr) {
|
||||||
|
mTransferrer = details::TransferrerFromPtr(mInstance.drcTransferrer);
|
||||||
|
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingsAccessor);
|
||||||
|
mTimeAccessor = details::TimeAccessorFromPtr(mInstance.timeAccessor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
~DrcManager() = default;
|
~DrcManager() = default;
|
||||||
|
|
||||||
details::ITransferrerBase &GetTransferrer() {
|
details::ITransferrerBase &
|
||||||
return mTransferrer;
|
GetTransferrer()
|
||||||
}
|
{
|
||||||
|
return mTransferrer;
|
||||||
|
}
|
||||||
|
|
||||||
details::ISettingAccessorBase &GetSettingAccessor() {
|
details::ISettingAccessorBase &
|
||||||
return mSettingAccessor;
|
GetSettingAccessor()
|
||||||
}
|
{
|
||||||
|
return mSettingAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
details::ITimeAccessorBase &GetTimeAccessor() {
|
details::ITimeAccessorBase &
|
||||||
return mTimeAccessor;
|
GetTimeAccessor()
|
||||||
}
|
{
|
||||||
|
return mTimeAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
nn::Result CancelTransfer() {
|
nn::Result
|
||||||
return CancelTransfer__Q3_2nn2sl10DrcManagerFv(&mInstance);
|
CancelTransfer()
|
||||||
}
|
{
|
||||||
|
return CancelTransfer__Q3_2nn2sl10DrcManagerFv(&mInstance);
|
||||||
|
}
|
||||||
|
|
||||||
nn::Result PushNotification(bool *u1, const KillerNotification *u2, bool u3, bool u4, uint64_t u5) {
|
nn::Result
|
||||||
return PushNotification__Q3_2nn2sl10DrcManagerFPbPCQ3_2nn2sl18KillerNotificationbT3L(&mInstance, u1, u2, u3, u4, u5);
|
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
|
||||||
return Transfer__Q3_2nn2sl10DrcManagerFRCQ3_2nn2sl16TransferableInfobQ4_2nn2sl12ITransferrer12TransferMode(&mInstance, u1, u2, u3);
|
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__Q3_2nn2sl10DrcManagerFRQ3_2nn2sl12ITransferrerRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl13ITimeAccessor(
|
Initialize(details::ITransferrerBase &transferrer, details::ISettingAccessorBase &settingAccessor, details::ITimeAccessorBase &timeAccessor)
|
||||||
&mInstance,
|
{
|
||||||
transferrer.GetInternal(),
|
Initialize__Q3_2nn2sl10DrcManagerFRQ3_2nn2sl12ITransferrerRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl13ITimeAccessor(
|
||||||
settingAccessor.GetInternal(),
|
&mInstance,
|
||||||
timeAccessor.GetInternal());
|
transferrer.GetInternal(),
|
||||||
}
|
settingAccessor.GetInternal(),
|
||||||
|
timeAccessor.GetInternal());
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
details::DrcManagerInternal mInstance = {};
|
details::DrcManagerInternal mInstance = {};
|
||||||
|
|
||||||
details::TransferrerFromPtr mTransferrer;
|
details::TransferrerFromPtr mTransferrer;
|
||||||
details::SettingAccessorFromPtr mSettingAccessor;
|
details::SettingAccessorFromPtr mSettingAccessor;
|
||||||
details::TimeAccessorFromPtr mTimeAccessor;
|
details::TimeAccessorFromPtr mTimeAccessor;
|
||||||
};
|
};
|
||||||
} // namespace nn::sl
|
} // namespace nn::sl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1,73 +1,94 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <wut.h>
|
||||||
#include <coreinit/filesystem.h>
|
#include <coreinit/filesystem.h>
|
||||||
#include <nn/result.h>
|
#include <nn/result.h>
|
||||||
#include <nn/sl/IStream.h>
|
#include <nn/sl/IStream.h>
|
||||||
#include <nn/sl/details/IStreamDetails.h>
|
#include <nn/sl/details/IStreamDetails.h>
|
||||||
#include <wut.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn::sl {
|
namespace nn::sl
|
||||||
namespace details {
|
{
|
||||||
typedef struct WUT_PACKED FileStreamInternal {
|
namespace details
|
||||||
void *vtable;
|
{
|
||||||
FSClient *fsClient;
|
typedef struct WUT_PACKED FileStreamInternal
|
||||||
FSCmdBlock *fsCmdBlock;
|
{
|
||||||
FSFileHandle fileHandle;
|
void *vtable;
|
||||||
} FileStreamInternal;
|
FSClient *fsClient;
|
||||||
WUT_CHECK_SIZE(FileStreamInternal, 0x10);
|
FSCmdBlock *fsCmdBlock;
|
||||||
WUT_CHECK_OFFSET(FileStreamInternal, 0x00, vtable);
|
FSFileHandle fileHandle;
|
||||||
WUT_CHECK_OFFSET(FileStreamInternal, 0x04, fsClient);
|
} FileStreamInternal;
|
||||||
WUT_CHECK_OFFSET(FileStreamInternal, 0x08, fsCmdBlock);
|
WUT_CHECK_SIZE(FileStreamInternal, 0x10);
|
||||||
WUT_CHECK_OFFSET(FileStreamInternal, 0x0C, fileHandle);
|
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" nn::Result
|
||||||
extern "C" FileStreamInternal *__ct__Q3_2nn2sl10FileStreamFv(FileStreamInternal *);
|
Initialize__Q3_2nn2sl10FileStreamFP8FSClientP10FSCmdBlockPCcT3(FileStreamInternal *, FSClient *, FSCmdBlock *, char const *, char const *);
|
||||||
extern "C" void __dt__Q3_2nn2sl10FileStreamFv(FileStreamInternal *, int);
|
extern "C" FileStreamInternal *
|
||||||
} // namespace details
|
__ct__Q3_2nn2sl10FileStreamFv(FileStreamInternal *);
|
||||||
|
extern "C" void
|
||||||
|
__dt__Q3_2nn2sl10FileStreamFv(FileStreamInternal *, int);
|
||||||
|
} // namespace details
|
||||||
|
|
||||||
class FileStream : public details::IStreamBase {
|
class FileStream : public details::IStreamBase
|
||||||
public:
|
{
|
||||||
FileStream() {
|
public:
|
||||||
__ct__Q3_2nn2sl10FileStreamFv(&mInstance);
|
FileStream()
|
||||||
}
|
{
|
||||||
|
__ct__Q3_2nn2sl10FileStreamFv(&mInstance);
|
||||||
|
}
|
||||||
|
|
||||||
~FileStream() override {
|
~FileStream() override
|
||||||
__dt__Q3_2nn2sl10FileStreamFv(&mInstance, 2);
|
{
|
||||||
}
|
__dt__Q3_2nn2sl10FileStreamFv(&mInstance, 2);
|
||||||
|
}
|
||||||
|
|
||||||
nn::Result Read(uint32_t *bytesRead, void *buffer, uint32_t readSize) override {
|
nn::Result
|
||||||
auto *base = reinterpret_cast<details::IStreamInternal *>(&mInstance);
|
Read(uint32_t *bytesRead, void *buffer, uint32_t readSize) override
|
||||||
return base->vtable->ReadFn(base, bytesRead, buffer, readSize);
|
{
|
||||||
}
|
auto *base = reinterpret_cast<details::IStreamInternal *>(&mInstance);
|
||||||
nn::Result Write(uint32_t *bytesWritten, void *buffer, uint32_t readSize) override {
|
return base->vtable->ReadFn(base, bytesRead, buffer, readSize);
|
||||||
auto *base = reinterpret_cast<details::IStreamInternal *>(&mInstance);
|
}
|
||||||
return base->vtable->WriteFn(base, bytesWritten, buffer, readSize);
|
nn::Result
|
||||||
}
|
Write(uint32_t *bytesWritten, void *buffer, uint32_t readSize) override
|
||||||
nn::Result GetSize(uint32_t *fileSize) override {
|
{
|
||||||
auto *base = reinterpret_cast<details::IStreamInternal *>(&mInstance);
|
auto *base = reinterpret_cast<details::IStreamInternal *>(&mInstance);
|
||||||
return base->vtable->GetSizeFn(base, fileSize);
|
return base->vtable->WriteFn(base, bytesWritten, buffer, readSize);
|
||||||
}
|
}
|
||||||
nn::Result Seek(int32_t offset, nn::sl::SeekOrigin seekOrigin) override {
|
nn::Result
|
||||||
auto *base = reinterpret_cast<details::IStreamInternal *>(&mInstance);
|
GetSize(uint32_t *fileSize) override
|
||||||
return base->vtable->SeekFn(base, offset, seekOrigin);
|
{
|
||||||
}
|
auto *base = reinterpret_cast<details::IStreamInternal *>(&mInstance);
|
||||||
|
return base->vtable->GetSizeFn(base, fileSize);
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The given client and cmd must be valid during the whole liftime of the filestream
|
* 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
|
||||||
return Initialize__Q3_2nn2sl10FileStreamFP8FSClientP10FSCmdBlockPCcT3(&mInstance, client, cmdBlock, path, mode);
|
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 *
|
||||||
return reinterpret_cast<details::IStreamInternal *>(&mInstance);
|
GetInternal() override
|
||||||
}
|
{
|
||||||
|
return reinterpret_cast<details::IStreamInternal *>(&mInstance);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
details::FileStreamInternal mInstance = {};
|
details::FileStreamInternal mInstance = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace nn::sl
|
}; // namespace nn::sl
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,55 +1,70 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <wut.h>
|
||||||
#include <nn/result.h>
|
#include <nn/result.h>
|
||||||
#include <nn/sl/details/IAccountInfoAccessorDetails.h>
|
#include <nn/sl/details/IAccountInfoAccessorDetails.h>
|
||||||
#include <wut.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn::sl {
|
namespace nn::sl
|
||||||
class IAccountInfoAccessor : public details::IAccountInfoAccessorBase {
|
{
|
||||||
|
class IAccountInfoAccessor : public details::IAccountInfoAccessorBase
|
||||||
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IAccountInfoAccessor() {
|
IAccountInfoAccessor()
|
||||||
InitInternalVtable();
|
{
|
||||||
}
|
InitInternalVtable();
|
||||||
|
}
|
||||||
|
|
||||||
IAccountInfoAccessor(IAccountInfoAccessor &src) {
|
IAccountInfoAccessor(IAccountInfoAccessor &src)
|
||||||
InitInternalVtable();
|
{
|
||||||
}
|
InitInternalVtable();
|
||||||
|
}
|
||||||
|
|
||||||
IAccountInfoAccessor &operator=(const IAccountInfoAccessor &other) {
|
IAccountInfoAccessor &
|
||||||
InitInternalVtable();
|
operator=(const IAccountInfoAccessor &other)
|
||||||
return *this;
|
{
|
||||||
}
|
InitInternalVtable();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
IAccountInfoAccessor &operator=(IAccountInfoAccessor &&src) noexcept {
|
IAccountInfoAccessor &
|
||||||
InitInternalVtable();
|
operator=(IAccountInfoAccessor &&src) noexcept
|
||||||
return *this;
|
{
|
||||||
}
|
InitInternalVtable();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
~IAccountInfoAccessor() override = default;
|
~IAccountInfoAccessor() override = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static nn::Result GetWrapper(details::IAccountInfoAccessorInternal *instance, AccountInfo *outAccountInfo) {
|
static nn::Result
|
||||||
return instance->vtable->instance->Get(outAccountInfo);
|
GetWrapper(details::IAccountInfoAccessorInternal *instance, AccountInfo *outAccountInfo)
|
||||||
}
|
{
|
||||||
|
return instance->vtable->instance->Get(outAccountInfo);
|
||||||
|
}
|
||||||
|
|
||||||
details::IAccountInfoAccessorInternal *GetInternal() override {
|
details::IAccountInfoAccessorInternal *
|
||||||
return &mInstance;
|
GetInternal() override
|
||||||
}
|
{
|
||||||
|
return &mInstance;
|
||||||
|
}
|
||||||
|
|
||||||
void InitInternalVtable() {
|
void
|
||||||
mVTable = {.instance = this,
|
InitInternalVtable()
|
||||||
.GetFn = &GetWrapper};
|
{
|
||||||
mInstance.vtable = &mVTable;
|
mVTable = {.instance = this,
|
||||||
}
|
.GetFn = &GetWrapper};
|
||||||
|
mInstance.vtable = &mVTable;
|
||||||
|
}
|
||||||
|
|
||||||
details::IAccountInfoAccessorInternal mInstance{};
|
details::IAccountInfoAccessorInternal mInstance{};
|
||||||
details::IAccountInfoAccessorInternalVTable mVTable{};
|
details::IAccountInfoAccessorInternalVTable mVTable{};
|
||||||
};
|
};
|
||||||
|
|
||||||
details::IAccountInfoAccessorBase &GetDefaultAccountInfoAccessor();
|
details::IAccountInfoAccessorBase &
|
||||||
|
GetDefaultAccountInfoAccessor();
|
||||||
} // namespace nn::sl
|
} // namespace nn::sl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1,58 +1,73 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <wut.h>
|
||||||
#include <nn/result.h>
|
#include <nn/result.h>
|
||||||
#include <nn/sl/details/IBlackListAccessorDetails.h>
|
#include <nn/sl/details/IBlackListAccessorDetails.h>
|
||||||
#include <nn/sl/sl_cpp.h>
|
#include <nn/sl/sl_cpp.h>
|
||||||
#include <wut.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
namespace nn::sl {
|
namespace nn::sl
|
||||||
|
{
|
||||||
|
|
||||||
class IBlackListAccessor : public details::IBlackListAccessorBase {
|
class IBlackListAccessor : public details::IBlackListAccessorBase
|
||||||
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IBlackListAccessor() {
|
IBlackListAccessor()
|
||||||
InitInternalVtable();
|
{
|
||||||
}
|
InitInternalVtable();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
IBlackListAccessor(IBlackListAccessor &src) {
|
IBlackListAccessor(IBlackListAccessor &src)
|
||||||
InitInternalVtable();
|
{
|
||||||
}
|
InitInternalVtable();
|
||||||
|
}
|
||||||
|
|
||||||
IBlackListAccessor &operator=(const IBlackListAccessor &other) {
|
IBlackListAccessor &
|
||||||
InitInternalVtable();
|
operator=(const IBlackListAccessor &other)
|
||||||
return *this;
|
{
|
||||||
}
|
InitInternalVtable();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
IBlackListAccessor &operator=(IBlackListAccessor &&src) noexcept {
|
IBlackListAccessor &
|
||||||
InitInternalVtable();
|
operator=(IBlackListAccessor &&src) noexcept
|
||||||
return *this;
|
{
|
||||||
}
|
InitInternalVtable();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
~IBlackListAccessor() override = default;
|
~IBlackListAccessor() override = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static nn::Result GetWrapper(details::IBlackListAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) {
|
static nn::Result
|
||||||
return instance->vtable->instance->Get(outTitleInfos, outTitleInfosSize, maxTitleInfos);
|
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 *
|
||||||
return &mInstance;
|
GetInternal() override
|
||||||
}
|
{
|
||||||
|
return &mInstance;
|
||||||
|
}
|
||||||
|
|
||||||
void InitInternalVtable() {
|
void
|
||||||
mVTable = {.instance = this,
|
InitInternalVtable()
|
||||||
.GetFn = &GetWrapper};
|
{
|
||||||
mInstance.vtable = &mVTable;
|
mVTable = {.instance = this,
|
||||||
}
|
.GetFn = &GetWrapper};
|
||||||
|
mInstance.vtable = &mVTable;
|
||||||
|
}
|
||||||
|
|
||||||
details::IBlackListAccessorInternal mInstance{};
|
details::IBlackListAccessorInternal mInstance{};
|
||||||
details::IBlackListAccessorInternalVTable mVTable{};
|
details::IBlackListAccessorInternalVTable mVTable{};
|
||||||
};
|
};
|
||||||
|
|
||||||
details::IBlackListAccessorBase &GetDefaultBlackListAccessor();
|
details::IBlackListAccessorBase &
|
||||||
|
GetDefaultBlackListAccessor();
|
||||||
} // namespace nn::sl
|
} // namespace nn::sl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user