mirror of
https://github.com/zeldaret/ss
synced 2026-05-30 08:56:34 -04:00
init
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
__pycache__
|
||||
build
|
||||
build.ninja
|
||||
orig/*/*
|
||||
!orig/*/.gitkeep
|
||||
tools/mwcc_compiler/*
|
||||
!tools/mwcc_compiler/.gitkeep
|
||||
.ninja_deps
|
||||
.ninja_log
|
||||
objdiff.json
|
||||
/tools/objdiff.exe
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"clangd.fallbackFlags": [
|
||||
"-I${workspaceFolder}/include"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
object: orig/SOUE01/main.dol
|
||||
splits: config/SOUE01/splits.txt
|
||||
symbols: config/SOUE01/symbols.txt
|
||||
auto_force_files: false
|
||||
@@ -0,0 +1,8 @@
|
||||
unk_flag_stuff.cpp:
|
||||
.text start:0x800BEF90 end:0x800BF200
|
||||
|
||||
Runtime/__init_cpp_exceptions.cpp:
|
||||
.text start:0x804C71A8 end:0x804C7218
|
||||
.ctors start:0x804DB640 end:0x804DB644 rename:.ctors$10
|
||||
.dtors start:0x804DB9E0 end:0x804DB9E4 rename:.dtors$10
|
||||
.dtors start:0x804DB9E4 end:0x804DB9E8 rename:.dtors$15
|
||||
File diff suppressed because it is too large
Load Diff
+577
@@ -0,0 +1,577 @@
|
||||
#!/usr/bin/env python3
|
||||
LIBS = [
|
||||
{
|
||||
"lib": "SS",
|
||||
"mw_version": "1.7",
|
||||
"cflags": "-proc gekko -Cpp_exceptions off -RTTI off -O4,p -fp hard, -inline noauto, -enum int, -str reuse -I- -i include",
|
||||
"host": False,
|
||||
"objects": [
|
||||
["Runtime/__init_cpp_exceptions.cpp", False],
|
||||
["unk_flag_stuff.cpp", True]
|
||||
],
|
||||
},
|
||||
]
|
||||
VERSIONS = [
|
||||
"SOUE01", # 0
|
||||
]
|
||||
|
||||
import os
|
||||
import io
|
||||
import sys
|
||||
import argparse
|
||||
import json
|
||||
|
||||
from pathlib import Path
|
||||
from shutil import which
|
||||
import typing
|
||||
from tools import ninja_syntax
|
||||
|
||||
|
||||
def path(
|
||||
input: typing.Union[typing.List[Path], Path, None]
|
||||
) -> typing.Optional[typing.List[str]]:
|
||||
if input is None:
|
||||
return None
|
||||
elif isinstance(input, list):
|
||||
return list(map(str, input))
|
||||
else:
|
||||
return [str(input)]
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
versions_str = ", ".join(VERSIONS)
|
||||
parser.add_argument(
|
||||
"--version",
|
||||
dest="version",
|
||||
default="SOUE01",
|
||||
help=f"version to build ({versions_str})",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--build-dir",
|
||||
dest="build_dir",
|
||||
type=Path,
|
||||
default=Path("build"),
|
||||
help="base build directory (default: build)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--build-dtk",
|
||||
dest="build_dtk",
|
||||
type=Path,
|
||||
help="path to decomp-toolkit source",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--compilers",
|
||||
dest="compilers",
|
||||
type=Path,
|
||||
default=Path("tools/mwcc_compiler"),
|
||||
help="path to compilers (default: tools/mwcc_compiler)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--orig",
|
||||
dest="orig",
|
||||
type=Path,
|
||||
default=Path("orig"),
|
||||
help="path to retail files (default: orig)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--map",
|
||||
dest="map",
|
||||
action="store_true",
|
||||
help="generate map file",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--debug",
|
||||
dest="debug",
|
||||
action="store_true",
|
||||
help="build with debug info (non-matching)",
|
||||
)
|
||||
if os.name != "nt" and not "_NT-" in os.uname().sysname:
|
||||
parser.add_argument(
|
||||
"--wine",
|
||||
dest="wine",
|
||||
type=Path,
|
||||
help="path to wine (or wibo)",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
# On Windows, we need this to use && in commands
|
||||
chain = "cmd /c " if os.name == "nt" else ""
|
||||
|
||||
out = io.StringIO()
|
||||
n = ninja_syntax.Writer(out)
|
||||
|
||||
n.variable("ninja_required_version", "1.3")
|
||||
n.newline()
|
||||
|
||||
n.comment("The arguments passed to configure.py, for rerunning it.")
|
||||
n.variable("configure_args", sys.argv[1:])
|
||||
n.variable("python", f'"{sys.executable}"')
|
||||
n.newline()
|
||||
|
||||
###
|
||||
# Variables
|
||||
###
|
||||
n.comment("Variables")
|
||||
version = args.version
|
||||
version_num = VERSIONS.index(args.version)
|
||||
build_path = args.build_dir / version
|
||||
config_path = Path("config") / version / "config.yml"
|
||||
|
||||
cflags_base = f"-proc gekko -nodefaults -Cpp_exceptions off -RTTI off -fp hard -fp_contract on -O4,p -maxerrors 1 -enum int -inline auto -str reuse -nosyspath -DVERSION={version_num} -i include"
|
||||
if args.debug:
|
||||
cflags_base += " -sym on -D_DEBUG"
|
||||
else:
|
||||
cflags_base += " -DNDEBUG"
|
||||
n.variable("cflags_base", cflags_base)
|
||||
n.variable(
|
||||
"cflags_retro",
|
||||
"$cflags_base -use_lmw_stmw on -str reuse,pool,readonly -gccinc -inline deferred,noauto -common on",
|
||||
)
|
||||
n.variable(
|
||||
"cflags_runtime",
|
||||
"$cflags_base -use_lmw_stmw on -str reuse,pool,readonly -gccinc -inline deferred,auto",
|
||||
)
|
||||
n.variable("cflags_musyx", "$cflags_base -str reuse,pool,readonly -fp_contract off")
|
||||
ldscript_path = build_path / "ldscript.lcf"
|
||||
ldflags = f"-fp hard -nodefaults -lcf {ldscript_path}"
|
||||
map_path = build_path / f"main.MAP"
|
||||
if args.map:
|
||||
ldflags += f" -map {map_path} -mapunused -listclosure"
|
||||
if args.debug:
|
||||
ldflags += " -g"
|
||||
n.variable("ldflags", ldflags)
|
||||
mw_link_version = "1.7"
|
||||
n.variable("mw_version", mw_link_version)
|
||||
if os.name == "nt":
|
||||
exe = ".exe"
|
||||
wine = ""
|
||||
else:
|
||||
if "_NT-" in os.uname().sysname:
|
||||
# MSYS2
|
||||
wine = ""
|
||||
elif args.wine:
|
||||
wine = f"{args.wine} "
|
||||
elif which("wibo") is not None:
|
||||
wine = "wibo "
|
||||
else:
|
||||
wine = "wine "
|
||||
exe = ""
|
||||
n.newline()
|
||||
|
||||
###
|
||||
# Tooling
|
||||
###
|
||||
n.comment("decomp-toolkit")
|
||||
|
||||
tools_path = Path("tools")
|
||||
build_tools_path = args.build_dir / "tools"
|
||||
|
||||
if args.build_dtk:
|
||||
dtk = build_tools_path / "release" / f"dtk{exe}"
|
||||
n.rule(
|
||||
name="cargo",
|
||||
command="cargo build --release --manifest-path $in --bin $bin --target-dir $target",
|
||||
description="CARGO $bin",
|
||||
depfile=path(Path("$target") / "release" / "$bin.d"),
|
||||
deps="gcc",
|
||||
)
|
||||
n.build(
|
||||
outputs=path(dtk),
|
||||
rule="cargo",
|
||||
inputs=path(args.build_dtk / "Cargo.toml"),
|
||||
variables={
|
||||
"bin": "dtk",
|
||||
"target": build_tools_path,
|
||||
},
|
||||
)
|
||||
else:
|
||||
dtk = build_tools_path / f"dtk{exe}"
|
||||
download_dtk = tools_path / "download_dtk.py"
|
||||
n.rule(
|
||||
name="download_dtk",
|
||||
command=f"$python {download_dtk} $in $out",
|
||||
description="DOWNLOAD $out",
|
||||
)
|
||||
n.build(
|
||||
outputs=path(dtk),
|
||||
rule="download_dtk",
|
||||
inputs=path(tools_path / "dtk_version"),
|
||||
implicit=path(download_dtk),
|
||||
)
|
||||
n.newline()
|
||||
|
||||
###
|
||||
# Rules
|
||||
###
|
||||
compiler_path = args.compilers / "$mw_version"
|
||||
mwcc = compiler_path / "mwcceppc.exe"
|
||||
mwld = compiler_path / "mwldeppc.exe"
|
||||
|
||||
mwcc_cmd = f"{chain}{wine}{mwcc} $cflags -MMD -c $in -o $basedir"
|
||||
mwld_cmd = f"{wine}{mwld} $ldflags -o $out @$out.rsp"
|
||||
ar_cmd = f"{dtk} ar create $out @$out.rsp"
|
||||
|
||||
if os.name != "nt":
|
||||
transform_dep = tools_path / "transform-dep.py"
|
||||
transform_dep_cmd = f" && $python {transform_dep} $basefile.d $basefile.d"
|
||||
mwcc_cmd += transform_dep_cmd
|
||||
|
||||
n.comment("Link ELF file")
|
||||
n.rule(
|
||||
name="link",
|
||||
command=mwld_cmd,
|
||||
description="LINK $out",
|
||||
rspfile="$out.rsp",
|
||||
rspfile_content="$in_newline",
|
||||
)
|
||||
n.newline()
|
||||
|
||||
n.comment("MWCC build")
|
||||
n.rule(
|
||||
name="mwcc",
|
||||
command=mwcc_cmd,
|
||||
description="MWCC $out",
|
||||
depfile="$basefile.d",
|
||||
deps="gcc",
|
||||
)
|
||||
n.newline()
|
||||
|
||||
n.comment("Host build")
|
||||
n.variable("host_cflags", "-I include -Wno-trigraphs")
|
||||
n.variable(
|
||||
"host_cppflags",
|
||||
"-std=c++98 -I include -fno-exceptions -fno-rtti -D_CRT_SECURE_NO_WARNINGS -Wno-trigraphs -Wno-c++11-extensions",
|
||||
)
|
||||
n.rule(
|
||||
name="host_cc",
|
||||
command="clang $host_cflags -c -o $out $in",
|
||||
description="CC $out",
|
||||
)
|
||||
n.rule(
|
||||
name="host_cpp",
|
||||
command="clang++ $host_cppflags -c -o $out $in",
|
||||
description="CXX $out",
|
||||
)
|
||||
n.newline()
|
||||
|
||||
###
|
||||
# Rules for source files
|
||||
###
|
||||
n.comment("Source files")
|
||||
build_obj_path = build_path / "obj"
|
||||
build_src_path = build_path / "src"
|
||||
build_host_path = build_path / "host"
|
||||
build_config_path = build_path / "config.json"
|
||||
|
||||
build_obj_path.mkdir(parents=True, exist_ok=True)
|
||||
build_src_path.mkdir(parents=True, exist_ok=True)
|
||||
objdiff_config = {
|
||||
"custom_make": "ninja",
|
||||
"target_dir": str(build_obj_path),
|
||||
"base_dir": str(build_src_path),
|
||||
"build_target": False,
|
||||
"watch_patterns": [
|
||||
"*.c",
|
||||
"*.cp",
|
||||
"*.cpp",
|
||||
"*.h",
|
||||
"*.hpp",
|
||||
"*.py",
|
||||
"*.yml",
|
||||
"*.txt",
|
||||
"*.json",
|
||||
],
|
||||
"units": [],
|
||||
}
|
||||
|
||||
|
||||
def locate_unit(unit):
|
||||
for lib in LIBS:
|
||||
for obj in lib["objects"]:
|
||||
if obj[0] == unit:
|
||||
return [lib, obj]
|
||||
return None
|
||||
|
||||
|
||||
has_units = False
|
||||
if build_config_path.is_file():
|
||||
has_units = True
|
||||
|
||||
src_path = Path("src")
|
||||
link_inputs = []
|
||||
used_compiler_versions = set()
|
||||
source_inputs = []
|
||||
host_source_inputs = []
|
||||
|
||||
with open(build_config_path) as r:
|
||||
data = json.load(r)
|
||||
for unit in data["units"]:
|
||||
obj_path, unit = unit["object"], unit["name"]
|
||||
unit_path = src_path / unit
|
||||
if unit_path.exists():
|
||||
result = locate_unit(unit)
|
||||
if result:
|
||||
lib, object = result
|
||||
lib_name = lib["lib"]
|
||||
|
||||
completed = None
|
||||
options = {
|
||||
"add_to_all": True,
|
||||
"mw_version": None,
|
||||
"cflags": None,
|
||||
}
|
||||
if type(object) is list:
|
||||
if len(object) > 1:
|
||||
completed = object[1]
|
||||
if len(object) > 2:
|
||||
options.update(object[2])
|
||||
object = object[0]
|
||||
|
||||
mw_version = options["mw_version"] or lib["mw_version"]
|
||||
cflags = options["cflags"] or lib["cflags"]
|
||||
used_compiler_versions.add(mw_version)
|
||||
|
||||
n.comment(f"{unit}: {lib_name} (linked {completed})")
|
||||
|
||||
base_object = Path(object).with_suffix("")
|
||||
src_obj_path = build_src_path / f"{base_object}.o"
|
||||
n.build(
|
||||
outputs=path(src_obj_path),
|
||||
rule="mwcc",
|
||||
inputs=path(unit_path),
|
||||
variables={
|
||||
"mw_version": mw_version,
|
||||
"cflags": cflags,
|
||||
"basedir": os.path.dirname(
|
||||
build_src_path / f"{base_object}"
|
||||
),
|
||||
"basefile": path(build_src_path / f"{base_object}"),
|
||||
},
|
||||
)
|
||||
|
||||
if lib["host"]:
|
||||
host_obj_path = build_host_path / f"{base_object}.o"
|
||||
n.build(
|
||||
outputs=path(host_obj_path),
|
||||
rule="host_cc" if unit_path.suffix == ".c" else "host_cpp",
|
||||
inputs=path(unit_path),
|
||||
variables={
|
||||
"basedir": os.path.dirname(
|
||||
build_host_path / f"{base_object}"
|
||||
),
|
||||
"basefile": path(build_host_path / f"{base_object}"),
|
||||
},
|
||||
)
|
||||
if options["add_to_all"]:
|
||||
host_source_inputs.append(host_obj_path)
|
||||
|
||||
if options["add_to_all"]:
|
||||
source_inputs.append(src_obj_path)
|
||||
|
||||
objdiff_config["units"].append(
|
||||
{
|
||||
"name": unit,
|
||||
"path": f"{base_object}.o",
|
||||
"reverse_fn_order": "deferred" in cflags,
|
||||
}
|
||||
)
|
||||
|
||||
if completed:
|
||||
obj_path = src_obj_path
|
||||
else:
|
||||
print(f"No configuration entry found for {unit}")
|
||||
exit(1)
|
||||
link_inputs.append(obj_path)
|
||||
n.newline()
|
||||
|
||||
# Check if all compiler versions exist
|
||||
for mw_version in used_compiler_versions:
|
||||
mw_path = args.compilers / mw_version / "mwcceppc.exe"
|
||||
if not os.path.exists(mw_path):
|
||||
print(f"Compiler {mw_path} does not exist")
|
||||
exit(1)
|
||||
|
||||
# Check if linker exists
|
||||
mw_path = args.compilers / mw_link_version / "mwldeppc.exe"
|
||||
if not os.path.exists(mw_path):
|
||||
print(f"Linker {mw_path} does not exist")
|
||||
exit(1)
|
||||
|
||||
###
|
||||
# Link
|
||||
###
|
||||
n.comment("Link")
|
||||
elf_path = build_path / "main.elf"
|
||||
if args.map:
|
||||
n.build(
|
||||
outputs=path(elf_path),
|
||||
rule="link",
|
||||
inputs=path(link_inputs),
|
||||
implicit=path(ldscript_path),
|
||||
implicit_outputs=path(map_path),
|
||||
)
|
||||
else:
|
||||
n.build(
|
||||
outputs=path(elf_path),
|
||||
rule="link",
|
||||
inputs=path(link_inputs),
|
||||
implicit=path(ldscript_path),
|
||||
)
|
||||
n.newline()
|
||||
|
||||
###
|
||||
# Helper rule for building all source files
|
||||
###
|
||||
n.comment("Build all source files")
|
||||
n.build(
|
||||
outputs="all_source",
|
||||
rule="phony",
|
||||
inputs=path(source_inputs),
|
||||
)
|
||||
n.newline()
|
||||
|
||||
###
|
||||
# Helper rule for building all source files, with a host compiler
|
||||
###
|
||||
n.comment("Build all source files with a host compiler")
|
||||
n.build(
|
||||
outputs="all_source_host",
|
||||
rule="phony",
|
||||
inputs=path(host_source_inputs),
|
||||
)
|
||||
n.newline()
|
||||
|
||||
###
|
||||
# Generate DOL
|
||||
###
|
||||
n.comment("Generate DOL")
|
||||
dol_path = build_path / "main.dol"
|
||||
n.rule(
|
||||
name="elf2dol",
|
||||
command=f"{dtk} elf2dol $in $out",
|
||||
description="DOL $out",
|
||||
)
|
||||
n.build(
|
||||
outputs=path(dol_path),
|
||||
rule="elf2dol",
|
||||
inputs=path(elf_path),
|
||||
implicit=path(dtk),
|
||||
)
|
||||
n.newline()
|
||||
|
||||
###
|
||||
# Check DOL hash
|
||||
###
|
||||
n.comment("Check DOL hash")
|
||||
dol_ok_path = str(dol_path) + ".ok"
|
||||
n.rule(
|
||||
name="check",
|
||||
command=f"{dtk} shasum -c $in -o $out",
|
||||
description="CHECK $in",
|
||||
)
|
||||
n.build(
|
||||
outputs=path(dol_ok_path),
|
||||
rule="check",
|
||||
inputs=path(Path("orig") / f"{version}.sha1"),
|
||||
implicit=path([dol_path, dtk]),
|
||||
)
|
||||
n.newline()
|
||||
|
||||
###
|
||||
# Helper tools
|
||||
###
|
||||
n.comment("Check for mismatching symbols")
|
||||
n.rule(
|
||||
name="dol_diff",
|
||||
command=f"{dtk} -L error dol diff $in",
|
||||
description=f"DIFF {elf_path}",
|
||||
)
|
||||
n.build(
|
||||
inputs=path([config_path, elf_path, map_path]),
|
||||
outputs="dol_diff",
|
||||
rule="dol_diff",
|
||||
)
|
||||
n.build(
|
||||
outputs="diff",
|
||||
rule="phony",
|
||||
inputs="dol_diff",
|
||||
)
|
||||
n.newline()
|
||||
|
||||
n.comment("Apply symbols from linked ELF")
|
||||
n.rule(
|
||||
name="dol_apply",
|
||||
command=f"{dtk} dol apply $in",
|
||||
description=f"APPLY {elf_path}",
|
||||
)
|
||||
n.build(
|
||||
inputs=path([config_path, elf_path, map_path]),
|
||||
outputs="dol_apply",
|
||||
rule="dol_apply",
|
||||
implicit=path([dol_ok_path])
|
||||
)
|
||||
n.build(
|
||||
outputs="apply",
|
||||
rule="phony",
|
||||
inputs="dol_apply",
|
||||
)
|
||||
|
||||
###
|
||||
# DOL split
|
||||
###
|
||||
n.comment("Generate objects from original DOL")
|
||||
n.rule(
|
||||
name="split",
|
||||
command=f"{dtk} dol split $in $out_dir",
|
||||
description="SPLIT $in",
|
||||
depfile="$out_dir/dep",
|
||||
deps="gcc",
|
||||
)
|
||||
n.build(
|
||||
inputs=path(config_path),
|
||||
outputs=path(build_config_path),
|
||||
rule="split",
|
||||
implicit=path(dtk),
|
||||
variables={"out_dir": path(build_path)},
|
||||
)
|
||||
n.newline()
|
||||
|
||||
###
|
||||
# Regenerate on change
|
||||
###
|
||||
n.comment("Reconfigure on change")
|
||||
script = os.path.relpath(__file__)
|
||||
n.rule(
|
||||
name="configure",
|
||||
command=f"$python {script} $configure_args",
|
||||
generator=True,
|
||||
description=f"RUN {script}",
|
||||
)
|
||||
n.build(
|
||||
outputs="build.ninja",
|
||||
rule="configure",
|
||||
implicit=path([script, tools_path / "ninja_syntax.py", build_config_path]),
|
||||
)
|
||||
n.newline()
|
||||
|
||||
###
|
||||
# Default rule
|
||||
###
|
||||
n.comment("Default rule")
|
||||
if has_units:
|
||||
n.default(path(dol_ok_path))
|
||||
else:
|
||||
n.default(path(build_config_path))
|
||||
|
||||
###
|
||||
# Write build.ninja
|
||||
###
|
||||
with open("build.ninja", "w") as f:
|
||||
f.write(out.getvalue())
|
||||
n.close()
|
||||
|
||||
###
|
||||
# Write objdiff config
|
||||
###
|
||||
with open("objdiff.json", "w") as w:
|
||||
json.dump(objdiff_config, w, indent=4)
|
||||
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <types.h>
|
||||
|
||||
|
||||
// MOST LIKELY mVEC
|
||||
struct Vec3f
|
||||
{
|
||||
f32 x, y, z;
|
||||
};
|
||||
|
||||
struct Vec2f
|
||||
{
|
||||
f32 x, y;
|
||||
};
|
||||
|
||||
struct Vec3s
|
||||
{
|
||||
s16 x, y, z;
|
||||
};
|
||||
|
||||
struct ObjInfoPtr {
|
||||
/* 0x00 */ char* name;
|
||||
/* 0x04 */ u16 obj_id;
|
||||
/* 0x06 */ u16 obj_id2;
|
||||
/* 0x08 */ u16 fiTextEntryId;
|
||||
/* 0x0A */ u8 unk_0xA;
|
||||
/* 0x0B */ u8 subtype;
|
||||
};
|
||||
@@ -0,0 +1,70 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/cLib/c_list.hpp
|
||||
|
||||
#include <types.h>
|
||||
|
||||
/// @brief A doubly-linked list node. See cListMg_c.
|
||||
/// @note Unofficial name.
|
||||
class cListNd_c {
|
||||
public:
|
||||
/// @brief Constructs a new list node.
|
||||
cListNd_c() : mpPrev(nullptr), mpNext(nullptr) {}
|
||||
|
||||
cListNd_c *getPrev() const { return mpPrev; }
|
||||
cListNd_c *getNext() const { return mpNext; }
|
||||
|
||||
protected:
|
||||
cListNd_c *mpPrev; ///< The previous node.
|
||||
cListNd_c *mpNext; ///< The next node.
|
||||
|
||||
friend class cListMg_c;
|
||||
};
|
||||
|
||||
/// @brief A doubly-linked list container. See cListNd_c.
|
||||
/// @note Unofficial name.
|
||||
class cListMg_c {
|
||||
public:
|
||||
/// @brief Constructs a new list container.
|
||||
cListMg_c() : mpFirst(nullptr), mpLast(nullptr) {}
|
||||
|
||||
/**
|
||||
* @brief Inserts a node after the given previous node.
|
||||
*
|
||||
* @param node The node to insert.
|
||||
* @param prevNode The node to insert it after, or @p nullptr to insert it at the beginning.
|
||||
* @return If the operation was successful.
|
||||
*/
|
||||
bool insertAfter(cListNd_c *node, cListNd_c *prevNode);
|
||||
|
||||
/**
|
||||
* @brief Removes a node from the list.
|
||||
*
|
||||
* @param node The node to remove.
|
||||
* @return If the operation was successful.
|
||||
*/
|
||||
bool remove(cListNd_c *node);
|
||||
|
||||
/**
|
||||
* @brief Adds a node to the end of the list.
|
||||
*
|
||||
* @param node The node to append.
|
||||
* @return If the operation was successful.
|
||||
*/
|
||||
bool append(cListNd_c *node);
|
||||
|
||||
/**
|
||||
* @brief Adds a node to the beginning of the list.
|
||||
*
|
||||
* @param node The node to prepend.
|
||||
* @return If the operation was successful.
|
||||
*/
|
||||
bool prepend(cListNd_c *node);
|
||||
|
||||
cListNd_c *getFirst() const { return mpFirst; }
|
||||
cListNd_c *getLast() const { return mpLast; }
|
||||
|
||||
protected:
|
||||
cListNd_c *mpFirst; ///< The first node in the list.
|
||||
cListNd_c *mpLast; ///< The last node in the list.
|
||||
};
|
||||
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/cLib/c_owner_set.hpp
|
||||
|
||||
#include <types.h>
|
||||
/// @file
|
||||
|
||||
/// @brief A set node with a pointer to the owning container. See cOwnerSetMg_c.
|
||||
/// @note Unofficial name.
|
||||
class cOwnerSetNd_c {
|
||||
public:
|
||||
void *getOwner() const { return mpOwner; }
|
||||
cOwnerSetNd_c *getNext() const { return mpNext; }
|
||||
|
||||
private:
|
||||
void* mpOwner; ///< The set that contains this node.
|
||||
cOwnerSetNd_c* mpNext; ///< The next node in the set.
|
||||
|
||||
friend class cOwnerSetMg_c;
|
||||
};
|
||||
|
||||
/// @brief A set container. See cOwnerSetNd_c.
|
||||
/// @details The set is implemented as a singly-linked list.
|
||||
/// @note Unofficial name.
|
||||
class cOwnerSetMg_c {
|
||||
public:
|
||||
/// @brief Constructs a new set container.
|
||||
cOwnerSetMg_c() : mpRoot(nullptr) {}
|
||||
|
||||
/// @brief Destroys the set.
|
||||
~cOwnerSetMg_c() { clear(); };
|
||||
|
||||
/**
|
||||
* @brief Adds a node to the set.
|
||||
*
|
||||
* @param nd The node to add.
|
||||
* @param owner The owner of the node.
|
||||
*/
|
||||
void add(cOwnerSetNd_c *nd, void *owner);
|
||||
|
||||
/**
|
||||
* @brief Removes a node from the set.
|
||||
*
|
||||
* @param nd The node to remove.
|
||||
* @param owner The owner of the node.
|
||||
*/
|
||||
void remove(cOwnerSetNd_c *nd, void *owner);
|
||||
|
||||
private:
|
||||
/// @brief Clears out the set and unlinks all child nodes.
|
||||
void clear();
|
||||
|
||||
cOwnerSetNd_c* mpRoot; ///< The first element of the set.
|
||||
};
|
||||
@@ -0,0 +1,62 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/cLib/c_tree.hpp
|
||||
|
||||
#include <types.h>
|
||||
|
||||
/// @brief A tree node. See cTreeMg_c.
|
||||
/// @details The tree is represented as a doubly-linked LCRS tree.
|
||||
class cTreeNd_c {
|
||||
public:
|
||||
/// @brief Constructs a new tree node.
|
||||
cTreeNd_c();
|
||||
|
||||
/// @brief Gets the next node in preorder traversal order.
|
||||
cTreeNd_c *getTreeNext() const;
|
||||
|
||||
/// @brief Gets the next node in preorder traversal order, excluding the node's children.
|
||||
cTreeNd_c *getTreeNextNotChild() const;
|
||||
|
||||
cTreeNd_c *getParent() const { return mpParent; }
|
||||
cTreeNd_c *getChild() const { return mpChild; }
|
||||
cTreeNd_c *getBrPrev() const { return mpPrev; }
|
||||
cTreeNd_c *getBrNext() const { return mpNext; }
|
||||
|
||||
protected:
|
||||
/// @brief Clears all fields.
|
||||
void forcedClear();
|
||||
|
||||
cTreeNd_c *mpParent; ///< The parent node.
|
||||
cTreeNd_c *mpChild; ///< The child node.
|
||||
cTreeNd_c *mpPrev; ///< The previous sibling node.
|
||||
cTreeNd_c *mpNext; ///< The next sibling node.
|
||||
|
||||
friend class cTreeMg_c;
|
||||
};
|
||||
|
||||
/// @brief A tree container. See cTreeNd_c.
|
||||
class cTreeMg_c {
|
||||
public:
|
||||
/// @brief Constructs a new tree container.
|
||||
cTreeMg_c() : mpRootNode(nullptr) {}
|
||||
|
||||
/**
|
||||
* @brief Adds a node to the tree, either to the root node or to a specified parent node.
|
||||
*
|
||||
* @param node The node to add.
|
||||
* @param parent The parent node to attach it to, or @p nullptr to attach it to the tree root.
|
||||
* @return If the operation was successful.
|
||||
*/
|
||||
bool addTreeNode(cTreeNd_c *node, cTreeNd_c *parent);
|
||||
|
||||
/**
|
||||
* @brief Removes a node from the tree.
|
||||
*
|
||||
* @param node The node to remove.
|
||||
* @return If the operation was successful.
|
||||
*/
|
||||
bool removeTreeNode(cTreeNd_c *node);
|
||||
|
||||
protected:
|
||||
cTreeNd_c *mpRootNode; ///< The root node of the tree.
|
||||
};
|
||||
@@ -0,0 +1,141 @@
|
||||
#pragma once
|
||||
|
||||
#include <d/d_base.h>
|
||||
#include <d/d_heap.h>
|
||||
#include <m/mAllocator.h>
|
||||
#include <UnknownTypeBelongings.h>
|
||||
// Ghidra: ActorBase
|
||||
// size: 0xFC
|
||||
// non-official name
|
||||
class dAcBase_c : public dBase_c {
|
||||
public:
|
||||
/* 0x68 */ mHeapAllocator mHeapAllocator; // mHeapAlloctor
|
||||
/* 0x84 */ ObjInfoPtr* objInfo; //
|
||||
/* 0x88 */ int field_0x88;
|
||||
/* 0x8C */ int field_0x8C;
|
||||
/* 0x90 */ int field_0x90;
|
||||
/* 0x94 */ void* soundRelated;
|
||||
protected:
|
||||
/* 80501544 */ // vtable
|
||||
/* 0x08 */ virtual int create();
|
||||
/* 0x0C */ // virtual int preCreate(); // uses fBase_c::preCreate()
|
||||
/* 0x10 */ virtual void postCreate(MAIN_STATE_e state);
|
||||
/* 0x14 */ // virtual int doDelete(); / uses fBase_c::doDelete
|
||||
/* 0x18 */ virtual int preDelete();
|
||||
/* 0x1C */ // virtual void postDelete(MAIN_STATE_e state); // uses fBase_c::postDelete
|
||||
/* 0x20 */ virtual int execute(); // calls either actorExecute/executeInEvent
|
||||
/* 0x24 */ virtual int preExecute(); // looks at some actor properties
|
||||
/* 0x28 */ virtual void postExecute(MAIN_STATE_e state); // not fully understood
|
||||
/* 0x2C */ // virtual int draw(); // uses fBase_c::draw
|
||||
/* 0x30 */ // virtual int preDraw(); // uses dBase_c::preDraw
|
||||
/* 0x34 */ // virtual void postDraw(MAIN_STATE_e state); // uses dBase_c::postDraw
|
||||
/* 0x38 */ // virtual void deleteReady(); // uses fBase_c::deleteReady
|
||||
/* 0x3C */ // virtual bool entryFrmHeap(unsigned long size, EGG::Heap *parentHeap); // uses fBase_c::entryFrmHeap
|
||||
/* 0x40 */ // virtual bool entryFrmHeapNonAdjust(unsigned long size, EGG::Heap *parentHeap); // uses fBase_c::entryFrmHeapNonAdjust
|
||||
/* 0x44 */ virtual bool createHeap();
|
||||
/* 0x48 */ virtual ~dAcBase_c();
|
||||
// Start of dAcBase_c vtable additions (after dBase_c)
|
||||
/* 0x4C */ virtual int actorCreate(); // name is assumed
|
||||
/* 0x50 */ virtual int actorReCreate(); // name is assumed
|
||||
/* 0x54 */ virtual int actorExecute(); // name is assumed
|
||||
/* 0x58 */ virtual int actorExecuteInEvent(); // name is assumed
|
||||
/* 0x5C */ virtual void unkVirtFunc_0x5C();
|
||||
/* 0x60 */ virtual void unkVirtFunc_0x60();
|
||||
/* 0x64 */ virtual bool restorePosRotFromCopy();
|
||||
/* 0x68 */ virtual void* getCurrentEventActor();
|
||||
/* 0x6C */ virtual void unkVirtFunc_0x6C();
|
||||
/* 0x70 */ virtual void doInteraction(s32);
|
||||
|
||||
public:
|
||||
dAcBase_c();
|
||||
|
||||
public:
|
||||
// funcs found in TU
|
||||
static void setTempCreateParams( \
|
||||
Vec3f* pos, Vec3s* rot, Vec3f* scale, \
|
||||
s32 roomId, u32 params2, dAcBase_c* parent, \
|
||||
u8 subtype, s16 unkFlag, u8 viewClipIdx,\
|
||||
ObjInfoPtr* objInfo );
|
||||
|
||||
void* FUN_8002c690();
|
||||
int initAllocatorWork1Heap(int size, char* name);
|
||||
int initAllocator(int size, char* name, EGG::Heap* heap);
|
||||
bool addActorToRoom(s32 roomId);
|
||||
void setBit_field_0xE8(s32);
|
||||
u32 itemDroppingAndGivingRelated(Vec3f* spawnPos, int subtype);
|
||||
void fillUpperParams2Byte();
|
||||
u32 getParams2_ignoreLower();
|
||||
void setParams2Upper_ignoreLower(u32 val);
|
||||
u8 getParams2UpperByte();
|
||||
void setParams2UpperByte(u32 val);
|
||||
static u32 buildParams2(u32 lower, u8 upper);
|
||||
u32 getParams2Lower();
|
||||
static dAcBase_c* findActor(char* objName, dAcBase_c* parent);
|
||||
static dAcBase_c* searchActor(dAcBase_c& optionalParent);
|
||||
// Kinda performs the code of the first param on every actor (second param is optional parent)
|
||||
static void forEachActor(void*, dAcBase_c&);
|
||||
// Not really static, but we currently dont have a type for the return (not just simply a s16)
|
||||
static void getXZAngleToPlayer(s16&, dAcBase_c&);
|
||||
// returns true if under the distThresh, False if not. the actual distance is returned in outDist
|
||||
bool getDistanceToActor(dAcBase_c& actor, f32 distThresh, f32* outDist);
|
||||
// same concept as above
|
||||
bool getDistanceAndAngleToActor(dAcBase_c& actor, f32 distThresh, s16 yAngle, s16 xAngle, f32* outDist, s16* outDiffAngleY, s16* outDiffAngleX);
|
||||
bool isWithinPlayerRadius(f32 radius);
|
||||
bool getDistanceAndAngleToPlayer(f32 distThresh, s16 yAngle, s16 xAngle, f32* outDist, s16* outDiffAngleY, s16* outDiffAngleX);
|
||||
f32 getDistToPlayer();
|
||||
f32 getSquareDistToPlayer();
|
||||
void updateRoomId(f32 yOffs);
|
||||
bool isRoomFlags_0x6_Set();
|
||||
// Begin Sound Effect Related
|
||||
void FUN_8002d590();
|
||||
void FUN_8002d5b0();
|
||||
void playSound();
|
||||
void FUN_8002d600();
|
||||
void FUN_8002d630();
|
||||
void FUN_8002d6d0();
|
||||
void playSoundEffect1();
|
||||
void FUN_8002d740();
|
||||
void FUN_8002d770();
|
||||
void FUN_8002d7a0();
|
||||
void FUN_8002d7d0();
|
||||
void FUN_8002d7f0();
|
||||
void FUN_8002d810();
|
||||
void FUN_8002d830();
|
||||
void FUN_8002d860();
|
||||
void FUN_8002d880();
|
||||
// End Sound Effect Related
|
||||
void FUN_8002d890();
|
||||
void setActorRef(dBase_c&);
|
||||
// next three funcs are related
|
||||
void setUnkFlag();
|
||||
void FUN_8002d940();
|
||||
void FUN_8002d960();
|
||||
|
||||
static dAcBase_c createActor(ProfileName actorId, u32 params1, Vec3f* pos, Vec3s* rot, \
|
||||
Vec3f* scale, u32 params2, s32 roomId, dBase_c* ref);
|
||||
|
||||
static dAcBase_c createActorUnkGroup3(ProfileName actorId, u32 params1, Vec3f* pos, Vec3s* rot, \
|
||||
Vec3f* scale, u32 params2, s32 roomId, dBase_c* ref);
|
||||
|
||||
void FUN_8002dc20(s16*, s16*);
|
||||
void incrementKillCounter();
|
||||
void FUN_8002dcd0();
|
||||
void FUN_8002dd10();
|
||||
void FUN_8002dd50();
|
||||
void FUN_8002dd90();
|
||||
void FUN_8002ddd0();
|
||||
void FUN_8002de30();
|
||||
|
||||
public:
|
||||
// static vars
|
||||
static u32 s_Create_RoomId;
|
||||
static u32 s_Create_Params2;
|
||||
static u16 s_Create_UnkFlags;
|
||||
static u8 s_Create_ViewClipIdx;
|
||||
static Vec3f* s_Create_Position;
|
||||
static Vec3s* s_Create_Rotation;
|
||||
static Vec3f* s_Create_Scale;
|
||||
static dAcBase_c* s_Create_Parent;
|
||||
static ObjInfoPtr* s_Create_ObjInfo;
|
||||
static u8 s_Create_Subtype;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <d/a/obj/d_a_obj_base.h>
|
||||
|
||||
// Ghidra: ActorEnemyBase
|
||||
// size:
|
||||
// non-official name
|
||||
class dAcEnBase_c : public dAcOBase_c {
|
||||
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <d/a/obj/d_a_obj_base.h>
|
||||
|
||||
// This is the NPC base. Most npcs actually use dAcOrdinaryNpc, but this just is a simpler one?
|
||||
|
||||
// Ghidra: ActorNpcBase
|
||||
// size: 0x6e4
|
||||
// official name
|
||||
class dAcNpc_c : public dAcOBase_c {
|
||||
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <d/a/npc/d_a_npc.h>
|
||||
|
||||
// Ghidra: AcOrdinaryNpc
|
||||
// size:
|
||||
// official name
|
||||
class dAcOrdinaryNpc_c : public dAcNpc_c {
|
||||
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <d/a/d_a_base.h>
|
||||
|
||||
// Ghidra: ActorObjectBase
|
||||
// size: 0x330
|
||||
// non-official name
|
||||
class dAcOBase_c : public dAcBase_c {
|
||||
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <d/a/obj/d_a_obj_base.h>
|
||||
|
||||
// Ghidra: AcItem
|
||||
// Size: 0xd68
|
||||
// official name
|
||||
class dAcItem_c : public dAcOBase_c {
|
||||
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include <f/f_base.h>
|
||||
#include <c/c_owner_set.h>
|
||||
|
||||
// Ghidra: dBase_c
|
||||
// size: 0x68
|
||||
// non-official but likely name
|
||||
class dBase_c : public fBase_c{
|
||||
public:
|
||||
/* 80050800 */ dBase_c();
|
||||
/* 80050890 */ virtual int preExecute();
|
||||
/* 800508f0 */ virtual void postExecute(MAIN_STATE_e state);
|
||||
/* 80050920 */ virtual int preDraw();
|
||||
/* 80050860 */ virtual void postDraw(MAIN_STATE_e state);
|
||||
/* 8002c530 */ virtual ~dBase_c();
|
||||
|
||||
public:
|
||||
u32 baseProperties; // field from profile init
|
||||
|
||||
public:
|
||||
/* 80050980 */ static void resetFlags();
|
||||
/* 800509a0 */ static bool isActorPlayer(dBase_c&);
|
||||
/* 800509e0 */ static void initLoader();
|
||||
/* 80050a00 */ static dBase_c* createBase(ProfileName, dBase_c*, unsigned long, u8);
|
||||
/* 80050a10 */ static dBase_c* createRoot(ProfileName, unsigned long, u8);
|
||||
|
||||
private:
|
||||
/* 800509c0 */ static int loadAsyncCallback();
|
||||
/* 800509d0 */ static void unloadCallback();
|
||||
|
||||
inline bool isProcControlFlag(u32 flag) const { return (baseProperties & flag) != 0; }
|
||||
|
||||
public:
|
||||
// /* 805750c0 */ static u32 ACTOR_SHOULD_UPDATE_FLAGS;
|
||||
// /* 805750c0 */ static u32 ACTOR_SHOULD_DRAW_FLAGS;
|
||||
// /* 805750c0 */ static u32 ACTOR_SHOULD_UNK_FLAGS;
|
||||
// /* 80575bc0 */ static fProfile::fBaseProfile_c** DAT_ACTOR_ALLOCATION_FUNCTIONS;
|
||||
|
||||
friend class fBase_c;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <lib/egg/core/eggHeap.h>
|
||||
|
||||
class dHeap {
|
||||
public:
|
||||
static EGG::Heap* work1Heap;
|
||||
};
|
||||
@@ -0,0 +1,134 @@
|
||||
#pragma once
|
||||
|
||||
// This file is adapted from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_base.hpp
|
||||
// and the Skyward Sword Ghidra database. Comments and docs can be seen above. stripped in this file for easier looking
|
||||
|
||||
#include <types.h>
|
||||
#include <lib/egg/core/eggFrmHeap.h>
|
||||
#include <f/f_profile.h>
|
||||
#include <f/f_base_id.h>
|
||||
#include <f/f_helper_unk.h>
|
||||
#include <f/f_manager.h>
|
||||
#include <f/f_list_mg.h>
|
||||
|
||||
// Ghidra: fBase
|
||||
// size: 0x64
|
||||
// official name
|
||||
class fBase_c {
|
||||
public:
|
||||
/* 0x00 */ fBaseID_e mUniqueID;
|
||||
/* 0x04 */ undefined4 mParam; // params1
|
||||
/* 0x08 */ ProfileName mProfName; // Actor Id
|
||||
protected:
|
||||
/* 0x0A */ u8 mLifecycleState;
|
||||
/* 0x0B */ bool mDeleteRequest;
|
||||
/* 0x0C */ bool mUpdateRequest;
|
||||
/* 0x0D */ bool mRetryCreate;
|
||||
/* 0x0E */ u8 mGroupType;
|
||||
/* 0x0F */ u8 mProcControl;
|
||||
/* 0x10 */ fManager_c mMng;
|
||||
/* 0x50 */ fBaHelper_c* mpUnusedHelper;
|
||||
/* 0x54 */ fLiMgBa_c mUnusedList;
|
||||
/* 0x5C */ EGG::FrmHeap* mpHeap;
|
||||
/* 0x60 */ // vtable
|
||||
public:
|
||||
enum LIFECYCLE_e {
|
||||
WAITING_FOR_CREATE,
|
||||
ACTIVE,
|
||||
TO_BE_DELETED
|
||||
};
|
||||
enum GROUP_TYPE_e {
|
||||
OTHER,
|
||||
SCENE,
|
||||
ACTOR
|
||||
};
|
||||
enum MAIN_STATE_e {
|
||||
CANCELED,
|
||||
ERROR,
|
||||
SUCCESS,
|
||||
WAITING
|
||||
};
|
||||
enum PACK_RESULT_e {
|
||||
NOT_READY,
|
||||
SUCCEEDED,
|
||||
FAILED,
|
||||
};
|
||||
|
||||
enum PROC_DISABLE_e {
|
||||
ROOT_DISABLE_EXECUTE = 1,
|
||||
DISABLE_EXECUTE = 2,
|
||||
ROOT_DISABLE_DRAW = 4,
|
||||
DISABLE_DRAW = 8
|
||||
};
|
||||
|
||||
bool isProcControlFlag(u8 flag) const { return (mProcControl & flag) != 0; }
|
||||
void setProcControlFlag(u8 flag) { mProcControl |= flag; }
|
||||
void clearProcControlFlag(u8 flag) { mProcControl &= ~flag; }
|
||||
public:
|
||||
fBase_c();
|
||||
|
||||
static void *operator new(size_t);
|
||||
static void operator delete(void *);
|
||||
|
||||
protected:
|
||||
// This vtable should exist at 0x60
|
||||
/* 0x08 */ virtual int create();
|
||||
/* 0x0C */ virtual int preCreate();
|
||||
/* 0x10 */ virtual void postCreate(MAIN_STATE_e state);
|
||||
/* 0x14 */ virtual int doDelete();
|
||||
/* 0x18 */ virtual int preDelete();
|
||||
/* 0x1C */ virtual void postDelete(MAIN_STATE_e state);
|
||||
/* 0x20 */ virtual int execute();
|
||||
/* 0x24 */ virtual int preExecute();
|
||||
/* 0x28 */ virtual void postExecute(MAIN_STATE_e state);
|
||||
/* 0x2C */ virtual int draw();
|
||||
/* 0x30 */ virtual int preDraw();
|
||||
/* 0x34 */ virtual void postDraw(MAIN_STATE_e state);
|
||||
/* 0x38 */ virtual void deleteReady();
|
||||
/* 0x3C */ virtual bool entryFrmHeap(unsigned long size, EGG::Heap *parentHeap);
|
||||
/* 0x40 */ virtual bool entryFrmHeapNonAdjust(unsigned long size, EGG::Heap *parentHeap);
|
||||
/* 0x44 */ virtual bool createHeap();
|
||||
/* 0x48 */ virtual ~fBase_c();
|
||||
|
||||
|
||||
public:
|
||||
void deleteRequest();
|
||||
fBase_c *getConnectParent() const;
|
||||
fBase_c *getConnectChild() const;
|
||||
fBase_c *getConnectBrNext() const;
|
||||
bool checkChildProcessCreateState() const;
|
||||
|
||||
private:
|
||||
int createPack();
|
||||
int deletePack();
|
||||
int executePack();
|
||||
int drawPack();
|
||||
int commonPack(int (fBase_c::*doFunc)(), int (fBase_c::*preFunc)(), void (fBase_c::*postFunc)(MAIN_STATE_e));
|
||||
int connectProc();
|
||||
void runCreate();
|
||||
fBase_c *getChildProcessCreateState() const;
|
||||
|
||||
public:
|
||||
static fBase_c *createChild(ProfileName profName, fBase_c *parent, unsigned long param, u8 groupType);
|
||||
static fBase_c *createRoot(ProfileName profName, unsigned long param, u8 groupType);
|
||||
|
||||
private:
|
||||
static void setTmpCtData(ProfileName profName, fTrNdBa_c *connectParent, unsigned long param, u8 groupType);
|
||||
static fBase_c *fBase_make(ProfileName profName, fTrNdBa_c *connectParent, unsigned long param, u8 groupType);
|
||||
|
||||
protected:
|
||||
// these still exist and are still unused
|
||||
static int (*sLoadAsyncCallback)();
|
||||
static void (*sUnloadCallback)();
|
||||
|
||||
private:
|
||||
static fBaseID_e m_rootUniqueID;
|
||||
static ProfileName m_tmpCtProfName;
|
||||
static fTrNdBa_c *m_tmpCtConnectParent;
|
||||
static u32 m_tmpCtParam;
|
||||
static u8 m_tmpCtGroupType;
|
||||
|
||||
friend class fManager_c;
|
||||
friend class fLiNdBa_c;
|
||||
friend class fTrMgBa_c;
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
enum fBaseID_e {
|
||||
FIRST_ID = 1,
|
||||
INVALID = -1,
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_helper_unk.hpp
|
||||
|
||||
#include <types.h>
|
||||
|
||||
/// @brief [A helper class for fBase_c with unknown purpose].
|
||||
/// @note Unofficial name.
|
||||
class fBaHelper_c {
|
||||
s16 mStatus;
|
||||
s16 mCount;
|
||||
void **mpArr;
|
||||
void *filler1;
|
||||
s16 filler2;
|
||||
s16 mUnknown;
|
||||
|
||||
virtual void vf_0x8(); ///< [Stripped out of binary].
|
||||
virtual int vf_0xc(void *); ///< [Stripped out of binary].
|
||||
virtual void vf_0x10(void *); ///< [Stripped out of binary].
|
||||
|
||||
public:
|
||||
void Delete(); ///< @todo Document this method.
|
||||
int Load(int); ///< @todo Document this method.
|
||||
bool LoadOnlyOne(); ///< @todo Document this method.
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_mg.hpp
|
||||
|
||||
#include <types.h>
|
||||
#include <f/f_profile.h>
|
||||
#include <c/c_list.h>
|
||||
#include <f/f_base_id.h>
|
||||
#include <f/f_list_nd.h>
|
||||
|
||||
class fBase_c;
|
||||
|
||||
/// @brief A list of fLiNdBa_c nodes.
|
||||
class fLiMgBa_c : public cListMg_c {
|
||||
public:
|
||||
/**
|
||||
* @brief Counts the number of nodes of a given profile in this list.
|
||||
*
|
||||
* @param profName The profile name.
|
||||
* @return How many nodes were found.
|
||||
*/
|
||||
int countNodeByProfName(ProfileName profName) const;
|
||||
|
||||
/**
|
||||
* @brief Finds a node in this list with the given ID.
|
||||
*
|
||||
* @param id The ID to search for.
|
||||
* @return The found node, or @p nullptr if none were found.
|
||||
*/
|
||||
const fLiNdBa_c *searchNodeByID(fBaseID_e id) const;
|
||||
|
||||
inline fLiNdBa_c *getFirst() const {
|
||||
return (fLiNdBa_c *) cListMg_c::getFirst();
|
||||
}
|
||||
|
||||
inline fLiNdBa_c *getLast() const {
|
||||
return (fLiNdBa_c *) cListMg_c::getLast();
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_mg_ptmf.hpp
|
||||
|
||||
#include <types.h>
|
||||
|
||||
#include <f/f_list_mg.h>
|
||||
#include <f/f_list_nd_prio.h>
|
||||
|
||||
class fBase_c;
|
||||
|
||||
/// @brief A list of fLiNdPrio_c nodes with a reference to a process function.
|
||||
/// @note Unofficial name.
|
||||
class fLiMgPTMF_c : public fLiMgBa_c {
|
||||
public:
|
||||
/// @brief Constructs a new list node.
|
||||
/// @param procFunc The process function.
|
||||
fLiMgPTMF_c(int (fBase_c::*procFunc)()) : mpProcFunc(procFunc) {}
|
||||
|
||||
/**
|
||||
* @brief Inserts a node in the correct place according to its priority.
|
||||
*
|
||||
* @param node The node to insert.
|
||||
* @return If the operation was successful.
|
||||
*/
|
||||
bool addNode(fLiNdPrio_c *node);
|
||||
|
||||
/// @brief Calls the process function ::mpProcFunc on the owner of each node in the list.
|
||||
/// @return If the operation was successful.
|
||||
bool walkPack();
|
||||
|
||||
fLiNdPrio_c *getFirst() const {
|
||||
return (fLiNdPrio_c *) fLiMgBa_c::getFirst();
|
||||
}
|
||||
|
||||
fLiNdPrio_c *getLast() const {
|
||||
return (fLiNdPrio_c *) fLiMgBa_c::getLast();
|
||||
}
|
||||
|
||||
private:
|
||||
int (fBase_c::*mpProcFunc)(); ///< The process function for the list.
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_nd.hpp
|
||||
|
||||
#include <types.h>
|
||||
#include <c/c_list.h>
|
||||
|
||||
class fBase_c;
|
||||
|
||||
/// @brief A list node with an owner reference.
|
||||
/// @note Unofficial name.
|
||||
class fLiNdBa_c : public cListNd_c {
|
||||
public:
|
||||
|
||||
/// @brief Constructs a new list node.
|
||||
/// @param owner The node's owner.
|
||||
fLiNdBa_c(fBase_c *owner) : mpOwner(owner) {}
|
||||
|
||||
inline fLiNdBa_c *getPrev() const {
|
||||
return (fLiNdBa_c *) cListNd_c::getPrev();
|
||||
}
|
||||
|
||||
inline fLiNdBa_c *getNext() const {
|
||||
return (fLiNdBa_c *) cListNd_c::getNext();
|
||||
}
|
||||
|
||||
/// @brief Removes this node from the owner's fBase_c::mUnusedList.
|
||||
/// @note Unofficial name. Might not actually belong to this class (xor trick on hash).
|
||||
void removeSelf();
|
||||
|
||||
fBase_c *mpOwner; ///< The owner of this node.
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_list_nd_prio.hpp
|
||||
|
||||
#include <types.h>
|
||||
#include <f/f_profile.h>
|
||||
#include <f/f_list_nd.h>
|
||||
|
||||
/// @brief A list node with priority fields for an order in a list.
|
||||
/// @note Unofficial name.
|
||||
class fLiNdPrio_c : public fLiNdBa_c {
|
||||
public:
|
||||
/// @brief Constructs a new list node.
|
||||
/// @param owner The node's owner.
|
||||
fLiNdPrio_c(fBase_c *owner) : fLiNdBa_c(owner), mOrder(0), mNewOrder(0) {}
|
||||
|
||||
fLiNdPrio_c *getPrev() const {
|
||||
return (fLiNdPrio_c *) fLiNdBa_c::getPrev();
|
||||
}
|
||||
|
||||
fLiNdPrio_c *getNext() const {
|
||||
return (fLiNdPrio_c *) fLiNdBa_c::getNext();
|
||||
}
|
||||
|
||||
u16 getOrder() const {
|
||||
return mOrder;
|
||||
}
|
||||
|
||||
u16 getNewOrder() const {
|
||||
return mNewOrder;
|
||||
}
|
||||
|
||||
u16 mOrder; ///< The priority of this node.
|
||||
u16 mNewOrder; ///< The priority the node should change to if it differs from ::mOrder.
|
||||
};
|
||||
@@ -0,0 +1,80 @@
|
||||
#pragma once
|
||||
|
||||
// this file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_manager.hpp
|
||||
|
||||
#include <f/f_base_id.h>
|
||||
#include <f/f_list_mg_ptmf.h>
|
||||
#include <f/f_list_mg.h>
|
||||
#include <f/f_list_nd.h>
|
||||
#include <f/f_list_nd_prio.h>
|
||||
#include <f/f_tree_mg_ptmf.h>
|
||||
#include <f/f_tree_nd.h>
|
||||
#include <f/f_profile.h>
|
||||
|
||||
#define GET_PROC_FLAG(proc) (1 << (proc - 1))
|
||||
|
||||
class fBase_c;
|
||||
|
||||
/// @brief A class that manages the execution of the bases.
|
||||
class fManager_c {
|
||||
public:
|
||||
|
||||
/// @brief The processes for fManager_c.
|
||||
enum LOOP_PROC_e {
|
||||
NOTHING, CONNECT, CREATE, EXECUTE, DELETE, DRAW
|
||||
};
|
||||
|
||||
/// @brief Flags for different processes, induced from ::LOOP_PROC_e.
|
||||
enum PROC_FLAGS {
|
||||
PROC_FLAG_CONNECT = GET_PROC_FLAG(CONNECT),
|
||||
PROC_FLAG_CREATE = GET_PROC_FLAG(CREATE),
|
||||
PROC_FLAG_EXECUTE = GET_PROC_FLAG(EXECUTE),
|
||||
PROC_FLAG_DELETE = GET_PROC_FLAG(DELETE),
|
||||
PROC_FLAG_DRAW = GET_PROC_FLAG(DRAW)
|
||||
};
|
||||
|
||||
/// @brief Constructs a new manager.
|
||||
/// @param owner The manager's owner.
|
||||
fManager_c(fBase_c *owner) :
|
||||
mConnectNode(owner),
|
||||
mExecuteNode(owner),
|
||||
mDrawNode(owner),
|
||||
mSearchNode(owner) {}
|
||||
|
||||
/// @brief Gets the index of the search list corresponding to the owner of the manager. See ::m_searchManage.
|
||||
int getSearchTableNum();
|
||||
|
||||
/// @brief Executes the currently enabled processes on all the bases in the respective lists.
|
||||
static void mainLoop();
|
||||
|
||||
/// @brief Searches for a base with the given ID.
|
||||
static fBase_c *searchBaseByID(fBaseID_e id);
|
||||
|
||||
/// @brief Searches for a base with a given profile name, optionally under a given parent.
|
||||
static fBase_c *searchBaseByProfName(ProfileName profID, const fBase_c *parent);
|
||||
|
||||
/// @brief Searches for a base with a given group type, optionally under a given parent.
|
||||
static fBase_c *searchBaseByGroupType(unsigned char groupType, const fBase_c *parent);
|
||||
|
||||
private:
|
||||
fTrNdBa_c mConnectNode; ///< The node in ::m_connectManage.
|
||||
fLiNdPrio_c mExecuteNode; ///< The node in ::m_executeManage.
|
||||
fLiNdPrio_c mDrawNode; ///< The node in ::m_drawManage.
|
||||
fLiNdBa_c mSearchNode; ///< The node in ::m_searchManage.
|
||||
|
||||
static fTrMgPTMF_c m_connectManage; ///< A tree that connects all loaded bases.
|
||||
static fLiMgPTMF_c m_createManage; ///< A list of all the bases scheduled for creation.
|
||||
static fLiMgPTMF_c m_executeManage; ///< A list of all the bases scheduled for execution.
|
||||
static fLiMgPTMF_c m_deleteManage; ///< A list of all the bases scheduled for deletion.
|
||||
static fLiMgPTMF_c m_drawManage; ///< A list of all the bases scheduled for drawing.
|
||||
|
||||
/// @brief An array of lists that is used to search for bases.
|
||||
/// @details Bases are distributed evenly between each entry in the array.
|
||||
/// This allows for more efficient base lookups.
|
||||
static fLiMgBa_c m_searchManage[8];
|
||||
|
||||
static u32 m_StopProcInf; ///< Which processes should be executed this frame.
|
||||
static LOOP_PROC_e m_nowLoopProc; ///< The process ::mainLoop is currently in.
|
||||
|
||||
friend class fBase_c;
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
#pragma once
|
||||
|
||||
// Ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_profile.hpp
|
||||
|
||||
#include <f/f_profile_name.h>
|
||||
|
||||
|
||||
/// @brief Creates a profile of a base with given values for execute and draw order.
|
||||
#define SPECIAL_BASE_PROFILE(profName, className, executeOrder, drawOrder, baseProperties) void *className##_classInit() { return new className(); } \
|
||||
fProfile::fBaseProfile_c g_profile_##profName = { &className##_classInit, executeOrder, drawOrder, baseProperties }
|
||||
|
||||
/// @brief Creates a profile of an actor with given values for execute and draw order and the actor properties. @see SPECIAL_BASE_PROFILE
|
||||
#define SPECIAL_ACTOR_PROFILE(profName, className, executeOrder, drawOrder, baseProperties, properties) void *className##_classInit() { return new className(); } \
|
||||
const fProfile::fActorProfile_c g_profile_##profName = { &className##_classInit, executeOrder, drawOrder, baseProperties, properties }
|
||||
|
||||
/// @brief Creates a profile for a base, with the profile number as the priority for both the draw and execute order. @see SPECIAL_BASE_PROFILE
|
||||
#define DEFAULT_BASE_PROFILE(profName, className) SPECIAL_BASE_PROFILE(profName, className, fProfile::profName, fProfile::profName);
|
||||
|
||||
/// @brief Creates a profile of an actor with default values. @see DEFAULT_BASE_PROFILE
|
||||
#define DEFAULT_ACTOR_PROFILE(profName, className, baseProperties, properties) SPECIAL_ACTOR_PROFILE(profName, className, fProfile::profName, fProfile::profName, baseProperties, properties);
|
||||
/*
|
||||
|
||||
fProfile::fActorProfile_c g_profile_NAME = {
|
||||
*class_init()
|
||||
profName executreOrder
|
||||
profName drawOrder
|
||||
properties
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
/// @brief The name of a profile. Value is a fProfile::PROFILE_NAME_e.
|
||||
/// @note The compilation order suggests that this file might have been grouped together
|
||||
/// with the other f classes, so a similar naming scheme has been applied here.
|
||||
typedef u16 ProfileName;
|
||||
|
||||
/**
|
||||
* @brief Gets a string representing the profile name.
|
||||
*
|
||||
* @param profName The profile name for which to get the name string of.
|
||||
* @return A string containing the profile name.
|
||||
*/
|
||||
char *dProf_getName(ProfileName profName);
|
||||
|
||||
/// @brief For all profile related structures.
|
||||
/// @note Unofficial name.
|
||||
namespace fProfile {
|
||||
|
||||
/// @brief A set of basic information needed to construct a base.
|
||||
/// @details A profile consists of a pointer to a constructor function
|
||||
/// and a priority value for execution and drawing order.
|
||||
struct fBaseProfile_c {
|
||||
void *(*mpClassInit)(); ///< The constructor function.
|
||||
u16 mExecuteOrder; ///< The execution priority of the base.
|
||||
u16 mDrawOrder; ///< The draw priority of the base.
|
||||
u32 mBaseProperties;
|
||||
};
|
||||
|
||||
/// @brief A set of basic information needed to construct an actor.
|
||||
/// @details In addition to the fields in fBaseProfile_c, it also contains some properties about the actor.
|
||||
struct fActorProfile_c : fBaseProfile_c {
|
||||
u32 mActorProperties; ///< Some actor-related properties. @todo Document the bitfield.
|
||||
};
|
||||
|
||||
extern fBaseProfile_c *(*sProfileList)[NUMBER_OF_ACTORS]; ///< A list of all profiles.
|
||||
|
||||
} // namespace fProfile
|
||||
@@ -0,0 +1,714 @@
|
||||
#pragma once
|
||||
|
||||
#include <types.h>
|
||||
|
||||
namespace fProfile {
|
||||
|
||||
enum PROFILE_NAME_e {
|
||||
/* 000 (0x000) */ TITLE,
|
||||
/* 001 (0x001) */ E3_TITLE,
|
||||
/* 002 (0x002) */ E3_GAMEEND,
|
||||
/* 003 (0x003) */ THPPLAYER,
|
||||
/* 004 (0x004) */ GAME,
|
||||
/* 005 (0x005) */ STAGE_MANAGER,
|
||||
/* 006 (0x006) */ STAGE,
|
||||
/* 007 (0x007) */ STAGE_SELECT,
|
||||
/* 008 (0x008) */ VIEW_CLIP_TAG,
|
||||
/* 009 (0x009) */ START_TAG,
|
||||
/* 010 (0x00A) */ MAP_AREA_TAG,
|
||||
/* 011 (0x00B) */ TRUCK_RAIL,
|
||||
/* 012 (0x00C) */ TAG_STREAM,
|
||||
/* 013 (0x00D) */ COL_BOMSLD,
|
||||
/* 014 (0x00E) */ OBJ_STAGE_KRAKEN,
|
||||
/* 015 (0x00F) */ OBJ_STAGE_KRAKEN_PARTS,
|
||||
/* 016 (0x010) */ OBJ_TIME_STONE,
|
||||
/* 017 (0x011) */ OBJ_SW,
|
||||
/* 018 (0x012) */ OBJ_BLOCK_ROPE,
|
||||
/* 019 (0x013) */ OBJ_PUSH_BLOCK,
|
||||
/* 020 (0x014) */ OBJ_KIBAKO,
|
||||
/* 021 (0x015) */ OBJ_LOG,
|
||||
/* 022 (0x016) */ OBJ_LOG_WATER,
|
||||
/* 023 (0x017) */ OBJ_BELT_CVR,
|
||||
/* 024 (0x018) */ OBJ_DRUM,
|
||||
/* 025 (0x019) */ OBJ_BELT_OBSTACLE,
|
||||
/* 026 (0x01A) */ OBJ_HIMO,
|
||||
/* 027 (0x01B) */ OBJ_SPIDER_LINE,
|
||||
/* 028 (0x01C) */ OBJ_WIND,
|
||||
/* 029 (0x01D) */ OBJ_WIND03,
|
||||
/* 030 (0x01E) */ OBJ_WIND04,
|
||||
/* 031 (0x01F) */ OBJ_TORNADO,
|
||||
/* 032 (0x020) */ OBJ_SWITCH_WALL,
|
||||
/* 033 (0x021) */ OBJ_TOWER_D101,
|
||||
/* 034 (0x022) */ OBJ_DOOR_DUNGEON_D200,
|
||||
/* 035 (0x023) */ OBJ_DOOR_DUNGEON,
|
||||
/* 036 (0x024) */ OBJ_WOOD_BOARD,
|
||||
/* 037 (0x025) */ OBJ_CLAW_SHOT_TG,
|
||||
/* 038 (0x026) */ OBJ_BULB_SWITCH,
|
||||
/* 039 (0x027) */ OBJ_SIDE_SHUTTER,
|
||||
/* 040 (0x028) */ OBJ_HIT_LEVER_SW,
|
||||
/* 041 (0x029) */ OBJ_FENCE_IRON,
|
||||
/* 042 (0x02A) */ OBJ_UPDOWN_LAVA,
|
||||
/* 043 (0x02B) */ OBJ_BB_OBJECTS,
|
||||
/* 044 (0x02C) */ OBJ_BRIDGE_BUILDING,
|
||||
/* 045 (0x02D) */ OBJ_CANNON,
|
||||
/* 046 (0x02E) */ OBJ_ROULETTE_ISLAND_C,
|
||||
/* 047 (0x02F) */ OBJ_ROULETTE_ISLAND_R,
|
||||
/* 048 (0x030) */ OBJ_BRIDGE_STRETCH,
|
||||
/* 049 (0x031) */ OBJ_IRON_STAGE,
|
||||
/* 050 (0x032) */ OBJ_UTAJIMA_STOPPER,
|
||||
/* 051 (0x033) */ OBJ_UTAJIMA_MAIN_MECHA,
|
||||
/* 052 (0x034) */ OBJ_UTAJIMA_PEDESTAL,
|
||||
/* 053 (0x035) */ OBJ_UTAJIMA_ISLAND,
|
||||
/* 054 (0x036) */ OBJ_CANNON_COVER,
|
||||
/* 055 (0x037) */ OBJ_UTAJIMA,
|
||||
/* 056 (0x038) */ OBJ_UTAJIMA_LV2,
|
||||
/* 057 (0x039) */ OBJ_PUZZLE_ISLAND,
|
||||
/* 058 (0x03A) */ OBJ_FENCE_BOKO,
|
||||
/* 059 (0x03B) */ OBJ_FENCE_BOKO2,
|
||||
/* 060 (0x03C) */ OBJ_WINDMILL,
|
||||
/* 061 (0x03D) */ OBJ_PINWHEEL,
|
||||
/* 062 (0x03E) */ OBJ_LIGHTHOUSE_HARP,
|
||||
/* 063 (0x03F) */ OBJ_FENCE_KONSAI,
|
||||
/* 064 (0x040) */ OBJ_STAGE_SINK,
|
||||
/* 065 (0x041) */ OBJ_STAGE_WATER,
|
||||
/* 066 (0x042) */ OBJ_STAGE_COVER,
|
||||
/* 067 (0x043) */ OBJ_STAGE_CRACK,
|
||||
/* 068 (0x044) */ OBJ_TERRY_ISLAND,
|
||||
/* 069 (0x045) */ OBJ_INSECT_ISLAND,
|
||||
/* 070 (0x046) */ OBJ_SHRINE_AFTER,
|
||||
/* 071 (0x047) */ OBJ_SHRINE_BEFORE,
|
||||
/* 072 (0x048) */ OBJ_SHIP_WINDOW,
|
||||
/* 073 (0x049) */ OBJ_WATER_SURFACE,
|
||||
/* 074 (0x04A) */ OBJ_PUMPKIN_BAR,
|
||||
/* 075 (0x04B) */ OBJ_TREASURE_ISLAND,
|
||||
/* 076 (0x04C) */ OBJ_SEALED_DOOR,
|
||||
/* 077 (0x04D) */ OBJ_EVIL_FIELD,
|
||||
/* 078 (0x04E) */ OBJ_MEGAMI_ISLAND,
|
||||
/* 079 (0x04F) */ OBJ_CITY,
|
||||
/* 080 (0x050) */ OBJ_BAMBOO_ISLAND,
|
||||
/* 081 (0x051) */ OBJ_STREAM_LAVA,
|
||||
/* 082 (0x052) */ OBJ_DOWN_LAVA,
|
||||
/* 083 (0x053) */ OBJ_APPEAR_BRIDGE,
|
||||
/* 084 (0x054) */ OBJ_TRUCK_STOPPER,
|
||||
/* 085 (0x055) */ OBJ_ISLAND_NUSI,
|
||||
/* 086 (0x056) */ OBJ_ROCK_SKY,
|
||||
/* 087 (0x057) */ OBJ_TREASURE_ISLAND_B,
|
||||
/* 088 (0x058) */ OBJ_WATER_F100,
|
||||
/* 089 (0x059) */ OBJ_BELL,
|
||||
/* 090 (0x05A) */ OBJ_SHRINE_BEF_INSIDE,
|
||||
/* 091 (0x05B) */ OBJ_WINDMILL_DESERT,
|
||||
/* 092 (0x05C) */ OBJ_CITY_WATER,
|
||||
/* 093 (0x05D) */ OBJ_MOLE_COVER,
|
||||
/* 094 (0x05E) */ OBJ_DESERT_DEBRIS,
|
||||
/* 095 (0x05F) */ OBJ_BB_BROKEN_PARTS,
|
||||
/* 096 (0x060) */ OBJ_KUMITE_WALL,
|
||||
/* 097 (0x061) */ OBJ_WATER_SHIELD,
|
||||
/* 098 (0x062) */ OBJ_BSTONE,
|
||||
/* 099 (0x063) */ OBJ_WIND02,
|
||||
/* 100 (0x064) */ OBJ_LEAF_SWING,
|
||||
/* 101 (0x065) */ RIDE_ROCK_SET_TAG,
|
||||
/* 102 (0x066) */ OBJ_RIDE_ROCK,
|
||||
/* 103 (0x067) */ OBJ_MOVE_LIFT_VOL,
|
||||
/* 104 (0x068) */ OBJ_TRUCK,
|
||||
/* 105 (0x069) */ OBJ_TERRY_SHOP,
|
||||
/* 106 (0x06A) */ OBJ_TRAP_ROCK_1,
|
||||
/* 107 (0x06B) */ OBJ_STOPPER_ROCK,
|
||||
/* 108 (0x06C) */ OBJ_SHUTTER_FENCE,
|
||||
/* 109 (0x06D) */ OBJ_SINK_FLOOR_F,
|
||||
/* 110 (0x06E) */ E_GUMARM,
|
||||
/* 111 (0x06F) */ OBJ_STEP_GUMARM,
|
||||
/* 112 (0x070) */ OBJ_BRIDGE_FALL,
|
||||
/* 113 (0x071) */ OBJ_BRIDGE_STEP,
|
||||
/* 114 (0x072) */ OBJ_BRIDGE_BONE,
|
||||
/* 115 (0x073) */ OBJ_BB_BRIDGE,
|
||||
/* 116 (0x074) */ OBJ_BRIDGE_TIME,
|
||||
/* 117 (0x075) */ OBJ_BOAT,
|
||||
/* 118 (0x076) */ OBJ_BALLISTA,
|
||||
/* 119 (0x077) */ OBJ_BALLISTA_F3,
|
||||
/* 120 (0x078) */ OBJ_TIME_BOAT,
|
||||
/* 121 (0x079) */ OBJ_GODDESS_STATUE,
|
||||
/* 122 (0x07A) */ OBJ_STONE_STAND,
|
||||
/* 123 (0x07B) */ OBJ_TIME_STAGE_BG,
|
||||
/* 124 (0x07C) */ OBJ_WARP_HOLE,
|
||||
/* 125 (0x07D) */ OBJ_GEAR,
|
||||
/* 126 (0x07E) */ OBJ_DESERT,
|
||||
/* 127 (0x07F) */ OBJ_D300,
|
||||
/* 128 (0x080) */ OBJ_SEA_F301,
|
||||
/* 129 (0x081) */ OBJ_DESERT_AGO,
|
||||
/* 130 (0x082) */ OBJ_DESERT_METER,
|
||||
/* 131 (0x083) */ OBJ_NEEDLE_DESERT,
|
||||
/* 132 (0x084) */ OBJ_LOTUS,
|
||||
/* 133 (0x085) */ OBJ_TARZAN_POLE,
|
||||
/* 134 (0x086) */ OBJ_STEP_TIME_SLIP,
|
||||
/* 135 (0x087) */ OBJ_TIME_BASE,
|
||||
/* 136 (0x088) */ OBJ_SWITCH_SHUTTER,
|
||||
/* 137 (0x089) */ OBJ_WATERFALL_D101,
|
||||
/* 138 (0x08A) */ OBJ_ROLL_PILLAR,
|
||||
/* 139 (0x08B) */ OBJ_CHEST,
|
||||
/* 140 (0x08C) */ OBJ_ROCK_BOAT,
|
||||
/* 141 (0x08D) */ OBJ_BLOCK_UNDERGROUND,
|
||||
/* 142 (0x08E) */ OBJ_UNDERGROUND,
|
||||
/* 143 (0x08F) */ OBJ_TROLLEY,
|
||||
/* 144 (0x090) */ OBJ_LAVA_PLATE,
|
||||
/* 145 (0x091) */ OBJ_SAND_FLOOR,
|
||||
/* 146 (0x092) */ OBJ_SW_SYAKO,
|
||||
/* 147 (0x093) */ OBJ_SYAKO_SHUTTER,
|
||||
/* 148 (0x094) */ OBJ_DUNGEON_SHIP,
|
||||
/* 149 (0x095) */ OBJ_NEEDLE_UNDERGROUND,
|
||||
/* 150 (0x096) */ OBJ_STEP_STATUE,
|
||||
/* 151 (0x097) */ OBJ_GRAVE,
|
||||
/* 152 (0x098) */ OBJ_SHED,
|
||||
/* 153 (0x099) */ OBJ_GIRAHIMU_FLOOR,
|
||||
/* 154 (0x09A) */ OBJ_TENIJIMA,
|
||||
/* 155 (0x09B) */ OBJ_SAND_D301,
|
||||
/* 156 (0x09C) */ OBJ_DOOR_BOSSD101,
|
||||
/* 157 (0x09D) */ OBJ_BOXCAGE_F300,
|
||||
/* 158 (0x09E) */ OBJ_TOWER_HAND_D101,
|
||||
/* 159 (0x09F) */ OBJ_DORMITORY_GATE,
|
||||
/* 160 (0x0A0) */ OBJ_PISTON,
|
||||
/* 161 (0x0A1) */ OBJ_FRUIT_TREE,
|
||||
/* 162 (0x0A2) */ OBJ_FARMLAND,
|
||||
/* 163 (0x0A3) */ OBJ_PROPELLER_LIFT,
|
||||
/* 164 (0x0A4) */ OBJ_D3_DUMMY,
|
||||
/* 165 (0x0A5) */ B_BIGBOSS_BASE,
|
||||
/* 166 (0x0A6) */ B_BIGBOSS,
|
||||
/* 167 (0x0A7) */ B_BIGBOSS2,
|
||||
/* 168 (0x0A8) */ B_BIGBOSS3,
|
||||
/* 169 (0x0A9) */ B_VD,
|
||||
/* 170 (0x0AA) */ OBJ_VDB,
|
||||
/* 171 (0x0AB) */ E_CAPTAIN,
|
||||
/* 172 (0x0AC) */ OBJ_TRUCK_RAIL_COL,
|
||||
/* 173 (0x0AD) */ BIRD,
|
||||
/* 174 (0x0AE) */ BIRD_TARGET,
|
||||
/* 175 (0x0AF) */ BIRD_NPC,
|
||||
/* 176 (0x0B0) */ BIRD_KOBUNA,
|
||||
/* 177 (0x0B1) */ BIRD_KOBUNB,
|
||||
/* 178 (0x0B2) */ BIRD_RIVAL,
|
||||
/* 179 (0x0B3) */ BIRD_ZELDA_TRAINING,
|
||||
/* 180 (0x0B4) */ AVATER_RACE_MNG,
|
||||
/* 181 (0x0B5) */ AVATER_BULLET,
|
||||
/* 182 (0x0B6) */ NUSI_BASE,
|
||||
/* 183 (0x0B7) */ NUSI_NPC,
|
||||
/* 184 (0x0B8) */ B_NUSI,
|
||||
/* 185 (0x0B9) */ B_NUSI_TENTAKLE,
|
||||
/* 186 (0x0BA) */ B_NUSI_BULLET,
|
||||
/* 187 (0x0BB) */ OBJ_LIGHT_LINE,
|
||||
/* 188 (0x0BC) */ OBJ_LIGHT_SHAFT_SMALL,
|
||||
/* 189 (0x0BD) */ TAG_LIGHT_SHAFT_EFF,
|
||||
/* 190 (0x0BE) */ MEGAMI_DIVING_TAG,
|
||||
/* 191 (0x0BF) */ COMMON_BULLET,
|
||||
/* 192 (0x0C0) */ E_SYAKOMAITO,
|
||||
/* 193 (0x0C1) */ E_MR,
|
||||
/* 194 (0x0C2) */ E_PH,
|
||||
/* 195 (0x0C3) */ B_KR,
|
||||
/* 196 (0x0C4) */ B_KRH,
|
||||
/* 197 (0x0C5) */ B_KRA,
|
||||
/* 198 (0x0C6) */ OBJ_FLYING_CLAWSHOT_TARGET,
|
||||
/* 199 (0x0C7) */ OBJ_DIS_SHIP,
|
||||
/* 200 (0x0C8) */ PLAYER,
|
||||
/* 201 (0x0C9) */ TAG_SHUTTER_FENCE_PERMISSION,
|
||||
/* 202 (0x0CA) */ SHUTTER,
|
||||
/* 203 (0x0CB) */ OBJ_SHUTTER_CHANGE_SCENE,
|
||||
/* 204 (0x0CC) */ OBJ_DOOR_BOSS,
|
||||
/* 205 (0x0CD) */ OBJ_DOOR,
|
||||
/* 206 (0x0CE) */ OBJ_FENCE,
|
||||
/* 207 (0x0CF) */ TAG_SHUTTER_FENCE_FORBIDDANCE,
|
||||
/* 208 (0x0D0) */ OBJ_TROLLEY_SHUTTER,
|
||||
/* 209 (0x0D1) */ OBJ_TR_SHUTTER_CS,
|
||||
/* 210 (0x0D2) */ OBJ_BG,
|
||||
/* 211 (0x0D3) */ BOOMERANG,
|
||||
/* 212 (0x0D4) */ GENKI_MGR_TAG,
|
||||
/* 213 (0x0D5) */ TAG_MIECHAN,
|
||||
/* 214 (0x0D6) */ DEMO_NPC_BIRD,
|
||||
/* 215 (0x0D7) */ NPC_RVL,
|
||||
/* 216 (0x0D8) */ NPC_RIVAL_LOD,
|
||||
/* 217 (0x0D9) */ NPC_KBN,
|
||||
/* 218 (0x0DA) */ NPC_KBN2,
|
||||
/* 219 (0x0DB) */ NPC_KOBUN_B_NIGHT,
|
||||
/* 220 (0x0DC) */ NPC_SKN,
|
||||
/* 221 (0x0DD) */ NPC_SKN2,
|
||||
/* 222 (0x0DE) */ NPC_GZL,
|
||||
/* 223 (0x0DF) */ NPC_ZLD,
|
||||
/* 224 (0x0E0) */ NPC_DSK,
|
||||
/* 225 (0x0E1) */ NPC_DRB,
|
||||
/* 226 (0x0E2) */ NPC_DRBC,
|
||||
/* 227 (0x0E3) */ NPC_CE_FRIEND,
|
||||
/* 228 (0x0E4) */ NPC_CE_LADY,
|
||||
/* 229 (0x0E5) */ NPC_TOILET_GHOST,
|
||||
/* 230 (0x0E6) */ NPC_SORAJIMA_FATHER,
|
||||
/* 231 (0x0E7) */ NPC_SORAJIMA_MOTHER,
|
||||
/* 232 (0x0E8) */ NPC_SORAJIMA_GIRL,
|
||||
/* 233 (0x0E9) */ NPC_KYUI_WIZARD,
|
||||
/* 234 (0x0EA) */ NPC_KYUI_FIRST,
|
||||
/* 235 (0x0EB) */ NPC_ORD_KYUI,
|
||||
/* 236 (0x0EC) */ NPC_KYUI_ELDER,
|
||||
/* 237 (0x0ED) */ NPC_KYUI_THIRD,
|
||||
/* 238 (0x0EE) */ NPC_KYUI4,
|
||||
/* 239 (0x0EF) */ NPC_TMN,
|
||||
/* 240 (0x0F0) */ NPC_SALESMAN_S,
|
||||
/* 241 (0x0F1) */ NPC_DOUGUYA_NIGHT,
|
||||
/* 242 (0x0F2) */ NPC_MED_WIFE_NIGHT,
|
||||
/* 243 (0x0F3) */ NPC_MED_HUS_NIGHT,
|
||||
/* 244 (0x0F4) */ NPC_JUNK_NIGHT,
|
||||
/* 245 (0x0F5) */ NPC_AZUKARIYA_NIGHT,
|
||||
/* 246 (0x0F6) */ NPC_DOUGUYA_MOTHER,
|
||||
/* 247 (0x0F7) */ NPC_DOUGUYA_MOTHER_LOD,
|
||||
/* 248 (0x0F8) */ NPC_JUNK_MOTHER,
|
||||
/* 249 (0x0F9) */ NPC_JUNK_MOTHER_LOD,
|
||||
/* 250 (0x0FA) */ NPC_SENPAIA_MOTHER,
|
||||
/* 251 (0x0FB) */ NPC_SENPAIA_MOTHER_LOD,
|
||||
/* 252 (0x0FC) */ NPC_SORAJIMA_MAN_E,
|
||||
/* 253 (0x0FD) */ NPC_SORAJIMA_MAN_D,
|
||||
/* 254 (0x0FE) */ NPC_AZUKARIYA_FATHER,
|
||||
/* 255 (0x0FF) */ NPC_DAISHINKAN_N,
|
||||
/* 256 (0x100) */ NPC_SORAJIMA_MALE,
|
||||
/* 257 (0x101) */ NPC_BDSW,
|
||||
/* 258 (0x102) */ NPC_SORAJIMA_FEMALE,
|
||||
/* 259 (0x103) */ NPC_KENSEI,
|
||||
/* 260 (0x104) */ NPC_TALK_KENSEI,
|
||||
/* 261 (0x105) */ NPC_BDZ,
|
||||
/* 262 (0x106) */ NPC_OIM,
|
||||
/* 263 (0x107) */ NPC_YIM,
|
||||
/* 264 (0x108) */ NPC_BGR,
|
||||
/* 265 (0x109) */ NPC_SLTK,
|
||||
/* 266 (0x10A) */ NPC_SLB2,
|
||||
/* 267 (0x10B) */ NPC_SMA3,
|
||||
/* 268 (0x10C) */ NPC_SMA2,
|
||||
/* 269 (0x10D) */ NPC_PMA,
|
||||
/* 270 (0x10E) */ NPC_PDU,
|
||||
/* 271 (0x10F) */ NPC_ICGK,
|
||||
/* 272 (0x110) */ NPC_PCS,
|
||||
/* 273 (0x111) */ NPC_FDR,
|
||||
/* 274 (0x112) */ NPC_TDR,
|
||||
/* 275 (0x113) */ NPC_TDS,
|
||||
/* 276 (0x114) */ NPC_TDRB,
|
||||
/* 277 (0x115) */ TAG_SWORD_BATTLE_GAME,
|
||||
/* 278 (0x116) */ TAG_SIREN_TIME_ATTACK,
|
||||
/* 279 (0x117) */ NPC_ADR,
|
||||
/* 280 (0x118) */ NPC_GHM,
|
||||
/* 281 (0x119) */ NPC_SHA,
|
||||
/* 282 (0x11A) */ NPC_GRA,
|
||||
/* 283 (0x11B) */ NPC_GRC,
|
||||
/* 284 (0x11C) */ NPC_GRD,
|
||||
/* 285 (0x11D) */ NPC_SORAJIMA_BOY,
|
||||
/* 286 (0x11E) */ NPC_AKUMAKUN,
|
||||
/* 287 (0x11F) */ NPC_AKU_HUMAN,
|
||||
/* 288 (0x120) */ NPC_SUISEI,
|
||||
/* 289 (0x121) */ NPC_SUISEI_SUB,
|
||||
/* 290 (0x122) */ NPC_SUISEI_NORMAL,
|
||||
/* 291 (0x123) */ MOLE_MGR_TAG,
|
||||
/* 292 (0x124) */ NPC_MOLE_MG,
|
||||
/* 293 (0x125) */ NPC_MOLE,
|
||||
/* 294 (0x126) */ NPC_MOLE_NORMAL,
|
||||
/* 295 (0x127) */ NPC_MOLE_NORMAL2,
|
||||
/* 296 (0x128) */ NPC_MOLE_ES_NML,
|
||||
/* 297 (0x129) */ NPC_MOLE_TACKLE,
|
||||
/* 298 (0x12A) */ NPC_MOLE_TACKLE2,
|
||||
/* 299 (0x12B) */ NPC_CHEF,
|
||||
/* 300 (0x12C) */ NPC_SLFB,
|
||||
/* 301 (0x12D) */ NPC_SLRP,
|
||||
/* 302 (0x12E) */ NPC_SLFL,
|
||||
/* 303 (0x12F) */ NPC_TERRY,
|
||||
/* 304 (0x130) */ NPC_DIVE_GAME_JUDGE,
|
||||
/* 305 (0x131) */ KNIGHT_LEADER_BIRD,
|
||||
/* 306 (0x132) */ NPC_KNIGHT_LEADER,
|
||||
/* 307 (0x133) */ NPC_SENPAI,
|
||||
/* 308 (0x134) */ NPC_SENPAI_B,
|
||||
/* 309 (0x135) */ NPC_REGRET_RIVAL,
|
||||
/* 310 (0x136) */ NPC_RESCUE,
|
||||
/* 311 (0x137) */ NPC_SLB,
|
||||
/* 312 (0x138) */ FLY_SLB,
|
||||
/* 313 (0x139) */ OBJ_PROPERA,
|
||||
/* 314 (0x13A) */ OBJ_ROULETTE,
|
||||
/* 315 (0x13B) */ NPC_MOLE_ELDER,
|
||||
/* 316 (0x13C) */ NPC_SALBAGE_MORRY,
|
||||
/* 317 (0x13D) */ NPC_MOLE_SAL,
|
||||
/* 318 (0x13E) */ OBJ_POT_SAL,
|
||||
/* 319 (0x13F) */ OBJ_MOLE_SOIL,
|
||||
/* 320 (0x140) */ LITTLE_BIRD_MGR,
|
||||
/* 321 (0x141) */ LITTLE_BIRD,
|
||||
/* 322 (0x142) */ FISH_MGR,
|
||||
/* 323 (0x143) */ FISH,
|
||||
/* 324 (0x144) */ EEL,
|
||||
/* 325 (0x145) */ JSTUDIO_SYSOBJ,
|
||||
/* 326 (0x146) */ JSTUDIO_ACTOR,
|
||||
/* 327 (0x147) */ B_BBSHWV,
|
||||
/* 328 (0x148) */ NPC_BBRVL,
|
||||
/* 329 (0x149) */ OBJ_BIGBOMB_FLOWER,
|
||||
/* 330 (0x14A) */ OBJ_BBLARGEBOMB,
|
||||
/* 331 (0x14B) */ OBJ_BSTN,
|
||||
/* 332 (0x14C) */ B_MG,
|
||||
/* 333 (0x14D) */ B_LASTBOSS,
|
||||
/* 334 (0x14E) */ J_TEST,
|
||||
/* 335 (0x14F) */ E_AM,
|
||||
/* 336 (0x150) */ T_QUAKE,
|
||||
/* 337 (0x151) */ T_KUMITE,
|
||||
/* 338 (0x152) */ GROUP_TEST,
|
||||
/* 339 (0x153) */ GROUP_SUMMON,
|
||||
/* 340 (0x154) */ T_BCAL,
|
||||
/* 341 (0x155) */ E_SM,
|
||||
/* 342 (0x156) */ E_BEAMOS,
|
||||
/* 343 (0x157) */ GEKO_TAG,
|
||||
/* 344 (0x158) */ E_GEKO,
|
||||
/* 345 (0x159) */ E_SIREN,
|
||||
/* 346 (0x15A) */ E_PO,
|
||||
/* 347 (0x15B) */ OBJ_RING,
|
||||
/* 348 (0x15C) */ E_OR,
|
||||
/* 349 (0x15D) */ E_OR_CANNON,
|
||||
/* 350 (0x15E) */ OR_CANN_BULLET,
|
||||
/* 351 (0x15F) */ E_EYE,
|
||||
/* 352 (0x160) */ OBJ_HOLE,
|
||||
/* 353 (0x161) */ OBJ_INTO_HOLE,
|
||||
/* 354 (0x162) */ E_SPARK,
|
||||
/* 355 (0x163) */ E_MAGMA,
|
||||
/* 356 (0x164) */ E_MAGUPPO,
|
||||
/* 357 (0x165) */ MAGUPPO_BULLET,
|
||||
/* 358 (0x166) */ E_BS,
|
||||
/* 359 (0x167) */ E_SF,
|
||||
/* 360 (0x168) */ E_SF4,
|
||||
/* 361 (0x169) */ E_ST,
|
||||
/* 362 (0x16A) */ E_ST_WIRE,
|
||||
/* 363 (0x16B) */ ENEMY_CONTROL,
|
||||
/* 364 (0x16C) */ KIESU_TAG,
|
||||
/* 365 (0x16D) */ E_KS,
|
||||
/* 366 (0x16E) */ E_HB,
|
||||
/* 367 (0x16F) */ E_HB_LEAF,
|
||||
/* 368 (0x170) */ E_REMLY,
|
||||
/* 369 (0x171) */ E_LIZARUFOS,
|
||||
/* 370 (0x172) */ E_LIZA_TAIL,
|
||||
/* 371 (0x173) */ E_HIDOKARI,
|
||||
/* 372 (0x174) */ E_HIDOKARIS,
|
||||
/* 373 (0x175) */ E_HYDRA,
|
||||
/* 374 (0x176) */ E_GUNHO,
|
||||
/* 375 (0x177) */ E_GUNHOB,
|
||||
/* 376 (0x178) */ E_BFISH,
|
||||
/* 377 (0x179) */ E_CACTUS,
|
||||
/* 378 (0x17A) */ E_HOC,
|
||||
/* 379 (0x17B) */ E_OC,
|
||||
/* 380 (0x17C) */ E_KGIRA,
|
||||
/* 381 (0x17D) */ OBJ_PIPE,
|
||||
/* 382 (0x17E) */ E_BC,
|
||||
/* 383 (0x17F) */ E_BCE,
|
||||
/* 384 (0x180) */ E_BCAL,
|
||||
/* 385 (0x181) */ E_BCARROW,
|
||||
/* 386 (0x182) */ E_BCALARROW,
|
||||
/* 387 (0x183) */ BCZ_TAG,
|
||||
/* 388 (0x184) */ E_BCZ,
|
||||
/* 389 (0x185) */ E_SKYTAIL,
|
||||
/* 390 (0x186) */ E_HP,
|
||||
/* 391 (0x187) */ E_CHB,
|
||||
/* 392 (0x188) */ E_GUE,
|
||||
/* 393 (0x189) */ GUE_BULLET,
|
||||
/* 394 (0x18A) */ E_GE,
|
||||
/* 395 (0x18B) */ E_RUPEE_GUE,
|
||||
/* 396 (0x18C) */ E_GEROCK,
|
||||
/* 397 (0x18D) */ E_TN2,
|
||||
/* 398 (0x18E) */ E_HIDORY,
|
||||
/* 399 (0x18F) */ HIDORY_FIRE,
|
||||
/* 400 (0x190) */ E_WS,
|
||||
/* 401 (0x191) */ NPC_BIRD,
|
||||
/* 402 (0x192) */ B_GIRAHIMU_BASE,
|
||||
/* 403 (0x193) */ B_GIRAHIMU,
|
||||
/* 404 (0x194) */ B_GIRAHIMU2,
|
||||
/* 405 (0x195) */ B_GIRAHIMU3_BASE,
|
||||
/* 406 (0x196) */ B_GIRAHIMU3_FIRST,
|
||||
/* 407 (0x197) */ B_GIRAHIMU3_SECOND,
|
||||
/* 408 (0x198) */ B_GIRAHIMU3_THIRD,
|
||||
/* 409 (0x199) */ OBJ_GH_SW_L,
|
||||
/* 410 (0x19A) */ OBJ_GH_KNIFE,
|
||||
/* 411 (0x19B) */ OBJ_BIRD_SP_UP,
|
||||
/* 412 (0x19C) */ GH_SWORD_BEAM,
|
||||
/* 413 (0x19D) */ B_ASURA,
|
||||
/* 414 (0x19E) */ ASURA_ARM,
|
||||
/* 415 (0x19F) */ ASURA_FOOT,
|
||||
/* 416 (0x1A0) */ ASURA_BULLET,
|
||||
/* 417 (0x1A1) */ ASURA_SWORD,
|
||||
/* 418 (0x1A2) */ ASURA_PILLAR,
|
||||
/* 419 (0x1A3) */ INVISIBLE,
|
||||
/* 420 (0x1A4) */ E_MR_SHIELD,
|
||||
/* 421 (0x1A5) */ E_KG,
|
||||
/* 422 (0x1A6) */ NPC_HONEYCOMB,
|
||||
/* 423 (0x1A7) */ NPC_BEE,
|
||||
/* 424 (0x1A8) */ HEART_FLOWER,
|
||||
/* 425 (0x1A9) */ BOMBF,
|
||||
/* 426 (0x1AA) */ BOMB,
|
||||
/* 427 (0x1AB) */ OBJ_CARRY_STONE,
|
||||
/* 428 (0x1AC) */ OBJ_ROLL_ROCK,
|
||||
/* 429 (0x1AD) */ COL_STP,
|
||||
/* 430 (0x1AE) */ KANBAN,
|
||||
/* 431 (0x1AF) */ OBJ_BAMBOO,
|
||||
/* 432 (0x1B0) */ OBJ_SWHIT,
|
||||
/* 433 (0x1B1) */ OBJ_SW_SWORD_BEAM,
|
||||
/* 434 (0x1B2) */ OBJ_SW_HARP,
|
||||
/* 435 (0x1B3) */ OBJ_SIREN_BARRIER,
|
||||
/* 436 (0x1B4) */ OBJ_TOGE_TRAP,
|
||||
/* 437 (0x1B5) */ PUMPKIN,
|
||||
/* 438 (0x1B6) */ OBJ_PUMPKIN_LEAF,
|
||||
/* 439 (0x1B7) */ OBJ_WATER_NUT_LEAF,
|
||||
/* 440 (0x1B8) */ OBJ_WATER_NUT,
|
||||
/* 441 (0x1B9) */ OBJ_TABLEWARE,
|
||||
/* 442 (0x1BA) */ OBJ_SW_WHIPLEVER,
|
||||
/* 443 (0x1BB) */ OBJ_MUSHROOM,
|
||||
/* 444 (0x1BC) */ WOODAREA_TAG,
|
||||
/* 445 (0x1BD) */ OBJ_FRUIT,
|
||||
/* 446 (0x1BE) */ OBJ_SKULL,
|
||||
/* 447 (0x1BF) */ SOUND_TAG,
|
||||
/* 448 (0x1C0) */ OBJ_ROCK_DRAGON,
|
||||
/* 449 (0x1C1) */ TAG_INSECT,
|
||||
/* 450 (0x1C2) */ INSECT_LADYBUG,
|
||||
/* 451 (0x1C3) */ INSECT_DRAGONFLY,
|
||||
/* 452 (0x1C4) */ INSECT_BEETLE,
|
||||
/* 453 (0x1C5) */ INSECT_GRASSHOPPER,
|
||||
/* 454 (0x1C6) */ INSECT_CICADA,
|
||||
/* 455 (0x1C7) */ INSECT_ANT,
|
||||
/* 456 (0x1C8) */ INSECT_BUTTERFLY,
|
||||
/* 457 (0x1C9) */ INSECT_SCARAB,
|
||||
/* 458 (0x1CA) */ INSECT_FIREFLY,
|
||||
/* 459 (0x1CB) */ OBJ_SAIL,
|
||||
/* 460 (0x1CC) */ OBJ_LOTUS_FLOWER,
|
||||
/* 461 (0x1CD) */ OBJ_LOTUS_SEED,
|
||||
/* 462 (0x1CE) */ OBJ_SHUTTER_LOCK,
|
||||
/* 463 (0x1CF) */ OBJ_LAMP,
|
||||
/* 464 (0x1D0) */ TAG_ROCK_BOAT,
|
||||
/* 465 (0x1D1) */ OBJ_TOWER_GEAR_D101,
|
||||
/* 466 (0x1D2) */ OBJ_SHUTTER_WATER_D101,
|
||||
/* 467 (0x1D3) */ OBJ_ANCIENT_JEWELS,
|
||||
/* 468 (0x1D4) */ OBJ_MG_PUMPKIN,
|
||||
/* 469 (0x1D5) */ OBJ_FLAG,
|
||||
/* 470 (0x1D6) */ OBJ_CHANDELIER,
|
||||
/* 471 (0x1D7) */ TAG_PUMPKIN_CLAY,
|
||||
/* 472 (0x1D8) */ TAG_REACTION,
|
||||
/* 473 (0x1D9) */ OBJ_SPORE,
|
||||
/* 474 (0x1DA) */ OBJ_FRUIT_B,
|
||||
/* 475 (0x1DB) */ OBJ_DIVINER_CRYSTAL,
|
||||
/* 476 (0x1DC) */ TAG_NOEFFECT_AREA,
|
||||
/* 477 (0x1DD) */ TAG_D3_SCENE_CHANGE,
|
||||
/* 478 (0x1DE) */ OBJ_DECOA,
|
||||
/* 479 (0x1DF) */ OBJ_DECOB,
|
||||
/* 480 (0x1E0) */ OBJ_SANDBAG,
|
||||
/* 481 (0x1E1) */ OBJ_PAINT,
|
||||
/* 482 (0x1E2) */ OBJ_CONTROL_PANEL,
|
||||
/* 483 (0x1E3) */ OBJ_UG_SWITCH,
|
||||
/* 484 (0x1E4) */ OBJ_CLEARNESS_WALL,
|
||||
/* 485 (0x1E5) */ OBJ_RUINED_SAVE,
|
||||
/* 486 (0x1E6) */ OBJ_TRIFORCE,
|
||||
/* 487 (0x1E7) */ OBJ_KANBAN_STONE,
|
||||
/* 488 (0x1E8) */ TBOX,
|
||||
/* 489 (0x1E9) */ OBJ_BUBBLE,
|
||||
/* 490 (0x1EA) */ OBJ_VSD,
|
||||
/* 491 (0x1EB) */ OBJ_SOIL,
|
||||
/* 492 (0x1EC) */ OBJ_IVY_ROPE,
|
||||
/* 493 (0x1ED) */ OBJ_GRASS_COIL,
|
||||
/* 494 (0x1EE) */ OBJ_ROPE_IGAIGA,
|
||||
/* 495 (0x1EF) */ OBJ_FIRE,
|
||||
/* 496 (0x1F0) */ OBJ_TUBO,
|
||||
/* 497 (0x1F1) */ OBJ_TUBO_BIG,
|
||||
/* 498 (0x1F2) */ OBJ_CHAIR,
|
||||
/* 499 (0x1F3) */ TIME_AREA,
|
||||
/* 500 (0x1F4) */ OBJ_BLAST_ROCK,
|
||||
/* 501 (0x1F5) */ OBJ_SW_DIR,
|
||||
/* 502 (0x1F6) */ OBJ_SW_DIR_DOOR,
|
||||
/* 503 (0x1F7) */ OBJ_SW_BANK,
|
||||
/* 504 (0x1F8) */ OBJ_SW_BANK_SMALL,
|
||||
/* 505 (0x1F9) */ T_FAIRY,
|
||||
/* 506 (0x1FA) */ OBJ_FAIRY,
|
||||
/* 507 (0x1FB) */ BIRD_MOB,
|
||||
/* 508 (0x1FC) */ OBJ_BALLISTA_HANDLE,
|
||||
/* 509 (0x1FD) */ OBJ_TIME_BOAT_BULLET,
|
||||
/* 510 (0x1FE) */ OBJ_TIME_DOOR,
|
||||
/* 511 (0x1FF) */ OBJ_TIME_DOOR_BEFORE,
|
||||
/* 512 (0x200) */ TAG_TIME_DOOR_BEAM,
|
||||
/* 513 (0x201) */ OBJ_COL,
|
||||
/* 514 (0x202) */ OBJ_DAYNIGHT,
|
||||
/* 515 (0x203) */ OBJ_BUILDING,
|
||||
/* 516 (0x204) */ OBJ_OCT_GRASS,
|
||||
/* 517 (0x205) */ OBJ_OCT_GRASS_LEAF,
|
||||
/* 518 (0x206) */ OBJ_TUMBLE_WEED,
|
||||
/* 519 (0x207) */ TUMBLE_WEED_TAG,
|
||||
/* 520 (0x208) */ OBJ_FLOWER_ANCIENT,
|
||||
/* 521 (0x209) */ OBJ_BARREL,
|
||||
/* 522 (0x20A) */ OBJ_WARP,
|
||||
/* 523 (0x20B) */ OBJ_WATER_MARK,
|
||||
/* 524 (0x20C) */ OBJ_WATER_JAR,
|
||||
/* 525 (0x20D) */ OBJ_STOPPING_ROPE,
|
||||
/* 526 (0x20E) */ OBJ_TRAP_BIRD_WOOD,
|
||||
/* 527 (0x20F) */ OBJ_TACKLE,
|
||||
/* 528 (0x210) */ TACKLE_TAG,
|
||||
/* 529 (0x211) */ OBJ_VORTEX,
|
||||
/* 530 (0x212) */ OBJ_TOWER_BOMB,
|
||||
/* 531 (0x213) */ OBJ_SEAT_SWORD,
|
||||
/* 532 (0x214) */ OBJ_POLE_STONY,
|
||||
/* 533 (0x215) */ OBJ_SWORD_CANDLE,
|
||||
/* 534 (0x216) */ OBJ_SAVE,
|
||||
/* 535 (0x217) */ OBJ_POOL_COCK,
|
||||
/* 536 (0x218) */ OBJ_FIREWALL,
|
||||
/* 537 (0x219) */ HARP_TAG,
|
||||
/* 538 (0x21A) */ OBJ_SWORD_STAB,
|
||||
/* 539 (0x21B) */ OBJ_GODDESS_CUBE,
|
||||
/* 540 (0x21C) */ OBJ_TIME_BLOCK,
|
||||
/* 541 (0x21D) */ OBJ_MOVE_ELEC,
|
||||
/* 542 (0x21E) */ OBJ_LAVA_D201,
|
||||
/* 543 (0x21F) */ OBJ_HARP_HINT,
|
||||
/* 544 (0x220) */ OBJ_F302_LIGHT,
|
||||
/* 545 (0x221) */ OBJ_TOD3_STONE,
|
||||
/* 546 (0x222) */ OBJ_B300_SAND,
|
||||
/* 547 (0x223) */ T_DOWSING,
|
||||
/* 548 (0x224) */ T_MAP_MARK,
|
||||
/* 549 (0x225) */ BEETLE_TAG,
|
||||
/* 550 (0x226) */ EFFECT_GEN_TAG,
|
||||
/* 551 (0x227) */ TAG_TIME_AREA_CHECK,
|
||||
/* 552 (0x228) */ TAG_RESTART_TIME_STONE,
|
||||
/* 553 (0x229) */ SHOP_SAMPLE,
|
||||
/* 554 (0x22A) */ OBJ_TERRY_GIMMICK,
|
||||
/* 555 (0x22B) */ OBJ_TERRY_SWITCH,
|
||||
/* 556 (0x22C) */ OBJ_TERRY_HOLE,
|
||||
/* 557 (0x22D) */ OBJ_TERRY_BIKE,
|
||||
/* 558 (0x22E) */ OBJ_JUNK_REPAIR,
|
||||
/* 559 (0x22F) */ CO_TEST,
|
||||
/* 560 (0x230) */ OBJ_ARROW_SWITCH,
|
||||
/* 561 (0x231) */ OBJ_VENT_FAN,
|
||||
/* 562 (0x232) */ OBJ_ELECTRIC_LIGHT,
|
||||
/* 563 (0x233) */ OBJ_WATER_SWITCH,
|
||||
/* 564 (0x234) */ OBJ_ROTATION_LIGHT,
|
||||
/* 565 (0x235) */ OBJ_HOLE_MINIGAME,
|
||||
/* 566 (0x236) */ OBJ_CLOUD_DIVE,
|
||||
/* 567 (0x237) */ OBJ_MUSASABI,
|
||||
/* 568 (0x238) */ OBJ_FORTUNE_RING,
|
||||
/* 569 (0x239) */ OBJ_BLOW_COAL,
|
||||
/* 570 (0x23A) */ OBJ_SPIKE,
|
||||
/* 571 (0x23B) */ OBJ_WATER_SPOUT,
|
||||
/* 572 (0x23C) */ OBJ_SMOKE,
|
||||
/* 573 (0x23D) */ OBJ_LIGHTHOUSE_LIGHT,
|
||||
/* 574 (0x23E) */ OBJ_WATER_IGAIGA,
|
||||
/* 575 (0x23F) */ OBJ_BLADE,
|
||||
/* 576 (0x240) */ OBJ_FIRE_OBSTACLE,
|
||||
/* 577 (0x241) */ OBJ_FIRE_PILLAR,
|
||||
/* 578 (0x242) */ OBJ_GUARD_LOG,
|
||||
/* 579 (0x243) */ OBJ_SLICE_LOG,
|
||||
/* 580 (0x244) */ OBJ_SLICE_LOG_PARTS,
|
||||
/* 581 (0x245) */ OBJ_STAGE_DEBRIS,
|
||||
/* 582 (0x246) */ OBJ_GROUND_COVER,
|
||||
/* 583 (0x247) */ OBJ_CUMUL_CLOUD,
|
||||
/* 584 (0x248) */ OBJ_UNDER_CLOUD,
|
||||
/* 585 (0x249) */ OBJ_WATERFALL_F102,
|
||||
/* 586 (0x24A) */ OBJ_GOD_MARK,
|
||||
/* 587 (0x24B) */ OBJ_IMPA_DOOR,
|
||||
/* 588 (0x24C) */ OBJ_WATERFALL_D100,
|
||||
/* 589 (0x24D) */ OBJ_GIRAHIM_FOOT,
|
||||
/* 590 (0x24E) */ OBJ_ISLAND_LOD,
|
||||
/* 591 (0x24F) */ OBJ_UTA_DEMO_PEDEST,
|
||||
/* 592 (0x250) */ OBJ_LAVA_F200,
|
||||
/* 593 (0x251) */ OBJ_ROPE_BASE,
|
||||
/* 594 (0x252) */ OBJ_SUN_LIGHT,
|
||||
/* 595 (0x253) */ OBJ_SIREN_2DMAP,
|
||||
/* 596 (0x254) */ OBJ_DISPLAY_ONLY_NBS,
|
||||
/* 597 (0x255) */ OBJ_AMBER,
|
||||
/* 598 (0x256) */ OBJ_BIRD_STATUE,
|
||||
/* 599 (0x257) */ OBJ_F400_GATE_LEAF,
|
||||
/* 600 (0x258) */ OBJ_F400_GATE_SEAL,
|
||||
/* 601 (0x259) */ OBJ_MAPPARTS,
|
||||
/* 602 (0x25A) */ OBJ_RO_AT_TARGET,
|
||||
/* 603 (0x25B) */ RO_AT_TAR_MANAGER_TAG,
|
||||
/* 604 (0x25C) */ TAG_MUSASABI,
|
||||
/* 605 (0x25D) */ TAG_MAP_INST,
|
||||
/* 606 (0x25E) */ TAG_AUTO_MESSAGE,
|
||||
/* 607 (0x25F) */ TAG_SHIP_SLOPE,
|
||||
/* 608 (0x260) */ TAG_SHIP_FLOOD,
|
||||
/* 609 (0x261) */ TAG_BARREL,
|
||||
/* 610 (0x262) */ TAG_BARREL_POS,
|
||||
/* 611 (0x263) */ TAG_HEAT_RESIST,
|
||||
/* 612 (0x264) */ TAG_HOLY_WATER,
|
||||
/* 613 (0x265) */ TAG_BELT_OBSTACLE,
|
||||
/* 614 (0x266) */ TAG_DRUM,
|
||||
/* 615 (0x267) */ TAG_ROLL_ATTACK_LOG,
|
||||
/* 616 (0x268) */ TAG_SHIP_WINDOW,
|
||||
/* 617 (0x269) */ ARROW,
|
||||
/* 618 (0x26A) */ MASS_OBJ_TAG,
|
||||
/* 619 (0x26B) */ SOUND_AREA_MGR,
|
||||
/* 620 (0x26C) */ TAG_SOUND_AREA,
|
||||
/* 621 (0x26D) */ ATT_TAG,
|
||||
/* 622 (0x26E) */ TLP_TAG,
|
||||
/* 623 (0x26F) */ SKYENEMY_T,
|
||||
/* 624 (0x270) */ TOUCH_TAG,
|
||||
/* 625 (0x271) */ CAMERA_TAG,
|
||||
/* 626 (0x272) */ CAMERA2_TAG,
|
||||
/* 627 (0x273) */ ACTION_TAG,
|
||||
/* 628 (0x274) */ SC_CHANGE_TAG,
|
||||
/* 629 (0x275) */ GATE2GND_TAG,
|
||||
/* 630 (0x276) */ ALLDIE_TAG,
|
||||
/* 631 (0x277) */ SW_TAG,
|
||||
/* 632 (0x278) */ PL_RESTART,
|
||||
/* 633 (0x279) */ SW_AREA_TAG,
|
||||
/* 634 (0x27A) */ SIREN_TAG,
|
||||
/* 635 (0x27B) */ TAG_TKEVNT,
|
||||
/* 636 (0x27C) */ MOLE_PROHIBIT_TAG,
|
||||
/* 637 (0x27D) */ TAG_DEFEAT_BOSS,
|
||||
/* 638 (0x27E) */ TAG_TIMER,
|
||||
/* 639 (0x27F) */ TAG_FENCE_SYNCHRONIZER,
|
||||
/* 640 (0x280) */ TAG_GENKI_DOWSING_TARGET,
|
||||
/* 641 (0x281) */ ITEM,
|
||||
/* 642 (0x282) */ OBJ_ITEM_HEART_CONTAINER,
|
||||
/* 643 (0x283) */ OBJ_CLEF,
|
||||
/* 644 (0x284) */ OBJ_FRUIT_GUTS_LEAF,
|
||||
/* 645 (0x285) */ OBJ_SWRD_PRJ,
|
||||
/* 646 (0x286) */ OBJ_VACU_DUST_PARTS,
|
||||
/* 647 (0x287) */ OBJ_VACU_DUST,
|
||||
/* 648 (0x288) */ OBJ_RAIL_POST,
|
||||
/* 649 (0x289) */ OBJ_RAIL_END,
|
||||
/* 650 (0x28A) */ OBJ_TENI_RAIL,
|
||||
/* 651 (0x28B) */ OBJ_TENI_RAIL_POST,
|
||||
/* 652 (0x28C) */ OBJ_FORCE_SIGN,
|
||||
/* 653 (0x28D) */ TAG_FORCE_GET_FLAG,
|
||||
/* 654 (0x28E) */ TAG_CLEF_MANAGER,
|
||||
/* 655 (0x28F) */ TAG_CLEF_GAME,
|
||||
/* 656 (0x290) */ TAG_MINIGAME_INSECT_CAPTURE,
|
||||
/* 657 (0x291) */ CAMERA,
|
||||
/* 658 (0x292) */ WEATHER_TAG,
|
||||
/* 659 (0x293) */ SPORE_TAG,
|
||||
/* 660 (0x294) */ MIST_TAG,
|
||||
/* 661 (0x295) */ SPARKS_TAG,
|
||||
/* 662 (0x296) */ SPARKS2_TAG,
|
||||
/* 663 (0x297) */ KYTAG_TAG,
|
||||
/* 664 (0x298) */ LBTHUNDER_TAG,
|
||||
/* 665 (0x299) */ PLTCHG_TAG,
|
||||
/* 666 (0x29A) */ PLIGHT_TAG,
|
||||
/* 667 (0x29B) */ VRBOX_TAG,
|
||||
/* 668 (0x29C) */ NPC_INV,
|
||||
/* 669 (0x29D) */ NPC_TKE,
|
||||
/* 670 (0x29E) */ NPC_STR,
|
||||
/* 671 (0x29F) */ MESSAGE_ACTOR,
|
||||
/* 672 (0x2A0) */ LIGHT_OBJECT,
|
||||
/* 673 (0x2A1) */ MESSAGE,
|
||||
/* 674 (0x2A2) */ LYT_CONTROL_GAME,
|
||||
/* 675 (0x2A3) */ LYT_DEMO_DOWSING,
|
||||
/* 676 (0x2A4) */ LYT_CONTROL_TITLE,
|
||||
/* 677 (0x2A5) */ LYT_DROP_LINE,
|
||||
/* 678 (0x2A6) */ LYT_FORCE_LINE,
|
||||
/* 679 (0x2A7) */ LYT_ENEMY_ICON,
|
||||
/* 680 (0x2A8) */ LYT_MINI_GAME,
|
||||
/* 681 (0x2A9) */ LYT_SUIRYU_SCORE,
|
||||
/* 682 (0x2AA) */ LYT_SUIRYU_SCORE_COMP,
|
||||
/* 683 (0x2AB) */ LYT_BOSS_CAPTION,
|
||||
/* 684 (0x2AC) */ LYT_PAUSE,
|
||||
/* 685 (0x2AD) */ LYT_GAMEOVER_MGR,
|
||||
/* 686 (0x2AE) */ LYT_SAVE_MGR,
|
||||
/* 687 (0x2AF) */ TITLE_MANAGER,
|
||||
/* 688 (0x2B0) */ LYT_TITLE_BG,
|
||||
/* 689 (0x2B1) */ LYT_SHOP,
|
||||
/* 690 (0x2B2) */ LYT_DEPOSIT,
|
||||
/* 691 (0x2B3) */ LYT_DEMO_TITLE,
|
||||
/* 692 (0x2B4) */ LYT_END_ROLL,
|
||||
/* 693 (0x2B5) */ LYT_SEEKER_STONE,
|
||||
/* 694 (0x2B6) */ LYT_FILESELECT,
|
||||
/* 695 (0x2B7) */ SKB,
|
||||
/* 696 (0x2B8) */ EVENT_TAG,
|
||||
/* 697 (0x2B9) */ EVENTF_TAG,
|
||||
/* 698 (0x2BA) */ C_GAME,
|
||||
/* 699 (0x2BB) */ C_BASE,
|
||||
/* 700 (0x2BC) */ BOOT,
|
||||
/* 701 (0x2BD) */ ROOM,
|
||||
/* 702 (0x2BE) */ LAST,
|
||||
/* 703 */ NUMBER_OF_ACTORS,
|
||||
INVALID,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_tree_mg.hpp
|
||||
|
||||
#include <types.h>
|
||||
#include <c/c_tree.h>
|
||||
#include <f/f_profile.h>
|
||||
|
||||
class fTrNdBa_c;
|
||||
|
||||
/// @brief A container for a tree of fTrNdBa_c nodes.
|
||||
class fTrMgBa_c : public cTreeMg_c {
|
||||
public:
|
||||
/**
|
||||
* @brief Finds a node with a given profile name, optionally under a given parent root node.
|
||||
*
|
||||
* @param profName The profile name.
|
||||
* @param parent The root node to start search below, or @p nullptr to use the tree's root node.
|
||||
* @return The found node, or @p nullptr if none was found.
|
||||
*/
|
||||
const fTrNdBa_c *searchNodeByProfName(ProfileName profName, const fTrNdBa_c *parent) const;
|
||||
/**
|
||||
* @brief Find a node with a given group type, optionally under a given parent root node.
|
||||
*
|
||||
* @param groupType The group type.
|
||||
* @param parent The root node to start search below, or @p nullptr to use the tree's root node.
|
||||
* @return The found node, or @p nullptr if none was found.
|
||||
*/
|
||||
const fTrNdBa_c *searchNodeByGroupType(u8 groupType, const fTrNdBa_c *parent) const;
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_tree_mg_ptmf.hpp
|
||||
|
||||
#include <types.h>
|
||||
#include <c/c_tree.h>
|
||||
#include <f/f_tree_mg.h>
|
||||
|
||||
class fBase_c;
|
||||
|
||||
/// @brief A container for a tree of fTrNdBa_c nodes with a reference to a process function.
|
||||
/// @note Unofficial name.
|
||||
class fTrMgPTMF_c : public fTrMgBa_c {
|
||||
public:
|
||||
/// @brief Constructs a new tree container.
|
||||
/// @param procFunc The process function.
|
||||
fTrMgPTMF_c(int (fBase_c::*procFunc)()) : mpProcFunc(procFunc) {}
|
||||
|
||||
/// @brief Calls the process function ::mpProcFunc on the owner of each node in the tree.
|
||||
/// @return If the operation was successful.
|
||||
bool walkPack();
|
||||
|
||||
private:
|
||||
int (fBase_c::*mpProcFunc)(); ///< The process function for the tree.
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_tree_nd.hpp
|
||||
|
||||
#include <types.h>
|
||||
#include <c/c_tree.h>
|
||||
#include <f/f_profile.h>
|
||||
|
||||
class fBase_c;
|
||||
|
||||
/// @brief A tree node with an owner reference.
|
||||
class fTrNdBa_c : public cTreeNd_c {
|
||||
public:
|
||||
/// @brief Constructs a new tree node.
|
||||
/// @param owner The node's owner.
|
||||
fTrNdBa_c(fBase_c *owner) : mpOwner(owner) {}
|
||||
|
||||
fTrNdBa_c *getTreeNext() const {
|
||||
return (fTrNdBa_c *) cTreeNd_c::getTreeNext();
|
||||
}
|
||||
|
||||
fTrNdBa_c *getTreeNextNotChild() const {
|
||||
return (fTrNdBa_c *) cTreeNd_c::getTreeNextNotChild();
|
||||
}
|
||||
|
||||
fTrNdBa_c *getParent() const {
|
||||
return (fTrNdBa_c *) cTreeNd_c::getParent();
|
||||
}
|
||||
|
||||
fTrNdBa_c *getChild() const {
|
||||
return (fTrNdBa_c *) cTreeNd_c::getChild();
|
||||
}
|
||||
|
||||
fTrNdBa_c *getBrPrev() const {
|
||||
return (fTrNdBa_c *) cTreeNd_c::getBrPrev();
|
||||
}
|
||||
|
||||
fTrNdBa_c *getBrNext() const {
|
||||
return (fTrNdBa_c *) cTreeNd_c::getBrNext();
|
||||
}
|
||||
|
||||
fBase_c *mpOwner; ///< The owner of this node.
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
// this file was ported from https://github.com/riidefi/mkw/blob/master/source/egg/core/eggAllocator.hpp
|
||||
|
||||
#include <lib/rvl/MEM.h>
|
||||
#include <lib/egg/core/eggHeap.h>
|
||||
|
||||
namespace EGG {
|
||||
class Heap;
|
||||
// Ghidra: Allocator
|
||||
// size: 0x1C
|
||||
// .text: [0x804952d0, 0x804953f0]
|
||||
// .data: [0x8056e8d0, 0x8056e8e8] # Allocator vtable
|
||||
// sdata2: [0x8057f2f0, 0x8057f2f8] # MEMAllocator func table
|
||||
class Allocator : public MEMAllocator {
|
||||
public:
|
||||
Allocator(Heap* heap, s32 align);
|
||||
// vtable at 0x10
|
||||
/* 0x08 */ virtual ~Allocator();
|
||||
/* 0x0C */ virtual void* alloc(u32 size);
|
||||
/* 0x10 */ virtual void free(void* block);
|
||||
|
||||
inline MEMAllocator* getHandle() { return static_cast<MEMAllocator*>(this); }
|
||||
private:
|
||||
/* 0x14 */ Heap* mHeap;
|
||||
/* 0x18 */ s32 align;
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
// This file was adapted from https://github.com/riidefi/mkw/blob/master/source/egg/core/eggDisposer.hpp
|
||||
|
||||
#include <lib/nw4r/ut/utList.h>
|
||||
#include <types.h>
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class Heap;
|
||||
|
||||
// Ghidra: EggBase
|
||||
// size: 0x8
|
||||
// .text: [0x80496830, 0x80496910]
|
||||
class Disposer : private NonCopyable {
|
||||
friend class Heap;
|
||||
protected:
|
||||
virtual ~Disposer();
|
||||
Disposer();
|
||||
public:
|
||||
enum eLifetime {
|
||||
LIFETIME_UNMANAGED,
|
||||
LIFETIME_HEAP_GC
|
||||
};
|
||||
inline eLifetime getLifetime() const {
|
||||
return mContainHeap != nullptr ? LIFETIME_HEAP_GC : LIFETIME_UNMANAGED;
|
||||
}
|
||||
|
||||
private:
|
||||
Heap* mContainHeap;
|
||||
nw4r::ut::Node mList;
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <lib/egg/core/eggHeap.h>
|
||||
|
||||
// [TODO: extend this]
|
||||
|
||||
namespace EGG {
|
||||
class FrmHeap : public Heap {
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
#pragma once
|
||||
|
||||
// This file is ported from https://github.com/riidefi/mkw/blob/master/source/egg/core/eggHeap.hpp
|
||||
|
||||
#include <types.h>
|
||||
#include <lib/rvl/MEM.h>
|
||||
#include <lib/rvl/OS.h>
|
||||
#include <lib/egg/core/eggAllocator.h>
|
||||
#include <lib/egg/core/eggDisposer.h>
|
||||
#include <lib/nw4r/ut/utList.h>
|
||||
#include <lib/egg/core/eggThread.h>
|
||||
|
||||
#ifndef HEAP_PRIVATE
|
||||
#define HEAP_PRIVATE protected
|
||||
#endif
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class ExpHeap;
|
||||
class Allocator;
|
||||
|
||||
struct HeapAllocArg {
|
||||
int userArg; // 00
|
||||
u32 size; // 04
|
||||
int align; // 08
|
||||
Heap* heap; // 0C heap to allocate in
|
||||
|
||||
inline HeapAllocArg() : userArg(0), size(0), align(0), heap(nullptr) {}
|
||||
};
|
||||
typedef void (*HeapAllocCallback)(HeapAllocArg& arg);
|
||||
|
||||
struct HeapErrorArg {
|
||||
const char* msg;
|
||||
void* userdata;
|
||||
|
||||
inline HeapErrorArg() {}
|
||||
};
|
||||
|
||||
typedef void (*ErrorCallback)(void*);
|
||||
|
||||
// Ghidra: Heap
|
||||
// size: 0x34
|
||||
// .text: [0x804953f0, 0x80495ab0]
|
||||
class Heap : public Disposer {
|
||||
public:
|
||||
enum eHeapKind {
|
||||
HEAP_KIND_NONE = 0,
|
||||
HEAP_KIND_EXPANDED,
|
||||
HEAP_KIND_FRAME,
|
||||
HEAP_KIND_UNIT,
|
||||
HEAP_KIND_ASSERT,
|
||||
};
|
||||
|
||||
inline bool isExpHeap() { return getHeapKind() == HEAP_KIND_EXPANDED; }
|
||||
// inline Heap* getParentHeap() { return mParentHeap; } // not part of ss
|
||||
inline void* getStartAddress() { return this; }
|
||||
|
||||
// vtable at 0x0
|
||||
/* 0x08 */ virtual ~Heap();
|
||||
/* 0x0C */ virtual eHeapKind getHeapKind() const = 0;
|
||||
/* 0x10 */ virtual void initAllocator(Allocator* allocator, s32 align) = 0;
|
||||
/* 0x14 */ virtual void* alloc(u32 size, s32 align) = 0;
|
||||
/* 0x18 */ virtual void free(void* block) = 0;
|
||||
/* 0x1C */ virtual void destroy() = 0;
|
||||
/* 0x20 */ virtual u32 resizeForMBlock(void* block, u32 size) = 0;
|
||||
/* 0x24 */ virtual u32 getAllocatableSize(s32 align) = 0;
|
||||
/* 0x28 */ virtual u32 adjust() = 0;
|
||||
|
||||
HEAP_PRIVATE :
|
||||
static nw4r::ut::List sHeapList;
|
||||
static OSMutex sRootMutex;
|
||||
static Heap* sCurrentHeap;
|
||||
static int sIsHeapListInitialized;
|
||||
|
||||
static Heap* sAllocatableHeap;
|
||||
static ErrorCallback sErrorCallback;
|
||||
static HeapAllocCallback sAllocCallback;
|
||||
static void* sErrorCallbackArg;
|
||||
static void* sAllocCallbackArg;
|
||||
static class Thread* sAllocatableThread;
|
||||
public:
|
||||
// members
|
||||
/* 0x10 */ MEMiHeapHead* mHeapHandle;
|
||||
/* 0x14 */ void* mParentBlock;
|
||||
// Heap* mParentHeap; // does not exist in ss
|
||||
enum HeapFlag {
|
||||
// tstDisableAllocation, enableAllocation, disableAllocation
|
||||
// setBit__Q23EGG12TBitFlag<Us>FUc
|
||||
HEAP_FLAG_LOCKED = (1 << 0)
|
||||
};
|
||||
/* 0x18 */ u16 mFlag;
|
||||
/* 0x1C */ nw4r::ut::Node mNode;
|
||||
/* 0x24 */ nw4r::ut::List mChildren;
|
||||
/* 0x30 */ const char* mName; // set to "NoName" in ctor
|
||||
|
||||
public:
|
||||
static void initialize();
|
||||
Heap(MEMiHeapHead* heapHandle);
|
||||
|
||||
private:
|
||||
inline Heap(const Heap&) {}
|
||||
|
||||
public:
|
||||
static void* alloc(u32 size, int align, Heap* heap);
|
||||
|
||||
template <typename T> static T* alloc(u32 count, Heap* heap, int align = 4) {
|
||||
return reinterpret_cast<T*>(alloc(count * sizeof(T), align, heap));
|
||||
}
|
||||
template <typename T> static T* alloc(Heap* heap, int align = 4) {
|
||||
return reinterpret_cast<T*>(alloc(sizeof(T), align, heap));
|
||||
}
|
||||
|
||||
Heap* findParentHeap();
|
||||
static Heap* findContainHeap(const void* memBlock);
|
||||
static void free(void* memBlock, Heap* heap);
|
||||
void dispose();
|
||||
static void dumpAll();
|
||||
Heap* becomeCurrentHeap();
|
||||
|
||||
public:
|
||||
static void* addOffset(void* begin, u32 size) {
|
||||
return reinterpret_cast<char*>(begin) + size;
|
||||
}
|
||||
|
||||
inline void appendDisposer(Disposer* disposer) {
|
||||
nw4r::ut::List_Append(&mChildren, disposer);
|
||||
}
|
||||
inline void removeDisposer(Disposer* disposer) {
|
||||
nw4r::ut::List_Remove(&mChildren, disposer);
|
||||
}
|
||||
|
||||
inline MEMiHeapHead* getHeapHandle() { return mHeapHandle; }
|
||||
|
||||
static inline Heap* getCurrentHeap() { return sCurrentHeap; }
|
||||
|
||||
inline int getArenaEnd() {
|
||||
return (int)mHeapHandle->end;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
void* operator new(size_t size);
|
||||
// __nwa(ulong, ulong)
|
||||
void* operator new[](size_t size, u32 align);
|
||||
// __nw(ulong, EGG::Heap *, int)
|
||||
void* operator new(size_t size, EGG::Heap* heap, int align);
|
||||
// __nwa(ulong)
|
||||
void* operator new[](size_t size);
|
||||
// __nwa(ulong, int)
|
||||
void* operator new[](size_t size, int align);
|
||||
// __nwa(ulong, EGG::Heap *, int)
|
||||
void* operator new[](size_t size, EGG::Heap* heap, int align);
|
||||
// __dl(void *)
|
||||
void operator delete(void* p);
|
||||
// __dla(void *)
|
||||
void operator delete[](void*);
|
||||
|
||||
#undef HEAP_PRIVATE
|
||||
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class Thread;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
// This file was ported from https://github.com/riidefi/mkw/blob/master/source/nw4r/ut/utList.hpp
|
||||
|
||||
#include <types.h>
|
||||
|
||||
// TODO: Doc file boundaries
|
||||
|
||||
namespace nw4r {
|
||||
namespace ut {
|
||||
|
||||
//! Bidirectional list node
|
||||
struct Node {
|
||||
void* pred;
|
||||
void* succ;
|
||||
};
|
||||
|
||||
// Unlike modern "std::list"-like structures, list nodes are directly inherited
|
||||
// by children, which saves a level of indirection.
|
||||
struct List {
|
||||
void* head;
|
||||
void* tail;
|
||||
u16 count;
|
||||
u16 intrusion_offset;
|
||||
};
|
||||
|
||||
void List_Init(List* pList, u16 intrusion_offset);
|
||||
void List_Append(List* pList, void* pObj);
|
||||
void List_Insert(List* pList, void* pTgt, void* pObj);
|
||||
void List_Remove(List* pList, void* pObj);
|
||||
void* List_GetNext(const List*, const void*);
|
||||
void* List_GetPrev(const List*, const void*);
|
||||
void* List_GetNth(const List* pList, unsigned short);
|
||||
inline void* List_GetFirst(const List* pList) {
|
||||
return List_GetNext(pList, nullptr);
|
||||
}
|
||||
// Seems to be not included as a symbol. Only inlined.
|
||||
// void List_Prepend(List* pList, void* pObj);
|
||||
|
||||
} // namespace ut
|
||||
} // namespace nw4r
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef RVL_SDK_PUBLIC_AI_H
|
||||
#define RVL_SDK_PUBLIC_AI_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/AI/ai.h>
|
||||
#include <lib/rvl/AI/ai_hardware.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef RVL_SDK_AI_H
|
||||
#define RVL_SDK_AI_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Forward declarations
|
||||
typedef struct OSContext;
|
||||
|
||||
typedef void (*AIDMACallback)(void);
|
||||
|
||||
typedef enum {
|
||||
AI_DSP_32KHZ,
|
||||
AI_DSP_48KHZ,
|
||||
} AIDSPSampleRate;
|
||||
|
||||
AIDMACallback AIRegisterDMACallback(AIDMACallback callback);
|
||||
void AIInitDMA(void* buffer, u32 length);
|
||||
void AIStartDMA(void);
|
||||
u32 AIGetDMABytesLeft(void);
|
||||
void AISetDSPSampleRate(u32 rate);
|
||||
u32 AIGetDSPSampleRate(void);
|
||||
void AIInit(void* stack);
|
||||
void __AIDHandler(s16 intr, struct OSContext* ctx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef RVL_SDK_AI_HARDWARE_H
|
||||
#define RVL_SDK_AI_HARDWARE_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* AI Hardware Registers
|
||||
* https://www.gc-forever.com/yagcd/chap5.html#sec5.10
|
||||
*/
|
||||
volatile u32 AI_HW_REGS[] : 0xCD006C00;
|
||||
|
||||
/**
|
||||
* Hardware register indexes
|
||||
*/
|
||||
typedef enum {
|
||||
AI_AICR, //!< 0xCC006C00
|
||||
AI_AIVR, //!< 0xCC006C04
|
||||
AI_AISCNT, //!< 0xCC006C08
|
||||
AI_AIIT, //!< 0xCC006C0C
|
||||
};
|
||||
|
||||
// AICR - AI Control Register
|
||||
#define AI_AICR_SAMPLERATE (1 << 6)
|
||||
#define AI_AICR_SCRESET (1 << 5)
|
||||
#define AI_AICR_AIINTVLD (1 << 4)
|
||||
#define AI_AICR_AIINT (1 << 3)
|
||||
#define AI_AICR_AIINTMSK (1 << 2)
|
||||
#define AI_AICR_AFR (1 << 1)
|
||||
#define AI_AICR_PSTAT (1 << 0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef RVL_SDK_PUBLIC_ARC_H
|
||||
#define RVL_SDK_PUBLIC_ARC_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/ARC/arc.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,99 @@
|
||||
#ifndef RVL_SDK_ARC_H
|
||||
#define RVL_SDK_ARC_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Modified from decompilation by riidefi in WiiCore
|
||||
* https://github.com/riidefi/WiiCore/tree/master/source/rx
|
||||
*/
|
||||
|
||||
typedef enum { ARC_ENTRY_FILE, ARC_ENTRY_FOLDER } ARCEntryType;
|
||||
|
||||
typedef struct ARCNode {
|
||||
union {
|
||||
struct {
|
||||
u32 is_folder : 8;
|
||||
u32 name : 24;
|
||||
};
|
||||
u32 packed_type_name;
|
||||
}; // at 0x0
|
||||
|
||||
union {
|
||||
struct {
|
||||
u32 offset;
|
||||
u32 size;
|
||||
} file;
|
||||
|
||||
struct {
|
||||
u32 parent;
|
||||
u32 sibling_next;
|
||||
} folder;
|
||||
}; // at 0x4
|
||||
} ARCNode;
|
||||
|
||||
typedef struct ARCHeader {
|
||||
u32 magic; // at 0x0
|
||||
|
||||
struct {
|
||||
s32 offset; // at 0x4
|
||||
s32 size; // at 0x8
|
||||
} nodes;
|
||||
|
||||
struct {
|
||||
s32 offset; // at 0xC
|
||||
} files;
|
||||
|
||||
char UNK_0x10[0x10];
|
||||
} ARCHeader;
|
||||
|
||||
typedef struct ARCHandle {
|
||||
ARCHeader* header; // at 0x0
|
||||
ARCNode* nodes; // at 0x4
|
||||
u8* file; // at 0x8
|
||||
u32 count; // at 0xC
|
||||
const char* strings; // at 0x10
|
||||
u32 fstSize; // at 0x14
|
||||
s32 entrynum; // at 0x18
|
||||
} ARCHandle;
|
||||
|
||||
typedef struct ARCFileInfo {
|
||||
ARCHandle* handle; // at 0x0
|
||||
u32 offset; // at 0x4
|
||||
u32 size; // at 0x8
|
||||
} ARCFileInfo;
|
||||
|
||||
typedef struct ARCEntry {
|
||||
ARCHandle* handle; // at 0x0
|
||||
u32 path; // at 0x4
|
||||
ARCEntryType type; // at 0x8
|
||||
const char* name; // at 0xC
|
||||
} ARCEntry;
|
||||
|
||||
typedef struct ARCDir {
|
||||
ARCHandle* handle; // at 0x0
|
||||
u32 path_begin; // at 0x4
|
||||
u32 path_it; // at 0x8
|
||||
u32 path_end; // at 0xC
|
||||
} ARCDir;
|
||||
|
||||
BOOL ARCGetCurrentDir(ARCHandle* handle, char* string, u32 maxlen);
|
||||
BOOL ARCInitHandle(void* bin, ARCHandle* handle);
|
||||
BOOL ARCOpen(ARCHandle* handle, const char* path, ARCFileInfo* info);
|
||||
BOOL ARCFastOpen(ARCHandle* handle, s32 entrynum, ARCFileInfo* info);
|
||||
s32 ARCConvertPathToEntrynum(ARCHandle* handle, const char* path);
|
||||
void* ARCGetStartAddrInMem(ARCFileInfo* info);
|
||||
s32 ARCGetStartOffset(ARCFileInfo* info);
|
||||
u32 ARCGetLength(ARCFileInfo* info);
|
||||
BOOL ARCClose(ARCFileInfo* info);
|
||||
BOOL ARCChangeDir(ARCHandle* info, const char* path);
|
||||
BOOL ARCOpenDir(ARCHandle* info, const char* path, ARCDir* dir);
|
||||
BOOL ARCReadDir(ARCDir* dir, ARCEntry* entry);
|
||||
BOOL ARCCloseDir(ARCDir* dir);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef RVL_SDK_PUBLIC_BASE_H
|
||||
#define RVL_SDK_PUBLIC_BASE_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/BASE/PPCArch.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,339 @@
|
||||
#ifndef RVL_SDK_PPC_ARCH_H
|
||||
#define RVL_SDK_PPC_ARCH_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
u32 PPCMfmsr(void);
|
||||
void PPCMtmsr(u32 val);
|
||||
|
||||
u32 PPCMfhid0(void);
|
||||
void PPCMthid0(u32 val);
|
||||
|
||||
u32 PPCMfl2cr(void);
|
||||
void PPCMtl2cr(u32 val);
|
||||
|
||||
void PPCMtdec(u32 val);
|
||||
|
||||
void PPCSync(void);
|
||||
void PPCHalt(void);
|
||||
|
||||
void PPCMtmmcr0(u32 val);
|
||||
void PPCMtmmcr1(u32 val);
|
||||
|
||||
void PPCMtpmc1(u32 val);
|
||||
void PPCMtpmc2(u32 val);
|
||||
void PPCMtpmc3(u32 val);
|
||||
void PPCMtpmc4(u32 val);
|
||||
|
||||
u32 PPCMffpscr(void);
|
||||
void PPCMtfpscr(u32 val);
|
||||
|
||||
u32 PPCMfhid2(void);
|
||||
void PPCMthid2(u32 val);
|
||||
|
||||
u32 PPCMfwpar(void);
|
||||
void PPCMtwpar(u32 val);
|
||||
|
||||
void PPCDisableSpeculation(void);
|
||||
void PPCSetFpNonIEEEMode(void);
|
||||
|
||||
void PPCMthid4(u32 val);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MSR
|
||||
* Machine Status Register
|
||||
*/
|
||||
// Power management enable
|
||||
#define MSR_POW (1 << (31 - 13))
|
||||
// Exception little-endian mode
|
||||
#define MSR_ILE (1 << (31 - 15))
|
||||
// External interrupt enable
|
||||
#define MSR_EE (1 << (31 - 16))
|
||||
// Privilege level
|
||||
#define MSR_PR (1 << (31 - 17))
|
||||
// Floating-point available
|
||||
#define MSR_FP (1 << (31 - 18))
|
||||
// Machine check enable
|
||||
#define MSR_ME (1 << (31 - 19))
|
||||
// IEEE floating-point exception mode 0
|
||||
#define MSR_FE0 (1 << (31 - 20))
|
||||
// Single-step trace enable
|
||||
#define MSR_SE (1 << (31 - 21))
|
||||
// Branch trace enable
|
||||
#define MSR_BE (1 << (31 - 22))
|
||||
// IEEE floating-point exception mode 1
|
||||
#define MSR_FE1 (1 << (31 - 23))
|
||||
// Exception prefix
|
||||
#define MSR_IP (1 << (31 - 25))
|
||||
// Instruction address translation
|
||||
#define MSR_IR (1 << (31 - 26))
|
||||
// Data address translation
|
||||
#define MSR_DR (1 << (31 - 27))
|
||||
// Performance monitor marked mode
|
||||
#define MSR_PM (1 << (31 - 29))
|
||||
// Indicates whether system reset or machine check exception is recoverable
|
||||
#define MSR_RI (1 << (31 - 30))
|
||||
// Little-endian mode enable
|
||||
#define MSR_LE (1 << (31 - 31))
|
||||
|
||||
/**
|
||||
* HID0
|
||||
* Hardware Implementation-Dependent Register 0
|
||||
*/
|
||||
// Enable MCP
|
||||
#define HID0_EMCP (1 << (31 - 0))
|
||||
// Enable/disable 60x bus address and data parity generation
|
||||
#define HID0_DBP (1 << (31 - 1))
|
||||
// Enable/disable 60x bus address parity checking
|
||||
#define HID0_EBA (1 << (31 - 2))
|
||||
// Enable 60x bus data parity checking
|
||||
#define HID0_EBD (1 << (31 - 3))
|
||||
// CLK_OUT enable
|
||||
#define HID0_BCLK (1 << (31 - 4))
|
||||
// CLK_OUT enable
|
||||
#define HID0_ECLK (1 << (31 - 6))
|
||||
// Disable precharge of ARTRY
|
||||
#define HID0_PAR (1 << (31 - 7))
|
||||
// Doze mode enable
|
||||
#define HID0_DOZE (1 << (31 - 8))
|
||||
// Nap mode enable
|
||||
#define HID0_NAP (1 << (31 - 9))
|
||||
// Sleep mode enable
|
||||
#define HID0_SLEEP (1 << (31 - 10))
|
||||
// Dynamic power management enable
|
||||
#define HID0_DPM (1 << (31 - 11))
|
||||
// Not hard reset (software-use only)
|
||||
#define HID0_NHR (1 << (31 - 15))
|
||||
// Instruction cache enable
|
||||
#define HID0_ICE (1 << (31 - 16))
|
||||
// Data cache enable
|
||||
#define HID0_DCE (1 << (31 - 17))
|
||||
// Instruction cache lock
|
||||
#define HID0_ILOCK (1 << (31 - 18))
|
||||
// Data cache lock
|
||||
#define HID0_DLOCK (1 << (31 - 19))
|
||||
// Instruction cache flash invalidate
|
||||
#define HID0_ICFI (1 << (31 - 20))
|
||||
// Data cache flash invalidate
|
||||
#define HID0_DCFI (1 << (31 - 21))
|
||||
// Speculative cache access disable
|
||||
#define HID0_SPD (1 << (31 - 22))
|
||||
// Enable M bit on bus for instruction fetches
|
||||
#define HID0_IFEM (1 << (31 - 23))
|
||||
// Store gathering enable
|
||||
#define HID0_SGE (1 << (31 - 24))
|
||||
// Data cache flush assist
|
||||
#define HID0_DCFA (1 << (31 - 25))
|
||||
// Branch Target Instruction Cache enable
|
||||
#define HID0_BTIC (1 << (31 - 26))
|
||||
// Address broadcast enable
|
||||
#define HID0_ABE (1 << (31 - 28))
|
||||
// Branch history table enable
|
||||
#define HID0_BHT (1 << (31 - 29))
|
||||
// No-op the data cache touch instructions
|
||||
#define HID0_NOOPTI (1 << (31 - 31))
|
||||
|
||||
/**
|
||||
* HID1
|
||||
* Hardware Implementation-Dependent Register 1
|
||||
*/
|
||||
// PLL configuration bits (read-only)
|
||||
#define HID1_PC0 (1 << (31 - 0))
|
||||
#define HID1_PC1 (1 << (31 - 1))
|
||||
#define HID1_PC2 (1 << (31 - 2))
|
||||
#define HID1_PC3 (1 << (31 - 3))
|
||||
#define HID1_PC4 (1 << (31 - 4))
|
||||
|
||||
/**
|
||||
* L2CR
|
||||
* L2 Control Register
|
||||
*/
|
||||
// L2 enable
|
||||
#define L2CR_L2E (1 << (31 - 0))
|
||||
// L2 Checkstop enable
|
||||
#define L2CR_L2CE (1 << (31 - 1))
|
||||
// L2 data-only
|
||||
#define L2CR_L2DO (1 << (31 - 9))
|
||||
// L2 global invalidate
|
||||
#define L2CR_L2I (1 << (31 - 10))
|
||||
// L2 write-through
|
||||
#define L2CR_L2WT (1 << (31 - 12))
|
||||
// L2 test support
|
||||
#define L2CR_L2TS (1 << (31 - 13))
|
||||
// L2 global invalidate in progress (read only)
|
||||
#define L2CR_L2IP (1 << (31 - 31))
|
||||
|
||||
/**
|
||||
* PMC1-PMC4
|
||||
* Performance Monitor Counter Registers
|
||||
*/
|
||||
// Overflow
|
||||
#define PMC_OV (1 << (31 - 0))
|
||||
|
||||
/**
|
||||
* FPSCR
|
||||
* Floating-Point Status and Control Register
|
||||
*/
|
||||
// Floating-point exception summary
|
||||
#define FPSCR_FX (1 << (31 - 0))
|
||||
// Floating-point enabled exception summary
|
||||
#define FPSCR_FEX (1 << (31 - 1))
|
||||
// Floating-point invalid operation exception summary
|
||||
#define FPSCR_VX (1 << (31 - 2))
|
||||
// Floating-point overflow exception
|
||||
#define FPSCR_OX (1 << (31 - 3))
|
||||
// Floating-point underflow exception
|
||||
#define FPSCR_UX (1 << (31 - 4))
|
||||
// Floating-point zero divide exception
|
||||
#define FPSCR_ZX (1 << (31 - 5))
|
||||
// Floating-point inexact exception
|
||||
#define FPSCR_XX (1 << (31 - 6))
|
||||
// Floating-point invalid operation exception for SNaN
|
||||
#define FPSCR_VXSNAN (1 << (31 - 7))
|
||||
// Floating-point invalid operation exception for (inf - inf)
|
||||
#define FPSCR_VXISI (1 << (31 - 8))
|
||||
// Floating-point invalid operation exception for (inf / inf)
|
||||
#define FPSCR_VXIDI (1 << (31 - 9))
|
||||
// Floating-point invalid operation exception for (0 / 0)
|
||||
#define FPSCR_VXZDZ (1 << (31 - 10))
|
||||
// Floating-point invalid operation exception for (inf * 0)
|
||||
#define FPSCR_VXIMZ (1 << (31 - 11))
|
||||
// Floating-point invalid operation exception for invalid compare
|
||||
#define FPSCR_VXVC (1 << (31 - 12))
|
||||
// Floating-point fraction rounded
|
||||
#define FPSCR_FR (1 << (31 - 13))
|
||||
// Floating-point fraction inexact
|
||||
#define FPSCR_FI (1 << (31 - 14))
|
||||
// Floating-point result flags
|
||||
#define FPSCR_FPRF (0x1F << (31 - 19))
|
||||
// Unknown
|
||||
#define FPSCR_UNK20 (1 << (31 - 20))
|
||||
// Floating-point invalid operation exception for software request
|
||||
#define FPSCR_VXSOFT (1 << (31 - 21))
|
||||
// Floating-point invalid operation exception for invalid square root
|
||||
#define FPSCR_VXSQRT (1 << (31 - 22))
|
||||
// Floating-point invalid operation exception for invalid integer convert
|
||||
#define FPSCR_VXCVI (1 << (31 - 23))
|
||||
// Floating-point invalid operation exception enable
|
||||
#define FPSCR_VE (1 << (31 - 24))
|
||||
// IEEE floating-point overflow exception enable
|
||||
#define FPSCR_OE (1 << (31 - 25))
|
||||
// IEEE floating-point underflow exception enable
|
||||
#define FPSCR_UE (1 << (31 - 26))
|
||||
// IEEE floating-point zero divide exception enable
|
||||
#define FPSCR_ZE (1 << (31 - 27))
|
||||
// Floating-point inexact exception enable
|
||||
#define FPSCR_XE (1 << (31 - 28))
|
||||
// Floating-point non-IEEE mode
|
||||
#define FPSCR_NI (1 << (31 - 29))
|
||||
// Floating-point rounding control
|
||||
#define FPSCR_RN (0x3 << (31 - 31))
|
||||
|
||||
/**
|
||||
* HID2
|
||||
* Hardware Implementation-Dependent Register 2
|
||||
*/
|
||||
// Write pipe enable
|
||||
#define HID2_WPE (1 << (31 - 1))
|
||||
// Paired-single enable
|
||||
#define HID2_PSE (1 << (31 - 2))
|
||||
// Locked cache enable
|
||||
#define HID2_LCE (1 << (31 - 3))
|
||||
// DMA queue length (read only)
|
||||
#define HID2_DMAQL \
|
||||
((1 << (31 - 4)) | (1 << (31 - 5)) | (1 << (31 - 6)) | (1 << (31 - 7)))
|
||||
// dcbz_l cache hit error
|
||||
#define HID2_DCHERR (1 << (31 - 8))
|
||||
// DMA access to normal cache error
|
||||
#define HID2_DNCERR (1 << (31 - 9))
|
||||
// DMA cache miss error
|
||||
#define HID2_DCMERR (1 << (31 - 10))
|
||||
// DMA queue overflow error
|
||||
#define HID2_DQOERR (1 << (31 - 11))
|
||||
// dcbz_l cache hit error enable
|
||||
#define HID2_DCHEE (1 << (31 - 12))
|
||||
// DMA access to normal cache error enable
|
||||
#define HID2_DNCEE (1 << (31 - 13))
|
||||
// DMA cache miss error enable
|
||||
#define HID2_DCMEE (1 << (31 - 14))
|
||||
// DMA queue overflow error enable
|
||||
#define HID2_DQOEE (1 << (31 - 15))
|
||||
|
||||
/**
|
||||
* WPAR
|
||||
* Write Pipe Address Register
|
||||
*/
|
||||
// High order address bits of the data to be gathered
|
||||
#define WPAR_GB_ADDR (0x07FFFFFF << (31 - 26))
|
||||
// Buffer not empty (read only)
|
||||
#define WPAR_BNE (1 << (31 - 31))
|
||||
|
||||
/**
|
||||
* DMAU
|
||||
* Direct Memory Access Upper Register
|
||||
*/
|
||||
// High order address bits of starting address in external memory of the DMA
|
||||
// transfer
|
||||
#define DMAU_MEM_ADDR (0x07FFFFFF << (31 - 26))
|
||||
// High order bits of transfer length, in cache lines. Low order bits are in
|
||||
// DMAL
|
||||
#define DMAU_DMA_LEN_U (0x0000001F << (31 - 31))
|
||||
|
||||
/**
|
||||
* DMAL
|
||||
* Direct Memory Access Lower Register
|
||||
*/
|
||||
// High order address bits of starting address in locked cache of the DMA
|
||||
// transfer
|
||||
#define DMAL_LC_ADDR (0x07FFFFFF << (31 - 26))
|
||||
// DMA load command
|
||||
#define DMAL_DMA_LD (1 << (31 - 27))
|
||||
// Low order bits of transfer length, in cache lines. High order bits are in
|
||||
// DMAU
|
||||
#define DMAL_DMA_LEN_L (0x3 << (31 - 29))
|
||||
// Trigger bit
|
||||
#define DMAL_DMA_T (1 << (31 - 30))
|
||||
// Flush bit
|
||||
#define DMAL_DMA_F (1 << (31 - 31))
|
||||
|
||||
/**
|
||||
* PVR
|
||||
* Processor Version Register
|
||||
*/
|
||||
// A 16-bit number that uniquely identifies a particular processor version
|
||||
#define PVR_VER (0xFFFF0000)
|
||||
// A 16-bit number that distinguishes between various releases of a particular
|
||||
// version (that is, an engineering change level)
|
||||
#define PVR_REV (0x0000FFFF)
|
||||
|
||||
/**
|
||||
* HID4
|
||||
* Hardware Implementation-Dependent Register 4
|
||||
*/
|
||||
// Unknown
|
||||
#define HID4_H4A (1 << (31 - 0))
|
||||
// L2 fetch mode
|
||||
#define HID4_L2FM (0x3 << (31 - 2))
|
||||
// Bus pipeline depth
|
||||
#define HID4_BPD (0x3 << (31 - 4))
|
||||
// L2 second castout buffer enable
|
||||
#define HID4_BCO (1 << (31 - 5))
|
||||
// Secondary BAT enable
|
||||
#define HID4_SBE (1 << (31 - 6))
|
||||
// Paired-singles control bit 1
|
||||
#define HID4_PS1_CTL (1 << (31 - 7))
|
||||
// Data bus parking
|
||||
#define HID4_DBP (1 << (31 - 9))
|
||||
// L2 MUM enable
|
||||
#define HID4_L2MUM (1 << (31 - 10))
|
||||
// L2CFI - L2 complete castout prior to L2 flash invalidate
|
||||
#define HID4_L2_CCFI (1 << (31 - 11))
|
||||
// Paired-singles control bit 2
|
||||
#define HID4_PSS2_CTL (1 << (31 - 12))
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef RVL_SDK_PUBLIC_CARD_H
|
||||
#define RVL_SDK_PUBLIC_CARD_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/CARD/CARD.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef RVL_SDK_CARD_H
|
||||
#define RVL_SDK_CARD_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct CARDFileInfo {
|
||||
s32 chan; // at 0x0
|
||||
s32 fileNo; // at 0x4
|
||||
s32 offset; // at 0x8
|
||||
s32 length; // at 0xC
|
||||
u16 iBlock; // at 0x10
|
||||
u16 padding; // at 0x12
|
||||
} CARDFileInfo;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef RVL_SDK_PUBLIC_CNT_H
|
||||
#define RVL_SDK_PUBLIC_CNT_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/CNT/cnt.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef RVL_SDK_CNT_H
|
||||
#define RVL_SDK_CNT_H
|
||||
#include <lib/rvl/ARC.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct CNTHandle {
|
||||
ARCHandle arcHandle; // at 0x0
|
||||
s32 fd; // at 0x1C
|
||||
} CNTHandle;
|
||||
|
||||
typedef struct CNTFileInfo {
|
||||
CNTHandle* handle; // at 0x0
|
||||
u32 offset; // at 0x4
|
||||
u32 length; // at 0x8
|
||||
u32 position; // at 0xC
|
||||
} CNTFileInfo;
|
||||
|
||||
s32 contentFastOpenNAND(CNTHandle* handle, s32 entrynum, CNTFileInfo* info);
|
||||
s32 contentConvertPathToEntrynumNAND(CNTHandle* handle, const char* path);
|
||||
u32 contentGetLengthNAND(CNTFileInfo* info);
|
||||
s32 contentReadNAND(CNTFileInfo* info, void* dst, s32 len, s32 offset);
|
||||
s32 contentCloseNAND(CNTFileInfo* info);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef RVL_SDK_PUBLIC_DB_H
|
||||
#define RVL_SDK_PUBLIC_DB_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/DB/db.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef RVL_SDK_DB_H
|
||||
#define RVL_SDK_DB_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Forward declarations
|
||||
typedef struct OSDebugInterface;
|
||||
|
||||
void DBInit(void);
|
||||
void __DBExceptionDestinationAux(void);
|
||||
void __DBExceptionDestination(void);
|
||||
BOOL __DBIsExceptionMarked(u8 exc);
|
||||
void DBPrintf(const char* msg, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef RVL_SDK_PUBLIC_DSP_H
|
||||
#define RVL_SDK_PUBLIC_DSP_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/DSP/dsp.h>
|
||||
#include <lib/rvl/DSP/dsp_debug.h>
|
||||
#include <lib/rvl/DSP/dsp_hardware.h>
|
||||
#include <lib/rvl/DSP/dsp_task.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef RVL_SDK_DSP_H
|
||||
#define RVL_SDK_DSP_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Forward declarations
|
||||
typedef struct DSPTask;
|
||||
|
||||
// General-purpose typedef
|
||||
typedef void* DSPMail;
|
||||
|
||||
BOOL DSPCheckMailToDSP(void);
|
||||
BOOL DSPCheckMailFromDSP(void);
|
||||
DSPMail DSPReadMailFromDSP(void);
|
||||
void DSPSendMailToDSP(DSPMail mail);
|
||||
void DSPAssertInt(void);
|
||||
void DSPInit(void);
|
||||
BOOL DSPCheckInit(void);
|
||||
struct DSPTask* DSPAddTask(struct DSPTask* task);
|
||||
struct DSPTask* DSPAssertTask(struct DSPTask* task);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef RVL_SDK_DSP_DEBUG_H
|
||||
#define RVL_SDK_DSP_DEBUG_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void __DSP_debug_printf(const char* fmt, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,74 @@
|
||||
#ifndef RVL_SDK_DSP_HARDWARE_H
|
||||
#define RVL_SDK_DSP_HARDWARE_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* DSP Hardware Registers
|
||||
* https://www.gc-forever.com/yagcd/chap5.html#sec5.6
|
||||
*/
|
||||
volatile u16 DSP_HW_REGS[] : 0xCC005000;
|
||||
|
||||
/**
|
||||
* Hardware register indexes
|
||||
*/
|
||||
typedef enum {
|
||||
DSP_DSPMBOX_H, //!< 0xCC005000
|
||||
DSP_DSPMBOX_L, //!< 0xCC005002
|
||||
DSP_CPUMBOX_H, //!< 0xCC005004
|
||||
DSP_CPUMBOX_L, //!< 0xCC005006
|
||||
DSP_REG_0x8, //!< 0xCC005008
|
||||
DSP_CSR, //!< 0xCC00500A
|
||||
DSP_REG_0xC, //!< 0xCC00500C
|
||||
DSP_REG_0xE, //!< 0xCC00500E
|
||||
DSP_REG_0x10, //!< 0xCC005010
|
||||
DSP_AR_SIZE, //!< 0xCC005012
|
||||
DSP_REG_0x14, //!< 0xCC005014
|
||||
DSP_AR_MODE, //!< 0xCC005016
|
||||
DSP_REG_0x18, //!< 0xCC005018
|
||||
DSP_AR_REFRESH, //!< 0xCC00501A
|
||||
DSP_REG_0x1C, //!< 0xCC00501C
|
||||
DSP_REG_0x1E, //!< 0xCC00501E
|
||||
DSP_AR_DMA_MMADDR_H, //!< 0xCC005020
|
||||
DSP_AR_DMA_MMADDR_L, //!< 0xCC005022
|
||||
DSP_AR_DMA_ARADDR_H, //!< 0xCC005024
|
||||
DSP_AR_DMA_ARADDR_L, //!< 0xCC005026
|
||||
DSP_AR_DMA_CNT_H, //!< 0xCC005028
|
||||
DSP_AR_DMA_CNT_L, //!< 0xCC00502A
|
||||
DSP_REG_0x2C, //!< 0xCC00502C
|
||||
DSP_REG_0x2E, //!< 0xCC00502E
|
||||
DSP_AI_DMA_START_H, //!< 0xCC005030
|
||||
DSP_AI_DMA_START_L, //!< 0xCC005032
|
||||
DSP_REG_0x34, //!< 0xCC005034
|
||||
DSP_AI_DMA_CSR, //!< 0xCC005036
|
||||
DSP_REG_0x38, //!< 0xCC005038
|
||||
DSP_AI_DMA_BYTES_LEFT //!< 0xCC00503A
|
||||
} DSPHwReg;
|
||||
|
||||
// DSPMBOX_H - DSP Mailbox High (to DSP)
|
||||
#define DSP_DSPMBOX_H_STATUS (1 << 15)
|
||||
|
||||
// CPUMBOX_H - CPU Mailbox High (from DSP)
|
||||
#define DSP_CPUMBOX_H_STATUS (1 << 15)
|
||||
|
||||
// CSR - Control Status Register
|
||||
#define DSP_CSR_RES (1 << 11)
|
||||
#define DSP_CSR_DMAINT (1 << 9)
|
||||
#define DSP_CSR_DSPINTMSK (1 << 8)
|
||||
#define DSP_CSR_DSPINT (1 << 7)
|
||||
#define DSP_CSR_ARINTMSK (1 << 6)
|
||||
#define DSP_CSR_ARINT (1 << 5)
|
||||
#define DSP_CSR_AIDINTMSK (1 << 4)
|
||||
#define DSP_CSR_AIDINT (1 << 3)
|
||||
#define DSP_CSR_HALT (1 << 2)
|
||||
#define DSP_CSR_PIINT (1 << 1)
|
||||
|
||||
// AI_DMA_CSR - AI DMA Control Status Register
|
||||
#define DSP_AI_DMA_CSR_PLAY (1 << 15)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,62 @@
|
||||
#ifndef RVL_SDK_DSP_TASK_H
|
||||
#define RVL_SDK_DSP_TASK_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Forward declarations
|
||||
typedef struct DSPTask;
|
||||
typedef struct OSContext;
|
||||
|
||||
typedef enum {
|
||||
DSP_TASK_ACTIVE = (1 << 0),
|
||||
DSP_TASK_CANCELED = (1 << 1),
|
||||
} DSPTaskFlags;
|
||||
|
||||
typedef enum {
|
||||
DSP_TASK_STATE_0,
|
||||
DSP_TASK_STATE_1,
|
||||
DSP_TASK_STATE_2,
|
||||
DSP_TASK_STATE_3,
|
||||
} DSPTaskState;
|
||||
|
||||
typedef void (*DSPTaskCallback)(struct DSPTask* task);
|
||||
|
||||
typedef struct DSPTask {
|
||||
u32 state; // at 0x0
|
||||
u32 prio; // at 0x4
|
||||
u32 flags; // at 0x8
|
||||
void* iramMmemAddr; // at 0xC
|
||||
u32 iramMmemLen; // at 0x10
|
||||
void* iramDspAddr; // at 0x14
|
||||
u32 iramDspLen; // at 0x18
|
||||
u32 dramMmemLen; // at 0x1C
|
||||
UNKWORD WORD_0x20;
|
||||
u16 startVector; // at 0x24
|
||||
u16 resumeVector; // at 0x26
|
||||
DSPTaskCallback initCallback; // at 0x28
|
||||
DSPTaskCallback resumeCallback; // at 0x2C
|
||||
DSPTaskCallback doneCallback; // at 0x30
|
||||
DSPTaskCallback requestCallback; // at 0x34
|
||||
struct DSPTask* next; // at 0x38
|
||||
struct DSPTask* prev; // at 0x3C
|
||||
} DSPTask;
|
||||
|
||||
extern BOOL __DSP_rude_task_pending;
|
||||
extern DSPTask* __DSP_rude_task;
|
||||
extern DSPTask* __DSP_tmp_task;
|
||||
extern DSPTask* __DSP_last_task;
|
||||
extern DSPTask* __DSP_first_task;
|
||||
extern DSPTask* __DSP_curr_task;
|
||||
|
||||
void __DSPHandler(s16 intr, struct OSContext* ctx);
|
||||
void __DSP_exec_task(DSPTask* task1, DSPTask* task2);
|
||||
void __DSP_boot_task(DSPTask* task);
|
||||
void __DSP_insert_task(DSPTask* task);
|
||||
void __DSP_remove_task(DSPTask* task);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef RVL_SDK_PUBLIC_DVD_H
|
||||
#define RVL_SDK_PUBLIC_DVD_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/DVD/dvd.h>
|
||||
#include <lib/rvl/DVD/dvd_broadway.h>
|
||||
#include <lib/rvl/DVD/dvdfatal.h>
|
||||
#include <lib/rvl/DVD/dvdfs.h>
|
||||
#include <lib/rvl/DVD/dvdidutils.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef RVL_SDK_DVD_H
|
||||
#define RVL_SDK_DVD_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Forward declarations
|
||||
typedef struct OSAlarm;
|
||||
|
||||
typedef struct DVDDriveBlock {
|
||||
char UNK_0x0[0xC];
|
||||
UNKWORD WORD_0xC;
|
||||
char UNK_0x10[0x30 - 0x10];
|
||||
} DVDDriveBlock;
|
||||
|
||||
typedef struct DVDDriveInfo {
|
||||
u16 revision; // at 0x0
|
||||
u16 deviceCode; // at 0x2
|
||||
u32 releaseDate; // at 0x4
|
||||
char padding[32 - 0x8];
|
||||
} DVDDriveInfo;
|
||||
|
||||
typedef void (*DVDInquiryCallback)(s32, DVDDriveBlock*);
|
||||
|
||||
void DVDInit(void);
|
||||
|
||||
BOOL DVDInquiryAsync(DVDDriveBlock*, DVDDriveInfo*, DVDInquiryCallback);
|
||||
|
||||
u32 __DVDGetCoverStatus(void);
|
||||
|
||||
void __DVDPrepareReset(void);
|
||||
BOOL __DVDTestAlarm(struct OSAlarm*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
#ifndef RVL_SDK_DVD_BROADWAY_H
|
||||
#define RVL_SDK_DVD_BROADWAY_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Forward declarations
|
||||
typedef struct DVDDiskID;
|
||||
typedef struct DVDDriveInfo;
|
||||
typedef struct ESPTicket;
|
||||
typedef struct ESPTmd;
|
||||
typedef struct OSAlarm;
|
||||
|
||||
/**
|
||||
* https://wiibrew.org/wiki//dev/di
|
||||
* Names adjusted to be closer to those seen in assertions
|
||||
*/
|
||||
typedef enum {
|
||||
DVD_INTTYPE_TC = (1 << 0), //!< Transaction callback?
|
||||
DVD_INTTYPE_DE = (1 << 1), //!< Drive error
|
||||
DVD_INTTYPE_CVR = (1 << 2), //!< Something with DVD cover
|
||||
DVD_INTTYPE_BR = (1 << 3), //!< Break requested
|
||||
DVD_INTTYPE_TIME = (1 << 4), //!< Time out
|
||||
DVD_INTTYPE_SERR = (1 << 5), //!< Security error
|
||||
DVD_INTTYPE_VERR = (1 << 6), //!< Verify error
|
||||
DVD_INTTYPE_ARGS = (1 << 7), //!< Bad arguments
|
||||
} DVDLowIntType;
|
||||
|
||||
typedef void (*DVDLowCallback)(u32 intType);
|
||||
|
||||
BOOL DVDLowInit(void);
|
||||
BOOL DVDLowReadDiskID(struct DVDDiskID* out, DVDLowCallback callback);
|
||||
BOOL DVDLowOpenPartition(u32 offset, const struct ESPTicket* ticket,
|
||||
u32 certsSize, const void* certs, struct ESPTmd* tmd,
|
||||
DVDLowCallback callback);
|
||||
BOOL DVDLowClosePartition(DVDLowCallback callback);
|
||||
BOOL DVDLowUnencryptedRead(void* dst, u32 size, u32 offset,
|
||||
DVDLowCallback callback);
|
||||
BOOL DVDLowStopMotor(BOOL eject, BOOL kill, DVDLowCallback callback);
|
||||
BOOL DVDLowInquiry(struct DVDDriveInfo* out, DVDLowCallback callback);
|
||||
BOOL DVDLowRequestError(DVDLowCallback callback);
|
||||
BOOL DVDLowSetSpinupFlag(BOOL enable);
|
||||
BOOL DVDLowReset(DVDLowCallback callback);
|
||||
BOOL DVDLowAudioBufferConfig(BOOL enable, u32 size, DVDLowCallback callback);
|
||||
BOOL DVDLowSetMaximumRotation(u32 speed, DVDLowCallback callback);
|
||||
BOOL DVDLowRead(void* dst, u32 size, u32 offset, DVDLowCallback callback);
|
||||
BOOL DVDLowSeek(u32 offset, DVDLowCallback callback);
|
||||
u32 DVDLowGetCoverRegister(void);
|
||||
BOOL DVDLowPrepareCoverRegister(DVDLowCallback callback);
|
||||
u32 DVDLowGetImmBufferReg(void);
|
||||
BOOL DVDLowUnmaskStatusInterrupts(void);
|
||||
BOOL DVDLowMaskCoverInterrupt(void);
|
||||
BOOL DVDLowClearCoverInterrupt(DVDLowCallback callback);
|
||||
BOOL __DVDLowTestAlarm(const struct OSAlarm* alarm);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef RVL_SDK_DVD_FATAL_H
|
||||
#define RVL_SDK_DVD_FATAL_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void __DVDShowFatalMessage(void);
|
||||
BOOL DVDSetAutoFatalMessaging(BOOL enable);
|
||||
BOOL __DVDGetAutoFatalMessaging(void);
|
||||
void __DVDPrintFatalMessage(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef RVL_SDK_DVD_FS_H
|
||||
#define RVL_SDK_DVD_FS_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern BOOL __DVDLongFileNameFlag;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef RVL_SDK_DVD_ID_UTILS_H
|
||||
#define RVL_SDK_DVD_ID_UTILS_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct DVDDiskID {
|
||||
char game[4]; // at 0x0
|
||||
char company[2]; // at 0x4
|
||||
u8 disk; // at 0x6
|
||||
u8 version; // at 0x7
|
||||
u8 strmEnable; // at 0x8
|
||||
u8 strmBufSize; // at 0x9
|
||||
u8 padding[14]; // at 0xA
|
||||
u32 rvlMagic; // at 0x18
|
||||
u32 gcMagic; // at 0x1C
|
||||
} DVDDiskID;
|
||||
|
||||
BOOL DVDCompareDiskID(const DVDDiskID* id1, const DVDDiskID* id2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef RVL_SDK_PUBLIC_ESP_H
|
||||
#define RVL_SDK_PUBLIC_ESP_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/ESP/esp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef RVL_SDK_ESP_H
|
||||
#define RVL_SDK_ESP_H
|
||||
#include <lib/rvl/ARC.h>
|
||||
#include <lib/rvl/IPC.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
ES_IOCTLV_LAUNCH_TITLE = 8,
|
||||
ES_IOCTLV_GET_NUM_TICKET_VIEWS = 18,
|
||||
ES_IOCTLV_GET_TICKET_VIEWS = 19,
|
||||
ES_IOCTLV_GET_DATA_DIR = 29,
|
||||
ES_IOCTLV_GET_TITLE_ID = 32,
|
||||
} ESIoctl;
|
||||
|
||||
typedef struct ESPTicket {
|
||||
u8 dummy[0x2A4];
|
||||
char padding[0x2C0 - 0x2A4];
|
||||
} ESPTicket;
|
||||
|
||||
typedef struct ESPTmd {
|
||||
u8 dummy[0x49E4];
|
||||
char padding[0x4A00 - 0x49E4];
|
||||
} ESPTmd;
|
||||
|
||||
s32 ESP_ReadContentFile(UNKWORD, void*, u32);
|
||||
s32 ESP_SeekContentFile(UNKWORD, s32, UNKWORD);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef RVL_SDK_PUBLIC_EXI_H
|
||||
#define RVL_SDK_PUBLIC_EXI_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/EXI/EXIBios.h>
|
||||
#include <lib/rvl/EXI/EXICommon.h>
|
||||
#include <lib/rvl/EXI/EXIHardware.h>
|
||||
#include <lib/rvl/EXI/EXIUart.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,59 @@
|
||||
#ifndef RVL_SDK_EXI_BIOS_H
|
||||
#define RVL_SDK_EXI_BIOS_H
|
||||
#include <lib/rvl/EXI/EXICommon.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
EXI_FREQ_1MHZ,
|
||||
EXI_FREQ_2MHZ,
|
||||
EXI_FREQ_4MHZ,
|
||||
EXI_FREQ_8MHZ,
|
||||
EXI_FREQ_16MHZ,
|
||||
EXI_FREQ_32HZ,
|
||||
} EXIFreq;
|
||||
|
||||
typedef struct EXIItem {
|
||||
u32 dev; // at 0x0
|
||||
EXICallback callback; // at 0x4
|
||||
} EXIItem;
|
||||
|
||||
typedef struct EXIData {
|
||||
EXICallback exiCallback; // at 0x0
|
||||
EXICallback tcCallback; // at 0x4
|
||||
EXICallback extCallback; // at 0x8
|
||||
volatile s32 state; // at 0xC
|
||||
s32 bytesRead; // at 0x10
|
||||
void* buffer; // at 0x14
|
||||
u32 dev; // at 0x18
|
||||
u32 id; // at 0x1C
|
||||
UNKWORD WORD_0x20;
|
||||
s32 numItems; // at 0x24
|
||||
EXIItem items[3]; // at 0x28
|
||||
} EXIData;
|
||||
|
||||
BOOL EXIImm(EXIChannel chan, void* buf, s32 len, u32 type,
|
||||
EXICallback callback);
|
||||
BOOL EXIImmEx(EXIChannel chan, void* buf, s32 len, u32 type);
|
||||
BOOL EXIDma(EXIChannel chan, void* buf, s32 len, u32 type,
|
||||
EXICallback callback);
|
||||
BOOL EXISync(EXIChannel chan);
|
||||
void EXIClearInterrupts(EXIChannel chan, BOOL exi, BOOL tc, BOOL ext);
|
||||
EXICallback EXISetExiCallback(EXIChannel chan, EXICallback callback);
|
||||
void EXIProbeReset(void);
|
||||
BOOL EXIProbe(EXIChannel chan);
|
||||
BOOL EXIAttach(EXIChannel chan, EXICallback callback);
|
||||
BOOL EXIDetach(EXIChannel chan);
|
||||
BOOL EXISelect(EXIChannel chan, u32 dev, u32 freq);
|
||||
BOOL EXIDeselect(EXIChannel chan);
|
||||
void EXIInit(void);
|
||||
BOOL EXILock(EXIChannel chan, u32 dev, EXICallback callback);
|
||||
BOOL EXIUnlock(EXIChannel chan);
|
||||
s32 EXIGetID(EXIChannel chan, u32 dev, u32* out);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,40 @@
|
||||
#ifndef RVL_SDK_EXI_COMMON_H
|
||||
#define RVL_SDK_EXI_COMMON_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Forward declarations
|
||||
typedef struct OSContext;
|
||||
|
||||
typedef enum {
|
||||
EXI_STATE_DMA_ACCESS = (1 << 0),
|
||||
EXI_STATE_IMM_ACCESS = (1 << 1),
|
||||
EXI_STATE_SELECTED = (1 << 2),
|
||||
EXI_STATE_ATTACHED = (1 << 3),
|
||||
EXI_STATE_LOCKED = (1 << 4),
|
||||
|
||||
EXI_STATE_BUSY = EXI_STATE_DMA_ACCESS | EXI_STATE_IMM_ACCESS
|
||||
} EXIState;
|
||||
|
||||
typedef enum { EXI_CHAN_0, EXI_CHAN_1, EXI_CHAN_2, EXI_MAX_CHAN } EXIChannel;
|
||||
|
||||
typedef enum { EXI_READ, EXI_WRITE, EXI_TYPE_2, EXI_MAX_TYPE } EXIType;
|
||||
|
||||
typedef void (*EXICallback)(EXIChannel chan, struct OSContext* ctx);
|
||||
|
||||
extern const u32 __EXIFreq;
|
||||
|
||||
static u32 __EXISwap32(u32 val) {
|
||||
return val >> 24 & 0x000000FF | val >> 8 & 0x0000FF00 |
|
||||
val << 8 & 0x00FF0000 | val << 24 & 0xFF000000;
|
||||
}
|
||||
|
||||
BOOL EXIWriteReg(EXIChannel chan, u32 dev, UNKWORD r5, const void* buf,
|
||||
s32 len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef RVL_SDK_EXI_HARDWARE_H
|
||||
#define RVL_SDK_EXI_HARDWARE_H
|
||||
#include <lib/rvl/EXI/EXICommon.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Documentation from:
|
||||
* https://www.gc-forever.com/yagcd/chap5.html#sec5.9
|
||||
*/
|
||||
typedef struct ExiChannelControl {
|
||||
u32 csr; // at 0x0
|
||||
void* dmaAddr; // at 0x4
|
||||
u32 dmaLen; // at 0x8
|
||||
u32 cr; // at 0xC
|
||||
u32 imm; // at 0x10
|
||||
} ExiChannelControl;
|
||||
|
||||
volatile ExiChannelControl EXI_CHAN_CTRL[EXI_MAX_CHAN] : 0xCD006800;
|
||||
|
||||
// CSR - Control Status Register
|
||||
#define EXI_CSR_EXIINTMASK (1 << 0)
|
||||
#define EXI_CSR_EXIINT (1 << 1)
|
||||
#define EXI_CSR_TCINTMASK (1 << 2)
|
||||
#define EXI_CSR_TCINT (1 << 3)
|
||||
#define EXI_CSR_EXTINTMASK (1 << 10)
|
||||
#define EXI_CSR_EXTINT (1 << 11)
|
||||
#define EXI_CSR_EXT (1 << 12)
|
||||
#define EXI_CSR_ROMDIS (1 << 13)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef RVL_SDK_EXI_UART_H
|
||||
#define RVL_SDK_EXI_UART_H
|
||||
#include <lib/rvl/EXI/EXIBios.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void __OSEnableBarnacle(EXIChannel, u32);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef RVL_SDK_PUBLIC_FS_H
|
||||
#define RVL_SDK_PUBLIC_FS_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/FS/fs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,73 @@
|
||||
#ifndef RVL_SDK_FS_H
|
||||
#define RVL_SDK_FS_H
|
||||
#include <lib/rvl/IPC.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FS_MAX_PATH 64
|
||||
|
||||
typedef void (*FSAsyncCallback)(s32 result, void* arg);
|
||||
|
||||
typedef struct FSStats {
|
||||
char UNK_0x0[0x1C];
|
||||
} FSStats;
|
||||
|
||||
// Could be more fields, but not larger than 32B
|
||||
typedef struct FSFileStats {
|
||||
u32 length; // at 0x0
|
||||
u32 position; // at 0x4
|
||||
} FSFileStats ALIGN(32);
|
||||
|
||||
s32 ISFS_OpenLib(void);
|
||||
s32 ISFS_CreateDir(const char* path, u32 attr, u32 ownerPerm, u32 groupPerm,
|
||||
u32 otherPerm);
|
||||
s32 ISFS_CreateDirAsync(const char* path, u32 attr, u32 ownerPerm,
|
||||
u32 groupPerm, u32 otherPerm, FSAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 ISFS_ReadDir(const char* path, char* filesOut, u32* fileCountOut);
|
||||
s32 ISFS_ReadDirAsync(const char* path, char* filesOut, u32* fileCountOut,
|
||||
FSAsyncCallback callback, void* callbackArg);
|
||||
s32 ISFS_GetAttr(const char* path, u32* ownerIdOut, u16* groupIdOut,
|
||||
u32* attrOut, u32* ownerPermOut, u32* groupPermOut,
|
||||
u32* otherPermOut);
|
||||
s32 ISFS_GetAttrAsync(const char* path, u32* ownerIdOut, u16* groupIdOut,
|
||||
u32* attrOut, u32* ownerPermOut, u32* groupPermOut,
|
||||
u32* otherPermOut, FSAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 ISFS_Delete(const char* path);
|
||||
s32 ISFS_DeleteAsync(const char* path, FSAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 ISFS_Rename(const char* from, const char* to);
|
||||
s32 ISFS_RenameAsync(const char* from, const char* to, FSAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 ISFS_GetUsage(const char* path, s32* blockCountOut, s32* fileCountOut);
|
||||
s32 ISFS_CreateFile(const char* path, u32 attr, u32 ownerPerm, u32 groupPerm,
|
||||
u32 otherPerm);
|
||||
s32 ISFS_CreateFileAsync(const char* path, u32 attr, u32 ownerPerm,
|
||||
u32 groupPerm, u32 otherPerm, FSAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 ISFS_Open(const char* path, IPCOpenMode mode);
|
||||
s32 ISFS_OpenAsync(const char* path, IPCOpenMode mode, FSAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 ISFS_GetFileStats(s32 fd, FSFileStats* statsOut);
|
||||
s32 ISFS_GetFileStatsAsync(s32 fd, FSFileStats* statsOut,
|
||||
FSAsyncCallback callback, void* callbackArg);
|
||||
s32 ISFS_Seek(s32 fd, s32 offset, IPCSeekMode mode);
|
||||
s32 ISFS_SeekAsync(s32 fd, s32 offset, IPCSeekMode mode,
|
||||
FSAsyncCallback callback, void* callbackArg);
|
||||
s32 ISFS_Read(s32 fd, void* dst, s32 len);
|
||||
s32 ISFS_ReadAsync(s32 fd, void* dst, s32 len, FSAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 ISFS_Write(s32 fd, const void* src, s32 len);
|
||||
s32 ISFS_WriteAsync(s32 fd, const void* src, s32 len, FSAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 ISFS_Close(s32 fd);
|
||||
s32 ISFS_CloseAsync(s32 fd, FSAsyncCallback callback, void* callbackArg);
|
||||
s32 ISFS_ShutdownAsync(FSAsyncCallback callback, void* callbackArg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef RVL_SDK_PUBLIC_GX_H
|
||||
#define RVL_SDK_PUBLIC_GX_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/GX/GXAttr.h>
|
||||
#include <lib/rvl/GX/GXBump.h>
|
||||
#include <lib/rvl/GX/GXDisplayList.h>
|
||||
#include <lib/rvl/GX/GXDraw.h>
|
||||
#include <lib/rvl/GX/GXFifo.h>
|
||||
#include <lib/rvl/GX/GXFrameBuf.h>
|
||||
#include <lib/rvl/GX/GXGeometry.h>
|
||||
#include <lib/rvl/GX/GXHardware.h>
|
||||
#include <lib/rvl/GX/GXHardwareBP.h>
|
||||
#include <lib/rvl/GX/GXHardwareCP.h>
|
||||
#include <lib/rvl/GX/GXHardwareXF.h>
|
||||
#include <lib/rvl/GX/GXInit.h>
|
||||
#include <lib/rvl/GX/GXInternal.h>
|
||||
#include <lib/rvl/GX/GXLight.h>
|
||||
#include <lib/rvl/GX/GXMisc.h>
|
||||
#include <lib/rvl/GX/GXPixel.h>
|
||||
#include <lib/rvl/GX/GXTev.h>
|
||||
#include <lib/rvl/GX/GXTexture.h>
|
||||
#include <lib/rvl/GX/GXTransform.h>
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/GX/GXVert.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,58 @@
|
||||
#ifndef RVL_SDK_GX_ATTR_H
|
||||
#define RVL_SDK_GX_ATTR_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _GXVtxDescList {
|
||||
GXAttr attr; // at 0x0
|
||||
GXAttrType type; // at 0x4
|
||||
} GXVtxDescList;
|
||||
|
||||
typedef struct _GXVtxAttrFmtList {
|
||||
GXAttr attr; // at 0x0
|
||||
GXCompCnt compCnt; // at 0x4
|
||||
GXCompType compType; // at 0x8
|
||||
u8 shift; // at 0xC
|
||||
} GXVtxAttrFmtList;
|
||||
|
||||
void GXSetVtxDesc(GXAttr name, GXAttrType type);
|
||||
void GXSetVtxDescv(const GXVtxDescList* list);
|
||||
void GXGetVtxDesc(GXAttr name, GXAttrType* type);
|
||||
void GXGetVtxDescv(GXVtxDescList* list);
|
||||
void GXClearVtxDesc(void);
|
||||
void GXSetVtxAttrFmt(GXVtxFmt fmt, GXAttr attr, GXCompCnt compCnt,
|
||||
GXCompType compType, u8 shift);
|
||||
|
||||
// TODO: Please find a way to get rid of this
|
||||
#ifdef GXATTR_MATCH_HACK
|
||||
void GXSetVtxAttrFmtv(s16 fmt, const GXVtxAttrFmtList* list);
|
||||
#else
|
||||
void GXSetVtxAttrFmtv(GXVtxFmt fmt, const GXVtxAttrFmtList* list);
|
||||
#endif
|
||||
|
||||
void GXGetVtxAttrFmt(GXVtxFmt fmt, GXAttr attr, GXCompCnt* compCnt,
|
||||
GXCompType* compType, u8* shift);
|
||||
void GXGetVtxAttrFmtv(GXVtxFmt fmt, GXVtxAttrFmtList* list);
|
||||
void GXSetArray(GXAttr attr, u32 base, u8 stride);
|
||||
void GXInvalidateVtxCache(void);
|
||||
void GXSetTexCoordGen2(GXTexCoordID id, GXTexGenType type, GXTexGenSrc src,
|
||||
u32 texMtxIdx, GXBool normalize, u32 dualTexMtxIdx);
|
||||
void GXSetNumTexGens(u8 num);
|
||||
|
||||
void __GXSetVCD(void);
|
||||
void __GXCalculateVLim(void);
|
||||
void __GXSetVAT(void);
|
||||
|
||||
static void GXSetTexCoordGen(GXTexCoordID id, GXTexGenType type,
|
||||
GXTexGenSrc src, u32 texMtxIdx) {
|
||||
// TODO: What matrix index is this???
|
||||
GXSetTexCoordGen2(id, type, src, texMtxIdx, FALSE, 125);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef RVL_SDK_GX_BUMP_H
|
||||
#define RVL_SDK_GX_BUMP_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXSetTevIndirect(GXTevStageID tevStage, GXIndTexStageID texStage,
|
||||
GXIndTexFormat texFmt, GXIndTexBiasSel biasSel,
|
||||
GXIndTexMtxID mtxId, GXIndTexWrap wrapS,
|
||||
GXIndTexWrap wrapT, GXBool addPrev, GXBool utcLod,
|
||||
GXIndTexAlphaSel alphaSel);
|
||||
void GXSetIndTexMtx(GXIndTexMtxID id, const f32 offset[2][3], s8 scaleExp);
|
||||
void GXSetIndTexCoordScale(GXIndTexStageID stage, GXIndTexScale scaleS,
|
||||
GXIndTexScale scaleT);
|
||||
void GXSetIndTexOrder(GXIndTexStageID stage, GXTexCoordID coord,
|
||||
GXTexMapID map);
|
||||
void GXSetNumIndStages(u8 num);
|
||||
void GXSetTevDirect(GXTevStageID stage);
|
||||
|
||||
void __GXUpdateBPMask(void);
|
||||
void __GXSetIndirectMask(u32 mask);
|
||||
void __GXFlushTextureState(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef RVL_SDK_GX_DISPLAY_LIST_H
|
||||
#define RVL_SDK_GX_DISPLAY_LIST_H
|
||||
#include <lib/rvl/GX/GXHardware.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXBeginDisplayList(void* list, u32 size);
|
||||
u32 GXEndDisplayList(void);
|
||||
void GXCallDisplayList(void* list, u32 size);
|
||||
|
||||
static inline void GXFastCallDisplayList(void* list, u32 size) {
|
||||
WGPIPE.c = GX_FIFO_CMD_CALL_DL;
|
||||
WGPIPE.p = list;
|
||||
WGPIPE.i = size;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef RVL_SDK_GX_DRAW_H
|
||||
#define RVL_SDK_GX_DRAW_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXDrawCylinder(u8 sides);
|
||||
void GXDrawSphere(u32 stacks, u32 sectors);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef RVL_SDK_GX_FIFO_H
|
||||
#define RVL_SDK_GX_FIFO_H
|
||||
#include <lib/rvl/GX/GXInternal.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GX_DECL_PUBLIC_STRUCT(GXFifoObj, 128);
|
||||
|
||||
void GXSetCPUFifo(GXFifoObj*);
|
||||
BOOL GXGetCPUFifo(GXFifoObj*);
|
||||
|
||||
u32 GXGetFifoCount(GXFifoObj*);
|
||||
u8 GXGetFifoWrap(GXFifoObj*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef RVL_SDK_GX_FRAMEBUF_H
|
||||
#define RVL_SDK_GX_FRAMEBUF_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _GXRenderModeObj {
|
||||
u32 tvInfo; // at 0x0
|
||||
u16 fbWidth; // at 0x4
|
||||
u16 efbHeight; // at 0x6
|
||||
u16 xfbHeight; // at 0x8
|
||||
u16 viXOrigin; // at 0xA
|
||||
u16 viYOrigin; // at 0xC
|
||||
u16 viWidth; // at 0xE
|
||||
u16 viHeight; // at 0x10
|
||||
u32 xfbMode; // at 0x14
|
||||
u8 field_rendering; // at 0x18
|
||||
u8 aa; // at 0x19
|
||||
u8 sample_pattern[12][2]; // at 0x1A
|
||||
u8 vfilter[7]; // at 0x32
|
||||
} GXRenderModeObj;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef RVL_SDK_GX_GEOMETRY_H
|
||||
#define RVL_SDK_GX_GEOMETRY_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXBegin(GXPrimitive prim, GXVtxFmt fmt, u16 verts);
|
||||
static void GXEnd(void) {}
|
||||
|
||||
void GXSetLineWidth(u8 width, u32 offset);
|
||||
void GXSetPointSize(u8 size, u32 offset);
|
||||
void GXEnableTexOffsets(GXTexCoordID coordId, GXBool lineOfs,
|
||||
GXBool pointOfs);
|
||||
void GXSetCullMode(GXCullMode mode);
|
||||
void GXGetCullMode(GXCullMode* out);
|
||||
void GXSetCoPlanar(GXBool coplanar);
|
||||
|
||||
void __GXSetDirtyState(void);
|
||||
void __GXSendFlushPrim(void);
|
||||
void __GXSetGenMode(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,196 @@
|
||||
#ifndef RVL_SDK_GX_HARDWARE_H
|
||||
#define RVL_SDK_GX_HARDWARE_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Documentation from:
|
||||
* https://www.gc-forever.com/yagcd/chap8.html#sec8
|
||||
* https://www.gc-forever.com/yagcd/chap5.html#sec5
|
||||
* https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/BPMemory.h
|
||||
* https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/XFMemory.h
|
||||
* https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/OpcodeDecoding.h
|
||||
* https://patents.google.com/patent/US6700586B1/en
|
||||
* https://patents.google.com/patent/US6639595B1/en
|
||||
* https://patents.google.com/patent/US7002591
|
||||
* https://patents.google.com/patent/US6697074
|
||||
*/
|
||||
|
||||
/************************************************************
|
||||
*
|
||||
*
|
||||
* GX FIFO
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
/**
|
||||
* FIFO write/gather pipe
|
||||
*/
|
||||
extern volatile union {
|
||||
// 1-byte
|
||||
char c;
|
||||
unsigned char uc;
|
||||
// 2-byte
|
||||
short s;
|
||||
unsigned short us;
|
||||
// 4-byte
|
||||
int i;
|
||||
unsigned int ui;
|
||||
void* p;
|
||||
float f;
|
||||
} WGPIPE : 0xCC008000;
|
||||
|
||||
/**
|
||||
* FIFO commands
|
||||
*/
|
||||
typedef enum {
|
||||
GX_FIFO_CMD_NOOP = 0x00,
|
||||
|
||||
GX_FIFO_CMD_LOAD_BP_REG = 0x61,
|
||||
GX_FIFO_CMD_LOAD_CP_REG = 0x08,
|
||||
GX_FIFO_CMD_LOAD_XF_REG = 0x10,
|
||||
|
||||
GX_FIFO_CMD_LOAD_INDX_A = 0x20,
|
||||
GX_FIFO_CMD_LOAD_INDX_B = 0x28,
|
||||
GX_FIFO_CMD_LOAD_INDX_C = 0x30,
|
||||
GX_FIFO_CMD_LOAD_INDX_D = 0x38,
|
||||
|
||||
GX_FIFO_CMD_CALL_DL = 0x40,
|
||||
GX_FIFO_CMD_INVAL_VTX = 0x48
|
||||
} GXFifoCmd;
|
||||
|
||||
#define __GX_FIFO_SET_LOAD_INDX_DST(reg, x) ((reg) = GX_BITSET(reg, 20, 12, x))
|
||||
#define __GX_FIFO_SET_LOAD_INDX_NELEM(reg, x) ((reg) = GX_BITSET(reg, 16, 4, x))
|
||||
#define __GX_FIFO_SET_LOAD_INDX_INDEX(reg, x) ((reg) = GX_BITSET(reg, 0, 16, x))
|
||||
|
||||
#define __GX_FIFO_LOAD_INDX(reg, dst, nelem, index) \
|
||||
{ \
|
||||
u32 cmd = 0; \
|
||||
__GX_FIFO_SET_LOAD_INDX_DST(cmd, dst); \
|
||||
__GX_FIFO_SET_LOAD_INDX_NELEM(cmd, nelem); \
|
||||
__GX_FIFO_SET_LOAD_INDX_INDEX(cmd, index); \
|
||||
WGPIPE.c = reg; \
|
||||
WGPIPE.i = cmd; \
|
||||
}
|
||||
|
||||
#define GX_FIFO_LOAD_INDX_A(dst, nelem, index) \
|
||||
__GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_A, dst, nelem, index)
|
||||
|
||||
#define GX_FIFO_LOAD_INDX_B(dst, nelem, index) \
|
||||
__GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_B, dst, nelem, index)
|
||||
|
||||
#define GX_FIFO_LOAD_INDX_C(dst, nelem, index) \
|
||||
__GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_C, dst, nelem, index)
|
||||
|
||||
#define GX_FIFO_LOAD_INDX_D(dst, nelem, index) \
|
||||
__GX_FIFO_LOAD_INDX(GX_FIFO_CMD_LOAD_INDX_D, dst, nelem, index)
|
||||
|
||||
/************************************************************
|
||||
*
|
||||
*
|
||||
* GX Blitting Processor (BP)
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
/**
|
||||
* Load immediate value into BP register
|
||||
*/
|
||||
#define GX_BP_LOAD_REG(data) \
|
||||
WGPIPE.c = GX_FIFO_CMD_LOAD_BP_REG; \
|
||||
WGPIPE.i = (data);
|
||||
|
||||
/**
|
||||
* Set BP command opcode (first 8 bits)
|
||||
*/
|
||||
#define GX_BP_SET_OPCODE(cmd, opcode) (cmd) = GX_BITSET(cmd, 0, 8, (opcode))
|
||||
|
||||
/************************************************************
|
||||
*
|
||||
*
|
||||
* GX Command Processor (CP)
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
/**
|
||||
* Load immediate value into CP register
|
||||
*/
|
||||
#define GX_CP_LOAD_REG(addr, data) \
|
||||
WGPIPE.c = GX_FIFO_CMD_LOAD_CP_REG; \
|
||||
WGPIPE.c = (addr); \
|
||||
WGPIPE.i = (data);
|
||||
|
||||
/************************************************************
|
||||
*
|
||||
*
|
||||
* GX Transform Unit (XF)
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
/**
|
||||
* XF memory
|
||||
*/
|
||||
typedef enum {
|
||||
GX_XF_MEM_POSMTX = 0x0000,
|
||||
GX_XF_MEM_NRMMTX = 0x0400,
|
||||
GX_XF_MEM_DUALTEXMTX = 0x0500,
|
||||
GX_XF_MEM_LIGHTOBJ = 0x0600
|
||||
} GXXfMem;
|
||||
|
||||
/**
|
||||
* Header for an XF register load
|
||||
*/
|
||||
#define GX_XF_LOAD_REG_HDR(addr) \
|
||||
WGPIPE.c = GX_FIFO_CMD_LOAD_XF_REG; \
|
||||
WGPIPE.i = (addr);
|
||||
|
||||
/**
|
||||
* Load immediate value into XF register
|
||||
*/
|
||||
#define GX_XF_LOAD_REG(addr, data) \
|
||||
GX_XF_LOAD_REG_HDR(addr); \
|
||||
WGPIPE.i = (data);
|
||||
|
||||
/**
|
||||
* Load immediate values into multiple XF registers
|
||||
*/
|
||||
#define GX_XF_LOAD_REGS(size, addr) \
|
||||
{ \
|
||||
u32 cmd = 0; \
|
||||
cmd |= (addr); \
|
||||
cmd |= (size) << 16; \
|
||||
GX_XF_LOAD_REG_HDR(cmd); \
|
||||
}
|
||||
|
||||
/**
|
||||
* Enums for Tex0-Tex7 register fields
|
||||
*/
|
||||
typedef enum {
|
||||
GX_XF_TEX_PROJ_ST, //! (s,t): texmul is 2x4
|
||||
GX_XF_TEX_PROJ_STQ //! (s,t,q): texmul is 3x4
|
||||
} GXXfTexProj;
|
||||
|
||||
typedef enum {
|
||||
GX_XF_TEX_FORM_AB11, //! (A, B, 1.0, 1.0) (used for regular texture source)
|
||||
GX_XF_TEX_FORM_ABC1 //! (A, B, C, 1.0) (used for geometry or normal source)
|
||||
} GXXfTexForm;
|
||||
|
||||
typedef enum {
|
||||
GX_XF_TG_REGULAR, //! Regular transformation (transform incoming data)
|
||||
GX_XF_TG_BUMP, //! Texgen bump mapping
|
||||
GX_XF_TG_CLR0, //! Color texgen: (s,t)=(r,g:b) (g and b are concatenated),
|
||||
//! color0
|
||||
GX_XF_TG_CLR1 //! Color texgen: (s,t)=(r,g:b) (g and b are concatenated),
|
||||
//! color 1
|
||||
} GXXfTexGen;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,977 @@
|
||||
#ifndef RVL_SDK_GX_HARDWARE_BP_H
|
||||
#define RVL_SDK_GX_HARDWARE_BP_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
*
|
||||
* GX Blitting Processor (BP)
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
* BP registers
|
||||
*/
|
||||
typedef enum {
|
||||
GX_BP_REG_GENMODE = 0x0,
|
||||
GX_BP_REG_DISPCOPYFILTER0 = 0x1,
|
||||
GX_BP_REG_DISPCOPYFILTER1 = 0x2,
|
||||
GX_BP_REG_DISPCOPYFILTER2 = 0x3,
|
||||
GX_BP_REG_DISPCOPYFILTER3 = 0x4,
|
||||
GX_BP_REG_INDMTX0A = 0x6,
|
||||
GX_BP_REG_INDMTX0B = 0x7,
|
||||
GX_BP_REG_INDMTX0C = 0x8,
|
||||
GX_BP_REG_INDMTX1A = 0x9,
|
||||
GX_BP_REG_INDMTX1B = 0xA,
|
||||
GX_BP_REG_INDMTX1C = 0xB,
|
||||
GX_BP_REG_INDMTX2A = 0xC,
|
||||
GX_BP_REG_INDMTX2B = 0xD,
|
||||
GX_BP_REG_INDMTX2C = 0xE,
|
||||
GX_BP_REG_INDIMASK = 0xF,
|
||||
GX_BP_REG_INDTEVSTAGE0 = 0x10,
|
||||
GX_BP_REG_INDTEVSTAGE1 = 0x11,
|
||||
GX_BP_REG_INDTEVSTAGE2 = 0x12,
|
||||
GX_BP_REG_INDTEVSTAGE3 = 0x13,
|
||||
GX_BP_REG_INDTEVSTAGE4 = 0x14,
|
||||
GX_BP_REG_INDTEVSTAGE5 = 0x15,
|
||||
GX_BP_REG_INDTEVSTAGE6 = 0x16,
|
||||
GX_BP_REG_INDTEVSTAGE7 = 0x17,
|
||||
GX_BP_REG_INDTEVSTAGE8 = 0x18,
|
||||
GX_BP_REG_INDTEVSTAGE9 = 0x19,
|
||||
GX_BP_REG_INDTEVSTAGE10 = 0x1A,
|
||||
GX_BP_REG_INDTEVSTAGE11 = 0x1B,
|
||||
GX_BP_REG_INDTEVSTAGE12 = 0x1C,
|
||||
GX_BP_REG_INDTEVSTAGE13 = 0x1D,
|
||||
GX_BP_REG_INDTEVSTAGE14 = 0x1E,
|
||||
GX_BP_REG_INDTEVSTAGE15 = 0x1F,
|
||||
GX_BP_REG_SCISSORTL = 0x20,
|
||||
GX_BP_REG_SCISSORBR = 0x21,
|
||||
GX_BP_REG_LINEPTWIDTH = 0x22,
|
||||
GX_BP_REG_PERF0TRI = 0x23,
|
||||
GX_BP_REG_PERF0QUAD = 0x24,
|
||||
GX_BP_REG_RAS1_SS0 = 0x25,
|
||||
GX_BP_REG_RAS1_SS1 = 0x26,
|
||||
GX_BP_REG_RAS1_IREF = 0x27,
|
||||
GX_BP_REG_RAS1_TREF0 = 0x28,
|
||||
GX_BP_REG_RAS1_TREF1 = 0x29,
|
||||
GX_BP_REG_RAS1_TREF2 = 0x2A,
|
||||
GX_BP_REG_RAS1_TREF3 = 0x2B,
|
||||
GX_BP_REG_RAS1_TREF4 = 0x2C,
|
||||
GX_BP_REG_RAS1_TREF5 = 0x2D,
|
||||
GX_BP_REG_RAS1_TREF6 = 0x2E,
|
||||
GX_BP_REG_RAS1_TREF7 = 0x2F,
|
||||
GX_BP_REG_SU_SSIZE0 = 0x30,
|
||||
GX_BP_REG_SU_TSIZE0 = 0x31,
|
||||
GX_BP_REG_SU_SSIZE1 = 0x32,
|
||||
GX_BP_REG_SU_TSIZE1 = 0x33,
|
||||
GX_BP_REG_SU_SSIZE2 = 0x34,
|
||||
GX_BP_REG_SU_TSIZE2 = 0x35,
|
||||
GX_BP_REG_SU_SSIZE3 = 0x36,
|
||||
GX_BP_REG_SU_TSIZE3 = 0x37,
|
||||
GX_BP_REG_SU_SSIZE4 = 0x38,
|
||||
GX_BP_REG_SU_TSIZE4 = 0x39,
|
||||
GX_BP_REG_SU_SSIZE5 = 0x3A,
|
||||
GX_BP_REG_SU_TSIZE5 = 0x3B,
|
||||
GX_BP_REG_SU_SSIZE6 = 0x3C,
|
||||
GX_BP_REG_SU_TSIZE6 = 0x3D,
|
||||
GX_BP_REG_SU_SSIZE7 = 0x3E,
|
||||
GX_BP_REG_SU_TSIZE7 = 0x3F,
|
||||
GX_BP_REG_ZMODE = 0x40,
|
||||
GX_BP_REG_BLENDMODE = 0x41,
|
||||
GX_BP_REG_DSTALPHA = 0x42,
|
||||
GX_BP_REG_ZCONTROL = 0x43,
|
||||
GX_BP_REG_FIELDMASK = 0x44,
|
||||
GX_BP_REG_DRAWDONE = 0x45,
|
||||
GX_BP_REG_PETOKEN = 0x47,
|
||||
GX_BP_REG_PETOKENINT = 0x48,
|
||||
GX_BP_REG_TEXCOPYSRCXY = 0x49,
|
||||
GX_BP_REG_TEXCOPYSRCWH = 0x4A,
|
||||
GX_BP_REG_TEXCOPYDST = 0x4B,
|
||||
GX_BP_REG_DISPCOPYSTRIDE = 0x4D,
|
||||
GX_BP_REG_DISPCOPYSCALEY = 0x4E,
|
||||
GX_BP_REG_COPYCLEARAR = 0x4F,
|
||||
GX_BP_REG_COPYCLEARGB = 0x50,
|
||||
GX_BP_REG_COPYCLEARZ = 0x51,
|
||||
GX_BP_REG_COPYFILTER0 = 0x53,
|
||||
GX_BP_REG_COPYFILTER1 = 0x54,
|
||||
GX_BP_REG_BOUNDINGBOX0 = 0x55,
|
||||
GX_BP_REG_BOUNDINGBOX1 = 0x56,
|
||||
GX_BP_REG_SCISSOROFFSET = 0x59,
|
||||
GX_BP_REG_TMEMPRELOADADDR = 0x60,
|
||||
GX_BP_REG_TMEMPRELOADEVEN = 0x61,
|
||||
GX_BP_REG_TMEMPRELOADODD = 0x62,
|
||||
GX_BP_REG_TMEMPRELOADMODE = 0x63,
|
||||
GX_BP_REG_TMEMTLUTSRC = 0x64,
|
||||
GX_BP_REG_TMEMTLUTDST = 0x65,
|
||||
GX_BP_REG_TMEMTEXINVALIDATE = 0x66,
|
||||
GX_BP_REG_PERF1 = 0x67,
|
||||
GX_BP_REG_FIELDMODE = 0x68,
|
||||
GX_BP_REG_SETMODE0_TEX0 = 0x80,
|
||||
GX_BP_REG_SETMODE0_TEX1 = 0x81,
|
||||
GX_BP_REG_SETMODE0_TEX2 = 0x82,
|
||||
GX_BP_REG_SETMODE0_TEX3 = 0x83,
|
||||
GX_BP_REG_SETMODE1_TEX0 = 0x84,
|
||||
GX_BP_REG_SETMODE1_TEX1 = 0x85,
|
||||
GX_BP_REG_SETMODE1_TEX2 = 0x86,
|
||||
GX_BP_REG_SETMODE1_TEX3 = 0x87,
|
||||
GX_BP_REG_SETIMAGE0_TEX0 = 0x88,
|
||||
GX_BP_REG_SETIMAGE0_TEX1 = 0x89,
|
||||
GX_BP_REG_SETIMAGE0_TEX2 = 0x8A,
|
||||
GX_BP_REG_SETIMAGE0_TEX3 = 0x8B,
|
||||
GX_BP_REG_SETIMAGE1_TEX0 = 0x8C,
|
||||
GX_BP_REG_SETIMAGE1_TEX1 = 0x8D,
|
||||
GX_BP_REG_SETIMAGE1_TEX2 = 0x8E,
|
||||
GX_BP_REG_SETIMAGE1_TEX3 = 0x8F,
|
||||
GX_BP_REG_SETIMAGE2_TEX0 = 0x90,
|
||||
GX_BP_REG_SETIMAGE2_TEX1 = 0x91,
|
||||
GX_BP_REG_SETIMAGE2_TEX2 = 0x92,
|
||||
GX_BP_REG_SETIMAGE2_TEX3 = 0x93,
|
||||
GX_BP_REG_SETIMAGE3_TEX0 = 0x94,
|
||||
GX_BP_REG_SETIMAGE3_TEX1 = 0x95,
|
||||
GX_BP_REG_SETIMAGE3_TEX2 = 0x96,
|
||||
GX_BP_REG_SETIMAGE3_TEX3 = 0x97,
|
||||
GX_BP_REG_SETTLUT_TEX0 = 0x98,
|
||||
GX_BP_REG_SETTLUT_TEX1 = 0x99,
|
||||
GX_BP_REG_SETTLUT_TEX2 = 0x9A,
|
||||
GX_BP_REG_SETTLUT_TEX3 = 0x9B,
|
||||
GX_BP_REG_SETMODE0_TEX4 = 0xA0,
|
||||
GX_BP_REG_SETMODE0_TEX5 = 0xA1,
|
||||
GX_BP_REG_SETMODE0_TEX6 = 0xA2,
|
||||
GX_BP_REG_SETMODE0_TEX7 = 0xA3,
|
||||
GX_BP_REG_SETMODE1_TEX4 = 0xA4,
|
||||
GX_BP_REG_SETMODE1_TEX5 = 0xA5,
|
||||
GX_BP_REG_SETMODE1_TEX6 = 0xA6,
|
||||
GX_BP_REG_SETMODE1_TEX7 = 0xA7,
|
||||
GX_BP_REG_SETIMAGE0_TEX4 = 0xA8,
|
||||
GX_BP_REG_SETIMAGE0_TEX5 = 0xA9,
|
||||
GX_BP_REG_SETIMAGE0_TEX6 = 0xAA,
|
||||
GX_BP_REG_SETIMAGE0_TEX7 = 0xAB,
|
||||
GX_BP_REG_SETIMAGE1_TEX4 = 0xAC,
|
||||
GX_BP_REG_SETIMAGE1_TEX5 = 0xAD,
|
||||
GX_BP_REG_SETIMAGE1_TEX6 = 0xAE,
|
||||
GX_BP_REG_SETIMAGE1_TEX7 = 0xAF,
|
||||
GX_BP_REG_SETIMAGE2_TEX4 = 0xB0,
|
||||
GX_BP_REG_SETIMAGE2_TEX5 = 0xB1,
|
||||
GX_BP_REG_SETIMAGE2_TEX6 = 0xB2,
|
||||
GX_BP_REG_SETIMAGE2_TEX7 = 0xB3,
|
||||
GX_BP_REG_SETIMAGE3_TEX4 = 0xB4,
|
||||
GX_BP_REG_SETIMAGE3_TEX5 = 0xB5,
|
||||
GX_BP_REG_SETIMAGE3_TEX6 = 0xB6,
|
||||
GX_BP_REG_SETIMAGE3_TEX7 = 0xB7,
|
||||
GX_BP_REG_SETTLUT_TEX4 = 0xB8,
|
||||
GX_BP_REG_SETTLUT_TEX5 = 0xB9,
|
||||
GX_BP_REG_SETTLUT_TEX6 = 0xBA,
|
||||
GX_BP_REG_SETTLUT_TEX7 = 0xBB,
|
||||
GX_BP_REG_TEVCOLORCOMBINER0 = 0xC0,
|
||||
GX_BP_REG_TEVALPHACOMBINER0 = 0xC1,
|
||||
GX_BP_REG_TEVCOLORCOMBINER1 = 0xC2,
|
||||
GX_BP_REG_TEVALPHACOMBINER1 = 0xC3,
|
||||
GX_BP_REG_TEVCOLORCOMBINER2 = 0xC4,
|
||||
GX_BP_REG_TEVALPHACOMBINER2 = 0xC5,
|
||||
GX_BP_REG_TEVCOLORCOMBINER3 = 0xC6,
|
||||
GX_BP_REG_TEVALPHACOMBINER3 = 0xC7,
|
||||
GX_BP_REG_TEVCOLORCOMBINER4 = 0xC8,
|
||||
GX_BP_REG_TEVALPHACOMBINER4 = 0xC9,
|
||||
GX_BP_REG_TEVCOLORCOMBINER5 = 0xCA,
|
||||
GX_BP_REG_TEVALPHACOMBINER5 = 0xCB,
|
||||
GX_BP_REG_TEVCOLORCOMBINER6 = 0xCC,
|
||||
GX_BP_REG_TEVALPHACOMBINER6 = 0xCD,
|
||||
GX_BP_REG_TEVCOLORCOMBINER7 = 0xCE,
|
||||
GX_BP_REG_TEVALPHACOMBINER7 = 0xCF,
|
||||
GX_BP_REG_TEVCOLORCOMBINER8 = 0xD0,
|
||||
GX_BP_REG_TEVALPHACOMBINER8 = 0xD1,
|
||||
GX_BP_REG_TEVCOLORCOMBINER9 = 0xD2,
|
||||
GX_BP_REG_TEVALPHACOMBINER9 = 0xD3,
|
||||
GX_BP_REG_TEVCOLORCOMBINER10 = 0xD4,
|
||||
GX_BP_REG_TEVALPHACOMBINER10 = 0xD5,
|
||||
GX_BP_REG_TEVCOLORCOMBINER11 = 0xD6,
|
||||
GX_BP_REG_TEVALPHACOMBINER11 = 0xD7,
|
||||
GX_BP_REG_TEVCOLORCOMBINER12 = 0xD8,
|
||||
GX_BP_REG_TEVALPHACOMBINER12 = 0xD9,
|
||||
GX_BP_REG_TEVCOLORCOMBINER13 = 0xDA,
|
||||
GX_BP_REG_TEVALPHACOMBINER13 = 0xDB,
|
||||
GX_BP_REG_TEVCOLORCOMBINER14 = 0xDC,
|
||||
GX_BP_REG_TEVALPHACOMBINER14 = 0xDD,
|
||||
GX_BP_REG_TEVCOLORCOMBINER15 = 0xDE,
|
||||
GX_BP_REG_TEVALPHACOMBINER15 = 0xDF,
|
||||
GX_BP_REG_TEVREG0LO = 0xE0,
|
||||
GX_BP_REG_TEVREG0HI = 0xE1,
|
||||
GX_BP_REG_TEVREG1LO = 0xE2,
|
||||
GX_BP_REG_TEVREG1HI = 0xE3,
|
||||
GX_BP_REG_TEVREG2LO = 0xE4,
|
||||
GX_BP_REG_TEVREG2HI = 0xE5,
|
||||
GX_BP_REG_TEVREG3LO = 0xE6,
|
||||
GX_BP_REG_TEVREG3HI = 0xE7,
|
||||
GX_BP_REG_FOGRANGE = 0xE8,
|
||||
GX_BP_REG_FOGRANGEK0 = 0xE9,
|
||||
GX_BP_REG_FOGRANGEK1 = 0xEA,
|
||||
GX_BP_REG_FOGRANGEK2 = 0xEB,
|
||||
GX_BP_REG_FOGRANGEK3 = 0xEC,
|
||||
GX_BP_REG_FOGRANGEK4 = 0xED,
|
||||
GX_BP_REG_FOGPARAM0 = 0xEE,
|
||||
GX_BP_REG_FOGPARAM1 = 0xEF,
|
||||
GX_BP_REG_FOGPARAM2 = 0xF0,
|
||||
GX_BP_REG_FOGPARAM3 = 0xF1,
|
||||
GX_BP_REG_FOGCOLOR = 0xF2,
|
||||
GX_BP_REG_ALPHACOMPARE = 0xF3,
|
||||
GX_BP_REG_ZTEXTURE0 = 0xF4,
|
||||
GX_BP_REG_ZTEXTURE1 = 0xF5,
|
||||
GX_BP_REG_TEVKSEL0 = 0xF6,
|
||||
GX_BP_REG_TEVKSEL1 = 0xF7,
|
||||
GX_BP_REG_TEVKSEL2 = 0xF8,
|
||||
GX_BP_REG_TEVKSEL3 = 0xF9,
|
||||
GX_BP_REG_TEVKSEL4 = 0xFA,
|
||||
GX_BP_REG_TEVKSEL5 = 0xFB,
|
||||
GX_BP_REG_TEVKSEL6 = 0xFC,
|
||||
GX_BP_REG_TEVKSEL7 = 0xFD,
|
||||
GX_BP_REG_SSMASK = 0xFE,
|
||||
} GX_BP_REG;
|
||||
|
||||
/**
|
||||
* BP register 0x0 - GenMode
|
||||
*/
|
||||
// NUMTEX [28:31] (4) - Active texture count
|
||||
#define GX_BP_GENMODE_NUMTEX_ST 28
|
||||
#define GX_BP_GENMODE_NUMTEX_END 31
|
||||
#define GX_BP_GENMODE_NUMTEX_SZ 4
|
||||
#define GX_BP_GENMODE_NUMTEX_MASK (((1 << 4) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_GENMODE_NUMTEX(reg) GX_BITGET(reg, 28, 4)
|
||||
#define GX_BP_SET_GENMODE_NUMTEX(reg, x) ((reg) = GX_BITSET(reg, 28, 4, x))
|
||||
// NUMCOLORS [25:27] (3) - Color/channel count
|
||||
#define GX_BP_GENMODE_NUMCOLORS_ST 25
|
||||
#define GX_BP_GENMODE_NUMCOLORS_END 27
|
||||
#define GX_BP_GENMODE_NUMCOLORS_SZ 3
|
||||
#define GX_BP_GENMODE_NUMCOLORS_MASK (((1 << 3) - 1) << 31 - 27)
|
||||
#define GX_BP_GET_GENMODE_NUMCOLORS(reg) GX_BITGET(reg, 25, 3)
|
||||
#define GX_BP_SET_GENMODE_NUMCOLORS(reg, x) ((reg) = GX_BITSET(reg, 25, 3, x))
|
||||
// MULTISAMPLE [22:22] (1)
|
||||
#define GX_BP_GENMODE_MULTISAMPLE_ST 22
|
||||
#define GX_BP_GENMODE_MULTISAMPLE_END 22
|
||||
#define GX_BP_GENMODE_MULTISAMPLE_SZ 1
|
||||
#define GX_BP_GENMODE_MULTISAMPLE_MASK (((1 << 1) - 1) << 31 - 22)
|
||||
#define GX_BP_GET_GENMODE_MULTISAMPLE(reg) GX_BITGET(reg, 22, 1)
|
||||
#define GX_BP_SET_GENMODE_MULTISAMPLE(reg, x) ((reg) = GX_BITSET(reg, 22, 1, x))
|
||||
// CULLMODE [16:17] (2)
|
||||
#define GX_BP_GENMODE_CULLMODE_ST 16
|
||||
#define GX_BP_GENMODE_CULLMODE_END 17
|
||||
#define GX_BP_GENMODE_CULLMODE_SZ 2
|
||||
#define GX_BP_GENMODE_CULLMODE_MASK (((1 << 2) - 1) << 31 - 17)
|
||||
#define GX_BP_GET_GENMODE_CULLMODE(reg) GX_BITGET(reg, 16, 2)
|
||||
#define GX_BP_SET_GENMODE_CULLMODE(reg, x) ((reg) = GX_BITSET(reg, 16, 2, x))
|
||||
// NUMINDSTAGES [13:15] (3)
|
||||
#define GX_BP_GENMODE_NUMINDSTAGES_ST 13
|
||||
#define GX_BP_GENMODE_NUMINDSTAGES_END 15
|
||||
#define GX_BP_GENMODE_NUMINDSTAGES_SZ 3
|
||||
#define GX_BP_GENMODE_NUMINDSTAGES_MASK (((1 << 3) - 1) << 31 - 15)
|
||||
#define GX_BP_GET_GENMODE_NUMINDSTAGES(reg) GX_BITGET(reg, 13, 3)
|
||||
#define GX_BP_SET_GENMODE_NUMINDSTAGES(reg, x) ((reg) = GX_BITSET(reg, 13, 3, x))
|
||||
// COPLANAR [12:12] (1) - Toggle co-planar ("Z freeze" according to Dolphin)
|
||||
#define GX_BP_GENMODE_COPLANAR_ST 12
|
||||
#define GX_BP_GENMODE_COPLANAR_END 12
|
||||
#define GX_BP_GENMODE_COPLANAR_SZ 1
|
||||
#define GX_BP_GENMODE_COPLANAR_MASK (((1 << 1) - 1) << 31 - 12)
|
||||
#define GX_BP_GET_GENMODE_COPLANAR(reg) GX_BITGET(reg, 12, 1)
|
||||
#define GX_BP_SET_GENMODE_COPLANAR(reg, x) ((reg) = GX_BITSET(reg, 12, 1, x))
|
||||
|
||||
/**
|
||||
* BP structure - IndMtxA
|
||||
*/
|
||||
// M00 [21:31] (11) - Texture offset matrix #0 [0][0]
|
||||
#define GX_BP_INDMTXA_M00_ST 21
|
||||
#define GX_BP_INDMTXA_M00_END 31
|
||||
#define GX_BP_INDMTXA_M00_SZ 11
|
||||
#define GX_BP_INDMTXA_M00_MASK (((1 << 11) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_INDMTXA_M00(reg) GX_BITGET(reg, 21, 11)
|
||||
#define GX_BP_SET_INDMTXA_M00(reg, x) ((reg) = GX_BITSET(reg, 21, 11, x))
|
||||
// M10 [10:20] (11) - Texture offset matrix #0 [1][0]
|
||||
#define GX_BP_INDMTXA_M10_ST 10
|
||||
#define GX_BP_INDMTXA_M10_END 20
|
||||
#define GX_BP_INDMTXA_M10_SZ 11
|
||||
#define GX_BP_INDMTXA_M10_MASK (((1 << 11) - 1) << 31 - 20)
|
||||
#define GX_BP_GET_INDMTXA_M10(reg) GX_BITGET(reg, 10, 11)
|
||||
#define GX_BP_SET_INDMTXA_M10(reg, x) ((reg) = GX_BITSET(reg, 10, 11, x))
|
||||
// EXP [8:9] (2) - Bits 0-1 of scaling exponent #0 (2^x)
|
||||
#define GX_BP_INDMTXA_EXP_ST 8
|
||||
#define GX_BP_INDMTXA_EXP_END 9
|
||||
#define GX_BP_INDMTXA_EXP_SZ 2
|
||||
#define GX_BP_INDMTXA_EXP_MASK (((1 << 2) - 1) << 31 - 9)
|
||||
#define GX_BP_GET_INDMTXA_EXP(reg) GX_BITGET(reg, 8, 2)
|
||||
#define GX_BP_SET_INDMTXA_EXP(reg, x) ((reg) = GX_BITSET(reg, 8, 2, x))
|
||||
|
||||
/**
|
||||
* BP structure - IndMtxB
|
||||
*/
|
||||
// M01 [21:31] (11) - Texture offset matrix #0 [0][1]
|
||||
#define GX_BP_INDMTXB_M01_ST 21
|
||||
#define GX_BP_INDMTXB_M01_END 31
|
||||
#define GX_BP_INDMTXB_M01_SZ 11
|
||||
#define GX_BP_INDMTXB_M01_MASK (((1 << 11) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_INDMTXB_M01(reg) GX_BITGET(reg, 21, 11)
|
||||
#define GX_BP_SET_INDMTXB_M01(reg, x) ((reg) = GX_BITSET(reg, 21, 11, x))
|
||||
// M11 [10:20] (11) - Texture offset matrix #0 [1][1]
|
||||
#define GX_BP_INDMTXB_M11_ST 10
|
||||
#define GX_BP_INDMTXB_M11_END 20
|
||||
#define GX_BP_INDMTXB_M11_SZ 11
|
||||
#define GX_BP_INDMTXB_M11_MASK (((1 << 11) - 1) << 31 - 20)
|
||||
#define GX_BP_GET_INDMTXB_M11(reg) GX_BITGET(reg, 10, 11)
|
||||
#define GX_BP_SET_INDMTXB_M11(reg, x) ((reg) = GX_BITSET(reg, 10, 11, x))
|
||||
// EXP [8:9] (2) - Bits 2-3 of scaling exponent #0 (2^x)
|
||||
#define GX_BP_INDMTXB_EXP_ST 8
|
||||
#define GX_BP_INDMTXB_EXP_END 9
|
||||
#define GX_BP_INDMTXB_EXP_SZ 2
|
||||
#define GX_BP_INDMTXB_EXP_MASK (((1 << 2) - 1) << 31 - 9)
|
||||
#define GX_BP_GET_INDMTXB_EXP(reg) GX_BITGET(reg, 8, 2)
|
||||
#define GX_BP_SET_INDMTXB_EXP(reg, x) ((reg) = GX_BITSET(reg, 8, 2, x))
|
||||
|
||||
/**
|
||||
* BP structure - IndMtxC
|
||||
*/
|
||||
// M02 [21:31] (11) - Texture offset matrix #0 [0][2]
|
||||
#define GX_BP_INDMTXC_M02_ST 21
|
||||
#define GX_BP_INDMTXC_M02_END 31
|
||||
#define GX_BP_INDMTXC_M02_SZ 11
|
||||
#define GX_BP_INDMTXC_M02_MASK (((1 << 11) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_INDMTXC_M02(reg) GX_BITGET(reg, 21, 11)
|
||||
#define GX_BP_SET_INDMTXC_M02(reg, x) ((reg) = GX_BITSET(reg, 21, 11, x))
|
||||
// M12 [10:20] (11) - Texture offset matrix #0 [1][2]
|
||||
#define GX_BP_INDMTXC_M12_ST 10
|
||||
#define GX_BP_INDMTXC_M12_END 20
|
||||
#define GX_BP_INDMTXC_M12_SZ 11
|
||||
#define GX_BP_INDMTXC_M12_MASK (((1 << 11) - 1) << 31 - 20)
|
||||
#define GX_BP_GET_INDMTXC_M12(reg) GX_BITGET(reg, 10, 11)
|
||||
#define GX_BP_SET_INDMTXC_M12(reg, x) ((reg) = GX_BITSET(reg, 10, 11, x))
|
||||
// EXP [8:9] (2) - Bit 4 of scaling exponent #0 (2^x)
|
||||
#define GX_BP_INDMTXC_EXP_ST 8
|
||||
#define GX_BP_INDMTXC_EXP_END 9
|
||||
#define GX_BP_INDMTXC_EXP_SZ 2
|
||||
#define GX_BP_INDMTXC_EXP_MASK (((1 << 2) - 1) << 31 - 9)
|
||||
#define GX_BP_GET_INDMTXC_EXP(reg) GX_BITGET(reg, 8, 2)
|
||||
#define GX_BP_SET_INDMTXC_EXP(reg, x) ((reg) = GX_BITSET(reg, 8, 2, x))
|
||||
|
||||
/**
|
||||
* BP register 0xF - IndIMask
|
||||
*/
|
||||
// IMASK [24:31] (8) - Indirect mask for textures
|
||||
#define GX_BP_INDIMASK_IMASK_ST 24
|
||||
#define GX_BP_INDIMASK_IMASK_END 31
|
||||
#define GX_BP_INDIMASK_IMASK_SZ 8
|
||||
#define GX_BP_INDIMASK_IMASK_MASK (((1 << 8) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_INDIMASK_IMASK(reg) GX_BITGET(reg, 24, 8)
|
||||
#define GX_BP_SET_INDIMASK_IMASK(reg, x) ((reg) = GX_BITSET(reg, 24, 8, x))
|
||||
|
||||
/**
|
||||
* BP structure - IndTevStage
|
||||
*/
|
||||
// STAGE [30:31] (2) - Indirect texture stage ID
|
||||
#define GX_BP_INDTEVSTAGE_STAGE_ST 30
|
||||
#define GX_BP_INDTEVSTAGE_STAGE_END 31
|
||||
#define GX_BP_INDTEVSTAGE_STAGE_SZ 2
|
||||
#define GX_BP_INDTEVSTAGE_STAGE_MASK (((1 << 2) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_INDTEVSTAGE_STAGE(reg) GX_BITGET(reg, 30, 2)
|
||||
#define GX_BP_SET_INDTEVSTAGE_STAGE(reg, x) ((reg) = GX_BITSET(reg, 30, 2, x))
|
||||
// FORMAT [28:29] (2) - Indirect texture format
|
||||
#define GX_BP_INDTEVSTAGE_FORMAT_ST 28
|
||||
#define GX_BP_INDTEVSTAGE_FORMAT_END 29
|
||||
#define GX_BP_INDTEVSTAGE_FORMAT_SZ 2
|
||||
#define GX_BP_INDTEVSTAGE_FORMAT_MASK (((1 << 2) - 1) << 31 - 29)
|
||||
#define GX_BP_GET_INDTEVSTAGE_FORMAT(reg) GX_BITGET(reg, 28, 2)
|
||||
#define GX_BP_SET_INDTEVSTAGE_FORMAT(reg, x) ((reg) = GX_BITSET(reg, 28, 2, x))
|
||||
// BIAS [25:27] (3) - Indirect texture bias
|
||||
#define GX_BP_INDTEVSTAGE_BIAS_ST 25
|
||||
#define GX_BP_INDTEVSTAGE_BIAS_END 27
|
||||
#define GX_BP_INDTEVSTAGE_BIAS_SZ 3
|
||||
#define GX_BP_INDTEVSTAGE_BIAS_MASK (((1 << 3) - 1) << 31 - 27)
|
||||
#define GX_BP_GET_INDTEVSTAGE_BIAS(reg) GX_BITGET(reg, 25, 3)
|
||||
#define GX_BP_SET_INDTEVSTAGE_BIAS(reg, x) ((reg) = GX_BITSET(reg, 25, 3, x))
|
||||
// ALPHA [23:24] (2) - Indirect texture alpha
|
||||
#define GX_BP_INDTEVSTAGE_ALPHA_ST 23
|
||||
#define GX_BP_INDTEVSTAGE_ALPHA_END 24
|
||||
#define GX_BP_INDTEVSTAGE_ALPHA_SZ 2
|
||||
#define GX_BP_INDTEVSTAGE_ALPHA_MASK (((1 << 2) - 1) << 31 - 24)
|
||||
#define GX_BP_GET_INDTEVSTAGE_ALPHA(reg) GX_BITGET(reg, 23, 2)
|
||||
#define GX_BP_SET_INDTEVSTAGE_ALPHA(reg, x) ((reg) = GX_BITSET(reg, 23, 2, x))
|
||||
// MTX [19:22] (4) - Indirect texture matrix
|
||||
#define GX_BP_INDTEVSTAGE_MTX_ST 19
|
||||
#define GX_BP_INDTEVSTAGE_MTX_END 22
|
||||
#define GX_BP_INDTEVSTAGE_MTX_SZ 4
|
||||
#define GX_BP_INDTEVSTAGE_MTX_MASK (((1 << 4) - 1) << 31 - 22)
|
||||
#define GX_BP_GET_INDTEVSTAGE_MTX(reg) GX_BITGET(reg, 19, 4)
|
||||
#define GX_BP_SET_INDTEVSTAGE_MTX(reg, x) ((reg) = GX_BITSET(reg, 19, 4, x))
|
||||
// WRAPS [16:18] (3) - S component wrap factor
|
||||
#define GX_BP_INDTEVSTAGE_WRAPS_ST 16
|
||||
#define GX_BP_INDTEVSTAGE_WRAPS_END 18
|
||||
#define GX_BP_INDTEVSTAGE_WRAPS_SZ 3
|
||||
#define GX_BP_INDTEVSTAGE_WRAPS_MASK (((1 << 3) - 1) << 31 - 18)
|
||||
#define GX_BP_GET_INDTEVSTAGE_WRAPS(reg) GX_BITGET(reg, 16, 3)
|
||||
#define GX_BP_SET_INDTEVSTAGE_WRAPS(reg, x) ((reg) = GX_BITSET(reg, 16, 3, x))
|
||||
// WRAPT [13:15] (3) - T component wrap factor
|
||||
#define GX_BP_INDTEVSTAGE_WRAPT_ST 13
|
||||
#define GX_BP_INDTEVSTAGE_WRAPT_END 15
|
||||
#define GX_BP_INDTEVSTAGE_WRAPT_SZ 3
|
||||
#define GX_BP_INDTEVSTAGE_WRAPT_MASK (((1 << 3) - 1) << 31 - 15)
|
||||
#define GX_BP_GET_INDTEVSTAGE_WRAPT(reg) GX_BITGET(reg, 13, 3)
|
||||
#define GX_BP_SET_INDTEVSTAGE_WRAPT(reg, x) ((reg) = GX_BITSET(reg, 13, 3, x))
|
||||
// UTCLOD [12:12] (1) - Whether to use unmodified texcoords for mipmaps
|
||||
#define GX_BP_INDTEVSTAGE_UTCLOD_ST 12
|
||||
#define GX_BP_INDTEVSTAGE_UTCLOD_END 12
|
||||
#define GX_BP_INDTEVSTAGE_UTCLOD_SZ 1
|
||||
#define GX_BP_INDTEVSTAGE_UTCLOD_MASK (((1 << 1) - 1) << 31 - 12)
|
||||
#define GX_BP_GET_INDTEVSTAGE_UTCLOD(reg) GX_BITGET(reg, 12, 1)
|
||||
#define GX_BP_SET_INDTEVSTAGE_UTCLOD(reg, x) ((reg) = GX_BITSET(reg, 12, 1, x))
|
||||
// ADDPREV [11:11] (1) - Whether to add in results from previous tev stage
|
||||
#define GX_BP_INDTEVSTAGE_ADDPREV_ST 11
|
||||
#define GX_BP_INDTEVSTAGE_ADDPREV_END 11
|
||||
#define GX_BP_INDTEVSTAGE_ADDPREV_SZ 1
|
||||
#define GX_BP_INDTEVSTAGE_ADDPREV_MASK (((1 << 1) - 1) << 31 - 11)
|
||||
#define GX_BP_GET_INDTEVSTAGE_ADDPREV(reg) GX_BITGET(reg, 11, 1)
|
||||
#define GX_BP_SET_INDTEVSTAGE_ADDPREV(reg, x) ((reg) = GX_BITSET(reg, 11, 1, x))
|
||||
|
||||
/**
|
||||
* BP register 0x20 - scissorTL
|
||||
*/
|
||||
// TOP [21:31] (11) - Top component
|
||||
#define GX_BP_SCISSORTL_TOP_ST 21
|
||||
#define GX_BP_SCISSORTL_TOP_END 31
|
||||
#define GX_BP_SCISSORTL_TOP_SZ 11
|
||||
#define GX_BP_SCISSORTL_TOP_MASK (((1 << 11) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_SCISSORTL_TOP(reg) GX_BITGET(reg, 21, 11)
|
||||
#define GX_BP_SET_SCISSORTL_TOP(reg, x) ((reg) = GX_BITSET(reg, 21, 11, x))
|
||||
// LEFT [9:19] (11) - Left component
|
||||
#define GX_BP_SCISSORTL_LEFT_ST 9
|
||||
#define GX_BP_SCISSORTL_LEFT_END 19
|
||||
#define GX_BP_SCISSORTL_LEFT_SZ 11
|
||||
#define GX_BP_SCISSORTL_LEFT_MASK (((1 << 11) - 1) << 31 - 19)
|
||||
#define GX_BP_GET_SCISSORTL_LEFT(reg) GX_BITGET(reg, 9, 11)
|
||||
#define GX_BP_SET_SCISSORTL_LEFT(reg, x) ((reg) = GX_BITSET(reg, 9, 11, x))
|
||||
|
||||
/**
|
||||
* BP register 0x21 - scissorBR
|
||||
*/
|
||||
// BOT [21:31] (11) - Bottom component
|
||||
#define GX_BP_SCISSORBR_BOT_ST 21
|
||||
#define GX_BP_SCISSORBR_BOT_END 31
|
||||
#define GX_BP_SCISSORBR_BOT_SZ 11
|
||||
#define GX_BP_SCISSORBR_BOT_MASK (((1 << 11) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_SCISSORBR_BOT(reg) GX_BITGET(reg, 21, 11)
|
||||
#define GX_BP_SET_SCISSORBR_BOT(reg, x) ((reg) = GX_BITSET(reg, 21, 11, x))
|
||||
// RIGHT [9:19] (11) - Right component
|
||||
#define GX_BP_SCISSORBR_RIGHT_ST 9
|
||||
#define GX_BP_SCISSORBR_RIGHT_END 19
|
||||
#define GX_BP_SCISSORBR_RIGHT_SZ 11
|
||||
#define GX_BP_SCISSORBR_RIGHT_MASK (((1 << 11) - 1) << 31 - 19)
|
||||
#define GX_BP_GET_SCISSORBR_RIGHT(reg) GX_BITGET(reg, 9, 11)
|
||||
#define GX_BP_SET_SCISSORBR_RIGHT(reg, x) ((reg) = GX_BITSET(reg, 9, 11, x))
|
||||
|
||||
/**
|
||||
* BP register 0x22 - linePtWidth
|
||||
*/
|
||||
// LINESZ [24:31] (8) - Line size/width
|
||||
#define GX_BP_LINEPTWIDTH_LINESZ_ST 24
|
||||
#define GX_BP_LINEPTWIDTH_LINESZ_END 31
|
||||
#define GX_BP_LINEPTWIDTH_LINESZ_SZ 8
|
||||
#define GX_BP_LINEPTWIDTH_LINESZ_MASK (((1 << 8) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_LINEPTWIDTH_LINESZ(reg) GX_BITGET(reg, 24, 8)
|
||||
#define GX_BP_SET_LINEPTWIDTH_LINESZ(reg, x) ((reg) = GX_BITSET(reg, 24, 8, x))
|
||||
// POINTSZ [16:23] (8) - Point size
|
||||
#define GX_BP_LINEPTWIDTH_POINTSZ_ST 16
|
||||
#define GX_BP_LINEPTWIDTH_POINTSZ_END 23
|
||||
#define GX_BP_LINEPTWIDTH_POINTSZ_SZ 8
|
||||
#define GX_BP_LINEPTWIDTH_POINTSZ_MASK (((1 << 8) - 1) << 31 - 23)
|
||||
#define GX_BP_GET_LINEPTWIDTH_POINTSZ(reg) GX_BITGET(reg, 16, 8)
|
||||
#define GX_BP_SET_LINEPTWIDTH_POINTSZ(reg, x) ((reg) = GX_BITSET(reg, 16, 8, x))
|
||||
// LINEOFS [13:15] (3) - Line offset
|
||||
#define GX_BP_LINEPTWIDTH_LINEOFS_ST 13
|
||||
#define GX_BP_LINEPTWIDTH_LINEOFS_END 15
|
||||
#define GX_BP_LINEPTWIDTH_LINEOFS_SZ 3
|
||||
#define GX_BP_LINEPTWIDTH_LINEOFS_MASK (((1 << 3) - 1) << 31 - 15)
|
||||
#define GX_BP_GET_LINEPTWIDTH_LINEOFS(reg) GX_BITGET(reg, 13, 3)
|
||||
#define GX_BP_SET_LINEPTWIDTH_LINEOFS(reg, x) ((reg) = GX_BITSET(reg, 13, 3, x))
|
||||
// POINTOFS [10:12] (3) - Point offset
|
||||
#define GX_BP_LINEPTWIDTH_POINTOFS_ST 10
|
||||
#define GX_BP_LINEPTWIDTH_POINTOFS_END 12
|
||||
#define GX_BP_LINEPTWIDTH_POINTOFS_SZ 3
|
||||
#define GX_BP_LINEPTWIDTH_POINTOFS_MASK (((1 << 3) - 1) << 31 - 12)
|
||||
#define GX_BP_GET_LINEPTWIDTH_POINTOFS(reg) GX_BITGET(reg, 10, 3)
|
||||
#define GX_BP_SET_LINEPTWIDTH_POINTOFS(reg, x) ((reg) = GX_BITSET(reg, 10, 3, x))
|
||||
// ADJUST_AR [9:9] (1) - Interlacing: adjust for pixels having aspect ratio of 1/2
|
||||
#define GX_BP_LINEPTWIDTH_ADJUST_AR_ST 9
|
||||
#define GX_BP_LINEPTWIDTH_ADJUST_AR_END 9
|
||||
#define GX_BP_LINEPTWIDTH_ADJUST_AR_SZ 1
|
||||
#define GX_BP_LINEPTWIDTH_ADJUST_AR_MASK (((1 << 1) - 1) << 31 - 9)
|
||||
#define GX_BP_GET_LINEPTWIDTH_ADJUST_AR(reg) GX_BITGET(reg, 9, 1)
|
||||
#define GX_BP_SET_LINEPTWIDTH_ADJUST_AR(reg, x) ((reg) = GX_BITSET(reg, 9, 1, x))
|
||||
|
||||
/**
|
||||
* BP register 0x25 - ras1_ss0
|
||||
*/
|
||||
// S0 [28:31] (4) - S-component scale (stage 0)
|
||||
#define GX_BP_RAS1_SS0_S0_ST 28
|
||||
#define GX_BP_RAS1_SS0_S0_END 31
|
||||
#define GX_BP_RAS1_SS0_S0_SZ 4
|
||||
#define GX_BP_RAS1_SS0_S0_MASK (((1 << 4) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_RAS1_SS0_S0(reg) GX_BITGET(reg, 28, 4)
|
||||
#define GX_BP_SET_RAS1_SS0_S0(reg, x) ((reg) = GX_BITSET(reg, 28, 4, x))
|
||||
// T0 [24:27] (4) - T-component scale (stage 0)
|
||||
#define GX_BP_RAS1_SS0_T0_ST 24
|
||||
#define GX_BP_RAS1_SS0_T0_END 27
|
||||
#define GX_BP_RAS1_SS0_T0_SZ 4
|
||||
#define GX_BP_RAS1_SS0_T0_MASK (((1 << 4) - 1) << 31 - 27)
|
||||
#define GX_BP_GET_RAS1_SS0_T0(reg) GX_BITGET(reg, 24, 4)
|
||||
#define GX_BP_SET_RAS1_SS0_T0(reg, x) ((reg) = GX_BITSET(reg, 24, 4, x))
|
||||
// S1 [20:23] (4) - S-component scale (stage 1)
|
||||
#define GX_BP_RAS1_SS0_S1_ST 20
|
||||
#define GX_BP_RAS1_SS0_S1_END 23
|
||||
#define GX_BP_RAS1_SS0_S1_SZ 4
|
||||
#define GX_BP_RAS1_SS0_S1_MASK (((1 << 4) - 1) << 31 - 23)
|
||||
#define GX_BP_GET_RAS1_SS0_S1(reg) GX_BITGET(reg, 20, 4)
|
||||
#define GX_BP_SET_RAS1_SS0_S1(reg, x) ((reg) = GX_BITSET(reg, 20, 4, x))
|
||||
// T1 [16:19] (4) - T-component scale (stage 1)
|
||||
#define GX_BP_RAS1_SS0_T1_ST 16
|
||||
#define GX_BP_RAS1_SS0_T1_END 19
|
||||
#define GX_BP_RAS1_SS0_T1_SZ 4
|
||||
#define GX_BP_RAS1_SS0_T1_MASK (((1 << 4) - 1) << 31 - 19)
|
||||
#define GX_BP_GET_RAS1_SS0_T1(reg) GX_BITGET(reg, 16, 4)
|
||||
#define GX_BP_SET_RAS1_SS0_T1(reg, x) ((reg) = GX_BITSET(reg, 16, 4, x))
|
||||
|
||||
/**
|
||||
* BP register 0x26 - ras1_ss1
|
||||
*/
|
||||
// S2 [28:31] (4) - S-component scale (stage 2)
|
||||
#define GX_BP_RAS1_SS1_S2_ST 28
|
||||
#define GX_BP_RAS1_SS1_S2_END 31
|
||||
#define GX_BP_RAS1_SS1_S2_SZ 4
|
||||
#define GX_BP_RAS1_SS1_S2_MASK (((1 << 4) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_RAS1_SS1_S2(reg) GX_BITGET(reg, 28, 4)
|
||||
#define GX_BP_SET_RAS1_SS1_S2(reg, x) ((reg) = GX_BITSET(reg, 28, 4, x))
|
||||
// T2 [24:27] (4) - T-component scale (stage 2)
|
||||
#define GX_BP_RAS1_SS1_T2_ST 24
|
||||
#define GX_BP_RAS1_SS1_T2_END 27
|
||||
#define GX_BP_RAS1_SS1_T2_SZ 4
|
||||
#define GX_BP_RAS1_SS1_T2_MASK (((1 << 4) - 1) << 31 - 27)
|
||||
#define GX_BP_GET_RAS1_SS1_T2(reg) GX_BITGET(reg, 24, 4)
|
||||
#define GX_BP_SET_RAS1_SS1_T2(reg, x) ((reg) = GX_BITSET(reg, 24, 4, x))
|
||||
// S3 [20:23] (4) - S-component scale (stage 3)
|
||||
#define GX_BP_RAS1_SS1_S3_ST 20
|
||||
#define GX_BP_RAS1_SS1_S3_END 23
|
||||
#define GX_BP_RAS1_SS1_S3_SZ 4
|
||||
#define GX_BP_RAS1_SS1_S3_MASK (((1 << 4) - 1) << 31 - 23)
|
||||
#define GX_BP_GET_RAS1_SS1_S3(reg) GX_BITGET(reg, 20, 4)
|
||||
#define GX_BP_SET_RAS1_SS1_S3(reg, x) ((reg) = GX_BITSET(reg, 20, 4, x))
|
||||
// T3 [16:19] (4) - T-component scale (stage 3)
|
||||
#define GX_BP_RAS1_SS1_T3_ST 16
|
||||
#define GX_BP_RAS1_SS1_T3_END 19
|
||||
#define GX_BP_RAS1_SS1_T3_SZ 4
|
||||
#define GX_BP_RAS1_SS1_T3_MASK (((1 << 4) - 1) << 31 - 19)
|
||||
#define GX_BP_GET_RAS1_SS1_T3(reg) GX_BITGET(reg, 16, 4)
|
||||
#define GX_BP_SET_RAS1_SS1_T3(reg, x) ((reg) = GX_BITSET(reg, 16, 4, x))
|
||||
|
||||
/**
|
||||
* BP register 0x27 - ras1_iref
|
||||
*/
|
||||
// MAP0 [29:31] (3) - Texmap id (stage 0)
|
||||
#define GX_BP_RAS1_IREF_MAP0_ST 29
|
||||
#define GX_BP_RAS1_IREF_MAP0_END 31
|
||||
#define GX_BP_RAS1_IREF_MAP0_SZ 3
|
||||
#define GX_BP_RAS1_IREF_MAP0_MASK (((1 << 3) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_RAS1_IREF_MAP0(reg) GX_BITGET(reg, 29, 3)
|
||||
#define GX_BP_SET_RAS1_IREF_MAP0(reg, x) ((reg) = GX_BITSET(reg, 29, 3, x))
|
||||
// TXC0 [26:28] (3) - Texcoord ID (stage 0)
|
||||
#define GX_BP_RAS1_IREF_TXC0_ST 26
|
||||
#define GX_BP_RAS1_IREF_TXC0_END 28
|
||||
#define GX_BP_RAS1_IREF_TXC0_SZ 3
|
||||
#define GX_BP_RAS1_IREF_TXC0_MASK (((1 << 3) - 1) << 31 - 28)
|
||||
#define GX_BP_GET_RAS1_IREF_TXC0(reg) GX_BITGET(reg, 26, 3)
|
||||
#define GX_BP_SET_RAS1_IREF_TXC0(reg, x) ((reg) = GX_BITSET(reg, 26, 3, x))
|
||||
// MAP1 [23:25] (3) - Texmap id (stage 1)
|
||||
#define GX_BP_RAS1_IREF_MAP1_ST 23
|
||||
#define GX_BP_RAS1_IREF_MAP1_END 25
|
||||
#define GX_BP_RAS1_IREF_MAP1_SZ 3
|
||||
#define GX_BP_RAS1_IREF_MAP1_MASK (((1 << 3) - 1) << 31 - 25)
|
||||
#define GX_BP_GET_RAS1_IREF_MAP1(reg) GX_BITGET(reg, 23, 3)
|
||||
#define GX_BP_SET_RAS1_IREF_MAP1(reg, x) ((reg) = GX_BITSET(reg, 23, 3, x))
|
||||
// TXC1 [20:22] (3) - Texcoord ID (stage 1)
|
||||
#define GX_BP_RAS1_IREF_TXC1_ST 20
|
||||
#define GX_BP_RAS1_IREF_TXC1_END 22
|
||||
#define GX_BP_RAS1_IREF_TXC1_SZ 3
|
||||
#define GX_BP_RAS1_IREF_TXC1_MASK (((1 << 3) - 1) << 31 - 22)
|
||||
#define GX_BP_GET_RAS1_IREF_TXC1(reg) GX_BITGET(reg, 20, 3)
|
||||
#define GX_BP_SET_RAS1_IREF_TXC1(reg, x) ((reg) = GX_BITSET(reg, 20, 3, x))
|
||||
// MAP2 [17:19] (3) - Texmap id (stage 2)
|
||||
#define GX_BP_RAS1_IREF_MAP2_ST 17
|
||||
#define GX_BP_RAS1_IREF_MAP2_END 19
|
||||
#define GX_BP_RAS1_IREF_MAP2_SZ 3
|
||||
#define GX_BP_RAS1_IREF_MAP2_MASK (((1 << 3) - 1) << 31 - 19)
|
||||
#define GX_BP_GET_RAS1_IREF_MAP2(reg) GX_BITGET(reg, 17, 3)
|
||||
#define GX_BP_SET_RAS1_IREF_MAP2(reg, x) ((reg) = GX_BITSET(reg, 17, 3, x))
|
||||
// TXC2 [14:16] (3) - Texcoord ID (stage 2)
|
||||
#define GX_BP_RAS1_IREF_TXC2_ST 14
|
||||
#define GX_BP_RAS1_IREF_TXC2_END 16
|
||||
#define GX_BP_RAS1_IREF_TXC2_SZ 3
|
||||
#define GX_BP_RAS1_IREF_TXC2_MASK (((1 << 3) - 1) << 31 - 16)
|
||||
#define GX_BP_GET_RAS1_IREF_TXC2(reg) GX_BITGET(reg, 14, 3)
|
||||
#define GX_BP_SET_RAS1_IREF_TXC2(reg, x) ((reg) = GX_BITSET(reg, 14, 3, x))
|
||||
// MAP3 [11:13] (3) - Texmap id (stage 3)
|
||||
#define GX_BP_RAS1_IREF_MAP3_ST 11
|
||||
#define GX_BP_RAS1_IREF_MAP3_END 13
|
||||
#define GX_BP_RAS1_IREF_MAP3_SZ 3
|
||||
#define GX_BP_RAS1_IREF_MAP3_MASK (((1 << 3) - 1) << 31 - 13)
|
||||
#define GX_BP_GET_RAS1_IREF_MAP3(reg) GX_BITGET(reg, 11, 3)
|
||||
#define GX_BP_SET_RAS1_IREF_MAP3(reg, x) ((reg) = GX_BITSET(reg, 11, 3, x))
|
||||
// TXC3 [8:10] (3) - Texcoord ID (stage 3)
|
||||
#define GX_BP_RAS1_IREF_TXC3_ST 8
|
||||
#define GX_BP_RAS1_IREF_TXC3_END 10
|
||||
#define GX_BP_RAS1_IREF_TXC3_SZ 3
|
||||
#define GX_BP_RAS1_IREF_TXC3_MASK (((1 << 3) - 1) << 31 - 10)
|
||||
#define GX_BP_GET_RAS1_IREF_TXC3(reg) GX_BITGET(reg, 8, 3)
|
||||
#define GX_BP_SET_RAS1_IREF_TXC3(reg, x) ((reg) = GX_BITSET(reg, 8, 3, x))
|
||||
|
||||
/**
|
||||
* BP structure - su_ssize
|
||||
*/
|
||||
// USELINEOFS [13:13] (1)
|
||||
#define GX_BP_SU_SSIZE_USELINEOFS_ST 13
|
||||
#define GX_BP_SU_SSIZE_USELINEOFS_END 13
|
||||
#define GX_BP_SU_SSIZE_USELINEOFS_SZ 1
|
||||
#define GX_BP_SU_SSIZE_USELINEOFS_MASK (((1 << 1) - 1) << 31 - 13)
|
||||
#define GX_BP_GET_SU_SSIZE_USELINEOFS(reg) GX_BITGET(reg, 13, 1)
|
||||
#define GX_BP_SET_SU_SSIZE_USELINEOFS(reg, x) ((reg) = GX_BITSET(reg, 13, 1, x))
|
||||
// USEPOINTOFS [12:12] (1)
|
||||
#define GX_BP_SU_SSIZE_USEPOINTOFS_ST 12
|
||||
#define GX_BP_SU_SSIZE_USEPOINTOFS_END 12
|
||||
#define GX_BP_SU_SSIZE_USEPOINTOFS_SZ 1
|
||||
#define GX_BP_SU_SSIZE_USEPOINTOFS_MASK (((1 << 1) - 1) << 31 - 12)
|
||||
#define GX_BP_GET_SU_SSIZE_USEPOINTOFS(reg) GX_BITGET(reg, 12, 1)
|
||||
#define GX_BP_SET_SU_SSIZE_USEPOINTOFS(reg, x) ((reg) = GX_BITSET(reg, 12, 1, x))
|
||||
|
||||
/**
|
||||
* BP register 0x40 - ZMode
|
||||
*/
|
||||
// TEST_ENABLE [31:31] (1)
|
||||
#define GX_BP_ZMODE_TEST_ENABLE_ST 31
|
||||
#define GX_BP_ZMODE_TEST_ENABLE_END 31
|
||||
#define GX_BP_ZMODE_TEST_ENABLE_SZ 1
|
||||
#define GX_BP_ZMODE_TEST_ENABLE_MASK (((1 << 1) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_ZMODE_TEST_ENABLE(reg) GX_BITGET(reg, 31, 1)
|
||||
#define GX_BP_SET_ZMODE_TEST_ENABLE(reg, x) ((reg) = GX_BITSET(reg, 31, 1, x))
|
||||
// COMPARE [28:30] (3)
|
||||
#define GX_BP_ZMODE_COMPARE_ST 28
|
||||
#define GX_BP_ZMODE_COMPARE_END 30
|
||||
#define GX_BP_ZMODE_COMPARE_SZ 3
|
||||
#define GX_BP_ZMODE_COMPARE_MASK (((1 << 3) - 1) << 31 - 30)
|
||||
#define GX_BP_GET_ZMODE_COMPARE(reg) GX_BITGET(reg, 28, 3)
|
||||
#define GX_BP_SET_ZMODE_COMPARE(reg, x) ((reg) = GX_BITSET(reg, 28, 3, x))
|
||||
// UPDATE_ENABLE [27:27] (1)
|
||||
#define GX_BP_ZMODE_UPDATE_ENABLE_ST 27
|
||||
#define GX_BP_ZMODE_UPDATE_ENABLE_END 27
|
||||
#define GX_BP_ZMODE_UPDATE_ENABLE_SZ 1
|
||||
#define GX_BP_ZMODE_UPDATE_ENABLE_MASK (((1 << 1) - 1) << 31 - 27)
|
||||
#define GX_BP_GET_ZMODE_UPDATE_ENABLE(reg) GX_BITGET(reg, 27, 1)
|
||||
#define GX_BP_SET_ZMODE_UPDATE_ENABLE(reg, x) ((reg) = GX_BITSET(reg, 27, 1, x))
|
||||
|
||||
/**
|
||||
* BP register 0x41 - BlendMode
|
||||
*/
|
||||
// BLEND_ENABLE [31:31] (1)
|
||||
#define GX_BP_BLENDMODE_BLEND_ENABLE_ST 31
|
||||
#define GX_BP_BLENDMODE_BLEND_ENABLE_END 31
|
||||
#define GX_BP_BLENDMODE_BLEND_ENABLE_SZ 1
|
||||
#define GX_BP_BLENDMODE_BLEND_ENABLE_MASK (((1 << 1) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_BLENDMODE_BLEND_ENABLE(reg) GX_BITGET(reg, 31, 1)
|
||||
#define GX_BP_SET_BLENDMODE_BLEND_ENABLE(reg, x) ((reg) = GX_BITSET(reg, 31, 1, x))
|
||||
// LOGIC_OP_ENABLE [30:30] (1)
|
||||
#define GX_BP_BLENDMODE_LOGIC_OP_ENABLE_ST 30
|
||||
#define GX_BP_BLENDMODE_LOGIC_OP_ENABLE_END 30
|
||||
#define GX_BP_BLENDMODE_LOGIC_OP_ENABLE_SZ 1
|
||||
#define GX_BP_BLENDMODE_LOGIC_OP_ENABLE_MASK (((1 << 1) - 1) << 31 - 30)
|
||||
#define GX_BP_GET_BLENDMODE_LOGIC_OP_ENABLE(reg) GX_BITGET(reg, 30, 1)
|
||||
#define GX_BP_SET_BLENDMODE_LOGIC_OP_ENABLE(reg, x) ((reg) = GX_BITSET(reg, 30, 1, x))
|
||||
// DITHER [29:29] (1)
|
||||
#define GX_BP_BLENDMODE_DITHER_ST 29
|
||||
#define GX_BP_BLENDMODE_DITHER_END 29
|
||||
#define GX_BP_BLENDMODE_DITHER_SZ 1
|
||||
#define GX_BP_BLENDMODE_DITHER_MASK (((1 << 1) - 1) << 31 - 29)
|
||||
#define GX_BP_GET_BLENDMODE_DITHER(reg) GX_BITGET(reg, 29, 1)
|
||||
#define GX_BP_SET_BLENDMODE_DITHER(reg, x) ((reg) = GX_BITSET(reg, 29, 1, x))
|
||||
// COLOR_UPDATE [28:28] (1)
|
||||
#define GX_BP_BLENDMODE_COLOR_UPDATE_ST 28
|
||||
#define GX_BP_BLENDMODE_COLOR_UPDATE_END 28
|
||||
#define GX_BP_BLENDMODE_COLOR_UPDATE_SZ 1
|
||||
#define GX_BP_BLENDMODE_COLOR_UPDATE_MASK (((1 << 1) - 1) << 31 - 28)
|
||||
#define GX_BP_GET_BLENDMODE_COLOR_UPDATE(reg) GX_BITGET(reg, 28, 1)
|
||||
#define GX_BP_SET_BLENDMODE_COLOR_UPDATE(reg, x) ((reg) = GX_BITSET(reg, 28, 1, x))
|
||||
// ALPHA_UPDATE [27:27] (1)
|
||||
#define GX_BP_BLENDMODE_ALPHA_UPDATE_ST 27
|
||||
#define GX_BP_BLENDMODE_ALPHA_UPDATE_END 27
|
||||
#define GX_BP_BLENDMODE_ALPHA_UPDATE_SZ 1
|
||||
#define GX_BP_BLENDMODE_ALPHA_UPDATE_MASK (((1 << 1) - 1) << 31 - 27)
|
||||
#define GX_BP_GET_BLENDMODE_ALPHA_UPDATE(reg) GX_BITGET(reg, 27, 1)
|
||||
#define GX_BP_SET_BLENDMODE_ALPHA_UPDATE(reg, x) ((reg) = GX_BITSET(reg, 27, 1, x))
|
||||
// DST_FACTOR [24:26] (3)
|
||||
#define GX_BP_BLENDMODE_DST_FACTOR_ST 24
|
||||
#define GX_BP_BLENDMODE_DST_FACTOR_END 26
|
||||
#define GX_BP_BLENDMODE_DST_FACTOR_SZ 3
|
||||
#define GX_BP_BLENDMODE_DST_FACTOR_MASK (((1 << 3) - 1) << 31 - 26)
|
||||
#define GX_BP_GET_BLENDMODE_DST_FACTOR(reg) GX_BITGET(reg, 24, 3)
|
||||
#define GX_BP_SET_BLENDMODE_DST_FACTOR(reg, x) ((reg) = GX_BITSET(reg, 24, 3, x))
|
||||
// SRC_FACTOR [21:23] (3)
|
||||
#define GX_BP_BLENDMODE_SRC_FACTOR_ST 21
|
||||
#define GX_BP_BLENDMODE_SRC_FACTOR_END 23
|
||||
#define GX_BP_BLENDMODE_SRC_FACTOR_SZ 3
|
||||
#define GX_BP_BLENDMODE_SRC_FACTOR_MASK (((1 << 3) - 1) << 31 - 23)
|
||||
#define GX_BP_GET_BLENDMODE_SRC_FACTOR(reg) GX_BITGET(reg, 21, 3)
|
||||
#define GX_BP_SET_BLENDMODE_SRC_FACTOR(reg, x) ((reg) = GX_BITSET(reg, 21, 3, x))
|
||||
// SUBTRACT [20:20] (1)
|
||||
#define GX_BP_BLENDMODE_SUBTRACT_ST 20
|
||||
#define GX_BP_BLENDMODE_SUBTRACT_END 20
|
||||
#define GX_BP_BLENDMODE_SUBTRACT_SZ 1
|
||||
#define GX_BP_BLENDMODE_SUBTRACT_MASK (((1 << 1) - 1) << 31 - 20)
|
||||
#define GX_BP_GET_BLENDMODE_SUBTRACT(reg) GX_BITGET(reg, 20, 1)
|
||||
#define GX_BP_SET_BLENDMODE_SUBTRACT(reg, x) ((reg) = GX_BITSET(reg, 20, 1, x))
|
||||
// LOGIC_MODE [16:19] (4)
|
||||
#define GX_BP_BLENDMODE_LOGIC_MODE_ST 16
|
||||
#define GX_BP_BLENDMODE_LOGIC_MODE_END 19
|
||||
#define GX_BP_BLENDMODE_LOGIC_MODE_SZ 4
|
||||
#define GX_BP_BLENDMODE_LOGIC_MODE_MASK (((1 << 4) - 1) << 31 - 19)
|
||||
#define GX_BP_GET_BLENDMODE_LOGIC_MODE(reg) GX_BITGET(reg, 16, 4)
|
||||
#define GX_BP_SET_BLENDMODE_LOGIC_MODE(reg, x) ((reg) = GX_BITSET(reg, 16, 4, x))
|
||||
|
||||
/**
|
||||
* BP register 0x42 - DstAlpha
|
||||
*/
|
||||
// ALPHA [24:31] (8)
|
||||
#define GX_BP_DSTALPHA_ALPHA_ST 24
|
||||
#define GX_BP_DSTALPHA_ALPHA_END 31
|
||||
#define GX_BP_DSTALPHA_ALPHA_SZ 8
|
||||
#define GX_BP_DSTALPHA_ALPHA_MASK (((1 << 8) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_DSTALPHA_ALPHA(reg) GX_BITGET(reg, 24, 8)
|
||||
#define GX_BP_SET_DSTALPHA_ALPHA(reg, x) ((reg) = GX_BITSET(reg, 24, 8, x))
|
||||
// ENABLE [23:23] (1)
|
||||
#define GX_BP_DSTALPHA_ENABLE_ST 23
|
||||
#define GX_BP_DSTALPHA_ENABLE_END 23
|
||||
#define GX_BP_DSTALPHA_ENABLE_SZ 1
|
||||
#define GX_BP_DSTALPHA_ENABLE_MASK (((1 << 1) - 1) << 31 - 23)
|
||||
#define GX_BP_GET_DSTALPHA_ENABLE(reg) GX_BITGET(reg, 23, 1)
|
||||
#define GX_BP_SET_DSTALPHA_ENABLE(reg, x) ((reg) = GX_BITSET(reg, 23, 1, x))
|
||||
// YUV_FMT [21:22] (2)
|
||||
#define GX_BP_DSTALPHA_YUV_FMT_ST 21
|
||||
#define GX_BP_DSTALPHA_YUV_FMT_END 22
|
||||
#define GX_BP_DSTALPHA_YUV_FMT_SZ 2
|
||||
#define GX_BP_DSTALPHA_YUV_FMT_MASK (((1 << 2) - 1) << 31 - 22)
|
||||
#define GX_BP_GET_DSTALPHA_YUV_FMT(reg) GX_BITGET(reg, 21, 2)
|
||||
#define GX_BP_SET_DSTALPHA_YUV_FMT(reg, x) ((reg) = GX_BITSET(reg, 21, 2, x))
|
||||
|
||||
/**
|
||||
* BP register 0x43 - ZControl
|
||||
*/
|
||||
// PIXEL_FMT [29:31] (3)
|
||||
#define GX_BP_ZCONTROL_PIXEL_FMT_ST 29
|
||||
#define GX_BP_ZCONTROL_PIXEL_FMT_END 31
|
||||
#define GX_BP_ZCONTROL_PIXEL_FMT_SZ 3
|
||||
#define GX_BP_ZCONTROL_PIXEL_FMT_MASK (((1 << 3) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_ZCONTROL_PIXEL_FMT(reg) GX_BITGET(reg, 29, 3)
|
||||
#define GX_BP_SET_ZCONTROL_PIXEL_FMT(reg, x) ((reg) = GX_BITSET(reg, 29, 3, x))
|
||||
// Z_FMT [26:28] (3)
|
||||
#define GX_BP_ZCONTROL_Z_FMT_ST 26
|
||||
#define GX_BP_ZCONTROL_Z_FMT_END 28
|
||||
#define GX_BP_ZCONTROL_Z_FMT_SZ 3
|
||||
#define GX_BP_ZCONTROL_Z_FMT_MASK (((1 << 3) - 1) << 31 - 28)
|
||||
#define GX_BP_GET_ZCONTROL_Z_FMT(reg) GX_BITGET(reg, 26, 3)
|
||||
#define GX_BP_SET_ZCONTROL_Z_FMT(reg, x) ((reg) = GX_BITSET(reg, 26, 3, x))
|
||||
// BEFORE_TEX [25:25] (1) - Determines whether Z-buffering occurs before or after texturing
|
||||
#define GX_BP_ZCONTROL_BEFORE_TEX_ST 25
|
||||
#define GX_BP_ZCONTROL_BEFORE_TEX_END 25
|
||||
#define GX_BP_ZCONTROL_BEFORE_TEX_SZ 1
|
||||
#define GX_BP_ZCONTROL_BEFORE_TEX_MASK (((1 << 1) - 1) << 31 - 25)
|
||||
#define GX_BP_GET_ZCONTROL_BEFORE_TEX(reg) GX_BITGET(reg, 25, 1)
|
||||
#define GX_BP_SET_ZCONTROL_BEFORE_TEX(reg, x) ((reg) = GX_BITSET(reg, 25, 1, x))
|
||||
|
||||
/**
|
||||
* BP register 0x44 - FieldMask
|
||||
*/
|
||||
// ODD [31:31] (1) - Whether to write odd fields to the EFB
|
||||
#define GX_BP_FIELDMASK_ODD_ST 31
|
||||
#define GX_BP_FIELDMASK_ODD_END 31
|
||||
#define GX_BP_FIELDMASK_ODD_SZ 1
|
||||
#define GX_BP_FIELDMASK_ODD_MASK (((1 << 1) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_FIELDMASK_ODD(reg) GX_BITGET(reg, 31, 1)
|
||||
#define GX_BP_SET_FIELDMASK_ODD(reg, x) ((reg) = GX_BITSET(reg, 31, 1, x))
|
||||
// EVEN [30:30] (1) - Whether to write even fields to the EFB
|
||||
#define GX_BP_FIELDMASK_EVEN_ST 30
|
||||
#define GX_BP_FIELDMASK_EVEN_END 30
|
||||
#define GX_BP_FIELDMASK_EVEN_SZ 1
|
||||
#define GX_BP_FIELDMASK_EVEN_MASK (((1 << 1) - 1) << 31 - 30)
|
||||
#define GX_BP_GET_FIELDMASK_EVEN(reg) GX_BITGET(reg, 30, 1)
|
||||
#define GX_BP_SET_FIELDMASK_EVEN(reg, x) ((reg) = GX_BITSET(reg, 30, 1, x))
|
||||
|
||||
/**
|
||||
* BP register 0x59 - ScissorOffset
|
||||
*/
|
||||
// OX [22:31] (10)
|
||||
#define GX_BP_SCISSOROFFSET_OX_ST 22
|
||||
#define GX_BP_SCISSOROFFSET_OX_END 31
|
||||
#define GX_BP_SCISSOROFFSET_OX_SZ 10
|
||||
#define GX_BP_SCISSOROFFSET_OX_MASK (((1 << 10) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_SCISSOROFFSET_OX(reg) GX_BITGET(reg, 22, 10)
|
||||
#define GX_BP_SET_SCISSOROFFSET_OX(reg, x) ((reg) = GX_BITSET(reg, 22, 10, x))
|
||||
// OY [12:21] (10)
|
||||
#define GX_BP_SCISSOROFFSET_OY_ST 12
|
||||
#define GX_BP_SCISSOROFFSET_OY_END 21
|
||||
#define GX_BP_SCISSOROFFSET_OY_SZ 10
|
||||
#define GX_BP_SCISSOROFFSET_OY_MASK (((1 << 10) - 1) << 31 - 21)
|
||||
#define GX_BP_GET_SCISSOROFFSET_OY(reg) GX_BITGET(reg, 12, 10)
|
||||
#define GX_BP_SET_SCISSOROFFSET_OY(reg, x) ((reg) = GX_BITSET(reg, 12, 10, x))
|
||||
|
||||
/**
|
||||
* BP register 0x68 - FieldMode
|
||||
*/
|
||||
// TEX_LOD [31:31] (1) - Adjust vertex tex LOD computation to account for interlacing
|
||||
#define GX_BP_FIELDMODE_TEX_LOD_ST 31
|
||||
#define GX_BP_FIELDMODE_TEX_LOD_END 31
|
||||
#define GX_BP_FIELDMODE_TEX_LOD_SZ 1
|
||||
#define GX_BP_FIELDMODE_TEX_LOD_MASK (((1 << 1) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_FIELDMODE_TEX_LOD(reg) GX_BITGET(reg, 31, 1)
|
||||
#define GX_BP_SET_FIELDMODE_TEX_LOD(reg, x) ((reg) = GX_BITSET(reg, 31, 1, x))
|
||||
|
||||
/**
|
||||
* BP register 0xE8 - FogRange
|
||||
*/
|
||||
// CENTER [22:31] (10)
|
||||
#define GX_BP_FOGRANGE_CENTER_ST 22
|
||||
#define GX_BP_FOGRANGE_CENTER_END 31
|
||||
#define GX_BP_FOGRANGE_CENTER_SZ 10
|
||||
#define GX_BP_FOGRANGE_CENTER_MASK (((1 << 10) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_FOGRANGE_CENTER(reg) GX_BITGET(reg, 22, 10)
|
||||
#define GX_BP_SET_FOGRANGE_CENTER(reg, x) ((reg) = GX_BITSET(reg, 22, 10, x))
|
||||
// ENABLED [21:21] (1)
|
||||
#define GX_BP_FOGRANGE_ENABLED_ST 21
|
||||
#define GX_BP_FOGRANGE_ENABLED_END 21
|
||||
#define GX_BP_FOGRANGE_ENABLED_SZ 1
|
||||
#define GX_BP_FOGRANGE_ENABLED_MASK (((1 << 1) - 1) << 31 - 21)
|
||||
#define GX_BP_GET_FOGRANGE_ENABLED(reg) GX_BITGET(reg, 21, 1)
|
||||
#define GX_BP_SET_FOGRANGE_ENABLED(reg, x) ((reg) = GX_BITSET(reg, 21, 1, x))
|
||||
|
||||
/**
|
||||
* BP structure - FogRangeK
|
||||
*/
|
||||
// HI [20:31] (12)
|
||||
#define GX_BP_FOGRANGEK_HI_ST 20
|
||||
#define GX_BP_FOGRANGEK_HI_END 31
|
||||
#define GX_BP_FOGRANGEK_HI_SZ 12
|
||||
#define GX_BP_FOGRANGEK_HI_MASK (((1 << 12) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_FOGRANGEK_HI(reg) GX_BITGET(reg, 20, 12)
|
||||
#define GX_BP_SET_FOGRANGEK_HI(reg, x) ((reg) = GX_BITSET(reg, 20, 12, x))
|
||||
// LO [8:19] (12)
|
||||
#define GX_BP_FOGRANGEK_LO_ST 8
|
||||
#define GX_BP_FOGRANGEK_LO_END 19
|
||||
#define GX_BP_FOGRANGEK_LO_SZ 12
|
||||
#define GX_BP_FOGRANGEK_LO_MASK (((1 << 12) - 1) << 31 - 19)
|
||||
#define GX_BP_GET_FOGRANGEK_LO(reg) GX_BITGET(reg, 8, 12)
|
||||
#define GX_BP_SET_FOGRANGEK_LO(reg, x) ((reg) = GX_BITSET(reg, 8, 12, x))
|
||||
|
||||
/**
|
||||
* BP register 0xEE - FogParam0
|
||||
*/
|
||||
// A_MANT [21:31] (11)
|
||||
#define GX_BP_FOGPARAM0_A_MANT_ST 21
|
||||
#define GX_BP_FOGPARAM0_A_MANT_END 31
|
||||
#define GX_BP_FOGPARAM0_A_MANT_SZ 11
|
||||
#define GX_BP_FOGPARAM0_A_MANT_MASK (((1 << 11) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_FOGPARAM0_A_MANT(reg) GX_BITGET(reg, 21, 11)
|
||||
#define GX_BP_SET_FOGPARAM0_A_MANT(reg, x) ((reg) = GX_BITSET(reg, 21, 11, x))
|
||||
// A_EXP [13:20] (8)
|
||||
#define GX_BP_FOGPARAM0_A_EXP_ST 13
|
||||
#define GX_BP_FOGPARAM0_A_EXP_END 20
|
||||
#define GX_BP_FOGPARAM0_A_EXP_SZ 8
|
||||
#define GX_BP_FOGPARAM0_A_EXP_MASK (((1 << 8) - 1) << 31 - 20)
|
||||
#define GX_BP_GET_FOGPARAM0_A_EXP(reg) GX_BITGET(reg, 13, 8)
|
||||
#define GX_BP_SET_FOGPARAM0_A_EXP(reg, x) ((reg) = GX_BITSET(reg, 13, 8, x))
|
||||
// A_SIGN [12:12] (1)
|
||||
#define GX_BP_FOGPARAM0_A_SIGN_ST 12
|
||||
#define GX_BP_FOGPARAM0_A_SIGN_END 12
|
||||
#define GX_BP_FOGPARAM0_A_SIGN_SZ 1
|
||||
#define GX_BP_FOGPARAM0_A_SIGN_MASK (((1 << 1) - 1) << 31 - 12)
|
||||
#define GX_BP_GET_FOGPARAM0_A_SIGN(reg) GX_BITGET(reg, 12, 1)
|
||||
#define GX_BP_SET_FOGPARAM0_A_SIGN(reg, x) ((reg) = GX_BITSET(reg, 12, 1, x))
|
||||
|
||||
/**
|
||||
* BP register 0xEF - FogParam1
|
||||
*/
|
||||
// B_MAG [8:31] (24)
|
||||
#define GX_BP_FOGPARAM1_B_MAG_ST 8
|
||||
#define GX_BP_FOGPARAM1_B_MAG_END 31
|
||||
#define GX_BP_FOGPARAM1_B_MAG_SZ 24
|
||||
#define GX_BP_FOGPARAM1_B_MAG_MASK (((1 << 24) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_FOGPARAM1_B_MAG(reg) GX_BITGET(reg, 8, 24)
|
||||
#define GX_BP_SET_FOGPARAM1_B_MAG(reg, x) ((reg) = GX_BITSET(reg, 8, 24, x))
|
||||
|
||||
/**
|
||||
* BP register 0xF0 - FogParam2
|
||||
*/
|
||||
// B_SHIFT [27:31] (5)
|
||||
#define GX_BP_FOGPARAM2_B_SHIFT_ST 27
|
||||
#define GX_BP_FOGPARAM2_B_SHIFT_END 31
|
||||
#define GX_BP_FOGPARAM2_B_SHIFT_SZ 5
|
||||
#define GX_BP_FOGPARAM2_B_SHIFT_MASK (((1 << 5) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_FOGPARAM2_B_SHIFT(reg) GX_BITGET(reg, 27, 5)
|
||||
#define GX_BP_SET_FOGPARAM2_B_SHIFT(reg, x) ((reg) = GX_BITSET(reg, 27, 5, x))
|
||||
|
||||
/**
|
||||
* BP register 0xF1 - FogParam3
|
||||
*/
|
||||
// C_MANT [21:31] (11)
|
||||
#define GX_BP_FOGPARAM3_C_MANT_ST 21
|
||||
#define GX_BP_FOGPARAM3_C_MANT_END 31
|
||||
#define GX_BP_FOGPARAM3_C_MANT_SZ 11
|
||||
#define GX_BP_FOGPARAM3_C_MANT_MASK (((1 << 11) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_FOGPARAM3_C_MANT(reg) GX_BITGET(reg, 21, 11)
|
||||
#define GX_BP_SET_FOGPARAM3_C_MANT(reg, x) ((reg) = GX_BITSET(reg, 21, 11, x))
|
||||
// C_EXP [13:20] (8)
|
||||
#define GX_BP_FOGPARAM3_C_EXP_ST 13
|
||||
#define GX_BP_FOGPARAM3_C_EXP_END 20
|
||||
#define GX_BP_FOGPARAM3_C_EXP_SZ 8
|
||||
#define GX_BP_FOGPARAM3_C_EXP_MASK (((1 << 8) - 1) << 31 - 20)
|
||||
#define GX_BP_GET_FOGPARAM3_C_EXP(reg) GX_BITGET(reg, 13, 8)
|
||||
#define GX_BP_SET_FOGPARAM3_C_EXP(reg, x) ((reg) = GX_BITSET(reg, 13, 8, x))
|
||||
// C_SIGN [12:12] (1)
|
||||
#define GX_BP_FOGPARAM3_C_SIGN_ST 12
|
||||
#define GX_BP_FOGPARAM3_C_SIGN_END 12
|
||||
#define GX_BP_FOGPARAM3_C_SIGN_SZ 1
|
||||
#define GX_BP_FOGPARAM3_C_SIGN_MASK (((1 << 1) - 1) << 31 - 12)
|
||||
#define GX_BP_GET_FOGPARAM3_C_SIGN(reg) GX_BITGET(reg, 12, 1)
|
||||
#define GX_BP_SET_FOGPARAM3_C_SIGN(reg, x) ((reg) = GX_BITSET(reg, 12, 1, x))
|
||||
// PROJ [11:11] (1)
|
||||
#define GX_BP_FOGPARAM3_PROJ_ST 11
|
||||
#define GX_BP_FOGPARAM3_PROJ_END 11
|
||||
#define GX_BP_FOGPARAM3_PROJ_SZ 1
|
||||
#define GX_BP_FOGPARAM3_PROJ_MASK (((1 << 1) - 1) << 31 - 11)
|
||||
#define GX_BP_GET_FOGPARAM3_PROJ(reg) GX_BITGET(reg, 11, 1)
|
||||
#define GX_BP_SET_FOGPARAM3_PROJ(reg, x) ((reg) = GX_BITSET(reg, 11, 1, x))
|
||||
// FSEL [8:10] (3)
|
||||
#define GX_BP_FOGPARAM3_FSEL_ST 8
|
||||
#define GX_BP_FOGPARAM3_FSEL_END 10
|
||||
#define GX_BP_FOGPARAM3_FSEL_SZ 3
|
||||
#define GX_BP_FOGPARAM3_FSEL_MASK (((1 << 3) - 1) << 31 - 10)
|
||||
#define GX_BP_GET_FOGPARAM3_FSEL(reg) GX_BITGET(reg, 8, 3)
|
||||
#define GX_BP_SET_FOGPARAM3_FSEL(reg, x) ((reg) = GX_BITSET(reg, 8, 3, x))
|
||||
|
||||
/**
|
||||
* BP register 0xF2 - FogColor
|
||||
*/
|
||||
// RGB [8:31] (24)
|
||||
#define GX_BP_FOGCOLOR_RGB_ST 8
|
||||
#define GX_BP_FOGCOLOR_RGB_END 31
|
||||
#define GX_BP_FOGCOLOR_RGB_SZ 24
|
||||
#define GX_BP_FOGCOLOR_RGB_MASK (((1 << 24) - 1) << 31 - 31)
|
||||
#define GX_BP_GET_FOGCOLOR_RGB(reg) GX_BITGET(reg, 8, 24)
|
||||
#define GX_BP_SET_FOGCOLOR_RGB(reg, x) ((reg) = GX_BITSET(reg, 8, 24, x))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,541 @@
|
||||
#ifndef RVL_SDK_GX_HARDWARE_CP_H
|
||||
#define RVL_SDK_GX_HARDWARE_CP_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
*
|
||||
* GX Command Processor (CP)
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
* CP registers
|
||||
*/
|
||||
typedef enum {
|
||||
GX_CP_REG_MATRIXINDEXA = 0x30,
|
||||
GX_CP_REG_MATRIXINDEXB = 0x40,
|
||||
GX_CP_REG_VCD_LO = 0x50,
|
||||
GX_CP_REG_VCD_HI = 0x60,
|
||||
GX_CP_REG_VAT_GROUP0 = 0x70,
|
||||
GX_CP_REG_VAT_GROUP1 = 0x80,
|
||||
GX_CP_REG_VAT_GROUP2 = 0x90,
|
||||
GX_CP_REG_ARRAYBASE = 0xA0,
|
||||
GX_CP_REG_ARRAYSTRIDE = 0xB0,
|
||||
} GX_CP_REG;
|
||||
|
||||
/**
|
||||
* CP register 0x30 - MatrixIndexA
|
||||
*/
|
||||
// GEOM [26:31] (6)
|
||||
#define GX_CP_MATRIXINDEXA_GEOM_ST 26
|
||||
#define GX_CP_MATRIXINDEXA_GEOM_END 31
|
||||
#define GX_CP_MATRIXINDEXA_GEOM_SZ 6
|
||||
#define GX_CP_MATRIXINDEXA_GEOM_MASK (((1 << 6) - 1) << 31 - 31)
|
||||
#define GX_CP_GET_MATRIXINDEXA_GEOM(reg) GX_BITGET(reg, 26, 6)
|
||||
#define GX_CP_SET_MATRIXINDEXA_GEOM(reg, x) ((reg) = GX_BITSET(reg, 26, 6, x))
|
||||
// TEX0 [20:25] (6)
|
||||
#define GX_CP_MATRIXINDEXA_TEX0_ST 20
|
||||
#define GX_CP_MATRIXINDEXA_TEX0_END 25
|
||||
#define GX_CP_MATRIXINDEXA_TEX0_SZ 6
|
||||
#define GX_CP_MATRIXINDEXA_TEX0_MASK (((1 << 6) - 1) << 31 - 25)
|
||||
#define GX_CP_GET_MATRIXINDEXA_TEX0(reg) GX_BITGET(reg, 20, 6)
|
||||
#define GX_CP_SET_MATRIXINDEXA_TEX0(reg, x) ((reg) = GX_BITSET(reg, 20, 6, x))
|
||||
// TEX1 [14:19] (6)
|
||||
#define GX_CP_MATRIXINDEXA_TEX1_ST 14
|
||||
#define GX_CP_MATRIXINDEXA_TEX1_END 19
|
||||
#define GX_CP_MATRIXINDEXA_TEX1_SZ 6
|
||||
#define GX_CP_MATRIXINDEXA_TEX1_MASK (((1 << 6) - 1) << 31 - 19)
|
||||
#define GX_CP_GET_MATRIXINDEXA_TEX1(reg) GX_BITGET(reg, 14, 6)
|
||||
#define GX_CP_SET_MATRIXINDEXA_TEX1(reg, x) ((reg) = GX_BITSET(reg, 14, 6, x))
|
||||
// TEX2 [8:13] (6)
|
||||
#define GX_CP_MATRIXINDEXA_TEX2_ST 8
|
||||
#define GX_CP_MATRIXINDEXA_TEX2_END 13
|
||||
#define GX_CP_MATRIXINDEXA_TEX2_SZ 6
|
||||
#define GX_CP_MATRIXINDEXA_TEX2_MASK (((1 << 6) - 1) << 31 - 13)
|
||||
#define GX_CP_GET_MATRIXINDEXA_TEX2(reg) GX_BITGET(reg, 8, 6)
|
||||
#define GX_CP_SET_MATRIXINDEXA_TEX2(reg, x) ((reg) = GX_BITSET(reg, 8, 6, x))
|
||||
// TEX3 [2:7] (6)
|
||||
#define GX_CP_MATRIXINDEXA_TEX3_ST 2
|
||||
#define GX_CP_MATRIXINDEXA_TEX3_END 7
|
||||
#define GX_CP_MATRIXINDEXA_TEX3_SZ 6
|
||||
#define GX_CP_MATRIXINDEXA_TEX3_MASK (((1 << 6) - 1) << 31 - 7)
|
||||
#define GX_CP_GET_MATRIXINDEXA_TEX3(reg) GX_BITGET(reg, 2, 6)
|
||||
#define GX_CP_SET_MATRIXINDEXA_TEX3(reg, x) ((reg) = GX_BITSET(reg, 2, 6, x))
|
||||
|
||||
/**
|
||||
* CP register 0x40 - MatrixIndexB
|
||||
*/
|
||||
// TEX4 [26:31] (6)
|
||||
#define GX_CP_MATRIXINDEXB_TEX4_ST 26
|
||||
#define GX_CP_MATRIXINDEXB_TEX4_END 31
|
||||
#define GX_CP_MATRIXINDEXB_TEX4_SZ 6
|
||||
#define GX_CP_MATRIXINDEXB_TEX4_MASK (((1 << 6) - 1) << 31 - 31)
|
||||
#define GX_CP_GET_MATRIXINDEXB_TEX4(reg) GX_BITGET(reg, 26, 6)
|
||||
#define GX_CP_SET_MATRIXINDEXB_TEX4(reg, x) ((reg) = GX_BITSET(reg, 26, 6, x))
|
||||
// TEX5 [20:25] (6)
|
||||
#define GX_CP_MATRIXINDEXB_TEX5_ST 20
|
||||
#define GX_CP_MATRIXINDEXB_TEX5_END 25
|
||||
#define GX_CP_MATRIXINDEXB_TEX5_SZ 6
|
||||
#define GX_CP_MATRIXINDEXB_TEX5_MASK (((1 << 6) - 1) << 31 - 25)
|
||||
#define GX_CP_GET_MATRIXINDEXB_TEX5(reg) GX_BITGET(reg, 20, 6)
|
||||
#define GX_CP_SET_MATRIXINDEXB_TEX5(reg, x) ((reg) = GX_BITSET(reg, 20, 6, x))
|
||||
// TEX6 [14:19] (6)
|
||||
#define GX_CP_MATRIXINDEXB_TEX6_ST 14
|
||||
#define GX_CP_MATRIXINDEXB_TEX6_END 19
|
||||
#define GX_CP_MATRIXINDEXB_TEX6_SZ 6
|
||||
#define GX_CP_MATRIXINDEXB_TEX6_MASK (((1 << 6) - 1) << 31 - 19)
|
||||
#define GX_CP_GET_MATRIXINDEXB_TEX6(reg) GX_BITGET(reg, 14, 6)
|
||||
#define GX_CP_SET_MATRIXINDEXB_TEX6(reg, x) ((reg) = GX_BITSET(reg, 14, 6, x))
|
||||
// TEX7 [8:13] (6)
|
||||
#define GX_CP_MATRIXINDEXB_TEX7_ST 8
|
||||
#define GX_CP_MATRIXINDEXB_TEX7_END 13
|
||||
#define GX_CP_MATRIXINDEXB_TEX7_SZ 6
|
||||
#define GX_CP_MATRIXINDEXB_TEX7_MASK (((1 << 6) - 1) << 31 - 13)
|
||||
#define GX_CP_GET_MATRIXINDEXB_TEX7(reg) GX_BITGET(reg, 8, 6)
|
||||
#define GX_CP_SET_MATRIXINDEXB_TEX7(reg, x) ((reg) = GX_BITSET(reg, 8, 6, x))
|
||||
|
||||
/**
|
||||
* CP register 0x50 - VCD_Lo
|
||||
*/
|
||||
// POSMATIDX [31:31] (1)
|
||||
#define GX_CP_VCD_LO_POSMATIDX_ST 31
|
||||
#define GX_CP_VCD_LO_POSMATIDX_END 31
|
||||
#define GX_CP_VCD_LO_POSMATIDX_SZ 1
|
||||
#define GX_CP_VCD_LO_POSMATIDX_MASK (((1 << 1) - 1) << 31 - 31)
|
||||
#define GX_CP_GET_VCD_LO_POSMATIDX(reg) GX_BITGET(reg, 31, 1)
|
||||
#define GX_CP_SET_VCD_LO_POSMATIDX(reg, x) ((reg) = GX_BITSET(reg, 31, 1, x))
|
||||
// TEX0MATIDX [30:30] (1)
|
||||
#define GX_CP_VCD_LO_TEX0MATIDX_ST 30
|
||||
#define GX_CP_VCD_LO_TEX0MATIDX_END 30
|
||||
#define GX_CP_VCD_LO_TEX0MATIDX_SZ 1
|
||||
#define GX_CP_VCD_LO_TEX0MATIDX_MASK (((1 << 1) - 1) << 31 - 30)
|
||||
#define GX_CP_GET_VCD_LO_TEX0MATIDX(reg) GX_BITGET(reg, 30, 1)
|
||||
#define GX_CP_SET_VCD_LO_TEX0MATIDX(reg, x) ((reg) = GX_BITSET(reg, 30, 1, x))
|
||||
// TEX1MATIDX [29:29] (1)
|
||||
#define GX_CP_VCD_LO_TEX1MATIDX_ST 29
|
||||
#define GX_CP_VCD_LO_TEX1MATIDX_END 29
|
||||
#define GX_CP_VCD_LO_TEX1MATIDX_SZ 1
|
||||
#define GX_CP_VCD_LO_TEX1MATIDX_MASK (((1 << 1) - 1) << 31 - 29)
|
||||
#define GX_CP_GET_VCD_LO_TEX1MATIDX(reg) GX_BITGET(reg, 29, 1)
|
||||
#define GX_CP_SET_VCD_LO_TEX1MATIDX(reg, x) ((reg) = GX_BITSET(reg, 29, 1, x))
|
||||
// TEX2MATIDX [28:28] (1)
|
||||
#define GX_CP_VCD_LO_TEX2MATIDX_ST 28
|
||||
#define GX_CP_VCD_LO_TEX2MATIDX_END 28
|
||||
#define GX_CP_VCD_LO_TEX2MATIDX_SZ 1
|
||||
#define GX_CP_VCD_LO_TEX2MATIDX_MASK (((1 << 1) - 1) << 31 - 28)
|
||||
#define GX_CP_GET_VCD_LO_TEX2MATIDX(reg) GX_BITGET(reg, 28, 1)
|
||||
#define GX_CP_SET_VCD_LO_TEX2MATIDX(reg, x) ((reg) = GX_BITSET(reg, 28, 1, x))
|
||||
// TEX3MATIDX [27:27] (1)
|
||||
#define GX_CP_VCD_LO_TEX3MATIDX_ST 27
|
||||
#define GX_CP_VCD_LO_TEX3MATIDX_END 27
|
||||
#define GX_CP_VCD_LO_TEX3MATIDX_SZ 1
|
||||
#define GX_CP_VCD_LO_TEX3MATIDX_MASK (((1 << 1) - 1) << 31 - 27)
|
||||
#define GX_CP_GET_VCD_LO_TEX3MATIDX(reg) GX_BITGET(reg, 27, 1)
|
||||
#define GX_CP_SET_VCD_LO_TEX3MATIDX(reg, x) ((reg) = GX_BITSET(reg, 27, 1, x))
|
||||
// TEX4MATIDX [26:26] (1)
|
||||
#define GX_CP_VCD_LO_TEX4MATIDX_ST 26
|
||||
#define GX_CP_VCD_LO_TEX4MATIDX_END 26
|
||||
#define GX_CP_VCD_LO_TEX4MATIDX_SZ 1
|
||||
#define GX_CP_VCD_LO_TEX4MATIDX_MASK (((1 << 1) - 1) << 31 - 26)
|
||||
#define GX_CP_GET_VCD_LO_TEX4MATIDX(reg) GX_BITGET(reg, 26, 1)
|
||||
#define GX_CP_SET_VCD_LO_TEX4MATIDX(reg, x) ((reg) = GX_BITSET(reg, 26, 1, x))
|
||||
// TEX5MATIDX [25:25] (1)
|
||||
#define GX_CP_VCD_LO_TEX5MATIDX_ST 25
|
||||
#define GX_CP_VCD_LO_TEX5MATIDX_END 25
|
||||
#define GX_CP_VCD_LO_TEX5MATIDX_SZ 1
|
||||
#define GX_CP_VCD_LO_TEX5MATIDX_MASK (((1 << 1) - 1) << 31 - 25)
|
||||
#define GX_CP_GET_VCD_LO_TEX5MATIDX(reg) GX_BITGET(reg, 25, 1)
|
||||
#define GX_CP_SET_VCD_LO_TEX5MATIDX(reg, x) ((reg) = GX_BITSET(reg, 25, 1, x))
|
||||
// TEX6MATIDX [24:24] (1)
|
||||
#define GX_CP_VCD_LO_TEX6MATIDX_ST 24
|
||||
#define GX_CP_VCD_LO_TEX6MATIDX_END 24
|
||||
#define GX_CP_VCD_LO_TEX6MATIDX_SZ 1
|
||||
#define GX_CP_VCD_LO_TEX6MATIDX_MASK (((1 << 1) - 1) << 31 - 24)
|
||||
#define GX_CP_GET_VCD_LO_TEX6MATIDX(reg) GX_BITGET(reg, 24, 1)
|
||||
#define GX_CP_SET_VCD_LO_TEX6MATIDX(reg, x) ((reg) = GX_BITSET(reg, 24, 1, x))
|
||||
// TEX7MATIDX [23:23] (1)
|
||||
#define GX_CP_VCD_LO_TEX7MATIDX_ST 23
|
||||
#define GX_CP_VCD_LO_TEX7MATIDX_END 23
|
||||
#define GX_CP_VCD_LO_TEX7MATIDX_SZ 1
|
||||
#define GX_CP_VCD_LO_TEX7MATIDX_MASK (((1 << 1) - 1) << 31 - 23)
|
||||
#define GX_CP_GET_VCD_LO_TEX7MATIDX(reg) GX_BITGET(reg, 23, 1)
|
||||
#define GX_CP_SET_VCD_LO_TEX7MATIDX(reg, x) ((reg) = GX_BITSET(reg, 23, 1, x))
|
||||
// POSITION [21:22] (2)
|
||||
#define GX_CP_VCD_LO_POSITION_ST 21
|
||||
#define GX_CP_VCD_LO_POSITION_END 22
|
||||
#define GX_CP_VCD_LO_POSITION_SZ 2
|
||||
#define GX_CP_VCD_LO_POSITION_MASK (((1 << 2) - 1) << 31 - 22)
|
||||
#define GX_CP_GET_VCD_LO_POSITION(reg) GX_BITGET(reg, 21, 2)
|
||||
#define GX_CP_SET_VCD_LO_POSITION(reg, x) ((reg) = GX_BITSET(reg, 21, 2, x))
|
||||
// NORMAL [19:20] (2)
|
||||
#define GX_CP_VCD_LO_NORMAL_ST 19
|
||||
#define GX_CP_VCD_LO_NORMAL_END 20
|
||||
#define GX_CP_VCD_LO_NORMAL_SZ 2
|
||||
#define GX_CP_VCD_LO_NORMAL_MASK (((1 << 2) - 1) << 31 - 20)
|
||||
#define GX_CP_GET_VCD_LO_NORMAL(reg) GX_BITGET(reg, 19, 2)
|
||||
#define GX_CP_SET_VCD_LO_NORMAL(reg, x) ((reg) = GX_BITSET(reg, 19, 2, x))
|
||||
// COLORDIFFUSED [17:18] (2)
|
||||
#define GX_CP_VCD_LO_COLORDIFFUSED_ST 17
|
||||
#define GX_CP_VCD_LO_COLORDIFFUSED_END 18
|
||||
#define GX_CP_VCD_LO_COLORDIFFUSED_SZ 2
|
||||
#define GX_CP_VCD_LO_COLORDIFFUSED_MASK (((1 << 2) - 1) << 31 - 18)
|
||||
#define GX_CP_GET_VCD_LO_COLORDIFFUSED(reg) GX_BITGET(reg, 17, 2)
|
||||
#define GX_CP_SET_VCD_LO_COLORDIFFUSED(reg, x) ((reg) = GX_BITSET(reg, 17, 2, x))
|
||||
// COLORSPECULAR [15:16] (2)
|
||||
#define GX_CP_VCD_LO_COLORSPECULAR_ST 15
|
||||
#define GX_CP_VCD_LO_COLORSPECULAR_END 16
|
||||
#define GX_CP_VCD_LO_COLORSPECULAR_SZ 2
|
||||
#define GX_CP_VCD_LO_COLORSPECULAR_MASK (((1 << 2) - 1) << 31 - 16)
|
||||
#define GX_CP_GET_VCD_LO_COLORSPECULAR(reg) GX_BITGET(reg, 15, 2)
|
||||
#define GX_CP_SET_VCD_LO_COLORSPECULAR(reg, x) ((reg) = GX_BITSET(reg, 15, 2, x))
|
||||
|
||||
/**
|
||||
* CP register 0x60 - VCD_Hi
|
||||
*/
|
||||
// TEX0COORD [30:31] (2)
|
||||
#define GX_CP_VCD_HI_TEX0COORD_ST 30
|
||||
#define GX_CP_VCD_HI_TEX0COORD_END 31
|
||||
#define GX_CP_VCD_HI_TEX0COORD_SZ 2
|
||||
#define GX_CP_VCD_HI_TEX0COORD_MASK (((1 << 2) - 1) << 31 - 31)
|
||||
#define GX_CP_GET_VCD_HI_TEX0COORD(reg) GX_BITGET(reg, 30, 2)
|
||||
#define GX_CP_SET_VCD_HI_TEX0COORD(reg, x) ((reg) = GX_BITSET(reg, 30, 2, x))
|
||||
// TEX1COORD [28:29] (2)
|
||||
#define GX_CP_VCD_HI_TEX1COORD_ST 28
|
||||
#define GX_CP_VCD_HI_TEX1COORD_END 29
|
||||
#define GX_CP_VCD_HI_TEX1COORD_SZ 2
|
||||
#define GX_CP_VCD_HI_TEX1COORD_MASK (((1 << 2) - 1) << 31 - 29)
|
||||
#define GX_CP_GET_VCD_HI_TEX1COORD(reg) GX_BITGET(reg, 28, 2)
|
||||
#define GX_CP_SET_VCD_HI_TEX1COORD(reg, x) ((reg) = GX_BITSET(reg, 28, 2, x))
|
||||
// TEX2COORD [26:27] (2)
|
||||
#define GX_CP_VCD_HI_TEX2COORD_ST 26
|
||||
#define GX_CP_VCD_HI_TEX2COORD_END 27
|
||||
#define GX_CP_VCD_HI_TEX2COORD_SZ 2
|
||||
#define GX_CP_VCD_HI_TEX2COORD_MASK (((1 << 2) - 1) << 31 - 27)
|
||||
#define GX_CP_GET_VCD_HI_TEX2COORD(reg) GX_BITGET(reg, 26, 2)
|
||||
#define GX_CP_SET_VCD_HI_TEX2COORD(reg, x) ((reg) = GX_BITSET(reg, 26, 2, x))
|
||||
// TEX3COORD [24:25] (2)
|
||||
#define GX_CP_VCD_HI_TEX3COORD_ST 24
|
||||
#define GX_CP_VCD_HI_TEX3COORD_END 25
|
||||
#define GX_CP_VCD_HI_TEX3COORD_SZ 2
|
||||
#define GX_CP_VCD_HI_TEX3COORD_MASK (((1 << 2) - 1) << 31 - 25)
|
||||
#define GX_CP_GET_VCD_HI_TEX3COORD(reg) GX_BITGET(reg, 24, 2)
|
||||
#define GX_CP_SET_VCD_HI_TEX3COORD(reg, x) ((reg) = GX_BITSET(reg, 24, 2, x))
|
||||
// TEX4COORD [22:23] (2)
|
||||
#define GX_CP_VCD_HI_TEX4COORD_ST 22
|
||||
#define GX_CP_VCD_HI_TEX4COORD_END 23
|
||||
#define GX_CP_VCD_HI_TEX4COORD_SZ 2
|
||||
#define GX_CP_VCD_HI_TEX4COORD_MASK (((1 << 2) - 1) << 31 - 23)
|
||||
#define GX_CP_GET_VCD_HI_TEX4COORD(reg) GX_BITGET(reg, 22, 2)
|
||||
#define GX_CP_SET_VCD_HI_TEX4COORD(reg, x) ((reg) = GX_BITSET(reg, 22, 2, x))
|
||||
// TEX5COORD [20:21] (2)
|
||||
#define GX_CP_VCD_HI_TEX5COORD_ST 20
|
||||
#define GX_CP_VCD_HI_TEX5COORD_END 21
|
||||
#define GX_CP_VCD_HI_TEX5COORD_SZ 2
|
||||
#define GX_CP_VCD_HI_TEX5COORD_MASK (((1 << 2) - 1) << 31 - 21)
|
||||
#define GX_CP_GET_VCD_HI_TEX5COORD(reg) GX_BITGET(reg, 20, 2)
|
||||
#define GX_CP_SET_VCD_HI_TEX5COORD(reg, x) ((reg) = GX_BITSET(reg, 20, 2, x))
|
||||
// TEX6COORD [18:19] (2)
|
||||
#define GX_CP_VCD_HI_TEX6COORD_ST 18
|
||||
#define GX_CP_VCD_HI_TEX6COORD_END 19
|
||||
#define GX_CP_VCD_HI_TEX6COORD_SZ 2
|
||||
#define GX_CP_VCD_HI_TEX6COORD_MASK (((1 << 2) - 1) << 31 - 19)
|
||||
#define GX_CP_GET_VCD_HI_TEX6COORD(reg) GX_BITGET(reg, 18, 2)
|
||||
#define GX_CP_SET_VCD_HI_TEX6COORD(reg, x) ((reg) = GX_BITSET(reg, 18, 2, x))
|
||||
// TEX7COORD [16:17] (2)
|
||||
#define GX_CP_VCD_HI_TEX7COORD_ST 16
|
||||
#define GX_CP_VCD_HI_TEX7COORD_END 17
|
||||
#define GX_CP_VCD_HI_TEX7COORD_SZ 2
|
||||
#define GX_CP_VCD_HI_TEX7COORD_MASK (((1 << 2) - 1) << 31 - 17)
|
||||
#define GX_CP_GET_VCD_HI_TEX7COORD(reg) GX_BITGET(reg, 16, 2)
|
||||
#define GX_CP_SET_VCD_HI_TEX7COORD(reg, x) ((reg) = GX_BITSET(reg, 16, 2, x))
|
||||
|
||||
/**
|
||||
* CP register 0x70 - VAT_group0
|
||||
*/
|
||||
// POS_CNT [31:31] (1)
|
||||
#define GX_CP_VAT_GROUP0_POS_CNT_ST 31
|
||||
#define GX_CP_VAT_GROUP0_POS_CNT_END 31
|
||||
#define GX_CP_VAT_GROUP0_POS_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP0_POS_CNT_MASK (((1 << 1) - 1) << 31 - 31)
|
||||
#define GX_CP_GET_VAT_GROUP0_POS_CNT(reg) GX_BITGET(reg, 31, 1)
|
||||
#define GX_CP_SET_VAT_GROUP0_POS_CNT(reg, x) ((reg) = GX_BITSET(reg, 31, 1, x))
|
||||
// POS_TYPE [28:30] (3)
|
||||
#define GX_CP_VAT_GROUP0_POS_TYPE_ST 28
|
||||
#define GX_CP_VAT_GROUP0_POS_TYPE_END 30
|
||||
#define GX_CP_VAT_GROUP0_POS_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP0_POS_TYPE_MASK (((1 << 3) - 1) << 31 - 30)
|
||||
#define GX_CP_GET_VAT_GROUP0_POS_TYPE(reg) GX_BITGET(reg, 28, 3)
|
||||
#define GX_CP_SET_VAT_GROUP0_POS_TYPE(reg, x) ((reg) = GX_BITSET(reg, 28, 3, x))
|
||||
// POS_SHIFT [23:27] (5)
|
||||
#define GX_CP_VAT_GROUP0_POS_SHIFT_ST 23
|
||||
#define GX_CP_VAT_GROUP0_POS_SHIFT_END 27
|
||||
#define GX_CP_VAT_GROUP0_POS_SHIFT_SZ 5
|
||||
#define GX_CP_VAT_GROUP0_POS_SHIFT_MASK (((1 << 5) - 1) << 31 - 27)
|
||||
#define GX_CP_GET_VAT_GROUP0_POS_SHIFT(reg) GX_BITGET(reg, 23, 5)
|
||||
#define GX_CP_SET_VAT_GROUP0_POS_SHIFT(reg, x) ((reg) = GX_BITSET(reg, 23, 5, x))
|
||||
// NRM_CNT [22:22] (1)
|
||||
#define GX_CP_VAT_GROUP0_NRM_CNT_ST 22
|
||||
#define GX_CP_VAT_GROUP0_NRM_CNT_END 22
|
||||
#define GX_CP_VAT_GROUP0_NRM_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP0_NRM_CNT_MASK (((1 << 1) - 1) << 31 - 22)
|
||||
#define GX_CP_GET_VAT_GROUP0_NRM_CNT(reg) GX_BITGET(reg, 22, 1)
|
||||
#define GX_CP_SET_VAT_GROUP0_NRM_CNT(reg, x) ((reg) = GX_BITSET(reg, 22, 1, x))
|
||||
// NRM_TYPE [19:21] (3)
|
||||
#define GX_CP_VAT_GROUP0_NRM_TYPE_ST 19
|
||||
#define GX_CP_VAT_GROUP0_NRM_TYPE_END 21
|
||||
#define GX_CP_VAT_GROUP0_NRM_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP0_NRM_TYPE_MASK (((1 << 3) - 1) << 31 - 21)
|
||||
#define GX_CP_GET_VAT_GROUP0_NRM_TYPE(reg) GX_BITGET(reg, 19, 3)
|
||||
#define GX_CP_SET_VAT_GROUP0_NRM_TYPE(reg, x) ((reg) = GX_BITSET(reg, 19, 3, x))
|
||||
// COLORDIFF_CNT [18:18] (1)
|
||||
#define GX_CP_VAT_GROUP0_COLORDIFF_CNT_ST 18
|
||||
#define GX_CP_VAT_GROUP0_COLORDIFF_CNT_END 18
|
||||
#define GX_CP_VAT_GROUP0_COLORDIFF_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP0_COLORDIFF_CNT_MASK (((1 << 1) - 1) << 31 - 18)
|
||||
#define GX_CP_GET_VAT_GROUP0_COLORDIFF_CNT(reg) GX_BITGET(reg, 18, 1)
|
||||
#define GX_CP_SET_VAT_GROUP0_COLORDIFF_CNT(reg, x) ((reg) = GX_BITSET(reg, 18, 1, x))
|
||||
// COLORDIFF_TYPE [15:17] (3)
|
||||
#define GX_CP_VAT_GROUP0_COLORDIFF_TYPE_ST 15
|
||||
#define GX_CP_VAT_GROUP0_COLORDIFF_TYPE_END 17
|
||||
#define GX_CP_VAT_GROUP0_COLORDIFF_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP0_COLORDIFF_TYPE_MASK (((1 << 3) - 1) << 31 - 17)
|
||||
#define GX_CP_GET_VAT_GROUP0_COLORDIFF_TYPE(reg) GX_BITGET(reg, 15, 3)
|
||||
#define GX_CP_SET_VAT_GROUP0_COLORDIFF_TYPE(reg, x) ((reg) = GX_BITSET(reg, 15, 3, x))
|
||||
// COLORSPEC_CNT [14:14] (1)
|
||||
#define GX_CP_VAT_GROUP0_COLORSPEC_CNT_ST 14
|
||||
#define GX_CP_VAT_GROUP0_COLORSPEC_CNT_END 14
|
||||
#define GX_CP_VAT_GROUP0_COLORSPEC_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP0_COLORSPEC_CNT_MASK (((1 << 1) - 1) << 31 - 14)
|
||||
#define GX_CP_GET_VAT_GROUP0_COLORSPEC_CNT(reg) GX_BITGET(reg, 14, 1)
|
||||
#define GX_CP_SET_VAT_GROUP0_COLORSPEC_CNT(reg, x) ((reg) = GX_BITSET(reg, 14, 1, x))
|
||||
// COLORSPEC_TYPE [11:13] (3)
|
||||
#define GX_CP_VAT_GROUP0_COLORSPEC_TYPE_ST 11
|
||||
#define GX_CP_VAT_GROUP0_COLORSPEC_TYPE_END 13
|
||||
#define GX_CP_VAT_GROUP0_COLORSPEC_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP0_COLORSPEC_TYPE_MASK (((1 << 3) - 1) << 31 - 13)
|
||||
#define GX_CP_GET_VAT_GROUP0_COLORSPEC_TYPE(reg) GX_BITGET(reg, 11, 3)
|
||||
#define GX_CP_SET_VAT_GROUP0_COLORSPEC_TYPE(reg, x) ((reg) = GX_BITSET(reg, 11, 3, x))
|
||||
// TXC0_CNT [10:10] (1)
|
||||
#define GX_CP_VAT_GROUP0_TXC0_CNT_ST 10
|
||||
#define GX_CP_VAT_GROUP0_TXC0_CNT_END 10
|
||||
#define GX_CP_VAT_GROUP0_TXC0_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP0_TXC0_CNT_MASK (((1 << 1) - 1) << 31 - 10)
|
||||
#define GX_CP_GET_VAT_GROUP0_TXC0_CNT(reg) GX_BITGET(reg, 10, 1)
|
||||
#define GX_CP_SET_VAT_GROUP0_TXC0_CNT(reg, x) ((reg) = GX_BITSET(reg, 10, 1, x))
|
||||
// TXC0_TYPE [7:9] (3)
|
||||
#define GX_CP_VAT_GROUP0_TXC0_TYPE_ST 7
|
||||
#define GX_CP_VAT_GROUP0_TXC0_TYPE_END 9
|
||||
#define GX_CP_VAT_GROUP0_TXC0_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP0_TXC0_TYPE_MASK (((1 << 3) - 1) << 31 - 9)
|
||||
#define GX_CP_GET_VAT_GROUP0_TXC0_TYPE(reg) GX_BITGET(reg, 7, 3)
|
||||
#define GX_CP_SET_VAT_GROUP0_TXC0_TYPE(reg, x) ((reg) = GX_BITSET(reg, 7, 3, x))
|
||||
// TXC0_SHIFT [2:6] (5)
|
||||
#define GX_CP_VAT_GROUP0_TXC0_SHIFT_ST 2
|
||||
#define GX_CP_VAT_GROUP0_TXC0_SHIFT_END 6
|
||||
#define GX_CP_VAT_GROUP0_TXC0_SHIFT_SZ 5
|
||||
#define GX_CP_VAT_GROUP0_TXC0_SHIFT_MASK (((1 << 5) - 1) << 31 - 6)
|
||||
#define GX_CP_GET_VAT_GROUP0_TXC0_SHIFT(reg) GX_BITGET(reg, 2, 5)
|
||||
#define GX_CP_SET_VAT_GROUP0_TXC0_SHIFT(reg, x) ((reg) = GX_BITSET(reg, 2, 5, x))
|
||||
// BYTEDEQUANT [1:1] (1)
|
||||
#define GX_CP_VAT_GROUP0_BYTEDEQUANT_ST 1
|
||||
#define GX_CP_VAT_GROUP0_BYTEDEQUANT_END 1
|
||||
#define GX_CP_VAT_GROUP0_BYTEDEQUANT_SZ 1
|
||||
#define GX_CP_VAT_GROUP0_BYTEDEQUANT_MASK (((1 << 1) - 1) << 31 - 1)
|
||||
#define GX_CP_GET_VAT_GROUP0_BYTEDEQUANT(reg) GX_BITGET(reg, 1, 1)
|
||||
#define GX_CP_SET_VAT_GROUP0_BYTEDEQUANT(reg, x) ((reg) = GX_BITSET(reg, 1, 1, x))
|
||||
// NORMALINDEX3 [0:0] (1) - Input will be treated as three staggered indices (one per triple biased by component size) into normal table
|
||||
#define GX_CP_VAT_GROUP0_NORMALINDEX3_ST 0
|
||||
#define GX_CP_VAT_GROUP0_NORMALINDEX3_END 0
|
||||
#define GX_CP_VAT_GROUP0_NORMALINDEX3_SZ 1
|
||||
#define GX_CP_VAT_GROUP0_NORMALINDEX3_MASK (((1 << 1) - 1) << 31 - 0)
|
||||
#define GX_CP_GET_VAT_GROUP0_NORMALINDEX3(reg) GX_BITGET(reg, 0, 1)
|
||||
#define GX_CP_SET_VAT_GROUP0_NORMALINDEX3(reg, x) ((reg) = GX_BITSET(reg, 0, 1, x))
|
||||
|
||||
/**
|
||||
* CP register 0x80 - VAT_group1
|
||||
*/
|
||||
// TXC1_CNT [31:31] (1)
|
||||
#define GX_CP_VAT_GROUP1_TXC1_CNT_ST 31
|
||||
#define GX_CP_VAT_GROUP1_TXC1_CNT_END 31
|
||||
#define GX_CP_VAT_GROUP1_TXC1_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP1_TXC1_CNT_MASK (((1 << 1) - 1) << 31 - 31)
|
||||
#define GX_CP_GET_VAT_GROUP1_TXC1_CNT(reg) GX_BITGET(reg, 31, 1)
|
||||
#define GX_CP_SET_VAT_GROUP1_TXC1_CNT(reg, x) ((reg) = GX_BITSET(reg, 31, 1, x))
|
||||
// TXC1_TYPE [28:30] (3)
|
||||
#define GX_CP_VAT_GROUP1_TXC1_TYPE_ST 28
|
||||
#define GX_CP_VAT_GROUP1_TXC1_TYPE_END 30
|
||||
#define GX_CP_VAT_GROUP1_TXC1_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP1_TXC1_TYPE_MASK (((1 << 3) - 1) << 31 - 30)
|
||||
#define GX_CP_GET_VAT_GROUP1_TXC1_TYPE(reg) GX_BITGET(reg, 28, 3)
|
||||
#define GX_CP_SET_VAT_GROUP1_TXC1_TYPE(reg, x) ((reg) = GX_BITSET(reg, 28, 3, x))
|
||||
// TXC1_SHIFT [23:27] (5)
|
||||
#define GX_CP_VAT_GROUP1_TXC1_SHIFT_ST 23
|
||||
#define GX_CP_VAT_GROUP1_TXC1_SHIFT_END 27
|
||||
#define GX_CP_VAT_GROUP1_TXC1_SHIFT_SZ 5
|
||||
#define GX_CP_VAT_GROUP1_TXC1_SHIFT_MASK (((1 << 5) - 1) << 31 - 27)
|
||||
#define GX_CP_GET_VAT_GROUP1_TXC1_SHIFT(reg) GX_BITGET(reg, 23, 5)
|
||||
#define GX_CP_SET_VAT_GROUP1_TXC1_SHIFT(reg, x) ((reg) = GX_BITSET(reg, 23, 5, x))
|
||||
// TXC2_CNT [22:22] (1)
|
||||
#define GX_CP_VAT_GROUP1_TXC2_CNT_ST 22
|
||||
#define GX_CP_VAT_GROUP1_TXC2_CNT_END 22
|
||||
#define GX_CP_VAT_GROUP1_TXC2_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP1_TXC2_CNT_MASK (((1 << 1) - 1) << 31 - 22)
|
||||
#define GX_CP_GET_VAT_GROUP1_TXC2_CNT(reg) GX_BITGET(reg, 22, 1)
|
||||
#define GX_CP_SET_VAT_GROUP1_TXC2_CNT(reg, x) ((reg) = GX_BITSET(reg, 22, 1, x))
|
||||
// TXC2_TYPE [19:21] (3)
|
||||
#define GX_CP_VAT_GROUP1_TXC2_TYPE_ST 19
|
||||
#define GX_CP_VAT_GROUP1_TXC2_TYPE_END 21
|
||||
#define GX_CP_VAT_GROUP1_TXC2_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP1_TXC2_TYPE_MASK (((1 << 3) - 1) << 31 - 21)
|
||||
#define GX_CP_GET_VAT_GROUP1_TXC2_TYPE(reg) GX_BITGET(reg, 19, 3)
|
||||
#define GX_CP_SET_VAT_GROUP1_TXC2_TYPE(reg, x) ((reg) = GX_BITSET(reg, 19, 3, x))
|
||||
// TXC2_SHIFT [14:18] (5)
|
||||
#define GX_CP_VAT_GROUP1_TXC2_SHIFT_ST 14
|
||||
#define GX_CP_VAT_GROUP1_TXC2_SHIFT_END 18
|
||||
#define GX_CP_VAT_GROUP1_TXC2_SHIFT_SZ 5
|
||||
#define GX_CP_VAT_GROUP1_TXC2_SHIFT_MASK (((1 << 5) - 1) << 31 - 18)
|
||||
#define GX_CP_GET_VAT_GROUP1_TXC2_SHIFT(reg) GX_BITGET(reg, 14, 5)
|
||||
#define GX_CP_SET_VAT_GROUP1_TXC2_SHIFT(reg, x) ((reg) = GX_BITSET(reg, 14, 5, x))
|
||||
// TXC3_CNT [13:13] (1)
|
||||
#define GX_CP_VAT_GROUP1_TXC3_CNT_ST 13
|
||||
#define GX_CP_VAT_GROUP1_TXC3_CNT_END 13
|
||||
#define GX_CP_VAT_GROUP1_TXC3_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP1_TXC3_CNT_MASK (((1 << 1) - 1) << 31 - 13)
|
||||
#define GX_CP_GET_VAT_GROUP1_TXC3_CNT(reg) GX_BITGET(reg, 13, 1)
|
||||
#define GX_CP_SET_VAT_GROUP1_TXC3_CNT(reg, x) ((reg) = GX_BITSET(reg, 13, 1, x))
|
||||
// TXC3_TYPE [10:12] (3)
|
||||
#define GX_CP_VAT_GROUP1_TXC3_TYPE_ST 10
|
||||
#define GX_CP_VAT_GROUP1_TXC3_TYPE_END 12
|
||||
#define GX_CP_VAT_GROUP1_TXC3_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP1_TXC3_TYPE_MASK (((1 << 3) - 1) << 31 - 12)
|
||||
#define GX_CP_GET_VAT_GROUP1_TXC3_TYPE(reg) GX_BITGET(reg, 10, 3)
|
||||
#define GX_CP_SET_VAT_GROUP1_TXC3_TYPE(reg, x) ((reg) = GX_BITSET(reg, 10, 3, x))
|
||||
// TXC3_SHIFT [5:9] (5)
|
||||
#define GX_CP_VAT_GROUP1_TXC3_SHIFT_ST 5
|
||||
#define GX_CP_VAT_GROUP1_TXC3_SHIFT_END 9
|
||||
#define GX_CP_VAT_GROUP1_TXC3_SHIFT_SZ 5
|
||||
#define GX_CP_VAT_GROUP1_TXC3_SHIFT_MASK (((1 << 5) - 1) << 31 - 9)
|
||||
#define GX_CP_GET_VAT_GROUP1_TXC3_SHIFT(reg) GX_BITGET(reg, 5, 5)
|
||||
#define GX_CP_SET_VAT_GROUP1_TXC3_SHIFT(reg, x) ((reg) = GX_BITSET(reg, 5, 5, x))
|
||||
// TXC4_CNT [4:4] (1)
|
||||
#define GX_CP_VAT_GROUP1_TXC4_CNT_ST 4
|
||||
#define GX_CP_VAT_GROUP1_TXC4_CNT_END 4
|
||||
#define GX_CP_VAT_GROUP1_TXC4_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP1_TXC4_CNT_MASK (((1 << 1) - 1) << 31 - 4)
|
||||
#define GX_CP_GET_VAT_GROUP1_TXC4_CNT(reg) GX_BITGET(reg, 4, 1)
|
||||
#define GX_CP_SET_VAT_GROUP1_TXC4_CNT(reg, x) ((reg) = GX_BITSET(reg, 4, 1, x))
|
||||
// TXC4_TYPE [1:3] (3)
|
||||
#define GX_CP_VAT_GROUP1_TXC4_TYPE_ST 1
|
||||
#define GX_CP_VAT_GROUP1_TXC4_TYPE_END 3
|
||||
#define GX_CP_VAT_GROUP1_TXC4_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP1_TXC4_TYPE_MASK (((1 << 3) - 1) << 31 - 3)
|
||||
#define GX_CP_GET_VAT_GROUP1_TXC4_TYPE(reg) GX_BITGET(reg, 1, 3)
|
||||
#define GX_CP_SET_VAT_GROUP1_TXC4_TYPE(reg, x) ((reg) = GX_BITSET(reg, 1, 3, x))
|
||||
|
||||
/**
|
||||
* CP register 0x90 - VAT_group2
|
||||
*/
|
||||
// TXC4_SHIFT [27:31] (5)
|
||||
#define GX_CP_VAT_GROUP2_TXC4_SHIFT_ST 27
|
||||
#define GX_CP_VAT_GROUP2_TXC4_SHIFT_END 31
|
||||
#define GX_CP_VAT_GROUP2_TXC4_SHIFT_SZ 5
|
||||
#define GX_CP_VAT_GROUP2_TXC4_SHIFT_MASK (((1 << 5) - 1) << 31 - 31)
|
||||
#define GX_CP_GET_VAT_GROUP2_TXC4_SHIFT(reg) GX_BITGET(reg, 27, 5)
|
||||
#define GX_CP_SET_VAT_GROUP2_TXC4_SHIFT(reg, x) ((reg) = GX_BITSET(reg, 27, 5, x))
|
||||
// TXC5_CNT [26:26] (1)
|
||||
#define GX_CP_VAT_GROUP2_TXC5_CNT_ST 26
|
||||
#define GX_CP_VAT_GROUP2_TXC5_CNT_END 26
|
||||
#define GX_CP_VAT_GROUP2_TXC5_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP2_TXC5_CNT_MASK (((1 << 1) - 1) << 31 - 26)
|
||||
#define GX_CP_GET_VAT_GROUP2_TXC5_CNT(reg) GX_BITGET(reg, 26, 1)
|
||||
#define GX_CP_SET_VAT_GROUP2_TXC5_CNT(reg, x) ((reg) = GX_BITSET(reg, 26, 1, x))
|
||||
// TXC5_TYPE [23:25] (3)
|
||||
#define GX_CP_VAT_GROUP2_TXC5_TYPE_ST 23
|
||||
#define GX_CP_VAT_GROUP2_TXC5_TYPE_END 25
|
||||
#define GX_CP_VAT_GROUP2_TXC5_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP2_TXC5_TYPE_MASK (((1 << 3) - 1) << 31 - 25)
|
||||
#define GX_CP_GET_VAT_GROUP2_TXC5_TYPE(reg) GX_BITGET(reg, 23, 3)
|
||||
#define GX_CP_SET_VAT_GROUP2_TXC5_TYPE(reg, x) ((reg) = GX_BITSET(reg, 23, 3, x))
|
||||
// TXC5_SHIFT [18:22] (5)
|
||||
#define GX_CP_VAT_GROUP2_TXC5_SHIFT_ST 18
|
||||
#define GX_CP_VAT_GROUP2_TXC5_SHIFT_END 22
|
||||
#define GX_CP_VAT_GROUP2_TXC5_SHIFT_SZ 5
|
||||
#define GX_CP_VAT_GROUP2_TXC5_SHIFT_MASK (((1 << 5) - 1) << 31 - 22)
|
||||
#define GX_CP_GET_VAT_GROUP2_TXC5_SHIFT(reg) GX_BITGET(reg, 18, 5)
|
||||
#define GX_CP_SET_VAT_GROUP2_TXC5_SHIFT(reg, x) ((reg) = GX_BITSET(reg, 18, 5, x))
|
||||
// TXC6_CNT [17:17] (1)
|
||||
#define GX_CP_VAT_GROUP2_TXC6_CNT_ST 17
|
||||
#define GX_CP_VAT_GROUP2_TXC6_CNT_END 17
|
||||
#define GX_CP_VAT_GROUP2_TXC6_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP2_TXC6_CNT_MASK (((1 << 1) - 1) << 31 - 17)
|
||||
#define GX_CP_GET_VAT_GROUP2_TXC6_CNT(reg) GX_BITGET(reg, 17, 1)
|
||||
#define GX_CP_SET_VAT_GROUP2_TXC6_CNT(reg, x) ((reg) = GX_BITSET(reg, 17, 1, x))
|
||||
// TXC6_TYPE [14:16] (3)
|
||||
#define GX_CP_VAT_GROUP2_TXC6_TYPE_ST 14
|
||||
#define GX_CP_VAT_GROUP2_TXC6_TYPE_END 16
|
||||
#define GX_CP_VAT_GROUP2_TXC6_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP2_TXC6_TYPE_MASK (((1 << 3) - 1) << 31 - 16)
|
||||
#define GX_CP_GET_VAT_GROUP2_TXC6_TYPE(reg) GX_BITGET(reg, 14, 3)
|
||||
#define GX_CP_SET_VAT_GROUP2_TXC6_TYPE(reg, x) ((reg) = GX_BITSET(reg, 14, 3, x))
|
||||
// TXC6_SHIFT [9:13] (5)
|
||||
#define GX_CP_VAT_GROUP2_TXC6_SHIFT_ST 9
|
||||
#define GX_CP_VAT_GROUP2_TXC6_SHIFT_END 13
|
||||
#define GX_CP_VAT_GROUP2_TXC6_SHIFT_SZ 5
|
||||
#define GX_CP_VAT_GROUP2_TXC6_SHIFT_MASK (((1 << 5) - 1) << 31 - 13)
|
||||
#define GX_CP_GET_VAT_GROUP2_TXC6_SHIFT(reg) GX_BITGET(reg, 9, 5)
|
||||
#define GX_CP_SET_VAT_GROUP2_TXC6_SHIFT(reg, x) ((reg) = GX_BITSET(reg, 9, 5, x))
|
||||
// TXC7_CNT [8:8] (1)
|
||||
#define GX_CP_VAT_GROUP2_TXC7_CNT_ST 8
|
||||
#define GX_CP_VAT_GROUP2_TXC7_CNT_END 8
|
||||
#define GX_CP_VAT_GROUP2_TXC7_CNT_SZ 1
|
||||
#define GX_CP_VAT_GROUP2_TXC7_CNT_MASK (((1 << 1) - 1) << 31 - 8)
|
||||
#define GX_CP_GET_VAT_GROUP2_TXC7_CNT(reg) GX_BITGET(reg, 8, 1)
|
||||
#define GX_CP_SET_VAT_GROUP2_TXC7_CNT(reg, x) ((reg) = GX_BITSET(reg, 8, 1, x))
|
||||
// TXC7_TYPE [5:7] (3)
|
||||
#define GX_CP_VAT_GROUP2_TXC7_TYPE_ST 5
|
||||
#define GX_CP_VAT_GROUP2_TXC7_TYPE_END 7
|
||||
#define GX_CP_VAT_GROUP2_TXC7_TYPE_SZ 3
|
||||
#define GX_CP_VAT_GROUP2_TXC7_TYPE_MASK (((1 << 3) - 1) << 31 - 7)
|
||||
#define GX_CP_GET_VAT_GROUP2_TXC7_TYPE(reg) GX_BITGET(reg, 5, 3)
|
||||
#define GX_CP_SET_VAT_GROUP2_TXC7_TYPE(reg, x) ((reg) = GX_BITSET(reg, 5, 3, x))
|
||||
// TXC7_SHIFT [0:4] (5)
|
||||
#define GX_CP_VAT_GROUP2_TXC7_SHIFT_ST 0
|
||||
#define GX_CP_VAT_GROUP2_TXC7_SHIFT_END 4
|
||||
#define GX_CP_VAT_GROUP2_TXC7_SHIFT_SZ 5
|
||||
#define GX_CP_VAT_GROUP2_TXC7_SHIFT_MASK (((1 << 5) - 1) << 31 - 4)
|
||||
#define GX_CP_GET_VAT_GROUP2_TXC7_SHIFT(reg) GX_BITGET(reg, 0, 5)
|
||||
#define GX_CP_SET_VAT_GROUP2_TXC7_SHIFT(reg, x) ((reg) = GX_BITSET(reg, 0, 5, x))
|
||||
|
||||
/**
|
||||
* CP register 0xA0 - ArrayBase
|
||||
*/
|
||||
// BASE [6:31] (26)
|
||||
#define GX_CP_ARRAYBASE_BASE_ST 6
|
||||
#define GX_CP_ARRAYBASE_BASE_END 31
|
||||
#define GX_CP_ARRAYBASE_BASE_SZ 26
|
||||
#define GX_CP_ARRAYBASE_BASE_MASK (((1 << 26) - 1) << 31 - 31)
|
||||
#define GX_CP_GET_ARRAYBASE_BASE(reg) GX_BITGET(reg, 6, 26)
|
||||
#define GX_CP_SET_ARRAYBASE_BASE(reg, x) ((reg) = GX_BITSET(reg, 6, 26, x))
|
||||
|
||||
/**
|
||||
* CP register 0xB0 - ArrayStride
|
||||
*/
|
||||
// STRIDE [24:31] (8)
|
||||
#define GX_CP_ARRAYSTRIDE_STRIDE_ST 24
|
||||
#define GX_CP_ARRAYSTRIDE_STRIDE_END 31
|
||||
#define GX_CP_ARRAYSTRIDE_STRIDE_SZ 8
|
||||
#define GX_CP_ARRAYSTRIDE_STRIDE_MASK (((1 << 8) - 1) << 31 - 31)
|
||||
#define GX_CP_GET_ARRAYSTRIDE_STRIDE(reg) GX_BITGET(reg, 24, 8)
|
||||
#define GX_CP_SET_ARRAYSTRIDE_STRIDE(reg, x) ((reg) = GX_BITSET(reg, 24, 8, x))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,334 @@
|
||||
#ifndef RVL_SDK_GX_HARDWARE_XF_H
|
||||
#define RVL_SDK_GX_HARDWARE_XF_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
*
|
||||
* GX Transform Unit (XF)
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
* XF registers
|
||||
*/
|
||||
typedef enum {
|
||||
GX_XF_REG_ERROR = 0x1000,
|
||||
GX_XF_REG_DIAGNOSTICS = 0x1001,
|
||||
GX_XF_REG_STATE0 = 0x1002,
|
||||
GX_XF_REG_STATE1 = 0x1003,
|
||||
GX_XF_REG_CLOCK = 0x1004,
|
||||
GX_XF_REG_CLIPDISABLE = 0x1005,
|
||||
GX_XF_REG_PERF0 = 0x1006,
|
||||
GX_XF_REG_PERF1 = 0x1007,
|
||||
GX_XF_REG_INVERTEXSPEC = 0x1008,
|
||||
GX_XF_REG_NUMCOLORS = 0x1009,
|
||||
GX_XF_REG_AMBIENT0 = 0x100A,
|
||||
GX_XF_REG_AMBIENT1 = 0x100B,
|
||||
GX_XF_REG_MATERIAL0 = 0x100C,
|
||||
GX_XF_REG_MATERIAL1 = 0x100D,
|
||||
GX_XF_REG_COLOR0CNTRL = 0x100E,
|
||||
GX_XF_REG_COLOR1CNTRL = 0x100F,
|
||||
GX_XF_REG_ALPHA0CNTRL = 0x1010,
|
||||
GX_XF_REG_ALPHA1CNTRL = 0x1011,
|
||||
GX_XF_REG_DUALTEXTRAN = 0x1012,
|
||||
GX_XF_REG_MATRIXINDEX0 = 0x1018,
|
||||
GX_XF_REG_MATRIXINDEX1 = 0x1019,
|
||||
GX_XF_REG_SCALEX = 0x101A,
|
||||
GX_XF_REG_SCALEY = 0x101B,
|
||||
GX_XF_REG_SCALEZ = 0x101C,
|
||||
GX_XF_REG_OFFSETX = 0x101D,
|
||||
GX_XF_REG_OFFSETY = 0x101E,
|
||||
GX_XF_REG_OFFSETZ = 0x101F,
|
||||
GX_XF_REG_PROJECTIONA = 0x1020,
|
||||
GX_XF_REG_PROJECTIONB = 0x1021,
|
||||
GX_XF_REG_PROJECTIONC = 0x1022,
|
||||
GX_XF_REG_PROJECTIOND = 0x1023,
|
||||
GX_XF_REG_PROJECTIONE = 0x1024,
|
||||
GX_XF_REG_PROJECTIONF = 0x1025,
|
||||
GX_XF_REG_PROJECTORTHO = 0x1026,
|
||||
GX_XF_REG_NUMTEX = 0x103F,
|
||||
GX_XF_REG_TEX0 = 0x1040,
|
||||
GX_XF_REG_TEX1 = 0x1041,
|
||||
GX_XF_REG_TEX2 = 0x1042,
|
||||
GX_XF_REG_TEX3 = 0x1043,
|
||||
GX_XF_REG_TEX4 = 0x1044,
|
||||
GX_XF_REG_TEX5 = 0x1045,
|
||||
GX_XF_REG_TEX6 = 0x1046,
|
||||
GX_XF_REG_TEX7 = 0x1047,
|
||||
GX_XF_REG_DUALTEX0 = 0x1050,
|
||||
GX_XF_REG_DUALTEX1 = 0x1051,
|
||||
GX_XF_REG_DUALTEX2 = 0x1052,
|
||||
GX_XF_REG_DUALTEX3 = 0x1053,
|
||||
GX_XF_REG_DUALTEX4 = 0x1054,
|
||||
GX_XF_REG_DUALTEX5 = 0x1055,
|
||||
GX_XF_REG_DUALTEX6 = 0x1056,
|
||||
GX_XF_REG_DUALTEX7 = 0x1057,
|
||||
} GX_XF_REG;
|
||||
|
||||
/**
|
||||
* XF register 0x1005 - ClipDisable
|
||||
*/
|
||||
// DETECT [31:31] (1) - Disable clipping detection
|
||||
#define GX_XF_CLIPDISABLE_DETECT_ST 31
|
||||
#define GX_XF_CLIPDISABLE_DETECT_END 31
|
||||
#define GX_XF_CLIPDISABLE_DETECT_SZ 1
|
||||
#define GX_XF_CLIPDISABLE_DETECT_MASK (((1 << 1) - 1) << 31 - 31)
|
||||
#define GX_XF_GET_CLIPDISABLE_DETECT(reg) GX_BITGET(reg, 31, 1)
|
||||
#define GX_XF_SET_CLIPDISABLE_DETECT(reg, x) ((reg) = GX_BITSET(reg, 31, 1, x))
|
||||
// REJECT [30:30] (1) - Disable trivial rejection
|
||||
#define GX_XF_CLIPDISABLE_REJECT_ST 30
|
||||
#define GX_XF_CLIPDISABLE_REJECT_END 30
|
||||
#define GX_XF_CLIPDISABLE_REJECT_SZ 1
|
||||
#define GX_XF_CLIPDISABLE_REJECT_MASK (((1 << 1) - 1) << 31 - 30)
|
||||
#define GX_XF_GET_CLIPDISABLE_REJECT(reg) GX_BITGET(reg, 30, 1)
|
||||
#define GX_XF_SET_CLIPDISABLE_REJECT(reg, x) ((reg) = GX_BITSET(reg, 30, 1, x))
|
||||
// ACCEL [29:29] (1) - Disable cpoly clipping acceleration
|
||||
#define GX_XF_CLIPDISABLE_ACCEL_ST 29
|
||||
#define GX_XF_CLIPDISABLE_ACCEL_END 29
|
||||
#define GX_XF_CLIPDISABLE_ACCEL_SZ 1
|
||||
#define GX_XF_CLIPDISABLE_ACCEL_MASK (((1 << 1) - 1) << 31 - 29)
|
||||
#define GX_XF_GET_CLIPDISABLE_ACCEL(reg) GX_BITGET(reg, 29, 1)
|
||||
#define GX_XF_SET_CLIPDISABLE_ACCEL(reg, x) ((reg) = GX_BITSET(reg, 29, 1, x))
|
||||
|
||||
/**
|
||||
* XF register 0x1007 - Perf1
|
||||
*/
|
||||
// TARGET [25:31] (7) - Target performance (Cycles/vertex)
|
||||
#define GX_XF_PERF1_TARGET_ST 25
|
||||
#define GX_XF_PERF1_TARGET_END 31
|
||||
#define GX_XF_PERF1_TARGET_SZ 7
|
||||
#define GX_XF_PERF1_TARGET_MASK (((1 << 7) - 1) << 31 - 31)
|
||||
#define GX_XF_GET_PERF1_TARGET(reg) GX_BITGET(reg, 25, 7)
|
||||
#define GX_XF_SET_PERF1_TARGET(reg, x) ((reg) = GX_BITSET(reg, 25, 7, x))
|
||||
|
||||
/**
|
||||
* XF register 0x1008 - InVertexSpec
|
||||
*/
|
||||
// CLR [30:31] (2)
|
||||
#define GX_XF_INVERTEXSPEC_CLR_ST 30
|
||||
#define GX_XF_INVERTEXSPEC_CLR_END 31
|
||||
#define GX_XF_INVERTEXSPEC_CLR_SZ 2
|
||||
#define GX_XF_INVERTEXSPEC_CLR_MASK (((1 << 2) - 1) << 31 - 31)
|
||||
#define GX_XF_GET_INVERTEXSPEC_CLR(reg) GX_BITGET(reg, 30, 2)
|
||||
#define GX_XF_SET_INVERTEXSPEC_CLR(reg, x) ((reg) = GX_BITSET(reg, 30, 2, x))
|
||||
// NRM [28:29] (2)
|
||||
#define GX_XF_INVERTEXSPEC_NRM_ST 28
|
||||
#define GX_XF_INVERTEXSPEC_NRM_END 29
|
||||
#define GX_XF_INVERTEXSPEC_NRM_SZ 2
|
||||
#define GX_XF_INVERTEXSPEC_NRM_MASK (((1 << 2) - 1) << 31 - 29)
|
||||
#define GX_XF_GET_INVERTEXSPEC_NRM(reg) GX_BITGET(reg, 28, 2)
|
||||
#define GX_XF_SET_INVERTEXSPEC_NRM(reg, x) ((reg) = GX_BITSET(reg, 28, 2, x))
|
||||
// TXC [24:27] (4)
|
||||
#define GX_XF_INVERTEXSPEC_TXC_ST 24
|
||||
#define GX_XF_INVERTEXSPEC_TXC_END 27
|
||||
#define GX_XF_INVERTEXSPEC_TXC_SZ 4
|
||||
#define GX_XF_INVERTEXSPEC_TXC_MASK (((1 << 4) - 1) << 31 - 27)
|
||||
#define GX_XF_GET_INVERTEXSPEC_TXC(reg) GX_BITGET(reg, 24, 4)
|
||||
#define GX_XF_SET_INVERTEXSPEC_TXC(reg, x) ((reg) = GX_BITSET(reg, 24, 4, x))
|
||||
|
||||
/**
|
||||
* XF register 0x100E - Color0Cntrl
|
||||
*/
|
||||
// MATSRC [31:31] (1)
|
||||
#define GX_XF_COLOR0CNTRL_MATSRC_ST 31
|
||||
#define GX_XF_COLOR0CNTRL_MATSRC_END 31
|
||||
#define GX_XF_COLOR0CNTRL_MATSRC_SZ 1
|
||||
#define GX_XF_COLOR0CNTRL_MATSRC_MASK (((1 << 1) - 1) << 31 - 31)
|
||||
#define GX_XF_GET_COLOR0CNTRL_MATSRC(reg) GX_BITGET(reg, 31, 1)
|
||||
#define GX_XF_SET_COLOR0CNTRL_MATSRC(reg, x) ((reg) = GX_BITSET(reg, 31, 1, x))
|
||||
// LIGHT [30:30] (1)
|
||||
#define GX_XF_COLOR0CNTRL_LIGHT_ST 30
|
||||
#define GX_XF_COLOR0CNTRL_LIGHT_END 30
|
||||
#define GX_XF_COLOR0CNTRL_LIGHT_SZ 1
|
||||
#define GX_XF_COLOR0CNTRL_LIGHT_MASK (((1 << 1) - 1) << 31 - 30)
|
||||
#define GX_XF_GET_COLOR0CNTRL_LIGHT(reg) GX_BITGET(reg, 30, 1)
|
||||
#define GX_XF_SET_COLOR0CNTRL_LIGHT(reg, x) ((reg) = GX_BITSET(reg, 30, 1, x))
|
||||
// LMASKHI [26:29] (4)
|
||||
#define GX_XF_COLOR0CNTRL_LMASKHI_ST 26
|
||||
#define GX_XF_COLOR0CNTRL_LMASKHI_END 29
|
||||
#define GX_XF_COLOR0CNTRL_LMASKHI_SZ 4
|
||||
#define GX_XF_COLOR0CNTRL_LMASKHI_MASK (((1 << 4) - 1) << 31 - 29)
|
||||
#define GX_XF_GET_COLOR0CNTRL_LMASKHI(reg) GX_BITGET(reg, 26, 4)
|
||||
#define GX_XF_SET_COLOR0CNTRL_LMASKHI(reg, x) ((reg) = GX_BITSET(reg, 26, 4, x))
|
||||
// AMBSRC [25:25] (1)
|
||||
#define GX_XF_COLOR0CNTRL_AMBSRC_ST 25
|
||||
#define GX_XF_COLOR0CNTRL_AMBSRC_END 25
|
||||
#define GX_XF_COLOR0CNTRL_AMBSRC_SZ 1
|
||||
#define GX_XF_COLOR0CNTRL_AMBSRC_MASK (((1 << 1) - 1) << 31 - 25)
|
||||
#define GX_XF_GET_COLOR0CNTRL_AMBSRC(reg) GX_BITGET(reg, 25, 1)
|
||||
#define GX_XF_SET_COLOR0CNTRL_AMBSRC(reg, x) ((reg) = GX_BITSET(reg, 25, 1, x))
|
||||
// DIFFUSEATTN [23:24] (2)
|
||||
#define GX_XF_COLOR0CNTRL_DIFFUSEATTN_ST 23
|
||||
#define GX_XF_COLOR0CNTRL_DIFFUSEATTN_END 24
|
||||
#define GX_XF_COLOR0CNTRL_DIFFUSEATTN_SZ 2
|
||||
#define GX_XF_COLOR0CNTRL_DIFFUSEATTN_MASK (((1 << 2) - 1) << 31 - 24)
|
||||
#define GX_XF_GET_COLOR0CNTRL_DIFFUSEATTN(reg) GX_BITGET(reg, 23, 2)
|
||||
#define GX_XF_SET_COLOR0CNTRL_DIFFUSEATTN(reg, x) ((reg) = GX_BITSET(reg, 23, 2, x))
|
||||
// ATTNENABLE [22:22] (1)
|
||||
#define GX_XF_COLOR0CNTRL_ATTNENABLE_ST 22
|
||||
#define GX_XF_COLOR0CNTRL_ATTNENABLE_END 22
|
||||
#define GX_XF_COLOR0CNTRL_ATTNENABLE_SZ 1
|
||||
#define GX_XF_COLOR0CNTRL_ATTNENABLE_MASK (((1 << 1) - 1) << 31 - 22)
|
||||
#define GX_XF_GET_COLOR0CNTRL_ATTNENABLE(reg) GX_BITGET(reg, 22, 1)
|
||||
#define GX_XF_SET_COLOR0CNTRL_ATTNENABLE(reg, x) ((reg) = GX_BITSET(reg, 22, 1, x))
|
||||
// ATTNSELECT [21:21] (1)
|
||||
#define GX_XF_COLOR0CNTRL_ATTNSELECT_ST 21
|
||||
#define GX_XF_COLOR0CNTRL_ATTNSELECT_END 21
|
||||
#define GX_XF_COLOR0CNTRL_ATTNSELECT_SZ 1
|
||||
#define GX_XF_COLOR0CNTRL_ATTNSELECT_MASK (((1 << 1) - 1) << 31 - 21)
|
||||
#define GX_XF_GET_COLOR0CNTRL_ATTNSELECT(reg) GX_BITGET(reg, 21, 1)
|
||||
#define GX_XF_SET_COLOR0CNTRL_ATTNSELECT(reg, x) ((reg) = GX_BITSET(reg, 21, 1, x))
|
||||
// LMASKLO [17:20] (4)
|
||||
#define GX_XF_COLOR0CNTRL_LMASKLO_ST 17
|
||||
#define GX_XF_COLOR0CNTRL_LMASKLO_END 20
|
||||
#define GX_XF_COLOR0CNTRL_LMASKLO_SZ 4
|
||||
#define GX_XF_COLOR0CNTRL_LMASKLO_MASK (((1 << 4) - 1) << 31 - 20)
|
||||
#define GX_XF_GET_COLOR0CNTRL_LMASKLO(reg) GX_BITGET(reg, 17, 4)
|
||||
#define GX_XF_SET_COLOR0CNTRL_LMASKLO(reg, x) ((reg) = GX_BITSET(reg, 17, 4, x))
|
||||
|
||||
/**
|
||||
* XF register 0x1018 - MatrixIndex0
|
||||
*/
|
||||
// GEOM [26:31] (6)
|
||||
#define GX_XF_MATRIXINDEX0_GEOM_ST 26
|
||||
#define GX_XF_MATRIXINDEX0_GEOM_END 31
|
||||
#define GX_XF_MATRIXINDEX0_GEOM_SZ 6
|
||||
#define GX_XF_MATRIXINDEX0_GEOM_MASK (((1 << 6) - 1) << 31 - 31)
|
||||
#define GX_XF_GET_MATRIXINDEX0_GEOM(reg) GX_BITGET(reg, 26, 6)
|
||||
#define GX_XF_SET_MATRIXINDEX0_GEOM(reg, x) ((reg) = GX_BITSET(reg, 26, 6, x))
|
||||
// TEX0 [20:25] (6)
|
||||
#define GX_XF_MATRIXINDEX0_TEX0_ST 20
|
||||
#define GX_XF_MATRIXINDEX0_TEX0_END 25
|
||||
#define GX_XF_MATRIXINDEX0_TEX0_SZ 6
|
||||
#define GX_XF_MATRIXINDEX0_TEX0_MASK (((1 << 6) - 1) << 31 - 25)
|
||||
#define GX_XF_GET_MATRIXINDEX0_TEX0(reg) GX_BITGET(reg, 20, 6)
|
||||
#define GX_XF_SET_MATRIXINDEX0_TEX0(reg, x) ((reg) = GX_BITSET(reg, 20, 6, x))
|
||||
// TEX1 [14:19] (6)
|
||||
#define GX_XF_MATRIXINDEX0_TEX1_ST 14
|
||||
#define GX_XF_MATRIXINDEX0_TEX1_END 19
|
||||
#define GX_XF_MATRIXINDEX0_TEX1_SZ 6
|
||||
#define GX_XF_MATRIXINDEX0_TEX1_MASK (((1 << 6) - 1) << 31 - 19)
|
||||
#define GX_XF_GET_MATRIXINDEX0_TEX1(reg) GX_BITGET(reg, 14, 6)
|
||||
#define GX_XF_SET_MATRIXINDEX0_TEX1(reg, x) ((reg) = GX_BITSET(reg, 14, 6, x))
|
||||
// TEX2 [8:13] (6)
|
||||
#define GX_XF_MATRIXINDEX0_TEX2_ST 8
|
||||
#define GX_XF_MATRIXINDEX0_TEX2_END 13
|
||||
#define GX_XF_MATRIXINDEX0_TEX2_SZ 6
|
||||
#define GX_XF_MATRIXINDEX0_TEX2_MASK (((1 << 6) - 1) << 31 - 13)
|
||||
#define GX_XF_GET_MATRIXINDEX0_TEX2(reg) GX_BITGET(reg, 8, 6)
|
||||
#define GX_XF_SET_MATRIXINDEX0_TEX2(reg, x) ((reg) = GX_BITSET(reg, 8, 6, x))
|
||||
// TEX3 [2:7] (6)
|
||||
#define GX_XF_MATRIXINDEX0_TEX3_ST 2
|
||||
#define GX_XF_MATRIXINDEX0_TEX3_END 7
|
||||
#define GX_XF_MATRIXINDEX0_TEX3_SZ 6
|
||||
#define GX_XF_MATRIXINDEX0_TEX3_MASK (((1 << 6) - 1) << 31 - 7)
|
||||
#define GX_XF_GET_MATRIXINDEX0_TEX3(reg) GX_BITGET(reg, 2, 6)
|
||||
#define GX_XF_SET_MATRIXINDEX0_TEX3(reg, x) ((reg) = GX_BITSET(reg, 2, 6, x))
|
||||
|
||||
/**
|
||||
* XF register 0x1019 - MatrixIndex1
|
||||
*/
|
||||
// TEX4 [26:31] (6)
|
||||
#define GX_XF_MATRIXINDEX1_TEX4_ST 26
|
||||
#define GX_XF_MATRIXINDEX1_TEX4_END 31
|
||||
#define GX_XF_MATRIXINDEX1_TEX4_SZ 6
|
||||
#define GX_XF_MATRIXINDEX1_TEX4_MASK (((1 << 6) - 1) << 31 - 31)
|
||||
#define GX_XF_GET_MATRIXINDEX1_TEX4(reg) GX_BITGET(reg, 26, 6)
|
||||
#define GX_XF_SET_MATRIXINDEX1_TEX4(reg, x) ((reg) = GX_BITSET(reg, 26, 6, x))
|
||||
// TEX5 [20:25] (6)
|
||||
#define GX_XF_MATRIXINDEX1_TEX5_ST 20
|
||||
#define GX_XF_MATRIXINDEX1_TEX5_END 25
|
||||
#define GX_XF_MATRIXINDEX1_TEX5_SZ 6
|
||||
#define GX_XF_MATRIXINDEX1_TEX5_MASK (((1 << 6) - 1) << 31 - 25)
|
||||
#define GX_XF_GET_MATRIXINDEX1_TEX5(reg) GX_BITGET(reg, 20, 6)
|
||||
#define GX_XF_SET_MATRIXINDEX1_TEX5(reg, x) ((reg) = GX_BITSET(reg, 20, 6, x))
|
||||
// TEX6 [14:19] (6)
|
||||
#define GX_XF_MATRIXINDEX1_TEX6_ST 14
|
||||
#define GX_XF_MATRIXINDEX1_TEX6_END 19
|
||||
#define GX_XF_MATRIXINDEX1_TEX6_SZ 6
|
||||
#define GX_XF_MATRIXINDEX1_TEX6_MASK (((1 << 6) - 1) << 31 - 19)
|
||||
#define GX_XF_GET_MATRIXINDEX1_TEX6(reg) GX_BITGET(reg, 14, 6)
|
||||
#define GX_XF_SET_MATRIXINDEX1_TEX6(reg, x) ((reg) = GX_BITSET(reg, 14, 6, x))
|
||||
// TEX7 [8:13] (6)
|
||||
#define GX_XF_MATRIXINDEX1_TEX7_ST 8
|
||||
#define GX_XF_MATRIXINDEX1_TEX7_END 13
|
||||
#define GX_XF_MATRIXINDEX1_TEX7_SZ 6
|
||||
#define GX_XF_MATRIXINDEX1_TEX7_MASK (((1 << 6) - 1) << 31 - 13)
|
||||
#define GX_XF_GET_MATRIXINDEX1_TEX7(reg) GX_BITGET(reg, 8, 6)
|
||||
#define GX_XF_SET_MATRIXINDEX1_TEX7(reg, x) ((reg) = GX_BITSET(reg, 8, 6, x))
|
||||
|
||||
/**
|
||||
* XF structure - Tex
|
||||
*/
|
||||
// PROJTYPE [30:30] (1)
|
||||
#define GX_XF_TEX_PROJTYPE_ST 30
|
||||
#define GX_XF_TEX_PROJTYPE_END 30
|
||||
#define GX_XF_TEX_PROJTYPE_SZ 1
|
||||
#define GX_XF_TEX_PROJTYPE_MASK (((1 << 1) - 1) << 31 - 30)
|
||||
#define GX_XF_GET_TEX_PROJTYPE(reg) GX_BITGET(reg, 30, 1)
|
||||
#define GX_XF_SET_TEX_PROJTYPE(reg, x) ((reg) = GX_BITSET(reg, 30, 1, x))
|
||||
// INPUTFORM [29:29] (1)
|
||||
#define GX_XF_TEX_INPUTFORM_ST 29
|
||||
#define GX_XF_TEX_INPUTFORM_END 29
|
||||
#define GX_XF_TEX_INPUTFORM_SZ 1
|
||||
#define GX_XF_TEX_INPUTFORM_MASK (((1 << 1) - 1) << 31 - 29)
|
||||
#define GX_XF_GET_TEX_INPUTFORM(reg) GX_BITGET(reg, 29, 1)
|
||||
#define GX_XF_SET_TEX_INPUTFORM(reg, x) ((reg) = GX_BITSET(reg, 29, 1, x))
|
||||
// TEXGENTYPE [25:27] (3)
|
||||
#define GX_XF_TEX_TEXGENTYPE_ST 25
|
||||
#define GX_XF_TEX_TEXGENTYPE_END 27
|
||||
#define GX_XF_TEX_TEXGENTYPE_SZ 3
|
||||
#define GX_XF_TEX_TEXGENTYPE_MASK (((1 << 3) - 1) << 31 - 27)
|
||||
#define GX_XF_GET_TEX_TEXGENTYPE(reg) GX_BITGET(reg, 25, 3)
|
||||
#define GX_XF_SET_TEX_TEXGENTYPE(reg, x) ((reg) = GX_BITSET(reg, 25, 3, x))
|
||||
// SRCROW [20:24] (5)
|
||||
#define GX_XF_TEX_SRCROW_ST 20
|
||||
#define GX_XF_TEX_SRCROW_END 24
|
||||
#define GX_XF_TEX_SRCROW_SZ 5
|
||||
#define GX_XF_TEX_SRCROW_MASK (((1 << 5) - 1) << 31 - 24)
|
||||
#define GX_XF_GET_TEX_SRCROW(reg) GX_BITGET(reg, 20, 5)
|
||||
#define GX_XF_SET_TEX_SRCROW(reg, x) ((reg) = GX_BITSET(reg, 20, 5, x))
|
||||
// BUMPSRCTEX [17:19] (3)
|
||||
#define GX_XF_TEX_BUMPSRCTEX_ST 17
|
||||
#define GX_XF_TEX_BUMPSRCTEX_END 19
|
||||
#define GX_XF_TEX_BUMPSRCTEX_SZ 3
|
||||
#define GX_XF_TEX_BUMPSRCTEX_MASK (((1 << 3) - 1) << 31 - 19)
|
||||
#define GX_XF_GET_TEX_BUMPSRCTEX(reg) GX_BITGET(reg, 17, 3)
|
||||
#define GX_XF_SET_TEX_BUMPSRCTEX(reg, x) ((reg) = GX_BITSET(reg, 17, 3, x))
|
||||
// BUMPSRCLIGHT [14:16] (3)
|
||||
#define GX_XF_TEX_BUMPSRCLIGHT_ST 14
|
||||
#define GX_XF_TEX_BUMPSRCLIGHT_END 16
|
||||
#define GX_XF_TEX_BUMPSRCLIGHT_SZ 3
|
||||
#define GX_XF_TEX_BUMPSRCLIGHT_MASK (((1 << 3) - 1) << 31 - 16)
|
||||
#define GX_XF_GET_TEX_BUMPSRCLIGHT(reg) GX_BITGET(reg, 14, 3)
|
||||
#define GX_XF_SET_TEX_BUMPSRCLIGHT(reg, x) ((reg) = GX_BITSET(reg, 14, 3, x))
|
||||
|
||||
/**
|
||||
* XF structure - DualTex
|
||||
*/
|
||||
// BASEROW [26:31] (6) - Indicates which is the base row of the transform matrix
|
||||
#define GX_XF_DUALTEX_BASEROW_ST 26
|
||||
#define GX_XF_DUALTEX_BASEROW_END 31
|
||||
#define GX_XF_DUALTEX_BASEROW_SZ 6
|
||||
#define GX_XF_DUALTEX_BASEROW_MASK (((1 << 6) - 1) << 31 - 31)
|
||||
#define GX_XF_GET_DUALTEX_BASEROW(reg) GX_BITGET(reg, 26, 6)
|
||||
#define GX_XF_SET_DUALTEX_BASEROW(reg, x) ((reg) = GX_BITSET(reg, 26, 6, x))
|
||||
// NORMALIZE [23:23] (1) - Normalize texcoord before sending transform
|
||||
#define GX_XF_DUALTEX_NORMALIZE_ST 23
|
||||
#define GX_XF_DUALTEX_NORMALIZE_END 23
|
||||
#define GX_XF_DUALTEX_NORMALIZE_SZ 1
|
||||
#define GX_XF_DUALTEX_NORMALIZE_MASK (((1 << 1) - 1) << 31 - 23)
|
||||
#define GX_XF_GET_DUALTEX_NORMALIZE(reg) GX_BITGET(reg, 23, 1)
|
||||
#define GX_XF_SET_DUALTEX_NORMALIZE(reg, x) ((reg) = GX_BITSET(reg, 23, 1, x))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,86 @@
|
||||
#ifndef RVL_SDK_GX_INIT_H
|
||||
#define RVL_SDK_GX_INIT_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _GXData {
|
||||
union {
|
||||
UNKWORD WORD_0x0;
|
||||
struct {
|
||||
u16 SHORT_0x0; // at 0x0
|
||||
u16 lastWriteWasXF; // at 0x2
|
||||
};
|
||||
}; // at 0x0
|
||||
u16 SHORT_0x4;
|
||||
u16 vlim; // at 0x6
|
||||
u32 cpCtrlReg; // at 0x8
|
||||
u32 cpStatReg; // at 0xC
|
||||
char UNK_0x10[0x4];
|
||||
u32 vcdLoReg; // at 0x14
|
||||
u32 vcdHiReg; // at 0x18
|
||||
u32 vatA[GX_MAX_VTXFMT]; // at 0x1C
|
||||
u32 vatB[GX_MAX_VTXFMT]; // at 0x3C
|
||||
u32 vatC[GX_MAX_VTXFMT]; // at 0x5C
|
||||
u32 linePtWidth; // at 0x7C
|
||||
u32 matrixIndex0; // at 0x80
|
||||
u32 matrixIndex1; // at 0x84
|
||||
char UNK_0x88[0xA8 - 0x88];
|
||||
GXColor ambColors[2]; // at 0xA8
|
||||
GXColor matColors[2]; // at 0xB0
|
||||
u32 colorControl[4]; // at 0xB8
|
||||
u32 texRegs[GX_MAX_TEXCOORD]; // at 0xC8
|
||||
u32 dualTexRegs[GX_MAX_TEXCOORD]; // at 0xE8
|
||||
u32 txcRegs[GX_MAX_TEXCOORD]; // at 0x108
|
||||
char UNK_0x128[0x148 - 0x128];
|
||||
u32 scissorTL; // at 0x148
|
||||
u32 scissorBR; // at 0x14C
|
||||
char UNK_0x150[0x170 - 0x150];
|
||||
u32 ras1_iref; // at 0x170
|
||||
u32 ind_imask; // at 0x174
|
||||
u32 ras1_ss0; // at 0x178
|
||||
u32 ras1_ss1; // at 0x17C
|
||||
char UNK_0x180[0x220 - 0x180];
|
||||
u32 blendMode; // at 0x220
|
||||
u32 dstAlpha; // at 0x224
|
||||
u32 zMode; // at 0x228
|
||||
u32 zControl; // at 0x22C
|
||||
char UNK_0x230[0x254 - 0x230];
|
||||
u32 genMode; // at 0x254
|
||||
char UNK_0x258[0x520 - 0x258];
|
||||
GXAttrType normalType; // at 0x520
|
||||
GXBool normal; // at 0x524
|
||||
GXBool binormal; // at 0x525
|
||||
GXProjMtxType projType; // at 0x528
|
||||
f32 proj[6]; // at 0x52C
|
||||
union {
|
||||
struct {
|
||||
f32 vpOx; // at 0x544
|
||||
f32 vpOy; // at 0x548
|
||||
f32 vpSx; // at 0x54C
|
||||
f32 vpSy; // at 0x550
|
||||
f32 vpNear; // at 0x554
|
||||
f32 vpFar; // at 0x558
|
||||
};
|
||||
f32 view[6];
|
||||
}; // at 0x544
|
||||
f32 offsetZ; // at 0x55C
|
||||
f32 scaleZ; // at 0x560
|
||||
char UNK_0x564[0x5F8 - 0x564];
|
||||
GXBool dlistActive; // at 0x5F8
|
||||
GXBool dlistSave; // at 0x5F9
|
||||
u8 BYTE_0x5FA;
|
||||
u8 vatDirtyFlags; // at 0x5FB
|
||||
u32 gxDirtyFlags; // at 0x5FC
|
||||
} GXData;
|
||||
|
||||
extern GXData* const __GXData;
|
||||
|
||||
// I hate typing this name out
|
||||
#define gxdt __GXData
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,65 @@
|
||||
#ifndef RVL_SDK_GX_INTERNAL_H
|
||||
#define RVL_SDK_GX_INTERNAL_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* GX internal structures.
|
||||
*
|
||||
* Wouldn't be necessary if the public ones didn't include padding; but they do,
|
||||
* so there has to be different structure definitions.
|
||||
*
|
||||
* These internal structures are implemented like the RFL ones since we don't
|
||||
* have DWARF info for most GX structures.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Declare a public structure from the corresponding internal structure.
|
||||
* (Implementation size is included to require that such a structure already
|
||||
* exists.)
|
||||
*/
|
||||
#define GX_DECL_PUBLIC_STRUCT(name, size) \
|
||||
typedef struct _##name { \
|
||||
u8 dummy[(size) - sizeof(name##Impl) + sizeof(name##Impl)]; \
|
||||
} name;
|
||||
|
||||
typedef struct _GXFifoObjImpl {
|
||||
void* base; // at 0x0
|
||||
void* end; // at 0x4
|
||||
u32 size; // at 0x8
|
||||
void* hiWatermark; // at 0xC
|
||||
void* loWatermark; // at 0x10
|
||||
void* readPtr; // at 0x14
|
||||
void* writePtr; // at 0x18
|
||||
u32 count; // at 0x1C
|
||||
u8 wrap; // at 0x20
|
||||
} GXFifoObjImpl;
|
||||
|
||||
typedef struct _GXLightObjImpl {
|
||||
char UNK_0x0[0xC];
|
||||
GXColor color; // at 0xC
|
||||
f32 aa; // at 0x10
|
||||
f32 ab; // at 0x14
|
||||
f32 ac; // at 0x18
|
||||
f32 ka; // at 0x1C
|
||||
f32 kb; // at 0x20
|
||||
f32 kc; // at 0x24
|
||||
f32 posX; // at 0x28
|
||||
f32 posY; // at 0x2C
|
||||
f32 posZ; // at 0x30
|
||||
f32 dirX; // at 0x34
|
||||
f32 dirY; // at 0x38
|
||||
f32 dirZ; // at 0x3C
|
||||
} GXLightObjImpl;
|
||||
|
||||
typedef struct _GXTexObjImpl {
|
||||
u8 todo;
|
||||
} GXTexObjImpl;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef RVL_SDK_GX_LIGHT_H
|
||||
#define RVL_SDK_GX_LIGHT_H
|
||||
#include <lib/rvl/GX/GXInternal.h>
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GX_DECL_PUBLIC_STRUCT(GXLightObj, 64);
|
||||
|
||||
void GXInitLightAttn(GXLightObj* light, f32 aa, f32 ab, f32 ac, f32 ka, f32 kb,
|
||||
f32 kc);
|
||||
void GXInitLightAttnA(GXLightObj* light, f32 a, f32 b, f32 c);
|
||||
void GXInitLightAttnK(GXLightObj* light, f32 a, f32 b, f32 c);
|
||||
void GXInitLightSpot(GXLightObj* light, f32 angle, GXSpotFn fn);
|
||||
void GXInitLightDistAttn(GXLightObj* light, f32 distance, f32 brightness,
|
||||
GXDistAttnFn fn);
|
||||
void GXInitLightPos(GXLightObj* light, f32 x, f32 y, f32 z);
|
||||
void GXGetLightPos(const GXLightObj* light, f32* x, f32* y, f32* z);
|
||||
void GXInitLightDir(GXLightObj* light, f32 x, f32 y, f32 z);
|
||||
void GXGetLightDir(const GXLightObj* light, f32* x, f32* y, f32* z);
|
||||
void GXInitSpecularDir(GXLightObj* light, f32 x, f32 y, f32 z);
|
||||
void GXInitLightColor(GXLightObj* light, GXColor color);
|
||||
void GXLoadLightObjImm(const GXLightObj* light, GXLightID id);
|
||||
void GXLoadLightObjIndx(u16 index, GXLightID id);
|
||||
void GXSetChanAmbColor(GXChannelID chan, GXColor color);
|
||||
void GXSetChanMatColor(GXChannelID chan, GXColor color);
|
||||
void GXSetNumChans(u8 num);
|
||||
void GXSetChanCtrl(GXChannelID chan, GXBool enable, GXColorSrc ambSrc,
|
||||
GXColorSrc matSrc, GXLightID lightMask, GXDiffuseFn diffFn,
|
||||
GXAttnFn attnFn);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef RVL_SDK_GX_MISC_H
|
||||
#define RVL_SDK_GX_MISC_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXSetMisc(UNKWORD token, UNKWORD val);
|
||||
void GXFlush(void);
|
||||
void GXResetWriteGatherPipe(void);
|
||||
|
||||
void GXAbortFrame(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef RVL_SDK_GX_PIXEL_H
|
||||
#define RVL_SDK_GX_PIXEL_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/MTX.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _GXFogAdjTable {
|
||||
u16 r[10]; // at 0x0
|
||||
} GXFogAdjTable;
|
||||
|
||||
void GXSetFog(GXFogType type, GXColor color, f32 start, f32 end, f32 near,
|
||||
f32 far);
|
||||
void GXInitFogAdjTable(GXFogAdjTable* table, u16 width, const Mtx44 proj);
|
||||
void GXSetFogRangeAdj(GXBool enable, u16 center, const GXFogAdjTable* table);
|
||||
void GXSetBlendMode(GXBlendMode mode, GXBlendFactor src, GXBlendFactor dst,
|
||||
GXLogicOp op);
|
||||
void GXSetColorUpdate(GXBool enable);
|
||||
void GXSetAlphaUpdate(GXBool enable);
|
||||
void GXSetZMode(GXBool enableTest, GXCompare func, GXBool enableUpdate);
|
||||
void GXSetZCompLoc(GXBool beforeTex);
|
||||
void GXSetPixelFmt(GXPixelFmt pixelFmt, GXZFmt zFmt);
|
||||
void GXSetDither(GXBool enable);
|
||||
void GXSetDstAlpha(GXBool enable, u8 alpha);
|
||||
void GXSetFieldMask(GXBool enableEven, GXBool enableOdd);
|
||||
void GXSetFieldMode(GXBool texLOD, GXBool adjustAR);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef RVL_SDK_GX_TEV_H
|
||||
#define RVL_SDK_GX_TEV_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXSetTevOp(GXTevStageID, UNKWORD);
|
||||
void GXSetTevColorIn(GXTevStageID, GXTevColorArg, GXTevColorArg, GXTevColorArg,
|
||||
GXTevColorArg);
|
||||
void GXSetTevAlphaIn(GXTevStageID, GXTevAlphaArg, GXTevAlphaArg, GXTevAlphaArg,
|
||||
GXTevAlphaArg);
|
||||
void GXSetTevColorOp(GXTevStageID, GXTevOp, GXTevBias, GXTevScale, u8,
|
||||
GXTevRegID);
|
||||
void GXSetTevAlphaOp(GXTevStageID, GXTevOp, GXTevBias, GXTevScale, u8,
|
||||
GXTevRegID);
|
||||
|
||||
void GXSetTevColor(GXTevRegID, GXColor);
|
||||
|
||||
void GXSetTevKColor(GXTevKColorID, GXColor);
|
||||
void GXSetTevKColorSel(GXTevStageID, GXTevKColorSel);
|
||||
void GXSetTevKAlphaSel(GXTevStageID, GXTevKAlphaSel);
|
||||
void GXSetTevSwapMode(GXTevStageID, GXTevSwapSel, GXTevSwapSel);
|
||||
void GXSetTevSwapModeTable(GXTevSwapSel, GXTevColorChan, GXTevColorChan,
|
||||
GXTevColorChan, GXTevColorChan);
|
||||
|
||||
void GXSetAlphaCompare(GXCompare, u8, GXAlphaOp, GXCompare, u8);
|
||||
void GXSetZTexture(UNKWORD, UNKWORD, UNKWORD);
|
||||
void GXSetTevOrder(GXTevStageID, GXTexCoordID, GXTexMapID, GXChannelID);
|
||||
void GXSetNumTevStages(u8);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef RVL_SDK_GX_TEXTURE_H
|
||||
#define RVL_SDK_GX_TEXTURE_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GX_DECL_PUBLIC_STRUCT(GXTexObj, 32);
|
||||
|
||||
void __GXSetSUTexRegs(void);
|
||||
|
||||
void GXInitTexObj(GXTexObj*, void*, u16, u16, GXTexFmt, GXTexWrapMode,
|
||||
GXTexWrapMode, u8);
|
||||
void GXInitTexObjLOD(GXTexObj*, GXTexFilter, GXTexFilter, f32, f32, f32, u8, u8,
|
||||
GXAnisotropy);
|
||||
|
||||
void GXLoadTexObj(GXTexObj*, GXTexMapID);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef RVL_SDK_GX_TRANSFORM_H
|
||||
#define RVL_SDK_GX_TRANSFORM_H
|
||||
#include <lib/rvl/GX/GXTypes.h>
|
||||
#include <lib/rvl/MTX.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GXSetProjection(const Mtx44 proj, GXProjMtxType type);
|
||||
void GXSetProjectionv(const f32 proj[7]);
|
||||
void GXGetProjectionv(f32 proj[7]);
|
||||
void GXLoadPosMtxImm(const Mtx mtx, u32 id);
|
||||
void GXLoadPosMtxIndx(u16 index, u32 id);
|
||||
void GXLoadNrmMtxImm(const Mtx mtx, u32 id);
|
||||
void GXLoadNrmMtxIndx3x3(u16 index, u32 id);
|
||||
void GXSetCurrentMtx(u32 id);
|
||||
void GXLoadTexMtxImm(const Mtx mtx, u32 id, GXMtxType type);
|
||||
void GXSetViewportJitter(f32 ox, f32 oy, f32 sx, f32 sy, f32 near, f32 far,
|
||||
u32 nextField);
|
||||
void GXSetViewport(f32 ox, f32 oy, f32 sx, f32 sy, f32 near, f32 far);
|
||||
void GXGetViewportv(f32 view[6]);
|
||||
void GXSetZScaleOffset(f32 scale, f32 offset);
|
||||
void GXSetScissor(u32 x, u32 y, u32 w, u32 h);
|
||||
void GXGetScissor(u32* x, u32* y, u32* w, u32* h);
|
||||
void GXSetScissorBoxOffset(u32 ox, u32 oy);
|
||||
void GXSetClipMode(GXClipMode mode);
|
||||
|
||||
void __GXSetProjection(void);
|
||||
void __GXSetViewport(void);
|
||||
void __GXSetMatrixIndex(GXAttr index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,832 @@
|
||||
#ifndef RVL_SDK_GX_TYPES_H
|
||||
#define RVL_SDK_GX_TYPES_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Pack value into bitfield.
|
||||
* Value is shifted to the specified bit position.
|
||||
* (Bit indices are LSB)
|
||||
*/
|
||||
#define GX_BITSET(field, pos, size, value) \
|
||||
__rlwimi((field), (value), 31 - (pos) - (size) + 1, (pos), (pos) + (size)-1)
|
||||
|
||||
/**
|
||||
* Compose value from bitfield.
|
||||
* Value is shifted after masking.
|
||||
* (Bit indices are LSB)
|
||||
*/
|
||||
#define GX_BITGET(field, pos, size) \
|
||||
((field) >> (31 - (pos) - (size) + 1) & ((1 << (size)) - 1))
|
||||
|
||||
/**
|
||||
* Pack value into bitfield.
|
||||
* Value is not shifted, only masked.
|
||||
* (Bit indices are LSB)
|
||||
*/
|
||||
#define GX_BITSET_TRUNC(field, pos, size, value) \
|
||||
__rlwimi((field), (value), 0, (pos), (pos) + (size)-1)
|
||||
|
||||
/**
|
||||
* Compose value from bitfield.
|
||||
* Value is not shifted, only masked.
|
||||
* (Bit indices are LSB)
|
||||
*/
|
||||
#define GX_BITGET_TRUNC(field, pos, size) \
|
||||
((field) & (((1 << (size)) - 1) << (32 - (pos) - (size))))
|
||||
|
||||
/**
|
||||
* Common types used throughout many GX files.
|
||||
* To avoid circular depencies, common structures and all enums have been moved
|
||||
* here. Everything is organized in alphabetical order.
|
||||
*/
|
||||
|
||||
// Differentiate between 8-byte and boolean values
|
||||
// Real name! (from patent)
|
||||
typedef unsigned char GXBool;
|
||||
|
||||
/**
|
||||
* Common structs
|
||||
*/
|
||||
|
||||
typedef struct _GXColor {
|
||||
u8 r, g, b, a;
|
||||
} GXColor;
|
||||
|
||||
typedef struct _GXColorS10 {
|
||||
s16 r, g, b, a;
|
||||
} GXColorS10;
|
||||
|
||||
/**
|
||||
* Common enums
|
||||
*/
|
||||
|
||||
typedef enum _GXAlphaOp {
|
||||
GX_AOP_AND,
|
||||
GX_AOP_OR,
|
||||
GX_AOP_XOR,
|
||||
GX_AOP_XNOR,
|
||||
|
||||
GX_MAX_ALPHAOP
|
||||
} GXAlphaOp;
|
||||
|
||||
typedef enum _GXAnisotropy {
|
||||
GX_ANISO_1,
|
||||
GX_ANISO_2,
|
||||
GX_ANISO_4,
|
||||
|
||||
GX_MAX_ANISOTROPY
|
||||
} GXAnisotropy;
|
||||
|
||||
typedef enum _GXAttnFn {
|
||||
GX_AF_SPEC,
|
||||
GX_AF_SPOT,
|
||||
GX_AF_NONE,
|
||||
} GXAttnFn;
|
||||
|
||||
typedef enum _GXAttr {
|
||||
GX_VA_PNMTXIDX,
|
||||
GX_VA_TEX0MTXIDX,
|
||||
GX_VA_TEX1MTXIDX,
|
||||
GX_VA_TEX2MTXIDX,
|
||||
GX_VA_TEX3MTXIDX,
|
||||
GX_VA_TEX4MTXIDX,
|
||||
GX_VA_TEX5MTXIDX,
|
||||
GX_VA_TEX6MTXIDX,
|
||||
GX_VA_TEX7MTXIDX,
|
||||
GX_VA_POS,
|
||||
GX_VA_NRM,
|
||||
GX_VA_CLR0,
|
||||
GX_VA_CLR1,
|
||||
GX_VA_TEX0,
|
||||
GX_VA_TEX1,
|
||||
GX_VA_TEX2,
|
||||
GX_VA_TEX3,
|
||||
GX_VA_TEX4,
|
||||
GX_VA_TEX5,
|
||||
GX_VA_TEX6,
|
||||
GX_VA_TEX7,
|
||||
GX_POS_MTX_ARRAY,
|
||||
GX_NRM_MTX_ARRAY,
|
||||
GX_TEX_MTX_ARRAY,
|
||||
GX_LIGHT_ARRAY,
|
||||
GX_VA_NBT, // All three normal elements (normal/binormal/tangent)
|
||||
|
||||
GX_VA_MAX_ATTR,
|
||||
GX_VA_NULL = 255
|
||||
} GXAttr;
|
||||
|
||||
typedef enum _GXAttrType {
|
||||
GX_NONE, //! No data sent
|
||||
GX_DIRECT, //! Data sent directly to FIFO
|
||||
GX_INDEX8, //! 8-bit index sent to FIFO
|
||||
GX_INDEX16 //! 16-bit index sent to FIFO
|
||||
} GXAttrType;
|
||||
|
||||
typedef enum _GXBlendFactor {
|
||||
GX_BL_ZERO,
|
||||
GX_BL_ONE,
|
||||
GX_BL_SRCCLR,
|
||||
GX_BL_INVSRCCLR,
|
||||
GX_BL_SRCALPHA,
|
||||
GX_BL_INVSRCALPHA,
|
||||
GX_BL_DSTALPHA,
|
||||
GX_BL_INVDSTALPHA,
|
||||
|
||||
GX_BL_DSTCLR = GX_BL_SRCCLR,
|
||||
GX_BL_INVDSTCLR = GX_BL_INVSRCCLR
|
||||
} GXBlendFactor;
|
||||
|
||||
typedef enum _GXBlendMode {
|
||||
GX_BM_NONE,
|
||||
GX_BM_BLEND,
|
||||
GX_BM_LOGIC,
|
||||
GX_BM_SUBTRACT,
|
||||
|
||||
GX_MAX_BLENDMODE
|
||||
} GXBlendMode;
|
||||
|
||||
typedef enum _GXChannelID {
|
||||
GX_COLOR0,
|
||||
GX_COLOR1,
|
||||
GX_ALPHA0,
|
||||
GX_ALPHA1,
|
||||
GX_COLOR0A0,
|
||||
GX_COLOR1A1,
|
||||
GX_COLOR_ZERO,
|
||||
GX_ALPHA_BUMP,
|
||||
GX_ALPHA_BUMPN,
|
||||
|
||||
GX_COLOR_NULL = 255
|
||||
} GXChannelID;
|
||||
|
||||
// TODO: Fabricated names from patent
|
||||
typedef enum _GXClipMode {
|
||||
// "ClipDisable" in XF mem, so 0 = enable
|
||||
GX_CLIP_ENABLE,
|
||||
GX_CLIP_DISABLE,
|
||||
} GXClipMode;
|
||||
|
||||
typedef enum _GXColorSrc { GX_SRC_REG, GX_SRC_VTX } GXColorSrc;
|
||||
|
||||
typedef enum _GXCompare {
|
||||
GX_NEVER,
|
||||
GX_LESS,
|
||||
GX_EQUAL,
|
||||
GX_LEQUAL,
|
||||
GX_GREATER,
|
||||
GX_NEQUAL,
|
||||
GX_GEQUAL,
|
||||
GX_ALWAYS
|
||||
} GXCompare;
|
||||
|
||||
typedef enum _GXCompCnt {
|
||||
GX_POS_XY = 0,
|
||||
GX_POS_XYZ,
|
||||
|
||||
GX_NRM_XYZ = 0,
|
||||
GX_NRM_NBT,
|
||||
GX_NRM_NBT3,
|
||||
|
||||
GX_CLR_RGB = 0,
|
||||
GX_CLR_RGBA,
|
||||
|
||||
GX_TEX_S = 0,
|
||||
GX_TEX_ST
|
||||
} GXCompCnt;
|
||||
|
||||
typedef enum _GXCompType {
|
||||
GX_U8,
|
||||
GX_S8,
|
||||
GX_U16,
|
||||
GX_S16,
|
||||
GX_F32,
|
||||
|
||||
GX_RGB565 = 0,
|
||||
GX_RGB8,
|
||||
GX_RGBX8,
|
||||
GX_RGBA4,
|
||||
GX_RGBA6,
|
||||
GX_RGBA8
|
||||
} GXCompType;
|
||||
|
||||
typedef enum _GXCullMode {
|
||||
GX_CULL_NONE,
|
||||
GX_CULL_FRONT,
|
||||
GX_CULL_BACK,
|
||||
GX_CULL_ALL
|
||||
} GXCullMode;
|
||||
|
||||
typedef enum _GXDiffuseFn { GX_DF_NONE, GX_DF_SIGN, GX_DF_CLAMP } GXDiffuseFn;
|
||||
|
||||
typedef enum _GXDirtyFlag {
|
||||
GX_DIRTY_SU_TEX = (1 << 0),
|
||||
GX_DIRTY_BP_MASK = (1 << 1),
|
||||
GX_DIRTY_GEN_MODE = (1 << 2),
|
||||
GX_DIRTY_VCD = (1 << 3),
|
||||
GX_DIRTY_VAT = (1 << 4),
|
||||
// . . .
|
||||
GX_DIRTY_AMB_COLOR0 = (1 << 8),
|
||||
GX_DIRTY_AMB_COLOR1 = (1 << 9),
|
||||
GX_DIRTY_MAT_COLOR0 = (1 << 10),
|
||||
GX_DIRTY_MAT_COLOR1 = (1 << 11),
|
||||
GX_DIRTY_CHAN_COLOR0 = (1 << 12),
|
||||
GX_DIRTY_CHAN_COLOR1 = (1 << 13),
|
||||
GX_DIRTY_CHAN_ALPHA0 = (1 << 14),
|
||||
GX_DIRTY_CHAN_ALPHA1 = (1 << 15),
|
||||
GX_DIRTY_TEX0 = (1 << 16),
|
||||
GX_DIRTY_TEX1 = (1 << 17),
|
||||
GX_DIRTY_TEX2 = (1 << 18),
|
||||
GX_DIRTY_TEX3 = (1 << 19),
|
||||
GX_DIRTY_TEX4 = (1 << 20),
|
||||
GX_DIRTY_TEX5 = (1 << 21),
|
||||
GX_DIRTY_TEX6 = (1 << 22),
|
||||
GX_DIRTY_TEX7 = (1 << 23),
|
||||
GX_DIRTY_NUM_COLORS = (1 << 24),
|
||||
GX_DIRTY_NUM_TEX = (1 << 25),
|
||||
GX_DIRTY_MTX_IDX = (1 << 26),
|
||||
GX_DIRTY_PROJECTION = (1 << 27),
|
||||
GX_DIRTY_VIEWPORT = (1 << 28),
|
||||
|
||||
GX_AMB_MAT_MASK = GX_DIRTY_AMB_COLOR0 | GX_DIRTY_AMB_COLOR1 |
|
||||
GX_DIRTY_MAT_COLOR0 | GX_DIRTY_MAT_COLOR1,
|
||||
|
||||
GX_LIGHT_CHAN_MASK = GX_DIRTY_CHAN_COLOR0 | GX_DIRTY_CHAN_COLOR1 |
|
||||
GX_DIRTY_CHAN_ALPHA0 | GX_DIRTY_CHAN_ALPHA1 |
|
||||
GX_DIRTY_NUM_COLORS,
|
||||
|
||||
GX_TEX_GEN_MASK = 0x2FF0000,
|
||||
} GXDirtyFlag;
|
||||
|
||||
typedef enum _GXDistAttnFn {
|
||||
GX_DA_OFF,
|
||||
GX_DA_GENTLE,
|
||||
GX_DA_MEDIUM,
|
||||
GX_DA_STEEP
|
||||
} GXDistAttnFn;
|
||||
|
||||
typedef enum _GXFogType {
|
||||
GX_FOG_NONE,
|
||||
|
||||
GX_FOG_PERSP_LIN = 2,
|
||||
GX_FOG_PERSP_EXP = 4,
|
||||
GX_FOG_PERSP_EXP2 = 5,
|
||||
GX_FOG_PERSP_REVEXP = 6,
|
||||
GX_FOG_PERSP_REVEXP2 = 7,
|
||||
|
||||
// Fourth bit is set to mark orthographic
|
||||
GX_FOG_ORTHO_LIN = 1 << 3 | GX_FOG_PERSP_LIN,
|
||||
GX_FOG_ORTHO_EXP = 1 << 3 | GX_FOG_PERSP_EXP,
|
||||
GX_FOG_ORTHO_EXP2 = 1 << 3 | GX_FOG_PERSP_EXP2,
|
||||
GX_FOG_ORTHO_REVEXP = 1 << 3 | GX_FOG_PERSP_REVEXP,
|
||||
GX_FOG_ORTHO_REVEXP2 = 1 << 3 | GX_FOG_PERSP_REVEXP2
|
||||
} GXFogType;
|
||||
|
||||
// Access components of the fog type
|
||||
#define GX_FOG_GET_PROJ(x) ((x) >> 3 & 1)
|
||||
#define GX_FOG_GET_FSEL(x) ((x)&7)
|
||||
|
||||
typedef enum _GXIndTexAlphaSel {
|
||||
GX_ITBA_OFF,
|
||||
GX_ITBA_S,
|
||||
GX_ITBA_T,
|
||||
GX_ITBA_U,
|
||||
|
||||
GX_MAX_ITBALPHA
|
||||
} GXIndTexAlphaSel;
|
||||
|
||||
typedef enum _GXIndTexBiasSel {
|
||||
GX_ITB_NONE,
|
||||
GX_ITB_S,
|
||||
GX_ITB_T,
|
||||
GX_ITB_ST,
|
||||
GX_ITB_U,
|
||||
GX_ITB_SU,
|
||||
GX_ITB_TU,
|
||||
GX_ITB_STU,
|
||||
|
||||
GX_MAX_ITBIAS
|
||||
} GXIndTexBiasSel;
|
||||
|
||||
typedef enum _GXIndTexFormat {
|
||||
GX_ITF_8,
|
||||
GX_ITF_5,
|
||||
GX_ITF_4,
|
||||
GX_ITF_3,
|
||||
|
||||
GX_MAX_ITFORMAT
|
||||
} GXIndTexFormat;
|
||||
|
||||
typedef enum _GXIndTexMtxID {
|
||||
GX_ITM_OFF,
|
||||
GX_ITM_0,
|
||||
GX_ITM_1,
|
||||
GX_ITM_2,
|
||||
|
||||
GX_ITM_S0 = 5,
|
||||
GX_ITM_S1,
|
||||
GX_ITM_S2,
|
||||
|
||||
GX_ITM_T0 = 9,
|
||||
GX_ITM_T1,
|
||||
GX_ITM_T2,
|
||||
} GXIndTexMtxID;
|
||||
|
||||
typedef enum _GXIndTexScale {
|
||||
GX_ITS_1,
|
||||
GX_ITS_2,
|
||||
GX_ITS_4,
|
||||
GX_ITS_8,
|
||||
GX_ITS_16,
|
||||
GX_ITS_32,
|
||||
GX_ITS_64,
|
||||
GX_ITS_128,
|
||||
GX_ITS_256,
|
||||
|
||||
GX_MAX_ITSCALE
|
||||
} GXIndTexScale;
|
||||
|
||||
typedef enum _GXIndTexStageID {
|
||||
GX_INDTEXSTAGE0,
|
||||
GX_INDTEXSTAGE1,
|
||||
GX_INDTEXSTAGE2,
|
||||
GX_INDTEXSTAGE3,
|
||||
|
||||
GX_MAX_INDTEXSTAGE
|
||||
} GXIndTexStageID;
|
||||
|
||||
typedef enum _GXIndTexWrap {
|
||||
GX_ITW_OFF,
|
||||
GX_ITW_256,
|
||||
GX_ITW_128,
|
||||
GX_ITW_64,
|
||||
GX_ITW_32,
|
||||
GX_ITW_16,
|
||||
GX_ITW_0,
|
||||
|
||||
GX_MAX_ITWRAP,
|
||||
} GXIndTexWrap;
|
||||
|
||||
typedef enum _GXLightID {
|
||||
GX_LIGHT0 = 1,
|
||||
GX_LIGHT1 = 2,
|
||||
GX_LIGHT2 = 4,
|
||||
GX_LIGHT3 = 8,
|
||||
GX_LIGHT4 = 16,
|
||||
GX_LIGHT5 = 32,
|
||||
GX_LIGHT6 = 64,
|
||||
GX_LIGHT7 = 128,
|
||||
|
||||
GX_MAX_LIGHT = 256,
|
||||
GX_LIGHT_NULL = 0
|
||||
} GXLightID;
|
||||
|
||||
typedef enum _GXLogicOp {
|
||||
GX_LO_CLEAR,
|
||||
GX_LO_AND,
|
||||
GX_LO_REVAND,
|
||||
GX_LO_COPY,
|
||||
GX_LO_INVAND,
|
||||
GX_LO_NOOP,
|
||||
GX_LO_XOR,
|
||||
GX_LO_OR,
|
||||
GX_LO_NOR,
|
||||
GX_LO_EQUIV,
|
||||
GX_LO_INV,
|
||||
GX_LO_REVOR,
|
||||
GX_LO_INVCOPY,
|
||||
GX_LO_INVOR,
|
||||
GX_LO_NAND,
|
||||
GX_LO_SET
|
||||
} GXLogicOp;
|
||||
|
||||
// TODO: Fabricated name
|
||||
typedef enum _GXMtxType {
|
||||
GX_MTX_3x4,
|
||||
GX_MTX_2x4,
|
||||
} GXMtxType;
|
||||
|
||||
typedef enum _GXPixelFmt {
|
||||
GX_PF_RGB8_Z24, // from Dolphin
|
||||
GX_PF_RGBA6_Z24, // from EGG
|
||||
GX_PF_RGBA565_Z16, // from Dolphin
|
||||
GX_PF_Z24, // from Dolphin
|
||||
GX_PF_Y8, // from Dolphin
|
||||
GX_PF_U8, // from Dolphin
|
||||
GX_PF_V8, // from Dolphin
|
||||
GX_PF_YUV420, // from Dolphin
|
||||
|
||||
GX_MAX_PIXELFMT
|
||||
} GXPixelFmt;
|
||||
|
||||
/**
|
||||
* Matrix column index into XF memory.
|
||||
* (Multiply by row dimension to get XF mem offset)
|
||||
*/
|
||||
typedef enum _GXPosNrmMtx {
|
||||
GX_PNMTX0 = 0,
|
||||
GX_PNMTX1 = 3,
|
||||
GX_PNMTX2 = 6,
|
||||
GX_PNMTX3 = 9,
|
||||
GX_PNMTX4 = 12,
|
||||
GX_PNMTX5 = 15,
|
||||
GX_PNMTX6 = 18,
|
||||
GX_PNMTX7 = 21,
|
||||
GX_PNMTX8 = 24,
|
||||
GX_PNMTX9 = 27
|
||||
} GXPosNrmMtx;
|
||||
|
||||
typedef enum _GXPrimitive {
|
||||
GX_POINTS = 0xB8,
|
||||
GX_LINES = 0xA8,
|
||||
GX_LINESTRIP = 0xB0,
|
||||
GX_TRIANGLES = 0x90,
|
||||
GX_TRIANGLESTRIP = 0x98,
|
||||
GX_TRIANGLEFAN = 0xA0,
|
||||
GX_QUADS = 0x80,
|
||||
} GXPrimitive;
|
||||
|
||||
typedef enum _GXProjMtxType { GX_PERSPECTIVE, GX_ORTHOGRAPHIC } GXProjMtxType;
|
||||
|
||||
typedef enum _GXSpotFn {
|
||||
GX_SP_OFF,
|
||||
GX_SP_FLAT,
|
||||
GX_SP_COS,
|
||||
GX_SP_COS2,
|
||||
GX_SP_SHARP,
|
||||
GX_SP_RING1,
|
||||
GX_SP_RING2
|
||||
} GXSpotFn;
|
||||
|
||||
typedef enum _GXTevAlphaArg {
|
||||
GX_CA_APREV,
|
||||
GX_CA_A0,
|
||||
GX_CA_A1,
|
||||
GX_CA_A2,
|
||||
GX_CA_TEXA,
|
||||
GX_CA_RASA,
|
||||
GX_CA_KONST,
|
||||
GX_CA_ZERO,
|
||||
GX_CA_ONE
|
||||
} GXTevAlphaArg;
|
||||
|
||||
typedef enum _GXTevBias {
|
||||
GX_TB_ZERO,
|
||||
GX_TB_ADDHALF,
|
||||
GX_TB_SUBHALF,
|
||||
|
||||
GX_MAX_TEVBIAS
|
||||
} GXTevBias;
|
||||
|
||||
typedef enum _GXTevColorArg {
|
||||
GX_CC_CPREV,
|
||||
GX_CC_APREV,
|
||||
GX_CC_C0,
|
||||
GX_CC_A0,
|
||||
GX_CC_C1,
|
||||
GX_CC_A1,
|
||||
GX_CC_C2,
|
||||
GX_CC_A2,
|
||||
GX_CC_TEXC,
|
||||
GX_CC_TEXA,
|
||||
GX_CC_RASC,
|
||||
GX_CC_RASA,
|
||||
GX_CC_ONE,
|
||||
GX_CC_HALF,
|
||||
GX_CC_KONST,
|
||||
GX_CC_ZERO,
|
||||
GX_CC_TEXRRR,
|
||||
GX_CC_TEXGGG,
|
||||
GX_CC_TEXBBB,
|
||||
|
||||
GX_CC_QUARTER = GX_CC_KONST
|
||||
} GXTevColorArg;
|
||||
|
||||
typedef enum _GXTevColorChan {
|
||||
GX_CH_RED,
|
||||
GX_CH_GREEN,
|
||||
GX_CH_BLUE,
|
||||
GX_CH_ALPHA
|
||||
} GXTevColorChan;
|
||||
|
||||
typedef enum _GXTevOp {
|
||||
GX_TEV_ADD,
|
||||
GX_TEV_SUB,
|
||||
|
||||
GX_TEV_COMP_R8_GT = 8,
|
||||
GX_TEV_COMP_R8_EQ,
|
||||
GX_TEV_COMP_GR16_GT,
|
||||
GX_TEV_COMP_GR16_EQ,
|
||||
GX_TEV_COMP_BGR24_GT,
|
||||
GX_TEV_COMP_BGR24_EQ,
|
||||
GX_TEV_COMP_RGB8_GT,
|
||||
GX_TEV_COMP_RGB8_EQ,
|
||||
|
||||
GX_TEV_COMP_A8_GT = GX_TEV_COMP_RGB8_GT,
|
||||
GX_TEV_COMP_A8_EQ = GX_TEV_COMP_RGB8_EQ
|
||||
} GXTevOp;
|
||||
|
||||
typedef enum _GXTevRegID {
|
||||
GX_TEVPREV,
|
||||
GX_TEVREG0,
|
||||
GX_TEVREG1,
|
||||
GX_TEVREG2,
|
||||
|
||||
GX_MAX_TEVREG
|
||||
} GXTevRegID;
|
||||
|
||||
typedef enum _GXTevScale {
|
||||
GX_TEV_SCALE_0,
|
||||
GX_TEV_SCALE_1,
|
||||
GX_TEV_SCALE_2,
|
||||
GX_TEV_SCALE_3,
|
||||
} GXTevScale;
|
||||
|
||||
typedef enum _GXTevStageID {
|
||||
GX_TEVSTAGE0,
|
||||
GX_TEVSTAGE1,
|
||||
GX_TEVSTAGE2,
|
||||
GX_TEVSTAGE3,
|
||||
GX_TEVSTAGE4,
|
||||
GX_TEVSTAGE5,
|
||||
GX_TEVSTAGE6,
|
||||
GX_TEVSTAGE7,
|
||||
GX_TEVSTAGE8,
|
||||
GX_TEVSTAGE9,
|
||||
GX_TEVSTAGE10,
|
||||
GX_TEVSTAGE11,
|
||||
GX_TEVSTAGE12,
|
||||
GX_TEVSTAGE13,
|
||||
GX_TEVSTAGE14,
|
||||
GX_TEVSTAGE15,
|
||||
|
||||
GX_MAX_TEVSTAGE
|
||||
} GXTevStageID;
|
||||
|
||||
typedef enum _GXTevSwapSel {
|
||||
GX_TEV_SWAP0,
|
||||
GX_TEV_SWAP1,
|
||||
GX_TEV_SWAP2,
|
||||
GX_TEV_SWAP3,
|
||||
|
||||
GX_MAX_TEVSWAP
|
||||
} GXTevSwapSel;
|
||||
|
||||
typedef enum _GXTevKAlphaSel {
|
||||
GX_TEV_KASEL_8_8,
|
||||
GX_TEV_KASEL_7_8,
|
||||
GX_TEV_KASEL_6_8,
|
||||
GX_TEV_KASEL_5_8,
|
||||
GX_TEV_KASEL_4_8,
|
||||
GX_TEV_KASEL_3_8,
|
||||
GX_TEV_KASEL_2_8,
|
||||
GX_TEV_KASEL_1_8,
|
||||
|
||||
GX_TEV_KASEL_1 = 0,
|
||||
GX_TEV_KASEL_3_4 = 2,
|
||||
GX_TEV_KASEL_1_2 = 4,
|
||||
GX_TEV_KASEL_1_4 = 6,
|
||||
|
||||
GX_TEV_KASEL_K0_R = 16,
|
||||
GX_TEV_KASEL_K1_R,
|
||||
GX_TEV_KASEL_K2_R,
|
||||
GX_TEV_KASEL_K3_R,
|
||||
GX_TEV_KASEL_K0_G,
|
||||
GX_TEV_KASEL_K1_G,
|
||||
GX_TEV_KASEL_K2_G,
|
||||
GX_TEV_KASEL_K3_G,
|
||||
GX_TEV_KASEL_K0_B,
|
||||
GX_TEV_KASEL_K1_B,
|
||||
GX_TEV_KASEL_K2_B,
|
||||
GX_TEV_KASEL_K3_B,
|
||||
GX_TEV_KASEL_K0_A,
|
||||
GX_TEV_KASEL_K1_A,
|
||||
GX_TEV_KASEL_K2_A,
|
||||
GX_TEV_KASEL_K3_A
|
||||
} GXTevKAlphaSel;
|
||||
|
||||
typedef enum _GXTevKColorID {
|
||||
GX_KCOLOR0,
|
||||
GX_KCOLOR1,
|
||||
GX_KCOLOR2,
|
||||
GX_KCOLOR3,
|
||||
|
||||
GX_MAX_KCOLOR
|
||||
} GXTevKColorID;
|
||||
|
||||
typedef enum _GXTevKColorSel {
|
||||
GX_TEV_KCSEL_8_8,
|
||||
GX_TEV_KCSEL_7_8,
|
||||
GX_TEV_KCSEL_6_8,
|
||||
GX_TEV_KCSEL_5_8,
|
||||
GX_TEV_KCSEL_4_8,
|
||||
GX_TEV_KCSEL_3_8,
|
||||
GX_TEV_KCSEL_2_8,
|
||||
GX_TEV_KCSEL_1_8,
|
||||
|
||||
GX_TEV_KCSEL_1 = 0,
|
||||
GX_TEV_KCSEL_3_4 = 2,
|
||||
GX_TEV_KCSEL_1_2 = 4,
|
||||
GX_TEV_KCSEL_1_4 = 6,
|
||||
|
||||
GX_TEV_KCSEL_K0 = 12,
|
||||
GX_TEV_KCSEL_K1,
|
||||
GX_TEV_KCSEL_K2,
|
||||
GX_TEV_KCSEL_K3,
|
||||
GX_TEV_KCSEL_K0_R,
|
||||
GX_TEV_KCSEL_K1_R,
|
||||
GX_TEV_KCSEL_K2_R,
|
||||
GX_TEV_KCSEL_K3_R,
|
||||
GX_TEV_KCSEL_K0_G,
|
||||
GX_TEV_KCSEL_K1_G,
|
||||
GX_TEV_KCSEL_K2_G,
|
||||
GX_TEV_KCSEL_K3_G,
|
||||
GX_TEV_KCSEL_K0_B,
|
||||
GX_TEV_KCSEL_K1_B,
|
||||
GX_TEV_KCSEL_K2_B,
|
||||
GX_TEV_KCSEL_K3_B,
|
||||
GX_TEV_KCSEL_K0_A,
|
||||
GX_TEV_KCSEL_K1_A,
|
||||
GX_TEV_KCSEL_K2_A,
|
||||
GX_TEV_KCSEL_K3_A
|
||||
} GXTevKColorSel;
|
||||
|
||||
typedef enum _GXTexCoordID {
|
||||
GX_TEXCOORD0,
|
||||
GX_TEXCOORD1,
|
||||
GX_TEXCOORD2,
|
||||
GX_TEXCOORD3,
|
||||
GX_TEXCOORD4,
|
||||
GX_TEXCOORD5,
|
||||
GX_TEXCOORD6,
|
||||
GX_TEXCOORD7,
|
||||
|
||||
GX_MAX_TEXCOORD,
|
||||
GX_TEXCOORD_NULL = 255
|
||||
} GXTexCoordID;
|
||||
|
||||
typedef enum _GXTexFilter {
|
||||
GX_NEAR,
|
||||
GX_LINEAR,
|
||||
GX_NEAR_MIP_NEAR,
|
||||
GX_LIN_MIP_NEAR,
|
||||
GX_NEAR_MIP_LIN,
|
||||
GX_LIN_MIP_LIN,
|
||||
} GXTexFilter;
|
||||
|
||||
typedef enum _GXTexFmt {
|
||||
GX_TF_I4,
|
||||
GX_TF_I8,
|
||||
GX_TF_IA4,
|
||||
GX_TF_IA8,
|
||||
GX_TF_RGB565,
|
||||
GX_TF_RGB5A3,
|
||||
GX_TF_RGBA8,
|
||||
GX_TF_CMPR = 14,
|
||||
|
||||
GX_CTF_R4 = 32,
|
||||
GX_CTF_RA4 = 34,
|
||||
GX_CTF_RA8 = 35,
|
||||
GX_CTF_YUVA8 = 38,
|
||||
GX_CTF_A8 = 39,
|
||||
GX_CTF_R8 = 40,
|
||||
GX_CTF_G8 = 41,
|
||||
GX_CTF_B8 = 42,
|
||||
GX_CTF_RG8 = 43,
|
||||
GX_CTF_GB8 = 44,
|
||||
|
||||
GX_TF_Z8 = 17,
|
||||
GX_TF_Z16 = 19,
|
||||
GX_TF_Z24X8 = 22,
|
||||
|
||||
GX_CTF_Z4 = 48,
|
||||
GX_CTF_Z8M = 57,
|
||||
GX_CTF_Z8L = 58,
|
||||
GX_CTF_Z16L = 60,
|
||||
|
||||
GX_TF_A8 = GX_CTF_YUVA8
|
||||
} GXTexFmt;
|
||||
|
||||
typedef enum _GXTexGenSrc {
|
||||
GX_TG_POS,
|
||||
GX_TG_NRM,
|
||||
GX_TG_BINRM,
|
||||
GX_TG_TANGENT,
|
||||
GX_TG_TEX0,
|
||||
GX_TG_TEX1,
|
||||
GX_TG_TEX2,
|
||||
GX_TG_TEX3,
|
||||
GX_TG_TEX4,
|
||||
GX_TG_TEX5,
|
||||
GX_TG_TEX6,
|
||||
GX_TG_TEX7,
|
||||
GX_TG_TEXCOORD0,
|
||||
GX_TG_TEXCOORD1,
|
||||
GX_TG_TEXCOORD2,
|
||||
GX_TG_TEXCOORD3,
|
||||
GX_TG_TEXCOORD4,
|
||||
GX_TG_TEXCOORD5,
|
||||
GX_TG_TEXCOORD6,
|
||||
GX_TG_COLOR0,
|
||||
GX_TG_COLOR1,
|
||||
} GXTexGenSrc;
|
||||
|
||||
typedef enum _GXTexGenType {
|
||||
GX_TG_MTX3x4,
|
||||
GX_TG_MTX2x4,
|
||||
GX_TG_BUMP0,
|
||||
GX_TG_BUMP1,
|
||||
GX_TG_BUMP2,
|
||||
GX_TG_BUMP3,
|
||||
GX_TG_BUMP4,
|
||||
GX_TG_BUMP5,
|
||||
GX_TG_BUMP6,
|
||||
GX_TG_BUMP7,
|
||||
GX_TG_SRTG
|
||||
} GXTexGenType;
|
||||
|
||||
typedef enum _GXTexMapID {
|
||||
GX_TEXMAP0,
|
||||
GX_TEXMAP1,
|
||||
GX_TEXMAP2,
|
||||
GX_TEXMAP3,
|
||||
GX_TEXMAP4,
|
||||
GX_TEXMAP5,
|
||||
GX_TEXMAP6,
|
||||
GX_TEXMAP7,
|
||||
GX_MAX_TEXMAP,
|
||||
|
||||
GX_TEXMAP_NULL = 255,
|
||||
GX_TEX_DISABLE
|
||||
} GXTexMapID;
|
||||
|
||||
// TODO: Fabricated names
|
||||
typedef enum _GXTexMtx {
|
||||
// Any dimension (in standard XF matrix memory)
|
||||
GX_TEXMTX0 = 30,
|
||||
GX_TEXMTX1 = 33,
|
||||
GX_TEXMTX2 = 36,
|
||||
GX_TEXMTX3 = 39,
|
||||
GX_TEXMTX4 = 42,
|
||||
GX_TEXMTX5 = 45,
|
||||
GX_TEXMTX6 = 48,
|
||||
GX_TEXMTX7 = 51,
|
||||
GX_TEXMTX8 = 54,
|
||||
GX_TEXMTX9 = 57,
|
||||
|
||||
// 3x4 matrices (in dual-tex XF matrix memory)
|
||||
GX_DTEXMTX0 = 64,
|
||||
GX_DTEXMTX1 = 67,
|
||||
GX_DTEXMTX2 = 70,
|
||||
GX_DTEXMTX3 = 73,
|
||||
GX_DTEXMTX4 = 76,
|
||||
GX_DTEXMTX5 = 79,
|
||||
GX_DTEXMTX6 = 82,
|
||||
GX_DTEXMTX7 = 85,
|
||||
GX_DTEXMTX8 = 88,
|
||||
GX_DTEXMTX9 = 91,
|
||||
} GXTexMtx;
|
||||
|
||||
typedef enum _GXTexWrapMode {
|
||||
GX_CLAMP,
|
||||
GX_REPEAT,
|
||||
GX_MIRROR,
|
||||
|
||||
GX_MAX_TEXWRAPMODE
|
||||
} GXTexWrapMode;
|
||||
|
||||
typedef enum _GXTlutFmt {
|
||||
GX_TL_IA8,
|
||||
GX_TL_RGB565,
|
||||
GX_TL_RGB5A3,
|
||||
|
||||
GX_MAX_TLUTFMT
|
||||
} GXTlutFmt;
|
||||
|
||||
// TODO: Fabricated name
|
||||
typedef enum _GXVtxFmt {
|
||||
GX_VTXFMT0, // from patent
|
||||
GX_VTXFMT1,
|
||||
GX_VTXFMT2,
|
||||
GX_VTXFMT3,
|
||||
GX_VTXFMT4,
|
||||
GX_VTXFMT5,
|
||||
GX_VTXFMT6,
|
||||
GX_VTXFMT7,
|
||||
|
||||
GX_MAX_VTXFMT,
|
||||
} GXVtxFmt;
|
||||
|
||||
typedef enum _GXZFmt {
|
||||
GX_ZC_LINEAR, // from patent
|
||||
GX_ZC_NEAR, // from Dolphin
|
||||
GX_ZC_MID, // from Dolphin
|
||||
GX_ZC_FAR, // from Dolphin
|
||||
} GXZFmt;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,159 @@
|
||||
#ifndef RVL_SDK_GX_VERT_H
|
||||
#define RVL_SDK_GX_VERT_H
|
||||
#include <lib/rvl/GX/GXHardware.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static inline void GXCmd1u8(u8 uc) { WGPIPE.c = uc; }
|
||||
|
||||
static inline void GXCmd1u16(u16 us) { WGPIPE.us = us; }
|
||||
|
||||
static inline void GXCmd1u32(u32 ul) { WGPIPE.i = ul; }
|
||||
|
||||
static inline void GXPosition3f32(f32 x, f32 y, f32 z) {
|
||||
WGPIPE.f = x;
|
||||
WGPIPE.f = y;
|
||||
WGPIPE.f = z;
|
||||
}
|
||||
|
||||
static inline void GXPosition3u8(u8 x, u8 y, u8 z) {
|
||||
WGPIPE.c = x;
|
||||
WGPIPE.c = y;
|
||||
WGPIPE.c = z;
|
||||
}
|
||||
|
||||
static inline void GXPosition3s8(s8 x, s8 y, s8 z) {
|
||||
WGPIPE.c = x;
|
||||
WGPIPE.c = y;
|
||||
WGPIPE.c = z;
|
||||
}
|
||||
|
||||
static inline void GXPosition3u16(u16 x, u16 y, u16 z) {
|
||||
WGPIPE.us = x;
|
||||
WGPIPE.us = y;
|
||||
WGPIPE.us = z;
|
||||
}
|
||||
|
||||
static inline void GXPosition3s16(s16 x, s16 y, s16 z) {
|
||||
WGPIPE.s = x;
|
||||
WGPIPE.s = y;
|
||||
WGPIPE.s = z;
|
||||
}
|
||||
|
||||
static inline void GXPosition2f32(f32 x, f32 y) {
|
||||
WGPIPE.f = x;
|
||||
WGPIPE.f = y;
|
||||
}
|
||||
|
||||
static inline void GXPosition2u8(u8 x, u8 y) {
|
||||
WGPIPE.c = x;
|
||||
WGPIPE.c = y;
|
||||
}
|
||||
|
||||
static inline void GXPosition2s8(s8 x, s8 y) {
|
||||
WGPIPE.c = x;
|
||||
WGPIPE.c = y;
|
||||
}
|
||||
|
||||
static inline void GXPosition2u16(u16 x, u16 y) {
|
||||
WGPIPE.us = x;
|
||||
WGPIPE.us = y;
|
||||
}
|
||||
|
||||
static inline void GXPosition2s16(s16 x, s16 y) {
|
||||
WGPIPE.s = x;
|
||||
WGPIPE.s = y;
|
||||
}
|
||||
|
||||
static inline void GXPosition1x16(u16 us) { WGPIPE.us = us; }
|
||||
|
||||
static inline void GXPosition1x8(u8 uc) { WGPIPE.c = uc; }
|
||||
|
||||
static inline void GXNormal3f32(f32 x, f32 y, f32 z) {
|
||||
WGPIPE.f = x;
|
||||
WGPIPE.f = y;
|
||||
WGPIPE.f = z;
|
||||
}
|
||||
|
||||
static inline void GXNormal3s16(s16 x, s16 y, s16 z) {
|
||||
WGPIPE.s = x;
|
||||
WGPIPE.s = y;
|
||||
WGPIPE.s = z;
|
||||
}
|
||||
|
||||
static inline void GXNormal3s8(s8 x, s8 y, s8 z) {
|
||||
WGPIPE.c = x;
|
||||
WGPIPE.c = y;
|
||||
WGPIPE.c = z;
|
||||
}
|
||||
|
||||
static inline void GXNormal1x16(u16 us) { WGPIPE.us = us; }
|
||||
|
||||
static inline void GXNormal1x8(u8 uc) { WGPIPE.c = uc; }
|
||||
|
||||
static inline void GXColor4u8(u8 r, u8 g, u8 b, u8 a) {
|
||||
WGPIPE.c = r;
|
||||
WGPIPE.c = g;
|
||||
WGPIPE.c = b;
|
||||
WGPIPE.c = a;
|
||||
}
|
||||
|
||||
static inline void GXColor1u32(u32 color) { WGPIPE.i = color; }
|
||||
|
||||
static inline void GXColor3u8(u8 r, u8 g, u8 b) {
|
||||
WGPIPE.c = r;
|
||||
WGPIPE.c = g;
|
||||
WGPIPE.c = b;
|
||||
}
|
||||
|
||||
static inline void GXColor1u16(u16 us) { WGPIPE.us = us; }
|
||||
|
||||
static inline void GXColor1x16(u16 us) { WGPIPE.us = us; }
|
||||
|
||||
static inline void GXColor1x8(u8 uc) { WGPIPE.c = uc; }
|
||||
|
||||
static inline void GXTexCoord2f32(f32 x, f32 y) {
|
||||
WGPIPE.f = x;
|
||||
WGPIPE.f = y;
|
||||
}
|
||||
|
||||
static inline void GXTexCoord2s16(s16 x, s16 y) {
|
||||
WGPIPE.s = x;
|
||||
WGPIPE.s = y;
|
||||
}
|
||||
|
||||
static inline void GXTexCoord2u16(u16 x, u16 y) {
|
||||
WGPIPE.us = x;
|
||||
WGPIPE.us = y;
|
||||
}
|
||||
|
||||
static inline void GXTexCoord2s8(s8 x, s8 y) {
|
||||
WGPIPE.c = x;
|
||||
WGPIPE.c = y;
|
||||
}
|
||||
|
||||
static inline void GXTexCoord2u8(u8 x, u8 y) {
|
||||
WGPIPE.c = x;
|
||||
WGPIPE.c = y;
|
||||
}
|
||||
|
||||
static inline void GXTexCoord1f32(f32 f) { WGPIPE.f = f; }
|
||||
|
||||
static inline void GXTexCoord1s16(s16 s) { WGPIPE.s = s; }
|
||||
|
||||
static inline void GXTexCoord1u16(u16 us) { WGPIPE.us = us; }
|
||||
|
||||
static inline void GXTexCoord1s8(s8 c) { WGPIPE.c = c; }
|
||||
|
||||
static inline void GXTexCoord1u8(u8 uc) { WGPIPE.c = uc; }
|
||||
|
||||
static inline void GXTexCoord1x16(u16 us) { WGPIPE.us = us; }
|
||||
|
||||
static inline void GXTexCoord1x8(u8 uc) { WGPIPE.c = uc; }
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef RVL_SDK_PUBLIC_IPC_H
|
||||
#define RVL_SDK_PUBLIC_IPC_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/IPC/ipcMain.h>
|
||||
#include <lib/rvl/IPC/ipcProfile.h>
|
||||
#include <lib/rvl/IPC/ipcclt.h>
|
||||
#include <lib/rvl/IPC/memory.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef RVL_SDK_IPC_MAIN_H
|
||||
#define RVL_SDK_IPC_MAIN_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
u32 IPC_HW_REGS[] : 0xCD000000;
|
||||
|
||||
static inline u32 ACRReadReg(u32 reg) {
|
||||
return *(u32*)((char*)IPC_HW_REGS + (reg & ~0x3));
|
||||
}
|
||||
|
||||
static inline void ACRWriteReg(u32 reg, u32 val) {
|
||||
*(u32*)((char*)IPC_HW_REGS + (reg & ~0x3)) = val;
|
||||
}
|
||||
|
||||
void IPCInit(void);
|
||||
u32 IPCReadReg(s32 index);
|
||||
void IPCWriteReg(s32 index, u32 value);
|
||||
void* IPCGetBufferHi(void);
|
||||
void* IPCGetBufferLo(void);
|
||||
void IPCSetBufferLo(void* lo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef RVL_SDK_IPC_PROFILE_H
|
||||
#define RVL_SDK_IPC_PROFILE_H
|
||||
#include <lib/rvl/IPC/ipcclt.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void IPCiProfInit(void);
|
||||
void IPCiProfQueueReq(IPCRequestEx* req, s32 fd);
|
||||
void IPCiProfAck(void);
|
||||
void IPCiProfReply(IPCRequestEx* req, s32 fd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,155 @@
|
||||
#ifndef RVL_SDK_IPC_CLT_H
|
||||
#define RVL_SDK_IPC_CLT_H
|
||||
#include <lib/rvl/OS.h>
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Documentation from:
|
||||
* https://wiibrew.org/wiki/IOS
|
||||
* https://wiibrew.org/wiki/IOS/Resource_request
|
||||
* http://wiibrew.org/wiki/IPC_(SDK)
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
IPC_RESULT_FATAL_ERROR = -119,
|
||||
IPC_RESULT_BUSY,
|
||||
IPC_RESULT_NOTEMPTY = -115,
|
||||
IPC_RESULT_ECC_CRIT,
|
||||
IPC_RESULT_OPENFD = -111,
|
||||
IPC_RESULT_MAXFD = -109,
|
||||
IPC_RESULT_MAXBLOCKS,
|
||||
IPC_RESULT_MAXFILES,
|
||||
IPC_RESULT_NOEXISTS,
|
||||
IPC_RESULT_EXISTS,
|
||||
IPC_RESULT_CORRUPT = -103,
|
||||
IPC_RESULT_ACCESS,
|
||||
IPC_RESULT_INVALID,
|
||||
|
||||
IPC_RESULT_ALLOC_FAILED = -22,
|
||||
IPC_RESULT_ECC_CRIT_INTERNAL = -12,
|
||||
IPC_RESULT_BUSY_INTERNAL = -8,
|
||||
IPC_RESULT_NOEXISTS_INTERNAL = -6,
|
||||
IPC_RESULT_CONN_MAX_INTERNAL = -5,
|
||||
IPC_RESULT_INVALID_INTERNAL = -4,
|
||||
IPC_RESULT_EXISTS_INTERNAL = -2,
|
||||
IPC_RESULT_ACCESS_INTERNAL = -1,
|
||||
|
||||
IPC_RESULT_OK = 0
|
||||
} IPCResult;
|
||||
|
||||
typedef enum {
|
||||
IPC_REQ_NONE,
|
||||
IPC_REQ_OPEN,
|
||||
IPC_REQ_CLOSE,
|
||||
IPC_REQ_READ,
|
||||
IPC_REQ_WRITE,
|
||||
IPC_REQ_SEEK,
|
||||
IPC_REQ_IOCTL,
|
||||
IPC_REQ_IOCTLV
|
||||
} IPCRequestType;
|
||||
|
||||
typedef enum {
|
||||
IPC_OPEN_NONE = 0,
|
||||
IPC_OPEN_READ = (1 << 0),
|
||||
IPC_OPEN_WRITE = (1 << 1),
|
||||
IPC_OPEN_RW = IPC_OPEN_READ | IPC_OPEN_WRITE
|
||||
} IPCOpenMode;
|
||||
|
||||
typedef enum {
|
||||
IPC_SEEK_BEG,
|
||||
IPC_SEEK_CUR,
|
||||
IPC_SEEK_END,
|
||||
} IPCSeekMode;
|
||||
|
||||
typedef s32 (*IPCAsyncCallback)(s32 result, void* arg);
|
||||
|
||||
typedef struct IPCIOVector {
|
||||
void* base; // at 0x0
|
||||
u32 length; // at 0x4
|
||||
} IPCIOVector;
|
||||
|
||||
typedef struct IPCOpenArgs {
|
||||
const char* path; // at 0x0
|
||||
IPCOpenMode mode; // at 0x4
|
||||
} IPCOpenArgs;
|
||||
|
||||
typedef struct IPCReadWriteArgs {
|
||||
void* data; // at 0x0
|
||||
u32 length; // at 0x4
|
||||
} IPCReadWriteArgs;
|
||||
|
||||
typedef struct IPCSeekArgs {
|
||||
s32 offset; // at 0x0
|
||||
IPCSeekMode mode; // at 0x4
|
||||
} IPCSeekArgs;
|
||||
|
||||
typedef struct IPCIoctlArgs {
|
||||
s32 type; // at 0x0
|
||||
void* in; // at 0x4
|
||||
s32 inSize; // at 0x8
|
||||
void* out; // at 0xC
|
||||
s32 outSize; // at 0x10
|
||||
} IPCIoctlArgs;
|
||||
|
||||
typedef struct IPCIoctlvArgs {
|
||||
s32 type; // at 0x0
|
||||
u32 inCount; // at 0x4
|
||||
u32 outCount; // at 0x8
|
||||
IPCIOVector* vectors; // at 0xC
|
||||
} IPCIoctlvArgs;
|
||||
|
||||
typedef struct IPCRequest {
|
||||
IPCRequestType type; // at 0x0
|
||||
s32 ret; // at 0x4
|
||||
s32 fd; // at 0x8
|
||||
union {
|
||||
IPCOpenArgs open;
|
||||
IPCReadWriteArgs rw;
|
||||
IPCSeekArgs seek;
|
||||
IPCIoctlArgs ioctl;
|
||||
IPCIoctlvArgs ioctlv;
|
||||
}; // at 0xC
|
||||
} IPCRequest;
|
||||
|
||||
typedef struct IPCRequestEx {
|
||||
IPCRequest base; // at 0x0
|
||||
IPCAsyncCallback callback; // at 0x20
|
||||
void* callbackArg; // at 0x24
|
||||
BOOL reboot; // at 0x28
|
||||
OSThreadQueue queue; // at 0x2C
|
||||
char padding[64 - 0x34];
|
||||
} IPCRequestEx;
|
||||
|
||||
s32 IPCCltInit(void);
|
||||
s32 IOS_OpenAsync(const char* path, IPCOpenMode mode, IPCAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 IOS_Open(const char* path, IPCOpenMode mode);
|
||||
s32 IOS_CloseAsync(s32 fd, IPCAsyncCallback callback, void* callbackArg);
|
||||
s32 IOS_Close(s32 fd);
|
||||
s32 IOS_ReadAsync(s32 fd, void* buf, s32 len, IPCAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 IOS_Read(s32 fd, void* buf, s32 len);
|
||||
s32 IOS_WriteAsync(s32 fd, const void* buf, s32 len, IPCAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 IOS_Write(s32 fd, const void* buf, s32 len);
|
||||
s32 IOS_SeekAsync(s32 fd, s32 offset, IPCSeekMode mode,
|
||||
IPCAsyncCallback callback, void* callbackArg);
|
||||
s32 IOS_Seek(s32 fd, s32 offset, IPCSeekMode mode);
|
||||
s32 IOS_IoctlAsync(s32 fd, s32 type, void* in, s32 inSize, void* out,
|
||||
s32 outSize, IPCAsyncCallback callback, void* callbackArg);
|
||||
s32 IOS_Ioctl(s32 fd, s32 type, void* in, s32 inSize, void* out, s32 outSize);
|
||||
s32 IOS_IoctlvAsync(s32 fd, s32 type, s32 inCount, s32 outCount,
|
||||
IPCIOVector* vectors, IPCAsyncCallback callback,
|
||||
void* callbackArg);
|
||||
s32 IOS_Ioctlv(s32 fd, s32 type, s32 inCount, s32 outCount,
|
||||
IPCIOVector* vectors);
|
||||
s32 IOS_IoctlvReboot(s32 fd, s32 type, s32 inCount, s32 outCount,
|
||||
IPCIOVector* vectors);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef RVL_SDK_IPC_MEMORY_H
|
||||
#define RVL_SDK_IPC_MEMORY_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
s32 iosCreateHeap(void*, u32);
|
||||
|
||||
void* iosAllocAligned(s32, u32, s32);
|
||||
s32 iosFree(s32, void*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef RVL_SDK_PUBLIC_MEM_H
|
||||
#define RVL_SDK_PUBLIC_MEM_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <lib/rvl/MEM/mem_allocator.h>
|
||||
#include <lib/rvl/MEM/mem_expHeap.h>
|
||||
#include <lib/rvl/MEM/mem_frameHeap.h>
|
||||
#include <lib/rvl/MEM/mem_heapCommon.h>
|
||||
#include <lib/rvl/MEM/mem_list.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,40 @@
|
||||
#ifndef RVL_SDK_MEM_ALLOCATOR_H
|
||||
#define RVL_SDK_MEM_ALLOCATOR_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Forward declarations
|
||||
typedef struct MEMAllocator;
|
||||
typedef struct MEMiHeapHead;
|
||||
|
||||
typedef void* (*MEMAllocatorAllocFunc)(struct MEMAllocator* allocator,
|
||||
u32 size);
|
||||
typedef void (*MEMAllocatorFreeFunc)(struct MEMAllocator* allocator,
|
||||
void* block);
|
||||
|
||||
typedef struct MEMAllocatorFuncs {
|
||||
MEMAllocatorAllocFunc allocFunc; // at 0x0
|
||||
MEMAllocatorFreeFunc freeFunc; // at 0x4
|
||||
} MEMAllocatorFuncs;
|
||||
|
||||
typedef struct MEMAllocator {
|
||||
const MEMAllocatorFuncs* funcs; // at 0x0
|
||||
struct MEMiHeapHead* heap; // at 0x4
|
||||
u32 heapParam1; // at 0x8
|
||||
u32 heapParam2; // at 0xC
|
||||
} MEMAllocator;
|
||||
|
||||
void* MEMAllocFromAllocator(MEMAllocator* allocator, u32 size);
|
||||
void MEMFreeToAllocator(MEMAllocator* allocator, void* block);
|
||||
|
||||
void MEMInitAllocatorForExpHeap(MEMAllocator* allocator,
|
||||
struct MEMiHeapHead* heap, s32 align);
|
||||
void MEMInitAllocatorForFrmHeap(MEMAllocator* allocator,
|
||||
struct MEMiHeapHead* heap, s32 align);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
#ifndef RVL_SDK_MEM_EXP_HEAP_H
|
||||
#define RVL_SDK_MEM_EXP_HEAP_H
|
||||
#include <lib/rvl/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Forward declarations
|
||||
typedef struct MEMiHeapHead;
|
||||
|
||||
typedef enum {
|
||||
MEM_EXP_HEAP_ALLOC_FAST, //!< When allocating memory blocks, take the first
|
||||
//!< usable found block rather than trying to
|
||||
//!< find a more optimal block
|
||||
} MEMiExpHeapAllocMode;
|
||||
|
||||
typedef struct MEMiExpHeapMBlock {
|
||||
u16 state; // at 0x0
|
||||
union {
|
||||
u16 settings;
|
||||
struct {
|
||||
u16 allocDir : 1;
|
||||
u16 align : 7;
|
||||
u16 group : 8;
|
||||
};
|
||||
}; // at 0x2
|
||||
u32 size; // at 0x4
|
||||
struct MEMiExpHeapMBlock* prev; // at 0x8
|
||||
struct MEMiExpHeapMBlock* next; // at 0xC
|
||||
} MEMiExpHeapMBlock;
|
||||
|
||||
typedef struct MEMiExpHeapMBlockList {
|
||||
MEMiExpHeapMBlock* head; // at 0x0
|
||||
MEMiExpHeapMBlock* tail; // at 0x4
|
||||
} MEMiExpHeapMBlockList;
|
||||
|
||||
// Placed in heap after base heap head
|
||||
typedef struct MEMiExpHeapHead {
|
||||
MEMiExpHeapMBlockList freeMBlocks; // at 0x0
|
||||
MEMiExpHeapMBlockList usedMBlocks; // at 0x8
|
||||
u16 group; // at 0x10
|
||||
union {
|
||||
u16 SHORT_0x12;
|
||||
struct {
|
||||
u16 SHORT_0x12_0_15 : 15;
|
||||
u16 allocMode : 1;
|
||||
};
|
||||
}; // at 0x12
|
||||
} MEMiExpHeapHead;
|
||||
|
||||
struct MEMiHeapHead* MEMCreateExpHeapEx(void* start, u32 size, u16 opt);
|
||||
struct MEMiHeapHead* MEMDestroyExpHeap(struct MEMiHeapHead* heap);
|
||||
void* MEMAllocFromExpHeapEx(struct MEMiHeapHead* heap, u32 size, s32 align);
|
||||
u32 MEMResizeForMBlockExpHeap(struct MEMiHeapHead* heap, void* memBlock,
|
||||
u32 size);
|
||||
void MEMFreeToExpHeap(struct MEMiHeapHead* heap, void* memBlock);
|
||||
u32 MEMGetAllocatableSizeForExpHeapEx(struct MEMiHeapHead* heap, s32 align);
|
||||
u32 MEMAdjustExpHeap(struct MEMiHeapHead* heap);
|
||||
|
||||
static inline struct MEMiHeapHead* MEMCreateExpHeap(void* start, u32 size) {
|
||||
return MEMCreateExpHeapEx(start, size, 0);
|
||||
}
|
||||
|
||||
static inline void* MEMAllocFromExpHeap(struct MEMiHeapHead* heap, u32 size) {
|
||||
return MEMAllocFromExpHeapEx(heap, size, 4);
|
||||
}
|
||||
|
||||
static inline u32 MEMGetAllocatableSizeForExpHeap(struct MEMiHeapHead* heap) {
|
||||
return MEMGetAllocatableSizeForExpHeapEx(heap, 4);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user