mirror of
https://github.com/devkitPro/wut.git
synced 2026-04-26 10:01:22 -05:00
Compare commits
116 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 | ||
|
|
ad730b9dcb | ||
|
|
7c93c38731 | ||
|
|
34ad45777a | ||
|
|
bbcf70dbc0 | ||
|
|
c38b84c175 | ||
|
|
55a4708ced | ||
|
|
15b28d8587 | ||
|
|
09e3a2440b | ||
|
|
9a32ef1b65 | ||
|
|
327de261b7 | ||
|
|
8b05ac3410 | ||
|
|
7044eaa8e4 | ||
|
|
29f5093bf0 | ||
|
|
0ae8f8a507 | ||
|
|
4933211d7b | ||
|
|
263c0364d1 | ||
|
|
a1de926fd3 | ||
|
|
c2682dd964 | ||
|
|
8474549331 | ||
|
|
9918fea92a | ||
|
|
09f04f6162 | ||
|
|
e47a996a3b | ||
|
|
4ee360097d | ||
|
|
ed0c91de16 | ||
|
|
f17054e3e8 | ||
|
|
151b1d02d1 | ||
|
|
7520e846ce | ||
|
|
e0854333e8 | ||
|
|
48b6c3b32a | ||
|
|
1da14020ee | ||
|
|
ef057f145b | ||
|
|
474ae04cb9 | ||
|
|
35aa8b7e80 | ||
|
|
382a3b2c81 | ||
|
|
09e36bf299 | ||
|
|
c4368c7822 | ||
|
|
72ec4f790f | ||
|
|
536c584989 | ||
|
|
2ff0ab7e59 | ||
|
|
c2b385cf2c | ||
|
|
c00384924e | ||
|
|
0f33ec2121 | ||
|
|
4e652e196a | ||
|
|
f0582e2e3e | ||
|
|
8e4e1cb41a | ||
|
|
6a1607c0a0 | ||
|
|
bd0156c9ba | ||
|
|
f01a0b87ac | ||
|
|
c1457779be | ||
|
|
e9abab7cd4 | ||
|
|
08cfb34e0b | ||
|
|
669a63bd0c | ||
|
|
b38d014a0c | ||
|
|
31943d2ecd | ||
|
|
32426509d0 | ||
|
|
682f8eb48a | ||
|
|
bd6799f158 | ||
|
|
4edae90d8b | ||
|
|
20ef19297e | ||
|
|
9fda122476 | ||
|
|
fe45347516 | ||
|
|
c1115e51bb | ||
|
|
e20c2e7517 | ||
|
|
1adf4740c7 | ||
|
|
f1019f63a0 | ||
|
|
430e0c700a | ||
|
|
f797d9741e | ||
|
|
5cf5d75699 | ||
|
|
af0ccf48b7 | ||
|
|
8cf1780417 | ||
|
|
9cb0dcdb03 | ||
|
|
951ac0184d | ||
|
|
554e9f5011 | ||
|
|
b98f8fc824 | ||
|
|
922eb4583e | ||
|
|
0dc1d00746 | ||
|
|
aa40d08787 | ||
|
|
ccdc2ea30c | ||
|
|
cb9046e776 | ||
|
|
0406a8377c | ||
|
|
8395fe1474 | ||
|
|
56a6793869 | ||
|
|
095a397e7e | ||
|
|
b408a15fa1 | ||
|
|
708bd46777 | ||
|
|
71437dbfb9 | ||
|
|
8df8e18e76 | ||
|
|
071345feb2 |
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())
|
||||
15
.github/workflows/doc.yml
vendored
15
.github/workflows/doc.yml
vendored
|
|
@ -4,23 +4,32 @@ on:
|
|||
push:
|
||||
tags:
|
||||
- '*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
doc:
|
||||
name: Deploy documentation
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout the Git repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Fetch tags
|
||||
run: |
|
||||
git fetch --tags
|
||||
|
||||
- name: Get current tag
|
||||
id: vars
|
||||
run: echo "tag=`git tag --sort=-version:refname | head -n 1`" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Generate Documentation
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y cmake doxygen doxygen-latex graphviz
|
||||
cd docs
|
||||
sudo cmake .
|
||||
sudo env WUT_VERSION=${{ steps.vars.outputs.tag }} cmake .
|
||||
doxygen Doxyfile.docs >/dev/null
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
|
|
|
|||
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
|
||||
109
CHANGELOG.md
109
CHANGELOG.md
|
|
@ -1,3 +1,112 @@
|
|||
#### wut 1.7.0
|
||||
|
||||
###### New features / improvements
|
||||
* nn/dlp: Add initial headers by @DaniElectra in https://github.com/devkitPro/wut/pull/389
|
||||
* nn/dlp: Fix Initialize functions on ServerPrivate by @DaniElectra in https://github.com/devkitPro/wut/pull/390
|
||||
* nn_ccr: Add `CCRSysSetCurrentLCDMode` and `CCRSysGetCurrentLCDMode` by @Maschell in https://github.com/devkitPro/wut/pull/393
|
||||
* nsysccr/cdc: Add CCRCDCSysGetInfo by @GaryOderNichts in https://github.com/devkitPro/wut/pull/398* nn_acp: Add ACPRemoveSaveDir* by @Andrew1Hawes in https://github.com/devkitPro/wut/pull/394
|
||||
* nn_acp: Add various save related functions by @Maschell in https://github.com/devkitPro/wut/pull/396
|
||||
* Add HDMI CEC functions by @GaryOderNichts in https://github.com/devkitPro/wut/pull/397
|
||||
* Added `OSSetPerformanceMonitor()`. by @dkosmari in https://github.com/devkitPro/wut/pull/400
|
||||
|
||||
###### Fixes and corrections
|
||||
* coreinit/screen: Swap row and column parameters in OSScreenPutFontEx by @capitalistspz in https://github.com/devkitPro/wut/pull/391
|
||||
* camera: corrections and comments by @capitalistspz in https://github.com/devkitPro/wut/pull/392
|
||||
* nn_idb: Fix copy headers, fix nn::idb::IDBReader::Initialize by @Maschell in https://github.com/devkitPro/wut/pull/395
|
||||
* camera: event argument correction by @capitalistspz in https://github.com/devkitPro/wut/pull/399
|
||||
|
||||
## New Contributors
|
||||
* @dkosmari made their first contribution in https://github.com/devkitPro/wut/pull/400
|
||||
|
||||
#### wut 1.6.0
|
||||
|
||||
###### New features / improvements
|
||||
* nn_idb: Implement icon database reading by @Maschell in https://github.com/devkitPro/wut/pull/357
|
||||
* nn_idb: move include into libraries directory by @Maschell in https://github.com/devkitPro/wut/pull/365
|
||||
* wut_types: Implement more operators for `WUT_ENUM_BITMASK_TYPE` by @GaryOderNichts in https://github.com/devkitPro/wut/pull/369
|
||||
* whb/gfx: Use 4:3 TV buffers on 4:3 TVs by @jranderia3 in https://github.com/devkitPro/wut/pull/383
|
||||
|
||||
###### Breaking changes
|
||||
* padscore: rename `nunchuck` -> `nunchuk` in https://github.com/devkitPro/wut/pull/348
|
||||
|
||||
###### CafeOS related changes
|
||||
* More nn_ccr and nsysccr struct/enum fixes by @Maschell in https://github.com/devkitPro/wut/pull/361
|
||||
* Add functions to control the Eco mode by @Maschell in https://github.com/devkitPro/wut/pull/363
|
||||
* nn_sl: Fix wrong parameters for nn::sl::LaunchInfoDatabase::Unregister by @Maschell in https://github.com/devkitPro/wut/pull/362
|
||||
* sysapp: Add all possible "jumpTo" targets for SysAppSettingsArgs by @Maschell in https://github.com/devkitPro/wut/pull/366
|
||||
* nn_ccr: Add CCRSysSetInitBootFlag and CCRSysInitializeSettings, add CCRCDCUicConfigIdEnum values by @Maschell in https://github.com/devkitPro/wut/pull/364
|
||||
* padscore: Add more functions and types in https://github.com/devkitPro/wut/pull/348
|
||||
* nsysccr/cdc: Add language and ext update functions by @GaryOderNichts in https://github.com/devkitPro/wut/pull/368
|
||||
* coreinit: Add __OSPhysicalToEffectiveCached and __OSPhysicalToEffectiveUncached by @Maschell in https://github.com/devkitPro/wut/pull/367
|
||||
* coreinit: Add "SavedFrame" related functions by @Maschell in https://github.com/devkitPro/wut/pull/374
|
||||
* nn_acp: Add ACPGetTitleMetaDir and ACPGetTitleMetaDirByTitleListType by @Maschell in https://github.com/devkitPro/wut/pull/375
|
||||
* coreinit: Add __FSAShimDecodeIosErrorToFsaStatus by @Maschell in https://github.com/devkitPro/wut/pull/378
|
||||
* coreinit: add stopwatch.h and stopwatchatomic.h by @capitalistspz in https://github.com/devkitPro/wut/pull/370
|
||||
* nn_ccr: Add CCRSysCaffeineBootCheckAbort; nsysccr: fix quick start menu value in CCRCDCDrcStateEnum by @Maschell in https://github.com/devkitPro/wut/pull/372
|
||||
* gx2: add GX2GetMainCoreId by @Maschell in https://github.com/devkitPro/wut/pull/380
|
||||
* vpad: Add VPADGetButtonProcMode by @Maschell in https://github.com/devkitPro/wut/pull/376
|
||||
* sndcore2: Update AXTransitionAudioBuffer struct by @Maschell in https://github.com/devkitPro/wut/pull/373
|
||||
* coreinit: Fix wrong/duplicate OSGetCodegenVirtAddrRange declaration, formatting by @Maschell in https://github.com/devkitPro/wut/pull/371
|
||||
* avm: Add some missing DRC functions by @Maschell in https://github.com/devkitPro/wut/pull/379
|
||||
* nsysccr: Add CCRCDCRegister*AttachCallback functions by @Maschell in https://github.com/devkitPro/wut/pull/377
|
||||
* gx2: Add GX2AllocateTilingApertureEx and GX2FreeTilingAperture by @GaryOderNichts in https://github.com/devkitPro/wut/pull/381
|
||||
* nsysnet/netconfig: Add SOGetProxyConfig by @GaryOderNichts in https://github.com/devkitPro/wut/pull/382
|
||||
* gx2: Add GX2GetSystemTVAspectRatio by @GaryOderNichts in https://github.com/devkitPro/wut/pull/384
|
||||
* nsysccr/cdc: Update CCRCDCDrcStateEnum with test menu names by @GaryOderNichts in https://github.com/devkitPro/wut/pull/386
|
||||
* More DRX definitions by @team-orangeBlue in https://github.com/devkitPro/wut/pull/385
|
||||
* nn/uds: Add initial headers by @DaniElectra in https://github.com/devkitPro/wut/pull/387
|
||||
|
||||
#### wut 1.5.0
|
||||
|
||||
###### New features / improvements
|
||||
* wutnewlib: implement abort, assert and assert_func by @Maschell in https://github.com/devkitPro/wut/pull/337 and updated for devkitPPC r45.1 in https://github.com/devkitPro/wut/pull/359
|
||||
|
||||
###### Bug fixes
|
||||
* wutmalloc: make sure to set errno properly on error by @Maschell in https://github.com/devkitPro/wut/pull/347
|
||||
|
||||
###### CafeOS related changes
|
||||
* Add missing language/region values to nn::erreula and nn::swkbd by @Maschell in https://github.com/devkitPro/wut/pull/336
|
||||
* nn_nets2: Add somemopt by @GaryOderNichts in https://github.com/devkitPro/wut/pull/338
|
||||
* coreinit/im: Add IM_SetDeviceState and missing `IMEvent`s by @GaryOderNichts in https://github.com/devkitPro/wut/pull/343
|
||||
* Add AVM and TVE headers, functions and enums by @Andrew1Hawes in https://github.com/devkitPro/wut/pull/345
|
||||
* nn/hpad: Add initial headers by @GaryOderNichts in https://github.com/devkitPro/wut/pull/344
|
||||
* vpad: Fix documentation for VPADRead return value by @GaryOderNichts in https://github.com/devkitPro/wut/pull/346
|
||||
* nn/temp: Fix TEMPTargetPreference by @GaryOderNichts in https://github.com/devkitPro/wut/pull/349
|
||||
* coreinit/mcp: Fix MCPAppType for DRC and DRH by @GaryOderNichts in https://github.com/devkitPro/wut/pull/350
|
||||
* nsysccr/cdc: Add CCRCDCPerSetUicConfig by @GaryOderNichts in https://github.com/devkitPro/wut/pull/351
|
||||
* nsysccr/cdc: Add software functions by @GaryOderNichts in https://github.com/devkitPro/wut/pull/353
|
||||
* nn_ccr/sys: Add fw update functions by @GaryOderNichts in https://github.com/devkitPro/wut/pull/355
|
||||
* padscore: Add missing functions for 7-controller mode by @GaryOderNichts in https://github.com/devkitPro/wut/pull/352
|
||||
* nsysccr/cdc: Implement CCRCDCSysSetDrhState by @Maschell in https://github.com/devkitPro/wut/pull/356
|
||||
* nn/sl: Implement more functions/classes by @Maschell in https://github.com/devkitPro/wut/pull/354
|
||||
* coreinit: Add MEMCheckExpHeap and MEMCheckHeap by @Maschell in https://github.com/devkitPro/wut/pull/358
|
||||
|
||||
|
||||
#### wut 1.4.0
|
||||
|
||||
## What's Changed
|
||||
* nfc: Add initial header by @GaryOderNichts in https://github.com/devkitPro/wut/pull/321
|
||||
* nsysccr/cdc: Add CCRCDCWowlWakeDrc and CCRCDCWakeStateEnum by @Andrew1Hawes in https://github.com/devkitPro/wut/pull/320
|
||||
* Add NTAG by @GaryOderNichts in https://github.com/devkitPro/wut/pull/326
|
||||
* Add system time update functions by @GaryOderNichts in https://github.com/devkitPro/wut/pull/328
|
||||
* Update camera.h by @Fangal-Airbag in https://github.com/devkitPro/wut/pull/329
|
||||
* Add missing GX2 enum values by @GaryOderNichts in https://github.com/devkitPro/wut/pull/327
|
||||
* Add missing optnames and multicast support by @GaryOderNichts in https://github.com/devkitPro/wut/pull/331
|
||||
* procui: Fix ProcUIInForeground and ProcUIIsRunning comments by @Andrew1Hawes in https://github.com/devkitPro/wut/pull/330
|
||||
* Finalize compile commands by @thearst3rd in https://github.com/devkitPro/wut/pull/332
|
||||
|
||||
#### wut 1.3.2
|
||||
|
||||
* Implement wut_set_thread_specific/wut_get_thread_specific as weak functions by @Maschell in https://github.com/devkitPro/wut/pull/324
|
||||
* wutdevoptab: Add support for opening files with more flag combinations by @Maschell in https://github.com/devkitPro/wut/pull/322
|
||||
|
||||
#### wut 1.3.1
|
||||
|
||||
* wutmalloc: Always align allocated memory to 0x40 to match newlib behaviour by @Maschell in https://github.com/devkitPro/wut/pull/316
|
||||
* devoptab_fsa: use c++ headers by @WinterMute in https://github.com/devkitPro/wut/pull/317
|
||||
* Implement __syscall_getreent by @GaryOderNichts in https://github.com/devkitPro/wut/pull/318
|
||||
* coreinit: Add some missing field to the OSThread struct by @Maschell in https://github.com/devkitPro/wut/pull/319
|
||||
|
||||
#### wut 1.3.0
|
||||
|
||||
###### Important changes
|
||||
|
|
|
|||
32
Makefile
32
Makefile
|
|
@ -2,10 +2,6 @@
|
|||
TOPDIR ?= $(CURDIR)
|
||||
include $(TOPDIR)/share/wut_rules
|
||||
|
||||
export WUT_MAJOR := 1
|
||||
export WUT_MINOR := 3
|
||||
export WUT_PATCH := 0
|
||||
|
||||
VERSION := $(WUT_MAJOR).$(WUT_MINOR).$(WUT_PATCH)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
|
@ -20,7 +16,6 @@ TARGET := wut
|
|||
SOURCES := cafe \
|
||||
libraries/wutcrt \
|
||||
libraries/wutnewlib \
|
||||
libraries/wutstdc++ \
|
||||
libraries/wutmalloc \
|
||||
libraries/wutdevoptab \
|
||||
libraries/wutsocket \
|
||||
|
|
@ -29,12 +24,15 @@ SOURCES := cafe \
|
|||
libraries/libgfd/src \
|
||||
libraries/libirc/src \
|
||||
libraries/nn_erreula \
|
||||
libraries/nn_sl \
|
||||
libraries/nn_idb/src \
|
||||
libraries/nn_swkbd
|
||||
DATA := data
|
||||
INCLUDES := include \
|
||||
libraries/libwhb/include \
|
||||
libraries/libgfd/include \
|
||||
libraries/libirc/include
|
||||
libraries/libirc/include \
|
||||
libraries/nn_idb/include
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
|
|
@ -102,21 +100,13 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
|
|||
#---------------------------------------------------------------------------------
|
||||
all: lib/libwut.a lib/libwutd.a
|
||||
|
||||
dist-bin: all
|
||||
@tar --exclude=*~ -cjf wut-$(VERSION).tar.bz2 \
|
||||
include lib share \
|
||||
-C libraries/libwhb include \
|
||||
-C ../libgfd include \
|
||||
-C ../libirc include
|
||||
|
||||
dist-src:
|
||||
@tar --exclude=*~ -cjf wut-src-$(VERSION).tar.bz2 cafe include libraries share Makefile
|
||||
|
||||
dist: dist-src dist-bin
|
||||
|
||||
install: dist-bin
|
||||
mkdir -p $(DESTDIR)$(DEVKITPRO)/wut
|
||||
bzip2 -cd wut-$(VERSION).tar.bz2 | tar -xf - -C $(DESTDIR)$(DEVKITPRO)/wut
|
||||
install: all
|
||||
@mkdir -p $(DESTDIR)$(DEVKITPRO)/wut
|
||||
@cp -frv include lib share $(DESTDIR)$(DEVKITPRO)/wut
|
||||
@cp -frv libraries/libwhb/include $(DESTDIR)$(DEVKITPRO)/wut
|
||||
@cp -frv libraries/nn_idb/include $(DESTDIR)$(DEVKITPRO)/wut
|
||||
@cp -frv libraries/libgfd/include $(DESTDIR)$(DEVKITPRO)/wut
|
||||
@cp -frv libraries/libirc/include $(DESTDIR)$(DEVKITPRO)/wut
|
||||
|
||||
lib:
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ ACPGetTitleMetaXmlByTitleListType
|
|||
ACPGetTitleSaveDir
|
||||
ACPGetTitleSaveDirEx
|
||||
ACPGetTitleSaveDirExWithoutMetaCheck
|
||||
ACPGetTitleSaveMetaXml
|
||||
ACPGetWoodTin
|
||||
ACPImportSaveDataFromBuffer
|
||||
ACPImportSaveDirOfAccountWithEncryption
|
||||
|
|
@ -161,3 +160,4 @@ WaitExternalStorage__Q2_2nn3acpFv
|
|||
|
||||
:TEXT_WRAP
|
||||
ACPGetTitleMetaXml
|
||||
ACPGetTitleSaveMetaXml
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ BETA_DEBUG_SET_DUMP_MODE
|
|||
HPADControlMotor
|
||||
HPADGetGGGGStatus
|
||||
HPADInit
|
||||
HPADRead
|
||||
HPADRecalibrate
|
||||
HPADResetDevice
|
||||
HPADSetConnectCallback
|
||||
|
|
@ -17,3 +16,6 @@ HPADSetGgggConnectCallback
|
|||
HPADSetPowerSupplyCallback
|
||||
HPADSetSamplingCallback
|
||||
HPADShutdown
|
||||
|
||||
:TEXT_WRAP
|
||||
HPADRead
|
||||
|
|
|
|||
|
|
@ -11,4 +11,6 @@ icmp_close_handle
|
|||
icmp_create_handle
|
||||
icmp_last_code_type
|
||||
icmp_ping
|
||||
|
||||
:TEXT_WRAP
|
||||
somemopt
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ inet_ntoa
|
|||
inet_ntoa_r
|
||||
ntohl
|
||||
ntohs
|
||||
set_multicast_state
|
||||
socket_lib_finish
|
||||
socket_lib_init
|
||||
|
||||
|
|
@ -162,7 +163,6 @@ send
|
|||
sendto
|
||||
sendto_multi
|
||||
sendto_multi_ex
|
||||
set_multicast_state
|
||||
set_resolver_allocator
|
||||
setsocklibopt
|
||||
setsockopt
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ NTAGConvertMasterDataToWriteDataForT2T
|
|||
NTAGConvertT2T
|
||||
NTAGCreateAllWriteData
|
||||
NTAGCreateAllWriteDataForT2T
|
||||
NTAGDetect
|
||||
NTAGFormat
|
||||
NTAGInit
|
||||
NTAGInitEx
|
||||
|
|
@ -28,3 +27,6 @@ NTAGWriteT2TLockArea
|
|||
NTAGWriteT2TRawData
|
||||
NTAGWriteT2TRawDataEx
|
||||
NTAGWriteT2TWithConvert
|
||||
|
||||
:TEXT_WRAP
|
||||
NTAGDetect
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ if(DOXYGEN_FOUND)
|
|||
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||
|
||||
set(DOXYGEN_PROJECT_NAME "wut")
|
||||
set(DOXYGEN_PROJECT_NUMBER "1.3.0")
|
||||
set(DOXYGEN_PROJECT_NUMBER $ENV{WUT_VERSION})
|
||||
set(DOXYGEN_PROJECT_BRIEF "Wii U Toolchain")
|
||||
|
||||
set(DOXYGEN_GENERATE_HTML YES)
|
||||
|
|
@ -22,18 +22,23 @@ if(DOXYGEN_FOUND)
|
|||
set(DOXYGEN_RECURSIVE YES)
|
||||
set(DOXYGEN_EXCLUDE_PATTERNS
|
||||
"wut_structsize.h")
|
||||
set(DOXYGEN_EXCLUDE_SYMBOLS
|
||||
"WUT_CHECK_OFFSET"
|
||||
"WUT_CHECK_SIZE"
|
||||
"WUT_PADDING_BYTES"
|
||||
"WUT_UNKNOWN_BYTES"
|
||||
"WUT_UNKNOWN_SIZE")
|
||||
set(DOXYGEN_SOURCE_BROWSER YES)
|
||||
set(DOXYGEN_JAVADOC_AUTOBRIEF YES)
|
||||
set(DOXYGEN_ENUM_VALUES_PER_LINE 1)
|
||||
set(DOXYGEN_CLASS_DIAGRAMS NO)
|
||||
set(DOXYGEN_COLLABORATION_GRAPH NO)
|
||||
set(DOXYGEN_PREDEFINED "__cplusplus")
|
||||
set(DOXYGEN_ENABLE_PREPROCESSING YES)
|
||||
set(DOXYGEN_MACRO_EXPANSION YES)
|
||||
set(DOXYGEN_EXPAND_ONLY_PREDEF YES)
|
||||
set(DOXYGEN_PREDEFINED
|
||||
"__cplusplus;"
|
||||
"WUT_PACKED=;"
|
||||
"WUT_ALIGNAS(x)=;"
|
||||
"WUT_CHECK_OFFSET(Type,Offset,Field)=;"
|
||||
"WUT_CHECK_SIZE(Type,Size)=;"
|
||||
"WUT_PADDING_BYTES(Size)=;"
|
||||
"WUT_UNKNOWN_BYTES(Size)=;"
|
||||
"WUT_UNKNOWN_SIZE(x)=;")
|
||||
|
||||
doxygen_add_docs(docs
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../include"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* \defgroup avm avm
|
||||
*
|
||||
* AVM
|
||||
* Audio/Video Manager
|
||||
*/
|
||||
|
|
|
|||
92
include/avm/cec.h
Normal file
92
include/avm/cec.h
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <tve/cec.h>
|
||||
|
||||
/**
|
||||
* \defgroup avm_cec AVM HDMI CEC
|
||||
* \ingroup avm
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Initializes CEC.
|
||||
*
|
||||
* \return
|
||||
* \c TRUE on success.
|
||||
*/
|
||||
BOOL
|
||||
AVMCECInit(void);
|
||||
|
||||
/**
|
||||
* Enable CEC.
|
||||
*/
|
||||
void
|
||||
AVMEnableCEC(void);
|
||||
|
||||
/**
|
||||
* Disable CEC.
|
||||
*/
|
||||
void
|
||||
AVMDisableCEC(void);
|
||||
|
||||
/**
|
||||
* Sends a CEC command.
|
||||
*
|
||||
* \param destination
|
||||
* Logical address of the device where the command should be sent to.
|
||||
*
|
||||
* \param opCode
|
||||
* The op code of the command to send.
|
||||
*
|
||||
* \param parameters
|
||||
* Pointer to optional command parameters.
|
||||
*
|
||||
* \param numParameters
|
||||
* The amount of additional parameters.
|
||||
*
|
||||
* \return
|
||||
* \c TRUE on success.
|
||||
*/
|
||||
BOOL
|
||||
AVMCECSendCommand(TVECECLogicalAddress destination,
|
||||
TVECECOpCode opCode,
|
||||
uint8_t *parameters,
|
||||
uint8_t numParameters);
|
||||
|
||||
/**
|
||||
* Get the last receieved CEC command.
|
||||
*
|
||||
* \param outInitiator
|
||||
* Pointer to store the logical address of the initiator of the command to.
|
||||
*
|
||||
* \param outOpCode
|
||||
* Pointer to store the op code of the command to.
|
||||
*
|
||||
* \param outParameters
|
||||
* Pointer to store additional parameters to.
|
||||
*
|
||||
* \param numParameters
|
||||
* Pointer to store the amount of additional parameters to.
|
||||
*
|
||||
* \return
|
||||
* \c TRUE on success.
|
||||
*
|
||||
* \warning
|
||||
* This will return success even if no new command has been receieved.
|
||||
* The caller should check that the parameters were actually written to.
|
||||
*/
|
||||
BOOL
|
||||
AVMCECReceiveCommand(TVECECLogicalAddress *outInitiator,
|
||||
TVECECOpCode *outOpCode,
|
||||
uint8_t *outParameters,
|
||||
uint8_t *outNumParameters);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
132
include/avm/config.h
Normal file
132
include/avm/config.h
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <tve/tve.h>
|
||||
#include "tv.h"
|
||||
|
||||
/**
|
||||
* \defgroup avm_config AVM System Config
|
||||
* \ingroup avm
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Reads the TV aspect ratio.
|
||||
*
|
||||
* \param outAspectRatio
|
||||
* Pointer to write the aspect ratio to.
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*/
|
||||
int32_t
|
||||
AVMReadSystemAspectRatioConfig(AVMTvAspectRatio *outAspectRatio);
|
||||
|
||||
/**
|
||||
* Reads the TV port.
|
||||
*
|
||||
* \param outPort
|
||||
* Pointer to write the port to.
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*/
|
||||
int32_t
|
||||
AVMReadSystemPortConfig(TVEPort *outPort);
|
||||
|
||||
/**
|
||||
* Reads the TV under scan.
|
||||
*
|
||||
* \param outUnderScan
|
||||
* Pointer to write the under scan to.
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*/
|
||||
int32_t
|
||||
AVMReadSystemTVUnderScanConfig(uint32_t *outUnderScan);
|
||||
|
||||
/**
|
||||
* Reads the TV resolution.
|
||||
*
|
||||
* \param outResolution
|
||||
* Pointer to write the resolution to.
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*/
|
||||
int32_t
|
||||
AVMReadSystemVideoResConfig(AVMTvResolution *outResolution);
|
||||
|
||||
/**
|
||||
* Writes the TV aspect ratio.
|
||||
*
|
||||
* \param aspectRatio
|
||||
* Must be one of #AVMTvAspectRatio.
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*/
|
||||
int32_t
|
||||
AVMWriteSystemAspectRatioConfig(AVMTvAspectRatio aspectRatio);
|
||||
|
||||
/**
|
||||
* Writes the TV under scan.
|
||||
*
|
||||
* \param underScan
|
||||
* Must be less than \c 0x15 .
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*/
|
||||
int32_t
|
||||
AVMWriteSystemTVUnderScanConfig(uint32_t underScan);
|
||||
|
||||
/**
|
||||
* Writes the TV port and resolution.
|
||||
*
|
||||
* \param port
|
||||
* Must be one of #TVEPort.
|
||||
*
|
||||
* \param resolution
|
||||
* Must be one of:
|
||||
* - #AVM_TV_RESOLUTION_576I
|
||||
* - #AVM_TV_RESOLUTION_480I
|
||||
* - #AVM_TV_RESOLUTION_480P
|
||||
* - #AVM_TV_RESOLUTION_720P
|
||||
* - #AVM_TV_RESOLUTION_1080I
|
||||
* - #AVM_TV_RESOLUTION_1080P
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*/
|
||||
int32_t
|
||||
AVMWriteSystemVideoOutConfig(TVEPort port,
|
||||
AVMTvResolution resolution);
|
||||
|
||||
/**
|
||||
* Writes the TV resolution.
|
||||
*
|
||||
* \param resolution
|
||||
* Must be one of:
|
||||
* - #AVM_TV_RESOLUTION_576I
|
||||
* - #AVM_TV_RESOLUTION_480I
|
||||
* - #AVM_TV_RESOLUTION_480P
|
||||
* - #AVM_TV_RESOLUTION_720P
|
||||
* - #AVM_TV_RESOLUTION_1080I
|
||||
* - #AVM_TV_RESOLUTION_1080P
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*/
|
||||
int32_t
|
||||
AVMWriteSystemVideoResConfig(AVMTvResolution resolution);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
|
@ -26,6 +26,30 @@ typedef enum AVMDrcMode
|
|||
AVM_DRC_MODE_DOUBLE = 2,
|
||||
} AVMDrcMode;
|
||||
|
||||
typedef enum AVMDrcSystemAudioMode
|
||||
{
|
||||
AVM_DRC_SYSTEM_AUDIO_MODE_UNKNOWN_0 = 0, // mono?
|
||||
AVM_DRC_SYSTEM_AUDIO_MODE_UNKNOWN_1 = 1, // stereo?
|
||||
AVM_DRC_SYSTEM_AUDIO_MODE_SURROUND = 2,
|
||||
} AVMDrcSystemAudioMode;
|
||||
|
||||
/**
|
||||
* Uses AVMGetDRCSystemAudioMode internally
|
||||
* @param outAudioMode
|
||||
* @return 0 on success, -2 on error
|
||||
*/
|
||||
int
|
||||
AVMGetSystemDRCAudioMode(AVMDrcSystemAudioMode *outAudioMode);
|
||||
|
||||
BOOL
|
||||
AVMGetDRCSystemAudioMode(AVMDrcSystemAudioMode *outAudioMode);
|
||||
|
||||
uint32_t
|
||||
AVMGetDRCVertCount();
|
||||
|
||||
BOOL
|
||||
AVMIsDRCFirstFlippDone();
|
||||
|
||||
BOOL
|
||||
AVMGetDRCScanMode(AVMDrcScanMode *outScanMode);
|
||||
|
||||
|
|
@ -35,6 +59,12 @@ AVMGetDRCMode(AVMDrcMode *outMode);
|
|||
uint32_t
|
||||
AVMProbeDRCNum(void);
|
||||
|
||||
BOOL
|
||||
AVMSetDRCEnable(BOOL enable);
|
||||
|
||||
BOOL
|
||||
AVMSetDRCGamma(float *gamma);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
265
include/avm/tv.h
Normal file
265
include/avm/tv.h
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <tve/tve.h>
|
||||
|
||||
/**
|
||||
* \defgroup avm_tv TV
|
||||
* \ingroup avm
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum AVMTvAspectRatio
|
||||
{
|
||||
//! 4:3
|
||||
AVM_TV_ASPECT_RATIO_4_3,
|
||||
//! 16:9
|
||||
AVM_TV_ASPECT_RATIO_16_9,
|
||||
} AVMTvAspectRatio;
|
||||
|
||||
typedef enum AVMTvResolution
|
||||
{
|
||||
AVM_TV_RESOLUTION_576I = 1,
|
||||
AVM_TV_RESOLUTION_480I = 2,
|
||||
AVM_TV_RESOLUTION_480P = 3,
|
||||
AVM_TV_RESOLUTION_720P = 4,
|
||||
AVM_TV_RESOLUTION_720P_3D = 5,
|
||||
AVM_TV_RESOLUTION_1080I = 6,
|
||||
AVM_TV_RESOLUTION_1080P = 7,
|
||||
AVM_TV_RESOLUTION_480I_PAL60 = 10,
|
||||
AVM_TV_RESOLUTION_576P = 11,
|
||||
AVM_TV_RESOLUTION_720P_50HZ = 12,
|
||||
AVM_TV_RESOLUTION_1080I_50HZ = 13,
|
||||
AVM_TV_RESOLUTION_1080P_50HZ = 14,
|
||||
} AVMTvResolution;
|
||||
|
||||
typedef enum AVMTvVideoRegion
|
||||
{
|
||||
AVM_TV_VIDEO_REGION_NTSC = 1,
|
||||
AVM_TV_VIDEO_REGION_PAL,
|
||||
} AVMTvVideoRegion;
|
||||
|
||||
/**
|
||||
* Gets the TV video region.
|
||||
*
|
||||
* \return
|
||||
* \c TRUE if the region is set to \link AVM_TV_VIDEO_REGION_NTSC NTSC \endlink.
|
||||
* \c FALSE if the region is set to \link AVM_TV_VIDEO_REGION_PAL PAL \endlink.
|
||||
*/
|
||||
BOOL
|
||||
AVMDebugIsNTSC(void);
|
||||
|
||||
/**
|
||||
* Gets the TV port.
|
||||
*
|
||||
* \param outPort
|
||||
* Pointer to write the port to.
|
||||
*
|
||||
* \return
|
||||
* Always returns \c TRUE .
|
||||
*
|
||||
* \sa
|
||||
* - TVEGetCurrentPort()
|
||||
*/
|
||||
BOOL
|
||||
AVMGetCurrentPort(TVEPort *outPort);
|
||||
|
||||
/**
|
||||
* Gets the HDMI state.
|
||||
*
|
||||
* \param outState
|
||||
* Pointer to write the state to.
|
||||
*
|
||||
* \sa
|
||||
* - TVEGetHDMIErrorStat()
|
||||
*/
|
||||
void
|
||||
AVMGetHDMIState(TVEHdmiState *outState);
|
||||
|
||||
/**
|
||||
* Gets the TV aspect ratio.
|
||||
*
|
||||
* \param outAspectRatio
|
||||
* Pointer to write the aspect ratio to.
|
||||
*
|
||||
* \return
|
||||
* Always returns \c TRUE .
|
||||
*/
|
||||
BOOL
|
||||
AVMGetTVAspectRatio(AVMTvAspectRatio *outAspectRatio);
|
||||
|
||||
/**
|
||||
* Gets the TV resolution.
|
||||
*
|
||||
* \warning
|
||||
* If the resolution is set to #AVM_TV_RESOLUTION_480I_PAL60, this function
|
||||
* will instead output #AVM_TV_RESOLUTION_480I.
|
||||
* If the resolution is set to either #AVM_TV_RESOLUTION_720P_50HZ,
|
||||
* #AVM_TV_RESOLUTION_1080I_50HZ, or #AVM_TV_RESOLUTION_1080P_50HZ, then
|
||||
* \e nothing will be stored to \a outResolution .
|
||||
*
|
||||
* \param outResolution
|
||||
* Pointer to write the resolution to.
|
||||
*
|
||||
* \return
|
||||
* Always returns \c TRUE .
|
||||
*/
|
||||
BOOL
|
||||
AVMGetTVScanMode(AVMTvResolution *outResolution);
|
||||
|
||||
/**
|
||||
* Gets the TV under scan.
|
||||
*
|
||||
* \param outUnderScan
|
||||
* Pointer to write the under scan to.
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or \c -1 on failure.
|
||||
*/
|
||||
int32_t
|
||||
AVMGetTVUnderScan(uint32_t *outUnderScan);
|
||||
|
||||
/**
|
||||
* Determines whether a TV is currently connected and displaying the Wii U source.
|
||||
*
|
||||
* Internally checks that either the #TVEHdmiState is #TVE_HDMI_STATE_DONE or
|
||||
* the analog state is \c 1 , depending on whether the \link TVEPort port \endlink is
|
||||
* set to \link TVE_PORT_HDMI HDMI \endlink or not.
|
||||
*
|
||||
* \return
|
||||
* \c TRUE if a TV is connected, \c FALSE otherwise.
|
||||
*
|
||||
* \sa
|
||||
* - AVMGetHDMIState()
|
||||
* - TVEGetHDMIErrorStat()
|
||||
* - TVEGetAnalogStat()
|
||||
*/
|
||||
BOOL
|
||||
AVMIsAVOutReady(void);
|
||||
|
||||
/**
|
||||
* Sets the TV aspect ratio.
|
||||
*
|
||||
* \param aspectRatio
|
||||
* Must be one of #AVMTvAspectRatio.
|
||||
*
|
||||
* \return
|
||||
* \c TRUE on success or \c FALSE on failure.
|
||||
*/
|
||||
BOOL
|
||||
AVMSetTVAspectRatio(AVMTvAspectRatio aspectRatio);
|
||||
|
||||
/**
|
||||
* Sets whether to show or hide the TV video out.
|
||||
*
|
||||
* \param enable
|
||||
* If \c FALSE then a black image is output (i.e. blanks the screen).
|
||||
* The TV still receives a signal as normal and still plays audio.
|
||||
*
|
||||
* \return
|
||||
* \c TRUE on success or \c FALSE on failure.
|
||||
*/
|
||||
BOOL
|
||||
AVMSetTVEnable(BOOL enable);
|
||||
|
||||
/**
|
||||
* Sets the TV port.
|
||||
*
|
||||
* \param port
|
||||
* Must be one of #TVEPort.
|
||||
*
|
||||
* \param resolution
|
||||
* Must be one of #AVMTvResolution.
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*/
|
||||
int32_t
|
||||
AVMSetTVOutPort(TVEPort port,
|
||||
AVMTvResolution resolution);
|
||||
|
||||
/**
|
||||
* Sets the TV resolution and port.
|
||||
*
|
||||
* \param resolution
|
||||
* Must be one of #AVMTvResolution.
|
||||
*
|
||||
* \param port
|
||||
* Must be one of #TVEPort.
|
||||
*
|
||||
* \return
|
||||
* \c 1 on success.
|
||||
*/
|
||||
int32_t
|
||||
AVMSetTVScanMode(AVMTvResolution resolution,
|
||||
uint32_t unknown,
|
||||
TVEPort port);
|
||||
|
||||
/**
|
||||
* Sets the TV resolution.
|
||||
*
|
||||
* \param resolution
|
||||
* Must be one of #AVMTvResolution.
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*/
|
||||
int32_t
|
||||
AVMSetTVScanResolution(AVMTvResolution resolution);
|
||||
|
||||
/**
|
||||
* Sets the TV under scan.
|
||||
*
|
||||
* \param underScan
|
||||
* Must be less than \c 0x15 .
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*
|
||||
* \sa
|
||||
* - AVMSetTVUnderScanParam()
|
||||
*/
|
||||
int32_t
|
||||
AVMSetTVUnderScan(uint32_t underScan);
|
||||
|
||||
/**
|
||||
* \param underScan
|
||||
* Must be less than \c 0x15 .
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or \c -1 on failure.
|
||||
*
|
||||
* \sa
|
||||
* - AVMSetTVUnderScan()
|
||||
*/
|
||||
int32_t
|
||||
AVMSetTVUnderScanParam(uint32_t underScan);
|
||||
|
||||
/**
|
||||
* Sets the TV video region.
|
||||
*
|
||||
* \param videoRegion
|
||||
* Must be one of #AVMTvVideoRegion.
|
||||
*
|
||||
* \param port
|
||||
* Must be one of #TVEPort.
|
||||
*
|
||||
* \param resolution
|
||||
* Must be one of #AVMTvResolution.
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success or a negative value on error.
|
||||
*/
|
||||
int32_t
|
||||
AVMSetTVVideoRegion(AVMTvVideoRegion videoRegion,
|
||||
TVEPort port,
|
||||
AVMTvResolution resolution);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
|
@ -37,48 +37,88 @@ typedef enum CamError
|
|||
CAMERA_ERROR_OK = 0,
|
||||
CAMERA_ERROR_INVALID_ARG = -1,
|
||||
CAMERA_ERROR_INVALID_HANDLE = -2,
|
||||
CAMERA_ERROR_TOO_MANY_SURFACES = -4,
|
||||
CAMERA_ERROR_INSUFFICIENT_MEMORY = -5,
|
||||
CAMERA_ERROR_NOT_READY = -6,
|
||||
CAMERA_ERROR_UNINITIALIZED = -8,
|
||||
CAMERA_ERROR_UNKNOWN = -10,
|
||||
CAMERA_ERROR_UVC = -9,
|
||||
CAMERA_ERROR_UVD_CONTEXT = -10,
|
||||
CAMERA_ERROR_DEVICE_IN_USE = -12,
|
||||
CAMERA_ERROR_SEGMENT_VIOLATION = -14
|
||||
CAMERA_ERROR_UVD_SESSION = -13,
|
||||
CAMERA_ERROR_SEGMENT_VIOLATION = -15
|
||||
} CamError;
|
||||
|
||||
typedef enum CamFps
|
||||
{
|
||||
CAMERA_FPS_15,
|
||||
CAMERA_FPS_30
|
||||
CAMERA_FPS_15 = 0,
|
||||
CAMERA_FPS_30 = 1
|
||||
} CamFps;
|
||||
|
||||
typedef enum CamStreamType
|
||||
{
|
||||
CAMERA_STREAM_TYPE_1
|
||||
CAMERA_STREAM_TYPE_1 = 0
|
||||
} CamStreamType;
|
||||
|
||||
typedef enum CamEventType
|
||||
{
|
||||
CAMERA_DECODE_DONE = 0,
|
||||
CAMERA_DRC_DETACH = 1
|
||||
} CamEventType;
|
||||
|
||||
struct CAMEventData
|
||||
{
|
||||
CAMError err;
|
||||
void *img;
|
||||
void *arg; // user provided value ??
|
||||
//! Event type
|
||||
CamEventType eventType;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
//! Pointer to the buffer of the decoded image
|
||||
void *surfaceBuffer;
|
||||
//! Handle of instance
|
||||
CAMHandle handle;
|
||||
//! TRUE if decode failed
|
||||
BOOL failed;
|
||||
} decode;
|
||||
struct
|
||||
{
|
||||
//! Will be FALSE
|
||||
BOOL connected;
|
||||
//! Handle of instance
|
||||
CAMHandle handle;
|
||||
} detach;
|
||||
//! Event args
|
||||
uint32_t args[3];
|
||||
};
|
||||
WUT_CHECK_SIZE(CAMEventData, 0x0C);
|
||||
};
|
||||
WUT_CHECK_OFFSET(CAMEventData, 0x00, eventType);
|
||||
WUT_CHECK_OFFSET(CAMEventData, 0x04, decode.surfaceBuffer);
|
||||
WUT_CHECK_OFFSET(CAMEventData, 0x08, decode.handle);
|
||||
WUT_CHECK_OFFSET(CAMEventData, 0x0c, decode.failed);
|
||||
WUT_CHECK_OFFSET(CAMEventData, 0x04, detach.connected);
|
||||
WUT_CHECK_OFFSET(CAMEventData, 0x08, detach.handle);
|
||||
WUT_CHECK_OFFSET(CAMEventData, 0x04, args);
|
||||
WUT_CHECK_SIZE(CAMEventData, 0x10);
|
||||
|
||||
typedef void(*CAMEventHandler)(CAMEventData*);
|
||||
typedef void (*CAMEventHandler)(CAMEventData *camEventData);
|
||||
|
||||
struct CAMMode
|
||||
{
|
||||
int unk_0x00;
|
||||
//! If TRUE, the GamePad will display the camera output regardless of what is being rendered
|
||||
BOOL forceDrc;
|
||||
//! Framerate setting
|
||||
CamFps fps;
|
||||
};
|
||||
WUT_CHECK_OFFSET(CAMMode, 0x00, unk_0x00);
|
||||
WUT_CHECK_OFFSET(CAMMode, 0x00, forceDrc);
|
||||
WUT_CHECK_OFFSET(CAMMode, 0x04, fps);
|
||||
WUT_CHECK_SIZE(CAMMode, 0x08);
|
||||
|
||||
struct CAMWorkMem
|
||||
{
|
||||
int size; // size of the work mem
|
||||
void *pMem; // pointer to the work mem
|
||||
//! Size of the work memory
|
||||
uint32_t size;
|
||||
//! Pointer to the work memory
|
||||
void *pMem;
|
||||
};
|
||||
WUT_CHECK_OFFSET(CAMWorkMem, 0x00, size);
|
||||
WUT_CHECK_OFFSET(CAMWorkMem, 0x04, pMem);
|
||||
|
|
@ -86,9 +126,12 @@ WUT_CHECK_SIZE(CAMWorkMem, 0x08);
|
|||
|
||||
struct CAMStreamInfo
|
||||
{
|
||||
//! Stream type, only CAMERA_STREAM_TYPE_1 is valid
|
||||
CamStreamType type;
|
||||
int height; // stream height
|
||||
int width; // stream width
|
||||
//! Stream height
|
||||
uint32_t height;
|
||||
//! Stream width
|
||||
uint32_t width;
|
||||
};
|
||||
WUT_CHECK_OFFSET(CAMStreamInfo, 0x00, type);
|
||||
WUT_CHECK_OFFSET(CAMStreamInfo, 0x04, height);
|
||||
|
|
@ -97,61 +140,100 @@ WUT_CHECK_SIZE(CAMStreamInfo, 0x0C);
|
|||
|
||||
struct CAMSetupInfo
|
||||
{
|
||||
//! Stream info
|
||||
CAMStreamInfo streamInfo;
|
||||
//! Memory used by library to record and decode frames
|
||||
CAMWorkMem workMem;
|
||||
//! Event handler
|
||||
CAMEventHandler eventHandler;
|
||||
WUT_UNKNOWN_BYTES(4);
|
||||
//! Camera mode
|
||||
CAMMode mode;
|
||||
//! See \link OS_THREAD_ATTRIB \endlink
|
||||
uint32_t threadAffinity;
|
||||
WUT_UNKNOWN_BYTES(0x10);
|
||||
WUT_PADDING_BYTES(0x10);
|
||||
};
|
||||
WUT_CHECK_OFFSET(CAMSetupInfo, 0x00, streamInfo);
|
||||
WUT_CHECK_OFFSET(CAMSetupInfo, 0x0C, workMem);
|
||||
WUT_CHECK_OFFSET(CAMSetupInfo, 0x14, eventHandler);
|
||||
WUT_CHECK_OFFSET(CAMSetupInfo, 0x1C, mode);
|
||||
WUT_CHECK_OFFSET(CAMSetupInfo, 0x24, threadAffinity);
|
||||
WUT_CHECK_SIZE(CAMSetupInfo, 0x38);
|
||||
WUT_CHECK_OFFSET(CAMSetupInfo, 0x18, mode);
|
||||
WUT_CHECK_OFFSET(CAMSetupInfo, 0x20, threadAffinity);
|
||||
WUT_CHECK_SIZE(CAMSetupInfo, 0x34);
|
||||
|
||||
struct CAMSurface
|
||||
{
|
||||
int surfaceSize;
|
||||
//! Number of bytes allocated to surface buffer
|
||||
int32_t surfaceSize;
|
||||
//! Surface buffer data
|
||||
void *surfaceBuffer;
|
||||
int height; // surface height
|
||||
int width; // surface width
|
||||
int unk_0x10; // pitch related?
|
||||
int alignment; // surface alignment
|
||||
int unk_0x18; // surface tile mode related?
|
||||
int unk_0x1C;
|
||||
//! Surface height
|
||||
int32_t height;
|
||||
//! Surface width
|
||||
int32_t width;
|
||||
//! Surface pitch
|
||||
int32_t pitch;
|
||||
//! Surface alignment
|
||||
int32_t alignment;
|
||||
//! Tile mode, should be zero
|
||||
int32_t tileMode;
|
||||
//! Pixel format, Should be zero
|
||||
int32_t pixelFormat;
|
||||
};
|
||||
WUT_CHECK_OFFSET(CAMSurface, 0x00, surfaceSize);
|
||||
WUT_CHECK_OFFSET(CAMSurface, 0x04, surfaceBuffer);
|
||||
WUT_CHECK_OFFSET(CAMSurface, 0x08, height);
|
||||
WUT_CHECK_OFFSET(CAMSurface, 0x0C, width);
|
||||
WUT_CHECK_OFFSET(CAMSurface, 0x10, unk_0x10);
|
||||
WUT_CHECK_OFFSET(CAMSurface, 0x10, pitch);
|
||||
WUT_CHECK_OFFSET(CAMSurface, 0x14, alignment);
|
||||
WUT_CHECK_OFFSET(CAMSurface, 0x18, unk_0x18);
|
||||
WUT_CHECK_OFFSET(CAMSurface, 0x1C, unk_0x1C);
|
||||
WUT_CHECK_OFFSET(CAMSurface, 0x18, tileMode);
|
||||
WUT_CHECK_OFFSET(CAMSurface, 0x1C, pixelFormat);
|
||||
WUT_CHECK_SIZE(CAMSurface, 0x20);
|
||||
|
||||
/**
|
||||
* Initialize the camera
|
||||
* \returns camera handle on success, and -1 on failure
|
||||
*/
|
||||
CAMHandle
|
||||
CAMInit(int instance, CAMSetupInfo *setupInfo, CAMError *err);
|
||||
|
||||
/**
|
||||
* Deinitialize and clean up
|
||||
*/
|
||||
void
|
||||
CAMExit(CAMHandle handle);
|
||||
|
||||
/**
|
||||
* Start recording and decoding frames
|
||||
*/
|
||||
CAMError
|
||||
CAMOpen(CAMHandle handle);
|
||||
|
||||
/**
|
||||
* Stops recording and decoding.
|
||||
* Automatically called when the process is moved to background
|
||||
*/
|
||||
CAMError
|
||||
CAMClose(CAMHandle handle);
|
||||
|
||||
CAMError
|
||||
/**
|
||||
* Get the number of bytes requied by the work memory
|
||||
* \returns number of bytes
|
||||
* \returns CAM_ERROR_INVALID_ARG if streamInfo is NULL
|
||||
*/
|
||||
int32_t
|
||||
CAMGetMemReq(CAMStreamInfo *streamInfo);
|
||||
|
||||
/**
|
||||
* Submit 1 surface to the working queue.
|
||||
* Once the frame is captured and decoded, the event handler set in CAMInit will fire, and the frame will be dequeued.
|
||||
* Up to 20 surfaces may be queued.
|
||||
* Surface data is returned in the NV12 format
|
||||
*/
|
||||
CAMError
|
||||
CAMSubmitTargetSurface(CAMHandle handle, CAMSurface *surface);
|
||||
|
||||
/**
|
||||
* Checks whether memory is segmented correctly to be used with the camera library
|
||||
*/
|
||||
CAMError
|
||||
CAMCheckMemSegmentation(void *pMem, uint32_t size);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include "context.h"
|
||||
#include "threadqueue.h"
|
||||
#include "time.h"
|
||||
#include "context.h"
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_alarms Alarms
|
||||
|
|
|
|||
|
|
@ -12,16 +12,32 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef int32_t BSPError;
|
||||
typedef uint32_t BSPHardwareVersion;
|
||||
typedef uint32_t BSPConsoleTypeRaw;
|
||||
|
||||
typedef enum BSPErrors
|
||||
typedef enum BSPError
|
||||
{
|
||||
BSP_ERROR_OK = 0,
|
||||
BSP_ERROR_OK = 0x0,
|
||||
BSP_ERROR_UNKNOWN_ENTITY = 0x1,
|
||||
BSP_ERROR_UNKNOWN_ATTRIBUTE = 0x2,
|
||||
BSP_ERROR_INVALID_INSTANCE = 0x4,
|
||||
BSP_ERROR_CFG_CORRUPTED = 0x8,
|
||||
BSP_ERROR_DEVICE_ERROR = 0x10,
|
||||
BSP_ERROR_DEVICE_BUSY = 0x20,
|
||||
BSP_ERROR_IOS_ERROR = 0x40,
|
||||
BSP_ERROR_RESPONSE_TOO_LARGE = 0x80,
|
||||
} BSPErrors;
|
||||
BSP_ERROR_SPECIFIED_SIZE_INVALID = 0x80,
|
||||
BSP_ERROR_HEAP_ERROR = 0x100,
|
||||
BSP_ERROR_ENTITY_LIST_FULL = 0x200,
|
||||
BSP_ERROR_UNSUPPORTED_METHOD = 0x400,
|
||||
BSP_ERROR_UNKNOWN_HARDWARE_VERSION = 0x800,
|
||||
BSP_ERROR_QUERY_UNAVAILABLE = 0x1000,
|
||||
BSP_ERROR_UNKNOWN_DEVICE = 0x2000,
|
||||
BSP_ERROR_INVALID_PARAMETER = 0x4000,
|
||||
BSP_ERROR_DEVICE_NOT_FOUND = 0x8000,
|
||||
BSP_ERROR_REQUEST_DENIED = 0x10000,
|
||||
BSP_ERROR_UNSUPPORTED_PARAMETER = 0x20000,
|
||||
BSP_ERROR_BOARD_CONFIG_INVALID = 0x40000,
|
||||
} BSPError;
|
||||
|
||||
typedef enum BSPHardwareVersions
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
|
||||
/**
|
||||
|
|
@ -53,7 +54,7 @@ typedef enum OSCodegenSecMode
|
|||
* - \link OSGetSecCodeGenMode \endlink
|
||||
*/
|
||||
void
|
||||
OSCodegenGetVirtAddrRange(uint32_t* outVirtualAddress,
|
||||
OSGetCodegenVirtAddrRange(void **outVirtualAddress,
|
||||
uint32_t *outSize);
|
||||
|
||||
/**
|
||||
|
|
@ -119,10 +120,9 @@ OSGetSecCodeGenMode();
|
|||
* <!-- NOTE this function has a specific bit required in cox.xml: 1 << 30? -->
|
||||
*/
|
||||
BOOL
|
||||
OSCodegenCopy(void* dst, void* src, size_t size);
|
||||
|
||||
void
|
||||
OSGetCodegenVirtAddrRange(void** outAddr, uint32_t* size);
|
||||
OSCodegenCopy(void *dst,
|
||||
void *src,
|
||||
size_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ extern "C" {
|
|||
//! A bitfield of enum OS_CONTEXT_STATE.
|
||||
typedef uint16_t OSContextState;
|
||||
|
||||
enum OS_CONTEXT_STATE {
|
||||
enum OS_CONTEXT_STATE
|
||||
{
|
||||
OS_CONTEXT_STATE_OSCALLBACK = 1 << 3,
|
||||
OS_CONTEXT_STATE_USERMODE_SAVED = 1 << 4
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,6 +14,15 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Can be used to mask the return value of
|
||||
* \ref OSGetConsoleType
|
||||
* for determining the "group" of console. See the function for more
|
||||
* information around the values the mask gives.
|
||||
*/
|
||||
#define OS_CONSOLE_TYPE_MASK 0xF0000000
|
||||
|
||||
|
||||
/**
|
||||
* Gets the number of cores in the system. On a retail Wii U, this is always 3.
|
||||
*
|
||||
|
|
@ -58,6 +67,22 @@ BOOL
|
|||
OSIsMainCore();
|
||||
|
||||
|
||||
/**
|
||||
* Get the type of console this code is actively running on.
|
||||
*
|
||||
* Most of the field is relatively unknown but you can use
|
||||
* \ref OS_CONSOLE_TYPE_MASK
|
||||
* which returns whether the unit is a Retail/CAT-R unit with `0x00000000`,
|
||||
* a CAT-DEV or other CAFE development board with `0x10000000`, and an
|
||||
* orchestrax unit with `0x20000000`.
|
||||
*
|
||||
* \returns
|
||||
* A number representing the specific console types.
|
||||
*/
|
||||
uint32_t
|
||||
OSGetConsoleType();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -12,14 +12,16 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum COSReportLevel{
|
||||
typedef enum COSReportLevel
|
||||
{
|
||||
COS_REPORT_LEVEL_ERROR = 0,
|
||||
COS_REPORT_LEVEL_WARN = 1,
|
||||
COS_REPORT_LEVEL_INFO = 2,
|
||||
COS_REPORT_LEVEL_VERBOSE = 3,
|
||||
} COSReportLevel;
|
||||
|
||||
typedef enum COSReportModule{
|
||||
typedef enum COSReportModule
|
||||
{
|
||||
COS_REPORT_MODULE_UNKNOWN_0 = 0,
|
||||
COS_REPORT_MODULE_UNKNOWN_1 = 1,
|
||||
COS_REPORT_MODULE_UNKNOWN_2 = 2,
|
||||
|
|
@ -30,27 +32,32 @@ void
|
|||
COSVReport(COSReportModule module,
|
||||
COSReportLevel level,
|
||||
const char *fmt,
|
||||
...);
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(3, 4);
|
||||
|
||||
void
|
||||
COSError(COSReportModule module,
|
||||
const char *fmt,
|
||||
...);
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(2, 3);
|
||||
|
||||
void
|
||||
COSInfo(COSReportModule module,
|
||||
const char *fmt,
|
||||
...);
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(2, 3);
|
||||
|
||||
void
|
||||
COSVerbose(COSReportModule module,
|
||||
const char *fmt,
|
||||
...);
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(2, 3);
|
||||
|
||||
void
|
||||
COSWarn(COSReportModule module,
|
||||
const char *fmt,
|
||||
...);
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(2, 3);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OSFatalError OSFatalError;
|
||||
|
||||
typedef void (*DisassemblyPrintFn)(const char *fmt, ...);
|
||||
|
||||
typedef uint32_t (*DisassemblyFindSymbolFn)(uint32_t addr, char *symbolNameBuf, uint32_t symbolNameBufSize);
|
||||
|
|
@ -20,6 +22,39 @@ typedef enum DisassemblePPCFlags
|
|||
DISASSEMBLE_PPC_FLAGS_NONE = 0,
|
||||
} DisassemblePPCFlags;
|
||||
|
||||
typedef enum OSFatalErrorMessageType
|
||||
{
|
||||
OS_FATAL_ERROR_UNKOWN = 0,
|
||||
OS_FATAL_ERROR_GENERAL = 1,
|
||||
|
||||
//! These are only valid for errorCode 1600200 - 1609999
|
||||
OS_FATAL_ERROR_CORRUPTION = 2,
|
||||
OS_FATAL_ERROR_FATAL_SYSTEM_OR_USB = 3,
|
||||
OS_FATAL_ERROR_CORRUPTION_SLC = 4,
|
||||
OS_FATAL_ERROR_CORRUPTION_USB = 5,
|
||||
OS_FATAL_ERROR_STORAGE_REMOVED = 6,
|
||||
OS_FATAL_ERROR_DISC_REMOVED = 7,
|
||||
OS_FATAL_ERROR_CORRUPTION_DISC = 8,
|
||||
OS_FATAL_ERROR_WRITE_PROTECT = 9,
|
||||
} OSFatalErrorMessageType;
|
||||
|
||||
struct OSFatalError
|
||||
{
|
||||
OSFatalErrorMessageType messageType;
|
||||
uint32_t errorCode;
|
||||
uint32_t processId;
|
||||
uint32_t internalErrorCode;
|
||||
uint32_t line;
|
||||
char functionName[64];
|
||||
WUT_UNKNOWN_BYTES(0x80);
|
||||
};
|
||||
WUT_CHECK_OFFSET(OSFatalError, 0x00, messageType);
|
||||
WUT_CHECK_OFFSET(OSFatalError, 0x04, errorCode);
|
||||
WUT_CHECK_OFFSET(OSFatalError, 0x08, processId);
|
||||
WUT_CHECK_OFFSET(OSFatalError, 0x0C, internalErrorCode);
|
||||
WUT_CHECK_OFFSET(OSFatalError, 0x10, line);
|
||||
WUT_CHECK_OFFSET(OSFatalError, 0x14, functionName);
|
||||
WUT_CHECK_SIZE(OSFatalError, 0xD4);
|
||||
|
||||
void
|
||||
OSConsoleWrite(const char *msg,
|
||||
|
|
@ -30,30 +65,40 @@ __OSConsoleWrite(const char *msg,
|
|||
uint32_t size);
|
||||
|
||||
void
|
||||
OSReport(const char *fmt, ...);
|
||||
OSReport(const char *fmt, ...)
|
||||
WUT_FORMAT_PRINTF(1, 2);
|
||||
|
||||
|
||||
void
|
||||
OSReportVerbose(const char *fmt, ...);
|
||||
OSReportVerbose(const char *fmt, ...)
|
||||
WUT_FORMAT_PRINTF(1, 2);
|
||||
|
||||
|
||||
void
|
||||
OSReportInfo(const char *fmt, ...);
|
||||
OSReportInfo(const char *fmt, ...)
|
||||
WUT_FORMAT_PRINTF(1, 2);
|
||||
|
||||
|
||||
void
|
||||
OSReportWarn(const char *fmt, ...);
|
||||
OSReportWarn(const char *fmt, ...)
|
||||
WUT_FORMAT_PRINTF(1, 2);
|
||||
|
||||
|
||||
void
|
||||
OSPanic(const char *file,
|
||||
uint32_t line,
|
||||
const char *fmt, ...);
|
||||
const char *fmt,
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(3, 4);
|
||||
|
||||
|
||||
void
|
||||
OSFatal(const char *msg);
|
||||
|
||||
void
|
||||
OSSendFatalError(OSFatalError *error,
|
||||
const char *functionName,
|
||||
uint32_t line);
|
||||
|
||||
uint32_t
|
||||
OSGetSymbolName(uint32_t addr,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ typedef enum OSDynLoad_Error
|
|||
typedef OSDynLoad_Error (*OSDynLoadAllocFn)(int32_t size, int32_t align, void **outAddr);
|
||||
typedef void (*OSDynLoadFreeFn)(void *addr);
|
||||
|
||||
typedef enum OSDynLoad_ExportType {
|
||||
typedef enum OSDynLoad_ExportType
|
||||
{
|
||||
OS_DYNLOAD_EXPORT_FUNC = 0,
|
||||
OS_DYNLOAD_EXPORT_DATA = 1,
|
||||
} OSDynLoad_ExportType;
|
||||
|
|
@ -130,7 +131,8 @@ struct OSDynLoad_LoaderSectionInfo
|
|||
uint32_t flags;
|
||||
void *address;
|
||||
|
||||
union {
|
||||
union
|
||||
{
|
||||
//! Size of the section, set when type != SHT_RPL_IMPORTS
|
||||
uint32_t size;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
void
|
||||
RPLWRAP(exit)(int code);
|
||||
// clang-format on
|
||||
|
||||
void
|
||||
_Exit(int code);
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
typedef void (*OSFiberEntryFn)();
|
||||
typedef void (*OSFiberExEntryFn)(uint32_t arg1, uint32_t arg2,
|
||||
uint32_t arg3, uint32_t arg4);
|
||||
typedef void (*OSFiberExEntryFn)(uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4);
|
||||
|
||||
int32_t
|
||||
OSSwitchFiber(OSFiberEntryFn entry,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <coreinit/alarm.h>
|
||||
#include <coreinit/fastmutex.h>
|
||||
#include <coreinit/ios.h>
|
||||
#include <coreinit/messagequeue.h>
|
||||
#include <coreinit/time.h>
|
||||
#include <coreinit/ios.h>
|
||||
#include <coreinit/fastmutex.h>
|
||||
#include <coreinit/alarm.h>
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_fs Filesystem
|
||||
|
|
@ -181,7 +181,8 @@ typedef enum FSVolumeState
|
|||
FS_VOLUME_STATE_INVALID = 11,
|
||||
} FSVolumeState;
|
||||
|
||||
typedef enum FSMediaState {
|
||||
typedef enum FSMediaState
|
||||
{
|
||||
FS_MEDIA_STATE_READY = 0,
|
||||
FS_MEDIA_STATE_NO_MEDIA = 1,
|
||||
FS_MEDIA_STATE_INVALID_MEDIA = 2,
|
||||
|
|
@ -189,9 +190,11 @@ typedef enum FSMediaState {
|
|||
FS_MEDIA_STATE_MEDIA_ERROR = 4,
|
||||
} FSMediaState;
|
||||
|
||||
typedef enum FSMountSourceType {
|
||||
typedef enum FSMountSourceType
|
||||
{
|
||||
FS_MOUNT_SOURCE_SD = 0,
|
||||
FS_MOUNT_SOURCE_UNK = 1,
|
||||
//! Devkit only API currently. Uses the PCFS channel to perform I/O operations on the attached host machine.
|
||||
FS_MOUNT_SOURCE_HFIO = 1,
|
||||
} FSMountSourceType;
|
||||
|
||||
typedef enum FSOpenFileFlags
|
||||
|
|
@ -397,7 +400,8 @@ WUT_CHECK_OFFSET(FSAsyncResult, 0x20, block);
|
|||
WUT_CHECK_OFFSET(FSAsyncResult, 0x24, status);
|
||||
WUT_CHECK_SIZE(FSAsyncResult, 0x28);
|
||||
|
||||
struct FSCmdBlockBody {
|
||||
struct FSCmdBlockBody
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x96C);
|
||||
FSAsyncResult asyncResult;
|
||||
WUT_UNKNOWN_BYTES(0x68);
|
||||
|
|
@ -419,7 +423,8 @@ struct FSMountSource
|
|||
};
|
||||
WUT_CHECK_SIZE(FSMountSource, 0x300);
|
||||
|
||||
struct WUT_PACKED FSVolumeInfo {
|
||||
struct WUT_PACKED FSVolumeInfo
|
||||
{
|
||||
uint32_t flags;
|
||||
FSMediaState mediaState;
|
||||
WUT_UNKNOWN_BYTES(0x4);
|
||||
|
|
@ -450,7 +455,8 @@ WUT_CHECK_SIZE(FSVolumeInfo, 444);
|
|||
* Get an aligned FSClientBody from an FSClient.
|
||||
*/
|
||||
static inline FSClientBody *
|
||||
FSGetClientBody(FSClient *client) {
|
||||
FSGetClientBody(FSClient *client)
|
||||
{
|
||||
if (!client) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -461,7 +467,8 @@ FSGetClientBody(FSClient *client) {
|
|||
* Get an aligned FSCmdBlockBody from an FSCmdBlock.
|
||||
*/
|
||||
static inline FSCmdBlockBody *
|
||||
FSGetCmdBlockBody(FSCmdBlock *cmdBlock) {
|
||||
FSGetCmdBlockBody(FSCmdBlock *cmdBlock)
|
||||
{
|
||||
if (!cmdBlock) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include "wut.h"
|
||||
#include <wut.h>
|
||||
#include "filesystem.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
@ -83,7 +82,8 @@ typedef void (*FSAAsyncCallbackFn)(FSError result,
|
|||
/**
|
||||
* Block information.
|
||||
*/
|
||||
struct FSABlockInfo {
|
||||
struct FSABlockInfo
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x14);
|
||||
};
|
||||
WUT_CHECK_SIZE(FSABlockInfo, 0x14);
|
||||
|
|
@ -91,7 +91,8 @@ WUT_CHECK_SIZE(FSABlockInfo, 0x14);
|
|||
/**
|
||||
* Device information.
|
||||
*/
|
||||
struct FSADeviceInfo {
|
||||
struct FSADeviceInfo
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x08);
|
||||
uint64_t deviceSizeInSectors;
|
||||
uint32_t deviceSectorSize;
|
||||
|
|
@ -104,19 +105,22 @@ WUT_CHECK_SIZE(FSADeviceInfo, 0x28);
|
|||
/**
|
||||
* File System information.
|
||||
*/
|
||||
struct FSAFileSystemInfo {
|
||||
struct FSAFileSystemInfo
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x1E);
|
||||
};
|
||||
WUT_CHECK_SIZE(FSAFileSystemInfo, 0x1E);
|
||||
|
||||
typedef enum FSAMountPriority {
|
||||
typedef enum FSAMountPriority
|
||||
{
|
||||
FSA_MOUNT_PRIORITY_BASE = 0x1,
|
||||
FSA_MOUNT_PRIORITY_RAM_DISK_CACHE = 0x4,
|
||||
FSA_MOUNT_PRIORITY_TITLE_UPDATE = 0x9,
|
||||
FSA_MOUNT_PRIORITY_UNMOUNT_ALL = 0x80000000,
|
||||
} FSAMountPriority;
|
||||
|
||||
typedef enum FSAQueryInfoType {
|
||||
typedef enum FSAQueryInfoType
|
||||
{
|
||||
FSA_QUERY_INFO_FREE_SPACE_SIZE = 0x0,
|
||||
FSA_QUERY_INFO_DIR_SIZE = 0x1,
|
||||
FSA_QUERY_INFO_ENTRY_NUM = 0x2,
|
||||
|
|
@ -128,12 +132,14 @@ typedef enum FSAQueryInfoType {
|
|||
FSA_QUERY_INFO_FRAGMENT_BLOCK_INFO = 0x8,
|
||||
} FSAQueryInfoType;
|
||||
|
||||
typedef enum FSAReadFlag {
|
||||
typedef enum FSAReadFlag
|
||||
{
|
||||
FSA_READ_FLAG_NONE = 0x0,
|
||||
FSA_READ_FLAG_READ_WITH_POS = 0x1
|
||||
} FSAReadFlag;
|
||||
|
||||
typedef enum FSAWriteFlag {
|
||||
typedef enum FSAWriteFlag
|
||||
{
|
||||
FSA_WRITE_FLAG_NONE = 0x0,
|
||||
FSA_WRITE_FLAG_READ_WITH_POS = 0x1
|
||||
} FSAWriteFlag;
|
||||
|
|
@ -152,19 +158,22 @@ WUT_CHECK_OFFSET(FSAProcessInfo, 0x08, processId);
|
|||
WUT_CHECK_OFFSET(FSAProcessInfo, 0x0C, groupId);
|
||||
WUT_CHECK_SIZE(FSAProcessInfo, 0x10);
|
||||
|
||||
struct FSARequestRawOpen {
|
||||
struct FSARequestRawOpen
|
||||
{
|
||||
char path[0x280];
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestRawOpen, 0x0, path);
|
||||
WUT_CHECK_SIZE(FSARequestRawOpen, 0x280);
|
||||
|
||||
struct FSARequestRawClose {
|
||||
struct FSARequestRawClose
|
||||
{
|
||||
int32_t handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestRawClose, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSARequestRawClose, 0x04);
|
||||
|
||||
struct WUT_PACKED FSARequestRawRead {
|
||||
struct WUT_PACKED FSARequestRawRead
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x4);
|
||||
uint64_t blocks_offset;
|
||||
uint32_t count;
|
||||
|
|
@ -177,7 +186,8 @@ WUT_CHECK_OFFSET(FSARequestRawRead, 0x10, size);
|
|||
WUT_CHECK_OFFSET(FSARequestRawRead, 0x14, device_handle);
|
||||
WUT_CHECK_SIZE(FSARequestRawRead, 0x18);
|
||||
|
||||
struct WUT_PACKED FSARequestRawWrite {
|
||||
struct WUT_PACKED FSARequestRawWrite
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x4);
|
||||
uint64_t blocks_offset;
|
||||
uint32_t count;
|
||||
|
|
@ -572,10 +582,12 @@ WUT_CHECK_OFFSET(FSARequestChangeOwner, 0x284, owner);
|
|||
WUT_CHECK_OFFSET(FSARequestChangeOwner, 0x28C, group);
|
||||
WUT_CHECK_SIZE(FSARequestChangeOwner, 0x290);
|
||||
|
||||
struct FSARequest {
|
||||
struct FSARequest
|
||||
{
|
||||
FSError emulatedError;
|
||||
|
||||
union {
|
||||
union
|
||||
{
|
||||
FSARequestRawOpen rawOpen;
|
||||
FSARequestRawClose rawClose;
|
||||
FSARequestRawRead rawRead;
|
||||
|
|
@ -616,7 +628,8 @@ WUT_CHECK_OFFSET(FSARequest, 0x04, rawOpen);
|
|||
WUT_CHECK_SIZE(FSARequest, 0x520);
|
||||
|
||||
|
||||
struct FSAResponseRawOpen {
|
||||
struct FSAResponseRawOpen
|
||||
{
|
||||
int handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponseRawOpen, 0x0, handle);
|
||||
|
|
@ -652,7 +665,8 @@ WUT_CHECK_SIZE(FSAResponseGetVolumeInfo, 0x1BC);
|
|||
|
||||
struct WUT_PACKED FSAResponseGetInfoByQuery
|
||||
{
|
||||
union WUT_PACKED {
|
||||
union WUT_PACKED
|
||||
{
|
||||
FSABlockInfo badBlockInfo;
|
||||
FSADeviceInfo deviceInfo;
|
||||
uint64_t dirSize;
|
||||
|
|
@ -703,9 +717,11 @@ struct FSAResponseStatFile
|
|||
WUT_CHECK_OFFSET(FSAResponseStatFile, 0x0, stat);
|
||||
WUT_CHECK_SIZE(FSAResponseStatFile, 0x64);
|
||||
|
||||
struct WUT_PACKED FSAResponse {
|
||||
struct WUT_PACKED FSAResponse
|
||||
{
|
||||
uint32_t word0;
|
||||
union WUT_PACKED {
|
||||
union WUT_PACKED
|
||||
{
|
||||
FSAResponseRawOpen rawOpen;
|
||||
FSAResponseGetCwd getCwd;
|
||||
FSAResponseGetFileBlockAddress getFileBlockAddress;
|
||||
|
|
@ -723,7 +739,8 @@ WUT_CHECK_OFFSET(FSAResponse, 0x0, word0);
|
|||
WUT_CHECK_OFFSET(FSAResponse, 0x4, rawOpen);
|
||||
WUT_CHECK_SIZE(FSAResponse, 0x293);
|
||||
|
||||
enum FSACommandEnum {
|
||||
enum FSACommandEnum
|
||||
{
|
||||
FSA_COMMAND_INVALID = 0x0,
|
||||
FSA_COMMAND_MOUNT = 0x1,
|
||||
FSA_COMMAND_UNMOUNT = 0x2,
|
||||
|
|
@ -791,12 +808,14 @@ enum FSACommandEnum {
|
|||
FSA_COMMAND_SEND_PROFILE_CMD = 0x8E,
|
||||
};
|
||||
|
||||
enum FSAIpcRequestTypeEnum {
|
||||
enum FSAIpcRequestTypeEnum
|
||||
{
|
||||
FSA_IPC_REQUEST_IOCTL = 0,
|
||||
FSA_IPC_REQUEST_IOCTLV = 1,
|
||||
};
|
||||
|
||||
struct FSAAsyncResult {
|
||||
struct FSAAsyncResult
|
||||
{
|
||||
//! Queue to put a message on when command is complete.
|
||||
OSMessageQueue *ioMsgQueue;
|
||||
|
||||
|
|
@ -831,7 +850,8 @@ WUT_CHECK_OFFSET(FSAAsyncResult, 0x24, response);
|
|||
WUT_CHECK_OFFSET(FSAAsyncResult, 0x28, userContext);
|
||||
WUT_CHECK_SIZE(FSAAsyncResult, 0x2C);
|
||||
|
||||
struct WUT_PACKED FSAShimBuffer {
|
||||
struct WUT_PACKED FSAShimBuffer
|
||||
{
|
||||
//! Buffer for FSA IPC request.
|
||||
FSARequest request;
|
||||
WUT_UNKNOWN_BYTES(0x60);
|
||||
|
|
@ -880,7 +900,8 @@ typedef void (*FSAClientAttachAsyncCallbackFn)(FSError result,
|
|||
FSAResponse *response,
|
||||
void *userContext);
|
||||
|
||||
struct FSAClientAttachAsyncData {
|
||||
struct FSAClientAttachAsyncData
|
||||
{
|
||||
//! Callback to call when an attach has happened.
|
||||
FSAClientAttachAsyncCallbackFn userCallback;
|
||||
|
||||
|
|
@ -895,13 +916,15 @@ WUT_CHECK_OFFSET(FSAClientAttachAsyncData, 0x04, userContext);
|
|||
WUT_CHECK_OFFSET(FSAClientAttachAsyncData, 0x08, ioMsgQueue);
|
||||
WUT_CHECK_SIZE(FSAClientAttachAsyncData, 0xC);
|
||||
|
||||
typedef enum FSAMountFlags {
|
||||
typedef enum FSAMountFlags
|
||||
{
|
||||
FSA_MOUNT_FLAG_LOCAL_MOUNT = 0,
|
||||
FSA_MOUNT_FLAG_BIND_MOUNT = 1,
|
||||
FSA_MOUNT_FLAG_GLOBAL_MOUNT = 2,
|
||||
} FSAMountFlags;
|
||||
|
||||
typedef enum FSAUnmountFlags {
|
||||
typedef enum FSAUnmountFlags
|
||||
{
|
||||
FSA_UNMOUNT_FLAG_NONE = 0x00000000,
|
||||
FSA_UNMOUNT_FLAG_FORCE = 0x00000002,
|
||||
FSA_UNMOUNT_FLAG_BIND_MOUNT = 0x80000000,
|
||||
|
|
@ -925,6 +948,10 @@ FSADelClient(FSAClientHandle client);
|
|||
const char *
|
||||
FSAGetStatusStr(FSError error);
|
||||
|
||||
FSError
|
||||
__FSAShimDecodeIosErrorToFsaStatus(IOSHandle handle,
|
||||
IOSError err);
|
||||
|
||||
FSError
|
||||
FSAFlushMultiQuota(FSAClientHandle client,
|
||||
const char *path);
|
||||
|
|
|
|||
|
|
@ -16,8 +16,28 @@ extern "C" {
|
|||
typedef struct IMRequest IMRequest;
|
||||
typedef struct IMHomeButtonParams IMHomeButtonParams;
|
||||
typedef struct IMParameters IMParameters;
|
||||
typedef struct IMDeviceStateEx IMDeviceStateEx;
|
||||
typedef uint32_t IMEventMask;
|
||||
|
||||
typedef enum IMPadType
|
||||
{
|
||||
IM_PAD_TYPE_NONE = 0,
|
||||
IM_PAD_TYPE_WII_REMOTE = 1,
|
||||
IM_PAD_TYPE_WIIU_PRO_CONTROLLER = 2,
|
||||
IM_PAD_TYPE_WII_REMOTE_EXTENSION = 3,
|
||||
IM_PAD_TYPE_WIIU_GAMEPAD = 4,
|
||||
} IMPadType;
|
||||
|
||||
typedef enum IMDeviceState
|
||||
{
|
||||
IM_DEVICE_STATE_CLEAR = 0,
|
||||
IM_DEVICE_STATE_INACTIVE = 1,
|
||||
IM_DEVICE_STATE_ACTIVE = 2,
|
||||
IM_DEVICE_STATE_HOME = 3,
|
||||
IM_DEVICE_STATE_POWER = 4,
|
||||
IM_DEVICE_STATE_SYNC = 5,
|
||||
} IMDeviceState;
|
||||
|
||||
struct WUT_PACKED IMRequest
|
||||
{
|
||||
uint8_t args[0x80];
|
||||
|
|
@ -42,8 +62,13 @@ WUT_CHECK_SIZE(IMRequest, 0xB4);
|
|||
|
||||
struct IMHomeButtonParams
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x8);
|
||||
//! The controller type which pressed the home button
|
||||
IMPadType type;
|
||||
//! The controller index which pressed the home button
|
||||
int32_t index;
|
||||
};
|
||||
WUT_CHECK_OFFSET(IMHomeButtonParams, 0x0, type);
|
||||
WUT_CHECK_OFFSET(IMHomeButtonParams, 0x4, index);
|
||||
WUT_CHECK_SIZE(IMHomeButtonParams, 0x8);
|
||||
|
||||
struct IMParameters
|
||||
|
|
@ -61,6 +86,15 @@ WUT_CHECK_OFFSET(IMParameters, 0x0C, apdEnabled);
|
|||
WUT_CHECK_OFFSET(IMParameters, 0x10, apdPeriod);
|
||||
WUT_CHECK_SIZE(IMParameters, 0x14);
|
||||
|
||||
struct IMDeviceStateEx
|
||||
{
|
||||
IMDeviceState state;
|
||||
IMHomeButtonParams params;
|
||||
};
|
||||
WUT_CHECK_OFFSET(IMDeviceStateEx, 0x0, state);
|
||||
WUT_CHECK_OFFSET(IMDeviceStateEx, 0x4, params);
|
||||
WUT_CHECK_SIZE(IMDeviceStateEx, 0xC);
|
||||
|
||||
typedef enum IMParameter
|
||||
{
|
||||
IM_PARAMETER_INACTIVE_SECONDS = 0,
|
||||
|
|
@ -85,14 +119,21 @@ typedef enum IMTimer
|
|||
|
||||
typedef enum IMEvent
|
||||
{
|
||||
IM_EVENT_UNK1 = 1 << 1,
|
||||
IM_EVENT_UNK2 = 1 << 2,
|
||||
IM_EVENT_UNK3 = 1 << 3,
|
||||
IM_EVENT_ACTIVE = 1 << 0,
|
||||
IM_EVENT_INACTIVE = 1 << 1,
|
||||
IM_EVENT_DIM = 1 << 2,
|
||||
IM_EVENT_UNDIM = 1 << 3,
|
||||
//! Automatic power down
|
||||
IM_EVENT_APD = 1 << 4,
|
||||
IM_EVENT_UNK5 = 1 << 5,
|
||||
IM_EVENT_UNK6 = 1 << 6,
|
||||
//! Controller power button was pressed
|
||||
IM_EVENT_POWER = 1 << 5,
|
||||
//! Home button was pressed
|
||||
IM_EVENT_HOME = 1 << 6,
|
||||
//! Console sync button was pressed
|
||||
IM_EVENT_SYNC = 1 << 7,
|
||||
IM_EVENT_UNK8 = 1 << 8,
|
||||
IM_EVENT_RESET = 1 << 8,
|
||||
//! Event notify was cancelled
|
||||
IM_EVENT_CANCELLED = 1 << 31,
|
||||
} IMEvent;
|
||||
|
||||
IOSHandle
|
||||
|
|
@ -172,6 +213,20 @@ IM_CancelGetEventNotify(IOSHandle handle,
|
|||
IOSAsyncCallbackFn asyncCallback,
|
||||
void *asyncCallbackContext);
|
||||
|
||||
IOSError
|
||||
IM_SetDeviceState(IOSHandle handle,
|
||||
IMRequest *request,
|
||||
IMDeviceState state,
|
||||
IOSAsyncCallbackFn asyncCallback,
|
||||
void *asyncCallbackContext);
|
||||
|
||||
IOSError
|
||||
IM_SetDeviceStateEx(IOSHandle handle,
|
||||
IMRequest *request,
|
||||
IMDeviceStateEx *state,
|
||||
IOSAsyncCallbackFn asyncCallback,
|
||||
void *asyncCallbackContext);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,7 +6,11 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
int
|
||||
__os_snprintf(char *buf, size_t n, const char *format, ... );
|
||||
__os_snprintf(char *buf,
|
||||
size_t n,
|
||||
const char *format,
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(3, 4);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include "mutex.h"
|
||||
#include "ios.h"
|
||||
#include "mutex.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -17,7 +17,8 @@ typedef struct IPCBufPool IPCBufPool;
|
|||
*
|
||||
* Functions similar to a ring buffer.
|
||||
*/
|
||||
struct IPCBufPoolFIFO {
|
||||
struct IPCBufPoolFIFO
|
||||
{
|
||||
//! The current message index to push to.
|
||||
int32_t pushIndex;
|
||||
|
||||
|
|
@ -43,7 +44,8 @@ WUT_CHECK_SIZE(IPCBufPoolFIFO, 0x14);
|
|||
/**
|
||||
* Attributes returned by IPCBufPoolGetAttributes.
|
||||
*/
|
||||
struct IPCBufPoolAttributes {
|
||||
struct IPCBufPoolAttributes
|
||||
{
|
||||
//! Size of a message in the buffer pool.
|
||||
uint32_t messageSize;
|
||||
|
||||
|
|
@ -63,7 +65,8 @@ WUT_CHECK_SIZE(IPCBufPoolAttributes, 0x0C);
|
|||
/**
|
||||
* A simple message buffer pool used for IPC communication.
|
||||
*/
|
||||
struct IPCBufPool {
|
||||
struct IPCBufPool
|
||||
{
|
||||
//! Magic header always set to IPCBufPool::MagicHeader.
|
||||
uint32_t magic;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum OSICICommand {
|
||||
typedef enum OSICICommand
|
||||
{
|
||||
OS_ICI_COMMAND_INVALID_IC_RANGE = 1,
|
||||
OS_ICI_COMMAND_RESCHEDULE_CORE = 2,
|
||||
OS_ICI_COMMAND_HALT_CORE = 3,
|
||||
|
|
@ -36,7 +37,8 @@ typedef void (*KernelTimerCallbackFn)(OSExceptionType exception, OSContext *inte
|
|||
|
||||
typedef uint32_t KernelTimerHandle;
|
||||
|
||||
typedef struct OSExceptionChainInfo {
|
||||
typedef struct OSExceptionChainInfo
|
||||
{
|
||||
OSExceptionCallbackExFn callback;
|
||||
void *stack;
|
||||
OSContext *context;
|
||||
|
|
@ -46,8 +48,10 @@ WUT_CHECK_OFFSET(OSExceptionChainInfo, 4, stack);
|
|||
WUT_CHECK_OFFSET(OSExceptionChainInfo, 8, context);
|
||||
WUT_CHECK_SIZE(OSExceptionChainInfo, 12);
|
||||
|
||||
typedef struct KernelInfo0 {
|
||||
struct CoreinitInfo {
|
||||
typedef struct KernelInfo0
|
||||
{
|
||||
struct CoreinitInfo
|
||||
{
|
||||
void *loaderHandle;
|
||||
void *textAddr;
|
||||
uint32_t textOffset;
|
||||
|
|
@ -127,7 +131,8 @@ WUT_CHECK_OFFSET(KernelInfo0, 0x9C, unk0x9C);
|
|||
WUT_CHECK_OFFSET(KernelInfo0, 0xA0, titleId);
|
||||
WUT_CHECK_SIZE(KernelInfo0, 0xA8);
|
||||
|
||||
typedef struct KernelInfo6 {
|
||||
typedef struct KernelInfo6
|
||||
{
|
||||
uint64_t osTitleId;
|
||||
uint32_t unk0x08;
|
||||
WUT_PADDING_BYTES(0x108 - 0xC);
|
||||
|
|
@ -136,14 +141,33 @@ WUT_CHECK_OFFSET(KernelInfo6, 0x00, osTitleId);
|
|||
WUT_CHECK_OFFSET(KernelInfo6, 0x08, unk0x08);
|
||||
WUT_CHECK_SIZE(KernelInfo6, 0x108);
|
||||
|
||||
void __KernelSetUserModeExHandler(OSExceptionType exceptionType, OSExceptionChainInfo *chainInfo, OSExceptionChainInfo *prevChainInfo);
|
||||
void
|
||||
__KernelSetUserModeExHandler(OSExceptionType exceptionType,
|
||||
OSExceptionChainInfo *chainInfo,
|
||||
OSExceptionChainInfo *prevChainInfo);
|
||||
|
||||
KernelTimerHandle __KernelAllocateTimer(KernelTimerCallbackFn, void *exceptionStack, OSContext *context);
|
||||
uint32_t __KernelPrimeTimer(KernelTimerHandle handle, uint64_t startTimeInTicks, uint64_t intervalInTicks, uint32_t unknown);
|
||||
KernelTimerHandle
|
||||
__KernelAllocateTimer(KernelTimerCallbackFn,
|
||||
void *exceptionStack,
|
||||
OSContext *context);
|
||||
|
||||
void __KernelSendICI(OSICICommand cmd, void *arg1, uint32_t unknown1, uint32_t unknown2);
|
||||
uint32_t
|
||||
__KernelPrimeTimer(KernelTimerHandle handle,
|
||||
uint64_t startTimeInTicks,
|
||||
uint64_t intervalInTicks,
|
||||
uint32_t unknown);
|
||||
|
||||
void __KernelGetInfo(uint32_t type, void *outBuffer, uint32_t outBufferSize, uint32_t core);
|
||||
void
|
||||
__KernelSendICI(OSICICommand cmd,
|
||||
void *arg1,
|
||||
uint32_t unknown1,
|
||||
uint32_t unknown2);
|
||||
|
||||
void
|
||||
__KernelGetInfo(uint32_t type,
|
||||
void *outBuffer,
|
||||
uint32_t outBufferSize,
|
||||
uint32_t core);
|
||||
|
||||
static inline void
|
||||
__KernelGetInfo0(KernelInfo0 *outBuffer, uint32_t core)
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ typedef enum MCPAppType
|
|||
MCP_APP_TYPE_BOOT1 = 0x10000009,
|
||||
MCP_APP_TYPE_SYSTEM_LIBRARIES = 0x1000000A,
|
||||
MCP_APP_TYPE_BLUETOOTH_FIRMWARE = 0x10000012,
|
||||
MCP_APP_TYPE_DRH_FIRMWARE = 0x10000013,
|
||||
MCP_APP_TYPE_DRC_FIRMWARE = 0x10000014,
|
||||
MCP_APP_TYPE_DRC_FIRMWARE = 0x10000013,
|
||||
MCP_APP_TYPE_DRH_FIRMWARE = 0x10000014,
|
||||
MCP_APP_TYPE_SYSTEM_VERSION = 0x10000015,
|
||||
MCP_APP_TYPE_DRC_LANGUAGE = 0x1000001A,
|
||||
MCP_APP_TYPE_EXCEPTIONS_DATA = 0x18000010,
|
||||
|
|
@ -63,9 +63,11 @@ typedef enum MCPAppType
|
|||
|
||||
typedef enum MCPDeviceType
|
||||
{
|
||||
MCP_DEVICE_TYPE_AUTO = 1, /* returns result for ODD, MLC and USB */
|
||||
MCP_DEVICE_TYPE_ODD = 2,
|
||||
MCP_DEVICE_TYPE_MLC = 3,
|
||||
MCP_DEVICE_TYPE_USB = 4,
|
||||
/* any value >= 5 is MCP_DEVICE_TYPE_AUTO */
|
||||
} MCPDeviceType;
|
||||
|
||||
typedef enum MCPDeviceFlags
|
||||
|
|
@ -100,6 +102,16 @@ typedef enum MCPCompatAVFile
|
|||
MCP_COMPAT_AV_FILE_DEINT = 0x01,
|
||||
} MCPCompatAVFile;
|
||||
|
||||
typedef enum MCPSystemMode
|
||||
{
|
||||
//! This unit is in 'retail'/'production' mode.
|
||||
MCP_PRODUCTION = 0x00,
|
||||
//! This unit is in 'development' mode (default for CAT-DEV).
|
||||
MCP_DEVELOPMENT = 0x01,
|
||||
//! This unit is in 'test' mode.
|
||||
MCP_TEST = 0x02,
|
||||
} MCPSystemMode;
|
||||
|
||||
struct WUT_PACKED MCPDevice
|
||||
{
|
||||
char type[8];
|
||||
|
|
@ -239,6 +251,10 @@ MCPError
|
|||
MCP_GetOwnTitleInfo(int32_t handle,
|
||||
MCPTitleListType *titleInfo);
|
||||
|
||||
MCPError
|
||||
MCP_GetSystemMode(int32_t handle,
|
||||
MCPSystemMode *mode);
|
||||
|
||||
MCPError
|
||||
MCP_GetSysProdSettings(int32_t handle,
|
||||
MCPSysProdSettings *settings);
|
||||
|
|
@ -310,7 +326,7 @@ MCP_TitleListByUniqueId(int32_t handle,
|
|||
|
||||
MCPError
|
||||
MCP_TitleListByDevice(int32_t handle,
|
||||
const char *device,
|
||||
const char *deviceName,
|
||||
uint32_t *outTitleCount,
|
||||
MCPTitleListType *titleList,
|
||||
uint32_t titleListSizeBytes);
|
||||
|
|
@ -324,7 +340,7 @@ MCP_TitleListByDeviceType(int32_t handle,
|
|||
MCPError
|
||||
MCP_TitleListByAppAndDevice(int32_t handle,
|
||||
MCPAppType appType,
|
||||
const char *device,
|
||||
const char *deviceName,
|
||||
uint32_t *outTitleCount,
|
||||
MCPTitleListType *titleList,
|
||||
uint32_t titleListSizeBytes);
|
||||
|
|
@ -358,6 +374,44 @@ MCP_CompatLoadAVFile(int32_t handle,
|
|||
uint32_t *size,
|
||||
MCPCompatAVFile file);
|
||||
|
||||
/**
|
||||
* Saves the current Cafe log to the SLC logs directory.
|
||||
* Internally calls IOS_Ioctl() with request \c 0xCD .
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success.
|
||||
*/
|
||||
MCPError
|
||||
MCP_TriggerCrashLogCollection(int32_t handle);
|
||||
|
||||
/**
|
||||
* Sets values to /storage_slc/sys/config/eco.xml
|
||||
*
|
||||
* \return
|
||||
* \c 0 on success.
|
||||
*/
|
||||
MCPError
|
||||
MCP_ChangeEcoSettings(int32_t handle,
|
||||
uint32_t enable,
|
||||
uint32_t maxOnTime,
|
||||
uint16_t defaultOffTime);
|
||||
|
||||
static inline const char *
|
||||
MCP_GetDeviceNameByDeviceType(MCPDeviceType deviceType)
|
||||
{
|
||||
switch (deviceType) {
|
||||
case MCP_DEVICE_TYPE_AUTO:
|
||||
return "auto";
|
||||
case MCP_DEVICE_TYPE_ODD:
|
||||
return "odd";
|
||||
case MCP_DEVICE_TYPE_MLC:
|
||||
return "mlc";
|
||||
case MCP_DEVICE_TYPE_USB:
|
||||
return "usb";
|
||||
}
|
||||
return "auto";
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
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
|
||||
uint32_t numFreeBlocks;
|
||||
|
||||
WUT_PADDING_BYTES(0xC);
|
||||
};
|
||||
WUT_CHECK_OFFSET(MEMBlockHeap, 0x00, header);
|
||||
WUT_CHECK_OFFSET(MEMBlockHeap, 0x40, defaultTrack);
|
||||
|
|
@ -83,7 +85,7 @@ WUT_CHECK_OFFSET(MEMBlockHeap, 0x64, firstBlock);
|
|||
WUT_CHECK_OFFSET(MEMBlockHeap, 0x68, lastBlock);
|
||||
WUT_CHECK_OFFSET(MEMBlockHeap, 0x6C, firstFreeBlock);
|
||||
WUT_CHECK_OFFSET(MEMBlockHeap, 0x70, numFreeBlocks);
|
||||
WUT_CHECK_SIZE(MEMBlockHeap, 0x74);
|
||||
WUT_CHECK_SIZE(MEMBlockHeap, 0x80);
|
||||
|
||||
MEMHeapHandle
|
||||
MEMInitBlockHeap(MEMBlockHeap *heap,
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@ typedef struct MEMExpHeap MEMExpHeap;
|
|||
typedef struct MEMExpHeapBlock MEMExpHeapBlock;
|
||||
typedef struct MEMExpHeapBlockList MEMExpHeapBlockList;
|
||||
|
||||
typedef void (*MEMExpHeapBlockVisitor)(void *block, MEMHeapHandle heap,
|
||||
void *context);
|
||||
typedef void (*MEMExpHeapBlockVisitor)(void *block, MEMHeapHandle heap, void *context);
|
||||
|
||||
typedef enum MEMExpHeapMode
|
||||
{
|
||||
|
|
@ -31,6 +30,12 @@ typedef enum MEMExpHeapDirection
|
|||
MEM_EXP_HEAP_DIR_FROM_BOTTOM = 1,
|
||||
} MEMExpHeapDirection;
|
||||
|
||||
typedef enum MEMExpHeapCheckFlags
|
||||
{
|
||||
MEM_EXP_HEAP_CHECK_FLAGS_NONE = 0,
|
||||
MEM_EXP_HEAP_CHECK_FLAGS_LOG_ERRORS = 1,
|
||||
} MEMExpHeapCheckFlags;
|
||||
|
||||
struct MEMExpHeapBlock
|
||||
{
|
||||
uint32_t attribs;
|
||||
|
|
@ -131,6 +136,10 @@ MEMVisitAllocatedForExpHeap(MEMHeapHandle heap,
|
|||
MEMExpHeapBlockVisitor callback,
|
||||
void *context);
|
||||
|
||||
BOOL
|
||||
MEMCheckExpHeap(MEMHeapHandle handle,
|
||||
MEMExpHeapCheckFlags mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include "spinlock.h"
|
||||
#include "memlist.h"
|
||||
#include "spinlock.h"
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_memheap Common Memory Heap
|
||||
* \ingroup coreinit
|
||||
*
|
||||
* Common memory heap fucntions.
|
||||
* Common memory heap functions.
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
|
@ -144,6 +144,12 @@ void
|
|||
MEMSetFillValForHeap(MEMHeapFillType type,
|
||||
uint32_t value);
|
||||
|
||||
/**
|
||||
* Checks the heap for corruption
|
||||
*/
|
||||
BOOL
|
||||
MEMCheckHeap(MEMHeapHandle handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ typedef enum OSMemoryMapMode
|
|||
uint32_t
|
||||
OSEffectiveToPhysical(uint32_t virtualAddress);
|
||||
|
||||
uint32_t
|
||||
__OSPhysicalToEffectiveCached(uint32_t physicalAddress);
|
||||
|
||||
uint32_t
|
||||
__OSPhysicalToEffectiveUncached(uint32_t physicalAddress);
|
||||
|
||||
BOOL
|
||||
OSIsAddressValid(uint32_t virtualAddress);
|
||||
|
||||
|
|
|
|||
206
include/coreinit/performancemonitor.h
Normal file
206
include/coreinit/performancemonitor.h
Normal file
|
|
@ -0,0 +1,206 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_performancemonitor Performance Monitor
|
||||
* \ingroup coreinit
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/// Used to tell OSSetPerformanceMonitor() which arguments are valid.
|
||||
typedef enum OSPerfMonArg
|
||||
{
|
||||
OS_PM_ARG_MMCR0 = 1u << 0u,
|
||||
OS_PM_ARG_MMCR1 = 1u << 1u,
|
||||
OS_PM_ARG_PMC1 = 1u << 2u,
|
||||
OS_PM_ARG_PMC2 = 1u << 3u,
|
||||
OS_PM_ARG_PMC3 = 1u << 4u,
|
||||
OS_PM_ARG_PMC4 = 1u << 5u,
|
||||
} OSPerfMonArg;
|
||||
|
||||
/**
|
||||
* Flags to write to (U)MMCR0 register.
|
||||
*
|
||||
* \sa OSSetPerformanceMonitor
|
||||
*/
|
||||
typedef enum OSPerfMonMMCR0Flags
|
||||
{
|
||||
OS_PM_MMCR0_PMC1_CURRENT = 0b0000000u << 6,
|
||||
OS_PM_MMCR0_PMC1_CPU_CYCLES = 0b0000001u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED = 0b0000010u << 6,
|
||||
OS_PM_MMCR0_PMC1_TBL_RISING_TRANSITIONS = 0b0000011u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_DISPATCHED = 0b0000100u << 6,
|
||||
OS_PM_MMCR0_PMC1_EIEIO_INSTRUCTIONS_COMPLETED = 0b0000101u << 6,
|
||||
OS_PM_MMCR0_PMC1_ITLB_SEARCH_CYCLES = 0b0000110u << 6,
|
||||
OS_PM_MMCR0_PMC1_L2_HITS = 0b0000111u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_EA_DELIVERED = 0b0001000u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED_MATCHES_IABR = 0b0001001u << 6,
|
||||
OS_PM_MMCR0_PMC1_SLOW_L1_MISSES = 0b0001010u << 6,
|
||||
OS_PM_MMCR0_PMC1_UNRESOLVED_BRANCHES = 0b0001011u << 6,
|
||||
OS_PM_MMCR0_PMC1_UNRESOLVED_STALL_CYCLES = 0b0001100u << 6,
|
||||
OS_PM_MMCR0_PMC1_L1_SHARED_STORES = 0b0001110u << 6,
|
||||
OS_PM_MMCR0_PMC1_L2_SHARED_INTERVENTIONS = 0b0001111u << 6,
|
||||
OS_PM_MMCR0_PMC1_CACHE_PARADOXES = 0b0010000u << 6,
|
||||
OS_PM_MMCR0_PMC1_CIU_LOAD_REQUESTS = 0b0010100u << 6,
|
||||
OS_PM_MMCR0_PMC1_BIU_ADDRESS_ONLY_REQUESTS = 0b0010101u << 6,
|
||||
OS_PM_MMCR0_PMC1_CIU_PARADOXES = 0b0010110u << 6,
|
||||
OS_PM_MMCR0_PMC1_60XE_BUS_DATA_BEATS = 0b0010111u << 6,
|
||||
|
||||
OS_PM_MMCR0_PMC2_CURRENT = 0b000000u,
|
||||
OS_PM_MMCR0_PMC2_CPU_CYCLES = 0b000001u,
|
||||
OS_PM_MMCR0_PMC2_INSTRUCTIONS_COMPLETED = 0b000010u,
|
||||
OS_PM_MMCR0_PMC2_TBL_RISING_TRANSITIONS = 0b000011u,
|
||||
OS_PM_MMCR0_PMC2_INSTRUCTIONS_DISPATCHED = 0b000100u,
|
||||
OS_PM_MMCR0_PMC2_L1_ICACHE_MISSES = 0b000101u,
|
||||
OS_PM_MMCR0_PMC2_ITLB_MISSES = 0b000110u,
|
||||
OS_PM_MMCR0_PMC2_L2_INSTRUCTION_MISSES = 0b000111u,
|
||||
OS_PM_MMCR0_PMC2_PRED_BRANCHES_NOT_TAKEN = 0b001000u,
|
||||
OS_PM_MMCR0_PMC2_RESERVED_LOADS = 0b001010u,
|
||||
OS_PM_MMCR0_PMC2_LOADS_AND_STORES = 0b001011u,
|
||||
OS_PM_MMCR0_PMC2_CACHE_SNOOPS = 0b001100u,
|
||||
OS_PM_MMCR0_PMC2_L1_TO_L2_CASTOUTS = 0b001101u,
|
||||
OS_PM_MMCR0_PMC2_SYSTEM_UNIT_INSTRUCTIONS = 0b001110u,
|
||||
OS_PM_MMCR0_PMC2_L1_INSTRUCTION_MISS_CYCLES = 0b001111u,
|
||||
OS_PM_MMCR0_PMC2_FIRST_SPECULATIVE_BRANCH_RESOLVES = 0b010000u,
|
||||
OS_PM_MMCR0_PMC2_L2_SHARED_STORES = 0b010001u,
|
||||
OS_PM_MMCR0_PMC2_L1_SHARED_INTERVENTIONS = 0b010010u,
|
||||
OS_PM_MMCR0_PMC2_CIU_STORE_REQUESTS = 0b010100u,
|
||||
OS_PM_MMCR0_PMC2_SLOW_OUTSTANDING_BIU_TRANSACTIONS = 0b010101u,
|
||||
OS_PM_MMCR0_PMC2_CIU_MODIFIED_INTERVENTIONS = 0b010110u,
|
||||
} OSPerfMonMMCR0Flags;
|
||||
|
||||
/**
|
||||
* Flags to write to (U)MMCR1 register.
|
||||
*
|
||||
* \sa OSSetPerformanceMonitor
|
||||
*/
|
||||
typedef enum OSPerfMonMMCR1Flags
|
||||
{
|
||||
OS_PM_MMCR1_PMC3_CURRENT = 0b00000u << 27,
|
||||
OS_PM_MMCR1_PMC3_CPU_CYCLES = 0b00001u << 27,
|
||||
OS_PM_MMCR1_PMC3_INSTRUCTIONS_COMPLETED = 0b00010u << 27,
|
||||
OS_PM_MMCR1_PMC3_TBL_RISING_TRANSITIONS = 0b00011u << 27,
|
||||
OS_PM_MMCR1_PMC3_INSTRUCTIONS_DISPATCHED = 0b00100u << 27,
|
||||
OS_PM_MMCR1_PMC3_L1_DCACHE_MISSES = 0b00101u << 27,
|
||||
OS_PM_MMCR1_PMC3_DTLB_MISSES = 0b00110u << 27,
|
||||
OS_PM_MMCR1_PMC3_L2_DATA_MISSES = 0b00111u << 27,
|
||||
OS_PM_MMCR1_PMC3_PRED_BRANCHES_TAKEN = 0b01000u << 27,
|
||||
OS_PM_MMCR1_PMC3_COND_STORES_COMPLETED = 0b01010u << 27,
|
||||
OS_PM_MMCR1_PMC3_FPU_INSTRUCTIONS_COMPLETED = 0b01011u << 27,
|
||||
OS_PM_MMCR1_PMC3_L2_CASTOUTS_BY_SNOOPS = 0b01100u << 27,
|
||||
OS_PM_MMCR1_PMC3_L2_CACHE_OPERATIONS = 0b01101u << 27,
|
||||
OS_PM_MMCR1_PMC3_L1_LOAD_MISS_CYCLES = 0b01111u << 27,
|
||||
OS_PM_MMCR1_PMC3_SECOND_SPECULATIVE_BRANCH_RESOLVES = 0b10000u << 27,
|
||||
OS_PM_MMCR1_PMC3_BPU_STALL_LR_CR_CYCLES = 0b10001u << 27,
|
||||
OS_PM_MMCR1_PMC3_L1_MODIFIED_INTERVENTIONS = 0b10010u << 27,
|
||||
OS_PM_MMCR1_PMC3_ICBI_SNOOPS = 0b10011u << 27,
|
||||
OS_PM_MMCR1_PMC3_CIU_ADDRESS_ONLY_REQUESTS = 0b10100u << 27,
|
||||
OS_PM_MMCR1_PMC3_BIU_LOAD_REQUESTS = 0b10101u << 27,
|
||||
OS_PM_MMCR1_PMC3_CIU_SHARED_INTERVENTIONS = 0b10110u << 27,
|
||||
|
||||
OS_PM_MMCR1_PMC4_CURRENT = 0b00000u << 22,
|
||||
OS_PM_MMCR1_PMC4_CPU_CYCLES = 0b00001u << 22,
|
||||
OS_PM_MMCR1_PMC4_INSTRUCTIONS_COMPLETED = 0b00010u << 22,
|
||||
OS_PM_MMCR1_PMC4_TBL_RISING_TRANSITIONS = 0b00011u << 22,
|
||||
OS_PM_MMCR1_PMC4_INSTRUCTIONS_DISPATCHED = 0b00100u << 22,
|
||||
OS_PM_MMCR1_PMC4_L2_CASTOUTS = 0b00101u << 22,
|
||||
OS_PM_MMCR1_PMC4_DTLB_SEARCH_CYCLES = 0b00110u << 22,
|
||||
OS_PM_MMCR1_PMC4_BRANCHES_MISPREDICTED = 0b01000u << 22,
|
||||
OS_PM_MMCR1_PMC4_INTACT_COND_STORES_COMPLETED = 0b01010u << 22,
|
||||
OS_PM_MMCR1_PMC4_SYNC_INSTRUCTIONS_COMPLETED = 0b01011u << 22,
|
||||
OS_PM_MMCR1_PMC4_SNOOP_RETRIES = 0b01100u << 22,
|
||||
OS_PM_MMCR1_PMC4_INTEGER_OPERATIONS = 0b01101u << 22,
|
||||
OS_PM_MMCR1_PMC4_BPU_STALL_TWO_BRANCHES_CYCLES = 0b01110u << 22,
|
||||
OS_PM_MMCR1_PMC4_L2_MODIFIED_INTERVENTIONS = 0b10000u << 22,
|
||||
OS_PM_MMCR1_PMC4_TLBIE_SNOOPS = 0b10001u << 22,
|
||||
OS_PM_MMCR1_PMC4_L2_BANK_REFRESH_OVERFLOWS = 0b10010u << 22,
|
||||
OS_PM_MMCR1_PMC4_CIU_ARTRY_COUNT = 0b10100u << 22,
|
||||
OS_PM_MMCR1_PMC4_BIU_STORE_REQUESTS = 0b10101u << 22,
|
||||
OS_PM_MMCR1_PMC4_CIU_TWO_CORE_SHARED_INTERVENTIONS = 0b10110u << 22,
|
||||
} OSPerfMonMMCR1Flags;
|
||||
|
||||
/**
|
||||
* Write to performance monitor registers.
|
||||
*
|
||||
* Performance monitor registers can only be written by the kernel, this allows userspace
|
||||
* to write to them.
|
||||
*
|
||||
* \param arg_mask OR-ed values from `OSPerfMonArg`, indicating which of the following
|
||||
* arguments are to be written to registers.
|
||||
*
|
||||
* \param mmcr0 OR-ed values from `OSPerfMonMMCR0Flags` to write to register MMCR0.
|
||||
* \param mmcr1 OR-ed values from `OSPerfMonMMCR1Flags` to write to register MMCR1.
|
||||
* \param pmc1 Value to write to register PMC1.
|
||||
* \param pmc2 Value to write to register PMC2.
|
||||
* \param pmc3 Value to write to register PMC3.
|
||||
* \param pmc4 Value to write to register PMC4.
|
||||
*/
|
||||
void
|
||||
OSSetPerformanceMonitor(uint32_t arg_mask,
|
||||
uint32_t mmcr0,
|
||||
uint32_t mmcr1,
|
||||
uint32_t pmc1,
|
||||
uint32_t pmc2,
|
||||
uint32_t pmc3,
|
||||
uint32_t pmc4);
|
||||
|
||||
/**
|
||||
* Convenience function to read from UPMC1.
|
||||
*/
|
||||
static inline uint32_t
|
||||
OSGetUPMC1()
|
||||
{
|
||||
uint32_t result;
|
||||
asm("mfupmc1 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience function to read from UPMC2.
|
||||
*/
|
||||
static inline uint32_t
|
||||
OSGetUPMC2()
|
||||
{
|
||||
uint32_t result;
|
||||
asm("mfupmc2 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience function to read from UPMC3.
|
||||
*/
|
||||
static inline uint32_t
|
||||
OSGetUPMC3()
|
||||
{
|
||||
uint32_t result;
|
||||
asm("mfupmc3 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience function to read from UPMC4.
|
||||
*/
|
||||
static inline uint32_t
|
||||
OSGetUPMC4()
|
||||
{
|
||||
uint32_t result;
|
||||
asm("mfupmc4 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
106
include/coreinit/savedframe.h
Normal file
106
include/coreinit/savedframe.h
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_savedframe
|
||||
* \ingroup coreinit
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum OSSavedFrameType
|
||||
{
|
||||
OS_SAVED_FRAME_A = 0,
|
||||
OS_SAVED_FRAME_B = 1,
|
||||
} OSSavedFrameType;
|
||||
|
||||
typedef enum OSSavedFrameScreen
|
||||
{
|
||||
OS_SAVED_FRAME_SCREEN_TV = 2,
|
||||
OS_SAVED_FRAME_SCREEN_DRC = 4,
|
||||
} OSSavedFrameScreen;
|
||||
|
||||
uint32_t
|
||||
__OSClearSavedFrame(OSSavedFrameType type,
|
||||
OSSavedFrameScreen screen);
|
||||
|
||||
/**
|
||||
* Gets the GX2Texture saved via \link __OSSetSavedFrame \endlink
|
||||
* @param ptr_size must be <= 0x100
|
||||
*/
|
||||
void
|
||||
__OSGetSavedFrame(OSSavedFrameScreen screen,
|
||||
void *outPtr,
|
||||
uint32_t ptr_size);
|
||||
|
||||
/**
|
||||
* Gets the GX2Texture saved via \link __OSSetSavedFrame \endlink
|
||||
* @param ptr_size must be <= 0x100
|
||||
*/
|
||||
void
|
||||
__OSGetSavedFrameA(OSSavedFrameScreen screen,
|
||||
void *outPtr,
|
||||
uint32_t ptr_size);
|
||||
|
||||
/**
|
||||
* Gets the GX2Texture saved via \link __OSSetSavedFrame \endlink
|
||||
* @param ptr_size must be <= 0x100
|
||||
*/
|
||||
void
|
||||
__OSGetSavedFrameB(OSSavedFrameScreen screen,
|
||||
void *outPtr,
|
||||
uint32_t ptr_size);
|
||||
|
||||
BOOL
|
||||
__OSGetSavedFrameGammaA(OSSavedFrameScreen screen,
|
||||
float *outGamma);
|
||||
|
||||
BOOL
|
||||
__OSGetSavedFrameGammaB(OSSavedFrameScreen screen,
|
||||
float *outGamma);
|
||||
|
||||
void *
|
||||
__OSGetSavedFramePtr(OSSavedFrameType type,
|
||||
OSSavedFrameScreen screen);
|
||||
|
||||
void *
|
||||
__OSGetSavedFramePtrForRead(OSSavedFrameScreen screen);
|
||||
|
||||
void *
|
||||
__OSGetSavedFramePtrForWrite(OSSavedFrameScreen screen);
|
||||
|
||||
uint32_t
|
||||
__OSGetSavedFrames();
|
||||
|
||||
uint32_t
|
||||
__OSGetSavedFramesA();
|
||||
|
||||
uint32_t
|
||||
__OSGetSavedFramesB();
|
||||
|
||||
void
|
||||
__OSResetSavedFrame(OSSavedFrameScreen screen);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param data expected to be a GX2Texture
|
||||
* @param size must be <= 0x100
|
||||
* @return 0 on succes, -1 on error
|
||||
*/
|
||||
int
|
||||
__OSSetSavedFrame(OSSavedFrameScreen screen,
|
||||
void *data,
|
||||
uint32_t size);
|
||||
|
||||
void
|
||||
__OSSetSavedFrameGamma(float gamma,
|
||||
OSSavedFrameScreen screen);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
|
@ -154,14 +154,14 @@ OSScreenFlipBuffersEx(OSScreenID screen);
|
|||
* \param screen
|
||||
* The ID of the screen to draw to. Only the work buffer will be affected.
|
||||
*
|
||||
* \param row
|
||||
* The row, in characters, to place the text in. 0 corresponds to the top of
|
||||
* the screen.
|
||||
*
|
||||
* \param column
|
||||
* The column, in characters, to place the text at. 0 corresponds to the left of
|
||||
* the screen.
|
||||
*
|
||||
* \param row
|
||||
* The row, in characters, to place the text in. 0 corresponds to the top of
|
||||
* the screen.
|
||||
*
|
||||
* \param buffer
|
||||
* Pointer to the string of text to draw. Null-terminated.
|
||||
*
|
||||
|
|
@ -176,8 +176,8 @@ OSScreenFlipBuffersEx(OSScreenID screen);
|
|||
*/
|
||||
void
|
||||
OSScreenPutFontEx(OSScreenID screen,
|
||||
uint32_t row,
|
||||
uint32_t column,
|
||||
uint32_t row,
|
||||
const char *buffer);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -79,7 +79,8 @@ struct SmdElement
|
|||
{
|
||||
SmdElementType type;
|
||||
uint32_t size;
|
||||
union {
|
||||
union
|
||||
{
|
||||
uint8_t data[0xf8];
|
||||
SmdVector spec;
|
||||
uint32_t vectorPaddr;
|
||||
|
|
@ -96,7 +97,8 @@ struct SmdReceiveData
|
|||
{
|
||||
SmdElementType type;
|
||||
uint32_t size;
|
||||
union {
|
||||
union
|
||||
{
|
||||
uint8_t message[0x80];
|
||||
SmdVector spec;
|
||||
SmdVector *vector;
|
||||
|
|
|
|||
93
include/coreinit/stopwatch.h
Normal file
93
include/coreinit/stopwatch.h
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include "spinlock.h"
|
||||
#include "time.h"
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_stopwatch Lock-based Stopwatch
|
||||
* \ingroup coreinit
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OSStopwatch OSStopwatch;
|
||||
|
||||
struct OSStopwatch
|
||||
{
|
||||
//! Lock
|
||||
OSSpinLock lock;
|
||||
//! Tag
|
||||
const char *name;
|
||||
//! Number of times the stopwatch has been stopped
|
||||
uint32_t hitCount;
|
||||
//! Total time from first start to last stop
|
||||
OSTime totalTime;
|
||||
//! Minimum time between stops
|
||||
OSTime minTime;
|
||||
//! Maximum time between stops
|
||||
OSTime maxTime;
|
||||
//! Last time the watch was started
|
||||
OSTime startTime;
|
||||
//! Whether the stopwatch is running
|
||||
BOOL running;
|
||||
WUT_PADDING_BYTES(0x4);
|
||||
};
|
||||
WUT_CHECK_OFFSET(OSStopwatch, 0x00, lock);
|
||||
WUT_CHECK_OFFSET(OSStopwatch, 0x10, name);
|
||||
WUT_CHECK_OFFSET(OSStopwatch, 0x14, hitCount);
|
||||
WUT_CHECK_OFFSET(OSStopwatch, 0x18, totalTime);
|
||||
WUT_CHECK_OFFSET(OSStopwatch, 0x20, minTime);
|
||||
WUT_CHECK_OFFSET(OSStopwatch, 0x28, maxTime);
|
||||
WUT_CHECK_OFFSET(OSStopwatch, 0x30, startTime);
|
||||
WUT_CHECK_OFFSET(OSStopwatch, 0x38, running);
|
||||
WUT_CHECK_SIZE(OSStopwatch, 0x40);
|
||||
|
||||
/**
|
||||
* Initialises the stopwatch,
|
||||
* stopwatches must be initialized before any other stopwatch functions are used
|
||||
*/
|
||||
void
|
||||
OSInitStopwatch(OSStopwatch *stopwatch,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* Resets all stopwatch data
|
||||
*/
|
||||
void
|
||||
OSResetStopwatch(OSStopwatch *stopwatch);
|
||||
|
||||
/**
|
||||
* Starts the stopwatch.
|
||||
* if already started, will update the start time without resetting the total time
|
||||
*/
|
||||
void
|
||||
OSStartStopwatch(OSStopwatch *stopwatch);
|
||||
|
||||
/**
|
||||
* Stops the stopwatch and increments hit count.
|
||||
* Nothing happens if the stopwatch has already been stopped
|
||||
*/
|
||||
void
|
||||
OSStopStopwatch(OSStopwatch *stopwatch);
|
||||
|
||||
/**
|
||||
* Returns the total time the stopwatch has been running
|
||||
*/
|
||||
OSTime
|
||||
OSCheckStopwatch(OSStopwatch *stopwatch);
|
||||
|
||||
/**
|
||||
* Dumps stopwatch info to the Cafe OS warn log
|
||||
*/
|
||||
void
|
||||
OSDumpStopwatch(OSStopwatch *stopwatch);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
65
include/coreinit/stopwatchatomic.h
Normal file
65
include/coreinit/stopwatchatomic.h
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include "time.h"
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_stopwatchatomic Atomic Stopwatch
|
||||
* \ingroup coreinit
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OSStopWatchAtomic OSStopWatchAtomic;
|
||||
|
||||
struct OSStopWatchAtomic
|
||||
{
|
||||
//! Last time the watch was started
|
||||
OSTime startTime;
|
||||
//! Total time from first start to last stop
|
||||
OSTime totalTime;
|
||||
};
|
||||
WUT_CHECK_OFFSET(OSStopWatchAtomic, 0x00, startTime);
|
||||
WUT_CHECK_OFFSET(OSStopWatchAtomic, 0x08, totalTime);
|
||||
WUT_CHECK_SIZE(OSStopWatchAtomic, 0x10);
|
||||
|
||||
/**
|
||||
* Start the stopwatch.
|
||||
* Only updates the start time
|
||||
* \returns total time on stopwatch
|
||||
*/
|
||||
OSTime
|
||||
OSStopWatchStart(OSStopWatchAtomic *stopWatch);
|
||||
|
||||
/**
|
||||
* Stop the stopwatch.
|
||||
* Resets the start time to 0
|
||||
* \returns total time on stopwatch
|
||||
*/
|
||||
OSTime
|
||||
OSStopWatchStop(OSStopWatchAtomic *stopWatch);
|
||||
|
||||
/**
|
||||
* Get the current time on the stopwatch
|
||||
* \returns current time on stopwatch
|
||||
*/
|
||||
OSTime
|
||||
OSStopWatchLap(OSStopWatchAtomic *stopWatch);
|
||||
|
||||
|
||||
/**
|
||||
* Stops and resets the stop watch.
|
||||
* Clears start and total time
|
||||
* \returns previous total time
|
||||
*/
|
||||
OSTime
|
||||
OSStopWatchReset(OSStopWatchAtomic *stopWatch);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
|
@ -3,9 +3,9 @@
|
|||
#include <time.h>
|
||||
#include "alarm.h"
|
||||
#include "context.h"
|
||||
#include "time.h"
|
||||
#include "threadqueue.h"
|
||||
#include "exception.h"
|
||||
#include "threadqueue.h"
|
||||
#include "time.h"
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_thread Thread
|
||||
|
|
@ -126,7 +126,8 @@ enum OS_THREAD_ATTRIB
|
|||
OS_THREAD_ATTRIB_UNKNOWN = 1 << 7
|
||||
};
|
||||
|
||||
enum OS_THREAD_TYPE {
|
||||
enum OS_THREAD_TYPE
|
||||
{
|
||||
OS_THREAD_TYPE_DRIVER = 0,
|
||||
OS_THREAD_TYPE_IO = 1,
|
||||
OS_THREAD_TYPE_APP = 2
|
||||
|
|
|
|||
|
|
@ -84,6 +84,9 @@ void
|
|||
OSTicksToCalendarTime(OSTime time,
|
||||
OSCalendarTime *calendarTime);
|
||||
|
||||
BOOL
|
||||
__OSSetAbsoluteSystemTime(OSTime time);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint64_t OSGetTitleID(void);
|
||||
uint64_t
|
||||
OSGetTitleID(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ extern "C" {
|
|||
int
|
||||
__OSGetSavedAudioFlags();
|
||||
|
||||
int __OSGetTransitionAudioBuffer(void **buffer,
|
||||
int
|
||||
__OSGetTransitionAudioBuffer(void **buffer,
|
||||
uint32_t *size);
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <gx2/semaphore.h>
|
||||
|
||||
/**
|
||||
* \defgroup dmae_sync Synchronization
|
||||
|
|
@ -14,6 +15,12 @@ extern "C" {
|
|||
//! Timestamp for a DMAE operation.
|
||||
typedef uint64_t DMAETimeStamp;
|
||||
|
||||
DMAETimeStamp
|
||||
DMAEGetLastSubmittedTimeStamp(void);
|
||||
|
||||
DMAETimeStamp
|
||||
DMAEGetRetiredTimeStamp(void);
|
||||
|
||||
/**
|
||||
* Waits for a DMAE operation to complete.
|
||||
*
|
||||
|
|
@ -26,6 +33,16 @@ typedef uint64_t DMAETimeStamp;
|
|||
BOOL
|
||||
DMAEWaitDone(DMAETimeStamp timestamp);
|
||||
|
||||
uint32_t
|
||||
DMAEGetTimeout(void);
|
||||
|
||||
void
|
||||
DMAESetTimeout(uint32_t timeout);
|
||||
|
||||
void
|
||||
DMAESemaphore(GX2Semaphore *semaphore,
|
||||
GX2SemaphoreAction action);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -17,30 +17,52 @@ struct FSClient;
|
|||
namespace Rpl
|
||||
{
|
||||
|
||||
void ErrEulaSetVersion(int version);
|
||||
bool ErrEulaJump(const char *buffer, uint32_t bufferSize);
|
||||
void ErrEulaPlayAppearSE(bool playAppearSoundEffect);
|
||||
bool ErrEulaIsSelectCursorActive();
|
||||
void ErrEulaChangeLang(nn::erreula::LangType language);
|
||||
void ErrEulaDisappearHomeNixSign();
|
||||
bool ErrEulaIsAppearHomeNixSign();
|
||||
void ErrEulaAppearHomeNixSign(const nn::erreula::HomeNixSignArg &arg);
|
||||
void ErrEulaSetControllerRemo(nn::erreula::ControllerType controller);
|
||||
int32_t ErrEulaGetSelectButtonNumError();
|
||||
int32_t ErrEulaGetResultCode();
|
||||
nn::erreula::ResultType ErrEulaGetResultType();
|
||||
nn::erreula::State ErrEulaGetStateErrorViewer();
|
||||
bool ErrEulaIsDecideSelectRightButtonError();
|
||||
bool ErrEulaIsDecideSelectLeftButtonError();
|
||||
bool ErrEulaIsDecideSelectButtonError();
|
||||
void ErrEulaDisappearError();
|
||||
void ErrEulaAppearError(const nn::erreula::AppearArg &arg);
|
||||
void ErrEulaCalc(const nn::erreula::ControllerInfo &controllerInfo);
|
||||
void ErrEulaDrawDRC();
|
||||
void ErrEulaDrawTV();
|
||||
void ErrEulaDestroy();
|
||||
void ErrEulaCreate(void *workMemory, nn::erreula::RegionType region,
|
||||
nn::erreula::LangType language, FSClient *fsClient);
|
||||
void
|
||||
ErrEulaSetVersion(int version);
|
||||
bool
|
||||
ErrEulaJump(const char *buffer, uint32_t bufferSize);
|
||||
void
|
||||
ErrEulaPlayAppearSE(bool playAppearSoundEffect);
|
||||
bool
|
||||
ErrEulaIsSelectCursorActive();
|
||||
void
|
||||
ErrEulaChangeLang(nn::erreula::LangType language);
|
||||
void
|
||||
ErrEulaDisappearHomeNixSign();
|
||||
bool
|
||||
ErrEulaIsAppearHomeNixSign();
|
||||
void
|
||||
ErrEulaAppearHomeNixSign(const nn::erreula::HomeNixSignArg &arg);
|
||||
void
|
||||
ErrEulaSetControllerRemo(nn::erreula::ControllerType controller);
|
||||
int32_t
|
||||
ErrEulaGetSelectButtonNumError();
|
||||
int32_t
|
||||
ErrEulaGetResultCode();
|
||||
nn::erreula::ResultType
|
||||
ErrEulaGetResultType();
|
||||
nn::erreula::State
|
||||
ErrEulaGetStateErrorViewer();
|
||||
bool
|
||||
ErrEulaIsDecideSelectRightButtonError();
|
||||
bool
|
||||
ErrEulaIsDecideSelectLeftButtonError();
|
||||
bool
|
||||
ErrEulaIsDecideSelectButtonError();
|
||||
void
|
||||
ErrEulaDisappearError();
|
||||
void
|
||||
ErrEulaAppearError(const nn::erreula::AppearArg &arg);
|
||||
void
|
||||
ErrEulaCalc(const nn::erreula::ControllerInfo &controllerInfo);
|
||||
void
|
||||
ErrEulaDrawDRC();
|
||||
void
|
||||
ErrEulaDrawTV();
|
||||
void
|
||||
ErrEulaDestroy();
|
||||
void
|
||||
ErrEulaCreate(void *workMemory, nn::erreula::RegionType region, nn::erreula::LangType language, FSClient *fsClient);
|
||||
|
||||
} // namespace Rpl
|
||||
|
||||
|
|
|
|||
62
include/gx2/aperture.h
Normal file
62
include/gx2/aperture.h
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include "enum.h"
|
||||
#include "surface.h"
|
||||
|
||||
/**
|
||||
* \defgroup gx2_aperture Aperture
|
||||
* \ingroup gx2
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef uint32_t GX2ApertureHandle;
|
||||
|
||||
/**
|
||||
* Allocates a tiling aperture.
|
||||
* This function creates a linear and untiled buffer to read from and write to the surface.
|
||||
* The total size of the buffer will be width * height * bpp.
|
||||
*
|
||||
* \param surface
|
||||
* A pointer to the surface to create the tiling aperture for.
|
||||
*
|
||||
* \param level
|
||||
* The level of the surface to create the tiling aperture for.
|
||||
*
|
||||
* \param depth
|
||||
* The depth of the surface to create the tiling aperture for.
|
||||
*
|
||||
* \param endian
|
||||
* The endian swap mode.
|
||||
*
|
||||
* \param outHandle
|
||||
* A pointer to store the handle for the aperture.
|
||||
*
|
||||
* \param outAddress
|
||||
* A pointer to store the address for the aperture.
|
||||
*/
|
||||
void
|
||||
GX2AllocateTilingApertureEx(GX2Surface *surface,
|
||||
uint32_t level,
|
||||
uint32_t depth,
|
||||
GX2EndianSwapMode endian,
|
||||
GX2ApertureHandle *outHandle,
|
||||
void **outAddress);
|
||||
|
||||
/**
|
||||
* Frees an allocated tiling aperture.
|
||||
*
|
||||
* \param handle
|
||||
* The handle of the tiling aperture which should be freed.
|
||||
*/
|
||||
void
|
||||
GX2FreeTilingAperture(GX2ApertureHandle handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
|
@ -57,6 +57,9 @@ void
|
|||
GX2SetDRCScale(uint32_t x,
|
||||
uint32_t y);
|
||||
|
||||
GX2AspectRatio
|
||||
GX2GetSystemTVAspectRatio();
|
||||
|
||||
GX2TVScanMode
|
||||
GX2GetSystemTVScanMode();
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ extern "C" {
|
|||
#define GX2_SHADER_PROGRAM_ALIGNMENT (0x100)
|
||||
#define GX2_VERTEX_BUFFER_ALIGNMENT (0x40)
|
||||
#define GX2_INDEX_BUFFER_ALIGNMENT (0x20)
|
||||
#define GX2_UNIFORM_BLOCK_ALIGNMENT (0x100)
|
||||
|
||||
#define GX2_COMMAND_BUFFER_SIZE (0x400000)
|
||||
|
||||
|
|
@ -29,7 +30,8 @@ typedef enum GX2AAMode
|
|||
{
|
||||
GX2_AA_MODE1X = 0,
|
||||
GX2_AA_MODE2X = 1,
|
||||
GX2_AA_MODE4X = 2
|
||||
GX2_AA_MODE4X = 2,
|
||||
GX2_AA_MODE8X = 3,
|
||||
} GX2AAMode;
|
||||
|
||||
typedef enum GX2AlphaToMaskMode
|
||||
|
|
@ -41,6 +43,12 @@ typedef enum GX2AlphaToMaskMode
|
|||
GX2_ALPHA_TO_MASK_MODE_DITHER_270 = 4,
|
||||
} GX2AlphaToMaskMode;
|
||||
|
||||
typedef enum GX2AspectRatio
|
||||
{
|
||||
GX2_ASPECT_RATIO_4_3 = 0,
|
||||
GX2_ASPECT_RATIO_16_9 = 1,
|
||||
} GX2AspectRatio;
|
||||
|
||||
typedef enum GX2AttribFormat
|
||||
{
|
||||
GX2_ATTRIB_TYPE_8 = 0x00,
|
||||
|
|
@ -120,6 +128,8 @@ typedef enum GX2BlendMode
|
|||
GX2_BLEND_MODE_INV_SRC1_COLOR = 16,
|
||||
GX2_BLEND_MODE_SRC1_ALPHA = 17,
|
||||
GX2_BLEND_MODE_INV_SRC1_ALPHA = 18,
|
||||
GX2_BLEND_MODE_CONSTANT_ALPHA = 19,
|
||||
GX2_BLEND_MODE_INV_CONSTANT_ALPHA = 20,
|
||||
} GX2BlendMode;
|
||||
|
||||
typedef enum GX2BlendCombineMode
|
||||
|
|
@ -164,6 +174,8 @@ typedef enum GX2ClearFlags
|
|||
GX2_CLEAR_FLAGS_BOTH = (GX2_CLEAR_FLAGS_DEPTH | GX2_CLEAR_FLAGS_STENCIL),
|
||||
} GX2ClearFlags;
|
||||
|
||||
WUT_ENUM_BITMASK_TYPE(GX2ClearFlags)
|
||||
|
||||
typedef enum GX2CompareFunction
|
||||
{
|
||||
GX2_COMPARE_FUNC_NEVER = 0,
|
||||
|
|
@ -334,6 +346,14 @@ typedef enum GX2ScanTarget
|
|||
GX2_SCAN_TARGET_DRC = GX2_SCAN_TARGET_DRC0,
|
||||
} GX2ScanTarget;
|
||||
|
||||
WUT_ENUM_BITMASK_TYPE(GX2ScanTarget)
|
||||
|
||||
typedef enum GX2SemaphoreAction
|
||||
{
|
||||
GX2_SEMAPHORE_ACTION_WAIT = 0,
|
||||
GX2_SEMAPHORE_ACTION_SIGNAL = 1,
|
||||
} GX2SemaphoreAction;
|
||||
|
||||
typedef enum GX2ShaderMode
|
||||
{
|
||||
GX2_SHADER_MODE_UNIFORM_REGISTER = 0,
|
||||
|
|
@ -518,7 +538,10 @@ typedef enum GX2TexClampMode
|
|||
GX2_TEX_CLAMP_MODE_MIRROR = 1,
|
||||
GX2_TEX_CLAMP_MODE_CLAMP = 2,
|
||||
GX2_TEX_CLAMP_MODE_MIRROR_ONCE = 3,
|
||||
GX2_TEX_CLAMP_MODE_CLAMP_HALF_BORDER = 4,
|
||||
GX2_TEX_CLAMP_MODE_MIRROR_ONCE_HALF_BORDER = 5,
|
||||
GX2_TEX_CLAMP_MODE_CLAMP_BORDER = 6,
|
||||
GX2_TEX_CLAMP_MODE_MIRROR_ONCE_BORDER = 7,
|
||||
} GX2TexClampMode;
|
||||
|
||||
typedef enum GX2TexMipFilterMode
|
||||
|
|
@ -537,11 +560,16 @@ typedef enum GX2TexXYFilterMode
|
|||
{
|
||||
GX2_TEX_XY_FILTER_MODE_POINT = 0,
|
||||
GX2_TEX_XY_FILTER_MODE_LINEAR = 1,
|
||||
GX2_TEX_XY_FILTER_MODE_BICUBIC = 2,
|
||||
} GX2TexXYFilterMode;
|
||||
|
||||
typedef enum GX2TexAnisoRatio
|
||||
{
|
||||
GX2_TEX_ANISO_RATIO_NONE = 0,
|
||||
GX2_TEX_ANISO_RATIO_2_TO_1 = 1,
|
||||
GX2_TEX_ANISO_RATIO_4_TO_1 = 2,
|
||||
GX2_TEX_ANISO_RATIO_8_TO_1 = 3,
|
||||
GX2_TEX_ANISO_RATIO_16_TO_1 = 4,
|
||||
} GX2TexAnisoRatio;
|
||||
|
||||
typedef enum GX2TexZFilterMode
|
||||
|
|
|
|||
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
|
||||
#include <string.h>
|
||||
#include <wut.h>
|
||||
#include <string.h>
|
||||
#include "enum.h"
|
||||
#include "sampler.h"
|
||||
#include "gx2r/buffer.h"
|
||||
#include "sampler.h"
|
||||
|
||||
/**
|
||||
* \defgroup gx2_shader Shaders
|
||||
|
|
@ -427,9 +427,12 @@ GX2SetGeometryUniformBlock(uint32_t location,
|
|||
|
||||
void
|
||||
GX2SetShaderModeEx(GX2ShaderMode mode,
|
||||
uint32_t numVsGpr, uint32_t numVsStackEntries,
|
||||
uint32_t numGsGpr, uint32_t numGsStackEntries,
|
||||
uint32_t numPsGpr, uint32_t numPsStackEntries);
|
||||
uint32_t numVsGpr,
|
||||
uint32_t numVsStackEntries,
|
||||
uint32_t numGsGpr,
|
||||
uint32_t numGsStackEntries,
|
||||
uint32_t numPsGpr,
|
||||
uint32_t numPsStackEntries);
|
||||
|
||||
void
|
||||
GX2SetStreamOutEnable(BOOL enable);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include "enum.h"
|
||||
|
||||
|
|
@ -24,6 +25,12 @@ GX2Flush();
|
|||
void
|
||||
GX2ResetGPU(uint32_t unknown);
|
||||
|
||||
/**
|
||||
* @return -1 if GX2 is not running, on success the core where GX2Init has been called is returned.
|
||||
*/
|
||||
int
|
||||
GX2GetMainCoreId();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include <gx2r/resource.h>
|
||||
#include <wut.h>
|
||||
#include <gx2r/resource.h>
|
||||
#include "enum.h"
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +28,8 @@ struct GX2Surface
|
|||
uint32_t mipLevels;
|
||||
GX2SurfaceFormat format;
|
||||
GX2AAMode aa;
|
||||
union {
|
||||
union
|
||||
{
|
||||
GX2SurfaceUse use;
|
||||
GX2RResourceFlags resourceFlags;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ H264DECSetParam_OUTPUT_PER_FRAME(void *memory,
|
|||
*/
|
||||
H264Error
|
||||
H264DECSetParam_USER_MEMORY(void *memory,
|
||||
void *value);
|
||||
void **value);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
|
||||
/**
|
||||
* \defgroup h264_stream H264 Stream
|
||||
|
|
|
|||
|
|
@ -59,23 +59,31 @@ WUT_CHECK_SIZE(MICStatus, 0x0C);
|
|||
* The second parameter to MICInit is unused, any value is valid.
|
||||
*/
|
||||
MICHandle
|
||||
MICInit(MICInstance instance, int unused, MICWorkMemory *workMemory,
|
||||
MICInit(MICInstance instance,
|
||||
int unused,
|
||||
MICWorkMemory *workMemory,
|
||||
MICError *outError);
|
||||
|
||||
MICError
|
||||
MICOpen(MICHandle handle);
|
||||
|
||||
MICError
|
||||
MICGetState(MICHandle handle, int state, uint32_t *outStateVal);
|
||||
MICGetState(MICHandle handle,
|
||||
int state,
|
||||
uint32_t *outStateVal);
|
||||
|
||||
MICError
|
||||
MICSetState(MICHandle handle, int state, uint32_t stateVal);
|
||||
MICSetState(MICHandle handle,
|
||||
int state,
|
||||
uint32_t stateVal);
|
||||
|
||||
MICError
|
||||
MICGetStatus(MICHandle handle, MICStatus *outStatus);
|
||||
MICGetStatus(MICHandle handle,
|
||||
MICStatus *outStatus);
|
||||
|
||||
MICError
|
||||
MICSetDataConsumed(MICHandle handle, int dataAmountConsumed);
|
||||
MICSetDataConsumed(MICHandle handle,
|
||||
int dataAmountConsumed);
|
||||
|
||||
MICError
|
||||
MICClose(MICHandle handle);
|
||||
|
|
|
|||
|
|
@ -15,17 +15,31 @@
|
|||
|
||||
#define IP_TOS 3
|
||||
#define IP_TTL 4
|
||||
#define IP_MULTICAST_IF 9
|
||||
#define IP_MULTICAST_TTL 10
|
||||
#define IP_MULTICAST_LOOP 11
|
||||
#define IP_ADD_MEMBERSHIP 12
|
||||
#define IP_DROP_MEMBERSHIP 13
|
||||
#define IP_UNKNOWN 14
|
||||
|
||||
typedef uint16_t in_port_t;
|
||||
typedef uint32_t in_addr_t;
|
||||
|
||||
struct in_addr {
|
||||
struct in_addr
|
||||
{
|
||||
in_addr_t s_addr;
|
||||
};
|
||||
|
||||
struct sockaddr_in {
|
||||
struct sockaddr_in
|
||||
{
|
||||
sa_family_t sin_family;
|
||||
in_port_t sin_port;
|
||||
struct in_addr sin_addr;
|
||||
unsigned char sin_zero[8];
|
||||
};
|
||||
|
||||
struct ip_mreq
|
||||
{
|
||||
struct in_addr imr_multiaddr;
|
||||
struct in_addr imr_interface;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,3 +6,4 @@
|
|||
#define TCP_NOACKDELAY 0x2002
|
||||
#define TCP_MAXSEG 0x2003
|
||||
#define TCP_NODELAY 0x2004
|
||||
#define TCP_UNKNOWN 0x2005 // amount of mss received before sending an ack
|
||||
|
|
|
|||
4
include/nfc/nfc.dox
Normal file
4
include/nfc/nfc.dox
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* \defgroup nfc nfc
|
||||
* Near Field Communication (NFC).
|
||||
*/
|
||||
1287
include/nfc/nfc.h
Normal file
1287
include/nfc/nfc.h
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <nn/result.h>
|
||||
#include <nsysnet/netconfig.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_ac_cpp Auto Connect C++ API
|
||||
|
|
@ -24,103 +25,55 @@ namespace ac
|
|||
* An ID number representing a network configuration. These are the same IDs as
|
||||
* shown in System Settings' Connection List.
|
||||
*/
|
||||
typedef uint32_t ConfigIdNum;
|
||||
using ConfigIdNum = uint32_t;
|
||||
|
||||
/**
|
||||
* C++ linkage for the autoconnect API, see \link nn::ac \endlink for use.
|
||||
* Cafe provides mangled symbols for C++ APIs, so nn::ac is actually static
|
||||
* inline calls to the mangled symbols under nn::ac::detail.
|
||||
* The configuration for a given network profile (from 1 to 6).
|
||||
* \sa NetConfCfg
|
||||
*/
|
||||
namespace detail
|
||||
using Config = NetConfCfg;
|
||||
|
||||
using ErrorCode = uint32_t;
|
||||
|
||||
enum Status
|
||||
{
|
||||
extern "C"
|
||||
{
|
||||
|
||||
nn::Result Initialize__Q2_2nn2acFv();
|
||||
void Finalize__Q2_2nn2acFv();
|
||||
nn::Result Connect__Q2_2nn2acFv();
|
||||
nn::Result ConnectAsync__Q2_2nn2acFv();
|
||||
nn::Result Close__Q2_2nn2acFv();
|
||||
nn::Result GetCloseStatus__Q2_2nn2acFPQ3_2nn2ac6Status();
|
||||
nn::Result GetStartupId__Q2_2nn2acFPQ3_2nn2ac11ConfigIdNum(ConfigIdNum *id);
|
||||
nn::Result Connect__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum(ConfigIdNum id);
|
||||
nn::Result GetAssignedAddress__Q2_2nn2acFPUl(uint32_t *ip);
|
||||
|
||||
} // extern "C"
|
||||
} // namespace detail
|
||||
|
||||
/**
|
||||
* Initialise the Auto Connect library. Call this function before any other nn::ac
|
||||
* functions.
|
||||
*
|
||||
* \return
|
||||
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
|
||||
* and \link nn::Result::IsFailure \endlink.
|
||||
*
|
||||
* \sa
|
||||
* - \link Finalize \endlink
|
||||
*/
|
||||
static inline nn::Result
|
||||
Initialize()
|
||||
{
|
||||
return detail::Initialize__Q2_2nn2acFv();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup the Auto Connect library. Do not call any nn::ac functions (other
|
||||
* than \link Initialize \endlink) after calling this function.
|
||||
*
|
||||
* \sa
|
||||
* - \link Initialize \endlink
|
||||
*/
|
||||
static inline void
|
||||
Finalize()
|
||||
{
|
||||
return detail::Finalize__Q2_2nn2acFv();
|
||||
}
|
||||
STATUS_FAILED = -1,
|
||||
STATUS_OK = 0,
|
||||
STATUS_PROCESSING = 1,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Gets the default connection configuration id. This is the default as marked
|
||||
* in System Settings.
|
||||
*
|
||||
* \param id
|
||||
* A pointer to an \link ConfigIdNum \endlink to write the config ID to. Must
|
||||
* not be a \c nullptr.
|
||||
*
|
||||
* \return
|
||||
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
|
||||
* and \link nn::Result::IsFailure \endlink.
|
||||
*/
|
||||
static inline nn::Result
|
||||
GetStartupId(ConfigIdNum *id)
|
||||
{
|
||||
return detail::GetStartupId__Q2_2nn2acFPQ3_2nn2ac11ConfigIdNum(id);
|
||||
}
|
||||
nn::Result
|
||||
BeginLocalConnection(bool unknown)
|
||||
asm("BeginLocalConnection__Q2_2nn2acFb");
|
||||
|
||||
static inline nn::Result
|
||||
Connect()
|
||||
{
|
||||
return detail::Connect__Q2_2nn2acFv();
|
||||
}
|
||||
void
|
||||
ClearConfig(Config *cfg)
|
||||
asm("ClearConfig__Q2_2nn2acFP16netconf_profile_");
|
||||
|
||||
static inline nn::Result
|
||||
ConnectAsync()
|
||||
{
|
||||
return detail::ConnectAsync__Q2_2nn2acFv();
|
||||
}
|
||||
|
||||
static inline nn::Result
|
||||
nn::Result
|
||||
Close()
|
||||
{
|
||||
return detail::Close__Q2_2nn2acFv();
|
||||
}
|
||||
asm("Close__Q2_2nn2acFv");
|
||||
|
||||
static inline nn::Result
|
||||
GetCloseStatus()
|
||||
{
|
||||
return detail::GetCloseStatus__Q2_2nn2acFPQ3_2nn2ac6Status();
|
||||
}
|
||||
nn::Result
|
||||
CloseAll()
|
||||
asm("CloseAll__Q2_2nn2acFv");
|
||||
|
||||
nn::Result
|
||||
Connect(const Config *cfg)
|
||||
asm("Connect__Q2_2nn2acFPC16netconf_profile_");
|
||||
|
||||
nn::Result
|
||||
Connect(ConfigIdNum id)
|
||||
asm("Connect__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum");
|
||||
|
||||
nn::Result
|
||||
Connect()
|
||||
asm("Connect__Q2_2nn2acFv");
|
||||
|
||||
nn::Result
|
||||
ConnectAsync(const Config *cfg)
|
||||
asm("ConnectAsync__Q2_2nn2acFPC16netconf_profile_");
|
||||
|
||||
/**
|
||||
* Connects to a network, using the configuration represented by the given
|
||||
|
|
@ -133,11 +86,36 @@ GetCloseStatus()
|
|||
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
|
||||
* and \link nn::Result::IsFailure \endlink.
|
||||
*/
|
||||
static inline nn::Result
|
||||
Connect(ConfigIdNum id)
|
||||
{
|
||||
return detail::Connect__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum(id);
|
||||
}
|
||||
nn::Result
|
||||
ConnectAsync(ConfigIdNum id)
|
||||
asm("ConnectAsync__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum");
|
||||
|
||||
nn::Result
|
||||
ConnectAsync()
|
||||
asm("ConnectAsync__Q2_2nn2acFv");
|
||||
|
||||
nn::Result
|
||||
ConnectWithRetry()
|
||||
asm("ConnectWithRetry__Q2_2nn2acFv");
|
||||
|
||||
nn::Result
|
||||
DeleteConfig(ConfigIdNum id)
|
||||
asm("DeleteConfig__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum");
|
||||
|
||||
nn::Result
|
||||
EndLocalConnection()
|
||||
asm("EndLocalConnection__Q2_2nn2acFv");
|
||||
|
||||
/**
|
||||
* Cleans up the Auto Connect library. Do not call any nn::ac functions (other
|
||||
* than \link Initialize \endlink) after calling this function.
|
||||
*
|
||||
* \sa
|
||||
* - \link Initialize \endlink
|
||||
*/
|
||||
void
|
||||
Finalize()
|
||||
asm("Finalize__Q2_2nn2acFv");
|
||||
|
||||
/**
|
||||
* Gets the IP address assosciated with the currently active connection.
|
||||
|
|
@ -151,11 +129,120 @@ Connect(ConfigIdNum id)
|
|||
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
|
||||
* and \link nn::Result::IsFailure \endlink.
|
||||
*/
|
||||
static inline nn::Result
|
||||
nn::Result
|
||||
GetAssignedAddress(uint32_t *ip)
|
||||
{
|
||||
return detail::GetAssignedAddress__Q2_2nn2acFPUl(ip);
|
||||
}
|
||||
asm("GetAssignedAddress__Q2_2nn2acFPUl");
|
||||
|
||||
nn::Result
|
||||
GetAssignedAlternativeDns(uint32_t *ip)
|
||||
asm("GetAssignedAlternativeDns__Q2_2nn2acFPUl");
|
||||
|
||||
nn::Result
|
||||
GetAssignedGateway(uint32_t *ip)
|
||||
asm("GetAssignedGateway__Q2_2nn2acFPUl");
|
||||
|
||||
nn::Result
|
||||
GetAssignedPreferedDns(uint32_t *ip)
|
||||
asm("GetAssignedPreferedDns__Q2_2nn2acFPUl");
|
||||
|
||||
nn::Result
|
||||
GetAssignedSubnet(uint32_t *ip)
|
||||
asm("GetAssignedSubnet__Q2_2nn2acFPUl");
|
||||
|
||||
nn::Result
|
||||
GetCloseStatus(Status *status)
|
||||
asm("GetCloseStatus__Q2_2nn2acFPQ3_2nn2ac6Status");
|
||||
|
||||
nn::Result
|
||||
GetCompatId(ConfigIdNum *id)
|
||||
asm("GetCompatId__Q2_2nn2acFPQ3_2nn2ac11ConfigIdNum");
|
||||
|
||||
nn::Result
|
||||
GetConnectResult(nn::Result *result)
|
||||
asm("GetConnectResult__Q2_2nn2acFPQ2_2nn6Result");
|
||||
|
||||
nn::Result
|
||||
GetConnectStatus(Status *status)
|
||||
asm("GetConnectStatus__Q2_2nn2acFPQ3_2nn2ac6Status");
|
||||
|
||||
nn::Result
|
||||
GetLastErrorCode(ErrorCode *error)
|
||||
asm("GetLastErrorCode__Q2_2nn2acFPUi");
|
||||
|
||||
nn::Result
|
||||
GetRunningConfig(Config *cfg)
|
||||
asm("GetRunningConfig__Q2_2nn2acFP16netconf_profile_");
|
||||
|
||||
/**
|
||||
* Gets the default connection configuration id. This is the default as marked
|
||||
* in System Settings.
|
||||
*
|
||||
* \param id
|
||||
* A pointer to an \link ConfigIdNum \endlink to write the config ID to. Must
|
||||
* not be a \c nullptr.
|
||||
*
|
||||
* \return
|
||||
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
|
||||
* and \link nn::Result::IsFailure \endlink.
|
||||
*/
|
||||
nn::Result
|
||||
GetStartupId(ConfigIdNum *id)
|
||||
asm("GetStartupId__Q2_2nn2acFPQ3_2nn2ac11ConfigIdNum");
|
||||
|
||||
/**
|
||||
* Initializes the Auto Connect library. Call this function before any other nn::ac
|
||||
* functions.
|
||||
*
|
||||
* \return
|
||||
* A \link nn::Result Result\endlink - see \link nn::Result::IsSuccess \endlink
|
||||
* and \link nn::Result::IsFailure \endlink.
|
||||
*
|
||||
* \sa
|
||||
* - \link Finalize \endlink
|
||||
*/
|
||||
nn::Result
|
||||
Initialize()
|
||||
asm("Initialize__Q2_2nn2acFv");
|
||||
|
||||
nn::Result
|
||||
IsAnyKeepingConnect(bool keeping)
|
||||
asm("IsAnyKeepingConnect__Q2_2nn2acFPb");
|
||||
|
||||
nn::Result
|
||||
IsApplicationConnected(bool *connected)
|
||||
asm("IsApplicationConnected__Q2_2nn2acFPb");
|
||||
|
||||
nn::Result
|
||||
IsAutoConnectionFatallyFailed(nn::Result *failed)
|
||||
asm("IsAutoConnectionFatallyFailed__Q2_2nn2acFQ2_2nn6Result");
|
||||
|
||||
nn::Result
|
||||
IsConfigExisting(ConfigIdNum id, bool *existing)
|
||||
asm("IsConfigExisting__Q2_2nn2acFQ3_2nn2ac11ConfigIdNumPb");
|
||||
|
||||
nn::Result
|
||||
IsKeepingConnect(bool *keeping)
|
||||
asm("IsKeepingConnect__Q2_2nn2acFPb");
|
||||
|
||||
nn::Result
|
||||
IsReadyToConnect(bool *ready)
|
||||
asm("IsReadyToConnect__Q2_2nn2acFPb");
|
||||
|
||||
nn::Result
|
||||
ReadConfig(ConfigIdNum id, Config *cfg)
|
||||
asm("ReadConfig__Q2_2nn2acFQ3_2nn2ac11ConfigIdNumP16netconf_profile_");
|
||||
|
||||
nn::Result
|
||||
SetCompatId(ConfigIdNum id)
|
||||
asm("SetCompatId__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum");
|
||||
|
||||
nn::Result
|
||||
SetStartupId(ConfigIdNum id)
|
||||
asm("SetStartupId__Q2_2nn2acFQ3_2nn2ac11ConfigIdNum");
|
||||
|
||||
nn::Result
|
||||
WriteConfig(ConfigIdNum id, const Config *cfg)
|
||||
asm("WriteConfig__Q2_2nn2acFQ3_2nn2ac11ConfigIdNumPC16netconf_profile_");
|
||||
|
||||
} // namespace ac
|
||||
} // namespace nn
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#include <nn/acp/client.h>
|
||||
#include <nn/acp/device.h>
|
||||
#include <nn/acp/drcled_c.h>
|
||||
#include <nn/acp/drcled_cpp.h>
|
||||
#include <nn/acp/result.h>
|
||||
#include <nn/acp/save.h>
|
||||
#include <nn/acp/title.h>
|
||||
#include <nn/acp/drcled_c.h>
|
||||
#include <nn/acp/drcled_cpp.h>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,15 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef int32_t ACPDeviceType;
|
||||
typedef enum ACPDeviceType
|
||||
{
|
||||
ACP_DEVICE_TYPE_AUTO = 1,
|
||||
ACP_DEVICE_TYPE_ODD = 2,
|
||||
ACP_DEVICE_TYPE_HFIODISC = 2, /* when ApplicationDevice is emulated */
|
||||
ACP_DEVICE_TYPE_MLC = 3,
|
||||
ACP_DEVICE_TYPE_HFIOMLC = 3, /* when ApplicationDevice is emulated */
|
||||
ACP_DEVICE_TYPE_USB = 4,
|
||||
} ACPDeviceType;
|
||||
|
||||
ACPResult
|
||||
ACPCheckApplicationDeviceEmulation(BOOL *emulation);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include <nn/acp/result.h>
|
||||
#include <nn/acp/device.h>
|
||||
#include <nn/acp/result.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include <nn/acp/result.h>
|
||||
#include <nn/acp/device.h>
|
||||
#include <nn/acp/result.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace nn {
|
||||
namespace nn
|
||||
{
|
||||
|
||||
namespace acp {
|
||||
namespace acp
|
||||
{
|
||||
|
||||
typedef uint8_t DrcLedStatus;
|
||||
typedef uint32_t DrcLedPattern;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
typedef enum ACPResult {
|
||||
typedef enum ACPResult
|
||||
{
|
||||
ACP_RESULT_SUCCESS = 0,
|
||||
|
||||
ACP_RESULT_INVALID = -200,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <nn/acp/result.h>
|
||||
#include <nn/acp/device.h>
|
||||
#include <nn/acp/result.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_acp_save Save
|
||||
|
|
@ -15,6 +15,21 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef uint64_t ACPTitleId;
|
||||
typedef struct ACPSaveDirInfo ACPSaveDirInfo;
|
||||
|
||||
struct WUT_PACKED ACPSaveDirInfo
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x8);
|
||||
uint32_t persistentId;
|
||||
WUT_UNKNOWN_BYTES(0x14);
|
||||
char path[0x40];
|
||||
WUT_PADDING_BYTES(0x80 - 0x60);
|
||||
};
|
||||
WUT_CHECK_OFFSET(ACPSaveDirInfo, 0x08, persistentId);
|
||||
WUT_CHECK_OFFSET(ACPSaveDirInfo, 0x20, path);
|
||||
WUT_CHECK_SIZE(ACPSaveDirInfo, 0x80);
|
||||
|
||||
ACPResult
|
||||
ACPCreateSaveDir(uint32_t persistentId,
|
||||
ACPDeviceType deviceType);
|
||||
|
|
@ -28,6 +43,48 @@ ACPMountExternalStorage();
|
|||
ACPResult
|
||||
ACPMountSaveDir();
|
||||
|
||||
/**
|
||||
* Deletes the given user's save data directory for the given title.
|
||||
*
|
||||
* \param persistentId
|
||||
* The persistent ID of the user. Pass \c 0 to delete the 'common' directory.
|
||||
*
|
||||
* \return
|
||||
* ACP_RESULT_SUCCESS on success.
|
||||
*/
|
||||
ACPResult
|
||||
ACPRemoveSaveDir(uint32_t persistentId,
|
||||
uint64_t titleId,
|
||||
ACPDeviceType deviceType);
|
||||
|
||||
/**
|
||||
* Deletes the given user's save data directory for the given title.
|
||||
*
|
||||
* \param persistentId
|
||||
* The persistent ID of the user. Pass \c 0 to delete the 'common' directory.
|
||||
*
|
||||
* \return
|
||||
* ACP_RESULT_SUCCESS on success.
|
||||
*/
|
||||
ACPResult
|
||||
ACPRemoveSaveDirWithoutFlush(uint32_t persistentId,
|
||||
uint64_t titleId,
|
||||
ACPDeviceType deviceType);
|
||||
|
||||
/**
|
||||
* Deletes the given user's save data directory for the given title.
|
||||
*
|
||||
* \param persistentId
|
||||
* The persistent ID of the user. Pass \c 0 to delete the 'common' directory.
|
||||
*
|
||||
* \return
|
||||
* ACP_RESULT_SUCCESS on success.
|
||||
*/
|
||||
ACPResult
|
||||
ACPRemoveSaveDirWithoutMetaCheck(uint32_t persistentId,
|
||||
uint64_t titleId,
|
||||
ACPDeviceType deviceType);
|
||||
|
||||
ACPResult
|
||||
ACPRepairSaveMetaDir();
|
||||
|
||||
|
|
@ -37,6 +94,59 @@ ACPUnmountExternalStorage();
|
|||
ACPResult
|
||||
ACPUnmountSaveDir();
|
||||
|
||||
/**
|
||||
* Gets all titles id which have save data
|
||||
*
|
||||
* @param deviceType
|
||||
* @param titlesOut needs to be aligned to 0x40
|
||||
* @param maxCount needs to be a multiple of 8
|
||||
* @param countOut
|
||||
* @return ACP_RESULT_SUCCESS on success.
|
||||
*/
|
||||
ACPResult
|
||||
ACPGetSaveDataTitleIdList(ACPDeviceType deviceType,
|
||||
uint64_t *titlesOut,
|
||||
uint32_t maxCount,
|
||||
uint32_t *countOut);
|
||||
|
||||
/**
|
||||
* Gets a list of all saves dir for a given title id
|
||||
*
|
||||
* @param titleId
|
||||
* @param deviceType
|
||||
* @param u1 seems to be always 0
|
||||
* @param saveDirInfo needs to be aligned to 0x40
|
||||
* @param maxCount
|
||||
* @param countOut
|
||||
* @return ACP_RESULT_SUCCESS on success.
|
||||
*/
|
||||
ACPResult
|
||||
ACPGetTitleSaveDirEx(uint64_t titleId,
|
||||
ACPDeviceType deviceType,
|
||||
uint32_t u1,
|
||||
ACPSaveDirInfo *saveDirInfo,
|
||||
uint32_t maxCount,
|
||||
uint32_t *countOut);
|
||||
|
||||
/**
|
||||
* Gets a list of all saves dir for a given title id
|
||||
*
|
||||
* @param titleId
|
||||
* @param deviceType
|
||||
* @param u1 seems to be always 0
|
||||
* @param saveDirInfo needs to be aligned to 0x40
|
||||
* @param maxCount
|
||||
* @param countOut
|
||||
* @return ACP_RESULT_SUCCESS on success.
|
||||
*/
|
||||
ACPResult
|
||||
ACPGetTitleSaveDirExWithoutMetaCheck(uint64_t titleId,
|
||||
ACPDeviceType deviceType,
|
||||
uint32_t u1,
|
||||
ACPSaveDirInfo *saveDirInfo,
|
||||
uint32_t maxCount,
|
||||
uint32_t *countOut);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include <nn/acp/result.h>
|
||||
#include <nn/acp/device.h>
|
||||
#include <coreinit/mcp.h>
|
||||
#include <nn/acp/device.h>
|
||||
#include <nn/acp/result.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_acp_title Title
|
||||
|
|
@ -20,7 +20,8 @@ extern "C" {
|
|||
typedef uint64_t ACPTitleId;
|
||||
typedef struct ACPMetaXml ACPMetaXml;
|
||||
|
||||
struct WUT_PACKED ACPMetaXml {
|
||||
struct WUT_PACKED ACPMetaXml
|
||||
{
|
||||
uint64_t title_id;
|
||||
uint64_t boss_id;
|
||||
uint64_t os_version;
|
||||
|
|
@ -249,9 +250,11 @@ ACPGetTitleIdOfMainApplication(ACPTitleId* titleId);
|
|||
* @param metaXml must be aligned to 0x40
|
||||
* @return ACP_RESULT_SUCCESS on success
|
||||
*/
|
||||
// clang-format off
|
||||
ACPResult
|
||||
RPLWRAP(ACPGetTitleMetaXml)(ACPTitleId titleId,
|
||||
ACPMetaXml *metaXml);
|
||||
// clang-format on
|
||||
|
||||
/**
|
||||
* Gets the MetaXML for a given title id
|
||||
|
|
@ -262,19 +265,56 @@ RPLWRAP(ACPGetTitleMetaXml)(ACPTitleId titleId,
|
|||
*/
|
||||
static inline ACPResult
|
||||
ACPGetTitleMetaXml(ACPTitleId titleId,
|
||||
ACPMetaXml *metaXml) {
|
||||
ACPMetaXml *metaXml)
|
||||
{
|
||||
if ((uintptr_t)metaXml & 0x3F) {
|
||||
return ACP_RESULT_INVALID_PARAMETER;
|
||||
}
|
||||
return RPLWRAP(ACPGetTitleMetaXml)(titleId, metaXml);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
ACPResult
|
||||
RPLWRAP(ACPGetTitleSaveMetaXml)(uint64_t titleId,
|
||||
ACPMetaXml* metaXml,
|
||||
ACPDeviceType deviceType);
|
||||
// clang-format on
|
||||
|
||||
/**
|
||||
* Gets the save dir MetaXML for a given title id
|
||||
* @param titleId
|
||||
* @param metaXml must be aligned to 0x40
|
||||
* @param deviceType
|
||||
* @return ACP_RESULT_SUCCESS on success,
|
||||
* ACP_RESULT_INVALID_PARAMETER if metaXml is not aligned properly
|
||||
*/
|
||||
static inline ACPResult
|
||||
ACPGetTitleSaveMetaXml(ACPTitleId titleId,
|
||||
ACPMetaXml *metaXml,
|
||||
ACPDeviceType deviceType)
|
||||
{
|
||||
if ((uintptr_t)metaXml & 0x3F) {
|
||||
return ACP_RESULT_INVALID_PARAMETER;
|
||||
}
|
||||
return RPLWRAP(ACPGetTitleSaveMetaXml)(titleId, metaXml, deviceType);
|
||||
}
|
||||
|
||||
ACPResult
|
||||
ACPGetTitleMetaDir(ACPTitleId titleId,
|
||||
char *directory,
|
||||
size_t directoryLen);
|
||||
|
||||
ACPResult
|
||||
ACPGetTitleMetaDirByDevice(ACPTitleId titleId,
|
||||
char *directory,
|
||||
size_t directoryLen,
|
||||
ACPDeviceType deviceType);
|
||||
|
||||
ACPResult
|
||||
ACPGetTitleMetaDirByTitleListType(MCPTitleListType titleListType,
|
||||
char *directory,
|
||||
size_t directoryLen);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <nn/result.h>
|
||||
#include <nn/ffl/miidata.h>
|
||||
#include <nn/result.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_act_client Accounts Client API
|
||||
|
|
@ -12,9 +12,11 @@
|
|||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace nn {
|
||||
namespace nn
|
||||
{
|
||||
|
||||
namespace act {
|
||||
namespace act
|
||||
{
|
||||
|
||||
//https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/nn/act/nn_act_types.h
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <coreinit/time.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_ccr_sys
|
||||
|
|
@ -12,6 +13,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct CCRSysUpdateState CCRSysUpdateState;
|
||||
|
||||
typedef enum CCRSysPairingState
|
||||
{
|
||||
//! Pairing is complete / hasn't started yet
|
||||
|
|
@ -22,6 +25,29 @@ typedef enum CCRSysPairingState
|
|||
CCR_SYS_PAIRING_TIMED_OUT = 2,
|
||||
} CCRSysPairingState;
|
||||
|
||||
typedef enum CCRSysInitBootFlag
|
||||
{
|
||||
CCR_SYS_BOOT_FLAG_NONE = 0,
|
||||
//! Shows "Turn on the TV and Wii U Console.." text on next DRC boot
|
||||
CCR_SYS_BOOT_FLAG_FIRST_BOOT = 1,
|
||||
} CCRSysInitBootFlag;
|
||||
|
||||
typedef enum CCRSysLCDMode
|
||||
{
|
||||
CCR_SYS_LCD_MODE_BRIGHTNESS_1 = 1,
|
||||
CCR_SYS_LCD_MODE_BRIGHTNESS_2 = 2,
|
||||
CCR_SYS_LCD_MODE_BRIGHTNESS_3 = 3,
|
||||
CCR_SYS_LCD_MODE_BRIGHTNESS_4 = 4,
|
||||
CCR_SYS_LCD_MODE_BRIGHTNESS_5 = 5,
|
||||
} CCRSysLCDMode;
|
||||
|
||||
struct CCRSysUpdateState
|
||||
{
|
||||
uint32_t state;
|
||||
//! Progress from 0-100
|
||||
uint32_t progress;
|
||||
};
|
||||
|
||||
void
|
||||
CCRSysInit(void);
|
||||
|
||||
|
|
@ -105,6 +131,184 @@ CCRSysGetPairingState(void);
|
|||
int32_t
|
||||
CCRSysGetPincode(uint32_t *pin);
|
||||
|
||||
/**
|
||||
* Sets the DRH system time.
|
||||
*
|
||||
* \param time
|
||||
* The system time in ticks.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
CCRSysSetSystemTime(OSTime time);
|
||||
|
||||
/**
|
||||
* Check if a DRC firmware update is needed.
|
||||
* This function additionally verifies the DRC area compared to \link __CCRSysNeedsDRCFWUpdate \endlink.
|
||||
*
|
||||
* \param drcSlot
|
||||
* Slot from 0 to 1.
|
||||
*
|
||||
* \param outNeedsUpdate
|
||||
* Pointer to store the result to.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
CCRSysNeedsDRCFWUpdate(uint32_t drcSlot,
|
||||
BOOL *outNeedsUpdate);
|
||||
|
||||
/**
|
||||
* Check if a DRC firmware update is needed.
|
||||
*
|
||||
* \param drcSlot
|
||||
* Slot from 0 to 1.
|
||||
*
|
||||
* \param outNeedsUpdate
|
||||
* Pointer to store the result to.
|
||||
*
|
||||
* \param allowDowngrade
|
||||
* Only check if the installed version doesn't match the running version,
|
||||
* instead of checking that it's greater.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
__CCRSysNeedsDRCFWUpdate(uint32_t drcSlot,
|
||||
BOOL *outNeedsUpdate,
|
||||
BOOL allowDowngrade);
|
||||
|
||||
/**
|
||||
* Starts a DRC firmware update if necessary and region matches.
|
||||
*
|
||||
* \note
|
||||
* This function will wait for \link CCRSysDRCFWUpdateForward \endlink to be called once done.
|
||||
* See \link CCRSysGetUpdateState \endlink for status and progress.
|
||||
*
|
||||
* \param drcSlot
|
||||
* Slot from 0 to 1.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
CCRSysDRCFWUpdate(uint32_t drcSlot);
|
||||
|
||||
/**
|
||||
* Starts a DRC firmware update if necessary.
|
||||
*
|
||||
* \note
|
||||
* This function will wait for \link CCRSysDRCFWUpdateForward \endlink to be called once done.
|
||||
* See \link CCRSysGetUpdateState \endlink for status and progress.
|
||||
*
|
||||
* \param drcSlot
|
||||
* Slot from 0 to 1.
|
||||
*
|
||||
* \param allowDowngrade
|
||||
* Only check if the installed version doesn't match the running version,
|
||||
* instead of checking that it's greater.
|
||||
* There are additional checks on the IOS side and this doesn't actually allow downgrading the firmware.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
__CCRSysDRCFWUpdate(uint32_t drcSlot,
|
||||
BOOL allowDowngrade);
|
||||
|
||||
|
||||
/**
|
||||
* Finish a pending DRC firmware update.
|
||||
*/
|
||||
void
|
||||
CCRSysDRCFWUpdateForward(void);
|
||||
|
||||
/**
|
||||
* Get the update state during a pending DRC firmware update.
|
||||
*
|
||||
* \param outUpdateState
|
||||
* Pointer to store the state to.
|
||||
*/
|
||||
void
|
||||
CCRSysGetUpdateState(CCRSysUpdateState *outUpdateState);
|
||||
|
||||
/**
|
||||
* Initialize a DRC reattach.
|
||||
*
|
||||
* \param drcSlot
|
||||
* Slot from 0 to 1.
|
||||
*/
|
||||
void
|
||||
__CCRSysInitReattach(uint32_t drcSlot);
|
||||
|
||||
/**
|
||||
* Wait for the DRC to reattach.
|
||||
* This returns once the DRC disconnects and reconnects or a timeout is reached.
|
||||
*
|
||||
* \param drcSlot
|
||||
* Slot from 0 to 1.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
__CCRSysWaitReattach(uint32_t drcSlot,
|
||||
BOOL unknown);
|
||||
|
||||
/**
|
||||
* Get the version check flag.
|
||||
*
|
||||
* \param outFlag
|
||||
* Pointer to write the flag to.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
CCRSysGetVersionCheckFlag(uint32_t *outFlag);
|
||||
|
||||
/**
|
||||
* Set the version check flag.
|
||||
*
|
||||
* \param outFlag
|
||||
* The flag to set.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
CCRSysSetVersionCheckFlag(uint32_t flag);
|
||||
|
||||
int32_t
|
||||
CCRSysCaffeineSetCaffeineSlot(uint32_t slot);
|
||||
|
||||
int32_t
|
||||
CCRSysSetInitBootFlag(CCRSysInitBootFlag flag);
|
||||
|
||||
/**
|
||||
* Resets the DRC (It'll show "Turn on the TV and Wii U console" until paired)
|
||||
* @return 0 on success, -1 on error.
|
||||
*/
|
||||
int32_t
|
||||
CCRSysInitializeSettings();
|
||||
|
||||
/**
|
||||
* Sets the brightness of the DRC.
|
||||
* @return 0 on success, -1 on error.
|
||||
*/
|
||||
int32_t
|
||||
CCRSysSetCurrentLCDMode(CCRSysLCDMode mode);
|
||||
|
||||
/**
|
||||
* Gets the brightness of the DRC.
|
||||
* @return 0 on success, -1 on error.
|
||||
*/
|
||||
int32_t
|
||||
CCRSysGetCurrentLCDMode(CCRSysLCDMode *mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ typedef struct CCRAppLaunchParam CCRAppLaunchParam;
|
|||
|
||||
struct WUT_PACKED CCRAppLaunchParam
|
||||
{
|
||||
uint64_t titleId;
|
||||
char uuid[16];
|
||||
uint64_t launchInfoDatabaseEntryId; // id used in the \link nn::sl::LaunchInfoDatabase
|
||||
char uuid[16]; // account uuid
|
||||
WUT_UNKNOWN_BYTES(0xE7);
|
||||
};
|
||||
WUT_CHECK_OFFSET(CCRAppLaunchParam, 0x00, titleId);
|
||||
WUT_CHECK_OFFSET(CCRAppLaunchParam, 0x00, launchInfoDatabaseEntryId);
|
||||
WUT_CHECK_OFFSET(CCRAppLaunchParam, 0x08, uuid);
|
||||
WUT_CHECK_SIZE(CCRAppLaunchParam, 0xFF);
|
||||
|
||||
|
|
@ -30,6 +30,21 @@ CCRSysCaffeineGetAppLaunchParam(CCRAppLaunchParam * data);
|
|||
uint32_t
|
||||
CCRSysCaffeineBootCheck();
|
||||
|
||||
void
|
||||
CCRSysCaffeineBootCheckAbort();
|
||||
|
||||
/**
|
||||
* @return 0 on success, -1 on error
|
||||
*/
|
||||
int32_t
|
||||
CCRSysCaffeineSetDRCEnableFlag(int32_t enabled);
|
||||
|
||||
/**
|
||||
* @return 0 on success, -1 on error
|
||||
*/
|
||||
int32_t
|
||||
CCRSysCaffeineSetEnableFlag(int32_t enabled);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
29
include/nn/cfg/CTR.h
Normal file
29
include/nn/cfg/CTR.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
||||
namespace cfg
|
||||
{
|
||||
|
||||
namespace CTR
|
||||
{
|
||||
|
||||
//! Represents a console username, used in UDS and DLP
|
||||
struct UserName
|
||||
{
|
||||
char16_t name[12];
|
||||
};
|
||||
WUT_CHECK_SIZE(UserName, 0x18);
|
||||
|
||||
} // namespace CTR
|
||||
|
||||
} // namespace cfg
|
||||
|
||||
} // namespace nn
|
||||
|
||||
#endif
|
||||
|
|
@ -12,7 +12,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum CmptScreenType {
|
||||
typedef enum CmptScreenType
|
||||
{
|
||||
CMPT_SCREEN_TYPE_TV = 1,
|
||||
CMPT_SCREEN_TYPE_DRC,
|
||||
CMPT_SCREEN_TYPE_BOTH,
|
||||
|
|
|
|||
8
include/nn/dlp.h
Normal file
8
include/nn/dlp.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
/**
|
||||
* \defgroup nn_dlp nn_dlp
|
||||
* Download Play functions
|
||||
*/
|
||||
|
||||
#include <nn/dlp/Cafe.h>
|
||||
359
include/nn/dlp/Cafe.h
Normal file
359
include/nn/dlp/Cafe.h
Normal file
|
|
@ -0,0 +1,359 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include <nn/cfg/CTR.h>
|
||||
#include <nn/result.h>
|
||||
#include <nn/uds/NodeInformation.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_dlp nn_dlp
|
||||
* \ingroup nn_dlp
|
||||
* Download Play functions (see \link nn::dlp \endlink)
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
||||
namespace dlp
|
||||
{
|
||||
|
||||
namespace Cafe
|
||||
{
|
||||
enum PollStateChangeFlags : uint8_t
|
||||
{
|
||||
//! Prevents \c PollStateChange from blocking if no new data is available
|
||||
DLP_POLL_NONBLOCK = 1 << 0,
|
||||
};
|
||||
WUT_CHECK_SIZE(PollStateChangeFlags, 0x1);
|
||||
|
||||
//! Represents the client state
|
||||
enum class ClientState : uint32_t
|
||||
{
|
||||
//! The client is accepted for the DLP child distribution
|
||||
Accepted = 5,
|
||||
//! The client is receiving the distributed DLP child
|
||||
Receiving = 6,
|
||||
//! The client has received the distribution and is ready to boot the DLP child
|
||||
Ready = 7,
|
||||
//! The client is connected to the session and pending to be accepted
|
||||
Connecting = 64
|
||||
};
|
||||
WUT_CHECK_SIZE(ClientState, 0x4);
|
||||
|
||||
//! Represents the server state. All values between 3 and 7 are considered internal state
|
||||
enum class ServerState : uint32_t
|
||||
{
|
||||
//! The server is not initialized
|
||||
Uninitialized = 0,
|
||||
//! The server is initialized but there is no active network
|
||||
Idle = 1,
|
||||
//! The server is open to new connections
|
||||
Open = 2,
|
||||
//! The server is distributing the DLP child to the clients
|
||||
DistributingInternal = 7,
|
||||
//! The server has distributed the DLP child
|
||||
Distributed = 8,
|
||||
//! The server has finished distribution and clients are booted into the DLP child
|
||||
Finished = 9,
|
||||
//! The server failed to distribute the DLP child to the clients
|
||||
Failed = 10,
|
||||
//! Public value for internal states
|
||||
Distributing = 11
|
||||
};
|
||||
WUT_CHECK_SIZE(ServerState, 0x4);
|
||||
|
||||
class Server
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Accepts a client into the DLP child distribution.
|
||||
*
|
||||
* \param nodeId
|
||||
* The node ID of the client.
|
||||
*/
|
||||
static nn::Result
|
||||
AcceptClient(uint16_t nodeId)
|
||||
asm("AcceptClient__Q4_2nn3dlp4Cafe6ServerSFUs");
|
||||
|
||||
/**
|
||||
* Closes the DLP session.
|
||||
*/
|
||||
static nn::Result
|
||||
CloseSessions()
|
||||
asm("CloseSessions__Q4_2nn3dlp4Cafe6ServerSFv");
|
||||
|
||||
/**
|
||||
* Disconnects a client from the DLP session. This cannot be done after starting distribution.
|
||||
*
|
||||
* \param nodeId
|
||||
* The node ID of the client.
|
||||
*/
|
||||
static nn::Result
|
||||
DisconnectClient(uint16_t nodeId)
|
||||
asm("DisconnectClient__Q4_2nn3dlp4Cafe6ServerSFUs");
|
||||
|
||||
/**
|
||||
* Finalizes DLP.
|
||||
*/
|
||||
static nn::Result
|
||||
Finalize()
|
||||
asm("Finalize__Q4_2nn3dlp4Cafe6ServerSFv");
|
||||
|
||||
/**
|
||||
* Gets information about a client.
|
||||
*
|
||||
* \param clientInfo
|
||||
* Pointer where the client information is written.
|
||||
*
|
||||
* \param nodeId
|
||||
* Node ID of the client.
|
||||
*/
|
||||
static nn::Result
|
||||
GetClientInfo(nn::uds::Cafe::NodeInformation *clientInfo, uint16_t nodeId)
|
||||
asm("GetClientInfo__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3uds4Cafe15NodeInformationUs");
|
||||
|
||||
/**
|
||||
* Gets a client state.
|
||||
*
|
||||
* \param state
|
||||
* Pointer where the client state is filled in.
|
||||
*
|
||||
* \param nodeId
|
||||
* Node ID of the client.
|
||||
*/
|
||||
static nn::Result
|
||||
GetClientState(ClientState *state, uint16_t nodeId)
|
||||
asm("GetClientState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ClientStateUs");
|
||||
|
||||
/**
|
||||
* Gets a client state.
|
||||
*
|
||||
* \param state
|
||||
* Pointer where the client state is filled in.
|
||||
*
|
||||
* \param unitsTotal
|
||||
* Pointer filled with the total number of units being distributed.
|
||||
* Only filled when starting distribution and the DLP child isn't cached.
|
||||
*
|
||||
* \param unitsReceived
|
||||
* Pointer filled with the number of units that the client has received.
|
||||
* Only filled when starting distribution and the DLP child isn't cached.
|
||||
*
|
||||
* \param nodeId
|
||||
* Node ID of the client.
|
||||
*/
|
||||
static nn::Result
|
||||
GetClientState(ClientState *state,
|
||||
uint32_t *unitsTotal,
|
||||
uint32_t *unitsReceived,
|
||||
uint16_t nodeId)
|
||||
asm("GetClientState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ClientStatePUiT2Us");
|
||||
|
||||
/**
|
||||
* Gets the clients that are connected to the DLP session.
|
||||
*
|
||||
* \param receivedLength
|
||||
* Pointer where the number of clients written to the array is stored.
|
||||
*
|
||||
* \param connectingClients
|
||||
* Array where the node IDs of the clients are written.
|
||||
*
|
||||
* \param length
|
||||
* Number of nodes that the \c connectingClients array can hold.
|
||||
*/
|
||||
static nn::Result
|
||||
GetConnectingClients(uint16_t *receivedLength,
|
||||
uint16_t *connectingClients,
|
||||
uint16_t length)
|
||||
asm("GetConnectingClients__Q4_2nn3dlp4Cafe6ServerSFPUsT1Us");
|
||||
|
||||
/**
|
||||
* Gets the server state. Internal states are filtered as \link Distributing \endlink .
|
||||
*
|
||||
* \param state
|
||||
* Pointer where the server state is written.
|
||||
*/
|
||||
static nn::Result
|
||||
GetState(ServerState *state)
|
||||
asm("GetState__Q4_2nn3dlp4Cafe6ServerSFPQ4_2nn3dlp4Cafe11ServerState");
|
||||
|
||||
/**
|
||||
* Initializes DLP.
|
||||
*
|
||||
* \param maxClientNum
|
||||
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
||||
*
|
||||
* \param uniqueId
|
||||
* Unique ID of the DLP child to be distributed.
|
||||
*
|
||||
* \param childIndex
|
||||
* Index of the DLP child to be distributed.
|
||||
*
|
||||
* \param userName
|
||||
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
||||
*/
|
||||
static nn::Result
|
||||
Initialize(uint8_t maxClientNum,
|
||||
uint32_t uniqueId,
|
||||
uint8_t childIndex,
|
||||
nn::cfg::CTR::UserName *userName)
|
||||
asm("Initialize__Q4_2nn3dlp4Cafe6ServerSFUcUiT1PQ4_2nn3cfg3CTR8UserName");
|
||||
|
||||
/**
|
||||
* Initializes DLP.
|
||||
*
|
||||
* \param dupNoticeNeed
|
||||
* Unknown output bool, always false on the Wii U.
|
||||
*
|
||||
* \param maxClientNum
|
||||
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
||||
*
|
||||
* \param uniqueId
|
||||
* Unique ID of the DLP child to be distributed.
|
||||
*
|
||||
* \param childIndex
|
||||
* Index of the DLP child to be distributed.
|
||||
*
|
||||
* \param userName
|
||||
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
||||
*/
|
||||
static nn::Result
|
||||
Initialize(bool *dupNoticeNeed,
|
||||
uint8_t maxClientNum,
|
||||
uint32_t uniqueId,
|
||||
uint8_t childIndex,
|
||||
nn::cfg::CTR::UserName *userName)
|
||||
asm("Initialize__Q4_2nn3dlp4Cafe6ServerSFPbUcUiT2PQ4_2nn3cfg3CTR8UserName");
|
||||
|
||||
/**
|
||||
* Opens the DLP session.
|
||||
*
|
||||
* \param isManualAccept
|
||||
* If set, all clients must be accepted to allow them to join the session.
|
||||
*
|
||||
* \param channel
|
||||
* The channel to be used for hosting the session. Use 0 to choose a channel automatically.
|
||||
* Must be either 0, 1, 6 or 11.
|
||||
*/
|
||||
static nn::Result
|
||||
OpenSessions(bool isManualAccept, uint8_t channel)
|
||||
asm("OpenSessions__Q4_2nn3dlp4Cafe6ServerSFbUc");
|
||||
|
||||
/**
|
||||
* Checks if the server state chas changed, and waits until it changes if specified.
|
||||
*
|
||||
* \param flags
|
||||
* Flags, see \link PollStateChangeFlags \endlink for all flags.
|
||||
*/
|
||||
static nn::Result
|
||||
PollStateChange(uint8_t flags)
|
||||
asm("PollStateChange__Q4_2nn3dlp4Cafe6ServerSFUc");
|
||||
|
||||
/**
|
||||
* Reboots all clients into the Download Play child.
|
||||
*
|
||||
* \param passPhrase
|
||||
* Passphrase to be used by the client when connecting to the main UDS network.
|
||||
* If \c NULL, it will be set to an empty string.
|
||||
*/
|
||||
static nn::Result
|
||||
RebootAllClients(const char *passPhrase)
|
||||
asm("RebootAllClients__Q4_2nn3dlp4Cafe6ServerSFPCc");
|
||||
|
||||
/**
|
||||
* Starts distribution of the Download Play child.
|
||||
*/
|
||||
static nn::Result
|
||||
StartDistribution()
|
||||
asm("StartDistribute__Q4_2nn3dlp4Cafe6ServerSFv");
|
||||
};
|
||||
|
||||
class ServerPrivate
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Gets the server state. Internal states are not filtered.
|
||||
*
|
||||
* \param state
|
||||
* Pointer where the server state is written.
|
||||
*/
|
||||
static nn::Result
|
||||
GetInternalState(ServerState *state)
|
||||
asm("GetInternalState__Q4_2nn3dlp4Cafe13ServerPrivateSFPQ4_2nn3dlp4Cafe11ServerState");
|
||||
|
||||
/**
|
||||
* Initializes DLP.
|
||||
*
|
||||
* \param maxClientNum
|
||||
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
||||
*
|
||||
* \param uniqueId
|
||||
* Unique ID of the DLP child to be distributed.
|
||||
*
|
||||
* \param childIndex
|
||||
* Index of the DLP child to be distributed.
|
||||
*
|
||||
* \param blockBufferSize
|
||||
* Unknown parameter (default: 0xC000). Must be bigger than 0x4000 and smaller than 0x80000 inclusively.
|
||||
*
|
||||
* \param blockBufferNum
|
||||
* Unknown parameter (default: 2). Must be a number between 2 and 4 inclusively.
|
||||
*
|
||||
* \param userName
|
||||
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
||||
*/
|
||||
static nn::Result
|
||||
Initialize(uint8_t maxClientNum,
|
||||
uint32_t uniqueId,
|
||||
uint8_t childIndex,
|
||||
uint32_t blockBufferSize,
|
||||
uint32_t blockBufferNum,
|
||||
nn::cfg::CTR::UserName *userName)
|
||||
asm("Initialize__Q4_2nn3dlp4Cafe13ServerPrivateSFUcUiT1N22PQ4_2nn3cfg3CTR8UserName");
|
||||
|
||||
/**
|
||||
* Initializes DLP.
|
||||
*
|
||||
* \param dupNoticeNeed
|
||||
* Unknown output bool, always false on the Wii U.
|
||||
*
|
||||
* \param maxClientNum
|
||||
* Maximum number of clients allowed for distribution. Must be between 1 and 8 inclusively.
|
||||
*
|
||||
* \param uniqueId
|
||||
* Unique ID of the DLP child to be distributed.
|
||||
*
|
||||
* \param childIndex
|
||||
* Index of the DLP child to be distributed.
|
||||
*
|
||||
* \param blockBufferSize
|
||||
* Unknown parameter (default: 0xC000). Must be bigger than 0x4000 and smaller than 0x80000 inclusively.
|
||||
*
|
||||
* \param blockBufferNum
|
||||
* Unknown parameter (default: 2). Must be a number between 2 and 4 inclusively.
|
||||
*
|
||||
* \param userName
|
||||
* Username that will be displayed to the clients. If \c NULL, the Mii name will be used.
|
||||
*/
|
||||
static nn::Result
|
||||
Initialize(bool *dupNoticeNeed,
|
||||
uint8_t maxClientNum,
|
||||
uint32_t uniqueId,
|
||||
uint8_t childIndex,
|
||||
uint32_t blockBufferSize,
|
||||
uint32_t blockBufferNum,
|
||||
nn::cfg::CTR::UserName *userName)
|
||||
asm("Initialize__Q4_2nn3dlp4Cafe13ServerPrivateSFPbUcUiT2N23PQ4_2nn3cfg3CTR8UserName");
|
||||
};
|
||||
} // namespace Cafe
|
||||
|
||||
} // namespace dlp
|
||||
|
||||
} // namespace nn
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
#include <coreinit/filesystem.h>
|
||||
#include <nn/result.h>
|
||||
#include <padscore/kpad.h>
|
||||
#include <vpad/input.h>
|
||||
#include <string.h>
|
||||
#include <vpad/input.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_erreula_erreula Error Viewer
|
||||
|
|
@ -43,7 +43,17 @@ enum class LangType
|
|||
{
|
||||
Japanese = 0,
|
||||
English = 1,
|
||||
// TODO: More languages
|
||||
French = 2,
|
||||
German = 3,
|
||||
Italian = 4,
|
||||
Spanish = 5,
|
||||
SimplifiedChinese = 6,
|
||||
Korean = 7,
|
||||
Dutch = 8,
|
||||
Portuguese = 9,
|
||||
Russian = 10,
|
||||
TraditionalChinese = 11,
|
||||
Invalid = 12,
|
||||
};
|
||||
|
||||
enum class RegionType
|
||||
|
|
|
|||
|
|
@ -14,13 +14,15 @@ extern "C" {
|
|||
|
||||
// https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/nn/ffl/nn_ffl_miidata.h
|
||||
|
||||
typedef enum FFLCreateIDFlags {
|
||||
typedef enum FFLCreateIDFlags
|
||||
{
|
||||
FFL_CREATE_ID_FLAG_WII_U = 0x1 | 0x4,
|
||||
FFL_CREATE_ID_FLAG_TEMPORARY = 0x2,
|
||||
FFL_CREATE_ID_FLAG_NORMAL = 0x8,
|
||||
} FFLCreateIDFlags;
|
||||
|
||||
typedef struct WUT_PACKED FFLCreateID {
|
||||
typedef struct WUT_PACKED FFLCreateID
|
||||
{
|
||||
FFLCreateIDFlags flags : 4;
|
||||
|
||||
uint32_t timestamp : 28;
|
||||
|
|
@ -31,7 +33,8 @@ WUT_CHECK_OFFSET(FFLCreateID, 4, deviceHash);
|
|||
WUT_CHECK_SIZE(FFLCreateID, 10);
|
||||
|
||||
//Note: the endian may be wrong here
|
||||
typedef struct WUT_PACKED FFLiMiiDataCore {
|
||||
typedef struct WUT_PACKED FFLiMiiDataCore
|
||||
{
|
||||
// 0x00
|
||||
uint8_t birth_platform : 4;
|
||||
uint8_t unk_0x00_b4 : 4;
|
||||
|
|
@ -150,14 +153,16 @@ WUT_CHECK_OFFSET(FFLiMiiDataCore, 0x2F, fatness);
|
|||
WUT_CHECK_OFFSET(FFLiMiiDataCore, 0x33, hair_type);
|
||||
WUT_CHECK_SIZE(FFLiMiiDataCore, 0x48);
|
||||
|
||||
typedef struct WUT_PACKED FFLiMiiDataOfficial {
|
||||
typedef struct WUT_PACKED FFLiMiiDataOfficial
|
||||
{
|
||||
FFLiMiiDataCore core;
|
||||
uint16_t creator_name[10];
|
||||
} FFLiMiiDataOfficial;
|
||||
WUT_CHECK_OFFSET(FFLiMiiDataOfficial, 0x48, creator_name);
|
||||
WUT_CHECK_SIZE(FFLiMiiDataOfficial, 0x5C);
|
||||
|
||||
typedef struct WUT_PACKED FFLStoreData {
|
||||
typedef struct WUT_PACKED FFLStoreData
|
||||
{
|
||||
FFLiMiiDataOfficial data;
|
||||
uint16_t unk_0x5C;
|
||||
uint16_t checksum;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <nn/result.h>
|
||||
#include <nn/ffl/miidata.h>
|
||||
#include <nn/act.h>
|
||||
#include <nn/ffl/miidata.h>
|
||||
#include <nn/result.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_fp_fp Friends Presence
|
||||
|
|
|
|||
9
include/nn/hpad.h
Normal file
9
include/nn/hpad.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
/**
|
||||
* \defgroup nn_hpad nn_hpad
|
||||
* Library for using the USB Gamecube Controller Adapter (HID Pad?).
|
||||
*/
|
||||
|
||||
#include <nn/hpad/beta.h>
|
||||
#include <nn/hpad/hpad.h>
|
||||
64
include/nn/hpad/beta.h
Normal file
64
include/nn/hpad/beta.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <nn/hpad/hpad.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_hpad_beta
|
||||
* \ingroup nn_hpad
|
||||
* Beta functions for HPAD.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Prints internal state info to the COS shell.
|
||||
*/
|
||||
void
|
||||
BETA_DEBUG_DUMP(void);
|
||||
|
||||
/**
|
||||
* Gets the command queue size of the specified adapter.
|
||||
*
|
||||
* \param chan
|
||||
* The channel to get the size of.
|
||||
*
|
||||
* \return
|
||||
* The command queue size.
|
||||
*/
|
||||
int32_t
|
||||
BETA_DEBUG_GET_QUEUE_SIZE(HPADGGGGChan chan);
|
||||
|
||||
|
||||
/**
|
||||
* Sends a report to the specified adapter.
|
||||
*
|
||||
* \param chan
|
||||
* The channel to send the report to.
|
||||
*
|
||||
* \param reptId
|
||||
* The ID of the report to send.
|
||||
*/
|
||||
void
|
||||
BETA_DEBUG_SEND_REPT_ID(HPADGGGGChan chan,
|
||||
uint32_t reptId);
|
||||
|
||||
/**
|
||||
* Returns immediately.
|
||||
*/
|
||||
void
|
||||
BETA_DEBUG_GET_RAW_DATA(void);
|
||||
|
||||
/**
|
||||
* Returns immediately.
|
||||
*/
|
||||
void
|
||||
BETA_DEBUG_SET_DUMP_MODE(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
342
include/nn/hpad/hpad.h
Normal file
342
include/nn/hpad/hpad.h
Normal file
|
|
@ -0,0 +1,342 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_hpad_hpad
|
||||
* \ingroup nn_hpad
|
||||
* Functions for using the USB Gamecube Controller Adapter.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//! The minimum value of the stick axis
|
||||
#define HPAD_STICK_AXIS_MIN -56
|
||||
//! The maximum value of the stick axis
|
||||
#define HPAD_STICK_AXIS_MAX 56
|
||||
//! The minimum value of the substick axis
|
||||
#define HPAD_SUBSTICK_AXIS_MIN -44
|
||||
//! The maximum value of the substick axis
|
||||
#define HPAD_SUBSTICK_AXIS_MAX 44
|
||||
//! The minimum value of the trigger
|
||||
#define HPAD_TRIGGER_MIN 0
|
||||
//! The maximum value of the trigger
|
||||
#define HPAD_TRIGGER_MAX 150
|
||||
|
||||
typedef struct HPADStatus HPADStatus;
|
||||
typedef struct HPADGGGGStatus HPADGGGGStatus;
|
||||
|
||||
typedef enum HPADChan
|
||||
{
|
||||
HPAD_CHAN_0 = 0,
|
||||
HPAD_CHAN_1 = 1,
|
||||
HPAD_CHAN_2 = 2,
|
||||
HPAD_CHAN_3 = 3,
|
||||
HPAD_CHAN_4 = 4,
|
||||
HPAD_CHAN_5 = 5,
|
||||
HPAD_CHAN_6 = 6,
|
||||
HPAD_CHAN_7 = 7,
|
||||
} HPADChan;
|
||||
|
||||
typedef enum HPADGGGGChan
|
||||
{
|
||||
//! Adapter Channel 0
|
||||
HPAD_GGGG_CHAN_0 = 0,
|
||||
//! Adapter Channel 1
|
||||
HPAD_GGGG_CHAN_1 = 1,
|
||||
} HPADGGGGChan;
|
||||
|
||||
typedef enum HPADButtons
|
||||
{
|
||||
HPAD_BUTTON_A = 0x0001,
|
||||
HPAD_BUTTON_B = 0x0002,
|
||||
HPAD_BUTTON_X = 0x0004,
|
||||
HPAD_BUTTON_Y = 0x0008,
|
||||
HPAD_BUTTON_LEFT = 0x0010,
|
||||
HPAD_BUTTON_RIGHT = 0x0020,
|
||||
HPAD_BUTTON_DOWN = 0x0040,
|
||||
HPAD_BUTTON_UP = 0x0080,
|
||||
HPAD_BUTTON_START = 0x0100,
|
||||
HPAD_TRIGGER_Z = 0x0200,
|
||||
HPAD_TRIGGER_R = 0x0400,
|
||||
HPAD_TRIGGER_L = 0x0800,
|
||||
|
||||
HPAD_STICK_EMULATION_LEFT = 0x00001000,
|
||||
HPAD_STICK_EMULATION_RIGHT = 0x00002000,
|
||||
HPAD_STICK_EMULATION_DOWN = 0x00004000,
|
||||
HPAD_STICK_EMULATION_UP = 0x00008000,
|
||||
HPAD_SUBSTICK_EMULATION_LEFT = 0x00010000,
|
||||
HPAD_SUBSTICK_EMULATION_RIGHT = 0x00020000,
|
||||
HPAD_SUBSTICK_EMULATION_DOWN = 0x00040000,
|
||||
HPAD_SUBSTICK_EMULATION_UP = 0x00080000,
|
||||
} HPADButtons;
|
||||
|
||||
typedef enum HPADMotorCommand
|
||||
{
|
||||
HPAD_MOTOR_COMMAND_STOP = 0,
|
||||
HPAD_MOTOR_COMMAND_RUMBLE = 1,
|
||||
HPAD_MOTOR_COMMAND_STOP_HARD = 2,
|
||||
} HPADMotorCommand;
|
||||
|
||||
struct HPADStatus
|
||||
{
|
||||
//! Indicates what HPADButtons are held down.
|
||||
int32_t hold;
|
||||
//! Indicates what HPADButtons have been pressed since last sample.
|
||||
int32_t trigger;
|
||||
//! Indicates what HPADButtons have been released since last sample.
|
||||
int32_t release;
|
||||
//! X-Position of the analog stick
|
||||
int8_t stickX;
|
||||
//! Y-Position of the analog stick
|
||||
int8_t stickY;
|
||||
//! X-Position of the analog substick/C-Stick
|
||||
int8_t substickX;
|
||||
//! Y-Position of the analog substick/C-Stick
|
||||
int8_t substickY;
|
||||
//! Position of the left analog trigger
|
||||
uint8_t triggerL;
|
||||
//! Position of the right analog trigger
|
||||
uint8_t triggerR;
|
||||
//! Status of the controller
|
||||
uint8_t status;
|
||||
WUT_PADDING_BYTES(0x1);
|
||||
//! Read error, 0 for success
|
||||
int32_t error;
|
||||
};
|
||||
WUT_CHECK_OFFSET(HPADStatus, 0x00, hold);
|
||||
WUT_CHECK_OFFSET(HPADStatus, 0x04, trigger);
|
||||
WUT_CHECK_OFFSET(HPADStatus, 0x08, release);
|
||||
WUT_CHECK_OFFSET(HPADStatus, 0x0C, stickX);
|
||||
WUT_CHECK_OFFSET(HPADStatus, 0x0D, stickY);
|
||||
WUT_CHECK_OFFSET(HPADStatus, 0x0E, substickX);
|
||||
WUT_CHECK_OFFSET(HPADStatus, 0x0F, substickY);
|
||||
WUT_CHECK_OFFSET(HPADStatus, 0x10, triggerL);
|
||||
WUT_CHECK_OFFSET(HPADStatus, 0x11, triggerR);
|
||||
WUT_CHECK_OFFSET(HPADStatus, 0x12, status);
|
||||
WUT_CHECK_OFFSET(HPADStatus, 0x14, error);
|
||||
WUT_CHECK_SIZE(HPADStatus, 0x18);
|
||||
|
||||
struct HPADGGGGStatus
|
||||
{
|
||||
//! \c TRUE if the adapeter is connected
|
||||
BOOL connected;
|
||||
//! \c TRUE if the power supply is connected
|
||||
BOOL powerSupplyConnected;
|
||||
//! \c TRUE if the adapter is active/is sending samples
|
||||
BOOL active;
|
||||
};
|
||||
WUT_CHECK_OFFSET(HPADGGGGStatus, 0x0, connected);
|
||||
WUT_CHECK_OFFSET(HPADGGGGStatus, 0x4, powerSupplyConnected);
|
||||
WUT_CHECK_OFFSET(HPADGGGGStatus, 0x8, active);
|
||||
WUT_CHECK_SIZE(HPADGGGGStatus, 0xC);
|
||||
|
||||
typedef void (*HPADConnectCallback)(HPADChan chan, int32_t status);
|
||||
typedef void (*HPADGGGGConnectCallback)(HPADGGGGChan chan, BOOL connected);
|
||||
typedef void (*HPADPowerSupplyCallback)(HPADGGGGChan chan, BOOL connected);
|
||||
typedef void (*HPADSamplingCallback)(HPADGGGGChan chan);
|
||||
typedef void (*HPADResetCallback)(HPADGGGGChan chan, int32_t status);
|
||||
|
||||
/**
|
||||
* Initializes the HPAD library.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
HPADInit(void);
|
||||
|
||||
/**
|
||||
* Shuts down the HPAD library.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
HPADShutdown(void);
|
||||
|
||||
/**
|
||||
* Reads status buffers from a specified HPAD channel.
|
||||
*
|
||||
* \warning
|
||||
* The count parameter is ignored and this function will always fill up to 16 sampling buffers.
|
||||
* Make sure to always make space for 16 buffers.
|
||||
*
|
||||
* \param chan
|
||||
* The channel to read from.
|
||||
*
|
||||
* \param buffers
|
||||
* Pointer to an array of HPADStatus buffers to fill.
|
||||
*
|
||||
* \param count
|
||||
* Number of buffers to fill.
|
||||
*
|
||||
* \return
|
||||
* The amount of buffers read or a negative value on error.
|
||||
*/
|
||||
// clang-format off
|
||||
int32_t
|
||||
RPLWRAP(HPADRead)(HPADChan chan,
|
||||
HPADStatus *buffers,
|
||||
int32_t count);
|
||||
// clang-format on
|
||||
|
||||
/**
|
||||
* Reads status buffers from a specified HPAD channel.
|
||||
*
|
||||
* \param chan
|
||||
* The channel to read from.
|
||||
*
|
||||
* \param buffers
|
||||
* Pointer to an array of HPADStatus buffers to fill.
|
||||
*
|
||||
* \param count
|
||||
* Number of buffers to fill. Must be 16.
|
||||
*
|
||||
* \return
|
||||
* The amount of buffers read or a negative value on error.
|
||||
*/
|
||||
static inline int32_t
|
||||
HPADRead(HPADChan chan,
|
||||
HPADStatus *buffers,
|
||||
int32_t count)
|
||||
{
|
||||
// HPADRead ignores the count and will always fill up to 16 sampling buffers
|
||||
if (count != 16) {
|
||||
return -6;
|
||||
}
|
||||
|
||||
return RPLWRAP(HPADRead)(chan, buffers, count);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a motor/rumble command to the specified HPAD channel.
|
||||
*
|
||||
* \param chan
|
||||
* The channel to send the command to.
|
||||
*
|
||||
* \param command
|
||||
* The motor command to send.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
HPADControlMotor(HPADChan chan,
|
||||
HPADMotorCommand command);
|
||||
|
||||
/**
|
||||
* Invalidates calibration data of the specified HPAD channel.
|
||||
*
|
||||
* \param chan
|
||||
* The channel to invalidate data.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
HPADRecalibrate(HPADChan chan);
|
||||
|
||||
/**
|
||||
* Sets a callback for once the specified HPAD channel is connected.
|
||||
*
|
||||
* \param chan
|
||||
* The channel to set the callback.
|
||||
*
|
||||
* \param callback
|
||||
* A pointer to the callback function.
|
||||
*
|
||||
* \return
|
||||
* A pointer to the previous callback or \c NULL.
|
||||
*/
|
||||
HPADConnectCallback
|
||||
HPADSetConnectCallback(HPADChan chan,
|
||||
HPADConnectCallback callback);
|
||||
|
||||
/**
|
||||
* Get the status of the specified GGGG channel (GC Adapter).
|
||||
*
|
||||
* \param chan
|
||||
* The channel to get the status from.
|
||||
*
|
||||
* \param status
|
||||
* A pointer to write the status to.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
HPADGetGGGGStatus(HPADGGGGChan chan,
|
||||
HPADGGGGStatus *status);
|
||||
|
||||
/**
|
||||
* Sets a callback for once the specified GGGG Adapter is connected.
|
||||
*
|
||||
* \param chan
|
||||
* The channel to set the callback.
|
||||
*
|
||||
* \param callback
|
||||
* A pointer to the callback function.
|
||||
*
|
||||
* \return
|
||||
* A pointer to the previous callback or \c NULL.
|
||||
*/
|
||||
HPADGGGGConnectCallback
|
||||
HPADSetGgggConnectCallback(HPADGGGGChan chan,
|
||||
HPADGGGGConnectCallback callback);
|
||||
|
||||
/**
|
||||
* Sets a callback for once the power supply of the specified GGGG Adapter is connected.
|
||||
*
|
||||
* \param chan
|
||||
* The channel to set the callback.
|
||||
*
|
||||
* \param callback
|
||||
* A pointer to the callback function.
|
||||
*
|
||||
* \return
|
||||
* A pointer to the previous callback or \c NULL.
|
||||
*/
|
||||
HPADPowerSupplyCallback
|
||||
HPADSetPowerSupplyCallback(HPADGGGGChan chan,
|
||||
HPADPowerSupplyCallback callback);
|
||||
|
||||
/**
|
||||
* Sets a callback for once a sample is received from the specified GGGG Adapter.
|
||||
*
|
||||
* \param chan
|
||||
* The channel to set the callback.
|
||||
*
|
||||
* \param callback
|
||||
* A pointer to the callback function.
|
||||
*
|
||||
* \return
|
||||
* A pointer to the previous callback or \c NULL.
|
||||
*/
|
||||
HPADSamplingCallback
|
||||
HPADSetSamplingCallback(HPADGGGGChan chan,
|
||||
HPADSamplingCallback callback);
|
||||
|
||||
/**
|
||||
* Resets the specified GGGG Adapter.
|
||||
*
|
||||
* \param chan
|
||||
* The channel to reset.
|
||||
*
|
||||
* \param callback
|
||||
* A pointer to a callback function after resetting is complete.
|
||||
*
|
||||
* \return
|
||||
* 0 on success.
|
||||
*/
|
||||
int32_t
|
||||
HPADResetDevice(HPADGGGGChan chan,
|
||||
HPADResetCallback callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
8
include/nn/idb.h
Normal file
8
include/nn/idb.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
/**
|
||||
* \defgroup nn_idb nn_idb
|
||||
*/
|
||||
|
||||
#include <nn/idb/IDBReader.h>
|
||||
#include <nn/idb/idb_cpp.h>
|
||||
8
include/nn/nets2.h
Normal file
8
include/nn/nets2.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
/**
|
||||
* \defgroup nn_nets2 nn_nets2
|
||||
* Network functions 2.
|
||||
*/
|
||||
|
||||
#include <nn/nets2/somemopt.h>
|
||||
70
include/nn/nets2/somemopt.h
Normal file
70
include/nn/nets2/somemopt.h
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_nets2_somemopt
|
||||
* \ingroup nn_nets2
|
||||
* User provided socket memory options.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum SOMemOptRequest
|
||||
{
|
||||
//! Initialize buffer managment from user-provided buffer.
|
||||
//! This is a blocking request, which only returns once nsysnet is shut down/the application quits.
|
||||
SOMEMOPT_REQUEST_INIT = 1,
|
||||
//! Return the amount of bytes used for buffer management.
|
||||
SOMEMOPT_REQUEST_GET_BYTES_USED = 2,
|
||||
//! Wait for buffer management initialization to be done.
|
||||
SOMEMOPT_REQUEST_WAIT_FOR_INIT = 3,
|
||||
//! Cancel pending wait for init.
|
||||
SOMEMOPT_REQUEST_CANCEL_WAIT = 4,
|
||||
} SOMemOptRequest;
|
||||
|
||||
typedef enum SOMemOptFlags
|
||||
{
|
||||
SOMEMOPT_FLAGS_NONE = 0,
|
||||
//! Changes the distribution between small and big buffers to 50-50 instead of 80-20.
|
||||
SOMEMOPT_FLAGS_BIG_BUFFERS = 1 << 0,
|
||||
} SOMemOptFlags;
|
||||
|
||||
/**
|
||||
* Perform a somemopt request.
|
||||
*
|
||||
* \param request
|
||||
* The request to perform.
|
||||
*
|
||||
* \param buffer
|
||||
* A 0x40 aligned buffer for \link SOMEMOPT_REQUEST_INIT \endlink.
|
||||
*
|
||||
* \param size
|
||||
* The size of the buffer for \link SOMEMOPT_REQUEST_INIT \endlink.
|
||||
* Minimum size is \c 0x20000 bytes, maximum size is \c 0x300000.
|
||||
*
|
||||
* \param flags
|
||||
* A combination of flags.
|
||||
*
|
||||
* \return
|
||||
* -1 on error.
|
||||
*/
|
||||
int
|
||||
somemopt(SOMemOptRequest request,
|
||||
void *buffer,
|
||||
uint32_t size,
|
||||
SOMemOptFlags flags);
|
||||
|
||||
// clang-format off
|
||||
int
|
||||
RPLWRAP(somemopt)(SOMemOptRequest request,
|
||||
void *buffer,
|
||||
uint32_t size,
|
||||
SOMemOptFlags flags);
|
||||
// clang-format on
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
@ -5,5 +5,5 @@
|
|||
* Nintendo Figurine (amiibo) Platform library.
|
||||
*/
|
||||
|
||||
#include <nn/nfp/nfp_cpp.h>
|
||||
#include <nn/nfp/amiibo_settings_cpp.h>
|
||||
#include <nn/nfp/nfp_cpp.h>
|
||||
|
|
|
|||
|
|
@ -12,9 +12,11 @@
|
|||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace nn {
|
||||
namespace nn
|
||||
{
|
||||
|
||||
namespace nfp {
|
||||
namespace nfp
|
||||
{
|
||||
|
||||
enum class AmiiboSettingsMode : uint32_t
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <nn/result.h>
|
||||
#include <nn/ffl/miidata.h>
|
||||
#include <coreinit/event.h>
|
||||
#include <nfc/nfc.h>
|
||||
#include <nn/ffl/miidata.h>
|
||||
#include <nn/result.h>
|
||||
|
||||
/**
|
||||
* \defgroup nn_nfp
|
||||
|
|
@ -13,9 +14,11 @@
|
|||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace nn {
|
||||
namespace nn
|
||||
{
|
||||
|
||||
namespace nfp {
|
||||
namespace nfp
|
||||
{
|
||||
|
||||
//! NN_NFP result descriptions for \link nn::Result::GetDescription \endlink.
|
||||
enum ResultDescription
|
||||
|
|
@ -71,6 +74,16 @@ enum class AdminFlags : uint8_t
|
|||
};
|
||||
WUT_CHECK_SIZE(AdminFlags, 0x1);
|
||||
|
||||
enum class TagType : uint8_t
|
||||
{
|
||||
Unknown = 0,
|
||||
Type1Tag = 1 << 0,
|
||||
Type2Tag = 1 << 1,
|
||||
Type3Tag = 1 << 2,
|
||||
Iso15693 = 1 << 5,
|
||||
};
|
||||
WUT_CHECK_SIZE(TagType, 0x1);
|
||||
|
||||
struct Date
|
||||
{
|
||||
//! Year (Starting at 0)
|
||||
|
|
@ -119,16 +132,16 @@ struct TagInfo
|
|||
TagId id;
|
||||
//! reserved bytes
|
||||
uint8_t reserved0[0x15];
|
||||
//! Tag protocol (always 0x00)
|
||||
uint8_t protocol;
|
||||
//! Tag type (always 0x02)
|
||||
uint8_t tag_type;
|
||||
//! Technology (always \link NFC_TECHNOLOGY_A \endlink)
|
||||
NFCTechnology technology;
|
||||
//! Tag type (always \link TagType::Type2Tag \endlink)
|
||||
TagType tag_type;
|
||||
//! reserved bytes
|
||||
uint8_t reserved1[0x32];
|
||||
};
|
||||
WUT_CHECK_OFFSET(TagInfo, 0x0, id);
|
||||
WUT_CHECK_OFFSET(TagInfo, 0xB, reserved0);
|
||||
WUT_CHECK_OFFSET(TagInfo, 0x20, protocol);
|
||||
WUT_CHECK_OFFSET(TagInfo, 0x20, technology);
|
||||
WUT_CHECK_OFFSET(TagInfo, 0x21, tag_type);
|
||||
WUT_CHECK_OFFSET(TagInfo, 0x22, reserved1);
|
||||
WUT_CHECK_SIZE(TagInfo, 0x54);
|
||||
|
|
@ -171,8 +184,8 @@ struct WUT_PACKED RegisterInfo
|
|||
FFLStoreData mii;
|
||||
//! The name of this amiibo
|
||||
uint16_t name[11];
|
||||
//! Flags (see \link RegisterInfoSet \endlink)
|
||||
uint8_t flags;
|
||||
//! Font region
|
||||
uint8_t fontRegion;
|
||||
//! Country code
|
||||
uint8_t country;
|
||||
//! The date when the amiibo was registered
|
||||
|
|
@ -182,7 +195,7 @@ struct WUT_PACKED RegisterInfo
|
|||
};
|
||||
WUT_CHECK_OFFSET(RegisterInfo, 0x0, mii);
|
||||
WUT_CHECK_OFFSET(RegisterInfo, 0x60, name);
|
||||
WUT_CHECK_OFFSET(RegisterInfo, 0x76, flags);
|
||||
WUT_CHECK_OFFSET(RegisterInfo, 0x76, fontRegion);
|
||||
WUT_CHECK_OFFSET(RegisterInfo, 0x77, country);
|
||||
WUT_CHECK_OFFSET(RegisterInfo, 0x78, registerDate);
|
||||
WUT_CHECK_OFFSET(RegisterInfo, 0x7C, reserved);
|
||||
|
|
@ -219,14 +232,14 @@ struct WUT_PACKED RegisterInfoSet
|
|||
FFLStoreData mii;
|
||||
//! The name of this amiibo
|
||||
uint16_t name[11];
|
||||
//! Flags (can be retrieved from \link RegisterInfo \endlink)
|
||||
uint8_t flags;
|
||||
//! Font region
|
||||
uint8_t fontRegion;
|
||||
//! reserved bytes, must be 0
|
||||
uint8_t reserved[0x2d];
|
||||
};
|
||||
WUT_CHECK_OFFSET(RegisterInfoSet, 0x0, mii);
|
||||
WUT_CHECK_OFFSET(RegisterInfoSet, 0x60, name);
|
||||
WUT_CHECK_OFFSET(RegisterInfoSet, 0x76, flags);
|
||||
WUT_CHECK_OFFSET(RegisterInfoSet, 0x76, fontRegion);
|
||||
WUT_CHECK_OFFSET(RegisterInfoSet, 0x77, reserved);
|
||||
WUT_CHECK_SIZE(RegisterInfoSet, 0xA4);
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,11 @@
|
|||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace nn {
|
||||
namespace nn
|
||||
{
|
||||
|
||||
namespace pdm {
|
||||
namespace pdm
|
||||
{
|
||||
|
||||
//! Flags for PlayDiary
|
||||
typedef enum PlayDiaryFlags : uint16_t
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@ struct NNResult
|
|||
* \sa
|
||||
* - \link NNResult_IsFailure \endlink
|
||||
*/
|
||||
static inline int NNResult_IsSuccess(NNResult result)
|
||||
static inline int
|
||||
NNResult_IsSuccess(NNResult result)
|
||||
{
|
||||
return result.value >= 0;
|
||||
}
|
||||
|
|
@ -51,7 +52,8 @@ static inline int NNResult_IsSuccess(NNResult result)
|
|||
* \sa
|
||||
* - \link NNResult_IsSuccess \endlink
|
||||
*/
|
||||
static inline int NNResult_IsFailure(NNResult result)
|
||||
static inline int
|
||||
NNResult_IsFailure(NNResult result)
|
||||
{
|
||||
return result.value < 0;
|
||||
}
|
||||
|
|
@ -228,6 +230,11 @@ public:
|
|||
};
|
||||
|
||||
public:
|
||||
Result() :
|
||||
mValue(0)
|
||||
{
|
||||
}
|
||||
|
||||
Result(Level level, Module module, unsigned description) :
|
||||
mValue(((level & 0x7) << 29) | ((module & 0x1FF) << 20) | (description & 0xFFFFF))
|
||||
{
|
||||
|
|
@ -247,7 +254,8 @@ public:
|
|||
* \sa
|
||||
* - \link IsSuccess \endlink
|
||||
*/
|
||||
bool IsFailure() const
|
||||
bool
|
||||
IsFailure() const
|
||||
{
|
||||
return !IsSuccess();
|
||||
}
|
||||
|
|
@ -261,22 +269,26 @@ public:
|
|||
* \sa
|
||||
* - \link IsFailure \endlink
|
||||
*/
|
||||
bool IsSuccess() const
|
||||
bool
|
||||
IsSuccess() const
|
||||
{
|
||||
return mValue >= 0; // level >= 0
|
||||
}
|
||||
|
||||
bool IsLegacy() const
|
||||
bool
|
||||
IsLegacy() const
|
||||
{
|
||||
return ((mValue >> 27) & 0x3) == SIGNATURE_IS_LEGACY;
|
||||
}
|
||||
|
||||
unsigned GetDescription() const
|
||||
unsigned
|
||||
GetDescription() const
|
||||
{
|
||||
return mValue & (IsLegacy() ? 0x3FF : 0xFFFFF);
|
||||
}
|
||||
|
||||
int GetLevel() const
|
||||
int
|
||||
GetLevel() const
|
||||
{
|
||||
if (IsLegacy()) {
|
||||
return (mValue << 14) >> 28; // cause arithmetic shift
|
||||
|
|
@ -285,12 +297,14 @@ public:
|
|||
return mValue >> 29;
|
||||
}
|
||||
|
||||
unsigned GetModule() const
|
||||
unsigned
|
||||
GetModule() const
|
||||
{
|
||||
return (mValue >> 20) & (IsLegacy() ? 0x7F : 0x1FF);
|
||||
}
|
||||
|
||||
unsigned GetSummary() const
|
||||
unsigned
|
||||
GetSummary() const
|
||||
{
|
||||
if (IsLegacy()) {
|
||||
return (mValue >> 10) & 0xF;
|
||||
|
|
@ -311,12 +325,14 @@ public:
|
|||
return result;
|
||||
}
|
||||
|
||||
bool operator==(const Result &other) const
|
||||
bool
|
||||
operator==(const Result &other) const
|
||||
{
|
||||
return mValue == other.mValue;
|
||||
}
|
||||
|
||||
bool operator!=(const Result &other) const
|
||||
bool
|
||||
operator!=(const Result &other) const
|
||||
{
|
||||
return mValue != other.mValue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include <nn/acp/device.h>
|
||||
#include <coreinit/filesystem.h>
|
||||
#include <nn/acp/device.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,32 @@
|
|||
* \defgroup nn_sl nn_sl
|
||||
*/
|
||||
|
||||
#include <nn/sl/sl_cpp.h>
|
||||
#include <nn/sl/LaunchInfoDatabase.h>
|
||||
#include <nn/sl/CacheManager.h>
|
||||
#include <nn/sl/Condition.h>
|
||||
#include <nn/sl/DataCreator.h>
|
||||
#include <nn/sl/DrcManager.h>
|
||||
#include <nn/sl/FileStream.h>
|
||||
#include <nn/sl/IAccountInfoAccessor.h>
|
||||
#include <nn/sl/IBlackListAccessor.h>
|
||||
#include <nn/sl/IDefaultTitleAccessor.h>
|
||||
#include <nn/sl/IKillerNotificationAccessor.h>
|
||||
#include <nn/sl/ILaunchedTitleListAccessor.h>
|
||||
#include <nn/sl/IPreferentialTitleAccessor.h>
|
||||
#include <nn/sl/ISerializer.h>
|
||||
#include <nn/sl/ISettingAccessor.h>
|
||||
#include <nn/sl/IStream.h>
|
||||
#include <nn/sl/ITimeAccessor.h>
|
||||
#include <nn/sl/ITitleIconCache.h>
|
||||
#include <nn/sl/ITitleListAccessor.h>
|
||||
#include <nn/sl/ITransferrer.h>
|
||||
#include <nn/sl/IUpdatePackageAccessor.h>
|
||||
#include <nn/sl/IWhiteListAccessor.h>
|
||||
#include <nn/sl/KillerNotification.h>
|
||||
#include <nn/sl/KillerNotificationSelector.h>
|
||||
#include <nn/sl/KillerNotificationTransferRecordManager.h>
|
||||
#include <nn/sl/KillerNotificationTransferRecordStream.h>
|
||||
#include <nn/sl/LaunchInfoDatabase.h>
|
||||
#include <nn/sl/QuickStartApplicationSelector.h>
|
||||
#include <nn/sl/TitleIconCache.h>
|
||||
#include <nn/sl/TitleListCache.h>
|
||||
#include <nn/sl/sl_cpp.h>
|
||||
|
|
|
|||
123
include/nn/sl/CacheManager.h
Normal file
123
include/nn/sl/CacheManager.h
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include <nn/result.h>
|
||||
#include <nn/sl/ISerializer.h>
|
||||
#include <nn/sl/KillerNotification.h>
|
||||
#include <nn/sl/sl_cpp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace nn::sl
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
typedef struct WUT_PACKED CacheManagerInternal
|
||||
{
|
||||
ISerializerInternal *quickStartTitleInfoSerializer;
|
||||
ISerializerInternal *killerNotificationSerializer;
|
||||
ISerializerInternal *jumpTitleInfoSerializer;
|
||||
} CacheManagerInternal;
|
||||
WUT_CHECK_SIZE(CacheManagerInternal, 0x0c);
|
||||
WUT_CHECK_OFFSET(CacheManagerInternal, 0x00, quickStartTitleInfoSerializer);
|
||||
WUT_CHECK_OFFSET(CacheManagerInternal, 0x04, killerNotificationSerializer);
|
||||
WUT_CHECK_OFFSET(CacheManagerInternal, 0x08, jumpTitleInfoSerializer);
|
||||
|
||||
extern "C" CacheManagerInternal *
|
||||
__ct__Q3_2nn2sl12CacheManagerFv(CacheManagerInternal *);
|
||||
extern "C" void
|
||||
SetupInitialCache__Q3_2nn2sl12CacheManagerFv(CacheManagerInternal *);
|
||||
extern "C" nn::Result
|
||||
GetKillerNotificationCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl18KillerNotificationPQ3_2nn2sl9TitleInfo(CacheManagerInternal *, KillerNotification *, TitleInfo *);
|
||||
extern "C" nn::Result
|
||||
GetQuickStartCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoi(CacheManagerInternal *, TitleInfo *, int);
|
||||
extern "C" nn::Result
|
||||
Get__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoiPQ3_2nn2sl18KillerNotificationT1(CacheManagerInternal *, TitleInfo *, int, KillerNotification *, TitleInfo *);
|
||||
extern "C" nn::Result
|
||||
Initialize__Q3_2nn2sl12CacheManagerFRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfoRQ3_2nn2sl49ISerializer__tm__30_Q3_2nn2sl18KillerNotificationT1(
|
||||
CacheManagerInternal *,
|
||||
ISerializerInternal *,
|
||||
ISerializerInternal *,
|
||||
ISerializerInternal *);
|
||||
} // namespace details
|
||||
|
||||
class CacheManager
|
||||
{
|
||||
public:
|
||||
CacheManager() :
|
||||
mQuickStartTitleInfoSerializer(nullptr),
|
||||
mKillerNotificationSerializer(nullptr),
|
||||
mJumpTitleInfoSerializer(nullptr)
|
||||
{
|
||||
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()
|
||||
{
|
||||
return mQuickStartTitleInfoSerializer;
|
||||
}
|
||||
|
||||
[[nodiscard]] details::ISerializerBase<KillerNotification> &
|
||||
GetKillerNotificationSerializer()
|
||||
{
|
||||
return mKillerNotificationSerializer;
|
||||
}
|
||||
|
||||
[[nodiscard]] details::ISerializerBase<TitleInfo> &
|
||||
GetJumpTitleInfoSerializer()
|
||||
{
|
||||
return mJumpTitleInfoSerializer;
|
||||
}
|
||||
|
||||
void
|
||||
SetupInitialCache()
|
||||
{
|
||||
SetupInitialCache__Q3_2nn2sl12CacheManagerFv(&mInstance);
|
||||
}
|
||||
|
||||
nn::Result
|
||||
GetKillerNotificationCache(KillerNotification *u1, TitleInfo *u2)
|
||||
{
|
||||
return GetKillerNotificationCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl18KillerNotificationPQ3_2nn2sl9TitleInfo(&mInstance, u1, u2);
|
||||
}
|
||||
|
||||
nn::Result
|
||||
GetQuickStartCache(TitleInfo *u1, int u2)
|
||||
{
|
||||
return GetQuickStartCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoi(&mInstance, u1, u2);
|
||||
}
|
||||
|
||||
nn::Result
|
||||
Get(TitleInfo *u1, int u2, KillerNotification *u3, TitleInfo *u4)
|
||||
{
|
||||
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)
|
||||
{
|
||||
Initialize__Q3_2nn2sl12CacheManagerFRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfoRQ3_2nn2sl49ISerializer__tm__30_Q3_2nn2sl18KillerNotificationT1(&mInstance,
|
||||
quickStartTitleInfoSerializer.GetInternal(),
|
||||
killerNotificationSerializer.GetInternal(),
|
||||
jumpTitleInfoSerializer.GetInternal());
|
||||
mQuickStartTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(quickStartTitleInfoSerializer.GetInternal());
|
||||
mKillerNotificationSerializer = details::SerializerFromPtr<KillerNotification>(killerNotificationSerializer.GetInternal());
|
||||
mJumpTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(jumpTitleInfoSerializer.GetInternal());
|
||||
}
|
||||
|
||||
~CacheManager() = default;
|
||||
|
||||
private:
|
||||
details::CacheManagerInternal mInstance{};
|
||||
details::SerializerFromPtr<TitleInfo> mQuickStartTitleInfoSerializer;
|
||||
details::SerializerFromPtr<KillerNotification> mKillerNotificationSerializer;
|
||||
details::SerializerFromPtr<TitleInfo> mJumpTitleInfoSerializer;
|
||||
};
|
||||
} // namespace nn::sl
|
||||
|
||||
#endif
|
||||
145
include/nn/sl/Condition.h
Normal file
145
include/nn/sl/Condition.h
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include <coreinit/time.h>
|
||||
#include <nn/result.h>
|
||||
#include <nn/sl/ISettingAccessor.h>
|
||||
#include <nn/sl/ITimeAccessor.h>
|
||||
#include <nn/sl/IUpdatePackageAccessor.h>
|
||||
#include <nn/sl/details/ISerializerDetails.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace nn::sl
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
typedef struct WUT_PACKED ConditionInternal
|
||||
{
|
||||
ISettingAccessorInternal *settingAccessor;
|
||||
IUpdatePackageAccessorInternal *updatePackageAccessor;
|
||||
ISerializerInternal *previousSendingTimeSerializer;
|
||||
ITimeAccessorInternal *timeAccessor;
|
||||
void *vtable;
|
||||
} ConditionInternal;
|
||||
WUT_CHECK_SIZE(ConditionInternal, 0x14);
|
||||
WUT_CHECK_OFFSET(ConditionInternal, 0x00, settingAccessor);
|
||||
WUT_CHECK_OFFSET(ConditionInternal, 0x04, updatePackageAccessor);
|
||||
WUT_CHECK_OFFSET(ConditionInternal, 0x08, previousSendingTimeSerializer);
|
||||
WUT_CHECK_OFFSET(ConditionInternal, 0x0C, timeAccessor);
|
||||
WUT_CHECK_OFFSET(ConditionInternal, 0x10, vtable);
|
||||
|
||||
extern "C" ConditionInternal *
|
||||
__ct__Q3_2nn2sl9ConditionFv(ConditionInternal *);
|
||||
extern "C" nn::Result
|
||||
GetEnability__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
|
||||
extern "C" nn::Result
|
||||
StoreCurrentTimeAsPreviousSendingTime__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
|
||||
extern "C" nn::Result
|
||||
NeedsUpdate__Q3_2nn2sl9ConditionCFv(ConditionInternal *);
|
||||
extern "C" nn::Result
|
||||
GetPreviousSendingTime__Q3_2nn2sl9ConditionCFPL(ConditionInternal *, int64_t *outTime);
|
||||
extern "C" void
|
||||
Initialize__Q3_2nn2sl9ConditionFRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl22IUpdatePackageAccessorRQ3_2nn2sl20ISerializer__tm__2_LRQ3_2nn2sl13ITimeAccessor(ConditionInternal *,
|
||||
ISettingAccessorInternal *,
|
||||
IUpdatePackageAccessorInternal *,
|
||||
ISerializerInternal *,
|
||||
ITimeAccessorInternal *);
|
||||
} // namespace details
|
||||
|
||||
class Condition
|
||||
{
|
||||
public:
|
||||
Condition() :
|
||||
mSettingAccessor(nullptr),
|
||||
mUpdatePackageAccessor(nullptr),
|
||||
mPreviousSendingTimeSerializer(nullptr),
|
||||
mTimeAccessor(nullptr)
|
||||
{
|
||||
if (__ct__Q3_2nn2sl9ConditionFv(&mInstance) != nullptr) {
|
||||
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingAccessor);
|
||||
mUpdatePackageAccessor = details::UpdatePackageAccessorFromPtr(mInstance.updatePackageAccessor);
|
||||
mPreviousSendingTimeSerializer = details::SerializerFromPtr<OSTime>(mInstance.previousSendingTimeSerializer);
|
||||
mTimeAccessor = details::TimeAccessorFromPtr(mInstance.timeAccessor);
|
||||
}
|
||||
}
|
||||
|
||||
~Condition() = default;
|
||||
|
||||
[[nodiscard]] details::ISettingAccessorBase &
|
||||
GetSettingAccessor()
|
||||
{
|
||||
return mSettingAccessor;
|
||||
}
|
||||
|
||||
[[nodiscard]] details::IUpdatePackageAccessorBase &
|
||||
GetUpdatePackageAccessor()
|
||||
{
|
||||
return mUpdatePackageAccessor;
|
||||
}
|
||||
|
||||
[[nodiscard]] details::ISerializerBase<OSTime> &
|
||||
GetPreviousSendingTimeSerializer()
|
||||
{
|
||||
return mPreviousSendingTimeSerializer;
|
||||
}
|
||||
|
||||
[[nodiscard]] details::ITimeAccessorBase &
|
||||
GetTimeAccessor()
|
||||
{
|
||||
return mTimeAccessor;
|
||||
}
|
||||
|
||||
nn::Result
|
||||
GetEnability()
|
||||
{
|
||||
return GetEnability__Q3_2nn2sl9ConditionCFv(&mInstance);
|
||||
}
|
||||
|
||||
nn::Result
|
||||
NeedsUpdate()
|
||||
{
|
||||
return NeedsUpdate__Q3_2nn2sl9ConditionCFv(&mInstance);
|
||||
}
|
||||
|
||||
nn::Result
|
||||
StoreCurrentTimeAsPreviousSendingTime()
|
||||
{
|
||||
return StoreCurrentTimeAsPreviousSendingTime__Q3_2nn2sl9ConditionCFv(&mInstance);
|
||||
}
|
||||
|
||||
nn::Result
|
||||
GetPreviousSendingTime(int64_t *outTime)
|
||||
{
|
||||
return GetPreviousSendingTime__Q3_2nn2sl9ConditionCFPL(&mInstance, outTime);
|
||||
}
|
||||
|
||||
void
|
||||
Initialize(details::ISettingAccessorBase &settingAccessor,
|
||||
details::IUpdatePackageAccessorBase &updatePackageAccessor,
|
||||
details::ISerializerBase<OSTime> &previousSendingTimeSerializer,
|
||||
details::ITimeAccessorBase &timeAccessor)
|
||||
{
|
||||
Initialize__Q3_2nn2sl9ConditionFRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl22IUpdatePackageAccessorRQ3_2nn2sl20ISerializer__tm__2_LRQ3_2nn2sl13ITimeAccessor(
|
||||
&mInstance,
|
||||
settingAccessor.GetInternal(),
|
||||
updatePackageAccessor.GetInternal(),
|
||||
previousSendingTimeSerializer.GetInternal(),
|
||||
timeAccessor.GetInternal());
|
||||
mSettingAccessor = details::SettingAccessorFromPtr(settingAccessor.GetInternal());
|
||||
mUpdatePackageAccessor = details::UpdatePackageAccessorFromPtr(updatePackageAccessor.GetInternal());
|
||||
mPreviousSendingTimeSerializer = details::SerializerFromPtr<OSTime>(previousSendingTimeSerializer.GetInternal());
|
||||
mTimeAccessor = details::TimeAccessorFromPtr(timeAccessor.GetInternal());
|
||||
}
|
||||
|
||||
private:
|
||||
details::ConditionInternal mInstance = {};
|
||||
details::SettingAccessorFromPtr mSettingAccessor;
|
||||
details::UpdatePackageAccessorFromPtr mUpdatePackageAccessor;
|
||||
details::SerializerFromPtr<OSTime> mPreviousSendingTimeSerializer;
|
||||
details::TimeAccessorFromPtr mTimeAccessor;
|
||||
};
|
||||
|
||||
} // namespace nn::sl
|
||||
|
||||
#endif
|
||||
130
include/nn/sl/DataCreator.h
Normal file
130
include/nn/sl/DataCreator.h
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include <nn/result.h>
|
||||
#include <nn/sl/IIconInfoAccessor.h>
|
||||
#include <nn/sl/ISettingAccessor.h>
|
||||
#include <nn/sl/ITitleIconCache.h>
|
||||
#include <nn/sl/KillerNotification.h>
|
||||
#include <nn/sl/LaunchInfoDatabase.h>
|
||||
#include <nn/sl/details/IAccountInfoAccessorDetails.h>
|
||||
#include <nn/sl/sl_cpp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace nn ::sl
|
||||
{
|
||||
namespace details
|
||||
{
|
||||
typedef struct WUT_PACKED DataCreatorInternal
|
||||
{
|
||||
IIconInfoAccessorInternal *iconInfoAccessor;
|
||||
IAccountInfoAccessorInternal *accountInfoAccessor;
|
||||
ISettingAccessorInternal *settingInfoAccessor;
|
||||
ITitleIconCacheInternal *titleIconCache;
|
||||
void *vtable;
|
||||
} DataCreatorInternal;
|
||||
WUT_CHECK_SIZE(DataCreatorInternal, 0x14);
|
||||
WUT_CHECK_OFFSET(DataCreatorInternal, 0x00, iconInfoAccessor);
|
||||
WUT_CHECK_OFFSET(DataCreatorInternal, 0x04, accountInfoAccessor);
|
||||
WUT_CHECK_OFFSET(DataCreatorInternal, 0x08, settingInfoAccessor);
|
||||
WUT_CHECK_OFFSET(DataCreatorInternal, 0x0c, titleIconCache);
|
||||
WUT_CHECK_OFFSET(DataCreatorInternal, 0x10, vtable);
|
||||
|
||||
extern "C" DataCreatorInternal *
|
||||
__ct__Q3_2nn2sl11DataCreatorFv(DataCreatorInternal *);
|
||||
extern "C" nn::Result
|
||||
Create__Q3_2nn2sl11DataCreatorFPQ3_2nn2sl16TransferableInfoPCQ3_2nn2sl9TitleInfoiRCQ3_2nn2sl18KillerNotificationRCQ3_2nn2sl9TitleInfoRQ3_2nn2sl18LaunchInfoDatabase(
|
||||
DataCreatorInternal *,
|
||||
TransferableInfo *,
|
||||
const TitleInfo *,
|
||||
int,
|
||||
const KillerNotification &,
|
||||
const TitleInfo &,
|
||||
LaunchInfoDatabase &);
|
||||
extern "C" nn::Result
|
||||
Initialize__Q3_2nn2sl11DataCreatorFRQ3_2nn2sl17IIconInfoAccessorRQ3_2nn2sl20IAccountInfoAccessorRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl15ITitleIconCache(
|
||||
DataCreatorInternal *,
|
||||
IIconInfoAccessorInternal *,
|
||||
IAccountInfoAccessorInternal *,
|
||||
ISettingAccessorInternal *,
|
||||
ITitleIconCacheInternal *);
|
||||
} // namespace details
|
||||
|
||||
|
||||
class DataCreator
|
||||
{
|
||||
public:
|
||||
DataCreator() :
|
||||
mIconInfoAccessor(nullptr),
|
||||
mAccountInfoAccessor(nullptr),
|
||||
mSettingAccessor(nullptr),
|
||||
mTitleIconCache(nullptr)
|
||||
{
|
||||
if (__ct__Q3_2nn2sl11DataCreatorFv(&mInstance) != nullptr) {
|
||||
mIconInfoAccessor = details::IconInfoAccessorFromPtr(mInstance.iconInfoAccessor);
|
||||
mAccountInfoAccessor = details::AccountInfoAccessorFromPtr(mInstance.accountInfoAccessor);
|
||||
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingInfoAccessor);
|
||||
mTitleIconCache = details::TitleIconCacheFromPtr(mInstance.titleIconCache);
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] details::IIconInfoAccessorBase &
|
||||
getIconInfoAccessor()
|
||||
{
|
||||
return mIconInfoAccessor;
|
||||
}
|
||||
|
||||
[[nodiscard]] details::IAccountInfoAccessorBase &
|
||||
getAccountInfoAccessor()
|
||||
{
|
||||
return mAccountInfoAccessor;
|
||||
}
|
||||
|
||||
[[nodiscard]] details::ISettingAccessorBase &
|
||||
getSettingAccessor()
|
||||
{
|
||||
return mSettingAccessor;
|
||||
}
|
||||
|
||||
[[nodiscard]] details::ITitleIconCacheBase &
|
||||
getTitleIconCache()
|
||||
{
|
||||
return mTitleIconCache;
|
||||
}
|
||||
|
||||
nn::Result
|
||||
Create(TransferableInfo *outTransferableInfo,
|
||||
const TitleInfo *quickstartTitleInfos,
|
||||
int numQuickstartTitleInfos,
|
||||
const KillerNotification &killerNotification,
|
||||
const TitleInfo &killerNotificationTitleInfo,
|
||||
LaunchInfoDatabase &launchInfoDatabase)
|
||||
{
|
||||
return details::Create__Q3_2nn2sl11DataCreatorFPQ3_2nn2sl16TransferableInfoPCQ3_2nn2sl9TitleInfoiRCQ3_2nn2sl18KillerNotificationRCQ3_2nn2sl9TitleInfoRQ3_2nn2sl18LaunchInfoDatabase(
|
||||
&mInstance, outTransferableInfo, quickstartTitleInfos, numQuickstartTitleInfos, killerNotification, killerNotificationTitleInfo, launchInfoDatabase);
|
||||
}
|
||||
|
||||
void
|
||||
Initialize(details::IIconInfoAccessorBase &iconInfoAccessor, details::IAccountInfoAccessorBase &accountInfoAccessor, details::ISettingAccessorBase &settingAccessor, details::ITitleIconCacheBase &titleIconCache)
|
||||
{
|
||||
details::Initialize__Q3_2nn2sl11DataCreatorFRQ3_2nn2sl17IIconInfoAccessorRQ3_2nn2sl20IAccountInfoAccessorRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl15ITitleIconCache(
|
||||
&mInstance, iconInfoAccessor.GetInternal(), accountInfoAccessor.GetInternal(), settingAccessor.GetInternal(), titleIconCache.GetInternal());
|
||||
mIconInfoAccessor = details::IconInfoAccessorFromPtr(mInstance.iconInfoAccessor);
|
||||
mAccountInfoAccessor = details::AccountInfoAccessorFromPtr(mInstance.accountInfoAccessor);
|
||||
mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingInfoAccessor);
|
||||
mTitleIconCache = details::TitleIconCacheFromPtr(mInstance.titleIconCache);
|
||||
}
|
||||
|
||||
~DataCreator() = default;
|
||||
|
||||
private:
|
||||
details::DataCreatorInternal mInstance = {};
|
||||
details::IconInfoAccessorFromPtr mIconInfoAccessor;
|
||||
details::AccountInfoAccessorFromPtr mAccountInfoAccessor;
|
||||
details::SettingAccessorFromPtr mSettingAccessor;
|
||||
details::TitleIconCacheFromPtr mTitleIconCache;
|
||||
};
|
||||
}; // namespace nn::sl
|
||||
|
||||
#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