From ffb04ddd10545d6702aa077a0f833ef03fce8df5 Mon Sep 17 00:00:00 2001
From: Tyler Wilding
Date: Sat, 12 Feb 2022 17:48:50 -0500
Subject: [PATCH] Documentation cleanup and some feature improvements (#1155)
* ci: switch to codacy for coverage
* docs: update badges
* decomp: allow overriding config flags via CLI
* cleanup: top level file cleanup
* docs: big README overhaul
Attempt to close #1128 and #1086
* decomp: attempt to detect if `iso_data` is missing or wrongly extracted
* game: switch to `fpng` for screenshots, allow for compression
closes #1035
* game: switch vsync control to a checkbox
* lint: format cpp files
* lint: format json files
* docs/scripts: organize taskfile
---
.github/workflows/linux-workflow.yaml | 11 +-
.gitignore | 3 +
.gitmodules | 0
.vs/launch.vs.json | 10 +-
CMakeSettings.json | 40 -
LICENSE.txt => LICENSE | 2 +-
README.md | 171 +-
Taskfile.yml | 67 +-
common/util/FileUtil.cpp | 21 +-
common/util/FileUtil.h | 3 +-
common/util/diff.cpp | 6 +-
common/util/diff.h | 5 +-
decompiler/config.cpp | 12 +-
decompiler/config.h | 4 +-
decompiler/config/jak1_ntsc_black_label.jsonc | 1 +
.../anonymous_function_types.jsonc | 45 +-
.../config/jak1_ntsc_black_label/hacks.jsonc | 130 +-
.../config/jak1_ntsc_black_label/inputs.jsonc | 4 +-
.../jak1_ntsc_black_label/label_types.jsonc | 110 +-
.../stack_structures.jsonc | 1988 +++--------
.../jak1_ntsc_black_label/type_casts.jsonc | 1667 +++------
decompiler/data/tpage.cpp | 10 +-
decompiler/main.cpp | 55 +-
docs/markdown/imgs/windows/release-build.png | Bin 4543 -> 7677 bytes
.../opengl_renderer/OpenGLRenderer.cpp | 8 +-
.../graphics/opengl_renderer/OpenGLRenderer.h | 8 +-
game/graphics/opengl_renderer/debug_gui.cpp | 6 +-
game/graphics/opengl_renderer/debug_gui.h | 22 +-
game/graphics/pipelines/opengl.cpp | 10 +-
game/graphics/texture/TexturePool.cpp | 2 +-
scripts/tasks/Taskfile_darwin.yml | 4 +
scripts/tasks/Taskfile_linux.yml | 4 +
scripts/tasks/Taskfile_windows.yml | 4 +
test/offline/offline_test_main.cpp | 2 +-
third-party/fpng/fpng.cpp | 3118 +++++++++++++++++
third-party/fpng/fpng.h | 109 +
third-party/svpng.h | 103 -
vendor.txt | 3 -
vendor.yaml | 10 +
39 files changed, 4608 insertions(+), 3170 deletions(-)
delete mode 100644 .gitmodules
delete mode 100644 CMakeSettings.json
rename LICENSE.txt => LICENSE (94%)
create mode 100644 scripts/tasks/Taskfile_darwin.yml
create mode 100644 scripts/tasks/Taskfile_linux.yml
create mode 100644 scripts/tasks/Taskfile_windows.yml
create mode 100644 third-party/fpng/fpng.cpp
create mode 100644 third-party/fpng/fpng.h
delete mode 100644 third-party/svpng.h
delete mode 100644 vendor.txt
create mode 100644 vendor.yaml
diff --git a/.github/workflows/linux-workflow.yaml b/.github/workflows/linux-workflow.yaml
index 515204e5e6..e3d3135238 100644
--- a/.github/workflows/linux-workflow.yaml
+++ b/.github/workflows/linux-workflow.yaml
@@ -77,10 +77,11 @@ jobs:
./test_code_coverage.sh
fi
- - name: Coveralls
+ - name: Submit Coverage Report to Codacy
if: ${{ matrix.compiler }} != 'clang'
- uses: coverallsapp/github-action@master
- continue-on-error: true # Sometimes Coveralls has intermittent problems, and codecoverage isn't critical to our success
+ uses: codacy/codacy-coverage-reporter-action@v1
+ continue-on-error: true
with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- path-to-lcov: ./build/goalc-test_coverage.info
+ project-token: ${{ secrets.CODACY_PROJECT_KEY }}
+ # lcov report
+ coverage-reports: ./build/goalc-test_coverage.info
diff --git a/.gitignore b/.gitignore
index 76c0d4785f..54cd7e85fc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,9 @@ build/*
decompiler_out/*
logs/*
+# wsl apparently builds to here?
+linux-default/
+
# for Nix
/result*
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/.vs/launch.vs.json b/.vs/launch.vs.json
index de4992337d..b3adb4c2ef 100644
--- a/.vs/launch.vs.json
+++ b/.vs/launch.vs.json
@@ -67,7 +67,15 @@
"type" : "default",
"project" : "CMakeLists.txt",
"projectTarget" : "goalc.exe (bin\\goalc.exe)",
- "name" : "Run - REPL"
+ "name" : "Run - REPL",
+ "args" : []
+ },
+ {
+ "type" : "default",
+ "project" : "CMakeLists.txt",
+ "projectTarget" : "goalc.exe (bin\\goalc.exe)",
+ "name" : "Run - REPL - Auto Listen",
+ "args" : [ "-auto-lt" ]
},
{
"type" : "default",
diff --git a/CMakeSettings.json b/CMakeSettings.json
deleted file mode 100644
index 4dcf4a6bb9..0000000000
--- a/CMakeSettings.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "configurations": [
- {
- "name": "Debug",
- "generator": "Ninja",
- "configurationType": "Debug",
- "inheritEnvironments": [ "msvc_x64_x64" ],
- "buildRoot": "${projectDir}\\out\\build\\${configurationType}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "addressSanitizerEnabled": false
- },
- {
- "name": "Release",
- "generator": "Ninja",
- "configurationType": "Release",
- "inheritEnvironments": [ "msvc_x64_x64" ],
- "buildRoot": "${projectDir}\\out\\build\\${configurationType}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "addressSanitizerEnabled": false
- },
- {
- "name": "Debug (clang-cl)",
- "generator": "Ninja",
- "configurationType": "Debug",
- "inheritEnvironments": [ "clang_cl_x64_x64" ],
- "buildRoot": "${projectDir}\\out\\build\\${configurationType}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "addressSanitizerEnabled": false
- },
- {
- "name": "Release (clang-cl)",
- "generator": "Ninja",
- "configurationType": "Release",
- "inheritEnvironments": [ "clang_cl_x64_x64" ],
- "buildRoot": "${projectDir}\\out\\build\\${configurationType}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "addressSanitizerEnabled": false
- }
- ]
-}
\ No newline at end of file
diff --git a/LICENSE.txt b/LICENSE
similarity index 94%
rename from LICENSE.txt
rename to LICENSE
index 0e32f29a5a..04b75384c9 100644
--- a/LICENSE.txt
+++ b/LICENSE
@@ -1,6 +1,6 @@
ISC License
-Copyright (c) 2020-2021 water111
+Copyright (c) 2020-2021 OpenGOAL Team
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
diff --git a/README.md b/README.md
index 2fbd0302a3..2b0d408730 100644
--- a/README.md
+++ b/README.md
@@ -3,11 +3,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -20,17 +20,22 @@
- [Project Description](#project-description)
- [Current Status](#current-status)
- [What's Next](#whats-next)
-- [Getting Started - Linux (Ubuntu)](#getting-started---linux-ubuntu)
-- [Getting Started - Linux (Arch)](#getting-started---linux-arch)
-- [Getting Started - Nixpkgs](#getting-started---nixpkgs)
+- [Getting Started - Linux](#getting-started---linux)
+ - [Ubuntu (20.04)](#ubuntu-2004)
+ - [Arch](#arch)
+ - [With Nix](#with-nix)
- [Getting Started - Windows](#getting-started---windows)
+ - [Required Software](#required-software)
+ - [Setting up and Opening the Project](#setting-up-and-opening-the-project)
- [Building and Running the Game](#building-and-running-the-game)
- [Extract Assets](#extract-assets)
- - [Build Game](#build-game)
- - [Run Game](#run-game)
+ - [Build the Game](#build-the-game)
+ - [Run the Game](#run-the-game)
+ - [Connecting the REPL to the Game](#connecting-the-repl-to-the-game)
+ - [Running the Game Without Auto-Booting](#running-the-game-without-auto-booting)
+ - [Interacting with the Game](#interacting-with-the-game)
- [Project Layout](#project-layout)
- [Directory Layout](#directory-layout)
- - [On Windows / Visual Studio](#on-windows--visual-studio)
@@ -53,6 +58,7 @@ We support both Linux and Windows on x86-64.
We have a Discord server where we discuss development. https://discord.gg/V82sTJGEAs
## Current Status
+
So far, we've decompiled around 400,000 lines of GOAL code, out of an estimated 500,000 total lines. We have a working OpenGL renderer which renders most of the game world and foreground. Levels are fully playable, and you can finish the game with 100% completion! There is currently *no* audio.
Here are some screenshots of the renderer:
@@ -73,13 +79,15 @@ We don't save any assets from the game - you must bring your own copy of the gam
- Improve the decompiler. We are always finding new features and macros in the GOAL language.
- Investigate more complicated renderers. We have an in-progress port of the "merc" foreground renderer, shown in the screenshots above.
-## Getting Started - Linux (Ubuntu)
+## Getting Started - Linux
+
+### Ubuntu (20.04)
Install packages and init repository:
```sh
-sudo apt install gcc make cmake build-essential g++ nasm clang-format libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
-git submodule update --init --recursive
+sudo apt install gcc make cmake build-essential g++ nasm clang-format libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev python
+sudo snap install task --classic
```
Compile:
@@ -95,21 +103,23 @@ Run tests:
```
Note: we have found that `clang` and `lld` are significantly faster to compile and link than `gcc`, generate faster code, and have better warning messages. To install these:
+
```sh
sudo apt install lld clang
```
+
and run `cmake` (in a fresh build directory) with:
+
```sh
cmake -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..
```
-## Getting Started - Linux (Arch)
+### Arch
Install packages and init repository:
```sh
-sudo pacman -S gcc make cmake base-devel g++ nasm
-git submodule update --init --recursive
+sudo pacman -S gcc make cmake base-devel g++ nasm taskfile-git python
```
Compile:
@@ -124,7 +134,7 @@ Run tests:
./test.sh
```
-## Getting Started - Nixpkgs
+### With Nix
If your Nix supports flakes:
@@ -146,27 +156,35 @@ nix-build -A packages.x86_64-linux.jak-asan # package with Clang ASan build
## Getting Started - Windows
-If you do not have it already, install Visual Studio 2019 or 2022 and get the `Desktop development with C++` workload during the installation process. If you already have Visual Studio installed and don't have this, open your `Visual Studio Installer` and modify the installation.
+### Required Software
-On Windows, it's recommended to get Scoop to use as a package manager, making the follow steps _much_ easier. Follow the steps on the bottom of the homepage here https://scoop.sh/
+We primarily use Visual Studio for development on Windows for C++ development. Download the community addition from [here](https://visualstudio.microsoft.com/vs/)
-Once Scoop is installed, run the following command:
+You will require the `Desktop development with C++` workload. This can be selected during the installation, or after via the `Visual Studio Installer` and modifying the Visual Studio Installation.
+
+On Windows, it's recommended to get Scoop to use as a package manager, making the following steps _much_ easier. Follow the steps on the bottom of the homepage [here](https://scoop.sh/)
+
+Once Scoop is installed, run the following commands:
```sh
-scoop install git llvm nasm
+scoop install git llvm nasm python
+scoop bucket add extras
+scoop install task
```
-Initialize the repository's third-party dependencies:
+### Setting up and Opening the Project
+
+Clone the repository by running the following command in your folder of choice.
```sh
-git submodule update --init --recursive
+git clone https://github.com/open-goal/jak-project.git
```
-Open the project as a CMake project.
+This will create a `jak-project` folder, we will open the project as a CMake project via Visual Studio.

-Then build the entire project as "Release". You can also press Ctrl+Shift+B as a hotkey for Build All.
+Then build the entire project as `Windows Release (clang-cl)`. You can also press Ctrl+Shift+B as a hotkey for Build All. We currently prefer `clang-cl` on Windows as opposed to `msvc`, though it should work as well!


@@ -174,25 +192,94 @@ Then build the entire project as "Release". You can also press Ctrl+Shift+B as a
## Building and Running the Game
Getting a running game involves 4 steps:
-1. Build C++ tools (follow steps above)
-2. Extract assets from game
-3. Build game
-4. Run game
+
+1. Build C++ tools (follow Getting Started steps above for your platform)
+2. Extract assets from the game
+3. Build the game
+4. Run the game
### Extract Assets
-Running the decompiler on the entire game is slow and not needed, so it is recommended to just run it on data. Edit `decompiler/config/jak1-ntsc_black_label.jsonc` and disable `decompile_code`.
-```json
- "decompile_code": false, // change this to false, don't decompile code
+
+The first step is to extract your ISO file contents into the `iso_data/` folder. In the case of jak this is `iso_data/jak1`.
+
+Once this is done, open a terminal in the `jak-project` folder and run the following:
+
+```sh
+task extract-jak1
```
-Place a copy of the game's files in `iso_data/jak1/`, then run the decompiler with the `scripts/shell/decomp.sh` (Linux) or `scripts/batch/decomp-jak1.bat` (Windows) script.
+### Build the Game
-### Build Game
-Run the OpenGOAL compiler `out/build/goalc/goalc` (keep in mind that the build directories may vary by system, on Windows the equivalent is similar to `out/build/Release/bin/goalc`), or use one of the `gc` scripts. Enter `(mi)` to build the `"iso"` target, which contains everything we have placed in the build system so far.
+The next step is to build the game itself. To do so, in the same terminal run the following:
-### Run Game
-In a separate terminal, start the runtime with `out/build/game/gk -boot -fakeiso -debug`, or instead run the `gk-display.bat` script (Windows). The game should boot up automatically! If you want to connect the REPL to the live game and use it for inspecting code or changing things around, rhen, in the OpenGOAL compiler window (REPL), run `(mi)` to create the data for the game and give the REPL information for running code and `(lt)` to connect. If you want to start the runtime but not boot up the game, remove the `-boot` argument or run the regular `gk.bat` script, and after connecting to the runtime from the REPL, run `(lg)` to load the game engine and `(test-play)` to start it. Assuming it all works right, it will look something like this:
+```sh
+task repl
```
+
+You will be greeted with a prompt like so:
+
+```sh
+ _____ _____ _____ _____ __
+| |___ ___ ___| __| | _ | |
+| | | . | -_| | | | | | | |__
+|_____| _|___|_|_|_____|_____|__|__|_____|
+ |_|
+Welcome to OpenGOAL 0.8!
+Run (repl-help) for help with common commands and REPL usage.
+Run (lt) to connect to the local target.
+
+g >
+```
+
+Run the following to build the game:
+
+```sh
+g > (mi)
+```
+
+### Run the Game
+
+Finally the game can be ran. Open a second terminal from the `jak-project` directly and run the following:
+
+```sh
+task boot-game
+```
+
+The game should boot automatically if everything was done correctly.
+
+#### Connecting the REPL to the Game
+
+Connecting the REPL to the game allows you to inspect and modify code or data while the game is running.
+
+To do so, in the REPL after a successful `(mi)`, run the following:
+
+```sh
+g > (lt)
+```
+
+If successfuly your prompt should change to:
+
+```sh
+gc>
+```
+
+For example, running the following will print out some basic information about Jak:
+
+```sh
+gc> *target*
+```
+
+#### Running the Game Without Auto-Booting
+
+You can also start up the game without booting. To do so run the following in one terminal
+
+```sh
+task run-game
+```
+
+And then in your REPL run the following (after a successful `(mi)`):
+
+```sh
g > (lt)
[Listener] Socket connected established! (took 0 tries). Waiting for version...
Got version 0.8 OK!
@@ -207,11 +294,15 @@ gc> (test-play)
gc>
```
+
+### Interacting with the Game
+
In the graphics window, you can use the period key to bring up the debug menu. Controllers also work, using the same mapping as the original game.
Check out the `pc_debug`, `examples` and `engine/pc/` folders under `goal_src` for some examples of GOAL code we wrote. The debug files have instructions for how to run them if they are not loaded automatically by the engine.
## Project Layout
+
There are four main components to the project.
The first is `goalc`, which is a GOAL compiler for x86-64. Our implementation of GOAL is called OpenGOAL. All of the compiler source code is in `goalc`. To run the compiler on Linux, there is a script `gc.sh`. On Windows, there is a `gc.bat` scripts and a `gc-no-lt.bat` script, the latter of which will not attempt to automatically attach to a running target. The compiler is controlled through a prompt which can be used to enter commands to compile, connect to a running GOAL program for interaction, run the OpenGOAL debugger, or, if you are connected to a running GOAL program, can be used as a REPL to run code interactively. In addition to compiling code files, the compiler has features to pack and build data files.
@@ -304,7 +395,3 @@ The final component is the "runtime", located in `game`. This is the part of the
- `json`: A JSON library.
- `replxx`: Used for the REPL input. Supports history and useful editing shortcuts.
- `svpng`: Save a PNG file.
-
-### On Windows / Visual Studio
-
-Until 16.9 Preview 4, when attaching a debugger to the ASan build, you must disable breaking on Win32 Access Violation exceptions. See the relevant section `Debugging - Exceptions` here https://devblogs.microsoft.com/cppblog/asan-for-windows-x64-and-debug-build-support/#known-issues
diff --git a/Taskfile.yml b/Taskfile.yml
index 3cdc16cf84..67b70b55a9 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -1,35 +1,43 @@
version: '3'
-vars:
- # make this OS agnostic eventually
- RELEASE_PATH: './out/build/Release/bin'
+includes:
+ build: ./scripts/tasks/Taskfile_{{OS}}.yml
tasks:
+ # GENERAL
+ extract-jak1:
+ cmds:
+ - '{{.RELEASE_PATH}}/decompiler "./decompiler/config/jak1_ntsc_black_label.jsonc" "./iso_data" "./decompiler_out" "decompile_code=false"'
+ boot-game:
+ cmds:
+ - "{{.RELEASE_PATH}}/gk -boot -fakeiso -debug -v"
+ run-game:
+ cmds:
+ - "{{.RELEASE_PATH}}/gk -fakeiso -debug -v"
+ repl:
+ env:
+ OPENGOAL_DECOMP_DIR: "jak1/"
+ cmds:
+ - "{{.RELEASE_PATH}}/goalc"
+ # DEVELOPMENT
format:
cmds:
- cmd: python ./third-party/run-clang-format/run-clang-format.py -r common decompiler game goalc test -i
# npm install -g prettier
- cmd: prettier --write ./decompiler/config/jak1_ntsc_black_label/*.jsonc
ignore_error: true
- run-game:
- cmds:
- - "{{.RELEASE_PATH}}/gk.exe -fakeiso -debug -v"
run-game-headless:
cmds:
- - "{{.RELEASE_PATH}}/gk.exe -fakeiso -debug -nodisplay"
- repl:
- env:
- OPENGOAL_DECOMP_DIR: "jak1/"
- cmds:
- - "{{.RELEASE_PATH}}/goalc.exe"
+ - "{{.RELEASE_PATH}}/gk -fakeiso -debug -nodisplay"
repl-lt:
env:
OPENGOAL_DECOMP_DIR: "jak1/"
cmds:
- - "{{.RELEASE_PATH}}/goalc.exe -auto-lt"
+ - "{{.RELEASE_PATH}}/goalc -auto-lt"
+ # DECOMPILING
decomp:
cmds:
- - '{{.RELEASE_PATH}}/decompiler.exe "./decompiler/config/jak1_ntsc_black_label.jsonc" "./iso_data" "./decompiler_out"'
+ - '{{.RELEASE_PATH}}/decompiler "./decompiler/config/jak1_ntsc_black_label.jsonc" "./iso_data" "./decompiler_out"'
decomp-clean:
cmds:
- rm ./decompiler_out/**/*.asm
@@ -47,20 +55,10 @@ tasks:
decomp-watch:
cmds:
- watchmedo shell-command --drop --patterns="*.gc;*.jsonc" --recursive --command='task decomp-file FILES="{{.FILES}}"' ./decompiler/config/
- clean-all-types:
- cmds:
- - python ./scripts/cleanup-all-types.py
- analyze-ee-memory:
- cmds:
- - '{{.RELEASE_PATH}}/memory_dump_tool.exe "{{.FILE}}" ./ > ee-analysis.log'
- watch-pcsx2:
- cmds:
- - watchmedo shell-command --drop --patterns="*.p2s" --recursive --command='task analyze-ee-memory FILE="${watch_src_path}"' "{{.SAVESTATE_DIR}}"
- vars:
- SAVESTATE_DIR: '{{default "." .SAVESTATE_DIR}}'
+ # TESTS
offline-tests:
cmds:
- - '{{.RELEASE_PATH}}/offline-test.exe "./iso_data/jak1"'
+ - '{{.RELEASE_PATH}}/offline-test "./iso_data/jak1"'
add-reference-test:
cmds:
- task: decomp-file
@@ -73,7 +71,7 @@ tasks:
update-reference-tests:
cmds:
- cmd: python ./scripts/default-file-or-folder.py --path failures
- - cmd: '{{.RELEASE_PATH}}/offline-test.exe "./iso_data/jak1" --dump-mode'
+ - cmd: '{{.RELEASE_PATH}}/offline-test "./iso_data/jak1" --dump-mode'
ignore_error: true
- python ./scripts/update_decomp_reference.py ./failures ./test/decompiler/reference/
- task: offline-tests
@@ -84,11 +82,20 @@ tasks:
- python ./scripts/find-label-types.py --file "{{.FILES}}"
type-test:
cmds:
- - cmd: '{{.RELEASE_PATH}}/goalc-test.exe --gtest_brief=0 --gtest_filter="*MANUAL_TEST_TypeConsistencyWithBuildFirst*"'
+ - cmd: '{{.RELEASE_PATH}}/goalc-test --gtest_brief=0 --gtest_filter="*MANUAL_TEST_TypeConsistencyWithBuildFirst*"'
ignore_error: true
check-gsrc-file:
cmds:
- python ./scripts/check-gsrc-file.py --files "{{.FILES}}"
+ # TOOLS
+ analyze-ee-memory:
+ cmds:
+ - '{{.RELEASE_PATH}}/memory_dump_tool "{{.FILE}}" ./ > ee-analysis.log'
+ watch-pcsx2:
+ cmds:
+ - watchmedo shell-command --drop --patterns="*.p2s" --recursive --command='task analyze-ee-memory FILE="${watch_src_path}"' "{{.SAVESTATE_DIR}}"
+ vars:
+ SAVESTATE_DIR: '{{default "." .SAVESTATE_DIR}}'
update-gsrc:
cmds:
- python ./scripts/next-decomp-file.py --files "{{.FILES}}"
@@ -100,3 +107,7 @@ tasks:
cast-repl:
cmds:
- cmd: python ./scripts/cast-repl.py
+ # Doesn't Currently Work
+ # clean-all-types:
+ # cmds:
+ # - python ./scripts/cleanup-all-types.py
diff --git a/common/util/FileUtil.cpp b/common/util/FileUtil.cpp
index 98cadbc16c..c9067de7c8 100644
--- a/common/util/FileUtil.cpp
+++ b/common/util/FileUtil.cpp
@@ -13,7 +13,8 @@
#include "common/util/BinaryReader.h"
#include "BinaryWriter.h"
#include "common/common_types.h"
-#include "third-party/svpng.h"
+#include "third-party/fpng/fpng.cpp"
+#include "third-party/fpng/fpng.h"
#include "third-party/fmt/core.h"
#include "third-party/lzokay/lzokay.hpp"
@@ -99,15 +100,17 @@ void write_binary_file(const std::string& name, const void* data, size_t size) {
fclose(fp);
}
-void write_rgba_png(const std::string& name, void* data, int w, int h) {
- FILE* fp = fopen(name.c_str(), "wb");
- if (!fp) {
- throw std::runtime_error("couldn't open file " + name);
+void write_rgba_png(const std::string& name, void* data, int w, int h, bool compress) {
+ auto flags = 0;
+ if (!compress) {
+ flags = fpng::FPNG_FORCE_UNCOMPRESSED;
}
- svpng(fp, w, h, (const unsigned char*)data, 1);
+ auto ok = fpng::fpng_encode_image_to_file(name.c_str(), data, w, h, 4, flags);
- fclose(fp);
+ if (!ok) {
+ throw std::runtime_error("couldn't save png file " + name);
+ }
}
void write_text_file(const std::string& file_name, const std::string& text) {
@@ -174,6 +177,10 @@ std::string combine_path(const std::string& parent, const std::string& child) {
return parent + "/" + child;
}
+bool file_exists(const std::string& path) {
+ return std::filesystem::exists(path);
+}
+
std::string base_name(const std::string& filename) {
size_t pos = 0;
ASSERT(!filename.empty());
diff --git a/common/util/FileUtil.h b/common/util/FileUtil.h
index 9455c6d854..6395e368fd 100644
--- a/common/util/FileUtil.h
+++ b/common/util/FileUtil.h
@@ -18,12 +18,13 @@ std::string get_project_path();
std::string get_file_path(const std::vector& input);
bool create_dir_if_needed(const std::string& path);
void write_binary_file(const std::string& name, const void* data, size_t size);
-void write_rgba_png(const std::string& name, void* data, int w, int h);
+void write_rgba_png(const std::string& name, void* data, int w, int h, bool compress);
void write_text_file(const std::string& file_name, const std::string& text);
std::vector read_binary_file(const std::string& filename);
std::string read_text_file(const std::string& path);
bool is_printable_char(char c);
std::string combine_path(const std::string& parent, const std::string& child);
+bool file_exists(const std::string& path);
std::string base_name(const std::string& filename);
void init_crc();
uint32_t crc32(const uint8_t* data, size_t size);
diff --git a/common/util/diff.cpp b/common/util/diff.cpp
index ee5d87e709..62f8733448 100644
--- a/common/util/diff.cpp
+++ b/common/util/diff.cpp
@@ -305,4 +305,8 @@ std::string diff_strings(const std::string& lhs, const std::string& rhs) {
}
}
return "";
-}
\ No newline at end of file
+}
+
+std::vector split_string(const ::std::string& str, char delimiter) {
+ return SplitString(str, delimiter);
+}
diff --git a/common/util/diff.h b/common/util/diff.h
index b9da9a85f9..8dac5a4875 100644
--- a/common/util/diff.h
+++ b/common/util/diff.h
@@ -1,8 +1,11 @@
#pragma once
#include
+#include
/*!
* Diff two strings. This uses the code from gtest's diff implementation.
*/
-std::string diff_strings(const std::string& lhs, const std::string& rhs);
\ No newline at end of file
+std::string diff_strings(const std::string& lhs, const std::string& rhs);
+
+std::vector split_string(const ::std::string& str, char delimiter = '\n');
diff --git a/decompiler/config.cpp b/decompiler/config.cpp
index 01bf6cdedc..7001926a96 100644
--- a/decompiler/config.cpp
+++ b/decompiler/config.cpp
@@ -22,14 +22,24 @@ nlohmann::json read_json_file_from_config(const nlohmann::json& cfg, const std::
/*!
* Parse the main config file and return decompiler config.
*/
-Config read_config_file(const std::string& path_to_config_file) {
+Config read_config_file(const std::string& path_to_config_file,
+ const std::map& overrides) {
Config config;
auto config_str = file_util::read_text_file(path_to_config_file);
auto cfg = parse_commented_json(config_str, path_to_config_file);
+ // Override JSON
+ for (auto const& [key, val] : overrides) {
+ fmt::print("[Config] - Overwriting '{}' with '{}'\n", key, val);
+ cfg[key] = val;
+ }
+
config.game_version = cfg.at("game_version").get();
config.text_version = cfg.at("text_version").get();
config.game_name = cfg.at("game_name").get();
+ if (cfg.contains("expected_elf_name")) {
+ config.expected_elf_name = cfg.at("expected_elf_name").get();
+ }
auto inputs_json = read_json_file_from_config(cfg, "inputs_file");
config.dgo_names = inputs_json.at("dgo_names").get>();
diff --git a/decompiler/config.h b/decompiler/config.h
index c17012de70..2ca494b48b 100644
--- a/decompiler/config.h
+++ b/decompiler/config.h
@@ -112,6 +112,7 @@ struct Config {
bool is_pal = false;
std::string game_name;
+ std::string expected_elf_name;
GameTextVersion text_version = GameTextVersion::JAK1_V1;
std::unordered_set allowed_objects;
@@ -138,6 +139,7 @@ struct Config {
DecompileHacks hacks;
};
-Config read_config_file(const std::string& path_to_config_file);
+Config read_config_file(const std::string& path_to_config_file,
+ const std::map& overrides);
} // namespace decompiler
diff --git a/decompiler/config/jak1_ntsc_black_label.jsonc b/decompiler/config/jak1_ntsc_black_label.jsonc
index 9d69a27120..b7ee43f008 100644
--- a/decompiler/config/jak1_ntsc_black_label.jsonc
+++ b/decompiler/config/jak1_ntsc_black_label.jsonc
@@ -2,6 +2,7 @@
"game_version": 1,
"text_version": 10,
"game_name": "jak1",
+ "expected_elf_name": "SCUS_971.24",
// if you want to filter to only some object names.
// it will make the decompiler much faster.
diff --git a/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc b/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc
index 544c060ef3..37a7c62d53 100644
--- a/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc
+++ b/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc
@@ -808,32 +808,27 @@
[46, "(function float :behavior manipy)"]
],
- "beach-obs": [
- [8, "(function none :behavior camera-tracker)"]
- ],
+ "beach-obs": [[8, "(function none :behavior camera-tracker)"]],
- "jungleb-obs": [
- [4, "(function none :behavior camera-tracker)"]
- ],
+ "jungleb-obs": [[4, "(function none :behavior camera-tracker)"]],
"village2-obs": [
[4, "(function sparticle-launch-control :behavior ogreboss-village2)"]
],
- "generic-obs": [
- [5, "(function symbol :behavior touch-tracker)"]
- ],
+ "generic-obs": [[5, "(function symbol :behavior touch-tracker)"]],
- "plant-boss": [
- [22, "(function none :behavior camera-tracker)"]
- ],
+ "plant-boss": [[22, "(function none :behavior camera-tracker)"]],
"pelican": [
[1, "(function sparticle-launch-control :behavior pelican)"],
[5, "(function pelican int)"],
[6, "(function int)"],
[10, "(function int)"],
- [15, "(function process int symbol event-message-block object :behavior pelican)"],
+ [
+ 15,
+ "(function process int symbol event-message-block object :behavior pelican)"
+ ],
[16, "(function none :behavior pelican)"],
[24, "(function pelican int)"],
[25, "(function int)"],
@@ -852,9 +847,7 @@
[69, "(function part-tracker vector)"]
],
- "collide-edge-grab": [
- [0, "(function surface object object int float)"]
- ],
+ "collide-edge-grab": [[0, "(function surface object object int float)"]],
"target": [
[1, "(function none :behavior target)"],
@@ -862,13 +855,9 @@
[16, "(function target float)"]
],
- "water": [
- [13, "(function water-vol object)"]
- ],
+ "water": [[13, "(function water-vol object)"]],
- "rolling-lightning-mole": [
- [38, "(function none :behavior lightning-mole)"]
- ],
+ "rolling-lightning-mole": [[38, "(function none :behavior lightning-mole)"]],
"target-flut": [
[23, "(function nav-enemy none :behavior target)"],
@@ -890,22 +879,16 @@
[99, "(function symbol)"]
],
- "swamp-blimp": [
- [29, "(function int none)"]
- ],
+ "swamp-blimp": [[29, "(function int none)"]],
"jungle-mirrors": [
[14, "(function string none)"],
[32, "(function entity-actor (pointer symbol) object)"] // passed to `actor-link-info` function
],
- "voicebox": [
- [1, "(function none :behavior voicebox)"]
- ],
+ "voicebox": [[1, "(function none :behavior voicebox)"]],
- "seagull": [
- [30, "(function process symbol)"]
- ],
+ "seagull": [[30, "(function process symbol)"]],
"placeholder-do-not-add-below": []
}
diff --git a/decompiler/config/jak1_ntsc_black_label/hacks.jsonc b/decompiler/config/jak1_ntsc_black_label/hacks.jsonc
index 7a48eab9aa..1967b5062b 100644
--- a/decompiler/config/jak1_ntsc_black_label/hacks.jsonc
+++ b/decompiler/config/jak1_ntsc_black_label/hacks.jsonc
@@ -232,14 +232,7 @@
"collide-probe-node", // CFG
// collide-edge-grab
- // CFG
- // CFG
"(method 15 collide-edge-work)", // CFG
- // CFG
- // CFG
- // CFG
- // CFG
-
"(method 12 collide-mesh)",
@@ -250,29 +243,14 @@
// ambient
"ambient-inspect",
- // target BUG
- //"target-falling-anim-trans", // CFG resolution
-
// target2 BUG
"look-for-points-of-interest", // Failed to split nested sc - looks like dead code to me
// collide-cache
"(method 10 collide-puss-work)", // CFG
"(method 9 collide-puss-work)", // decompiler crash
- // decompiler crash
-
- // CFG
- // CFG
- // CFG
- // "(method 14 collide-cache)", // CFG
- // CFG
- // "(method 26 collide-cache)", // CFG
- //"(method 21 collide-cache)", // CFG
"(method 32 collide-cache)", // CFG
- // memory-usage BUG
- //"(method 14 level)",
-
// ocean
"draw-large-polygon-ocean", // CFG
@@ -449,50 +427,57 @@
"draw-bones": [0, 1, 2, 8, 81],
"draw-bones-hud": [7, 8],
"(method 16 drawable-tree)": [7, 9, 10],
- "(method 21 collide-cache)" : [3, 5, 19, 20,24,25,28,29],
- "(method 14 collide-cache)" : [0, 1,2, 3, 4, 5],
- "(method 9 collide-mesh-cache)" : [0, 1, 2, 5],
- "(method 42 collide-shape)" : [0, 1, 2, 3, 4, 7],
- "(method 23 collide-shape-prim-group)" : [1, 2, 3, 4, 5],
- "(method 23 collide-shape-prim-mesh)" : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
- "(method 23 collide-shape-prim-sphere)" : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
- "(method 18 collide-shape-prim-sphere)" : [1, 3,4, 5, 7],
- "(method 45 collide-shape)" : [0, 16, 42, 67, 92],
- "(method 24 collide-shape-prim)" : [2, 3, 4, 5, 1],
- "(method 20 collide-shape-prim-group)" : [11],
- "(method 28 collide-shape-prim-mesh)" : [10],
- "(method 40 collide-shape)": [0, 2,5,6,7, 11,12, 28, 43, 58, 63],
- "(method 15 collide-shape-prim-group)" : [1, 2, 3, 4, 5, 6],
- "(method 16 collide-shape-prim)" : [1, 2, 3, 4, 5, 6],
- "(method 15 collide-shape-prim-sphere)" : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
- "(method 15 collide-shape-prim-mesh)" : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 29],
- "(method 35 collide-shape)" : [1],
- "(method 22 collide-cache)":[2, 3, 4, 13, 14, 15, 23, 24, 25, 33, 34, 35],
- "(method 12 collide-shape-prim-sphere)" : [0, 1],
- "(method 12 collide-shape-prim-group)" : [1, 2, 3, 4],
- "(method 24 collide-cache)" : [2, 3, 4, 13, 14, 15, 23, 24, 25, 33, 34, 35],
- "(method 14 collide-shape-prim-sphere)" : [0, 1, 2, 3],
- "(method 14 collide-shape-prim-group)" : [0, 1, 2, 3, 4],
- "(method 23 collide-cache)" : [2, 3, 4, 13, 14, 15, 23, 24, 25, 33, 34, 35],
- "(method 13 collide-shape-prim-sphere)" : [0, 1, 2],
- "(method 13 collide-shape-prim-group)" : [0, 1, 2,3,4],
- "(method 19 collide-cache)" : [0, 1, 3, 4, 5, 18, 19],
- "(method 10 collide-mesh)" : [1, 2, 4, 5],
- "target-falling-anim-trans" : [5, 6],
- "(method 19 process-drawable)" : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
- "(anon-function 9 racer)" : [75],
- "(method 13 collide-edge-work)" : [0, 2],
- "(method 17 collide-edge-work)" : [0, 1, 2, 3, 4],
- "(method 9 edge-grab-info)" : [15, 16, 18, 19, 21, 22, 24],
-// "(method 18 collide-edge-work)" : [1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24],
- "target-falling-anim-trans" : [5, 6],
- "(method 27 nav-mesh)" : [8],
+ "(method 21 collide-cache)": [3, 5, 19, 20, 24, 25, 28, 29],
+ "(method 14 collide-cache)": [0, 1, 2, 3, 4, 5],
+ "(method 9 collide-mesh-cache)": [0, 1, 2, 5],
+ "(method 42 collide-shape)": [0, 1, 2, 3, 4, 7],
+ "(method 23 collide-shape-prim-group)": [1, 2, 3, 4, 5],
+ "(method 23 collide-shape-prim-mesh)": [
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
+ ],
+ "(method 23 collide-shape-prim-sphere)": [
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
+ ],
+ "(method 18 collide-shape-prim-sphere)": [1, 3, 4, 5, 7],
+ "(method 45 collide-shape)": [0, 16, 42, 67, 92],
+ "(method 24 collide-shape-prim)": [2, 3, 4, 5, 1],
+ "(method 20 collide-shape-prim-group)": [11],
+ "(method 28 collide-shape-prim-mesh)": [10],
+ "(method 40 collide-shape)": [0, 2, 5, 6, 7, 11, 12, 28, 43, 58, 63],
+ "(method 15 collide-shape-prim-group)": [1, 2, 3, 4, 5, 6],
+ "(method 16 collide-shape-prim)": [1, 2, 3, 4, 5, 6],
+ "(method 15 collide-shape-prim-sphere)": [
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
+ ],
+ "(method 15 collide-shape-prim-mesh)": [
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 29
+ ],
+ "(method 35 collide-shape)": [1],
+ "(method 22 collide-cache)": [2, 3, 4, 13, 14, 15, 23, 24, 25, 33, 34, 35],
+ "(method 12 collide-shape-prim-sphere)": [0, 1],
+ "(method 12 collide-shape-prim-group)": [1, 2, 3, 4],
+ "(method 24 collide-cache)": [2, 3, 4, 13, 14, 15, 23, 24, 25, 33, 34, 35],
+ "(method 14 collide-shape-prim-sphere)": [0, 1, 2, 3],
+ "(method 14 collide-shape-prim-group)": [0, 1, 2, 3, 4],
+ "(method 23 collide-cache)": [2, 3, 4, 13, 14, 15, 23, 24, 25, 33, 34, 35],
+ "(method 13 collide-shape-prim-sphere)": [0, 1, 2],
+ "(method 13 collide-shape-prim-group)": [0, 1, 2, 3, 4],
+ "(method 19 collide-cache)": [0, 1, 3, 4, 5, 18, 19],
+ "(method 10 collide-mesh)": [1, 2, 4, 5],
+ "(method 19 process-drawable)": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
+ "(anon-function 9 racer)": [75],
+ "(method 13 collide-edge-work)": [0, 2],
+ "(method 17 collide-edge-work)": [0, 1, 2, 3, 4],
+ "(method 9 edge-grab-info)": [15, 16, 18, 19, 21, 22, 24],
+ // "(method 18 collide-edge-work)" : [1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24],
+ "target-falling-anim-trans": [5, 6],
+ "(method 27 nav-mesh)": [8],
"(method 32 nav-control)": [12, 21, 32],
"start-collect-nav": [0],
"end-collect-nav": [0],
"robotboss-always-trans": [9, 10, 11, 12, 13, 14, 15, 18, 29, 36, 45, 48],
- "target-flut-falling-anim-trans" : [5, 6],
- "(method 27 ropebridge)" : [5, 7],
+ "target-flut-falling-anim-trans": [5, 6],
+ "(method 27 ropebridge)": [5, 7],
"(anon-function 5 orbit-plat)": [4, 5, 11],
"(anon-function 21 plant-boss)": [0, 1, 3, 4],
"(method 55 ram-boss)": [5],
@@ -586,16 +571,23 @@
],
"mips2c_jump_table_functions": {
- "decompress-fixed-data-to-accumulator" : [108, 199, 233, 286, 301, 366, 387, 100, 155, 199, 261, 286, 335, 366, 402, 100],
- "decompress-frame-data-to-accumulator" : [84, 92, 119, 140, 205, 220, 273, 307, 84, 107, 119, 174, 205, 248, 273, 354],
- "decompress-frame-data-pair-to-accumulator" : [117, 125, 169, 197, 293, 318, 408, 459, 117, 150, 169, 248, 293, 366, 408, 533]
+ "decompress-fixed-data-to-accumulator": [
+ 108, 199, 233, 286, 301, 366, 387, 100, 155, 199, 261, 286, 335, 366, 402,
+ 100
+ ],
+ "decompress-frame-data-to-accumulator": [
+ 84, 92, 119, 140, 205, 220, 273, 307, 84, 107, 119, 174, 205, 248, 273,
+ 354
+ ],
+ "decompress-frame-data-pair-to-accumulator": [
+ 117, 125, 169, 197, 293, 318, 408, 459, 117, 150, 169, 248, 293, 366, 408,
+ 533
+ ]
},
// there are some missing textures. I don't know what the game actually does here.
// the format for entries is [level, tpage, index]
- "missing_textures": [
- ["finalboss", 1419, 3]
- ],
+ "missing_textures": [["finalboss", 1419, 3]],
// some object files have garbage pad data at the end which makes the decompiler
// assume they must be different files, such as the art group for orb-cache-top.
@@ -631,5 +623,3 @@
"plat-ag"
]
}
-
-
diff --git a/decompiler/config/jak1_ntsc_black_label/inputs.jsonc b/decompiler/config/jak1_ntsc_black_label/inputs.jsonc
index a42b8980da..957a623564 100644
--- a/decompiler/config/jak1_ntsc_black_label/inputs.jsonc
+++ b/decompiler/config/jak1_ntsc_black_label/inputs.jsonc
@@ -263,8 +263,8 @@
"audio_dir_file_name": "",
"streamed_audio_file_names": ["VAGWAD.ENG", "VAGWAD.JAP"],
-
- "levels_to_extract":[
+
+ "levels_to_extract": [
"BEA.DGO",
"CIT.DGO",
"DAR.DGO",
diff --git a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc
index fb345acd7e..c57e6d3c05 100644
--- a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc
+++ b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc
@@ -954,9 +954,7 @@
["L314", "float", true]
],
- "seagull": [
- ["L226", "(inline-array air-box)", 10]
- ],
+ "seagull": [["L226", "(inline-array air-box)", 10]],
"rolling-race-ring": [
["L94", "vector"],
@@ -1172,21 +1170,13 @@
["L101", "attack-info"]
],
- "citadel-obs": [
- ["L265", "attack-info"]
- ],
+ "citadel-obs": [["L265", "attack-info"]],
- "jungleb-obs": [
- ["L34", "vector"]
- ],
+ "jungleb-obs": [["L34", "vector"]],
- "jungle-obs": [
- ["L164", "attack-info"]
- ],
+ "jungle-obs": [["L164", "attack-info"]],
- "misty-obs": [
- ["L135", "rigid-body-platform-constants"]
- ],
+ "misty-obs": [["L135", "rigid-body-platform-constants"]],
"village2-obs": [
["L274", "rigid-body-platform-constants"],
@@ -1230,9 +1220,7 @@
["L257", "vector"]
],
- "firecanyon-obs": [
- ["L57", "attack-info"]
- ],
+ "firecanyon-obs": [["L57", "attack-info"]],
"ogre-obs": [
["L141", "rigid-body-platform-constants"],
@@ -1240,9 +1228,7 @@
["L156", "attack-info"]
],
- "snow-obs": [
- ["L201", "vector"]
- ],
+ "snow-obs": [["L201", "vector"]],
"lavatube-obs": [
["L162", "attack-info"],
@@ -1448,13 +1434,9 @@
["L128", "attack-info"]
],
- "billy": [
- ["L234", "vector"]
- ],
+ "billy": [["L234", "vector"]],
- "lurkerworm": [
- ["L56", "attack-info"]
- ],
+ "lurkerworm": [["L56", "attack-info"]],
"pelican": [
["L199", "vector"],
@@ -1473,13 +1455,9 @@
["L14", "attack-info"]
],
- "steam-cap": [
- ["L51", "attack-info"]
- ],
+ "steam-cap": [["L51", "attack-info"]],
- "sidekick": [
- ["L29", "vector"]
- ],
+ "sidekick": [["L29", "vector"]],
"target": [
["L720", "float", true],
@@ -1603,9 +1581,7 @@
["L150", "attack-info"]
],
- "racer": [
- ["L106", "vector"]
- ],
+ "racer": [["L106", "vector"]],
"target-racer-FIC-LAV-MIS-OGR-ROL": [
["L237", "attack-info"],
@@ -1977,13 +1953,9 @@
["L303", "vector4w"]
],
- "load-boundary-data": [
- ["L2", "(array array)"]
- ],
+ "load-boundary-data": [["L2", "(array array)"]],
- "tfrag-near": [
- ["L1", "vu-function"]
- ],
+ "tfrag-near": [["L1", "vu-function"]],
"snow-ram-boss": [
["L220", "attack-info"],
@@ -1993,13 +1965,9 @@
["L225", "attack-info"]
],
- "snow-ram": [
- ["L73", "attack-info"]
- ],
+ "snow-ram": [["L73", "attack-info"]],
- "snow-bumper": [
- ["L54", "attack-info"]
- ],
+ "snow-bumper": [["L54", "attack-info"]],
"snow-ball": [
["L86", "(pointer float)", 8],
@@ -2007,22 +1975,16 @@
["L89", "attack-info"]
],
- "puffer": [
- ["L170", "attack-info"]
- ],
+ "puffer": [["L170", "attack-info"]],
"driller-lurker": [
["L174", "attack-info"],
["L175", "attack-info"]
],
- "dark-crystal": [
- ["L36", "attack-info"]
- ],
+ "dark-crystal": [["L36", "attack-info"]],
- "kermit": [
- ["L164", "attack-info"]
- ],
+ "kermit": [["L164", "attack-info"]],
"swamp-blimp": [
["L177", "vector"],
@@ -2035,22 +1997,16 @@
["L209", "tetherrock-info"]
],
- "mistycannon": [
- ["L199", "attack-info"]
- ],
+ "mistycannon": [["L199", "attack-info"]],
- "darkvine": [
- ["L41", "attack-info"]
- ],
+ "darkvine": [["L41", "attack-info"]],
"jungle-mirrors": [
["L325", "vector"],
["L326", "vector4w-4"]
],
- "quicksandlurker": [
- ["L111", "attack-info"]
- ],
+ "quicksandlurker": [["L111", "attack-info"]],
"voicebox": [
["L47", "vector"],
@@ -2080,21 +2036,13 @@
["L162", "vu-function"]
],
- "tie": [
- ["L43", "vu-function"]
- ],
+ "tie": [["L43", "vu-function"]],
- "tie-near": [
- ["L91", "vu-function"]
- ],
-
- "sequence-a-village1": [
- ["L38", "vector"]
- ],
+ "tie-near": [["L91", "vu-function"]],
- "depth-cue": [
- ["L17", "depth-cue-work"]
- ],
+ "sequence-a-village1": [["L38", "vector"]],
+
+ "depth-cue": [["L17", "depth-cue-work"]],
"navigate": [
["L402", "vector"],
@@ -2117,9 +2065,7 @@
["L523", "float", true] // TODO - meters
],
- "snow-bunny": [
- ["L190", "attack-info"]
- ],
+ "snow-bunny": [["L190", "attack-info"]],
// please do not add things after this entry! git is dumb.
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": []
diff --git a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc
index 8b2e465569..2b8e02b82f 100644
--- a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc
+++ b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc
@@ -1812,29 +1812,17 @@
"ambient-type-sound": [[32, "sound-spec"]],
"ambient-type-sound-loop": [[16, "sound-spec"]],
- "(trans windmill-one-idle)": [
- [16, "vector"]
- ],
+ "(trans windmill-one-idle)": [[16, "vector"]],
- "move-grottopole-to-position": [
- [16, "vector"]
- ],
+ "move-grottopole-to-position": [[16, "vector"]],
- "flying-rock-init-by-other": [
- [16, "vector"]
- ],
+ "flying-rock-init-by-other": [[16, "vector"]],
- "(event flutflutegg-idle)": [
- [16, "vector"]
- ],
+ "(event flutflutegg-idle)": [[16, "vector"]],
- "(trans flutflutegg-idle)": [
- [16, "vector"]
- ],
+ "(trans flutflutegg-idle)": [[16, "vector"]],
- "(event flutflutegg-physics)": [
- [16, "vector"]
- ],
+ "(event flutflutegg-physics)": [[16, "vector"]],
"(code flutflutegg-physics-fall)": [
[16, "vector"],
@@ -1863,13 +1851,9 @@
[112, "vector"]
],
- "beachcam-spawn": [
- [16, "event-message-block"]
- ],
+ "beachcam-spawn": [[16, "event-message-block"]],
- "(anon-function 8 beach-obs)": [
- [16, "event-message-block"]
- ],
+ "(anon-function 8 beach-obs)": [[16, "event-message-block"]],
"(code target-warp-in)": [
[16, "vector"],
@@ -1886,21 +1870,13 @@
[32, "font-context"]
],
- "(code active warp-gate)": [
- [16, "font-context"]
- ],
+ "(code active warp-gate)": [[16, "font-context"]],
- "(event basebutton-up-idle warp-gate-switch)": [
- [16, "event-message-block"]
- ],
+ "(event basebutton-up-idle warp-gate-switch)": [[16, "event-message-block"]],
- "(method 31 warp-gate-switch)": [
- [16, "event-message-block"]
- ],
+ "(method 31 warp-gate-switch)": [[16, "event-message-block"]],
- "(trans basebutton-up-idle warp-gate-switch)": [
- [16, "event-message-block"]
- ],
+ "(trans basebutton-up-idle warp-gate-switch)": [[16, "event-message-block"]],
"(event basebutton-down-idle warp-gate-switch)": [
[16, "event-message-block"]
@@ -1915,89 +1891,49 @@
[32, "vector"]
],
- "(event citb-disc-idle)": [
- [16, "event-message-block"]
- ],
+ "(event citb-disc-idle)": [[16, "event-message-block"]],
- "(post plat-path-active citb-launcher)": [
- [16, "event-message-block"]
- ],
+ "(post plat-path-active citb-launcher)": [[16, "event-message-block"]],
- "(event citb-robotboss-idle)": [
- [16, "event-message-block"]
- ],
+ "(event citb-robotboss-idle)": [[16, "event-message-block"]],
- "(code citb-robotboss-idle)": [
- [16, "event-message-block"]
- ],
+ "(code citb-robotboss-idle)": [[16, "event-message-block"]],
- "citb-generator-trigger-others": [
- [16, "event-message-block"]
- ],
+ "citb-generator-trigger-others": [[16, "event-message-block"]],
- "(code citb-generator-break)": [
- [16, "event-message-block"]
- ],
+ "(code citb-generator-break)": [[16, "event-message-block"]],
- "(code citadelcam-stair-plats)": [
- [16, "event-message-block"]
- ],
+ "(code citadelcam-stair-plats)": [[16, "event-message-block"]],
"(code battlecontroller-play-intro-camera citb-battlecontroller)": [
[16, "event-message-block"]
],
- "(trans cavecrystal-active)": [
- [16, "vector"]
- ],
+ "(trans cavecrystal-active)": [[16, "vector"]],
- "(method 11 eggtop)": [
- [16, "vector"]
- ],
+ "(method 11 eggtop)": [[16, "vector"]],
- "(anon-function 4 jungleb-obs)": [
- [16, "event-message-block"]
- ],
+ "(anon-function 4 jungleb-obs)": [[16, "event-message-block"]],
- "(event idle logtrap)": [
- [16, "event-message-block"]
- ],
+ "(event idle logtrap)": [[16, "event-message-block"]],
- "(code pov-camera-playing precurbridgecam)": [
- [16, "event-message-block"]
- ],
+ "(code pov-camera-playing precurbridgecam)": [[16, "event-message-block"]],
- "(code precurbridge-idle)": [
- [16, "event-message-block"]
- ],
+ "(code precurbridge-idle)": [[16, "event-message-block"]],
- "(code maindoor-closed)": [
- [16, "event-message-block"]
- ],
+ "(code maindoor-closed)": [[16, "event-message-block"]],
- "(method 11 maindoor)": [
- [16, "event-message-block"]
- ],
+ "(method 11 maindoor)": [[16, "event-message-block"]],
- "(code lurkerm-piston-idle)": [
- [16, "vector"]
- ],
+ "(code lurkerm-piston-idle)": [[16, "vector"]],
- "starfish-spawn-child": [
- [16, "vector"]
- ],
+ "starfish-spawn-child": [[16, "vector"]],
- "(method 27 bone-platform)": [
- [16, "vector"]
- ],
+ "(method 27 bone-platform)": [[16, "vector"]],
- "(event breakaway-idle)": [
- [16, "event-message-block"]
- ],
+ "(event breakaway-idle)": [[16, "event-message-block"]],
- "mistycam-spawn": [
- [16, "event-message-block"]
- ],
+ "mistycam-spawn": [[16, "event-message-block"]],
"mis-bone-bridge-event-handler": [
[16, "vector"],
@@ -2021,13 +1957,9 @@
[96, "vector"]
],
- "fireboulder-hover-stuff": [
- [16, "vector"]
- ],
+ "fireboulder-hover-stuff": [[16, "vector"]],
- "(enter fireboulder-hover)": [
- [16, "vector"]
- ],
+ "(enter fireboulder-hover)": [[16, "vector"]],
"boulder1-trans": [
[16, "vector"],
@@ -2079,189 +2011,107 @@
[32, "event-message-block"]
],
- "(code ogreboss-village2-throw)": [
- [16, "event-message-block"]
- ],
+ "(code ogreboss-village2-throw)": [[16, "event-message-block"]],
- "swamp-spike-default-event-handler": [
- [16, "event-message-block"]
- ],
+ "swamp-spike-default-event-handler": [[16, "event-message-block"]],
- "swamp-spike-post": [
- [16, "event-message-block"]
- ],
+ "swamp-spike-post": [[16, "event-message-block"]],
- "(code balance-plat-idle)": [
- [16, "event-message-block"]
- ],
+ "(code balance-plat-idle)": [[16, "event-message-block"]],
"(code swamp-spike-idle)": [
[16, "vector"],
[32, "vector"]
],
- "(code pov-camera-playing maincavecam)": [
- [16, "event-message-block"]
- ],
+ "(code pov-camera-playing maincavecam)": [[16, "event-message-block"]],
- "(event idle cavetrapdoor)": [
- [16, "event-message-block"]
- ],
+ "(event idle cavetrapdoor)": [[16, "event-message-block"]],
- "cavecrystal-light-control-caveelevator-callback": [
- [16, "vector"]
- ],
+ "cavecrystal-light-control-caveelevator-callback": [[16, "vector"]],
- "(method 21 caveelevator)": [
- [16, "vector"]
- ],
+ "(method 21 caveelevator)": [[16, "vector"]],
- "(method 20 caveelevator)": [
- [16, "vector"]
- ],
+ "(method 20 caveelevator)": [[16, "vector"]],
- "caveelevator-joint-callback": [
- [16, "vector"]
- ],
+ "caveelevator-joint-callback": [[16, "vector"]],
"(event caveflamepots-active)": [
[16, "attack-info"],
[128, "event-message-block"]
],
- "(code pov-camera-playing sunkencam)": [
- [16, "event-message-block"]
- ],
+ "(code pov-camera-playing sunkencam)": [[16, "event-message-block"]],
- "dark-plant-check-target": [
- [16, "event-message-block"]
- ],
+ "dark-plant-check-target": [[16, "event-message-block"]],
- "(code dark-plant-idle)": [
- [16, "event-message-block"]
- ],
+ "(code dark-plant-idle)": [[16, "event-message-block"]],
- "(code gorge-abort-idle)": [
- [16, "event-message-block"]
- ],
+ "(code gorge-abort-idle)": [[16, "event-message-block"]],
- "(code gorge-finish-idle)": [
- [16, "event-message-block"]
- ],
+ "(code gorge-finish-idle)": [[16, "event-message-block"]],
- "(code gorge-start-race-finished)": [
- [16, "event-message-block"]
- ],
+ "(code gorge-start-race-finished)": [[16, "event-message-block"]],
"(code gorge-start-race-aborted)": [
[16, "event-message-block"],
[96, "font-context"]
],
- "(enter gorge-start-racing)": [
- [16, "event-message-block"]
- ],
+ "(enter gorge-start-racing)": [[16, "event-message-block"]],
- "(exit gorge-start-racing)": [
- [16, "event-message-block"]
- ],
+ "(exit gorge-start-racing)": [[16, "event-message-block"]],
- "(code gorge-start-ready)": [
- [16, "event-message-block"]
- ],
+ "(code gorge-start-ready)": [[16, "event-message-block"]],
"(code happy-plant-opening)": [
[16, "event-message-block"],
[96, "vector"]
],
- "(code pusher-idle)": [
- [16, "vector"]
- ],
+ "(code pusher-idle)": [[16, "vector"]],
- "(method 11 gorge-start)": [
- [16, "vector"]
- ],
+ "(method 11 gorge-start)": [[16, "vector"]],
- "(method 11 happy-plant)": [
- [16, "vector"]
- ],
+ "(method 11 happy-plant)": [[16, "vector"]],
- "rolling-start-init-by-other": [
- [16, "matrix"]
- ],
+ "rolling-start-init-by-other": [[16, "matrix"]],
- "dark-plant-randomize": [
- [16, "vector"]
- ],
+ "dark-plant-randomize": [[16, "vector"]],
- "gorge-init": [
- [16, "vector"]
- ],
+ "gorge-init": [[16, "vector"]],
- "gorge-start-launch-start-banner": [
- [16, "vector"]
- ],
+ "gorge-start-launch-start-banner": [[16, "vector"]],
- "gorge-behind": [
- [16, "vector"]
- ],
+ "gorge-behind": [[16, "vector"]],
- "gorge-in-front": [
- [16, "vector"]
- ],
+ "gorge-in-front": [[16, "vector"]],
- "race-time-read": [
- [16, "race-time"]
- ],
+ "race-time-read": [[16, "race-time"]],
- "gorge-start-draw-time": [
- [16, "font-context"]
- ],
+ "gorge-start-draw-time": [[16, "font-context"]],
- "(event balloon-idle)": [
- [16, "event-message-block"]
- ],
+ "(event balloon-idle)": [[16, "event-message-block"]],
- "(trans spike-up)": [
- [16, "event-message-block"]
- ],
+ "(trans spike-up)": [[16, "event-message-block"]],
- "(trans spike-down)": [
- [16, "event-message-block"]
- ],
+ "(trans spike-down)": [[16, "event-message-block"]],
- "(trans spike-idle)": [
- [16, "event-message-block"]
- ],
+ "(trans spike-idle)": [[16, "event-message-block"]],
- "(event idle crate-darkeco-cluster)": [
- [16, "event-message-block"]
- ],
+ "(event idle crate-darkeco-cluster)": [[16, "event-message-block"]],
- "(event idle tntbarrel)": [
- [16, "event-message-block"]
- ],
+ "(event idle tntbarrel)": [[16, "event-message-block"]],
- "(trans ogre-bridge-idle)": [
- [16, "event-message-block"]
- ],
+ "(trans ogre-bridge-idle)": [[16, "event-message-block"]],
- "(code ogre-bridge-activate)": [
- [16, "event-message-block"]
- ],
+ "(code ogre-bridge-activate)": [[16, "event-message-block"]],
- "(event ogre-bridge-break)": [
- [16, "vector"]
- ],
+ "(event ogre-bridge-break)": [[16, "vector"]],
- "(code ride-up gondola)": [
- [16, "event-message-block"]
- ],
+ "(code ride-up gondola)": [[16, "event-message-block"]],
- "(code ride-down gondola)": [
- [16, "event-message-block"]
- ],
+ "(code ride-down gondola)": [[16, "event-message-block"]],
"(code idle gondola)": [
[16, "vector"],
@@ -2270,41 +2120,23 @@
[128, "font-context"]
],
- "(code pov-camera-playing snowcam)": [
- [16, "event-message-block"]
- ],
+ "(code pov-camera-playing snowcam)": [[16, "event-message-block"]],
- "(code snow-eggtop-activate)": [
- [16, "event-message-block"]
- ],
+ "(code snow-eggtop-activate)": [[16, "event-message-block"]],
- "(event snowpusher-idle)": [
- [16, "event-message-block"]
- ],
+ "(event snowpusher-idle)": [[16, "event-message-block"]],
- "(code snow-log-wait-for-master)": [
- [16, "event-message-block"]
- ],
+ "(code snow-log-wait-for-master)": [[16, "event-message-block"]],
- "(code snow-log-button-activate)": [
- [16, "event-message-block"]
- ],
+ "(code snow-log-button-activate)": [[16, "event-message-block"]],
- "(method 11 snow-eggtop)": [
- [16, "vector"]
- ],
+ "(method 11 snow-eggtop)": [[16, "vector"]],
- "(method 20 snow-gears)": [
- [16, "vector"]
- ],
+ "(method 20 snow-gears)": [[16, "vector"]],
- "(code snow-switch-activate)": [
- [16, "vector"]
- ],
+ "(code snow-switch-activate)": [[16, "vector"]],
- "(method 11 snow-switch)": [
- [16, "vector"]
- ],
+ "(method 11 snow-switch)": [[16, "vector"]],
"(code snow-fort-gate-activate)": [
[16, "vector"],
@@ -2313,17 +2145,11 @@
[64, "vector"]
],
- "(code snow-spatula-idle)": [
- [16, "matrix"]
- ],
+ "(code snow-spatula-idle)": [[16, "matrix"]],
- "(enter snow-button-activate)": [
- [16, "event-message-block"]
- ],
+ "(enter snow-button-activate)": [[16, "event-message-block"]],
- "(code plat-startup flutflut-plat)": [
- [16, "event-message-block"]
- ],
+ "(code plat-startup flutflut-plat)": [[16, "event-message-block"]],
"(enter flutflut-plat-appear)": [
[16, "vector"],
@@ -2343,46 +2169,28 @@
[176, "vector"]
],
- "(code darkecobarrel-mover-die)": [
- [16, "vector"]
- ],
+ "(code darkecobarrel-mover-die)": [[16, "vector"]],
- "(code die chainmine)": [
- [16, "vector"]
- ],
+ "(code die chainmine)": [[16, "vector"]],
- "(event idle chainmine)": [
- [16, "event-message-block"]
- ],
+ "(event idle chainmine)": [[16, "event-message-block"]],
- "(event idle lavaballoon)": [
- [16, "event-message-block"]
- ],
+ "(event idle lavaballoon)": [[16, "event-message-block"]],
"(event darkecobarrel-mover-move)": [
[16, "event-message-block"],
[96, "vector"]
],
- "(code startup logo)": [
- [16, "event-message-block"]
- ],
+ "(code startup logo)": [[16, "event-message-block"]],
- "(code ndi logo)": [
- [16, "event-message-block"]
- ],
+ "(code ndi logo)": [[16, "event-message-block"]],
- "(enter target-title)": [
- [16, "event-message-block"]
- ],
+ "(enter target-title)": [[16, "event-message-block"]],
- "(trans target-title-wait)": [
- [16, "font-context"]
- ],
+ "(trans target-title-wait)": [[16, "font-context"]],
- "(code target-title)": [
- [16, "mc-slot-info"]
- ],
+ "(code target-title)": [[16, "mc-slot-info"]],
"(post startup logo)": [
[16, "vector"],
@@ -3217,61 +3025,39 @@
[224, "vector"]
],
- "lb-flip":[
- [16, "load-boundary-crossing-command"]
- ],
+ "lb-flip": [[16, "load-boundary-crossing-command"]],
- "---lb-save":[
- [16, "file-stream"]
- ],
+ "---lb-save": [[16, "file-stream"]],
- "edit-load-boundaries":[
+ "edit-load-boundaries": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"]
],
- "triangulate-boundary":[
- [16, "lbvtx"]
- ],
+ "triangulate-boundary": [[16, "lbvtx"]],
- "fix-boundary-normals":[
- [16, "vector"]
- ],
+ "fix-boundary-normals": [[16, "vector"]],
- "check-closed-boundary":[
- [16, "vector"]
- ],
+ "check-closed-boundary": [[16, "vector"]],
- "(event target-racing-start)": [
- [16, "event-message-block"]
- ],
+ "(event target-racing-start)": [[16, "event-message-block"]],
- "(exit target-racing-start)": [
- [16, "event-message-block"]
- ],
+ "(exit target-racing-start)": [[16, "event-message-block"]],
- "(code target-racing-start)": [
- [16, "event-message-block"]
- ],
+ "(code target-racing-start)": [[16, "event-message-block"]],
"target-racing-smack-check": [
[16, "vector"],
[32, "vector"]
],
- "(trans target-racing)": [
- [16, "vector"]
- ],
+ "(trans target-racing)": [[16, "vector"]],
- "(trans target-racing-jump)": [
- [16, "vector"]
- ],
+ "(trans target-racing-jump)": [[16, "vector"]],
- "(trans target-racing-bounce)": [
- [16, "vector"]
- ],
+ "(trans target-racing-bounce)": [[16, "vector"]],
"(code target-racing-hit)": [
[16, "vector"],
@@ -3281,9 +3067,7 @@
[80, "vector"]
],
- "(exit target-racing-death)": [
- [16, "event-message-block"]
- ],
+ "(exit target-racing-death)": [[16, "event-message-block"]],
"(anon-function 17 racer-states-FIC-LAV-MIS-OGR-ROL)": [
[16, "joint-exploder-tuning"]
@@ -3301,9 +3085,7 @@
[48, "event-message-block"]
],
- "(post target-racing-get-on)": [
- [16, "vector"]
- ],
+ "(post target-racing-get-on)": [[16, "vector"]],
"(code target-racing-get-off-jump)": [
[16, "vector"],
@@ -3311,17 +3093,11 @@
[48, "event-message-block"]
],
- "(post target-racing-get-off-jump)": [
- [16, "vector"]
- ],
+ "(post target-racing-get-off-jump)": [[16, "vector"]],
- "(exit target-racing-clone-anim)": [
- [16, "event-message-block"]
- ],
+ "(exit target-racing-clone-anim)": [[16, "event-message-block"]],
- "(code target-racing-clone-anim)": [
- [16, "event-message-block"]
- ],
+ "(code target-racing-clone-anim)": [[16, "event-message-block"]],
"(method 9 joint-control)": [[16, "vector"]],
"process-drawable-birth-fuel-cell": [[16, "vector"]],
@@ -3343,9 +3119,7 @@
[32, "vector"]
],
- "target-powerup-effect": [
- [16, "vector"]
- ],
+ "target-powerup-effect": [[16, "vector"]],
"target-powerup-process": [
[16, "vector"],
@@ -3371,9 +3145,7 @@
[32, "vector"]
],
- "update-ocean": [
- [16, "vector"]
- ],
+ "update-ocean": [[16, "vector"]],
"(method 20 cavegeyserrock)": [
[16, "vector"],
@@ -3397,17 +3169,11 @@
[48, "vector"]
],
- "(method 11 cavegeyserrock)": [
- [48, "vector"]
- ],
+ "(method 11 cavegeyserrock)": [[48, "vector"]],
- "cavecrystal-light-control-cavegeyserrock-callback": [
- [16, "vector"]
- ],
+ "cavecrystal-light-control-cavegeyserrock-callback": [[16, "vector"]],
- "junglesnake-default-event-handler": [
- [16, "event-message-block"]
- ],
+ "junglesnake-default-event-handler": [[16, "event-message-block"]],
"junglesnake-joint-callback": [
[16, "matrix"],
@@ -3423,25 +3189,15 @@
[368, "matrix"]
],
- "add-a-bunch": [
- [16, "vector"]
- ],
+ "add-a-bunch": [[16, "vector"]],
- "(event idle scarecrow-a)": [
- [16, "vector"]
- ],
+ "(event idle scarecrow-a)": [[16, "vector"]],
- "(method 11 touching-prims-entry)": [
- [16, "vector"]
- ],
+ "(method 11 touching-prims-entry)": [[16, "vector"]],
- "(code hit scarecrow-a)": [
- [16, "joint-exploder-tuning"]
- ],
+ "(code hit scarecrow-a)": [[16, "joint-exploder-tuning"]],
- "(code hit scarecrow-b)": [
- [16, "joint-exploder-tuning"]
- ],
+ "(code hit scarecrow-b)": [[16, "joint-exploder-tuning"]],
"(trans orb-cache-top-idle)": [[16, "event-message-block"]],
"(code orb-cache-top-activate)": [
@@ -3459,29 +3215,17 @@
[32, "vector"]
],
- "part-tracker-notify": [
- [16, "event-message-block"]
- ],
+ "part-tracker-notify": [[16, "event-message-block"]],
- "process-grab?": [
- [16, "event-message-block"]
- ],
+ "process-grab?": [[16, "event-message-block"]],
- "process-release?": [
- [16, "event-message-block"]
- ],
+ "process-release?": [[16, "event-message-block"]],
- "camera-change-to": [
- [16, "event-message-block"]
- ],
+ "camera-change-to": [[16, "event-message-block"]],
- "camera-look-at": [
- [16, "event-message-block"]
- ],
+ "camera-look-at": [[16, "event-message-block"]],
- "ja-anim-done?": [
- [16, "event-message-block"]
- ],
+ "ja-anim-done?": [[16, "event-message-block"]],
"draw-eco-beam": [
[16, "vector"],
@@ -3495,9 +3239,7 @@
[32, "vector"]
],
- "(anon-function 7 generic-obs)": [
- [16, "event-message-block"]
- ],
+ "(anon-function 7 generic-obs)": [[16, "event-message-block"]],
"(anon-function 11 generic-obs)": [
[16, "event-message-block"] // trans
@@ -3511,25 +3253,27 @@
[16, "event-message-block"] // trans
],
- "(anon-function 16 generic-obs)": [ // code
+ "(anon-function 16 generic-obs)": [
+ // code
[16, "vector"],
[32, "vector"],
[48, "event-message-block"]
],
- "(anon-function 18 generic-obs)": [ // enter
+ "(anon-function 18 generic-obs)": [
+ // enter
[16, "vector"]
],
- "cam-launcher-long-joystick": [
- [16, "matrix"]
- ],
+ "cam-launcher-long-joystick": [[16, "matrix"]],
- "(anon-function 21 generic-obs)": [ // code
+ "(anon-function 21 generic-obs)": [
+ // code
[16, "event-message-block"]
],
- "(anon-function 23 generic-obs)": [ // enter
+ "(anon-function 23 generic-obs)": [
+ // enter
[16, "vector"]
],
@@ -3542,83 +3286,49 @@
[16, "vector"] // code
],
- "(code swingpole-stance)": [
- [16, "event-message-block"]
- ],
+ "(code swingpole-stance)": [[16, "event-message-block"]],
- "camera-anim": [
- [16, "event-message-block"]
- ],
+ "camera-anim": [[16, "event-message-block"]],
- "camera-pov-from": [
- [16, "event-message-block"]
- ],
+ "camera-pov-from": [[16, "event-message-block"]],
"(method 14 camera-tracker)": [
[16, "event-message-block"],
[96, "event-message-block"]
],
- "(anon-function 33 generic-obs)": [
- [16, "event-message-block"]
- ],
+ "(anon-function 33 generic-obs)": [[16, "event-message-block"]],
"(trans manipy-idle)": [
[16, "vector"],
[32, "vector"]
],
- "(anon-function 34 generic-obs)": [
- [16, "event-message-block"]
- ],
+ "(anon-function 34 generic-obs)": [[16, "event-message-block"]],
- "(exit camera-tracker-process)": [
- [16, "event-message-block"]
- ],
+ "(exit camera-tracker-process)": [[16, "event-message-block"]],
- "(code camera-tracker-process)": [
- [16, "event-message-block"]
- ],
+ "(code camera-tracker-process)": [[16, "event-message-block"]],
- "(code cam-launcher-shortfall)": [
- [16, "event-message-block"]
- ],
+ "(code cam-launcher-shortfall)": [[16, "event-message-block"]],
- "(trans launcher-idle)": [
- [16, "event-message-block"]
- ],
+ "(trans launcher-idle)": [[16, "event-message-block"]],
- "(event launcher-active)": [
- [16, "event-message-block"]
- ],
+ "(event launcher-active)": [[16, "event-message-block"]],
- "(event touch-tracker-idle)": [
- [16, "event-message-block"]
- ],
+ "(event touch-tracker-idle)": [[16, "event-message-block"]],
- "(trans launcher-active)": [
- [16, "event-message-block"]
- ],
+ "(trans launcher-active)": [[16, "event-message-block"]],
- "(code touch-tracker-idle)": [
- [16, "touching-shapes-entry"]
- ],
+ "(code touch-tracker-idle)": [[16, "touching-shapes-entry"]],
- "(event manipy-idle)": [
- [16, "matrix"]
- ],
+ "(event manipy-idle)": [[16, "matrix"]],
- "(code med-res-level-idle)": [
- [16, "vector"]
- ],
+ "(code med-res-level-idle)": [[16, "vector"]],
- "(enter cam-launcher-longfall)": [
- [16, "vector"]
- ],
+ "(enter cam-launcher-longfall)": [[16, "vector"]],
- "(enter cam-launcher-shortfall)": [
- [16, "vector"]
- ],
+ "(enter cam-launcher-shortfall)": [[16, "vector"]],
"(code cam-launcher-longfall)": [
[16, "vector"],
@@ -3626,45 +3336,25 @@
[48, "event-message-block"]
],
- "plant-boss-default-event-handler": [
- [16, "event-message-block"]
- ],
+ "plant-boss-default-event-handler": [[16, "event-message-block"]],
- "(event plant-boss-vulnerable)": [
- [16, "event-message-block"]
- ],
+ "(event plant-boss-vulnerable)": [[16, "event-message-block"]],
- "(code plant-boss-hit)": [
- [16, "event-message-block"]
- ],
+ "(code plant-boss-hit)": [[16, "event-message-block"]],
- "(code plant-boss-dead)": [
- [16, "event-message-block"]
- ],
+ "(code plant-boss-dead)": [[16, "event-message-block"]],
- "(event plant-boss-attack)": [
- [16, "event-message-block"]
- ],
+ "(event plant-boss-attack)": [[16, "event-message-block"]],
- "(code plant-boss-eat)": [
- [16, "event-message-block"]
- ],
+ "(code plant-boss-eat)": [[16, "event-message-block"]],
- "(anon-function 22 plant-boss)": [
- [16, "event-message-block"]
- ],
+ "(anon-function 22 plant-boss)": [[16, "event-message-block"]],
- "(code plant-boss-vulnerable)": [
- [16, "event-message-block"]
- ],
+ "(code plant-boss-vulnerable)": [[16, "event-message-block"]],
- "(exit plant-boss-vulnerable)": [
- [16, "event-message-block"]
- ],
+ "(exit plant-boss-vulnerable)": [[16, "event-message-block"]],
- "(event plant-boss-back-arms-idle)": [
- [16, "event-message-block"]
- ],
+ "(event plant-boss-back-arms-idle)": [[16, "event-message-block"]],
"(method 11 plant-boss)": [
[16, "vector"],
@@ -3681,33 +3371,19 @@
[192, "vector"]
],
- "(method 60 ice-cube)": [
- [16, "vector"]
- ],
+ "(method 60 ice-cube)": [[16, "vector"]],
- "(method 52 ice-cube)": [
- [16, "vector"]
- ],
+ "(method 52 ice-cube)": [[16, "vector"]],
- "(trans ice-cube-appear)": [
- [16, "vector"]
- ],
+ "(trans ice-cube-appear)": [[16, "vector"]],
- "(code ice-cube-appear-land)": [
- [16, "vector"]
- ],
+ "(code ice-cube-appear-land)": [[16, "vector"]],
- "(code ice-cube-face-player)": [
- [16, "vector"]
- ],
+ "(code ice-cube-face-player)": [[16, "vector"]],
- "(code ice-cube-mean-turn-to-charge)": [
- [16, "vector"]
- ],
+ "(code ice-cube-mean-turn-to-charge)": [[16, "vector"]],
- "(method 54 ice-cube)": [
- [16, "vector"]
- ],
+ "(method 54 ice-cube)": [[16, "vector"]],
"(code ice-cube-shatter)": [
[16, "vector"],
@@ -3735,17 +3411,11 @@
[32, "collide-tri-result"]
],
- "(event double-lurker-top-knocked-down)": [
- [16, "event-message-block"]
- ],
+ "(event double-lurker-top-knocked-down)": [[16, "event-message-block"]],
- "(code double-lurker-top-knocked-down)": [
- [16, "vector"]
- ],
+ "(code double-lurker-top-knocked-down)": [[16, "vector"]],
- "(method 48 double-lurker)": [
- [16, "vector"]
- ],
+ "(method 48 double-lurker)": [[16, "vector"]],
"(method 52 double-lurker)": [
[16, "vector"],
@@ -3773,66 +3443,38 @@
[64, "clip-travel-vector-to-mesh-return-info"]
],
- "(code nav-enemy-die billy-rat)": [
- [16, "event-message-block"]
- ],
+ "(code nav-enemy-die billy-rat)": [[16, "event-message-block"]],
- "(code billy-rat-eat)": [
- [16, "event-message-block"]
- ],
+ "(code billy-rat-eat)": [[16, "event-message-block"]],
- "(code billy-rat-salivate)": [
- [16, "event-message-block"]
- ],
+ "(code billy-rat-salivate)": [[16, "event-message-block"]],
- "(enter nav-enemy-victory billy-rat)": [
- [16, "event-message-block"]
- ],
+ "(enter nav-enemy-victory billy-rat)": [[16, "event-message-block"]],
- "(enter billy-done)": [
- [16, "event-message-block"]
- ],
+ "(enter billy-done)": [[16, "event-message-block"]],
- "(exit billy-done)": [
- [16, "event-message-block"]
- ],
+ "(exit billy-done)": [[16, "event-message-block"]],
- "(trans enter-playing billy)": [
- [16, "event-message-block"]
- ],
+ "(trans enter-playing billy)": [[16, "event-message-block"]],
- "(method 11 billy)": [
- [16, "event-message-block"]
- ],
+ "(method 11 billy)": [[16, "event-message-block"]],
- "(method 32 billy)": [
- [16, "vector"]
- ],
+ "(method 32 billy)": [[16, "vector"]],
- "billy-rat-init-by-other": [
- [16, "vector"]
- ],
+ "billy-rat-init-by-other": [[16, "vector"]],
- "(method 43 billy)": [
- [16, "vector"]
- ],
+ "(method 43 billy)": [[16, "vector"]],
- "(enter billy-playing)": [
- [16, "vector"]
- ],
+ "(enter billy-playing)": [[16, "vector"]],
"billy-game-update": [
[16, "vector"],
[32, "vector"]
],
- "(method 20 lurkerworm)": [
- [16, "vector"]
- ],
+ "(method 20 lurkerworm)": [[16, "vector"]],
- "lurkerworm-prebind-function": [
- [16, "quaternion"]
- ],
+ "lurkerworm-prebind-function": [[16, "quaternion"]],
"(method 21 lurkerworm)": [
[16, "vector"],
@@ -3841,34 +3483,22 @@
[64, "vector"]
],
- "lurkerworm-default-event-handler": [
- [16, "event-message-block"]
- ],
+ "lurkerworm-default-event-handler": [[16, "event-message-block"]],
- "(method 11 pelican)": [
- [16, "event-message-block"]
- ],
+ "(method 11 pelican)": [[16, "event-message-block"]],
"(code pelican-explode)": [
[16, "vector"],
[32, "event-message-block"]
],
- "(event pelican-circle)": [
- [16, "vector"]
- ],
+ "(event pelican-circle)": [[16, "vector"]],
- "pelican-path-update": [
- [16, "vector"]
- ],
+ "pelican-path-update": [[16, "vector"]],
- "(trans pelican-wait-at-nest)": [
- [16, "vector"]
- ],
+ "(trans pelican-wait-at-nest)": [[16, "vector"]],
- "(enter pelican-fly-to-end)": [
- [16, "vector"]
- ],
+ "(enter pelican-fly-to-end)": [[16, "vector"]],
"(code pelican-spit)": [
[16, "quaternion"],
@@ -3876,55 +3506,35 @@
[112, "vector"]
],
- "(enter pelican-circle)": [
- [16, "event-message-block"]
- ],
+ "(enter pelican-circle)": [[16, "event-message-block"]],
- "(code pelican-wait-at-nest)": [
- [16, "event-message-block"]
- ],
+ "(code pelican-wait-at-nest)": [[16, "event-message-block"]],
"(event pelican-wait-at-nest)": [
[16, "event-message-block"],
[96, "vector"]
],
- "(code pelican-dive)": [
- [16, "event-message-block"]
- ],
+ "(code pelican-dive)": [[16, "event-message-block"]],
- "(enter pelican-wait-at-nest)": [
- [16, "event-message-block"]
- ],
+ "(enter pelican-wait-at-nest)": [[16, "event-message-block"]],
- "(code pelican-circle)": [
- [16, "event-message-block"]
- ],
+ "(code pelican-circle)": [[16, "event-message-block"]],
"(enter pelican-dive)": [
[16, "event-message-block"],
[96, "vector"]
],
- "(anon-function 37 pelican)": [
- [16, "event-message-block"]
- ],
+ "(anon-function 37 pelican)": [[16, "event-message-block"]],
- "(trans energydoor-closed-till-task)": [
- [16, "event-message-block"]
- ],
+ "(trans energydoor-closed-till-task)": [[16, "event-message-block"]],
- "(method 11 energydoor)": [
- [16, "event-message-block"]
- ],
+ "(method 11 energydoor)": [[16, "event-message-block"]],
- "(enter energyhub-stopped)": [
- [16, "event-message-block"]
- ],
+ "(enter energyhub-stopped)": [[16, "event-message-block"]],
- "(enter energyhub-stop)": [
- [16, "event-message-block"]
- ],
+ "(enter energyhub-stop)": [[16, "event-message-block"]],
"energydoor-player-dist": [
[16, "vector"],
@@ -3953,146 +3563,88 @@
[32, "matrix"]
],
- "energyhub-trans": [
- [16, "matrix"]
- ],
+ "energyhub-trans": [[16, "matrix"]],
- "(method 43 red-sagecage)": [
- [16, "vector"]
- ],
+ "(method 43 red-sagecage)": [[16, "vector"]],
- "(method 43 blue-sagecage)": [
- [16, "vector"]
- ],
+ "(method 43 blue-sagecage)": [[16, "vector"]],
- "(method 43 yellow-sagecage)": [
- [16, "vector"]
- ],
+ "(method 43 yellow-sagecage)": [[16, "vector"]],
"(method 44 citb-sage)": [
[16, "vector"],
[32, "vector"]
],
- "(enter hidden citb-sage)": [
- [16, "event-message-block"]
- ],
+ "(enter hidden citb-sage)": [[16, "event-message-block"]],
- "(trans idle green-sagecage)": [
- [16, "event-message-block"]
- ],
+ "(trans idle green-sagecage)": [[16, "event-message-block"]],
- "(exit play-anim green-sagecage)": [
- [16, "event-message-block"]
- ],
+ "(exit play-anim green-sagecage)": [[16, "event-message-block"]],
- "(trans play-anim green-sagecage)": [
- [16, "event-message-block"]
- ],
+ "(trans play-anim green-sagecage)": [[16, "event-message-block"]],
- "(event play-anim green-sagecage)": [
- [16, "event-message-block"]
- ],
+ "(event play-anim green-sagecage)": [[16, "event-message-block"]],
- "(method 32 green-sagecage)": [
- [16, "event-message-block"]
- ],
+ "(method 32 green-sagecage)": [[16, "event-message-block"]],
- "(event play-anim citb-sage)": [
- [16, "event-message-block"]
- ],
+ "(event play-anim citb-sage)": [[16, "event-message-block"]],
- "(event idle citb-sage)": [
- [16, "event-message-block"]
- ],
+ "(event idle citb-sage)": [[16, "event-message-block"]],
- "(event wait eco-collectable)": [
- [16, "event-message-block"]
- ],
+ "(event wait eco-collectable)": [[16, "event-message-block"]],
- "(enter wait eco-collectable)": [
- [16, "event-message-block"]
- ],
+ "(enter wait eco-collectable)": [[16, "event-message-block"]],
- "(event notice-blue eco-collectable)": [
- [16, "event-message-block"]
- ],
+ "(event notice-blue eco-collectable)": [[16, "event-message-block"]],
- "(trans notice-blue eco-collectable)": [
- [16, "event-message-block"]
- ],
+ "(trans notice-blue eco-collectable)": [[16, "event-message-block"]],
- "(code pickup eco-collectable)": [
- [16, "event-message-block"]
- ],
+ "(code pickup eco-collectable)": [[16, "event-message-block"]],
- "(enter pickup eco-collectable)": [
- [16, "event-message-block"]
- ],
+ "(enter pickup eco-collectable)": [[16, "event-message-block"]],
- "(code die eco)": [
- [16, "event-message-block"]
- ],
+ "(code die eco)": [[16, "event-message-block"]],
- "(code pickup fuel-cell)": [
- [16, "event-message-block"]
- ],
+ "(code pickup fuel-cell)": [[16, "event-message-block"]],
"(code pickup buzzer)": [
[16, "event-message-block"],
[96, "vector"]
],
- "(trans pickup fuel-cell)": [
- [16, "event-message-block"]
- ],
+ "(trans pickup fuel-cell)": [[16, "event-message-block"]],
- "(event vent-wait-for-touch)": [
- [16, "event-message-block"]
- ],
+ "(event vent-wait-for-touch)": [[16, "event-message-block"]],
- "add-blue-motion": [
- [16, "vector"]
- ],
+ "add-blue-motion": [[16, "vector"]],
- "ecovalve-init-by-other": [
- [16, "vector"]
- ],
+ "ecovalve-init-by-other": [[16, "vector"]],
- "(anon-function 69 collectables)": [
- [16, "vector"]
- ],
+ "(anon-function 69 collectables)": [[16, "vector"]],
- "(code ecovalve-idle)": [
- [16, "vector"]
- ],
+ "(code ecovalve-idle)": [[16, "vector"]],
"(method 9 fact-info)": [
[16, "vector"],
[32, "collide-tri-result"]
],
- "(method 29 buzzer)": [
- [16, "vector"]
- ],
+ "(method 29 buzzer)": [[16, "vector"]],
"(trans wait eco-collectable)": [
[16, "vector"],
[32, "event-message-block"]
],
- "(code jump eco-collectable)": [
- [16, "trajectory"]
- ],
+ "(code jump eco-collectable)": [[16, "trajectory"]],
"(event shover-idle)": [
[16, "attack-info"],
[128, "event-message-block"]
],
- "(method 21 sun-iris-door)": [
- [16, "vector"]
- ],
+ "(method 21 sun-iris-door)": [[16, "vector"]],
"(method 20 sun-iris-door)": [
[16, "vector"],
@@ -4117,34 +3669,22 @@
[144, "vector"]
],
- "(method 11 steam-cap)": [
- [32, "vector"]
- ],
+ "(method 11 steam-cap)": [[32, "vector"]],
- "(trans floating-launcher-idle)": [
- [16, "vector"]
- ],
+ "(trans floating-launcher-idle)": [[16, "vector"]],
- "(trans whirlpool-idle)": [
- [16, "vector"]
- ],
+ "(trans whirlpool-idle)": [[16, "vector"]],
"(method 20 whirlpool)": [
[16, "vector"],
[32, "event-message-block"]
],
- "(method 12 touching-list)": [
- [16, "event-message-block"]
- ],
+ "(method 12 touching-list)": [[16, "event-message-block"]],
- "(method 9 touching-list)": [
- [16, "add-prims-touching-work"]
- ],
+ "(method 9 touching-list)": [[16, "add-prims-touching-work"]],
- "(method 11 touching-prims-entry)": [
- [16, "vector"]
- ],
+ "(method 11 touching-prims-entry)": [[16, "vector"]],
"(method 35 collide-shape)": [
[16, "collide-overlap-result"],
@@ -4158,13 +3698,9 @@
[736, "matrix"]
],
- "(method 44 collide-shape)": [
- [16, "pull-rider-info"]
- ],
+ "(method 44 collide-shape)": [[16, "pull-rider-info"]],
- "(method 12 collide-mesh)": [
- [16, "matrix"]
- ],
+ "(method 12 collide-mesh)": [[16, "matrix"]],
"target-attack-up": [
[16, "vector"],
@@ -4173,21 +3709,13 @@
[64, "event-message-block"]
],
- "(method 30 collide-shape)": [
- [16, "vector"]
- ],
+ "(method 30 collide-shape)": [[16, "vector"]],
- "(method 32 collide-shape)": [
- [16, "bounding-box"]
- ],
+ "(method 32 collide-shape)": [[16, "bounding-box"]],
- "(method 33 collide-shape)": [
- [16, "vector"]
- ],
+ "(method 33 collide-shape)": [[16, "vector"]],
- "(method 57 collide-shape-moving)": [
- [16, "vector"]
- ],
+ "(method 57 collide-shape-moving)": [[16, "vector"]],
"(method 60 collide-shape-moving)": [
[16, "vector"],
@@ -4199,9 +3727,7 @@
[112, "overlaps-others-params"]
],
- "(method 58 collide-shape-moving)": [
- [16, "overlaps-others-params"]
- ],
+ "(method 58 collide-shape-moving)": [[16, "overlaps-others-params"]],
"simple-collision-reaction": [
[16, "vector"],
@@ -4222,9 +3748,7 @@
[144, "vector"]
],
- "(method 56 collide-shape-moving)": [
- [16, "event-message-block"]
- ],
+ "(method 56 collide-shape-moving)": [[16, "event-message-block"]],
"(method 63 collide-shape-moving)": [
[16, "collide-shape-intersect"],
@@ -4331,9 +3855,7 @@
[32, "matrix"]
],
- "(method 20 target)": [
- [16, "event-message-block"]
- ],
+ "(method 20 target)": [[16, "event-message-block"]],
"(method 19 collide-edge-work)": [
[16, "vector"],
@@ -4342,21 +3864,13 @@
[80, "matrix"]
],
- "(method 14 collide-edge-work)": [
- [16, "vector"]
- ],
+ "(method 14 collide-edge-work)": [[16, "vector"]],
- "(method 10 collide-edge-work)": [
- [16, "vector"]
- ],
+ "(method 10 collide-edge-work)": [[16, "vector"]],
- "(method 9 collide-edge-hold-list)": [
- [16, "vector"]
- ],
+ "(method 9 collide-edge-hold-list)": [[16, "vector"]],
- "collide-shape-moving-angle-set!": [
- [16, "vector"]
- ],
+ "collide-shape-moving-angle-set!": [[16, "vector"]],
"poly-find-nearest-edge": [
[16, "vector"],
@@ -4388,9 +3902,7 @@
[80, "event-message-block"]
],
- "(method 15 collide-cache)": [
- [16, "bounding-box"]
- ],
+ "(method 15 collide-cache)": [[16, "bounding-box"]],
"test-closest-pt-in-triangle": [
[16, "vector"],
@@ -4405,13 +3917,9 @@
[48, "vector"]
],
- "(method 10 collide-mesh)": [
- [16, "matrix"]
- ],
+ "(method 10 collide-mesh)": [[16, "matrix"]],
- "(method 22 collide-shape-prim-mesh)": [
- [16, "collide-tri-result"]
- ],
+ "(method 22 collide-shape-prim-mesh)": [[16, "collide-tri-result"]],
"find-ground-point": [
[16, "vector"],
@@ -4423,46 +3931,28 @@
"(method 19 collide-shape-prim-sphere)": [[16, "collide-tri-result"]],
"(method 37 collide-shape)": [[16, "vector"]],
- "starts": [
- [16, "event-message-block"]
- ],
+ "starts": [[16, "event-message-block"]],
- "(trans target-flop)": [
- [16, "event-message-block"]
- ],
+ "(trans target-flop)": [[16, "event-message-block"]],
- "(event target-wheel)": [
- [16, "event-message-block"]
- ],
+ "(event target-wheel)": [[16, "event-message-block"]],
- "(code target-stance)": [
- [16, "ground-tween-info"]
- ],
+ "(code target-stance)": [[16, "ground-tween-info"]],
- "init-var-jump": [
- [16, "vector"]
- ],
+ "init-var-jump": [[16, "vector"]],
- "(code target-wheel)": [
- [16, "vector"]
- ],
+ "(code target-wheel)": [[16, "vector"]],
"(code target-wheel-flip)": [
[16, "vector"],
[32, "vector"]
],
- "(enter target-flop)": [
- [16, "vector"]
- ],
+ "(enter target-flop)": [[16, "vector"]],
- "(code target-running-attack)": [
- [16, "vector"]
- ],
+ "(code target-running-attack)": [[16, "vector"]],
- "(enter target-flop-hit-ground)": [
- [16, "vector"]
- ],
+ "(enter target-flop-hit-ground)": [[16, "vector"]],
"(enter target-attack-air)": [
[16, "vector"],
@@ -4470,9 +3960,7 @@
[48, "vector"]
],
- "(enter target-hit-ground)": [
- [16, "vector"]
- ],
+ "(enter target-hit-ground)": [[16, "vector"]],
"(code target-flop)": [
[16, "vector"],
@@ -4490,21 +3978,13 @@
[32, "vector"]
],
- "target-generic-event-handler": [
- [16, "event-message-block"]
- ],
+ "target-generic-event-handler": [[16, "event-message-block"]],
- "target-powerup-effect": [
- [16, "vector"]
- ],
+ "target-powerup-effect": [[16, "vector"]],
- "check-water-level-drop": [
- [16, "vector"]
- ],
+ "check-water-level-drop": [[16, "vector"]],
- "(method 13 water-control)": [
- [16, "vector"]
- ],
+ "(method 13 water-control)": [[16, "vector"]],
"(method 10 water-control)": [
[16, "vector"],
@@ -4518,17 +3998,11 @@
[208, "vector"]
],
- "(method 15 water-control)": [
- [16, "event-message-block"]
- ],
+ "(method 15 water-control)": [[16, "event-message-block"]],
- "(anon-function 13 water)": [
- [16, "event-message-block"]
- ],
+ "(anon-function 13 water)": [[16, "event-message-block"]],
- "(method 26 water-vol)": [
- [16, "event-message-block"]
- ],
+ "(method 26 water-vol)": [[16, "event-message-block"]],
"(code wait-for-start racer)": [
[16, "event-message-block"],
@@ -4540,17 +4014,11 @@
[112, "event-message-block"]
],
- "(event wait-for-return racer)": [
- [16, "event-message-block"]
- ],
+ "(event wait-for-return racer)": [[16, "event-message-block"]],
- "racer-xz": [
- [16, "vector"]
- ],
+ "racer-xz": [[16, "vector"]],
- "racer-cushion": [
- [16, "vector"]
- ],
+ "racer-cushion": [[16, "vector"]],
"target-racing-post": [
[16, "vector"],
@@ -4589,9 +4057,7 @@
[48, "vector"]
],
- "racer-integrate": [
- [16, "quaternion"]
- ],
+ "racer-integrate": [[16, "quaternion"]],
"fleeing-nav-enemy-clip-travel": [
[16, "clip-travel-vector-to-mesh-return-info"],
@@ -4653,33 +4119,19 @@
[32, "vector"]
],
- "(trans lightning-mole-dive)": [
- [16, "event-message-block"]
- ],
+ "(trans lightning-mole-dive)": [[16, "event-message-block"]],
- "(trans lightning-mole-head-for-hole)": [
- [16, "event-message-block"]
- ],
+ "(trans lightning-mole-head-for-hole)": [[16, "event-message-block"]],
- "(method 43 lightning-mole)": [
- [16, "event-message-block"]
- ],
+ "(method 43 lightning-mole)": [[16, "event-message-block"]],
- "(method 44 lightning-mole)": [
- [16, "event-message-block"]
- ],
+ "(method 44 lightning-mole)": [[16, "event-message-block"]],
- "check-drop-level-rolling-dirt": [
- [16, "vector"]
- ],
+ "check-drop-level-rolling-dirt": [[16, "vector"]],
- "check-drop-level-rolling-dirt-finish": [
- [16, "vector"]
- ],
+ "check-drop-level-rolling-dirt-finish": [[16, "vector"]],
- "(code fuel-cell-spline-slider)": [
- [16, "vector"]
- ],
+ "(code fuel-cell-spline-slider)": [[16, "vector"]],
"robber-find-ground": [
[16, "vector"],
@@ -4692,30 +4144,20 @@
[80, "vector"]
],
- "robber-calc-speed": [
- [16, "vector"]
- ],
+ "robber-calc-speed": [[16, "vector"]],
- "(code robber-die)": [
- [16, "vector"]
- ],
+ "(code robber-die)": [[16, "vector"]],
- "(code robber-initial-notice)": [
- [16, "vector"]
- ],
+ "(code robber-initial-notice)": [[16, "vector"]],
- "(method 11 robber)": [
- [16, "matrix"]
- ],
+ "(method 11 robber)": [[16, "matrix"]],
"(code robber-debug)": [
[16, "vector"],
[32, "vector"]
],
- "(code target-flut-running-attack)": [
- [16, "vector"]
- ],
+ "(code target-flut-running-attack)": [[16, "vector"]],
"(enter target-flut-running-attack)": [
[16, "vector"],
@@ -4737,38 +4179,24 @@
[32, "event-message-block"]
],
- "(code target-flut-start)": [
- [16, "event-message-block"]
- ],
+ "(code target-flut-start)": [[16, "event-message-block"]],
- "(exit target-flut-clone-anim)": [
- [16, "event-message-block"]
- ],
+ "(exit target-flut-clone-anim)": [[16, "event-message-block"]],
- "(code target-flut-clone-anim)": [
- [16, "event-message-block"]
- ],
+ "(code target-flut-clone-anim)": [[16, "event-message-block"]],
- "(enter target-flut-air-attack-hit-ground)": [
- [16, "event-message-block"]
- ],
+ "(enter target-flut-air-attack-hit-ground)": [[16, "event-message-block"]],
"(event target-flut-jump)": [
[16, "vector"],
[32, "event-message-block"]
],
- "(enter target-flut-air-attack)": [
- [16, "vector"]
- ],
+ "(enter target-flut-air-attack)": [[16, "vector"]],
- "(post target-flut-get-on)": [
- [16, "vector"]
- ],
+ "(post target-flut-get-on)": [[16, "vector"]],
- "(post target-flut-get-off-jump)": [
- [16, "vector"]
- ],
+ "(post target-flut-get-off-jump)": [[16, "vector"]],
"(code target-flut-get-on)": [
[16, "vector"],
@@ -4801,9 +4229,7 @@
[80, "event-message-block"]
],
- "target-hit-orient": [
- [16, "vector"]
- ],
+ "target-hit-orient": [[16, "vector"]],
"target-hit-move": [
[16, "vector"],
@@ -4811,9 +4237,7 @@
[48, "matrix"]
],
- "(anon-function 20 target-death)": [
- [16, "event-message-block"]
- ],
+ "(anon-function 20 target-death)": [[16, "event-message-block"]],
"target-death-anim": [
[16, "event-message-block"],
@@ -4830,13 +4254,9 @@
[96, "transformq"]
],
- "velocity-set-to-target!": [
- [16, "vector"]
- ],
+ "velocity-set-to-target!": [[16, "vector"]],
- "(exit target-hit)": [
- [16, "vector"]
- ],
+ "(exit target-hit)": [[16, "vector"]],
"(code target-hit)": [
[16, "vector"],
@@ -4846,13 +4266,9 @@
[80, "event-message-block"]
],
- "target-hit-push": [
- [16, "vector"]
- ],
+ "target-hit-push": [[16, "vector"]],
- "(anon-function 2 target-death)": [
- [16, "vector"]
- ],
+ "(anon-function 2 target-death)": [[16, "vector"]],
"racer-collision-reaction": [
[16, "vector"],
@@ -4877,9 +4293,7 @@
[208, "vector"]
],
- "target-apply-tongue": [
- [16, "vector"]
- ],
+ "target-apply-tongue": [[16, "vector"]],
"target-bonk-event-handler": [
[16, "vector"],
@@ -4888,78 +4302,44 @@
[128, "vector"]
],
- "(code target-load-wait)": [
- [16, "event-message-block"]
- ],
+ "(code target-load-wait)": [[16, "event-message-block"]],
- "(code target-stance-look-around)": [
- [16, "event-message-block"]
- ],
+ "(code target-stance-look-around)": [[16, "event-message-block"]],
- "(enter target-look-around)": [
- [16, "event-message-block"]
- ],
+ "(enter target-look-around)": [[16, "event-message-block"]],
- "(exit target-look-around)": [
- [16, "event-message-block"]
- ],
+ "(exit target-look-around)": [[16, "event-message-block"]],
- "(code target-look-around)": [
- [16, "event-message-block"]
- ],
+ "(code target-look-around)": [[16, "event-message-block"]],
- "(enter target-billy-game)": [
- [16, "event-message-block"]
- ],
+ "(enter target-billy-game)": [[16, "event-message-block"]],
- "(exit target-billy-game)": [
- [16, "event-message-block"]
- ],
+ "(exit target-billy-game)": [[16, "event-message-block"]],
- "(enter target-pole-cycle)": [
- [16, "event-message-block"]
- ],
+ "(enter target-pole-cycle)": [[16, "event-message-block"]],
- "(code target-pole-flip-up-jump)": [
- [16, "event-message-block"]
- ],
+ "(code target-pole-flip-up-jump)": [[16, "event-message-block"]],
- "(enter target-edge-grab)": [
- [16, "event-message-block"]
- ],
+ "(enter target-edge-grab)": [[16, "event-message-block"]],
- "(exit target-edge-grab)": [
- [16, "event-message-block"]
- ],
+ "(exit target-edge-grab)": [[16, "event-message-block"]],
- "(trans target-swim-up)": [
- [16, "event-message-block"]
- ],
+ "(trans target-swim-up)": [[16, "event-message-block"]],
- "(code target-launch)": [
- [16, "event-message-block"]
- ],
+ "(code target-launch)": [[16, "event-message-block"]],
- "(code target-play-anim)": [
- [16, "event-message-block"]
- ],
+ "(code target-play-anim)": [[16, "event-message-block"]],
- "(exit target-play-anim)": [
- [16, "event-message-block"]
- ],
+ "(exit target-play-anim)": [[16, "event-message-block"]],
- "(trans target-edge-grab)": [
- [16, "collide-using-spheres-params"]
- ],
+ "(trans target-edge-grab)": [[16, "collide-using-spheres-params"]],
"(exit target-clone-anim)": [
[16, "event-message-block"],
[96, "vector"]
],
- "(enter target-clone-anim)": [
- [16, "event-message-block"]
- ],
+ "(enter target-clone-anim)": [[16, "event-message-block"]],
"(code target-edge-grab-off)": [
[16, "event-message-block"],
@@ -4971,13 +4351,9 @@
[32, "vector"]
],
- "(trans target-pole-cycle)": [
- [16, "vector"]
- ],
+ "(trans target-pole-cycle)": [[16, "vector"]],
- "(code target-swim-jump)": [
- [16, "vector"]
- ],
+ "(code target-swim-jump)": [[16, "vector"]],
"(anon-function 11 target2)": [
[16, "vector"],
@@ -4986,22 +4362,16 @@
[80, "vector"]
],
- "(enter target-yellow-blast)": [
- [16, "vector"]
- ],
+ "(enter target-yellow-blast)": [[16, "vector"]],
"(code target-periscope)": [
[16, "vector"],
[32, "event-message-block"]
],
- "(enter target-yellow-jump-blast)": [
- [16, "vector"]
- ],
+ "(enter target-yellow-jump-blast)": [[16, "vector"]],
- "(code target-swim-down)": [
- [16, "vector"]
- ],
+ "(code target-swim-down)": [[16, "vector"]],
"(code target-yellow-jump-blast)": [
[16, "vector"],
@@ -5048,37 +4418,21 @@
[80, "matrix"]
],
- "(trans notice-blue crate)": [
- [16, "event-message-block"]
- ],
+ "(trans notice-blue crate)": [[16, "event-message-block"]],
- "(event die crate)": [
- [16, "event-message-block"]
- ],
+ "(event die crate)": [[16, "event-message-block"]],
- "(code notice-blue crate)": [
- [16, "vector"]
- ],
+ "(code notice-blue crate)": [[16, "vector"]],
- "(method 28 ram-boss-proj)": [
- [16, "vector"]
- ],
+ "(method 28 ram-boss-proj)": [[16, "vector"]],
- "(method 56 ram-boss)": [
- [16, "vector"]
- ],
+ "(method 56 ram-boss)": [[16, "vector"]],
- "(code ram-boss-jump-down)": [
- [16, "vector"]
- ],
+ "(code ram-boss-jump-down)": [[16, "vector"]],
- "(method 57 ram-boss)": [
- [16, "vector"]
- ],
+ "(method 57 ram-boss)": [[16, "vector"]],
- "(post ram-boss-lose-shield)": [
- [16, "vector"]
- ],
+ "(post ram-boss-lose-shield)": [[16, "vector"]],
"(trans ram-boss-tracking)": [
[16, "vector"],
@@ -5103,17 +4457,11 @@
[64, "matrix"]
],
- "ram-boss-on-ground-event-handler": [
- [16, "event-message-block"]
- ],
+ "ram-boss-on-ground-event-handler": [[16, "event-message-block"]],
- "(enter ram-boss-throw)": [
- [16, "event-message-block"]
- ],
+ "(enter ram-boss-throw)": [[16, "event-message-block"]],
- "(code nav-enemy-die ram-boss)": [
- [16, "event-message-block"]
- ],
+ "(code nav-enemy-die ram-boss)": [[16, "event-message-block"]],
"(method 55 ram-boss)": [
[16, "vector"],
@@ -5128,9 +4476,7 @@
[112, "vector"]
],
- "(method 20 ram)": [
- [16, "vector"]
- ],
+ "(method 20 ram)": [[16, "vector"]],
"(method 21 ram)": [
[16, "vector"],
@@ -5139,13 +4485,9 @@
[64, "vector"]
],
- "(event ram-idle)": [
- [16, "event-message-block"]
- ],
+ "(event ram-idle)": [[16, "event-message-block"]],
- "(code ram-idle)": [
- [32, "event-message-block"]
- ],
+ "(code ram-idle)": [[32, "event-message-block"]],
"(method 21 snow-bumper)": [
[16, "vector"],
@@ -5153,9 +4495,7 @@
[48, "event-message-block"]
],
- "(method 20 snow-ball-roller)": [
- [16, "vector"]
- ],
+ "(method 20 snow-ball-roller)": [[16, "vector"]],
"snow-ball-roller-path-update": [
[16, "vector"],
@@ -5171,21 +4511,13 @@
[48, "event-message-block"]
],
- "(code snow-ball-idle)": [
- [16, ["inline-array", "snow-ball-junction", 4]]
- ],
+ "(code snow-ball-idle)": [[16, ["inline-array", "snow-ball-junction", 4]]],
- "(method 11 spider-egg)": [
- [16, "vector"]
- ],
+ "(method 11 spider-egg)": [[16, "vector"]],
- "(code spider-egg-die)": [
- [16, "event-message-block"]
- ],
+ "(code spider-egg-die)": [[16, "event-message-block"]],
- "puffer-default-event-handler": [
- [16, "event-message-block"]
- ],
+ "puffer-default-event-handler": [[16, "event-message-block"]],
"(method 28 puffer)": [
[16, "collide-tri-result"],
@@ -5205,17 +4537,11 @@
[208, "matrix"]
],
- "(trans puffer-patrol)": [
- [16, "vector"]
- ],
+ "(trans puffer-patrol)": [[16, "vector"]],
- "(trans puffer-attack)": [
- [16, "vector"]
- ],
+ "(trans puffer-attack)": [[16, "vector"]],
- "(method 27 driller-lurker)": [
- [16, "vector"]
- ],
+ "(method 27 driller-lurker)": [[16, "vector"]],
"(method 11 driller-lurker)": [
[16, "vector"],
@@ -5230,17 +4556,11 @@
[80, "quaternion"]
],
- "driller-lurker-default-event-handler": [
- [16, "event-message-block"]
- ],
+ "driller-lurker-default-event-handler": [[16, "event-message-block"]],
- "(code driller-lurker-die)": [
- [16, "event-message-block"]
- ],
+ "(code driller-lurker-die)": [[16, "event-message-block"]],
- "(code dark-crystal-explode)": [
- [16, "joint-exploder-tuning"]
- ],
+ "(code dark-crystal-explode)": [[16, "joint-exploder-tuning"]],
"(method 20 dark-crystal)": [
[16, "vector"],
@@ -5250,9 +4570,7 @@
[160, "event-message-block"]
],
- "(event kermit-pulse-idle)": [
- [16, "event-message-block"]
- ],
+ "(event kermit-pulse-idle)": [[16, "event-message-block"]],
"kermit-check-tongue-is-clear?": [
[16, "vector"],
@@ -5277,9 +4595,7 @@
[48, "vector"]
],
- "kermit-post": [
- [16, "vector"]
- ],
+ "kermit-post": [[16, "vector"]],
"(trans kermit-tongue-stuck)": [
[16, "vector"],
@@ -5314,30 +4630,20 @@
[64, "vector"]
],
- "(method 22 gnawer)": [
- [16, "bounding-box"]
- ],
+ "(method 22 gnawer)": [[16, "bounding-box"]],
- "(method 25 gnawer)": [
- [16, "vector"]
- ],
+ "(method 25 gnawer)": [[16, "vector"]],
- "(method 29 gnawer)": [
- [16, "vector"]
- ],
+ "(method 29 gnawer)": [[16, "vector"]],
- "(trans gnawer-die)": [
- [16, "vector"]
- ],
+ "(trans gnawer-die)": [[16, "vector"]],
"(method 21 gnawer)": [
[16, "vector"],
[32, "vector"]
],
- "(code gnawer-give-fuel-cell)": [
- [16, "vector"]
- ],
+ "(code gnawer-give-fuel-cell)": [[16, "vector"]],
"(code gnawer-put-items-at-dest)": [
[16, "vector"],
@@ -5345,21 +4651,13 @@
[48, "vector"]
],
- "(event gnawer-chewing-on-post)": [
- [16, "event-message-block"]
- ],
+ "(event gnawer-chewing-on-post)": [[16, "event-message-block"]],
- "(event gnawer-run)": [
- [16, "event-message-block"]
- ],
+ "(event gnawer-run)": [[16, "event-message-block"]],
- "(code mother-spider-egg-hatch)": [
- [16, "event-message-block"]
- ],
+ "(code mother-spider-egg-hatch)": [[16, "event-message-block"]],
- "(code mother-spider-egg-die-exit)": [
- [16, "event-message-block"]
- ],
+ "(code mother-spider-egg-die-exit)": [[16, "event-message-block"]],
"(method 21 mother-spider-egg)": [
[16, "collide-tri-result"],
@@ -5374,26 +4672,18 @@
[64, "vector"]
],
- "(trans mother-spider-egg-hatch)": [
- [16, "vector"]
- ],
+ "(trans mother-spider-egg-hatch)": [[16, "vector"]],
- "(trans precursor-arm-idle)": [
- [16, "matrix"]
- ],
+ "(trans precursor-arm-idle)": [[16, "matrix"]],
"swamp-rope-break-code": [
[16, "matrix"],
[80, "vector"]
],
- "(method 10 swamp-blimp-oscillator)": [
- [16, "vector"]
- ],
+ "(method 10 swamp-blimp-oscillator)": [[16, "vector"]],
- "swamp-rope-update-bounding-spheres": [
- [16, "vector"]
- ],
+ "swamp-rope-update-bounding-spheres": [[16, "vector"]],
"swamp-rope-trans": [
[16, "matrix"],
@@ -5419,42 +4709,26 @@
[64, "vector"]
],
- "(enter swamp-blimp-bye-bye)": [
- [16, "event-message-block"]
- ],
+ "(enter swamp-blimp-bye-bye)": [[16, "event-message-block"]],
- "(code swamp-blimp-bye-bye)": [
- [16, "quaternion"]
- ],
+ "(code swamp-blimp-bye-bye)": [[16, "quaternion"]],
- "swamp-blimp-setup": [
- [16, "vector"]
- ],
+ "swamp-blimp-setup": [[16, "vector"]],
- "(method 11 swamp-blimp)": [
- [16, "vector"]
- ],
+ "(method 11 swamp-blimp)": [[16, "vector"]],
- "bustarock": [
- [16, "event-message-block"]
- ],
+ "bustarock": [[16, "event-message-block"]],
"(code mistycannon-missile-in-water)": [
[16, "vector"],
[32, "vector"]
],
- "(method 20 mistycannon-missile)": [
- [16, "vector"]
- ],
+ "(method 20 mistycannon-missile)": [[16, "vector"]],
- "(post mistycannon-missile-idle)": [
- [16, "vector"]
- ],
+ "(post mistycannon-missile-idle)": [[16, "vector"]],
- "(code mistycannon-missile-explode)": [
- [16, "overlaps-others-params"]
- ],
+ "(code mistycannon-missile-explode)": [[16, "overlaps-others-params"]],
"(event mistycannon-missile-explode)": [
[16, "vector"],
@@ -5467,21 +4741,13 @@
[32, "vector"]
],
- "spawn-mistycannon-missile": [
- [16, "mistycannon-init-data"]
- ],
+ "spawn-mistycannon-missile": [[16, "mistycannon-init-data"]],
- "(method 22 mistycannon)": [
- [16, "vector"]
- ],
+ "(method 22 mistycannon)": [[16, "vector"]],
- "mistycannon-postbind-function": [
- [16, "vector"]
- ],
+ "mistycannon-postbind-function": [[16, "vector"]],
- "(code mistycannon-aim-at-player)": [
- [16, "vector"]
- ],
+ "(code mistycannon-aim-at-player)": [[16, "vector"]],
"mistycannon-do-aim": [
[16, "trajectory-params"],
@@ -5496,13 +4762,9 @@
[112, "event-message-block"]
],
- "(event mistycannon-player-control)": [
- [16, "event-message-block"]
- ],
+ "(event mistycannon-player-control)": [[16, "event-message-block"]],
- "(code mistycannon-player-control)": [
- [16, "event-message-block"]
- ],
+ "(code mistycannon-player-control)": [[16, "event-message-block"]],
"(trans rigid-body-platform-idle citb-chain-plat)": [
[16, "event-message-block"]
@@ -5512,25 +4774,15 @@
[16, "event-message-block"]
],
- "(event citb-firehose-blast)": [
- [16, "event-message-block"]
- ],
+ "(event citb-firehose-blast)": [[16, "event-message-block"]],
- "(method 27 citb-chain-plat)": [
- [16, "vector"]
- ],
+ "(method 27 citb-chain-plat)": [[16, "vector"]],
- "(trans plat-button-move-downward citb-exit-plat)": [
- [16, "vector"]
- ],
+ "(trans plat-button-move-downward citb-exit-plat)": [[16, "vector"]],
- "(trans plat-button-move-upward citb-exit-plat)": [
- [16, "vector"]
- ],
+ "(trans plat-button-move-upward citb-exit-plat)": [[16, "vector"]],
- "citb-firehose-blast-particles": [
- [16, "quaternion"]
- ],
+ "citb-firehose-blast-particles": [[16, "quaternion"]],
"(code citb-chain-plat-settle)": [
[16, "vector"],
@@ -5543,29 +4795,17 @@
[48, "event-message-block"]
],
- "darkvine-event-handler": [
- [16, "event-message-block"]
- ],
+ "darkvine-event-handler": [[16, "event-message-block"]],
- "(post darkvine-idle)": [
- [16, "vector"]
- ],
+ "(post darkvine-idle)": [[16, "vector"]],
- "(enter cam-periscope)": [
- [16, "vector"]
- ],
+ "(enter cam-periscope)": [[16, "vector"]],
- "(code cam-periscope)": [
- [16, "vector"]
- ],
+ "(code cam-periscope)": [[16, "vector"]],
- "(code reflector-idle)": [
- [16, "vector"]
- ],
+ "(code reflector-idle)": [[16, "vector"]],
- "(code reflector-mirror-idle)": [
- [16, "vector"]
- ],
+ "(code reflector-mirror-idle)": [[16, "vector"]],
"periscope-crosshair": [
[16, "vector"],
@@ -5604,30 +4844,20 @@
[128, "event-message-block"]
],
- "periscope-update-joints": [
- [16, "event-message-block"]
- ],
+ "periscope-update-joints": [[16, "event-message-block"]],
- "(code reflector-mirror-broken)": [
- [16, "event-message-block"]
- ],
+ "(code reflector-mirror-broken)": [[16, "event-message-block"]],
- "(code periscope-player-control)": [
- [16, "event-message-block"]
- ],
+ "(code periscope-player-control)": [[16, "event-message-block"]],
"(code reflector-origin-idle)": [
[16, "event-message-block"],
[96, "vector"]
],
- "(code launcherdoor-closed)": [
- [16, "event-message-block"]
- ],
+ "(code launcherdoor-closed)": [[16, "event-message-block"]],
- "(event quicksandlurker-missile-idle)": [
- [16, "event-message-block"]
- ],
+ "(event quicksandlurker-missile-idle)": [[16, "event-message-block"]],
"quicksandlurker-spit": [
[16, "vector"],
@@ -5635,9 +4865,7 @@
[48, "vector"]
],
- "spawn-quicksandlurker-missile": [
- [16, "quicksandlurker-missile-init-data"]
- ],
+ "spawn-quicksandlurker-missile": [[16, "quicksandlurker-missile-init-data"]],
"balloonlurker-snap-to-path-point": [
[16, "vector"],
@@ -5649,53 +4877,29 @@
[32, "vector"]
],
- "balloonlurker-find-nearest-path-point": [
- [16, "vector"]
- ],
+ "balloonlurker-find-nearest-path-point": [[16, "vector"]],
- "(post balloonlurker-pilot-die)": [
- [16, "vector"]
- ],
+ "(post balloonlurker-pilot-die)": [[16, "vector"]],
- "balloonlurker-post": [
- [16, "quaternion"]
- ],
+ "balloonlurker-post": [[16, "quaternion"]],
- "balloonlurker-event-handler": [
- [16, "event-message-block"]
- ],
+ "balloonlurker-event-handler": [[16, "event-message-block"]],
- "(event balloonlurker-pilot-idle)": [
- [16, "event-message-block"]
- ],
+ "(event balloonlurker-pilot-idle)": [[16, "event-message-block"]],
- "(code balloonlurker-die)": [
- [32, "event-message-block"]
- ],
+ "(code balloonlurker-die)": [[32, "event-message-block"]],
- "(event orbit-plat-idle)": [
- [16, "event-message-block"]
- ],
+ "(event orbit-plat-idle)": [[16, "event-message-block"]],
- "(code orbit-plat-idle)": [
- [16, "event-message-block"]
- ],
+ "(code orbit-plat-idle)": [[16, "event-message-block"]],
- "(code orbit-plat-still)": [
- [16, "event-message-block"]
- ],
+ "(code orbit-plat-still)": [[16, "event-message-block"]],
- "(code orbit-plat-riding)": [
- [16, "event-message-block"]
- ],
+ "(code orbit-plat-riding)": [[16, "event-message-block"]],
- "(code orbit-plat-reset)": [
- [16, "event-message-block"]
- ],
+ "(code orbit-plat-reset)": [[16, "event-message-block"]],
- "(method 20 orbit-plat-bottom)": [
- [16, "vector"]
- ],
+ "(method 20 orbit-plat-bottom)": [[16, "vector"]],
"(code orbit-plat-bottom-idle)": [
[16, "vector"],
@@ -5718,29 +4922,17 @@
[32, "vector"]
],
- "(code enter voicebox)": [
- [16, "event-message-block"]
- ],
+ "(code enter voicebox)": [[16, "event-message-block"]],
- "(code exit voicebox)": [
- [16, "event-message-block"]
- ],
+ "(code exit voicebox)": [[16, "event-message-block"]],
- "mother-spider-death-event-handler": [
- [16, "vector"]
- ],
+ "mother-spider-death-event-handler": [[16, "vector"]],
- "mother-spider-full-joint-callback": [
- [16, "vector"]
- ],
+ "mother-spider-full-joint-callback": [[16, "vector"]],
- "(method 29 mother-spider)": [
- [16, "vector"]
- ],
+ "(method 29 mother-spider)": [[16, "vector"]],
- "(method 30 mother-spider)": [
- [16, "baby-spider-spawn-params"]
- ],
+ "(method 30 mother-spider)": [[16, "baby-spider-spawn-params"]],
"(trans mother-spider-leg-flying)": [
[16, "collide-tri-result"],
@@ -5827,17 +5019,11 @@
[240, "vector"]
],
- "(code bully-notice)": [
- [16, "vector"]
- ],
+ "(code bully-notice)": [[16, "vector"]],
- "(enter bully-start-spinning)": [
- [16, "vector"]
- ],
+ "(enter bully-start-spinning)": [[16, "vector"]],
- "(method 24 seagull)": [
- [16, "vector"]
- ],
+ "(method 24 seagull)": [[16, "vector"]],
"seagull-reaction": [
[16, "vector"],
@@ -5849,33 +5035,19 @@
[112, "vector"]
],
- "(trans seagull-idle)": [
- [16, "vector"]
- ],
+ "(trans seagull-idle)": [[16, "vector"]],
- "(method 16 seagullflock)": [
- [16, "vector"]
- ],
+ "(method 16 seagullflock)": [[16, "vector"]],
- "(method 11 seagullflock)": [
- [16, "vector"]
- ],
+ "(method 11 seagullflock)": [[16, "vector"]],
- "(code seagullflock-at-waterfall)": [
- [16, "event-message-block"]
- ],
+ "(code seagullflock-at-waterfall)": [[16, "event-message-block"]],
- "(code seagull-flying)": [
- [16, "vector"]
- ],
+ "(code seagull-flying)": [[16, "vector"]],
- "(code seagull-soaring)": [
- [16, "vector"]
- ],
+ "(code seagull-soaring)": [[16, "vector"]],
- "(method 26 seagull)": [
- [16, "vector"]
- ],
+ "(method 26 seagull)": [[16, "vector"]],
"seagull-post": [
[16, "quaternion"],
@@ -5922,25 +5094,15 @@
[96, "vector"]
],
- "(method 21 helix-water)": [
- [16, "event-message-block"]
- ],
+ "(method 21 helix-water)": [[16, "event-message-block"]],
- "(code helix-water-idle)": [
- [16, "event-message-block"]
- ],
+ "(code helix-water-idle)": [[16, "event-message-block"]],
- "(trans helix-water-activated)": [
- [16, "event-message-block"]
- ],
+ "(trans helix-water-activated)": [[16, "event-message-block"]],
- "(code helix-water-activated)": [
- [16, "event-message-block"]
- ],
+ "(code helix-water-activated)": [[16, "event-message-block"]],
- "(code idle minecartsteel)": [
- [16, "vector"]
- ],
+ "(code idle minecartsteel)": [[16, "vector"]],
"tie-test-cam-restore": [
[16, "vector"],
@@ -5965,21 +5127,13 @@
[192, "vector"]
],
- "(code sunken-pipegame-end-play)": [
- [16, "event-message-block"]
- ],
+ "(code sunken-pipegame-end-play)": [[16, "event-message-block"]],
- "(enter sunken-pipegame-begin-play)": [
- [16, "event-message-block"]
- ],
+ "(enter sunken-pipegame-begin-play)": [[16, "event-message-block"]],
- "(trans exit-chamber-idle-in-village)": [
- [16, "event-message-block"]
- ],
+ "(trans exit-chamber-idle-in-village)": [[16, "event-message-block"]],
- "(code exit-chamber-idle-in-village)": [
- [16, "event-message-block"]
- ],
+ "(code exit-chamber-idle-in-village)": [[16, "event-message-block"]],
"(code exit-chamber-lower)": [
[16, "event-message-block"],
@@ -6001,42 +5155,26 @@
[96, "vector"]
],
- "(method 32 sequenceA-village1)": [
- [16, "event-message-block"]
- ],
+ "(method 32 sequenceA-village1)": [[16, "event-message-block"]],
- "(event play-anim sequenceA-village1)": [
- [16, "event-message-block"]
- ],
+ "(event play-anim sequenceA-village1)": [[16, "event-message-block"]],
- "(exit play-anim sequenceA-village1)": [
- [16, "event-message-block"]
- ],
+ "(exit play-anim sequenceA-village1)": [[16, "event-message-block"]],
- "(code gorge-start-idle)": [
- [16, "event-message-block"]
- ],
+ "(code gorge-start-idle)": [[16, "event-message-block"]],
- "(trans joint-exploder-shatter)": [
- [16, "bounding-box"]
- ],
+ "(trans joint-exploder-shatter)": [[16, "bounding-box"]],
"(method 22 joint-exploder)": [
[16, "vector"],
[32, "collide-tri-result"]
],
- "(enter target-tube-hit)": [
- [16, "event-message-block"]
- ],
+ "(enter target-tube-hit)": [[16, "event-message-block"]],
- "(event slide-control-ride slide-control)": [
- [16, "event-message-block"]
- ],
+ "(event slide-control-ride slide-control)": [[16, "event-message-block"]],
- "(code target-tube-death)": [
- [16, "vector"]
- ],
+ "(code target-tube-death)": [[16, "vector"]],
"(code target-tube-hit)": [
[16, "vector"],
@@ -6063,15 +5201,11 @@
[48, "vector"]
],
- "(method 14 collide-cache)" : [
- [16, "bounding-box"]
- ],
+ "(method 14 collide-cache)": [[16, "bounding-box"]],
- "(method 23 collide-shape-prim-mesh)" :[
- [16, "collide-tri-result"]
- ],
+ "(method 23 collide-shape-prim-mesh)": [[16, "collide-tri-result"]],
- "(method 23 collide-shape-prim-sphere)" : [
+ "(method 23 collide-shape-prim-sphere)": [
[16, "vector"],
[32, "vector"],
[48, "collide-tri-result"],
@@ -6079,10 +5213,8 @@
[160, "vector"]
],
- "(method 18 collide-shape-prim-sphere)" : [
- [16, "collide-tri-result"]
- ],
- "target-collision-low-coverage" : [
+ "(method 18 collide-shape-prim-sphere)": [[16, "collide-tri-result"]],
+ "target-collision-low-coverage": [
[64, "collide-tri-result"],
[176, "vector"],
[192, "vector"],
@@ -6104,9 +5236,7 @@
[48, "collide-tri-result"]
],
- "ogreboss-rock-explosion-effect": [
- [16, "event-message-block"]
- ],
+ "ogreboss-rock-explosion-effect": [[16, "event-message-block"]],
"(code ogreboss-dead)": [
[16, "event-message-block"],
@@ -6118,69 +5248,37 @@
[48, "vector"]
],
- "(code ogreboss-die)": [
- [16, "event-message-block"]
- ],
+ "(code ogreboss-die)": [[16, "event-message-block"]],
- "(code ogreboss-stage3-hit)": [
- [16, "event-message-block"]
- ],
+ "(code ogreboss-stage3-hit)": [[16, "event-message-block"]],
- "ogreboss-trigger-steps": [
- [16, "event-message-block"]
- ],
+ "ogreboss-trigger-steps": [[16, "event-message-block"]],
- "(code ogreboss-stage3-throw)": [
- [16, "event-message-block"]
- ],
+ "(code ogreboss-stage3-throw)": [[16, "event-message-block"]],
- "ogreboss-attack-event-handler": [
- [16, "event-message-block"]
- ],
+ "ogreboss-attack-event-handler": [[16, "event-message-block"]],
- "(exit ogreboss-stage3-shuffle)": [
- [16, "event-message-block"]
- ],
+ "(exit ogreboss-stage3-shuffle)": [[16, "event-message-block"]],
- "(trans ogreboss-stage3-shuffle)": [
- [16, "event-message-block"]
- ],
+ "(trans ogreboss-stage3-shuffle)": [[16, "event-message-block"]],
- "ogreboss-submerge": [
- [16, "event-message-block"]
- ],
+ "ogreboss-submerge": [[16, "event-message-block"]],
- "ogreboss-post": [
- [16, "event-message-block"]
- ],
+ "ogreboss-post": [[16, "event-message-block"]],
- "ogreboss-emerge": [
- [16, "event-message-block"]
- ],
+ "ogreboss-emerge": [[16, "event-message-block"]],
- "(code ogreboss-intro)": [
- [16, "event-message-block"]
- ],
+ "(code ogreboss-intro)": [[16, "event-message-block"]],
- "ogreboss-bounce-boulder-event-handler": [
- [16, "event-message-block"]
- ],
+ "ogreboss-bounce-boulder-event-handler": [[16, "event-message-block"]],
- "(enter ogreboss-idle)": [
- [16, "event-message-block"]
- ],
+ "(enter ogreboss-idle)": [[16, "event-message-block"]],
- "ogreboss-super-boulder-event-handler": [
- [16, "event-message-block"]
- ],
+ "ogreboss-super-boulder-event-handler": [[16, "event-message-block"]],
- "(code ogreboss-super-boulder-roll)": [
- [16, "event-message-block"]
- ],
+ "(code ogreboss-super-boulder-roll)": [[16, "event-message-block"]],
- "(code ogreboss-missile-impact)": [
- [16, "overlaps-others-params"]
- ],
+ "(code ogreboss-missile-impact)": [[16, "overlaps-others-params"]],
"(event ogreboss-missile-impact)": [
[16, "event-message-block"],
@@ -6190,9 +5288,7 @@
[224, "vector"]
],
- "(method 18 collide-edge-work)": [
- [16, "pbhp-stack-vars"]
- ],
+ "(method 18 collide-edge-work)": [[16, "pbhp-stack-vars"]],
"(method 9 edge-grab-info)": [
[16, "collide-using-spheres-params"],
@@ -6216,9 +5312,7 @@
[64, "vector"]
],
- "(method 18 nav-control)": [
- [16, "vector"]
- ],
+ "(method 18 nav-control)": [[16, "vector"]],
"(method 9 nav-control)": [
[16, "vector"],
[32, "vector"],
@@ -6237,28 +5331,16 @@
[32, "nav-gap-info"],
[64, "event-message-block"]
],
- "(method 12 nav-control)": [
- [16, "vector"]
- ],
- "(method 13 nav-mesh)": [
- [16, "vector"]
- ],
- "(method 18 nav-mesh)": [
- [16, "vector"]
- ],
- "(method 24 nav-control)": [
- [16, "vector"]
- ],
+ "(method 12 nav-control)": [[16, "vector"]],
+ "(method 13 nav-mesh)": [[16, "vector"]],
+ "(method 18 nav-mesh)": [[16, "vector"]],
+ "(method 24 nav-control)": [[16, "vector"]],
"(method 24 nav-mesh)": [
[16, "vector"],
[32, "vector"]
],
- "(method 22 nav-control)": [
- [16, "vector"]
- ],
- "(method 17 nav-control)": [
- [16, "vector"]
- ],
+ "(method 22 nav-control)": [[16, "vector"]],
+ "(method 17 nav-control)": [[16, "vector"]],
"(method 19 nav-control)": [
[16, "vector"],
[32, "vector"]
@@ -6272,9 +5354,7 @@
[16, "vector"],
[32, "matrix"]
],
- "debug-nav-validate-current-poly": [
- [16, "vector"]
- ],
+ "debug-nav-validate-current-poly": [[16, "vector"]],
"(method 13 nav-control)": [
[16, "vector"],
[32, "vector"],
@@ -6285,73 +5365,39 @@
[288, "vector"]
],
- "(method 28 nav-mesh)": [
- [16, ["inline-array", "nav-vertex", 3]]
- ],
+ "(method 28 nav-mesh)": [[16, ["inline-array", "nav-vertex", 3]]],
- "choose-travel-portal-vertex": [
- [16, "nav-route-portal"]
- ],
+ "choose-travel-portal-vertex": [[16, "nav-route-portal"]],
- "(method 33 nav-control)": [
- [16, "event-message-block"]
- ],
+ "(method 33 nav-control)": [[16, "event-message-block"]],
- "(method 27 nav-control)": [
- [16, "nav-ray"]
- ],
- "(method 16 nav-mesh)": [
- [16, "nav-ray"]
- ],
+ "(method 27 nav-control)": [[16, "nav-ray"]],
+ "(method 16 nav-mesh)": [[16, "nav-ray"]],
- "(method 29 nav-mesh)": [
- [16, ["inline-array", "nav-vertex", 6]]
- ],
+ "(method 29 nav-mesh)": [[16, ["inline-array", "nav-vertex", 6]]],
- "find-closest-circle-ray-intersection": [
- [16, "vector"]
- ],
+ "find-closest-circle-ray-intersection": [[16, "vector"]],
- "(method 20 nav-control)": [
- [16, "vector"]
- ],
- "(method 21 nav-control)": [
- [16, "vector"]
- ],
+ "(method 20 nav-control)": [[16, "vector"]],
+ "(method 21 nav-control)": [[16, "vector"]],
"(method 23 nav-control)": [
[16, "vector"],
[32, "vector"],
[48, "vector"]
],
- "(method 16 nav-control)": [
- [16, "vector"]
- ],
- "(method 25 nav-control)": [
- [16, "vector"]
- ],
- "(method 28 nav-control)": [
- [16, "vector"]
- ],
+ "(method 16 nav-control)": [[16, "vector"]],
+ "(method 25 nav-control)": [[16, "vector"]],
+ "(method 28 nav-control)": [[16, "vector"]],
- "(method 35 nav-control)": [
- [16, "vector"]
- ],
+ "(method 35 nav-control)": [[16, "vector"]],
- "(method 15 nav-mesh)": [
- [16, "nav-ray"]
- ],
+ "(method 15 nav-mesh)": [[16, "nav-ray"]],
- "nav-ray-test-local?": [
- [16, "nav-ray"]
- ],
+ "nav-ray-test-local?": [[16, "nav-ray"]],
- "find-adjacent-bounds": [
- [16, "vector"]
- ],
+ "find-adjacent-bounds": [[16, "vector"]],
- "(method 32 nav-control)": [
- [16, "nav-control-cfs-work"]
- ],
+ "(method 32 nav-control)": [[16, "nav-control-cfs-work"]],
"robotboss-always-trans": [
[16, "vector"],
@@ -6361,22 +5407,16 @@
[64, "event-message-block"]
],
- "(event ropebridge-idle)" : [
+ "(event ropebridge-idle)": [
[16, "vector"],
[32, "vector"]
],
- "(method 21 ropebridge)" : [
- [16, "vector"]
- ],
+ "(method 21 ropebridge)": [[16, "vector"]],
- "(method 24 ropebridge)":[
- [16, "vector"]
- ],
+ "(method 24 ropebridge)": [[16, "vector"]],
- "ropebridge-joint-callback": [
- [16, "vector"]
- ],
+ "ropebridge-joint-callback": [[16, "vector"]],
"(code orbit-plat-rotating)": [
[16, "vector"],
@@ -6384,42 +5424,26 @@
[48, "vector"]
],
- "(code plant-boss-intro)": [
- [16, "event-message-block"]
- ],
+ "(code plant-boss-intro)": [[16, "event-message-block"]],
- "(event notice-blue plat-eco)": [
- [16, "event-message-block"]
- ],
+ "(event notice-blue plat-eco)": [[16, "event-message-block"]],
- "(trans notice-blue plat-eco)": [
- [16, "event-message-block"]
- ],
+ "(trans notice-blue plat-eco)": [[16, "event-message-block"]],
- "(trans plat-idle plat-eco)": [
- [16, "event-message-block"]
- ],
+ "(trans plat-idle plat-eco)": [[16, "event-message-block"]],
- "(trans energydoor-opened)": [
- [16, "event-message-block"]
- ],
+ "(trans energydoor-opened)": [[16, "event-message-block"]],
- "snow-bunny-default-event-handler": [
- [16, "event-message-block"]
- ],
+ "snow-bunny-default-event-handler": [[16, "event-message-block"]],
- "(code notice-blue plat-eco)": [
- [16, "vector"]
- ],
+ "(code notice-blue plat-eco)": [[16, "vector"]],
"(method 51 snow-bunny)": [
[16, "vector"],
[32, "collide-tri-result"]
],
- "(method 53 snow-bunny)": [
- [16, "vector"]
- ],
+ "(method 53 snow-bunny)": [[16, "vector"]],
"(method 54 snow-bunny)": [
[16, "vector"],
@@ -6431,13 +5455,9 @@
[32, "vector"]
],
- "(code nav-enemy-notice snow-bunny)": [
- [16, "vector"]
- ],
+ "(code nav-enemy-notice snow-bunny)": [[16, "vector"]],
- "(trans snow-bunny-attack snow-bunny)": [
- [16, "vector"]
- ],
+ "(trans snow-bunny-attack snow-bunny)": [[16, "vector"]],
"(method 55 snow-bunny)": [
[16, "snow-bunny-retreat-work"],
diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc
index 82b2ad75b1..82a67d1d16 100644
--- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc
+++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc
@@ -80,9 +80,7 @@
[101, "t9", "(function object object object object object object none)"]
],
- "send-event-function": [
- [[7,12], "a0", "process"]
- ],
+ "send-event-function": [[[7, 12], "a0", "process"]],
// MATH
"log2": [[3, "v1", "int"]],
@@ -812,9 +810,7 @@
],
"(method 20 level)": [[[43, 45], "s3", "ramdisk-rpc-fill"]],
- "ja-post": [
- [54, "a1", "process"]
- ],
+ "ja-post": [[54, "a1", "process"]],
"upload-generic-shrub": [
[[3, 13], "t0", "dma-packet"],
@@ -1046,9 +1042,7 @@
"debug-menu-func-decode": [[[12, 14], "a0", "symbol"]],
- "dm-cam-render-float": [
- [72, "v1", "float"]
- ],
+ "dm-cam-render-float": [[72, "v1", "float"]],
"can-hint-be-played?": [[[25, 28], "a0", "level-hint"]],
"debug-menu-rebuild": [[[4, 13], "a0", "debug-menu-item"]],
@@ -1085,7 +1079,7 @@
"blackout": [[[20, 24], "v1", "dma-packet"]],
"(method 15 load-state)": [
[31, "t9", "(function int)"],
- [[291,303], "s5", "entity-actor"],
+ [[291, 303], "s5", "entity-actor"],
[370, "s3", "process-drawable"],
[343, "s5", "symbol"],
[21, "s5", "symbol"]
@@ -1502,9 +1496,7 @@
[[54, 58], "t9", "(function object object)"]
],
- "update-mood-village3": [
- [[245, 311], "s0", "village3-states"]
- ],
+ "update-mood-village3": [[[245, 311], "s0", "village3-states"]],
"update-mood-citadel": [
[291, "s5", "(pointer float)"],
@@ -1536,17 +1528,11 @@
[144, "s4", "(pointer float)"]
],
- "update-mood-snow": [
- [[30, 111], "s5", "snow-states"]
- ],
+ "update-mood-snow": [[[30, 111], "s5", "snow-states"]],
- "update-mood-ogre": [
- [[53, 145], "s4", "ogre-states"]
- ],
+ "update-mood-ogre": [[[53, 145], "s4", "ogre-states"]],
- "update-mood-finalboss": [
- [[40, 348], "s4", "finalboss-states"]
- ],
+ "update-mood-finalboss": [[[40, 348], "s4", "finalboss-states"]],
"ocean-trans-add-upload-table": [
[44, "a0", "dma-packet"],
@@ -1755,13 +1741,9 @@
[140, "s1", "(pointer uint128)"]
],
- "(method 15 level)": [
- [[21, 60], "v1", "(inline-array box8s)"]
- ],
+ "(method 15 level)": [[[21, 60], "v1", "(inline-array box8s)"]],
- "(method 27 level)": [
- [[23, 68], "s2", "(inline-array box8s)"]
- ],
+ "(method 27 level)": [[[23, 68], "s2", "(inline-array box8s)"]],
"unpack-comp-huf": [[[21, 23], "t3", "(pointer uint16)"]],
@@ -2066,9 +2048,7 @@
[118, "a0", "process-drawable"]
],
- "dm-task-get-money": [
- [32, "v1", "float"]
- ],
+ "dm-task-get-money": [[32, "v1", "float"]],
"ground-tween-update": [
[16, "f1", "float"],
@@ -2270,13 +2250,9 @@
[7, "t9", "(function entity-actor entity-actor)"]
],
- "(method 10 drawable-group)": [
- [19, "s5", "drawable-group"]
- ],
+ "(method 10 drawable-group)": [[19, "s5", "drawable-group"]],
- "(method 15 drawable-group)": [
- [19, "s5", "drawable-group"]
- ],
+ "(method 15 drawable-group)": [[19, "s5", "drawable-group"]],
"(method 14 level-group)": [
[[54, 164], "s1", "process-drawable"],
@@ -3096,9 +3072,7 @@
[33, "s4", "process-drawable"]
],
- "(method 23 exit-chamber)": [
- [113, "a0", "fuel-cell"]
- ],
+ "(method 23 exit-chamber)": [[113, "a0", "fuel-cell"]],
"(code exit-chamber-rise)": [
[15, "v1", "fuel-cell"],
@@ -3231,9 +3205,7 @@
[93, "v1", "process-drawable"]
],
- "(code part-tester-idle)": [
- [[16,22], "s5", "process-drawable"]
- ],
+ "(code part-tester-idle)": [[[16, 22], "s5", "process-drawable"]],
"(method 20 hud-money)": [
[35, "a0", "process-drawable"],
@@ -3437,9 +3409,7 @@
"(code helix-slide-door-close)": [[10, "v1", "art-joint-anim"]],
- "(code helix-button-startup)": [
- [39, "v1", "collectable"]
- ],
+ "(code helix-button-startup)": [[39, "v1", "collectable"]],
"(method 73 green-eco-lurker)": [[6, "a1", "touching-shapes-entry"]],
@@ -3998,32 +3968,22 @@
[54, "a0", "pair"]
],
- "command-get-int":[
- [27, "gp", "bfloat"]
- ],
+ "command-get-int": [[27, "gp", "bfloat"]],
- "command-get-float":[
- [30, "gp", "bfloat"]
- ],
+ "command-get-float": [[30, "gp", "bfloat"]],
- "command-get-time":[
- [46, "gp", "bfloat"]
- ],
+ "command-get-time": [[46, "gp", "bfloat"]],
- "command-get-param":[
- [125, "gp", "bfloat"]
- ],
+ "command-get-param": [[125, "gp", "bfloat"]],
- "command-list-get-process":[
- [[78, 88], "s4", "process-drawable"]
- ],
+ "command-list-get-process": [[[78, 88], "s4", "process-drawable"]],
- "add-boundary-shader":[
- [[5,8], "a1", "gs-gif-tag"],
+ "add-boundary-shader": [
+ [[5, 8], "a1", "gs-gif-tag"],
[[11, 35], "s5", "adgif-shader"]
],
- "render-boundary":[
+ "render-boundary": [
[[22, 26], "a0", "dma-packet"],
[[32, 35], "a0", "gs-gif-tag"],
@@ -4037,7 +3997,7 @@
[[120, 123], "v1", "dma-packet"]
],
- "real-main-draw-hook":[
+ "real-main-draw-hook": [
[[225, 229], "a0", "dma-packet"],
[[235, 238], "a0", "gs-gif-tag"],
[243, "a0", "(pointer gs-zbuf)"],
@@ -4069,41 +4029,25 @@
[42, "v1", "target"]
],
- "(code target-racing-smack)": [
- [30, "v1", "art-joint-anim"]
- ],
+ "(code target-racing-smack)": [[30, "v1", "art-joint-anim"]],
- "(code target-racing-hit)": [
- [186, "v1", "art-joint-anim"]
- ],
+ "(code target-racing-hit)": [[186, "v1", "art-joint-anim"]],
- "(code target-racing-death)": [
- [242, "v1", "art-joint-anim"]
- ],
+ "(code target-racing-death)": [[242, "v1", "art-joint-anim"]],
- "(code target-racing-get-on)": [
- [59, "s3", "racer"]
- ],
+ "(code target-racing-get-on)": [[59, "s3", "racer"]],
"(code target-racing-get-off-jump)": [
[67, "s2", "racer"],
[145, "v1", "art-joint-anim"]
],
- "(code target-racing-get-off-hit-ground)": [
- [13, "v1", "art-joint-anim"]
- ],
+ "(code target-racing-get-off-hit-ground)": [[13, "v1", "art-joint-anim"]],
- "(event target-racing-grab)": [
- [24, "a0", "process-drawable"]
- ],
+ "(event target-racing-grab)": [[24, "a0", "process-drawable"]],
- "cam-collision-record-draw": [
- [[44, 275], "s5", "cam-collision-record"]
- ],
- "cam-collision-record-save": [
- [[8, 56], "v1", "cam-collision-record"]
- ],
+ "cam-collision-record-draw": [[[44, 275], "s5", "cam-collision-record"]],
+ "cam-collision-record-save": [[[8, 56], "v1", "cam-collision-record"]],
"(method 9 lod-set)": [["_stack_", 16, "res-tag"]],
@@ -4113,9 +4057,7 @@
[[18, 21], "a0", "process-drawable"]
],
- "(method 18 process-drawable)": [
- [[8, 11], "a0", "collide-shape"]
- ],
+ "(method 18 process-drawable)": [[[8, 11], "a0", "collide-shape"]],
"ja-post": [[[42, 45], "a0", "collide-shape"]],
"transform-post": [[[3, 6], "a0", "collide-shape"]],
@@ -4143,9 +4085,7 @@
[[13, 59], "s4", "joint-control-channel"]
],
- "ja-blend-eval": [
- [[3, 31], "s5", "joint-control-channel"]
- ],
+ "ja-blend-eval": [[[3, 31], "s5", "joint-control-channel"]],
"joint-control-reset!": [
[4, "a1", "pointer"],
@@ -4159,13 +4099,9 @@
[38, "a0", "pointer"]
],
- "fill-skeleton-cache": [
- [[11, 33], "a2", "bone-cache"]
- ],
+ "fill-skeleton-cache": [[[11, 33], "a2", "bone-cache"]],
- "dma-add-process-drawable-hud": [
- [[12, 27], "v1", "vu-lights"]
- ],
+ "dma-add-process-drawable-hud": [[[12, 27], "v1", "vu-lights"]],
"dma-add-process-drawable": [
[12, "a0", "terrain-context"],
@@ -4219,58 +4155,34 @@
[14, "t9", "(function process-drawable int process-drawable)"]
],
- "(trans junglesnake-wake)": [
- [15, "v1", "collide-shape-prim-group"]
- ],
+ "(trans junglesnake-wake)": [[15, "v1", "collide-shape-prim-group"]],
- "(trans junglesnake-attack)": [
- [15, "v1", "collide-shape-prim-group"]
- ],
+ "(trans junglesnake-attack)": [[15, "v1", "collide-shape-prim-group"]],
- "(method 23 junglesnake)": [
- [6, "v1", "collide-shape-prim-group"]
- ],
+ "(method 23 junglesnake)": [[6, "v1", "collide-shape-prim-group"]],
- "(method 24 junglesnake)": [
- [5, "v1", "collide-shape-prim-group"]
- ],
+ "(method 24 junglesnake)": [[5, "v1", "collide-shape-prim-group"]],
- "(trans junglesnake-tracking)": [
- [79, "v1", "collide-shape-prim-group"]
- ],
+ "(trans junglesnake-tracking)": [[79, "v1", "collide-shape-prim-group"]],
- "(code junglesnake-wake)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code junglesnake-wake)": [[10, "v1", "art-joint-anim"]],
- "(code junglesnake-tracking)": [
- [51, "v1", "art-joint-anim"]
- ],
+ "(code junglesnake-tracking)": [[51, "v1", "art-joint-anim"]],
- "(code junglesnake-die)": [
- [23, "v1", "art-joint-anim"]
- ],
+ "(code junglesnake-die)": [[23, "v1", "art-joint-anim"]],
- "(code junglesnake-give-up)": [
- [29, "v1", "art-joint-anim"]
- ],
+ "(code junglesnake-give-up)": [[29, "v1", "art-joint-anim"]],
- "(code junglesnake-attack)": [
- [43, "v1", "art-joint-anim"]
- ],
+ "(code junglesnake-attack)": [[43, "v1", "art-joint-anim"]],
"(method 21 junglesnake)": [
[15, "v1", "junglesnake-tilt-joint"],
[18, "v1", "junglesnake-twist-joint"]
],
- "(method 11 viewer)": [
- [1, "a1", "entity-actor"]
- ],
+ "(method 11 viewer)": [[1, "a1", "entity-actor"]],
- "(code windmill-one-idle)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code windmill-one-idle)": [[10, "v1", "art-joint-anim"]],
"(code harvester-inflate)": [
[11, "v1", "art-joint-anim"],
@@ -4287,17 +4199,11 @@
[14, "t9", "(function process-drawable int process-drawable)"]
],
- "(event flutflutegg-idle)": [
- [30, "gp", "process-drawable"]
- ],
+ "(event flutflutegg-idle)": [[30, "gp", "process-drawable"]],
- "(event flutflutegg-physics)": [
- [37, "gp", "process-drawable"]
- ],
+ "(event flutflutegg-physics)": [[37, "gp", "process-drawable"]],
- "(trans flutflutegg-idle)": [
- [17, "v1", "float"]
- ],
+ "(trans flutflutegg-idle)": [[17, "v1", "float"]],
"beachcam-spawn": [
[[57, 85], "gp", "handle"],
@@ -4307,17 +4213,11 @@
[[103, 110], "s5", "handle"]
],
- "(code ecoventrock-break)": [
- [338, "gp", "handle"]
- ],
+ "(code ecoventrock-break)": [[338, "gp", "handle"]],
- "(code target-warp-in)": [
- [192, "v1", "art-joint-anim"]
- ],
+ "(code target-warp-in)": [[192, "v1", "art-joint-anim"]],
- "(method 26 warp-gate-switch)": [
- [60, "v1", "art-joint-anim"]
- ],
+ "(method 26 warp-gate-switch)": [[60, "v1", "art-joint-anim"]],
"(method 31 warp-gate-switch)": [
[61, "t9", "(function basebutton symbol none)"]
@@ -4328,73 +4228,41 @@
[81, "t9", "(function none :behavior basebutton)"]
],
- "(method 11 village-cam)": [
- [21, "s5", "entity-actor"]
- ],
+ "(method 11 village-cam)": [[21, "s5", "entity-actor"]],
- "(code idle warp-gate)": [
- [35, "a0", "symbol"]
- ],
+ "(code idle warp-gate)": [[35, "a0", "symbol"]],
- "(method 21 citb-arm)": [
- [7, "t9", "(function citb-arm-section none)"]
- ],
+ "(method 21 citb-arm)": [[7, "t9", "(function citb-arm-section none)"]],
"(method 21 citb-arm-shoulder)": [
[7, "t9", "(function citb-arm-section none)"]
],
- "(method 21 citb-arm-a)": [
- [14, "t9", "(function citb-arm none)"]
- ],
+ "(method 21 citb-arm-a)": [[14, "t9", "(function citb-arm none)"]],
- "(method 21 citb-arm-b)": [
- [14, "t9", "(function citb-arm none)"]
- ],
+ "(method 21 citb-arm-b)": [[14, "t9", "(function citb-arm none)"]],
- "(method 21 citb-arm-c)": [
- [14, "t9", "(function citb-arm none)"]
- ],
+ "(method 21 citb-arm-c)": [[14, "t9", "(function citb-arm none)"]],
- "(method 21 citb-arm-d)": [
- [14, "t9", "(function citb-arm none)"]
- ],
+ "(method 21 citb-arm-d)": [[14, "t9", "(function citb-arm none)"]],
- "(method 21 citb-arm-shoulder-a)": [
- [14, "t9", "(function citb-arm none)"]
- ],
+ "(method 21 citb-arm-shoulder-a)": [[14, "t9", "(function citb-arm none)"]],
- "(method 21 citb-arm-shoulder-b)": [
- [14, "t9", "(function citb-arm none)"]
- ],
+ "(method 21 citb-arm-shoulder-b)": [[14, "t9", "(function citb-arm none)"]],
- "(method 26 citb-button)": [
- [31, "v1", "art-joint-anim"]
- ],
+ "(method 26 citb-button)": [[31, "v1", "art-joint-anim"]],
- "(code citb-coil-break)": [
- [19, "v1", "art-joint-anim"]
- ],
+ "(code citb-coil-break)": [[19, "v1", "art-joint-anim"]],
- "(code citb-coil-broken)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code citb-coil-broken)": [[10, "v1", "art-joint-anim"]],
- "(code citb-hose-idle)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code citb-hose-idle)": [[10, "v1", "art-joint-anim"]],
- "(code citb-hose-spawn)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code citb-hose-spawn)": [[14, "v1", "art-joint-anim"]],
- "(code citb-hose-die)": [
- [19, "v1", "art-joint-anim"]
- ],
+ "(code citb-hose-die)": [[19, "v1", "art-joint-anim"]],
- "(code citadelcam-stair-plats)": [
- [79, "gp", "handle"]
- ],
+ "(code citadelcam-stair-plats)": [[79, "gp", "handle"]],
"(code battlecontroller-play-intro-camera citb-battlecontroller)": [
[55, "gp", "handle"],
@@ -4419,33 +4287,19 @@
[176, "v1", "art-joint-anim"]
],
- "(code idle logtrap)": [
- [12, "v1", "art-joint-anim"]
- ],
+ "(code idle logtrap)": [[12, "v1", "art-joint-anim"]],
- "(code towertop-idle)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code towertop-idle)": [[10, "v1", "art-joint-anim"]],
- "(code lurkerm-tall-sail-idle)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code lurkerm-tall-sail-idle)": [[10, "v1", "art-joint-anim"]],
- "(code lurkerm-short-sail-idle)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code lurkerm-short-sail-idle)": [[10, "v1", "art-joint-anim"]],
- "(code lurkerm-piston-idle)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code lurkerm-piston-idle)": [[10, "v1", "art-joint-anim"]],
- "(code precurbridge-activate)": [
- [31, "v1", "art-joint-anim"]
- ],
+ "(code precurbridge-activate)": [[31, "v1", "art-joint-anim"]],
- "(event precurbridge-active)": [
- [4, "gp", "touching-shapes-entry"]
- ],
+ "(event precurbridge-active)": [[4, "gp", "touching-shapes-entry"]],
"(method 7 jngpusher)": [
[14, "t9", "(function process-drawable int process-drawable)"]
@@ -4457,25 +4311,17 @@
[148, "v0", "(pointer float)"]
],
- "(code starfish-patrol)": [
- [16, "v1", "art-joint-anim"]
- ],
+ "(code starfish-patrol)": [[16, "v1", "art-joint-anim"]],
"(method 7 hutlamp)": [
[14, "t9", "(function process-drawable int process-drawable)"]
],
- "(code mis-bone-bridge-bump)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code mis-bone-bridge-bump)": [[10, "v1", "art-joint-anim"]],
- "(code mis-bone-bridge-hit)": [
- [21, "v1", "art-joint-anim"]
- ],
+ "(code mis-bone-bridge-hit)": [[21, "v1", "art-joint-anim"]],
- "(code mis-bone-bridge-fall)": [
- [50, "v1", "art-joint-anim"]
- ],
+ "(code mis-bone-bridge-fall)": [[50, "v1", "art-joint-anim"]],
"(method 23 bone-platform)": [
[9, "t9", "(function rigid-body-platform basic none)"]
@@ -4496,9 +4342,7 @@
[7, "t9", "(function battlecontroller none)"]
],
- "(code boat-fuelcell-spawn)": [
- [50, "gp", "handle"]
- ],
+ "(code boat-fuelcell-spawn)": [[50, "gp", "handle"]],
"(code pov-camera-playing village2cam)": [
[12, "v1", "art-joint-anim"],
@@ -4514,9 +4358,7 @@
[14, "v1", "collide-shape-prim-group"]
],
- "fireboulder-hover-stuff": [
- [20, "v1", "(pointer part-tracker)"]
- ],
+ "fireboulder-hover-stuff": [[20, "v1", "(pointer part-tracker)"]],
"(code ogreboss-village2-throw)": [
[179, "v1", "art-joint-anim"],
@@ -4532,9 +4374,7 @@
[319, "v1", "art-joint-anim"]
],
- "(code fireboulder-idle)": [
- [58, "a0", "(pointer part-tracker)"]
- ],
+ "(code fireboulder-idle)": [[58, "a0", "(pointer part-tracker)"]],
"(code swamp-spike-idle)": [
[119, "v1", "art-joint-anim"],
@@ -4542,9 +4382,7 @@
[312, "v1", "art-joint-anim"]
],
- "(code swamp-spike-gate-up)": [
- [60, "v1", "art-joint-anim"]
- ],
+ "(code swamp-spike-gate-up)": [[60, "v1", "art-joint-anim"]],
"(method 23 tar-plat)": [
[9, "t9", "(function rigid-body-platform basic none)"]
@@ -4562,21 +4400,13 @@
[3, "v1", "(pointer swamp-spike)"]
],
- "(code pov-camera-playing maincavecam)": [
- [[40, 54], "gp", "handle"]
- ],
+ "(code pov-camera-playing maincavecam)": [[[40, 54], "gp", "handle"]],
- "(code cavecrusher-idle)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code cavecrusher-idle)": [[10, "v1", "art-joint-anim"]],
- "(code idle cavetrapdoor)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code idle cavetrapdoor)": [[10, "v1", "art-joint-anim"]],
- "(code caveelevator-one-way-idle-end)": [
- [19, "v1", "art-joint-anim"]
- ],
+ "(code caveelevator-one-way-idle-end)": [[19, "v1", "art-joint-anim"]],
"(code trigger cavetrapdoor)": [
[23, "v1", "art-joint-anim"],
@@ -4608,25 +4438,15 @@
[502, "v1", "art-joint-anim"]
],
- "(code seaweed-idle)": [
- [36, "v1", "art-joint-anim"]
- ],
+ "(code seaweed-idle)": [[36, "v1", "art-joint-anim"]],
- "(code dark-plant-death)": [
- [36, "v1", "art-joint-anim"]
- ],
+ "(code dark-plant-death)": [[36, "v1", "art-joint-anim"]],
- "(code dark-plant-sprout)": [
- [34, "v1", "art-joint-anim"]
- ],
+ "(code dark-plant-sprout)": [[34, "v1", "art-joint-anim"]],
- "(code happy-plant-opened)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code happy-plant-opened)": [[10, "v1", "art-joint-anim"]],
- "(code rolling-start-whole)": [
- [16, "v1", "art-joint-anim"]
- ],
+ "(code rolling-start-whole)": [[16, "v1", "art-joint-anim"]],
"(code rolling-start-break)": [
[11, "v1", "art-joint-anim"],
@@ -4645,13 +4465,9 @@
[139, "v1", "float"]
],
- "(code dark-plant-gone)": [
- [14, "v1", "float"]
- ],
+ "(code dark-plant-gone)": [[14, "v1", "float"]],
- "dark-plants-all-done": [
- [25, "v1", "dark-plant"]
- ],
+ "dark-plants-all-done": [[25, "v1", "dark-plant"]],
"(code happy-plant-opening)": [
[76, "gp", "handle"],
@@ -4662,86 +4478,52 @@
[[185, 192], "s5", "handle"]
],
- "(trans spike-idle)": [
- [70, "v1", "float"]
- ],
+ "(trans spike-idle)": [[70, "v1", "float"]],
"(method 23 ogre-plat)": [
[9, "t9", "(function rigid-body-platform basic none)"]
],
- "(method 31 ogre-step)": [
- [23, "t9", "(function ogre-plat none)"]
- ],
+ "(method 31 ogre-step)": [[23, "t9", "(function ogre-plat none)"]],
- "(method 31 ogre-step-a)": [
- [25, "t9", "(function ogre-step none)"]
- ],
+ "(method 31 ogre-step-a)": [[25, "t9", "(function ogre-step none)"]],
- "(method 31 ogre-step-b)": [
- [25, "t9", "(function ogre-step none)"]
- ],
+ "(method 31 ogre-step-b)": [[25, "t9", "(function ogre-step none)"]],
- "(method 31 ogre-step-c)": [
- [25, "t9", "(function ogre-step none)"]
- ],
+ "(method 31 ogre-step-c)": [[25, "t9", "(function ogre-step none)"]],
- "(method 31 ogre-step-d)": [
- [25, "t9", "(function ogre-step none)"]
- ],
+ "(method 31 ogre-step-d)": [[25, "t9", "(function ogre-step none)"]],
- "(method 31 ogre-isle)": [
- [17, "t9", "(function ogre-plat none)"]
- ],
+ "(method 31 ogre-isle)": [[17, "t9", "(function ogre-plat none)"]],
- "(method 31 ogre-isle-b)": [
- [31, "t9", "(function ogre-isle none)"]
- ],
+ "(method 31 ogre-isle-b)": [[31, "t9", "(function ogre-isle none)"]],
- "(method 31 ogre-isle-c)": [
- [31, "t9", "(function ogre-isle none)"]
- ],
+ "(method 31 ogre-isle-c)": [[31, "t9", "(function ogre-isle none)"]],
- "(method 31 ogre-isle-d)": [
- [37, "t9", "(function ogre-isle none)"]
- ],
+ "(method 31 ogre-isle-d)": [[37, "t9", "(function ogre-isle none)"]],
"(method 7 ogre-bridge)": [
[26, "t9", "(function process-drawable int process-drawable)"]
],
- "(code ogre-bridge-activate)": [
- [33, "v1", "art-joint-anim"]
- ],
+ "(code ogre-bridge-activate)": [[33, "v1", "art-joint-anim"]],
- "(code water-vol-idle ogre-lava)": [
- [36, "v1", "art-joint-anim"]
- ],
+ "(code water-vol-idle ogre-lava)": [[36, "v1", "art-joint-anim"]],
- "(code ogre-bridge-break)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code ogre-bridge-break)": [[10, "v1", "art-joint-anim"]],
- "(code ogre-bridge-activated)": [
- [13, "v1", "art-joint-anim"]
- ],
+ "(code ogre-bridge-activated)": [[13, "v1", "art-joint-anim"]],
"(code snow-eggtop-activate)": [
[56, "v1", "snowcam"],
[87, "v1", "art-joint-anim"]
],
- "(code snow-eggtop-idle-down)": [
- [32, "v1", "art-joint-anim"]
- ],
+ "(code snow-eggtop-idle-down)": [[32, "v1", "art-joint-anim"]],
- "(code snow-log-active)": [
- [30, "v1", "art-joint-anim"]
- ],
+ "(code snow-log-active)": [[30, "v1", "art-joint-anim"]],
- "(code snow-log-activate)": [
- [25, "v1", "art-joint-anim"]
- ],
+ "(code snow-log-activate)": [[25, "v1", "art-joint-anim"]],
"(code snow-gears-activate)": [
[25, "v1", "art-joint-anim"],
@@ -4766,13 +4548,9 @@
[19, "t9", "(function process-drawable int process-drawable)"]
],
- "(code snow-button-activate)": [
- [25, "v1", "art-joint-anim"]
- ],
+ "(code snow-button-activate)": [[25, "v1", "art-joint-anim"]],
- "(code snow-button-deactivate)": [
- [26, "v1", "art-joint-anim"]
- ],
+ "(code snow-button-deactivate)": [[26, "v1", "art-joint-anim"]],
"(code plat-startup flutflut-plat)": [
[62, "t9", "(function none :behavior plat)"]
@@ -4782,9 +4560,7 @@
[14, "t9", "(function darkecobarrel-base int darkecobarrel-base)"]
],
- "(event darkecobarrel-mover-move)": [
- [76, "v1", "process-drawable"]
- ],
+ "(event darkecobarrel-mover-move)": [[76, "v1", "process-drawable"]],
"(code darkecobarrel-mover-move)": [
[10, "v1", "float"],
@@ -4795,17 +4571,11 @@
[4, "t9", "(function none :behavior lavatube-lava)"]
],
- "darkecobarrel-mover-pos": [
- [135, "v1", "uint"]
- ],
+ "darkecobarrel-mover-pos": [[135, "v1", "uint"]],
- "(code startup logo)": [
- [352, "v1", "art-joint-anim"]
- ],
+ "(code startup logo)": [[352, "v1", "art-joint-anim"]],
- "(code idle logo)": [
- [78, "v1", "art-joint-anim"]
- ],
+ "(code idle logo)": [[78, "v1", "art-joint-anim"]],
"(code target-title)": [
// [[19, 22], "v1", "handle"],
@@ -4814,13 +4584,9 @@
[214, "s5", "handle"]
],
- "(event idle logo-slave)": [
- [14, "v1", "uint"]
- ],
+ "(event idle logo-slave)": [[14, "v1", "uint"]],
- "(method 11 training-cam)": [
- [21, "s5", "entity-actor"]
- ],
+ "(method 11 training-cam)": [[21, "s5", "entity-actor"]],
"(method 23 tra-pontoon)": [
[9, "t9", "(function rigid-body-platform float none)"]
@@ -4832,13 +4598,9 @@
[142, "gp", "target"]
],
- "(code idle scarecrow-a)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code idle scarecrow-a)": [[14, "v1", "art-joint-anim"]],
- "(code idle scarecrow-b)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code idle scarecrow-b)": [[14, "v1", "art-joint-anim"]],
"(code hit scarecrow-a)": [
[30, "v1", "art-joint-anim"],
@@ -4852,21 +4614,14 @@
[143, "v1", "art-joint-anim"]
],
- "(method 27 orb-cache-top)": [
- [155, "a0", "process-drawable"]
- ],
+ "(method 27 orb-cache-top)": [[155, "a0", "process-drawable"]],
- "(method 9 art)": [
- [9, "v1", "(pointer res-tag)"]
- ],
-
- "(method 9 art-joint-anim)": [
- [9, "v1", "(pointer res-tag)"]
- ],
+ "(method 9 art)": [[9, "v1", "(pointer res-tag)"]],
+ "(method 9 art-joint-anim)": [[9, "v1", "(pointer res-tag)"]],
"draw-drawable-tree-tfrag": [
- [[16,32], "v1", "drawable-inline-array-node"],
+ [[16, 32], "v1", "drawable-inline-array-node"],
[18, "a0", "drawable-inline-array-node"],
[142, "v1", "terrain-context"],
[238, "v1", "terrain-context"],
@@ -4879,7 +4634,7 @@
],
"draw-drawable-tree-trans-tfrag": [
- [[16,32], "v1", "drawable-inline-array-node"],
+ [[16, 32], "v1", "drawable-inline-array-node"],
[22, "a2", "terrain-context"],
[25, "a2", "terrain-context"],
[44, "a0", "terrain-context"],
@@ -4891,7 +4646,7 @@
],
"draw-drawable-tree-dirt-tfrag": [
- [[16,32], "v1", "drawable-inline-array-node"],
+ [[16, 32], "v1", "drawable-inline-array-node"],
[22, "a2", "terrain-context"],
[25, "a2", "terrain-context"],
[44, "a0", "terrain-context"],
@@ -4903,7 +4658,7 @@
],
"draw-drawable-tree-ice-tfrag": [
- [[16,32], "v1", "drawable-inline-array-node"],
+ [[16, 32], "v1", "drawable-inline-array-node"],
[22, "a2", "terrain-context"],
[25, "a2", "terrain-context"],
[44, "a0", "terrain-context"],
@@ -4914,37 +4669,25 @@
[[216, 219], "v1", "dma-packet"]
],
- "(method 10 drawable-tree-tfrag)": [
- [3, "a1", "terrain-context"]
- ],
+ "(method 10 drawable-tree-tfrag)": [[3, "a1", "terrain-context"]],
- "(method 10 drawable-tree-trans-tfrag)": [
- [3, "a1", "terrain-context"]
- ],
+ "(method 10 drawable-tree-trans-tfrag)": [[3, "a1", "terrain-context"]],
- "(method 10 drawable-tree-dirt-tfrag)": [
- [3, "a1", "terrain-context"]
- ],
+ "(method 10 drawable-tree-dirt-tfrag)": [[3, "a1", "terrain-context"]],
- "(method 10 drawable-tree-ice-tfrag)": [
- [3, "a1", "terrain-context"]
- ],
+ "(method 10 drawable-tree-ice-tfrag)": [[3, "a1", "terrain-context"]],
- "(method 10 drawable-tree-lowres-tfrag)": [
- [3, "a1", "terrain-context"]
- ],
+ "(method 10 drawable-tree-lowres-tfrag)": [[3, "a1", "terrain-context"]],
"(method 10 drawable-tree-lowres-trans-tfrag)": [
[3, "a1", "terrain-context"]
],
- "(method 15 drawable-tree-array)": [
- [11, "s5", "drawable-tree-array"]
- ],
+ "(method 15 drawable-tree-array)": [[11, "s5", "drawable-tree-array"]],
"tfrag-near-end-buffer": [
[[3, 7], "a1", "dma-packet"],
- [[15,20], "a0", "(pointer vif-tag)"],
+ [[15, 20], "a0", "(pointer vif-tag)"],
[[20, 24], "a0", "(pointer uint32)"],
[[25, 31], "a0", "(pointer vif-tag)"]
],
@@ -4959,7 +4702,7 @@
"tfrag-end-buffer": [
[[3, 7], "a1", "dma-packet"],
- [[13,20], "a0", "(pointer vif-tag)"],
+ [[13, 20], "a0", "(pointer vif-tag)"],
[[20, 24], "a0", "(pointer uint32)"],
[[25, 31], "a0", "(pointer vif-tag)"]
],
@@ -4977,16 +4720,10 @@
[[26, 30], "v1", "dma-packet"]
],
- "add-tfrag-mtx-1": [
- [[8, 16], "a0", "dma-packet"]
- ],
- "add-tfrag-mtx-0": [
- [[8, 16], "a0", "dma-packet"]
- ],
+ "add-tfrag-mtx-1": [[[8, 16], "a0", "dma-packet"]],
+ "add-tfrag-mtx-0": [[[8, 16], "a0", "dma-packet"]],
- "(method 11 swingpole)": [
- [27, "s5", "entity-actor"]
- ],
+ "(method 11 swingpole)": [[27, "s5", "entity-actor"]],
"(anon-function 54 generic-obs)": [
[57, "v1", "process-drawable"],
@@ -5005,9 +4742,7 @@
[30, "gp", "process-drawable"]
],
- "ja-anim-done?": [
- [27, "gp", "process-drawable"]
- ],
+ "ja-anim-done?": [[27, "gp", "process-drawable"]],
"camera-pov-from": [
[23, "gp", "process-drawable"],
@@ -5019,13 +4754,9 @@
[33, "s4", "collide-shape"]
],
- "launcher-init-by-other": [
- [134, "v0", "vector"]
- ],
+ "launcher-init-by-other": [[134, "v0", "vector"]],
- "(method 11 launcher)": [
- [130, "v0", "vector"]
- ],
+ "(method 11 launcher)": [[130, "v0", "vector"]],
"(method 11 part-spawner)": [
["_stack_", 16, "res-tag"],
@@ -5042,9 +4773,7 @@
[25, "v1", "quaternion"] // code
],
- "camera-tracker-init": [
- [69, "v1", "process"]
- ],
+ "camera-tracker-init": [[69, "v1", "process"]],
"camera-anim": [
[26, "t9", "(function process function object object object object object)"]
@@ -5062,9 +4791,7 @@
[313, "a0", "float"]
],
- "command-get-trans": [
- [29, "s4", "target"]
- ],
+ "command-get-trans": [[29, "s4", "target"]],
"(trans manipy-idle)": [
[57, "v1", "process-drawable"],
@@ -5092,25 +4819,17 @@
[30, "gp", "process-drawable"]
],
- "(event part-spawner-active)": [
- [25, "v1", "vector"]
- ],
+ "(event part-spawner-active)": [[25, "v1", "vector"]],
- "(exit launcher-active)": [
- [2, "v0", "sound-rpc-set-param"]
- ],
+ "(exit launcher-active)": [[2, "v0", "sound-rpc-set-param"]],
- "command-get-camera": [
- [27, "gp", "symbol"]
- ],
+ "command-get-camera": [[27, "gp", "symbol"]],
"(method 7 plant-boss)": [
[47, "t9", "(function process-drawable int process-drawable)"]
],
- "(code plant-boss-arm-hit)": [
- [88, "v1", "art-joint-anim"]
- ],
+ "(code plant-boss-arm-hit)": [[88, "v1", "art-joint-anim"]],
"(code plant-boss-arm-die)": [
[3, "v1", "collide-shape-prim-group"],
@@ -5121,47 +4840,31 @@
[186, "v1", "art-joint-anim"]
],
- "(code plant-boss-back-arms-idle)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code plant-boss-back-arms-idle)": [[10, "v1", "art-joint-anim"]],
- "(code plant-boss-vine-hit)": [
- [88, "v1", "art-joint-anim"]
- ],
+ "(code plant-boss-vine-hit)": [[88, "v1", "art-joint-anim"]],
- "(code plant-boss-dead-bounce)": [
- [79, "v1", "art-joint-anim"]
- ],
+ "(code plant-boss-dead-bounce)": [[79, "v1", "art-joint-anim"]],
- "(code plant-boss-vine-die)": [
- [46, "v1", "art-joint-anim"]
- ],
+ "(code plant-boss-vine-die)": [[46, "v1", "art-joint-anim"]],
- "(code plant-boss-dead-idle)": [
- [16, "v1", "art-joint-anim"]
- ],
+ "(code plant-boss-dead-idle)": [[16, "v1", "art-joint-anim"]],
"(code plant-boss-dead)": [
[45, "v1", "art-joint-anim"],
[113, "v1", "art-joint-anim"]
],
- "(code plant-boss-root-idle)": [
- [17, "v1", "art-joint-anim"]
- ],
+ "(code plant-boss-root-idle)": [[17, "v1", "art-joint-anim"]],
- "(code plant-boss-eat)": [
- [274, "v1", "art-joint-anim"]
- ],
+ "(code plant-boss-eat)": [[274, "v1", "art-joint-anim"]],
"(code plant-boss-vulnerable)": [
[149, "v1", "art-joint-anim"],
[221, "v1", "art-joint-anim"]
],
- "(code plant-boss-far-idle)": [
- [62, "v1", "art-joint-anim"]
- ],
+ "(code plant-boss-far-idle)": [[62, "v1", "art-joint-anim"]],
"(code plant-boss-idle)": [
[25, "v1", "art-joint-anim"],
@@ -5192,39 +4895,27 @@
[74, "v1", "art-joint-anim"]
],
- "(code plant-boss-vine-idle)": [
- [17, "v1", "art-joint-anim"]
- ],
+ "(code plant-boss-vine-idle)": [[17, "v1", "art-joint-anim"]],
"(code plant-boss-back-arms-die)": [
[20, "v1", "art-joint-anim"],
[82, "v1", "art-joint-anim"]
],
- "(code plant-boss-back-arms-hit)": [
- [149, "v1", "art-joint-anim"]
- ],
+ "(code plant-boss-back-arms-hit)": [[149, "v1", "art-joint-anim"]],
- "(method 7 ice-cube)": [
- [24, "t9", "(function nav-enemy int nav-enemy)"]
- ],
+ "(method 7 ice-cube)": [[24, "t9", "(function nav-enemy int nav-enemy)"]],
- "(code ice-cube-appear)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code ice-cube-appear)": [[14, "v1", "art-joint-anim"]],
"(code ice-cube-tired)": [
[14, "v1", "art-joint-anim"],
[68, "v1", "art-joint-anim"]
],
- "(code ice-cube-become-mean)": [
- [15, "v1", "art-joint-anim"]
- ],
+ "(code ice-cube-become-mean)": [[15, "v1", "art-joint-anim"]],
- "(code ice-cube-retract-spikes)": [
- [22, "v1", "art-joint-anim"]
- ],
+ "(code ice-cube-retract-spikes)": [[22, "v1", "art-joint-anim"]],
"(code ice-cube-mean-turn-to-charge)": [
[15, "v1", "art-joint-anim"],
@@ -5236,13 +4927,9 @@
[187, "v1", "art-joint-anim"]
],
- "(code ice-cube-appear-land)": [
- [37, "v1", "art-joint-anim"]
- ],
+ "(code ice-cube-appear-land)": [[37, "v1", "art-joint-anim"]],
- "(code nav-enemy-patrol ice-cube)": [
- [8, "t9", "(function none)"]
- ],
+ "(code nav-enemy-patrol ice-cube)": [[8, "t9", "(function none)"]],
"(event double-lurker-top-on-shoulders)": [
[5, "a0", "vector"],
@@ -5250,37 +4937,21 @@
[24, "v1", "vector"]
],
- "(code double-lurker-top-on-shoulders-die)": [
- [18, "v1", "art-joint-anim"]
- ],
+ "(code double-lurker-top-on-shoulders-die)": [[18, "v1", "art-joint-anim"]],
- "(code double-lurker-top-knocked-down)": [
- [51, "v1", "art-joint-anim"]
- ],
+ "(code double-lurker-top-knocked-down)": [[51, "v1", "art-joint-anim"]],
- "(code double-lurker-both-knocked-back)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code double-lurker-both-knocked-back)": [[14, "v1", "art-joint-anim"]],
- "(code double-lurker-knocked-back)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code double-lurker-knocked-back)": [[14, "v1", "art-joint-anim"]],
- "(code double-lurker-break-apart)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code double-lurker-break-apart)": [[10, "v1", "art-joint-anim"]],
- "(code nav-enemy-patrol double-lurker-top)": [
- [27, "t9", "(function none)"]
- ],
+ "(code nav-enemy-patrol double-lurker-top)": [[27, "t9", "(function none)"]],
- "(code nav-enemy-patrol double-lurker)": [
- [27, "t9", "(function none)"]
- ],
+ "(code nav-enemy-patrol double-lurker)": [[27, "t9", "(function none)"]],
- "double-lurker-default-event-handler": [
- [95, "gp", "target"]
- ],
+ "double-lurker-default-event-handler": [[95, "gp", "target"]],
"(method 51 double-lurker)": [
[6, "v1", "collide-shape-prim-group"],
@@ -5292,30 +4963,20 @@
[26, "t9", "(function process-drawable int process-drawable)"]
],
- "(method 38 billy)": [
- [33, "t9", "(function nav-enemy none)"]
- ],
+ "(method 38 billy)": [[33, "t9", "(function nav-enemy none)"]],
- "(enter nav-enemy-victory billy-rat)": [
- [4, "v0", "(state nav-enemy)"]
- ],
+ "(enter nav-enemy-victory billy-rat)": [[4, "v0", "(state nav-enemy)"]],
- "(code billy-rat-salivate)": [
- [43, "v1", "art-joint-anim"]
- ],
+ "(code billy-rat-salivate)": [[43, "v1", "art-joint-anim"]],
"(code idle billy)": [
[35, "v1", "float"],
[132, "v1", "art-joint-anim"]
],
- "(enter billy-done)": [
- [191, "v1", "float"]
- ],
+ "(enter billy-done)": [[191, "v1", "float"]],
- "(method 43 billy)": [
- [19, "v1", "float"]
- ],
+ "(method 43 billy)": [[19, "v1", "float"]],
"(event billy-done)": [
[15, "v1", "billy-rat"],
@@ -5337,17 +4998,11 @@
[255, "s5", "billy-snack"]
],
- "(code lurkerworm-rise)": [
- [13, "v1", "art-joint-anim"]
- ],
+ "(code lurkerworm-rise)": [[13, "v1", "art-joint-anim"]],
- "(code lurkerworm-sink)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code lurkerworm-sink)": [[10, "v1", "art-joint-anim"]],
- "(code lurkerworm-die)": [
- [19, "v1", "art-joint-anim"]
- ],
+ "(code lurkerworm-die)": [[19, "v1", "art-joint-anim"]],
"(code lurkerworm-rest)": [
[10, "v1", "float"],
@@ -5364,9 +5019,7 @@
[186, "v1", "art-joint-anim"]
],
- "(code pelican-dive)": [
- [161, "v1", "art-joint-anim"]
- ],
+ "(code pelican-dive)": [[161, "v1", "art-joint-anim"]],
"(code pelican-wait-at-nest)": [
[30, "v1", "art-joint-anim"],
@@ -5374,17 +5027,11 @@
[197, "v1", "art-joint-anim"]
],
- "(event pelican-wait-at-nest)": [
- [49, "v1", "process-drawable"]
- ],
+ "(event pelican-wait-at-nest)": [[49, "v1", "process-drawable"]],
- "(code pelican-explode)": [
- [71, "a0", "process-drawable"]
- ],
+ "(code pelican-explode)": [[71, "a0", "process-drawable"]],
- "(event pelican-circle)": [
- [23, "v1", "float"]
- ],
+ "(event pelican-circle)": [[23, "v1", "float"]],
"(code pelican-spit)": [
[42, "gp", "handle"],
@@ -5401,21 +5048,13 @@
[57, "v1", "float"]
],
- "(trans energyarm-idle)": [
- [21, "v1", "float"]
- ],
+ "(trans energyarm-idle)": [[21, "v1", "float"]],
- "(code energyhub-stopped)": [
- [11, "v1", "float"]
- ],
+ "(code energyhub-stopped)": [[11, "v1", "float"]],
- "(code energyhub-stop)": [
- [11, "v1", "float"]
- ],
+ "(code energyhub-stop)": [[11, "v1", "float"]],
- "(code energyhub-idle)": [
- [11, "v1", "float"]
- ],
+ "(code energyhub-idle)": [[11, "v1", "float"]],
"(code energyarm-idle)": [
[13, "v1", "float"],
@@ -5427,45 +5066,25 @@
[28, "v1", "process-drawable"]
],
- "(post idle citb-sage)": [
- [3, "t9", "(function none :behavior citb-sage)"]
- ],
+ "(post idle citb-sage)": [[3, "t9", "(function none :behavior citb-sage)"]],
- "(method 44 red-sagecage)": [
- [35, "t9", "(function citb-sage none)"]
- ],
+ "(method 44 red-sagecage)": [[35, "t9", "(function citb-sage none)"]],
- "(method 44 blue-sagecage)": [
- [35, "t9", "(function citb-sage none)"]
- ],
+ "(method 44 blue-sagecage)": [[35, "t9", "(function citb-sage none)"]],
- "(method 44 yellow-sagecage)": [
- [35, "t9", "(function citb-sage none)"]
- ],
+ "(method 44 yellow-sagecage)": [[35, "t9", "(function citb-sage none)"]],
- "(method 44 green-sagecage)": [
- [35, "t9", "(function citb-sage none)"]
- ],
+ "(method 44 green-sagecage)": [[35, "t9", "(function citb-sage none)"]],
- "(method 43 red-sagecage)": [
- [24, "v1", "float"]
- ],
+ "(method 43 red-sagecage)": [[24, "v1", "float"]],
- "(method 43 blue-sagecage)": [
- [24, "v1", "float"]
- ],
+ "(method 43 blue-sagecage)": [[24, "v1", "float"]],
- "(method 43 yellow-sagecage)": [
- [24, "v1", "float"]
- ],
+ "(method 43 yellow-sagecage)": [[24, "v1", "float"]],
- "(event play-anim green-sagecage)": [
- [128, "s5", "process-drawable"]
- ],
+ "(event play-anim green-sagecage)": [[128, "s5", "process-drawable"]],
- "(method 21 citb-sagecage)": [
- [[27, 97], "v1", "vector"]
- ],
+ "(method 21 citb-sagecage)": [[[27, 97], "v1", "vector"]],
"(code citb-sagecage-idle)": [
[9, "gp", "citb-sage"],
@@ -5487,25 +5106,15 @@
[[15, 21], "v1", "vector"]
],
- "(event fuel-cell-clone-anim)": [
- [35, "a0", "vector"]
- ],
+ "(event fuel-cell-clone-anim)": [[35, "a0", "vector"]],
- "fuel-cell-animate": [
- [9, "gp", "fuel-cell"]
- ],
+ "fuel-cell-animate": [[9, "gp", "fuel-cell"]],
- "(event wait fuel-cell)": [
- [95, "a0", "vector"]
- ],
+ "(event wait fuel-cell)": [[95, "a0", "vector"]],
- "(enter pickup fuel-cell)": [
- [9, "v0", "(state eco-collectable)"]
- ],
+ "(enter pickup fuel-cell)": [[9, "v0", "(state eco-collectable)"]],
- "(code ecovalve-idle)": [
- [41, "v1", "process-drawable"]
- ],
+ "(code ecovalve-idle)": [[41, "v1", "process-drawable"]],
"(code vent-pickup)": [
[25, "gp", "process-drawable"],
@@ -5522,9 +5131,7 @@
[50, "s5", "eco-collectable"]
],
- "fuel-cell-init-by-other": [
- [118, "gp", "vector"]
- ],
+ "fuel-cell-init-by-other": [[118, "gp", "vector"]],
"ecovalve-init-by-other": [
[95, "a0", "process-drawable"],
@@ -5541,25 +5148,15 @@
[153, "v0", "(pointer float)"]
],
- "(event sun-iris-door-closed)": [
- [14, "a0", "vector"]
- ],
+ "(event sun-iris-door-closed)": [[14, "a0", "vector"]],
- "(event sun-iris-door-opening)": [
- [14, "a0", "vector"]
- ],
+ "(event sun-iris-door-opening)": [[14, "a0", "vector"]],
- "(event sun-iris-door-closing)": [
- [14, "a0", "vector"]
- ],
+ "(event sun-iris-door-closing)": [[14, "a0", "vector"]],
- "(event sun-iris-door-open)": [
- [20, "a0", "vector"]
- ],
+ "(event sun-iris-door-open)": [[20, "a0", "vector"]],
- "sun-iris-door-init-by-other": [
- [97, "v1", "art-joint-anim"]
- ],
+ "sun-iris-door-init-by-other": [[97, "v1", "art-joint-anim"]],
"(method 7 steam-cap)": [
[19, "t9", "(function process-drawable int process-drawable)"]
@@ -5581,21 +5178,13 @@
[24, "a0", "int"]
],
- "check-blue-suck": [
- [25, "v1", "collide-shape"]
- ],
+ "check-blue-suck": [[25, "v1", "collide-shape"]],
- "(code die eco)": [
- [53, "v1", "float"]
- ],
+ "(code die eco)": [[53, "v1", "float"]],
- "(trans pickup fuel-cell)": [
- [92, "v1", "float"]
- ],
+ "(trans pickup fuel-cell)": [[92, "v1", "float"]],
- "(enter notice-blue eco-collectable)": [
- [13, "v1", "float"]
- ],
+ "(enter notice-blue eco-collectable)": [[13, "v1", "float"]],
"(code pickup fuel-cell)": [
["_stack_", 96, "res-tag"],
@@ -5610,17 +5199,11 @@
[521, "v1", "game-task"]
],
- "(method 11 eco)": [
- [13, "v0", "pickup-type"]
- ],
+ "(method 11 eco)": [[13, "v0", "pickup-type"]],
- "target-powerup-process": [
- [[200, 215], "v1", "sound-rpc-set-param"]
- ],
+ "target-powerup-process": [[[200, 215], "v1", "sound-rpc-set-param"]],
- "(method 14 touching-list)": [
- [[0,11], "s5", "touching-shapes-entry"]
- ],
+ "(method 14 touching-list)": [[[0, 11], "s5", "touching-shapes-entry"]],
"(method 13 touching-list)": [
[[0, 51], "v0", "touching-shapes-entry"]
@@ -5675,9 +5258,7 @@
[358, "s2", "collide-shape"]
],
- "(method 56 collide-shape-moving)": [
- [89, "v1", "target"]
- ],
+ "(method 56 collide-shape-moving)": [[89, "v1", "target"]],
"(method 20 collide-shape-prim-group)": [
[40, "a0", "collide-shape-prim-group"]
@@ -5693,16 +5274,12 @@
],
"(method 28 collide-shape-prim-mesh)": [
- [[22,45], "s4", "(array collide-mesh)"]
+ [[22, 45], "s4", "(array collide-mesh)"]
],
- "(method 53 collide-shape)": [
- [[24, 40], "v1", "collide-shape-prim-group"]
- ],
+ "(method 53 collide-shape)": [[[24, 40], "v1", "collide-shape-prim-group"]],
- "(method 54 collide-shape)": [
- [[18, 33], "v1", "collide-shape-prim-group"]
- ],
+ "(method 54 collide-shape)": [[[18, 33], "v1", "collide-shape-prim-group"]],
"(method 45 collide-shape)": [
[18, "v1", "connection"],
@@ -5789,8 +5366,8 @@
],
"(method 9 collide-cache)": [
- [[1,29], "gp", "collide-cache-tri"],
- [[29,56], "gp", "collide-cache-prim"],
+ [[1, 29], "gp", "collide-cache-tri"],
+ [[29, 56], "gp", "collide-cache-prim"],
[35, "gp", "collide-cache-prim"],
[50, "gp", "collide-cache-prim"],
[51, "gp", "collide-cache-prim"],
@@ -5808,9 +5385,7 @@
[41, "s4", "collide-shape-prim-group"]
],
- "(method 44 collide-shape)": [
- [26, "a0", "process-drawable"]
- ],
+ "(method 44 collide-shape)": [[26, "a0", "process-drawable"]],
"(method 43 collide-shape)": [
[58, "gp", "collide-shape-moving"],
@@ -5859,30 +5434,20 @@
[243, "v1", "art-joint-anim"]
],
- "(code target-slide-down)": [
- [26, "v1", "art-joint-anim"]
- ],
+ "(code target-slide-down)": [[26, "v1", "art-joint-anim"]],
- "(code target-jump-forward)": [
- [13, "v1", "art-joint-anim"]
- ],
+ "(code target-jump-forward)": [[13, "v1", "art-joint-anim"]],
- "(code target-double-jump)": [
- [24, "v1", "art-joint-anim"]
- ],
+ "(code target-double-jump)": [[24, "v1", "art-joint-anim"]],
"(code target-attack-air)": [
[14, "v1", "art-joint-anim"],
[167, "v1", "art-joint-anim"]
],
- "(code target-attack)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code target-attack)": [[14, "v1", "art-joint-anim"]],
- "(code target-flop)": [
- [13, "v1", "art-joint-anim"]
- ],
+ "(code target-flop)": [[13, "v1", "art-joint-anim"]],
"(code target-duck-stance)": [
[21, "v1", "art-joint-anim"],
@@ -5896,26 +5461,18 @@
[159, "v0", "vector"]
],
- "(code target-duck-high-jump-jump)": [
- [8, "v1", "float"]
- ],
+ "(code target-duck-high-jump-jump)": [[8, "v1", "float"]],
"(event target-running-attack)": [
[41, "v1", "process-drawable"],
[50, "s5", "collide-shape"]
],
- "(enter target-jump)": [
- [53, "v1", "vector"]
- ],
+ "(enter target-jump)": [[53, "v1", "vector"]],
- "(enter target-high-jump)": [
- [21, "v1", "vector"]
- ],
+ "(enter target-high-jump)": [[21, "v1", "vector"]],
- "(enter target-double-jump)": [
- [15, "v1", "vector"]
- ],
+ "(enter target-double-jump)": [[15, "v1", "vector"]],
// TODO - these shouldnt be required, but are here because `go/enter-state` returns none
"(event target-flop)": [
@@ -5957,17 +5514,11 @@
[831, "v1", "collide-shape-moving"]
],
- "part-water-splash-callback": [
- [3, "v1", "float"]
- ],
+ "part-water-splash-callback": [[3, "v1", "float"]],
- "(method 15 water-control)": [
- [42, "v1", "float"]
- ],
+ "(method 15 water-control)": [[42, "v1", "float"]],
- "(method 27 water-vol)": [
- [16, "v1", "target"]
- ],
+ "(method 27 water-vol)": [[16, "v1", "target"]],
"(method 26 water-vol)": [
[19, "v1", "target"],
@@ -5979,13 +5530,9 @@
[46, "v0", "(pointer float)"]
],
- "(enter pickup racer)": [
- [1, "t9", "(function none :behavior racer)"]
- ],
+ "(enter pickup racer)": [[1, "t9", "(function none :behavior racer)"]],
- "target-racing-jump-anim": [
- [36, "v1", "art-joint-anim"]
- ],
+ "target-racing-jump-anim": [[36, "v1", "art-joint-anim"]],
"target-racing-land-anim": [
[23, "v1", "art-joint-anim"],
@@ -5993,45 +5540,25 @@
[144, "v1", "art-joint-anim"]
],
- "(post target-racing-get-off-jump)": [
- [191, "f0", "float"]
- ],
+ "(post target-racing-get-off-jump)": [[191, "f0", "float"]],
- "check-drop-level-rolling-dirt-finish": [
- [17, "v1", "float"]
- ],
+ "check-drop-level-rolling-dirt-finish": [[17, "v1", "float"]],
- "(code peeper-down)": [
- [24, "v1", "float"]
- ],
+ "(code peeper-down)": [[24, "v1", "float"]],
- "(code nav-enemy-notice fleeing-nav-enemy)": [
- [27, "v1", "art-joint-anim"]
- ],
+ "(code nav-enemy-notice fleeing-nav-enemy)": [[27, "v1", "art-joint-anim"]],
- "(code lightning-mole-dive)": [
- [39, "v1", "art-joint-anim"]
- ],
+ "(code lightning-mole-dive)": [[39, "v1", "art-joint-anim"]],
- "(code lightning-mole-yelp)": [
- [19, "v1", "art-joint-anim"]
- ],
+ "(code lightning-mole-yelp)": [[19, "v1", "art-joint-anim"]],
- "(code peeper-up)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code peeper-up)": [[10, "v1", "art-joint-anim"]],
- "(code robber-idle)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code robber-idle)": [[14, "v1", "art-joint-anim"]],
- "(code robber-initial)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code robber-initial)": [[14, "v1", "art-joint-anim"]],
- "(code robber-initial-notice)": [
- [43, "v1", "art-joint-anim"]
- ],
+ "(code robber-initial-notice)": [[43, "v1", "art-joint-anim"]],
"(code robber-tired)": [
[69, "v1", "art-joint-anim"],
@@ -6053,34 +5580,22 @@
[204, "v1", "art-joint-anim"]
],
- "target-flut-standard-event-handler": [
- [164, "a0", "process-drawable"]
- ],
+ "target-flut-standard-event-handler": [[164, "a0", "process-drawable"]],
"(code target-flut-stance)": [
[81, "v1", "art-joint-anim"],
[145, "v1", "art-joint-anim"]
],
- "(code target-flut-walk)": [
- [60, "v1", "art-joint-anim"]
- ],
+ "(code target-flut-walk)": [[60, "v1", "art-joint-anim"]],
- "(code target-flut-air-attack)": [
- [98, "v1", "art-joint-anim"]
- ],
+ "(code target-flut-air-attack)": [[98, "v1", "art-joint-anim"]],
- "(code target-flut-air-attack-hit-ground)": [
- [86, "v1", "art-joint-anim"]
- ],
+ "(code target-flut-air-attack-hit-ground)": [[86, "v1", "art-joint-anim"]],
- "(code target-flut-death)": [
- [224, "v1", "art-joint-anim"]
- ],
+ "(code target-flut-death)": [[224, "v1", "art-joint-anim"]],
- "(code target-flut-get-off-hit-ground)": [
- [13, "v1", "art-joint-anim"]
- ],
+ "(code target-flut-get-off-hit-ground)": [[13, "v1", "art-joint-anim"]],
"(code target-flut-running-attack)": [
[53, "v1", "float"],
@@ -6125,9 +5640,7 @@
[145, "v1", "art-joint-anim"]
],
- "(event target-flut-grab)": [
- [24, "a0", "process-drawable"]
- ],
+ "(event target-flut-grab)": [[24, "a0", "process-drawable"]],
"(post target-racing-get-on)": [
[76, "f0", "float"],
@@ -6135,9 +5648,7 @@
[92, "f1", "float"]
],
- "target-death-anim": [
- [18, "v1", "art-joint-anim"]
- ],
+ "target-death-anim": [[18, "v1", "art-joint-anim"]],
"target-hit-setup-anim": [
[90, "v1", "art-joint-anim"],
@@ -6201,13 +5712,9 @@
[148, "v1", "art-joint-anim"]
],
- "(code target-pole-flip-up)": [
- [13, "v1", "art-joint-anim"]
- ],
+ "(code target-pole-flip-up)": [[13, "v1", "art-joint-anim"]],
- "(code target-edge-grab-jump)": [
- [34, "v1", "art-joint-anim"]
- ],
+ "(code target-edge-grab-jump)": [[34, "v1", "art-joint-anim"]],
"(code target-eco-powerup)": [
[32, "v1", "art-joint-anim"],
@@ -6236,13 +5743,9 @@
[140, "v1", "art-joint-anim"]
],
- "(code target-yellow-jump-blast)": [
- [184, "v1", "art-joint-anim"]
- ],
+ "(code target-yellow-jump-blast)": [[184, "v1", "art-joint-anim"]],
- "(code target-swim-down)": [
- [52, "v1", "art-joint-anim"]
- ],
+ "(code target-swim-down)": [[52, "v1", "art-joint-anim"]],
"(anon-function 11 target2)": [
[19, "s4", "target"], // confusing -- the parent of a target is a target?
@@ -6260,22 +5763,16 @@
[129, "s4", "target"]
],
- "(code target-play-anim)": [
- [8, "v0", "art-joint-anim"]
- ],
+ "(code target-play-anim)": [[8, "v0", "art-joint-anim"]],
- "(code target-look-around)": [
- [20, "v0", "float"]
- ],
+ "(code target-look-around)": [[20, "v0", "float"]],
"(code target-stance-look-around)": [
[10, "v0", "float"],
[36, "t9", "(function none :behavior target)"]
],
- "part-first-person-hud-selector-func": [
- [16, "v1", "first-person-hud"]
- ],
+ "part-first-person-hud-selector-func": [[16, "v1", "first-person-hud"]],
"part-first-person-hud-right-func": [
[16, "s5", "first-person-hud"],
@@ -6305,9 +5802,7 @@
[130, "v1", "art-joint-anim"]
],
- "(code target-swim-up)": [
- [17, "v1", "art-joint-anim"]
- ],
+ "(code target-swim-up)": [[17, "v1", "art-joint-anim"]],
"(code target-yellow-blast)": [
[161, "gp", "handle"],
@@ -6320,17 +5815,13 @@
[198, "v1", "art-joint-anim"]
],
- "(method 10 first-person-hud)": [
- [32, "t9", "(function process none)"]
- ],
+ "(method 10 first-person-hud)": [[32, "t9", "(function process none)"]],
"(code target-pole-flip-forward-jump)": [
[40, "t9", "(function none :behavior target)"]
],
- "tfrag-details":[
- [49, "gp", "(pointer uint32)"]
- ],
+ "tfrag-details": [[49, "gp", "(pointer uint32)"]],
"flatten-joint-control-to-spr": [
[14, "a1", "pointer"],
@@ -6347,13 +5838,9 @@
[172, "a1", "terrain-context"]
],
- "matrix-from-control-pair!": [
- [18, "a0", "terrain-context"]
- ],
+ "matrix-from-control-pair!": [[18, "a0", "terrain-context"]],
- "cspace<-matrix-no-push-joint!": [
- [4, "a0", "terrain-context"]
- ],
+ "cspace<-matrix-no-push-joint!": [[4, "a0", "terrain-context"]],
"make-joint-jump-tables": [
[5, "a0", "terrain-context"],
@@ -6425,9 +5912,7 @@
[86, "gp", "process-drawable"]
],
- "ram-boss-on-ground-event-handler": [
- [260, "v1", "ram-boss-proj"]
- ],
+ "ram-boss-on-ground-event-handler": [[260, "v1", "ram-boss-proj"]],
"(method 52 ram-boss)": [
[11, "v1", "(array collide-shape-prim)"],
@@ -6443,33 +5928,19 @@
[11, "v1", "(array collide-shape-prim)"]
],
- "(code ram-boss-idle)": [
- [38, "v1", "collide-shape-prim-group"]
- ],
+ "(code ram-boss-idle)": [[38, "v1", "collide-shape-prim-group"]],
- "(code ram-boss-jump-down)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code ram-boss-jump-down)": [[14, "v1", "art-joint-anim"]],
- "(code ram-boss-jump-down-hit-ground)": [
- [23, "v1", "art-joint-anim"]
- ],
+ "(code ram-boss-jump-down-hit-ground)": [[23, "v1", "art-joint-anim"]],
- "(code ram-boss-forward-defend-block)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code ram-boss-forward-defend-block)": [[14, "v1", "art-joint-anim"]],
- "(code ram-boss-up-defend-block)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code ram-boss-up-defend-block)": [[14, "v1", "art-joint-anim"]],
- "(code nav-enemy-victory ram-boss)": [
- [28, "v1", "art-joint-anim"]
- ],
+ "(code nav-enemy-victory ram-boss)": [[28, "v1", "art-joint-anim"]],
- "(code ram-boss-lose-shield)": [
- [29, "v1", "art-joint-anim"]
- ],
+ "(code ram-boss-lose-shield)": [[29, "v1", "art-joint-anim"]],
"(code ram-boss-throw)": [
[16, "v1", "art-joint-anim"],
@@ -6496,13 +5967,9 @@
[106, "v1", "art-joint-anim"]
],
- "(code snow-bumper-spawn-fuel-cell)": [
- [16, "v1", "art-joint-anim"]
- ],
+ "(code snow-bumper-spawn-fuel-cell)": [[16, "v1", "art-joint-anim"]],
- "(code snow-bumper-inactive-idle)": [
- [19, "v1", "art-joint-anim"]
- ],
+ "(code snow-bumper-inactive-idle)": [[19, "v1", "art-joint-anim"]],
"(method 7 snow-bumper)": [
[14, "t9", "(function process-drawable int process-drawable)"]
@@ -6519,47 +5986,31 @@
[153, "v1", "art-joint-anim"]
],
- "(code spider-egg-hatch)": [
- [62, "v1", "art-joint-anim"]
- ],
+ "(code spider-egg-hatch)": [[62, "v1", "art-joint-anim"]],
- "(code spider-egg-die)": [
- [79, "v1", "art-joint-anim"]
- ],
+ "(code spider-egg-die)": [[79, "v1", "art-joint-anim"]],
- "(code puffer-die)": [
- [33, "v1", "art-joint-anim"]
- ],
+ "(code puffer-die)": [[33, "v1", "art-joint-anim"]],
"puffer-default-event-handler": [
[28, "v1", "process-drawable"],
[34, "v1", "process-drawable"]
],
- "(method 22 puffer)": [
- [10, "v1", "process-drawable"]
- ],
+ "(method 22 puffer)": [[10, "v1", "process-drawable"]],
"(method 25 puffer)": [
[49, "v1", "puffer"],
[56, "v1", "puffer"]
],
- "(method 23 puffer)": [
- [18, "v1", "process-drawable"]
- ],
+ "(method 23 puffer)": [[18, "v1", "process-drawable"]],
- "(trans puffer-attack)": [
- [23, "v1", "collide-shape-prim-group"]
- ],
+ "(trans puffer-attack)": [[23, "v1", "collide-shape-prim-group"]],
- "(method 30 puffer)": [
- [16, "v1", "(array collide-shape-prim)"]
- ],
+ "(method 30 puffer)": [[16, "v1", "(array collide-shape-prim)"]],
- "(method 31 puffer)": [
- [16, "v1", "(array collide-shape-prim)"]
- ],
+ "(method 31 puffer)": [[16, "v1", "(array collide-shape-prim)"]],
"(method 7 puffer)": [
[14, "t9", "(function process-drawable int process-drawable)"]
@@ -6574,17 +6025,11 @@
[[51, 87], "s1", "touching-shapes-entry"]
],
- "(code driller-lurker-idle-drilling)": [
- [33, "v1", "art-joint-anim"]
- ],
+ "(code driller-lurker-idle-drilling)": [[33, "v1", "art-joint-anim"]],
- "(code driller-lurker-jammed-standing)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code driller-lurker-jammed-standing)": [[14, "v1", "art-joint-anim"]],
- "(code driller-lurker-die)": [
- [28, "v1", "art-joint-anim"]
- ],
+ "(code driller-lurker-die)": [[28, "v1", "art-joint-anim"]],
"(method 7 driller-lurker)": [
[24, "t9", "(function process-drawable int process-drawable)"]
@@ -6595,51 +6040,33 @@
[373, "v0", "(pointer float)"]
],
- "kermit-short-hop": [
- [10, "v1", "art-joint-anim"]
- ],
+ "kermit-short-hop": [[10, "v1", "art-joint-anim"]],
- "kermit-long-hop": [
- [10, "v1", "art-joint-anim"]
- ],
+ "kermit-long-hop": [[10, "v1", "art-joint-anim"]],
- "(code kermit-patrol)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code kermit-patrol)": [[10, "v1", "art-joint-anim"]],
- "(code kermit-chase-new-position)": [
- [16, "v1", "art-joint-anim"]
- ],
+ "(code kermit-chase-new-position)": [[16, "v1", "art-joint-anim"]],
- "(code kermit-chase)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code kermit-chase)": [[14, "v1", "art-joint-anim"]],
- "(code kermit-attack)": [
- [22, "v1", "art-joint-anim"]
- ],
+ "(code kermit-attack)": [[22, "v1", "art-joint-anim"]],
- "(code kermit-tongue-stuck)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code kermit-tongue-stuck)": [[14, "v1", "art-joint-anim"]],
"(code kermit-retract-tongue)": [
[14, "v1", "art-joint-anim"],
[90, "v1", "art-joint-anim"]
],
- "(method 39 kermit)": [
- [7, "t9", "(function nav-enemy none)"]
- ],
+ "(method 39 kermit)": [[7, "t9", "(function nav-enemy none)"]],
"(code falling gnawer-falling-segment)": [
[16, "v1", "art-joint-anim"],
[70, "v1", "art-joint-anim"]
],
- "(method 22 gnawer)": [
- [18, "f0", "float"]
- ],
+ "(method 22 gnawer)": [[18, "f0", "float"]],
"(code gnawer-chewing-on-post)": [
[139, "v1", "art-joint-anim"],
@@ -6649,21 +6076,13 @@
[451, "v1", "art-joint-anim"]
],
- "(code gnawer-retreat-into-post)": [
- [18, "v1", "art-joint-anim"]
- ],
+ "(code gnawer-retreat-into-post)": [[18, "v1", "art-joint-anim"]],
- "(code gnawer-die)": [
- [28, "v1", "art-joint-anim"]
- ],
+ "(code gnawer-die)": [[28, "v1", "art-joint-anim"]],
- "(event gnawer-run)": [
- [54, "a2", "touching-shapes-entry"]
- ],
+ "(event gnawer-run)": [[54, "a2", "touching-shapes-entry"]],
- "(method 7 gnawer)": [
- [19, "t9", "(function nav-enemy int nav-enemy)"]
- ],
+ "(method 7 gnawer)": [[19, "t9", "(function nav-enemy int nav-enemy)"]],
"(code gnawer-give-fuel-cell)": [
[43, "v0", "maincavecam"],
@@ -6679,21 +6098,13 @@
[446, "v0", "(pointer int32)"]
],
- "(code mother-spider-egg-falling)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code mother-spider-egg-falling)": [[14, "v1", "art-joint-anim"]],
- "(code mother-spider-egg-hatch)": [
- [65, "v1", "art-joint-anim"]
- ],
+ "(code mother-spider-egg-hatch)": [[65, "v1", "art-joint-anim"]],
- "(code mother-spider-egg-die)": [
- [63, "v1", "art-joint-anim"]
- ],
+ "(code mother-spider-egg-die)": [[63, "v1", "art-joint-anim"]],
- "(code mother-spider-egg-die-while-falling)": [
- [63, "v1", "art-joint-anim"]
- ],
+ "(code mother-spider-egg-die-while-falling)": [[63, "v1", "art-joint-anim"]],
"(code mother-spider-egg-on-ground)": [
[50, "v1", "art-joint-anim"],
@@ -6712,9 +6123,7 @@
[373, "a0", "swamp-blimp"]
],
- "(event swamp-tetherrock-idle)": [
- [55, "gp", "process-drawable"]
- ],
+ "(event swamp-tetherrock-idle)": [[55, "gp", "process-drawable"]],
"(code swamp-rope-break)": [
[10, "v1", "float"],
@@ -6728,13 +6137,9 @@
[48, "v1", "swamp-rope"]
],
- "(code swamp-rope-idle-arm)": [
- [13, "v1", "swamp-rope"]
- ],
+ "(code swamp-rope-idle-arm)": [[13, "v1", "swamp-rope"]],
- "swamp-blimp-setup": [
- [[26, 117], "s4", "swamp-rope"]
- ],
+ "swamp-blimp-setup": [[[26, 117], "s4", "swamp-rope"]],
"(code swamp-rope-idle-rock)": [
[32, "a0", "swamp-rope"],
@@ -6747,9 +6152,7 @@
[257, "v1", "art-joint-anim"]
],
- "(event mistycannon-missile-explode)": [
- [16, "v1", "mistycannon-missile"]
- ],
+ "(event mistycannon-missile-explode)": [[16, "v1", "mistycannon-missile"]],
"(code cam-mistycannon)": [
[3, "a1", "mistycannon"],
@@ -6779,9 +6182,7 @@
[10, "v0", "(state plat-button)"]
],
- "(code darkvine-idle)": [
- [32, "v1", "art-joint-anim"]
- ],
+ "(code darkvine-idle)": [[32, "v1", "art-joint-anim"]],
"(code darkvine-retreat)": [
[23, "v1", "art-joint-anim"],
@@ -6802,17 +6203,11 @@
[79, "v1", "periscope"]
],
- "periscope-crosshair": [
- [50, "v1", "periscope"]
- ],
+ "periscope-crosshair": [[50, "v1", "periscope"]],
- "periscope-find-next": [
- [58, "v1", "vector"]
- ],
+ "periscope-find-next": [[58, "v1", "vector"]],
- "(code reflector-origin-idle)": [
- [60, "v1", "periscope"]
- ],
+ "(code reflector-origin-idle)": [[60, "v1", "periscope"]],
"(code periscope-player-control)": [
[41, "v0", "(pointer float)"],
@@ -6829,29 +6224,17 @@
[89, "v1", "art-joint-anim"]
],
- "(code quicksandlurker-yawn)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code quicksandlurker-yawn)": [[10, "v1", "art-joint-anim"]],
- "(code quicksandlurker-track)": [
- [29, "v1", "art-joint-anim"]
- ],
+ "(code quicksandlurker-track)": [[29, "v1", "art-joint-anim"]],
- "(code quicksandlurker-attack)": [
- [12, "v1", "art-joint-anim"]
- ],
+ "(code quicksandlurker-attack)": [[12, "v1", "art-joint-anim"]],
- "(code quicksandlurker-hide)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code quicksandlurker-hide)": [[14, "v1", "art-joint-anim"]],
- "(code quicksandlurker-popup)": [
- [38, "v1", "art-joint-anim"]
- ],
+ "(code quicksandlurker-popup)": [[38, "v1", "art-joint-anim"]],
- "(code quicksandlurker-die)": [
- [18, "v1", "art-joint-anim"]
- ],
+ "(code quicksandlurker-die)": [[18, "v1", "art-joint-anim"]],
"(code quicksandlurker-victory)": [
[18, "v1", "art-joint-anim"],
@@ -6862,9 +6245,7 @@
[29, "t9", "(function process-drawable int process-drawable)"]
],
- "(code balloonlurker-pilot-die)": [
- [58, "v1", "art-joint-anim"]
- ],
+ "(code balloonlurker-pilot-die)": [[58, "v1", "art-joint-anim"]],
"(code orbit-plat-bottom-idle)": [
[29, "v1", "orbit-plat"],
@@ -6888,105 +6269,67 @@
[80, "v1", "art-joint-anim"]
],
- "(code mother-spider-stop-traveling)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code mother-spider-stop-traveling)": [[14, "v1", "art-joint-anim"]],
"(code mother-spider-hit-while-birthing)": [
[14, "v1", "art-joint-anim"],
[68, "v1", "art-joint-anim"]
],
- "(code mother-spider-birthing)": [
- [53, "v1", "art-joint-anim"]
- ],
+ "(code mother-spider-birthing)": [[53, "v1", "art-joint-anim"]],
- "(code mother-spider-die)": [
- [36, "v1", "art-joint-anim"]
- ],
+ "(code mother-spider-die)": [[36, "v1", "art-joint-anim"]],
- "(code mother-spider-die-from-uppercut)": [
- [31, "v1", "art-joint-anim"]
- ],
+ "(code mother-spider-die-from-uppercut)": [[31, "v1", "art-joint-anim"]],
- "(code mother-spider-spit)": [
- [15, "v1", "art-joint-anim"]
- ],
+ "(code mother-spider-spit)": [[15, "v1", "art-joint-anim"]],
- "(code mother-spider-birth-baby)": [
- [15, "v1", "art-joint-anim"]
- ],
+ "(code mother-spider-birth-baby)": [[15, "v1", "art-joint-anim"]],
"(code mother-spider-hit-while-tracking)": [
[14, "v1", "art-joint-anim"],
[68, "v1", "art-joint-anim"]
],
- "(code mother-spider-tracking)": [
- [53, "v1", "art-joint-anim"]
- ],
+ "(code mother-spider-tracking)": [[53, "v1", "art-joint-anim"]],
"mother-spider-default-event-handler": [
[52, "a0", "process-drawable"],
[138, "a0", "process-drawable"]
],
- "mother-spider-death-event-handler": [
- [7, "a0", "process-drawable"]
- ],
+ "mother-spider-death-event-handler": [[7, "a0", "process-drawable"]],
- "(code bully-broken-cage-explode)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code bully-broken-cage-explode)": [[14, "v1", "art-joint-anim"]],
- "(code bully-notice)": [
- [148, "v1", "art-joint-anim"]
- ],
+ "(code bully-notice)": [[148, "v1", "art-joint-anim"]],
- "(code bully-start-spinning)": [
- [14, "v1", "art-joint-anim"]
- ],
+ "(code bully-start-spinning)": [[14, "v1", "art-joint-anim"]],
- "(code bully-die)": [
- [70, "v1", "art-joint-anim"]
- ],
+ "(code bully-die)": [[70, "v1", "art-joint-anim"]],
- "bully-default-event-handler": [
- [21, "gp", "process-drawable"]
- ],
+ "bully-default-event-handler": [[21, "gp", "process-drawable"]],
- "(trans bully-notice)": [
- [10, "v1", "collide-shape-prim-group"]
- ],
+ "(trans bully-notice)": [[10, "v1", "collide-shape-prim-group"]],
- "(trans bully-start-spinning)": [
- [10, "v1", "collide-shape-prim-group"]
- ],
+ "(trans bully-start-spinning)": [[10, "v1", "collide-shape-prim-group"]],
- "(trans bully-stop-spinning)": [
- [10, "v1", "collide-shape-prim-group"]
- ],
+ "(trans bully-stop-spinning)": [[10, "v1", "collide-shape-prim-group"]],
"(method 7 bully)": [
[14, "t9", "(function process-drawable int process-drawable)"]
],
- "(enter seagull-idle)": [
- [20, "v1", "float"]
- ],
+ "(enter seagull-idle)": [[20, "v1", "float"]],
- "seagull-init-by-other": [
- [96, "v1", "float"]
- ],
+ "seagull-init-by-other": [[96, "v1", "float"]],
"seagull-reaction": [
[36, "s4", "seagull"],
[38, "s4", "seagull"]
],
- "beach-rock-trigger": [
- [5, "v0", "seagullflock"]
- ],
+ "beach-rock-trigger": [[5, "v0", "seagullflock"]],
"(method 11 seagullflock)": [
[80, "v1", "float"],
@@ -7041,9 +6384,7 @@
[[31, 39], "v1", "bone-memory"]
],
- "draw-bones-mtx-calc": [
- [[5, 8], "t2", "bone-memory"]
- ],
+ "draw-bones-mtx-calc": [[[5, 8], "t2", "bone-memory"]],
"bones-mtx-calc-execute": [
[[18, 45], "v1", "bone-memory"],
@@ -7058,9 +6399,7 @@
[[9, 12], "a1", "dma-packet"]
],
- "texscroll-make-request": [
- [[9, 39], "a1", "mei-texture-scroll"]
- ],
+ "texscroll-make-request": [[[9, 39], "a1", "mei-texture-scroll"]],
"texscroll-execute": [
[[25, 31], "a1", "mei-texture-scroll"],
@@ -7081,7 +6420,7 @@
[49, "a1", "bone-calculation"],
[262, "s2", "(pointer uint32)"],
[89, "at", "terrain-context"],
- [[312,334], "v1", "mei-envmap-tint"],
+ [[312, 334], "v1", "mei-envmap-tint"],
[363, "a0", "(pointer uint8)"]
],
@@ -7095,9 +6434,7 @@
[49, "at", "terrain-context"]
],
- "joint-mod-tracker-callback": [
- [[3, 99], "s4", "joint-mod-tracker"]
- ],
+ "joint-mod-tracker-callback": [[[3, 99], "s4", "joint-mod-tracker"]],
"(method 7 snow-ball)": [
[26, "t9", "(function process-drawable int process-drawable)"]
@@ -7111,9 +6448,7 @@
[367, "v0", "(pointer float)"]
],
- "quicksandlurker-missile-init-by-other": [
- [76, "a0", "process-drawable"]
- ],
+ "quicksandlurker-missile-init-by-other": [[76, "a0", "process-drawable"]],
"mother-spider-full-joint-callback": [
[[10, 48], "v1", "mother-spider-thread"]
@@ -7124,33 +6459,21 @@
[[500, 525], "v0", "(pointer float)"]
],
- "(method 21 mother-spider)": [
- [179, "s3", "collide-shape-prim-group"]
- ],
+ "(method 21 mother-spider)": [[179, "s3", "collide-shape-prim-group"]],
- "(method 11 plane-volume)": [
- [14, "f2", "float"]
- ],
+ "(method 11 plane-volume)": [[14, "f2", "float"]],
- "(method 9 plane-volume)": [
- [245, "f2", "float"]
- ],
+ "(method 9 plane-volume)": [[245, "f2", "float"]],
- "(method 21 helix-water)": [
- [27, "a0", "process-drawable"]
- ],
+ "(method 21 helix-water)": [[27, "a0", "process-drawable"]],
"(method 7 helix-water)": [
[14, "t9", "(function process-drawable int process-drawable)"]
],
- "(code helix-button-activate)": [
- [37, "v0", "sunkencam"]
- ],
+ "(code helix-button-activate)": [[37, "v0", "sunkencam"]],
- "(code target-flut-jump)": [
- [137, "v1", "float"]
- ],
+ "(code target-flut-jump)": [[137, "v1", "float"]],
"tie-init-engine": [
[[14, 18], "a0", "dma-packet"],
@@ -7173,13 +6496,9 @@
[[41, 52], "a0", "(pointer vif-tag)"]
],
- "tie-ints": [
- [[3, 30], "gp", "(pointer uint32)"]
- ],
+ "tie-ints": [[[3, 30], "gp", "(pointer uint32)"]],
- "tie-floats": [
- [[3, 73], "gp", "(pointer uint32)"]
- ],
+ "tie-floats": [[[3, 73], "gp", "(pointer uint32)"]],
"tie-init-buffers": [
[[29, 32], "v1", "dma-packet"],
@@ -7208,9 +6527,7 @@
[[484, 487], "v1", "dma-packet"]
],
- "(method 10 drawable-tree-instance-tie)": [
- [3, "a1", "terrain-context"]
- ],
+ "(method 10 drawable-tree-instance-tie)": [[3, "a1", "terrain-context"]],
"(method 14 drawable-tree-instance-tie)": [
[[47, 62], "t1", "tie-fragment"],
@@ -7230,24 +6547,20 @@
[[1, 6], "v1", "instance-tie"]
],
- "(method 10 drawable-tree-array)": [
- [4, "v1", "terrain-context"]
- ],
+ "(method 10 drawable-tree-array)": [[4, "v1", "terrain-context"]],
- "(method 16 drawable-tree)":[
- [[1,4], "v1", "drawable-inline-array-node"],
+ "(method 16 drawable-tree)": [
+ [[1, 4], "v1", "drawable-inline-array-node"],
//[4, "a1", "int"],
[11, "v1", "(pointer int8)"],
- [[29,34], "t0", "drawable-inline-array-node"],
+ [[29, 34], "t0", "drawable-inline-array-node"],
[31, "t2", "drawable-inline-array-node"],
//[[34,36], "a1", "int"],
[36, "t1", "(pointer int8)"],
[[9, 42], "a2", "(pointer int8)"]
],
- "(event sunken-pipegame-idle)": [
- [6, "a0", "sunken-pipegame-button"]
- ],
+ "(event sunken-pipegame-idle)": [[6, "a0", "sunken-pipegame-button"]],
"(method 11 sunken-pipegame)": [
[189, "a1", "collectable"],
@@ -7274,9 +6587,7 @@
[59, "v1", "collectable"]
],
- "(enter exit-chamber-lower)": [
- [14, "v1", "fuel-cell"]
- ],
+ "(enter exit-chamber-lower)": [[14, "v1", "fuel-cell"]],
"(code exit-chamber-lower)": [
[29, "v1", "sunkencam"],
@@ -7286,31 +6597,23 @@
[308, "v1", "fuel-cell"]
],
- "(method 11 exit-chamber)": [
- [190, "v1", "art-joint-anim"]
- ],
+ "(method 11 exit-chamber)": [[190, "v1", "art-joint-anim"]],
"ray-cylinder-intersect": [
[20, "v1", "uint"],
[20, "a0", "uint"]
],
- "(anon-function 15 pelican)": [
- [24, "v1", "collectable"]
- ],
+ "(anon-function 15 pelican)": [[24, "v1", "collectable"]],
- "(method 11 darkecobarrel)": [
- ["_stack_", 16, "res-tag"]
- ],
+ "(method 11 darkecobarrel)": [["_stack_", 16, "res-tag"]],
"(method 11 snowpusher)": [
["_stack_", 16, "res-tag"],
[19, "v0", "(pointer int32)"]
],
- "(code snow-switch-activate)": [
- [53, "v1", "snowcam"]
- ],
+ "(code snow-switch-activate)": [[53, "v1", "snowcam"]],
"(method 32 sequenceA-village1)": [
[[103, 111], "v1", "handle"],
@@ -7335,18 +6638,14 @@
[27, "s4", "hud"]
],
- "(code caveelevator-one-way-idle-start)": [
- [10, "v1", "art-joint-anim"]
- ],
+ "(code caveelevator-one-way-idle-start)": [[10, "v1", "art-joint-anim"]],
"(method 11 caveelevator)": [
["_stack_", 16, "res-tag"],
[109, "v0", "(pointer float)"]
],
- "(trans energyhub-idle)": [
- [31, "s4", "energyarm"]
- ],
+ "(trans energyhub-idle)": [[31, "s4", "energyarm"]],
"(method 0 joint-exploder-tuning)": [
[[6, 50], "v0", "joint-exploder-tuning"]
@@ -7370,21 +6669,13 @@
[139, "s0", "joint-exploder-joint"]
],
- "(method 25 joint-exploder)": [
- [[16, 54], "s2", "joint-exploder-joint"]
- ],
+ "(method 25 joint-exploder)": [[[16, 54], "s2", "joint-exploder-joint"]],
- "(method 22 joint-exploder)": [
- [[18, 78], "s5", "joint-exploder-joint"]
- ],
+ "(method 22 joint-exploder)": [[[18, 78], "s5", "joint-exploder-joint"]],
- "joint-exploder-joint-callback": [
- [[10, 18], "v1", "joint-exploder-joint"]
- ],
+ "joint-exploder-joint-callback": [[[10, 18], "v1", "joint-exploder-joint"]],
- "(method 24 joint-exploder)": [
- [[12, 19], "v1", "joint-exploder-joint"]
- ],
+ "(method 24 joint-exploder)": [[[12, 19], "v1", "joint-exploder-joint"]],
"(method 26 joint-exploder)": [
[[5, 8], "a2", "joint-exploder-joint"],
@@ -7392,13 +6683,9 @@
[28, "v1", "joint-exploder-joint"]
],
- "racer-effects": [
- [739, "v0", "sound-rpc-set-param"]
- ],
+ "racer-effects": [[739, "v0", "sound-rpc-set-param"]],
- "(code target-tube)": [
- [31, "v1", "art-joint-anim"]
- ],
+ "(code target-tube)": [[31, "v1", "art-joint-anim"]],
"(event slide-control-ride slide-control)": [
[24, "gp", "process-drawable"],
@@ -7407,9 +6694,7 @@
[39, "v1", "vector"]
],
- "(code target-tube-start)": [
- [110, "v1", "float"]
- ],
+ "(code target-tube-start)": [[110, "v1", "float"]],
"depth-cue-set-stencil": [
[[1, 7], "t1", "dma-packet"],
@@ -7513,8 +6798,8 @@
],
"collide-probe-instance-tie-tree-make-list": [
- [[5,7], "v1", "drawable-inline-array-node"],
- [[18,20], "v1", "drawable-inline-array-instance-tie"]
+ [[5, 7], "v1", "drawable-inline-array-node"],
+ [[18, 20], "v1", "drawable-inline-array-instance-tie"]
],
"collide-upload-vu0": [
@@ -7541,10 +6826,10 @@
],
"(method 23 collide-shape-prim-sphere)": [
- [[74,114], "s4", "collide-shape-prim-mesh"]
+ [[74, 114], "s4", "collide-shape-prim-mesh"]
],
- "(method 13 collide-mesh)" : [
+ "(method 13 collide-mesh)": [
[[0, 60], "a3", "(inline-array vector)"],
[[61, 123], "v1", "collide-mesh-tri"]
],
@@ -7552,22 +6837,22 @@
"(method 20 collide-shape-prim-group)": [
[5, "gp", "pointer"],
[6, "v1", "(pointer collide-shape-prim)"],
- [[7,14], "a0", "collide-shape-prim"],
+ [[7, 14], "a0", "collide-shape-prim"],
[32, "gp", "pointer"],
[33, "v1", "(pointer collide-shape-prim)"],
- [[34,40], "a0", "collide-shape-prim"],
+ [[34, 40], "a0", "collide-shape-prim"],
[[40, 46], "a0", "collide-shape-prim-group"]
],
- "(method 29 collide-shape-prim-group)" : [
+ "(method 29 collide-shape-prim-group)": [
[5, "gp", "pointer"],
[6, "v1", "(pointer collide-shape-prim)"],
[[13, 19], "a0", "collide-shape-prim-group"]
],
- "(method 40 collide-shape)" : [
+ "(method 40 collide-shape)": [
[21, "a0", "connection"],
- [[22,40], "a0", "collide-shape-moving"],
+ [[22, 40], "a0", "collide-shape-moving"],
[85, "a0", "connection"],
[[86, 104], "a0", "collide-shape-moving"],
[147, "a0", "connection"],
@@ -7576,17 +6861,17 @@
[[210, 228], "a0", "collide-shape-moving"]
],
- "(method 15 collide-shape-prim-sphere)" : [
+ "(method 15 collide-shape-prim-sphere)": [
[[16, 55], "gp", "collide-shape-prim-mesh"]
],
- "(method 25 collide-cache)" : [
+ "(method 25 collide-cache)": [
[[83, 104], "a2", "(inline-array collide-cache-tri)"]
],
- "(method 22 collide-cache)" : [
+ "(method 22 collide-cache)": [
[14, "v1", "connection"],
- [[15,31], "v1", "collide-shape"],
+ [[15, 31], "v1", "collide-shape"],
[74, "v1", "connection"],
[[75, 91], "v1", "collide-shape"],
[130, "v1", "connection"],
@@ -7595,13 +6880,13 @@
[[188, 205], "v1", "collide-shape"]
],
- "(method 12 collide-shape-prim-sphere)" : [
+ "(method 12 collide-shape-prim-sphere)": [
[[13, 23], "t0", "collide-cache-prim"]
],
- "(method 24 collide-cache)" : [
+ "(method 24 collide-cache)": [
[14, "v1", "connection"],
- [[15,31], "v1", "collide-shape"],
+ [[15, 31], "v1", "collide-shape"],
[74, "v1", "connection"],
[[75, 91], "v1", "collide-shape"],
[130, "v1", "connection"],
@@ -7610,83 +6895,63 @@
[[188, 205], "v1", "collide-shape"]
],
- "(method 14 collide-shape-prim-sphere)" : [
+ "(method 14 collide-shape-prim-sphere)": [
[[11, 23], "t0", "collide-cache-prim"]
],
- "(method 23 collide-cache)" : [
+ "(method 23 collide-cache)": [
[20, "v1", "connection"],
- [[21,43], "v1", "collide-shape"],
+ [[21, 43], "v1", "collide-shape"],
[86, "v1", "connection"],
- [[87,109], "v1", "collide-shape"],
+ [[87, 109], "v1", "collide-shape"],
[148, "v1", "connection"],
[[149, 174], "v1", "collide-shape"],
[211, "v1", "connection"],
[[212, 235], "v1", "collide-shape"]
],
- "(method 13 collide-shape-prim-sphere)" : [
+ "(method 13 collide-shape-prim-sphere)": [
[[11, 23], "t0", "collide-cache-prim"]
],
- "(method 31 collide-cache)" : [
- [22, "v1", "collide-shape-prim-sphere"]
- ],
+ "(method 31 collide-cache)": [[22, "v1", "collide-shape-prim-sphere"]],
- "(method 19 collide-cache)" : [
+ "(method 19 collide-cache)": [
[[52, 94], "s4", "collide-cache-prim"],
[[1, 100], "s5", "collide-puss-work"]
],
- "ogreboss-rock-explosion-effect": [
- [83, "v1", "manipy"]
- ],
+ "ogreboss-rock-explosion-effect": [[83, "v1", "manipy"]],
"ogreboss-missile-scale-explosion": [
[11, "gp", "process-drawable"],
[22, "gp", "process-drawable"]
],
- "(event ogreboss-missile-impact)": [
- [76, "t1", "target"]
- ],
+ "(event ogreboss-missile-impact)": [[76, "t1", "target"]],
- "(code ogreboss-super-boulder-throw)": [
- [16, "v1", "art-joint-anim"]
- ],
+ "(code ogreboss-super-boulder-throw)": [[16, "v1", "art-joint-anim"]],
- "ogreboss-emerge": [
- [47, "v1", "art-joint-anim"]
- ],
+ "ogreboss-emerge": [[47, "v1", "art-joint-anim"]],
- "(code ogreboss-die)": [
- [35, "v1", "art-joint-anim"]
- ],
+ "(code ogreboss-die)": [[35, "v1", "art-joint-anim"]],
- "ogreboss-super-boulder-play-hit-anim": [
- [15, "v1", "art-joint-anim"]
- ],
+ "ogreboss-super-boulder-play-hit-anim": [[15, "v1", "art-joint-anim"]],
- "(code ogreboss-stage3-hit)": [
- [47, "v1", "art-joint-anim"]
- ],
+ "(code ogreboss-stage3-hit)": [[47, "v1", "art-joint-anim"]],
"(code ogreboss-stage3-throw)": [
[33, "v1", "art-joint-anim"],
[89, "v1", "art-joint-anim"]
],
- "ogreboss-shoot-boulder": [
- [41, "a1", "process-drawable"]
- ],
+ "ogreboss-shoot-boulder": [[41, "a1", "process-drawable"]],
"(method 7 ogreboss-super-boulder)": [
[14, "t9", "(function process-drawable int process-drawable)"]
],
- "ogreboss-bounce-boulder-init-by-other": [
- [112, "v1", "float"]
- ],
+ "ogreboss-bounce-boulder-init-by-other": [[112, "v1", "float"]],
"(code ogreboss-stage3-shuffle)": [
[33, "v1", "art-joint-anim"],
@@ -7704,13 +6969,9 @@
[158, "v1", "art-joint-anim"]
],
- "ogreboss-update-super-boulder": [
- [12, "a1", "ogreboss-super-boulder"]
- ],
+ "ogreboss-update-super-boulder": [[12, "a1", "ogreboss-super-boulder"]],
- "(trans ogreboss-stage3-shuffle)": [
- [13, "v1", "ogreboss-super-boulder"]
- ],
+ "(trans ogreboss-stage3-shuffle)": [[13, "v1", "ogreboss-super-boulder"]],
"(code ogreboss-stage1)": [
[36, "v1", "art-joint-anim"],
@@ -7721,9 +6982,7 @@
[386, "v1", "art-joint-anim"]
],
- "(code ogreboss-bounce-boulder-idle)": [
- [81, "v1", "art-joint-anim"]
- ],
+ "(code ogreboss-bounce-boulder-idle)": [[81, "v1", "art-joint-anim"]],
"ogreboss-idle-loop": [
[145, "v1", "art-joint-anim"],
@@ -7731,33 +6990,19 @@
[261, "v1", "art-joint-anim"]
],
- "(code ogreboss-super-boulder-roll)": [
- [123, "v1", "art-joint-anim"]
- ],
+ "(code ogreboss-super-boulder-roll)": [[123, "v1", "art-joint-anim"]],
- "(code ogreboss-intro)": [
- [92, "v1", "art-joint-anim"]
- ],
+ "(code ogreboss-intro)": [[92, "v1", "art-joint-anim"]],
- "ogreboss-submerge": [
- [130, "v1", "art-joint-anim"]
- ],
+ "ogreboss-submerge": [[130, "v1", "art-joint-anim"]],
- "(code nav-enemy-notice snow-bunny)": [
- [145, "v1", "art-joint-anim"]
- ],
+ "(code nav-enemy-notice snow-bunny)": [[145, "v1", "art-joint-anim"]],
- "(code snow-bunny-lunge snow-bunny)": [
- [22, "v1", "art-joint-anim"]
- ],
+ "(code snow-bunny-lunge snow-bunny)": [[22, "v1", "art-joint-anim"]],
- "(code snow-bunny-attack snow-bunny)": [
- [20, "v1", "art-joint-anim"]
- ],
+ "(code snow-bunny-attack snow-bunny)": [[20, "v1", "art-joint-anim"]],
- "ogreboss-pick-target": [
- [31, "s3", "process-drawable"]
- ],
+ "ogreboss-pick-target": [[31, "s3", "process-drawable"]],
"(method 29 progress)": [
[290, "a0", "(pointer symbol)"],
@@ -7776,13 +7021,11 @@
"(method 9 edge-grab-info)": [
[23, "a0", "int"],
- [[24,31], "s5", "collide-shape-prim"],
+ [[24, 31], "s5", "collide-shape-prim"],
[29, "a0", "process-drawable"],
[156, "s5", "collide-shape-prim"]
],
- "circle-triangle-intersection-proc?": [
- [[113, 134], "v1", "vector"]
- ],
+ "circle-triangle-intersection-proc?": [[[113, 134], "v1", "vector"]],
"(method 28 nav-control)": [
[170, "v1", "connection"],
@@ -7802,34 +7045,22 @@
[24, "a0", "(pointer uint8)"]
],
- "nav-mesh-lookup-route": [
- [6, "a0", "(pointer uint8)"]
- ],
+ "nav-mesh-lookup-route": [[6, "a0", "(pointer uint8)"]],
- "(method 11 nav-mesh)": [
- [12, "a2", "(pointer uint8)"]
- ],
+ "(method 11 nav-mesh)": [[12, "a2", "(pointer uint8)"]],
- "(method 12 nav-mesh)": [
- [13, "a2", "(pointer uint8)"]
- ],
+ "(method 12 nav-mesh)": [[13, "a2", "(pointer uint8)"]],
"recursive-inside-poly": [
[16, "a0", "(pointer nav-node)"],
[29, "v1", "(pointer nav-node)"]
],
- "entity-nav-login": [
- ["_stack_", 16, "res-tag"]
- ],
+ "entity-nav-login": [["_stack_", 16, "res-tag"]],
- "(method 18 nav-mesh)": [
- [34, "v1", "nav-poly"]
- ],
+ "(method 18 nav-mesh)": [[34, "v1", "nav-poly"]],
- "foreground-engine-execute" : [
- [114, "v1", "(pointer uint32)"]
- ],
+ "foreground-engine-execute": [[114, "v1", "(pointer uint32)"]],
"(event ropebridge-idle)": [
[64, "gp", "touching-shapes-entry"],
@@ -7837,18 +7068,14 @@
[12, "v1", "float"]
],
- "(method 23 ropebridge)": [
- [[1, 9], "v1", "ropebridge-spring-point"]
- ],
+ "(method 23 ropebridge)": [[[1, 9], "v1", "ropebridge-spring-point"]],
"(method 21 ropebridge)": [
[20, "v1", "process-drawable"],
[[4, 50], "s5", "collide-sticky-rider"]
],
- "(method 24 ropebridge)": [
- [[3, 22], "s5", "ropebridge-spring-point"]
- ],
+ "(method 24 ropebridge)": [[[3, 22], "s5", "ropebridge-spring-point"]],
"(method 25 ropebridge)": [
[[4, 24], "a1", "vector"],
@@ -7856,27 +7083,21 @@
[[30, 42], "v1", "ropebridge-spring-point"]
],
- "(method 11 ropebridge)" : [
- [[17, 21], "s4", "symbol"]
- ],
+ "(method 11 ropebridge)": [[[17, 21], "s4", "symbol"]],
- "ropebridge-joint-callback" : [
- [[27,70], "s5", "(inline-array ropebridge-spring-point)"],
+ "ropebridge-joint-callback": [
+ [[27, 70], "s5", "(inline-array ropebridge-spring-point)"],
[[23, 24], "s3", "ropebridge-spring-point"]
],
- "(code orbit-plat-rotating)": [
- [12, "a2", "orbit-plat"]
- ],
+ "(code orbit-plat-rotating)": [[12, "a2", "orbit-plat"]],
"(code notice-blue plat-eco)": [
[22, "v1", "process-drawable"],
[36, "v1", "collide-shape"]
],
- "snow-bunny-default-event-handler": [
- [52, "v1", "vector"]
- ],
+ "snow-bunny-default-event-handler": [[52, "v1", "vector"]],
"(method 15 snow-ball)": [
[3, "v1", "(pointer snow-ball-roller)"],
@@ -7889,27 +7110,21 @@
[20, "a3", "(inline-array snow-ball-junction)"]
],
- "(trans snow-ball-shadow-idle)": [
- [4, "a0", "process-drawable"]
- ],
+ "(trans snow-ball-shadow-idle)": [[4, "a0", "process-drawable"]],
- "snow-ball-shadow-init-by-other": [
- [20, "a0", "process-drawable"]
- ],
+ "snow-ball-shadow-init-by-other": [[20, "a0", "process-drawable"]],
- "curve-evaluate!": [
- [62, "s5", "pointer"]
- ],
+ "curve-evaluate!": [[62, "s5", "pointer"]],
"setup-blerc-chains": [
[43, "v1", "int"],
[80, "s0", "int"],
[83, "a0", "int"],
- [[30,40], "s1", "merc-fragment-control"],
+ [[30, 40], "s1", "merc-fragment-control"],
[41, "v1", "merc-fragment"],
[46, "v1", "(pointer uint8)"],
[59, "a0", "merc-blend-ctrl"],
- [[64,76], "s1", "merc-fragment-control"],
+ [[64, 76], "s1", "merc-fragment-control"],
[77, "a1", "merc-blend-ctrl"]
],
@@ -7920,13 +7135,9 @@
[65, "a1", "(pointer int32)"]
],
- "update-mood-flames": [
- [[6, 88], "s5", "flames-state"]
- ],
+ "update-mood-flames": [[[6, 88], "s5", "flames-state"]],
- "update-mood-lava": [
- [[4, 81], "s4", "lava-state"]
- ],
+ "update-mood-lava": [[[4, 81], "s4", "lava-state"]],
"(method 27 ropebridge)": [
[101, "a0", "(inline-array vector)"],
diff --git a/decompiler/data/tpage.cpp b/decompiler/data/tpage.cpp
index ea749c2a3d..835051c03f 100644
--- a/decompiler/data/tpage.cpp
+++ b/decompiler/data/tpage.cpp
@@ -521,7 +521,7 @@ TPageResultStats process_tpage(ObjectFileData& data, TextureDB& texture_db) {
fmt::format(file_util::get_file_path(
{"assets", "textures", texture_page.name, "{}-{}-{}-{}.png"}),
data.name_in_dgo, tex.name, tex.w, tex.h),
- out.data(), tex.w, tex.h);
+ out.data(), tex.w, tex.h, false);
texture_db.add_texture(texture_page.id, tex_id, out, tex.w, tex.h, tex.name,
texture_page.name);
stats.successful_textures++;
@@ -569,7 +569,7 @@ TPageResultStats process_tpage(ObjectFileData& data, TextureDB& texture_db) {
fmt::format(file_util::get_file_path(
{"assets", "textures", texture_page.name, "{}-{}-{}-{}.png"}),
data.name_in_dgo, tex.name, tex.w, tex.h),
- out.data(), tex.w, tex.h);
+ out.data(), tex.w, tex.h, false);
texture_db.add_texture(texture_page.id, tex_id, out, tex.w, tex.h, tex.name,
texture_page.name);
stats.successful_textures++;
@@ -599,7 +599,7 @@ TPageResultStats process_tpage(ObjectFileData& data, TextureDB& texture_db) {
fmt::format(file_util::get_file_path(
{"assets", "textures", texture_page.name, "{}-{}-{}-{}.png"}),
data.name_in_dgo, tex.name, tex.w, tex.h),
- out.data(), tex.w, tex.h);
+ out.data(), tex.w, tex.h, false);
texture_db.add_texture(texture_page.id, tex_id, out, tex.w, tex.h, tex.name,
texture_page.name);
stats.successful_textures++;
@@ -645,7 +645,7 @@ TPageResultStats process_tpage(ObjectFileData& data, TextureDB& texture_db) {
fmt::format(file_util::get_file_path(
{"assets", "textures", texture_page.name, "{}-{}-{}-{}.png"}),
data.name_in_dgo, tex.name, tex.w, tex.h),
- out.data(), tex.w, tex.h);
+ out.data(), tex.w, tex.h, false);
texture_db.add_texture(texture_page.id, tex_id, out, tex.w, tex.h, tex.name,
texture_page.name);
stats.successful_textures++;
@@ -691,7 +691,7 @@ TPageResultStats process_tpage(ObjectFileData& data, TextureDB& texture_db) {
fmt::format(file_util::get_file_path(
{"assets", "textures", texture_page.name, "{}-{}-{}-{}.png"}),
data.name_in_dgo, tex.name, tex.w, tex.h),
- out.data(), tex.w, tex.h);
+ out.data(), tex.w, tex.h, false);
texture_db.add_texture(texture_page.id, tex_id, out, tex.w, tex.h, tex.name,
texture_page.name);
stats.successful_textures++;
diff --git a/decompiler/main.cpp b/decompiler/main.cpp
index 2e585fe3db..c865d15675 100644
--- a/decompiler/main.cpp
+++ b/decompiler/main.cpp
@@ -10,6 +10,7 @@
#include "decompiler/level_extractor/extract_level.h"
#include "decompiler/data/TextureDB.h"
#include "common/util/os.h"
+#include "common/util/diff.h"
int main(int argc, char** argv) {
fmt::print("[Mem] Size of linked word: {}\n", sizeof(decompiler::LinkedWord));
@@ -25,8 +26,10 @@ int main(int argc, char** argv) {
file_util::init_crc();
init_opcode_info();
- if (argc != 4) {
- printf("Usage: decompiler \n");
+ if (argc < 4) {
+ printf(
+ "Usage: decompiler "
+ "[bool_flag_name=true/false...]\n");
return 1;
}
fmt::print("[Mem] After init: {} MB\n", get_peak_rss() / (1024 * 1024));
@@ -34,7 +37,44 @@ int main(int argc, char** argv) {
// collect all files to process
Config config;
try {
- config = read_config_file(argv[1]);
+ // Allow overriding config boolean flags via CLI
+ // There are very minimum guard-rails here
+ //
+ // "="
+ //
+ // This allows us to run scripts that deviate from the defaults
+ std::map overrides;
+ if (argc > 4) {
+ for (int i = 4; i < argc; i++) {
+ std::string val = argv[i];
+ if (val.find('=') == std::string::npos) {
+ printf("Aborting - invalid flag override syntax\n");
+ printf(
+ "Usage: decompiler "
+ "[bool_flag_name=true/false...]\n");
+ return 1;
+ }
+ auto pair = split_string(argv[i], '=');
+ if (pair.size() > 2) {
+ printf("Aborting - invalid flag override syntax, provide pairs!\n");
+ printf(
+ "Usage: decompiler "
+ "[bool_flag_name=true/false...]\n");
+ return 1;
+ }
+ if (pair.at(1) != "true" && pair.at(1) != "false") {
+ printf("Aborting - invalid flag override syntax, true|false only!\n");
+ printf(
+ "Usage: decompiler "
+ "[bool_flag_name=true/false...]\n");
+ return 1;
+ }
+ overrides.insert({pair.at(0), pair.at(0) == "true"});
+ }
+ }
+
+ config = read_config_file(argv[1], overrides);
+
} catch (const std::exception& e) {
lg::error("Failed to parse config: {}", e.what());
return 1;
@@ -43,6 +83,15 @@ int main(int argc, char** argv) {
std::string in_folder = file_util::combine_path(argv[2], config.game_name);
std::string out_folder = file_util::combine_path(argv[3], config.game_name);
+ // Verify the in_folder is correct
+ // TODO - refactor to use ghc::filesystem, cleanup file_util
+ if (!file_util::file_exists(in_folder) ||
+ (!config.expected_elf_name.empty() &&
+ !file_util::file_exists(file_util::combine_path(in_folder, config.expected_elf_name)))) {
+ printf("Aborting - 'in_folder' does not exist or does not contain the expected files\n");
+ return 1;
+ }
+
std::vector dgos, objs, strs;
for (const auto& dgo_name : config.dgo_names) {
dgos.push_back(file_util::combine_path(in_folder, dgo_name));
diff --git a/docs/markdown/imgs/windows/release-build.png b/docs/markdown/imgs/windows/release-build.png
index c6d2aaf3c34c5a50df1fbf09b2684ec9ac58639f..46bd46981f372450107df17aa0a6463fb2bd4562 100644
GIT binary patch
literal 7677
zcmaKRbySqyzx@D8NHa)CBi)@2G30F`^An5#iq4hczSponw@ep}gT`v=4
zR)D?kY*KG*!ng7gMU@Br$Uy6#5fMk>5A<4{0yTVn^Fc%A3c4;r3Or_-z=9A`4;<|;
zkEdLif-Ilqvc**ew-k$h2J1XGDsl>r6K1ny56CsPd%Utt$reynr|tPLM0k;Xa{xVT
z6TNKp&ORQ>IQEsENLV_A9?*b968s0KkvIfC&gp
z{YZoXkQtJRKm*WQ(RZOf5+p+PJtFN}LxV_*5*}mR;Ko#XN-!2-i7+5Ar!$gELD15phCE1~OyEEPaxA^s-h=ks;geckK;Znh6^K{tP3`9FL)W>j|W%5pH
zaU;P1y7TGb4HMpF8HLe|aZ@Qb;ySJ9o1cjRwDOGum9lSxw=;72A&v8xij+!tlUO9f{rMVuC5ITA}an*tv~4lJ8*tN(gcR?cj*dNcrAJ4&Ju9$Ra{TQ#cq%!)ll7
z8WEn3tMj?pl)@feprWkks=k
zyTkW1)$IEpo+Ok(86?V=sIQ~$~WC0Uhphb7uPSfYzDgI2?k`Zl;By+
z-Q;LXK85px+?MeZuEN%RV_wXuw7z~)iT@S)ygVn1zL4%Xk!G14E3@-rexqq61OWY%
zY_YriX?EDY(?}}H#IgBVx(TTkY<+BmL~O8jC^dQrZoW5SxUC<|1d
z3)-GWS9l_2ea2j`vER~i|4MZz`a+&v>2R5Xtlf2rzq;F#msgRBslbcho^E<4<7E2QC=vpKu1Q#HbHrsqB65576Yw
zF}r%sCkb@8d53V8wx6qH(oboA&SB{~c}})=+UH@p-G?-du5ZCaqHH3yl)Am?7C@06
z+4dL=6OQb$S4q=#$|5p%uJ^az*QYrTWev&|r)@4ykG?2)ZsM{VbgaZNZg+*p3{5Qa
zpL0*k0jRCBX_#)thTC*jQ^7sCypswygMPKK>c)CBA2;8*JCYiA6yu11?cXDw=hWUS
z$Av3!D00dB&m8YR=D0^joW-3dx`FvVRk>c}72J~0Id>0PY9zYc)_G_tod{%ckOhj)
z)3a~X@_8Y(kh$#>L-r0~zAtY#Mcec8@)+tBT(T~cz#HaWFQNlNw~cqw+8|qWMR!`M
zKRA4st!*4`M0O3_vh9uC*tQVwoaK^=$z~TTpiTNAHVT^P>s
z5NL&UcLkl{OKDR05bV!e_Z2?SF%!4Xk!XA^P+8;EK};W>AKyiwNIPR#Z@>?OZG5an
z$-d-2GWEZ}I7+E+(Xz>jt-b=Rwv`oyvXHkYW3GN-0tLSF>s7*X7qyu)h}Xu4F|m={
zTMGCLJe3uVp!JNd>m}#aS9WoP)n3h^A_v4d`G{s`Ae
zoNz}G-NvcSD(XjJ)|GJUDQH7yNWZd*%2L^)A>T(!K!
zejwBJK&md=!zEd((I}+eVRkueaI}%X#?%uLS;OI(QP@9-Dc;
zmXG)sL73#@r#*H;d^gV`@T^QrF~p{vg0_XX%*>xI3yju}6^n;6x?O$D7HY9tV(;C5
z4+ykz!h^zsM<|U)2F6-h*TO_qzTVuqCZ>tM!jj%E#zRpi83narb_$mFN3SIushWEM
zB=00fO6AzAsZBU0if&V%Q=ir^MYC-nv6r#_MZdocf%F2(v`>Eijy#!>*AYkyAquX!
z>eujx%>V!*0oRi`QwGlTUAgveB9H+RUcI?-)vcy?lEja(`Pr!2i5@N*+mrSHLL}|C
z8@#Gy<}b=H{tu_;uDZ3lW+8U8sp5Hjwys(0Jd@y-O^Ccb--(jev&jD;RrjU}?i_iJ
z?-C*v@SDi#LJ=?EsIn&|+8Oh(4glzX+FMKQ7I_Iy?
zm!g2ShJS-!zt43|m2SJgeyo2bFXdL!9jXF;{0s2CB?xesFU7@z7+
zf4v0g**?!E9w-#SrsFmF?w}y2eOJHE{Y)$&|7=irENvKQ>UW-`6x|s}6g=R%$Ec=7
z^$+XSk{@c05LY}+v>zF#DW<)y(l0;s>!n8jVulBOaH-eHqgm_r&}%g#St81+jKg|8
zj?h3cUg%z`M%>yJbReLYbBxoi8QF2Sf*$NJA`JE0f~QKRL3@(+!?{8`e?JT
z9d`Gs_Ocw?{wVTrb#=b=cJPnkZ2d>=d5ut0TUgpe
zzeYKcjA?TEBrm5H5X_(X%_!$7tr&fX6!WDZ!eaD^qwx59oKV)6j00-x{Wx*Tj`5w(
zjd^t>W(zwAMkjtN{W0>VQk&0AyxthQpAp2E9aDX4D9#>h
zif*mgCk?aGSrCS**g}Eh`?-cN*AMES47l)MU11KWHO3)^-UrKQejYy3ffoM{53Jj+
zgU-uoZW3$0c4e#${UNR)Tzn?>{4={Ho`h-+-1Nc_!;Pg>0)2RI7yc!;SWw44WNxMf
zBE>qrcMfJuA8qaVTGvW>PPl>;_>s3u9EAe;o2@#=~99*pSMde3f8corXo+(8+8)Hk{@
zl)T5B0pu7vq($}TUPi)r(m}efJMsrSJBcOW3ycFgb^GRy
znx~(=*K_sc_I7`5X_b7hpC{=4#3a0B-JOJP8~d9|-4aTwwg2{OVY$8S-@d9;E#r7{
zR<@|)^hS2){Je6ausHKEP1bIm;rnjd*CJ`uh%i?!vY36>GIKuim6hjF??s2VWSq)(
zlOKY*?dqL7MnAt8;DU^n)N4ULzb83NGnaq&`e7#*8cm$kRqm~F!>yO24RiLW<_a5d
zN=rZQT4v6ocY{ndD`(gxpS0XmU)spKed+XVk%s(GrgheZ+B44maw^R2(2K!jxkGyw
z3<)T~3kQZJxb+B~ZCTvOW0`0=Z`%=BX;}V)l>`U|(Y2hjt^8Oi*rD&1Y=3*~
z3zGdyk@|)PaD;6C?cHHOIMHiL|HU#F&U@fJjtWxPQ%`C>@ZydE6GfkTIZb8nNwc-&_+UA_|4ko92~T
z5c80uG>0%@?;E5jv5Gg9SzEC%beArKMMggrB}{}k3c^^@4IVZw33>PZK5yUa!&_aG
z{XOzB4v+{)A%v@UcFej3p?sK7W;5oK5@CvxL@E&vdk@>g2LWH7YOL=}#Ys;r21v-0
zKe(4qz$de3&(i$^9`5Cy&B=%J9B-bw^^vW9iqI6ltgLg$B}IuT(vGFb2k0u!b@;=r
z=k=PyMMS9oowGE^=Qby4#>ZQ}PjIohv;n2ahJX*M52s6ZuTC0e${m_UX{(p-=NIcv
z&$Ng4ra+qY{ui_ki`SVgV-lu6zPX6CCy@=tyzlrWB_9eKy_{2>nGSl7Q5V^axmM5F
z)fzjg_r6ffJ!Y)n>#=(MIiV}@;KxuB85vItg(K2cC;m3c+pFjatO?5+ln;;(jLz*W-wy^
zG>11asb+{cz|=5iZH{MhaM;a4a{E$C=6GX?-4BI^&0Qi1B7;4=KX0d1_}yFAoo5p%
zB3P5Fv#T=-S|5_*@`)jNzIf*C57xPqE+cKXF;`4Rh!vti})#aiU*=_w4&(K
zo`>KlUCqEW=o}q=x4hPzrd;1QMlmKU&1w`mDdgk8|6>^FVZSowea1n9)TN47m+)~<
z^eETOc)6w3G{9Q^TOt46B98BOt+|u_>z$H@XvKe+^tZ5G{kx=xF03lds>b@4$0YKp96<7E3GUrt8kQPxJ8
zGo)Q&3=B&eEYpS19He+`2xLDwB^W=0?3yg7u@+8$OlQ`3E;%y+uWvci;Q^6GT|K3j
zsOfajsk2!64%Y(pTq1Le8#-U@;*pbW;2tCOn^-I7%k(xPbmaUW>fgESc)BGwOgQscKae!N
zPFC{GP(P&3g&Kg2fQOT<%*oaPD_43=qPfz2c#;i)soC_|7;`Rx+~ZkUSMe^Now!p@
z$Nbr+<>=Z<&yAIa832?$RhPUvfAy^i3gW3)jzgbZJ@a;AMn2^#BgALN<(%O1tv1E9xqGzOFTA;{@
zdlUVW#^b@J0T?2hukD7~qs%|zdgc-C+naR*xF}DTnHwd(N6yy`B_-SWx1w1_JZ;O!
zggQNfLj4y$HXc~vtX_A3f||P-ezG78`MdX*ICN7IEFxVXZf8mrV2sV|eDBu?{Q7ZH
zy2(M3ODZG;dqYBbk+pCGM3C_2K_GwL0^F#DjPDSV?>Bp;bSIWlYp}RT<-67uDY?L&bfZm>6?)3F)}`({r<|>bIsMwl
zH(tzmRKTNAY=rAkkCc#~%Ul-lbx&@skS*u0Gsv^eM0skQ@fQsv7mw8NPan0>m>Zt5
z{K=d`tGuL%e9>=LMB(M5>>UlhP0!+sE*h0(_|#Ie@Ko`QaTF|xb%FQLXUGSdzB|;L
zrKQSR&zgwODY+hU(fOEh=yzPg0a?t<(qNI!2=xgUGV*Gc;V*=Evrm?;syydt!bn*qTRJR53vH!`fKlVk
zCJ>mo9fn0#udNf4EC`(W`d~Lt{_9*Vtrfaf@fRWt+ylNKFris58ND`O(k)Pjd4A+j
zs5i1)7vg%qdQv}ZTa$xZttqzSbCo(bu~rXaUy#dYnR#gFY^XZ&2!ab{a`bZwO|mxI
zVil@z>>?spt~AqK?(D=W2CUII<)Mc1-pR?v`w%+>e=PNsosBUl@i69kk4ti}0q-5$
zr2?yLb*1MTa_Fb`27MD
zO`xO9Gin+Jv8+|vjzn}RwI1tg*w0jzFV3FW-yN$rtOc@!wcQA2pF9>AQJe7p%=uM&
zCa#R8*XqorR)63d$@p%`O4pC_sE!4VrOmk?)gyW@#Ih!(pZ6?as)Kx;HxxtLfqi3W
zB?IZg?~j06c8m&Akj`&d=Dz!Ui!p@
zzs%AN;?mL!ot7WqJ}8v6KZE!gh|MeZFE8`oR^(qT_W!KU;7@B=7^y2cz1N$Q8#z5E
zklR7NHKXS4|G@ZxQOh_BW(mqvg;5~Ptd#k=eI
zQ}hqCoL-{gyEbc*Tz-LZ5K4RG52FonebwiG7}elRVGDf-_pfW{VIKEH1O75QzMb$d)ALkT}Hia3u-BnY!4M
ztuDAw5^WtG^$TRa-~wgJu#R0x%}qa_qvMhI+Rcb=Q#1U&AJ$&d^oQ>C^MW
z))oqfFNr7msS#G;!i28cQ|2ouANiHpN`Z5a1~b>k>%b^|6=$
zlA~KdS6Z@^ng4MhObhbrl1sUX)N3G#QY}$>B{l4z_22nNG>Aag9xPjVH$Ax)KQV~-
z0+lcvSU^3!BUXuX;+B2~n{=vV7vlaIrr9Bd3nbou`&~!VtSpp(B@F9baOBE+3IbtW
zNq3SI%ESS7fm@kM|4AM*b1y(3Zf{j-rUbiCl8*c{ZY0SIb4`(>2r8OAccHH?E+3Wf
z07U}I8@fDd?N{Br%f!JosH{L-XqV`R-?_bX0h#`1`E=ui0atRY1#OYv
zuPLIU1GQE~i#XKjpc0<6Ap6#H~#a1>Wh&?I4?hMV@Q3J242=D;@rcIp!brKQG5vU6>2^uZ7FJV%gTas2Acg5Y1uxJe&aUsE?0?~Js27@JaxNjNC_NBgm%$(Jx?JX1@uwBSl${n@xXpf6U2
z$J%X^>87*+V8EP4D~>k`8exzBR0Aq=K#~J%s10)fv$k@YkNTjGa;)zr+U6bXaM*R_
z5~*jb#3hxdv}OpW<$K-e74)-t(*k_BtR+fkMgxE7OocR-ybGpBZ9uzqmoOZg^{+?z
z4jtJBV6Tqwa-2<&G!bysy=I>-dSg+4Tc-0bELeDaDU7NUwC4kF`;Z6;h!r<*5A6gc
zvXXxh>GzG1@u|D`)BHr|`TT6EHhwYAXco?J--oq`(QaNOC(a);6MdW7W
z)ZTDUDb^*mw?x$}!)wsvGHr0Pz{`)qaa+;Rp9miXCX6qT1yUMSB9zTx{KjA8u_O2$
zw8wc!r6_#Fwr}ZSTrfBtI#H^L%hR$
zjWtX1s(jy{(4w)YF)>_V5?i@y)zvAzd@G5mY3IjSkc@7I+A{9dI#1mXV6>83X#|8Z
zYCAz4Y#YxYak_FGry2VV3!U?Uu8EtOkZ+mR3KNehahh1b
z5(P)7&s~qva=v57Ep#vJ(rzZcWG1nyed+hryXZDor<_bvMKW2RPQ!rt0DJ#CbWFkt
z!qcpOUXHS9I+rm|8T_Gs-!w@f$d`5=AzmsQKf=WNV6wjuNT9(Xk^
z9v3?p*tQA%W%pI;g$}T>;CNp+a02PCR&oW6
zDuKJ>R(ziHU2oCW{MyfDI8^VdnZ`45&us+R$WbDEo<2$tV1iQcfItZhT9kWvffCpz
zo2$ffC^WgcSa96gt8D*P*>?S@?awBa&lS;wU9Pi@ogGYx&W{v~w;CEcM`l504tR!7
zW^Ne5&_z!+hq2jBW{Ju$44jwTWX47<0=5PUjIkn8pxJ+TK6rK(@ZaZ}obnHZ_rR;f
UeRUoZl;j3L6x8J_z;A>83z^)-bN~PV
literal 4543
zcmai&XH-+qy2gRfq)JnIQHr1eX+e7LAQBLf2uNt5Y!InZq;~|RX$Vbv3kZY&f~fFE
z0Zj}YHce29NKudoN;%PU*1dO~FZaWqJ@f9pW@fEKHYCD^@oJH
zP?P-!hzCdS-z#bp37smdv%ilxKNqU*s(Wf_eRx0k9`D2$SBf8n1yR%L>Il&4o+i=j
zo~Ff79%|t9ze75hmr11~<|o*>#8Sx`jmW9|vo1P_nNrr1X8q!wNJI>b5fvW;D`lkt
zMN3)#bQw_)kkWb^zf}6hfC*1naS!G1M2YB;2-Wj
zXvK}|&k!&wwNi3^Dv2=8Ue=5J3xmma<(3Q&6K{sgFoWX88lCw5(Cb!N9?=excvjZA
z&OoW9f{uZ%jE9+RVFr>vId^S$3EU`ltFYY9B6p-&%z-8c
z-?d=^Sb)wdJ%pJ`k&n~GitqO3Me1{(1IjGFTW&5|A6o}l3rC9&!f+57epS*H+v~$Y!1%ZtHA?qH7`#J8xa>FRwfC-qYd?8|8Xpj2=tiBy
zy;3~oa9#^9E~CzOdL_c*@as|JmEAM+=l!D`g)7!y@B!Hph8~}KeWDtnOVeuTcSv6)
zHOL!68wV!UVqZSyeOtyWXudFHS_z3K2y;u(4WiUpB7mz{W33e2@~9#Ejk!8oDLqjCyv(m{w{p%tf*TSBOE
zzniG7X*&~D@tXUBUt4RbDt7^Txex4s_2xL81F)1CRiIpWiM16=8VwPXP_wov&Ker_|hpcy#eXOaQMjIWw$Q#o(!q2Gz9Sks*32iX_
zxzwyOf@h(n4%4sgFGwkr{Fp-xXf=%zi_}Y^$kQo)l*zQ}E&1{PVah0$?thpfw$?z!
z06v-g@};`uOb{1dfJC1+Dpr|v6L1Gy#Ja4Kago-{Xt7T*_E(v?Y0unTJht&!5@dhEF`
z$|S)ySf^WrE(qvjXvJ3MV__|Iyyyr#4_q1hL%K*TTrQbKZNXz-gOCABw>B;w>FlCw
zEEI3-=JeiR{gc5C>9878B-ZM0HskB!u|k9NI7(I_R!#4Q&OGwbq2vNi_XXuOVe5F}
zrN37Fl~R5wKTzV7LQGnDSQ8uV7BEnrB6l224-UhAMqOTo;B<8m%%n51lJGdpw0}uT
zm(&7LlD%JoOFPXkRZx=&c^_lYQf^6{&27botCEbCGhVi|oGY8_iBf;gb9Tv&_7?*1
z^gFqAazN&@rzm405@+4WajSnLY)72A+BRDsJs{2nea;8mUEu?9-n{jbrQ<7JuPcKB
z?>^ASJe$&c_D4?>zPSExk9?n=R^5qbR9#B?N3<%3TlImuxS`~tByP}MLDylzA?&Iv
zmU>mG43pzSkBiby?xeT^A3hL%!L5A(4u-
zz-}NQyvT=A!W|IW9{EVzPl9i+D+7tP&g^Y+S^Rb;@rktWn4~kK0yf`MQ_g`7`_L(i
zPp?~(?;;HMsKfNC9ZnjZ!vk;Q&tF$IHjFx4+;3!k+jGSNPC3At&!NBrOJ`MW_jf)B
zbe(nB-q6mVY-W^8sAtReT!nB-<-`*&y2ocIu4iYb;XAvM8XHh_e}j20WZ=$9`mzD<
zF#Yq%!Vx{9N`5FkJs5*GB2Ach2qoi*8sx+xuhx=-UP`s|QkSpSoU${*0j9>ctuphU
z5_V+CYEu)bZ+iybNs<+v_xl+RF3|^f-S#^FU2t{$1{F}LF5qHL-e3rFIRCDR>TS;x
zg~vb7eQ;0zqIytBJtg^$@ukTA4|e?%4ejHPAEF~8zx3unwRveN`(&w)DGJ|6uN8B$
z%2O1!z3(18wC65LnqUMkAFJD3A@?IWv!i-gJ$q2&qes>)O7HP{RtNx>8vXm%FM4`<
z3c>I1d>({G_r+4U5%<>t{zdfvF@S%^|M7+tCjaL%))rMiDI$B-wE_a19`mr9`LU$`
zilUcNe4xqeKXZX3F>Id{9jInLT;l&mK)CH=)7Z?0|6+3n)pbtbkSH*iqi`spGFM$g
zjeLelQG$311trjs=cNBlJcIjK2G4>~96NZznpaK84`&UW+AaGvNkZvp2R(UKz39
zabZ)D7o_eJjz?;oeG|Z&M#no#)D6$e1-}W%4*urgBZC<&3d>M4%6znhF%Gk*0<{=sT*2b;cpF-@Pyg}xi93$Da#5?r9$=%Z~`V`<^N
zhWE5WlugkABN?`LH(x#tX~ed_V28^Sv(b3T&@KPsdNZw==v8QcYw;h+^CZB&(nWNn
zPG5CF77!DgMUs#TZkPCem1CO)@9r5j!o!P<=cy=k7^4D_=TlY7v$SUu1WLA^bZ&6x
zOyeu>>pk=A#A9GJW~g$J7*h?tj|h
z*Q}EqoFu_r1wLIn;Te%Hk7&f|=5he>@$r3qeK|QfXJv0aL8GU4CL?BgB)_6Pi|>6p
za3%;x$-MorwwCp7a;qdl##v^|m>VkdjD5tm?4=QkAcec$1pl%MK7al^WMfK<_;8^s
z)Sqwuju4RCCG?h^X3wy1xsPZnAaO4^r^gy
z&-27+`m93(GLgfR-psdbkuJ;n7`Gycj@(Em2GEGpWtcCB(x=vmhu5z&N9L8V%)yXNv4#Jin+6e;|xLWp;
z@ZcImchO9{|8^R#`lM+17~+^lwz4SXoz8I*Q3WfV5!r$3>O0?4j~pYl9Pm%sSPJ*U
zmV&a=-b^bi6xd}E2=Id=E;3UxR88%UTSZee^7hMmQLN{bhgqznu~lL5TI*T2k*A|J
z)$G9l`X3(~GaQ`}`Z0uu_{A+NE~4;
z*geq>wLNe~#p7zxNH2C!RfzXciC7)FbBUlhlrTS3OJpNo3}7p1kyN>^)ln3+nOl$7
z^=s8HBh8y~95lQT1r-;SXWolm{?fhy!XN4~7<+mcvCD`B2AbL1NH`VGb%j3mXtWF-
z>K!clAtnEIkR3g5Si4(>ai^v88oTHE|9vigCiu)xD@oo*U7}RHyi8
zYHC*AH4(_=HUD*Tf;n<)?+}S>!I&>q<{Ux{tE7Edkl|r-5zT#23%n%ffeCqZbOI
zZn8$*BcC}tYmt}WgV96yigsuzP=Tc@U-K%P=I^yHHc`t(?!3DZeX^W$LuTes(fROO
zKcD7CvdHn?; buffer(width * height);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadBuffer(GL_BACK);
@@ -446,5 +448,5 @@ void OpenGLRenderer::finish_screenshot(const std::string& output_name,
for (auto& px : buffer) {
px |= 0xff000000;
}
- file_util::write_rgba_png(output_name, buffer.data(), width, height);
+ file_util::write_rgba_png(output_name, buffer.data(), width, height, compress);
}
diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.h b/game/graphics/opengl_renderer/OpenGLRenderer.h
index 111ef0397f..c26b22b5b2 100644
--- a/game/graphics/opengl_renderer/OpenGLRenderer.h
+++ b/game/graphics/opengl_renderer/OpenGLRenderer.h
@@ -18,6 +18,7 @@ struct RenderOptions {
bool playing_from_dump = false;
bool save_screenshot = false;
+ bool screenshot_should_compress = false;
std::string screenshot_path;
};
@@ -34,7 +35,12 @@ class OpenGLRenderer {
void init_bucket_renderers();
void draw_renderer_selection_window();
- void finish_screenshot(const std::string& output_name, int px, int py, int x, int y);
+ void finish_screenshot(const std::string& output_name,
+ int px,
+ int py,
+ int x,
+ int y,
+ bool compress);
template
void init_bucket_renderer(const std::string& name, BucketId id, Args&&... args) {
diff --git a/game/graphics/opengl_renderer/debug_gui.cpp b/game/graphics/opengl_renderer/debug_gui.cpp
index ef95cec630..8c75e5acf0 100644
--- a/game/graphics/opengl_renderer/debug_gui.cpp
+++ b/game/graphics/opengl_renderer/debug_gui.cpp
@@ -96,6 +96,7 @@ void OpenGlDebugGui::draw(const DmaStats& dma_stats) {
}
if (ImGui::BeginMenu("Gfx Dump")) {
+ ImGui::Checkbox("Compress Screenshot", &m_compress_screenshot);
ImGui::MenuItem("Screenshot Next Frame!", nullptr, &m_want_screenshot);
ImGui::InputText("File", m_screenshot_save_name, 30);
ImGui::Separator();
@@ -112,8 +113,7 @@ void OpenGlDebugGui::draw(const DmaStats& dma_stats) {
}
if (ImGui::BeginMenu("Frame Rate")) {
- ImGui::MenuItem("Enable V-Sync", nullptr, &m_vsync);
- ImGui::MenuItem("Disable V-Sync", nullptr, &m_nosync);
+ ImGui::Checkbox("Enable V-Sync", &m_vsync);
ImGui::Separator();
ImGui::Checkbox("Framelimiter", &framelimiter);
ImGui::InputFloat("Target FPS", &m_target_fps_text);
@@ -131,4 +131,4 @@ void OpenGlDebugGui::draw(const DmaStats& dma_stats) {
if (m_draw_frame_time) {
m_frame_timer.draw_window(dma_stats);
}
-}
\ No newline at end of file
+}
diff --git a/game/graphics/opengl_renderer/debug_gui.h b/game/graphics/opengl_renderer/debug_gui.h
index fd0e9b9359..ecf6ec0b0f 100644
--- a/game/graphics/opengl_renderer/debug_gui.h
+++ b/game/graphics/opengl_renderer/debug_gui.h
@@ -61,21 +61,9 @@ class OpenGlDebugGui {
return false;
}
- bool get_nosync_flag() {
- if (m_nosync) {
- m_nosync = false;
- return true;
- }
- return false;
- }
+ bool screenshot_compress_flag() { return m_compress_screenshot; }
- bool get_vsync_flag() {
- if (m_vsync) {
- m_vsync = false;
- return true;
- }
- return false;
- }
+ bool get_vsync_flag() { return m_vsync; }
bool framelimiter = false;
float target_fps = 60.f;
@@ -90,10 +78,10 @@ class OpenGlDebugGui {
bool m_want_save = false;
bool m_want_replay = false;
bool m_want_dump_load = false;
+ bool m_compress_screenshot = false;
bool m_want_screenshot = false;
char m_dump_save_name[256] = "dump.bin";
char m_screenshot_save_name[256] = "screenshot.png";
- bool m_vsync = false;
- bool m_nosync = false;
+ bool m_vsync = true;
float m_target_fps_text = 60.0;
-};
\ No newline at end of file
+};
diff --git a/game/graphics/pipelines/opengl.cpp b/game/graphics/pipelines/opengl.cpp
index a1ecf3e5fa..611210dcd1 100644
--- a/game/graphics/pipelines/opengl.cpp
+++ b/game/graphics/pipelines/opengl.cpp
@@ -35,6 +35,7 @@ struct GraphicsData {
// vsync
std::mutex sync_mutex;
std::condition_variable sync_cv;
+ bool vsync_enabled;
// dma chain transfer
std::mutex dma_mutex;
@@ -262,6 +263,7 @@ void render_game_frame(int width, int height, int lbox_width, int lbox_height) {
options.draw_profiler_window = g_gfx_data->debug_gui.should_draw_profiler();
options.playing_from_dump = false;
options.save_screenshot = g_gfx_data->debug_gui.get_screenshot_flag();
+ options.screenshot_should_compress = g_gfx_data->debug_gui.screenshot_compress_flag();
if (options.save_screenshot) {
options.screenshot_path = make_output_file_name(g_gfx_data->debug_gui.screenshot_name());
}
@@ -428,10 +430,10 @@ static void gl_render_display(GfxDisplay* display) {
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
// switch vsync modes, if requested
- if (g_gfx_data->debug_gui.get_nosync_flag()) {
- glfwSwapInterval(0);
- } else if (g_gfx_data->debug_gui.get_vsync_flag()) {
- glfwSwapInterval(1);
+ bool req_vsync = g_gfx_data->debug_gui.get_vsync_flag();
+ if (req_vsync != g_gfx_data->vsync_enabled) {
+ g_gfx_data->vsync_enabled = req_vsync;
+ glfwSwapInterval(req_vsync);
}
// actual vsync
diff --git a/game/graphics/texture/TexturePool.cpp b/game/graphics/texture/TexturePool.cpp
index d183b095d4..3991df4584 100644
--- a/game/graphics/texture/TexturePool.cpp
+++ b/game/graphics/texture/TexturePool.cpp
@@ -249,7 +249,7 @@ std::vector> TexturePool::convert_textures(const
fmt::format(
file_util::get_file_path({"debug_out", "textures", tpage_name, "{}-{}-{}.png"}),
tex_idx, tex_name, mip_idx),
- texture_record->data.data(), ww, hh);
+ texture_record->data.data(), ww, hh, false);
}
result.push_back(std::move(texture_record));
}
diff --git a/scripts/tasks/Taskfile_darwin.yml b/scripts/tasks/Taskfile_darwin.yml
new file mode 100644
index 0000000000..956f5f4946
--- /dev/null
+++ b/scripts/tasks/Taskfile_darwin.yml
@@ -0,0 +1,4 @@
+version: '3'
+
+vars:
+ RELEASE_PATH: './build'
diff --git a/scripts/tasks/Taskfile_linux.yml b/scripts/tasks/Taskfile_linux.yml
new file mode 100644
index 0000000000..956f5f4946
--- /dev/null
+++ b/scripts/tasks/Taskfile_linux.yml
@@ -0,0 +1,4 @@
+version: '3'
+
+vars:
+ RELEASE_PATH: './build'
diff --git a/scripts/tasks/Taskfile_windows.yml b/scripts/tasks/Taskfile_windows.yml
new file mode 100644
index 0000000000..910ead1667
--- /dev/null
+++ b/scripts/tasks/Taskfile_windows.yml
@@ -0,0 +1,4 @@
+version: '3'
+
+vars:
+ RELEASE_PATH: './out/build/Release/bin'
diff --git a/test/offline/offline_test_main.cpp b/test/offline/offline_test_main.cpp
index dcdf1ad7f1..b51c9995ed 100644
--- a/test/offline/offline_test_main.cpp
+++ b/test/offline/offline_test_main.cpp
@@ -180,7 +180,7 @@ Decompiler setup_decompiler(const std::vector& files,
file_util::init_crc();
decompiler::init_opcode_info();
dc.config = std::make_unique(decompiler::read_config_file(
- file_util::get_file_path({"decompiler", "config", "jak1_ntsc_black_label.jsonc"})));
+ file_util::get_file_path({"decompiler", "config", "jak1_ntsc_black_label.jsonc"}), {}));
// modify the config
std::unordered_set object_files;
diff --git a/third-party/fpng/fpng.cpp b/third-party/fpng/fpng.cpp
new file mode 100644
index 0000000000..1b889306a6
--- /dev/null
+++ b/third-party/fpng/fpng.cpp
@@ -0,0 +1,3118 @@
+// fpng.cpp - Fast 24/32bpp .PNG image writer/reader. See unlicense at the end of this file.
+//
+// Uses code from the simple PNG writer function by Alex Evans, 2011. Released into the public domain: https://gist.github.com/908299
+// Some low-level Deflate/Huffman functions derived from the original 2011 Google Code version of miniz (public domain by R. Geldreich, Jr.): https://code.google.com/archive/p/miniz/
+// Low-level Huffman code size function: public domain, originally written by: Alistair Moffat, alistair@cs.mu.oz.au, Jyrki Katajainen, jyrki@diku.dk, November 1996.
+//
+// Optional config macros:
+// FPNG_NO_SSE - Set to 1 to completely disable SSE usage, even on x86/x64. By default, on x86/x64 it's enabled.
+// FPNG_DISABLE_DECODE_CRC32_CHECKS - Set to 1 to disable PNG chunk CRC-32 tests, for improved fuzzing. Defaults to 0.
+// FPNG_USE_UNALIGNED_LOADS - Set to 1 to indicate it's OK to read/write unaligned 32-bit/64-bit values. Defaults to 0, unless x86/x64.
+//
+// With gcc/clang on x86, compile with -msse4.1 -mpclmul -fno-strict-aliasing
+// Only tested with -fno-strict-aliasing (which the Linux kernel uses, and MSVC's default).
+//
+#include "fpng.h"
+#include
+#include
+
+#ifdef _MSC_VER
+ #pragma warning (disable:4127) // conditional expression is constant
+#endif
+
+// Set FPNG_NO_SSE to 1 to completely disable SSE usage.
+#ifndef FPNG_NO_SSE
+ #define FPNG_NO_SSE (0)
+#endif
+
+// Detect if we're compiling on x86/x64
+#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(i386) || defined(__ia64__) || defined(__x86_64__)
+ #define FPNG_X86_OR_X64_CPU (1)
+#else
+ #define FPNG_X86_OR_X64_CPU (0)
+#endif
+
+#if FPNG_X86_OR_X64_CPU && !FPNG_NO_SSE
+ #ifdef _MSC_VER
+ #include
+ #endif
+ #include // SSE
+ #include // SSE2
+ #include // SSE4.1
+ #include // pclmul
+#endif
+
+#ifndef FPNG_NO_STDIO
+ #include
+#endif
+
+// Allow the disabling of the chunk data CRC32 checks, for fuzz testing of the decoder
+#ifndef FPNG_DISABLE_DECODE_CRC32_CHECKS
+ #define FPNG_DISABLE_DECODE_CRC32_CHECKS (0)
+#endif
+
+// Using unaligned loads and stores causes errors when using UBSan. Jam it off.
+#if defined(__has_feature)
+ #if __has_feature(undefined_behavior_sanitizer)
+ #undef FPNG_USE_UNALIGNED_LOADS
+ #define FPNG_USE_UNALIGNED_LOADS (0)
+ #endif
+#endif
+
+// Set to 0 if your platform doesn't support unaligned 32-bit/64-bit reads/writes.
+#ifndef FPNG_USE_UNALIGNED_LOADS
+ #if FPNG_X86_OR_X64_CPU
+ // On x86/x64 we default to enabled, for a noticeable perf gain.
+ #define FPNG_USE_UNALIGNED_LOADS (1)
+ #else
+ #define FPNG_USE_UNALIGNED_LOADS (0)
+ #endif
+#endif
+
+#if defined(_MSC_VER) || defined(__MINGW32__) || FPNG_X86_OR_X64_CPU
+ #ifndef __LITTLE_ENDIAN
+ #define __LITTLE_ENDIAN 1234
+ #endif
+ #ifndef __BIG_ENDIAN
+ #define __BIG_ENDIAN 4321
+ #endif
+
+ // Assume little endian on Windows/x86/x64.
+ #define __BYTE_ORDER __LITTLE_ENDIAN
+#elif defined(__APPLE__)
+ #define __BYTE_ORDER __BYTE_ORDER__
+ #define __LITTLE_ENDIAN __LITTLE_ENDIAN__
+ #define __BIG_ENDIAN __BIG_ENDIAN__
+#else
+ // for __BYTE_ORDER (__LITTLE_ENDIAN or __BIG_ENDIAN)
+ #include
+
+ #ifndef __LITTLE_ENDIAN
+ #define __LITTLE_ENDIAN 1234
+ #endif
+ #ifndef __BIG_ENDIAN
+ #define __BIG_ENDIAN 4321
+ #endif
+#endif
+
+#if !defined(__BYTE_ORDER)
+ #error __BYTE_ORDER undefined. Compile with -D__BYTE_ORDER=1234 for little endian or -D__BYTE_ORDER=4321 for big endian.
+#endif
+
+namespace fpng
+{
+ static const int FPNG_FALSE = 0;
+ static const uint8_t FPNG_FDEC_VERSION = 0;
+ static const uint32_t FPNG_MAX_SUPPORTED_DIM = 1 << 24;
+
+ template static inline S maximum(S a, S b) { return (a > b) ? a : b; }
+ template static inline S minimum(S a, S b) { return (a < b) ? a : b; }
+
+ static inline uint32_t simple_swap32(uint32_t x) { return (x >> 24) | ((x >> 8) & 0x0000FF00) | ((x << 8) & 0x00FF0000) | (x << 24); }
+ static inline uint64_t simple_swap64(uint64_t x) { return (((uint64_t)simple_swap32((uint32_t)x)) << 32U) | simple_swap32((uint32_t)(x >> 32U)); }
+
+ static inline uint32_t swap32(uint32_t x)
+ {
+#if defined(__GNUC__) || defined(__clang__)
+ return __builtin_bswap32(x);
+#else
+ return simple_swap32(x);
+#endif
+ }
+
+ static inline uint64_t swap64(uint64_t x)
+ {
+#if defined(__GNUC__) || defined(__clang__)
+ return __builtin_bswap64(x);
+#else
+ return simple_swap64(x);
+#endif
+ }
+
+#if FPNG_USE_UNALIGNED_LOADS
+ #if __BYTE_ORDER == __BIG_ENDIAN
+ #define READ_LE32(p) swap32(*reinterpret_cast(p))
+ #define WRITE_LE32(p, v) *reinterpret_cast(p) = swap32((uint32_t)(v))
+ #define WRITE_LE64(p, v) *reinterpret_cast(p) = swap64((uint64_t)(v))
+
+ #define READ_BE32(p) *reinterpret_cast(p)
+ #else
+ #define READ_LE32(p) (*reinterpret_cast(p))
+ #define WRITE_LE32(p, v) *reinterpret_cast(p) = (uint32_t)(v)
+ #define WRITE_LE64(p, v) *reinterpret_cast(p) = (uint64_t)(v)
+
+ #define READ_BE32(p) swap32(*reinterpret_cast(p))
+ #endif
+#else
+ // A good compiler should be able to optimize these routines - hopefully. They are crucial for performance.
+ static inline uint32_t READ_LE32(const void* p)
+ {
+ const uint8_t* pBytes = (const uint8_t*)p;
+ return ((uint32_t)pBytes[0]) | (((uint32_t)pBytes[1]) << 8U) | (((uint32_t)pBytes[2]) << 16U) | (((uint32_t)pBytes[3]) << 24U);
+ }
+
+ static inline uint32_t READ_BE32(const void* p)
+ {
+ const uint8_t* pBytes = (const uint8_t*)p;
+ return ((uint32_t)pBytes[3]) | (((uint32_t)pBytes[2]) << 8U) | (((uint32_t)pBytes[1]) << 16U) | (((uint32_t)pBytes[0]) << 24U);
+ }
+
+ static inline void WRITE_LE32(const void* p, uint32_t v)
+ {
+ uint8_t* pBytes = (uint8_t*)p;
+ pBytes[0] = (uint8_t)(v);
+ pBytes[1] = (uint8_t)(v >> 8);
+ pBytes[2] = (uint8_t)(v >> 16);
+ pBytes[3] = (uint8_t)(v >> 24);
+ }
+
+ static inline void WRITE_LE64(const void* p, uint64_t v)
+ {
+ uint8_t* pBytes = (uint8_t*)p;
+ pBytes[0] = (uint8_t)(v);
+ pBytes[1] = (uint8_t)(v >> 8);
+ pBytes[2] = (uint8_t)(v >> 16);
+ pBytes[3] = (uint8_t)(v >> 24);
+ pBytes[4] = (uint8_t)(v >> 32);
+ pBytes[5] = (uint8_t)(v >> 40);
+ pBytes[6] = (uint8_t)(v >> 48);
+ pBytes[7] = (uint8_t)(v >> 56);
+ }
+#endif
+
+ // Customized the very common case of reading a 24bpp pixel from memory
+ static inline uint32_t READ_RGB_PIXEL(const void* p)
+ {
+#if FPNG_USE_UNALIGNED_LOADS
+ return READ_LE32(p) & 0xFFFFFF;
+#else
+ const uint8_t* pBytes = (const uint8_t*)p;
+ return ((uint32_t)pBytes[0]) | (((uint32_t)pBytes[1]) << 8U) | (((uint32_t)pBytes[2]) << 16U);
+#endif
+ }
+
+ // See "Slicing by 4" CRC-32 algorithm here:
+ // https://create.stephan-brumme.com/crc32/
+
+ // Precomputed 4KB of CRC-32 tables
+ static const uint32_t g_crc32_4[4][256] = {
+ {00, 016701630226, 035603460454, 023102250672, 0733342031, 016032572217, 035130722465, 023631112643, 01666704062, 017167134244, 034065364436, 022764554610, 01155446053, 017654276275, 034756026407, 022057616621, 03555610144, 015254020362, 036356270510, 020457440736, 03266552175, 015567362353, 036465132521, 020364702707, 02333114126, 014432724300, 037530574572, 021231344754, 02400256117, 014301466331, 037203636543, 021502006765,
+ 07333420310, 011432210136, 032530040744, 024231670562, 07400762321, 011301152107, 032203302775, 024502532553, 06555324372, 010254514154, 033356744726, 025457174500, 06266066343, 010567656165, 033465406717, 025364236531, 04666230254, 012167400072, 031065650600, 027764060426, 04155172265, 012654742043, 031756512631, 027057322417, 05000534236, 013701304010, 030603154662, 026102764444, 05733676207, 013032046021, 030130216653, 026631426475,
+ 016667040620, 0166670406, 023064420274, 035765210052, 016154302611, 0655532437, 023757762245, 035056152063, 017001744642, 01700174464, 022602324216, 034103514030, 017732406673, 01033236455, 022131066227, 034630656001, 015332650764, 03433060542, 020531230330, 036230400116, 015401512755, 03300322573, 020202172301, 036503742127, 014554154706, 02255764520, 021357534352, 037456304174, 014267216737, 02566426511, 021464676363, 037365046145,
+ 011554460530, 07255250716, 024357000164, 032456630342, 011267722501, 07566112727, 024464342155, 032365572373, 010332364552, 06433554774, 025531704106, 033230134320, 010401026563, 06300616745, 025202446137, 033503276311, 012001270474, 04700440652, 027602610020, 031103020206, 012732132445, 04033702663, 027131552011, 031630362237, 013667574416, 05166344630, 026064114042, 030765724264, 013154636427, 05655006601, 026757256073, 030056466255,
+ 035556101440, 023257731666, 0355561014, 016454351232, 035265243471, 023564473657, 0466623025, 016367013203, 034330605422, 022431035604, 01533265076, 017232455250, 034403547413, 022302377635, 01200127047, 017501717261, 036003711504, 020702121722, 03600371150, 015101541376, 036730453535, 020031263713, 03133033161, 015632603347, 037665015566, 021164625740, 02066475132, 014767245314, 037156357557, 021657567771, 02755737103, 014054107325,
+ 032665521750, 024164311576, 07066141304, 011767771122, 032156663761, 024657053547, 07755203335, 011054433113, 033003225732, 025702415514, 06600645366, 010101075140, 033730167703, 025031757525, 06133507357, 010632337171, 031330331614, 027431501432, 04533751240, 012232161066, 031403073625, 027302643403, 04200413271, 012501223057, 030556435676, 026257205450, 05355055222, 013454665004, 030265777647, 026564147461, 05466317213, 013367527035,
+ 023331141260, 035430771046, 016532521634, 0233311412, 023402203251, 035303433077, 016201663605, 0500053423, 022557645202, 034256075024, 017354225656, 01455415470, 022264507233, 034565337015, 017467167667, 01366757441, 020664751324, 036165161102, 015067331770, 03766501556, 020157413315, 036656223133, 015754073741, 03055643567, 021002055346, 037703665160, 014601435712, 02100205534, 021731317377, 037030527151, 014132777723, 02633147505,
+ 024002561170, 032703351356, 011601101524, 07100731702, 024731623141, 032030013367, 011132243515, 07633473733, 025664265112, 033165455334, 010067605546, 06766035760, 025157127123, 033656717305, 010754547577, 06055377751, 027557371034, 031256541212, 012354711460, 04455121646, 027264033005, 031565603223, 012467453451, 04366263677, 026331475056, 030430245270, 013532015402, 05233625624, 026402737067, 030303107241, 013201357433, 05500567615,
+ }, { 00,03106630501,06215461202,05313251703,014433142404,017535772105,012626523606,011720313307,031066305010,032160535511,037273764212,034375154713,025455247414,026553477115,023640626616,020746016317,011260411121,012366221420,017075070323,014173640622,05653553525,06755363024,03446132727,0540702226,020206714131,023300124430,026013375333,025115545632,034635656535,037733066034,032420237737,031526407236,
+ 022541022242,021447612743,024754443040,027652273541,036172160646,035074750347,030367501444,033261331145,013527327252,010421517753,015732746050,016634176551,07114265656,04012455357,01301604454,02207034155,033721433363,030627203662,035534052161,036432662460,027312571767,024214341266,021107110565,022001720064,02747736373,01641106672,04552357171,07454567470,016374674777,015272044276,010161215575,013067425074,
+ 036036247405,035130477104,030223626607,033325016306,022405305001,021503535500,024610764203,027716154702,07050142415,04156772114,01245523617,02343313316,013463000011,010565630510,015676461213,016770251712,027256656524,024350066025,021043237726,022145407227,033665714120,030763124421,035470375322,036576545623,016230553534,015336363035,010025132736,013123702237,02603411130,01705221431,04416070332,07510640633,
+ 014577265647,017471455346,012762604445,011664034144,0144327243,03042517742,06351746041,05257176540,025511160657,026417750356,023704501455,020602331154,031122022253,032024612752,037337443051,034231273550,05717674766,06611044267,03502215564,0404425065,011324736362,012222106663,017131357160,014037567461,034771571776,037677341277,032564110574,031462720075,020342433372,023244203673,026157052170,025051662471,
+ 07340714113,04246124412,01155375311,02053545610,013773656517,010675066016,015566237715,016460407214,036326411103,035220221402,030133070301,033035640600,022715553507,021613363006,024500132705,027406702204,016120305032,015026535533,010335764230,013233154731,02513247436,01415477137,04706626634,07600016335,027146000022,024040630523,021353461220,022255251721,033575142426,030473772127,035760523624,036666313325,
+ 025601736351,026707106650,023414357153,020512567452,031232674755,032334044254,037027215557,034121425056,014667433341,017761203640,012472052143,011574662442,0254571745,03352341244,06041110547,05147720046,034461327270,037567517771,032674746072,031772176573,020052265674,023154455375,026247604476,025341034177,05407022260,06501612761,03612443062,0714273563,011034160664,012132750365,017221501466,014327331167,
+ 031376553516,032270363017,037163132714,034065702215,025745411112,026643221413,023550070310,020456640611,0310656506,03216066007,06105237704,05003407205,014723714102,017625124403,012536375300,011430545601,020116142437,023010772136,026303523635,025205313334,034525000033,037423630532,032730461231,031636251730,011170247427,012076477126,017365626625,014263016324,05543305023,06445535522,03756764221,0650154720,
+ 013637571754,010731341255,015422110556,016524720057,07204433350,04302203651,01011052152,02117662453,022651674744,021757044245,024444215546,027542425047,036262736340,035364106641,030077357142,033171567443,02457160675,01551750374,04642501477,07744331176,016064022271,015162612770,010271443073,013377273572,033431265665,030537455364,035624604467,036722034166,027002327261,024104517760,021217746063,022311176562,
+ }, { 00,0160465067,0341152156,0221537131,0702324334,0662741353,0443276262,0523613205,01604650670,01764235617,01545702726,01425367741,01106574544,01066111523,01247426412,01327043475,03411521560,03571144507,03750473436,03630016451,03313605654,03273260633,03052757702,03132332765,02215371310,02375714377,02154223246,02034646221,02517055024,02477430043,02656107172,02736562115,
+ 07023243340,07143626327,07362311216,07202774271,07721167074,07641502013,07460035122,07500450145,06627413530,06747076557,06566541466,06406124401,06125737604,06045352663,06264665752,06304200735,04432762620,04552307647,04773630776,04613255711,04330446514,04250023573,04071514442,04111171425,05236132050,05356557037,05177060106,05017405161,05534216364,05454673303,05675344232,05715721255,
+ 016046506700,016126163767,016307454656,016267031631,016744622434,016624247453,016405770562,016565315505,017642356170,017722733117,017503204026,017463661041,017140072244,017020417223,017201120312,017361545375,015457027260,015537442207,015716175336,015676510351,015355303154,015235766133,015014251002,015174634065,014253677410,014333212477,014112725546,014072340521,014551553724,014431136743,014610401672,014770064615,
+ 011065745440,011105320427,011324617516,011244272571,011767461774,011607004713,011426533622,011546156645,010661115230,010701570257,010520047366,010440422301,010163231104,010003654163,010222363052,010342706035,012474264120,012514601147,012735336076,012655753011,012376140214,012216525273,012037012342,012157477325,013270434750,013310051737,013131566606,013051103661,013572710464,013412375403,013633642532,013753227555,
+ 034115215600,034075670667,034254347756,034334722731,034617131534,034777554553,034556063462,034436406405,035711445070,035671020017,035450517126,035530172141,035013761344,035173304323,035352633212,035232256275,037504734360,037464351307,037645666236,037725203251,037206410054,037366075033,037147542102,037027127165,036300164510,036260501577,036041036446,036121453421,036402240624,036562625643,036743312772,036623777715,
+ 033136056540,033056433527,033277104416,033317561471,033634372674,033754717613,033575220722,033415645745,032732606330,032652263357,032473754266,032513331201,032030522004,032150147063,032371470152,032211015135,030527577020,030447112047,030666425176,030706040111,030225653314,030345236373,030164701242,030004364225,031323327650,031243742637,031062275706,031102610761,031421003564,031541466503,031760151432,031600534455,
+ 022153713100,022033376167,022212641056,022372224031,022651437234,022731052253,022510565362,022470100305,023757143770,023637526717,023416011626,023576474641,023055267444,023135602423,023314335512,023274750575,021542232460,021422657407,021603360536,021763705551,021240116754,021320573733,021101044602,021061421665,020346462210,020226007277,020007530346,020167155321,020444746124,020524323143,020705614072,020665271015,
+ 025170550240,025010135227,025231402316,025351067371,025672674174,025712211113,025533726022,025453343045,024774300430,024614765457,024435252566,024555637501,024076024704,024116441763,024337176652,024257513635,026561071720,026401414747,026620123676,026740546611,026263355414,026303730473,026122207542,026042662525,027365621150,027205244137,027024773006,027144316061,027467505264,027507160203,027726457332,027646032355,
+ }, { 00,027057063545,025202344213,02255327756,021730513527,06767570062,04532657734,023565634271,030555024357,017502047612,015757360144,032700303401,011265537670,036232554335,034067673463,013030610126,012006253637,035051230372,037204117424,010253174161,033736740310,014761723655,016534404103,031563467446,022553277560,05504214025,07751133773,020706150236,03263764047,024234707502,026061420254,01036443711,
+ 024014527476,03043544133,01216663665,026241600320,05724034151,022773057414,020526370342,07571313607,014541503721,033516560264,031743647532,016714624077,035271010206,012226073743,010073354015,037024337550,036012774241,011045717704,013210430052,034247453517,017722267766,030775204223,032520123575,015577140030,06547750116,021510733453,023745414305,04712477640,027277243431,0220220174,02075107622,025022164367,
+ 023305054075,04352037530,06107310266,021150373723,02435547552,025462524017,027637603741,0660660204,013650070322,034607013667,036452334131,011405357474,032160563605,015137500340,017362627416,030335644153,031303207642,016354264307,014101143451,033156120114,010433714365,037464777620,035631450176,012666433433,01656223515,026601240050,024454167706,03403104243,020166730032,07131753577,05364474221,022333417764,
+ 07311573403,020346510146,022113637610,05144654355,026421060124,01476003461,03623324337,024674347672,037644557754,010613534211,012446613547,035411670002,016174044273,031123027736,033376300060,014321363525,015317720234,032340743771,030115464027,017142407562,034427233713,013470250256,011625177500,036672114045,025642704163,02615767426,0440440370,027417423635,04172217444,023125274101,021370153657,06327130312,
+ 035526333073,012571350536,010724077260,037773014725,014216620554,033241643011,031014564747,016043507202,05073317324,022024374661,020271053137,07226030472,024743604603,03714667346,01541540410,026516523155,027520160644,0577103301,02722224457,025775247112,06210473363,021247410626,023012737170,04045754435,017075144513,030022127056,032277200700,015220263245,036745457034,011712434571,013547713227,034510770762,
+ 011532614405,036565677140,034730550616,013767533353,030202307122,017255364467,015000043331,032057020674,021067630752,06030653217,04265574541,023232517004,0757323275,027700340730,025555067066,02502004523,03534447232,024563424777,026736703021,01761760564,022204154715,05253137250,07006210506,020051273043,033061463165,014036400420,016263727376,031234744633,012751170442,035706113107,037553234651,010504257314,
+ 016623367006,031674304543,033421023215,014476040750,037113674521,010144617064,012311530732,035346553277,026376343351,01321320614,03174007142,024123064407,07446650676,020411633333,022644514465,05613577120,04625134631,023672157374,021427270422,06470213167,025115427316,02142444653,0317763105,027340700440,034370110566,013327173023,011172254775,036125237230,015440403041,032417460504,030642747252,017615724717,
+ 032637640470,015660623135,017435504663,030462567326,013107353157,034150330412,036305017344,011352074601,02362664727,025335607262,027160520534,0137543071,023452377200,04405314745,06650033013,021607050556,020631413247,07666470702,05433757054,022464734511,01101100760,026156163225,024303244573,03354227036,010364437110,037333454455,035166773303,012131710646,031454124437,016403147172,014656260624,033601203361,
+ } };
+
+ static uint32_t crc32_slice_by_4(const void* pData, size_t data_len, uint32_t cur_crc32 = 0)
+ {
+ uint32_t crc = ~cur_crc32;
+ const uint32_t* pData32 = static_cast(pData);
+
+ for (; data_len >= sizeof(uint32_t); ++pData32, data_len -= 4)
+ {
+ uint32_t v = READ_LE32(pData32) ^ crc;
+ crc = g_crc32_4[0][v >> 24] ^ g_crc32_4[1][(v >> 16) & 0xFF] ^ g_crc32_4[2][(v >> 8) & 0xFF] ^ g_crc32_4[3][v & 0xFF];
+ }
+
+ for (const uint8_t* pData8 = reinterpret_cast(pData32); data_len; --data_len)
+ crc = (crc >> 8) ^ g_crc32_4[0][(crc & 0xFF) ^ *pData8++];
+
+ return ~crc;
+ }
+
+#if FPNG_X86_OR_X64_CPU && !FPNG_NO_SSE
+ // See Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction":
+ // https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf
+ // Requires PCLMUL and SSE 4.1. This function skips Step 1 (fold by 4) for simplicity/less code.
+ static uint32_t crc32_pclmul(const uint8_t* p, size_t size, uint32_t crc)
+ {
+ assert(size >= 16);
+
+ // See page 22 (bit reflected constants for gzip)
+#ifdef _MSC_VER
+ static const uint64_t __declspec(align(16))
+#else
+ static const uint64_t __attribute__((aligned(16)))
+#endif
+ s_u[2] = { 0x1DB710641, 0x1F7011641 }, s_k5k0[2] = { 0x163CD6124, 0 }, s_k3k4[2] = { 0x1751997D0, 0xCCAA009E };
+
+ // Load first 16 bytes, apply initial CRC32
+ __m128i b = _mm_xor_si128(_mm_cvtsi32_si128(~crc), _mm_loadu_si128(reinterpret_cast(p)));
+
+ // We're skipping directly to Step 2 page 12 - iteratively folding by 1 (by 4 is overkill for our needs)
+ const __m128i k3k4 = _mm_load_si128(reinterpret_cast(s_k3k4));
+
+ for (size -= 16, p += 16; size >= 16; size -= 16, p += 16)
+ b = _mm_xor_si128(_mm_xor_si128(_mm_clmulepi64_si128(b, k3k4, 17), _mm_loadu_si128(reinterpret_cast(p))), _mm_clmulepi64_si128(b, k3k4, 0));
+
+ // Final stages: fold to 64-bits, 32-bit Barrett reduction
+ const __m128i z = _mm_set_epi32(0, ~0, 0, ~0), u = _mm_load_si128(reinterpret_cast(s_u));
+ b = _mm_xor_si128(_mm_srli_si128(b, 8), _mm_clmulepi64_si128(b, k3k4, 16));
+ b = _mm_xor_si128(_mm_clmulepi64_si128(_mm_and_si128(b, z), _mm_loadl_epi64(reinterpret_cast(s_k5k0)), 0), _mm_srli_si128(b, 4));
+ return ~_mm_extract_epi32(_mm_xor_si128(b, _mm_clmulepi64_si128(_mm_and_si128(_mm_clmulepi64_si128(_mm_and_si128(b, z), u, 16), z), u, 0)), 1);
+ }
+
+ static uint32_t crc32_sse41_simd(const unsigned char* buf, size_t len, uint32_t prev_crc32)
+ {
+ if (len < 16)
+ return crc32_slice_by_4(buf, len, prev_crc32);
+
+ uint32_t simd_len = len & ~15;
+ uint32_t c = crc32_pclmul(buf, simd_len, prev_crc32);
+ return crc32_slice_by_4(buf + simd_len, len - simd_len, c);
+ }
+#endif
+
+#ifndef _MSC_VER
+ static void do_cpuid(uint32_t eax, uint32_t ecx, uint32_t* regs)
+ {
+ uint32_t ebx = 0, edx = 0;
+
+#if defined(__PIC__) && defined(__i386__)
+ __asm__("movl %%ebx, %%edi;"
+ "cpuid;"
+ "xchgl %%ebx, %%edi;"
+ : "=D"(ebx), "+a"(eax), "+c"(ecx), "=d"(edx));
+#else
+ __asm__("cpuid;" : "+b"(ebx), "+a"(eax), "+c"(ecx), "=d"(edx));
+#endif
+
+ regs[0] = eax; regs[1] = ebx; regs[2] = ecx; regs[3] = edx;
+ }
+#endif
+
+#if FPNG_X86_OR_X64_CPU && !FPNG_NO_SSE
+ struct cpu_info
+ {
+ cpu_info() { memset(this, 0, sizeof(*this)); }
+
+ bool m_initialized, m_has_fpu, m_has_mmx, m_has_sse, m_has_sse2, m_has_sse3, m_has_ssse3, m_has_sse41, m_has_sse42, m_has_avx, m_has_avx2, m_has_pclmulqdq;
+
+ void init()
+ {
+ if (m_initialized)
+ return;
+
+ int regs[4];
+
+#ifdef _MSC_VER
+ __cpuid(regs, 0);
+#else
+ do_cpuid(0, 0, (uint32_t*)regs);
+#endif
+
+ const uint32_t max_eax = regs[0];
+ if (max_eax >= 1U)
+ {
+#ifdef _MSC_VER
+ __cpuid(regs, 1);
+#else
+ do_cpuid(1, 0, (uint32_t*)regs);
+#endif
+ extract_x86_flags(regs[2], regs[3]);
+ }
+
+ if (max_eax >= 7U)
+ {
+#ifdef _MSC_VER
+ __cpuidex(regs, 7, 0);
+#else
+ do_cpuid(7, 0, (uint32_t*)regs);
+#endif
+ extract_x86_extended_flags(regs[1]);
+ }
+
+ m_initialized = true;
+ }
+
+ bool can_use_sse41() const { return m_has_sse && m_has_sse2 && m_has_sse3 && m_has_ssse3 && m_has_sse41; }
+ bool can_use_pclmul() const { return m_has_pclmulqdq && can_use_sse41(); }
+
+ private:
+ void extract_x86_flags(uint32_t ecx, uint32_t edx)
+ {
+ m_has_fpu = (edx & (1 << 0)) != 0; m_has_mmx = (edx & (1 << 23)) != 0; m_has_sse = (edx & (1 << 25)) != 0; m_has_sse2 = (edx & (1 << 26)) != 0;
+ m_has_sse3 = (ecx & (1 << 0)) != 0; m_has_ssse3 = (ecx & (1 << 9)) != 0; m_has_sse41 = (ecx & (1 << 19)) != 0; m_has_sse42 = (ecx & (1 << 20)) != 0;
+ m_has_pclmulqdq = (ecx & (1 << 1)) != 0; m_has_avx = (ecx & (1 << 28)) != 0;
+ }
+
+ void extract_x86_extended_flags(uint32_t ebx) { m_has_avx2 = (ebx & (1 << 5)) != 0; }
+ };
+
+ cpu_info g_cpu_info;
+
+ void fpng_init()
+ {
+ g_cpu_info.init();
+ }
+#else
+ void fpng_init()
+ {
+ }
+#endif
+
+ bool fpng_cpu_supports_sse41()
+ {
+#if FPNG_X86_OR_X64_CPU && !FPNG_NO_SSE
+ assert(g_cpu_info.m_initialized);
+ return g_cpu_info.can_use_sse41();
+#else
+ return false;
+#endif
+ }
+
+ uint32_t fpng_crc32(const void* pData, size_t size, uint32_t prev_crc32)
+ {
+#if FPNG_X86_OR_X64_CPU && !FPNG_NO_SSE
+ if (g_cpu_info.can_use_pclmul())
+ return crc32_sse41_simd(static_cast(pData), size, prev_crc32);
+#endif
+
+ return crc32_slice_by_4(pData, size, prev_crc32);
+ }
+
+#if FPNG_X86_OR_X64_CPU && !FPNG_NO_SSE
+ // See "Fast Computation of Adler32 Checksums":
+ // https ://www.intel.com/content/www/us/en/developer/articles/technical/fast-computation-of-adler32-checksums.html
+ // SSE 4.1, 8 bytes per iteration, 2-2.5x faster than the scalar version.
+ static uint32_t adler32_sse_8(const uint8_t* p, size_t len, uint32_t initial)
+ {
+ uint32_t s1 = initial & 0xFFFF, s2 = initial >> 16;
+ const uint32_t K = 65521;
+
+ while (len >= 8)
+ {
+ __m128i a = _mm_setr_epi32(s1, 0, 0, 0), b = _mm_setr_epi32(0, 0, 0, 0), c = _mm_setr_epi32(0, 0, 0, 0), d = _mm_setr_epi32(0, 0, 0, 0);
+
+ const size_t n = minimum(len >> 3, 5552);
+
+ for (size_t i = 0; i < n; i++)
+ {
+ a = _mm_add_epi32(a, _mm_cvtepu8_epi32(_mm_set1_epi32(((const uint32_t*)p)[i * 2 + 0])));
+ b = _mm_add_epi32(b, a);
+ c = _mm_add_epi32(c, _mm_cvtepu8_epi32(_mm_set1_epi32(((const uint32_t*)p)[i * 2 + 1])));
+ d = _mm_add_epi32(d, c);
+ }
+
+ uint32_t sa[8], sb[8];
+ _mm_storeu_si128((__m128i *)sa, a); _mm_storeu_si128((__m128i *)(sa + 4), c);
+ _mm_storeu_si128((__m128i *)sb, b); _mm_storeu_si128((__m128i *)(sb + 4), d);
+
+ uint64_t vs1 = 0;
+ for (uint32_t i = 0; i < 8; i++)
+ vs1 += sa[i];
+
+ uint64_t vs2_a = 0;
+ for (uint32_t i = 0; i < 8; i++)
+ vs2_a += sa[i] * (uint64_t)i;
+ uint64_t vs2_b = 0;
+ for (uint32_t i = 0; i < 8; i++)
+ vs2_b += sb[i];
+ vs2_b *= 8U;
+ uint64_t vs2 = vs2_b - vs2_a + s2;
+
+ s1 = (uint32_t)(vs1 % K);
+ s2 = (uint32_t)(vs2 % K);
+
+ p += n * 8;
+ len -= n * 8;
+ }
+
+ for (; len; len--)
+ {
+ s1 += *p++;
+ s2 += s1;
+ }
+
+ return (s1 % K) | ((s2 % K) << 16);
+ }
+#endif
+
+ static uint32_t fpng_adler32_scalar(const uint8_t* ptr, size_t buf_len, uint32_t adler)
+ {
+ uint32_t i, s1 = (uint32_t)(adler & 0xffff), s2 = (uint32_t)(adler >> 16); uint32_t block_len = (uint32_t)(buf_len % 5552);
+ if (!ptr) return FPNG_ADLER32_INIT;
+ while (buf_len) {
+ for (i = 0; i + 7 < block_len; i += 8, ptr += 8) {
+ s1 += ptr[0], s2 += s1; s1 += ptr[1], s2 += s1; s1 += ptr[2], s2 += s1; s1 += ptr[3], s2 += s1;
+ s1 += ptr[4], s2 += s1; s1 += ptr[5], s2 += s1; s1 += ptr[6], s2 += s1; s1 += ptr[7], s2 += s1;
+ }
+ for (; i < block_len; ++i) s1 += *ptr++, s2 += s1;
+ s1 %= 65521U, s2 %= 65521U; buf_len -= block_len; block_len = 5552;
+ }
+ return (s2 << 16) + s1;
+ }
+
+ uint32_t fpng_adler32(const uint8_t* ptr, size_t buf_len, uint32_t adler)
+ {
+#if FPNG_X86_OR_X64_CPU && !FPNG_NO_SSE
+ if (g_cpu_info.can_use_sse41())
+ return adler32_sse_8(ptr, buf_len, adler);
+#endif
+ return fpng_adler32_scalar(ptr, buf_len, adler);
+ }
+
+ // Ensure we've been configured for endianness correctly.
+ static inline bool endian_check()
+ {
+ uint32_t endian_check = 0;
+ WRITE_LE32(&endian_check, 0x1234ABCD);
+ const uint32_t first_byte = reinterpret_cast(&endian_check)[0];
+ return first_byte == 0xCD;
+ }
+
+ static const uint16_t g_defl_len_sym[256] = {
+ 257,258,259,260,261,262,263,264,265,265,266,266,267,267,268,268,269,269,269,269,270,270,270,270,271,271,271,271,272,272,272,272,
+ 273,273,273,273,273,273,273,273,274,274,274,274,274,274,274,274,275,275,275,275,275,275,275,275,276,276,276,276,276,276,276,276,
+ 277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,
+ 279,279,279,279,279,279,279,279,279,279,279,279,279,279,279,279,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
+ 281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,
+ 282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,
+ 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
+ 284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,285 };
+
+ static const uint8_t g_defl_len_extra[256] = {
+ 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0 };
+
+ static const uint8_t g_defl_small_dist_sym[512] = {
+ 0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,
+ 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17 };
+
+ static const uint32_t g_bitmasks[17] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF };
+
+ static const uint8_t g_dyn_huff_3[] = { 120, 1, 229, 194, 3, 176, 37, 75, 148, 5, 208, 189, 79, 102, 86, 213, 197, 99, 187, 231, 143, 109, 219, 182, 109, 219, 182, 109, 219, 182, 109, 219,
+ 198, 31, 207, 159, 118, 63, 94, 84, 85, 102, 158, 61, 21, 241, 34, 58, 38, 198, 102, 196 };
+ const uint32_t DYN_HUFF_3_BITBUF = 0x2, DYN_HUFF_3_BITBUF_SIZE = 3;
+
+ static const struct { uint8_t m_code_size; uint16_t m_code; } g_dyn_huff_3_codes[288] =
+ {
+ {3,0x0},{3,0x4},{4,0x6},{5,0x1},{5,0x11},{5,0x9},{6,0xD},{6,0x2D},{6,0x1D},{7,0x33},{7,0x73},{7,0xB},{7,0x4B},{8,0x3B},{8,0xBB},{8,0x7B},
+ {8,0xFB},{8,0x7},{8,0x87},{9,0x97},{9,0x197},{9,0x57},{9,0x157},{9,0xD7},{9,0x1D7},{9,0x37},{9,0x137},{12,0x24F},{10,0x18F},{12,0xA4F},{12,0x64F},{12,0xE4F},
+ {12,0x14F},{12,0x94F},{12,0x54F},{12,0xD4F},{12,0x34F},{12,0xB4F},{12,0x74F},{12,0xF4F},{12,0xCF},{12,0x8CF},{12,0x4CF},{12,0xCCF},{12,0x2CF},{12,0xACF},{12,0x6CF},{12,0xECF},
+ {12,0x1CF},{12,0x9CF},{12,0x5CF},{12,0xDCF},{12,0x3CF},{12,0xBCF},{12,0x7CF},{12,0xFCF},{12,0x2F},{12,0x82F},{12,0x42F},{12,0xC2F},{12,0x22F},{12,0xA2F},{12,0x62F},{12,0xE2F},
+ {12,0x12F},{12,0x92F},{12,0x52F},{12,0xD2F},{12,0x32F},{12,0xB2F},{12,0x72F},{12,0xF2F},{12,0xAF},{12,0x8AF},{12,0x4AF},{12,0xCAF},{12,0x2AF},{12,0xAAF},{12,0x6AF},{12,0xEAF},
+ {12,0x1AF},{12,0x9AF},{12,0x5AF},{12,0xDAF},{12,0x3AF},{12,0xBAF},{12,0x7AF},{12,0xFAF},{12,0x6F},{12,0x86F},{12,0x46F},{12,0xC6F},{12,0x26F},{12,0xA6F},{12,0x66F},{12,0xE6F},
+ {12,0x16F},{12,0x96F},{12,0x56F},{12,0xD6F},{12,0x36F},{12,0xB6F},{12,0x76F},{12,0xF6F},{12,0xEF},{12,0x8EF},{12,0x4EF},{12,0xCEF},{12,0x2EF},{12,0xAEF},{12,0x6EF},{12,0xEEF},
+ {12,0x1EF},{12,0x9EF},{12,0x5EF},{12,0xDEF},{12,0x3EF},{12,0xBEF},{12,0x7EF},{12,0xFEF},{12,0x1F},{12,0x81F},{12,0x41F},{12,0xC1F},{12,0x21F},{12,0xA1F},{12,0x61F},{12,0xE1F},
+ {12,0x11F},{12,0x91F},{12,0x51F},{12,0xD1F},{12,0x31F},{12,0xB1F},{12,0x71F},{12,0xF1F},{12,0x9F},{12,0x89F},{12,0x49F},{12,0xC9F},{12,0x29F},{12,0xA9F},{12,0x69F},{12,0xE9F},
+ {12,0x19F},{12,0x99F},{12,0x59F},{12,0xD9F},{12,0x39F},{12,0xB9F},{12,0x79F},{12,0xF9F},{12,0x5F},{12,0x85F},{12,0x45F},{12,0xC5F},{12,0x25F},{12,0xA5F},{12,0x65F},{12,0xE5F},
+ {12,0x15F},{12,0x95F},{12,0x55F},{12,0xD5F},{12,0x35F},{12,0xB5F},{12,0x75F},{12,0xF5F},{12,0xDF},{12,0x8DF},{12,0x4DF},{12,0xCDF},{12,0x2DF},{12,0xADF},{12,0x6DF},{12,0xEDF},
+ {12,0x1DF},{12,0x9DF},{12,0x5DF},{12,0xDDF},{12,0x3DF},{12,0xBDF},{12,0x7DF},{12,0xFDF},{12,0x3F},{12,0x83F},{12,0x43F},{12,0xC3F},{12,0x23F},{12,0xA3F},{12,0x63F},{12,0xE3F},
+ {12,0x13F},{12,0x93F},{12,0x53F},{12,0xD3F},{12,0x33F},{12,0xB3F},{12,0x73F},{12,0xF3F},{12,0xBF},{12,0x8BF},{12,0x4BF},{12,0xCBF},{12,0x2BF},{12,0xABF},{12,0x6BF},{12,0xEBF},
+ {12,0x1BF},{12,0x9BF},{12,0x5BF},{12,0xDBF},{12,0x3BF},{12,0xBBF},{12,0x7BF},{12,0xFBF},{12,0x7F},{12,0x87F},{12,0x47F},{10,0x38F},{12,0xC7F},{12,0x27F},{12,0xA7F},{12,0x67F},
+ {12,0xE7F},{12,0x17F},{12,0x97F},{12,0x57F},{10,0x4F},{12,0xD7F},{9,0xB7},{9,0x1B7},{9,0x77},{9,0x177},{9,0xF7},{9,0x1F7},{9,0xF},{9,0x10F},{8,0x47},{8,0xC7},
+ {8,0x27},{8,0xA7},{8,0x67},{8,0xE7},{7,0x2B},{7,0x6B},{7,0x1B},{7,0x5B},{6,0x3D},{6,0x3},{6,0x23},{5,0x19},{5,0x5},{5,0x15},{4,0xE},{3,0x2},
+ {12,0x37F},{6,0x13},{0,0x0},{0,0x0},{8,0x17},{0,0x0},{0,0x0},{9,0x8F},{0,0x0},{12,0xB7F},{0,0x0},{12,0x77F},{12,0xF7F},{12,0xFF},{12,0x8FF},{12,0x4FF},
+ {12,0xCFF},{12,0x2FF},{12,0xAFF},{12,0x6FF},{12,0xEFF},{12,0x1FF},{12,0x9FF},{12,0x5FF},{12,0xDFF},{12,0x3FF},{12,0xBFF},{12,0x7FF},{12,0xFFF},{0,0x0},{0,0x0},{0,0x0}
+ };
+
+ static const uint8_t g_dyn_huff_4[] = { 120,1,229,195,83,144,37,219,182,0,208,49,87,230,70,177,171,121,204,171,103,219,182,109,219,182,109,219,182,109,219,214,
+ 197,177,154,213,197,141,204,53,95,228,71,69,116,156,56,207,126,251,99 };
+ const uint32_t DYN_HUFF_4_BITBUF = 0x0, DYN_HUFF_4_BITBUF_SIZE = 2;
+
+ static const struct { uint8_t m_code_size; uint16_t m_code; } g_dyn_huff_4_codes[288] =
+ {
+ {1,0x0},{4,0x1},{5,0x5},{6,0xD},{6,0x2D},{7,0x23},{7,0x63},{7,0x13},{7,0x53},{8,0x6B},{8,0xEB},{8,0x1B},{8,0x9B},{8,0x5B},{8,0xDB},{9,0xA7},
+ {8,0x3B},{9,0x1A7},{9,0x67},{9,0x167},{9,0xE7},{9,0x1E7},{9,0x17},{10,0x137},{10,0x337},{10,0xB7},{10,0x2B7},{10,0x1B7},{10,0x3B7},{10,0x77},{10,0x277},{10,0x177},
+ {10,0x377},{10,0xF7},{10,0x2F7},{11,0x34F},{11,0x74F},{11,0xCF},{11,0x4CF},{11,0x2CF},{12,0x7CF},{12,0xFCF},{12,0x2F},{12,0x82F},{12,0x42F},{12,0xC2F},{12,0x22F},{12,0xA2F},
+ {12,0x62F},{12,0xE2F},{12,0x12F},{12,0x92F},{12,0x52F},{12,0xD2F},{12,0x32F},{12,0xB2F},{12,0x72F},{12,0xF2F},{12,0xAF},{12,0x8AF},{12,0x4AF},{12,0xCAF},{12,0x2AF},{12,0xAAF},
+ {12,0x6AF},{12,0xEAF},{12,0x1AF},{12,0x9AF},{12,0x5AF},{12,0xDAF},{12,0x3AF},{12,0xBAF},{12,0x7AF},{12,0xFAF},{12,0x6F},{12,0x86F},{12,0x46F},{12,0xC6F},{12,0x26F},{12,0xA6F},
+ {12,0x66F},{12,0xE6F},{12,0x16F},{12,0x96F},{12,0x56F},{12,0xD6F},{12,0x36F},{12,0xB6F},{12,0x76F},{12,0xF6F},{12,0xEF},{12,0x8EF},{12,0x4EF},{12,0xCEF},{12,0x2EF},{12,0xAEF},
+ {12,0x6EF},{12,0xEEF},{12,0x1EF},{12,0x9EF},{12,0x5EF},{12,0xDEF},{12,0x3EF},{12,0xBEF},{12,0x7EF},{12,0xFEF},{12,0x1F},{12,0x81F},{12,0x41F},{12,0xC1F},{12,0x21F},{12,0xA1F},
+ {12,0x61F},{12,0xE1F},{12,0x11F},{12,0x91F},{12,0x51F},{12,0xD1F},{12,0x31F},{12,0xB1F},{12,0x71F},{12,0xF1F},{12,0x9F},{12,0x89F},{12,0x49F},{12,0xC9F},{12,0x29F},{12,0xA9F},
+ {12,0x69F},{12,0xE9F},{12,0x19F},{12,0x99F},{12,0x59F},{12,0xD9F},{12,0x39F},{12,0xB9F},{12,0x79F},{12,0xF9F},{12,0x5F},{12,0x85F},{12,0x45F},{12,0xC5F},{12,0x25F},{12,0xA5F},
+ {12,0x65F},{12,0xE5F},{12,0x15F},{12,0x95F},{12,0x55F},{12,0xD5F},{12,0x35F},{12,0xB5F},{12,0x75F},{12,0xF5F},{12,0xDF},{12,0x8DF},{12,0x4DF},{12,0xCDF},{12,0x2DF},{12,0xADF},
+ {12,0x6DF},{12,0xEDF},{12,0x1DF},{12,0x9DF},{12,0x5DF},{12,0xDDF},{12,0x3DF},{12,0xBDF},{12,0x7DF},{12,0xFDF},{12,0x3F},{12,0x83F},{12,0x43F},{12,0xC3F},{12,0x23F},{12,0xA3F},
+ {12,0x63F},{12,0xE3F},{12,0x13F},{12,0x93F},{12,0x53F},{12,0xD3F},{12,0x33F},{12,0xB3F},{12,0x73F},{12,0xF3F},{12,0xBF},{12,0x8BF},{12,0x4BF},{12,0xCBF},{12,0x2BF},{12,0xABF},
+ {12,0x6BF},{12,0xEBF},{12,0x1BF},{12,0x9BF},{12,0x5BF},{12,0xDBF},{12,0x3BF},{12,0xBBF},{12,0x7BF},{12,0xFBF},{12,0x7F},{12,0x87F},{12,0x47F},{12,0xC7F},{12,0x27F},{12,0xA7F},
+ {12,0x67F},{12,0xE7F},{12,0x17F},{12,0x97F},{12,0x57F},{12,0xD7F},{12,0x37F},{12,0xB7F},{12,0x77F},{12,0xF7F},{12,0xFF},{11,0x6CF},{11,0x1CF},{11,0x5CF},{11,0x3CF},{10,0x1F7},
+ {10,0x3F7},{10,0xF},{10,0x20F},{10,0x10F},{10,0x30F},{10,0x8F},{10,0x28F},{10,0x18F},{10,0x38F},{10,0x4F},{9,0x117},{9,0x97},{9,0x197},{9,0x57},{9,0x157},{9,0xD7},
+ {8,0xBB},{9,0x1D7},{8,0x7B},{8,0xFB},{8,0x7},{8,0x87},{8,0x47},{8,0xC7},{7,0x33},{7,0x73},{7,0xB},{7,0x4B},{6,0x1D},{6,0x3D},{5,0x15},{4,0x9},
+ {12,0x8FF},{0,0x0},{6,0x3},{0,0x0},{0,0x0},{0,0x0},{8,0x27},{0,0x0},{0,0x0},{9,0x37},{0,0x0},{10,0x24F},{0,0x0},{10,0x14F},{12,0x4FF},{12,0xCFF},
+ {12,0x2FF},{12,0xAFF},{12,0x6FF},{12,0xEFF},{12,0x1FF},{12,0x9FF},{12,0x5FF},{12,0xDFF},{12,0x3FF},{12,0xBFF},{12,0x7FF},{12,0xFFF},{7,0x2B},{0,0x0},{0,0x0},{0,0x0},
+ };
+
+#define PUT_BITS(bb, ll) do { uint32_t b = bb, l = ll; assert((l) >= 0 && (l) <= 16); assert((b) < (1ULL << (l))); bit_buf |= (((uint64_t)(b)) << bit_buf_size); bit_buf_size += (l); assert(bit_buf_size <= 64); } while(0)
+#define PUT_BITS_CZ(bb, ll) do { uint32_t b = bb, l = ll; assert((l) >= 1 && (l) <= 16); assert((b) < (1ULL << (l))); bit_buf |= (((uint64_t)(b)) << bit_buf_size); bit_buf_size += (l); assert(bit_buf_size <= 64); } while(0)
+
+#define PUT_BITS_FLUSH do { \
+ if ((dst_ofs + 8) > dst_buf_size) \
+ return 0; \
+ WRITE_LE64(pDst + dst_ofs, bit_buf); \
+ uint32_t bits_to_shift = bit_buf_size & ~7; \
+ dst_ofs += (bits_to_shift >> 3); \
+ assert(bits_to_shift < 64); \
+ bit_buf = bit_buf >> bits_to_shift; \
+ bit_buf_size -= bits_to_shift; \
+} while(0)
+
+#define PUT_BITS_FORCE_FLUSH do { \
+ while (bit_buf_size > 0) \
+ { \
+ if ((dst_ofs + 1) > dst_buf_size) \
+ return 0; \
+ *(uint8_t*)(pDst + dst_ofs) = (uint8_t)bit_buf; \
+ dst_ofs++; \
+ bit_buf >>= 8; \
+ bit_buf_size -= 8; \
+ } \
+} while(0)
+
+ enum
+ {
+ DEFL_MAX_HUFF_TABLES = 3,
+ DEFL_MAX_HUFF_SYMBOLS = 288,
+ DEFL_MAX_HUFF_SYMBOLS_0 = 288,
+ DEFL_MAX_HUFF_SYMBOLS_1 = 32,
+ DEFL_MAX_HUFF_SYMBOLS_2 = 19,
+ DEFL_LZ_DICT_SIZE = 32768,
+ DEFL_LZ_DICT_SIZE_MASK = DEFL_LZ_DICT_SIZE - 1,
+ DEFL_MIN_MATCH_LEN = 3,
+ DEFL_MAX_MATCH_LEN = 258
+ };
+
+ struct defl_huff
+ {
+ uint16_t m_huff_count[DEFL_MAX_HUFF_TABLES][DEFL_MAX_HUFF_SYMBOLS];
+ uint16_t m_huff_codes[DEFL_MAX_HUFF_TABLES][DEFL_MAX_HUFF_SYMBOLS];
+ uint8_t m_huff_code_sizes[DEFL_MAX_HUFF_TABLES][DEFL_MAX_HUFF_SYMBOLS];
+ };
+
+ struct defl_sym_freq
+ {
+ uint16_t m_key;
+ uint16_t m_sym_index;
+ };
+
+#define DEFL_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj))
+
+ static defl_sym_freq* defl_radix_sort_syms(uint32_t num_syms, defl_sym_freq* pSyms0, defl_sym_freq* pSyms1)
+ {
+ uint32_t total_passes = 2, pass_shift, pass, i, hist[256 * 2]; defl_sym_freq* pCur_syms = pSyms0, * pNew_syms = pSyms1; DEFL_CLEAR_OBJ(hist);
+ for (i = 0; i < num_syms; i++) { uint32_t freq = pSyms0[i].m_key; hist[freq & 0xFF]++; hist[256 + ((freq >> 8) & 0xFF)]++; }
+ while ((total_passes > 1) && (num_syms == hist[(total_passes - 1) * 256])) total_passes--;
+ for (pass_shift = 0, pass = 0; pass < total_passes; pass++, pass_shift += 8)
+ {
+ const uint32_t* pHist = &hist[pass << 8];
+ uint32_t offsets[256], cur_ofs = 0;
+ for (i = 0; i < 256; i++) { offsets[i] = cur_ofs; cur_ofs += pHist[i]; }
+ for (i = 0; i < num_syms; i++) pNew_syms[offsets[(pCur_syms[i].m_key >> pass_shift) & 0xFF]++] = pCur_syms[i];
+ { defl_sym_freq* t = pCur_syms; pCur_syms = pNew_syms; pNew_syms = t; }
+ }
+ return pCur_syms;
+ }
+
+ // defl_calculate_minimum_redundancy() originally written by: Alistair Moffat, alistair@cs.mu.oz.au, Jyrki Katajainen, jyrki@diku.dk, November 1996.
+ static void defl_calculate_minimum_redundancy(defl_sym_freq* A, int n)
+ {
+ int root, leaf, next, avbl, used, dpth;
+ if (n == 0) return; else if (n == 1) { A[0].m_key = 1; return; }
+ A[0].m_key += A[1].m_key; root = 0; leaf = 2;
+ for (next = 1; next < n - 1; next++)
+ {
+ if (leaf >= n || A[root].m_key < A[leaf].m_key) { A[next].m_key = A[root].m_key; A[root++].m_key = (uint16_t)next; }
+ else A[next].m_key = A[leaf++].m_key;
+ if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key)) { A[next].m_key = (uint16_t)(A[next].m_key + A[root].m_key); A[root++].m_key = (uint16_t)next; }
+ else A[next].m_key = (uint16_t)(A[next].m_key + A[leaf++].m_key);
+ }
+ A[n - 2].m_key = 0; for (next = n - 3; next >= 0; next--) A[next].m_key = A[A[next].m_key].m_key + 1;
+ avbl = 1; used = dpth = 0; root = n - 2; next = n - 1;
+ while (avbl > 0)
+ {
+ while (root >= 0 && (int)A[root].m_key == dpth) { used++; root--; }
+ while (avbl > used) { A[next--].m_key = (uint16_t)(dpth); avbl--; }
+ avbl = 2 * used; dpth++; used = 0;
+ }
+ }
+
+ // Limits canonical Huffman code table's max code size.
+ enum { DEFL_MAX_SUPPORTED_HUFF_CODESIZE = 32 };
+ static void defl_huffman_enforce_max_code_size(int* pNum_codes, int code_list_len, int max_code_size)
+ {
+ int i; uint32_t total = 0; if (code_list_len <= 1) return;
+ for (i = max_code_size + 1; i <= DEFL_MAX_SUPPORTED_HUFF_CODESIZE; i++) pNum_codes[max_code_size] += pNum_codes[i];
+ for (i = max_code_size; i > 0; i--) total += (((uint32_t)pNum_codes[i]) << (max_code_size - i));
+ while (total != (1UL << max_code_size))
+ {
+ pNum_codes[max_code_size]--;
+ for (i = max_code_size - 1; i > 0; i--) if (pNum_codes[i]) { pNum_codes[i]--; pNum_codes[i + 1] += 2; break; }
+ total--;
+ }
+ }
+
+ static void defl_optimize_huffman_table(defl_huff* d, int table_num, int table_len, int code_size_limit, int static_table)
+ {
+ int i, j, l, num_codes[1 + DEFL_MAX_SUPPORTED_HUFF_CODESIZE]; uint32_t next_code[DEFL_MAX_SUPPORTED_HUFF_CODESIZE + 1]; DEFL_CLEAR_OBJ(num_codes);
+ if (static_table)
+ {
+ for (i = 0; i < table_len; i++) num_codes[d->m_huff_code_sizes[table_num][i]]++;
+ }
+ else
+ {
+ defl_sym_freq syms0[DEFL_MAX_HUFF_SYMBOLS], syms1[DEFL_MAX_HUFF_SYMBOLS], * pSyms;
+ int num_used_syms = 0;
+ const uint16_t* pSym_count = &d->m_huff_count[table_num][0];
+ for (i = 0; i < table_len; i++) if (pSym_count[i]) { syms0[num_used_syms].m_key = (uint16_t)pSym_count[i]; syms0[num_used_syms++].m_sym_index = (uint16_t)i; }
+
+ pSyms = defl_radix_sort_syms(num_used_syms, syms0, syms1); defl_calculate_minimum_redundancy(pSyms, num_used_syms);
+
+ for (i = 0; i < num_used_syms; i++) num_codes[pSyms[i].m_key]++;
+
+ defl_huffman_enforce_max_code_size(num_codes, num_used_syms, code_size_limit);
+
+ DEFL_CLEAR_OBJ(d->m_huff_code_sizes[table_num]); DEFL_CLEAR_OBJ(d->m_huff_codes[table_num]);
+ for (i = 1, j = num_used_syms; i <= code_size_limit; i++)
+ for (l = num_codes[i]; l > 0; l--) d->m_huff_code_sizes[table_num][pSyms[--j].m_sym_index] = (uint8_t)(i);
+ }
+
+ next_code[1] = 0; for (j = 0, i = 2; i <= code_size_limit; i++) next_code[i] = j = ((j + num_codes[i - 1]) << 1);
+
+ for (i = 0; i < table_len; i++)
+ {
+ uint32_t rev_code = 0, code, code_size; if ((code_size = d->m_huff_code_sizes[table_num][i]) == 0) continue;
+ code = next_code[code_size]++; for (l = code_size; l > 0; l--, code >>= 1) rev_code = (rev_code << 1) | (code & 1);
+ d->m_huff_codes[table_num][i] = (uint16_t)rev_code;
+ }
+ }
+
+#define DEFL_RLE_PREV_CODE_SIZE() { if (rle_repeat_count) { \
+ if (rle_repeat_count < 3) { \
+ d->m_huff_count[2][prev_code_size] = (uint16_t)(d->m_huff_count[2][prev_code_size] + rle_repeat_count); \
+ while (rle_repeat_count--) packed_code_sizes[num_packed_code_sizes++] = prev_code_size; \
+ } else { \
+ d->m_huff_count[2][16] = (uint16_t)(d->m_huff_count[2][16] + 1); packed_code_sizes[num_packed_code_sizes++] = 16; packed_code_sizes[num_packed_code_sizes++] = (uint8_t)(rle_repeat_count - 3); \
+} rle_repeat_count = 0; } }
+
+#define DEFL_RLE_ZERO_CODE_SIZE() { if (rle_z_count) { \
+ if (rle_z_count < 3) { \
+ d->m_huff_count[2][0] = (uint16_t)(d->m_huff_count[2][0] + rle_z_count); while (rle_z_count--) packed_code_sizes[num_packed_code_sizes++] = 0; \
+ } else if (rle_z_count <= 10) { \
+ d->m_huff_count[2][17] = (uint16_t)(d->m_huff_count[2][17] + 1); packed_code_sizes[num_packed_code_sizes++] = 17; packed_code_sizes[num_packed_code_sizes++] = (uint8_t)(rle_z_count - 3); \
+ } else { \
+ d->m_huff_count[2][18] = (uint16_t)(d->m_huff_count[2][18] + 1); packed_code_sizes[num_packed_code_sizes++] = 18; packed_code_sizes[num_packed_code_sizes++] = (uint8_t)(rle_z_count - 11); \
+} rle_z_count = 0; } }
+
+ static uint8_t g_defl_packed_code_size_syms_swizzle[] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
+
+#define DEFL_DYN_PUT_BITS(bb, ll) \
+do { \
+ uint32_t b = (bb), l = (ll); \
+ assert((l) >= 1 && (l) <= 16); assert((b) < (1ULL << (l))); \
+ bit_buf |= (((uint64_t)(b)) << bit_buf_size); bit_buf_size += (l); assert(bit_buf_size <= 64); \
+ while (bit_buf_size >= 8) \
+ { \
+ if ((dst_ofs + 1) > dst_buf_size) \
+ return false; \
+ *(uint8_t*)(pDst + dst_ofs) = (uint8_t)bit_buf; \
+ dst_ofs++; \
+ bit_buf >>= 8; \
+ bit_buf_size -= 8; \
+ } \
+} while(0)
+
+ static bool defl_start_dynamic_block(defl_huff* d, uint8_t* pDst, uint32_t& dst_ofs, uint32_t dst_buf_size, uint64_t& bit_buf, int& bit_buf_size)
+ {
+ int num_lit_codes, num_dist_codes, num_bit_lengths; uint32_t i, total_code_sizes_to_pack, num_packed_code_sizes, rle_z_count, rle_repeat_count, packed_code_sizes_index;
+ uint8_t code_sizes_to_pack[DEFL_MAX_HUFF_SYMBOLS_0 + DEFL_MAX_HUFF_SYMBOLS_1], packed_code_sizes[DEFL_MAX_HUFF_SYMBOLS_0 + DEFL_MAX_HUFF_SYMBOLS_1], prev_code_size = 0xFF;
+
+ d->m_huff_count[0][256] = 1;
+
+ defl_optimize_huffman_table(d, 0, DEFL_MAX_HUFF_SYMBOLS_0, 12, FPNG_FALSE);
+ defl_optimize_huffman_table(d, 1, DEFL_MAX_HUFF_SYMBOLS_1, 12, FPNG_FALSE);
+
+ for (num_lit_codes = 286; num_lit_codes > 257; num_lit_codes--) if (d->m_huff_code_sizes[0][num_lit_codes - 1]) break;
+ for (num_dist_codes = 30; num_dist_codes > 1; num_dist_codes--) if (d->m_huff_code_sizes[1][num_dist_codes - 1]) break;
+
+ memcpy(code_sizes_to_pack, &d->m_huff_code_sizes[0][0], num_lit_codes);
+ memcpy(code_sizes_to_pack + num_lit_codes, &d->m_huff_code_sizes[1][0], num_dist_codes);
+ total_code_sizes_to_pack = num_lit_codes + num_dist_codes; num_packed_code_sizes = 0; rle_z_count = 0; rle_repeat_count = 0;
+
+ memset(&d->m_huff_count[2][0], 0, sizeof(d->m_huff_count[2][0]) * DEFL_MAX_HUFF_SYMBOLS_2);
+ for (i = 0; i < total_code_sizes_to_pack; i++)
+ {
+ uint8_t code_size = code_sizes_to_pack[i];
+ if (!code_size)
+ {
+ DEFL_RLE_PREV_CODE_SIZE();
+ if (++rle_z_count == 138) { DEFL_RLE_ZERO_CODE_SIZE(); }
+ }
+ else
+ {
+ DEFL_RLE_ZERO_CODE_SIZE();
+ if (code_size != prev_code_size)
+ {
+ DEFL_RLE_PREV_CODE_SIZE();
+ d->m_huff_count[2][code_size] = (uint16_t)(d->m_huff_count[2][code_size] + 1); packed_code_sizes[num_packed_code_sizes++] = code_size;
+ }
+ else if (++rle_repeat_count == 6)
+ {
+ DEFL_RLE_PREV_CODE_SIZE();
+ }
+ }
+ prev_code_size = code_size;
+ }
+ if (rle_repeat_count) { DEFL_RLE_PREV_CODE_SIZE(); }
+ else { DEFL_RLE_ZERO_CODE_SIZE(); }
+
+ defl_optimize_huffman_table(d, 2, DEFL_MAX_HUFF_SYMBOLS_2, 7, FPNG_FALSE);
+
+ // max of 2+5+5+4+18*3+(288+32)*7=2310 bits
+ DEFL_DYN_PUT_BITS(2, 2);
+
+ DEFL_DYN_PUT_BITS(num_lit_codes - 257, 5);
+ DEFL_DYN_PUT_BITS(num_dist_codes - 1, 5);
+
+ for (num_bit_lengths = 18; num_bit_lengths >= 0; num_bit_lengths--) if (d->m_huff_code_sizes[2][g_defl_packed_code_size_syms_swizzle[num_bit_lengths]]) break;
+ num_bit_lengths = maximum(4, (num_bit_lengths + 1)); DEFL_DYN_PUT_BITS(num_bit_lengths - 4, 4);
+ for (i = 0; (int)i < num_bit_lengths; i++) DEFL_DYN_PUT_BITS(d->m_huff_code_sizes[2][g_defl_packed_code_size_syms_swizzle[i]], 3);
+
+ for (packed_code_sizes_index = 0; packed_code_sizes_index < num_packed_code_sizes; )
+ {
+ uint32_t code = packed_code_sizes[packed_code_sizes_index++]; assert(code < DEFL_MAX_HUFF_SYMBOLS_2);
+ DEFL_DYN_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]);
+ if (code >= 16) DEFL_DYN_PUT_BITS(packed_code_sizes[packed_code_sizes_index++], "\02\03\07"[code - 16]);
+ }
+
+ return true;
+ }
+
+ static uint32_t write_raw_block(const uint8_t* pSrc, uint32_t src_len, uint8_t* pDst, uint32_t dst_buf_size)
+ {
+ if (dst_buf_size < 2)
+ return 0;
+
+ pDst[0] = 0x78;
+ pDst[1] = 0x01;
+
+ uint32_t dst_ofs = 2;
+
+ uint32_t src_ofs = 0;
+ while (src_ofs < src_len)
+ {
+ const uint32_t src_remaining = src_len - src_ofs;
+ const uint32_t block_size = minimum(UINT16_MAX, src_remaining);
+ const bool final_block = (block_size == src_remaining);
+
+ if ((dst_ofs + 5 + block_size) > dst_buf_size)
+ return 0;
+
+ pDst[dst_ofs + 0] = final_block ? 1 : 0;
+
+ pDst[dst_ofs + 1] = block_size & 0xFF;
+ pDst[dst_ofs + 2] = (block_size >> 8) & 0xFF;
+
+ pDst[dst_ofs + 3] = (~block_size) & 0xFF;
+ pDst[dst_ofs + 4] = ((~block_size) >> 8) & 0xFF;
+
+ memcpy(pDst + dst_ofs + 5, pSrc + src_ofs, block_size);
+
+ src_ofs += block_size;
+ dst_ofs += 5 + block_size;
+ }
+
+ uint32_t src_adler32 = fpng_adler32(pSrc, src_len, FPNG_ADLER32_INIT);
+
+ for (uint32_t i = 0; i < 4; i++)
+ {
+ if (dst_ofs + 1 > dst_buf_size)
+ return 0;
+
+ pDst[dst_ofs] = (uint8_t)(src_adler32 >> 24);
+ dst_ofs++;
+
+ src_adler32 <<= 8;
+ }
+
+ return dst_ofs;
+ }
+
+ static void adjust_freq32(uint32_t num_freq, uint32_t* pFreq, uint16_t* pFreq16)
+ {
+ uint32_t total_freq = 0;
+ for (uint32_t i = 0; i < num_freq; i++)
+ total_freq += pFreq[i];
+
+ if (!total_freq)
+ {
+ memset(pFreq16, 0, num_freq * sizeof(uint16_t));
+ return;
+ }
+
+ uint32_t total_freq16 = 0;
+ for (uint32_t i = 0; i < num_freq; i++)
+ {
+ uint64_t f = pFreq[i];
+ if (!f)
+ {
+ pFreq16[i] = 0;
+ continue;
+ }
+
+ pFreq16[i] = (uint16_t)maximum(1, (uint32_t)((f * UINT16_MAX) / total_freq));
+
+ total_freq16 += pFreq16[i];
+ }
+
+ while (total_freq16 > UINT16_MAX)
+ {
+ total_freq16 = 0;
+ for (uint32_t i = 0; i < num_freq; i++)
+ {
+ if (pFreq[i])
+ {
+ pFreq[i] = maximum(1, pFreq[i] >> 1);
+ total_freq16 += pFreq[i];
+ }
+ }
+ }
+ }
+
+ static uint32_t pixel_deflate_dyn_3_rle(
+ const uint8_t* pImg, uint32_t w, uint32_t h,
+ uint8_t* pDst, uint32_t dst_buf_size)
+ {
+ const uint32_t bpl = 1 + w * 3;
+
+ uint64_t bit_buf = 0;
+ int bit_buf_size = 0;
+
+ uint32_t dst_ofs = 0;
+
+ // zlib header
+ PUT_BITS(0x78, 8);
+ PUT_BITS(0x01, 8);
+
+ // write BFINAL bit
+ PUT_BITS(1, 1);
+
+ std::vector codes((w + 1) * h);
+ uint32_t* pDst_codes = codes.data();
+
+ uint32_t lit_freq[DEFL_MAX_HUFF_SYMBOLS_0];
+ memset(lit_freq, 0, sizeof(lit_freq));
+
+ const uint8_t* pSrc = pImg;
+ uint32_t src_ofs = 0;
+
+ uint32_t src_adler32 = fpng_adler32(pImg, bpl * h, FPNG_ADLER32_INIT);
+
+ const uint32_t dist_sym = g_defl_small_dist_sym[3 - 1];
+
+ for (uint32_t y = 0; y < h; y++)
+ {
+ const uint32_t end_src_ofs = src_ofs + bpl;
+
+ const uint32_t filter_lit = pSrc[src_ofs++];
+ *pDst_codes++ = 1 | (filter_lit << 8);
+ lit_freq[filter_lit]++;
+
+ uint32_t prev_lits;
+
+ {
+ uint32_t lits = READ_RGB_PIXEL(pSrc + src_ofs);
+
+ *pDst_codes++ = lits << 8;
+
+ lit_freq[lits & 0xFF]++;
+ lit_freq[(lits >> 8) & 0xFF]++;
+ lit_freq[lits >> 16]++;
+
+ src_ofs += 3;
+
+ prev_lits = lits;
+ }
+
+ while (src_ofs < end_src_ofs)
+ {
+ uint32_t lits = READ_RGB_PIXEL(pSrc + src_ofs);
+
+ if (lits == prev_lits)
+ {
+ uint32_t match_len = 3;
+ uint32_t max_match_len = minimum(255, (int)(end_src_ofs - src_ofs));
+
+ while (match_len < max_match_len)
+ {
+ if (READ_RGB_PIXEL(pSrc + src_ofs + match_len) != lits)
+ break;
+ match_len += 3;
+ }
+
+ *pDst_codes++ = match_len - 1;
+
+ uint32_t adj_match_len = match_len - 3;
+
+ lit_freq[g_defl_len_sym[adj_match_len]]++;
+
+ src_ofs += match_len;
+ }
+ else
+ {
+ *pDst_codes++ = lits << 8;
+
+ lit_freq[lits & 0xFF]++;
+ lit_freq[(lits >> 8) & 0xFF]++;
+ lit_freq[lits >> 16]++;
+
+ prev_lits = lits;
+
+ src_ofs += 3;
+ }
+
+ } // while (src_ofs < end_src_ofs)
+
+ } // y
+
+ assert(src_ofs == h * bpl);
+ const uint32_t total_codes = (uint32_t)(pDst_codes - codes.data());
+ assert(total_codes <= codes.size());
+
+ defl_huff dh;
+
+ lit_freq[256] = 1;
+
+ adjust_freq32(DEFL_MAX_HUFF_SYMBOLS_0, lit_freq, &dh.m_huff_count[0][0]);
+
+ memset(&dh.m_huff_count[1][0], 0, sizeof(dh.m_huff_count[1][0]) * DEFL_MAX_HUFF_SYMBOLS_1);
+ dh.m_huff_count[1][dist_sym] = 1;
+
+ if (!defl_start_dynamic_block(&dh, pDst, dst_ofs, dst_buf_size, bit_buf, bit_buf_size))
+ return 0;
+
+ assert(bit_buf_size <= 7);
+ assert(dh.m_huff_codes[1][dist_sym] == 0 && dh.m_huff_code_sizes[1][dist_sym] == 1);
+
+ for (uint32_t i = 0; i < total_codes; i++)
+ {
+ uint32_t c = codes[i];
+
+ uint32_t c_type = c & 0xFF;
+ if (c_type == 0)
+ {
+ uint32_t lits = c >> 8;
+
+ PUT_BITS_CZ(dh.m_huff_codes[0][lits & 0xFF], dh.m_huff_code_sizes[0][lits & 0xFF]);
+ lits >>= 8;
+
+ PUT_BITS_CZ(dh.m_huff_codes[0][lits & 0xFF], dh.m_huff_code_sizes[0][lits & 0xFF]);
+ lits >>= 8;
+
+ PUT_BITS_CZ(dh.m_huff_codes[0][lits], dh.m_huff_code_sizes[0][lits]);
+ }
+ else if (c_type == 1)
+ {
+ uint32_t lit = c >> 8;
+ PUT_BITS_CZ(dh.m_huff_codes[0][lit], dh.m_huff_code_sizes[0][lit]);
+ }
+ else
+ {
+ uint32_t match_len = c_type + 1;
+
+ uint32_t adj_match_len = match_len - 3;
+
+ PUT_BITS_CZ(dh.m_huff_codes[0][g_defl_len_sym[adj_match_len]], dh.m_huff_code_sizes[0][g_defl_len_sym[adj_match_len]]);
+ PUT_BITS(adj_match_len & g_bitmasks[g_defl_len_extra[adj_match_len]], g_defl_len_extra[adj_match_len] + 1); // up to 6 bits, +1 for the match distance Huff code which is always 0
+
+ // no need to write the distance code, it's always 0
+ //PUT_BITS_CZ(dh.m_huff_codes[1][dist_sym], dh.m_huff_code_sizes[1][dist_sym]);
+ }
+
+ // up to 55 bits
+ PUT_BITS_FLUSH;
+ }
+
+ PUT_BITS_CZ(dh.m_huff_codes[0][256], dh.m_huff_code_sizes[0][256]);
+
+ PUT_BITS_FORCE_FLUSH;
+
+ // Write zlib adler32
+ for (uint32_t i = 0; i < 4; i++)
+ {
+ if ((dst_ofs + 1) > dst_buf_size)
+ return 0;
+ *(uint8_t*)(pDst + dst_ofs) = (uint8_t)(src_adler32 >> 24);
+ dst_ofs++;
+
+ src_adler32 <<= 8;
+ }
+
+ return dst_ofs;
+ }
+
+ static uint32_t pixel_deflate_dyn_3_rle_one_pass(
+ const uint8_t* pImg, uint32_t w, uint32_t h,
+ uint8_t* pDst, uint32_t dst_buf_size)
+ {
+ const uint32_t bpl = 1 + w * 3;
+
+ if (dst_buf_size < sizeof(g_dyn_huff_3))
+ return false;
+ memcpy(pDst, g_dyn_huff_3, sizeof(g_dyn_huff_3));
+ uint32_t dst_ofs = sizeof(g_dyn_huff_3);
+
+ uint64_t bit_buf = DYN_HUFF_3_BITBUF;
+ int bit_buf_size = DYN_HUFF_3_BITBUF_SIZE;
+
+ const uint8_t* pSrc = pImg;
+ uint32_t src_ofs = 0;
+
+ uint32_t src_adler32 = fpng_adler32(pImg, bpl * h, FPNG_ADLER32_INIT);
+
+ for (uint32_t y = 0; y < h; y++)
+ {
+ const uint32_t end_src_ofs = src_ofs + bpl;
+
+ const uint32_t filter_lit = pSrc[src_ofs++];
+ PUT_BITS_CZ(g_dyn_huff_3_codes[filter_lit].m_code, g_dyn_huff_3_codes[filter_lit].m_code_size);
+
+ uint32_t prev_lits;
+
+ {
+ uint32_t lits = READ_RGB_PIXEL(pSrc + src_ofs);
+
+ PUT_BITS_CZ(g_dyn_huff_3_codes[lits & 0xFF].m_code, g_dyn_huff_3_codes[lits & 0xFF].m_code_size);
+ PUT_BITS_CZ(g_dyn_huff_3_codes[(lits >> 8) & 0xFF].m_code, g_dyn_huff_3_codes[(lits >> 8) & 0xFF].m_code_size);
+ PUT_BITS_CZ(g_dyn_huff_3_codes[(lits >> 16)].m_code, g_dyn_huff_3_codes[(lits >> 16)].m_code_size);
+
+ src_ofs += 3;
+
+ prev_lits = lits;
+ }
+
+ PUT_BITS_FLUSH;
+
+ while (src_ofs < end_src_ofs)
+ {
+ uint32_t lits = READ_RGB_PIXEL(pSrc + src_ofs);
+
+ if (lits == prev_lits)
+ {
+ uint32_t match_len = 3;
+ uint32_t max_match_len = minimum(255, (int)(end_src_ofs - src_ofs));
+
+ while (match_len < max_match_len)
+ {
+ if (READ_RGB_PIXEL(pSrc + src_ofs + match_len) != lits)
+ break;
+ match_len += 3;
+ }
+
+ uint32_t adj_match_len = match_len - 3;
+
+ PUT_BITS_CZ(g_dyn_huff_3_codes[g_defl_len_sym[adj_match_len]].m_code, g_dyn_huff_3_codes[g_defl_len_sym[adj_match_len]].m_code_size);
+ PUT_BITS(adj_match_len & g_bitmasks[g_defl_len_extra[adj_match_len]], g_defl_len_extra[adj_match_len] + 1); // up to 6 bits, +1 for the match distance Huff code which is always 0
+
+ src_ofs += match_len;
+ }
+ else
+ {
+ PUT_BITS_CZ(g_dyn_huff_3_codes[lits & 0xFF].m_code, g_dyn_huff_3_codes[lits & 0xFF].m_code_size);
+ PUT_BITS_CZ(g_dyn_huff_3_codes[(lits >> 8) & 0xFF].m_code, g_dyn_huff_3_codes[(lits >> 8) & 0xFF].m_code_size);
+ PUT_BITS_CZ(g_dyn_huff_3_codes[(lits >> 16)].m_code, g_dyn_huff_3_codes[(lits >> 16)].m_code_size);
+
+ prev_lits = lits;
+
+ src_ofs += 3;
+ }
+
+ PUT_BITS_FLUSH;
+
+ } // while (src_ofs < end_src_ofs)
+
+ } // y
+
+ assert(src_ofs == h * bpl);
+
+ assert(bit_buf_size <= 7);
+
+ PUT_BITS_CZ(g_dyn_huff_3_codes[256].m_code, g_dyn_huff_3_codes[256].m_code_size);
+
+ PUT_BITS_FORCE_FLUSH;
+
+ // Write zlib adler32
+ for (uint32_t i = 0; i < 4; i++)
+ {
+ if ((dst_ofs + 1) > dst_buf_size)
+ return 0;
+ *(uint8_t*)(pDst + dst_ofs) = (uint8_t)(src_adler32 >> 24);
+ dst_ofs++;
+
+ src_adler32 <<= 8;
+ }
+
+ return dst_ofs;
+ }
+
+ static uint32_t pixel_deflate_dyn_4_rle(
+ const uint8_t* pImg, uint32_t w, uint32_t h,
+ uint8_t* pDst, uint32_t dst_buf_size)
+ {
+ const uint32_t bpl = 1 + w * 4;
+
+ uint64_t bit_buf = 0;
+ int bit_buf_size = 0;
+
+ uint32_t dst_ofs = 0;
+
+ // zlib header
+ PUT_BITS(0x78, 8);
+ PUT_BITS(0x01, 8);
+
+ // write BFINAL bit
+ PUT_BITS(1, 1);
+
+ std::vector codes;
+ codes.resize((w + 1) * h);
+ uint64_t* pDst_codes = codes.data();
+
+ uint32_t lit_freq[DEFL_MAX_HUFF_SYMBOLS_0];
+ memset(lit_freq, 0, sizeof(lit_freq));
+
+ const uint8_t* pSrc = pImg;
+ uint32_t src_ofs = 0;
+
+ uint32_t src_adler32 = fpng_adler32(pImg, bpl * h, FPNG_ADLER32_INIT);
+
+ const uint32_t dist_sym = g_defl_small_dist_sym[4 - 1];
+
+ for (uint32_t y = 0; y < h; y++)
+ {
+ const uint32_t end_src_ofs = src_ofs + bpl;
+
+ const uint32_t filter_lit = pSrc[src_ofs++];
+ *pDst_codes++ = 1 | (filter_lit << 8);
+ lit_freq[filter_lit]++;
+
+ uint32_t prev_lits;
+ {
+ uint32_t lits = READ_LE32(pSrc + src_ofs);
+
+ *pDst_codes++ = (uint64_t)lits << 8;
+
+ lit_freq[lits & 0xFF]++;
+ lit_freq[(lits >> 8) & 0xFF]++;
+ lit_freq[(lits >> 16) & 0xFF]++;
+ lit_freq[lits >> 24]++;
+
+ src_ofs += 4;
+
+ prev_lits = lits;
+ }
+
+ while (src_ofs < end_src_ofs)
+ {
+ uint32_t lits = READ_LE32(pSrc + src_ofs);
+
+ if (lits == prev_lits)
+ {
+ uint32_t match_len = 4;
+ uint32_t max_match_len = minimum(252, (int)(end_src_ofs - src_ofs));
+
+ while (match_len < max_match_len)
+ {
+ if (READ_LE32(pSrc + src_ofs + match_len) != lits)
+ break;
+ match_len += 4;
+ }
+
+ *pDst_codes++ = match_len - 1;
+
+ uint32_t adj_match_len = match_len - 3;
+
+ lit_freq[g_defl_len_sym[adj_match_len]]++;
+
+ src_ofs += match_len;
+ }
+ else
+ {
+ *pDst_codes++ = (uint64_t)lits << 8;
+
+ lit_freq[lits & 0xFF]++;
+ lit_freq[(lits >> 8) & 0xFF]++;
+ lit_freq[(lits >> 16) & 0xFF]++;
+ lit_freq[lits >> 24]++;
+
+ prev_lits = lits;
+
+ src_ofs += 4;
+ }
+
+ } // while (src_ofs < end_src_ofs)
+
+ } // y
+
+ assert(src_ofs == h * bpl);
+ const uint32_t total_codes = (uint32_t)(pDst_codes - codes.data());
+ assert(total_codes <= codes.size());
+
+ defl_huff dh;
+
+ lit_freq[256] = 1;
+
+ adjust_freq32(DEFL_MAX_HUFF_SYMBOLS_0, lit_freq, &dh.m_huff_count[0][0]);
+
+ memset(&dh.m_huff_count[1][0], 0, sizeof(dh.m_huff_count[1][0]) * DEFL_MAX_HUFF_SYMBOLS_1);
+ dh.m_huff_count[1][dist_sym] = 1;
+
+ if (!defl_start_dynamic_block(&dh, pDst, dst_ofs, dst_buf_size, bit_buf, bit_buf_size))
+ return 0;
+
+ assert(bit_buf_size <= 7);
+ assert(dh.m_huff_codes[1][dist_sym] == 0 && dh.m_huff_code_sizes[1][dist_sym] == 1);
+
+ for (uint32_t i = 0; i < total_codes; i++)
+ {
+ uint64_t c = codes[i];
+
+ uint32_t c_type = (uint32_t)(c & 0xFF);
+ if (c_type == 0)
+ {
+ uint32_t lits = (uint32_t)(c >> 8);
+
+ PUT_BITS_CZ(dh.m_huff_codes[0][lits & 0xFF], dh.m_huff_code_sizes[0][lits & 0xFF]);
+ lits >>= 8;
+
+ PUT_BITS_CZ(dh.m_huff_codes[0][lits & 0xFF], dh.m_huff_code_sizes[0][lits & 0xFF]);
+ lits >>= 8;
+
+ PUT_BITS_CZ(dh.m_huff_codes[0][lits & 0xFF], dh.m_huff_code_sizes[0][lits & 0xFF]);
+ lits >>= 8;
+
+ if (bit_buf_size >= 49)
+ {
+ PUT_BITS_FLUSH;
+ }
+
+ PUT_BITS_CZ(dh.m_huff_codes[0][lits], dh.m_huff_code_sizes[0][lits]);
+ }
+ else if (c_type == 1)
+ {
+ uint32_t lit = (uint32_t)(c >> 8);
+ PUT_BITS_CZ(dh.m_huff_codes[0][lit], dh.m_huff_code_sizes[0][lit]);
+ }
+ else
+ {
+ uint32_t match_len = c_type + 1;
+
+ uint32_t adj_match_len = match_len - 3;
+
+ PUT_BITS_CZ(dh.m_huff_codes[0][g_defl_len_sym[adj_match_len]], dh.m_huff_code_sizes[0][g_defl_len_sym[adj_match_len]]);
+ PUT_BITS(adj_match_len & g_bitmasks[g_defl_len_extra[adj_match_len]], g_defl_len_extra[adj_match_len] + 1); // up to 6 bits, +1 for the match distance Huff code which is always 0
+
+ // no need to write the distance code, it's always 0
+ }
+
+ // up to 55 bits
+ PUT_BITS_FLUSH;
+ }
+
+ PUT_BITS_CZ(dh.m_huff_codes[0][256], dh.m_huff_code_sizes[0][256]);
+
+ PUT_BITS_FORCE_FLUSH;
+
+ // Write zlib adler32
+ for (uint32_t i = 0; i < 4; i++)
+ {
+ if ((dst_ofs + 1) > dst_buf_size)
+ return 0;
+ *(uint8_t*)(pDst + dst_ofs) = (uint8_t)(src_adler32 >> 24);
+ dst_ofs++;
+
+ src_adler32 <<= 8;
+ }
+
+ return dst_ofs;
+ }
+
+ static uint32_t pixel_deflate_dyn_4_rle_one_pass(
+ const uint8_t* pImg, uint32_t w, uint32_t h,
+ uint8_t* pDst, uint32_t dst_buf_size)
+ {
+ const uint32_t bpl = 1 + w * 4;
+
+ if (dst_buf_size < sizeof(g_dyn_huff_4))
+ return false;
+ memcpy(pDst, g_dyn_huff_4, sizeof(g_dyn_huff_4));
+ uint32_t dst_ofs = sizeof(g_dyn_huff_4);
+
+ uint64_t bit_buf = DYN_HUFF_4_BITBUF;
+ int bit_buf_size = DYN_HUFF_4_BITBUF_SIZE;
+
+ const uint8_t* pSrc = pImg;
+ uint32_t src_ofs = 0;
+
+ uint32_t src_adler32 = fpng_adler32(pImg, bpl * h, FPNG_ADLER32_INIT);
+
+ for (uint32_t y = 0; y < h; y++)
+ {
+ const uint32_t end_src_ofs = src_ofs + bpl;
+
+ const uint32_t filter_lit = pSrc[src_ofs++];
+ PUT_BITS_CZ(g_dyn_huff_4_codes[filter_lit].m_code, g_dyn_huff_4_codes[filter_lit].m_code_size);
+
+ PUT_BITS_FLUSH;
+
+ uint32_t prev_lits;
+ {
+ uint32_t lits = READ_LE32(pSrc + src_ofs);
+
+ PUT_BITS_CZ(g_dyn_huff_4_codes[lits & 0xFF].m_code, g_dyn_huff_4_codes[lits & 0xFF].m_code_size);
+ PUT_BITS_CZ(g_dyn_huff_4_codes[(lits >> 8) & 0xFF].m_code, g_dyn_huff_4_codes[(lits >> 8) & 0xFF].m_code_size);
+ PUT_BITS_CZ(g_dyn_huff_4_codes[(lits >> 16) & 0xFF].m_code, g_dyn_huff_4_codes[(lits >> 16) & 0xFF].m_code_size);
+
+ if (bit_buf_size >= 49)
+ {
+ PUT_BITS_FLUSH;
+ }
+
+ PUT_BITS_CZ(g_dyn_huff_4_codes[(lits >> 24)].m_code, g_dyn_huff_4_codes[(lits >> 24)].m_code_size);
+
+ src_ofs += 4;
+
+ prev_lits = lits;
+ }
+
+ PUT_BITS_FLUSH;
+
+ while (src_ofs < end_src_ofs)
+ {
+ uint32_t lits = READ_LE32(pSrc + src_ofs);
+
+ if (lits == prev_lits)
+ {
+ uint32_t match_len = 4;
+ uint32_t max_match_len = minimum(252, (int)(end_src_ofs - src_ofs));
+
+ while (match_len < max_match_len)
+ {
+ if (READ_LE32(pSrc + src_ofs + match_len) != lits)
+ break;
+ match_len += 4;
+ }
+
+ uint32_t adj_match_len = match_len - 3;
+
+ const uint32_t match_code_bits = g_dyn_huff_4_codes[g_defl_len_sym[adj_match_len]].m_code_size;
+ const uint32_t len_extra_bits = g_defl_len_extra[adj_match_len];
+
+ if (match_len == 4)
+ {
+ // This check is optional - see if just encoding 4 literals would be cheaper than using a short match.
+ uint32_t lit_bits = g_dyn_huff_4_codes[lits & 0xFF].m_code_size + g_dyn_huff_4_codes[(lits >> 8) & 0xFF].m_code_size +
+ g_dyn_huff_4_codes[(lits >> 16) & 0xFF].m_code_size + g_dyn_huff_4_codes[(lits >> 24)].m_code_size;
+
+ if ((match_code_bits + len_extra_bits + 1) > lit_bits)
+ goto do_literals;
+ }
+
+ PUT_BITS_CZ(g_dyn_huff_4_codes[g_defl_len_sym[adj_match_len]].m_code, match_code_bits);
+ PUT_BITS(adj_match_len & g_bitmasks[g_defl_len_extra[adj_match_len]], len_extra_bits + 1); // up to 6 bits, +1 for the match distance Huff code which is always 0
+
+ src_ofs += match_len;
+ }
+ else
+ {
+do_literals:
+ PUT_BITS_CZ(g_dyn_huff_4_codes[lits & 0xFF].m_code, g_dyn_huff_4_codes[lits & 0xFF].m_code_size);
+ PUT_BITS_CZ(g_dyn_huff_4_codes[(lits >> 8) & 0xFF].m_code, g_dyn_huff_4_codes[(lits >> 8) & 0xFF].m_code_size);
+ PUT_BITS_CZ(g_dyn_huff_4_codes[(lits >> 16) & 0xFF].m_code, g_dyn_huff_4_codes[(lits >> 16) & 0xFF].m_code_size);
+
+ if (bit_buf_size >= 49)
+ {
+ PUT_BITS_FLUSH;
+ }
+
+ PUT_BITS_CZ(g_dyn_huff_4_codes[(lits >> 24)].m_code, g_dyn_huff_4_codes[(lits >> 24)].m_code_size);
+
+ src_ofs += 4;
+
+ prev_lits = lits;
+ }
+
+ PUT_BITS_FLUSH;
+
+ } // while (src_ofs < end_src_ofs)
+
+ } // y
+
+ assert(src_ofs == h * bpl);
+
+ assert(bit_buf_size <= 7);
+
+ PUT_BITS_CZ(g_dyn_huff_4_codes[256].m_code, g_dyn_huff_4_codes[256].m_code_size);
+
+ PUT_BITS_FORCE_FLUSH;
+
+ // Write zlib adler32
+ for (uint32_t i = 0; i < 4; i++)
+ {
+ if ((dst_ofs + 1) > dst_buf_size)
+ return 0;
+ *(uint8_t*)(pDst + dst_ofs) = (uint8_t)(src_adler32 >> 24);
+ dst_ofs++;
+
+ src_adler32 <<= 8;
+ }
+
+ return dst_ofs;
+ }
+
+ static void vector_append(std::vector& buf, const void* pData, size_t len)
+ {
+ if (len)
+ {
+ size_t l = buf.size();
+ buf.resize(l + len);
+ memcpy(buf.data() + l, pData, len);
+ }
+ }
+
+ static void apply_filter(uint32_t filter, int w, int h, uint32_t num_chans, uint32_t bpl, const uint8_t* pSrc, const uint8_t* pPrev_src, uint8_t* pDst)
+ {
+ (void)h;
+
+ switch (filter)
+ {
+ case 0:
+ {
+ *pDst++ = 0;
+
+ memcpy(pDst, pSrc, bpl);
+ break;
+ }
+ case 2:
+ {
+ assert(pPrev_src);
+
+ // Previous scanline
+ *pDst++ = 2;
+
+ if (num_chans == 3)
+ {
+ for (uint32_t x = 0; x < (uint32_t)w; x++)
+ {
+ pDst[0] = (uint8_t)(pSrc[0] - pPrev_src[0]);
+ pDst[1] = (uint8_t)(pSrc[1] - pPrev_src[1]);
+ pDst[2] = (uint8_t)(pSrc[2] - pPrev_src[2]);
+
+ pSrc += 3;
+ pPrev_src += 3;
+ pDst += 3;
+ }
+ }
+ else
+ {
+ for (uint32_t x = 0; x < (uint32_t)w; x++)
+ {
+ pDst[0] = (uint8_t)(pSrc[0] - pPrev_src[0]);
+ pDst[1] = (uint8_t)(pSrc[1] - pPrev_src[1]);
+ pDst[2] = (uint8_t)(pSrc[2] - pPrev_src[2]);
+ pDst[3] = (uint8_t)(pSrc[3] - pPrev_src[3]);
+
+ pSrc += 4;
+ pPrev_src += 4;
+ pDst += 4;
+ }
+ }
+ break;
+ }
+ default:
+ assert(0);
+ break;
+ }
+ }
+
+ bool fpng_encode_image_to_memory(const void* pImage, uint32_t w, uint32_t h, uint32_t num_chans, std::vector& out_buf, uint32_t flags)
+ {
+ if (!endian_check())
+ {
+ assert(0);
+ return false;
+ }
+
+ if ((w < 1) || (h < 1) || (w * h > UINT32_MAX) || (w > FPNG_MAX_SUPPORTED_DIM) || (h > FPNG_MAX_SUPPORTED_DIM))
+ {
+ assert(0);
+ return false;
+ }
+
+ if ((num_chans != 3) && (num_chans != 4))
+ {
+ assert(0);
+ return false;
+ }
+
+ int i, bpl = w * num_chans;
+ uint32_t y;
+
+ std::vector temp_buf;
+ temp_buf.resize(((bpl + 1) * h + 7) & ~7);
+ uint32_t temp_buf_ofs = 0;
+
+ for (y = 0; y < h; ++y)
+ {
+ const uint8_t* pSrc = (uint8_t*)pImage + y * bpl;
+ const uint8_t* pPrev_src = y ? ((uint8_t*)pImage + (y - 1) * bpl) : nullptr;
+
+ uint8_t* pDst = &temp_buf[temp_buf_ofs];
+
+ apply_filter(y ? 2 : 0, w, h, num_chans, bpl, pSrc, pPrev_src, pDst);
+
+ temp_buf_ofs += 1 + bpl;
+ }
+
+ const uint32_t PNG_HEADER_SIZE = 58;
+
+ uint32_t out_ofs = PNG_HEADER_SIZE;
+
+ out_buf.resize((out_ofs + (bpl + 1) * h + 7) & ~7);
+
+ uint32_t defl_size = 0;
+ if ((flags & FPNG_FORCE_UNCOMPRESSED) == 0)
+ {
+ if (num_chans == 3)
+ {
+ if (flags & FPNG_ENCODE_SLOWER)
+ defl_size = pixel_deflate_dyn_3_rle(temp_buf.data(), w, h, &out_buf[out_ofs], (uint32_t)out_buf.size() - out_ofs);
+ else
+ defl_size = pixel_deflate_dyn_3_rle_one_pass(temp_buf.data(), w, h, &out_buf[out_ofs], (uint32_t)out_buf.size() - out_ofs);
+ }
+ else
+ {
+ if (flags & FPNG_ENCODE_SLOWER)
+ defl_size = pixel_deflate_dyn_4_rle(temp_buf.data(), w, h, &out_buf[out_ofs], (uint32_t)out_buf.size() - out_ofs);
+ else
+ defl_size = pixel_deflate_dyn_4_rle_one_pass(temp_buf.data(), w, h, &out_buf[out_ofs], (uint32_t)out_buf.size() - out_ofs);
+ }
+ }
+
+ uint32_t zlib_size = defl_size;
+
+ if (!defl_size)
+ {
+ // Dynamic block failed to compress - fall back to uncompressed blocks, filter 0.
+
+ temp_buf_ofs = 0;
+
+ for (y = 0; y < h; ++y)
+ {
+ const uint8_t* pSrc = (uint8_t*)pImage + y * bpl;
+
+ uint8_t* pDst = &temp_buf[temp_buf_ofs];
+
+ apply_filter(0, w, h, num_chans, bpl, pSrc, nullptr, pDst);
+
+ temp_buf_ofs += 1 + bpl;
+ }
+
+ assert(temp_buf_ofs <= temp_buf.size());
+
+ out_buf.resize(out_ofs + 6 + temp_buf_ofs + ((temp_buf_ofs + 65534) / 65535) * 5);
+
+ uint32_t raw_size = write_raw_block(temp_buf.data(), (uint32_t)temp_buf_ofs, out_buf.data() + out_ofs, (uint32_t)out_buf.size() - out_ofs);
+ if (!raw_size)
+ {
+ // Somehow we miscomputed the size of the output buffer.
+ assert(0);
+ return false;
+ }
+
+ zlib_size = raw_size;
+ }
+
+ assert((out_ofs + zlib_size) <= out_buf.size());
+
+ out_buf.resize(out_ofs + zlib_size);
+
+ const uint32_t idat_len = (uint32_t)out_buf.size() - PNG_HEADER_SIZE;
+
+ // Write real PNG header, fdEC chunk, and the beginning of the IDAT chunk
+ {
+ static const uint8_t s_color_type[] = { 0x00, 0x00, 0x04, 0x02, 0x06 };
+
+ uint8_t pnghdr[58] = {
+ 0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a, // PNG sig
+ 0x00,0x00,0x00,0x0d, 'I','H','D','R', // IHDR chunk len, type
+ 0,0,(uint8_t)(w >> 8),(uint8_t)w, // width
+ 0,0,(uint8_t)(h >> 8),(uint8_t)h, // height
+ 8, //bit_depth
+ s_color_type[num_chans], // color_type
+ 0, // compression
+ 0, // filter
+ 0, // interlace
+ 0, 0, 0, 0, // IHDR crc32
+ 0, 0, 0, 5, 'f', 'd', 'E', 'C', 82, 36, 147, 227, FPNG_FDEC_VERSION, 0xE5, 0xAB, 0x62, 0x99, // our custom private, ancillary, do not copy, fdEC chunk
+ (uint8_t)(idat_len >> 24),(uint8_t)(idat_len >> 16),(uint8_t)(idat_len >> 8),(uint8_t)idat_len, 'I','D','A','T' // IDATA chunk len, type
+ };
+
+ // Compute IHDR CRC32
+ uint32_t c = (uint32_t)fpng_crc32(pnghdr + 12, 17, FPNG_CRC32_INIT);
+ for (i = 0; i < 4; ++i, c <<= 8)
+ ((uint8_t*)(pnghdr + 29))[i] = (uint8_t)(c >> 24);
+
+ memcpy(out_buf.data(), pnghdr, PNG_HEADER_SIZE);
+ }
+
+ // Write IDAT chunk's CRC32 and a 0 length IEND chunk
+ vector_append(out_buf, "\0\0\0\0\0\0\0\0\x49\x45\x4e\x44\xae\x42\x60\x82", 16); // IDAT CRC32, followed by the IEND chunk
+
+ // Compute IDAT crc32
+ uint32_t c = (uint32_t)fpng_crc32(out_buf.data() + PNG_HEADER_SIZE - 4, idat_len + 4, FPNG_CRC32_INIT);
+
+ for (i = 0; i < 4; ++i, c <<= 8)
+ (out_buf.data() + out_buf.size() - 16)[i] = (uint8_t)(c >> 24);
+
+ return true;
+ }
+
+#ifndef FPNG_NO_STDIO
+ bool fpng_encode_image_to_file(const char* pFilename, const void* pImage, uint32_t w, uint32_t h, uint32_t num_chans, uint32_t flags)
+ {
+ std::vector out_buf;
+ if (!fpng_encode_image_to_memory(pImage, w, h, num_chans, out_buf, flags))
+ return false;
+
+ FILE* pFile = nullptr;
+#ifdef _MSC_VER
+ fopen_s(&pFile, pFilename, "wb");
+#else
+ pFile = fopen(pFilename, "wb");
+#endif
+ if (!pFile)
+ return false;
+
+ if (fwrite(out_buf.data(), 1, out_buf.size(), pFile) != out_buf.size())
+ {
+ fclose(pFile);
+ return false;
+ }
+
+ return (fclose(pFile) != EOF);
+ }
+#endif
+
+ // Decompression
+
+ const uint32_t FPNG_DECODER_TABLE_BITS = 12;
+ const uint32_t FPNG_DECODER_TABLE_SIZE = 1 << FPNG_DECODER_TABLE_BITS;
+
+ static bool build_decoder_table(uint32_t num_syms, uint8_t* pCode_sizes, uint32_t* pTable)
+ {
+ uint32_t num_codes[16];
+
+ memset(num_codes, 0, sizeof(num_codes));
+ for (uint32_t i = 0; i < num_syms; i++)
+ {
+ assert(pCode_sizes[i] <= FPNG_DECODER_TABLE_SIZE);
+ num_codes[pCode_sizes[i]]++;
+ }
+
+ uint32_t next_code[17];
+ next_code[0] = next_code[1] = 0;
+ uint32_t total = 0;
+ for (uint32_t i = 1; i <= 15; i++)
+ next_code[i + 1] = (uint32_t)(total = ((total + ((uint32_t)num_codes[i])) << 1));
+
+ if (total != 0x10000)
+ {
+ uint32_t j = 0;
+
+ for (uint32_t i = 15; i != 0; i--)
+ if ((j += num_codes[i]) > 1)
+ return false;
+
+ if (j != 1)
+ return false;
+ }
+
+ uint32_t rev_codes[DEFL_MAX_HUFF_SYMBOLS];
+
+ for (uint32_t i = 0; i < num_syms; i++)
+ rev_codes[i] = next_code[pCode_sizes[i]]++;
+
+ memset(pTable, 0, sizeof(uint32_t) * FPNG_DECODER_TABLE_SIZE);
+
+ for (uint32_t i = 0; i < num_syms; i++)
+ {
+ const uint32_t code_size = pCode_sizes[i];
+ if (!code_size)
+ continue;
+
+ uint32_t old_code = rev_codes[i], new_code = 0;
+ for (uint32_t j = code_size; j != 0; j--)
+ {
+ new_code = (new_code << 1) | (old_code & 1);
+ old_code >>= 1;
+ }
+
+ uint32_t j = 1 << code_size;
+
+ while (new_code < FPNG_DECODER_TABLE_SIZE)
+ {
+ pTable[new_code] = i | (code_size << 9);
+ new_code += j;
+ }
+ }
+
+ return true;
+ }
+
+ static const uint16_t g_run_len3_to_4[259] =
+ {
+ 0,
+ 0, 0, 4, 0, 0, 8, 0, 0, 12, 0, 0, 16, 0, 0, 20, 0, 0, 24, 0, 0, 28, 0, 0,
+ 32, 0, 0, 36, 0, 0, 40, 0, 0, 44, 0, 0, 48, 0, 0, 52, 0, 0, 56, 0, 0,
+ 60, 0, 0, 64, 0, 0, 68, 0, 0, 72, 0, 0, 76, 0, 0, 80, 0, 0, 84, 0, 0,
+ 88, 0, 0, 92, 0, 0, 96, 0, 0, 100, 0, 0, 104, 0, 0, 108, 0, 0, 112, 0, 0,
+ 116, 0, 0, 120, 0, 0, 124, 0, 0, 128, 0, 0, 132, 0, 0, 136, 0, 0, 140, 0, 0,
+ 144, 0, 0, 148, 0, 0, 152, 0, 0, 156, 0, 0, 160, 0, 0, 164, 0, 0, 168, 0, 0,
+ 172, 0, 0, 176, 0, 0, 180, 0, 0, 184, 0, 0, 188, 0, 0, 192, 0, 0, 196, 0, 0,
+ 200, 0, 0, 204, 0, 0, 208, 0, 0, 212, 0, 0, 216, 0, 0, 220, 0, 0, 224, 0, 0,
+ 228, 0, 0, 232, 0, 0, 236, 0, 0, 240, 0, 0, 244, 0, 0, 248, 0, 0, 252, 0, 0,
+ 256, 0, 0, 260, 0, 0, 264, 0, 0, 268, 0, 0, 272, 0, 0, 276, 0, 0, 280, 0, 0,
+ 284, 0, 0, 288, 0, 0, 292, 0, 0, 296, 0, 0, 300, 0, 0, 304, 0, 0, 308, 0, 0,
+ 312, 0, 0, 316, 0, 0, 320, 0, 0, 324, 0, 0, 328, 0, 0, 332, 0, 0, 336, 0, 0,
+ 340, 0, 0,
+ 344,
+ };
+
+ static const int s_length_extra[] = { 0,0,0,0, 0,0,0,0, 1,1,1,1, 2,2,2,2, 3,3,3,3, 4,4,4,4, 5,5,5,5, 0, 0,0 };
+ static const int s_length_range[] = { 3,4,5,6, 7,8,9,10, 11,13,15,17, 19,23,27,31, 35,43,51,59, 67,83,99,115, 131,163,195,227, 258, 0,0 };
+
+#define ENSURE_32BITS() do { \
+ if (bit_buf_size < 32) { \
+ if ((src_ofs + 4) > src_len) return false; \
+ bit_buf |= ((uint64_t)READ_LE32(pSrc + src_ofs)) << bit_buf_size; \
+ src_ofs += 4; bit_buf_size += 32; } \
+ } while(0)
+
+#define GET_BITS(b, ll) do { \
+ uint32_t l = ll; assert(l && (l <= 32)); \
+ b = (uint32_t)(bit_buf & g_bitmasks[l]); \
+ bit_buf >>= l; \
+ bit_buf_size -= l; \
+ ENSURE_32BITS(); \
+ } while(0)
+
+#define SKIP_BITS(ll) do { \
+ uint32_t l = ll; assert(l <= 32); \
+ bit_buf >>= l; \
+ bit_buf_size -= l; \
+ ENSURE_32BITS(); \
+ } while(0)
+
+#define GET_BITS_NE(b, ll) do { \
+ uint32_t l = ll; assert(l && (l <= 32) && (bit_buf_size >= l)); \
+ b = (uint32_t)(bit_buf & g_bitmasks[l]); \
+ bit_buf >>= l; \
+ bit_buf_size -= l; \
+ } while(0)
+
+#define SKIP_BITS_NE(ll) do { \
+ uint32_t l = ll; assert(l <= 32 && (bit_buf_size >= l)); \
+ bit_buf >>= l; \
+ bit_buf_size -= l; \
+ } while(0)
+
+ static bool prepare_dynamic_block(
+ const uint8_t* pSrc, uint32_t src_len, uint32_t& src_ofs,
+ uint32_t& bit_buf_size, uint64_t& bit_buf,
+ uint32_t* pLit_table, uint32_t num_chans)
+ {
+ static const uint8_t s_bit_length_order[] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
+
+ uint32_t num_lit_codes, num_dist_codes, num_clen_codes;
+
+ GET_BITS(num_lit_codes, 5);
+ num_lit_codes += 257;
+
+ GET_BITS(num_dist_codes, 5);
+ num_dist_codes += 1;
+ if (num_dist_codes != num_chans)
+ return false;
+
+ uint32_t total_codes = num_lit_codes + num_dist_codes;
+ if (total_codes > (DEFL_MAX_HUFF_SYMBOLS_0 + DEFL_MAX_HUFF_SYMBOLS_1))
+ return false;
+
+ uint8_t code_sizes[DEFL_MAX_HUFF_SYMBOLS_0 + DEFL_MAX_HUFF_SYMBOLS_1];
+ memset(code_sizes, 0, sizeof(code_sizes));
+
+ GET_BITS(num_clen_codes, 4);
+ num_clen_codes += 4;
+
+ uint8_t clen_codesizes[DEFL_MAX_HUFF_SYMBOLS_2];
+ memset(clen_codesizes, 0, sizeof(clen_codesizes));
+
+ for (uint32_t i = 0; i < num_clen_codes; i++)
+ {
+ uint32_t len = 0;
+ GET_BITS(len, 3);
+ clen_codesizes[s_bit_length_order[i]] = (uint8_t)len;
+ }
+
+ uint32_t clen_table[FPNG_DECODER_TABLE_SIZE];
+ if (!build_decoder_table(DEFL_MAX_HUFF_SYMBOLS_2, clen_codesizes, clen_table))
+ return false;
+
+ uint32_t min_code_size = 15;
+
+ for (uint32_t cur_code = 0; cur_code < total_codes; )
+ {
+ uint32_t sym = clen_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ uint32_t sym_len = sym >> 9;
+ if (!sym_len)
+ return false;
+ SKIP_BITS(sym_len);
+ sym &= 511;
+
+ if (sym <= 15)
+ {
+ // Can't be a fpng Huffman table
+ if (sym > FPNG_DECODER_TABLE_BITS)
+ return false;
+
+ if (sym)
+ min_code_size = minimum(min_code_size, sym);
+
+ code_sizes[cur_code++] = (uint8_t)sym;
+ continue;
+ }
+
+ uint32_t rep_len = 0, rep_code_size = 0;
+
+ switch (sym)
+ {
+ case 16:
+ {
+ GET_BITS(rep_len, 2);
+ rep_len += 3;
+ if (!cur_code)
+ return false;
+ rep_code_size = code_sizes[cur_code - 1];
+ break;
+ }
+ case 17:
+ {
+ GET_BITS(rep_len, 3);
+ rep_len += 3;
+ rep_code_size = 0;
+ break;
+ }
+ case 18:
+ {
+ GET_BITS(rep_len, 7);
+ rep_len += 11;
+ rep_code_size = 0;
+ break;
+ }
+ }
+
+ if ((cur_code + rep_len) > total_codes)
+ return false;
+
+ for (; rep_len; rep_len--)
+ code_sizes[cur_code++] = (uint8_t)rep_code_size;
+ }
+
+ uint8_t lit_codesizes[DEFL_MAX_HUFF_SYMBOLS_0];
+
+ memcpy(lit_codesizes, code_sizes, num_lit_codes);
+ memset(lit_codesizes + num_lit_codes, 0, DEFL_MAX_HUFF_SYMBOLS_0 - num_lit_codes);
+
+ uint32_t total_valid_distcodes = 0;
+ for (uint32_t i = 0; i < num_dist_codes; i++)
+ total_valid_distcodes += code_sizes[num_lit_codes + i];
+ if (total_valid_distcodes != 1)
+ return false;
+
+ if (code_sizes[num_lit_codes + (num_chans - 1)] != 1)
+ return false;
+
+ if (!build_decoder_table(num_lit_codes, lit_codesizes, pLit_table))
+ return false;
+
+ // Add next symbol to decoder table, when it fits
+ for (uint32_t i = 0; i < FPNG_DECODER_TABLE_SIZE; i++)
+ {
+ uint32_t sym = pLit_table[i] & 511;
+ if (sym >= 256)
+ continue;
+
+ uint32_t sym_bits = (pLit_table[i] >> 9) & 15;
+ if (!sym_bits)
+ continue;
+ assert(sym_bits <= FPNG_DECODER_TABLE_BITS);
+
+ uint32_t bits_left = FPNG_DECODER_TABLE_BITS - sym_bits;
+ if (bits_left < min_code_size)
+ continue;
+
+ uint32_t next_bits = i >> sym_bits;
+ uint32_t next_sym = pLit_table[next_bits] & 511;
+ uint32_t next_sym_bits = (pLit_table[next_bits] >> 9) & 15;
+ if ((!next_sym_bits) || (bits_left < next_sym_bits))
+ continue;
+
+ pLit_table[i] |= (next_sym << 16) | (next_sym_bits << (16 + 9));
+ }
+
+ return true;
+ }
+
+ static bool fpng_pixel_zlib_raw_decompress(
+ const uint8_t* pSrc, uint32_t src_len, uint32_t zlib_len,
+ uint8_t* pDst, uint32_t w, uint32_t h,
+ uint32_t src_chans, uint32_t dst_chans)
+ {
+ assert((src_chans == 3) || (src_chans == 4));
+ assert((dst_chans == 3) || (dst_chans == 4));
+
+ const uint32_t src_bpl = w * src_chans;
+ const uint32_t dst_bpl = w * dst_chans;
+ const uint32_t dst_len = dst_bpl * h;
+
+ uint32_t src_ofs = 2;
+ uint32_t dst_ofs = 0;
+ uint32_t raster_ofs = 0;
+ uint32_t comp_ofs = 0;
+
+ for (; ; )
+ {
+ if ((src_ofs + 1) > src_len)
+ return false;
+
+ const bool bfinal = (pSrc[src_ofs] & 1) != 0;
+ const uint32_t btype = (pSrc[src_ofs] >> 1) & 3;
+ if (btype != 0)
+ return false;
+
+ src_ofs++;
+
+ if ((src_ofs + 4) > src_len)
+ return false;
+ uint32_t len = pSrc[src_ofs + 0] | (pSrc[src_ofs + 1] << 8);
+ uint32_t nlen = pSrc[src_ofs + 2] | (pSrc[src_ofs + 3] << 8);
+ src_ofs += 4;
+
+ if (len != (~nlen & 0xFFFF))
+ return false;
+
+ if ((src_ofs + len) > src_len)
+ return false;
+
+ // Raw blocks are a relatively uncommon case so this isn't well optimized.
+ // Supports 3->4 and 4->3 byte/pixel conversion.
+ for (uint32_t i = 0; i < len; i++)
+ {
+ uint32_t c = pSrc[src_ofs + i];
+
+ if (!raster_ofs)
+ {
+ // Check filter type
+ if (c != 0)
+ return false;
+
+ assert(!comp_ofs);
+ }
+ else
+ {
+ if (comp_ofs < dst_chans)
+ {
+ if (dst_ofs == dst_len)
+ return false;
+
+ pDst[dst_ofs++] = (uint8_t)c;
+ }
+
+ if (++comp_ofs == src_chans)
+ {
+ if (dst_chans > src_chans)
+ {
+ if (dst_ofs == dst_len)
+ return false;
+
+ pDst[dst_ofs++] = (uint8_t)0xFF;
+ }
+
+ comp_ofs = 0;
+ }
+ }
+
+ if (++raster_ofs == (src_bpl + 1))
+ {
+ assert(!comp_ofs);
+ raster_ofs = 0;
+ }
+ }
+
+ src_ofs += len;
+
+ if (bfinal)
+ break;
+ }
+
+ if (comp_ofs != 0)
+ return false;
+
+ // Check for zlib adler32
+ if ((src_ofs + 4) != zlib_len)
+ return false;
+
+ return (dst_ofs == dst_len);
+ }
+
+ template
+ static bool fpng_pixel_zlib_decompress_3(
+ const uint8_t* pSrc, uint32_t src_len, uint32_t zlib_len,
+ uint8_t* pDst, uint32_t w, uint32_t h)
+ {
+ assert(src_len >= (zlib_len + 4));
+
+ const uint32_t dst_bpl = w * dst_comps;
+ //const uint32_t dst_len = dst_bpl * h;
+
+ if (zlib_len < 7)
+ return false;
+
+ // check zlib header
+ if ((pSrc[0] != 0x78) || (pSrc[1] != 0x01))
+ return false;
+
+ uint32_t src_ofs = 2;
+
+ if ((pSrc[src_ofs] & 6) == 0)
+ return fpng_pixel_zlib_raw_decompress(pSrc, src_len, zlib_len, pDst, w, h, 3, dst_comps);
+
+ if ((src_ofs + 4) > src_len)
+ return false;
+ uint64_t bit_buf = READ_LE32(pSrc + src_ofs);
+ src_ofs += 4;
+
+ uint32_t bit_buf_size = 32;
+
+ uint32_t bfinal, btype;
+ GET_BITS(bfinal, 1);
+ GET_BITS(btype, 2);
+
+ // Must be the final block or it's not valid, and type=1 (dynamic)
+ if ((bfinal != 1) || (btype != 2))
+ return false;
+
+ uint32_t lit_table[FPNG_DECODER_TABLE_SIZE];
+ if (!prepare_dynamic_block(pSrc, src_len, src_ofs, bit_buf_size, bit_buf, lit_table, 3))
+ return false;
+
+ const uint8_t* pPrev_scanline = nullptr;
+ uint8_t* pCur_scanline = pDst;
+
+ for (uint32_t y = 0; y < h; y++)
+ {
+ // At start of PNG scanline, so read the filter literal
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ uint32_t filter = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ uint32_t filter_len = (filter >> 9) & 15;
+ if (!filter_len)
+ return false;
+ SKIP_BITS(filter_len);
+ filter &= 511;
+
+ uint32_t expected_filter = (y ? 2 : 0);
+ if (filter != expected_filter)
+ return false;
+
+ uint32_t x_ofs = 0;
+ uint8_t prev_delta_r = 0, prev_delta_g = 0, prev_delta_b = 0;
+ do
+ {
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ uint32_t lit0_tab = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+
+ uint32_t lit0 = lit0_tab;
+ uint32_t lit0_len = (lit0_tab >> 9) & 15;
+ if (!lit0_len)
+ return false;
+ SKIP_BITS(lit0_len);
+
+ if (lit0 & 256)
+ {
+ lit0 &= 511;
+
+ // Can't be EOB - we still have more pixels to decompress.
+ if (lit0 == 256)
+ return false;
+
+ // Must be an RLE match against the previous pixel.
+ uint32_t run_len = s_length_range[lit0 - 257];
+ if (lit0 >= 265)
+ {
+ uint32_t e;
+ GET_BITS_NE(e, s_length_extra[lit0 - 257]);
+
+ run_len += e;
+ }
+
+ // Skip match distance - it's always the same (3)
+ SKIP_BITS_NE(1);
+
+ // Matches must always be a multiple of 3/4 bytes
+ assert((run_len % 3) == 0);
+
+ if (dst_comps == 4)
+ {
+ const uint32_t x_ofs_end = x_ofs + g_run_len3_to_4[run_len];
+
+ // Check for valid run lengths
+ if (x_ofs == x_ofs_end)
+ return false;
+
+ // Matches cannot cross scanlines.
+ if (x_ofs_end > dst_bpl)
+ return false;
+
+ if (pPrev_scanline)
+ {
+ if ((prev_delta_r | prev_delta_g | prev_delta_b) == 0)
+ {
+ memcpy(pCur_scanline + x_ofs, pPrev_scanline + x_ofs, x_ofs_end - x_ofs);
+ x_ofs = x_ofs_end;
+ }
+ else
+ {
+ do
+ {
+ pCur_scanline[x_ofs] = (uint8_t)(pPrev_scanline[x_ofs] + prev_delta_r);
+ pCur_scanline[x_ofs + 1] = (uint8_t)(pPrev_scanline[x_ofs + 1] + prev_delta_g);
+ pCur_scanline[x_ofs + 2] = (uint8_t)(pPrev_scanline[x_ofs + 2] + prev_delta_b);
+ pCur_scanline[x_ofs + 3] = 0xFF;
+ x_ofs += 4;
+ } while (x_ofs < x_ofs_end);
+ }
+ }
+ else
+ {
+ do
+ {
+ pCur_scanline[x_ofs] = prev_delta_r;
+ pCur_scanline[x_ofs + 1] = prev_delta_g;
+ pCur_scanline[x_ofs + 2] = prev_delta_b;
+ pCur_scanline[x_ofs + 3] = 0xFF;
+ x_ofs += 4;
+ } while (x_ofs < x_ofs_end);
+ }
+ }
+ else
+ {
+ // Check for valid run lengths
+ if (!g_run_len3_to_4[run_len])
+ return false;
+
+ const uint32_t x_ofs_end = x_ofs + run_len;
+
+ // Matches cannot cross scanlines.
+ if (x_ofs_end > dst_bpl)
+ return false;
+
+ if (pPrev_scanline)
+ {
+ if ((prev_delta_r | prev_delta_g | prev_delta_b) == 0)
+ {
+ memcpy(pCur_scanline + x_ofs, pPrev_scanline + x_ofs, run_len);
+ x_ofs = x_ofs_end;
+ }
+ else
+ {
+ do
+ {
+ pCur_scanline[x_ofs] = (uint8_t)(pPrev_scanline[x_ofs] + prev_delta_r);
+ pCur_scanline[x_ofs + 1] = (uint8_t)(pPrev_scanline[x_ofs + 1] + prev_delta_g);
+ pCur_scanline[x_ofs + 2] = (uint8_t)(pPrev_scanline[x_ofs + 2] + prev_delta_b);
+ x_ofs += 3;
+ } while (x_ofs < x_ofs_end);
+ }
+ }
+ else
+ {
+ do
+ {
+ pCur_scanline[x_ofs] = prev_delta_r;
+ pCur_scanline[x_ofs + 1] = prev_delta_g;
+ pCur_scanline[x_ofs + 2] = prev_delta_b;
+ x_ofs += 3;
+ } while (x_ofs < x_ofs_end);
+ }
+ }
+ }
+ else
+ {
+ uint32_t lit1, lit2;
+
+ uint32_t lit1_spec_len = (lit0_tab >> (16 + 9));
+ uint32_t lit2_len;
+ if (lit1_spec_len)
+ {
+ lit1 = (lit0_tab >> 16) & 511;
+ SKIP_BITS_NE(lit1_spec_len);
+
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ lit2 = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ lit2_len = (lit2 >> 9) & 15;
+ if (!lit2_len)
+ return false;
+ }
+ else
+ {
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ lit1 = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ uint32_t lit1_len = (lit1 >> 9) & 15;
+ if (!lit1_len)
+ return false;
+ SKIP_BITS_NE(lit1_len);
+
+ lit2_len = (lit1 >> (16 + 9));
+ if (lit2_len)
+ lit2 = lit1 >> 16;
+ else
+ {
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ lit2 = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ lit2_len = (lit2 >> 9) & 15;
+ if (!lit2_len)
+ return false;
+ }
+ }
+
+ SKIP_BITS(lit2_len);
+
+ // Check for matches
+ if ((lit1 | lit2) & 256)
+ return false;
+
+ if (dst_comps == 4)
+ {
+ if (pPrev_scanline)
+ {
+ pCur_scanline[x_ofs] = (uint8_t)(pPrev_scanline[x_ofs] + lit0);
+ pCur_scanline[x_ofs + 1] = (uint8_t)(pPrev_scanline[x_ofs + 1] + lit1);
+ pCur_scanline[x_ofs + 2] = (uint8_t)(pPrev_scanline[x_ofs + 2] + lit2);
+ pCur_scanline[x_ofs + 3] = 0xFF;
+ }
+ else
+ {
+ pCur_scanline[x_ofs] = (uint8_t)lit0;
+ pCur_scanline[x_ofs + 1] = (uint8_t)lit1;
+ pCur_scanline[x_ofs + 2] = (uint8_t)lit2;
+ pCur_scanline[x_ofs + 3] = 0xFF;
+ }
+ x_ofs += 4;
+ }
+ else
+ {
+ if (pPrev_scanline)
+ {
+ pCur_scanline[x_ofs] = (uint8_t)(pPrev_scanline[x_ofs] + lit0);
+ pCur_scanline[x_ofs + 1] = (uint8_t)(pPrev_scanline[x_ofs + 1] + lit1);
+ pCur_scanline[x_ofs + 2] = (uint8_t)(pPrev_scanline[x_ofs + 2] + lit2);
+ }
+ else
+ {
+ pCur_scanline[x_ofs] = (uint8_t)lit0;
+ pCur_scanline[x_ofs + 1] = (uint8_t)lit1;
+ pCur_scanline[x_ofs + 2] = (uint8_t)lit2;
+ }
+ x_ofs += 3;
+ }
+
+ prev_delta_r = (uint8_t)lit0;
+ prev_delta_g = (uint8_t)lit1;
+ prev_delta_b = (uint8_t)lit2;
+
+ // See if we can decode one more pixel.
+ uint32_t spec_next_len0_len = lit2 >> (16 + 9);
+ if ((spec_next_len0_len) && (x_ofs < dst_bpl))
+ {
+ lit0 = (lit2 >> 16) & 511;
+ if (lit0 < 256)
+ {
+ SKIP_BITS_NE(spec_next_len0_len);
+
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ lit1 = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ uint32_t lit1_len = (lit1 >> 9) & 15;
+ if (!lit1_len)
+ return false;
+ SKIP_BITS(lit1_len);
+
+ lit2_len = (lit1 >> (16 + 9));
+ if (lit2_len)
+ lit2 = lit1 >> 16;
+ else
+ {
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ lit2 = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ lit2_len = (lit2 >> 9) & 15;
+ if (!lit2_len)
+ return false;
+ }
+
+ SKIP_BITS_NE(lit2_len);
+
+ // Check for matches
+ if ((lit1 | lit2) & 256)
+ return false;
+
+ if (dst_comps == 4)
+ {
+ if (pPrev_scanline)
+ {
+ pCur_scanline[x_ofs] = (uint8_t)(pPrev_scanline[x_ofs] + lit0);
+ pCur_scanline[x_ofs + 1] = (uint8_t)(pPrev_scanline[x_ofs + 1] + lit1);
+ pCur_scanline[x_ofs + 2] = (uint8_t)(pPrev_scanline[x_ofs + 2] + lit2);
+ pCur_scanline[x_ofs + 3] = 0xFF;
+ }
+ else
+ {
+ pCur_scanline[x_ofs] = (uint8_t)lit0;
+ pCur_scanline[x_ofs + 1] = (uint8_t)lit1;
+ pCur_scanline[x_ofs + 2] = (uint8_t)lit2;
+ pCur_scanline[x_ofs + 3] = 0xFF;
+ }
+ x_ofs += 4;
+ }
+ else
+ {
+ if (pPrev_scanline)
+ {
+ pCur_scanline[x_ofs] = (uint8_t)(pPrev_scanline[x_ofs] + lit0);
+ pCur_scanline[x_ofs + 1] = (uint8_t)(pPrev_scanline[x_ofs + 1] + lit1);
+ pCur_scanline[x_ofs + 2] = (uint8_t)(pPrev_scanline[x_ofs + 2] + lit2);
+ }
+ else
+ {
+ pCur_scanline[x_ofs] = (uint8_t)lit0;
+ pCur_scanline[x_ofs + 1] = (uint8_t)lit1;
+ pCur_scanline[x_ofs + 2] = (uint8_t)lit2;
+ }
+ x_ofs += 3;
+ }
+
+ prev_delta_r = (uint8_t)lit0;
+ prev_delta_g = (uint8_t)lit1;
+ prev_delta_b = (uint8_t)lit2;
+
+ } // if (lit0 < 256)
+
+ } // if ((spec_next_len0_len) && (x_ofs < bpl))
+ }
+
+ } while (x_ofs < dst_bpl);
+
+ pPrev_scanline = pCur_scanline;
+ pCur_scanline += dst_bpl;
+
+ } // y
+
+ // The last symbol should be EOB
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ uint32_t lit0 = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ uint32_t lit0_len = (lit0 >> 9) & 15;
+ if (!lit0_len)
+ return false;
+ lit0 &= 511;
+ if (lit0 != 256)
+ return false;
+
+ bit_buf_size -= lit0_len;
+ bit_buf >>= lit0_len;
+
+ uint32_t align_bits = bit_buf_size & 7;
+ bit_buf_size -= align_bits;
+ bit_buf >>= align_bits;
+
+ if (src_ofs < (bit_buf_size >> 3))
+ return false;
+ src_ofs -= (bit_buf_size >> 3);
+
+ // We should be at the very end, because the bit buf reads ahead 32-bits (which contains the zlib adler32).
+ if ((src_ofs + 4) != zlib_len)
+ return false;
+
+ return true;
+ }
+
+ template
+ static bool fpng_pixel_zlib_decompress_4(
+ const uint8_t* pSrc, uint32_t src_len, uint32_t zlib_len,
+ uint8_t* pDst, uint32_t w, uint32_t h)
+ {
+ assert(src_len >= (zlib_len + 4));
+
+ const uint32_t dst_bpl = w * dst_comps;
+ //const uint32_t dst_len = dst_bpl * h;
+
+ if (zlib_len < 7)
+ return false;
+
+ // check zlib header
+ if ((pSrc[0] != 0x78) || (pSrc[1] != 0x01))
+ return false;
+
+ uint32_t src_ofs = 2;
+
+ if ((pSrc[src_ofs] & 6) == 0)
+ return fpng_pixel_zlib_raw_decompress(pSrc, src_len, zlib_len, pDst, w, h, 4, dst_comps);
+
+ if ((src_ofs + 4) > src_len)
+ return false;
+ uint64_t bit_buf = READ_LE32(pSrc + src_ofs);
+ src_ofs += 4;
+
+ uint32_t bit_buf_size = 32;
+
+ uint32_t bfinal, btype;
+ GET_BITS(bfinal, 1);
+ GET_BITS(btype, 2);
+
+ // Must be the final block or it's not valid, and type=1 (dynamic)
+ if ((bfinal != 1) || (btype != 2))
+ return false;
+
+ uint32_t lit_table[FPNG_DECODER_TABLE_SIZE];
+ if (!prepare_dynamic_block(pSrc, src_len, src_ofs, bit_buf_size, bit_buf, lit_table, 4))
+ return false;
+
+ const uint8_t* pPrev_scanline = nullptr;
+ uint8_t* pCur_scanline = pDst;
+
+ for (uint32_t y = 0; y < h; y++)
+ {
+ // At start of PNG scanline, so read the filter literal
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ uint32_t filter = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ uint32_t filter_len = (filter >> 9) & 15;
+ if (!filter_len)
+ return false;
+ SKIP_BITS(filter_len);
+ filter &= 511;
+
+ uint32_t expected_filter = (y ? 2 : 0);
+ if (filter != expected_filter)
+ return false;
+
+ uint32_t x_ofs = 0;
+ uint8_t prev_delta_r = 0, prev_delta_g = 0, prev_delta_b = 0, prev_delta_a = 0;
+ do
+ {
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ uint32_t lit0_tab = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+
+ uint32_t lit0 = lit0_tab;
+ uint32_t lit0_len = (lit0_tab >> 9) & 15;
+ if (!lit0_len)
+ return false;
+ SKIP_BITS(lit0_len);
+
+ if (lit0 & 256)
+ {
+ lit0 &= 511;
+
+ // Can't be EOB - we still have more pixels to decompress.
+ if (lit0 == 256)
+ return false;
+
+ // Must be an RLE match against the previous pixel.
+ uint32_t run_len = s_length_range[lit0 - 257];
+ if (lit0 >= 265)
+ {
+ uint32_t e;
+ GET_BITS_NE(e, s_length_extra[lit0 - 257]);
+
+ run_len += e;
+ }
+
+ // Skip match distance - it's always the same (4)
+ SKIP_BITS_NE(1);
+
+ // Matches must always be a multiple of 3/4 bytes
+ if (run_len & 3)
+ return false;
+
+ if (dst_comps == 3)
+ {
+ const uint32_t run_len3 = (run_len >> 2) * 3;
+ const uint32_t x_ofs_end = x_ofs + run_len3;
+
+ // Matches cannot cross scanlines.
+ if (x_ofs_end > dst_bpl)
+ return false;
+
+ if (pPrev_scanline)
+ {
+ if ((prev_delta_r | prev_delta_g | prev_delta_b | prev_delta_a) == 0)
+ {
+ memcpy(pCur_scanline + x_ofs, pPrev_scanline + x_ofs, run_len3);
+ x_ofs = x_ofs_end;
+ }
+ else
+ {
+ do
+ {
+ pCur_scanline[x_ofs] = (uint8_t)(pPrev_scanline[x_ofs] + prev_delta_r);
+ pCur_scanline[x_ofs + 1] = (uint8_t)(pPrev_scanline[x_ofs + 1] + prev_delta_g);
+ pCur_scanline[x_ofs + 2] = (uint8_t)(pPrev_scanline[x_ofs + 2] + prev_delta_b);
+ x_ofs += 3;
+ } while (x_ofs < x_ofs_end);
+ }
+ }
+ else
+ {
+ do
+ {
+ pCur_scanline[x_ofs] = prev_delta_r;
+ pCur_scanline[x_ofs + 1] = prev_delta_g;
+ pCur_scanline[x_ofs + 2] = prev_delta_b;
+ x_ofs += 3;
+ } while (x_ofs < x_ofs_end);
+ }
+ }
+ else
+ {
+ const uint32_t x_ofs_end = x_ofs + run_len;
+
+ // Matches cannot cross scanlines.
+ if (x_ofs_end > dst_bpl)
+ return false;
+
+ if (pPrev_scanline)
+ {
+ if ((prev_delta_r | prev_delta_g | prev_delta_b | prev_delta_a) == 0)
+ {
+ memcpy(pCur_scanline + x_ofs, pPrev_scanline + x_ofs, run_len);
+ x_ofs = x_ofs_end;
+ }
+ else
+ {
+ do
+ {
+ pCur_scanline[x_ofs] = (uint8_t)(pPrev_scanline[x_ofs] + prev_delta_r);
+ pCur_scanline[x_ofs + 1] = (uint8_t)(pPrev_scanline[x_ofs + 1] + prev_delta_g);
+ pCur_scanline[x_ofs + 2] = (uint8_t)(pPrev_scanline[x_ofs + 2] + prev_delta_b);
+ pCur_scanline[x_ofs + 3] = (uint8_t)(pPrev_scanline[x_ofs + 3] + prev_delta_a);
+ x_ofs += 4;
+ } while (x_ofs < x_ofs_end);
+ }
+ }
+ else
+ {
+ do
+ {
+ pCur_scanline[x_ofs] = prev_delta_r;
+ pCur_scanline[x_ofs + 1] = prev_delta_g;
+ pCur_scanline[x_ofs + 2] = prev_delta_b;
+ pCur_scanline[x_ofs + 3] = prev_delta_a;
+ x_ofs += 4;
+ } while (x_ofs < x_ofs_end);
+ }
+ }
+ }
+ else
+ {
+ uint32_t lit1, lit2;
+
+ uint32_t lit1_spec_len = (lit0_tab >> (16 + 9));
+ uint32_t lit2_len;
+ if (lit1_spec_len)
+ {
+ lit1 = (lit0_tab >> 16) & 511;
+ SKIP_BITS_NE(lit1_spec_len);
+
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ lit2 = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ lit2_len = (lit2 >> 9) & 15;
+ if (!lit2_len)
+ return false;
+ }
+ else
+ {
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ lit1 = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ uint32_t lit1_len = (lit1 >> 9) & 15;
+ if (!lit1_len)
+ return false;
+ SKIP_BITS_NE(lit1_len);
+
+ lit2_len = (lit1 >> (16 + 9));
+ if (lit2_len)
+ lit2 = lit1 >> 16;
+ else
+ {
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ lit2 = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ lit2_len = (lit2 >> 9) & 15;
+ if (!lit2_len)
+ return false;
+ }
+ }
+
+ uint32_t lit3;
+ uint32_t lit3_len = lit2 >> (16 + 9);
+
+ if (lit3_len)
+ {
+ lit3 = (lit2 >> 16);
+ SKIP_BITS(lit2_len + lit3_len);
+ }
+ else
+ {
+ SKIP_BITS(lit2_len);
+
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ lit3 = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ lit3_len = (lit3 >> 9) & 15;
+ if (!lit3_len)
+ return false;
+
+ SKIP_BITS_NE(lit3_len);
+ }
+
+ // Check for matches
+ if ((lit1 | lit2 | lit3) & 256)
+ return false;
+
+ if (dst_comps == 3)
+ {
+ if (pPrev_scanline)
+ {
+ pCur_scanline[x_ofs] = (uint8_t)(pPrev_scanline[x_ofs] + lit0);
+ pCur_scanline[x_ofs + 1] = (uint8_t)(pPrev_scanline[x_ofs + 1] + lit1);
+ pCur_scanline[x_ofs + 2] = (uint8_t)(pPrev_scanline[x_ofs + 2] + lit2);
+ }
+ else
+ {
+ pCur_scanline[x_ofs] = (uint8_t)lit0;
+ pCur_scanline[x_ofs + 1] = (uint8_t)lit1;
+ pCur_scanline[x_ofs + 2] = (uint8_t)lit2;
+ }
+
+ x_ofs += 3;
+ }
+ else
+ {
+ if (pPrev_scanline)
+ {
+ pCur_scanline[x_ofs] = (uint8_t)(pPrev_scanline[x_ofs] + lit0);
+ pCur_scanline[x_ofs + 1] = (uint8_t)(pPrev_scanline[x_ofs + 1] + lit1);
+ pCur_scanline[x_ofs + 2] = (uint8_t)(pPrev_scanline[x_ofs + 2] + lit2);
+ pCur_scanline[x_ofs + 3] = (uint8_t)(pPrev_scanline[x_ofs + 3] + lit3);
+ }
+ else
+ {
+ pCur_scanline[x_ofs] = (uint8_t)lit0;
+ pCur_scanline[x_ofs + 1] = (uint8_t)lit1;
+ pCur_scanline[x_ofs + 2] = (uint8_t)lit2;
+ pCur_scanline[x_ofs + 3] = (uint8_t)lit3;
+ }
+
+ x_ofs += 4;
+ }
+
+ prev_delta_r = (uint8_t)lit0;
+ prev_delta_g = (uint8_t)lit1;
+ prev_delta_b = (uint8_t)lit2;
+ prev_delta_a = (uint8_t)lit3;
+ }
+
+ } while (x_ofs < dst_bpl);
+
+ pPrev_scanline = pCur_scanline;
+ pCur_scanline += dst_bpl;
+ } // y
+
+ // The last symbol should be EOB
+ assert(bit_buf_size >= FPNG_DECODER_TABLE_BITS);
+ uint32_t lit0 = lit_table[bit_buf & (FPNG_DECODER_TABLE_SIZE - 1)];
+ uint32_t lit0_len = (lit0 >> 9) & 15;
+ if (!lit0_len)
+ return false;
+ lit0 &= 511;
+ if (lit0 != 256)
+ return false;
+
+ bit_buf_size -= lit0_len;
+ bit_buf >>= lit0_len;
+
+ uint32_t align_bits = bit_buf_size & 7;
+ bit_buf_size -= align_bits;
+ bit_buf >>= align_bits;
+
+ if (src_ofs < (bit_buf_size >> 3))
+ return false;
+ src_ofs -= (bit_buf_size >> 3);
+
+ // We should be at the very end, because the bit buf reads ahead 32-bits (which contains the zlib adler32).
+ if ((src_ofs + 4) != zlib_len)
+ return false;
+
+ return true;
+ }
+
+#pragma pack(push)
+#pragma pack(1)
+ struct png_chunk_prefix
+ {
+ uint32_t m_length;
+ uint8_t m_type[4];
+ };
+ struct png_ihdr
+ {
+ png_chunk_prefix m_prefix;
+ uint32_t m_width;
+ uint32_t m_height;
+ uint8_t m_bitdepth;
+ uint8_t m_color_type;
+ uint8_t m_comp_method;
+ uint8_t m_filter_method;
+ uint8_t m_interlace_method;
+ uint32_t m_crc32;
+ };
+ const uint32_t IHDR_EXPECTED_LENGTH = 13;
+ struct png_iend
+ {
+ png_chunk_prefix m_prefix;
+ uint32_t m_crc32;
+ };
+#pragma pack(pop)
+
+ static int fpng_get_info_internal(const void* pImage, uint32_t image_size, uint32_t& width, uint32_t& height, uint32_t& channels_in_file, uint32_t &idat_ofs, uint32_t &idat_len)
+ {
+ static const uint8_t s_png_sig[8] = { 137, 80, 78, 71, 13, 10, 26, 10 };
+
+ if (!endian_check())
+ {
+ assert(0);
+ return false;
+ }
+
+ width = 0;
+ height = 0;
+ channels_in_file = 0;
+ idat_ofs = 0, idat_len = 0;
+
+ // Ensure the file has at least a minimum possible size
+ if (image_size < (sizeof(s_png_sig) + sizeof(png_ihdr) + sizeof(png_chunk_prefix) + 1 + sizeof(uint32_t) + sizeof(png_iend)))
+ return FPNG_DECODE_FAILED_NOT_PNG;
+
+ if (memcmp(pImage, s_png_sig, 8) != 0)
+ return FPNG_DECODE_FAILED_NOT_PNG;
+
+ const uint8_t* pImage_u8 = static_cast(pImage) + 8;
+
+ const png_ihdr& ihdr = *reinterpret_cast(pImage_u8);
+ pImage_u8 += sizeof(png_ihdr);
+
+ if (READ_BE32(&ihdr.m_prefix.m_length) != IHDR_EXPECTED_LENGTH)
+ return FPNG_DECODE_FAILED_NOT_PNG;
+
+ if (fpng_crc32(ihdr.m_prefix.m_type, 4 + IHDR_EXPECTED_LENGTH, FPNG_CRC32_INIT) != READ_BE32(&ihdr.m_crc32))
+ return FPNG_DECODE_FAILED_HEADER_CRC32;
+
+ width = READ_BE32(&ihdr.m_width);
+ height = READ_BE32(&ihdr.m_height);
+
+ if (!width || !height || (width > FPNG_MAX_SUPPORTED_DIM) || (height > FPNG_MAX_SUPPORTED_DIM))
+ return FPNG_DECODE_FAILED_INVALID_DIMENSIONS;
+
+ uint64_t total_pixels = (uint64_t)width * height;
+ if (total_pixels > (1 << 30))
+ return FPNG_DECODE_FAILED_INVALID_DIMENSIONS;
+
+ if ((ihdr.m_comp_method) || (ihdr.m_filter_method) || (ihdr.m_interlace_method) || (ihdr.m_bitdepth != 8))
+ return FPNG_DECODE_NOT_FPNG;
+
+ if (ihdr.m_color_type == 2)
+ channels_in_file = 3;
+ else if (ihdr.m_color_type == 6)
+ channels_in_file = 4;
+
+ if (!channels_in_file)
+ return FPNG_DECODE_NOT_FPNG;
+
+ // Scan all the chunks. Look for one IDAT, IEND, and our custom fdEC chunk that indicates the file was compressed by us. Skip any ancillary chunks.
+ bool found_fdec_chunk = false;
+
+ for (; ; )
+ {
+ const size_t src_ofs = pImage_u8 - static_cast(pImage);
+ if (src_ofs >= image_size)
+ return FPNG_DECODE_FAILED_CHUNK_PARSING;
+
+ const uint32_t bytes_remaining = image_size - (uint32_t)src_ofs;
+ if (bytes_remaining < sizeof(uint32_t) * 3)
+ return FPNG_DECODE_FAILED_CHUNK_PARSING;
+
+ const png_chunk_prefix* pChunk = reinterpret_cast(pImage_u8);
+
+ const uint32_t chunk_len = READ_BE32(&pChunk->m_length);
+ if ((src_ofs + sizeof(uint32_t) + chunk_len + sizeof(uint32_t)) > image_size)
+ return FPNG_DECODE_FAILED_CHUNK_PARSING;
+
+ for (uint32_t i = 0; i < 4; i++)
+ {
+ const uint8_t c = pChunk->m_type[i];
+ const bool is_upper = (c >= 65) && (c <= 90), is_lower = (c >= 97) && (c <= 122);
+ if ((!is_upper) && (!is_lower))
+ return FPNG_DECODE_FAILED_CHUNK_PARSING;
+ }
+
+ const uint32_t expected_crc32 = READ_BE32(pImage_u8 + sizeof(uint32_t) * 2 + chunk_len);
+
+ char chunk_type[5] = { (char)pChunk->m_type[0], (char)pChunk->m_type[1], (char)pChunk->m_type[2], (char)pChunk->m_type[3], 0 };
+ const bool is_idat = strcmp(chunk_type, "IDAT") == 0;
+
+#if !FPNG_DISABLE_DECODE_CRC32_CHECKS
+ if (!is_idat)
+ {
+ uint32_t actual_crc32 = fpng_crc32(pImage_u8 + sizeof(uint32_t), sizeof(uint32_t) + chunk_len, FPNG_CRC32_INIT);
+ if (actual_crc32 != expected_crc32)
+ return FPNG_DECODE_FAILED_HEADER_CRC32;
+ }
+#endif
+
+ const uint8_t* pChunk_data = pImage_u8 + sizeof(uint32_t) * 2;
+
+ if (strcmp(chunk_type, "IEND") == 0)
+ break;
+ else if (is_idat)
+ {
+ // If there were multiple IDAT's, or we didn't find the fdEC chunk, then it's not FPNG.
+ if ((idat_ofs) || (!found_fdec_chunk))
+ return FPNG_DECODE_NOT_FPNG;
+
+ idat_ofs = (uint32_t)src_ofs;
+ idat_len = chunk_len;
+
+ // Sanity check the IDAT chunk length
+ if (idat_len < 7)
+ return FPNG_DECODE_FAILED_INVALID_IDAT;
+ }
+ else if (strcmp(chunk_type, "fdEC") == 0)
+ {
+ if (found_fdec_chunk)
+ return FPNG_DECODE_NOT_FPNG;
+
+ // We've got our fdEC chunk. Now make sure it's big enough and check its contents.
+ if (chunk_len != 5)
+ return FPNG_DECODE_NOT_FPNG;
+
+ // Check fdEC chunk sig
+ if ((pChunk_data[0] != 82) || (pChunk_data[1] != 36) || (pChunk_data[2] != 147) || (pChunk_data[3] != 227))
+ return FPNG_DECODE_NOT_FPNG;
+
+ // Check fdEC version
+ if (pChunk_data[4] != FPNG_FDEC_VERSION)
+ return FPNG_DECODE_NOT_FPNG;
+
+ found_fdec_chunk = true;
+ }
+ else
+ {
+ // Bail if it's a critical chunk - can't be FPNG
+ if ((chunk_type[0] & 32) == 0)
+ return FPNG_DECODE_NOT_FPNG;
+
+ // ancillary chunk - skip it
+ }
+
+ pImage_u8 += sizeof(png_chunk_prefix) + chunk_len + sizeof(uint32_t);
+ }
+
+ if ((!found_fdec_chunk) || (!idat_ofs))
+ return FPNG_DECODE_NOT_FPNG;
+
+ return FPNG_DECODE_SUCCESS;
+ }
+
+ int fpng_get_info(const void* pImage, uint32_t image_size, uint32_t& width, uint32_t& height, uint32_t& channels_in_file)
+ {
+ uint32_t idat_ofs = 0, idat_len = 0;
+ return fpng_get_info_internal(pImage, image_size, width, height, channels_in_file, idat_ofs, idat_len);
+ }
+
+ int fpng_decode_memory(const void *pImage, uint32_t image_size, std::vector &out, uint32_t& width, uint32_t& height, uint32_t &channels_in_file, uint32_t desired_channels)
+ {
+ out.resize(0);
+ width = 0;
+ height = 0;
+ channels_in_file = 0;
+
+ if ((!pImage) || (!image_size) || ((desired_channels != 3) && (desired_channels != 4)))
+ {
+ assert(0);
+ return FPNG_DECODE_INVALID_ARG;
+ }
+
+ uint32_t idat_ofs = 0, idat_len = 0;
+ int status = fpng_get_info_internal(pImage, image_size, width, height, channels_in_file, idat_ofs, idat_len);
+ if (status)
+ return status;
+
+ const uint64_t mem_needed = (uint64_t)width * height * desired_channels;
+ if (mem_needed > UINT32_MAX)
+ return FPNG_DECODE_FAILED_DIMENSIONS_TOO_LARGE;
+
+ // On 32-bit systems do a quick sanity check before we try to resize the output buffer.
+ if ((sizeof(size_t) == sizeof(uint32_t)) && (mem_needed >= 0x80000000))
+ return FPNG_DECODE_FAILED_DIMENSIONS_TOO_LARGE;
+
+ out.resize(mem_needed);
+
+ const uint8_t* pIDAT_data = static_cast(pImage) + idat_ofs + sizeof(uint32_t) * 2;
+ const uint32_t src_len = image_size - (idat_ofs + sizeof(uint32_t) * 2);
+
+ bool decomp_status;
+ if (desired_channels == 3)
+ {
+ if (channels_in_file == 3)
+ decomp_status = fpng_pixel_zlib_decompress_3<3>(pIDAT_data, src_len, idat_len, out.data(), width, height);
+ else
+ decomp_status = fpng_pixel_zlib_decompress_4<3>(pIDAT_data, src_len, idat_len, out.data(), width, height);
+ }
+ else
+ {
+ if (channels_in_file == 3)
+ decomp_status = fpng_pixel_zlib_decompress_3<4>(pIDAT_data, src_len, idat_len, out.data(), width, height);
+ else
+ decomp_status = fpng_pixel_zlib_decompress_4<4>(pIDAT_data, src_len, idat_len, out.data(), width, height);
+ }
+ if (!decomp_status)
+ {
+ // Something went wrong. Either the file data was corrupted, or it doesn't conform to one of our zlib/Deflate constraints.
+ // The conservative thing to do is indicate it wasn't written by us, and let the general purpose PNG decoder handle it.
+ return FPNG_DECODE_NOT_FPNG;
+ }
+
+ return FPNG_DECODE_SUCCESS;
+ }
+
+#ifndef FPNG_NO_STDIO
+ int fpng_decode_file(const char* pFilename, std::vector& out, uint32_t& width, uint32_t& height, uint32_t& channels_in_file, uint32_t desired_channels)
+ {
+ FILE* pFile = nullptr;
+
+#ifdef _MSC_VER
+ fopen_s(&pFile, pFilename, "rb");
+#else
+ pFile = fopen(pFilename, "rb");
+#endif
+
+ if (!pFile)
+ return FPNG_DECODE_FILE_OPEN_FAILED;
+
+ if (fseek(pFile, 0, SEEK_END) != 0)
+ {
+ fclose(pFile);
+ return FPNG_DECODE_FILE_SEEK_FAILED;
+ }
+
+#ifdef _WIN32
+ int64_t filesize = _ftelli64(pFile);
+#else
+ int64_t filesize = ftello(pFile);
+#endif
+
+ if (fseek(pFile, 0, SEEK_SET) != 0)
+ {
+ fclose(pFile);
+ return FPNG_DECODE_FILE_SEEK_FAILED;
+ }
+
+ if ( (filesize < 0) || (filesize > UINT32_MAX) || ( (sizeof(size_t) == sizeof(uint32_t)) && (filesize > 0x70000000) ) )
+ {
+ fclose(pFile);
+ return FPNG_DECODE_FILE_TOO_LARGE;
+ }
+
+ std::vector buf((size_t)filesize);
+ if (fread(buf.data(), 1, buf.size(), pFile) != buf.size())
+ {
+ fclose(pFile);
+ return FPNG_DECODE_FILE_READ_FAILED;
+ }
+
+ fclose(pFile);
+
+ return fpng_decode_memory(buf.data(), (uint32_t)buf.size(), out, width, height, channels_in_file, desired_channels);
+ }
+#endif
+
+} // namespace fpng
+
+/*
+ This is free and unencumbered software released into the public domain.
+
+ Anyone is free to copy, modify, publish, use, compile, sell, or
+ distribute this software, either in source code form or as a compiled
+ binary, for any purpose, commercial or non-commercial, and by any
+ means.
+
+ In jurisdictions that recognize copyright laws, the author or authors
+ of this software dedicate any and all copyright interest in the
+ software to the public domain. We make this dedication for the benefit
+ of the public at large and to the detriment of our heirs and
+ successors. We intend this dedication to be an overt act of
+ relinquishment in perpetuity of all present and future rights to this
+ software under copyright law.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+ For more information, please refer to
+
+ Richard Geldreich, Jr.
+ 12/30/2021
+*/
diff --git a/third-party/fpng/fpng.h b/third-party/fpng/fpng.h
new file mode 100644
index 0000000000..c9384a9c12
--- /dev/null
+++ b/third-party/fpng/fpng.h
@@ -0,0 +1,109 @@
+// fpng.h - unlicense (see end of fpng.cpp)
+#pragma once
+
+#include
+#include
+#include
+
+namespace fpng
+{
+ // ---- Library initialization - call once to identify if the process supports SSE.
+ // Otherwise you'll only get scalar fallbacks.
+ void fpng_init();
+
+ // ---- Useful Utilities
+
+ // Returns true if the CPU supports SSE 4.1, and SSE support wasn't disabled by setting FPNG_NO_SSE=1.
+ // fpng_init() must have been called first, or it'll assert and return false.
+ bool fpng_cpu_supports_sse41();
+
+ // Fast CRC-32 SSE4.1+pclmul or a scalar fallback (slice by 4)
+ const uint32_t FPNG_CRC32_INIT = 0;
+ uint32_t fpng_crc32(const void* pData, size_t size, uint32_t prev_crc32 = FPNG_CRC32_INIT);
+
+ // Fast Adler32 SSE4.1 Adler-32 with a scalar fallback.
+ const uint32_t FPNG_ADLER32_INIT = 1;
+ uint32_t fpng_adler32(const uint8_t* ptr, size_t buf_len, uint32_t adler = FPNG_ADLER32_INIT);
+
+ // ---- Compression
+ enum
+ {
+ // Enables computing custom Huffman tables for each file, instead of using the custom global tables.
+ // Results in roughly 6% smaller files on average, but compression is around 40% slower.
+ FPNG_ENCODE_SLOWER = 1,
+
+ // Only use raw Deflate blocks (no compression at all). Intended for testing.
+ FPNG_FORCE_UNCOMPRESSED = 2,
+ };
+
+ // Fast PNG encoding. The resulting file can be decoded either using a standard PNG decoder or by the fpng_decode_memory() function below.
+ // pImage: pointer to RGB or RGBA image pixels, R first in memory, B/A last.
+ // w/h - image dimensions. Image's row pitch in bytes must is w*num_chans.
+ // num_chans must be 3 or 4.
+ bool fpng_encode_image_to_memory(const void* pImage, uint32_t w, uint32_t h, uint32_t num_chans, std::vector& out_buf, uint32_t flags = 0);
+
+#ifndef FPNG_NO_STDIO
+ // Fast PNG encoding to the specified file.
+ bool fpng_encode_image_to_file(const char* pFilename, const void* pImage, uint32_t w, uint32_t h, uint32_t num_chans, uint32_t flags = 0);
+#endif
+
+ // ---- Decompression
+
+ enum
+ {
+ FPNG_DECODE_SUCCESS = 0, // file is a valid PNG file and written by FPNG and the decode succeeded
+
+ FPNG_DECODE_NOT_FPNG, // file is a valid PNG file, but it wasn't written by FPNG so you should try decoding it with a general purpose PNG decoder
+
+ FPNG_DECODE_INVALID_ARG, // invalid function parameter
+
+ FPNG_DECODE_FAILED_NOT_PNG, // file cannot be a PNG file
+ FPNG_DECODE_FAILED_HEADER_CRC32, // a chunk CRC32 check failed, file is likely corrupted or not PNG
+ FPNG_DECODE_FAILED_INVALID_DIMENSIONS, // invalid image dimensions in IHDR chunk (0 or too large)
+ FPNG_DECODE_FAILED_DIMENSIONS_TOO_LARGE, // decoding the file fully into memory would likely require too much memory (only on 32bpp builds)
+ FPNG_DECODE_FAILED_CHUNK_PARSING, // failed while parsing the chunk headers, or file is corrupted
+ FPNG_DECODE_FAILED_INVALID_IDAT, // IDAT data length is too small and cannot be valid, file is either corrupted or it's a bug
+
+ // fpng_decode_file() specific errors
+ FPNG_DECODE_FILE_OPEN_FAILED,
+ FPNG_DECODE_FILE_TOO_LARGE,
+ FPNG_DECODE_FILE_READ_FAILED,
+ FPNG_DECODE_FILE_SEEK_FAILED
+ };
+
+ // Fast PNG decoding of files ONLY created by fpng_encode_image_to_memory() or fpng_encode_image_to_file().
+ // If fpng_get_info() or fpng_decode_memory() returns FPNG_DECODE_NOT_FPNG, you should decode the PNG by falling back to a general purpose decoder.
+ //
+ // fpng_get_info() parses the PNG header and iterates through all chunks to determine if it's a file written by FPNG, but does not decompress the actual image data so it's relatively fast.
+ //
+ // pImage, image_size: Pointer to PNG image data and its size
+ // width, height: output image's dimensions
+ // channels_in_file: will be 3 or 4
+ //
+ // Returns FPNG_DECODE_SUCCESS on success, otherwise one of the failure codes above.
+ // If FPNG_DECODE_NOT_FPNG is returned, you must decompress the file with a general purpose PNG decoder.
+ // If another error occurs, the file is likely corrupted or invalid, but you can still try to decompress the file with another decoder (which will likely fail).
+ int fpng_get_info(const void* pImage, uint32_t image_size, uint32_t& width, uint32_t& height, uint32_t& channels_in_file);
+
+ // fpng_decode_memory() decompresses 24/32bpp PNG files ONLY encoded by this module.
+ // If the image was written by FPNG, it will decompress the image data, otherwise it will return FPNG_DECODE_NOT_FPNG in which case you should fall back to a general purpose PNG decoder (lodepng, stb_image, libpng, etc.)
+ //
+ // pImage, image_size: Pointer to PNG image data and its size
+ // out: Output 24/32bpp image buffer
+ // width, height: output image's dimensions
+ // channels_in_file: will be 3 or 4
+ // desired_channels: must be 3 or 4
+ //
+ // If the image is 24bpp and 32bpp is requested, the alpha values will be set to 0xFF.
+ // If the image is 32bpp and 24bpp is requested, the alpha values will be discarded.
+ //
+ // Returns FPNG_DECODE_SUCCESS on success, otherwise one of the failure codes above.
+ // If FPNG_DECODE_NOT_FPNG is returned, you must decompress the file with a general purpose PNG decoder.
+ // If another error occurs, the file is likely corrupted or invalid, but you can still try to decompress the file with another decoder (which will likely fail).
+ int fpng_decode_memory(const void* pImage, uint32_t image_size, std::vector& out, uint32_t& width, uint32_t& height, uint32_t& channels_in_file, uint32_t desired_channels);
+
+#ifndef FPNG_NO_STDIO
+ int fpng_decode_file(const char* pFilename, std::vector& out, uint32_t& width, uint32_t& height, uint32_t& channels_in_file, uint32_t desired_channels);
+#endif
+
+} // namespace fpng
diff --git a/third-party/svpng.h b/third-party/svpng.h
deleted file mode 100644
index 0a74595106..0000000000
--- a/third-party/svpng.h
+++ /dev/null
@@ -1,103 +0,0 @@
-#pragma once
-
-#include
-
-/*
-Copyright (C) 2017 Milo Yip. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of pngout nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-inline void svpng(FILE* fp, unsigned w, unsigned h, const unsigned char* img, int alpha) {
- static const unsigned t[] = {0, 0x1db71064, 0x3b6e20c8, 0x26d930ac,
- 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c,
- 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c,
- 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c};
- unsigned a = 1, b = 0, c, p = w * (alpha ? 4 : 3) + 1, x, y, i; /* ADLER-a, ADLER-b, CRC, pitch */
-#define SVPNG_PUT(u) fputc(u, fp)
-#define SVPNG_U8A(ua, l) \
- for (i = 0; i < l; i++) \
- SVPNG_PUT((ua)[i]);
-#define SVPNG_U32(u) \
- do { \
- SVPNG_PUT((u) >> 24); \
- SVPNG_PUT(((u) >> 16) & 255); \
- SVPNG_PUT(((u) >> 8) & 255); \
- SVPNG_PUT((u)&255); \
- } while (0)
-#define SVPNG_U8C(u) \
- do { \
- SVPNG_PUT(u); \
- c ^= (u); \
- c = (c >> 4) ^ t[c & 15]; \
- c = (c >> 4) ^ t[c & 15]; \
- } while (0)
-#define SVPNG_U8AC(ua, l) \
- for (i = 0; i < l; i++) \
- SVPNG_U8C((ua)[i])
-#define SVPNG_U16LC(u) \
- do { \
- SVPNG_U8C((u)&255); \
- SVPNG_U8C(((u) >> 8) & 255); \
- } while (0)
-#define SVPNG_U32C(u) \
- do { \
- SVPNG_U8C((u) >> 24); \
- SVPNG_U8C(((u) >> 16) & 255); \
- SVPNG_U8C(((u) >> 8) & 255); \
- SVPNG_U8C((u)&255); \
- } while (0)
-#define SVPNG_U8ADLER(u) \
- do { \
- SVPNG_U8C(u); \
- a = (a + (u)) % 65521; \
- b = (b + a) % 65521; \
- } while (0)
-#define SVPNG_BEGIN(s, l) \
- do { \
- SVPNG_U32(l); \
- c = ~0U; \
- SVPNG_U8AC(s, 4); \
- } while (0)
-#define SVPNG_END() SVPNG_U32(~c)
- SVPNG_U8A("\x89PNG\r\n\32\n", 8); /* Magic */
- SVPNG_BEGIN("IHDR", 13); /* IHDR chunk { */
- SVPNG_U32C(w);
- SVPNG_U32C(h); /* Width & Height (8 bytes) */
- SVPNG_U8C(8);
- SVPNG_U8C(alpha ? 6 : 2); /* Depth=8, Color=True color with/without alpha (2 bytes) */
- SVPNG_U8AC("\0\0\0", 3); /* Compression=Deflate, Filter=No, Interlace=No (3 bytes) */
- SVPNG_END(); /* } */
- SVPNG_BEGIN("IDAT", 2 + h * (5 + p) + 4); /* IDAT chunk { */
- SVPNG_U8AC("\x78\1", 2); /* Deflate block begin (2 bytes) */
- for (y = 0; y < h; y++) { /* Each horizontal line makes a block for simplicity */
- SVPNG_U8C(y == h - 1); /* 1 for the last block, 0 for others (1 byte) */
- SVPNG_U16LC(p);
- SVPNG_U16LC(~p); /* Size of block in little endian and its 1's complement (4 bytes) */
- SVPNG_U8ADLER(0); /* No filter prefix (1 byte) */
- for (x = 0; x < p - 1; x++, img++)
- SVPNG_U8ADLER(*img); /* Image pixel data */
- }
- SVPNG_U32C((b << 16) | a); /* Deflate block end with adler (4 bytes) */
- SVPNG_END(); /* } */
- SVPNG_BEGIN("IEND", 0);
- SVPNG_END(); /* IEND chunk {} */
-}
diff --git a/vendor.txt b/vendor.txt
deleted file mode 100644
index 2e30ca52cf..0000000000
--- a/vendor.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-third-party/glfw: df8d7bc892937a8b0f7c604c92a9f64f383cf48c
-third-party/googletest: 14aa11db02d9851d957f93ef9fddb110c1aafdc6
-third-party/zydis: 562a7c1e5f2c5017ea882ad0aa3360c465a3eb8f
diff --git a/vendor.yaml b/vendor.yaml
new file mode 100644
index 0000000000..48935e61b7
--- /dev/null
+++ b/vendor.yaml
@@ -0,0 +1,10 @@
+third-party/glfw:
+ sha: df8d7bc892937a8b0f7c604c92a9f64f383cf48c
+third-party/googletest:
+ sha: 14aa11db02d9851d957f93ef9fddb110c1aafdc6
+third-party/zydis:
+ sha: 562a7c1e5f2c5017ea882ad0aa3360c465a3eb8f
+third-party/discord-rpc:
+ sha: 963aa9f3e5ce81a4682c6ca3d136cddda614db33
+third-party/fng:
+ sha: bfe5f9c69e93b99b31268c10db8e645c9125a07f